@gataca/qr 2.0.0 → 2.0.1

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.
Files changed (31) hide show
  1. package/dist/{esm/qr-code-styling-0eeb38d5.js → cjs/gataca-autoqr_6.cjs.entry.js} +599 -1
  2. package/dist/cjs/gatacaqr.cjs.js +1 -1
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/collection/components/gataca-autoqr/gataca-autoqr.js +20 -1
  5. package/dist/collection/components/gataca-qr/gataca-qr.css +2 -0
  6. package/dist/collection/components/gataca-qrws/gataca-qrws.css +2 -0
  7. package/dist/components/gataca-autoqr.js +20 -1
  8. package/dist/components/gataca-qr2.js +1 -1
  9. package/dist/components/gataca-qrws2.js +1 -1
  10. package/dist/{cjs/qr-code-styling-412bbc7a.js → esm/gataca-autoqr_6.entry.js} +589 -2
  11. package/dist/esm/gatacaqr.js +1 -1
  12. package/dist/esm/loader.js +1 -1
  13. package/dist/gatacaqr/gatacaqr.esm.js +1 -1
  14. package/dist/gatacaqr/p-4807b345.entry.js +1 -0
  15. package/package.json +1 -1
  16. package/dist/cjs/gat-icon-refresh-751505ff.js +0 -14
  17. package/dist/cjs/gataca-autoqr.cjs.entry.js +0 -88
  18. package/dist/cjs/gataca-qr.cjs.entry.js +0 -175
  19. package/dist/cjs/gataca-qrdisplay_2.cjs.entry.js +0 -219
  20. package/dist/cjs/gataca-ssibutton_2.cjs.entry.js +0 -114
  21. package/dist/esm/gat-icon-refresh-179ea123.js +0 -9
  22. package/dist/esm/gataca-autoqr.entry.js +0 -84
  23. package/dist/esm/gataca-qr.entry.js +0 -171
  24. package/dist/esm/gataca-qrdisplay_2.entry.js +0 -214
  25. package/dist/esm/gataca-ssibutton_2.entry.js +0 -109
  26. package/dist/gatacaqr/p-0905677f.entry.js +0 -1
  27. package/dist/gatacaqr/p-0be4566d.js +0 -1
  28. package/dist/gatacaqr/p-1d35273f.entry.js +0 -1
  29. package/dist/gatacaqr/p-2f22c7fc.js +0 -1
  30. package/dist/gatacaqr/p-4139a068.entry.js +0 -1
  31. package/dist/gatacaqr/p-f85d7e76.entry.js +0 -1
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["gataca-qrdisplay_2",[[1,"gataca-qrws",{"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"socketEndpoint":[1,"socket-endpoint"],"sessionTimeout":[2,"session-timeout"],"wsOnOpen":[16],"wsOnMessage":[16],"autostart":[4],"autorefresh":[4],"v2":[4,"v-2"],"qrModalTitle":[1,"qr-modal-title"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"display":[64],"stop":[64],"getSessionData":[64]},[[2,"sessionMsg","sessionMsgReceived"]]],[0,"gataca-qrdisplay",{"qrData":[1,"qr-data"],"size":[2],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrColor":[1,"qr-color"],"rounded":[4]}]]],["gataca-qr",[[1,"gataca-qr",{"checkStatus":[16],"createSession":[16],"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"autostart":[4],"autorefresh":[4],"v2":[4,"v-2"],"qrModalTitle":[1,"qr-modal-title"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"sessionTimeout":[2,"session-timeout"],"pollingFrequency":[2,"polling-frequency"],"dynamicLink":[4,"dynamic-link"],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"display":[64],"stop":[64],"getSessionData":[64]}]]],["gataca-ssibutton_2",[[1,"gataca-ssibutton",{"buttonText":[1,"button-text"],"checkStatus":[16],"createSession":[16],"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"sessionTimeout":[2,"session-timeout"],"pollingFrequency":[2,"polling-frequency"],"autorefresh":[4],"v2":[4,"v-2"],"qrModalTitle":[1,"qr-modal-title"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"open":[32],"getSessionData":[64]}],[1,"gataca-ssibuttonws",{"buttonText":[1,"button-text"],"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"socketEndpoint":[1,"socket-endpoint"],"sessionTimeout":[2,"session-timeout"],"wsOnOpen":[16],"wsOnMessage":[16],"autostart":[4],"autorefresh":[4],"v2":[4,"v-2"],"qrModalTitle":[1,"qr-modal-title"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"open":[32],"getSessionData":[64]}]]],["gataca-autoqr",[[1,"gataca-autoqr",{"configId":[1,"config-id"],"configRepository":[1,"config-repository"],"successCallback":[16],"errorCallback":[16],"checkStatus":[16],"createSession":[16],"wsOnOpen":[16],"wsOnMessage":[16],"config":[32],"loading":[32],"getSessionData":[64]}]]]], options);
13
+ return bootstrapLazy([["gataca-autoqr_6",[[1,"gataca-autoqr",{"configId":[1,"config-id"],"configRepository":[1,"config-repository"],"successCallback":[16],"errorCallback":[16],"checkStatus":[16],"createSession":[16],"wsOnOpen":[16],"wsOnMessage":[16],"config":[32],"loading":[32],"getSessionData":[64]}],[1,"gataca-ssibutton",{"buttonText":[1,"button-text"],"checkStatus":[16],"createSession":[16],"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"sessionTimeout":[2,"session-timeout"],"pollingFrequency":[2,"polling-frequency"],"autorefresh":[4],"v2":[4,"v-2"],"qrModalTitle":[1,"qr-modal-title"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"open":[32],"getSessionData":[64]}],[1,"gataca-ssibuttonws",{"buttonText":[1,"button-text"],"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"socketEndpoint":[1,"socket-endpoint"],"sessionTimeout":[2,"session-timeout"],"wsOnOpen":[16],"wsOnMessage":[16],"autostart":[4],"autorefresh":[4],"v2":[4,"v-2"],"qrModalTitle":[1,"qr-modal-title"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"open":[32],"getSessionData":[64]}],[1,"gataca-qr",{"checkStatus":[16],"createSession":[16],"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"autostart":[4],"autorefresh":[4],"v2":[4,"v-2"],"qrModalTitle":[1,"qr-modal-title"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"sessionTimeout":[2,"session-timeout"],"pollingFrequency":[2,"polling-frequency"],"dynamicLink":[4,"dynamic-link"],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"display":[64],"stop":[64],"getSessionData":[64]}],[1,"gataca-qrws",{"successCallback":[16],"errorCallback":[16],"qrRole":[1,"qr-role"],"callbackServer":[1,"callback-server"],"socketEndpoint":[1,"socket-endpoint"],"sessionTimeout":[2,"session-timeout"],"wsOnOpen":[16],"wsOnMessage":[16],"autostart":[4],"autorefresh":[4],"v2":[4,"v-2"],"qrModalTitle":[1,"qr-modal-title"],"qrModalDescription":[1,"qr-modal-description"],"hideBrandTitle":[4,"hide-brand-title"],"dynamicLink":[4,"dynamic-link"],"sessionId":[32],"authenticationRequest":[32],"sessionData":[32],"result":[32],"display":[64],"stop":[64],"getSessionData":[64]},[[2,"sessionMsg","sessionMsgReceived"]]],[0,"gataca-qrdisplay",{"qrData":[1,"qr-data"],"size":[2],"logoSize":[2,"logo-size"],"logoSrc":[1,"logo-src"],"qrColor":[1,"qr-color"],"rounded":[4]}]]]], options);
14
14
  });
15
15
  };
16
16
 
@@ -1 +1 @@
1
- import{p as e,b as s}from"./p-a6f85341.js";(()=>{const s=import.meta.url,a={};return""!==s&&(a.resourcesUrl=new URL(".",s).href),e(a)})().then((e=>s([["p-4139a068",[[1,"gataca-qrws",{successCallback:[16],errorCallback:[16],qrRole:[1,"qr-role"],callbackServer:[1,"callback-server"],socketEndpoint:[1,"socket-endpoint"],sessionTimeout:[2,"session-timeout"],wsOnOpen:[16],wsOnMessage:[16],autostart:[4],autorefresh:[4],v2:[4,"v-2"],qrModalTitle:[1,"qr-modal-title"],qrModalDescription:[1,"qr-modal-description"],hideBrandTitle:[4,"hide-brand-title"],dynamicLink:[4,"dynamic-link"],sessionId:[32],authenticationRequest:[32],sessionData:[32],result:[32],display:[64],stop:[64],getSessionData:[64]},[[2,"sessionMsg","sessionMsgReceived"]]],[0,"gataca-qrdisplay",{qrData:[1,"qr-data"],size:[2],logoSize:[2,"logo-size"],logoSrc:[1,"logo-src"],qrColor:[1,"qr-color"],rounded:[4]}]]],["p-1d35273f",[[1,"gataca-qr",{checkStatus:[16],createSession:[16],successCallback:[16],errorCallback:[16],qrRole:[1,"qr-role"],callbackServer:[1,"callback-server"],autostart:[4],autorefresh:[4],v2:[4,"v-2"],qrModalTitle:[1,"qr-modal-title"],qrModalDescription:[1,"qr-modal-description"],hideBrandTitle:[4,"hide-brand-title"],sessionTimeout:[2,"session-timeout"],pollingFrequency:[2,"polling-frequency"],dynamicLink:[4,"dynamic-link"],sessionId:[32],authenticationRequest:[32],sessionData:[32],result:[32],display:[64],stop:[64],getSessionData:[64]}]]],["p-0905677f",[[1,"gataca-ssibutton",{buttonText:[1,"button-text"],checkStatus:[16],createSession:[16],successCallback:[16],errorCallback:[16],qrRole:[1,"qr-role"],callbackServer:[1,"callback-server"],sessionTimeout:[2,"session-timeout"],pollingFrequency:[2,"polling-frequency"],autorefresh:[4],v2:[4,"v-2"],qrModalTitle:[1,"qr-modal-title"],qrModalDescription:[1,"qr-modal-description"],hideBrandTitle:[4,"hide-brand-title"],dynamicLink:[4,"dynamic-link"],open:[32],getSessionData:[64]}],[1,"gataca-ssibuttonws",{buttonText:[1,"button-text"],successCallback:[16],errorCallback:[16],qrRole:[1,"qr-role"],callbackServer:[1,"callback-server"],socketEndpoint:[1,"socket-endpoint"],sessionTimeout:[2,"session-timeout"],wsOnOpen:[16],wsOnMessage:[16],autostart:[4],autorefresh:[4],v2:[4,"v-2"],qrModalTitle:[1,"qr-modal-title"],qrModalDescription:[1,"qr-modal-description"],hideBrandTitle:[4,"hide-brand-title"],dynamicLink:[4,"dynamic-link"],open:[32],getSessionData:[64]}]]],["p-f85d7e76",[[1,"gataca-autoqr",{configId:[1,"config-id"],configRepository:[1,"config-repository"],successCallback:[16],errorCallback:[16],checkStatus:[16],createSession:[16],wsOnOpen:[16],wsOnMessage:[16],config:[32],loading:[32],getSessionData:[64]}]]]],e)));
1
+ import{p as e,b as s}from"./p-a6f85341.js";(()=>{const s=import.meta.url,a={};return""!==s&&(a.resourcesUrl=new URL(".",s).href),e(a)})().then((e=>s([["p-4807b345",[[1,"gataca-autoqr",{configId:[1,"config-id"],configRepository:[1,"config-repository"],successCallback:[16],errorCallback:[16],checkStatus:[16],createSession:[16],wsOnOpen:[16],wsOnMessage:[16],config:[32],loading:[32],getSessionData:[64]}],[1,"gataca-ssibutton",{buttonText:[1,"button-text"],checkStatus:[16],createSession:[16],successCallback:[16],errorCallback:[16],qrRole:[1,"qr-role"],callbackServer:[1,"callback-server"],sessionTimeout:[2,"session-timeout"],pollingFrequency:[2,"polling-frequency"],autorefresh:[4],v2:[4,"v-2"],qrModalTitle:[1,"qr-modal-title"],qrModalDescription:[1,"qr-modal-description"],hideBrandTitle:[4,"hide-brand-title"],dynamicLink:[4,"dynamic-link"],open:[32],getSessionData:[64]}],[1,"gataca-ssibuttonws",{buttonText:[1,"button-text"],successCallback:[16],errorCallback:[16],qrRole:[1,"qr-role"],callbackServer:[1,"callback-server"],socketEndpoint:[1,"socket-endpoint"],sessionTimeout:[2,"session-timeout"],wsOnOpen:[16],wsOnMessage:[16],autostart:[4],autorefresh:[4],v2:[4,"v-2"],qrModalTitle:[1,"qr-modal-title"],qrModalDescription:[1,"qr-modal-description"],hideBrandTitle:[4,"hide-brand-title"],dynamicLink:[4,"dynamic-link"],open:[32],getSessionData:[64]}],[1,"gataca-qr",{checkStatus:[16],createSession:[16],successCallback:[16],errorCallback:[16],qrRole:[1,"qr-role"],callbackServer:[1,"callback-server"],autostart:[4],autorefresh:[4],v2:[4,"v-2"],qrModalTitle:[1,"qr-modal-title"],qrModalDescription:[1,"qr-modal-description"],hideBrandTitle:[4,"hide-brand-title"],sessionTimeout:[2,"session-timeout"],pollingFrequency:[2,"polling-frequency"],dynamicLink:[4,"dynamic-link"],sessionId:[32],authenticationRequest:[32],sessionData:[32],result:[32],display:[64],stop:[64],getSessionData:[64]}],[1,"gataca-qrws",{successCallback:[16],errorCallback:[16],qrRole:[1,"qr-role"],callbackServer:[1,"callback-server"],socketEndpoint:[1,"socket-endpoint"],sessionTimeout:[2,"session-timeout"],wsOnOpen:[16],wsOnMessage:[16],autostart:[4],autorefresh:[4],v2:[4,"v-2"],qrModalTitle:[1,"qr-modal-title"],qrModalDescription:[1,"qr-modal-description"],hideBrandTitle:[4,"hide-brand-title"],dynamicLink:[4,"dynamic-link"],sessionId:[32],authenticationRequest:[32],sessionData:[32],result:[32],display:[64],stop:[64],getSessionData:[64]},[[2,"sessionMsg","sessionMsgReceived"]]],[0,"gataca-qrdisplay",{qrData:[1,"qr-data"],size:[2],logoSize:[2,"logo-size"],logoSrc:[1,"logo-src"],qrColor:[1,"qr-color"],rounded:[4]}]]]],e)));
@@ -0,0 +1 @@
1
+ import{r as t,c as i,h as n}from"./p-a6f85341.js";import{R as e,c as r,b as o}from"./p-b8ba109f.js";const a=t=>{if(t)return new Function("return "+t)()},s=class{constructor(n){t(this,n),this.gatacaLoginCompleted=i(this,"gatacaLoginCompleted",7),this.gatacaLoginFailed=i(this,"gatacaLoginFailed",7),this.configId=void 0,this.configRepository="https://studio.gataca.io/api/v1/qrconfigs",this.successCallback=void 0,this.errorCallback=void 0,this.checkStatus=void 0,this.createSession=void 0,this.wsOnOpen=void 0,this.wsOnMessage=void 0,this.config=void 0,this.loading=void 0,this.loading=!0,fetch(this.configRepository+"/"+this.configId,{method:"GET",headers:{"Content-Type":"application/json"}}).then((t=>{console.log("Got RESPONSE",t),t.json().then((t=>{console.log("Got DATA",t),t=(t=>{var i,n,e,r,o,s;return t.errorCallback=a(null===(i=t.errorCallback)||void 0===i?void 0:i.toString()),t.successCallback=a(null===(n=t.successCallback)||void 0===n?void 0:n.toString()),t.wsOnMessage=a(null===(e=t.wsOnMessage)||void 0===e?void 0:e.toString()),t.wsOnOpen=a(null===(r=t.wsOnOpen)||void 0===r?void 0:r.toString()),t.checkStatus=a(null===(o=t.checkStatus)||void 0===o?void 0:o.toString()),t.createSession=a(null===(s=t.createSession)||void 0===s?void 0:s.toString()),t})(t),this.config=t,this.loading=!1})).catch((t=>{console.log("Cannot retrieve selected config",t),this.loading=!1}))})).catch((t=>{console.log("Cannot retrieve selected config",t),this.loading=!1}))}async getSessionData(){return this.qr.getSessionData()}selectQR(){this.qr=this.config.useButton?this.config.useWs?n("gataca-ssibuttonws",{buttonText:this.config.buttonText,wsOnMessage:this.wsOnMessage||this.config.wsOnMessage,wsOnOpen:this.wsOnOpen||this.config.wsOnOpen,successCallback:this.successCallback||this.config.successCallback,errorCallback:this.errorCallback||this.config.errorCallback,qrRole:this.config.qrRole,callbackServer:this.config.callbackServer,sessionTimeout:this.config.sessionTimeout,socketEndpoint:this.config.socketEndpoint,autostart:!0,autorefresh:this.config.autorefresh,v2:this.config.v2,qrModalTitle:this.config.qrModalTitle,qrModalDescription:this.config.qrModalDescription,hideBrandTitle:this.config.hideBrandTitle,dynamicLink:this.config.dynamicLink}):n("gataca-ssibutton",{buttonText:this.config.buttonText,checkStatus:this.checkStatus||this.config.checkStatus,createSession:this.createSession||this.config.createSession,successCallback:this.successCallback||this.config.successCallback,errorCallback:this.errorCallback||this.config.errorCallback,qrRole:this.config.qrRole,callbackServer:this.config.callbackServer,sessionTimeout:this.config.sessionTimeout,pollingFrequency:this.config.pollingFrequency,autorefresh:this.config.autorefresh,v2:this.config.v2,qrModalTitle:this.config.qrModalTitle,qrModalDescription:this.config.qrModalDescription,hideBrandTitle:this.config.hideBrandTitle,dynamicLink:this.config.dynamicLink}):this.config.useWs?n("gataca-qrws",{wsOnMessage:this.wsOnMessage||this.config.wsOnMessage,wsOnOpen:this.wsOnOpen||this.config.wsOnOpen,successCallback:this.successCallback||this.config.successCallback,errorCallback:this.errorCallback||this.config.errorCallback,qrRole:this.config.qrRole,callbackServer:this.config.callbackServer,sessionTimeout:this.config.sessionTimeout,socketEndpoint:this.config.socketEndpoint,autostart:this.config.autostart,autorefresh:this.config.autorefresh,v2:this.config.v2,qrModalTitle:this.config.qrModalTitle,qrModalDescription:this.config.qrModalDescription,hideBrandTitle:this.config.hideBrandTitle,dynamicLink:this.config.dynamicLink}):n("gataca-qr",{checkStatus:this.checkStatus||this.config.checkStatus,createSession:this.createSession||this.config.createSession,successCallback:this.successCallback||this.config.successCallback,errorCallback:this.errorCallback||this.config.errorCallback,qrRole:this.config.qrRole,callbackServer:this.config.callbackServer,sessionTimeout:this.config.sessionTimeout,pollingFrequency:this.config.pollingFrequency,autostart:this.config.autostart,autorefresh:this.config.autorefresh,v2:this.config.v2,qrModalTitle:this.config.qrModalTitle,qrModalDescription:this.config.qrModalDescription,hideBrandTitle:this.config.hideBrandTitle,dynamicLink:this.config.dynamicLink})}render(){return this.loading?n("div",null,"Loading..."):this.config?(this.selectQR(),this.qr):n("div",null,"Error loading your config...")}};s.style='@import url("https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.buttonContainer{display:inline-block;text-align:right;padding:10px;position:relative}.gatacaButtonWrapper{margin:8px}.gatacaButtonWrapper .gatacaButton{display:flex;min-width:100px;padding:8px 8px;background-color:white;font-size:12px;font-family:"Work Sans", sans-serif;letter-spacing:1px;font-weight:2;justify-content:space-between;align-items:center;border-radius:6px;border:1px solid rgba(24, 27, 94, 0.5);color:rgba(24, 27, 94, 0.8);box-shadow:0px 1px 3px rgba(48, 48, 48, 0.15);cursor:pointer}.gatacaButtonWrapper .gatacaButton>span{margin-right:10px}.gatacaButtonWrapper .gatacaButton:hover{box-shadow:0px 2px 8px rgba(48, 48, 48, 0.1)}.gatacaButtonWrapper .buttonText{text-align:right;font-size:8px;color:rgba(24, 27, 94, 0.5);font-family:"Helvetica Neue", sans-serif;letter-spacing:1px;padding-right:8px;font-weight:1}.gatacaButtonWrapper .buttonImg{height:25px;width:25px;margin:0;margin-right:20px}';const c="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEwLjI5MDggMy44NjAyTDEuODIwNz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CwwLjgxYzEuMjMsMC43LDIuNDcsMS4zOSwzLjcyLDIuMDdsMjEuODEsMTIuNTlsMzUuOCwyMC42NwoJCWw1OS44MiwzNC41M2wzLjE2LDEuODNsOTMuNzksNTQuMTNsNTcuMDQtNDcuODZsMC4wNS0wLjA5bC0xMTUuODYtNjYuODdjNC41LTMuODgsOS4yOS03LjM1LDE0LjMxLTEwLjM4CgkJYzEuMjMtMC43NCwyLjQ2LTEuNDYsMy43Mi0yLjE1YzMxLjU2LTE3LjM3LDcxLjE4LTE4LjI0LDEwNC42MSwxLjIxYzE2Ljg5LDkuODIsMzAuMDksMjMuNzMsMzkuMDYsMzkuNzgKCQlDNTY4LjQ1LDM5OS43Niw1NzAuMTIsNDM4LjI2LDU1Mi40OSw0NzEuMTV6Ii8+CjwvZz4KPC9zdmc+Cg==";function d(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var f;const g=d((function(t){self,t.exports=(()=>{var t={192:(t,i)=>{var n,e,r=function(){var t=function(t,i){var n=t,e=a[i],r=null,o=0,c=null,v=[],w={},y=function(t,i){r=function(t){for(var i=new Array(t),n=0;n<t;n+=1){i[n]=new Array(t);for(var e=0;e<t;e+=1)i[n][e]=null}return i}(o=4*n+17),b(0,0),b(o-7,0),b(0,o-7),x(),m(),L(t,i),n>=7&&j(t),null==c&&(c=N(n,e,v)),D(c,i)},b=function(t,i){for(var n=-1;n<=7;n+=1)if(!(t+n<=-1||o<=t+n))for(var e=-1;e<=7;e+=1)i+e<=-1||o<=i+e||(r[t+n][i+e]=0<=n&&n<=6&&(0==e||6==e)||0<=e&&e<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=e&&e<=4)},m=function(){for(var t=8;t<o-8;t+=1)null==r[t][6]&&(r[t][6]=t%2==0);for(var i=8;i<o-8;i+=1)null==r[6][i]&&(r[6][i]=i%2==0)},x=function(){for(var t=s.getPatternPosition(n),i=0;i<t.length;i+=1)for(var e=0;e<t.length;e+=1){var o=t[i],a=t[e];if(null==r[o][a])for(var c=-2;c<=2;c+=1)for(var u=-2;u<=2;u+=1)r[o+c][a+u]=-2==c||2==c||-2==u||2==u||0==c&&0==u}},j=function(t){for(var i=s.getBCHTypeNumber(n),e=0;e<18;e+=1){var a=!t&&1==(i>>e&1);r[Math.floor(e/3)][e%3+o-8-3]=a}for(e=0;e<18;e+=1)a=!t&&1==(i>>e&1),r[e%3+o-8-3][Math.floor(e/3)]=a},L=function(t,i){for(var n=s.getBCHTypeInfo(e<<3|i),a=0;a<15;a+=1){var c=!t&&1==(n>>a&1);a<6?r[a][8]=c:a<8?r[a+1][8]=c:r[o-15+a][8]=c}for(a=0;a<15;a+=1)c=!t&&1==(n>>a&1),a<8?r[8][o-a-1]=c:a<9?r[8][15-a-1+1]=c:r[8][15-a-1]=c;r[o-8][8]=!t},D=function(t,i){for(var n=-1,e=o-1,a=7,c=0,u=s.getMaskFunction(i),h=o-1;h>0;h-=2)for(6==h&&(h-=1);;){for(var l=0;l<2;l+=1)if(null==r[e][h-l]){var d=!1;c<t.length&&(d=1==(t[c]>>>a&1)),u(e,h-l)&&(d=!d),r[e][h-l]=d,-1==(a-=1)&&(c+=1,a=7)}if((e+=n)<0||o<=e){e-=n,n=-n;break}}},N=function(t,i,n){for(var e=h.getRSBlocks(t,i),r=l(),o=0;o<n.length;o+=1){var a=n[o];r.put(a.getMode(),4),r.put(a.getLength(),s.getLengthInBits(a.getMode(),t)),a.write(r)}var c=0;for(o=0;o<e.length;o+=1)c+=e[o].dataCount;if(r.getLengthInBits()>8*c)throw"code length overflow. ("+r.getLengthInBits()+">"+8*c+")";for(r.getLengthInBits()+4<=8*c&&r.put(0,4);r.getLengthInBits()%8!=0;)r.putBit(!1);for(;!(r.getLengthInBits()>=8*c||(r.put(236,8),r.getLengthInBits()>=8*c));)r.put(17,8);return function(t,i){for(var n=0,e=0,r=0,o=new Array(i.length),a=new Array(i.length),c=0;c<i.length;c+=1){var h=i[c].dataCount,l=i[c].totalCount-h;e=Math.max(e,h),r=Math.max(r,l),o[c]=new Array(h);for(var d=0;d<o[c].length;d+=1)o[c][d]=255&t.getBuffer()[d+n];n+=h;var f=s.getErrorCorrectPolynomial(l),g=u(o[c],f.getLength()-1).mod(f);for(a[c]=new Array(f.getLength()-1),d=0;d<a[c].length;d+=1){var p=d+g.getLength()-a[c].length;a[c][d]=p>=0?g.getAt(p):0}}var v=0;for(d=0;d<i.length;d+=1)v+=i[d].totalCount;var w=new Array(v),M=0;for(d=0;d<e;d+=1)for(c=0;c<i.length;c+=1)d<o[c].length&&(w[M]=o[c][d],M+=1);for(d=0;d<r;d+=1)for(c=0;c<i.length;c+=1)d<a[c].length&&(w[M]=a[c][d],M+=1);return w}(r,e)};w.addData=function(t,i){var n=null;switch(i=i||"Byte"){case"Numeric":n=d(t);break;case"Alphanumeric":n=f(t);break;case"Byte":n=g(t);break;case"Kanji":n=p(t);break;default:throw"mode:"+i}v.push(n),c=null},w.isDark=function(t,i){if(t<0||o<=t||i<0||o<=i)throw t+","+i;return r[t][i]},w.getModuleCount=function(){return o},w.make=function(){if(n<1){for(var t=1;t<40;t++){for(var i=h.getRSBlocks(t,e),r=l(),o=0;o<v.length;o++){var a=v[o];r.put(a.getMode(),4),r.put(a.getLength(),s.getLengthInBits(a.getMode(),t)),a.write(r)}var c=0;for(o=0;o<i.length;o++)c+=i[o].dataCount;if(r.getLengthInBits()<=8*c)break}n=t}y(!1,function(){for(var t=0,i=0,n=0;n<8;n+=1){y(!0,n);var e=s.getLostPoint(w);(0==n||t>e)&&(t=e,i=n)}return i}())},w.createTableTag=function(t,i){t=t||2;var n="";n+='<table style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: "+(i=void 0===i?4*t:i)+"px;",n+='">',n+="<tbody>";for(var e=0;e<w.getModuleCount();e+=1){n+="<tr>";for(var r=0;r<w.getModuleCount();r+=1)n+='<td style="',n+=" border-width: 0px; border-style: none;",n+=" border-collapse: collapse;",n+=" padding: 0px; margin: 0px;",n+=" width: "+t+"px;",n+=" height: "+t+"px;",n+=" background-color: ",n+=w.isDark(e,r)?"#000000":"#ffffff",n+=";",n+='"/>';n+="</tr>"}return(n+="</tbody>")+"</table>"},w.createSvgTag=function(t,i,n,e){var r={};"object"==typeof arguments[0]&&(t=(r=arguments[0]).cellSize,i=r.margin,n=r.alt,e=r.title),t=t||2,i=void 0===i?4*t:i,(n="string"==typeof n?{text:n}:n||{}).text=n.text||null,n.id=n.text?n.id||"qrcode-description":null,(e="string"==typeof e?{text:e}:e||{}).text=e.text||null,e.id=e.text?e.id||"qrcode-title":null;var o,a,s,c,u=w.getModuleCount()*t+2*i,h="";for(c="l"+t+",0 0,"+t+" -"+t+",0 0,-"+t+"z ",h+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',h+=r.scalable?"":' width="'+u+'px" height="'+u+'px"',h+=' viewBox="0 0 '+u+" "+u+'" ',h+=' preserveAspectRatio="xMinYMin meet"',h+=e.text||n.text?' role="img" aria-labelledby="'+z([e.id,n.id].join(" ").trim())+'"':"",h+=">",h+=e.text?'<title id="'+z(e.id)+'">'+z(e.text)+"</title>":"",h+=n.text?'<description id="'+z(n.id)+'">'+z(n.text)+"</description>":"",h+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',h+='<path d="',a=0;a<w.getModuleCount();a+=1)for(s=a*t+i,o=0;o<w.getModuleCount();o+=1)w.isDark(a,o)&&(h+="M"+(o*t+i)+","+s+c);return(h+='" stroke="transparent" fill="black"/>')+"</svg>"},w.createDataURL=function(t,i){t=t||2,i=void 0===i?4*t:i;var n=w.getModuleCount()*t+2*i,e=i,r=n-i;return M(n,n,(function(i,n){if(e<=i&&i<r&&e<=n&&n<r){var o=Math.floor((i-e)/t),a=Math.floor((n-e)/t);return w.isDark(a,o)?0:1}return 1}))},w.createImgTag=function(t,i,n){t=t||2,i=void 0===i?4*t:i;var e=w.getModuleCount()*t+2*i,r="";return r+="<img",r+=' src="',r+=w.createDataURL(t,i),r+='"',r+=' width="',r+=e,r+='"',r+=' height="',r+=e,r+='"',n&&(r+=' alt="',r+=z(n),r+='"'),r+"/>"};var z=function(t){for(var i="",n=0;n<t.length;n+=1){var e=t.charAt(n);switch(e){case"<":i+="&lt;";break;case">":i+="&gt;";break;case"&":i+="&amp;";break;case'"':i+="&quot;";break;default:i+=e}}return i};return w.createASCII=function(t,i){if((t=t||1)<2)return function(t){t=void 0===t?2:t;var i,n,e,r,o,a=1*w.getModuleCount()+2*t,s=t,c=a-t,u={"██":"█","█ ":"▀"," █":"▄"," ":" "},h={"██":"▀","█ ":"▀"," █":" "," ":" "},l="";for(i=0;i<a;i+=2){for(e=Math.floor((i-s)/1),r=Math.floor((i+1-s)/1),n=0;n<a;n+=1)o="█",s<=n&&n<c&&s<=i&&i<c&&w.isDark(e,Math.floor((n-s)/1))&&(o=" "),s<=n&&n<c&&s<=i+1&&i+1<c&&w.isDark(r,Math.floor((n-s)/1))?o+=" ":o+="█",l+=t<1&&i+1>=c?h[o]:u[o];l+="\n"}return a%2&&t>0?l.substring(0,l.length-a-1)+Array(a+1).join("▀"):l.substring(0,l.length-1)}(i);t-=1,i=void 0===i?2*t:i;var n,e,r,o,a=w.getModuleCount()*t+2*i,s=i,c=a-i,u=Array(t+1).join("██"),h=Array(t+1).join(" "),l="",d="";for(n=0;n<a;n+=1){for(r=Math.floor((n-s)/t),d="",e=0;e<a;e+=1)o=1,s<=e&&e<c&&s<=n&&n<c&&w.isDark(r,Math.floor((e-s)/t))&&(o=0),d+=o?u:h;for(r=0;r<t;r+=1)l+=d+"\n"}return l.substring(0,l.length-1)},w.renderTo2dContext=function(t,i){i=i||2;for(var n=w.getModuleCount(),e=0;e<n;e++)for(var r=0;r<n;r++)t.fillStyle=w.isDark(e,r)?"black":"white",t.fillRect(e*i,r*i,i,i)},w};t.stringToBytes=(t.stringToBytesFuncs={default:function(t){for(var i=[],n=0;n<t.length;n+=1){var e=t.charCodeAt(n);i.push(255&e)}return i}}).default,t.createStringToBytes=function(t,i){var n=function(){for(var n=w(t),e=function(){var t=n.read();if(-1==t)throw"eof";return t},r=0,o={};;){var a=n.read();if(-1==a)break;var s=e(),c=e()<<8|e();o[String.fromCharCode(a<<8|s)]=c,r+=1}if(r!=i)throw r+" != "+i;return o}(),e="?".charCodeAt(0);return function(t){for(var i=[],r=0;r<t.length;r+=1){var o=t.charCodeAt(r);if(o<128)i.push(o);else{var a=n[t.charAt(r)];"number"==typeof a?(255&a)==a?i.push(a):(i.push(a>>>8),i.push(255&a)):i.push(e)}}return i}};var i,n,e,r,o,a={L:1,M:0,Q:3,H:2},s=(i=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],n=1335,e=7973,o=function(t){for(var i=0;0!=t;)i+=1,t>>>=1;return i},(r={}).getBCHTypeInfo=function(t){for(var i=t<<10;o(i)-o(n)>=0;)i^=n<<o(i)-o(n);return 21522^(t<<10|i)},r.getBCHTypeNumber=function(t){for(var i=t<<12;o(i)-o(e)>=0;)i^=e<<o(i)-o(e);return t<<12|i},r.getPatternPosition=function(t){return i[t-1]},r.getMaskFunction=function(t){switch(t){case 0:return function(t,i){return(t+i)%2==0};case 1:return function(t){return t%2==0};case 2:return function(t,i){return i%3==0};case 3:return function(t,i){return(t+i)%3==0};case 4:return function(t,i){return(Math.floor(t/2)+Math.floor(i/3))%2==0};case 5:return function(t,i){return t*i%2+t*i%3==0};case 6:return function(t,i){return(t*i%2+t*i%3)%2==0};case 7:return function(t,i){return(t*i%3+(t+i)%2)%2==0};default:throw"bad maskPattern:"+t}},r.getErrorCorrectPolynomial=function(t){for(var i=u([1],0),n=0;n<t;n+=1)i=i.multiply(u([1,c.gexp(n)],0));return i},r.getLengthInBits=function(t,i){if(1<=i&&i<10)switch(t){case 1:return 10;case 2:return 9;case 4:case 8:return 8;default:throw"mode:"+t}else if(i<27)switch(t){case 1:return 12;case 2:return 11;case 4:return 16;case 8:return 10;default:throw"mode:"+t}else{if(!(i<41))throw"type:"+i;switch(t){case 1:return 14;case 2:return 13;case 4:return 16;case 8:return 12;default:throw"mode:"+t}}},r.getLostPoint=function(t){for(var i=t.getModuleCount(),n=0,e=0;e<i;e+=1)for(var r=0;r<i;r+=1){for(var o=0,a=t.isDark(e,r),s=-1;s<=1;s+=1)if(!(e+s<0||i<=e+s))for(var c=-1;c<=1;c+=1)r+c<0||i<=r+c||0==s&&0==c||a==t.isDark(e+s,r+c)&&(o+=1);o>5&&(n+=3+o-5)}for(e=0;e<i-1;e+=1)for(r=0;r<i-1;r+=1){var u=0;t.isDark(e,r)&&(u+=1),t.isDark(e+1,r)&&(u+=1),t.isDark(e,r+1)&&(u+=1),t.isDark(e+1,r+1)&&(u+=1),0!=u&&4!=u||(n+=3)}for(e=0;e<i;e+=1)for(r=0;r<i-6;r+=1)t.isDark(e,r)&&!t.isDark(e,r+1)&&t.isDark(e,r+2)&&t.isDark(e,r+3)&&t.isDark(e,r+4)&&!t.isDark(e,r+5)&&t.isDark(e,r+6)&&(n+=40);for(r=0;r<i;r+=1)for(e=0;e<i-6;e+=1)t.isDark(e,r)&&!t.isDark(e+1,r)&&t.isDark(e+2,r)&&t.isDark(e+3,r)&&t.isDark(e+4,r)&&!t.isDark(e+5,r)&&t.isDark(e+6,r)&&(n+=40);var h=0;for(r=0;r<i;r+=1)for(e=0;e<i;e+=1)t.isDark(e,r)&&(h+=1);return n+Math.abs(100*h/i/i-50)/5*10},r),c=function(){for(var t=new Array(256),i=new Array(256),n=0;n<8;n+=1)t[n]=1<<n;for(n=8;n<256;n+=1)t[n]=t[n-4]^t[n-5]^t[n-6]^t[n-8];for(n=0;n<255;n+=1)i[t[n]]=n;return{glog:function(t){if(t<1)throw"glog("+t+")";return i[t]},gexp:function(i){for(;i<0;)i+=255;for(;i>=256;)i-=255;return t[i]}}}();function u(t,i){if(void 0===t.length)throw t.length+"/"+i;var n=function(){for(var n=0;n<t.length&&0==t[n];)n+=1;for(var e=new Array(t.length-n+i),r=0;r<t.length-n;r+=1)e[r]=t[r+n];return e}(),e={getAt:function(t){return n[t]},getLength:function(){return n.length},multiply:function(t){for(var i=new Array(e.getLength()+t.getLength()-1),n=0;n<e.getLength();n+=1)for(var r=0;r<t.getLength();r+=1)i[n+r]^=c.gexp(c.glog(e.getAt(n))+c.glog(t.getAt(r)));return u(i,0)},mod:function(t){if(e.getLength()-t.getLength()<0)return e;for(var i=c.glog(e.getAt(0))-c.glog(t.getAt(0)),n=new Array(e.getLength()),r=0;r<e.getLength();r+=1)n[r]=e.getAt(r);for(r=0;r<t.getLength();r+=1)n[r]^=c.gexp(c.glog(t.getAt(r))+i);return u(n,0).mod(t)}};return e}var h=function(){var t=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],i=function(t,i){var n={};return n.totalCount=t,n.dataCount=i,n};return{getRSBlocks:function(n,e){var r=function(i,n){switch(n){case a.L:return t[4*(i-1)+0];case a.M:return t[4*(i-1)+1];case a.Q:return t[4*(i-1)+2];case a.H:return t[4*(i-1)+3];default:return}}(n,e);if(void 0===r)throw"bad rs block @ typeNumber:"+n+"/errorCorrectionLevel:"+e;for(var o=r.length/3,s=[],c=0;c<o;c+=1)for(var u=r[3*c+0],h=r[3*c+1],l=r[3*c+2],d=0;d<u;d+=1)s.push(i(h,l));return s}}}(),l=function(){var t=[],i=0,n={getBuffer:function(){return t},getAt:function(i){var n=Math.floor(i/8);return 1==(t[n]>>>7-i%8&1)},put:function(t,i){for(var e=0;e<i;e+=1)n.putBit(1==(t>>>i-e-1&1))},getLengthInBits:function(){return i},putBit:function(n){var e=Math.floor(i/8);t.length<=e&&t.push(0),n&&(t[e]|=128>>>i%8),i+=1}};return n},d=function(t){var i=t,n={getMode:function(){return 1},getLength:function(){return i.length},write:function(t){for(var n=i,r=0;r+2<n.length;)t.put(e(n.substring(r,r+3)),10),r+=3;r<n.length&&(n.length-r==1?t.put(e(n.substring(r,r+1)),4):n.length-r==2&&t.put(e(n.substring(r,r+2)),7))}},e=function(t){for(var i=0,n=0;n<t.length;n+=1)i=10*i+r(t.charAt(n));return i},r=function(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);throw"illegal char :"+t};return n},f=function(t){var i=t,n={getMode:function(){return 2},getLength:function(){return i.length},write:function(t){for(var n=i,r=0;r+1<n.length;)t.put(45*e(n.charAt(r))+e(n.charAt(r+1)),11),r+=2;r<n.length&&t.put(e(n.charAt(r)),6)}},e=function(t){if("0"<=t&&t<="9")return t.charCodeAt(0)-"0".charCodeAt(0);if("A"<=t&&t<="Z")return t.charCodeAt(0)-"A".charCodeAt(0)+10;switch(t){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+t}};return n},g=function(i){var n=t.stringToBytes(i);return{getMode:function(){return 4},getLength:function(){return n.length},write:function(t){for(var i=0;i<n.length;i+=1)t.put(n[i],8)}}},p=function(i){var n=t.stringToBytesFuncs.SJIS;if(!n)throw"sjis not supported.";!function(){var t=n("友");if(2!=t.length||38726!=(t[0]<<8|t[1]))throw"sjis not supported."}();var e=n(i);return{getMode:function(){return 8},getLength:function(){return~~(e.length/2)},write:function(t){for(var i=e,n=0;n+1<i.length;){var r=(255&i[n])<<8|255&i[n+1];if(33088<=r&&r<=40956)r-=33088;else{if(!(57408<=r&&r<=60351))throw"illegal char at "+(n+1)+"/"+r;r-=49472}t.put(r=192*(r>>>8&255)+(255&r),13),n+=2}if(n<i.length)throw"illegal char at "+(n+1)}}},v=function(){var t=[],i={writeByte:function(i){t.push(255&i)},writeShort:function(t){i.writeByte(t),i.writeByte(t>>>8)},writeBytes:function(t,n,e){n=n||0,e=e||t.length;for(var r=0;r<e;r+=1)i.writeByte(t[r+n])},writeString:function(t){for(var n=0;n<t.length;n+=1)i.writeByte(t.charCodeAt(n))},toByteArray:function(){return t},toString:function(){var i="";i+="[";for(var n=0;n<t.length;n+=1)n>0&&(i+=","),i+=t[n];return i+"]"}};return i},w=function(t){var i=t,n=0,e=0,r=0,o={read:function(){for(;r<8;){if(n>=i.length){if(0==r)return-1;throw"unexpected end of file./"+r}var t=i.charAt(n);if(n+=1,"="==t)return r=0,-1;t.match(/^\s$/)||(e=e<<6|a(t.charCodeAt(0)),r+=6)}var o=e>>>r-8&255;return r-=8,o}},a=function(t){if(65<=t&&t<=90)return t-65;if(97<=t&&t<=122)return t-97+26;if(48<=t&&t<=57)return t-48+52;if(43==t)return 62;if(47==t)return 63;throw"c:"+t};return o},M=function(t,i,n){for(var e=function(t,i){var n=t,e=i,r=new Array(t*i),o={setPixel:function(t,i,e){r[i*n+t]=e},write:function(t){t.writeString("GIF87a"),t.writeShort(n),t.writeShort(e),t.writeByte(128),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(255),t.writeByte(255),t.writeByte(255),t.writeString(","),t.writeShort(0),t.writeShort(0),t.writeShort(n),t.writeShort(e),t.writeByte(0);var i=a(2);t.writeByte(2);for(var r=0;i.length-r>255;)t.writeByte(255),t.writeBytes(i,r,255),r+=255;t.writeByte(i.length-r),t.writeBytes(i,r,i.length-r),t.writeByte(0),t.writeString(";")}},a=function(t){for(var i=1<<t,n=1+(1<<t),e=t+1,o=s(),a=0;a<i;a+=1)o.add(String.fromCharCode(a));o.add(String.fromCharCode(i)),o.add(String.fromCharCode(n));var c,u,h,l=v(),d=(c=l,u=0,h=0,{write:function(t,i){if(t>>>i!=0)throw"length over";for(;u+i>=8;)c.writeByte(255&(t<<u|h)),i-=8-u,t>>>=8-u,h=0,u=0;h|=t<<u,u+=i},flush:function(){u>0&&c.writeByte(h)}});d.write(i,e);var f=0,g=String.fromCharCode(r[f]);for(f+=1;f<r.length;){var p=String.fromCharCode(r[f]);f+=1,o.contains(g+p)?g+=p:(d.write(o.indexOf(g),e),o.size()<4095&&(o.size()==1<<e&&(e+=1),o.add(g+p)),g=p)}return d.write(o.indexOf(g),e),d.write(n,e),d.flush(),l.toByteArray()},s=function(){var t={},i=0,n={add:function(e){if(n.contains(e))throw"dup key:"+e;t[e]=i,i+=1},size:function(){return i},indexOf:function(i){return t[i]},contains:function(i){return void 0!==t[i]}};return n};return o}(t,i),r=0;r<i;r+=1)for(var o=0;o<t;o+=1)e.setPixel(o,r,n(o,r));var a=v();e.write(a);for(var s=function(){var t=0,i=0,n=0,e="",r={},o=function(t){e+=String.fromCharCode(a(63&t))},a=function(t){if(t<0);else{if(t<26)return 65+t;if(t<52)return t-26+97;if(t<62)return t-52+48;if(62==t)return 43;if(63==t)return 47}throw"n:"+t};return r.writeByte=function(e){for(t=t<<8|255&e,i+=8,n+=1;i>=6;)o(t>>>i-6),i-=6},r.flush=function(){if(i>0&&(o(t<<6-i),t=0,i=0),n%3!=0)for(var r=3-n%3,a=0;a<r;a+=1)e+="="},r.toString=function(){return e},r}(),c=a.toByteArray(),u=0;u<c.length;u+=1)s.writeByte(c[u]);return s.flush(),"data:image/gif;base64,"+s};return t}();r.stringToBytesFuncs["UTF-8"]=function(t){return function(t){for(var i=[],n=0;n<t.length;n++){var e=t.charCodeAt(n);e<128?i.push(e):e<2048?i.push(192|e>>6,128|63&e):e<55296||e>=57344?i.push(224|e>>12,128|e>>6&63,128|63&e):(n++,e=65536+((1023&e)<<10|1023&t.charCodeAt(n)),i.push(240|e>>18,128|e>>12&63,128|e>>6&63,128|63&e))}return i}(t)},void 0===(e="function"==typeof(n=function(){return r})?n.apply(i,[]):n)||(t.exports=e)},676:(t,i,n)=>{n.d(i,{default:()=>T});var e=function(){return(e=Object.assign||function(t){for(var i,n=1,e=arguments.length;n<e;n++)for(var r in i=arguments[n])Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r]);return t}).apply(this,arguments)},r=function(){for(var t=0,i=0,n=arguments.length;i<n;i++)t+=arguments[i].length;var e=Array(t),r=0;for(i=0;i<n;i++)for(var o=arguments[i],a=0,s=o.length;a<s;a++,r++)e[r]=o[a];return e},o=function(t){return!!t&&"object"==typeof t&&!Array.isArray(t)};function a(t){for(var i=[],n=1;n<arguments.length;n++)i[n-1]=arguments[n];if(!i.length)return t;var s=i.shift();return void 0!==s&&o(t)&&o(s)?(t=e({},t),Object.keys(s).forEach((function(i){var n=t[i],e=s[i];t[i]=Array.isArray(n)&&Array.isArray(e)?e:o(n)&&o(e)?a(Object.assign({},n),e):e})),a.apply(void 0,r([t],i))):t}function s(t,i){var n=document.createElement("a");n.download=i,n.href=t,document.body.appendChild(n),n.click(),document.body.removeChild(n)}function c(t){return i=this,void 0,e=function(){return function(t,i){var n,e,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,e&&(r=2&o[0]?e.return:o[0]?e.throw||((r=e.return)&&r.call(e),0):e.next)&&!(r=r.call(e,o[1])).done)return r;switch(e=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,e=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=i.call(t,a)}catch(t){o=[6,t],e=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(){return[2,new Promise((function(i){var n=new XMLHttpRequest;n.onload=function(){var t=new FileReader;t.onloadend=function(){i(t.result)},t.readAsDataURL(n.response)},n.open("GET",t),n.responseType="blob",n.send()}))]}))},new((n=void 0)||(n=Promise))((function(t,r){function o(t){try{s(e.next(t))}catch(t){r(t)}}function a(t){try{s(e.throw(t))}catch(t){r(t)}}function s(i){var e;i.done?t(i.value):(e=i.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,a)}s((e=e.apply(i,[])).next())}));var i,n,e}const u={L:.07,M:.15,Q:.25,H:.3};var h=function(){return(h=Object.assign||function(t){for(var i,n=1,e=arguments.length;n<e;n++)for(var r in i=arguments[n])Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r]);return t}).apply(this,arguments)};const l=function(){function t(t){var i=t.type;this._svg=t.svg,this._type=i}return t.prototype.draw=function(t,i,n,e){var r;switch(this._type){case"dots":r=this._drawDot;break;case"classy":r=this._drawClassy;break;case"classy-rounded":r=this._drawClassyRounded;break;case"rounded":r=this._drawRounded;break;case"extra-rounded":r=this._drawExtraRounded;break;case"square":default:r=this._drawSquare}r.call(this,{x:t,y:i,size:n,getNeighbor:e})},t.prototype._rotateFigure=function(t){var i,n=t.size,e=t.rotation,r=void 0===e?0:e,o=t.x+n/2,a=t.y+n/2;(0,t.draw)(),null===(i=this._element)||void 0===i||i.setAttribute("transform","rotate("+180*r/Math.PI+","+o+","+a+")")},t.prototype._basicDot=function(t){var i=this,n=t.size,e=t.x,r=t.y;this._rotateFigure(h(h({},t),{draw:function(){i._element=document.createElementNS("http://www.w3.org/2000/svg","circle"),i._element.setAttribute("cx",String(e+n/2)),i._element.setAttribute("cy",String(r+n/2)),i._element.setAttribute("r",String(n/2))}}))},t.prototype._basicSquare=function(t){var i=this,n=t.size,e=t.x,r=t.y;this._rotateFigure(h(h({},t),{draw:function(){i._element=document.createElementNS("http://www.w3.org/2000/svg","rect"),i._element.setAttribute("x",String(e)),i._element.setAttribute("y",String(r)),i._element.setAttribute("width",String(n)),i._element.setAttribute("height",String(n))}}))},t.prototype._basicSideRounded=function(t){var i=this,n=t.size,e=t.x,r=t.y;this._rotateFigure(h(h({},t),{draw:function(){i._element=document.createElementNS("http://www.w3.org/2000/svg","path"),i._element.setAttribute("d","M "+e+" "+r+"v "+n+"h "+n/2+"a "+n/2+" "+n/2+", 0, 0, 0, 0 "+-n)}}))},t.prototype._basicCornerRounded=function(t){var i=this,n=t.size,e=t.x,r=t.y;this._rotateFigure(h(h({},t),{draw:function(){i._element=document.createElementNS("http://www.w3.org/2000/svg","path"),i._element.setAttribute("d","M "+e+" "+r+"v "+n+"h "+n+"v "+-n/2+"a "+n/2+" "+n/2+", 0, 0, 0, "+-n/2+" "+-n/2)}}))},t.prototype._basicCornerExtraRounded=function(t){var i=this,n=t.size,e=t.x,r=t.y;this._rotateFigure(h(h({},t),{draw:function(){i._element=document.createElementNS("http://www.w3.org/2000/svg","path"),i._element.setAttribute("d","M "+e+" "+r+"v "+n+"h "+n+"a "+n+" "+n+", 0, 0, 0, "+-n+" "+-n)}}))},t.prototype._basicCornersRounded=function(t){var i=this,n=t.size,e=t.x,r=t.y;this._rotateFigure(h(h({},t),{draw:function(){i._element=document.createElementNS("http://www.w3.org/2000/svg","path"),i._element.setAttribute("d","M "+e+" "+r+"v "+n/2+"a "+n/2+" "+n/2+", 0, 0, 0, "+n/2+" "+n/2+"h "+n/2+"v "+-n/2+"a "+n/2+" "+n/2+", 0, 0, 0, "+-n/2+" "+-n/2)}}))},t.prototype._drawDot=function(t){this._basicDot({x:t.x,y:t.y,size:t.size,rotation:0})},t.prototype._drawSquare=function(t){this._basicSquare({x:t.x,y:t.y,size:t.size,rotation:0})},t.prototype._drawRounded=function(t){var i=t.x,n=t.y,e=t.size,r=t.getNeighbor,o=r?+r(-1,0):0,a=r?+r(1,0):0,s=r?+r(0,-1):0,c=r?+r(0,1):0,u=o+a+s+c;if(0!==u)if(u>2||o&&a||s&&c)this._basicSquare({x:i,y:n,size:e,rotation:0});else{if(2===u){var h=0;return o&&s?h=Math.PI/2:s&&a?h=Math.PI:a&&c&&(h=-Math.PI/2),void this._basicCornerRounded({x:i,y:n,size:e,rotation:h})}if(1===u)return h=0,s?h=Math.PI/2:a?h=Math.PI:c&&(h=-Math.PI/2),void this._basicSideRounded({x:i,y:n,size:e,rotation:h})}else this._basicDot({x:i,y:n,size:e,rotation:0})},t.prototype._drawExtraRounded=function(t){var i=t.x,n=t.y,e=t.size,r=t.getNeighbor,o=r?+r(-1,0):0,a=r?+r(1,0):0,s=r?+r(0,-1):0,c=r?+r(0,1):0,u=o+a+s+c;if(0!==u)if(u>2||o&&a||s&&c)this._basicSquare({x:i,y:n,size:e,rotation:0});else{if(2===u){var h=0;return o&&s?h=Math.PI/2:s&&a?h=Math.PI:a&&c&&(h=-Math.PI/2),void this._basicCornerExtraRounded({x:i,y:n,size:e,rotation:h})}if(1===u)return h=0,s?h=Math.PI/2:a?h=Math.PI:c&&(h=-Math.PI/2),void this._basicSideRounded({x:i,y:n,size:e,rotation:h})}else this._basicDot({x:i,y:n,size:e,rotation:0})},t.prototype._drawClassy=function(t){var i=t.x,n=t.y,e=t.size,r=t.getNeighbor,o=r?+r(-1,0):0,a=r?+r(1,0):0,s=r?+r(0,-1):0,c=r?+r(0,1):0;0!==o+a+s+c?o||s?a||c?this._basicSquare({x:i,y:n,size:e,rotation:0}):this._basicCornerRounded({x:i,y:n,size:e,rotation:Math.PI/2}):this._basicCornerRounded({x:i,y:n,size:e,rotation:-Math.PI/2}):this._basicCornersRounded({x:i,y:n,size:e,rotation:Math.PI/2})},t.prototype._drawClassyRounded=function(t){var i=t.x,n=t.y,e=t.size,r=t.getNeighbor,o=r?+r(-1,0):0,a=r?+r(1,0):0,s=r?+r(0,-1):0,c=r?+r(0,1):0;0!==o+a+s+c?o||s?a||c?this._basicSquare({x:i,y:n,size:e,rotation:0}):this._basicCornerExtraRounded({x:i,y:n,size:e,rotation:Math.PI/2}):this._basicCornerExtraRounded({x:i,y:n,size:e,rotation:-Math.PI/2}):this._basicCornersRounded({x:i,y:n,size:e,rotation:Math.PI/2})},t}();var d=function(){return(d=Object.assign||function(t){for(var i,n=1,e=arguments.length;n<e;n++)for(var r in i=arguments[n])Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r]);return t}).apply(this,arguments)};const f=function(){function t(t){var i=t.type;this._svg=t.svg,this._type=i}return t.prototype.draw=function(t,i,n,e){var r;switch(this._type){case"square":r=this._drawSquare;break;case"extra-rounded":r=this._drawExtraRounded;break;case"dot":default:r=this._drawDot}r.call(this,{x:t,y:i,size:n,rotation:e})},t.prototype._rotateFigure=function(t){var i,n=t.size,e=t.rotation,r=void 0===e?0:e,o=t.x+n/2,a=t.y+n/2;(0,t.draw)(),null===(i=this._element)||void 0===i||i.setAttribute("transform","rotate("+180*r/Math.PI+","+o+","+a+")")},t.prototype._basicDot=function(t){var i=this,n=t.size,e=t.x,r=t.y,o=n/7;this._rotateFigure(d(d({},t),{draw:function(){i._element=document.createElementNS("http://www.w3.org/2000/svg","path"),i._element.setAttribute("clip-rule","evenodd"),i._element.setAttribute("d","M "+(e+n/2)+" "+r+"a "+n/2+" "+n/2+" 0 1 0 0.1 0zm 0 "+o+"a "+(n/2-o)+" "+(n/2-o)+" 0 1 1 -0.1 0Z")}}))},t.prototype._basicSquare=function(t){var i=this,n=t.size,e=t.x,r=t.y,o=n/7;this._rotateFigure(d(d({},t),{draw:function(){i._element=document.createElementNS("http://www.w3.org/2000/svg","path"),i._element.setAttribute("clip-rule","evenodd"),i._element.setAttribute("d","M "+e+" "+r+"v "+n+"h "+n+"v "+-n+"zM "+(e+o)+" "+(r+o)+"h "+(n-2*o)+"v "+(n-2*o)+"h "+(2*o-n)+"z")}}))},t.prototype._basicExtraRounded=function(t){var i=this,n=t.x,e=t.y,r=t.size/7;this._rotateFigure(d(d({},t),{draw:function(){i._element=document.createElementNS("http://www.w3.org/2000/svg","path"),i._element.setAttribute("clip-rule","evenodd"),i._element.setAttribute("d","M "+n+" "+(e+2.5*r)+"v "+2*r+"a "+2.5*r+" "+2.5*r+", 0, 0, 0, "+2.5*r+" "+2.5*r+"h "+2*r+"a "+2.5*r+" "+2.5*r+", 0, 0, 0, "+2.5*r+" "+2.5*-r+"v "+-2*r+"a "+2.5*r+" "+2.5*r+", 0, 0, 0, "+2.5*-r+" "+2.5*-r+"h "+-2*r+"a "+2.5*r+" "+2.5*r+", 0, 0, 0, "+2.5*-r+" "+2.5*r+"M "+(n+2.5*r)+" "+(e+r)+"h "+2*r+"a "+1.5*r+" "+1.5*r+", 0, 0, 1, "+1.5*r+" "+1.5*r+"v "+2*r+"a "+1.5*r+" "+1.5*r+", 0, 0, 1, "+1.5*-r+" "+1.5*r+"h "+-2*r+"a "+1.5*r+" "+1.5*r+", 0, 0, 1, "+1.5*-r+" "+1.5*-r+"v "+-2*r+"a "+1.5*r+" "+1.5*r+", 0, 0, 1, "+1.5*r+" "+1.5*-r)}}))},t.prototype._drawDot=function(t){this._basicDot({x:t.x,y:t.y,size:t.size,rotation:t.rotation})},t.prototype._drawSquare=function(t){this._basicSquare({x:t.x,y:t.y,size:t.size,rotation:t.rotation})},t.prototype._drawExtraRounded=function(t){this._basicExtraRounded({x:t.x,y:t.y,size:t.size,rotation:t.rotation})},t}();var g=function(){return(g=Object.assign||function(t){for(var i,n=1,e=arguments.length;n<e;n++)for(var r in i=arguments[n])Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r]);return t}).apply(this,arguments)};const p=function(){function t(t){var i=t.type;this._svg=t.svg,this._type=i}return t.prototype.draw=function(t,i,n,e){var r;switch(this._type){case"square":r=this._drawSquare;break;case"dot":default:r=this._drawDot}r.call(this,{x:t,y:i,size:n,rotation:e})},t.prototype._rotateFigure=function(t){var i,n=t.size,e=t.rotation,r=void 0===e?0:e,o=t.x+n/2,a=t.y+n/2;(0,t.draw)(),null===(i=this._element)||void 0===i||i.setAttribute("transform","rotate("+180*r/Math.PI+","+o+","+a+")")},t.prototype._basicDot=function(t){var i=this,n=t.size,e=t.x,r=t.y;this._rotateFigure(g(g({},t),{draw:function(){i._element=document.createElementNS("http://www.w3.org/2000/svg","circle"),i._element.setAttribute("cx",String(e+n/2)),i._element.setAttribute("cy",String(r+n/2)),i._element.setAttribute("r",String(n/2))}}))},t.prototype._basicSquare=function(t){var i=this,n=t.size,e=t.x,r=t.y;this._rotateFigure(g(g({},t),{draw:function(){i._element=document.createElementNS("http://www.w3.org/2000/svg","rect"),i._element.setAttribute("x",String(e)),i._element.setAttribute("y",String(r)),i._element.setAttribute("width",String(n)),i._element.setAttribute("height",String(n))}}))},t.prototype._drawDot=function(t){this._basicDot({x:t.x,y:t.y,size:t.size,rotation:t.rotation})},t.prototype._drawSquare=function(t){this._basicSquare({x:t.x,y:t.y,size:t.size,rotation:t.rotation})},t}(),v="circle";var w=function(t,i,n,e){return new(n||(n=Promise))((function(r,o){function a(t){try{c(e.next(t))}catch(t){o(t)}}function s(t){try{c(e.throw(t))}catch(t){o(t)}}function c(t){var i;t.done?r(t.value):(i=t.value,i instanceof n?i:new n((function(t){t(i)}))).then(a,s)}c((e=e.apply(t,i||[])).next())}))},M=function(t,i){var n,e,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,e&&(r=2&o[0]?e.return:o[0]?e.throw||((r=e.return)&&r.call(e),0):e.next)&&!(r=r.call(e,o[1])).done)return r;switch(e=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,e=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=i.call(t,a)}catch(t){o=[6,t],e=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},y=[[1,1,1,1,1,1,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,0,0,0,0,0,1],[1,1,1,1,1,1,1]],b=[[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,1,1,1,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]];const m=function(){function t(t){this._element=document.createElementNS("http://www.w3.org/2000/svg","svg"),this._element.setAttribute("width",String(t.width)),this._element.setAttribute("height",String(t.height)),this._defs=document.createElementNS("http://www.w3.org/2000/svg","defs"),this._element.appendChild(this._defs),this._options=t}return Object.defineProperty(t.prototype,"width",{get:function(){return this._options.width},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._options.height},enumerable:!1,configurable:!0}),t.prototype.getElement=function(){return this._element},t.prototype.drawQR=function(t){return w(this,void 0,void 0,(function(){var i,n,e,r,o,a,s,c=this;return M(this,(function(h){switch(h.label){case 0:return i=t.getModuleCount(),n=Math.min(this._options.width,this._options.height)-2*this._options.margin,e=this._options.shape===v?n/Math.sqrt(2):n,r=Math.floor(e/i),o={hideXDots:0,hideYDots:0,width:0,height:0},this._qr=t,this._options.image?[4,this.loadImage()]:[3,2];case 1:if(h.sent(),!this._image)return[2];a=this._options,s=Math.floor(a.imageOptions.imageSize*u[a.qrOptions.errorCorrectionLevel]*i*i),o=function(t){var i=t.originalHeight,n=t.originalWidth,e=t.maxHiddenDots,r=t.maxHiddenAxisDots,o=t.dotSize,a={x:0,y:0},s={x:0,y:0};if(i<=0||n<=0||e<=0||o<=0)return{height:0,width:0,hideYDots:0,hideXDots:0};var c=i/n;return a.x=Math.floor(Math.sqrt(e/c)),a.x<=0&&(a.x=1),r&&r<a.x&&(a.x=r),a.x%2==0&&a.x--,s.x=a.x*o,a.y=1+2*Math.ceil((a.x*c-1)/2),s.y=Math.round(s.x*c),(a.y*a.x>e||r&&r<a.y)&&(r&&r<a.y?(a.y=r,a.y%2==0&&a.x--):a.y-=2,s.y=a.y*o,a.x=1+2*Math.ceil((a.y/c-1)/2),s.x=Math.round(s.y/c)),{height:s.y,width:s.x,hideYDots:a.y,hideXDots:a.x}}({originalWidth:this._image.width,originalHeight:this._image.height,maxHiddenDots:s,maxHiddenAxisDots:i-14,dotSize:r}),h.label=2;case 2:return this.drawBackground(),this.drawDots((function(t,n){var e,r,a,s,u,h;return!(c._options.imageOptions.hideBackgroundDots&&t>=(i-o.hideXDots)/2&&t<(i+o.hideXDots)/2&&n>=(i-o.hideYDots)/2&&n<(i+o.hideYDots)/2||(null===(e=y[t])||void 0===e?void 0:e[n])||(null===(r=y[t-i+7])||void 0===r?void 0:r[n])||(null===(a=y[t])||void 0===a?void 0:a[n-i+7])||(null===(s=b[t])||void 0===s?void 0:s[n])||(null===(u=b[t-i+7])||void 0===u?void 0:u[n])||(null===(h=b[t])||void 0===h?void 0:h[n-i+7]))})),this.drawCorners(),this._options.image?[4,this.drawImage({width:o.width,height:o.height,count:i,dotSize:r})]:[3,4];case 3:h.sent(),h.label=4;case 4:return[2]}}))}))},t.prototype.drawBackground=function(){var t,i,n,e=this._options;if(this._element){var r=null===(t=e.backgroundOptions)||void 0===t?void 0:t.gradient,o=null===(i=e.backgroundOptions)||void 0===i?void 0:i.color;if((r||o)&&this._createColor({options:r,color:o,additionalRotation:0,x:0,y:0,height:e.height,width:e.width,name:"background-color"}),null===(n=e.backgroundOptions)||void 0===n?void 0:n.round){var a=Math.min(e.width,e.height),s=document.createElementNS("http://www.w3.org/2000/svg","rect");this._backgroundClipPath=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._backgroundClipPath.setAttribute("id","clip-path-background-color"),this._defs.appendChild(this._backgroundClipPath),s.setAttribute("x",String((e.width-a)/2)),s.setAttribute("y",String((e.height-a)/2)),s.setAttribute("width",String(a)),s.setAttribute("height",String(a)),s.setAttribute("rx",String(a/2*e.backgroundOptions.round)),this._backgroundClipPath.appendChild(s)}}},t.prototype.drawDots=function(t){var i,n,e=this;if(!this._qr)throw"QR code is not defined";var r=this._options,o=this._qr.getModuleCount();if(o>r.width||o>r.height)throw"The canvas is too small.";var a=Math.min(r.width,r.height)-2*r.margin,s=r.shape===v?a/Math.sqrt(2):a,c=Math.floor(s/o),u=Math.floor((r.width-o*c)/2),h=Math.floor((r.height-o*c)/2),d=new l({svg:this._element,type:r.dotsOptions.type});this._dotsClipPath=document.createElementNS("http://www.w3.org/2000/svg","clipPath"),this._dotsClipPath.setAttribute("id","clip-path-dot-color"),this._defs.appendChild(this._dotsClipPath),this._createColor({options:null===(i=r.dotsOptions)||void 0===i?void 0:i.gradient,color:r.dotsOptions.color,additionalRotation:0,x:0,y:0,height:r.height,width:r.width,name:"dot-color"});for(var f=function(i){for(var r=function(r){return t&&!t(i,r)?"continue":(null===(n=g._qr)||void 0===n?void 0:n.isDark(i,r))?(d.draw(u+i*c,h+r*c,c,(function(n,a){return!(i+n<0||r+a<0||i+n>=o||r+a>=o)&&!(t&&!t(i+n,r+a))&&!!e._qr&&e._qr.isDark(i+n,r+a)})),void(d._element&&g._dotsClipPath&&g._dotsClipPath.appendChild(d._element))):"continue"},a=0;a<o;a++)r(a)},g=this,p=0;p<o;p++)f(p);if(r.shape===v){var w=Math.floor((a/c-o)/2),M=o+2*w,y=u-w*c,b=h-w*c,m=[],x=Math.floor(M/2);for(p=0;p<M;p++){m[p]=[];for(var j=0;j<M;j++)m[p][j]=p>=w-1&&p<=M-w&&j>=w-1&&j<=M-w||Math.sqrt((p-x)*(p-x)+(j-x)*(j-x))>x?0:this._qr.isDark(j-2*w<0?j:j>=o?j-2*w:j-w,p-2*w<0?p:p>=o?p-2*w:p-w)?1:0}var L=function(t){for(var i=function(i){if(!m[t][i])return"continue";d.draw(y+t*c,b+i*c,c,(function(n,e){var r;return!!(null===(r=m[t+n])||void 0===r?void 0:r[i+e])})),d._element&&D._dotsClipPath&&D._dotsClipPath.appendChild(d._element)},n=0;n<M;n++)i(n)},D=this;for(p=0;p<M;p++)L(p)}},t.prototype.drawCorners=function(){var t=this;if(!this._qr)throw"QR code is not defined";var i=this._options;if(!this._element)throw"Element code is not defined";var n=this._qr.getModuleCount(),e=Math.min(i.width,i.height)-2*i.margin,r=i.shape===v?e/Math.sqrt(2):e,o=Math.floor(r/n),a=7*o,s=3*o,c=Math.floor((i.width-n*o)/2),u=Math.floor((i.height-n*o)/2);[[0,0,0],[1,0,Math.PI/2],[0,1,-Math.PI/2]].forEach((function(e){var r,h,d,g,v,w,M,m,x,j,L,D,N=e[0],z=e[1],I=e[2],A=c+N*o*(n-7),k=u+z*o*(n-7),C=t._dotsClipPath,S=t._dotsClipPath;if(((null===(r=i.cornersSquareOptions)||void 0===r?void 0:r.gradient)||(null===(h=i.cornersSquareOptions)||void 0===h?void 0:h.color))&&((C=document.createElementNS("http://www.w3.org/2000/svg","clipPath")).setAttribute("id","clip-path-corners-square-color-"+N+"-"+z),t._defs.appendChild(C),t._cornersSquareClipPath=t._cornersDotClipPath=S=C,t._createColor({options:null===(d=i.cornersSquareOptions)||void 0===d?void 0:d.gradient,color:null===(g=i.cornersSquareOptions)||void 0===g?void 0:g.color,additionalRotation:I,x:A,y:k,height:a,width:a,name:"corners-square-color-"+N+"-"+z})),null===(v=i.cornersSquareOptions)||void 0===v?void 0:v.type){var T=new f({svg:t._element,type:i.cornersSquareOptions.type});T.draw(A,k,a,I),T._element&&C&&C.appendChild(T._element)}else for(var O=new l({svg:t._element,type:i.dotsOptions.type}),U=function(t){for(var i=function(i){if(!(null===(w=y[t])||void 0===w?void 0:w[i]))return"continue";O.draw(A+t*o,k+i*o,o,(function(n,e){var r;return!!(null===(r=y[t+n])||void 0===r?void 0:r[i+e])})),O._element&&C&&C.appendChild(O._element)},n=0;n<y[t].length;n++)i(n)},E=0;E<y.length;E++)U(E);if(((null===(M=i.cornersDotOptions)||void 0===M?void 0:M.gradient)||(null===(m=i.cornersDotOptions)||void 0===m?void 0:m.color))&&((S=document.createElementNS("http://www.w3.org/2000/svg","clipPath")).setAttribute("id","clip-path-corners-dot-color-"+N+"-"+z),t._defs.appendChild(S),t._cornersDotClipPath=S,t._createColor({options:null===(x=i.cornersDotOptions)||void 0===x?void 0:x.gradient,color:null===(j=i.cornersDotOptions)||void 0===j?void 0:j.color,additionalRotation:I,x:A+2*o,y:k+2*o,height:s,width:s,name:"corners-dot-color-"+N+"-"+z})),null===(L=i.cornersDotOptions)||void 0===L?void 0:L.type){var Q=new p({svg:t._element,type:i.cornersDotOptions.type});Q.draw(A+2*o,k+2*o,s,I),Q._element&&S&&S.appendChild(Q._element)}else{O=new l({svg:t._element,type:i.dotsOptions.type});var q=function(t){for(var i=function(i){if(!(null===(D=b[t])||void 0===D?void 0:D[i]))return"continue";O.draw(A+t*o,k+i*o,o,(function(n,e){var r;return!!(null===(r=b[t+n])||void 0===r?void 0:r[i+e])})),O._element&&S&&S.appendChild(O._element)},n=0;n<b[t].length;n++)i(n)};for(E=0;E<b.length;E++)q(E)}}))},t.prototype.loadImage=function(){var t=this;return new Promise((function(i,n){var e=t._options,r=new Image;if(!e.image)return n("Image is not defined");"string"==typeof e.imageOptions.crossOrigin&&(r.crossOrigin=e.imageOptions.crossOrigin),t._image=r,r.onload=function(){i()},r.src=e.image}))},t.prototype.drawImage=function(t){var i=t.width,n=t.height,e=t.count,r=t.dotSize;return w(this,void 0,void 0,(function(){var t,o,a,s,u,h,l,d,f;return M(this,(function(g){switch(g.label){case 0:return t=this._options,o=Math.floor((t.width-e*r)/2),a=Math.floor((t.height-e*r)/2),s=o+t.imageOptions.margin+(e*r-i)/2,u=a+t.imageOptions.margin+(e*r-n)/2,h=i-2*t.imageOptions.margin,l=n-2*t.imageOptions.margin,(d=document.createElementNS("http://www.w3.org/2000/svg","image")).setAttribute("x",String(s)),d.setAttribute("y",String(u)),d.setAttribute("width",h+"px"),d.setAttribute("height",l+"px"),[4,c(t.image||"")];case 1:return f=g.sent(),d.setAttribute("href",f||""),this._element.appendChild(d),[2]}}))}))},t.prototype._createColor=function(t){var i=t.options,n=t.color,e=t.additionalRotation,r=t.x,o=t.y,a=t.height,s=t.width,c=t.name,u=s>a?s:a,h=document.createElementNS("http://www.w3.org/2000/svg","rect");if(h.setAttribute("x",String(r)),h.setAttribute("y",String(o)),h.setAttribute("height",String(a)),h.setAttribute("width",String(s)),h.setAttribute("clip-path","url('#clip-path-"+c+"')"),i){var l;if("radial"===i.type)(l=document.createElementNS("http://www.w3.org/2000/svg","radialGradient")).setAttribute("id",c),l.setAttribute("gradientUnits","userSpaceOnUse"),l.setAttribute("fx",String(r+s/2)),l.setAttribute("fy",String(o+a/2)),l.setAttribute("cx",String(r+s/2)),l.setAttribute("cy",String(o+a/2)),l.setAttribute("r",String(u/2));else{var d=((i.rotation||0)+e)%(2*Math.PI),f=(d+2*Math.PI)%(2*Math.PI),g=r+s/2,p=o+a/2,v=r+s/2,w=o+a/2;f>=0&&f<=.25*Math.PI||f>1.75*Math.PI&&f<=2*Math.PI?(g-=s/2,p-=a/2*Math.tan(d),v+=s/2,w+=a/2*Math.tan(d)):f>.25*Math.PI&&f<=.75*Math.PI?(p-=a/2,g-=s/2/Math.tan(d),w+=a/2,v+=s/2/Math.tan(d)):f>.75*Math.PI&&f<=1.25*Math.PI?(g+=s/2,p+=a/2*Math.tan(d),v-=s/2,w-=a/2*Math.tan(d)):f>1.25*Math.PI&&f<=1.75*Math.PI&&(p+=a/2,g+=s/2/Math.tan(d),w-=a/2,v-=s/2/Math.tan(d)),(l=document.createElementNS("http://www.w3.org/2000/svg","linearGradient")).setAttribute("id",c),l.setAttribute("gradientUnits","userSpaceOnUse"),l.setAttribute("x1",String(Math.round(g))),l.setAttribute("y1",String(Math.round(p))),l.setAttribute("x2",String(Math.round(v))),l.setAttribute("y2",String(Math.round(w)))}i.colorStops.forEach((function(t){var i=t.offset,n=t.color,e=document.createElementNS("http://www.w3.org/2000/svg","stop");e.setAttribute("offset",100*i+"%"),e.setAttribute("stop-color",n),l.appendChild(e)})),h.setAttribute("fill","url('#"+c+"')"),this._defs.appendChild(l)}else n&&h.setAttribute("fill",n);this._element.appendChild(h)},t}(),x="canvas";for(var j={},L=0;L<=40;L++)j[L]=L;const D={type:x,shape:"square",width:300,height:300,data:"",margin:0,qrOptions:{typeNumber:j[0],mode:void 0,errorCorrectionLevel:"Q"},imageOptions:{hideBackgroundDots:!0,imageSize:.4,crossOrigin:void 0,margin:0},dotsOptions:{type:"square",color:"#000"},backgroundOptions:{round:0,color:"#fff"}};var N=function(){return(N=Object.assign||function(t){for(var i,n=1,e=arguments.length;n<e;n++)for(var r in i=arguments[n])Object.prototype.hasOwnProperty.call(i,r)&&(t[r]=i[r]);return t}).apply(this,arguments)};function z(t){var i=N({},t);if(!i.colorStops||!i.colorStops.length)throw"Field 'colorStops' is required in gradient";return i.rotation=i.rotation?Number(i.rotation):0,i.colorStops=i.colorStops.map((function(t){return N(N({},t),{offset:Number(t.offset)})})),i}function I(t){var i=N({},t);return i.width=Number(i.width),i.height=Number(i.height),i.margin=Number(i.margin),i.imageOptions=N(N({},i.imageOptions),{hideBackgroundDots:Boolean(i.imageOptions.hideBackgroundDots),imageSize:Number(i.imageOptions.imageSize),margin:Number(i.imageOptions.margin)}),i.margin>Math.min(i.width,i.height)&&(i.margin=Math.min(i.width,i.height)),i.dotsOptions=N({},i.dotsOptions),i.dotsOptions.gradient&&(i.dotsOptions.gradient=z(i.dotsOptions.gradient)),i.cornersSquareOptions&&(i.cornersSquareOptions=N({},i.cornersSquareOptions),i.cornersSquareOptions.gradient&&(i.cornersSquareOptions.gradient=z(i.cornersSquareOptions.gradient))),i.cornersDotOptions&&(i.cornersDotOptions=N({},i.cornersDotOptions),i.cornersDotOptions.gradient&&(i.cornersDotOptions.gradient=z(i.cornersDotOptions.gradient))),i.backgroundOptions&&(i.backgroundOptions=N({},i.backgroundOptions),i.backgroundOptions.gradient&&(i.backgroundOptions.gradient=z(i.backgroundOptions.gradient))),i}var A=n(192),k=n.n(A),C=function(t,i,n,e){return new(n||(n=Promise))((function(r,o){function a(t){try{c(e.next(t))}catch(t){o(t)}}function s(t){try{c(e.throw(t))}catch(t){o(t)}}function c(t){var i;t.done?r(t.value):(i=t.value,i instanceof n?i:new n((function(t){t(i)}))).then(a,s)}c((e=e.apply(t,i||[])).next())}))},S=function(t,i){var n,e,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,e&&(r=2&o[0]?e.return:o[0]?e.throw||((r=e.return)&&r.call(e),0):e.next)&&!(r=r.call(e,o[1])).done)return r;switch(e=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,e=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((r=(r=a.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=i.call(t,a)}catch(t){o=[6,t],e=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}};const T=function(){function t(t){this._options=t?I(a(D,t)):D,this.update()}return t._clearContainer=function(t){t&&(t.innerHTML="")},t.prototype._setupSvg=function(){var t=this;if(this._qr){var i=new m(this._options);this._svg=i.getElement(),this._svgDrawingPromise=i.drawQR(this._qr).then((function(){var n;t._svg&&(null===(n=t._extension)||void 0===n||n.call(t,i.getElement(),t._options))}))}},t.prototype._setupCanvas=function(){var t,i=this;this._qr&&(this._canvas=document.createElement("canvas"),this._canvas.width=this._options.width,this._canvas.height=this._options.height,this._setupSvg(),this._canvasDrawingPromise=null===(t=this._svgDrawingPromise)||void 0===t?void 0:t.then((function(){if(i._svg){var t=i._svg,n=(new XMLSerializer).serializeToString(t),e="data:image/svg+xml;base64,"+btoa(n),r=new Image;return new Promise((function(t){r.onload=function(){var n,e;null===(e=null===(n=i._canvas)||void 0===n?void 0:n.getContext("2d"))||void 0===e||e.drawImage(r,0,0),t()},r.src=e}))}})))},t.prototype._getElement=function(t){return void 0===t&&(t="png"),C(this,void 0,void 0,(function(){return S(this,(function(i){switch(i.label){case 0:if(!this._qr)throw"QR code is empty";return"svg"!==t.toLowerCase()?[3,2]:(this._svg&&this._svgDrawingPromise||this._setupSvg(),[4,this._svgDrawingPromise]);case 1:return i.sent(),[2,this._svg];case 2:return this._canvas&&this._canvasDrawingPromise||this._setupCanvas(),[4,this._canvasDrawingPromise];case 3:return i.sent(),[2,this._canvas]}}))}))},t.prototype.update=function(i){t._clearContainer(this._container),this._options=i?I(a(this._options,i)):this._options,this._options.data&&(this._qr=k()(this._options.qrOptions.typeNumber,this._options.qrOptions.errorCorrectionLevel),this._qr.addData(this._options.data,this._options.qrOptions.mode||function(t){switch(!0){case/^[0-9]*$/.test(t):return"Numeric";case/^[0-9A-Z $%*+\-./:]*$/.test(t):return"Alphanumeric";default:return"Byte"}}(this._options.data)),this._qr.make(),this._options.type===x?this._setupCanvas():this._setupSvg(),this.append(this._container))},t.prototype.append=function(t){if(t){if("function"!=typeof t.appendChild)throw"Container should be a single DOM node";this._options.type===x?this._canvas&&t.appendChild(this._canvas):this._svg&&t.appendChild(this._svg),this._container=t}},t.prototype.applyExtension=function(t){if(!t)throw"Extension function should be defined.";this._extension=t,this.update()},t.prototype.deleteExtension=function(){this._extension=void 0,this.update()},t.prototype.getRawData=function(t){return void 0===t&&(t="png"),C(this,void 0,void 0,(function(){var i,n,e;return S(this,(function(r){switch(r.label){case 0:if(!this._qr)throw"QR code is empty";return[4,this._getElement(t)];case 1:return(i=r.sent())?"svg"===t.toLowerCase()?(n=new XMLSerializer,e=n.serializeToString(i),[2,new Blob(['<?xml version="1.0" standalone="no"?>\r\n'+e],{type:"image/svg+xml"})]):[2,new Promise((function(n){return i.toBlob(n,"image/"+t,1)}))]:[2,null]}}))}))},t.prototype.download=function(t){return C(this,void 0,void 0,(function(){var i,n,e,r,o;return S(this,(function(a){switch(a.label){case 0:if(!this._qr)throw"QR code is empty";return i="png",n="qr","string"==typeof t?(i=t,console.warn("Extension is deprecated as argument for 'download' method, please pass object { name: '...', extension: '...' } as argument")):"object"==typeof t&&null!==t&&(t.name&&(n=t.name),t.extension&&(i=t.extension)),[4,this._getElement(i)];case 1:return(e=a.sent())?("svg"===i.toLowerCase()?(r=new XMLSerializer,o='<?xml version="1.0" standalone="no"?>\r\n'+(o=r.serializeToString(e)),s("data:image/svg+xml;charset=utf-8,"+encodeURIComponent(o),n+".svg")):s(e.toDataURL("image/"+i),n+"."+i),[2]):[2]}}))}))},t}()}},i={};function n(e){if(i[e])return i[e].exports;var r=i[e]={exports:{}};return t[e](r,r.exports,n),r.exports}return n.n=t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return n.d(i,{a:i}),i},n.d=(t,i)=>{for(var e in i)n.o(i,e)&&!n.o(t,e)&&Object.defineProperty(t,e,{enumerable:!0,get:i[e]})},n.o=(t,i)=>Object.prototype.hasOwnProperty.call(t,i),n(676)})().default}(f={path:undefined,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}}),f.exports)),p=class{constructor(i){t(this,i),this.qrData=void 0,this.size=256,this.logoSize=0,this.logoSrc=void 0,this.qrColor="#181B5E",this.rounded=!0}componentDidLoad(){new g({data:this.qrData,width:this.size,height:this.size,image:this.logoSize>0?this.logoSrc||l:void 0,margin:10,type:"svg",dotsOptions:{color:this.qrColor,type:this.rounded?"dots":"square"},cornersSquareOptions:{type:this.rounded?"extra-rounded":"square"},cornersDotOptions:{type:this.rounded?"dot":"square"},imageOptions:{margin:2,imageSize:this.logoSize}}).append(this.qr)}render(){return n("div",{ref:t=>{this.qr=t}})}},v={connect:"scan",certify:"credential"},w=class{constructor(n){t(this,n),this.gatacaLoginCompleted=i(this,"gatacaLoginCompleted",7),this.gatacaLoginFailed=i(this,"gatacaLoginFailed",7),this.checkStatus=void 0,this.createSession=void 0,this.successCallback=void 0,this.errorCallback=void 0,this.qrRole=void 0,this.callbackServer=void 0,this.autostart=!0,this.autorefresh=!1,this.v2=!1,this.qrModalTitle="Quick Access",this.qrModalDescription="Sign up or sign in by scanning the QR Code with the Gataca Wallet",this.hideBrandTitle=!1,this.sessionTimeout=300,this.pollingFrequency=3,this.dynamicLink=!0,this.sessionId=void 0,this.authenticationRequest=void 0,this.sessionData=void 0,this.result=e.NOT_STARTED}disconnectedCallback(){this.stop()}async componentDidLoad(){this.autostart&&await this.display()}async display(){await this.getSessionId(),this.result=e.ONGOING,this.poll().then((t=>{this.result=e.SUCCESS,this.sessionData=t,this.gatacaLoginCompleted.emit(t),this.successCallback(t)})).catch((t=>{this.clean();let i=t===e.EXPIRED;if(i&&this.autorefresh)this.display();else if(t!==e.NOT_STARTED){let n=i?new Error("User did not scan the QR in the alloted time"):new Error("Provided user credentials couldn't be validated");this.result=t,this.gatacaLoginFailed.emit(n),this.errorCallback(n)}})),r()&&this.dynamicLink&&(window.location.href=this.getLink())}async stop(){this.clean(),this.result===e.ONGOING&&(this.result=e.NOT_STARTED)}clean(){this.sessionData=void 0,this.sessionId=void 0}async getSessionData(){return this.sessionData?Promise.resolve(this.sessionData):Promise.reject(new Error("No successful login"))}async getSessionId(){if(this.sessionId)return this.sessionId;let{sessionId:t,authenticationRequest:i}=await this.createSession();return this.sessionId=t,this.authenticationRequest=i,this.sessionId}getLink(){if(this.v2&&"connect"==this.qrRole)return this.authenticationRequest;let t="https://gataca.page.link/"+v[this.qrRole]+"?";return t+="connect"===this.qrRole?"session="+this.sessionId:"process="+this.sessionId,t+="&callback="+o(encodeURIComponent(this.callbackServer)),t=encodeURIComponent(t),this.dynamicLink?"https://gataca.page.link/?apn=com.gatacaapp&ibi=com.gataca.wallet&link="+t:t}async poll(){let t=(new Date).getTime()+1e3*(this.sessionTimeout||300),i=1e3*(this.pollingFrequency||3),n=this,r=async function(o,a){let{result:s,data:c}=await(async t=>{if(t.result===e.NOT_STARTED)return{result:e.NOT_STARTED};let i=await t.getSessionId();return t.checkStatus(i)})(n);switch(s){case e.SUCCESS:o(c);break;case e.ONGOING:n.sessionTimeout>0&&(new Date).getTime()<t?setTimeout(r,i,o,a):a(e.EXPIRED);break;default:a(s)}};return new Promise(r)}renderQRSection(){switch(this.result){case e.NOT_STARTED:return this.renderRetryButton();case e.ONGOING:return this.renderQR(this.getLink(),300,!0);case e.EXPIRED:return this.renderRetryButton("QR Code expired");case e.FAILED:return this.renderRetryButton("User credentials not validated");case e.SUCCESS:return this.renderSuccess()}}renderSuccess(){return n("div",{class:"success"},n("img",{src:u,height:52,width:52}),n("p",{class:"successMsg"},"Successful Connection!"))}renderRetryButton(t){return n("div",{class:"reload"},n("div",{id:"notify",onClick:()=>this.display()},n("img",{src:h,height:24,width:24}),n("p",{class:"qrDescription"},"Click inside the box to "),n("p",{class:"qrDescription bold"},t?"Refresh QR Code":"Scan QR Code"),t&&n("div",{class:"alert"},n("img",{src:c,height:24,width:24}),n("p",null,t))),n("div",{id:"qrwait"},this.renderQR("waiting to start a session",250)))}renderQR(t,i,e){return n("gataca-qrdisplay",{qrData:t,rounded:!0,size:i,"logo-size":e?.33:0})}render(){return n("div",{class:"popUpContainer"},n("div",{class:"modal-window is-visible",onClick:t=>{t.stopPropagation()}},n("div",{class:"modal-window__content"},n("div",{class:"qrTitleContainer"},n("p",{class:"qrTitle"},this.qrModalTitle),!this.hideBrandTitle&&n("p",{class:"qrBrand"},"by Gataca"," ",n("span",null,n("img",{src:l}))),this.result!==e.SUCCESS&&n("p",{class:"qrDescription"},this.qrModalDescription)),n("div",{class:"qrSection"},this.renderQRSection()))))}};w.style='@import url("https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.brandSection{padding-top:5px;display:flex;align-items:center}.brandSection .gatacaImgSmall{height:13px;width:13px;margin:0;margin-right:10px}.popUpContainer .modal-window{position:relative;border-radius:6px;color:rgba(24, 27, 94, 0.8);box-shadow:0px 3px 10px rgba(48, 48, 48, 0.1);display:flex;flex-direction:column;justify-content:space-between;align-items:center;display:flex;z-index:1001;width:300px;padding:1px;background-color:white;min-height:408px;border-radius:12px;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;visibility:hidden;opacity:0}.popUpContainer .modal-window__content{width:100%;height:100%;text-align:left}.popUpContainer .modal-window p{font-family:"Work Sans", "Helvetica Neue", sans-serif;font-weight:normal;font-size:12px;letter-spacing:1px;color:#181B5E}.popUpContainer .modal-window .qrTitleContainer{padding:24px;padding-bottom:0px}.popUpContainer .modal-window .qrTitle{font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .modal-window .qrDescription{font-weight:400;font-size:14px;line-height:16.5px;padding-top:12px;padding-bottom:5px;color:#A1A1A1}.popUpContainer .modal-window .bold{font-weight:600}.popUpContainer .modal-window .qrBrand{margin-top:4px;font-size:14px;font-weight:400;line-height:16.5px;display:flex;align-items:center}.popUpContainer .modal-window .qrBrand img{margin-left:5px;height:12px}.popUpContainer .modal-window .qr-section{width:252px;height:252px}.popUpContainer .reload{height:252px;width:252px;border:1px dashed #A1A1A1;border-radius:12px;position:relative;margin:24px;display:flex;justify-content:center;align-items:center}.popUpContainer #qrwait{display:flex;justify-content:center}.popUpContainer #qrwait,.popUpContainer #notify{width:100%;height:100%;top:0;left:0;border-radius:20px}.popUpContainer #notify{z-index:10;background-color:gray;position:absolute;justify-self:center;justify-items:center;justify-content:center;align-items:center;align-content:center;align-self:center;display:flex;flex-direction:column;padding:24px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:20px;background:rgba(255, 255, 255, 0.9);}.popUpContainer .notify-text{font-family:"Work Sans";font-style:normal;font-weight:400;font-size:14px;line-height:16px;text-align:center;font-feature-settings:"salt" on;color:#8B8B8B;flex:none;order:1;align-self:stretch;flex-grow:0}.popUpContainer .alert{display:flex;flex-direction:row;align-items:center;justify-content:start;width:252px;position:absolute;bottom:0;background:#FFE5E5;border-radius:12px}.popUpContainer .alert img{margin:12px}.popUpContainer .alert p{font-weight:400;font-size:14px;line-height:16px;color:black}.popUpContainer .success{display:flex;height:300px;flex-direction:column;justify-content:center;align-items:center;padding:0px}.popUpContainer .success .successMsg{margin-top:20px;font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .is-visible{opacity:1;visibility:visible}.is-transparent{opacity:0}';const M={connect:"scan",certify:"credential"},y=class{constructor(n){t(this,n),this.gatacaLoginCompleted=i(this,"gatacaLoginCompleted",7),this.gatacaLoginFailed=i(this,"gatacaLoginFailed",7),this.successCallback=void 0,this.errorCallback=void 0,this.qrRole=void 0,this.callbackServer=void 0,this.socketEndpoint=void 0,this.sessionTimeout=300,this.wsOnOpen=void 0,this.wsOnMessage=void 0,this.autostart=!0,this.autorefresh=!1,this.v2=!1,this.qrModalTitle="Quick Access",this.qrModalDescription="Sign up or sign in by scanning the QR Code with the Gataca Wallet",this.hideBrandTitle=!1,this.dynamicLink=!0,this.sessionId=void 0,this.authenticationRequest=void 0,this.sessionData=void 0,this.result=e.NOT_STARTED}disconnectedCallback(){this.stop()}async componentDidLoad(){this.autostart&&await this.display()}async display(){let t=new WebSocket(this.socketEndpoint);setTimeout((()=>{this.socket.close(1e3,"")}),1e3*this.sessionTimeout),this.socket=t,t.onopen=()=>{this.wsOnOpen&&this.wsOnOpen(this.socket)},t.onmessage=t=>{if(this.wsOnMessage)this.wsOnMessage(this.socket,t);else{let i=JSON.parse(t.data);i.sessionId&&this.handleWSResponse(i)}},t.onerror=()=>{let i=new Error("Error connecting with server");this.result=e.FAILED,this.gatacaLoginFailed.emit(i),this.errorCallback(i),t.close(1e3,"")},t.onclose=()=>{if(this.result===e.ONGOING&&(this.result=e.EXPIRED),this.result===e.EXPIRED)if(this.autorefresh)this.display();else{let t=new Error("User did not scan the QR in the alloted time");this.gatacaLoginFailed.emit(t),this.errorCallback(t)}},r()&&this.dynamicLink&&(window.location.href=this.getLink())}sessionMsgReceived(t){this.handleWSResponse(t.detail)}handleWSResponse(t){switch(this.result=t.result,t.result){case e.ONGOING:this.sessionId=t.sessionId,this.authenticationRequest=t.authenticationRequest;break;case e.SUCCESS:this.sessionData=t.authenticatedUserData,this.gatacaLoginCompleted.emit(t.authenticatedUserData),this.successCallback(t.authenticatedUserData),this.socket.close(1e3,"");break;case e.FAILED:this.socket.close();let i=new Error("Provided user credentials couldn't be validated");this.gatacaLoginFailed.emit(i),this.errorCallback(i);break;case e.EXPIRED:if(this.socket.close(),this.autorefresh)this.display();else{let t=new Error("User did not scan the QR in the alloted time");this.gatacaLoginFailed.emit(t),this.errorCallback(t)}}}async stop(){this.sessionData=void 0,this.sessionId=void 0,this.socket.close(1e3,"Client stopped the connection")}async getSessionData(){return this.sessionData?Promise.resolve(this.sessionData):Promise.reject(new Error("No successful login"))}getLink(){if(this.v2&&"connect"==this.qrRole)return this.authenticationRequest;let t="https://gataca.page.link/"+M[this.qrRole]+"?";return t+="connect"===this.qrRole?"session="+this.sessionId:"process="+this.sessionId,t+="&callback="+o(encodeURIComponent(this.callbackServer)),t=encodeURIComponent(t),this.dynamicLink?"https://gataca.page.link/?apn=com.gatacaapp&ibi=com.gataca.wallet&link="+t:t}renderQRSection(){switch(this.result){case e.NOT_STARTED:return this.renderRetryButton();case e.ONGOING:return this.renderQR(this.getLink(),300,!0);case e.EXPIRED:return this.renderRetryButton("QR Code expired");case e.FAILED:return this.renderRetryButton("User credentials not validated");case e.SUCCESS:return this.renderSuccess()}}renderSuccess(){return n("div",{class:"success"},n("img",{src:u,height:52,width:52}),n("p",{class:"successMsg"},"Successful Connection!"))}renderRetryButton(t){return n("div",{class:"reload"},n("div",{id:"notify",onClick:()=>this.display()},n("img",{src:h,height:24,width:24}),n("p",{class:"qrDescription"},"Click inside the box to "),n("p",{class:"qrDescription bold"},t?"Refresh QR Code":"Scan QR Code"),t&&n("div",{class:"alert"},n("img",{src:c,height:24,width:24}),n("p",null,t))),n("div",{id:"qrwait"},this.renderQR("waiting to start a session",250)))}renderQR(t,i,e){return n("gataca-qrdisplay",{qrData:t,rounded:!0,size:i,"logo-size":e?.33:0})}render(){return n("div",{class:"popUpContainer"},n("div",{class:"modal-window is-visible",onClick:t=>{t.stopPropagation()}},n("div",{class:"modal-window__content"},n("div",{class:"qrTitleContainer"},n("p",{class:"qrTitle"},this.qrModalTitle),!this.hideBrandTitle&&n("p",{class:"qrBrand"},"by Gataca"," ",n("span",null,n("img",{src:l}))),this.result!==e.SUCCESS&&n("p",{class:"qrDescription"},this.qrModalDescription)),n("div",{class:"qrSection"},this.renderQRSection()))))}};y.style='@import url("https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.brandSection{padding-top:5px;display:flex;align-items:center}.brandSection .gatacaImgSmall{height:13px;width:13px;margin:0;margin-right:10px}.popUpContainer .modal-window{position:relative;border-radius:6px;color:rgba(24, 27, 94, 0.8);box-shadow:0px 3px 10px rgba(48, 48, 48, 0.1);display:flex;flex-direction:column;justify-content:space-between;align-items:center;display:flex;z-index:1001;width:300px;min-height:408px;padding:1px;background-color:white;border-radius:12px;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;visibility:hidden;opacity:0}.popUpContainer .modal-window__content{width:100%;height:100%;text-align:left}.popUpContainer .modal-window p{font-family:"Work Sans", "Helvetica Neue", sans-serif;font-weight:normal;font-size:12px;letter-spacing:1px;color:#181B5E}.popUpContainer .modal-window .qrTitleContainer{padding:24px;padding-bottom:0px}.popUpContainer .modal-window .qrTitle{font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .modal-window .qrDescription{font-weight:400;font-size:14px;line-height:16.5px;padding-top:12px;padding-bottom:5px;color:#A1A1A1}.popUpContainer .modal-window .bold{font-weight:600}.popUpContainer .modal-window .qrBrand{margin-top:4px;font-size:14px;font-weight:400;line-height:16.5px;display:flex;align-items:center}.popUpContainer .modal-window .qrBrand img{margin-left:5px;height:12px}.popUpContainer .modal-window .qr-section{width:252px;height:252px}.popUpContainer .reload{height:252px;width:252px;border:1px dashed #A1A1A1;border-radius:12px;position:relative;margin:24px;display:flex;justify-content:center;align-items:center}.popUpContainer #qrwait{display:flex;justify-content:center}.popUpContainer #qrwait,.popUpContainer #notify{width:100%;height:100%;top:0;left:0;border-radius:20px}.popUpContainer #notify{z-index:10;background-color:gray;position:absolute;justify-self:center;justify-items:center;justify-content:center;align-items:center;align-content:center;align-self:center;display:flex;flex-direction:column;padding:24px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:20px;background:rgba(255, 255, 255, 0.9);}.popUpContainer .notify-text{font-family:"Work Sans";font-style:normal;font-weight:400;font-size:14px;line-height:16px;text-align:center;font-feature-settings:"salt" on;color:#8B8B8B;flex:none;order:1;align-self:stretch;flex-grow:0}.popUpContainer .alert{display:flex;flex-direction:row;align-items:center;justify-content:start;width:252px;position:absolute;bottom:0;background:#FFE5E5;border-radius:12px}.popUpContainer .alert img{margin:12px}.popUpContainer .alert p{font-weight:400;font-size:14px;line-height:16px;color:black}.popUpContainer .success{display:flex;height:300px;flex-direction:column;justify-content:center;align-items:center;padding:0px}.popUpContainer .success .successMsg{margin-top:20px;font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .is-visible{opacity:1;visibility:visible}.is-transparent{opacity:0}';const b=class{constructor(e){t(this,e),this.gatacaLoginCompleted=i(this,"gatacaLoginCompleted",7),this.gatacaLoginFailed=i(this,"gatacaLoginFailed",7),this.buttonText="Easy login",this.checkStatus=void 0,this.createSession=void 0,this.successCallback=void 0,this.errorCallback=void 0,this.qrRole=void 0,this.callbackServer=void 0,this.sessionTimeout=void 0,this.pollingFrequency=void 0,this.autorefresh=!1,this.v2=!1,this.qrModalTitle="Quick Access",this.qrModalDescription="Sign up or sign in by scanning the QR Code with the Gataca Wallet",this.hideBrandTitle=!1,this.dynamicLink=!0,this.open=!1,this.qr=n("gataca-qr",{checkStatus:this.checkStatus,createSession:this.createSession,successCallback:this.successCallback,errorCallback:this.errorCallback,qrRole:this.qrRole,callbackServer:this.callbackServer,sessionTimeout:this.sessionTimeout,pollingFrequency:this.pollingFrequency,autostart:!0,autorefresh:this.autorefresh,v2:this.v2,qrModalTitle:this.qrModalTitle,qrModalDescription:this.qrModalDescription,hideBrandTitle:this.hideBrandTitle,dynamicLink:this.dynamicLink})}async getSessionData(){return this.qr.getSessionData()}renderModal(){return this.qr}renderButton(){return n("div",{class:"gatacaButtonWrapper"},n("button",{class:"gatacaButton",onClick:()=>{this.open=!this.open,this.open?this.qr.display():this.qr.stop()}},n("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAYAAACN1PRVAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHvSURBVHgB3ZZPTttAFMbfe3YjL7qYLopcpZXSG7Q3CDfIsqrSJpyg5QQtJ2h7glgUdVs4AeEE5AYEQSDAgtnw357Hm0hAQDaeIRFCfFKyeKPxzzPzvc+DUKCZN80GEv1ABgWOQgSdGbOwv7u0nDueV4zjTzUIKhuAZna4vdQFR828azbI0K/TI/qodaLvjlP+tLDGDCs+IKv9Lbsi7kcv0w9541Q0EREPYcoieEQ9KiyECRXHzbpBUOcnYTfPFOOaaGVx9WsLiDrSIp0iU0wFNgIx/AQyc9I/OmOjy+Y8aBvHQcDUYebewc6/Xtk8J5htcg5efEPGhk0JtqkyBjo7DuZcnuO2sqCyKv8rUDmfTS9IBURqBAL+I6CkzBjOMOs22TLY21n8fl17KzXR3uDvb/CQk0GEdfvN07QvpnAOaGfYaRT25JzU6+rnG2tTpcWAy+Cp0m3U/URLms8HWfg/rn6RFaGSs9KQkZMpvGBWNs2Vandt46ac6YNBuc0fDLMaOU5DFybQ8039p/KJ4bq4rwPewtqoM/1gsCm/NfBXvWjgHhhuDAeLyd3qVSifHQULeZkou9EqemLhmUmav8qrZ4GEMGA7ivzjKvfeqGptFV2YdWPMPHHq0cCh3DdpVdLl/XCY9J1gVvbCiWa6N+JLocPFjCsx9cAAAAAASUVORK5CYII=",class:"buttonImg",alt:this.buttonText}),n("span",null,this.buttonText)))}render(){return n("div",{class:"buttonContainer"},this.renderButton(),this.open&&this.renderModal())}};b.style='@import url("https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.buttonContainer{display:inline-block;text-align:right;padding:10px;position:relative}.gatacaButtonWrapper{margin:8px}.gatacaButtonWrapper .gatacaButton{display:flex;min-width:100px;padding:8px 8px;background-color:white;font-size:12px;font-family:"Work Sans", sans-serif;letter-spacing:1px;font-weight:2;justify-content:space-between;align-items:center;border-radius:6px;border:1px solid rgba(24, 27, 94, 0.5);color:rgba(24, 27, 94, 0.8);box-shadow:0px 1px 3px rgba(48, 48, 48, 0.15);cursor:pointer}.gatacaButtonWrapper .gatacaButton>span{margin-right:10px}.gatacaButtonWrapper .gatacaButton:hover{box-shadow:0px 2px 8px rgba(48, 48, 48, 0.1)}.gatacaButtonWrapper .buttonText{text-align:right;font-size:8px;color:rgba(24, 27, 94, 0.5);font-family:"Helvetica Neue", sans-serif;letter-spacing:1px;padding-right:8px;font-weight:1}.gatacaButtonWrapper .buttonImg{height:25px;width:25px;margin:0;margin-right:20px}';const m=class{constructor(e){t(this,e),this.gatacaLoginCompleted=i(this,"gatacaLoginCompleted",7),this.gatacaLoginFailed=i(this,"gatacaLoginFailed",7),this.buttonText="Easy login",this.successCallback=void 0,this.errorCallback=void 0,this.qrRole=void 0,this.callbackServer=void 0,this.socketEndpoint=void 0,this.sessionTimeout=void 0,this.wsOnOpen=void 0,this.wsOnMessage=void 0,this.autostart=!0,this.autorefresh=!1,this.v2=!1,this.qrModalTitle="Quick Access",this.qrModalDescription="Sign up or sign in by scanning the QR Code with the Gataca Wallet",this.hideBrandTitle=!1,this.dynamicLink=!0,this.open=!1,this.qr=n("gataca-qrws",{wsOnMessage:this.wsOnMessage,wsOnOpen:this.wsOnOpen,successCallback:this.successCallback,errorCallback:this.errorCallback,qrRole:this.qrRole,callbackServer:this.callbackServer,sessionTimeout:this.sessionTimeout,socketEndpoint:this.socketEndpoint,autostart:!0,autorefresh:this.autorefresh,v2:this.v2,qrModalTitle:this.qrModalTitle,qrModalDescription:this.qrModalDescription,hideBrandTitle:this.hideBrandTitle,dynamicLink:this.dynamicLink})}async getSessionData(){return this.qr.getSessionData()}renderModal(){return this.qr}renderButton(){return n("div",{class:"gatacaButtonWrapper"},n("button",{class:"gatacaButton",onClick:()=>{this.open=!this.open,this.open?this.qr.display():this.qr.stop()}},n("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAYAAACN1PRVAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAHvSURBVHgB3ZZPTttAFMbfe3YjL7qYLopcpZXSG7Q3CDfIsqrSJpyg5QQtJ2h7glgUdVs4AeEE5AYEQSDAgtnw357Hm0hAQDaeIRFCfFKyeKPxzzPzvc+DUKCZN80GEv1ABgWOQgSdGbOwv7u0nDueV4zjTzUIKhuAZna4vdQFR828azbI0K/TI/qodaLvjlP+tLDGDCs+IKv9Lbsi7kcv0w9541Q0EREPYcoieEQ9KiyECRXHzbpBUOcnYTfPFOOaaGVx9WsLiDrSIp0iU0wFNgIx/AQyc9I/OmOjy+Y8aBvHQcDUYebewc6/Xtk8J5htcg5efEPGhk0JtqkyBjo7DuZcnuO2sqCyKv8rUDmfTS9IBURqBAL+I6CkzBjOMOs22TLY21n8fl17KzXR3uDvb/CQk0GEdfvN07QvpnAOaGfYaRT25JzU6+rnG2tTpcWAy+Cp0m3U/URLms8HWfg/rn6RFaGSs9KQkZMpvGBWNs2Vandt46ac6YNBuc0fDLMaOU5DFybQ8039p/KJ4bq4rwPewtqoM/1gsCm/NfBXvWjgHhhuDAeLyd3qVSifHQULeZkou9EqemLhmUmav8qrZ4GEMGA7ivzjKvfeqGptFV2YdWPMPHHq0cCh3DdpVdLl/XCY9J1gVvbCiWa6N+JLocPFjCsx9cAAAAAASUVORK5CYII=",class:"buttonImg",alt:this.buttonText}),n("span",null,this.buttonText)))}render(){return n("div",{class:"buttonContainer"},this.renderButton(),this.open&&this.renderModal())}};m.style='@import url("https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.buttonContainer{display:inline-block;text-align:right;padding:10px;position:relative}.gatacaButtonWrapper{margin:8px}.gatacaButtonWrapper .gatacaButton{display:flex;min-width:100px;padding:8px 8px;background-color:white;font-size:12px;font-family:"Work Sans", sans-serif;letter-spacing:1px;font-weight:2;justify-content:space-between;align-items:center;border-radius:6px;border:1px solid rgba(24, 27, 94, 0.5);color:rgba(24, 27, 94, 0.8);box-shadow:0px 1px 3px rgba(48, 48, 48, 0.15);cursor:pointer}.gatacaButtonWrapper .gatacaButton>span{margin-right:10px}.gatacaButtonWrapper .gatacaButton:hover{box-shadow:0px 2px 8px rgba(48, 48, 48, 0.1)}.gatacaButtonWrapper .buttonText{text-align:right;font-size:8px;color:rgba(24, 27, 94, 0.5);font-family:"Helvetica Neue", sans-serif;letter-spacing:1px;padding-right:8px;font-weight:1}.gatacaButtonWrapper .buttonImg{height:25px;width:25px;margin:0;margin-right:20px}';export{s as gataca_autoqr,w as gataca_qr,p as gataca_qrdisplay,y as gataca_qrws,b as gataca_ssibutton,m as gataca_ssibuttonws}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gataca/qr",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Gataca component to display presentation requests in QR",
5
5
  "author": "Gataca <it@gataca.io>",
6
6
  "licenses": [
@@ -1,14 +0,0 @@
1
- 'use strict';
2
-
3
- const logoGatacaSvg = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI2LjUuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNp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UzMDI2IDIwLjg3MjYgNy42NzIwMyAyMC4xMjg2IDYuMTgzNjMgMTguODY2N0M0LjY5NTI0IDE3LjYwNDcgMy42NTczIDE1Ljg5MzIgMy4yMjYyNSAxMy45OTAxQzIuNzk1MTkgMTIuMDg2OSAyLjk5NDM2IDEwLjA5NTIgMy43OTM3NCA4LjMxNTA4QzQuNTkzMTMgNi41MzQ5NiA1Ljk0OTQyIDUuMDYyODggNy42NTgyMyA0LjEyMDY1QzkuMzY3MDUgMy4xNzg0MyAxMS4zMzU4IDIuODE3MTEgMTMuMjY3OCAzLjA5MTE2QzE1LjE5OTkgMy4zNjUyIDE2Ljk5MDUgNC4yNTk3NSAxOC4zNjk5IDUuNjQwMDFMMjIuOTk5OSAxMCIgc3Ryb2tlPSIjOEI4QjhCIiBzdHJva2Utd2lkdGg9IjIiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K';
10
-
11
- exports.gatIconAlertSvg = gatIconAlertSvg;
12
- exports.gatIconCheckSvg = gatIconCheckSvg;
13
- exports.gatIconRefreshSvg = gatIconRefreshSvg;
14
- exports.logoGatacaSvg = logoGatacaSvg;
@@ -1,88 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-0b7a1532.js');
6
-
7
- const gatacaAutoqrCss = "@import url(\"https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap\"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:\"\";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.buttonContainer{display:inline-block;text-align:right;padding:10px;position:relative}.gatacaButtonWrapper{margin:8px}.gatacaButtonWrapper .gatacaButton{display:flex;min-width:100px;padding:8px 8px;background-color:white;font-size:12px;font-family:\"Work Sans\", sans-serif;letter-spacing:1px;font-weight:2;justify-content:space-between;align-items:center;border-radius:6px;border:1px solid rgba(24, 27, 94, 0.5);color:rgba(24, 27, 94, 0.8);box-shadow:0px 1px 3px rgba(48, 48, 48, 0.15);cursor:pointer}.gatacaButtonWrapper .gatacaButton>span{margin-right:10px}.gatacaButtonWrapper .gatacaButton:hover{box-shadow:0px 2px 8px rgba(48, 48, 48, 0.1)}.gatacaButtonWrapper .buttonText{text-align:right;font-size:8px;color:rgba(24, 27, 94, 0.5);font-family:\"Helvetica Neue\", sans-serif;letter-spacing:1px;padding-right:8px;font-weight:1}.gatacaButtonWrapper .buttonImg{height:25px;width:25px;margin:0;margin-right:20px}";
8
-
9
- const DEFAULT_REPOSITORY = "https://studio.gataca.io/api/v1/qrs";
10
- const GatacaAutoQR = class {
11
- constructor(hostRef) {
12
- index.registerInstance(this, hostRef);
13
- this.gatacaLoginCompleted = index.createEvent(this, "gatacaLoginCompleted", 7);
14
- this.gatacaLoginFailed = index.createEvent(this, "gatacaLoginFailed", 7);
15
- this.configId = undefined;
16
- this.configRepository = DEFAULT_REPOSITORY;
17
- this.successCallback = undefined;
18
- this.errorCallback = undefined;
19
- this.checkStatus = undefined;
20
- this.createSession = undefined;
21
- this.wsOnOpen = undefined;
22
- this.wsOnMessage = undefined;
23
- this.config = undefined;
24
- this.loading = undefined;
25
- this.loading = true;
26
- fetch(this.configRepository + "/" + this.configId, {
27
- method: "GET",
28
- headers: {
29
- "Content-Type": "application/json",
30
- },
31
- })
32
- .then((response) => {
33
- response
34
- .json()
35
- .then((data) => {
36
- this.config = data;
37
- this.loading = false;
38
- })
39
- .catch((err) => {
40
- console.log("Cannot retrieve selected config", err);
41
- this.loading = false;
42
- });
43
- })
44
- .catch((err) => {
45
- console.log("Cannot retrieve selected config", err);
46
- this.loading = false;
47
- });
48
- }
49
- /**
50
- * Retrieve manually the session data on a successful login
51
- */
52
- async getSessionData() {
53
- return this.qr.getSessionData();
54
- }
55
- selectQR() {
56
- if (this.config.useButton) {
57
- if (this.config.useWs) {
58
- this.qr = (index.h("gataca-ssibuttonws", { buttonText: this.config.buttonText, wsOnMessage: this.wsOnMessage || this.config.wsOnMessage, wsOnOpen: this.wsOnOpen || this.config.wsOnOpen, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, socketEndpoint: this.config.socketEndpoint, autostart: true, autorefresh: this.config.autorefresh, v2: this.config.v2, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
59
- }
60
- else {
61
- this.qr = (index.h("gataca-ssibutton", { buttonText: this.config.buttonText, checkStatus: this.checkStatus || this.config.checkStatus, createSession: this.createSession || this.config.createSession, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, pollingFrequency: this.config.pollingFrequency, autorefresh: this.config.autorefresh, v2: this.config.v2, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
62
- }
63
- }
64
- else {
65
- if (this.config.useWs) {
66
- this.qr = (index.h("gataca-qrws", { wsOnMessage: this.wsOnMessage || this.config.wsOnMessage, wsOnOpen: this.wsOnOpen || this.config.wsOnOpen, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, socketEndpoint: this.config.socketEndpoint, autostart: this.config.autostart, autorefresh: this.config.autorefresh, v2: this.config.v2, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
67
- }
68
- else {
69
- this.qr = (index.h("gataca-qr", { checkStatus: this.checkStatus || this.config.checkStatus, createSession: this.createSession || this.config.createSession, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, pollingFrequency: this.config.pollingFrequency, autostart: this.config.autostart, autorefresh: this.config.autorefresh, v2: this.config.v2, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
70
- }
71
- }
72
- }
73
- render() {
74
- if (this.loading) {
75
- //TODO: Improve loading message
76
- return index.h("div", null, "Loading...");
77
- }
78
- if (this.config) {
79
- this.selectQR();
80
- return this.qr;
81
- }
82
- //TODO: Improve error message
83
- return index.h("div", null, "Error loading your config...");
84
- }
85
- };
86
- GatacaAutoQR.style = gatacaAutoqrCss;
87
-
88
- exports.gataca_autoqr = GatacaAutoQR;
@@ -1,175 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-0b7a1532.js');
6
- const gatIconRefresh = require('./gat-icon-refresh-751505ff.js');
7
- require('./qr-code-styling-412bbc7a.js');
8
- const utils = require('./utils-383ee834.js');
9
-
10
- const gatacaQrCss = "@import url(\"https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap\"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:\"\";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.brandSection{padding-top:5px;display:flex;align-items:center}.brandSection .gatacaImgSmall{height:13px;width:13px;margin:0;margin-right:10px}.popUpContainer .modal-window{position:relative;border-radius:6px;color:rgba(24, 27, 94, 0.8);box-shadow:0px 3px 10px rgba(48, 48, 48, 0.1);display:flex;flex-direction:column;justify-content:space-between;align-items:center;display:flex;z-index:1001;width:300px;min-height:408px;border-radius:12px;-webkit-transition:opacity 0.5s, visibility 0s 0.5s;transition:opacity 0.5s, visibility 0s 0.5s;visibility:hidden;opacity:0}.popUpContainer .modal-window__content{width:100%;height:100%;text-align:left}.popUpContainer .modal-window p{font-family:\"Work Sans\", \"Helvetica Neue\", sans-serif;font-weight:normal;font-size:12px;letter-spacing:1px;color:#181B5E}.popUpContainer .modal-window .qrTitleContainer{padding:24px;padding-bottom:0px}.popUpContainer .modal-window .qrTitle{font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .modal-window .qrDescription{font-weight:400;font-size:14px;line-height:16.5px;padding-top:12px;padding-bottom:5px;color:#A1A1A1}.popUpContainer .modal-window .bold{font-weight:600}.popUpContainer .modal-window .qrBrand{margin-top:4px;font-size:14px;font-weight:400;line-height:16.5px;display:flex;align-items:center}.popUpContainer .modal-window .qrBrand img{margin-left:5px;height:12px}.popUpContainer .modal-window .qr-section{width:252px;height:252px}.popUpContainer .reload{height:252px;width:252px;border:1px dashed #A1A1A1;border-radius:12px;position:relative;margin:24px;display:flex;justify-content:center;align-items:center}.popUpContainer #qrwait{display:flex;justify-content:center}.popUpContainer #qrwait,.popUpContainer #notify{width:100%;height:100%;top:0;left:0;border-radius:20px}.popUpContainer #notify{z-index:10;background-color:gray;position:absolute;justify-self:center;justify-items:center;justify-content:center;align-items:center;align-content:center;align-self:center;display:flex;flex-direction:column;padding:24px;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;align-items:center;padding:20px;background:rgba(255, 255, 255, 0.9);}.popUpContainer .notify-text{font-family:\"Work Sans\";font-style:normal;font-weight:400;font-size:14px;line-height:16px;text-align:center;font-feature-settings:\"salt\" on;color:#8B8B8B;flex:none;order:1;align-self:stretch;flex-grow:0}.popUpContainer .alert{display:flex;flex-direction:row;align-items:center;justify-content:start;width:252px;position:absolute;bottom:0;background:#FFE5E5;border-radius:12px}.popUpContainer .alert img{margin:12px}.popUpContainer .alert p{font-weight:400;font-size:14px;line-height:16px;color:black}.popUpContainer .success{display:flex;height:300px;flex-direction:column;justify-content:center;align-items:center;padding:0px}.popUpContainer .success .successMsg{margin-top:20px;font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .is-visible{opacity:1;visibility:visible}.is-transparent{opacity:0}";
11
-
12
- const DEEP_LINK_PREFIX = "https://gataca.page.link/?apn=com.gatacaapp&ibi=com.gataca.wallet&link=";
13
- //Default values
14
- const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
15
- const DEFAULT_POLLING_FREQ = 3;
16
- const QR_ROLE_CONNECT = "connect";
17
- const FUNCTION_ROLES = {
18
- connect: "scan",
19
- certify: "credential",
20
- };
21
- const GatacaQR = class {
22
- constructor(hostRef) { index.registerInstance(this, hostRef); this.gatacaLoginCompleted = index.createEvent(this, "gatacaLoginCompleted", 7); this.gatacaLoginFailed = index.createEvent(this, "gatacaLoginFailed", 7); this.checkStatus = undefined; this.createSession = undefined; this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.autostart = true; this.autorefresh = false; this.v2 = false; this.qrModalTitle = "Quick Access"; this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideBrandTitle = false; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.pollingFrequency = DEFAULT_POLLING_FREQ; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = utils.RESULT_STATUS.NOT_STARTED; }
23
- disconnectedCallback() {
24
- this.stop();
25
- }
26
- async componentDidLoad() {
27
- if (this.autostart) {
28
- await this.display();
29
- }
30
- }
31
- /**
32
- * Force manually the display of a QR
33
- */
34
- async display() {
35
- await this.getSessionId();
36
- this.result = utils.RESULT_STATUS.ONGOING;
37
- this.poll()
38
- .then((data) => {
39
- this.result = utils.RESULT_STATUS.SUCCESS;
40
- this.sessionData = data;
41
- this.gatacaLoginCompleted.emit(data);
42
- this.successCallback(data);
43
- })
44
- .catch((err) => {
45
- this.clean();
46
- let expired = err === utils.RESULT_STATUS.EXPIRED;
47
- if (expired && this.autorefresh) {
48
- this.display();
49
- }
50
- else {
51
- if (err !== utils.RESULT_STATUS.NOT_STARTED) {
52
- let error = expired
53
- ? new Error("User did not scan the QR in the alloted time")
54
- : new Error("Provided user credentials couldn't be validated");
55
- this.result = err;
56
- this.gatacaLoginFailed.emit(error);
57
- this.errorCallback(error);
58
- }
59
- }
60
- });
61
- if (utils.checkMobile() && this.dynamicLink) {
62
- window.location.href = this.getLink();
63
- }
64
- }
65
- /**
66
- * Stop manually an ongoing session
67
- */
68
- async stop() {
69
- this.clean();
70
- if (this.result === utils.RESULT_STATUS.ONGOING) {
71
- this.result = utils.RESULT_STATUS.NOT_STARTED;
72
- }
73
- }
74
- clean() {
75
- this.sessionData = undefined;
76
- this.sessionId = undefined;
77
- }
78
- /**
79
- * Retrieve manually the session data on a successful login
80
- */
81
- async getSessionData() {
82
- return this.sessionData
83
- ? Promise.resolve(this.sessionData)
84
- : Promise.reject(new Error("No successful login"));
85
- }
86
- async getSessionId() {
87
- if (this.sessionId) {
88
- return this.sessionId;
89
- }
90
- let { sessionId, authenticationRequest } = await this.createSession();
91
- this.sessionId = sessionId;
92
- this.authenticationRequest = authenticationRequest;
93
- return this.sessionId;
94
- }
95
- getLink() {
96
- if (this.v2 && this.qrRole == QR_ROLE_CONNECT) {
97
- return this.authenticationRequest;
98
- }
99
- let op = FUNCTION_ROLES[this.qrRole];
100
- let link = "https://gataca.page.link/" + op + "?";
101
- link +=
102
- this.qrRole === QR_ROLE_CONNECT
103
- ? "session=" + this.sessionId
104
- : "process=" + this.sessionId;
105
- link +=
106
- "&callback=" + utils.base64UrlEncode(encodeURIComponent(this.callbackServer));
107
- link = encodeURIComponent(link);
108
- return this.dynamicLink ? DEEP_LINK_PREFIX + link : link;
109
- }
110
- async poll() {
111
- let endTime = new Date().getTime() +
112
- (this.sessionTimeout || DEFAULT_SESSION_TIMEOUT) * 1000;
113
- let interval = (this.pollingFrequency || DEFAULT_POLLING_FREQ) * 1000;
114
- let checkFunc = async (component) => {
115
- if (component.result === utils.RESULT_STATUS.NOT_STARTED) {
116
- return { result: utils.RESULT_STATUS.NOT_STARTED };
117
- }
118
- let id = await component.getSessionId();
119
- return component.checkStatus(id);
120
- };
121
- let component = this;
122
- let checkCondition = async function (resolve, reject) {
123
- // If the condition is met, we're done!
124
- let { result, data } = await checkFunc(component);
125
- switch (result) {
126
- case utils.RESULT_STATUS.SUCCESS:
127
- resolve(data);
128
- break;
129
- case utils.RESULT_STATUS.ONGOING:
130
- if (component.sessionTimeout > 0 && new Date().getTime() < endTime) {
131
- setTimeout(checkCondition, interval, resolve, reject);
132
- }
133
- else {
134
- reject(utils.RESULT_STATUS.EXPIRED);
135
- }
136
- break;
137
- default:
138
- reject(result);
139
- break;
140
- }
141
- };
142
- return new Promise(checkCondition);
143
- }
144
- renderQRSection() {
145
- switch (this.result) {
146
- case utils.RESULT_STATUS.NOT_STARTED:
147
- return this.renderRetryButton();
148
- case utils.RESULT_STATUS.ONGOING:
149
- return this.renderQR(this.getLink(), 300, true);
150
- case utils.RESULT_STATUS.EXPIRED:
151
- return this.renderRetryButton("QR Code expired");
152
- case utils.RESULT_STATUS.FAILED:
153
- return this.renderRetryButton("User credentials not validated");
154
- case utils.RESULT_STATUS.SUCCESS:
155
- return this.renderSuccess();
156
- }
157
- }
158
- renderSuccess() {
159
- return (index.h("div", { class: "success" }, index.h("img", { src: gatIconRefresh.gatIconCheckSvg, height: 52, width: 52 }), index.h("p", { class: "successMsg" }, "Successful Connection!")));
160
- }
161
- renderRetryButton(errorMessage) {
162
- return (index.h("div", { class: "reload" }, index.h("div", { id: "notify", onClick: () => this.display() }, index.h("img", { src: gatIconRefresh.gatIconRefreshSvg, height: 24, width: 24 }), index.h("p", { class: "qrDescription" }, "Click inside the box to "), errorMessage ? (index.h("p", { class: "qrDescription bold" }, "Refresh QR Code")) : (index.h("p", { class: "qrDescription bold" }, "Scan QR Code")), errorMessage && (index.h("div", { class: "alert" }, index.h("img", { src: gatIconRefresh.gatIconAlertSvg, height: 24, width: 24 }), index.h("p", null, errorMessage)))), index.h("div", { id: "qrwait" }, this.renderQR("waiting to start a session", 250))));
163
- }
164
- renderQR(value, size, useLogo) {
165
- return (index.h("gataca-qrdisplay", { qrData: value, rounded: true, size: size, "logo-size": useLogo ? 0.33 : 0 }));
166
- }
167
- render() {
168
- return (index.h("div", { class: "popUpContainer" }, index.h("div", { class: "modal-window is-visible", onClick: (event) => {
169
- event.stopPropagation();
170
- } }, index.h("div", { class: "modal-window__content" }, index.h("div", { class: "qrTitleContainer" }, index.h("p", { class: "qrTitle" }, this.qrModalTitle), !this.hideBrandTitle && (index.h("p", { class: "qrBrand" }, "by Gataca", " ", index.h("span", null, index.h("img", { src: gatIconRefresh.logoGatacaSvg })))), this.result !== utils.RESULT_STATUS.SUCCESS && (index.h("p", { class: "qrDescription" }, this.qrModalDescription))), index.h("div", { class: "qrSection" }, this.renderQRSection())))));
171
- }
172
- };
173
- GatacaQR.style = gatacaQrCss;
174
-
175
- exports.gataca_qr = GatacaQR;