@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.
- package/dist/cjs/gataca-autoqr.cjs.entry.js +5 -5
- package/dist/cjs/gataca-qr_2.cjs.entry.js +6 -19
- package/dist/cjs/gataca-qrws.cjs.entry.js +6 -18
- package/dist/cjs/gataca-ssibutton_2.cjs.entry.js +197 -13
- package/dist/cjs/gatacaqr.cjs.js +3 -7
- package/dist/cjs/{index-f214ab7a.js → index-93d47a75.js} +2 -111
- package/dist/cjs/loader.cjs.js +3 -4
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/gataca-autoqr/gataca-autoqr.js +5 -5
- package/dist/collection/components/gataca-qr/gataca-qr.js +13 -26
- package/dist/collection/components/gataca-qrws/gataca-qrws.js +12 -24
- package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +259 -19
- package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.js +9 -9
- package/dist/components/gataca-autoqr.js +4 -4
- package/dist/components/gataca-qr2.js +6 -19
- package/dist/components/gataca-qrws2.js +6 -18
- package/dist/components/gataca-ssibutton2.js +203 -12
- package/dist/components/gataca-ssibuttonws2.js +3 -3
- package/dist/components/index.d.ts +0 -9
- package/dist/components/index.js +1 -1
- package/dist/esm/gataca-autoqr.entry.js +5 -5
- package/dist/esm/gataca-qr_2.entry.js +6 -19
- package/dist/esm/gataca-qrws.entry.js +6 -18
- package/dist/esm/gataca-ssibutton_2.entry.js +197 -13
- package/dist/esm/gatacaqr.js +3 -4
- package/dist/esm/{index-570c9813.js → index-2be54f32.js} +3 -111
- package/dist/esm/loader.js +3 -4
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/gatacaqr/gatacaqr.esm.js +1 -1
- package/dist/gatacaqr/p-0381ab9a.entry.js +1 -0
- package/dist/gatacaqr/p-0be4566d.js +1 -1
- package/dist/gatacaqr/p-16298cb4.entry.js +1 -0
- package/dist/gatacaqr/p-5ae5f952.js +2 -0
- package/dist/gatacaqr/p-761647d3.entry.js +1 -0
- package/dist/gatacaqr/p-9e9af27e.entry.js +1 -0
- package/dist/types/components/gataca-autoqr/gataca-autoqr.d.ts +2 -2
- package/dist/types/components/gataca-qr/components/qr/QR.d.ts +1 -1
- package/dist/types/components/gataca-qr/components/readQR/ReadQR.d.ts +1 -1
- package/dist/types/components/gataca-qr/components/retryButton/RetryButton.d.ts +1 -1
- package/dist/types/components/gataca-qr/components/success/Success.d.ts +1 -1
- package/dist/types/components/gataca-qr/gataca-qr.d.ts +4 -4
- package/dist/types/components/gataca-qrws/components/qr/QR.d.ts +1 -1
- package/dist/types/components/gataca-qrws/components/readQR/ReadQR.d.ts +1 -1
- package/dist/types/components/gataca-qrws/components/retryButton/RetryButton.d.ts +1 -1
- package/dist/types/components/gataca-qrws/components/success/Success.d.ts +1 -1
- package/dist/types/components/gataca-qrws/gataca-qrws.d.ts +3 -3
- package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +29 -5
- package/dist/types/components/gataca-ssibuttonws/gataca-ssibuttonws.d.ts +2 -2
- package/dist/types/components.d.ts +38 -22
- package/dist/types/stencil-public-runtime.d.ts +3 -59
- package/dist/types/utils/utils.d.ts +9 -9
- package/loader/index.d.ts +0 -9
- package/package.json +2 -2
- package/readme.md +2 -0
- package/dist/gatacaqr/p-3d1a6526.entry.js +0 -1
- package/dist/gatacaqr/p-64740141.entry.js +0 -1
- package/dist/gatacaqr/p-bd6bd52f.entry.js +0 -1
- package/dist/gatacaqr/p-ec0f00a6.js +0 -2
- package/dist/gatacaqr/p-f9931de0.entry.js +0 -1
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
2
|
import { d as defineCustomElement$1 } from './gataca-qrdisplay2.js';
|
|
3
|
+
import { R as RESULT_STATUS } from './gat-icon-alert.js';
|
|
3
4
|
import { d as defineCustomElement$2 } from './gataca-qr2.js';
|
|
4
5
|
|
|
5
6
|
const gatacaSsibuttonCss = "@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}";
|
|
6
7
|
|
|
7
8
|
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=";
|
|
9
|
+
//Default values
|
|
10
|
+
const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
|
|
11
|
+
const DEFAULT_POLLING_FREQ = 3;
|
|
8
12
|
const GatacaSSIButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
9
13
|
constructor() {
|
|
10
14
|
super();
|
|
@@ -17,12 +21,13 @@ const GatacaSSIButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
17
21
|
this.createSession = undefined;
|
|
18
22
|
this.successCallback = undefined;
|
|
19
23
|
this.errorCallback = undefined;
|
|
24
|
+
this.handleCheckAppLoading = undefined;
|
|
20
25
|
this.qrRole = undefined;
|
|
21
26
|
this.callbackServer = undefined;
|
|
22
27
|
this.sessionTimeout = undefined;
|
|
23
28
|
this.pollingFrequency = undefined;
|
|
24
29
|
this.autorefresh = false;
|
|
25
|
-
this.
|
|
30
|
+
this.v = "3";
|
|
26
31
|
this.qrModalTitle = "Quick Access";
|
|
27
32
|
this.modalTitleColor = "#4745B7";
|
|
28
33
|
this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet";
|
|
@@ -43,7 +48,11 @@ const GatacaSSIButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
43
48
|
this.waitingStartSessionLabel = "waiting to start a session";
|
|
44
49
|
this.hideQrModalDescription = false;
|
|
45
50
|
this.open = false;
|
|
46
|
-
this.
|
|
51
|
+
this.sessionId = undefined;
|
|
52
|
+
this.authenticationRequest = undefined;
|
|
53
|
+
this.sessionData = undefined;
|
|
54
|
+
this.result = RESULT_STATUS.NOT_STARTED;
|
|
55
|
+
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 }));
|
|
47
56
|
}
|
|
48
57
|
/**
|
|
49
58
|
* Retrieve manually the session data on a successful login
|
|
@@ -51,22 +60,197 @@ const GatacaSSIButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
51
60
|
async getSessionData() {
|
|
52
61
|
return this.qr.getSessionData();
|
|
53
62
|
}
|
|
63
|
+
async getSessionId() {
|
|
64
|
+
if (this.sessionId) {
|
|
65
|
+
return this.sessionId;
|
|
66
|
+
}
|
|
67
|
+
let { sessionId, authenticationRequest } = await this.createSession();
|
|
68
|
+
this.sessionId = sessionId;
|
|
69
|
+
this.authenticationRequest = authenticationRequest;
|
|
70
|
+
return this.sessionId;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Force manually the start polling
|
|
74
|
+
*/
|
|
75
|
+
async startMobilePolling() {
|
|
76
|
+
await this.getSessionId();
|
|
77
|
+
this.result = RESULT_STATUS.ONGOING;
|
|
78
|
+
this.poll()
|
|
79
|
+
.then((data) => {
|
|
80
|
+
this.result = RESULT_STATUS.SUCCESS;
|
|
81
|
+
this.sessionData = data;
|
|
82
|
+
this.gatacaLoginCompleted.emit(data);
|
|
83
|
+
this.successCallback(data);
|
|
84
|
+
})
|
|
85
|
+
.catch((err) => {
|
|
86
|
+
this.clean();
|
|
87
|
+
let expired = err === RESULT_STATUS.EXPIRED;
|
|
88
|
+
if (expired && this.autorefresh) {
|
|
89
|
+
this.startMobilePolling();
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
if (err !== RESULT_STATUS.NOT_STARTED) {
|
|
93
|
+
let error = expired
|
|
94
|
+
? new Error(this.userNotScanInTimeErrorLabel)
|
|
95
|
+
: new Error(this.credsNotValidatedErrorLabel);
|
|
96
|
+
this.result = err;
|
|
97
|
+
this.gatacaLoginFailed.emit(error);
|
|
98
|
+
this.errorCallback(error);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Stop manually an ongoing session
|
|
105
|
+
*/
|
|
106
|
+
async stop() {
|
|
107
|
+
this.clean();
|
|
108
|
+
if (this.result === RESULT_STATUS.ONGOING || RESULT_STATUS.READ) {
|
|
109
|
+
this.result = RESULT_STATUS.NOT_STARTED;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
clean() {
|
|
113
|
+
this.sessionData = undefined;
|
|
114
|
+
this.sessionId = undefined;
|
|
115
|
+
}
|
|
54
116
|
renderModal() {
|
|
55
117
|
return this.qr;
|
|
56
118
|
}
|
|
57
|
-
|
|
119
|
+
async poll() {
|
|
120
|
+
let endTime = new Date().getTime() +
|
|
121
|
+
(this.sessionTimeout || DEFAULT_SESSION_TIMEOUT) * 1000;
|
|
122
|
+
let interval = (this.pollingFrequency || DEFAULT_POLLING_FREQ) * 1000;
|
|
123
|
+
let checkFunc = async (component) => {
|
|
124
|
+
if (component.result === RESULT_STATUS.NOT_STARTED) {
|
|
125
|
+
return { result: RESULT_STATUS.NOT_STARTED };
|
|
126
|
+
}
|
|
127
|
+
let id = await component.getSessionId();
|
|
128
|
+
return component.checkStatus(id);
|
|
129
|
+
};
|
|
130
|
+
let component = this;
|
|
131
|
+
let checkCondition = async function (resolve, reject) {
|
|
132
|
+
// If the condition is met, we're done!
|
|
133
|
+
let { result, data } = await checkFunc(component);
|
|
134
|
+
switch (result) {
|
|
135
|
+
case RESULT_STATUS.SUCCESS:
|
|
136
|
+
resolve(data);
|
|
137
|
+
break;
|
|
138
|
+
case RESULT_STATUS.READ:
|
|
139
|
+
component.result = RESULT_STATUS.READ;
|
|
140
|
+
case RESULT_STATUS.ONGOING:
|
|
141
|
+
if (component.sessionTimeout > 0 && new Date().getTime() < endTime) {
|
|
142
|
+
setTimeout(checkCondition, interval, resolve, reject);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
reject(RESULT_STATUS.EXPIRED);
|
|
146
|
+
}
|
|
147
|
+
break;
|
|
148
|
+
default:
|
|
149
|
+
reject(result);
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
return new Promise(checkCondition);
|
|
154
|
+
}
|
|
155
|
+
isAppInstalled(appScheme, callback) {
|
|
156
|
+
let timeout;
|
|
157
|
+
let detected = false;
|
|
158
|
+
if (appScheme === null || appScheme === void 0 ? void 0 : appScheme.length) {
|
|
159
|
+
window.location.href = appScheme;
|
|
160
|
+
}
|
|
161
|
+
timeout = setTimeout(() => {
|
|
162
|
+
if (!detected) {
|
|
163
|
+
setTimeout(() => {
|
|
164
|
+
if (!detected) {
|
|
165
|
+
callback(false);
|
|
166
|
+
}
|
|
167
|
+
cleanup();
|
|
168
|
+
}, 1000);
|
|
169
|
+
}
|
|
170
|
+
}, 1500);
|
|
171
|
+
const handleVisibilityChange = () => {
|
|
172
|
+
if (document.hidden) {
|
|
173
|
+
detected = true;
|
|
174
|
+
callback(true);
|
|
175
|
+
this.startMobilePolling();
|
|
176
|
+
cleanup();
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
document.addEventListener("visibilitychange", handleVisibilityChange);
|
|
180
|
+
function cleanup() {
|
|
181
|
+
clearTimeout(timeout);
|
|
182
|
+
document.removeEventListener("visibilitychange", handleVisibilityChange);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
renderDesktopButton() {
|
|
58
186
|
return (h("div", { class: "gatacaButtonWrapper" }, h("button", { class: "gatacaButton", onClick: () => {
|
|
59
187
|
this.open = !this.open;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
188
|
+
setTimeout(() => {
|
|
189
|
+
var _a, _b;
|
|
190
|
+
if (this.open) {
|
|
191
|
+
(_a = this.qrElement) === null || _a === void 0 ? void 0 : _a.display();
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
(_b = this.qrElement) === null || _b === void 0 ? void 0 : _b.stop();
|
|
195
|
+
}
|
|
196
|
+
}, 0);
|
|
66
197
|
} }, h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), h("span", null, this.buttonText))));
|
|
67
198
|
}
|
|
199
|
+
async getAuthRequest() {
|
|
200
|
+
let { authenticationRequest } = await this.createSession();
|
|
201
|
+
return authenticationRequest;
|
|
202
|
+
}
|
|
203
|
+
renderMobileButton(isAndroid, isIos) {
|
|
204
|
+
let loading = false;
|
|
205
|
+
const handleLoading = (isLoading) => {
|
|
206
|
+
loading = isLoading;
|
|
207
|
+
if (this.handleCheckAppLoading) {
|
|
208
|
+
this.handleCheckAppLoading(isLoading);
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
const executeRedirection = async () => {
|
|
212
|
+
handleLoading(true);
|
|
213
|
+
const androidStoreLink = "https://play.google.com/store/apps/details?id=com.gataca.identity";
|
|
214
|
+
const iosStoreLink = "https://apps.apple.com/us/app/gataca/id1498607616";
|
|
215
|
+
try {
|
|
216
|
+
const appScheme = await this.getAuthRequest();
|
|
217
|
+
this.isAppInstalled(appScheme, (installed) => {
|
|
218
|
+
if (!installed) {
|
|
219
|
+
setTimeout(() => {
|
|
220
|
+
this.stop();
|
|
221
|
+
if (isAndroid) {
|
|
222
|
+
window.location.href = androidStoreLink;
|
|
223
|
+
}
|
|
224
|
+
else if (isIos) {
|
|
225
|
+
window.location.href = iosStoreLink;
|
|
226
|
+
}
|
|
227
|
+
}, 500);
|
|
228
|
+
}
|
|
229
|
+
handleLoading(false);
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
catch (error) {
|
|
233
|
+
this.stop();
|
|
234
|
+
handleLoading(false);
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
return (h("div", { class: "gatacaButtonWrapper" }, h("button", { class: "gatacaButton", onClick: () => {
|
|
238
|
+
executeRedirection();
|
|
239
|
+
}, disabled: loading }, h("img", { src: PHONE_ICON, class: "buttonImg", alt: this.buttonText }), h("span", null, this.buttonText))));
|
|
240
|
+
}
|
|
68
241
|
render() {
|
|
69
|
-
|
|
242
|
+
const userAgent =
|
|
243
|
+
// @ts-ignore
|
|
244
|
+
(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);
|
|
245
|
+
const isAndroid = /android/i.test(userAgent);
|
|
246
|
+
const isIos =
|
|
247
|
+
// @ts-ignore
|
|
248
|
+
(/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) ||
|
|
249
|
+
(navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1);
|
|
250
|
+
const isMobile = isAndroid || isIos;
|
|
251
|
+
return (h("div", { class: "buttonContainer" }, isMobile && this.v === "3"
|
|
252
|
+
? this.renderMobileButton(isAndroid, isIos)
|
|
253
|
+
: this.renderDesktopButton(), this.open && (!isMobile || this.v === "3") && this.renderModal()));
|
|
70
254
|
}
|
|
71
255
|
static get style() { return gatacaSsibuttonCss; }
|
|
72
256
|
}, [1, "gataca-ssibutton", {
|
|
@@ -75,12 +259,13 @@ const GatacaSSIButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
75
259
|
"createSession": [16],
|
|
76
260
|
"successCallback": [16],
|
|
77
261
|
"errorCallback": [16],
|
|
262
|
+
"handleCheckAppLoading": [16],
|
|
78
263
|
"qrRole": [1, "qr-role"],
|
|
79
264
|
"callbackServer": [1, "callback-server"],
|
|
80
265
|
"sessionTimeout": [2, "session-timeout"],
|
|
81
266
|
"pollingFrequency": [2, "polling-frequency"],
|
|
82
267
|
"autorefresh": [4],
|
|
83
|
-
"
|
|
268
|
+
"v": [1],
|
|
84
269
|
"qrModalTitle": [1, "qr-modal-title"],
|
|
85
270
|
"modalTitleColor": [1, "modal-title-color"],
|
|
86
271
|
"qrModalDescription": [1, "qr-modal-description"],
|
|
@@ -101,7 +286,13 @@ const GatacaSSIButton = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
|
|
|
101
286
|
"waitingStartSessionLabel": [1, "waiting-start-session-label"],
|
|
102
287
|
"hideQrModalDescription": [4, "hide-qr-modal-description"],
|
|
103
288
|
"open": [32],
|
|
104
|
-
"
|
|
289
|
+
"sessionId": [32],
|
|
290
|
+
"authenticationRequest": [32],
|
|
291
|
+
"sessionData": [32],
|
|
292
|
+
"result": [32],
|
|
293
|
+
"getSessionData": [64],
|
|
294
|
+
"startMobilePolling": [64],
|
|
295
|
+
"stop": [64]
|
|
105
296
|
}]);
|
|
106
297
|
function defineCustomElement() {
|
|
107
298
|
if (typeof customElements === "undefined") {
|
|
@@ -23,13 +23,13 @@ const GatacaSSIButtonWS = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
23
23
|
this.wsOnMessage = undefined;
|
|
24
24
|
this.autostart = true;
|
|
25
25
|
this.autorefresh = false;
|
|
26
|
-
this.
|
|
26
|
+
this.v = "3";
|
|
27
27
|
this.qrModalTitle = "Quick Access";
|
|
28
28
|
this.qrModalDescription = "Sign up or sign in by scanning the QR Code with the Gataca Wallet";
|
|
29
29
|
this.hideBrandTitle = false;
|
|
30
30
|
this.dynamicLink = true;
|
|
31
31
|
this.open = false;
|
|
32
|
-
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,
|
|
32
|
+
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 }));
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Retrieve manually the session data on a successful login
|
|
@@ -67,7 +67,7 @@ const GatacaSSIButtonWS = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
67
67
|
"wsOnMessage": [16],
|
|
68
68
|
"autostart": [4],
|
|
69
69
|
"autorefresh": [4],
|
|
70
|
-
"
|
|
70
|
+
"v": [1],
|
|
71
71
|
"qrModalTitle": [1, "qr-modal-title"],
|
|
72
72
|
"qrModalDescription": [1, "qr-modal-description"],
|
|
73
73
|
"hideBrandTitle": [4, "hide-brand-title"],
|
|
@@ -18,15 +18,6 @@ export { GatacaSSIButtonWS as GatacaSsibuttonws } from '../types/components/gata
|
|
|
18
18
|
*/
|
|
19
19
|
export declare const setAssetPath: (path: string) => void;
|
|
20
20
|
|
|
21
|
-
/**
|
|
22
|
-
* Used to specify a nonce value that corresponds with an application's CSP.
|
|
23
|
-
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
24
|
-
* Alternatively, the nonce value can be set on a meta tag in the DOM head
|
|
25
|
-
* (<meta name="csp-nonce" content="{ nonce value here }" />) which
|
|
26
|
-
* will result in the same behavior.
|
|
27
|
-
*/
|
|
28
|
-
export declare const setNonce: (nonce: string) => void
|
|
29
|
-
|
|
30
21
|
export interface SetPlatformOptions {
|
|
31
22
|
raf?: (c: FrameRequestCallback) => number;
|
|
32
23
|
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
package/dist/components/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { setAssetPath,
|
|
1
|
+
export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
|
|
2
2
|
export { R as RESULT_STATUS, b as base64UrlEncode, c as checkMobile } from './gat-icon-alert.js';
|
|
3
3
|
export { GatacaAutoqr, defineCustomElement as defineCustomElementGatacaAutoqr } from './gataca-autoqr.js';
|
|
4
4
|
export { GatacaQr, defineCustomElement as defineCustomElementGatacaQr } from './gataca-qr.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-2be54f32.js';
|
|
2
2
|
|
|
3
3
|
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}";
|
|
4
4
|
|
|
@@ -68,18 +68,18 @@ const GatacaAutoQR = class {
|
|
|
68
68
|
selectQR() {
|
|
69
69
|
if (this.config.useButton) {
|
|
70
70
|
if (this.config.useWs) {
|
|
71
|
-
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,
|
|
71
|
+
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 }));
|
|
72
72
|
}
|
|
73
73
|
else {
|
|
74
|
-
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,
|
|
74
|
+
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 }));
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
else {
|
|
78
78
|
if (this.config.useWs) {
|
|
79
|
-
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,
|
|
79
|
+
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 }));
|
|
80
80
|
}
|
|
81
81
|
else {
|
|
82
|
-
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,
|
|
82
|
+
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 }));
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, c as createEvent } from './index-
|
|
1
|
+
import { r as registerInstance, h, c as createEvent } from './index-2be54f32.js';
|
|
2
2
|
import { l as logoGatacaSvg, g as gatIconCheckSvg, a as gatIconRefreshSvg, b as gatIconAlertSvg } from './gat-icon-alert-7b06ef3a.js';
|
|
3
3
|
import { Q as QRCodeStyling } from './qr-code-styling-0eeb38d5.js';
|
|
4
4
|
import { R as RESULT_STATUS, c as checkMobile, b as base64UrlEncode } from './utils-63e7a33b.js';
|
|
@@ -111,17 +111,12 @@ const QR = (props) => {
|
|
|
111
111
|
|
|
112
112
|
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)}}";
|
|
113
113
|
|
|
114
|
-
const DEEP_LINK_PREFIX = "https://gataca.
|
|
114
|
+
const DEEP_LINK_PREFIX = "https://api.gataca.io/qr/redirect.html";
|
|
115
115
|
//Default values
|
|
116
116
|
const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
|
|
117
117
|
const DEFAULT_POLLING_FREQ = 3;
|
|
118
|
-
const QR_ROLE_CONNECT = "connect";
|
|
119
|
-
const FUNCTION_ROLES = {
|
|
120
|
-
connect: "scan",
|
|
121
|
-
certify: "credential",
|
|
122
|
-
};
|
|
123
118
|
const GatacaQR = class {
|
|
124
|
-
constructor(hostRef) { registerInstance(this, hostRef); 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.
|
|
119
|
+
constructor(hostRef) { registerInstance(this, hostRef); 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; }
|
|
125
120
|
disconnectedCallback() {
|
|
126
121
|
this.stop();
|
|
127
122
|
}
|
|
@@ -195,19 +190,11 @@ const GatacaQR = class {
|
|
|
195
190
|
return this.sessionId;
|
|
196
191
|
}
|
|
197
192
|
getLink() {
|
|
198
|
-
if (this.
|
|
193
|
+
if (this.v === "2") {
|
|
199
194
|
return this.authenticationRequest;
|
|
200
195
|
}
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
link +=
|
|
204
|
-
this.qrRole === QR_ROLE_CONNECT
|
|
205
|
-
? "session=" + this.sessionId
|
|
206
|
-
: "process=" + this.sessionId;
|
|
207
|
-
link +=
|
|
208
|
-
"&callback=" + base64UrlEncode(encodeURIComponent(this.callbackServer));
|
|
209
|
-
link = encodeURIComponent(link);
|
|
210
|
-
return this.dynamicLink ? DEEP_LINK_PREFIX + link : link;
|
|
196
|
+
const authRequestEncoded = "?dl=" + base64UrlEncode(this.authenticationRequest);
|
|
197
|
+
return DEEP_LINK_PREFIX + authRequestEncoded;
|
|
211
198
|
}
|
|
212
199
|
async poll() {
|
|
213
200
|
let endTime = new Date().getTime() +
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h, r as registerInstance, c as createEvent } from './index-
|
|
1
|
+
import { h, r as registerInstance, c as createEvent } from './index-2be54f32.js';
|
|
2
2
|
import { g as gatIconCheckSvg, a as gatIconRefreshSvg, b as gatIconAlertSvg, l as logoGatacaSvg } from './gat-icon-alert-7b06ef3a.js';
|
|
3
3
|
import './qr-code-styling-0eeb38d5.js';
|
|
4
4
|
import { R as RESULT_STATUS, c as checkMobile, b as base64UrlEncode } from './utils-63e7a33b.js';
|
|
@@ -69,15 +69,11 @@ const ReadQR = (props) => {
|
|
|
69
69
|
|
|
70
70
|
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)}}";
|
|
71
71
|
|
|
72
|
-
const DEEP_LINK_PREFIX = "https://gataca.
|
|
72
|
+
const DEEP_LINK_PREFIX = "https://api.gataca.io/qr/redirect.html";
|
|
73
73
|
const DEFAULT_SESSION_TIMEOUT = 300;
|
|
74
74
|
const QR_ROLE_CONNECT = "connect";
|
|
75
|
-
const FUNCTION_ROLES = {
|
|
76
|
-
connect: "scan",
|
|
77
|
-
certify: "credential",
|
|
78
|
-
};
|
|
79
75
|
const GatacaQRWS = class {
|
|
80
|
-
constructor(hostRef) { registerInstance(this, hostRef); 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.
|
|
76
|
+
constructor(hostRef) { registerInstance(this, hostRef); 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; }
|
|
81
77
|
disconnectedCallback() {
|
|
82
78
|
this.stop();
|
|
83
79
|
}
|
|
@@ -189,19 +185,11 @@ const GatacaQRWS = class {
|
|
|
189
185
|
: Promise.reject(new Error("No successful login"));
|
|
190
186
|
}
|
|
191
187
|
getLink() {
|
|
192
|
-
if (this.
|
|
188
|
+
if (this.v === "2" && this.qrRole == QR_ROLE_CONNECT) {
|
|
193
189
|
return this.authenticationRequest;
|
|
194
190
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
link +=
|
|
198
|
-
this.qrRole === QR_ROLE_CONNECT
|
|
199
|
-
? "session=" + this.sessionId
|
|
200
|
-
: "process=" + this.sessionId;
|
|
201
|
-
link +=
|
|
202
|
-
"&callback=" + base64UrlEncode(encodeURIComponent(this.callbackServer));
|
|
203
|
-
link = encodeURIComponent(link);
|
|
204
|
-
return this.dynamicLink ? DEEP_LINK_PREFIX + link : link;
|
|
191
|
+
const authRequestEncoded = "?dl=" + base64UrlEncode(this.authenticationRequest);
|
|
192
|
+
return DEEP_LINK_PREFIX + authRequestEncoded;
|
|
205
193
|
}
|
|
206
194
|
renderQRSection() {
|
|
207
195
|
switch (this.result) {
|