@shopfront/bridge 3.0.5--canary.25.adff0f1.0 → 3.0.5
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/.gemini/config.yaml +3 -0
- package/lib/APIs/Sale/index.d.ts +1 -0
- package/lib/ApplicationEvents/ToShopfront.d.ts +1 -6
- package/lib/ApplicationEvents/index.d.ts +1 -1
- package/lib/BaseApplication.d.ts +0 -1
- package/lib/Events/Ready.d.ts +3 -3
- package/lib/index.mjs +104 -104
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/APIs/Sale/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type { SaleData as SaleCreateData, SalePaymentData as SaleCreatePaymentData, SaleProductData as SaleCreateProductData, } from "../../Utilities/SaleCreate.js";
|
|
2
|
+
export { BaseCurrentSale } from "./BaseCurrentSale.js";
|
|
2
3
|
export { BaseSale } from "./BaseSale.js";
|
|
3
4
|
export * as Exceptions from "./Exceptions.js";
|
|
4
5
|
export { Sale } from "./Sale.js";
|
|
@@ -162,11 +162,6 @@ export interface InternalPageMessageEvent {
|
|
|
162
162
|
message: unknown;
|
|
163
163
|
reference: InternalMessageSource;
|
|
164
164
|
}
|
|
165
|
-
export interface ReadyEvent {
|
|
166
|
-
register: null | string;
|
|
167
|
-
outlet: null | string;
|
|
168
|
-
vendor: string;
|
|
169
|
-
}
|
|
170
165
|
export interface RegisterChangedEvent {
|
|
171
166
|
register: null | string;
|
|
172
167
|
outlet: null | string;
|
|
@@ -208,7 +203,7 @@ export interface PaymentMethodEnabledContext {
|
|
|
208
203
|
};
|
|
209
204
|
}
|
|
210
205
|
export interface FromShopfrontCallbacks {
|
|
211
|
-
READY: (event:
|
|
206
|
+
READY: (event: RegisterChangedEvent) => MaybePromise<FromShopfrontResponse["READY"]>;
|
|
212
207
|
REQUEST_SETTINGS: () => MaybePromise<FromShopfrontResponse["REQUEST_SETTINGS"]>;
|
|
213
208
|
REQUEST_BUTTONS: (location: string, context: unknown) => MaybePromise<FromShopfrontResponse["REQUEST_BUTTONS"]>;
|
|
214
209
|
REQUEST_TABLE_COLUMNS: (location: string, data: unknown) => MaybePromise<FromShopfrontResponse["REQUEST_TABLE_COLUMNS"]>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export type { SaleAddCustomerEvent, SaleAddProductEvent, SaleChangeQuantityEvent, SaleRemoveProductEvent, SaleUpdateProductsEvent, } from "./DirectShopfront.js";
|
|
2
|
-
export type { AudioPermissionChangeEvent, FormatIntegratedProductEvent, FormatIntegratedProductResponse, FulfilmentApprovalEvent, FulfilmentGetOrderResponse, FulfilmentProcessEvent, GiftCardCodeCheckEvent, GiftCardCodeCheckResponse, InternalPageMessageEvent, PaymentMethodEnabledContext, PaymentMethodsEnabledEvent, PaymentMethodsEnabledResponse,
|
|
2
|
+
export type { AudioPermissionChangeEvent, FormatIntegratedProductEvent, FormatIntegratedProductResponse, FulfilmentApprovalEvent, FulfilmentGetOrderResponse, FulfilmentProcessEvent, GiftCardCodeCheckEvent, GiftCardCodeCheckResponse, InternalPageMessageEvent, PaymentMethodEnabledContext, PaymentMethodsEnabledEvent, PaymentMethodsEnabledResponse, RegisterChangedEvent, RequestButtonsResponse, RequestCustomerListOptionsResponse, RequestSaleKeysResponse, RequestSellScreenOptionsResponse, RequestSettingsResponse, RequestTableColumnsResponse, SaleCompletedEvent, UIPipelineContext, UIPipelineEvent, UIPipelineResponse, } from "./ToShopfront.js";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/BaseApplication.d.ts
CHANGED
|
@@ -39,7 +39,6 @@ export declare abstract class BaseApplication {
|
|
|
39
39
|
protected register: string | null;
|
|
40
40
|
protected outlet: string | null;
|
|
41
41
|
protected user: string | null;
|
|
42
|
-
protected vendor: string;
|
|
43
42
|
protected signingKey: CryptoKeyPair | undefined;
|
|
44
43
|
protected listeners: {
|
|
45
44
|
[key in ListenableFromShopfrontEvent]: Map<AnyFunction, FromShopfront[key] & BaseEvent>;
|
package/lib/Events/Ready.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { FromShopfrontCallbacks, FromShopfrontResponse,
|
|
1
|
+
import type { FromShopfrontCallbacks, FromShopfrontResponse, RegisterChangedEvent } from "../ApplicationEvents/ToShopfront.js";
|
|
2
2
|
import { BaseEvent } from "./BaseEvent.js";
|
|
3
3
|
interface ReadyData {
|
|
4
4
|
outlet: string | null;
|
|
5
5
|
register: string | null;
|
|
6
|
-
|
|
6
|
+
user: string | null;
|
|
7
7
|
}
|
|
8
|
-
export declare class Ready extends BaseEvent<
|
|
8
|
+
export declare class Ready extends BaseEvent<RegisterChangedEvent> {
|
|
9
9
|
constructor(callback: FromShopfrontCallbacks["READY"]);
|
|
10
10
|
/**
|
|
11
11
|
* @inheritDoc
|
package/lib/index.mjs
CHANGED
|
@@ -345,27 +345,6 @@ class x {
|
|
|
345
345
|
return this.sale.metaData;
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
|
-
class N extends Error {
|
|
349
|
-
constructor() {
|
|
350
|
-
super("The sale is no longer active.");
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
class k extends Error {
|
|
354
|
-
constructor() {
|
|
355
|
-
super("This device is no longer a register able to perform a sale.");
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
class I extends Error {
|
|
359
|
-
constructor() {
|
|
360
|
-
super("Product does not exist in the sale");
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
const qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
364
|
-
__proto__: null,
|
|
365
|
-
InvalidSaleDeviceError: k,
|
|
366
|
-
ProductNotExistsError: I,
|
|
367
|
-
SaleCancelledError: N
|
|
368
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
369
348
|
class ue {
|
|
370
349
|
id;
|
|
371
350
|
constructor(e) {
|
|
@@ -674,7 +653,7 @@ class _ {
|
|
|
674
653
|
this.quantityModified = !1, this.priceModified = !1, this.metaDataModified = !1;
|
|
675
654
|
}
|
|
676
655
|
}
|
|
677
|
-
class
|
|
656
|
+
class I extends x {
|
|
678
657
|
created = !1;
|
|
679
658
|
creating = !1;
|
|
680
659
|
constructor(e) {
|
|
@@ -791,7 +770,39 @@ class w extends x {
|
|
|
791
770
|
};
|
|
792
771
|
}
|
|
793
772
|
}
|
|
794
|
-
class
|
|
773
|
+
class k extends x {
|
|
774
|
+
application;
|
|
775
|
+
cancelled;
|
|
776
|
+
/**
|
|
777
|
+
* Create a sale from a sale state.
|
|
778
|
+
* It's highly recommend to not construct a sale manually, instead use application.getCurrentSale().
|
|
779
|
+
*/
|
|
780
|
+
constructor(e, t) {
|
|
781
|
+
super(I.buildSaleData(t)), this.application = e, this.cancelled = !1;
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
class N extends Error {
|
|
785
|
+
constructor() {
|
|
786
|
+
super("The sale is no longer active.");
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
class F extends Error {
|
|
790
|
+
constructor() {
|
|
791
|
+
super("This device is no longer a register able to perform a sale.");
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
class w extends Error {
|
|
795
|
+
constructor() {
|
|
796
|
+
super("Product does not exist in the sale");
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
const qe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
800
|
+
__proto__: null,
|
|
801
|
+
InvalidSaleDeviceError: F,
|
|
802
|
+
ProductNotExistsError: w,
|
|
803
|
+
SaleCancelledError: N
|
|
804
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
805
|
+
class G {
|
|
795
806
|
key;
|
|
796
807
|
url;
|
|
797
808
|
listeners = [];
|
|
@@ -829,7 +840,7 @@ class le extends d {
|
|
|
829
840
|
return this.callback(void 0, void 0);
|
|
830
841
|
}
|
|
831
842
|
}
|
|
832
|
-
class
|
|
843
|
+
class Q extends d {
|
|
833
844
|
constructor(e) {
|
|
834
845
|
super(e);
|
|
835
846
|
}
|
|
@@ -875,7 +886,7 @@ class he extends d {
|
|
|
875
886
|
return this.callback(e, void 0);
|
|
876
887
|
}
|
|
877
888
|
}
|
|
878
|
-
class
|
|
889
|
+
class q extends d {
|
|
879
890
|
constructor(e) {
|
|
880
891
|
super(e);
|
|
881
892
|
}
|
|
@@ -903,7 +914,7 @@ class pe extends d {
|
|
|
903
914
|
return this.callback(e, void 0);
|
|
904
915
|
}
|
|
905
916
|
}
|
|
906
|
-
class
|
|
917
|
+
class fe extends d {
|
|
907
918
|
constructor(e) {
|
|
908
919
|
super(e);
|
|
909
920
|
}
|
|
@@ -913,11 +924,11 @@ class ge extends d {
|
|
|
913
924
|
async emit(e) {
|
|
914
925
|
return this.callback({
|
|
915
926
|
id: e.id,
|
|
916
|
-
sale: new
|
|
927
|
+
sale: new I(I.buildSaleData(e.sale))
|
|
917
928
|
}, void 0);
|
|
918
929
|
}
|
|
919
930
|
}
|
|
920
|
-
class
|
|
931
|
+
class ge extends d {
|
|
921
932
|
constructor(e) {
|
|
922
933
|
super(e);
|
|
923
934
|
}
|
|
@@ -928,7 +939,7 @@ class fe extends d {
|
|
|
928
939
|
return this.callback(e, void 0);
|
|
929
940
|
}
|
|
930
941
|
}
|
|
931
|
-
class
|
|
942
|
+
class Y extends d {
|
|
932
943
|
constructor(e) {
|
|
933
944
|
super(e);
|
|
934
945
|
}
|
|
@@ -975,7 +986,7 @@ class Se extends d {
|
|
|
975
986
|
}, void 0);
|
|
976
987
|
}
|
|
977
988
|
}
|
|
978
|
-
class
|
|
989
|
+
class B extends d {
|
|
979
990
|
constructor(e) {
|
|
980
991
|
super(e);
|
|
981
992
|
}
|
|
@@ -1006,7 +1017,7 @@ class Re extends d {
|
|
|
1006
1017
|
return this.callback({
|
|
1007
1018
|
outlet: e.outlet,
|
|
1008
1019
|
register: e.register,
|
|
1009
|
-
|
|
1020
|
+
user: e.user
|
|
1010
1021
|
}, void 0);
|
|
1011
1022
|
}
|
|
1012
1023
|
}
|
|
@@ -1021,7 +1032,7 @@ class _e extends d {
|
|
|
1021
1032
|
return this.callback(e, void 0);
|
|
1022
1033
|
}
|
|
1023
1034
|
}
|
|
1024
|
-
class
|
|
1035
|
+
class j extends d {
|
|
1025
1036
|
constructor(e) {
|
|
1026
1037
|
super(e);
|
|
1027
1038
|
}
|
|
@@ -1060,7 +1071,7 @@ class C extends c {
|
|
|
1060
1071
|
} : e, C), typeof e == "string" ? this.contents = e : this.contents = e.properties[0];
|
|
1061
1072
|
}
|
|
1062
1073
|
}
|
|
1063
|
-
class
|
|
1074
|
+
class K extends d {
|
|
1064
1075
|
constructor(e) {
|
|
1065
1076
|
super(e);
|
|
1066
1077
|
}
|
|
@@ -1089,7 +1100,7 @@ class j extends d {
|
|
|
1089
1100
|
);
|
|
1090
1101
|
}
|
|
1091
1102
|
}
|
|
1092
|
-
class
|
|
1103
|
+
class H extends d {
|
|
1093
1104
|
constructor(e) {
|
|
1094
1105
|
super(e);
|
|
1095
1106
|
}
|
|
@@ -1117,7 +1128,7 @@ class K extends d {
|
|
|
1117
1128
|
e.sendMessage(a.RESPONSE_SALE_KEYS, i, s);
|
|
1118
1129
|
}
|
|
1119
1130
|
}
|
|
1120
|
-
class
|
|
1131
|
+
class f extends d {
|
|
1121
1132
|
constructor(e) {
|
|
1122
1133
|
super(e);
|
|
1123
1134
|
}
|
|
@@ -1148,7 +1159,7 @@ class g extends d {
|
|
|
1148
1159
|
for (let s = 0, i = t.length; s < i; s++) {
|
|
1149
1160
|
if (!t[s].url || !t[s].title)
|
|
1150
1161
|
throw new TypeError("You must specify both a URL and a title");
|
|
1151
|
-
|
|
1162
|
+
f.validateURL(t[s].url), t[s].id = f.getOptionId(t[s].url);
|
|
1152
1163
|
}
|
|
1153
1164
|
return t;
|
|
1154
1165
|
}
|
|
@@ -1159,7 +1170,7 @@ class g extends d {
|
|
|
1159
1170
|
e.sendMessage(a.RESPONSE_SELL_SCREEN_OPTIONS, t, s);
|
|
1160
1171
|
}
|
|
1161
1172
|
}
|
|
1162
|
-
class
|
|
1173
|
+
class V extends d {
|
|
1163
1174
|
constructor(e) {
|
|
1164
1175
|
super(e);
|
|
1165
1176
|
}
|
|
@@ -1183,7 +1194,7 @@ class H extends d {
|
|
|
1183
1194
|
e.sendMessage(a.RESPONSE_SETTINGS, t[0], s);
|
|
1184
1195
|
}
|
|
1185
1196
|
}
|
|
1186
|
-
class
|
|
1197
|
+
class $ extends d {
|
|
1187
1198
|
constructor(e) {
|
|
1188
1199
|
super(e);
|
|
1189
1200
|
}
|
|
@@ -1218,7 +1229,7 @@ class ye extends d {
|
|
|
1218
1229
|
return this.callback(e, void 0);
|
|
1219
1230
|
}
|
|
1220
1231
|
}
|
|
1221
|
-
class M extends
|
|
1232
|
+
class M extends G {
|
|
1222
1233
|
constructor(e, t, s) {
|
|
1223
1234
|
if (s === "frame" && window.parent === window)
|
|
1224
1235
|
throw new Error("The bridge has not been initialised within a frame");
|
|
@@ -1386,7 +1397,7 @@ class M extends F {
|
|
|
1386
1397
|
]);
|
|
1387
1398
|
}
|
|
1388
1399
|
}
|
|
1389
|
-
class
|
|
1400
|
+
class z extends d {
|
|
1390
1401
|
constructor(e) {
|
|
1391
1402
|
super(e);
|
|
1392
1403
|
}
|
|
@@ -1415,13 +1426,13 @@ class $ extends d {
|
|
|
1415
1426
|
}
|
|
1416
1427
|
}
|
|
1417
1428
|
var a = /* @__PURE__ */ ((r) => (r.READY = "READY", r.SERIALIZED = "SERIALIZED", r.RESPONSE_BUTTONS = "RESPONSE_BUTTONS", r.RESPONSE_SETTINGS = "RESPONSE_SETTINGS", r.RESPONSE_TABLE_COLUMNS = "RESPONSE_TABLE_COLUMNS", r.RESPONSE_SELL_SCREEN_OPTIONS = "RESPONSE_SELL_SCREEN_OPTIONS", r.DOWNLOAD = "DOWNLOAD", r.LOAD = "LOAD", r.REQUEST_CURRENT_SALE = "REQUEST_CURRENT_SALE", r.DATABASE_REQUEST = "DATABASE_REQUEST", r.UNSUPPORTED_EVENT = "UNSUPPORTED_EVENT", r.NOT_LISTENING_TO_EVENT = "NOT_LISTENING_TO_EVENT", r.REQUEST_LOCATION = "REQUEST_LOCATION", r.RESPONSE_FORMAT_PRODUCT = "RESPONSE_FORMAT_PRODUCT", r.RESPONSE_CUSTOMER_LIST_OPTIONS = "RESPONSE_CUSTOMER_LIST_OPTIONS", r.RESPONSE_SALE_KEYS = "RESPONSE_SALE_KEYS", r.PRINT_RECEIPT = "PRINT_RECEIPT", r.REDIRECT = "REDIRECT", r.GET_OPTION = "GET_OPTION", r.RESPONSE_UI_PIPELINE = "RESPONSE_UI_PIPELINE", r.RESPONSE_GIFT_CARD_CODE_CHECK = "RESPONSE_GIFT_CARD_CODE_CHECK", r.REQUEST_SECURE_KEY = "REQUEST_SECURE_KEY", r.ROTATE_SIGNING_KEY = "ROTATE_SIGNING_KEY", r.AUDIO_REQUEST_PERMISSION = "AUDIO_REQUEST_PERMISSION", r.AUDIO_PRELOAD = "AUDIO_PRELOAD", r.AUDIO_PLAY = "AUDIO_PLAY", r.CHANGE_SELL_SCREEN_ACTION_MODE = "CHANGE_SELL_SCREEN_ACTION_MODE", r.CHANGE_SELL_SCREEN_SUMMARY_MODE = "CHANGE_SELL_SCREEN_SUMMARY_MODE", r.SELL_SCREEN_OPTION_CHANGE = "SELL_SCREEN_OPTION_CHANGE", r.INTERNAL_PAGE_MESSAGE = "INTERNAL_PAGE_MESSAGE", r.TABLE_UPDATE = "TABLE_UPDATE", r.PIPELINE_TRIGGER = "PIPELINE_TRIGGER", r.SELL_SCREEN_PROMOTION_APPLICABLE = "SELL_SCREEN_PROMOTION_APPLICABLE", r.FULFILMENT_OPT_IN = "FULFILMENT_OPT_IN", r.FULFILMENT_OPTIONS = "FULFILMENT_OPTIONS", r.FULFILMENT_ORDERS_SYNC = "FULFILMENT_ORDERS_SYNC", r.FULFILMENT_ORDERS_CREATE = "FULFILMENT_ORDERS_CREATE", r.FULFILMENT_ORDERS_UPDATE = "FULFILMENT_ORDERS_UPDATE", r.FULFILMENT_ORDERS_CANCEL = "FULFILMENT_ORDERS_CANCEL", r.CREATE_SALE = "CREATE_SALE", r.FULFILMENT_GET_ORDER = "FULFILMENT_GET_ORDER", r))(a || {});
|
|
1418
|
-
class
|
|
1429
|
+
class J {
|
|
1419
1430
|
bridge;
|
|
1420
1431
|
constructor(e) {
|
|
1421
1432
|
this.bridge = e;
|
|
1422
1433
|
}
|
|
1423
1434
|
}
|
|
1424
|
-
class Te extends
|
|
1435
|
+
class Te extends J {
|
|
1425
1436
|
constructor(e) {
|
|
1426
1437
|
super(e);
|
|
1427
1438
|
}
|
|
@@ -1485,18 +1496,7 @@ class l extends c {
|
|
|
1485
1496
|
}
|
|
1486
1497
|
}
|
|
1487
1498
|
}
|
|
1488
|
-
class
|
|
1489
|
-
application;
|
|
1490
|
-
cancelled;
|
|
1491
|
-
/**
|
|
1492
|
-
* Create a sale from a sale state.
|
|
1493
|
-
* It's highly recommend to not construct a sale manually, instead use application.getCurrentSale().
|
|
1494
|
-
*/
|
|
1495
|
-
constructor(e, t) {
|
|
1496
|
-
super(w.buildSaleData(t)), this.application = e, this.cancelled = !1;
|
|
1497
|
-
}
|
|
1498
|
-
}
|
|
1499
|
-
class me extends J {
|
|
1499
|
+
class me extends k {
|
|
1500
1500
|
/**
|
|
1501
1501
|
* @inheritDoc
|
|
1502
1502
|
*/
|
|
@@ -1504,7 +1504,7 @@ class me extends J {
|
|
|
1504
1504
|
this.checkIfCancelled();
|
|
1505
1505
|
const e = await this.application.getCurrentSale();
|
|
1506
1506
|
if (e === !1)
|
|
1507
|
-
throw new
|
|
1507
|
+
throw new F();
|
|
1508
1508
|
this.hydrate(e);
|
|
1509
1509
|
}
|
|
1510
1510
|
/**
|
|
@@ -1628,13 +1628,13 @@ class me extends J {
|
|
|
1628
1628
|
return e.wasQuantityModified() && (t.quantity = e.getQuantity()), e.wasPriceModified() && (t.price = e.getPrice()), e.wasMetaDataModified() && (t.metaData = e.getMetaData()), e.clearModificationFlags(), this.sendSaleUpdate(new l("PRODUCT_UPDATE", t));
|
|
1629
1629
|
}
|
|
1630
1630
|
}
|
|
1631
|
-
class
|
|
1631
|
+
class g {
|
|
1632
1632
|
callback;
|
|
1633
1633
|
constructor(e) {
|
|
1634
1634
|
this.callback = e;
|
|
1635
1635
|
}
|
|
1636
1636
|
}
|
|
1637
|
-
class Ae extends
|
|
1637
|
+
class Ae extends g {
|
|
1638
1638
|
constructor(e) {
|
|
1639
1639
|
super(e);
|
|
1640
1640
|
}
|
|
@@ -1652,7 +1652,7 @@ class Ae extends f {
|
|
|
1652
1652
|
return this.callback(e);
|
|
1653
1653
|
}
|
|
1654
1654
|
}
|
|
1655
|
-
class Le extends
|
|
1655
|
+
class Le extends g {
|
|
1656
1656
|
constructor(e) {
|
|
1657
1657
|
super(e);
|
|
1658
1658
|
}
|
|
@@ -1670,7 +1670,7 @@ class Le extends f {
|
|
|
1670
1670
|
return this.callback(e);
|
|
1671
1671
|
}
|
|
1672
1672
|
}
|
|
1673
|
-
class Oe extends
|
|
1673
|
+
class Oe extends g {
|
|
1674
1674
|
constructor(e) {
|
|
1675
1675
|
super(e);
|
|
1676
1676
|
}
|
|
@@ -1688,7 +1688,7 @@ class Oe extends f {
|
|
|
1688
1688
|
return this.callback(e);
|
|
1689
1689
|
}
|
|
1690
1690
|
}
|
|
1691
|
-
class Ie extends
|
|
1691
|
+
class Ie extends g {
|
|
1692
1692
|
constructor(e) {
|
|
1693
1693
|
super(e);
|
|
1694
1694
|
}
|
|
@@ -1706,7 +1706,7 @@ class Ie extends f {
|
|
|
1706
1706
|
return this.callback();
|
|
1707
1707
|
}
|
|
1708
1708
|
}
|
|
1709
|
-
class we extends
|
|
1709
|
+
class we extends g {
|
|
1710
1710
|
constructor(e) {
|
|
1711
1711
|
super(e);
|
|
1712
1712
|
}
|
|
@@ -1724,7 +1724,7 @@ class we extends f {
|
|
|
1724
1724
|
return this.callback();
|
|
1725
1725
|
}
|
|
1726
1726
|
}
|
|
1727
|
-
class Pe extends
|
|
1727
|
+
class Pe extends g {
|
|
1728
1728
|
constructor(e) {
|
|
1729
1729
|
super(e);
|
|
1730
1730
|
}
|
|
@@ -1742,7 +1742,7 @@ class Pe extends f {
|
|
|
1742
1742
|
return this.callback(e);
|
|
1743
1743
|
}
|
|
1744
1744
|
}
|
|
1745
|
-
class De extends
|
|
1745
|
+
class De extends g {
|
|
1746
1746
|
constructor(e) {
|
|
1747
1747
|
super(e);
|
|
1748
1748
|
}
|
|
@@ -1780,7 +1780,6 @@ class W {
|
|
|
1780
1780
|
register;
|
|
1781
1781
|
outlet;
|
|
1782
1782
|
user;
|
|
1783
|
-
vendor = "";
|
|
1784
1783
|
signingKey;
|
|
1785
1784
|
listeners = {
|
|
1786
1785
|
READY: /* @__PURE__ */ new Map(),
|
|
@@ -1858,16 +1857,16 @@ class W {
|
|
|
1858
1857
|
s = new Re(t), this.listeners[e].set(t, s);
|
|
1859
1858
|
break;
|
|
1860
1859
|
case "REQUEST_SETTINGS":
|
|
1861
|
-
s = new
|
|
1860
|
+
s = new V(t), this.listeners[e].set(t, s);
|
|
1862
1861
|
break;
|
|
1863
1862
|
case "REQUEST_BUTTONS":
|
|
1864
|
-
s = new
|
|
1863
|
+
s = new j(t), this.listeners[e].set(t, s);
|
|
1865
1864
|
break;
|
|
1866
1865
|
case "REQUEST_TABLE_COLUMNS":
|
|
1867
|
-
s = new
|
|
1866
|
+
s = new $(t), this.listeners[e].set(t, s);
|
|
1868
1867
|
break;
|
|
1869
1868
|
case "REQUEST_SELL_SCREEN_OPTIONS":
|
|
1870
|
-
s = new
|
|
1869
|
+
s = new f(t), this.listeners[e].set(t, s);
|
|
1871
1870
|
break;
|
|
1872
1871
|
case "INTERNAL_PAGE_MESSAGE":
|
|
1873
1872
|
s = new Se(
|
|
@@ -1879,22 +1878,22 @@ class W {
|
|
|
1879
1878
|
s = new _e(t), this.listeners[e].set(t, s);
|
|
1880
1879
|
break;
|
|
1881
1880
|
case "REQUEST_CUSTOMER_LIST_OPTIONS":
|
|
1882
|
-
s = new
|
|
1881
|
+
s = new K(t), this.listeners[e].set(t, s);
|
|
1883
1882
|
break;
|
|
1884
1883
|
case "FORMAT_INTEGRATED_PRODUCT":
|
|
1885
|
-
s = new
|
|
1884
|
+
s = new Q(t), this.listeners[e].set(t, s);
|
|
1886
1885
|
break;
|
|
1887
1886
|
case "REQUEST_SALE_KEYS":
|
|
1888
|
-
s = new
|
|
1887
|
+
s = new H(t), this.listeners[e].set(t, s);
|
|
1889
1888
|
break;
|
|
1890
1889
|
case "SALE_COMPLETE":
|
|
1891
1890
|
s = new ye(t), this.listeners[e].set(t, s);
|
|
1892
1891
|
break;
|
|
1893
1892
|
case "UI_PIPELINE":
|
|
1894
|
-
s = new
|
|
1893
|
+
s = new z(t), this.listeners[e].set(t, s);
|
|
1895
1894
|
break;
|
|
1896
1895
|
case "PAYMENT_METHODS_ENABLED":
|
|
1897
|
-
s = new
|
|
1896
|
+
s = new B(t), this.listeners[e].set(t, s);
|
|
1898
1897
|
break;
|
|
1899
1898
|
case "AUDIO_READY":
|
|
1900
1899
|
s = new le(t), this.listeners[e].set(t, s);
|
|
@@ -1905,13 +1904,13 @@ class W {
|
|
|
1905
1904
|
case "FULFILMENT_GET_ORDER":
|
|
1906
1905
|
if (this.listeners[e].size !== 0)
|
|
1907
1906
|
throw new TypeError("Application already has 'FULFILMENT_GET_ORDER' event listener registered.");
|
|
1908
|
-
s = new
|
|
1907
|
+
s = new q(t), this.listeners[e].set(t, s);
|
|
1909
1908
|
break;
|
|
1910
1909
|
case "FULFILMENT_VOID_ORDER":
|
|
1911
|
-
s = new
|
|
1910
|
+
s = new ge(t), this.listeners[e].set(t, s);
|
|
1912
1911
|
break;
|
|
1913
1912
|
case "FULFILMENT_PROCESS_ORDER":
|
|
1914
|
-
s = new
|
|
1913
|
+
s = new fe(t), this.listeners[e].set(t, s);
|
|
1915
1914
|
break;
|
|
1916
1915
|
case "FULFILMENT_ORDER_APPROVAL":
|
|
1917
1916
|
s = new pe(t), this.listeners[e].set(t, s);
|
|
@@ -1923,16 +1922,16 @@ class W {
|
|
|
1923
1922
|
s = new he(t), this.listeners[e].set(t, s);
|
|
1924
1923
|
break;
|
|
1925
1924
|
case "GIFT_CARD_CODE_CHECK":
|
|
1926
|
-
s = new
|
|
1925
|
+
s = new Y(t), this.listeners[e].set(t, s);
|
|
1927
1926
|
break;
|
|
1928
1927
|
}
|
|
1929
1928
|
if (typeof s > "u")
|
|
1930
1929
|
throw new TypeError(`${e} has not been defined`);
|
|
1931
|
-
e === "READY" && this.isReady && s.emit({
|
|
1930
|
+
e === "READY" && this.isReady && (s = s, s.emit({
|
|
1932
1931
|
outlet: this.outlet,
|
|
1933
1932
|
register: this.register,
|
|
1934
|
-
|
|
1935
|
-
});
|
|
1933
|
+
user: this.user
|
|
1934
|
+
}));
|
|
1936
1935
|
}
|
|
1937
1936
|
/**
|
|
1938
1937
|
* Removed a registered listener for a Shopfront event
|
|
@@ -2040,10 +2039,9 @@ class Ue extends W {
|
|
|
2040
2039
|
* Handles an application event
|
|
2041
2040
|
*/
|
|
2042
2041
|
handleEvent = (e, t, s) => {
|
|
2043
|
-
if (e === "READY" && (this.isReady = !0, this.key = t.key, this.outlet = t.outlet, this.register = t.register,
|
|
2042
|
+
if (e === "READY" && (this.isReady = !0, this.key = t.key, this.outlet = t.outlet, this.register = t.register, t = {
|
|
2044
2043
|
outlet: t.outlet,
|
|
2045
|
-
register: t.register
|
|
2046
|
-
vendor: t.vendor
|
|
2044
|
+
register: t.register
|
|
2047
2045
|
}), e === "CALLBACK") {
|
|
2048
2046
|
this.handleEventCallback(t);
|
|
2049
2047
|
return;
|
|
@@ -2083,27 +2081,27 @@ class Ue extends W {
|
|
|
2083
2081
|
i.push(n.emit(t, this.bridge));
|
|
2084
2082
|
switch (e) {
|
|
2085
2083
|
case "REQUEST_BUTTONS":
|
|
2086
|
-
return i = i, Promise.all(i).then((n) =>
|
|
2084
|
+
return i = i, Promise.all(i).then((n) => j.respond(this.bridge, n.flat(), s));
|
|
2087
2085
|
case "REQUEST_SETTINGS":
|
|
2088
|
-
return i = i, Promise.all(i).then((n) => H.respond(this.bridge, n.flat(), s));
|
|
2089
|
-
case "REQUEST_TABLE_COLUMNS":
|
|
2090
2086
|
return i = i, Promise.all(i).then((n) => V.respond(this.bridge, n.flat(), s));
|
|
2087
|
+
case "REQUEST_TABLE_COLUMNS":
|
|
2088
|
+
return i = i, Promise.all(i).then((n) => $.respond(this.bridge, n.flat(), s));
|
|
2091
2089
|
case "REQUEST_SELL_SCREEN_OPTIONS":
|
|
2092
|
-
return i = i, Promise.all(i).then((n) =>
|
|
2090
|
+
return i = i, Promise.all(i).then((n) => f.respond(this.bridge, n.flat(), s));
|
|
2093
2091
|
case "FORMAT_INTEGRATED_PRODUCT":
|
|
2094
|
-
return i = i, Promise.all(i).then((n) =>
|
|
2092
|
+
return i = i, Promise.all(i).then((n) => Q.respond(this.bridge, n.flat(), s));
|
|
2095
2093
|
case "REQUEST_CUSTOMER_LIST_OPTIONS":
|
|
2096
|
-
return i = i, Promise.all(i).then((n) => j.respond(this.bridge, n.flat(), s));
|
|
2097
|
-
case "REQUEST_SALE_KEYS":
|
|
2098
2094
|
return i = i, Promise.all(i).then((n) => K.respond(this.bridge, n.flat(), s));
|
|
2095
|
+
case "REQUEST_SALE_KEYS":
|
|
2096
|
+
return i = i, Promise.all(i).then((n) => H.respond(this.bridge, n.flat(), s));
|
|
2099
2097
|
case "UI_PIPELINE":
|
|
2100
|
-
return i = i, Promise.all(i).then((n) =>
|
|
2098
|
+
return i = i, Promise.all(i).then((n) => z.respond(this.bridge, n.flat(), s));
|
|
2101
2099
|
case "GIFT_CARD_CODE_CHECK":
|
|
2102
|
-
return i = i, Promise.all(i).then((n) =>
|
|
2100
|
+
return i = i, Promise.all(i).then((n) => Y.respond(this.bridge, n[0], s));
|
|
2103
2101
|
case "PAYMENT_METHODS_ENABLED":
|
|
2104
|
-
return i = i, Promise.all(i).then((n) =>
|
|
2102
|
+
return i = i, Promise.all(i).then((n) => B.respond(this.bridge, n.flat(), s));
|
|
2105
2103
|
case "FULFILMENT_GET_ORDER":
|
|
2106
|
-
return i = i, Promise.all(i).then((n) =>
|
|
2104
|
+
return i = i, Promise.all(i).then((n) => q.respond(this.bridge, n[0], s));
|
|
2107
2105
|
}
|
|
2108
2106
|
}
|
|
2109
2107
|
/**
|
|
@@ -2367,7 +2365,8 @@ class Ue extends W {
|
|
|
2367
2365
|
const i = JSON.parse(new TextDecoder().decode(t));
|
|
2368
2366
|
if (i.app !== this.bridge.key)
|
|
2369
2367
|
throw new O();
|
|
2370
|
-
|
|
2368
|
+
let n = location.href;
|
|
2369
|
+
if (typeof import.meta < "u" && window.parent === window && (n = import.meta.url), i.url.loaded !== n)
|
|
2371
2370
|
throw new O();
|
|
2372
2371
|
return s ? i : i.auth;
|
|
2373
2372
|
}
|
|
@@ -2463,8 +2462,8 @@ class Ve extends h {
|
|
|
2463
2462
|
}
|
|
2464
2463
|
class $e extends h {
|
|
2465
2464
|
constructor(e, t) {
|
|
2466
|
-
|
|
2467
|
-
id:
|
|
2465
|
+
f.validateURL(e), super(a.SELL_SCREEN_OPTION_CHANGE, {
|
|
2466
|
+
id: f.getOptionId(e),
|
|
2468
2467
|
url: e,
|
|
2469
2468
|
title: t
|
|
2470
2469
|
});
|
|
@@ -2513,7 +2512,7 @@ const xe = {
|
|
|
2513
2512
|
priceSet: null,
|
|
2514
2513
|
metaData: {}
|
|
2515
2514
|
};
|
|
2516
|
-
class ke extends
|
|
2515
|
+
class ke extends k {
|
|
2517
2516
|
constructor(e, t) {
|
|
2518
2517
|
super(e, t ?? xe);
|
|
2519
2518
|
}
|
|
@@ -2620,7 +2619,7 @@ class ke extends J {
|
|
|
2620
2619
|
this.handleSaleProductPriceChange(t, s, n), await this.triggerEvent("SALE_UPDATE_PRODUCTS", { products: [] });
|
|
2621
2620
|
return;
|
|
2622
2621
|
} catch (t) {
|
|
2623
|
-
if (!(t instanceof
|
|
2622
|
+
if (!(t instanceof w))
|
|
2624
2623
|
throw t;
|
|
2625
2624
|
}
|
|
2626
2625
|
e.indexAddress = this.products.length === 0 ? [0] : [this.products.length], e.edited = !1, this.products.push(this.cloneProduct(e)), this.updateSaleTotal(e.getPrice() || 0), await this.triggerEvent("SALE_ADD_PRODUCT", {
|
|
@@ -2733,7 +2732,7 @@ class ke extends J {
|
|
|
2733
2732
|
getIndexOfProduct(e) {
|
|
2734
2733
|
const t = this.products.findIndex((s) => s.getId() === e.getId());
|
|
2735
2734
|
if (t === -1)
|
|
2736
|
-
throw new
|
|
2735
|
+
throw new w();
|
|
2737
2736
|
return t;
|
|
2738
2737
|
}
|
|
2739
2738
|
/**
|
|
@@ -2834,7 +2833,7 @@ class ke extends J {
|
|
|
2834
2833
|
};
|
|
2835
2834
|
}
|
|
2836
2835
|
}
|
|
2837
|
-
class Fe extends
|
|
2836
|
+
class Fe extends G {
|
|
2838
2837
|
isReady = !1;
|
|
2839
2838
|
constructor(e, t) {
|
|
2840
2839
|
super(e, t), this.registerListeners(), this.sendMessage(a.READY);
|
|
@@ -2926,7 +2925,7 @@ const U = {
|
|
|
2926
2925
|
vendorConnections: [],
|
|
2927
2926
|
enterprises: []
|
|
2928
2927
|
};
|
|
2929
|
-
class Ge extends
|
|
2928
|
+
class Ge extends J {
|
|
2930
2929
|
mockedDatabase = U;
|
|
2931
2930
|
constructor(e) {
|
|
2932
2931
|
super(e);
|
|
@@ -3242,7 +3241,8 @@ function We(r, e) {
|
|
|
3242
3241
|
export {
|
|
3243
3242
|
Ue as Application,
|
|
3244
3243
|
W as BaseApplication,
|
|
3245
|
-
|
|
3244
|
+
G as BaseBridge,
|
|
3245
|
+
k as BaseCurrentSale,
|
|
3246
3246
|
x as BaseSale,
|
|
3247
3247
|
M as Bridge,
|
|
3248
3248
|
R as Button,
|
|
@@ -3259,7 +3259,7 @@ export {
|
|
|
3259
3259
|
Ke as OrdersSync,
|
|
3260
3260
|
Qe as Redirect,
|
|
3261
3261
|
Ve as RegisterIntent,
|
|
3262
|
-
|
|
3262
|
+
I as Sale,
|
|
3263
3263
|
ue as SaleCustomer,
|
|
3264
3264
|
T as SaleKey,
|
|
3265
3265
|
L as SalePayment,
|