mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-24 21:34:06 -06:00
3 lines
39 KiB
JavaScript
3 lines
39 KiB
JavaScript
var et=Object.create;var ge=Object.defineProperty;var rt=Object.getOwnPropertyDescriptor;var tt=Object.getOwnPropertyNames;var nt=Object.getPrototypeOf,ot=Object.prototype.hasOwnProperty;var ke=g=>ge(g,"__esModule",{value:!0});var er=(g,p)=>()=>(p||g((p={exports:{}}).exports,p),p.exports),it=(g,p)=>{for(var R in p)ge(g,R,{get:p[R],enumerable:!0})},re=(g,p,R,L)=>{if(p&&typeof p=="object"||typeof p=="function")for(let M of tt(p))!ot.call(g,M)&&(R||M!=="default")&&ge(g,M,{get:()=>p[M],enumerable:!(L=rt(p,M))||L.enumerable});return g},rr=(g,p)=>re(ke(ge(g!=null?et(nt(g)):{},"default",!p&&g&&g.__esModule?{get:()=>g.default,enumerable:!0}:{value:g,enumerable:!0})),g),at=(g=>(p,R)=>g&&g.get(p)||(R=re(ke({}),p,1),g&&g.set(p,R),R))(typeof WeakMap!="undefined"?new WeakMap:0);var de=(g,p,R)=>new Promise((L,M)=>{var Q=S=>{try{Y(R.next(S))}catch(P){M(P)}},C=S=>{try{Y(R.throw(S))}catch(P){M(P)}},Y=S=>S.done?L(S.value):Promise.resolve(S.value).then(Q,C);Y((R=R.apply(g,p)).next())});var nr=er((tr,xe)=>{(function(g){if(typeof tr=="object"&&typeof xe!="undefined")xe.exports=g();else if(typeof define=="function"&&define.amd)define([],g);else{var p;typeof window!="undefined"?p=window:typeof global!="undefined"?p=global:typeof self!="undefined"?p=self:p=this,p.localforage=g()}})(function(){var g,p,R;return function L(M,Q,C){function Y(K,Z){if(!Q[K]){if(!M[K]){var m=typeof require=="function"&&require;if(!Z&&m)return m(K,!0);if(S)return S(K,!0);var w=new Error("Cannot find module '"+K+"'");throw w.code="MODULE_NOT_FOUND",w}var T=Q[K]={exports:{}};M[K][0].call(T.exports,function(z){var q=M[K][1][z];return Y(q||z)},T,T.exports,L,M,Q,C)}return Q[K].exports}for(var S=typeof require=="function"&&require,P=0;P<C.length;P++)Y(C[P]);return Y}({1:[function(L,M,Q){(function(C){"use strict";var Y=C.MutationObserver||C.WebKitMutationObserver,S;if(Y){var P=0,K=new Y(z),Z=C.document.createTextNode("");K.observe(Z,{characterData:!0}),S=function(){Z.data=P=++P%2}}else if(!C.setImmediate&&typeof C.MessageChannel!="undefined"){var m=new C.MessageChannel;m.port1.onmessage=z,S=function(){m.port2.postMessage(0)}}else"document"in C&&"onreadystatechange"in C.document.createElement("script")?S=function(){var F=C.document.createElement("script");F.onreadystatechange=function(){z(),F.onreadystatechange=null,F.parentNode.removeChild(F),F=null},C.document.documentElement.appendChild(F)}:S=function(){setTimeout(z,0)};var w,T=[];function z(){w=!0;for(var F,k,U=T.length;U;){for(k=T,T=[],F=-1;++F<U;)k[F]();U=T.length}w=!1}M.exports=q;function q(F){T.push(F)===1&&!w&&S()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(L,M,Q){"use strict";var C=L(1);function Y(){}var S={},P=["REJECTED"],K=["FULFILLED"],Z=["PENDING"];M.exports=m;function m(h){if(typeof h!="function")throw new TypeError("resolver must be a function");this.state=Z,this.queue=[],this.outcome=void 0,h!==Y&&q(this,h)}m.prototype.catch=function(h){return this.then(null,h)},m.prototype.then=function(h,D){if(typeof h!="function"&&this.state===K||typeof D!="function"&&this.state===P)return this;var I=new this.constructor(Y);if(this.state!==Z){var x=this.state===K?h:D;T(I,x,this.outcome)}else this.queue.push(new w(I,h,D));return I};function w(h,D,I){this.promise=h,typeof D=="function"&&(this.onFulfilled=D,this.callFulfilled=this.otherCallFulfilled),typeof I=="function"&&(this.onRejected=I,this.callRejected=this.otherCallRejected)}w.prototype.callFulfilled=function(h){S.resolve(this.promise,h)},w.prototype.otherCallFulfilled=function(h){T(this.promise,this.onFulfilled,h)},w.prototype.callRejected=function(h){S.reject(this.promise,h)},w.prototype.otherCallRejected=function(h){T(this.promise,this.onRejected,h)};function T(h,D,I){C(function(){var x;try{x=D(I)}catch(H){return S.reject(h,H)}x===h?S.reject(h,new TypeError("Cannot resolve promise with itself")):S.resolve(h,x)})}S.resolve=function(h,D){var I=F(z,D);if(I.status==="error")return S.reject(h,I.value);var x=I.value;if(x)q(h,x);else{h.state=K,h.outcome=D;for(var H=-1,j=h.queue.length;++H<j;)h.queue[H].callFulfilled(D)}return h},S.reject=function(h,D){h.state=P,h.outcome=D;for(var I=-1,x=h.queue.length;++I<x;)h.queue[I].callRejected(D);return h};function z(h){var D=h&&h.then;if(h&&(typeof h=="object"||typeof h=="function")&&typeof D=="function")return function(){D.apply(h,arguments)}}function q(h,D){var I=!1;function x($){I||(I=!0,S.reject(h,$))}function H($){I||(I=!0,S.resolve(h,$))}function j(){D(H,x)}var J=F(j);J.status==="error"&&x(J.value)}function F(h,D){var I={};try{I.value=h(D),I.status="success"}catch(x){I.status="error",I.value=x}return I}m.resolve=k;function k(h){return h instanceof this?h:S.resolve(new this(Y),h)}m.reject=U;function U(h){var D=new this(Y);return S.reject(D,h)}m.all=se;function se(h){var D=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var I=h.length,x=!1;if(!I)return this.resolve([]);for(var H=new Array(I),j=0,J=-1,$=new this(Y);++J<I;)ee(h[J],J);return $;function ee(fe,a){D.resolve(fe).then(s,function(v){x||(x=!0,S.reject($,v))});function s(v){H[a]=v,++j===I&&!x&&(x=!0,S.resolve($,H))}}}m.race=ne;function ne(h){var D=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var I=h.length,x=!1;if(!I)return this.resolve([]);for(var H=-1,j=new this(Y);++H<I;)J(h[H]);return j;function J($){D.resolve($).then(function(ee){x||(x=!0,S.resolve(j,ee))},function(ee){x||(x=!0,S.reject(j,ee))})}}},{"1":1}],3:[function(L,M,Q){(function(C){"use strict";typeof C.Promise!="function"&&(C.Promise=L(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"2":2}],4:[function(L,M,Q){"use strict";var C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function Y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch{return}}var P=S();function K(){try{if(!P||!P.open)return!1;var e=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!e||t)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch{return!1}}function Z(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(n){if(n.name!=="TypeError")throw n;for(var r=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,o=new r,i=0;i<e.length;i+=1)o.append(e[i]);return o.getBlob(t.type)}}typeof Promise=="undefined"&&L(3);var m=Promise;function w(e,t){t&&e.then(function(r){t(null,r)},function(r){t(r)})}function T(e,t,r){typeof t=="function"&&e.then(t),typeof r=="function"&&e.catch(r)}function z(e){return typeof e!="string"&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function q(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var F="local-forage-detect-blob-support",k=void 0,U={},se=Object.prototype.toString,ne="readonly",h="readwrite";function D(e){for(var t=e.length,r=new ArrayBuffer(t),o=new Uint8Array(r),i=0;i<t;i++)o[i]=e.charCodeAt(i);return r}function I(e){return new m(function(t){var r=e.transaction(F,h),o=Z([""]);r.objectStore(F).put(o,"key"),r.onabort=function(i){i.preventDefault(),i.stopPropagation(),t(!1)},r.oncomplete=function(){var i=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!i||parseInt(i[1],10)>=43)}}).catch(function(){return!1})}function x(e){return typeof k=="boolean"?m.resolve(k):I(e).then(function(t){return k=t,k})}function H(e){var t=U[e.name],r={};r.promise=new m(function(o,i){r.resolve=o,r.reject=i}),t.deferredOperations.push(r),t.dbReady?t.dbReady=t.dbReady.then(function(){return r.promise}):t.dbReady=r.promise}function j(e){var t=U[e.name],r=t.deferredOperations.pop();if(r)return r.resolve(),r.promise}function J(e,t){var r=U[e.name],o=r.deferredOperations.pop();if(o)return o.reject(t),o.promise}function $(e,t){return new m(function(r,o){if(U[e.name]=U[e.name]||G(),e.db)if(t)H(e),e.db.close();else return r(e.db);var i=[e.name];t&&i.push(e.version);var n=P.open.apply(P,i);t&&(n.onupgradeneeded=function(f){var u=n.result;try{u.createObjectStore(e.storeName),f.oldVersion<=1&&u.createObjectStore(F)}catch(c){if(c.name==="ConstraintError")console.warn('The database "'+e.name+'" has been upgraded from version '+f.oldVersion+" to version "+f.newVersion+', but the storage "'+e.storeName+'" already exists.');else throw c}}),n.onerror=function(f){f.preventDefault(),o(n.error)},n.onsuccess=function(){r(n.result),j(e)}})}function ee(e){return $(e,!1)}function fe(e){return $(e,!0)}function a(e,t){if(!e.db)return!0;var r=!e.db.objectStoreNames.contains(e.storeName),o=e.version<e.db.version,i=e.version>e.db.version;if(o&&(e.version!==t&&console.warn('The database "'+e.name+`" can't be downgraded from version `+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||r){if(r){var n=e.db.version+1;n>e.version&&(e.version=n)}return!0}return!1}function s(e){return new m(function(t,r){var o=new FileReader;o.onerror=r,o.onloadend=function(i){var n=btoa(i.target.result||"");t({__local_forage_encoded_blob:!0,data:n,type:e.type})},o.readAsBinaryString(e)})}function v(e){var t=D(atob(e.data));return Z([t],{type:e.type})}function b(e){return e&&e.__local_forage_encoded_blob}function _(e){var t=this,r=t._initReady().then(function(){var o=U[t._dbInfo.name];if(o&&o.dbReady)return o.dbReady});return T(r,e,e),r}function E(e){H(e);for(var t=U[e.name],r=t.forages,o=0;o<r.length;o++){var i=r[o];i._dbInfo.db&&(i._dbInfo.db.close(),i._dbInfo.db=null)}return e.db=null,ee(e).then(function(n){return e.db=n,a(e)?fe(e):n}).then(function(n){e.db=t.db=n;for(var f=0;f<r.length;f++)r[f]._dbInfo.db=n}).catch(function(n){throw J(e,n),n})}function N(e,t,r,o){o===void 0&&(o=1);try{var i=e.db.transaction(e.storeName,t);r(null,i)}catch(n){if(o>0&&(!e.db||n.name==="InvalidStateError"||n.name==="NotFoundError"))return m.resolve().then(function(){if(!e.db||n.name==="NotFoundError"&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),fe(e)}).then(function(){return E(e).then(function(){N(e,t,r,o-1)})}).catch(r);r(n)}}function G(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function ce(e){var t=this,r={db:null};if(e)for(var o in e)r[o]=e[o];var i=U[r.name];i||(i=G(),U[r.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=_);var n=[];function f(){return m.resolve()}for(var u=0;u<i.forages.length;u++){var c=i.forages[u];c!==t&&n.push(c._initReady().catch(f))}var l=i.forages.slice(0);return m.all(n).then(function(){return r.db=i.db,ee(r)}).then(function(d){return r.db=d,a(r,t._defaultConfig.version)?fe(r):d}).then(function(d){r.db=i.db=d,t._dbInfo=r;for(var y=0;y<l.length;y++){var A=l[y];A!==t&&(A._dbInfo.db=r.db,A._dbInfo.version=r.version)}})}function ue(e,t){var r=this;e=z(e);var o=new m(function(i,n){r.ready().then(function(){N(r._dbInfo,ne,function(f,u){if(f)return n(f);try{var c=u.objectStore(r._dbInfo.storeName),l=c.get(e);l.onsuccess=function(){var d=l.result;d===void 0&&(d=null),b(d)&&(d=v(d)),i(d)},l.onerror=function(){n(l.error)}}catch(d){n(d)}})}).catch(n)});return w(o,t),o}function ve(e,t){var r=this,o=new m(function(i,n){r.ready().then(function(){N(r._dbInfo,ne,function(f,u){if(f)return n(f);try{var c=u.objectStore(r._dbInfo.storeName),l=c.openCursor(),d=1;l.onsuccess=function(){var y=l.result;if(y){var A=y.value;b(A)&&(A=v(A));var B=e(A,y.key,d++);B!==void 0?i(B):y.continue()}else i()},l.onerror=function(){n(l.error)}}catch(y){n(y)}})}).catch(n)});return w(o,t),o}function ar(e,t,r){var o=this;e=z(e);var i=new m(function(n,f){var u;o.ready().then(function(){return u=o._dbInfo,se.call(t)==="[object Blob]"?x(u.db).then(function(c){return c?t:s(t)}):t}).then(function(c){N(o._dbInfo,h,function(l,d){if(l)return f(l);try{var y=d.objectStore(o._dbInfo.storeName);c===null&&(c=void 0);var A=y.put(c,e);d.oncomplete=function(){c===void 0&&(c=null),n(c)},d.onabort=d.onerror=function(){var B=A.error?A.error:A.transaction.error;f(B)}}catch(B){f(B)}})}).catch(f)});return w(i,r),i}function fr(e,t){var r=this;e=z(e);var o=new m(function(i,n){r.ready().then(function(){N(r._dbInfo,h,function(f,u){if(f)return n(f);try{var c=u.objectStore(r._dbInfo.storeName),l=c.delete(e);u.oncomplete=function(){i()},u.onerror=function(){n(l.error)},u.onabort=function(){var d=l.error?l.error:l.transaction.error;n(d)}}catch(d){n(d)}})}).catch(n)});return w(o,t),o}function ur(e){var t=this,r=new m(function(o,i){t.ready().then(function(){N(t._dbInfo,h,function(n,f){if(n)return i(n);try{var u=f.objectStore(t._dbInfo.storeName),c=u.clear();f.oncomplete=function(){o()},f.onabort=f.onerror=function(){var l=c.error?c.error:c.transaction.error;i(l)}}catch(l){i(l)}})}).catch(i)});return w(r,e),r}function sr(e){var t=this,r=new m(function(o,i){t.ready().then(function(){N(t._dbInfo,ne,function(n,f){if(n)return i(n);try{var u=f.objectStore(t._dbInfo.storeName),c=u.count();c.onsuccess=function(){o(c.result)},c.onerror=function(){i(c.error)}}catch(l){i(l)}})}).catch(i)});return w(r,e),r}function cr(e,t){var r=this,o=new m(function(i,n){if(e<0){i(null);return}r.ready().then(function(){N(r._dbInfo,ne,function(f,u){if(f)return n(f);try{var c=u.objectStore(r._dbInfo.storeName),l=!1,d=c.openKeyCursor();d.onsuccess=function(){var y=d.result;if(!y){i(null);return}e===0||l?i(y.key):(l=!0,y.advance(e))},d.onerror=function(){n(d.error)}}catch(y){n(y)}})}).catch(n)});return w(o,t),o}function lr(e){var t=this,r=new m(function(o,i){t.ready().then(function(){N(t._dbInfo,ne,function(n,f){if(n)return i(n);try{var u=f.objectStore(t._dbInfo.storeName),c=u.openKeyCursor(),l=[];c.onsuccess=function(){var d=c.result;if(!d){o(l);return}l.push(d.key),d.continue()},c.onerror=function(){i(c.error)}}catch(d){i(d)}})}).catch(i)});return w(r,e),r}function dr(e,t){t=q.apply(this,arguments);var r=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var o=this,i;if(!e.name)i=m.reject("Invalid arguments");else{var n=e.name===r.name&&o._dbInfo.db,f=n?m.resolve(o._dbInfo.db):ee(e).then(function(u){var c=U[e.name],l=c.forages;c.db=u;for(var d=0;d<l.length;d++)l[d]._dbInfo.db=u;return u});e.storeName?i=f.then(function(u){if(!!u.objectStoreNames.contains(e.storeName)){var c=u.version+1;H(e);var l=U[e.name],d=l.forages;u.close();for(var y=0;y<d.length;y++){var A=d[y];A._dbInfo.db=null,A._dbInfo.version=c}var B=new m(function(O,V){var W=P.open(e.name,c);W.onerror=function(X){var me=W.result;me.close(),V(X)},W.onupgradeneeded=function(){var X=W.result;X.deleteObjectStore(e.storeName)},W.onsuccess=function(){var X=W.result;X.close(),O(X)}});return B.then(function(O){l.db=O;for(var V=0;V<d.length;V++){var W=d[V];W._dbInfo.db=O,j(W._dbInfo)}}).catch(function(O){throw(J(e,O)||m.resolve()).catch(function(){}),O})}}):i=f.then(function(u){H(e);var c=U[e.name],l=c.forages;u.close();for(var d=0;d<l.length;d++){var y=l[d];y._dbInfo.db=null}var A=new m(function(B,O){var V=P.deleteDatabase(e.name);V.onerror=V.onblocked=function(W){var X=V.result;X&&X.close(),O(W)},V.onsuccess=function(){var W=V.result;W&&W.close(),B(W)}});return A.then(function(B){c.db=B;for(var O=0;O<l.length;O++){var V=l[O];j(V._dbInfo)}}).catch(function(B){throw(J(e,B)||m.resolve()).catch(function(){}),B})})}return w(i,t),i}var vr={_driver:"asyncStorage",_initStorage:ce,_support:K(),iterate:ve,getItem:ue,setItem:ar,removeItem:fr,clear:ur,length:sr,key:cr,keys:lr,dropInstance:dr};function hr(){return typeof openDatabase=="function"}var ie="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",mr="~~local_forage_type~",Le=/^~~local_forage_type~([^~]+)~/,ye="__lfsc__:",Ee=ye.length,Ie="arbf",Se="blob",Pe="si08",Me="ui08",Fe="uic8",Ue="si16",Ye="si32",ze="ur16",We="ui32",Ke="fl32",He="fl64",Ve=Ee+Ie.length,Ge=Object.prototype.toString;function je(e){var t=e.length*.75,r=e.length,o,i=0,n,f,u,c;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);var l=new ArrayBuffer(t),d=new Uint8Array(l);for(o=0;o<r;o+=4)n=ie.indexOf(e[o]),f=ie.indexOf(e[o+1]),u=ie.indexOf(e[o+2]),c=ie.indexOf(e[o+3]),d[i++]=n<<2|f>>4,d[i++]=(f&15)<<4|u>>2,d[i++]=(u&3)<<6|c&63;return l}function Ae(e){var t=new Uint8Array(e),r="",o;for(o=0;o<t.length;o+=3)r+=ie[t[o]>>2],r+=ie[(t[o]&3)<<4|t[o+1]>>4],r+=ie[(t[o+1]&15)<<2|t[o+2]>>6],r+=ie[t[o+2]&63];return t.length%3===2?r=r.substring(0,r.length-1)+"=":t.length%3===1&&(r=r.substring(0,r.length-2)+"=="),r}function yr(e,t){var r="";if(e&&(r=Ge.call(e)),e&&(r==="[object ArrayBuffer]"||e.buffer&&Ge.call(e.buffer)==="[object ArrayBuffer]")){var o,i=ye;e instanceof ArrayBuffer?(o=e,i+=Ie):(o=e.buffer,r==="[object Int8Array]"?i+=Pe:r==="[object Uint8Array]"?i+=Me:r==="[object Uint8ClampedArray]"?i+=Fe:r==="[object Int16Array]"?i+=Ue:r==="[object Uint16Array]"?i+=ze:r==="[object Int32Array]"?i+=Ye:r==="[object Uint32Array]"?i+=We:r==="[object Float32Array]"?i+=Ke:r==="[object Float64Array]"?i+=He:t(new Error("Failed to get type for BinaryArray"))),t(i+Ae(o))}else if(r==="[object Blob]"){var n=new FileReader;n.onload=function(){var f=mr+e.type+"~"+Ae(this.result);t(ye+Se+f)},n.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(f){console.error("Couldn't convert value into a JSON string: ",e),t(null,f)}}function pr(e){if(e.substring(0,Ee)!==ye)return JSON.parse(e);var t=e.substring(Ve),r=e.substring(Ee,Ve),o;if(r===Se&&Le.test(t)){var i=t.match(Le);o=i[1],t=t.substring(i[0].length)}var n=je(t);switch(r){case Ie:return n;case Se:return Z([n],{type:o});case Pe:return new Int8Array(n);case Me:return new Uint8Array(n);case Fe:return new Uint8ClampedArray(n);case Ue:return new Int16Array(n);case ze:return new Uint16Array(n);case Ye:return new Int32Array(n);case We:return new Uint32Array(n);case Ke:return new Float32Array(n);case He:return new Float64Array(n);default:throw new Error("Unkown type: "+r)}}var Re={serialize:yr,deserialize:pr,stringToBuffer:je,bufferToString:Ae};function Xe(e,t,r,o){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,o)}function gr(e){var t=this,r={db:null};if(e)for(var o in e)r[o]=typeof e[o]!="string"?e[o].toString():e[o];var i=new m(function(n,f){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(u){return f(u)}r.db.transaction(function(u){Xe(u,r,function(){t._dbInfo=r,n()},function(c,l){f(l)})},f)});return r.serializer=Re,i}function ae(e,t,r,o,i,n){e.executeSql(r,o,i,function(f,u){u.code===u.SYNTAX_ERR?f.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],function(c,l){l.rows.length?n(c,u):Xe(c,t,function(){c.executeSql(r,o,i,n)},n)},n):n(f,u)},n)}function br(e,t){var r=this;e=z(e);var o=new m(function(i,n){r.ready().then(function(){var f=r._dbInfo;f.db.transaction(function(u){ae(u,f,"SELECT * FROM "+f.storeName+" WHERE key = ? LIMIT 1",[e],function(c,l){var d=l.rows.length?l.rows.item(0).value:null;d&&(d=f.serializer.deserialize(d)),i(d)},function(c,l){n(l)})})}).catch(n)});return w(o,t),o}function _r(e,t){var r=this,o=new m(function(i,n){r.ready().then(function(){var f=r._dbInfo;f.db.transaction(function(u){ae(u,f,"SELECT * FROM "+f.storeName,[],function(c,l){for(var d=l.rows,y=d.length,A=0;A<y;A++){var B=d.item(A),O=B.value;if(O&&(O=f.serializer.deserialize(O)),O=e(O,B.key,A+1),O!==void 0){i(O);return}}i()},function(c,l){n(l)})})}).catch(n)});return w(o,t),o}function Qe(e,t,r,o){var i=this;e=z(e);var n=new m(function(f,u){i.ready().then(function(){t===void 0&&(t=null);var c=t,l=i._dbInfo;l.serializer.serialize(t,function(d,y){y?u(y):l.db.transaction(function(A){ae(A,l,"INSERT OR REPLACE INTO "+l.storeName+" (key, value) VALUES (?, ?)",[e,d],function(){f(c)},function(B,O){u(O)})},function(A){if(A.code===A.QUOTA_ERR){if(o>0){f(Qe.apply(i,[e,c,r,o-1]));return}u(A)}})})}).catch(u)});return w(n,r),n}function wr(e,t,r){return Qe.apply(this,[e,t,r,1])}function Er(e,t){var r=this;e=z(e);var o=new m(function(i,n){r.ready().then(function(){var f=r._dbInfo;f.db.transaction(function(u){ae(u,f,"DELETE FROM "+f.storeName+" WHERE key = ?",[e],function(){i()},function(c,l){n(l)})})}).catch(n)});return w(o,t),o}function Ir(e){var t=this,r=new m(function(o,i){t.ready().then(function(){var n=t._dbInfo;n.db.transaction(function(f){ae(f,n,"DELETE FROM "+n.storeName,[],function(){o()},function(u,c){i(c)})})}).catch(i)});return w(r,e),r}function Sr(e){var t=this,r=new m(function(o,i){t.ready().then(function(){var n=t._dbInfo;n.db.transaction(function(f){ae(f,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],function(u,c){var l=c.rows.item(0).c;o(l)},function(u,c){i(c)})})}).catch(i)});return w(r,e),r}function Ar(e,t){var r=this,o=new m(function(i,n){r.ready().then(function(){var f=r._dbInfo;f.db.transaction(function(u){ae(u,f,"SELECT key FROM "+f.storeName+" WHERE id = ? LIMIT 1",[e+1],function(c,l){var d=l.rows.length?l.rows.item(0).key:null;i(d)},function(c,l){n(l)})})}).catch(n)});return w(o,t),o}function Rr(e){var t=this,r=new m(function(o,i){t.ready().then(function(){var n=t._dbInfo;n.db.transaction(function(f){ae(f,n,"SELECT key FROM "+n.storeName,[],function(u,c){for(var l=[],d=0;d<c.rows.length;d++)l.push(c.rows.item(d).key);o(l)},function(u,c){i(c)})})}).catch(i)});return w(r,e),r}function Dr(e){return new m(function(t,r){e.transaction(function(o){o.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(i,n){for(var f=[],u=0;u<n.rows.length;u++)f.push(n.rows.item(u).name);t({db:e,storeNames:f})},function(i,n){r(n)})},function(o){r(o)})})}function Nr(e,t){t=q.apply(this,arguments);var r=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var o=this,i;return e.name?i=new m(function(n){var f;e.name===r.name?f=o._dbInfo.db:f=openDatabase(e.name,"","",0),e.storeName?n({db:f,storeNames:[e.storeName]}):n(Dr(f))}).then(function(n){return new m(function(f,u){n.db.transaction(function(c){function l(B){return new m(function(O,V){c.executeSql("DROP TABLE IF EXISTS "+B,[],function(){O()},function(W,X){V(X)})})}for(var d=[],y=0,A=n.storeNames.length;y<A;y++)d.push(l(n.storeNames[y]));m.all(d).then(function(){f()}).catch(function(B){u(B)})},function(c){u(c)})})}):i=m.reject("Invalid arguments"),w(i,t),i}var Tr={_driver:"webSQLStorage",_initStorage:gr,_support:hr(),iterate:_r,getItem:br,setItem:wr,removeItem:Er,clear:Ir,length:Sr,key:Ar,keys:Rr,dropInstance:Nr};function Br(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Je(e,t){var r=e.name+"/";return e.storeName!==t.storeName&&(r+=e.storeName+"/"),r}function xr(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}function Or(){return!xr()||localStorage.length>0}function Cr(e){var t=this,r={};if(e)for(var o in e)r[o]=e[o];return r.keyPrefix=Je(e,t._defaultConfig),Or()?(t._dbInfo=r,r.serializer=Re,m.resolve()):m.reject()}function Lr(e){var t=this,r=t.ready().then(function(){for(var o=t._dbInfo.keyPrefix,i=localStorage.length-1;i>=0;i--){var n=localStorage.key(i);n.indexOf(o)===0&&localStorage.removeItem(n)}});return w(r,e),r}function Pr(e,t){var r=this;e=z(e);var o=r.ready().then(function(){var i=r._dbInfo,n=localStorage.getItem(i.keyPrefix+e);return n&&(n=i.serializer.deserialize(n)),n});return w(o,t),o}function Mr(e,t){var r=this,o=r.ready().then(function(){for(var i=r._dbInfo,n=i.keyPrefix,f=n.length,u=localStorage.length,c=1,l=0;l<u;l++){var d=localStorage.key(l);if(d.indexOf(n)===0){var y=localStorage.getItem(d);if(y&&(y=i.serializer.deserialize(y)),y=e(y,d.substring(f),c++),y!==void 0)return y}}});return w(o,t),o}function Fr(e,t){var r=this,o=r.ready().then(function(){var i=r._dbInfo,n;try{n=localStorage.key(e)}catch{n=null}return n&&(n=n.substring(i.keyPrefix.length)),n});return w(o,t),o}function Ur(e){var t=this,r=t.ready().then(function(){for(var o=t._dbInfo,i=localStorage.length,n=[],f=0;f<i;f++){var u=localStorage.key(f);u.indexOf(o.keyPrefix)===0&&n.push(u.substring(o.keyPrefix.length))}return n});return w(r,e),r}function Yr(e){var t=this,r=t.keys().then(function(o){return o.length});return w(r,e),r}function zr(e,t){var r=this;e=z(e);var o=r.ready().then(function(){var i=r._dbInfo;localStorage.removeItem(i.keyPrefix+e)});return w(o,t),o}function Wr(e,t,r){var o=this;e=z(e);var i=o.ready().then(function(){t===void 0&&(t=null);var n=t;return new m(function(f,u){var c=o._dbInfo;c.serializer.serialize(t,function(l,d){if(d)u(d);else try{localStorage.setItem(c.keyPrefix+e,l),f(n)}catch(y){(y.name==="QuotaExceededError"||y.name==="NS_ERROR_DOM_QUOTA_REACHED")&&u(y),u(y)}})})});return w(i,r),i}function Kr(e,t){if(t=q.apply(this,arguments),e=typeof e!="function"&&e||{},!e.name){var r=this.config();e.name=e.name||r.name,e.storeName=e.storeName||r.storeName}var o=this,i;return e.name?i=new m(function(n){e.storeName?n(Je(e,o._defaultConfig)):n(e.name+"/")}).then(function(n){for(var f=localStorage.length-1;f>=0;f--){var u=localStorage.key(f);u.indexOf(n)===0&&localStorage.removeItem(u)}}):i=m.reject("Invalid arguments"),w(i,t),i}var Hr={_driver:"localStorageWrapper",_initStorage:Cr,_support:Br(),iterate:Mr,getItem:Pr,setItem:Wr,removeItem:zr,clear:Lr,length:Yr,key:Fr,keys:Ur,dropInstance:Kr},Vr=function(t,r){return t===r||typeof t=="number"&&typeof r=="number"&&isNaN(t)&&isNaN(r)},Gr=function(t,r){for(var o=t.length,i=0;i<o;){if(Vr(t[i],r))return!0;i++}return!1},$e=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},he={},Ze={},le={INDEXEDDB:vr,WEBSQL:Tr,LOCALSTORAGE:Hr},jr=[le.INDEXEDDB._driver,le.WEBSQL._driver,le.LOCALSTORAGE._driver],pe=["dropInstance"],De=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(pe),Xr={description:"",driver:jr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Qr(e,t){e[t]=function(){var r=arguments;return e.ready().then(function(){return e[t].apply(e,r)})}}function Ne(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var r in t)t.hasOwnProperty(r)&&($e(t[r])?arguments[0][r]=t[r].slice():arguments[0][r]=t[r])}return arguments[0]}var Jr=function(){function e(t){Y(this,e);for(var r in le)if(le.hasOwnProperty(r)){var o=le[r],i=o._driver;this[r]=i,he[i]||this.defineDriver(o)}this._defaultConfig=Ne({},Xr),this._config=Ne({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(r){if((typeof r=="undefined"?"undefined":C(r))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var o in r){if(o==="storeName"&&(r[o]=r[o].replace(/\W/g,"_")),o==="version"&&typeof r[o]!="number")return new Error("Database version must be a number.");this._config[o]=r[o]}return"driver"in r&&r.driver?this.setDriver(this._config.driver):!0}else return typeof r=="string"?this._config[r]:this._config},e.prototype.defineDriver=function(r,o,i){var n=new m(function(f,u){try{var c=r._driver,l=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!r._driver){u(l);return}for(var d=De.concat("_initStorage"),y=0,A=d.length;y<A;y++){var B=d[y],O=!Gr(pe,B);if((O||r[B])&&typeof r[B]!="function"){u(l);return}}var V=function(){for(var me=function(qr){return function(){var kr=new Error("Method "+qr+" is not implemented by the current driver"),qe=m.reject(kr);return w(qe,arguments[arguments.length-1]),qe}},Te=0,Zr=pe.length;Te<Zr;Te++){var Be=pe[Te];r[Be]||(r[Be]=me(Be))}};V();var W=function(me){he[c]&&console.info("Redefining LocalForage driver: "+c),he[c]=r,Ze[c]=me,f()};"_support"in r?r._support&&typeof r._support=="function"?r._support().then(W,u):W(!!r._support):W(!0)}catch(X){u(X)}});return T(n,o,i),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(r,o,i){var n=he[r]?m.resolve(he[r]):m.reject(new Error("Driver not found."));return T(n,o,i),n},e.prototype.getSerializer=function(r){var o=m.resolve(Re);return T(o,r),o},e.prototype.ready=function(r){var o=this,i=o._driverSet.then(function(){return o._ready===null&&(o._ready=o._initDriver()),o._ready});return T(i,r,r),i},e.prototype.setDriver=function(r,o,i){var n=this;$e(r)||(r=[r]);var f=this._getSupportedDrivers(r);function u(){n._config.driver=n.driver()}function c(y){return n._extend(y),u(),n._ready=n._initStorage(n._config),n._ready}function l(y){return function(){var A=0;function B(){for(;A<y.length;){var O=y[A];return A++,n._dbInfo=null,n._ready=null,n.getDriver(O).then(c).catch(B)}u();var V=new Error("No available storage method found.");return n._driverSet=m.reject(V),n._driverSet}return B()}}var d=this._driverSet!==null?this._driverSet.catch(function(){return m.resolve()}):m.resolve();return this._driverSet=d.then(function(){var y=f[0];return n._dbInfo=null,n._ready=null,n.getDriver(y).then(function(A){n._driver=A._driver,u(),n._wrapLibraryMethodsWithReady(),n._initDriver=l(f)})}).catch(function(){u();var y=new Error("No available storage method found.");return n._driverSet=m.reject(y),n._driverSet}),T(this._driverSet,o,i),this._driverSet},e.prototype.supports=function(r){return!!Ze[r]},e.prototype._extend=function(r){Ne(this,r)},e.prototype._getSupportedDrivers=function(r){for(var o=[],i=0,n=r.length;i<n;i++){var f=r[i];this.supports(f)&&o.push(f)}return o},e.prototype._wrapLibraryMethodsWithReady=function(){for(var r=0,o=De.length;r<o;r++)Qr(this,De[r])},e.prototype.createInstance=function(r){return new e(r)},e}(),$r=new Jr;M.exports=$r},{"3":3}]},{},[4])(4)})});var ir=er((be,or)=>{(function(g,p){typeof be=="object"&&typeof or!="undefined"?p(be):typeof define=="function"&&define.amd?define("localforage-driver-memory",["exports"],p):p(g.LocalforageDriverMemory={})})(typeof self!="undefined"?self:be,function(g){"use strict";var p="localforage-driver-memory";function R(a){var s=typeof Symbol=="function"&&a[Symbol.iterator],v=0;return s?s.call(a):{next:function(){return a&&v>=a.length&&(a=void 0),{value:a&&a[v++],done:!a}}}}function L(a,s){a=a||[],s=s||{};try{return new Blob(a,s)}catch(E){if(E.name!=="TypeError")throw E;for(var v=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,b=new v,_=0;_<a.length;_+=1)b.append(a[_]);return b.getBlob(s.type)}}var M=/^~~local_forage_type~([^~]+)~/,Q="__lfsc__:".length,C=Q+"arbf".length,Y=Object.prototype.toString;function S(a){var s=a.length*.75,v=a.length;a[a.length-1]==="="&&(s--,a[a.length-2]==="="&&s--);for(var b=new ArrayBuffer(s),_=new Uint8Array(b),E=0,N=0;E<v;E+=4){var G="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[E]),ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[E+1]),ue="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[E+2]),ve="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(a[E+3]);_[N++]=G<<2|ce>>4,_[N++]=(ce&15)<<4|ue>>2,_[N++]=(ue&3)<<6|ve&63}return b}function P(a){for(var s=new Uint8Array(a),v="",b=0;b<s.length;b+=3)v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[s[b]>>2],v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(s[b]&3)<<4|s[b+1]>>4],v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(s[b+1]&15)<<2|s[b+2]>>6],v+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[s[b+2]&63];return s.length%3===2?v=v.substring(0,v.length-1)+"=":s.length%3===1&&(v=v.substring(0,v.length-2)+"=="),v}function K(a,s){var v="";if(a&&(v=Y.call(a)),a&&(v==="[object ArrayBuffer]"||a.buffer&&Y.call(a.buffer)==="[object ArrayBuffer]")){var b=void 0,_="__lfsc__:";a instanceof ArrayBuffer?(b=a,_+="arbf"):(b=a.buffer,v==="[object Int8Array]"?_+="si08":v==="[object Uint8Array]"?_+="ui08":v==="[object Uint8ClampedArray]"?_+="uic8":v==="[object Int16Array]"?_+="si16":v==="[object Uint16Array]"?_+="ur16":v==="[object Int32Array]"?_+="si32":v==="[object Uint32Array]"?_+="ui32":v==="[object Float32Array]"?_+="fl32":v==="[object Float64Array]"?_+="fl64":s(new Error("Failed to get type for BinaryArray"))),s(_+P(b))}else if(v==="[object Blob]"){var E=new FileReader;E.onload=function(){var N="~~local_forage_type~"+a.type+"~"+P(this.result);s("__lfsc__:blob"+N)},E.readAsArrayBuffer(a)}else try{s(JSON.stringify(a))}catch(N){console.error("Couldn't convert value into a JSON string: ",a),s(null,N)}}function Z(a){if(a.substring(0,Q)!=="__lfsc__:")return JSON.parse(a);var s=a.substring(C),v=a.substring(Q,C),b;if(v==="blob"&&M.test(s)){var _=s.match(M);b=_[1],s=s.substring(_[0].length)}var E=S(s);switch(v){case"arbf":return E;case"blob":return L([E],{type:b});case"si08":return new Int8Array(E);case"ui08":return new Uint8Array(E);case"uic8":return new Uint8ClampedArray(E);case"si16":return new Int16Array(E);case"ur16":return new Uint16Array(E);case"si32":return new Int32Array(E);case"ui32":return new Uint32Array(E);case"fl32":return new Float32Array(E);case"fl64":return new Float64Array(E);default:throw new Error("Unkown type: "+v)}}function m(a){var s,v;if(a===null||typeof a!="object"||"isActiveClone"in a)return a;var b=a instanceof Date?new Date(a):a.constructor();try{for(var _=R(Object.keys(a)),E=_.next();!E.done;E=_.next()){var N=E.value;Object.prototype.hasOwnProperty.call(a,N)&&(a.isActiveClone=null,b[N]=m(a[N]),delete a.isActiveClone)}}catch(G){s={error:G}}finally{try{E&&!E.done&&(v=_.return)&&v.call(_)}finally{if(s)throw s.error}}return b}function w(a,s){return(a.name||s.name)+"/"+(a.storeName||s.storeName)+"/"}function T(a,s){s&&a.then(function(v){s(null,v)},function(v){s(v)})}function z(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}function q(a,s){var v=this;if(s=z.apply(this,arguments),a=typeof a!="function"&&a||{},!a.name){var b=this.config();a.name=a.name||b.name,a.storeName=a.storeName||b.storeName}var _;return a.name?_=new Promise(function(E){a.storeName?E(w(a,v._defaultConfig)):E(a.name+"/")}):_=Promise.reject("Invalid arguments"),{promise:_,callback:s}}function F(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}var k={bufferToString:P,deserialize:Z,serialize:K,stringToBuffer:S},U={},se=function(){function a(s){this.kp=s,this.data={}}return a.resolve=function(s){return U[s]||(U[s]=new a(s)),U[s]},a.prototype.clear=function(){this.data={}},a.prototype.drop=function(){this.clear(),delete U[this.kp]},a.prototype.get=function(s){return this.data[s]},a.prototype.key=function(s){return this.keys()[s]},a.prototype.keys=function(){return Object.keys(this.data)},a.prototype.rm=function(s){delete this.data[s]},a.prototype.set=function(s,v){this.data[s]=v},a}();function ne(a){var s=a?m(a):{},v=w(s,this._defaultConfig),b=se.resolve(v);return this._dbInfo=s,this._dbInfo.serializer=k,this._dbInfo.keyPrefix=v,this._dbInfo.mStore=b,Promise.resolve()}function h(a){var s=this,v=this.ready().then(function(){s._dbInfo.mStore.clear()});return T(v,a),v}function D(a,s){var v=q.apply(this,arguments),b=v.promise,_=v.callback,E=b.then(function(N){se.resolve(N).drop()});return T(E,_),b}function I(a,s){var v=this;a=F(a);var b=this.ready().then(function(){var _=v._dbInfo.mStore.get(a);return _==null?null:v._dbInfo.serializer.deserialize(_)});return T(b,s),b}function x(a,s){var v=this,b=this.ready().then(function(){for(var _=v._dbInfo.mStore,E=_.keys(),N=0;N<E.length;N++){var G=_.get(E[N]);if(G&&(G=v._dbInfo.serializer.deserialize(G)),G=a(G,E[N],N+1),G!==void 0)return G}});return T(b,s),b}function H(a,s){var v=this,b=this.ready().then(function(){var _;try{_=v._dbInfo.mStore.key(a),_===void 0&&(_=null)}catch{_=null}return _});return T(b,s),b}function j(a){var s=this,v=this.ready().then(function(){return s._dbInfo.mStore.keys()});return T(v,a),v}function J(a){var s=this.keys().then(function(v){return v.length});return T(s,a),s}function $(a,s){var v=this;a=F(a);var b=this.ready().then(function(){v._dbInfo.mStore.rm(a)});return T(b,s),b}function ee(a,s,v){var b=this;a=F(a);var _=this.ready().then(function(){s===void 0&&(s=null);var E=s;return new Promise(function(N,G){b._dbInfo.serializer.serialize(s,function(ce,ue){if(ue)G(ue);else try{b._dbInfo.mStore.set(a,ce),N(E)}catch(ve){G(ve)}})})});return T(_,v),_}var fe=!0;g._support=fe,g._driver=p,g._initStorage=ne,g.clear=h,g.dropInstance=D,g.getItem=I,g.iterate=x,g.key=H,g.keys=j,g.length=J,g.removeItem=$,g.setItem=ee,Object.defineProperty(g,"__esModule",{value:!0})})});var te={};it(te,{Magic:()=>ct});var _e=require("@magic-sdk/provider"),we=rr(nr()),Ce=rr(ir());var oe=require("@magic-sdk/provider"),ft={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};function ut(g){for(let[p,R]of Object.entries(ft))g.style[p]=R}function st(g){let p=[].slice.call(document.querySelectorAll(".magic-iframe"));return Boolean(p.find(R=>R.src.includes(g)))}var Oe=class extends oe.ViewController{constructor(){super(...arguments);this.activeElement=null}init(){this.test="hello",this.iframe=new Promise(p=>{let R=()=>{if(st(encodeURIComponent(this.parameters)))(0,oe.createDuplicateIframeWarning)().log();else{let L=document.createElement("iframe");L.classList.add("magic-iframe"),L.dataset.magicIframeLabel=(0,oe.createURL)(this.endpoint).host,L.title="Secure Modal",L.src=(0,oe.createURL)(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,ut(L),document.body.appendChild(L),p(L)}};["loaded","interactive","complete"].includes(document.readyState)?R():window.addEventListener("load",R,!1)}),window.addEventListener("message",p=>{var R;if(p.origin===this.endpoint&&p.data&&p.data.msgType&&this.messageHandlers.size){p.data.response=(R=p.data.response)!=null?R:{};for(let L of this.messageHandlers.values())L(p)}})}showOverlay(){return de(this,null,function*(){let p=yield this.iframe;p.style.display="block",this.activeElement=document.activeElement,p.focus()})}hideOverlay(){return de(this,null,function*(){var R;let p=yield this.iframe;p.style.display="none",((R=this.activeElement)==null?void 0:R.focus)&&this.activeElement.focus(),this.activeElement=null})}_post(p){return de(this,null,function*(){let R=yield this.iframe;if(R&&R.contentWindow)R.contentWindow.postMessage(p,this.endpoint);else throw(0,oe.createModalNotReadyError)()})}};re(te,require("@magic-sdk/commons"));var ct=(0,_e.createSDK)(_e.SDKBase,{platform:"web",sdkName:"magic-sdk",version:"8.0.1",defaultEndpoint:"https://auth.magic.link/",ViewController:Oe,configureStorage:()=>de(void 0,null,function*(){let g=we.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield g.defineDriver(Ce),yield g.setDriver([we.default.INDEXEDDB,we.default.LOCALSTORAGE,Ce._driver]),g})});module.exports=at(te);
|
|
//# sourceMappingURL=index.js.map
|