starti.app 1.0.41-alpha.0 → 1.0.41-alpha.2

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/app.js CHANGED
@@ -1,15 +1,7 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.App = void 0;
10
- const types_exported_1 = require("./@types/types.exported");
11
- const RequireIntegration_1 = require("./decorators/RequireIntegration");
12
- let AppClass = class AppClass extends EventTarget {
4
+ class AppClass extends EventTarget {
13
5
  constructor() {
14
6
  super(...arguments);
15
7
  this.startiappIsLoaded = false;
@@ -104,15 +96,6 @@ let AppClass = class AppClass extends EventTarget {
104
96
  getInternalDomainsResult(result) {
105
97
  this.resolveGetInternalDomains(result);
106
98
  }
107
- };
108
- __decorate([
109
- RequireIntegration_1.ExemptFromRequiredIntegrations
110
- ], AppClass.prototype, "setStartiappIsLoaded", null);
111
- __decorate([
112
- RequireIntegration_1.ExemptFromRequiredIntegrations
113
- ], AppClass.prototype, "isStartiappLoaded", null);
114
- AppClass = __decorate([
115
- (0, RequireIntegration_1.RequireIntegration)(types_exported_1.Integrations.App)
116
- ], AppClass);
99
+ }
117
100
  ;
118
101
  exports.App = new AppClass();
@@ -1,15 +1,7 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.Biometrics = void 0;
10
- const types_exported_1 = require("./@types/types.exported");
11
- const RequireIntegration_1 = require("./decorators/RequireIntegration");
12
- let BiometricsClass = class BiometricsClass extends EventTarget {
4
+ class BiometricsClass extends EventTarget {
13
5
  constructor() {
14
6
  super(...arguments);
15
7
  this.SECURED_CONTENT_KEY = "STARTI_APP_BIOMETRIC_CONTENT";
@@ -20,24 +12,14 @@ let BiometricsClass = class BiometricsClass extends EventTarget {
20
12
  scan(title = this.defaultScanTitle, reason = this.defaultScanReason) {
21
13
  const promise = new Promise((resolve, reject) => {
22
14
  this.resolveScan = resolve;
23
- try {
24
- BiometricIntegration.startScanning(title, reason);
25
- }
26
- catch (e) {
27
- reject(e);
28
- }
15
+ BiometricIntegration.startScanning(title, reason);
29
16
  });
30
17
  return promise;
31
18
  }
32
19
  getAuthenticationType() {
33
20
  const promise = new Promise((resolve, reject) => {
34
21
  this.resolveAuthType = resolve;
35
- try {
36
- BiometricIntegration.getAuthenticationType();
37
- }
38
- catch (e) {
39
- reject(e);
40
- }
22
+ BiometricIntegration.getAuthenticationType();
41
23
  });
42
24
  return promise;
43
25
  }
@@ -47,24 +29,14 @@ let BiometricsClass = class BiometricsClass extends EventTarget {
47
29
  getSecuredContent(title = this.defaultScanTitle, reason = this.defaultScanReason) {
48
30
  const promise = new Promise((resolve, reject) => {
49
31
  this.resolveGetContent = resolve;
50
- try {
51
- BiometricIntegration.getSecuredContent(this.SECURED_CONTENT_KEY, title, reason);
52
- }
53
- catch (e) {
54
- reject(e);
55
- }
32
+ BiometricIntegration.getSecuredContent(this.SECURED_CONTENT_KEY, title, reason);
56
33
  });
57
34
  return promise;
58
35
  }
59
36
  hasSecuredContent() {
60
37
  const promise = new Promise((resolve, reject) => {
61
- try {
62
- this.resolveHasSecureContent = resolve;
63
- BiometricIntegration.hasSecuredContent(this.SECURED_CONTENT_KEY);
64
- }
65
- catch (e) {
66
- reject(e);
67
- }
38
+ this.resolveHasSecureContent = resolve;
39
+ BiometricIntegration.hasSecuredContent(this.SECURED_CONTENT_KEY);
68
40
  });
69
41
  return promise;
70
42
  }
@@ -79,25 +51,15 @@ let BiometricsClass = class BiometricsClass extends EventTarget {
79
51
  }
80
52
  hasUsernameAndPassword() {
81
53
  const promise = new Promise((resolve, reject) => {
82
- try {
83
- this.resolveHasUsernameAndPassword = resolve;
84
- BiometricIntegration.hasSecuredContent(this.SECURED_LOGIN_KEY);
85
- }
86
- catch (e) {
87
- reject(e);
88
- }
54
+ this.resolveHasUsernameAndPassword = resolve;
55
+ BiometricIntegration.hasSecuredContent(this.SECURED_LOGIN_KEY);
89
56
  });
90
57
  return promise;
91
58
  }
92
59
  getUsernameAndPassword(scanTitle = this.defaultScanTitle, scanReason = this.defaultScanReason) {
93
60
  const promise = new Promise((resolve, reject) => {
94
- try {
95
- this.resolveGetUsernamePassword = resolve;
96
- BiometricIntegration.getSecuredContent(this.SECURED_LOGIN_KEY, scanTitle, scanReason);
97
- }
98
- catch (e) {
99
- reject(e);
100
- }
61
+ this.resolveGetUsernamePassword = resolve;
62
+ BiometricIntegration.getSecuredContent(this.SECURED_LOGIN_KEY, scanTitle, scanReason);
101
63
  });
102
64
  return promise;
103
65
  }
@@ -145,9 +107,6 @@ let BiometricsClass = class BiometricsClass extends EventTarget {
145
107
  this.resolveGetContent(null);
146
108
  }
147
109
  }
148
- };
149
- BiometricsClass = __decorate([
150
- (0, RequireIntegration_1.RequireIntegration)(types_exported_1.Integrations.Biometric)
151
- ], BiometricsClass);
110
+ }
152
111
  ;
153
112
  exports.Biometrics = new BiometricsClass();
package/dist/device.js CHANGED
@@ -1,23 +1,15 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.Device = void 0;
10
- const types_exported_1 = require("./@types/types.exported");
11
- const RequireIntegration_1 = require("./decorators/RequireIntegration");
12
- let DeviceClass = class DeviceClass extends EventTarget {
4
+ class DeviceClass extends EventTarget {
13
5
  startAccelerometer() {
14
6
  DeviceIntegration.startAccelerometer();
15
7
  }
16
8
  stopAccelerometer() {
17
9
  DeviceIntegration.stopAccelerometer();
18
10
  }
19
- };
20
- DeviceClass = __decorate([
21
- (0, RequireIntegration_1.RequireIntegration)(types_exported_1.Integrations.Device)
22
- ], DeviceClass);
11
+ onShakeEvent() {
12
+ this.dispatchEvent(new CustomEvent('shake'));
13
+ }
14
+ }
23
15
  exports.Device = new DeviceClass();
package/dist/index.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import '@abraham/reflection';
2
1
  declare class StartiappClass extends EventTarget {
3
2
  /** Basic calls to the app. */
4
3
  App: import("./app").IApp;
package/dist/index.js CHANGED
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  const app_1 = require("./app");
10
4
  const biometrics_1 = require("./biometrics");
@@ -14,9 +8,6 @@ const nfc_1 = require("./nfc");
14
8
  const pushnotification_1 = require("./pushnotification");
15
9
  const qrscanner_1 = require("./qrscanner");
16
10
  const ui_service_1 = require("./services/ui-service");
17
- require("@abraham/reflection");
18
- const RequireIntegration_1 = require("./decorators/RequireIntegration");
19
- const types_exported_1 = require("./@types/types.exported");
20
11
  const untypedWindow = window;
21
12
  untypedWindow.appIntegrationsAreReady = () => {
22
13
  app_1.App.setStartiappIsLoaded();
@@ -73,9 +64,6 @@ class StartiappClass extends EventTarget {
73
64
  super.removeEventListener(type, callback, options);
74
65
  }
75
66
  }
76
- __decorate([
77
- (0, RequireIntegration_1.RequireIntegration)(types_exported_1.Integrations.App)
78
- ], StartiappClass.prototype, "initialize", null);
79
67
  ;
80
68
  const startiapp = new StartiappClass();
81
69
  if (startiapp.isRunningInApp()) {
package/dist/nfc.js CHANGED
@@ -1,15 +1,7 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.NFC = void 0;
10
- const types_exported_1 = require("./@types/types.exported");
11
- const RequireIntegration_1 = require("./decorators/RequireIntegration");
12
- let NfcClass = class NfcClass extends EventTarget {
4
+ class NfcClass extends EventTarget {
13
5
  isNFCSupported() {
14
6
  const promise = new Promise((resolve, reject) => {
15
7
  this.resolveNFCSupported = resolve;
@@ -46,9 +38,6 @@ let NfcClass = class NfcClass extends EventTarget {
46
38
  startNFCReaderResult(result) {
47
39
  this.resolveStartNFCReader(result);
48
40
  }
49
- };
50
- NfcClass = __decorate([
51
- (0, RequireIntegration_1.RequireIntegration)(types_exported_1.Integrations.NFC)
52
- ], NfcClass);
41
+ }
53
42
  ;
54
43
  exports.NFC = new NfcClass();
@@ -1,10 +1,4 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
9
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -16,11 +10,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
16
10
  };
17
11
  Object.defineProperty(exports, "__esModule", { value: true });
18
12
  exports.PushNotification = void 0;
19
- const types_exported_1 = require("./@types/types.exported");
20
13
  const config_1 = require("./config");
21
- const RequireIntegration_1 = require("./decorators/RequireIntegration");
22
14
  const index_1 = require("./index");
23
- let PushNotificationClass = class PushNotificationClass extends EventTarget {
15
+ class PushNotificationClass extends EventTarget {
24
16
  requestAccess() {
25
17
  return __awaiter(this, void 0, void 0, function* () {
26
18
  return new Promise((resolve, _) => {
@@ -109,9 +101,6 @@ let PushNotificationClass = class PushNotificationClass extends EventTarget {
109
101
  * Always called with true from Firebase.
110
102
  */
111
103
  firebasePushNotificationSubscribeToTopicsResult(result) { }
112
- };
113
- PushNotificationClass = __decorate([
114
- (0, RequireIntegration_1.RequireIntegration)(types_exported_1.Integrations.PushNotification)
115
- ], PushNotificationClass);
104
+ }
116
105
  ;
117
106
  exports.PushNotification = new PushNotificationClass();
package/dist/qrscanner.js CHANGED
@@ -1,15 +1,7 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
2
  Object.defineProperty(exports, "__esModule", { value: true });
9
3
  exports.QrScanner = void 0;
10
- const types_exported_1 = require("./@types/types.exported");
11
- const RequireIntegration_1 = require("./decorators/RequireIntegration");
12
- let QrScannerClass = class QrScannerClass extends EventTarget {
4
+ class QrScannerClass extends EventTarget {
13
5
  scan() {
14
6
  return new Promise((resolve, reject) => {
15
7
  this.resolveScan = resolve;
@@ -37,9 +29,6 @@ let QrScannerClass = class QrScannerClass extends EventTarget {
37
29
  isCameraAccessGrantedResult(result) {
38
30
  this.resolveCameraAccessGranted(result);
39
31
  }
40
- };
41
- QrScannerClass = __decorate([
42
- (0, RequireIntegration_1.RequireIntegration)(types_exported_1.Integrations.QrScanner)
43
- ], QrScannerClass);
32
+ }
44
33
  ;
45
34
  exports.QrScanner = new QrScannerClass();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starti.app",
3
- "version": "1.0.41-alpha.0",
3
+ "version": "1.0.41-alpha.2",
4
4
  "description": "Use this package for easy communication with the starti.app API.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,8 +20,5 @@
20
20
  "build:dev": "webpack --mode=development",
21
21
  "build:prod": "webpack --mode=production --node-env=production",
22
22
  "watch": "webpack --watch"
23
- },
24
- "dependencies": {
25
- "@abraham/reflection": "^0.12.0"
26
23
  }
27
24
  }
package/umd/main.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}(self,(()=>{return e={886:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Integrations=void 0,(n=t.Integrations||(t.Integrations={})).PushNotification="PushNotificationIntegration",n.QrScanner="QrScannerIntegration",n.Device="DeviceIntegration",n.App="AppIntegration",n.Biometric="BiometricIntegration",n.Calendar="CalendarIntegration",n.NFC="NFCIntegration"},752:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.App=void 0;const o=n(886),i=n(830);let s=class extends EventTarget{constructor(){super(...arguments),this.startiappIsLoaded=!1}setStartiappIsLoaded(){this.startiappIsLoaded=!0}isStartiappLoaded(){return this.startiappIsLoaded}setAppUrl(e){AppIntegration.setAppUrl(e)}resetAppUrl(){AppIntegration.resetAppUrl()}openExternalBrowser(e){AppIntegration.openBrowser(e)}downloadFile(e,t){AppIntegration.download(e,t)}brandId(){return new Promise(((e,t)=>{this.resolveBrandId=e,AppIntegration.brandId()}))}requestReview(){AppIntegration.requestReview()}deviceId(){return new Promise(((e,t)=>{this.resolveDeviceId=e,AppIntegration.deviceId()}))}version(){return new Promise(((e,t)=>{this.resolveVersion=e,AppIntegration.version()}))}getInternalDomains(){return new Promise(((e,t)=>{this.resolveGetInternalDomains=e,AppIntegration.getInternalDomains()}))}addInternalDomain(e){AppIntegration.addInternalDomain(e)}removeInternalDomain(e){AppIntegration.removeInternalDomain(e)}showStatusBar(){AppIntegration.showStatusBar()}hideStatusBar(){AppIntegration.hideStatusBar()}setSafeAreaBackgroundColor(e){return new Promise(((t,n)=>{this.resolveSetSafeAreaBackgroundColor=t,AppIntegration.setSafeAreaBackgroundColor(e)}))}disableScreenRotation(){AppIntegration.disableScreenRotation()}enableScreenRotation(){AppIntegration.enableScreenRotation()}appInForegroundEventRecievedEvent(){this.dispatchEvent(new CustomEvent("appInForeground"))}brandIdResult(e){this.resolveBrandId(e)}versionResult(e){this.resolveVersion(e)}deviceIdResult(e){this.resolveDeviceId(e)}setSafeAreaBackgroundColorResult(e){this.resolveSetSafeAreaBackgroundColor(e)}navigatingPageEvent(e){this.dispatchEvent(new CustomEvent("navigatingPage",{detail:e}))}getInternalDomainsResult(e){this.resolveGetInternalDomains(e)}};r([i.ExemptFromRequiredIntegrations],s.prototype,"setStartiappIsLoaded",null),r([i.ExemptFromRequiredIntegrations],s.prototype,"isStartiappLoaded",null),s=r([(0,i.RequireIntegration)(o.Integrations.App)],s),t.App=new s},1:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.Biometrics=void 0;const o=n(886),i=n(830);let s=class extends EventTarget{constructor(){super(...arguments),this.SECURED_CONTENT_KEY="STARTI_APP_BIOMETRIC_CONTENT",this.SECURED_LOGIN_KEY="STARTI_APP_BIOMETRIC_LOGIN_CONTENT",this.defaultScanTitle="Prove you have fingers!",this.defaultScanReason="Can't let you in if you don't."}scan(e=this.defaultScanTitle,t=this.defaultScanReason){return new Promise(((n,r)=>{this.resolveScan=n;try{BiometricIntegration.startScanning(e,t)}catch(e){r(e)}}))}getAuthenticationType(){return new Promise(((e,t)=>{this.resolveAuthType=e;try{BiometricIntegration.getAuthenticationType()}catch(e){t(e)}}))}setSecuredContent(e){BiometricIntegration.setSecuredContent(this.SECURED_CONTENT_KEY,JSON.stringify(e))}getSecuredContent(e=this.defaultScanTitle,t=this.defaultScanReason){return new Promise(((n,r)=>{this.resolveGetContent=n;try{BiometricIntegration.getSecuredContent(this.SECURED_CONTENT_KEY,e,t)}catch(e){r(e)}}))}hasSecuredContent(){return new Promise(((e,t)=>{try{this.resolveHasSecureContent=e,BiometricIntegration.hasSecuredContent(this.SECURED_CONTENT_KEY)}catch(e){t(e)}}))}removeSecuredContent(){BiometricIntegration.removeSecuredContent(this.SECURED_CONTENT_KEY)}setUsernameAndPassword(e,t){BiometricIntegration.setSecuredContent(this.SECURED_LOGIN_KEY,JSON.stringify({username:e,password:t}))}removeUsernameAndPassword(){BiometricIntegration.removeSecuredContent(this.SECURED_LOGIN_KEY)}hasUsernameAndPassword(){return new Promise(((e,t)=>{try{this.resolveHasUsernameAndPassword=e,BiometricIntegration.hasSecuredContent(this.SECURED_LOGIN_KEY)}catch(e){t(e)}}))}getUsernameAndPassword(e=this.defaultScanTitle,t=this.defaultScanReason){return new Promise(((n,r)=>{try{this.resolveGetUsernamePassword=n,BiometricIntegration.getSecuredContent(this.SECURED_LOGIN_KEY,e,t)}catch(e){r(e)}}))}handleResolveGetUsernamePassword(e){try{const t=JSON.parse(e.content);this.resolveGetUsernamePassword(t)}catch(e){this.resolveGetUsernamePassword(null)}}hasSecuredContentResult(e){try{const t=JSON.parse(e);if(t.key===this.SECURED_LOGIN_KEY)return void this.resolveHasUsernameAndPassword(t.result);this.resolveHasSecureContent(t.result)}catch(e){this.resolveHasSecureContent(!1)}}getAuthenticationTypeResult(e){this.resolveAuthType(e)}startScanningResult(e){this.resolveScan(e)}getSecuredContentResult(e){try{const t=JSON.parse(e);if(t.key===this.SECURED_LOGIN_KEY)return void this.handleResolveGetUsernamePassword(t);this.resolveGetContent(t.content)}catch(e){this.resolveGetContent(null)}}};s=r([(0,i.RequireIntegration)(o.Integrations.Biometric)],s),t.Biometrics=new s},495:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ClientUser=void 0;const o=n(913),i=n(607);t.ClientUser=new class extends EventTarget{registerId(e){return r(this,void 0,void 0,(function*(){const t=yield i.default.App.brandId(),n=yield i.default.App.deviceId(),r=yield i.default.PushNotification.getToken();if(!r||0===r.length)throw console.warn("Failed to register logged in client user",e,"No FCM token"),new Error(`Failed to register logged in client user ${e}: No FCM token`);const s={brandId:t,clientUserId:e,deviceId:n,fcmToken:r},a=yield fetch(o.baseUrl+"/ClientUser-registerId",{body:JSON.stringify(s),headers:{"Content-Type":"application/json"},method:"POST"});if(!a.ok)throw console.warn("Failed to register logged in client user",e,s),new Error(`Failed to register logged in client user ${e}: Firebase returned statuscode ${a.status}`)}))}}},913:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.styleTagId=t.baseUrl=void 0,t.baseUrl="https://europe-west3-startiapp-admin-test-e56ab.cloudfunctions.net",t.styleTagId="startiapp-styling"},830:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExemptFromRequiredIntegrations=t.RequireIntegration=void 0;const r=n(34);t.RequireIntegration=function(...e){return function(t,n,o){if(function(e,t){return void 0===e&&void 0===t}(n,o)){let n=Object.getOwnPropertyNames(t.prototype).filter((e=>"constructor"!==e)).filter((e=>!e.endsWith("Result"))).filter((e=>!e.startsWith("resolve"))).filter((e=>!e.endsWith("Event")));for(const o of n){const n=Object.getOwnPropertyDescriptor(t.prototype,o);if(n.value instanceof Function){if(r.Reflection.getMetadata("exempt",t.prototype,o))continue;n.value=function(...t){const r=e.filter((e=>void 0===window[e]));if(r.length>0)throw new Error(`Integration(s) ${r.join(", ")} not available`);return n.value.apply(this,t)}}}}else{const o=Object.getOwnPropertyDescriptor(t,n);if(o.value instanceof Function){if(r.Reflection.getMetadata("exempt",t,n))return;o.value=function(...t){const n=e.filter((e=>void 0===window[e]));if(n.length>0)throw new Error(`Integration(s) ${n.join(", ")} not available`);return o.value.apply(this,t)}}}}},t.ExemptFromRequiredIntegrations=function(e,t,n){r.Reflection.defineMetadata("exempt",!0,e,t)}},955:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.Device=void 0;const o=n(886),i=n(830);let s=class extends EventTarget{startAccelerometer(){DeviceIntegration.startAccelerometer()}stopAccelerometer(){DeviceIntegration.stopAccelerometer()}};s=r([(0,i.RequireIntegration)(o.Integrations.Device)],s),t.Device=new s},607:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0});const o=n(752),i=n(1),s=n(495),a=n(955),c=n(983),u=n(681),l=n(952),d=n(716);n(34);const p=n(830),f=n(886),h=window;h.appIntegrationsAreReady=()=>{o.App.setStartiappIsLoaded(),g.dispatchEvent(new CustomEvent("ready"))},h.startiappDevice=a.Device,h.startiappApp=o.App,h.startiappUser=s.ClientUser,h.startiappQrScanner=l.QrScanner,h.startiappPushNotification=u.PushNotification,h.startiappNFC=c.NFC,h.startiappBiometric=i.Biometrics,h.appErrorEvent=e=>{g.dispatchEvent(new CustomEvent("error",{detail:e}))};class v extends EventTarget{constructor(){super(...arguments),this.App=o.App,this.Device=a.Device,this.Biometrics=i.Biometrics,this.User=s.ClientUser,this.Nfc=c.NFC,this.PushNotification=u.PushNotification,this.QrScanner=l.QrScanner}initialize(e){if("undefined"==typeof AppIntegration)throw new Error("The starti.app API integration is not available.");o.App.isStartiappLoaded()&&(d.AppUI.setOptions(e),AppIntegration.webAppIsReady())}isRunningInApp(){return navigator.userAgent.toLowerCase().indexOf("starti.app")>-1}addEventListener(e,t,n){super.addEventListener(e,t,n)}removeEventListener(e,t,n){super.removeEventListener(e,t,n)}}r([(0,p.RequireIntegration)(f.Integrations.App)],v.prototype,"initialize",null);const g=new v;g.isRunningInApp()&&(document.body?document.body.setAttribute("startiapp","true"):document.addEventListener("DOMContentLoaded",(()=>{document.body.setAttribute("startiapp","true")}))),t.default=g,h.startiapp=g},983:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.NFC=void 0;const o=n(886),i=n(830);let s=class extends EventTarget{isNFCSupported(){return new Promise(((e,t)=>{this.resolveNFCSupported=e,NFCIntegration.isNFCSupported()}))}startNFCReader(){return new Promise(((e,t)=>{this.resolveStartNFCReader=e,NFCIntegration.initNFC()}))}stopNFCReader(){return new Promise(((e,t)=>{this.resolveStopNFCReader=e,NFCIntegration.stopListening()}))}stopListeningResult(e){this.resolveStopNFCReader(e)}nfcTagResultRecievedEvent(e){const t=new CustomEvent("nfcTagScanned",{detail:e});this.dispatchEvent(t)}isNFCSupportedResult(e){this.resolveNFCSupported(e)}startNFCReaderResult(e){this.resolveStartNFCReader(e)}};s=r([(0,i.RequireIntegration)(o.Integrations.NFC)],s),t.NFC=new s},681:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s},o=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{c(r.next(e))}catch(e){i(e)}}function a(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PushNotification=void 0;const i=n(886),s=n(913),a=n(830),c=n(607);let u=class extends EventTarget{requestAccess(){return o(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.resolveRequestAccess=e,PushNotificationIntegration.requestAccess()}))}))}getToken(){return new Promise(((e,t)=>{this.resolveFCMToken=e,PushNotificationIntegration.getFCMToken()}))}subscribeToTopics(e){return o(this,void 0,void 0,(function*(){PushNotificationIntegration.firebasePushNotificationSubscribeToTopics(e);const t=yield this.getToken(),n=yield c.default.App.brandId(),r=yield c.default.App.deviceId(),o=[];e.forEach((e=>{const i={brand:n,topic:e,token:t,deviceId:r},a=fetch(s.baseUrl+"/PushNotification-subscribeToTopic",{body:JSON.stringify(i)});o.push(a)})),(yield Promise.all(o)).forEach(((t,n)=>{t.ok||console.warn("Failed to sign up to topic",n,e[n])}))}))}unsubscribeFromTopics(e){return o(this,void 0,void 0,(function*(){PushNotificationIntegration.firebasePushNotificationTopicsUnsubscribe(e);const t=yield this.getToken(),n=yield c.default.App.brandId(),r=yield c.default.App.deviceId(),o=[];e.forEach((e=>{const i={brand:n,topic:e,token:t,deviceId:r},a=fetch(s.baseUrl+"/PushNotification-unSubscribeFromTopic",{body:JSON.stringify(i)});o.push(a)})),(yield Promise.all(o)).forEach(((t,n)=>{t.ok||console.warn("Failed to unsubscribe from topic",n,e[n])}))}))}requestAccessResult(e){this.resolveRequestAccess(e)}getFCMTokenResult(e){this.resolveFCMToken(e)}tokenReceivedEvent(e){this.dispatchEvent(new CustomEvent("tokenRefreshed",{detail:e}))}notificationReceivedEvent(e){this.dispatchEvent(new CustomEvent("notificationReceived",{detail:e}))}firebasePushNotificationTopicsUnsubscribeResult(e){}firebasePushNotificationSubscribeToTopicsResult(e){}};u=r([(0,a.RequireIntegration)(i.Integrations.PushNotification)],u),t.PushNotification=new u},952:function(e,t,n){"use strict";var r=this&&this.__decorate||function(e,t,n,r){var o,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(i<3?o(s):i>3?o(t,n,s):o(t,n))||s);return i>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0}),t.QrScanner=void 0;const o=n(886),i=n(830);let s=class extends EventTarget{scan(){return new Promise(((e,t)=>{this.resolveScan=e,QrScannerIntegration.startQrCodeScanner()}))}isCameraAccessGranted(){return new Promise(((e,t)=>{this.resolveCameraAccessGranted=e,QrScannerIntegration.isCameraAccessGranted()}))}requestCameraAccess(){return new Promise(((e,t)=>{this.resolveRequestCameraAccess=e,QrScannerIntegration.requestCameraAccess()}))}requestCameraAccessResult(e){this.resolveRequestCameraAccess(e)}qrResultRecievedEvent(e){this.resolveScan(e)}isCameraAccessGrantedResult(e){this.resolveCameraAccessGranted(e)}};s=r([(0,i.RequireIntegration)(o.Integrations.QrScanner)],s),t.QrScanner=new s},716:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AppUI=void 0;const r=n(913);t.AppUI=new class{constructor(){this.options={allowDrag:!1,allowHighligt:!1,allowZoom:!1,allowScrollBounce:!1}}setOptions(e){this.options=Object.assign(this.options,e),null!=document.querySelector('meta[name="viewport"]')&&void 0===this.initialViewportMetaContent&&(this.initialViewportMetaContent=document.querySelector('meta[name="viewport"]').getAttribute("content")),this.initialViewportMetaContent.includes("viewport-fit=cover")||(this.initialViewportMetaContent+=", viewport-fit=cover"),this.updateUI()}getOptions(){return this.options}updateUI(){this.styleString="";const e=document.getElementById(r.styleTagId);e&&e.remove();const t=document.getElementsByTagName("img"),n=document.getElementsByTagName("a");this.options.allowDrag?[...t,...n].forEach((e=>{e.removeAttribute("draggable")})):[...t,...n].forEach((e=>{e.setAttribute("draggable","false")}));let o=document.querySelector("meta[name=viewport]");this.options.allowHighligt||(this.styleString+="\n body {\n -webkit-user-select: none; \n -khtml-user-select: none; \n -moz-user-select: none; \n -o-user-select: none; \n user-select: none;\n }\n "),this.options.allowScrollBounce||(this.styleString+="\n html {\n overscroll-behavior: none;\n }\n "),this.options.allowZoom?o.setAttribute("content",this.initialViewportMetaContent):(this.styleString+="\n body {\n touch-action: pan-x pan-y;\n }\n ",o.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, viewport-fit=cover"));const i=document.createElement("style");i.textContent=this.styleString,i.setAttribute("id",r.styleTagId),document.body.appendChild(i)}}},34:function(e,t){!function(e){"use strict";const t=new WeakMap;function n(e,t,n,r){if(!Array.isArray(e)||0===e.length)throw new TypeError;return void 0!==n?function(e,t,n,r){return e.reverse().forEach((e=>{r=e(t,n,r)||r})),r}(e,t,n,r):"function"==typeof t?function(e,t){return e.reverse().forEach((e=>{const n=e(t);n&&(t=n)})),t}(e,t):void 0}function r(e,n){return t.get(e)&&t.get(e).get(n)}function o(e,t,n){if(void 0===t)throw new TypeError;const o=r(t,n);return o&&o.get(e)}function i(e,n,o,i){if(i&&!["string","symbol"].includes(typeof i))throw new TypeError;(r(o,i)||function(e,n){const r=t.get(e)||new Map;t.set(e,r);const o=r.get(n)||new Map;return r.set(n,o),o}(o,i)).set(e,n)}function s(e,t,n){return o(e,t,n)?o(e,t,n):Object.getPrototypeOf(t)?s(e,Object.getPrototypeOf(t),n):void 0}function a(e,t){return function(n,r){i(e,t,n,r)}}function c(e,t,n){return s(e,t,n)}function u(e,t,n){return o(e,t,n)}function l(e,t,n){return!!o(e,t,n)}function d(e,t,n){return!!s(e,t,n)}function p(e,t,n,r){i(e,t,n,r)}const f={decorate:n,defineMetadata:p,getMetadata:c,getOwnMetadata:u,hasMetadata:d,hasOwnMetadata:l,metadata:a};Object.assign(Reflect,f),e.Reflection=f,e.decorate=n,e.defineMetadata=p,e.getMetadata=c,e.getOwnMetadata=u,e.hasMetadata=d,e.hasOwnMetadata=l,e.metadata=a}(t)}},t={},function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}(607);var e,t}));
1
+ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var s in n)("object"==typeof exports?exports:e)[s]=n[s]}}(self,(()=>(()=>{"use strict";var e={752:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.App=void 0;class n extends EventTarget{constructor(){super(...arguments),this.startiappIsLoaded=!1}setStartiappIsLoaded(){this.startiappIsLoaded=!0}isStartiappLoaded(){return this.startiappIsLoaded}setAppUrl(e){AppIntegration.setAppUrl(e)}resetAppUrl(){AppIntegration.resetAppUrl()}openExternalBrowser(e){AppIntegration.openBrowser(e)}downloadFile(e,t){AppIntegration.download(e,t)}brandId(){return new Promise(((e,t)=>{this.resolveBrandId=e,AppIntegration.brandId()}))}requestReview(){AppIntegration.requestReview()}deviceId(){return new Promise(((e,t)=>{this.resolveDeviceId=e,AppIntegration.deviceId()}))}version(){return new Promise(((e,t)=>{this.resolveVersion=e,AppIntegration.version()}))}getInternalDomains(){return new Promise(((e,t)=>{this.resolveGetInternalDomains=e,AppIntegration.getInternalDomains()}))}addInternalDomain(e){AppIntegration.addInternalDomain(e)}removeInternalDomain(e){AppIntegration.removeInternalDomain(e)}showStatusBar(){AppIntegration.showStatusBar()}hideStatusBar(){AppIntegration.hideStatusBar()}setSafeAreaBackgroundColor(e){return new Promise(((t,n)=>{this.resolveSetSafeAreaBackgroundColor=t,AppIntegration.setSafeAreaBackgroundColor(e)}))}disableScreenRotation(){AppIntegration.disableScreenRotation()}enableScreenRotation(){AppIntegration.enableScreenRotation()}appInForegroundEventRecievedEvent(){this.dispatchEvent(new CustomEvent("appInForeground"))}brandIdResult(e){this.resolveBrandId(e)}versionResult(e){this.resolveVersion(e)}deviceIdResult(e){this.resolveDeviceId(e)}setSafeAreaBackgroundColorResult(e){this.resolveSetSafeAreaBackgroundColor(e)}navigatingPageEvent(e){this.dispatchEvent(new CustomEvent("navigatingPage",{detail:e}))}getInternalDomainsResult(e){this.resolveGetInternalDomains(e)}}t.App=new n},1:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Biometrics=void 0;class n extends EventTarget{constructor(){super(...arguments),this.SECURED_CONTENT_KEY="STARTI_APP_BIOMETRIC_CONTENT",this.SECURED_LOGIN_KEY="STARTI_APP_BIOMETRIC_LOGIN_CONTENT",this.defaultScanTitle="Prove you have fingers!",this.defaultScanReason="Can't let you in if you don't."}scan(e=this.defaultScanTitle,t=this.defaultScanReason){return new Promise(((n,s)=>{this.resolveScan=n,BiometricIntegration.startScanning(e,t)}))}getAuthenticationType(){return new Promise(((e,t)=>{this.resolveAuthType=e,BiometricIntegration.getAuthenticationType()}))}setSecuredContent(e){BiometricIntegration.setSecuredContent(this.SECURED_CONTENT_KEY,JSON.stringify(e))}getSecuredContent(e=this.defaultScanTitle,t=this.defaultScanReason){return new Promise(((n,s)=>{this.resolveGetContent=n,BiometricIntegration.getSecuredContent(this.SECURED_CONTENT_KEY,e,t)}))}hasSecuredContent(){return new Promise(((e,t)=>{this.resolveHasSecureContent=e,BiometricIntegration.hasSecuredContent(this.SECURED_CONTENT_KEY)}))}removeSecuredContent(){BiometricIntegration.removeSecuredContent(this.SECURED_CONTENT_KEY)}setUsernameAndPassword(e,t){BiometricIntegration.setSecuredContent(this.SECURED_LOGIN_KEY,JSON.stringify({username:e,password:t}))}removeUsernameAndPassword(){BiometricIntegration.removeSecuredContent(this.SECURED_LOGIN_KEY)}hasUsernameAndPassword(){return new Promise(((e,t)=>{this.resolveHasUsernameAndPassword=e,BiometricIntegration.hasSecuredContent(this.SECURED_LOGIN_KEY)}))}getUsernameAndPassword(e=this.defaultScanTitle,t=this.defaultScanReason){return new Promise(((n,s)=>{this.resolveGetUsernamePassword=n,BiometricIntegration.getSecuredContent(this.SECURED_LOGIN_KEY,e,t)}))}handleResolveGetUsernamePassword(e){try{const t=JSON.parse(e.content);this.resolveGetUsernamePassword(t)}catch(e){this.resolveGetUsernamePassword(null)}}hasSecuredContentResult(e){try{const t=JSON.parse(e);if(t.key===this.SECURED_LOGIN_KEY)return void this.resolveHasUsernameAndPassword(t.result);this.resolveHasSecureContent(t.result)}catch(e){this.resolveHasSecureContent(!1)}}getAuthenticationTypeResult(e){this.resolveAuthType(e)}startScanningResult(e){this.resolveScan(e)}getSecuredContentResult(e){try{const t=JSON.parse(e);if(t.key===this.SECURED_LOGIN_KEY)return void this.handleResolveGetUsernamePassword(t);this.resolveGetContent(t.content)}catch(e){this.resolveGetContent(null)}}}t.Biometrics=new n},495:function(e,t,n){var s=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,r){function o(e){try{c(s.next(e))}catch(e){r(e)}}function a(e){try{c(s.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ClientUser=void 0;const i=n(913),r=n(607);t.ClientUser=new class extends EventTarget{registerId(e){return s(this,void 0,void 0,(function*(){const t=yield r.default.App.brandId(),n=yield r.default.App.deviceId(),s=yield r.default.PushNotification.getToken();if(!s||0===s.length)throw console.warn("Failed to register logged in client user",e,"No FCM token"),new Error(`Failed to register logged in client user ${e}: No FCM token`);const o={brandId:t,clientUserId:e,deviceId:n,fcmToken:s},a=yield fetch(i.baseUrl+"/ClientUser-registerId",{body:JSON.stringify(o),headers:{"Content-Type":"application/json"},method:"POST"});if(!a.ok)throw console.warn("Failed to register logged in client user",e,o),new Error(`Failed to register logged in client user ${e}: Firebase returned statuscode ${a.status}`)}))}}},913:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.styleTagId=t.baseUrl=void 0,t.baseUrl="https://europe-west3-startiapp-admin-test-e56ab.cloudfunctions.net",t.styleTagId="startiapp-styling"},955:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Device=void 0;class n extends EventTarget{startAccelerometer(){DeviceIntegration.startAccelerometer()}stopAccelerometer(){DeviceIntegration.stopAccelerometer()}onShakeEvent(){this.dispatchEvent(new CustomEvent("shake"))}}t.Device=new n},607:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});const s=n(752),i=n(1),r=n(495),o=n(955),a=n(983),c=n(681),d=n(952),l=n(716),u=window;u.appIntegrationsAreReady=()=>{s.App.setStartiappIsLoaded(),h.dispatchEvent(new CustomEvent("ready"))},u.startiappDevice=o.Device,u.startiappApp=s.App,u.startiappUser=r.ClientUser,u.startiappQrScanner=d.QrScanner,u.startiappPushNotification=c.PushNotification,u.startiappNFC=a.NFC,u.startiappBiometric=i.Biometrics,u.appErrorEvent=e=>{h.dispatchEvent(new CustomEvent("error",{detail:e}))};class p extends EventTarget{constructor(){super(...arguments),this.App=s.App,this.Device=o.Device,this.Biometrics=i.Biometrics,this.User=r.ClientUser,this.Nfc=a.NFC,this.PushNotification=c.PushNotification,this.QrScanner=d.QrScanner}initialize(e){if("undefined"==typeof AppIntegration)throw new Error("The starti.app API integration is not available.");s.App.isStartiappLoaded()&&(l.AppUI.setOptions(e),AppIntegration.webAppIsReady())}isRunningInApp(){return navigator.userAgent.toLowerCase().indexOf("starti.app")>-1}addEventListener(e,t,n){super.addEventListener(e,t,n)}removeEventListener(e,t,n){super.removeEventListener(e,t,n)}}const h=new p;h.isRunningInApp()&&(document.body?document.body.setAttribute("startiapp","true"):document.addEventListener("DOMContentLoaded",(()=>{document.body.setAttribute("startiapp","true")}))),t.default=h,u.startiapp=h},983:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NFC=void 0;class n extends EventTarget{isNFCSupported(){return new Promise(((e,t)=>{this.resolveNFCSupported=e,NFCIntegration.isNFCSupported()}))}startNFCReader(){return new Promise(((e,t)=>{this.resolveStartNFCReader=e,NFCIntegration.initNFC()}))}stopNFCReader(){return new Promise(((e,t)=>{this.resolveStopNFCReader=e,NFCIntegration.stopListening()}))}stopListeningResult(e){this.resolveStopNFCReader(e)}nfcTagResultRecievedEvent(e){const t=new CustomEvent("nfcTagScanned",{detail:e});this.dispatchEvent(t)}isNFCSupportedResult(e){this.resolveNFCSupported(e)}startNFCReaderResult(e){this.resolveStartNFCReader(e)}}t.NFC=new n},681:function(e,t,n){var s=this&&this.__awaiter||function(e,t,n,s){return new(n||(n=Promise))((function(i,r){function o(e){try{c(s.next(e))}catch(e){r(e)}}function a(e){try{c(s.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}c((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.PushNotification=void 0;const i=n(913),r=n(607);class o extends EventTarget{requestAccess(){return s(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.resolveRequestAccess=e,PushNotificationIntegration.requestAccess()}))}))}getToken(){return new Promise(((e,t)=>{this.resolveFCMToken=e,PushNotificationIntegration.getFCMToken()}))}subscribeToTopics(e){return s(this,void 0,void 0,(function*(){PushNotificationIntegration.firebasePushNotificationSubscribeToTopics(e);const t=yield this.getToken(),n=yield r.default.App.brandId(),s=yield r.default.App.deviceId(),o=[];e.forEach((e=>{const r={brand:n,topic:e,token:t,deviceId:s},a=fetch(i.baseUrl+"/PushNotification-subscribeToTopic",{body:JSON.stringify(r)});o.push(a)})),(yield Promise.all(o)).forEach(((t,n)=>{t.ok||console.warn("Failed to sign up to topic",n,e[n])}))}))}unsubscribeFromTopics(e){return s(this,void 0,void 0,(function*(){PushNotificationIntegration.firebasePushNotificationTopicsUnsubscribe(e);const t=yield this.getToken(),n=yield r.default.App.brandId(),s=yield r.default.App.deviceId(),o=[];e.forEach((e=>{const r={brand:n,topic:e,token:t,deviceId:s},a=fetch(i.baseUrl+"/PushNotification-unSubscribeFromTopic",{body:JSON.stringify(r)});o.push(a)})),(yield Promise.all(o)).forEach(((t,n)=>{t.ok||console.warn("Failed to unsubscribe from topic",n,e[n])}))}))}requestAccessResult(e){this.resolveRequestAccess(e)}getFCMTokenResult(e){this.resolveFCMToken(e)}tokenReceivedEvent(e){this.dispatchEvent(new CustomEvent("tokenRefreshed",{detail:e}))}notificationReceivedEvent(e){this.dispatchEvent(new CustomEvent("notificationReceived",{detail:e}))}firebasePushNotificationTopicsUnsubscribeResult(e){}firebasePushNotificationSubscribeToTopicsResult(e){}}t.PushNotification=new o},952:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QrScanner=void 0;class n extends EventTarget{scan(){return new Promise(((e,t)=>{this.resolveScan=e,QrScannerIntegration.startQrCodeScanner()}))}isCameraAccessGranted(){return new Promise(((e,t)=>{this.resolveCameraAccessGranted=e,QrScannerIntegration.isCameraAccessGranted()}))}requestCameraAccess(){return new Promise(((e,t)=>{this.resolveRequestCameraAccess=e,QrScannerIntegration.requestCameraAccess()}))}requestCameraAccessResult(e){this.resolveRequestCameraAccess(e)}qrResultRecievedEvent(e){this.resolveScan(e)}isCameraAccessGrantedResult(e){this.resolveCameraAccessGranted(e)}}t.QrScanner=new n},716:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AppUI=void 0;const s=n(913);t.AppUI=new class{constructor(){this.options={allowDrag:!1,allowHighligt:!1,allowZoom:!1,allowScrollBounce:!1}}setOptions(e){this.options=Object.assign(this.options,e),null!=document.querySelector('meta[name="viewport"]')&&void 0===this.initialViewportMetaContent&&(this.initialViewportMetaContent=document.querySelector('meta[name="viewport"]').getAttribute("content")),this.initialViewportMetaContent.includes("viewport-fit=cover")||(this.initialViewportMetaContent+=", viewport-fit=cover"),this.updateUI()}getOptions(){return this.options}updateUI(){this.styleString="";const e=document.getElementById(s.styleTagId);e&&e.remove();const t=document.getElementsByTagName("img"),n=document.getElementsByTagName("a");this.options.allowDrag?[...t,...n].forEach((e=>{e.removeAttribute("draggable")})):[...t,...n].forEach((e=>{e.setAttribute("draggable","false")}));let i=document.querySelector("meta[name=viewport]");this.options.allowHighligt||(this.styleString+="\n body {\n -webkit-user-select: none; \n -khtml-user-select: none; \n -moz-user-select: none; \n -o-user-select: none; \n user-select: none;\n }\n "),this.options.allowScrollBounce||(this.styleString+="\n html {\n overscroll-behavior: none;\n }\n "),this.options.allowZoom?i.setAttribute("content",this.initialViewportMetaContent):(this.styleString+="\n body {\n touch-action: pan-x pan-y;\n }\n ",i.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, viewport-fit=cover"));const r=document.createElement("style");r.textContent=this.styleString,r.setAttribute("id",s.styleTagId),document.body.appendChild(r)}}}},t={};return function n(s){var i=t[s];if(void 0!==i)return i.exports;var r=t[s]={exports:{}};return e[s].call(r.exports,r,r.exports,n),r.exports}(607)})()));
@@ -1,9 +0,0 @@
1
- export declare enum Integrations {
2
- PushNotification = "PushNotificationIntegration",
3
- QrScanner = "QrScannerIntegration",
4
- Device = "DeviceIntegration",
5
- App = "AppIntegration",
6
- Biometric = "BiometricIntegration",
7
- Calendar = "CalendarIntegration",
8
- NFC = "NFCIntegration"
9
- }
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Integrations = void 0;
4
- var Integrations;
5
- (function (Integrations) {
6
- Integrations["PushNotification"] = "PushNotificationIntegration";
7
- Integrations["QrScanner"] = "QrScannerIntegration";
8
- Integrations["Device"] = "DeviceIntegration";
9
- Integrations["App"] = "AppIntegration";
10
- Integrations["Biometric"] = "BiometricIntegration";
11
- Integrations["Calendar"] = "CalendarIntegration";
12
- Integrations["NFC"] = "NFCIntegration";
13
- })(Integrations = exports.Integrations || (exports.Integrations = {}));
@@ -1,7 +0,0 @@
1
- import { Integrations } from "../@types/types.exported";
2
- export declare function RequireIntegration(...integrations: Integrations[]): (constructorOrTarget: any, propertyKey?: string, descriptor?: PropertyDescriptor) => void;
3
- /**
4
- * Marks method in class as exempt from required integrations.
5
- * Using metadata to mark method as exempt.
6
- */
7
- export declare function ExemptFromRequiredIntegrations(target: any, propertyKey: string, descriptor: PropertyDescriptor): void;
@@ -1,56 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ExemptFromRequiredIntegrations = exports.RequireIntegration = void 0;
4
- const reflection_1 = require("@abraham/reflection");
5
- function isClassDecorator(propertyKey, descriptor) {
6
- return typeof propertyKey === 'undefined' && typeof descriptor === 'undefined';
7
- }
8
- function RequireIntegration(...integrations) {
9
- return function (constructorOrTarget, propertyKey, descriptor) {
10
- if (isClassDecorator(propertyKey, descriptor)) {
11
- let methods = Object.getOwnPropertyNames(constructorOrTarget.prototype)
12
- .filter(method => method !== 'constructor')
13
- .filter(method => !method.endsWith("Result"))
14
- .filter(method => !method.startsWith("resolve"))
15
- .filter(method => !method.endsWith("Event"));
16
- for (const method of methods) {
17
- const descriptor = Object.getOwnPropertyDescriptor(constructorOrTarget.prototype, method);
18
- if (descriptor.value instanceof Function) {
19
- const exempt = reflection_1.Reflection.getMetadata('exempt', constructorOrTarget.prototype, method);
20
- if (exempt)
21
- continue;
22
- descriptor.value = function (...args) {
23
- const unavailableIntegrations = integrations.filter(integration => typeof window[integration] === 'undefined');
24
- if (unavailableIntegrations.length > 0)
25
- throw new Error(`Integration(s) ${unavailableIntegrations.join(', ')} not available`);
26
- return descriptor.value.apply(this, args);
27
- };
28
- }
29
- }
30
- }
31
- else {
32
- const descriptor = Object.getOwnPropertyDescriptor(constructorOrTarget, propertyKey);
33
- if (descriptor.value instanceof Function) {
34
- const exempt = reflection_1.Reflection.getMetadata('exempt', constructorOrTarget, propertyKey);
35
- if (exempt)
36
- return;
37
- descriptor.value = function (...args) {
38
- const unavailableIntegrations = integrations.filter(integration => typeof window[integration] === 'undefined');
39
- if (unavailableIntegrations.length > 0) {
40
- throw new Error(`Integration(s) ${unavailableIntegrations.join(', ')} not available`);
41
- }
42
- return descriptor.value.apply(this, args);
43
- };
44
- }
45
- }
46
- };
47
- }
48
- exports.RequireIntegration = RequireIntegration;
49
- /**
50
- * Marks method in class as exempt from required integrations.
51
- * Using metadata to mark method as exempt.
52
- */
53
- function ExemptFromRequiredIntegrations(target, propertyKey, descriptor) {
54
- reflection_1.Reflection.defineMetadata('exempt', true, target, propertyKey);
55
- }
56
- exports.ExemptFromRequiredIntegrations = ExemptFromRequiredIntegrations;