@gataca/qr 0.0.7

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 (119) hide show
  1. package/LICENSE +21 -0
  2. package/dist/cjs/gat-icon-alert-0ad19b26.js +14 -0
  3. package/dist/cjs/gataca-autoqr.cjs.entry.js +105 -0
  4. package/dist/cjs/gataca-qr_2.cjs.entry.js +294 -0
  5. package/dist/cjs/gataca-qrws.cjs.entry.js +252 -0
  6. package/dist/cjs/gataca-ssibutton_2.cjs.entry.js +309 -0
  7. package/dist/cjs/gatacaqr.cjs.js +19 -0
  8. package/dist/cjs/index-93d47a75.js +1469 -0
  9. package/dist/cjs/index.cjs.js +16 -0
  10. package/dist/cjs/loader.cjs.js +21 -0
  11. package/dist/cjs/qr-code-styling-412bbc7a.js +28 -0
  12. package/dist/cjs/utils-ef28b844.js +27 -0
  13. package/dist/collection/assets/icons/gat-icon-alert.svg +5 -0
  14. package/dist/collection/assets/icons/gat-icon-check.svg +5 -0
  15. package/dist/collection/assets/icons/gat-icon-refresh.svg +4 -0
  16. package/dist/collection/assets/images/logo_gataca.svg +7 -0
  17. package/dist/collection/collection-manifest.json +17 -0
  18. package/dist/collection/components/gataca-autoqr/gataca-autoqr.css +116 -0
  19. package/dist/collection/components/gataca-autoqr/gataca-autoqr.js +323 -0
  20. package/dist/collection/components/gataca-qr/components/qr/QR.js +5 -0
  21. package/dist/collection/components/gataca-qr/components/readQR/ReadQR.js +11 -0
  22. package/dist/collection/components/gataca-qr/components/readQR/components/AnimatedLoader.js +4 -0
  23. package/dist/collection/components/gataca-qr/components/retryButton/RetryButton.js +13 -0
  24. package/dist/collection/components/gataca-qr/components/success/Success.js +8 -0
  25. package/dist/collection/components/gataca-qr/gataca-qr.css +399 -0
  26. package/dist/collection/components/gataca-qr/gataca-qr.js +965 -0
  27. package/dist/collection/components/gataca-qrdisplay/gataca-qrdisplay.js +154 -0
  28. package/dist/collection/components/gataca-qrws/components/qr/QR.js +5 -0
  29. package/dist/collection/components/gataca-qrws/components/readQR/ReadQR.js +11 -0
  30. package/dist/collection/components/gataca-qrws/components/readQR/components/AnimatedLoader.js +4 -0
  31. package/dist/collection/components/gataca-qrws/components/retryButton/RetryButton.js +13 -0
  32. package/dist/collection/components/gataca-qrws/components/success/Success.js +8 -0
  33. package/dist/collection/components/gataca-qrws/gataca-qrws.css +400 -0
  34. package/dist/collection/components/gataca-qrws/gataca-qrws.js +974 -0
  35. package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.css +116 -0
  36. package/dist/collection/components/gataca-ssibutton/gataca-ssibutton.js +933 -0
  37. package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.css +116 -0
  38. package/dist/collection/components/gataca-ssibuttonws/gataca-ssibuttonws.js +410 -0
  39. package/dist/collection/index.js +2 -0
  40. package/dist/collection/utils/index.js +1 -0
  41. package/dist/collection/utils/utils.js +22 -0
  42. package/dist/components/gat-icon-alert.js +30 -0
  43. package/dist/components/gataca-autoqr.d.ts +11 -0
  44. package/dist/components/gataca-autoqr.js +161 -0
  45. package/dist/components/gataca-qr.d.ts +11 -0
  46. package/dist/components/gataca-qr.js +6 -0
  47. package/dist/components/gataca-qr2.js +309 -0
  48. package/dist/components/gataca-qrdisplay.d.ts +11 -0
  49. package/dist/components/gataca-qrdisplay.js +6 -0
  50. package/dist/components/gataca-qrdisplay2.js +93 -0
  51. package/dist/components/gataca-qrws.d.ts +11 -0
  52. package/dist/components/gataca-qrws.js +6 -0
  53. package/dist/components/gataca-qrws2.js +310 -0
  54. package/dist/components/gataca-ssibutton.d.ts +11 -0
  55. package/dist/components/gataca-ssibutton.js +6 -0
  56. package/dist/components/gataca-ssibutton2.js +318 -0
  57. package/dist/components/gataca-ssibuttonws.d.ts +11 -0
  58. package/dist/components/gataca-ssibuttonws.js +6 -0
  59. package/dist/components/gataca-ssibuttonws2.js +102 -0
  60. package/dist/components/index.d.ts +27 -0
  61. package/dist/components/index.js +8 -0
  62. package/dist/esm/gat-icon-alert-7b06ef3a.js +9 -0
  63. package/dist/esm/gataca-autoqr.entry.js +101 -0
  64. package/dist/esm/gataca-qr_2.entry.js +289 -0
  65. package/dist/esm/gataca-qrws.entry.js +248 -0
  66. package/dist/esm/gataca-ssibutton_2.entry.js +304 -0
  67. package/dist/esm/gatacaqr.js +17 -0
  68. package/dist/esm/index-2be54f32.js +1443 -0
  69. package/dist/esm/index.js +1 -0
  70. package/dist/esm/loader.js +17 -0
  71. package/dist/esm/polyfills/core-js.js +11 -0
  72. package/dist/esm/polyfills/css-shim.js +1 -0
  73. package/dist/esm/polyfills/dom.js +79 -0
  74. package/dist/esm/polyfills/es5-html-element.js +1 -0
  75. package/dist/esm/polyfills/index.js +34 -0
  76. package/dist/esm/polyfills/system.js +6 -0
  77. package/dist/esm/qr-code-styling-0eeb38d5.js +26 -0
  78. package/dist/esm/utils-63e7a33b.js +24 -0
  79. package/dist/gatacaqr/gatacaqr.esm.js +1 -0
  80. package/dist/gatacaqr/index.esm.js +1 -0
  81. package/dist/gatacaqr/p-0381ab9a.entry.js +1 -0
  82. package/dist/gatacaqr/p-0be4566d.js +1 -0
  83. package/dist/gatacaqr/p-16298cb4.entry.js +1 -0
  84. package/dist/gatacaqr/p-2cd7b062.js +1 -0
  85. package/dist/gatacaqr/p-5ae5f952.js +2 -0
  86. package/dist/gatacaqr/p-68f20267.entry.js +1 -0
  87. package/dist/gatacaqr/p-9e9af27e.entry.js +1 -0
  88. package/dist/gatacaqr/p-ea783014.js +1 -0
  89. package/dist/index.cjs.js +1 -0
  90. package/dist/index.js +1 -0
  91. package/dist/types/components/gataca-autoqr/gataca-autoqr.d.ts +85 -0
  92. package/dist/types/components/gataca-qr/components/qr/QR.d.ts +9 -0
  93. package/dist/types/components/gataca-qr/components/readQR/ReadQR.d.ts +13 -0
  94. package/dist/types/components/gataca-qr/components/readQR/components/AnimatedLoader.d.ts +2 -0
  95. package/dist/types/components/gataca-qr/components/retryButton/RetryButton.d.ts +13 -0
  96. package/dist/types/components/gataca-qr/components/success/Success.d.ts +7 -0
  97. package/dist/types/components/gataca-qr/gataca-qr.d.ts +246 -0
  98. package/dist/types/components/gataca-qrdisplay/gataca-qrdisplay.d.ts +35 -0
  99. package/dist/types/components/gataca-qrws/components/qr/QR.d.ts +9 -0
  100. package/dist/types/components/gataca-qrws/components/readQR/ReadQR.d.ts +13 -0
  101. package/dist/types/components/gataca-qrws/components/readQR/components/AnimatedLoader.d.ts +2 -0
  102. package/dist/types/components/gataca-qrws/components/retryButton/RetryButton.d.ts +13 -0
  103. package/dist/types/components/gataca-qrws/components/success/Success.d.ts +7 -0
  104. package/dist/types/components/gataca-qrws/gataca-qrws.d.ts +239 -0
  105. package/dist/types/components/gataca-ssibutton/gataca-ssibutton.d.ts +218 -0
  106. package/dist/types/components/gataca-ssibuttonws/gataca-ssibuttonws.d.ts +110 -0
  107. package/dist/types/components.d.ts +1326 -0
  108. package/dist/types/index.d.ts +2 -0
  109. package/dist/types/stencil-public-runtime.d.ts +1581 -0
  110. package/dist/types/utils/index.d.ts +1 -0
  111. package/dist/types/utils/utils.d.ts +57 -0
  112. package/loader/cdn.js +3 -0
  113. package/loader/index.cjs.js +3 -0
  114. package/loader/index.d.ts +12 -0
  115. package/loader/index.es2017.js +3 -0
  116. package/loader/index.js +4 -0
  117. package/loader/package.json +11 -0
  118. package/package.json +45 -0
  119. package/readme.md +69 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ const logoGatacaSvg = 'data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDc2IDcxIiB3aWR0aD0iNzEiIGhlaWdodD0iNjYiPgoJPHRpdGxlPlZlY3RvciAoMyktc3ZnPC90aXRsZT4KCTxzdHlsZT4KCQkuczAgeyBmaWxsOiAjNDc0NWI3IH0gCgk8L3N0eWxlPgoJPHBhdGggaWQ9IkxheWVyIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsYXNzPSJzMCIgZD0ibTcyLjIgMzguNGMyLjIgMy4zIDMuNSA3LjIgMy41IDExLjQgMCAxMS4yLTguOCAyMC4yLTE5LjkgMjAuN3EtMC40IDAtMC44IDBjLTMgMC01LjgtMC42LTguNC0xLjdxLTIuMS0xLTMuOC0yLjMtMS4xLTAuOC0yLjEtMS43LTEuMy0xLjItMi4zLTIuNi0wLjUgMC42LTEgMS4yYy0zLjggNC40LTkuNCA3LjEtMTUuNyA3LjEtNi43IDAtMTIuNi0zLjItMTYuNC04LjEtMi43LTMuNS00LjMtNy44LTQuMy0xMi42IDAtMTAuNiA4LTE5LjMgMTguMy0yMC41LTEuMS0yLjUtMS43LTUuMi0xLjctOC4xIDAtMTEuNSA5LjM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@@ -0,0 +1,105 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-93d47a75.js');
6
+
7
+ const gatacaAutoqrCss = "@import url(\"https://fonts.googleapis.com/css2?family=Work+Sans:wght@300;400&display=swap\"); html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:\"\";content:none}table{border-collapse:collapse;border-spacing:0}.img-fluid{height:auto;max-width:50%}img{margin-left:auto;margin-right:auto}.buttonContainer{display:inline-block;text-align:right;padding:10px;position:relative}.gatacaButtonWrapper{margin:8px}.gatacaButtonWrapper .gatacaButton{display:flex;min-width:100px;padding:8px 8px;background-color:white;font-size:12px;font-family:\"Work Sans\", sans-serif;letter-spacing:1px;font-weight:2;justify-content:space-between;align-items:center;border-radius:6px;border:1px solid rgba(24, 27, 94, 0.5);color:rgba(24, 27, 94, 0.8);box-shadow:0px 1px 3px rgba(48, 48, 48, 0.15);cursor:pointer}.gatacaButtonWrapper .gatacaButton>span{margin-right:10px}.gatacaButtonWrapper .gatacaButton:hover{box-shadow:0px 2px 8px rgba(48, 48, 48, 0.1)}.gatacaButtonWrapper .buttonText{text-align:right;font-size:8px;color:rgba(24, 27, 94, 0.5);font-family:\"Helvetica Neue\", sans-serif;letter-spacing:1px;padding-right:8px;font-weight:1}.gatacaButtonWrapper .buttonImg{height:25px;width:25px;margin:0;margin-right:20px}";
8
+
9
+ const DEFAULT_REPOSITORY = "https://studio.gataca.io/api/v1/qrconfigs";
10
+ const fixFunctions = (data) => {
11
+ var _a, _b, _c, _d, _e, _f;
12
+ data.errorCallback = deserializeFunction((_a = data.errorCallback) === null || _a === void 0 ? void 0 : _a.toString());
13
+ data.successCallback = deserializeFunction((_b = data.successCallback) === null || _b === void 0 ? void 0 : _b.toString());
14
+ data.wsOnMessage = deserializeFunction((_c = data.wsOnMessage) === null || _c === void 0 ? void 0 : _c.toString());
15
+ data.wsOnOpen = deserializeFunction((_d = data.wsOnOpen) === null || _d === void 0 ? void 0 : _d.toString());
16
+ data.checkStatus = deserializeFunction((_e = data.checkStatus) === null || _e === void 0 ? void 0 : _e.toString());
17
+ data.createSession = deserializeFunction((_f = data.createSession) === null || _f === void 0 ? void 0 : _f.toString());
18
+ return data;
19
+ };
20
+ const deserializeFunction = (data) => {
21
+ if (data) {
22
+ return new Function("return " + data)();
23
+ }
24
+ return undefined;
25
+ };
26
+ const GatacaAutoQR = class {
27
+ constructor(hostRef) {
28
+ index.registerInstance(this, hostRef);
29
+ this.gatacaLoginCompleted = index.createEvent(this, "gatacaLoginCompleted", 7);
30
+ this.gatacaLoginFailed = index.createEvent(this, "gatacaLoginFailed", 7);
31
+ this.configId = undefined;
32
+ this.configRepository = DEFAULT_REPOSITORY;
33
+ this.successCallback = undefined;
34
+ this.errorCallback = undefined;
35
+ this.checkStatus = undefined;
36
+ this.createSession = undefined;
37
+ this.wsOnOpen = undefined;
38
+ this.wsOnMessage = undefined;
39
+ this.config = undefined;
40
+ this.loading = undefined;
41
+ this.loading = true;
42
+ fetch(this.configRepository + "/" + this.configId, {
43
+ method: "GET",
44
+ headers: {
45
+ "Content-Type": "application/json",
46
+ },
47
+ })
48
+ .then((response) => {
49
+ response
50
+ .json()
51
+ .then((data) => {
52
+ data = fixFunctions(data);
53
+ this.config = data;
54
+ this.loading = false;
55
+ })
56
+ .catch((err) => {
57
+ console.log("Cannot retrieve selected config", err);
58
+ this.loading = false;
59
+ });
60
+ })
61
+ .catch((err) => {
62
+ console.log("Cannot retrieve selected config", err);
63
+ this.loading = false;
64
+ });
65
+ }
66
+ /**
67
+ * Retrieve manually the session data on a successful login
68
+ */
69
+ async getSessionData() {
70
+ return this.qr.getSessionData();
71
+ }
72
+ selectQR() {
73
+ if (this.config.useButton) {
74
+ if (this.config.useWs) {
75
+ this.qr = (index.h("gataca-ssibuttonws", { buttonText: this.config.buttonText, wsOnMessage: this.wsOnMessage || this.config.wsOnMessage, wsOnOpen: this.wsOnOpen || this.config.wsOnOpen, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, socketEndpoint: this.config.socketEndpoint, autostart: true, autorefresh: this.config.autorefresh, v: this.config.v, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
76
+ }
77
+ else {
78
+ this.qr = (index.h("gataca-ssibutton", { buttonText: this.config.buttonText, checkStatus: this.checkStatus || this.config.checkStatus, createSession: this.createSession || this.config.createSession, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, pollingFrequency: this.config.pollingFrequency, autorefresh: this.config.autorefresh, v: this.config.v, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
79
+ }
80
+ }
81
+ else {
82
+ if (this.config.useWs) {
83
+ this.qr = (index.h("gataca-qrws", { wsOnMessage: this.wsOnMessage || this.config.wsOnMessage, wsOnOpen: this.wsOnOpen || this.config.wsOnOpen, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, socketEndpoint: this.config.socketEndpoint, autostart: this.config.autostart, autorefresh: this.config.autorefresh, v: this.config.v, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
84
+ }
85
+ else {
86
+ this.qr = (index.h("gataca-qr", { checkStatus: this.checkStatus || this.config.checkStatus, createSession: this.createSession || this.config.createSession, successCallback: this.successCallback || this.config.successCallback, errorCallback: this.errorCallback || this.config.errorCallback, qrRole: this.config.qrRole, callbackServer: this.config.callbackServer, sessionTimeout: this.config.sessionTimeout, pollingFrequency: this.config.pollingFrequency, autostart: this.config.autostart, autorefresh: this.config.autorefresh, v: this.config.v, qrModalTitle: this.config.qrModalTitle, qrModalDescription: this.config.qrModalDescription, hideBrandTitle: this.config.hideBrandTitle, dynamicLink: this.config.dynamicLink }));
87
+ }
88
+ }
89
+ }
90
+ render() {
91
+ if (this.loading) {
92
+ //TODO: Improve loading message
93
+ return index.h("div", null, "Loading...");
94
+ }
95
+ if (this.config) {
96
+ this.selectQR();
97
+ return this.qr;
98
+ }
99
+ //TODO: Improve error message
100
+ return index.h("div", null, "Error loading your config...");
101
+ }
102
+ };
103
+ GatacaAutoQR.style = gatacaAutoqrCss;
104
+
105
+ exports.gataca_autoqr = GatacaAutoQR;
@@ -0,0 +1,294 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-93d47a75.js');
6
+ const gatIconAlert = require('./gat-icon-alert-0ad19b26.js');
7
+ const qrCodeStyling = require('./qr-code-styling-412bbc7a.js');
8
+ const utils = require('./utils-ef28b844.js');
9
+
10
+ const GatacaQRDisplay = class {
11
+ constructor(hostRef) {
12
+ index.registerInstance(this, hostRef);
13
+ this.qrData = undefined;
14
+ this.size = 256;
15
+ this.logoSize = 0;
16
+ this.logoSrc = undefined;
17
+ this.qrColor = "#1E1E20";
18
+ this.rounded = true;
19
+ }
20
+ componentDidLoad() {
21
+ const qrCode = new qrCodeStyling.QRCodeStyling({
22
+ data: this.qrData,
23
+ width: this.size,
24
+ height: this.size,
25
+ image: this.logoSize > 0 ? this.logoSrc || gatIconAlert.logoGatacaSvg : undefined,
26
+ margin: 10,
27
+ type: "svg",
28
+ dotsOptions: {
29
+ color: this.qrColor,
30
+ type: this.rounded ? "dots" : "square",
31
+ },
32
+ cornersSquareOptions: {
33
+ type: this.rounded ? "extra-rounded" : "square",
34
+ },
35
+ cornersDotOptions: {
36
+ type: this.rounded ? "dot" : "square",
37
+ },
38
+ imageOptions: {
39
+ margin: 2,
40
+ imageSize: this.logoSize,
41
+ },
42
+ });
43
+ qrCode.append(this.qr);
44
+ }
45
+ render() {
46
+ return (index.h("div", { ref: (el) => {
47
+ this.qr = el;
48
+ } }));
49
+ }
50
+ };
51
+
52
+ const Success = (props) => {
53
+ const { modalHeight, successLoginLabel } = props;
54
+ return (index.h("div", { class: "success", style: {
55
+ height: modalHeight ? (modalHeight === null || modalHeight === void 0 ? void 0 : modalHeight.toString()) + "px" : "300px",
56
+ } },
57
+ index.h("img", { src: gatIconAlert.gatIconCheckSvg, height: 52, width: 52 }),
58
+ index.h("p", { class: "successMsg" }, successLoginLabel)));
59
+ };
60
+
61
+ const RetryButton = (props) => {
62
+ var _a;
63
+ const { errorMessage, modalWidth, clickInsideBoxLabel, refreshQrLabel, scanQrLabel, waitingStartSessionLabel, display, renderRetryQR, } = props;
64
+ return (index.h("div", { class: "reload", style: {
65
+ width: (modalWidth - 48).toString() + "px",
66
+ height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + "px" : "",
67
+ } },
68
+ index.h("div", { id: "notify", onClick: () => display() },
69
+ index.h("img", { src: gatIconAlert.gatIconRefreshSvg, height: 24, width: 24 }),
70
+ index.h("p", { class: "notify-text" },
71
+ clickInsideBoxLabel,
72
+ " "),
73
+ errorMessage ? (index.h("p", { class: "notify-text bold" }, refreshQrLabel)) : (index.h("p", { class: "notify-text bold" }, scanQrLabel)),
74
+ errorMessage && (index.h("div", { class: "alert", style: {
75
+ width: (modalWidth - 48).toString() + "px",
76
+ } },
77
+ index.h("img", { src: gatIconAlert.gatIconAlertSvg, height: 24, width: 24 }),
78
+ index.h("p", null, errorMessage)))),
79
+ index.h("div", { id: "qrwait" }, renderRetryQR(waitingStartSessionLabel))));
80
+ };
81
+
82
+ const AnimatedLoader = () => {
83
+ return (index.h("div", { class: "containerLoader" },
84
+ index.h("div", { class: "loader" },
85
+ index.h("div", { class: "loader__item loader__item__1" }),
86
+ index.h("div", { class: "loader__item loader__item__2" }),
87
+ index.h("div", { class: "loader__item loader__item__3" }),
88
+ index.h("div", { class: "loader__item loader__item__4" }),
89
+ index.h("div", { class: "loader__item loader__item__5" }),
90
+ index.h("div", { class: "loader__item loader__item__6" }),
91
+ index.h("div", { class: "loader__item loader__item__7" }),
92
+ index.h("div", { class: "loader__item loader__item__8" }))));
93
+ };
94
+
95
+ const ReadQR = (props) => {
96
+ var _a;
97
+ const { modalWidth, readQrMessages, renderQR, url, sizeQR } = props;
98
+ return (index.h("div", { class: "blured", style: {
99
+ width: (modalWidth - 48).toString() + "px",
100
+ height: modalWidth ? ((_a = (modalWidth - 48)) === null || _a === void 0 ? void 0 : _a.toString()) + "px" : "",
101
+ } },
102
+ index.h("div", { id: "notify" },
103
+ index.h(AnimatedLoader, null),
104
+ index.h("p", { class: "notify-text" }, readQrMessages === null || readQrMessages === void 0 ? void 0 :
105
+ readQrMessages.title,
106
+ " "),
107
+ index.h("p", { class: "notify-text bold" }, readQrMessages === null || readQrMessages === void 0 ? void 0 : readQrMessages.description)),
108
+ index.h("div", { id: "qrwait" }, renderQR(url, false, sizeQR))));
109
+ };
110
+
111
+ const QR = (props) => {
112
+ const { value, useLogo, logoSrc, size } = props;
113
+ return (index.h("gataca-qrdisplay", { qrData: value, rounded: true, size: size, "logo-size": useLogo ? 0.33 : 0, "logo-src": logoSrc }));
114
+ };
115
+
116
+ 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)}}";
117
+
118
+ const DEEP_LINK_PREFIX = "https://api.gataca.io/qr/redirect.html";
119
+ //Default values
120
+ const DEFAULT_SESSION_TIMEOUT = 300; //5mins as in connect
121
+ const DEFAULT_POLLING_FREQ = 3;
122
+ const GatacaQR = class {
123
+ constructor(hostRef) { index.registerInstance(this, hostRef); this.gatacaLoginCompleted = index.createEvent(this, "gatacaLoginCompleted", 7); this.gatacaLoginFailed = index.createEvent(this, "gatacaLoginFailed", 7); this.checkStatus = undefined; this.createSession = undefined; this.successCallback = undefined; this.errorCallback = undefined; this.qrRole = undefined; this.callbackServer = undefined; this.autostart = true; this.autorefresh = false; this.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 = gatIconAlert.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 = utils.RESULT_STATUS.NOT_STARTED; }
124
+ disconnectedCallback() {
125
+ this.stop();
126
+ }
127
+ async componentDidLoad() {
128
+ if (this.autostart) {
129
+ await this.display();
130
+ }
131
+ }
132
+ /**
133
+ * Force manually the display of a QR
134
+ */
135
+ async display() {
136
+ await this.getSessionId();
137
+ this.result = utils.RESULT_STATUS.ONGOING;
138
+ this.poll()
139
+ .then((data) => {
140
+ this.result = utils.RESULT_STATUS.SUCCESS;
141
+ this.sessionData = data;
142
+ this.gatacaLoginCompleted.emit(data);
143
+ this.successCallback(data);
144
+ })
145
+ .catch((err) => {
146
+ this.clean();
147
+ let expired = err === utils.RESULT_STATUS.EXPIRED;
148
+ if (expired && this.autorefresh) {
149
+ this.display();
150
+ }
151
+ else {
152
+ if (err !== utils.RESULT_STATUS.NOT_STARTED) {
153
+ let error = expired
154
+ ? new Error(this.userNotScanInTimeErrorLabel)
155
+ : new Error(this.credsNotValidatedErrorLabel);
156
+ this.result = err;
157
+ this.gatacaLoginFailed.emit(error);
158
+ this.errorCallback(error);
159
+ }
160
+ }
161
+ });
162
+ if (utils.checkMobile() && this.dynamicLink) {
163
+ window.location.href = this.getLink();
164
+ }
165
+ }
166
+ /**
167
+ * Stop manually an ongoing session
168
+ */
169
+ async stop() {
170
+ this.clean();
171
+ if (this.result === utils.RESULT_STATUS.ONGOING || utils.RESULT_STATUS.READ) {
172
+ this.result = utils.RESULT_STATUS.NOT_STARTED;
173
+ }
174
+ }
175
+ clean() {
176
+ this.sessionData = undefined;
177
+ this.sessionId = undefined;
178
+ }
179
+ /**
180
+ * Retrieve manually the session data on a successful login
181
+ */
182
+ async getSessionData() {
183
+ return this.sessionData
184
+ ? Promise.resolve(this.sessionData)
185
+ : Promise.reject(new Error(this.failedLoginErrorLabel));
186
+ }
187
+ async getSessionId() {
188
+ if (this.sessionId) {
189
+ return this.sessionId;
190
+ }
191
+ let { sessionId, authenticationRequest } = await this.createSession();
192
+ this.sessionId = sessionId;
193
+ this.authenticationRequest = authenticationRequest;
194
+ return this.sessionId;
195
+ }
196
+ getLink() {
197
+ if (this.v === "2") {
198
+ return this.authenticationRequest;
199
+ }
200
+ const authRequestEncoded = "?dl=" + utils.base64UrlEncode(this.authenticationRequest);
201
+ return DEEP_LINK_PREFIX + authRequestEncoded;
202
+ }
203
+ async poll() {
204
+ let endTime = new Date().getTime() +
205
+ (this.sessionTimeout || DEFAULT_SESSION_TIMEOUT) * 1000;
206
+ let interval = (this.pollingFrequency || DEFAULT_POLLING_FREQ) * 1000;
207
+ let checkFunc = async (component) => {
208
+ if (component.result === utils.RESULT_STATUS.NOT_STARTED) {
209
+ return { result: utils.RESULT_STATUS.NOT_STARTED };
210
+ }
211
+ let id = await component.getSessionId();
212
+ return component.checkStatus(id);
213
+ };
214
+ let component = this;
215
+ let checkCondition = async function (resolve, reject) {
216
+ // If the condition is met, we're done!
217
+ let { result, data } = await checkFunc(component);
218
+ switch (result) {
219
+ case utils.RESULT_STATUS.SUCCESS:
220
+ resolve(data);
221
+ break;
222
+ case utils.RESULT_STATUS.READ:
223
+ component.result = utils.RESULT_STATUS.READ;
224
+ case utils.RESULT_STATUS.ONGOING:
225
+ if (component.sessionTimeout > 0 && new Date().getTime() < endTime) {
226
+ setTimeout(checkCondition, interval, resolve, reject);
227
+ }
228
+ else {
229
+ reject(utils.RESULT_STATUS.EXPIRED);
230
+ }
231
+ break;
232
+ default:
233
+ reject(result);
234
+ break;
235
+ }
236
+ };
237
+ return new Promise(checkCondition);
238
+ }
239
+ renderQRSection() {
240
+ switch (this.result) {
241
+ case utils.RESULT_STATUS.NOT_STARTED:
242
+ return this.renderRetryButton();
243
+ case utils.RESULT_STATUS.ONGOING:
244
+ return this.renderQR(this.getLink(), true);
245
+ case utils.RESULT_STATUS.EXPIRED:
246
+ return this.renderRetryButton(this.qrCodeExpiredLabel);
247
+ case utils.RESULT_STATUS.FAILED:
248
+ return this.renderRetryButton(this.credentialsNotValidatedLabel);
249
+ case utils.RESULT_STATUS.SUCCESS:
250
+ return this.renderSuccess();
251
+ case utils.RESULT_STATUS.READ:
252
+ return this.renderReadQR({
253
+ title: this === null || this === void 0 ? void 0 : this.readQrTitle,
254
+ description: this === null || this === void 0 ? void 0 : this.readQrDescription,
255
+ });
256
+ }
257
+ }
258
+ renderSuccess() {
259
+ return (index.h(Success, { modalHeight: this === null || this === void 0 ? void 0 : this.modalHeight, successLoginLabel: this === null || this === void 0 ? void 0 : this.successLoginLabel }));
260
+ }
261
+ renderRetryButton(errorMessage) {
262
+ return (index.h(RetryButton, { errorMessage: errorMessage, modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, clickInsideBoxLabel: this === null || this === void 0 ? void 0 : this.clickInsideBoxLabel, refreshQrLabel: this === null || this === void 0 ? void 0 : this.refreshQrLabel, scanQrLabel: this === null || this === void 0 ? void 0 : this.scanQrLabel, waitingStartSessionLabel: this === null || this === void 0 ? void 0 : this.waitingStartSessionLabel, display: this.display.bind(this), renderRetryQR: this.renderRetryQR.bind(this) }));
263
+ }
264
+ renderReadQR(readQrMessages) {
265
+ return (index.h(ReadQR, { modalWidth: this === null || this === void 0 ? void 0 : this.modalWidth, readQrMessages: readQrMessages, url: this.getLink(), sizeQR: (this === null || this === void 0 ? void 0 : this.qrSize) ? (this === null || this === void 0 ? void 0 : this.qrSize) - 50 : undefined, renderQR: this.renderQR }));
266
+ }
267
+ renderQR(value, useLogo) {
268
+ return (index.h(QR, { value: value, useLogo: useLogo, size: (this === null || this === void 0 ? void 0 : this.qrSize) || undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc }));
269
+ }
270
+ renderRetryQR(value, useLogo) {
271
+ return (index.h(QR, { value: value, useLogo: useLogo, size: (this === null || this === void 0 ? void 0 : this.qrSize) ? (this === null || this === void 0 ? void 0 : this.qrSize) - 50 : undefined, logoSrc: this === null || this === void 0 ? void 0 : this.logoSrc }));
272
+ }
273
+ render() {
274
+ var _a, _b;
275
+ return (index.h("div", { class: "popUpContainer" }, index.h("div", { class: `is-visible modal-window ${this.hideModalTexts ? "" : "large-modal"} ${this.hideModalBoxShadow ? "noBoxShadow" : ""}`, style: {
276
+ width: (this.modalWidth - 2).toString() + "px",
277
+ height: this.modalHeight
278
+ ? ((_a = (this.modalHeight - 2)) === null || _a === void 0 ? void 0 : _a.toString()) + "px"
279
+ : "",
280
+ }, onClick: (event) => {
281
+ event.stopPropagation();
282
+ } }, index.h("div", { class: "modal-window__content" }, index.h("div", { class: `qrTitleContainer ${this.hideModalTexts ? "hidenText" : ""}` }, index.h("p", { class: "qrTitle modalText", style: { color: this.modalTitleColor || "#1e1e20" } }, this.qrModalTitle), !this.hideBrandTitle && (index.h("p", { class: "qrBrand modalText" }, this.byBrandLabel, " ", index.h("span", null, index.h("img", { src: gatIconAlert.logoGatacaSvg })))), this.result !== utils.RESULT_STATUS.SUCCESS &&
283
+ !this.hideQrModalDescription && (index.h("p", { class: "qrDescription modalText" }, this.qrModalDescription))), index.h("div", { class: "qrSection", style: {
284
+ width: this.modalWidth.toString() + "px",
285
+ height: this.modalWidth
286
+ ? ((_b = this.modalWidth) === null || _b === void 0 ? void 0 : _b.toString()) + "px"
287
+ : "",
288
+ } }, this.renderQRSection())))));
289
+ }
290
+ };
291
+ GatacaQR.style = gatacaQrCss;
292
+
293
+ exports.gataca_qr = GatacaQR;
294
+ exports.gataca_qrdisplay = GatacaQRDisplay;