surveysparrow-ionic-plugin 2.0.2-beta.1 → 2.0.2-beta.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/angular-ui/esm2022/spotchecks/SpotCheckComponent.mjs +81 -100
- package/dist/angular-ui/esm2022/spotchecks/SpotCheckEventListener.mjs +26 -0
- package/dist/angular-ui/esm2022/spotchecks/SpotcheckStateService.mjs +1 -3
- package/dist/angular-ui/esm2022/spotchecks/api.mjs +3 -3
- package/dist/angular-ui/esm2022/spotchecks/helpers.mjs +14 -18
- package/dist/angular-ui/esm2022/spotchecks/index.mjs +2 -1
- package/dist/angular-ui/esm2022/spotchecks/types.mjs +1 -1
- package/dist/angular-ui/fesm2022/angular-ui.mjs +120 -122
- package/dist/angular-ui/fesm2022/angular-ui.mjs.map +1 -1
- package/dist/angular-ui/spotchecks/SpotCheckComponent.d.ts +10 -5
- package/dist/angular-ui/spotchecks/SpotCheckEventListener.d.ts +16 -0
- package/dist/angular-ui/spotchecks/helpers.d.ts +1 -2
- package/dist/angular-ui/spotchecks/index.d.ts +1 -0
- package/dist/angular-ui/spotchecks/types.d.ts +0 -2
- package/dist/esm/angular-ui/lib/spotchecks/SpotCheckComponent.d.ts +10 -5
- package/dist/esm/angular-ui/lib/spotchecks/SpotCheckComponent.js +75 -95
- package/dist/esm/angular-ui/lib/spotchecks/SpotCheckComponent.js.map +1 -1
- package/dist/esm/angular-ui/lib/spotchecks/SpotCheckEventListener.d.ts +16 -0
- package/dist/esm/angular-ui/lib/spotchecks/SpotCheckEventListener.js +28 -0
- package/dist/esm/angular-ui/lib/spotchecks/SpotCheckEventListener.js.map +1 -0
- package/dist/esm/angular-ui/lib/spotchecks/SpotcheckStateService.js +0 -2
- package/dist/esm/angular-ui/lib/spotchecks/SpotcheckStateService.js.map +1 -1
- package/dist/esm/angular-ui/lib/spotchecks/api.js +3 -4
- package/dist/esm/angular-ui/lib/spotchecks/api.js.map +1 -1
- package/dist/esm/angular-ui/lib/spotchecks/helpers.d.ts +1 -2
- package/dist/esm/angular-ui/lib/spotchecks/helpers.js +15 -18
- package/dist/esm/angular-ui/lib/spotchecks/helpers.js.map +1 -1
- package/dist/esm/angular-ui/lib/spotchecks/index.d.ts +1 -0
- package/dist/esm/angular-ui/lib/spotchecks/index.js +1 -0
- package/dist/esm/angular-ui/lib/spotchecks/index.js.map +1 -1
- package/dist/esm/angular-ui/lib/spotchecks/types.d.ts +0 -2
- package/dist/esm/angular-ui/lib/spotchecks/types.js.map +1 -1
- package/dist/plugin.cjs.js +116 -116
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +116 -116
- package/dist/plugin.js.map +1 -1
- package/package.json +1 -1
- package/src/angular-ui/lib/spotchecks/SpotCheckComponent.ts +76 -98
- package/src/angular-ui/lib/spotchecks/SpotCheckEventListener.ts +50 -0
- package/src/angular-ui/lib/spotchecks/SpotcheckStateService.ts +0 -2
- package/src/angular-ui/lib/spotchecks/api.ts +4 -4
- package/src/angular-ui/lib/spotchecks/helpers.ts +14 -23
- package/src/angular-ui/lib/spotchecks/index.ts +3 -0
- package/src/angular-ui/lib/spotchecks/types.ts +0 -2
package/dist/plugin.cjs.js
CHANGED
|
@@ -51102,8 +51102,6 @@ let SpotcheckStateService = class SpotcheckStateService {
|
|
|
51102
51102
|
traceId: '',
|
|
51103
51103
|
isClassicLoading: true,
|
|
51104
51104
|
isChatLoading: true,
|
|
51105
|
-
isClassicLoadEventReceived: false,
|
|
51106
|
-
isChatLoadEventReceived: false,
|
|
51107
51105
|
classicUrl: '',
|
|
51108
51106
|
chatUrl: '',
|
|
51109
51107
|
classicWebViewRef: null,
|
|
@@ -51138,8 +51136,34 @@ SpotcheckStateService = __decorate$2([
|
|
|
51138
51136
|
})
|
|
51139
51137
|
], SpotcheckStateService);
|
|
51140
51138
|
|
|
51139
|
+
class SpotCheckEventListenerService {
|
|
51140
|
+
constructor() {
|
|
51141
|
+
this.eventSubject = new Subject();
|
|
51142
|
+
this.event$ = this.eventSubject.asObservable();
|
|
51143
|
+
}
|
|
51144
|
+
emit(type, data) {
|
|
51145
|
+
this.eventSubject.next({ type, data });
|
|
51146
|
+
}
|
|
51147
|
+
addListener(eventType, callback) {
|
|
51148
|
+
return this.event$.subscribe((event) => {
|
|
51149
|
+
if (event.type === eventType) {
|
|
51150
|
+
callback(event.data);
|
|
51151
|
+
}
|
|
51152
|
+
});
|
|
51153
|
+
}
|
|
51154
|
+
}
|
|
51155
|
+
let globalInstance;
|
|
51156
|
+
const getSpotCheckEventListener = () => {
|
|
51157
|
+
if (!globalInstance) {
|
|
51158
|
+
globalInstance = new SpotCheckEventListenerService();
|
|
51159
|
+
}
|
|
51160
|
+
return globalInstance;
|
|
51161
|
+
};
|
|
51162
|
+
const addSpotCheckListener = (eventType, callback) => {
|
|
51163
|
+
return getSpotCheckEventListener().addListener(eventType, callback);
|
|
51164
|
+
};
|
|
51165
|
+
|
|
51141
51166
|
let globalSpotcheckStateService;
|
|
51142
|
-
let globalOS = null;
|
|
51143
51167
|
const getSpotcheckStateService = () => {
|
|
51144
51168
|
if (!globalSpotcheckStateService) {
|
|
51145
51169
|
globalSpotcheckStateService = new SpotcheckStateService();
|
|
@@ -51159,11 +51183,10 @@ const ischatSurvey = (type) => {
|
|
|
51159
51183
|
};
|
|
51160
51184
|
const getOS = async () => {
|
|
51161
51185
|
const info = await device.Device.getInfo();
|
|
51162
|
-
|
|
51163
|
-
return globalOS;
|
|
51186
|
+
return info.operatingSystem;
|
|
51164
51187
|
};
|
|
51165
51188
|
const setAppearance = async (responseJson, screen, domainName, traceId, variables) => {
|
|
51166
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m
|
|
51189
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
51167
51190
|
try {
|
|
51168
51191
|
const spotcheckStateService = getSpotcheckStateService();
|
|
51169
51192
|
let state = spotcheckStateService.getState();
|
|
@@ -51210,11 +51233,11 @@ const setAppearance = async (responseJson, screen, domainName, traceId, variable
|
|
|
51210
51233
|
spotcheckStateService.setState(updatedState);
|
|
51211
51234
|
try {
|
|
51212
51235
|
const response = await axios.get(fullSpotcheckURL);
|
|
51213
|
-
const themeInfo =
|
|
51236
|
+
const themeInfo = response.data.config.generatedCSS;
|
|
51214
51237
|
const theme_payload = { type: 'THEME_UPDATE_SPOTCHECK', themeInfo };
|
|
51215
51238
|
state = spotcheckStateService.getState();
|
|
51216
51239
|
let webViewRef = chat ? state.chatWebViewRef : state.classicWebViewRef;
|
|
51217
|
-
let isLoading = chat ? state.isChatLoading
|
|
51240
|
+
let isLoading = chat ? state.isChatLoading : state.isClassicLoading;
|
|
51218
51241
|
const resetStateData = {
|
|
51219
51242
|
type: 'RESET_STATE',
|
|
51220
51243
|
state: Object.assign(Object.assign({}, (response.data || {})), { skip: true, spotCheckAppearance: Object.assign(Object.assign({}, (appearance || {})), { targetType: 'MOBILE' }), spotcheckUrl: screen, traceId, elementBuilderParams: Object.assign({}, (variables || {})) }),
|
|
@@ -51245,8 +51268,8 @@ const setAppearance = async (responseJson, screen, domainName, traceId, variable
|
|
|
51245
51268
|
else {
|
|
51246
51269
|
// todo: recheck this
|
|
51247
51270
|
const unsubscribe = spotcheckStateService.state$.subscribe((currentState) => {
|
|
51248
|
-
const { isChatLoading, isClassicLoading, chatWebViewRef, classicWebViewRef,
|
|
51249
|
-
if ((!isChatLoading && chat
|
|
51271
|
+
const { isChatLoading, isClassicLoading, chatWebViewRef, classicWebViewRef, } = currentState;
|
|
51272
|
+
if ((!isChatLoading && chat) || (!isClassicLoading && !chat)) {
|
|
51250
51273
|
unsubscribe.unsubscribe();
|
|
51251
51274
|
const activeWebViewRef = chat
|
|
51252
51275
|
? chatWebViewRef
|
|
@@ -51269,8 +51292,8 @@ const setAppearance = async (responseJson, screen, domainName, traceId, variable
|
|
|
51269
51292
|
? currentState.chatWebViewRef
|
|
51270
51293
|
: currentState.classicWebViewRef;
|
|
51271
51294
|
const updatedIsLoading = chat
|
|
51272
|
-
? currentState.isChatLoading
|
|
51273
|
-
: currentState.isClassicLoading
|
|
51295
|
+
? currentState.isChatLoading
|
|
51296
|
+
: currentState.isClassicLoading;
|
|
51274
51297
|
if (updatedWebViewRef) {
|
|
51275
51298
|
if (!updatedIsLoading) {
|
|
51276
51299
|
unsubscribeWebView.unsubscribe();
|
|
@@ -51316,7 +51339,10 @@ const closeSpotCheck = async () => {
|
|
|
51316
51339
|
},
|
|
51317
51340
|
body: JSON.stringify(payload),
|
|
51318
51341
|
});
|
|
51319
|
-
if (response.status
|
|
51342
|
+
if (response.status == 200) {
|
|
51343
|
+
getSpotCheckEventListener().emit('surveyDismissed');
|
|
51344
|
+
}
|
|
51345
|
+
else {
|
|
51320
51346
|
console.log(`Error: ${response.status}`);
|
|
51321
51347
|
}
|
|
51322
51348
|
}
|
|
@@ -51373,15 +51399,11 @@ const getSpotcheckComponentCssStyles = (state) => {
|
|
|
51373
51399
|
height: '100%',
|
|
51374
51400
|
};
|
|
51375
51401
|
}
|
|
51376
|
-
let marginBottom = globalOS !== 'ios' ? 18 : 0;
|
|
51377
51402
|
if (state.isVisible && state.isMounted) {
|
|
51378
51403
|
let height = Math.min(state.currentQuestionHeight, (state.maxHeight * window.innerHeight));
|
|
51379
51404
|
if (state.spotChecksMode === 'miniCard') {
|
|
51380
51405
|
if (state.avatarEnabled) {
|
|
51381
51406
|
height = height - 56;
|
|
51382
|
-
if (state.spotcheckPosition === 'bottom') {
|
|
51383
|
-
marginBottom += 56;
|
|
51384
|
-
}
|
|
51385
51407
|
}
|
|
51386
51408
|
if (state.isCloseButtonEnabled) {
|
|
51387
51409
|
height = height - 40;
|
|
@@ -51424,12 +51446,11 @@ const getSpotcheckComponentCssStyles = (state) => {
|
|
|
51424
51446
|
}
|
|
51425
51447
|
}
|
|
51426
51448
|
return {
|
|
51427
|
-
wrapperStyles: Object.assign({ position: 'fixed', width: '100%', height: '100%', top: '0', left: '0', backgroundColor: 'rgba(0, 0, 0, 0.3)', zIndex: '
|
|
51428
|
-
styles: Object.assign({ display: 'none', flexDirection: 'column', paddingTop: extraPaddingForMiniCardCloseButtonIfTopPosition + 'px'
|
|
51449
|
+
wrapperStyles: Object.assign({ position: 'fixed', width: '100%', height: '100%', top: '0', left: '0', backgroundColor: 'rgba(0, 0, 0, 0.3)', zIndex: '99999999', display: 'none', flexDirection: 'column' }, wrapperStyles),
|
|
51450
|
+
styles: Object.assign({ display: 'none', flexDirection: 'column', paddingTop: extraPaddingForMiniCardCloseButtonIfTopPosition + 'px' }, styles)
|
|
51429
51451
|
};
|
|
51430
51452
|
};
|
|
51431
51453
|
const closeSpotCheckAndHandleSurveyEnd = async () => {
|
|
51432
|
-
await closeSpotCheck();
|
|
51433
51454
|
handleSurveyEnd();
|
|
51434
51455
|
};
|
|
51435
51456
|
|
|
@@ -51443,8 +51464,10 @@ var __metadata = (undefined && undefined.__metadata) || function (k, v) {
|
|
|
51443
51464
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
51444
51465
|
};
|
|
51445
51466
|
let WebViewComponent = class WebViewComponent {
|
|
51446
|
-
constructor(sanitizer) {
|
|
51467
|
+
constructor(sanitizer, ngZone, cdr) {
|
|
51447
51468
|
this.sanitizer = sanitizer;
|
|
51469
|
+
this.ngZone = ngZone;
|
|
51470
|
+
this.cdr = cdr;
|
|
51448
51471
|
this.url = '';
|
|
51449
51472
|
this.webviewType = 'classic';
|
|
51450
51473
|
this.isMiniCard = false;
|
|
@@ -51475,90 +51498,51 @@ let WebViewComponent = class WebViewComponent {
|
|
|
51475
51498
|
setupIframeLoadListener() {
|
|
51476
51499
|
const iframe = this.iframe.nativeElement;
|
|
51477
51500
|
iframe.addEventListener('load', () => {
|
|
51478
|
-
this.
|
|
51479
|
-
|
|
51480
|
-
|
|
51481
|
-
|
|
51482
|
-
}
|
|
51483
|
-
else {
|
|
51484
|
-
stateService.setState({ isChatLoading: false });
|
|
51485
|
-
}
|
|
51486
|
-
});
|
|
51487
|
-
}
|
|
51488
|
-
injectNativeBridgeAdapters(iframe) {
|
|
51489
|
-
if (iframe && iframe.contentWindow) {
|
|
51490
|
-
try {
|
|
51491
|
-
const iframeWindow = iframe.contentWindow;
|
|
51492
|
-
if (!iframeWindow.SsAndroidSdk) {
|
|
51493
|
-
iframeWindow.SsAndroidSdk = {
|
|
51494
|
-
shareData: function () { },
|
|
51495
|
-
sendPartialSubmissionData: function () { }
|
|
51496
|
-
};
|
|
51497
|
-
}
|
|
51498
|
-
if (!iframeWindow.Android) {
|
|
51499
|
-
iframeWindow.Android = {
|
|
51500
|
-
onMessageReceive: function () { }
|
|
51501
|
-
};
|
|
51502
|
-
}
|
|
51503
|
-
if (!iframeWindow.webkit) {
|
|
51504
|
-
iframeWindow.webkit = {
|
|
51505
|
-
messageHandlers: {
|
|
51506
|
-
surveyResponse: {
|
|
51507
|
-
postMessage: function () { }
|
|
51508
|
-
},
|
|
51509
|
-
spotCheckData: {
|
|
51510
|
-
postMessage: function () { }
|
|
51511
|
-
},
|
|
51512
|
-
flutterSpotCheckData: {
|
|
51513
|
-
postMessage: function () { }
|
|
51514
|
-
}
|
|
51515
|
-
}
|
|
51516
|
-
};
|
|
51501
|
+
this.ngZone.run(() => {
|
|
51502
|
+
const stateService = getSpotcheckStateService();
|
|
51503
|
+
if (this.webviewType === 'classic') {
|
|
51504
|
+
stateService.setState({ isClassicLoading: false });
|
|
51517
51505
|
}
|
|
51518
|
-
|
|
51519
|
-
|
|
51520
|
-
postMessage: function () { }
|
|
51521
|
-
};
|
|
51506
|
+
else {
|
|
51507
|
+
stateService.setState({ isChatLoading: false });
|
|
51522
51508
|
}
|
|
51523
|
-
}
|
|
51524
|
-
|
|
51525
|
-
}
|
|
51509
|
+
});
|
|
51510
|
+
});
|
|
51526
51511
|
}
|
|
51527
51512
|
onMessage(event) {
|
|
51528
|
-
|
|
51529
|
-
|
|
51530
|
-
|
|
51531
|
-
|
|
51532
|
-
|
|
51533
|
-
|
|
51534
|
-
|
|
51535
|
-
|
|
51536
|
-
|
|
51537
|
-
|
|
51538
|
-
|
|
51539
|
-
|
|
51540
|
-
|
|
51541
|
-
|
|
51542
|
-
|
|
51543
|
-
|
|
51544
|
-
|
|
51513
|
+
this.ngZone.run(() => {
|
|
51514
|
+
const stateService = getSpotcheckStateService();
|
|
51515
|
+
const { data } = event;
|
|
51516
|
+
switch (data.type) {
|
|
51517
|
+
case 'slideInFrame':
|
|
51518
|
+
if (data.mounted) {
|
|
51519
|
+
stateService.setState({ isMounted: true });
|
|
51520
|
+
}
|
|
51521
|
+
break;
|
|
51522
|
+
case 'resizeWindow':
|
|
51523
|
+
if (data.size) {
|
|
51524
|
+
stateService.setState({
|
|
51525
|
+
currentQuestionHeight: data.size.height,
|
|
51526
|
+
});
|
|
51527
|
+
}
|
|
51528
|
+
else if (data.isCloseButtonEnabled) {
|
|
51529
|
+
stateService.setState({
|
|
51530
|
+
isCloseButtonEnabled: data.isCloseButtonEnabled,
|
|
51531
|
+
});
|
|
51532
|
+
}
|
|
51533
|
+
break;
|
|
51534
|
+
case 'surveyCompleted':
|
|
51535
|
+
closeSpotCheckAndHandleSurveyEnd().then(() => {
|
|
51536
|
+
getSpotCheckEventListener().emit('surveyCompleted', data.response);
|
|
51537
|
+
this.cdr.detectChanges();
|
|
51545
51538
|
});
|
|
51546
|
-
|
|
51547
|
-
|
|
51548
|
-
|
|
51549
|
-
|
|
51550
|
-
|
|
51551
|
-
|
|
51552
|
-
|
|
51553
|
-
// spotchecksListener.emitSurveyLoadStarted(data.surveyDetails);
|
|
51554
|
-
break;
|
|
51555
|
-
case 'classicLoadEvent':
|
|
51556
|
-
stateService.setState({ isClassicLoadEventReceived: true });
|
|
51557
|
-
break;
|
|
51558
|
-
case 'chatLoadEvent':
|
|
51559
|
-
stateService.setState({ isChatLoadEventReceived: true });
|
|
51560
|
-
break;
|
|
51561
|
-
}
|
|
51539
|
+
break;
|
|
51540
|
+
case 'surveyLoadStarted':
|
|
51541
|
+
getSpotCheckEventListener().emit('surveyLoadStarted', data.surveyDetails);
|
|
51542
|
+
break;
|
|
51543
|
+
}
|
|
51544
|
+
this.cdr.detectChanges();
|
|
51545
|
+
});
|
|
51562
51546
|
}
|
|
51563
51547
|
};
|
|
51564
51548
|
__decorate$1([
|
|
@@ -51589,8 +51573,7 @@ WebViewComponent = __decorate$1([
|
|
|
51589
51573
|
template: `
|
|
51590
51574
|
<div style="overflow: hidden; height: 100%; border-radius: {{isMiniCard ? 12 : 0}}px; padding-left: {{isMiniCard ? 12 : 0}}px; padding-right: {{isMiniCard ? 12 : 0}}px; box-sizing: border-box;">
|
|
51591
51575
|
<iframe
|
|
51592
|
-
allow="camera; microphone; geolocation; display-capture; autoplay; clipboard-read; clipboard-write;
|
|
51593
|
-
allowfullscreen
|
|
51576
|
+
allow="camera; microphone; geolocation; display-capture; autoplay; clipboard-read; clipboard-write;"
|
|
51594
51577
|
#iframeRef
|
|
51595
51578
|
[src]="safeUrl"
|
|
51596
51579
|
style="width: 100%; height: 100%; display: block; border-radius: {{isMiniCard ? 12 : 0}}px;"
|
|
@@ -51602,7 +51585,9 @@ WebViewComponent = __decorate$1([
|
|
|
51602
51585
|
standalone: true,
|
|
51603
51586
|
imports: [CommonModule],
|
|
51604
51587
|
}),
|
|
51605
|
-
__metadata("design:paramtypes", [DomSanitizer
|
|
51588
|
+
__metadata("design:paramtypes", [DomSanitizer,
|
|
51589
|
+
NgZone,
|
|
51590
|
+
ChangeDetectorRef])
|
|
51606
51591
|
], WebViewComponent);
|
|
51607
51592
|
let CloseSVGComponent = class CloseSVGComponent {
|
|
51608
51593
|
constructor() {
|
|
@@ -51648,7 +51633,9 @@ CloseSVGComponent = __decorate$1([
|
|
|
51648
51633
|
})
|
|
51649
51634
|
], CloseSVGComponent);
|
|
51650
51635
|
let CloseButtonComponent = class CloseButtonComponent {
|
|
51651
|
-
constructor() {
|
|
51636
|
+
constructor(ngZone, cdr) {
|
|
51637
|
+
this.ngZone = ngZone;
|
|
51638
|
+
this.cdr = cdr;
|
|
51652
51639
|
this.size = 30;
|
|
51653
51640
|
this.strokeWidth = 1.2;
|
|
51654
51641
|
this.isVisible = false;
|
|
@@ -51657,13 +51644,19 @@ let CloseButtonComponent = class CloseButtonComponent {
|
|
|
51657
51644
|
this.onClick = async () => {
|
|
51658
51645
|
await closeSpotCheck();
|
|
51659
51646
|
handleSurveyEnd();
|
|
51647
|
+
this.ngZone.run(() => {
|
|
51648
|
+
this.cdr.detectChanges();
|
|
51649
|
+
});
|
|
51660
51650
|
};
|
|
51661
51651
|
this.stateService = getSpotcheckStateService();
|
|
51662
51652
|
this.state = this.stateService.getState();
|
|
51663
51653
|
this.updateComponentState();
|
|
51664
51654
|
this.stateSubscription = this.stateService.state$.subscribe((newState) => {
|
|
51665
|
-
this.
|
|
51666
|
-
|
|
51655
|
+
this.ngZone.run(() => {
|
|
51656
|
+
this.state = newState;
|
|
51657
|
+
this.updateComponentState();
|
|
51658
|
+
this.cdr.detectChanges();
|
|
51659
|
+
});
|
|
51667
51660
|
});
|
|
51668
51661
|
}
|
|
51669
51662
|
ngOnDestroy() {
|
|
@@ -51707,10 +51700,13 @@ CloseButtonComponent = __decorate$1([
|
|
|
51707
51700
|
standalone: true,
|
|
51708
51701
|
imports: [CommonModule, CloseSVGComponent],
|
|
51709
51702
|
}),
|
|
51710
|
-
__metadata("design:paramtypes", [
|
|
51703
|
+
__metadata("design:paramtypes", [NgZone,
|
|
51704
|
+
ChangeDetectorRef])
|
|
51711
51705
|
], CloseButtonComponent);
|
|
51712
51706
|
let SpotCheckComponent = class SpotCheckComponent {
|
|
51713
|
-
constructor() {
|
|
51707
|
+
constructor(ngZone, cdr) {
|
|
51708
|
+
this.ngZone = ngZone;
|
|
51709
|
+
this.cdr = cdr;
|
|
51714
51710
|
this.componentStyles = {};
|
|
51715
51711
|
this.avatarUrl = '';
|
|
51716
51712
|
this.initializeComponent = async () => {
|
|
@@ -51753,9 +51749,12 @@ let SpotCheckComponent = class SpotCheckComponent {
|
|
|
51753
51749
|
this.state = this.spotcheckStateService.getState();
|
|
51754
51750
|
this.updateComponentStyles();
|
|
51755
51751
|
this.stateSubscription = this.spotcheckStateService.state$.subscribe((newState) => {
|
|
51756
|
-
this.
|
|
51757
|
-
|
|
51758
|
-
|
|
51752
|
+
this.ngZone.run(() => {
|
|
51753
|
+
this.state = newState;
|
|
51754
|
+
this.updateComponentStyles();
|
|
51755
|
+
this.avatarUrl = this.state.avatarUrl || "https://static.surveysparrow.com/application/images/profile.png";
|
|
51756
|
+
this.cdr.detectChanges();
|
|
51757
|
+
});
|
|
51759
51758
|
});
|
|
51760
51759
|
}
|
|
51761
51760
|
ngOnInit() {
|
|
@@ -51778,7 +51777,8 @@ SpotCheckComponent = __decorate$1([
|
|
|
51778
51777
|
standalone: true,
|
|
51779
51778
|
imports: [CommonModule, WebViewComponent, CloseButtonComponent],
|
|
51780
51779
|
}),
|
|
51781
|
-
__metadata("design:paramtypes", [
|
|
51780
|
+
__metadata("design:paramtypes", [NgZone,
|
|
51781
|
+
ChangeDetectorRef])
|
|
51782
51782
|
], SpotCheckComponent);
|
|
51783
51783
|
|
|
51784
51784
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
@@ -51806,7 +51806,6 @@ const setUUID = (uuid) => {
|
|
|
51806
51806
|
};
|
|
51807
51807
|
|
|
51808
51808
|
const sendTrackScreenRequest = async ({ screen, options, }) => {
|
|
51809
|
-
var _a, _b;
|
|
51810
51809
|
try {
|
|
51811
51810
|
const spotcheckStateService = getSpotcheckStateService();
|
|
51812
51811
|
const oldState = spotcheckStateService.getState();
|
|
@@ -51925,7 +51924,7 @@ const sendTrackScreenRequest = async ({ screen, options, }) => {
|
|
|
51925
51924
|
}
|
|
51926
51925
|
}
|
|
51927
51926
|
}
|
|
51928
|
-
throw new Error(
|
|
51927
|
+
throw new Error(responseJson === null || responseJson === void 0 ? void 0 : responseJson.reason.toString());
|
|
51929
51928
|
}
|
|
51930
51929
|
else {
|
|
51931
51930
|
throw new Error(`Received status code ${response.status}`);
|
|
@@ -51936,7 +51935,7 @@ const sendTrackScreenRequest = async ({ screen, options, }) => {
|
|
|
51936
51935
|
}
|
|
51937
51936
|
};
|
|
51938
51937
|
const sendTrackEventRequest = async ({ screen, event }) => {
|
|
51939
|
-
var _a, _b, _c, _d, _e, _f
|
|
51938
|
+
var _a, _b, _c, _d, _e, _f;
|
|
51940
51939
|
try {
|
|
51941
51940
|
const intMax = Number.POSITIVE_INFINITY;
|
|
51942
51941
|
const state = getSpotcheckStateService().getState();
|
|
@@ -52009,7 +52008,7 @@ const sendTrackEventRequest = async ({ screen, event }) => {
|
|
|
52009
52008
|
return { valid: true };
|
|
52010
52009
|
}
|
|
52011
52010
|
}
|
|
52012
|
-
throw new Error(
|
|
52011
|
+
throw new Error(responseJson === null || responseJson === void 0 ? void 0 : responseJson.reason.toString());
|
|
52013
52012
|
}
|
|
52014
52013
|
else {
|
|
52015
52014
|
throw new Error(`Received status code ${response.status}`);
|
|
@@ -52085,6 +52084,7 @@ const trackEvent = async ({ screen, event }) => {
|
|
|
52085
52084
|
const SurveySparrowIonicPlugin = core.registerPlugin('SurveySparrowIonicPlugin');
|
|
52086
52085
|
|
|
52087
52086
|
exports.SurveySparrowIonicPlugin = SurveySparrowIonicPlugin;
|
|
52087
|
+
exports.addSpotCheckListener = addSpotCheckListener;
|
|
52088
52088
|
exports.initializeSpotChecks = initializeSpotChecks;
|
|
52089
52089
|
exports.trackEvent = trackEvent;
|
|
52090
52090
|
exports.trackScreen = trackScreen;
|