@gataca/qr 2.0.14 → 3.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/cjs/gataca-autoqr.cjs.entry.js +5 -5
  2. package/dist/cjs/gataca-qr_2.cjs.entry.js +6 -19
  3. package/dist/cjs/gataca-qrws.cjs.entry.js +6 -18
  4. package/dist/cjs/gataca-ssibutton_2.cjs.entry.js +197 -13
  5. package/dist/cjs/gatacaqr.cjs.js +3 -7
  6. package/dist/cjs/{index-f214ab7a.js → index-93d47a75.js} +2 -111
  7. package/dist/cjs/loader.cjs.js +3 -4
  8. package/dist/collection/collection-manifest.json +2 -2
  9. package/dist/collection/components/gataca-autoqr/gataca-autoqr.js +5 -5
  10. package/dist/collection/components/gataca-qr/gataca-qr.js +13 -26
  11. package/dist/collection/components/gataca-qrws/gataca-qrws.js +12 -24
  12. package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +259 -19
  13. package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.js +9 -9
  14. package/dist/components/gataca-autoqr.js +4 -4
  15. package/dist/components/gataca-qr2.js +6 -19
  16. package/dist/components/gataca-qrws2.js +6 -18
  17. package/dist/components/gataca-ssibutton2.js +203 -12
  18. package/dist/components/gataca-ssibuttonws2.js +3 -3
  19. package/dist/components/index.d.ts +0 -9
  20. package/dist/components/index.js +1 -1
  21. package/dist/esm/gataca-autoqr.entry.js +5 -5
  22. package/dist/esm/gataca-qr_2.entry.js +6 -19
  23. package/dist/esm/gataca-qrws.entry.js +6 -18
  24. package/dist/esm/gataca-ssibutton_2.entry.js +197 -13
  25. package/dist/esm/gatacaqr.js +3 -4
  26. package/dist/esm/{index-570c9813.js → index-2be54f32.js} +3 -111
  27. package/dist/esm/loader.js +3 -4
  28. package/dist/esm/polyfills/css-shim.js +1 -1
  29. package/dist/gatacaqr/gatacaqr.esm.js +1 -1
  30. package/dist/gatacaqr/p-0381ab9a.entry.js +1 -0
  31. package/dist/gatacaqr/p-0be4566d.js +1 -1
  32. package/dist/gatacaqr/p-16298cb4.entry.js +1 -0
  33. package/dist/gatacaqr/p-5ae5f952.js +2 -0
  34. package/dist/gatacaqr/p-761647d3.entry.js +1 -0
  35. package/dist/gatacaqr/p-9e9af27e.entry.js +1 -0
  36. package/dist/types/components/gataca-autoqr/gataca-autoqr.d.ts +2 -2
  37. package/dist/types/components/gataca-qr/components/qr/QR.d.ts +1 -1
  38. package/dist/types/components/gataca-qr/components/readQR/ReadQR.d.ts +1 -1
  39. package/dist/types/components/gataca-qr/components/retryButton/RetryButton.d.ts +1 -1
  40. package/dist/types/components/gataca-qr/components/success/Success.d.ts +1 -1
  41. package/dist/types/components/gataca-qr/gataca-qr.d.ts +4 -4
  42. package/dist/types/components/gataca-qrws/components/qr/QR.d.ts +1 -1
  43. package/dist/types/components/gataca-qrws/components/readQR/ReadQR.d.ts +1 -1
  44. package/dist/types/components/gataca-qrws/components/retryButton/RetryButton.d.ts +1 -1
  45. package/dist/types/components/gataca-qrws/components/success/Success.d.ts +1 -1
  46. package/dist/types/components/gataca-qrws/gataca-qrws.d.ts +3 -3
  47. package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +29 -5
  48. package/dist/types/components/gataca-ssibuttonws/gataca-ssibuttonws.d.ts +2 -2
  49. package/dist/types/components.d.ts +38 -22
  50. package/dist/types/stencil-public-runtime.d.ts +3 -59
  51. package/dist/types/utils/utils.d.ts +9 -9
  52. package/loader/index.d.ts +0 -9
  53. package/package.json +2 -2
  54. package/readme.md +2 -0
  55. package/dist/gatacaqr/p-3d1a6526.entry.js +0 -1
  56. package/dist/gatacaqr/p-64740141.entry.js +0 -1
  57. package/dist/gatacaqr/p-bd6bd52f.entry.js +0 -1
  58. package/dist/gatacaqr/p-ec0f00a6.js +0 -2
  59. package/dist/gatacaqr/p-f9931de0.entry.js +0 -1
@@ -1,6 +1,10 @@
1
1
  import { h, } from "@stencil/core";
2
2
  import "../gataca-qrdisplay/gataca-qrdisplay";
3
+ import { RESULT_STATUS } from "../../utils/utils";
3
4
  const PHONE_ICON = "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=";
5
+ //Default values
6
+ const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
7
+ const DEFAULT_POLLING_FREQ = 3;
4
8
  export class GatacaSSIButton {
5
9
  constructor() {
6
10
  this.buttonText = "Easy login";
@@ -8,12 +12,13 @@ export class GatacaSSIButton {
8
12
  this.createSession = undefined;
9
13
  this.successCallback = undefined;
10
14
  this.errorCallback = undefined;
15
+ this.handleCheckAppLoading = undefined;
11
16
  this.qrRole = undefined;
12
17
  this.callbackServer = undefined;
13
18
  this.sessionTimeout = undefined;
14
19
  this.pollingFrequency = undefined;
15
20
  this.autorefresh = false;
16
- this.v2 = false;
21
+ this.v = "3";
17
22
  this.qrModalTitle = "Quick Access";
18
23
  this.modalTitleColor = "#4745B7";
19
24
  this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet";
@@ -34,7 +39,11 @@ export class GatacaSSIButton {
34
39
  this.waitingStartSessionLabel = "waiting to start a session";
35
40
  this.hideQrModalDescription = false;
36
41
  this.open = false;
37
- this.qr = (h("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: true, autorefresh: this.autorefresh, v2: this.v2, qrModalTitle: this.qrModalTitle, qrModalDescription: this.qrModalDescription, hideBrandTitle: this.hideBrandTitle, dynamicLink: this.dynamicLink, logoSize: this.logoSize, logoSrc: this.logoSrc, modalTitleColor: this.modalTitleColor, qrCodeExpiredLabel: this.qrCodeExpiredLabel, credentialsNotValidatedLabel: this.credentialsNotValidatedLabel, clickInsideBoxLabel: this.clickInsideBoxLabel, refreshQrLabel: this.refreshQrLabel, scanQrLabel: this.scanQrLabel, userNotScanInTimeErrorLabel: this.userNotScanInTimeErrorLabel, credsNotValidatedErrorLabel: this.credsNotValidatedErrorLabel, failedLoginErrorLabel: this.failedLoginErrorLabel, successLoginLabel: this.successLoginLabel, byBrandLabel: this.byBrandLabel, waitingStartSessionLabel: this.waitingStartSessionLabel, hideQrModalDescription: this.hideQrModalDescription }));
42
+ this.sessionId = undefined;
43
+ this.authenticationRequest = undefined;
44
+ this.sessionData = undefined;
45
+ this.result = RESULT_STATUS.NOT_STARTED;
46
+ this.qr = (h("gataca-qr", { ref: (el) => (this.qrElement = el), 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: true, autorefresh: this.autorefresh, v: this.v, qrModalTitle: this.qrModalTitle, qrModalDescription: this.qrModalDescription, hideBrandTitle: this.hideBrandTitle, dynamicLink: this.dynamicLink, logoSize: this.logoSize, logoSrc: this.logoSrc, modalTitleColor: this.modalTitleColor, qrCodeExpiredLabel: this.qrCodeExpiredLabel, credentialsNotValidatedLabel: this.credentialsNotValidatedLabel, clickInsideBoxLabel: this.clickInsideBoxLabel, refreshQrLabel: this.refreshQrLabel, scanQrLabel: this.scanQrLabel, userNotScanInTimeErrorLabel: this.userNotScanInTimeErrorLabel, credsNotValidatedErrorLabel: this.credsNotValidatedErrorLabel, failedLoginErrorLabel: this.failedLoginErrorLabel, successLoginLabel: this.successLoginLabel, byBrandLabel: this.byBrandLabel, waitingStartSessionLabel: this.waitingStartSessionLabel, hideQrModalDescription: this.hideQrModalDescription }));
38
47
  }
39
48
  /**
40
49
  * Retrieve manually the session data on a successful login
@@ -42,22 +51,197 @@ export class GatacaSSIButton {
42
51
  async getSessionData() {
43
52
  return this.qr.getSessionData();
44
53
  }
54
+ async getSessionId() {
55
+ if (this.sessionId) {
56
+ return this.sessionId;
57
+ }
58
+ let { sessionId, authenticationRequest } = await this.createSession();
59
+ this.sessionId = sessionId;
60
+ this.authenticationRequest = authenticationRequest;
61
+ return this.sessionId;
62
+ }
63
+ /**
64
+ * Force manually the start polling
65
+ */
66
+ async startMobilePolling() {
67
+ await this.getSessionId();
68
+ this.result = RESULT_STATUS.ONGOING;
69
+ this.poll()
70
+ .then((data) => {
71
+ this.result = RESULT_STATUS.SUCCESS;
72
+ this.sessionData = data;
73
+ this.gatacaLoginCompleted.emit(data);
74
+ this.successCallback(data);
75
+ })
76
+ .catch((err) => {
77
+ this.clean();
78
+ let expired = err === RESULT_STATUS.EXPIRED;
79
+ if (expired && this.autorefresh) {
80
+ this.startMobilePolling();
81
+ }
82
+ else {
83
+ if (err !== RESULT_STATUS.NOT_STARTED) {
84
+ let error = expired
85
+ ? new Error(this.userNotScanInTimeErrorLabel)
86
+ : new Error(this.credsNotValidatedErrorLabel);
87
+ this.result = err;
88
+ this.gatacaLoginFailed.emit(error);
89
+ this.errorCallback(error);
90
+ }
91
+ }
92
+ });
93
+ }
94
+ /**
95
+ * Stop manually an ongoing session
96
+ */
97
+ async stop() {
98
+ this.clean();
99
+ if (this.result === RESULT_STATUS.ONGOING || RESULT_STATUS.READ) {
100
+ this.result = RESULT_STATUS.NOT_STARTED;
101
+ }
102
+ }
103
+ clean() {
104
+ this.sessionData = undefined;
105
+ this.sessionId = undefined;
106
+ }
45
107
  renderModal() {
46
108
  return this.qr;
47
109
  }
48
- renderButton() {
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 === RESULT_STATUS.NOT_STARTED) {
116
+ return { result: 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 RESULT_STATUS.SUCCESS:
127
+ resolve(data);
128
+ break;
129
+ case RESULT_STATUS.READ:
130
+ component.result = RESULT_STATUS.READ;
131
+ case RESULT_STATUS.ONGOING:
132
+ if (component.sessionTimeout > 0 && new Date().getTime() < endTime) {
133
+ setTimeout(checkCondition, interval, resolve, reject);
134
+ }
135
+ else {
136
+ reject(RESULT_STATUS.EXPIRED);
137
+ }
138
+ break;
139
+ default:
140
+ reject(result);
141
+ break;
142
+ }
143
+ };
144
+ return new Promise(checkCondition);
145
+ }
146
+ isAppInstalled(appScheme, callback) {
147
+ let timeout;
148
+ let detected = false;
149
+ if (appScheme === null || appScheme === void 0 ? void 0 : appScheme.length) {
150
+ window.location.href = appScheme;
151
+ }
152
+ timeout = setTimeout(() => {
153
+ if (!detected) {
154
+ setTimeout(() => {
155
+ if (!detected) {
156
+ callback(false);
157
+ }
158
+ cleanup();
159
+ }, 1000);
160
+ }
161
+ }, 1500);
162
+ const handleVisibilityChange = () => {
163
+ if (document.hidden) {
164
+ detected = true;
165
+ callback(true);
166
+ this.startMobilePolling();
167
+ cleanup();
168
+ }
169
+ };
170
+ document.addEventListener("visibilitychange", handleVisibilityChange);
171
+ function cleanup() {
172
+ clearTimeout(timeout);
173
+ document.removeEventListener("visibilitychange", handleVisibilityChange);
174
+ }
175
+ }
176
+ renderDesktopButton() {
49
177
  return (h("div", { class: "gatacaButtonWrapper" }, h("button", { class: "gatacaButton", onClick: () => {
50
178
  this.open = !this.open;
51
- if (this.open) {
52
- this.qr.display();
53
- }
54
- else {
55
- this.qr.stop();
56
- }
179
+ setTimeout(() => {
180
+ var _a, _b;
181
+ if (this.open) {
182
+ (_a = this.qrElement) === null || _a === void 0 ? void 0 : _a.display();
183
+ }
184
+ else {
185
+ (_b = this.qrElement) === null || _b === void 0 ? void 0 : _b.stop();
186
+ }
187
+ }, 0);
57
188
  } }, h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), h("span", null, this.buttonText))));
58
189
  }
190
+ async getAuthRequest() {
191
+ let { authenticationRequest } = await this.createSession();
192
+ return authenticationRequest;
193
+ }
194
+ renderMobileButton(isAndroid, isIos) {
195
+ let loading = false;
196
+ const handleLoading = (isLoading) => {
197
+ loading = isLoading;
198
+ if (this.handleCheckAppLoading) {
199
+ this.handleCheckAppLoading(isLoading);
200
+ }
201
+ };
202
+ const executeRedirection = async () => {
203
+ handleLoading(true);
204
+ const androidStoreLink = "https://play.google.com/store/apps/details?id=com.gataca.identity";
205
+ const iosStoreLink = "https://apps.apple.com/us/app/gataca/id1498607616";
206
+ try {
207
+ const appScheme = await this.getAuthRequest();
208
+ this.isAppInstalled(appScheme, (installed) => {
209
+ if (!installed) {
210
+ setTimeout(() => {
211
+ this.stop();
212
+ if (isAndroid) {
213
+ window.location.href = androidStoreLink;
214
+ }
215
+ else if (isIos) {
216
+ window.location.href = iosStoreLink;
217
+ }
218
+ }, 500);
219
+ }
220
+ handleLoading(false);
221
+ });
222
+ }
223
+ catch (error) {
224
+ this.stop();
225
+ handleLoading(false);
226
+ }
227
+ };
228
+ return (h("div", { class: "gatacaButtonWrapper" }, h("button", { class: "gatacaButton", onClick: () => {
229
+ executeRedirection();
230
+ }, disabled: loading }, h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), h("span", null, this.buttonText))));
231
+ }
59
232
  render() {
60
- return (h("div", { class: "buttonContainer" }, this.renderButton(), this.open && this.renderModal()));
233
+ const userAgent =
234
+ // @ts-ignore
235
+ (navigator === null || navigator === void 0 ? void 0 : navigator.userAgent) || (navigator === null || navigator === void 0 ? void 0 : navigator.vendor) || (window === null || window === void 0 ? void 0 : window.opera);
236
+ const isAndroid = /android/i.test(userAgent);
237
+ const isIos =
238
+ // @ts-ignore
239
+ (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) ||
240
+ (navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1);
241
+ const isMobile = isAndroid || isIos;
242
+ return (h("div", { class: "buttonContainer" }, isMobile && this.v === "3"
243
+ ? this.renderMobileButton(isAndroid, isIos)
244
+ : this.renderDesktopButton(), this.open && (!isMobile || this.v === "3") && this.renderModal()));
61
245
  }
62
246
  static get is() { return "gataca-ssibutton"; }
63
247
  static get encapsulation() { return "shadow"; }
@@ -131,7 +315,7 @@ export class GatacaSSIButton {
131
315
  "optional": true,
132
316
  "docs": {
133
317
  "tags": [],
134
- "text": "***Mandatory***\nCreate session function to generate a new Session\nUsing V1, it can provide just a session Id\nUsing V2, it must provide also the authentication request. The session Id is the id of the presentation definition"
318
+ "text": "***Mandatory***\nCreate session function to generate a new Session\nUsing v=\"3\", it can provide just a session Id\nUsing another version, it must provide also the authentication request. The session Id is the id of the presentation definition"
135
319
  },
136
320
  "defaultValue": "undefined"
137
321
  },
@@ -171,6 +355,22 @@ export class GatacaSSIButton {
171
355
  },
172
356
  "defaultValue": "undefined"
173
357
  },
358
+ "handleCheckAppLoading": {
359
+ "type": "unknown",
360
+ "mutable": false,
361
+ "complexType": {
362
+ "original": "(isCheckingApp?: boolean) => void",
363
+ "resolved": "(isCheckingApp?: boolean) => void",
364
+ "references": {}
365
+ },
366
+ "required": false,
367
+ "optional": true,
368
+ "docs": {
369
+ "tags": [],
370
+ "text": "_[Optional]_\nFunction that runs every time the loading state changes while checking if the App is installed. Only on mobile with v3."
371
+ },
372
+ "defaultValue": "undefined"
373
+ },
174
374
  "qrRole": {
175
375
  "type": "string",
176
376
  "mutable": false,
@@ -257,23 +457,23 @@ export class GatacaSSIButton {
257
457
  "reflect": false,
258
458
  "defaultValue": "false"
259
459
  },
260
- "v2": {
261
- "type": "boolean",
460
+ "v": {
461
+ "type": "string",
262
462
  "mutable": false,
263
463
  "complexType": {
264
- "original": "boolean",
265
- "resolved": "boolean",
464
+ "original": "string",
465
+ "resolved": "string",
266
466
  "references": {}
267
467
  },
268
468
  "required": false,
269
469
  "optional": true,
270
470
  "docs": {
271
471
  "tags": [],
272
- "text": "_[Optional]_\nSet to use v2 links. The create session must be providing both an authentication request and a session Id"
472
+ "text": "_[Optional]_\nIf 3, handle deeplink redirects and deprecates (remove) v1 functionality. If not, the create session must be providing both an authentication request and a session Id"
273
473
  },
274
- "attribute": "v-2",
474
+ "attribute": "v",
275
475
  "reflect": false,
276
- "defaultValue": "false"
476
+ "defaultValue": "\"3\""
277
477
  },
278
478
  "qrModalTitle": {
279
479
  "type": "string",
@@ -620,7 +820,11 @@ export class GatacaSSIButton {
620
820
  }
621
821
  static get states() {
622
822
  return {
623
- "open": {}
823
+ "open": {},
824
+ "sessionId": {},
825
+ "authenticationRequest": {},
826
+ "sessionData": {},
827
+ "result": {}
624
828
  };
625
829
  }
626
830
  static get events() {
@@ -673,6 +877,42 @@ export class GatacaSSIButton {
673
877
  "text": "Retrieve manually the session data on a successful login",
674
878
  "tags": []
675
879
  }
880
+ },
881
+ "startMobilePolling": {
882
+ "complexType": {
883
+ "signature": "() => Promise<void>",
884
+ "parameters": [],
885
+ "references": {
886
+ "Promise": {
887
+ "location": "global"
888
+ },
889
+ "RESULT_STATUS": {
890
+ "location": "import",
891
+ "path": "../../utils/utils"
892
+ }
893
+ },
894
+ "return": "Promise<void>"
895
+ },
896
+ "docs": {
897
+ "text": "Force manually the start polling",
898
+ "tags": []
899
+ }
900
+ },
901
+ "stop": {
902
+ "complexType": {
903
+ "signature": "() => Promise<void>",
904
+ "parameters": [],
905
+ "references": {
906
+ "Promise": {
907
+ "location": "global"
908
+ }
909
+ },
910
+ "return": "Promise<void>"
911
+ },
912
+ "docs": {
913
+ "text": "Stop manually an ongoing session",
914
+ "tags": []
915
+ }
676
916
  }
677
917
  };
678
918
  }
@@ -13,13 +13,13 @@ export class GatacaSSIButtonWS {
13
13
  this.wsOnMessage = undefined;
14
14
  this.autostart = true;
15
15
  this.autorefresh = false;
16
- this.v2 = false;
16
+ this.v = "3";
17
17
  this.qrModalTitle = "Quick Access";
18
18
  this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet";
19
19
  this.hideBrandTitle = false;
20
20
  this.dynamicLink = true;
21
21
  this.open = false;
22
- this.qr = (h("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: true, autorefresh: this.autorefresh, v2: this.v2, qrModalTitle: this.qrModalTitle, qrModalDescription: this.qrModalDescription, hideBrandTitle: this.hideBrandTitle, dynamicLink: this.dynamicLink }));
22
+ this.qr = (h("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: true, autorefresh: this.autorefresh, v: this.v, qrModalTitle: this.qrModalTitle, qrModalDescription: this.qrModalDescription, hideBrandTitle: this.hideBrandTitle, dynamicLink: this.dynamicLink }));
23
23
  }
24
24
  /**
25
25
  * Retrieve manually the session data on a successful login
@@ -257,23 +257,23 @@ export class GatacaSSIButtonWS {
257
257
  "reflect": false,
258
258
  "defaultValue": "false"
259
259
  },
260
- "v2": {
261
- "type": "boolean",
260
+ "v": {
261
+ "type": "string",
262
262
  "mutable": false,
263
263
  "complexType": {
264
- "original": "boolean",
265
- "resolved": "boolean",
264
+ "original": "string",
265
+ "resolved": "string",
266
266
  "references": {}
267
267
  },
268
268
  "required": false,
269
269
  "optional": true,
270
270
  "docs": {
271
271
  "tags": [],
272
- "text": "**RECOMMENDED**\nSet to use v2 links. The create session must be providing both an authentication request and a session Id"
272
+ "text": "**RECOMMENDED**\nIf 3, handle deeplink redirects and deprecates (remove) v1 functionality. If not, the create session must be providing both an authentication request and a session Id"
273
273
  },
274
- "attribute": "v-2",
274
+ "attribute": "v",
275
275
  "reflect": false,
276
- "defaultValue": "false"
276
+ "defaultValue": "\"3\""
277
277
  },
278
278
  "qrModalTitle": {
279
279
  "type": "string",
@@ -75,18 +75,18 @@ const GatacaAutoQR = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
75
75
  selectQR() {
76
76
  if (this.config.useButton) {
77
77
  if (this.config.useWs) {
78
- this.qr = (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 }));
78
+ this.qr = (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, v: this.config.v, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
79
79
  }
80
80
  else {
81
- this.qr = (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 }));
81
+ this.qr = (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, v: this.config.v, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
82
82
  }
83
83
  }
84
84
  else {
85
85
  if (this.config.useWs) {
86
- this.qr = (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 }));
86
+ this.qr = (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, v: this.config.v, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
87
87
  }
88
88
  else {
89
- this.qr = (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 }));
89
+ this.qr = (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, v: this.config.v, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
90
90
  }
91
91
  }
92
92
  }
@@ -68,17 +68,12 @@ const QR = (props) => {
68
68
 
69
69
  const gatacaQrCss = "@import url(\"https://fonts.googleapis.com/css2?family=Ubuntu:wght@100;300;400;500;600;700&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;500;600;700&display=swap\"); @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 .large-modal{width:300px;min-height:350px}.popUpContainer .modal-window{position:relative;border-radius:6px;overflow:hidden;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;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__content .hidenText{display:none}.popUpContainer .modal-window .modalText{font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px;margin-top:10px;letter-spacing:1px}.popUpContainer .modal-window .qrTitleContainer{padding:14px 24px;padding-bottom:0px}.popUpContainer .modal-window .qrTitle{font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .modal-window .qrDescription{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074}.popUpContainer .modal-window .bold{font-weight:700}.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 .noBoxShadow{box-shadow:none}.popUpContainer .is-visible{opacity:1;visibility:visible}.is-transparent{opacity:0}.success{display:flex;height:300px;flex-direction:column;justify-content:center;align-items:center;padding:0px}.success>img{padding-bottom:12px}.success>.successMsg{line-height:23.5px;color:var(--neutral-1000, #1e1e20);text-align:center;font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px}.reload,.blured{height:252px;width:252px;border:1px dashed #a1a1a1;border-radius:12px;position:relative;top:24px;margin:0 24px 24px;display:flex;overflow:hidden;justify-content:center;align-items:center}#qrwait{display:flex;justify-content:center}#qrwait,#notify{width:100%;height:100%;top:0;left:0;border-radius:20px}#notify{z-index:10;position:absolute;justify-self:center;justify-items:center;justify-content:center;align-items:center;align-content:center;display:flex;flex-direction:column;box-sizing:border-box;padding:20px;background:rgba(255, 255, 255, 0.95)}#notify>img{padding-bottom:12px}.alert{display:flex;flex-direction:row;justify-content:start;width:252px;position:absolute;bottom:0px;border:1px solid #ee888c;background:#ffdedf;border-radius:11px;box-sizing:border-box;padding:12px;align-items:center;gap:12px}.alert>img{margin:0}.alert>p{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;margin-top:0;line-height:16px;color:#1e1e20}.notify-text{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074;text-align:center}.containerLoader{display:flex;justify-content:center;align-items:center;width:30px;height:30px;margin-bottom:12px}.loader{position:relative;margin-left:0 !important}.loader__item{position:absolute;width:9.68px;height:4px;background:transparent;border-radius:2px}.loader__item__1{transform:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-webkit-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-moz-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-o-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);animation:blink 0.8333333333s linear 0.1041666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.1041666667s infinite;-moz-animation:blink 0.8333333333s linear 0.1041666667s infinite;-o-animation:blink 0.8333333333s linear 0.1041666667s infinite}.loader__item__2{transform:translate(-4.84px, 8.5px) rotate(90deg);-webkit-animation:translate(-4.84px, 8.5px) rotate(90deg);-moz-animation:translate(-4.84px, 8.5px) rotate(90deg);-o-animation:translate(-4.84px, 8.5px) rotate(90deg);animation:blink 0.8333333333s linear 0.2083333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.2083333333s infinite;-moz-animation:blink 0.8333333333s linear 0.2083333333s infinite;-o-animation:blink 0.8333333333s linear 0.2083333333s infinite}.loader__item__3{transform:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-webkit-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-moz-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-o-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);animation:blink 0.8333333333s linear 0.3125s infinite;-webkit-animation:blink 0.8333333333s linear 0.3125s infinite;-moz-animation:blink 0.8333333333s linear 0.3125s infinite;-o-animation:blink 0.8333333333s linear 0.3125s infinite}.loader__item__4{transform:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-webkit-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-moz-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-o-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);animation:blink 0.8333333333s linear 0.4166666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.4166666667s infinite;-moz-animation:blink 0.8333333333s linear 0.4166666667s infinite;-o-animation:blink 0.8333333333s linear 0.4166666667s infinite}.loader__item__5{transform:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-webkit-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-moz-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-o-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);animation:blink 0.8333333333s linear 0.5208333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.5208333333s infinite;-moz-animation:blink 0.8333333333s linear 0.5208333333s infinite;-o-animation:blink 0.8333333333s linear 0.5208333333s infinite}.loader__item__6{transform:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-webkit-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-moz-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-o-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);animation:blink 0.8333333333s linear 0.625s infinite;-webkit-animation:blink 0.8333333333s linear 0.625s infinite;-moz-animation:blink 0.8333333333s linear 0.625s infinite;-o-animation:blink 0.8333333333s linear 0.625s infinite}.loader__item__7{transform:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-webkit-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-moz-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-o-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);animation:blink 0.8333333333s linear 0.7291666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.7291666667s infinite;-moz-animation:blink 0.8333333333s linear 0.7291666667s infinite;-o-animation:blink 0.8333333333s linear 0.7291666667s infinite}.loader__item__8{transform:translate(5.6631628524px, -1.99913122px) rotate(360deg);-webkit-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-moz-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-o-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);animation:blink 0.8333333333s linear 0.8333333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.8333333333s infinite;-moz-animation:blink 0.8333333333s linear 0.8333333333s infinite;-o-animation:blink 0.8333333333s linear 0.8333333333s infinite}.loader__item__8{max-width:8.5px}@keyframes blink{0%{background:#4745B7}100%{background:#CCCBF8}}@keyframes rotate{0%{transform:rotate(0deg)}100%{background:rotate(360deg)}}";
70
70
 
71
- const DEEP_LINK_PREFIX = "https://gataca.page.link/?apn=com.gatacaapp&ibi=com.gataca.wallet&link=";
71
+ const DEEP_LINK_PREFIX = "https://api.gataca.io/qr/redirect.html";
72
72
  //Default values
73
73
  const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
74
74
  const DEFAULT_POLLING_FREQ = 3;
75
- const QR_ROLE_CONNECT = "connect";
76
- const FUNCTION_ROLES = {
77
- connect: "scan",
78
- certify: "credential",
79
- };
80
75
  const GatacaQR = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
81
- constructor() { super(); this.__registerHost(); this.__attachShadow(); this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7); this.gatacaLoginFailed = 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.modalTitleColor = "#4745B7"; this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideModalTexts = false; this.hideModalBoxShadow = false; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = logoGatacaSvg; this.qrSize = 300; this.modalWidth = 300; this.modalHeight = undefined; this.qrCodeExpiredLabel = "QR Code expired"; this.credentialsNotValidatedLabel = "User credentials not validated"; this.clickInsideBoxLabel = "Click inside the box to"; this.refreshQrLabel = "Refresh QR Code"; this.scanQrLabel = "Scan QR Code"; this.userNotScanInTimeErrorLabel = "User did not scan the QR in the allowed time"; this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated"; this.failedLoginErrorLabel = "No successful login"; this.successLoginLabel = "Successful Connection!"; this.byBrandLabel = "by Gataca"; this.waitingStartSessionLabel = "waiting to start a session"; this.readQrTitle = "Processing..."; this.readQrDescription = "Please wait a moment"; this.hideQrModalDescription = 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 = RESULT_STATUS.NOT_STARTED; }
76
+ constructor() { super(); this.__registerHost(); this.__attachShadow(); this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7); this.gatacaLoginFailed = 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.v = "3"; this.qrModalTitle = "Quick Access"; this.modalTitleColor = "#4745B7"; this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideModalTexts = false; this.hideModalBoxShadow = false; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = logoGatacaSvg; this.qrSize = 300; this.modalWidth = 300; this.modalHeight = undefined; this.qrCodeExpiredLabel = "QR Code expired"; this.credentialsNotValidatedLabel = "User credentials not validated"; this.clickInsideBoxLabel = "Click inside the box to"; this.refreshQrLabel = "Refresh QR Code"; this.scanQrLabel = "Scan QR Code"; this.userNotScanInTimeErrorLabel = "User did not scan the QR in the allowed time"; this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated"; this.failedLoginErrorLabel = "No successful login"; this.successLoginLabel = "Successful Connection!"; this.byBrandLabel = "by Gataca"; this.waitingStartSessionLabel = "waiting to start a session"; this.readQrTitle = "Processing..."; this.readQrDescription = "Please wait a moment"; this.hideQrModalDescription = 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 = RESULT_STATUS.NOT_STARTED; }
82
77
  disconnectedCallback() {
83
78
  this.stop();
84
79
  }
@@ -152,19 +147,11 @@ const GatacaQR = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
152
147
  return this.sessionId;
153
148
  }
154
149
  getLink() {
155
- if (this.v2) {
150
+ if (this.v === "2") {
156
151
  return this.authenticationRequest;
157
152
  }
158
- let op = FUNCTION_ROLES[this.qrRole];
159
- let link = "https://gataca.page.link/" + op + "?";
160
- link +=
161
- this.qrRole === QR_ROLE_CONNECT
162
- ? "session=" + this.sessionId
163
- : "process=" + this.sessionId;
164
- link +=
165
- "&callback=" + base64UrlEncode(encodeURIComponent(this.callbackServer));
166
- link = encodeURIComponent(link);
167
- return this.dynamicLink ? DEEP_LINK_PREFIX + link : link;
153
+ const authRequestEncoded = "?dl=" + base64UrlEncode(this.authenticationRequest);
154
+ return DEEP_LINK_PREFIX + authRequestEncoded;
168
155
  }
169
156
  async poll() {
170
157
  let endTime = new Date().getTime() +
@@ -263,7 +250,7 @@ const GatacaQR = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
263
250
  "callbackServer": [1, "callback-server"],
264
251
  "autostart": [4],
265
252
  "autorefresh": [4],
266
- "v2": [4, "v-2"],
253
+ "v": [1],
267
254
  "qrModalTitle": [1, "qr-modal-title"],
268
255
  "modalTitleColor": [1, "modal-title-color"],
269
256
  "qrModalDescription": [1, "qr-modal-description"],
@@ -68,15 +68,11 @@ const ReadQR = (props) => {
68
68
 
69
69
  const gatacaQrwsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Ubuntu:wght@100;300;400;500;600;700&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Poppins:wght@100;300;400;500;600;700&display=swap\"); @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 .large-modal{width:300px;min-height:350px}.popUpContainer .modal-window{position:relative;border-radius:6px;overflow:hidden;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;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__content .hidenText{display:none}.popUpContainer .modal-window .modalText{font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px;margin-top:10px;letter-spacing:1px}.popUpContainer .modal-window .qrTitleContainer{padding:14px 24px;padding-bottom:0px}.popUpContainer .modal-window .qrTitle{font-size:20px;font-weight:600;line-height:23.5px}.popUpContainer .modal-window .qrDescription{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074}.popUpContainer .modal-window .bold{font-weight:700}.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 .noBoxShadow{box-shadow:none}.popUpContainer .is-visible{opacity:1;visibility:visible}.is-transparent{opacity:0}.success{display:flex;height:300px;flex-direction:column;justify-content:center;align-items:center;padding:0px}.success>img{padding-bottom:12px}.success>.successMsg{line-height:23.5px;color:var(--neutral-1000, #1e1e20);text-align:center;font-family:\"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:20px;font-style:normal;font-weight:700;line-height:24px}.reload,.blured{height:252px;width:252px;border:1px dashed #a1a1a1;border-radius:12px;position:relative;top:24px;margin:0 24px 24px;display:flex;overflow:hidden;justify-content:center;align-items:center}#qrwait{display:flex;justify-content:center}#qrwait,#notify{width:100%;height:100%;top:0;left:0;border-radius:20px}#notify{z-index:10;position:absolute;justify-self:center;justify-items:center;justify-content:center;align-items:center;align-content:center;display:flex;flex-direction:column;box-sizing:border-box;padding:20px;background:rgba(255, 255, 255, 0.95)}#notify>img{padding-bottom:12px}.alert{display:flex;flex-direction:row;justify-content:start;width:252px;position:absolute;bottom:0px;border:1px solid #ee888c;background:#ffdedf;border-radius:11px;box-sizing:border-box;padding:12px;align-items:center;gap:12px}.alert>img{margin:0}.alert>p{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;margin-top:0;line-height:16px;color:#1e1e20}.notify-text{font-family:\"Poppins\", \"Ubuntu\", \"Work Sans\", \"Helvetica Neue\", sans-serif;font-size:14px;font-style:normal;font-weight:400;line-height:16px;color:#707074;text-align:center}.containerLoader{display:flex;justify-content:center;align-items:center;width:30px;height:30px;margin-bottom:12px}.loader{position:relative;margin-left:0 !important}.loader__item{position:absolute;width:9.68px;height:4px;background:transparent;border-radius:2px}.loader__item__1{transform:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-webkit-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-moz-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);-o-animation:translate(2.5846212025px, 5.4246212025px) rotate(45deg);animation:blink 0.8333333333s linear 0.1041666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.1041666667s infinite;-moz-animation:blink 0.8333333333s linear 0.1041666667s infinite;-o-animation:blink 0.8333333333s linear 0.1041666667s infinite}.loader__item__2{transform:translate(-4.84px, 8.5px) rotate(90deg);-webkit-animation:translate(-4.84px, 8.5px) rotate(90deg);-moz-animation:translate(-4.84px, 8.5px) rotate(90deg);-o-animation:translate(-4.84px, 8.5px) rotate(90deg);animation:blink 0.8333333333s linear 0.2083333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.2083333333s infinite;-moz-animation:blink 0.8333333333s linear 0.2083333333s infinite;-o-animation:blink 0.8333333333s linear 0.2083333333s infinite}.loader__item__3{transform:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-webkit-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-moz-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);-o-animation:translate(-12.2646212025px, 5.4246212025px) rotate(135deg);animation:blink 0.8333333333s linear 0.3125s infinite;-webkit-animation:blink 0.8333333333s linear 0.3125s infinite;-moz-animation:blink 0.8333333333s linear 0.3125s infinite;-o-animation:blink 0.8333333333s linear 0.3125s infinite}.loader__item__4{transform:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-webkit-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-moz-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);-o-animation:translate(-15.3399999992px, -1.9999999999px) rotate(180deg);animation:blink 0.8333333333s linear 0.4166666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.4166666667s infinite;-moz-animation:blink 0.8333333333s linear 0.4166666667s infinite;-o-animation:blink 0.8333333333s linear 0.4166666667s infinite}.loader__item__5{transform:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-webkit-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-moz-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);-o-animation:translate(-12.2646210959px, -9.4246211842px) rotate(225deg);animation:blink 0.8333333333s linear 0.5208333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.5208333333s infinite;-moz-animation:blink 0.8333333333s linear 0.5208333333s infinite;-o-animation:blink 0.8333333333s linear 0.5208333333s infinite}.loader__item__6{transform:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-webkit-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-moz-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);-o-animation:translate(-4.8399941857px, -12.499998805px) rotate(270deg);animation:blink 0.8333333333s linear 0.625s infinite;-webkit-animation:blink 0.8333333333s linear 0.625s infinite;-moz-animation:blink 0.8333333333s linear 0.625s infinite;-o-animation:blink 0.8333333333s linear 0.625s infinite}.loader__item__7{transform:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-webkit-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-moz-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);-o-animation:translate(2.5847915061px, -9.4245803212px) rotate(315deg);animation:blink 0.8333333333s linear 0.7291666667s infinite;-webkit-animation:blink 0.8333333333s linear 0.7291666667s infinite;-moz-animation:blink 0.8333333333s linear 0.7291666667s infinite;-o-animation:blink 0.8333333333s linear 0.7291666667s infinite}.loader__item__8{transform:translate(5.6631628524px, -1.99913122px) rotate(360deg);-webkit-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-moz-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);-o-animation:translate(5.6631628524px, -1.99913122px) rotate(360deg);animation:blink 0.8333333333s linear 0.8333333333s infinite;-webkit-animation:blink 0.8333333333s linear 0.8333333333s infinite;-moz-animation:blink 0.8333333333s linear 0.8333333333s infinite;-o-animation:blink 0.8333333333s linear 0.8333333333s infinite}.loader__item__8{max-width:8.5px}@keyframes blink{0%{background:#4745B7}100%{background:#CCCBF8}}@keyframes rotate{0%{transform:rotate(0deg)}100%{background:rotate(360deg)}}";
70
70
 
71
- const DEEP_LINK_PREFIX = "https://gataca.page.link/?apn=com.gatacaapp&ibi=com.gataca.wallet&link=";
71
+ const DEEP_LINK_PREFIX = "https://api.gataca.io/qr/redirect.html";
72
72
  const DEFAULT_SESSION_TIMEOUT = 300;
73
73
  const QR_ROLE_CONNECT = "connect";
74
- const FUNCTION_ROLES = {
75
- connect: "scan",
76
- certify: "credential",
77
- };
78
74
  const GatacaQRWS = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
79
- constructor() { super(); this.__registerHost(); this.__attachShadow(); this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7); this.gatacaLoginFailed = createEvent(this, "gatacaLoginFailed", 7); this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.socketEndpoint = undefined; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.wsOnOpen = undefined; this.wsOnMessage = undefined; this.autostart = true; this.autorefresh = false; this.v2 = false; this.qrModalTitle = "Quick Access"; this.modalTitleColor = "#4745B7"; this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideModalTexts = false; this.hideModalBoxShadow = false; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = logoGatacaSvg; this.qrSize = 300; this.modalWidth = 300; this.modalHeight = undefined; this.qrCodeExpiredLabel = "QR Code expired"; this.credentialsNotValidatedLabel = "User credentials not validated"; this.clickInsideBoxLabel = "Click inside the box to"; this.refreshQrLabel = "Refresh QR Code"; this.scanQrLabel = "Scan QR Code"; this.userNotScanInTimeErrorLabel = "User did not scan the QR in the allowed time"; this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated"; this.failedLoginErrorLabel = "No successful login"; this.successLoginLabel = "Successful Connection!"; this.byBrandLabel = "by Gataca"; this.waitingStartSessionLabel = "waiting to start a session"; this.readQrTitle = "Processing..."; this.readQrDescription = "Please wait a moment"; this.hideQrModalDescription = false; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = RESULT_STATUS.NOT_STARTED; }
75
+ constructor() { super(); this.__registerHost(); this.__attachShadow(); this.gatacaLoginCompleted = createEvent(this, "gatacaLoginCompleted", 7); this.gatacaLoginFailed = createEvent(this, "gatacaLoginFailed", 7); this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.socketEndpoint = undefined; this.sessionTimeout = DEFAULT_SESSION_TIMEOUT; this.wsOnOpen = undefined; this.wsOnMessage = undefined; this.autostart = true; this.autorefresh = false; this.v = "3"; this.qrModalTitle = "Quick Access"; this.modalTitleColor = "#4745B7"; this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet"; this.hideModalTexts = false; this.hideModalBoxShadow = false; this.hideBrandTitle = false; this.logoSize = 0; this.logoSrc = logoGatacaSvg; this.qrSize = 300; this.modalWidth = 300; this.modalHeight = undefined; this.qrCodeExpiredLabel = "QR Code expired"; this.credentialsNotValidatedLabel = "User credentials not validated"; this.clickInsideBoxLabel = "Click inside the box to"; this.refreshQrLabel = "Refresh QR Code"; this.scanQrLabel = "Scan QR Code"; this.userNotScanInTimeErrorLabel = "User did not scan the QR in the allowed time"; this.credsNotValidatedErrorLabel = "Provided user credentials couldn't be validated"; this.failedLoginErrorLabel = "No successful login"; this.successLoginLabel = "Successful Connection!"; this.byBrandLabel = "by Gataca"; this.waitingStartSessionLabel = "waiting to start a session"; this.readQrTitle = "Processing..."; this.readQrDescription = "Please wait a moment"; this.hideQrModalDescription = false; this.dynamicLink = true; this.sessionId = undefined; this.authenticationRequest = undefined; this.sessionData = undefined; this.result = RESULT_STATUS.NOT_STARTED; }
80
76
  disconnectedCallback() {
81
77
  this.stop();
82
78
  }
@@ -188,19 +184,11 @@ const GatacaQRWS = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
188
184
  : Promise.reject(new Error("No successful login"));
189
185
  }
190
186
  getLink() {
191
- if (this.v2 && this.qrRole == QR_ROLE_CONNECT) {
187
+ if (this.v === "2" && this.qrRole == QR_ROLE_CONNECT) {
192
188
  return this.authenticationRequest;
193
189
  }
194
- let op = FUNCTION_ROLES[this.qrRole];
195
- let link = "https://gataca.page.link/" + op + "?";
196
- link +=
197
- this.qrRole === QR_ROLE_CONNECT
198
- ? "session=" + this.sessionId
199
- : "process=" + this.sessionId;
200
- link +=
201
- "&callback=" + base64UrlEncode(encodeURIComponent(this.callbackServer));
202
- link = encodeURIComponent(link);
203
- return this.dynamicLink ? DEEP_LINK_PREFIX + link : link;
190
+ const authRequestEncoded = "?dl=" + base64UrlEncode(this.authenticationRequest);
191
+ return DEEP_LINK_PREFIX + authRequestEncoded;
204
192
  }
205
193
  renderQRSection() {
206
194
  switch (this.result) {
@@ -265,7 +253,7 @@ const GatacaQRWS = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
265
253
  "wsOnMessage": [16],
266
254
  "autostart": [4],
267
255
  "autorefresh": [4],
268
- "v2": [4, "v-2"],
256
+ "v": [1],
269
257
  "qrModalTitle": [1, "qr-modal-title"],
270
258
  "modalTitleColor": [1, "modal-title-color"],
271
259
  "qrModalDescription": [1, "qr-modal-description"],