bitsnap-react 1.3.6 → 1.3.8
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/package.json +1 -1
- package/dist/errors.js +0 -2
- package/dist/errors.js.map +0 -1
- package/dist/index.js +0 -4663
- package/dist/index.js.map +0 -1
- package/dist/internal.js +0 -2
- package/dist/internal.js.map +0 -1
- package/dist/models.js +0 -106
- package/dist/models.js.map +0 -1
package/dist/index.js
DELETED
|
@@ -1,4663 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/index.ts
|
|
31
|
-
var src_exports = {};
|
|
32
|
-
__export(src_exports, {
|
|
33
|
-
ApplePayButton: () => ApplePay_default,
|
|
34
|
-
Bitsnap: () => Bitsnap,
|
|
35
|
-
BitsnapCheckout: () => BitsnapCart_default,
|
|
36
|
-
GooglePayButton: () => GooglePay_default,
|
|
37
|
-
NotificationsComponent: () => NotificationsComponentPublic_default,
|
|
38
|
-
createCheckout: () => createCheckout,
|
|
39
|
-
createPaymentURL: () => createPaymentURL,
|
|
40
|
-
getReferenceIfPossible: () => getReferenceIfPossible,
|
|
41
|
-
injectReferenceToRequestIfNeeded: () => injectReferenceToRequestIfNeeded,
|
|
42
|
-
setCustomHost: () => setCustomHost,
|
|
43
|
-
setProjectID: () => setProjectID
|
|
44
|
-
});
|
|
45
|
-
module.exports = __toCommonJS(src_exports);
|
|
46
|
-
|
|
47
|
-
// src/components/checkout/ApplePay.tsx
|
|
48
|
-
var import_apple_pay_button = __toESM(require("apple-pay-button"));
|
|
49
|
-
|
|
50
|
-
// src/public.api.client.ts
|
|
51
|
-
var import_connect = require("@connectrpc/connect");
|
|
52
|
-
var import_connect_web = require("@connectrpc/connect-web");
|
|
53
|
-
|
|
54
|
-
// src/gen/proto/public/v1/public_api_pb.ts
|
|
55
|
-
var import_codegenv25 = require("@bufbuild/protobuf/codegenv2");
|
|
56
|
-
var import_wkt3 = require("@bufbuild/protobuf/wkt");
|
|
57
|
-
|
|
58
|
-
// src/gen/proto/common/v1/gateway_pb.ts
|
|
59
|
-
var import_codegenv2 = require("@bufbuild/protobuf/codegenv2");
|
|
60
|
-
var file_common_v1_gateway = /* @__PURE__ */ (0, import_codegenv2.fileDesc)("Chdjb21tb24vdjEvZ2F0ZXdheS5wcm90bxIJY29tbW9uLnYxKrMBCgdHYXRld2F5Eg8KC0dBVEVXQVlfQUxMEAASFwoTR0FURVdBWV9QUlpFTEVXWV8yNBABEhIKDkdBVEVXQVlfU1RSSVBFEAISEAoMR0FURVdBWV9UUEFZEAMSHAoYR0FURVdBWV9DQVNIX09OX0RFTElWRVJZEAQSEAoMR0FURVdBWV9GUkVFEAUSFgoSR0FURVdBWV9JTlBPU1RfUEFZEAYSEAoMR0FURVdBWV9QQVlVEAdCTlpMZ2l0aHViLmNvbS9lbW1lbXMvc3VwZXItY2FydC9hcHBzL3Nydi13b3JrZXIvdXRpbHMvbW9kZWxzL2NvbW1vbi92MTtjb21tb252MWIGcHJvdG8z");
|
|
61
|
-
|
|
62
|
-
// src/gen/proto/common/v1/address_pb.ts
|
|
63
|
-
var import_codegenv22 = require("@bufbuild/protobuf/codegenv2");
|
|
64
|
-
var file_common_v1_address = /* @__PURE__ */ (0, import_codegenv22.fileDesc)("Chdjb21tb24vdjEvYWRkcmVzcy5wcm90bxIJY29tbW9uLnYxIocBCgdBZGRyZXNzEgwKBG5hbWUYASABKAkSDQoFbGluZTEYAiABKAkSEgoFbGluZTIYAyABKAlIAIgBARIMCgRjaXR5GAQgASgJEg8KB2NvdW50cnkYBSABKAkSFQoIemlwX2NvZGUYBiABKAlIAYgBAUIICgZfbGluZTJCCwoJX3ppcF9jb2RlIq4BCg5CaWxsaW5nQWRkcmVzcxIMCgRuYW1lGAEgASgJEg0KBWxpbmUxGAIgASgJEhIKBWxpbmUyGAMgASgJSACIAQESDAoEY2l0eRgEIAEoCRIPCgdjb3VudHJ5GAUgASgJEhUKCHppcF9jb2RlGAYgASgJSAGIAQESEwoGdGF4X2lkGAcgASgJSAKIAQFCCAoGX2xpbmUyQgsKCV96aXBfY29kZUIJCgdfdGF4X2lkQk5aTGdpdGh1Yi5jb20vZW1tZW1zL3N1cGVyLWNhcnQvYXBwcy9zcnYtd29ya2VyL3V0aWxzL21vZGVscy9jb21tb24vdjE7Y29tbW9udjFiBnByb3RvMw");
|
|
65
|
-
var AddressSchema = /* @__PURE__ */ (0, import_codegenv22.messageDesc)(file_common_v1_address, 0);
|
|
66
|
-
var BillingAddressSchema = /* @__PURE__ */ (0, import_codegenv22.messageDesc)(file_common_v1_address, 1);
|
|
67
|
-
|
|
68
|
-
// src/gen/proto/common/v1/push_notifications_pb.ts
|
|
69
|
-
var import_codegenv23 = require("@bufbuild/protobuf/codegenv2");
|
|
70
|
-
var import_wkt = require("@bufbuild/protobuf/wkt");
|
|
71
|
-
var file_common_v1_push_notifications = /* @__PURE__ */ (0, import_codegenv23.fileDesc)("CiJjb21tb24vdjEvcHVzaF9ub3RpZmljYXRpb25zLnByb3RvEgljb21tb24udjEi9gEKG1B1c2hOb3RpZmljYXRpb25EZXZpY2VUb2tlbhIXCgpwdXNoX3Rva2VuGAIgASgJSACIAQESNAoLZXhwaXJlX3RpbWUYAyABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wSAGIAQESEwoGcDI1NmRoGAQgASgJSAKIAQESFQoIZW5kcG9pbnQYBSABKAlIA4gBARIlCghwbGF0Zm9ybRgGIAEoDjITLmNvbW1vbi52MS5QbGF0Zm9ybUINCgtfcHVzaF90b2tlbkIOCgxfZXhwaXJlX3RpbWVCCQoHX3AyNTZkaEILCglfZW5kcG9pbnQiZwoXUHVzaE5vdGlmaWNhdGlvblBheWxvYWQSDQoFdGl0bGUYAiABKAkSFQoIb3Blbl91cmwYAyABKAlIAYgBARIOCgRib2R5GAQgASgJSABCCQoHbWVzc2FnZUILCglfb3Blbl91cmwqeAoIUGxhdGZvcm0SGAoUUExBVEZPUk1fVU5TUEVDSUZJRUQQABIQCgxQTEFURk9STV9XRUIQARIYChRQTEFURk9STV9JT1NfU0FOREJPWBACEhAKDFBMQVRGT1JNX0lPUxADEhQKEFBMQVRGT1JNX0FORFJPSUQQBCp0ChFOb3RpZmljYXRpb25FdmVudBIRCg1FVkVOVF9VTktOT1dOEAASEgoORVZFTlRfUkVDRUlWRUQQARIQCgxFVkVOVF9PUEVORUQQAhIRCg1FVkVOVF9DTElDS0VEEAMSEwoPRVZFTlRfRElTTUlTU0VEEAQqmQEKGU5vdGlmaWNhdGlvbkdyb3VwSG93T2Z0ZW4SJwojTk9USUZJQ0FUSU9OX0dST1VQX0hPV19PRlRFTl9SQVJFTFkQABImCiJOT1RJRklDQVRJT05fR1JPVVBfSE9XX09GVEVOX09GVEVOEAESKwonTk9USUZJQ0FUSU9OX0dST1VQX0hPV19PRlRFTl9WRVJZX09GVEVOEAJCTlpMZ2l0aHViLmNvbS9lbW1lbXMvc3VwZXItY2FydC9hcHBzL3Nydi13b3JrZXIvdXRpbHMvbW9kZWxzL2NvbW1vbi92MTtjb21tb252MWIGcHJvdG8z", [import_wkt.file_google_protobuf_timestamp]);
|
|
72
|
-
|
|
73
|
-
// src/gen/proto/dashboard/v1/audiobooks_pb.ts
|
|
74
|
-
var import_codegenv24 = require("@bufbuild/protobuf/codegenv2");
|
|
75
|
-
var import_wkt2 = require("@bufbuild/protobuf/wkt");
|
|
76
|
-
var file_dashboard_v1_audiobooks = /* @__PURE__ */ (0, import_codegenv24.fileDesc)("Ch1kYXNoYm9hcmQvdjEvYXVkaW9ib29rcy5wcm90bxIXZGFzaGJvYXJkLmF1ZGlvYm9va3MudjEiFgoUR2V0QXVkaW9ib29rc1JlcXVlc3QiIQoTR2V0QXVkaW9ib29rUmVxdWVzdBIKCgJpZBgBIAEoCSKrAQoHQ2hhcHRlchIKCgJpZBgBIAEoCRIMCgRuYW1lGAIgASgJEhgKC2Rlc2NyaXB0aW9uGAMgASgJSACIAQESGgoNbXVsdGltZWRpYV9pZBgEIAEoCUgBiAEBEi4KCmNyZWF0ZWRfYXQYBSABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wQg4KDF9kZXNjcmlwdGlvbkIQCg5fbXVsdGltZWRpYV9pZCLzAgoJQXVkaW9ib29rEg8KAmlkGAEgASgJSACIAQESEgoKcHJvamVjdF9pZBgCIAEoCRI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RW1haWxzUmVzcG9uc2USdQoVQ3JlYXRlQXVkaW9ib29rQWNjZXNzEjUuZGFzaGJvYXJkLmF1ZGlvYm9va3MudjEuQ3JlYXRlQXVkaW9ib29rQWNjZXNzUmVxdWVzdBolLmRhc2hib2FyZC5hdWRpb2Jvb2tzLnYxLkJvb2xSZXNwb25zZRJ1ChVEZWxldGVBdWRpb2Jvb2tBY2Nlc3MSNS5kYXNoYm9hcmQuYXVkaW9ib29rcy52MS5EZWxldGVBdWRpb2Jvb2tBY2Nlc3NSZXF1ZXN0GiUuZGFzaGJvYXJkLmF1ZGlvYm9va3MudjEuQm9vbFJlc3BvbnNlYgZwcm90bzM", [import_wkt2.file_google_protobuf_timestamp, import_wkt2.file_google_protobuf_empty]);
|
|
77
|
-
|
|
78
|
-
// src/gen/proto/public/v1/public_api_pb.ts
|
|
79
|
-
var file_public_v1_public_api = /* @__PURE__ */ (0, import_codegenv25.fileDesc)("ChpwdWJsaWMvdjEvcHVibGljX2FwaS5wcm90bxINcHVibGljX2FwaS52MSI3CiFJc09uZUNsaWNrUGF5bWVudEF2YWlsYWJsZVJlcXVlc3QSEgoKcHJvamVjdF9pZBgBIAEoCSLFAgoiSXNPbmVDbGlja1BheW1lbnRBdmFpbGFibGVSZXNwb25zZRISCgppbnBvc3RfcGF5GAEgASgIEhEKCWFwcGxlX3BheRgCIAEoCBISCgpnb29nbGVfcGF5GAMgASgIEmEKEWdvb2dsZV9wYXlfY29uZmlnGAQgASgLMkEucHVibGljX2FwaS52MS5Jc09uZUNsaWNrUGF5bWVudEF2YWlsYWJsZVJlc3BvbnNlLkdvb2dsZVBheUNvbmZpZ0gAiAEBGmsKD0dvb2dsZVBheUNvbmZpZxITCgttZXJjaGFudF9pZBgBIAEoCRIVCg1tZXJjaGFudF9uYW1lGAIgASgJEg8KB2dhdGV3YXkYAyABKAkSGwoTZ2F0ZXdheV9tZXJjaGFudF9pZBgEIAEoCUIUChJfZ29vZ2xlX3BheV9jb25maWci0QMKH09uZUN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xlQ291bnRGb3JQcm9kdWN0UmVxdWVzdBoyLnB1YmxpY19hcGkudjEuR2V0QXZhaWxhYmxlQ291bnRGb3JQcm9kdWN0UmVzcG9uc2USgQEKGklzT25lQ2xpY2tQYXltZW50QXZhaWxhYmxlEjAucHVibGljX2FwaS52MS5Jc09uZUNsaWNrUGF5bWVudEF2YWlsYWJsZVJlcXVlc3QaMS5wdWJsaWNfYXBpLnYxLklzT25lQ2xpY2tQYXltZW50QXZhaWxhYmxlUmVzcG9uc2USaQoSR2V0UHJlT3JkZXJEZXRhaWxzEigucHVibGljX2FwaS52MS5HZXRQcmVPcmRlckRldGFpbHNSZXF1ZXN0GikucHVibGljX2FwaS52MS5HZXRQcmVPcmRlckRldGFpbHNSZXNwb25zZRJ7ChhBcHBsZVBheVZhbGlkYXRlTWVyY2hhbnQSLi5wdWJsaWNfYXBpLnYxLkFwcGxlUGF5VmFsaWRhdGVNZXJjaGFudFJlcXVlc3QaLy5wdWJsaWNfYXBpLnYxLkFwcGxlUGF5VmFsaWRhdGVNZXJjaGFudFJlc3BvbnNlEnsKGEF1dGhvcml6ZU9uZUNsaWNrUGF5bWVudBIuLnB1YmxpY19hcGkudjEuT25lQ2xpY2tBdXRob3JpemVQYXltZW50UmVxdWVzdBovLnB1YmxpY19hcGkudjEuT25lQ2xpY2tBdXRob3JpemVQYXltZW50UmVzcG9uc2USdgoiTm90aWZ5VXNlckFib3V0UHJvZHVjdEF2YWlsYWJpbGl0eRI4LnB1YmxpY19hcGkudjEuTm90aWZ5VXNlckFib3V0UHJvZHVjdEF2YWlsYWJpbGl0eVJlcXVlc3QaFi5nb29nbGUucHJvdG9idWYuRW1wdHliBnByb3RvMw", [import_wkt3.file_google_protobuf_timestamp, file_common_v1_gateway, file_common_v1_address, file_common_v1_push_notifications, import_wkt3.file_google_protobuf_empty, file_dashboard_v1_audiobooks]);
|
|
80
|
-
var PreOrderItemSchema = /* @__PURE__ */ (0, import_codegenv25.messageDesc)(file_public_v1_public_api, 4);
|
|
81
|
-
var GetPreOrderDetailsRequestSchema = /* @__PURE__ */ (0, import_codegenv25.messageDesc)(file_public_v1_public_api, 5);
|
|
82
|
-
var PublicApiService = /* @__PURE__ */ (0, import_codegenv25.serviceDesc)(file_public_v1_public_api, 0);
|
|
83
|
-
|
|
84
|
-
// src/public.api.client.ts
|
|
85
|
-
var PublicApiClient;
|
|
86
|
-
((PublicApiClient2) => {
|
|
87
|
-
function get(host) {
|
|
88
|
-
return (0, import_connect.createClient)(PublicApiService, getTransport(host));
|
|
89
|
-
}
|
|
90
|
-
PublicApiClient2.get = get;
|
|
91
|
-
let transport;
|
|
92
|
-
function getTransport(host) {
|
|
93
|
-
if (transport == null) {
|
|
94
|
-
transport = (0, import_connect_web.createConnectTransport)({
|
|
95
|
-
useBinaryFormat: true,
|
|
96
|
-
baseUrl: host + "/api/rpc"
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
return transport;
|
|
100
|
-
}
|
|
101
|
-
})(PublicApiClient || (PublicApiClient = {}));
|
|
102
|
-
|
|
103
|
-
// src/components/checkout/CartProvider.tsx
|
|
104
|
-
var import_protobuf = require("@bufbuild/protobuf");
|
|
105
|
-
var import_react = require("react");
|
|
106
|
-
var import_zod2 = __toESM(require("zod"));
|
|
107
|
-
|
|
108
|
-
// src/components/checkout/constants.ts
|
|
109
|
-
var HOST = "https://bitsnap.pl";
|
|
110
|
-
function setCustomHost(host) {
|
|
111
|
-
console.log("setCustomHost", host);
|
|
112
|
-
HOST = host;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// src/components/checkout/helper.methods.ts
|
|
116
|
-
function buildURL(projectID, path) {
|
|
117
|
-
return `${HOST}/api/integrations/${projectID}/public-commerce${path}`;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
// src/components/checkout/lib/err.ts
|
|
121
|
-
function isErr(x) {
|
|
122
|
-
return typeof x === "object" && x != null && "ERR" in x;
|
|
123
|
-
}
|
|
124
|
-
function Err(message, type) {
|
|
125
|
-
return { ERR: true, error: message, type };
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// src/components/checkout/lib/round.number.ts
|
|
129
|
-
function round(num, numberOfDecimals = 2) {
|
|
130
|
-
return Number(
|
|
131
|
-
+(Math.round(Number(num + "e+" + numberOfDecimals)) + "e-" + numberOfDecimals)
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
function formatCurrency(amount, currency) {
|
|
135
|
-
const formatter = Intl.NumberFormat(navigator.language, {
|
|
136
|
-
style: "currency",
|
|
137
|
-
currency,
|
|
138
|
-
currencyDisplay: "symbol"
|
|
139
|
-
});
|
|
140
|
-
return formatter.format(amount / 100);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// src/components/checkout/state.ts
|
|
144
|
-
var import_zustand = require("zustand");
|
|
145
|
-
var useCheckoutStore = (0, import_zustand.create)((set) => ({
|
|
146
|
-
isCartVisible: false,
|
|
147
|
-
numberOfProductsInCart: 0,
|
|
148
|
-
showCart: () => set((state) => ({ ...state, isCartVisible: true })),
|
|
149
|
-
hideCart: () => set((state) => ({ ...state, isCartVisible: false })),
|
|
150
|
-
setNumberOfProductsInCart: (numberOfProductsInCart) => set((state) => ({ ...state, numberOfProductsInCart }))
|
|
151
|
-
}));
|
|
152
|
-
|
|
153
|
-
// src/components/checkout/methods.ts
|
|
154
|
-
var Bitsnap;
|
|
155
|
-
((Bitsnap2) => {
|
|
156
|
-
async function addProductToCart(id, quantity = 1, metadata) {
|
|
157
|
-
const projectID = getProjectID();
|
|
158
|
-
if (projectID == null) {
|
|
159
|
-
throw new Error("No project ID found");
|
|
160
|
-
}
|
|
161
|
-
const methods = getCheckoutMethods(projectID);
|
|
162
|
-
const err = await methods.addProduct({
|
|
163
|
-
productID: id,
|
|
164
|
-
quantity,
|
|
165
|
-
metadata
|
|
166
|
-
});
|
|
167
|
-
if (err != null) {
|
|
168
|
-
return err;
|
|
169
|
-
}
|
|
170
|
-
return void 0;
|
|
171
|
-
}
|
|
172
|
-
Bitsnap2.addProductToCart = addProductToCart;
|
|
173
|
-
function showCart() {
|
|
174
|
-
useCheckoutStore.setState({ isCartVisible: true });
|
|
175
|
-
}
|
|
176
|
-
Bitsnap2.showCart = showCart;
|
|
177
|
-
function hideCart() {
|
|
178
|
-
useCheckoutStore.setState({ isCartVisible: false });
|
|
179
|
-
}
|
|
180
|
-
Bitsnap2.hideCart = hideCart;
|
|
181
|
-
})(Bitsnap || (Bitsnap = {}));
|
|
182
|
-
async function createPaymentURL(request) {
|
|
183
|
-
const projectID = getProjectID();
|
|
184
|
-
if (projectID == null) {
|
|
185
|
-
throw new Error("No project ID found");
|
|
186
|
-
}
|
|
187
|
-
request = injectReferenceToRequestIfNeeded(request);
|
|
188
|
-
const result = await fetch(buildURL(projectID, "/buy"), {
|
|
189
|
-
method: "POST",
|
|
190
|
-
headers: {
|
|
191
|
-
"Content-Type": "application/json"
|
|
192
|
-
},
|
|
193
|
-
body: JSON.stringify(request)
|
|
194
|
-
});
|
|
195
|
-
if (result.status != 200) {
|
|
196
|
-
console.warn(
|
|
197
|
-
"result",
|
|
198
|
-
await result.text(),
|
|
199
|
-
result.status,
|
|
200
|
-
result.statusText
|
|
201
|
-
);
|
|
202
|
-
return Err("internal-error", "internal");
|
|
203
|
-
}
|
|
204
|
-
const response = await result.json();
|
|
205
|
-
return {
|
|
206
|
-
url: response.url
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
async function createCheckout(request) {
|
|
210
|
-
const projectID = getProjectID();
|
|
211
|
-
if (projectID == null) {
|
|
212
|
-
throw new Error("No project ID found");
|
|
213
|
-
}
|
|
214
|
-
const headers = {
|
|
215
|
-
"Content-Type": "application/json",
|
|
216
|
-
...request.apiKey != null ? { Authorization: `Bearer ${request.apiKey}` } : {}
|
|
217
|
-
};
|
|
218
|
-
const path = request.testMode ? `/api/payment/link/auto/${projectID}/test` : `/api/payment/link/auto/${projectID}`;
|
|
219
|
-
delete request.apiKey;
|
|
220
|
-
delete request.testMode;
|
|
221
|
-
const response = await fetch(HOST + path, {
|
|
222
|
-
method: "POST",
|
|
223
|
-
headers,
|
|
224
|
-
body: JSON.stringify(request)
|
|
225
|
-
});
|
|
226
|
-
const payload = await response.json();
|
|
227
|
-
return {
|
|
228
|
-
status: "ok",
|
|
229
|
-
redirectURL: payload.url
|
|
230
|
-
};
|
|
231
|
-
}
|
|
232
|
-
function getReferenceIfPossible() {
|
|
233
|
-
if (typeof localStorage == "undefined") {
|
|
234
|
-
return void 0;
|
|
235
|
-
}
|
|
236
|
-
const refLink = localStorage.getItem("bitsnap-ref");
|
|
237
|
-
if (refLink == null) {
|
|
238
|
-
return void 0;
|
|
239
|
-
}
|
|
240
|
-
return refLink;
|
|
241
|
-
}
|
|
242
|
-
function injectReferenceToRequestIfNeeded(request) {
|
|
243
|
-
const ref = getReferenceIfPossible();
|
|
244
|
-
if (ref == null) {
|
|
245
|
-
return request;
|
|
246
|
-
}
|
|
247
|
-
if (request.metadata == null) {
|
|
248
|
-
request.metadata = {};
|
|
249
|
-
}
|
|
250
|
-
request.metadata["ref"] = ref;
|
|
251
|
-
return request;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
// src/components/checkout/google.pay.mapper.ts
|
|
255
|
-
function mapGooglePayConfiguration(args) {
|
|
256
|
-
var _a;
|
|
257
|
-
const { items, googlePayConfig, checkout, result, cartRequiresShipping } = args;
|
|
258
|
-
if (result.totalAmount == null) {
|
|
259
|
-
return void 0;
|
|
260
|
-
}
|
|
261
|
-
let intents = [];
|
|
262
|
-
if (cartRequiresShipping) {
|
|
263
|
-
intents.push("SHIPPING_ADDRESS");
|
|
264
|
-
intents.push("SHIPPING_OPTION");
|
|
265
|
-
}
|
|
266
|
-
const returnValue = {
|
|
267
|
-
apiVersion: 2,
|
|
268
|
-
apiVersionMinor: 0,
|
|
269
|
-
callbackIntents: intents,
|
|
270
|
-
allowedPaymentMethods: [
|
|
271
|
-
{
|
|
272
|
-
type: "CARD",
|
|
273
|
-
parameters: {
|
|
274
|
-
allowedAuthMethods: ["PAN_ONLY", "CRYPTOGRAM_3DS"],
|
|
275
|
-
allowedCardNetworks: ["MASTERCARD", "VISA"]
|
|
276
|
-
},
|
|
277
|
-
tokenizationSpecification: {
|
|
278
|
-
type: "PAYMENT_GATEWAY",
|
|
279
|
-
parameters: {
|
|
280
|
-
gateway: googlePayConfig.gateway,
|
|
281
|
-
gatewayMerchantId: googlePayConfig.gatewayId
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
],
|
|
286
|
-
emailRequired: true,
|
|
287
|
-
shippingAddressParameters: {
|
|
288
|
-
phoneNumberRequired: cartRequiresShipping
|
|
289
|
-
},
|
|
290
|
-
shippingAddressRequired: cartRequiresShipping,
|
|
291
|
-
shippingOptionRequired: cartRequiresShipping,
|
|
292
|
-
shippingOptionParameters: cartRequiresShipping ? {
|
|
293
|
-
shippingOptions: result.methods.slice(0, 5).map((method) => {
|
|
294
|
-
var _a2;
|
|
295
|
-
return {
|
|
296
|
-
id: method.id,
|
|
297
|
-
label: method.name + ` - ${formatCurrency(method.amount, result.currency)}`,
|
|
298
|
-
description: (_a2 = method.description) != null ? _a2 : ""
|
|
299
|
-
};
|
|
300
|
-
}),
|
|
301
|
-
defaultSelectedOptionId: result.selectedDeliveryMethod
|
|
302
|
-
} : void 0,
|
|
303
|
-
merchantInfo: {
|
|
304
|
-
merchantId: googlePayConfig.merchantId + "",
|
|
305
|
-
merchantName: googlePayConfig.merchantName
|
|
306
|
-
},
|
|
307
|
-
transactionInfo: {
|
|
308
|
-
totalPriceStatus: "FINAL",
|
|
309
|
-
totalPriceLabel: "P\u0142atno\u015B\u0107 za koszyk",
|
|
310
|
-
totalPrice: `${round(result.totalAmount / 100, 2)}`,
|
|
311
|
-
currencyCode: result.currency,
|
|
312
|
-
countryCode: result.country,
|
|
313
|
-
checkoutOption: "COMPLETE_IMMEDIATE_PURCHASE",
|
|
314
|
-
displayItems: mapGooglePayDisplayItems(items, result.methods, (_a = result.selectedDeliveryMethod) != null ? _a : result.methods.length > 0 ? result.methods[0].id : void 0, checkout.couponCode, result.couponValue)
|
|
315
|
-
}
|
|
316
|
-
};
|
|
317
|
-
console.log("returnValue", returnValue);
|
|
318
|
-
return returnValue;
|
|
319
|
-
}
|
|
320
|
-
function mapGooglePayDisplayItems(items, methods, deliveryMethod, couponCode, couponValue) {
|
|
321
|
-
const displayItems = [];
|
|
322
|
-
let subtotalAmount = 0;
|
|
323
|
-
for (const item of items) {
|
|
324
|
-
if (item.details == null) {
|
|
325
|
-
continue;
|
|
326
|
-
}
|
|
327
|
-
subtotalAmount += item.details.price * item.quantity;
|
|
328
|
-
displayItems.push({
|
|
329
|
-
label: item.details.name + " x " + item.quantity,
|
|
330
|
-
price: `${round(item.details.price / 100, 2)}`,
|
|
331
|
-
type: "LINE_ITEM",
|
|
332
|
-
status: "FINAL"
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
const selectedDeliveryMethod = methods.find((method) => method.id === deliveryMethod);
|
|
336
|
-
if (selectedDeliveryMethod != null) {
|
|
337
|
-
displayItems.push({
|
|
338
|
-
label: selectedDeliveryMethod.name,
|
|
339
|
-
price: `${round(selectedDeliveryMethod.amount / 100, 2)}`,
|
|
340
|
-
type: "SHIPPING_OPTION",
|
|
341
|
-
status: "FINAL"
|
|
342
|
-
});
|
|
343
|
-
}
|
|
344
|
-
if (couponCode != null && couponValue != null) {
|
|
345
|
-
displayItems.push({
|
|
346
|
-
label: `Kupon ${couponCode}`,
|
|
347
|
-
price: `${round(couponValue / 100, 2)}`,
|
|
348
|
-
type: "DISCOUNT",
|
|
349
|
-
status: "FINAL"
|
|
350
|
-
});
|
|
351
|
-
}
|
|
352
|
-
if (subtotalAmount > 0) {
|
|
353
|
-
displayItems.push({
|
|
354
|
-
label: "Subtotal",
|
|
355
|
-
price: `${round(subtotalAmount / 100, 2)}`,
|
|
356
|
-
type: "SUBTOTAL",
|
|
357
|
-
status: "FINAL"
|
|
358
|
-
});
|
|
359
|
-
}
|
|
360
|
-
return displayItems;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
// src/components/checkout/CartProvider.tsx
|
|
364
|
-
var import_react_query = require("@tanstack/react-query");
|
|
365
|
-
|
|
366
|
-
// src/components/checkout/frontent.analytics.ts
|
|
367
|
-
var import_zod = __toESM(require("zod"));
|
|
368
|
-
var eventPayload = import_zod.default.object({
|
|
369
|
-
event: import_zod.default.enum([
|
|
370
|
-
"purchase",
|
|
371
|
-
"addToCart",
|
|
372
|
-
"customizeProduct",
|
|
373
|
-
"viewCart",
|
|
374
|
-
"removeFromCart",
|
|
375
|
-
"initiateCheckout"
|
|
376
|
-
]),
|
|
377
|
-
step: import_zod.default.string().optional(),
|
|
378
|
-
value: import_zod.default.number().optional(),
|
|
379
|
-
currency: import_zod.default.string().optional(),
|
|
380
|
-
content_name: import_zod.default.string().optional(),
|
|
381
|
-
items: import_zod.default.array(
|
|
382
|
-
import_zod.default.object({
|
|
383
|
-
id: import_zod.default.string(),
|
|
384
|
-
name: import_zod.default.string(),
|
|
385
|
-
price: import_zod.default.number().default(0),
|
|
386
|
-
currency: import_zod.default.string().default("PLN"),
|
|
387
|
-
quantity: import_zod.default.number().default(1)
|
|
388
|
-
})
|
|
389
|
-
).optional()
|
|
390
|
-
});
|
|
391
|
-
function sendAnalyticEvent(payload) {
|
|
392
|
-
if (typeof window == "undefined") {
|
|
393
|
-
return;
|
|
394
|
-
}
|
|
395
|
-
sendGoogleAnalyticsEvent(payload);
|
|
396
|
-
sendPixelAnalyticsEvent(payload);
|
|
397
|
-
}
|
|
398
|
-
function sendGoogleAnalyticsEvent(payload) {
|
|
399
|
-
try {
|
|
400
|
-
if (typeof window.dataLayer == "undefined") {
|
|
401
|
-
window.dataLayer = [];
|
|
402
|
-
}
|
|
403
|
-
window.dataLayer.push(payload);
|
|
404
|
-
} catch (e) {
|
|
405
|
-
console.warn("cannot send google analytics event", e);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
function sendPixelAnalyticsEvent(payload) {
|
|
409
|
-
if (typeof window.fbq == "undefined") {
|
|
410
|
-
return;
|
|
411
|
-
}
|
|
412
|
-
let eventType = "";
|
|
413
|
-
let eventName = "";
|
|
414
|
-
let eventPayload2 = {};
|
|
415
|
-
switch (payload.event) {
|
|
416
|
-
case "purchase":
|
|
417
|
-
eventType = "track";
|
|
418
|
-
eventName = "Purchase";
|
|
419
|
-
eventPayload2 = {
|
|
420
|
-
category_name: payload.step,
|
|
421
|
-
...payload
|
|
422
|
-
};
|
|
423
|
-
break;
|
|
424
|
-
case "addToCart":
|
|
425
|
-
eventType = "track";
|
|
426
|
-
eventName = "Add to Cart";
|
|
427
|
-
eventPayload2 = {
|
|
428
|
-
category_name: payload.step,
|
|
429
|
-
...payload
|
|
430
|
-
};
|
|
431
|
-
break;
|
|
432
|
-
case "customizeProduct":
|
|
433
|
-
eventType = "track";
|
|
434
|
-
eventName = "Customize Product";
|
|
435
|
-
eventPayload2 = {
|
|
436
|
-
category_name: payload.step,
|
|
437
|
-
...payload
|
|
438
|
-
};
|
|
439
|
-
break;
|
|
440
|
-
case "viewCart":
|
|
441
|
-
eventType = "track";
|
|
442
|
-
eventName = "View Cart";
|
|
443
|
-
eventPayload2 = {
|
|
444
|
-
category_name: payload.step,
|
|
445
|
-
...payload
|
|
446
|
-
};
|
|
447
|
-
break;
|
|
448
|
-
case "removeFromCart":
|
|
449
|
-
eventType = "track";
|
|
450
|
-
eventName = "Remove from Cart";
|
|
451
|
-
eventPayload2 = {
|
|
452
|
-
category_name: payload.step,
|
|
453
|
-
...payload
|
|
454
|
-
};
|
|
455
|
-
break;
|
|
456
|
-
case "initiateCheckout":
|
|
457
|
-
eventType = "track";
|
|
458
|
-
eventName = "Initiate Checkout";
|
|
459
|
-
eventPayload2 = {
|
|
460
|
-
category_name: payload.step,
|
|
461
|
-
...payload
|
|
462
|
-
};
|
|
463
|
-
break;
|
|
464
|
-
default:
|
|
465
|
-
break;
|
|
466
|
-
}
|
|
467
|
-
if (window.location.search.includes("analytics")) {
|
|
468
|
-
console.log("Pushing FB event", eventType, eventName, eventPayload2);
|
|
469
|
-
}
|
|
470
|
-
window.fbq(eventType, eventName, eventPayload2);
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
// src/components/checkout/CartProvider.tsx
|
|
474
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
475
|
-
var MARKETING_AGREEMENT_ID = "__m_a";
|
|
476
|
-
var CartProviderContext = (0, import_react.createContext)(void 0);
|
|
477
|
-
var bitsnapProjectID = void 0;
|
|
478
|
-
function setProjectID(projectID) {
|
|
479
|
-
bitsnapProjectID = projectID;
|
|
480
|
-
}
|
|
481
|
-
function getProjectID() {
|
|
482
|
-
if (bitsnapProjectID != null) {
|
|
483
|
-
return bitsnapProjectID;
|
|
484
|
-
}
|
|
485
|
-
const me = document.querySelector(
|
|
486
|
-
'script[data-id][data-name="internal-cart"]'
|
|
487
|
-
);
|
|
488
|
-
const projectID = me == null ? void 0 : me.getAttribute("data-id");
|
|
489
|
-
return projectID != null ? projectID : void 0;
|
|
490
|
-
}
|
|
491
|
-
function getNewHostIfExist() {
|
|
492
|
-
const me = document.querySelector(
|
|
493
|
-
'script[data-id][data-name="internal-cart"]'
|
|
494
|
-
);
|
|
495
|
-
const customHost = me == null ? void 0 : me.getAttribute("data-custom-host");
|
|
496
|
-
return customHost != null ? customHost : void 0;
|
|
497
|
-
}
|
|
498
|
-
var CartProvider = ({ children }) => {
|
|
499
|
-
const queryClient = new import_react_query.QueryClient();
|
|
500
|
-
(0, import_react.useEffect)(() => {
|
|
501
|
-
updateNumberOfProductsInCart();
|
|
502
|
-
}, []);
|
|
503
|
-
const projectID = getProjectID();
|
|
504
|
-
if (projectID == null) {
|
|
505
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {});
|
|
506
|
-
}
|
|
507
|
-
const checkoutMethods = getCheckoutMethods(projectID);
|
|
508
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_query.QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CartProviderContext.Provider, { value: checkoutMethods, children }) });
|
|
509
|
-
};
|
|
510
|
-
var getProducts = async (projectID) => {
|
|
511
|
-
var _a, _b;
|
|
512
|
-
const products = (_b = (_a = getCheckout()) == null ? void 0 : _a.products) != null ? _b : [];
|
|
513
|
-
const productIds = Array.from(
|
|
514
|
-
new Set(products.map((product) => product.productID))
|
|
515
|
-
);
|
|
516
|
-
const params = new URLSearchParams();
|
|
517
|
-
params.set("ids", productIds.join(","));
|
|
518
|
-
const result = await fetch(
|
|
519
|
-
buildURL(projectID, `/products?${params.toString()}`),
|
|
520
|
-
{
|
|
521
|
-
method: "GET"
|
|
522
|
-
}
|
|
523
|
-
);
|
|
524
|
-
if (result.status != 200) {
|
|
525
|
-
return [];
|
|
526
|
-
}
|
|
527
|
-
const payload = await result.json();
|
|
528
|
-
products.forEach((product) => {
|
|
529
|
-
var _a2;
|
|
530
|
-
product["details"] = (_a2 = payload.result) == null ? void 0 : _a2.find((el) => {
|
|
531
|
-
if (el.id === product.productID) {
|
|
532
|
-
return true;
|
|
533
|
-
}
|
|
534
|
-
if (el.variants != null && el.variants.length > 0) {
|
|
535
|
-
const index = el.variants.findIndex(
|
|
536
|
-
(variant) => variant.id === product.productID
|
|
537
|
-
);
|
|
538
|
-
return index !== -1;
|
|
539
|
-
}
|
|
540
|
-
return false;
|
|
541
|
-
});
|
|
542
|
-
});
|
|
543
|
-
return products.filter((el) => "details" in el).map((el) => {
|
|
544
|
-
el.details = resolveProductDetailsFromSingleProduct(
|
|
545
|
-
el.productID,
|
|
546
|
-
el.details
|
|
547
|
-
);
|
|
548
|
-
return el;
|
|
549
|
-
});
|
|
550
|
-
};
|
|
551
|
-
var useCartProvider = () => {
|
|
552
|
-
const context = (0, import_react.useContext)(CartProviderContext);
|
|
553
|
-
if (context === void 0) {
|
|
554
|
-
throw new Error("useCartProvider must be used within a CartProvider");
|
|
555
|
-
}
|
|
556
|
-
return context;
|
|
557
|
-
};
|
|
558
|
-
var CartProvider_default = CartProvider;
|
|
559
|
-
var googlePayConfigSchema = import_zod2.default.object({
|
|
560
|
-
isAvailable: import_zod2.default.boolean(),
|
|
561
|
-
merchantId: import_zod2.default.string(),
|
|
562
|
-
merchantName: import_zod2.default.string(),
|
|
563
|
-
gateway: import_zod2.default.string(),
|
|
564
|
-
gatewayId: import_zod2.default.string()
|
|
565
|
-
});
|
|
566
|
-
var checkoutSchema = import_zod2.default.object({
|
|
567
|
-
country: import_zod2.default.string().optional(),
|
|
568
|
-
couponCode: import_zod2.default.string().optional(),
|
|
569
|
-
selectedDeliveryMethod: import_zod2.default.string().optional(),
|
|
570
|
-
postalCode: import_zod2.default.string().optional(),
|
|
571
|
-
email: import_zod2.default.string().optional(),
|
|
572
|
-
products: import_zod2.default.array(
|
|
573
|
-
import_zod2.default.object({
|
|
574
|
-
id: import_zod2.default.string(),
|
|
575
|
-
productID: import_zod2.default.string(),
|
|
576
|
-
quantity: import_zod2.default.number(),
|
|
577
|
-
metadata: import_zod2.default.record(import_zod2.default.string(), import_zod2.default.string().optional()).optional()
|
|
578
|
-
})
|
|
579
|
-
).optional(),
|
|
580
|
-
googlePayConfig: googlePayConfigSchema.optional()
|
|
581
|
-
});
|
|
582
|
-
var emptyCheckout = {
|
|
583
|
-
country: void 0,
|
|
584
|
-
couponCode: void 0,
|
|
585
|
-
email: void 0,
|
|
586
|
-
selectedDeliveryMethod: void 0,
|
|
587
|
-
postalCode: void 0,
|
|
588
|
-
products: [],
|
|
589
|
-
googlePayConfig: void 0
|
|
590
|
-
};
|
|
591
|
-
var checkoutKey = "checkout";
|
|
592
|
-
function getCheckout() {
|
|
593
|
-
try {
|
|
594
|
-
const value = localStorage.getItem(checkoutKey);
|
|
595
|
-
if (value == null) {
|
|
596
|
-
return emptyCheckout;
|
|
597
|
-
}
|
|
598
|
-
return checkoutSchema.parse(JSON.parse(value));
|
|
599
|
-
} catch (e) {
|
|
600
|
-
return emptyCheckout;
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
function addProducts(products) {
|
|
604
|
-
const checkout = getCheckout();
|
|
605
|
-
if (checkout.products == null) {
|
|
606
|
-
checkout.products = [];
|
|
607
|
-
}
|
|
608
|
-
checkout.products.push(
|
|
609
|
-
...products.map((el) => ({
|
|
610
|
-
id: Math.random().toString(36).substring(7),
|
|
611
|
-
productID: el.productID,
|
|
612
|
-
quantity: el.quantity,
|
|
613
|
-
metadata: el.metadata
|
|
614
|
-
}))
|
|
615
|
-
);
|
|
616
|
-
sendAnalyticEvent({
|
|
617
|
-
event: "addToCart",
|
|
618
|
-
currency: "PLN",
|
|
619
|
-
items: products.map((el) => ({
|
|
620
|
-
id: el.productID,
|
|
621
|
-
name: "",
|
|
622
|
-
price: 0,
|
|
623
|
-
quantity: el.quantity,
|
|
624
|
-
currency: "PLN"
|
|
625
|
-
}))
|
|
626
|
-
});
|
|
627
|
-
saveCheckout(checkout);
|
|
628
|
-
updateNumberOfProductsInCart();
|
|
629
|
-
}
|
|
630
|
-
function removeProductFromCheckout(ids) {
|
|
631
|
-
var _a;
|
|
632
|
-
const checkout = getCheckout();
|
|
633
|
-
const newCheckout = {
|
|
634
|
-
...checkout,
|
|
635
|
-
products: (_a = checkout == null ? void 0 : checkout.products) == null ? void 0 : _a.filter(
|
|
636
|
-
(product) => !ids.includes(product.productID) && !ids.includes(product.id)
|
|
637
|
-
)
|
|
638
|
-
};
|
|
639
|
-
sendAnalyticEvent({
|
|
640
|
-
event: "removeFromCart",
|
|
641
|
-
items: ids.map((id) => ({
|
|
642
|
-
id,
|
|
643
|
-
name: "",
|
|
644
|
-
price: 0,
|
|
645
|
-
quantity: 1,
|
|
646
|
-
currency: "PLN"
|
|
647
|
-
}))
|
|
648
|
-
});
|
|
649
|
-
saveCheckout(newCheckout);
|
|
650
|
-
updateNumberOfProductsInCart();
|
|
651
|
-
}
|
|
652
|
-
function saveCheckout(model) {
|
|
653
|
-
localStorage.setItem(checkoutKey, JSON.stringify(model));
|
|
654
|
-
}
|
|
655
|
-
var getCheckoutMethods = (projectID) => {
|
|
656
|
-
const newHost = getNewHostIfExist();
|
|
657
|
-
if (newHost != null) {
|
|
658
|
-
setCustomHost(newHost);
|
|
659
|
-
}
|
|
660
|
-
return {
|
|
661
|
-
async checkIfApplePayIsAvailable() {
|
|
662
|
-
if (typeof window == "undefined" || typeof document == "undefined") {
|
|
663
|
-
return false;
|
|
664
|
-
}
|
|
665
|
-
if ("ApplePaySession" in window === false) {
|
|
666
|
-
return false;
|
|
667
|
-
}
|
|
668
|
-
try {
|
|
669
|
-
const result = await PublicApiClient.get(
|
|
670
|
-
HOST
|
|
671
|
-
).isOneClickPaymentAvailable({
|
|
672
|
-
projectId: projectID
|
|
673
|
-
});
|
|
674
|
-
return result.applePay;
|
|
675
|
-
} catch (e) {
|
|
676
|
-
console.error("Error checking if Apple Pay is available", e);
|
|
677
|
-
return false;
|
|
678
|
-
}
|
|
679
|
-
},
|
|
680
|
-
async getGooglePayConfiguration(args) {
|
|
681
|
-
if (typeof window == "undefined" || typeof document == "undefined") {
|
|
682
|
-
return {
|
|
683
|
-
isAvailable: false
|
|
684
|
-
};
|
|
685
|
-
}
|
|
686
|
-
try {
|
|
687
|
-
const googlePayConfig = await resolveGooglePayConfiguration(projectID);
|
|
688
|
-
if ((googlePayConfig == null ? void 0 : googlePayConfig.isAvailable) != true) {
|
|
689
|
-
return {
|
|
690
|
-
isAvailable: false
|
|
691
|
-
};
|
|
692
|
-
}
|
|
693
|
-
const checkout = getCheckout();
|
|
694
|
-
if (checkout == null) {
|
|
695
|
-
console.log("checkout is null");
|
|
696
|
-
return {
|
|
697
|
-
isAvailable: false
|
|
698
|
-
};
|
|
699
|
-
}
|
|
700
|
-
if (args && args.items != null && args.items.length > 0) {
|
|
701
|
-
if (checkout.products) {
|
|
702
|
-
removeProductFromCheckout(
|
|
703
|
-
checkout.products.map((el) => el.productID)
|
|
704
|
-
);
|
|
705
|
-
}
|
|
706
|
-
addProducts(args.items);
|
|
707
|
-
}
|
|
708
|
-
const products = await getProducts(projectID);
|
|
709
|
-
if (isErr(products)) {
|
|
710
|
-
return {
|
|
711
|
-
isAvailable: false
|
|
712
|
-
};
|
|
713
|
-
}
|
|
714
|
-
const result = await PublicApiClient.get(HOST).getPreOrderDetails({
|
|
715
|
-
items: products.map(
|
|
716
|
-
(el) => (0, import_protobuf.create)(PreOrderItemSchema, {
|
|
717
|
-
id: el.productID,
|
|
718
|
-
quantity: el.quantity
|
|
719
|
-
})
|
|
720
|
-
),
|
|
721
|
-
projectId: projectID,
|
|
722
|
-
// we can detect 5 the closest inpost pickup point based on shipping address.
|
|
723
|
-
postCode: checkout.postalCode,
|
|
724
|
-
couponCode: checkout.couponCode,
|
|
725
|
-
countryCode: checkout.country,
|
|
726
|
-
selectedDeliveryMethod: checkout.selectedDeliveryMethod
|
|
727
|
-
});
|
|
728
|
-
if (result.totalAmount == null) {
|
|
729
|
-
return {
|
|
730
|
-
isAvailable: false
|
|
731
|
-
};
|
|
732
|
-
}
|
|
733
|
-
const cartRequiresShipping = products.find((el) => {
|
|
734
|
-
var _a;
|
|
735
|
-
return ((_a = el.details) == null ? void 0 : _a.isDeliverable) == true;
|
|
736
|
-
}) != null;
|
|
737
|
-
const mappedPaymentRequest = await mapGooglePayConfiguration({
|
|
738
|
-
items: products,
|
|
739
|
-
googlePayConfig,
|
|
740
|
-
checkout,
|
|
741
|
-
cartRequiresShipping,
|
|
742
|
-
result
|
|
743
|
-
});
|
|
744
|
-
if (mappedPaymentRequest == null) {
|
|
745
|
-
return {
|
|
746
|
-
isAvailable: false
|
|
747
|
-
};
|
|
748
|
-
}
|
|
749
|
-
return {
|
|
750
|
-
isAvailable: true,
|
|
751
|
-
config: mappedPaymentRequest
|
|
752
|
-
};
|
|
753
|
-
} catch (e) {
|
|
754
|
-
console.error("Error resolving Google Pay configuration", e);
|
|
755
|
-
return {
|
|
756
|
-
isAvailable: false
|
|
757
|
-
};
|
|
758
|
-
}
|
|
759
|
-
},
|
|
760
|
-
async clearCart() {
|
|
761
|
-
var _a;
|
|
762
|
-
const empty = structuredClone(emptyCheckout);
|
|
763
|
-
empty.country = (_a = getCheckout()) == null ? void 0 : _a.country;
|
|
764
|
-
saveCheckout(empty);
|
|
765
|
-
updateNumberOfProductsInCart();
|
|
766
|
-
},
|
|
767
|
-
async getAvailableCountries() {
|
|
768
|
-
const result = await fetch(buildURL(projectID, "/countries"), {
|
|
769
|
-
method: "GET"
|
|
770
|
-
});
|
|
771
|
-
if (result.status != 200) {
|
|
772
|
-
return [];
|
|
773
|
-
}
|
|
774
|
-
try {
|
|
775
|
-
return import_zod2.default.array(
|
|
776
|
-
import_zod2.default.object({
|
|
777
|
-
name: import_zod2.default.string(),
|
|
778
|
-
code: import_zod2.default.string()
|
|
779
|
-
})
|
|
780
|
-
).parse(await result.json());
|
|
781
|
-
} catch (e) {
|
|
782
|
-
return Err(e.toString(), "internal");
|
|
783
|
-
}
|
|
784
|
-
},
|
|
785
|
-
async getCountry() {
|
|
786
|
-
var _a;
|
|
787
|
-
let country = (_a = getCheckout()) == null ? void 0 : _a.country;
|
|
788
|
-
if (country == null) {
|
|
789
|
-
country = "PL";
|
|
790
|
-
const checkout = getCheckout();
|
|
791
|
-
checkout.country = country;
|
|
792
|
-
saveCheckout(checkout);
|
|
793
|
-
}
|
|
794
|
-
return country;
|
|
795
|
-
},
|
|
796
|
-
async getNumberOfElementsInCart() {
|
|
797
|
-
var _a, _b, _c;
|
|
798
|
-
return (_c = (_b = (_a = getCheckout()) == null ? void 0 : _a.products) == null ? void 0 : _b.reduce(
|
|
799
|
-
(acc, product) => acc + product.quantity,
|
|
800
|
-
0
|
|
801
|
-
)) != null ? _c : 0;
|
|
802
|
-
},
|
|
803
|
-
async getProducts() {
|
|
804
|
-
return await getProducts(projectID);
|
|
805
|
-
},
|
|
806
|
-
async removeProductFromCart(args) {
|
|
807
|
-
return removeProductFromCheckout([args.id]);
|
|
808
|
-
},
|
|
809
|
-
async setCountry(country) {
|
|
810
|
-
const checkout = getCheckout();
|
|
811
|
-
checkout.country = country;
|
|
812
|
-
saveCheckout(checkout);
|
|
813
|
-
},
|
|
814
|
-
async setCouponCodeIfPossible(couponCode) {
|
|
815
|
-
const checkout = getCheckout();
|
|
816
|
-
checkout.couponCode = couponCode;
|
|
817
|
-
saveCheckout(checkout);
|
|
818
|
-
},
|
|
819
|
-
async setPostalCode(postalCode) {
|
|
820
|
-
const checkout = getCheckout();
|
|
821
|
-
checkout.postalCode = postalCode;
|
|
822
|
-
saveCheckout(checkout);
|
|
823
|
-
},
|
|
824
|
-
async setDeliveryMethod(deliveryMethod) {
|
|
825
|
-
const checkout = getCheckout();
|
|
826
|
-
checkout.selectedDeliveryMethod = deliveryMethod;
|
|
827
|
-
saveCheckout(checkout);
|
|
828
|
-
},
|
|
829
|
-
async setEmail(email) {
|
|
830
|
-
const checkout = getCheckout();
|
|
831
|
-
checkout.email = email;
|
|
832
|
-
saveCheckout(checkout);
|
|
833
|
-
},
|
|
834
|
-
async addProduct(args) {
|
|
835
|
-
return addProducts([args]);
|
|
836
|
-
},
|
|
837
|
-
async updateQuantity(args) {
|
|
838
|
-
var _a;
|
|
839
|
-
const checkout = getCheckout();
|
|
840
|
-
checkout.products = (_a = checkout.products) == null ? void 0 : _a.map((product) => {
|
|
841
|
-
if (product.id === args.id) {
|
|
842
|
-
product.quantity = args.quantity;
|
|
843
|
-
}
|
|
844
|
-
return product;
|
|
845
|
-
});
|
|
846
|
-
saveCheckout(checkout);
|
|
847
|
-
updateNumberOfProductsInCart();
|
|
848
|
-
},
|
|
849
|
-
async redirectToNextStep() {
|
|
850
|
-
const checkout = getCheckout();
|
|
851
|
-
if (checkout.products == null || checkout.products.length == 0) {
|
|
852
|
-
return Err("cart-is-empty", "badInput");
|
|
853
|
-
}
|
|
854
|
-
const mergedMetadata = checkout.products.reduce((acc, product) => {
|
|
855
|
-
if (product.metadata != null) {
|
|
856
|
-
Object.keys(product.metadata).forEach((key) => {
|
|
857
|
-
var _a;
|
|
858
|
-
const value = (_a = product.metadata) == null ? void 0 : _a[key];
|
|
859
|
-
if (value != null) {
|
|
860
|
-
acc[key] = value;
|
|
861
|
-
}
|
|
862
|
-
});
|
|
863
|
-
}
|
|
864
|
-
return acc;
|
|
865
|
-
}, {});
|
|
866
|
-
const payload = {
|
|
867
|
-
items: checkout.products.map((el) => {
|
|
868
|
-
return {
|
|
869
|
-
id: el.productID,
|
|
870
|
-
quantity: el.quantity
|
|
871
|
-
};
|
|
872
|
-
}),
|
|
873
|
-
askForNote: true,
|
|
874
|
-
countries: checkout.country ? [checkout.country] : void 0,
|
|
875
|
-
metadata: mergedMetadata
|
|
876
|
-
};
|
|
877
|
-
const paymentResponse = await createPaymentURL(payload);
|
|
878
|
-
if (isErr(paymentResponse)) {
|
|
879
|
-
console.warn("cannot create payment URL", paymentResponse.error);
|
|
880
|
-
return paymentResponse;
|
|
881
|
-
}
|
|
882
|
-
return {
|
|
883
|
-
url: paymentResponse.url
|
|
884
|
-
};
|
|
885
|
-
},
|
|
886
|
-
async justRedirectToPayment(args) {
|
|
887
|
-
let payload = {
|
|
888
|
-
items: [
|
|
889
|
-
{
|
|
890
|
-
id: args.productID,
|
|
891
|
-
quantity: 1
|
|
892
|
-
}
|
|
893
|
-
],
|
|
894
|
-
askForNote: false,
|
|
895
|
-
details: args.email || args.name ? {
|
|
896
|
-
name: args.name,
|
|
897
|
-
email: args.email
|
|
898
|
-
} : void 0
|
|
899
|
-
};
|
|
900
|
-
payload = injectReferenceToRequestIfNeeded(payload);
|
|
901
|
-
if (args.country == null) {
|
|
902
|
-
args.country = "pl";
|
|
903
|
-
}
|
|
904
|
-
if (payload.details == null) {
|
|
905
|
-
payload.details = {};
|
|
906
|
-
}
|
|
907
|
-
if (payload.details.address == null) {
|
|
908
|
-
payload.details.address = {};
|
|
909
|
-
}
|
|
910
|
-
payload.details.address.country = args.country;
|
|
911
|
-
if (args.marketingAgreement === true) {
|
|
912
|
-
payload.additionalAgreements = [
|
|
913
|
-
{
|
|
914
|
-
id: MARKETING_AGREEMENT_ID,
|
|
915
|
-
name: "",
|
|
916
|
-
required: true,
|
|
917
|
-
answer: true
|
|
918
|
-
}
|
|
919
|
-
];
|
|
920
|
-
}
|
|
921
|
-
const result = await fetch(buildURL(projectID, "/buy"), {
|
|
922
|
-
method: "POST",
|
|
923
|
-
headers: {
|
|
924
|
-
"Content-Type": "application/json"
|
|
925
|
-
},
|
|
926
|
-
body: JSON.stringify(payload)
|
|
927
|
-
});
|
|
928
|
-
console.log("CODE", result.status);
|
|
929
|
-
if (result.status != 200) {
|
|
930
|
-
console.warn(
|
|
931
|
-
"result",
|
|
932
|
-
await result.text(),
|
|
933
|
-
result.status,
|
|
934
|
-
result.statusText
|
|
935
|
-
);
|
|
936
|
-
return Err("internal-error", "internal");
|
|
937
|
-
}
|
|
938
|
-
const response = await result.json();
|
|
939
|
-
console.log(response.url);
|
|
940
|
-
return {
|
|
941
|
-
url: response.url
|
|
942
|
-
};
|
|
943
|
-
},
|
|
944
|
-
async completeApplePayPayment(args) {
|
|
945
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J;
|
|
946
|
-
const checkout = getCheckout();
|
|
947
|
-
if (checkout == null) {
|
|
948
|
-
return Err("Checkout not found");
|
|
949
|
-
}
|
|
950
|
-
const products = await getProducts(projectID);
|
|
951
|
-
if (isErr(products)) {
|
|
952
|
-
return products;
|
|
953
|
-
}
|
|
954
|
-
try {
|
|
955
|
-
let shippingName = (_a = args.shippingContact) == null ? void 0 : _a.givenName;
|
|
956
|
-
if (((_b = args.shippingContact) == null ? void 0 : _b.familyName) != null) {
|
|
957
|
-
shippingName += " " + ((_c = args.shippingContact) == null ? void 0 : _c.familyName);
|
|
958
|
-
} else if (((_d = args.billingContact) == null ? void 0 : _d.familyName) != null) {
|
|
959
|
-
shippingName += " " + ((_e = args.billingContact) == null ? void 0 : _e.familyName);
|
|
960
|
-
}
|
|
961
|
-
let metadata = {};
|
|
962
|
-
const ref = getReferenceIfPossible();
|
|
963
|
-
if (ref != null) {
|
|
964
|
-
metadata["ref"] = ref;
|
|
965
|
-
}
|
|
966
|
-
const result = await PublicApiClient.get(HOST).authorizeOneClickPayment(
|
|
967
|
-
{
|
|
968
|
-
gateway: 0 /* APPLE_PAY */,
|
|
969
|
-
paymentData: JSON.stringify(args.token.paymentData),
|
|
970
|
-
paymentMethod: JSON.stringify(args.token.paymentMethod),
|
|
971
|
-
transactionIdentifier: args.token.transactionIdentifier,
|
|
972
|
-
order: (0, import_protobuf.create)(GetPreOrderDetailsRequestSchema, {
|
|
973
|
-
items: products.map((el) => ({
|
|
974
|
-
id: el.productID,
|
|
975
|
-
quantity: el.quantity
|
|
976
|
-
})),
|
|
977
|
-
couponCode: checkout.couponCode,
|
|
978
|
-
email: (_j = (_i = (_h = (_f = args.shippingContact) == null ? void 0 : _f.emailAddress) != null ? _h : (_g = args.billingContact) == null ? void 0 : _g.emailAddress) != null ? _i : checkout.email) != null ? _j : void 0,
|
|
979
|
-
phone: (_n = (_m = (_k = args.shippingContact) == null ? void 0 : _k.phoneNumber) != null ? _m : (_l = args.billingContact) == null ? void 0 : _l.phoneNumber) != null ? _n : void 0,
|
|
980
|
-
selectedDeliveryMethod: checkout.selectedDeliveryMethod,
|
|
981
|
-
postCode: checkout.postalCode,
|
|
982
|
-
projectId: projectID
|
|
983
|
-
}),
|
|
984
|
-
shippingAddress: (0, import_protobuf.create)(AddressSchema, {
|
|
985
|
-
line1: (_q = (_p = (_o = args.shippingContact) == null ? void 0 : _o.addressLines) == null ? void 0 : _p[0]) != null ? _q : "",
|
|
986
|
-
city: (_s = (_r = args.shippingContact) == null ? void 0 : _r.locality) != null ? _s : "",
|
|
987
|
-
country: (_u = (_t = args.shippingContact) == null ? void 0 : _t.countryCode) != null ? _u : "",
|
|
988
|
-
zipCode: (_w = (_v = args.shippingContact) == null ? void 0 : _v.postalCode) != null ? _w : "",
|
|
989
|
-
name: shippingName
|
|
990
|
-
}),
|
|
991
|
-
billingAddress: (0, import_protobuf.create)(BillingAddressSchema, {
|
|
992
|
-
name: (_A = (_x = args.billingContact) == null ? void 0 : _x.givenName) != null ? _A : " " + ((_z = (_y = args.billingContact) == null ? void 0 : _y.familyName) != null ? _z : ""),
|
|
993
|
-
line1: (_D = (_C = (_B = args.billingContact) == null ? void 0 : _B.addressLines) == null ? void 0 : _C[0]) != null ? _D : "",
|
|
994
|
-
city: (_F = (_E = args.billingContact) == null ? void 0 : _E.locality) != null ? _F : "",
|
|
995
|
-
country: (_H = (_G = args.billingContact) == null ? void 0 : _G.countryCode) != null ? _H : "",
|
|
996
|
-
zipCode: (_J = (_I = args.billingContact) == null ? void 0 : _I.postalCode) != null ? _J : ""
|
|
997
|
-
}),
|
|
998
|
-
metadata: Object.keys(metadata).length > 0 ? JSON.stringify(metadata) : void 0
|
|
999
|
-
}
|
|
1000
|
-
);
|
|
1001
|
-
return {
|
|
1002
|
-
isSuccess: result.isSuccess,
|
|
1003
|
-
redirectURL: result.redirectUrl
|
|
1004
|
-
};
|
|
1005
|
-
} catch (error) {
|
|
1006
|
-
console.error(error);
|
|
1007
|
-
return Err("Failed to authorize payment");
|
|
1008
|
-
}
|
|
1009
|
-
},
|
|
1010
|
-
async completeGooglePayPayment(args) {
|
|
1011
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C;
|
|
1012
|
-
const checkout = getCheckout();
|
|
1013
|
-
if (checkout == null) {
|
|
1014
|
-
return Err("Checkout not found");
|
|
1015
|
-
}
|
|
1016
|
-
const products = await getProducts(projectID);
|
|
1017
|
-
if (isErr(products)) {
|
|
1018
|
-
return products;
|
|
1019
|
-
}
|
|
1020
|
-
try {
|
|
1021
|
-
let shippingName = (_a = args.paymentData.shippingAddress) == null ? void 0 : _a.name;
|
|
1022
|
-
let metadata = {};
|
|
1023
|
-
const ref = getReferenceIfPossible();
|
|
1024
|
-
if (ref != null) {
|
|
1025
|
-
metadata["ref"] = ref;
|
|
1026
|
-
}
|
|
1027
|
-
const result = await PublicApiClient.get(HOST).authorizeOneClickPayment(
|
|
1028
|
-
{
|
|
1029
|
-
gateway: 1 /* GOOGLE_PAY */,
|
|
1030
|
-
paymentData: args.paymentData.paymentMethodData.tokenizationData.token,
|
|
1031
|
-
paymentMethod: args.paymentData.paymentMethodData.type,
|
|
1032
|
-
transactionIdentifier: "",
|
|
1033
|
-
order: (0, import_protobuf.create)(GetPreOrderDetailsRequestSchema, {
|
|
1034
|
-
items: products.map((el) => ({
|
|
1035
|
-
id: el.productID,
|
|
1036
|
-
quantity: el.quantity
|
|
1037
|
-
})),
|
|
1038
|
-
couponCode: checkout.couponCode,
|
|
1039
|
-
email: (_b = args.paymentData.email) != null ? _b : void 0,
|
|
1040
|
-
phone: (_d = (_c = args.paymentData.shippingAddress) == null ? void 0 : _c.phoneNumber) != null ? _d : void 0,
|
|
1041
|
-
selectedDeliveryMethod: (_f = (_e = args.paymentData.shippingOptionData) == null ? void 0 : _e.id) != null ? _f : checkout.selectedDeliveryMethod,
|
|
1042
|
-
postCode: (_g = args.paymentData.shippingAddress) == null ? void 0 : _g.postalCode,
|
|
1043
|
-
projectId: projectID
|
|
1044
|
-
}),
|
|
1045
|
-
shippingAddress: (0, import_protobuf.create)(AddressSchema, {
|
|
1046
|
-
line1: (_i = (_h = args.paymentData.shippingAddress) == null ? void 0 : _h.address1) != null ? _i : "",
|
|
1047
|
-
city: (_k = (_j = args.paymentData.shippingAddress) == null ? void 0 : _j.locality) != null ? _k : "",
|
|
1048
|
-
country: (_m = (_l = args.paymentData.shippingAddress) == null ? void 0 : _l.countryCode) != null ? _m : "",
|
|
1049
|
-
zipCode: (_o = (_n = args.paymentData.shippingAddress) == null ? void 0 : _n.postalCode) != null ? _o : "",
|
|
1050
|
-
name: shippingName
|
|
1051
|
-
}),
|
|
1052
|
-
billingAddress: (0, import_protobuf.create)(BillingAddressSchema, {
|
|
1053
|
-
name: (_q = (_p = args.paymentData.paymentMethodData.info) == null ? void 0 : _p.billingAddress) == null ? void 0 : _q.name,
|
|
1054
|
-
line1: (_t = (_s = (_r = args.paymentData.paymentMethodData.info) == null ? void 0 : _r.billingAddress) == null ? void 0 : _s.address1) != null ? _t : "",
|
|
1055
|
-
city: (_w = (_v = (_u = args.paymentData.paymentMethodData.info) == null ? void 0 : _u.billingAddress) == null ? void 0 : _v.locality) != null ? _w : "",
|
|
1056
|
-
country: (_z = (_y = (_x = args.paymentData.paymentMethodData.info) == null ? void 0 : _x.billingAddress) == null ? void 0 : _y.countryCode) != null ? _z : "",
|
|
1057
|
-
zipCode: (_C = (_B = (_A = args.paymentData.paymentMethodData.info) == null ? void 0 : _A.billingAddress) == null ? void 0 : _B.postalCode) != null ? _C : ""
|
|
1058
|
-
}),
|
|
1059
|
-
metadata: Object.keys(metadata).length > 0 ? JSON.stringify(metadata) : void 0
|
|
1060
|
-
}
|
|
1061
|
-
);
|
|
1062
|
-
return {
|
|
1063
|
-
isSuccess: result.isSuccess,
|
|
1064
|
-
redirectURL: result.redirectUrl
|
|
1065
|
-
};
|
|
1066
|
-
} catch (error) {
|
|
1067
|
-
console.error(error);
|
|
1068
|
-
return Err("Failed to authorize payment");
|
|
1069
|
-
}
|
|
1070
|
-
return {
|
|
1071
|
-
isSuccess: true
|
|
1072
|
-
};
|
|
1073
|
-
},
|
|
1074
|
-
async getApplePayPaymentRequest(args) {
|
|
1075
|
-
var _a, _b;
|
|
1076
|
-
const checkout = getCheckout();
|
|
1077
|
-
if (checkout == null) {
|
|
1078
|
-
return Err("Checkout not found");
|
|
1079
|
-
}
|
|
1080
|
-
if (args && args.expectedItems != null && args.expectedItems.length > 0) {
|
|
1081
|
-
if (checkout.products) {
|
|
1082
|
-
removeProductFromCheckout(
|
|
1083
|
-
checkout.products.map((el) => el.productID)
|
|
1084
|
-
);
|
|
1085
|
-
}
|
|
1086
|
-
addProducts(args.expectedItems);
|
|
1087
|
-
}
|
|
1088
|
-
const products = await getProducts(projectID);
|
|
1089
|
-
if (isErr(products)) {
|
|
1090
|
-
return products;
|
|
1091
|
-
}
|
|
1092
|
-
const result = await PublicApiClient.get(HOST).getPreOrderDetails({
|
|
1093
|
-
items: products.map(
|
|
1094
|
-
(el) => (0, import_protobuf.create)(PreOrderItemSchema, {
|
|
1095
|
-
id: el.productID,
|
|
1096
|
-
quantity: el.quantity
|
|
1097
|
-
})
|
|
1098
|
-
),
|
|
1099
|
-
projectId: projectID,
|
|
1100
|
-
// we can detect 5 the closest inpost pickup point based on shipping address.
|
|
1101
|
-
postCode: checkout.postalCode,
|
|
1102
|
-
couponCode: checkout.couponCode,
|
|
1103
|
-
countryCode: checkout.country,
|
|
1104
|
-
selectedDeliveryMethod: checkout.selectedDeliveryMethod
|
|
1105
|
-
});
|
|
1106
|
-
const items = products.map((el) => {
|
|
1107
|
-
var _a2, _b2, _c;
|
|
1108
|
-
return {
|
|
1109
|
-
amount: `${round(el.quantity * ((_b2 = (_a2 = el.details) == null ? void 0 : _a2.price) != null ? _b2 : 0) / 100, 2)}`,
|
|
1110
|
-
label: ((_c = el.details) == null ? void 0 : _c.name) + " - " + el.quantity,
|
|
1111
|
-
type: "final"
|
|
1112
|
-
};
|
|
1113
|
-
});
|
|
1114
|
-
if (result.selectedDeliveryMethod != null) {
|
|
1115
|
-
const deliveryMethod = result.methods.find(
|
|
1116
|
-
(el) => el.id == result.selectedDeliveryMethod
|
|
1117
|
-
);
|
|
1118
|
-
if (deliveryMethod != null) {
|
|
1119
|
-
items.push({
|
|
1120
|
-
amount: `${round(deliveryMethod.amount / 100, 2)}`,
|
|
1121
|
-
label: deliveryMethod.name,
|
|
1122
|
-
type: "final"
|
|
1123
|
-
});
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
if (result.couponCode != null && result.couponValue != null) {
|
|
1127
|
-
items.push({
|
|
1128
|
-
amount: `-${round(result.couponValue / 100, 2)}`,
|
|
1129
|
-
label: result.couponCode,
|
|
1130
|
-
type: "final"
|
|
1131
|
-
});
|
|
1132
|
-
}
|
|
1133
|
-
return {
|
|
1134
|
-
countryCode: (_a = checkout.country) != null ? _a : "PL",
|
|
1135
|
-
merchantCapabilities: [
|
|
1136
|
-
"supports3DS",
|
|
1137
|
-
"supportsCredit",
|
|
1138
|
-
"supportsDebit"
|
|
1139
|
-
],
|
|
1140
|
-
supportedNetworks: ["visa", "masterCard"],
|
|
1141
|
-
total: {
|
|
1142
|
-
amount: `${round(((_b = result.totalAmount) != null ? _b : 0) / 100, 2)}`,
|
|
1143
|
-
label: "P\u0142atno\u015B\u0107 za koszyk",
|
|
1144
|
-
type: "final"
|
|
1145
|
-
},
|
|
1146
|
-
shippingMethods: result.methods.map((el) => {
|
|
1147
|
-
var _a2, _b2, _c;
|
|
1148
|
-
return {
|
|
1149
|
-
amount: `${round(el.amount / 100, 2)}`,
|
|
1150
|
-
detail: (_a2 = el.description) != null ? _a2 : "",
|
|
1151
|
-
identifier: el.id,
|
|
1152
|
-
label: el.name,
|
|
1153
|
-
dateComponentsRange: {
|
|
1154
|
-
startDateComponents: {
|
|
1155
|
-
days: (_b2 = el.minDays) != null ? _b2 : 1,
|
|
1156
|
-
hours: 0,
|
|
1157
|
-
months: 0,
|
|
1158
|
-
years: 0
|
|
1159
|
-
},
|
|
1160
|
-
endDateComponents: {
|
|
1161
|
-
days: (_c = el.maxDays) != null ? _c : 14,
|
|
1162
|
-
hours: 0,
|
|
1163
|
-
months: 0,
|
|
1164
|
-
years: 0
|
|
1165
|
-
}
|
|
1166
|
-
}
|
|
1167
|
-
};
|
|
1168
|
-
}),
|
|
1169
|
-
lineItems: items,
|
|
1170
|
-
currencyCode: "PLN"
|
|
1171
|
-
};
|
|
1172
|
-
}
|
|
1173
|
-
};
|
|
1174
|
-
};
|
|
1175
|
-
async function resolveGooglePayConfiguration(projectID) {
|
|
1176
|
-
var _a;
|
|
1177
|
-
const checkout = getCheckout();
|
|
1178
|
-
if (((_a = checkout.googlePayConfig) == null ? void 0 : _a.isAvailable) != true) {
|
|
1179
|
-
const result = await PublicApiClient.get(HOST).isOneClickPaymentAvailable({
|
|
1180
|
-
projectId: projectID
|
|
1181
|
-
});
|
|
1182
|
-
if (result.googlePay == true && result.googlePayConfig != null) {
|
|
1183
|
-
checkout.googlePayConfig = {
|
|
1184
|
-
isAvailable: true,
|
|
1185
|
-
gateway: result.googlePayConfig.gateway,
|
|
1186
|
-
gatewayId: result.googlePayConfig.gatewayMerchantId,
|
|
1187
|
-
merchantName: result.googlePayConfig.merchantName,
|
|
1188
|
-
merchantId: result.googlePayConfig.merchantId
|
|
1189
|
-
};
|
|
1190
|
-
} else {
|
|
1191
|
-
checkout.googlePayConfig = {
|
|
1192
|
-
isAvailable: false,
|
|
1193
|
-
gateway: "",
|
|
1194
|
-
gatewayId: "",
|
|
1195
|
-
merchantName: "",
|
|
1196
|
-
merchantId: ""
|
|
1197
|
-
};
|
|
1198
|
-
}
|
|
1199
|
-
}
|
|
1200
|
-
saveCheckout(checkout);
|
|
1201
|
-
return checkout.googlePayConfig;
|
|
1202
|
-
}
|
|
1203
|
-
function resolveProductDetailsFromSingleProduct(id, product) {
|
|
1204
|
-
var _a, _b, _c, _d;
|
|
1205
|
-
if (id == product.id) {
|
|
1206
|
-
const variantIndex = (_a = product.variants) == null ? void 0 : _a.findIndex((v) => v.id === id);
|
|
1207
|
-
if (variantIndex != null && variantIndex != -1) {
|
|
1208
|
-
const variant2 = product.variants[variantIndex];
|
|
1209
|
-
return {
|
|
1210
|
-
...product,
|
|
1211
|
-
availableQuantity: variant2.availableQuantity,
|
|
1212
|
-
isDeliverable: variant2.isDeliverable,
|
|
1213
|
-
images: (_b = variant2.images) != null ? _b : product.images,
|
|
1214
|
-
name: product.name + " " + variant2.name,
|
|
1215
|
-
price: variant2.price,
|
|
1216
|
-
currency: variant2.currency
|
|
1217
|
-
};
|
|
1218
|
-
}
|
|
1219
|
-
return product;
|
|
1220
|
-
}
|
|
1221
|
-
const variant = (_c = product.variants) == null ? void 0 : _c.find((v) => v.id === id);
|
|
1222
|
-
if (variant == null) {
|
|
1223
|
-
return product;
|
|
1224
|
-
}
|
|
1225
|
-
return {
|
|
1226
|
-
...product,
|
|
1227
|
-
id: variant.id,
|
|
1228
|
-
name: product.name + " " + variant.name,
|
|
1229
|
-
price: variant.price,
|
|
1230
|
-
currency: variant.currency,
|
|
1231
|
-
metadata: product.metadata,
|
|
1232
|
-
availableQuantity: variant.availableQuantity,
|
|
1233
|
-
isDeliverable: variant.isDeliverable,
|
|
1234
|
-
images: (_d = variant.images) != null ? _d : product.images
|
|
1235
|
-
};
|
|
1236
|
-
}
|
|
1237
|
-
function updateNumberOfProductsInCart() {
|
|
1238
|
-
var _a, _b;
|
|
1239
|
-
const checkout = getCheckout();
|
|
1240
|
-
let numberOfProductsInCart = 0;
|
|
1241
|
-
if (checkout == null) {
|
|
1242
|
-
useCheckoutStore.setState((state) => ({
|
|
1243
|
-
...state,
|
|
1244
|
-
numberOfProductsInCart
|
|
1245
|
-
}));
|
|
1246
|
-
return;
|
|
1247
|
-
}
|
|
1248
|
-
numberOfProductsInCart = (_b = (_a = checkout.products) == null ? void 0 : _a.reduce((acc, product) => acc + product.quantity, 0)) != null ? _b : 0;
|
|
1249
|
-
useCheckoutStore.setState((state) => ({ ...state, numberOfProductsInCart }));
|
|
1250
|
-
}
|
|
1251
|
-
|
|
1252
|
-
// src/components/checkout/ApplePay.tsx
|
|
1253
|
-
var import_react_query2 = require("@tanstack/react-query");
|
|
1254
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
1255
|
-
function ApplePayButtonComponent({
|
|
1256
|
-
style,
|
|
1257
|
-
buttonType,
|
|
1258
|
-
colorType,
|
|
1259
|
-
items,
|
|
1260
|
-
onClick
|
|
1261
|
-
}) {
|
|
1262
|
-
const {
|
|
1263
|
-
checkIfApplePayIsAvailable,
|
|
1264
|
-
getApplePayPaymentRequest,
|
|
1265
|
-
completeApplePayPayment,
|
|
1266
|
-
setCountry,
|
|
1267
|
-
setCouponCodeIfPossible,
|
|
1268
|
-
setDeliveryMethod,
|
|
1269
|
-
setEmail,
|
|
1270
|
-
setPostalCode,
|
|
1271
|
-
clearCart
|
|
1272
|
-
} = useCartProvider();
|
|
1273
|
-
const { data: isApplePayAvailable } = (0, import_react_query2.useQuery)({
|
|
1274
|
-
queryKey: ["is-apple-pay-available"],
|
|
1275
|
-
queryFn: checkIfApplePayIsAvailable
|
|
1276
|
-
});
|
|
1277
|
-
if (isApplePayAvailable != true) {
|
|
1278
|
-
return null;
|
|
1279
|
-
}
|
|
1280
|
-
const expectedItems = items.map((el) => ({
|
|
1281
|
-
productID: el.id,
|
|
1282
|
-
quantity: el.quantity,
|
|
1283
|
-
metadata: el.metadata
|
|
1284
|
-
}));
|
|
1285
|
-
async function beginSession() {
|
|
1286
|
-
sendAnalyticEvent({
|
|
1287
|
-
event: "initiateCheckout"
|
|
1288
|
-
});
|
|
1289
|
-
const requiresShipping = items.find((el) => el.isDeliverable === true) != null;
|
|
1290
|
-
const session = new ApplePaySession(14, {
|
|
1291
|
-
countryCode: "PL",
|
|
1292
|
-
merchantCapabilities: ["supports3DS"],
|
|
1293
|
-
supportedNetworks: ["visa", "masterCard"],
|
|
1294
|
-
currencyCode: "PLN",
|
|
1295
|
-
total: {
|
|
1296
|
-
amount: `${round(
|
|
1297
|
-
items.reduce((acc, item) => acc + item.price * item.quantity, 0) / 100,
|
|
1298
|
-
2
|
|
1299
|
-
)}`,
|
|
1300
|
-
label: "P\u0142atno\u015B\u0107 za koszyk",
|
|
1301
|
-
type: "pending"
|
|
1302
|
-
},
|
|
1303
|
-
lineItems: [
|
|
1304
|
-
...items.map(
|
|
1305
|
-
(item) => ({
|
|
1306
|
-
amount: `${round(item.price * item.quantity / 100, 2)}`,
|
|
1307
|
-
label: item.name,
|
|
1308
|
-
type: "final"
|
|
1309
|
-
})
|
|
1310
|
-
),
|
|
1311
|
-
requiresShipping ? {
|
|
1312
|
-
amount: `16.99`,
|
|
1313
|
-
type: "pending",
|
|
1314
|
-
label: "Dostawa"
|
|
1315
|
-
} : void 0
|
|
1316
|
-
].filter((el) => el != null),
|
|
1317
|
-
...requiresShipping ? {
|
|
1318
|
-
shippingMethods: [],
|
|
1319
|
-
supportsCouponCode: true,
|
|
1320
|
-
requiredBillingContactFields: [
|
|
1321
|
-
"name",
|
|
1322
|
-
"email",
|
|
1323
|
-
"postalAddress",
|
|
1324
|
-
"phone"
|
|
1325
|
-
],
|
|
1326
|
-
requiredShippingContactFields: [
|
|
1327
|
-
"name",
|
|
1328
|
-
"email",
|
|
1329
|
-
"postalAddress",
|
|
1330
|
-
"phone"
|
|
1331
|
-
]
|
|
1332
|
-
} : {}
|
|
1333
|
-
});
|
|
1334
|
-
await (onClick == null ? void 0 : onClick());
|
|
1335
|
-
const apRequest = await getApplePayPaymentRequest({ expectedItems });
|
|
1336
|
-
if (isErr(apRequest)) {
|
|
1337
|
-
console.error("Error creating ApplePaySession:", apRequest.error);
|
|
1338
|
-
return;
|
|
1339
|
-
}
|
|
1340
|
-
session.oncancel = (event) => {
|
|
1341
|
-
console.log("ApplePaySession cancelled", event);
|
|
1342
|
-
};
|
|
1343
|
-
session.onvalidatemerchant = async (event) => {
|
|
1344
|
-
try {
|
|
1345
|
-
const result = await PublicApiClient.get(HOST).applePayValidateMerchant(
|
|
1346
|
-
{
|
|
1347
|
-
validationUrl: event.validationURL,
|
|
1348
|
-
projectId: getProjectID()
|
|
1349
|
-
}
|
|
1350
|
-
);
|
|
1351
|
-
console.log("merchantSession", result.merchantSession);
|
|
1352
|
-
if (result.merchantSession.length > 0) {
|
|
1353
|
-
console.log("completing merchant session");
|
|
1354
|
-
session.completeMerchantValidation(
|
|
1355
|
-
JSON.parse(result.merchantSession)
|
|
1356
|
-
);
|
|
1357
|
-
} else {
|
|
1358
|
-
session.abort();
|
|
1359
|
-
}
|
|
1360
|
-
} catch (error) {
|
|
1361
|
-
session.abort;
|
|
1362
|
-
}
|
|
1363
|
-
};
|
|
1364
|
-
session.onshippingmethodselected = async (event) => {
|
|
1365
|
-
console.log("shipping method selected", event);
|
|
1366
|
-
await setDeliveryMethod(event.shippingMethod.identifier);
|
|
1367
|
-
const apRequest2 = await getApplePayPaymentRequest({ expectedItems });
|
|
1368
|
-
console.log("apRequest", apRequest2);
|
|
1369
|
-
if (isErr(apRequest2)) {
|
|
1370
|
-
session.abort();
|
|
1371
|
-
throw new Error("Failed to get Apple Pay payment request");
|
|
1372
|
-
}
|
|
1373
|
-
session.completeShippingMethodSelection({
|
|
1374
|
-
newTotal: apRequest2.total,
|
|
1375
|
-
newLineItems: apRequest2.lineItems,
|
|
1376
|
-
newShippingMethods: apRequest2.shippingMethods
|
|
1377
|
-
});
|
|
1378
|
-
};
|
|
1379
|
-
session.onshippingcontactselected = async (event) => {
|
|
1380
|
-
try {
|
|
1381
|
-
if (event.shippingContact.countryCode != null) {
|
|
1382
|
-
await setCountry(event.shippingContact.countryCode);
|
|
1383
|
-
}
|
|
1384
|
-
if (event.shippingContact.postalCode != null) {
|
|
1385
|
-
await setPostalCode(event.shippingContact.postalCode);
|
|
1386
|
-
}
|
|
1387
|
-
if (event.shippingContact.phoneNumber != null) {
|
|
1388
|
-
await setEmail(event.shippingContact.emailAddress);
|
|
1389
|
-
}
|
|
1390
|
-
const apRequest2 = await getApplePayPaymentRequest({ expectedItems });
|
|
1391
|
-
if (isErr(apRequest2)) {
|
|
1392
|
-
session.abort();
|
|
1393
|
-
throw new Error("Failed to get Apple Pay payment request");
|
|
1394
|
-
}
|
|
1395
|
-
console.log("apRequest", apRequest2);
|
|
1396
|
-
session.completeShippingContactSelection({
|
|
1397
|
-
newLineItems: apRequest2.lineItems,
|
|
1398
|
-
newTotal: apRequest2.total,
|
|
1399
|
-
newShippingMethods: apRequest2.shippingMethods
|
|
1400
|
-
});
|
|
1401
|
-
} catch (error) {
|
|
1402
|
-
console.log("shipping contact selected error", error);
|
|
1403
|
-
session.abort();
|
|
1404
|
-
}
|
|
1405
|
-
};
|
|
1406
|
-
session.oncouponcodechanged = async (event) => {
|
|
1407
|
-
try {
|
|
1408
|
-
console.log("coupon code changed", event);
|
|
1409
|
-
const result = await setCouponCodeIfPossible(event.couponCode);
|
|
1410
|
-
const apRequest2 = await getApplePayPaymentRequest({ expectedItems });
|
|
1411
|
-
console.log("apRequest", apRequest2);
|
|
1412
|
-
if (isErr(apRequest2)) {
|
|
1413
|
-
session.abort();
|
|
1414
|
-
throw new Error("Failed to get Apple Pay payment request");
|
|
1415
|
-
}
|
|
1416
|
-
session.completeCouponCodeChange({
|
|
1417
|
-
errors: isErr(result) ? [new ApplePayError("couponCodeInvalid")] : void 0,
|
|
1418
|
-
newTotal: apRequest2.total,
|
|
1419
|
-
newLineItems: apRequest2.lineItems,
|
|
1420
|
-
newShippingMethods: apRequest2.shippingMethods
|
|
1421
|
-
});
|
|
1422
|
-
} catch (error) {
|
|
1423
|
-
console.log("coupon code changed error", error);
|
|
1424
|
-
session.abort();
|
|
1425
|
-
}
|
|
1426
|
-
};
|
|
1427
|
-
session.onpaymentauthorized = async (event) => {
|
|
1428
|
-
try {
|
|
1429
|
-
const result = await completeApplePayPayment({
|
|
1430
|
-
token: event.payment.token,
|
|
1431
|
-
billingContact: event.payment.billingContact,
|
|
1432
|
-
shippingContact: event.payment.shippingContact
|
|
1433
|
-
});
|
|
1434
|
-
if (isErr(result)) {
|
|
1435
|
-
console.log("apple pay error", result);
|
|
1436
|
-
session.completePayment({
|
|
1437
|
-
status: ApplePaySession.STATUS_FAILURE
|
|
1438
|
-
});
|
|
1439
|
-
return;
|
|
1440
|
-
}
|
|
1441
|
-
if (result.redirectURL) {
|
|
1442
|
-
setTimeout(() => {
|
|
1443
|
-
open(result.redirectURL, "_self");
|
|
1444
|
-
}, 2e3);
|
|
1445
|
-
}
|
|
1446
|
-
session.completePayment({
|
|
1447
|
-
status: result.isSuccess ? ApplePaySession.STATUS_SUCCESS : ApplePaySession.STATUS_FAILURE
|
|
1448
|
-
});
|
|
1449
|
-
result.isSuccess && clearCart();
|
|
1450
|
-
} catch (e) {
|
|
1451
|
-
session.completePayment({
|
|
1452
|
-
status: ApplePaySession.STATUS_FAILURE
|
|
1453
|
-
});
|
|
1454
|
-
}
|
|
1455
|
-
};
|
|
1456
|
-
session.begin();
|
|
1457
|
-
}
|
|
1458
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
1459
|
-
import_apple_pay_button.default,
|
|
1460
|
-
{
|
|
1461
|
-
style,
|
|
1462
|
-
buttonStyle: colorType,
|
|
1463
|
-
type: buttonType,
|
|
1464
|
-
onClick: beginSession
|
|
1465
|
-
}
|
|
1466
|
-
);
|
|
1467
|
-
}
|
|
1468
|
-
function Wrapper(props) {
|
|
1469
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(CartProvider_default, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ApplePayButtonComponent, { ...props }) }) });
|
|
1470
|
-
}
|
|
1471
|
-
var ApplePay_default = Wrapper;
|
|
1472
|
-
|
|
1473
|
-
// src/components/checkout/GooglePay.tsx
|
|
1474
|
-
var import_button_react = __toESM(require("@google-pay/button-react"));
|
|
1475
|
-
|
|
1476
|
-
// src/ui/spinner.tsx
|
|
1477
|
-
var import_lucide_react = require("lucide-react");
|
|
1478
|
-
|
|
1479
|
-
// src/lib/utils.ts
|
|
1480
|
-
var import_clsx = require("clsx");
|
|
1481
|
-
var import_tailwind_merge = require("tailwind-merge");
|
|
1482
|
-
function cn(...inputs) {
|
|
1483
|
-
return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
|
|
1484
|
-
}
|
|
1485
|
-
|
|
1486
|
-
// src/ui/spinner.tsx
|
|
1487
|
-
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
1488
|
-
function Spinner({ className, ...props }) {
|
|
1489
|
-
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
1490
|
-
import_lucide_react.Loader2Icon,
|
|
1491
|
-
{
|
|
1492
|
-
role: "status",
|
|
1493
|
-
"aria-label": "Loading",
|
|
1494
|
-
className: cn("size-4 animate-spin", className),
|
|
1495
|
-
...props
|
|
1496
|
-
}
|
|
1497
|
-
);
|
|
1498
|
-
}
|
|
1499
|
-
|
|
1500
|
-
// src/components/checkout/GooglePay.tsx
|
|
1501
|
-
var import_react_query3 = require("@tanstack/react-query");
|
|
1502
|
-
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
1503
|
-
function GooglePayButtonComponent({
|
|
1504
|
-
items,
|
|
1505
|
-
style,
|
|
1506
|
-
buttonColor,
|
|
1507
|
-
buttonSizeMode,
|
|
1508
|
-
test
|
|
1509
|
-
}) {
|
|
1510
|
-
const {
|
|
1511
|
-
getGooglePayConfiguration,
|
|
1512
|
-
completeGooglePayPayment,
|
|
1513
|
-
setCountry,
|
|
1514
|
-
setCouponCodeIfPossible,
|
|
1515
|
-
setDeliveryMethod,
|
|
1516
|
-
setEmail,
|
|
1517
|
-
setPostalCode,
|
|
1518
|
-
clearCart
|
|
1519
|
-
} = useCartProvider();
|
|
1520
|
-
const { data: googlePayConfiguration } = (0, import_react_query3.useQuery)({
|
|
1521
|
-
queryKey: [
|
|
1522
|
-
"get-google-pay-configuration",
|
|
1523
|
-
items.map((el) => el.id).join(",")
|
|
1524
|
-
],
|
|
1525
|
-
queryFn: () => getGooglePayConfiguration({
|
|
1526
|
-
items: items.map((el) => ({
|
|
1527
|
-
...el,
|
|
1528
|
-
id: void 0,
|
|
1529
|
-
productID: el.id
|
|
1530
|
-
}))
|
|
1531
|
-
})
|
|
1532
|
-
});
|
|
1533
|
-
const { mutateAsync: completeGooglePayPaymentAsync, isPending } = (0, import_react_query3.useMutation)(
|
|
1534
|
-
{
|
|
1535
|
-
mutationFn: completeGooglePayPayment
|
|
1536
|
-
}
|
|
1537
|
-
);
|
|
1538
|
-
if (googlePayConfiguration == null || googlePayConfiguration.isAvailable != true) {
|
|
1539
|
-
console.log(
|
|
1540
|
-
"google pay configuration is not available",
|
|
1541
|
-
googlePayConfiguration
|
|
1542
|
-
);
|
|
1543
|
-
return null;
|
|
1544
|
-
}
|
|
1545
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
1546
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
1547
|
-
import_button_react.default,
|
|
1548
|
-
{
|
|
1549
|
-
buttonSizeMode,
|
|
1550
|
-
buttonColor,
|
|
1551
|
-
style,
|
|
1552
|
-
existingPaymentMethodRequired: true,
|
|
1553
|
-
environment: test === true ? "TEST" : "PRODUCTION",
|
|
1554
|
-
onPaymentDataChanged: async (paymentData) => {
|
|
1555
|
-
var _a, _b, _c, _d, _e;
|
|
1556
|
-
sendAnalyticEvent({
|
|
1557
|
-
event: "initiateCheckout"
|
|
1558
|
-
});
|
|
1559
|
-
console.log("payment data changed", paymentData);
|
|
1560
|
-
if (((_a = paymentData.shippingAddress) == null ? void 0 : _a.postalCode) != null) {
|
|
1561
|
-
await setPostalCode((_b = paymentData.shippingAddress) == null ? void 0 : _b.postalCode);
|
|
1562
|
-
}
|
|
1563
|
-
if (((_c = paymentData.shippingAddress) == null ? void 0 : _c.countryCode) != null) {
|
|
1564
|
-
await setCountry((_d = paymentData.shippingAddress) == null ? void 0 : _d.countryCode);
|
|
1565
|
-
}
|
|
1566
|
-
if (((_e = paymentData.shippingOptionData) == null ? void 0 : _e.id) != null) {
|
|
1567
|
-
await setDeliveryMethod(paymentData.shippingOptionData.id);
|
|
1568
|
-
}
|
|
1569
|
-
const config = await getGooglePayConfiguration({ items: [] });
|
|
1570
|
-
console.log("PAYMENT DATA CHANGED CONFIG", config);
|
|
1571
|
-
if (config.isAvailable) {
|
|
1572
|
-
return {
|
|
1573
|
-
error: void 0,
|
|
1574
|
-
newShippingOptionParameters: config.config.shippingOptionParameters,
|
|
1575
|
-
newTransactionInfo: config.config.transactionInfo
|
|
1576
|
-
};
|
|
1577
|
-
}
|
|
1578
|
-
return {
|
|
1579
|
-
error: void 0
|
|
1580
|
-
};
|
|
1581
|
-
},
|
|
1582
|
-
paymentRequest: googlePayConfiguration.config,
|
|
1583
|
-
onLoadPaymentData: async (paymentRequest) => {
|
|
1584
|
-
try {
|
|
1585
|
-
const result = await completeGooglePayPaymentAsync({
|
|
1586
|
-
paymentData: paymentRequest
|
|
1587
|
-
});
|
|
1588
|
-
if (isErr(result)) {
|
|
1589
|
-
console.log("apple pay error", result);
|
|
1590
|
-
return;
|
|
1591
|
-
}
|
|
1592
|
-
result.isSuccess && clearCart();
|
|
1593
|
-
if (result.redirectURL) {
|
|
1594
|
-
open(result.redirectURL, "_self");
|
|
1595
|
-
}
|
|
1596
|
-
} catch (e) {
|
|
1597
|
-
console.warn("error completing google pay payment", e);
|
|
1598
|
-
}
|
|
1599
|
-
}
|
|
1600
|
-
}
|
|
1601
|
-
),
|
|
1602
|
-
isPending ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Spinner, {}) : null
|
|
1603
|
-
] });
|
|
1604
|
-
}
|
|
1605
|
-
function Wrapper2(props) {
|
|
1606
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CartProvider_default, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(GooglePayButtonComponent, { ...props }) }) });
|
|
1607
|
-
}
|
|
1608
|
-
var GooglePay_default = Wrapper2;
|
|
1609
|
-
|
|
1610
|
-
// src/components/checkout/BitsnapCart.tsx
|
|
1611
|
-
var import_react8 = require("react");
|
|
1612
|
-
var import_zod3 = __toESM(require("zod"));
|
|
1613
|
-
|
|
1614
|
-
// src/components/checkout/CartComponent.tsx
|
|
1615
|
-
var import_react7 = require("@formkit/auto-animate/react");
|
|
1616
|
-
var import_react_dom = require("react-dom");
|
|
1617
|
-
|
|
1618
|
-
// src/components/checkout/CartComponentContent.tsx
|
|
1619
|
-
var import_react5 = require("@formkit/auto-animate/react");
|
|
1620
|
-
var import_react6 = __toESM(require("react"));
|
|
1621
|
-
|
|
1622
|
-
// src/components/checkout/CountrySelector.tsx
|
|
1623
|
-
var import_react2 = require("motion/react");
|
|
1624
|
-
var import_react3 = require("react");
|
|
1625
|
-
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
1626
|
-
function CountrySelector({
|
|
1627
|
-
id,
|
|
1628
|
-
open: open2,
|
|
1629
|
-
disabled = false,
|
|
1630
|
-
onToggle,
|
|
1631
|
-
onChange,
|
|
1632
|
-
selectedValue,
|
|
1633
|
-
countries
|
|
1634
|
-
}) {
|
|
1635
|
-
var _a;
|
|
1636
|
-
const ref = (0, import_react3.useRef)(null);
|
|
1637
|
-
(0, import_react3.useEffect)(() => {
|
|
1638
|
-
const mutableRef = ref;
|
|
1639
|
-
const handleClickOutside = (event) => {
|
|
1640
|
-
if (mutableRef.current && // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1641
|
-
// @ts-expect-error
|
|
1642
|
-
!mutableRef.current.contains(event.target) && open2) {
|
|
1643
|
-
onToggle();
|
|
1644
|
-
setQuery("");
|
|
1645
|
-
}
|
|
1646
|
-
};
|
|
1647
|
-
window.document.addEventListener("mousedown", handleClickOutside);
|
|
1648
|
-
return () => {
|
|
1649
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
1650
|
-
};
|
|
1651
|
-
}, [ref]);
|
|
1652
|
-
(0, import_react3.useEffect)(() => {
|
|
1653
|
-
if (selectedValue == null && countries.length > 0) {
|
|
1654
|
-
onChange(countries[0].code);
|
|
1655
|
-
}
|
|
1656
|
-
}, []);
|
|
1657
|
-
const [query, setQuery] = (0, import_react3.useState)("");
|
|
1658
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "relative", children: [
|
|
1659
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1660
|
-
"button",
|
|
1661
|
-
{
|
|
1662
|
-
type: "button",
|
|
1663
|
-
className: `${disabled ? "bg-neutral-100" : "bg-extra-light-white"} relative w-full rounded-2xl shadow-sm pl-8 pr-10 py-3 text-left cursor-default focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500 sm:text-sm`,
|
|
1664
|
-
"aria-haspopup": "listbox",
|
|
1665
|
-
"aria-expanded": "true",
|
|
1666
|
-
"aria-labelledby": "listbox-label",
|
|
1667
|
-
onClick: onToggle,
|
|
1668
|
-
disabled,
|
|
1669
|
-
children: [
|
|
1670
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "truncate flex items-center", children: [
|
|
1671
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1672
|
-
"img",
|
|
1673
|
-
{
|
|
1674
|
-
alt: `${selectedValue}`,
|
|
1675
|
-
src: `https://purecatamphetamine.github.io/country-flag-icons/3x2/${selectedValue}.svg`,
|
|
1676
|
-
className: "inline mr-2 h-4 rounded-sm"
|
|
1677
|
-
}
|
|
1678
|
-
),
|
|
1679
|
-
(_a = countries.find((el) => el.code === selectedValue)) == null ? void 0 : _a.name
|
|
1680
|
-
] }),
|
|
1681
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1682
|
-
"span",
|
|
1683
|
-
{
|
|
1684
|
-
className: `absolute inset-y-0 right-0 flex items-center pr-2 pointer-events-none ${disabled ? "hidden" : ""}`,
|
|
1685
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1686
|
-
"svg",
|
|
1687
|
-
{
|
|
1688
|
-
className: "h-5 w-5 text-light-purple",
|
|
1689
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1690
|
-
viewBox: "0 0 20 20",
|
|
1691
|
-
fill: "currentColor",
|
|
1692
|
-
"aria-hidden": "true",
|
|
1693
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1694
|
-
"path",
|
|
1695
|
-
{
|
|
1696
|
-
fillRule: "evenodd",
|
|
1697
|
-
d: "M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z",
|
|
1698
|
-
clipRule: "evenodd"
|
|
1699
|
-
}
|
|
1700
|
-
)
|
|
1701
|
-
}
|
|
1702
|
-
)
|
|
1703
|
-
}
|
|
1704
|
-
)
|
|
1705
|
-
]
|
|
1706
|
-
}
|
|
1707
|
-
),
|
|
1708
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react2.AnimatePresence, { children: open2 && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1709
|
-
import_react2.motion.ul,
|
|
1710
|
-
{
|
|
1711
|
-
initial: { opacity: 0 },
|
|
1712
|
-
animate: { opacity: 1 },
|
|
1713
|
-
exit: { opacity: 0 },
|
|
1714
|
-
transition: { duration: 0.1 },
|
|
1715
|
-
className: "absolute z-10 -mt-80 w-full dark:bg-neutral-800 bg-white shadow-lg max-h-80 rounded-md text-body-regular ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-body-regular",
|
|
1716
|
-
tabIndex: -1,
|
|
1717
|
-
role: "listbox",
|
|
1718
|
-
"aria-labelledby": "listbox-label",
|
|
1719
|
-
"aria-activedescendant": "listbox-option-3",
|
|
1720
|
-
children: [
|
|
1721
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "sticky top-0 z-10 bg-white dark:bg-neutral-800", children: [
|
|
1722
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { className: "dark:text-neutral-200 text-neutral-900 cursor-default select-none relative py-2 px-3", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1723
|
-
"input",
|
|
1724
|
-
{
|
|
1725
|
-
type: "search",
|
|
1726
|
-
name: "search",
|
|
1727
|
-
autoComplete: "off",
|
|
1728
|
-
className: "block w-full outline-none sm:text-body-regular dark:text-neutral-400 text-dark-blue bg-transparent border-light-purple rounded-md placeholder:text-light-purple",
|
|
1729
|
-
placeholder: "Znajd\u017A kraj",
|
|
1730
|
-
onChange: (e) => setQuery(e.target.value)
|
|
1731
|
-
}
|
|
1732
|
-
) }),
|
|
1733
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("hr", {})
|
|
1734
|
-
] }),
|
|
1735
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1736
|
-
"div",
|
|
1737
|
-
{
|
|
1738
|
-
className: "max-h-64 scrollbar scrollbar-track-gray-100 scrollbar-thumb-gray-300 hover:scrollbar-thumb-gray-600 scrollbar-thumb-rounded scrollbar-thin overflow-y-scroll",
|
|
1739
|
-
children: countries.filter(
|
|
1740
|
-
(country) => country.name.toLowerCase().startsWith(query.toLowerCase())
|
|
1741
|
-
).length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("li", { className: "text-light-purple cursor-default select-none relative py-2 pl-3 pr-9", children: "No countries found" }) : countries.filter(
|
|
1742
|
-
(country) => country.name.toLowerCase().startsWith(query.toLowerCase())
|
|
1743
|
-
).map((value, index) => {
|
|
1744
|
-
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
1745
|
-
"li",
|
|
1746
|
-
{
|
|
1747
|
-
className: "text-dark-blue cursor-default select-none relative py-2 pl-3 pr-9 flex items-center hover:bg-extra-light-white transition",
|
|
1748
|
-
id: "listbox-option-0",
|
|
1749
|
-
role: "option",
|
|
1750
|
-
onClick: () => {
|
|
1751
|
-
onChange(value.code);
|
|
1752
|
-
setQuery("");
|
|
1753
|
-
onToggle();
|
|
1754
|
-
},
|
|
1755
|
-
children: [
|
|
1756
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1757
|
-
"img",
|
|
1758
|
-
{
|
|
1759
|
-
alt: `${value.code}`,
|
|
1760
|
-
src: `https://purecatamphetamine.github.io/country-flag-icons/3x2/${value.code}.svg`,
|
|
1761
|
-
className: "inline mr-2 h-4 rounded-sm"
|
|
1762
|
-
}
|
|
1763
|
-
),
|
|
1764
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "font-normal truncate", children: value.name }),
|
|
1765
|
-
value.code === selectedValue ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1766
|
-
"span",
|
|
1767
|
-
{
|
|
1768
|
-
className: "text-blue-600 absolute inset-y-0 right-0 flex items-center pr-8",
|
|
1769
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1770
|
-
"svg",
|
|
1771
|
-
{
|
|
1772
|
-
className: "h-5 w-5",
|
|
1773
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
1774
|
-
viewBox: "0 0 20 20",
|
|
1775
|
-
fill: "currentColor",
|
|
1776
|
-
"aria-hidden": "true",
|
|
1777
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
1778
|
-
"path",
|
|
1779
|
-
{
|
|
1780
|
-
fillRule: "evenodd",
|
|
1781
|
-
d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",
|
|
1782
|
-
clipRule: "evenodd"
|
|
1783
|
-
}
|
|
1784
|
-
)
|
|
1785
|
-
}
|
|
1786
|
-
)
|
|
1787
|
-
}
|
|
1788
|
-
) : null
|
|
1789
|
-
]
|
|
1790
|
-
},
|
|
1791
|
-
`${id}-${index}`
|
|
1792
|
-
);
|
|
1793
|
-
})
|
|
1794
|
-
}
|
|
1795
|
-
)
|
|
1796
|
-
]
|
|
1797
|
-
}
|
|
1798
|
-
) })
|
|
1799
|
-
] }) });
|
|
1800
|
-
}
|
|
1801
|
-
var CountrySelector_default = CountrySelector;
|
|
1802
|
-
|
|
1803
|
-
// src/components/checkout/SingleProduct.tsx
|
|
1804
|
-
var import_react4 = require("react");
|
|
1805
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
1806
|
-
var SingleProduct = ({ quantity, details, shouldUpdate }) => {
|
|
1807
|
-
var _a;
|
|
1808
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
1809
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("img", { className: "aspect-auto max-w-[30%] max-w-32 max-h-32", src: (_a = details.image_url) != null ? _a : "", alt: details.name }),
|
|
1810
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex flex-col", children: [
|
|
1811
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "font-medium", children: details.name }),
|
|
1812
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "text-sm", children: formatCurrency(details.price, details.currency) }),
|
|
1813
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex justify-between", children: [
|
|
1814
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(QuantityComponent, { className: "", quantity, shouldUpdate }),
|
|
1815
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { className: "text-sm font-medium", onClick: () => shouldUpdate(0), children: "Usu\u0144" })
|
|
1816
|
-
] })
|
|
1817
|
-
] })
|
|
1818
|
-
] });
|
|
1819
|
-
};
|
|
1820
|
-
var SingleProduct_default = SingleProduct;
|
|
1821
|
-
var QuantityComponent = ({
|
|
1822
|
-
quantity,
|
|
1823
|
-
shouldUpdate,
|
|
1824
|
-
className
|
|
1825
|
-
}) => {
|
|
1826
|
-
const [quantityString, setQuantityString] = (0, import_react4.useState)(quantity.toString());
|
|
1827
|
-
const [quantityValue, setQuantityValue] = (0, import_react4.useState)(quantity);
|
|
1828
|
-
(0, import_react4.useEffect)(() => {
|
|
1829
|
-
shouldUpdate(quantityValue);
|
|
1830
|
-
}, [quantityValue]);
|
|
1831
|
-
function setNewQuantity(newQuantity) {
|
|
1832
|
-
setQuantityString(newQuantity);
|
|
1833
|
-
if (newQuantity.length == 0) {
|
|
1834
|
-
return;
|
|
1835
|
-
}
|
|
1836
|
-
const parsedInt = parseInt(newQuantity);
|
|
1837
|
-
if (isNaN(parsedInt)) {
|
|
1838
|
-
setQuantityValue(1);
|
|
1839
|
-
setQuantityString("");
|
|
1840
|
-
return;
|
|
1841
|
-
}
|
|
1842
|
-
if (parsedInt == 0 || parsedInt < 0) {
|
|
1843
|
-
setQuantityValue(1);
|
|
1844
|
-
setQuantityString("1");
|
|
1845
|
-
return;
|
|
1846
|
-
}
|
|
1847
|
-
setQuantityValue(parsedInt);
|
|
1848
|
-
setQuantityString(parsedInt.toString());
|
|
1849
|
-
}
|
|
1850
|
-
function increaseQuantity() {
|
|
1851
|
-
setQuantityValue(quantity + 1);
|
|
1852
|
-
setQuantityString((quantity + 1).toString());
|
|
1853
|
-
}
|
|
1854
|
-
function decreaseQuantity() {
|
|
1855
|
-
if (quantity > 1) {
|
|
1856
|
-
setQuantityString((quantity - 1).toString());
|
|
1857
|
-
setQuantityValue(quantity - 1);
|
|
1858
|
-
return;
|
|
1859
|
-
}
|
|
1860
|
-
setQuantityString(quantity.toString());
|
|
1861
|
-
setQuantityValue(quantity);
|
|
1862
|
-
}
|
|
1863
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: `flex ${className} items-center border dark:border-neutral-400 border-neutral-700 rounded-md my-1`, children: [
|
|
1864
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { onClick: decreaseQuantity, className: "px-2 py-1", children: "-" }),
|
|
1865
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1866
|
-
"input",
|
|
1867
|
-
{
|
|
1868
|
-
className: "w-8 bg-transparent text-center",
|
|
1869
|
-
value: quantityString,
|
|
1870
|
-
onInput: (e) => {
|
|
1871
|
-
setNewQuantity(e.currentTarget.value);
|
|
1872
|
-
},
|
|
1873
|
-
type: "text"
|
|
1874
|
-
}
|
|
1875
|
-
),
|
|
1876
|
-
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("button", { onClick: increaseQuantity, className: "px-2 py-1", children: "+" })
|
|
1877
|
-
] });
|
|
1878
|
-
};
|
|
1879
|
-
|
|
1880
|
-
// src/components/checkout/Skeleton.tsx
|
|
1881
|
-
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
1882
|
-
function Skeleton({ className, ...props }) {
|
|
1883
|
-
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1884
|
-
"div",
|
|
1885
|
-
{
|
|
1886
|
-
"data-slot": "skeleton",
|
|
1887
|
-
className: "bg-neutral-700 animate-pulse rounded-md " + className,
|
|
1888
|
-
...props
|
|
1889
|
-
}
|
|
1890
|
-
);
|
|
1891
|
-
}
|
|
1892
|
-
|
|
1893
|
-
// src/components/checkout/CartComponentContent.tsx
|
|
1894
|
-
var import_react_query4 = require("@tanstack/react-query");
|
|
1895
|
-
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
1896
|
-
var CartComponentContent = ({ className }) => {
|
|
1897
|
-
var _a, _b, _c, _d, _e;
|
|
1898
|
-
const provider = useCartProvider();
|
|
1899
|
-
const { mutateAsync: removeProduct } = (0, import_react_query4.useMutation)({
|
|
1900
|
-
mutationFn: provider.removeProductFromCart
|
|
1901
|
-
});
|
|
1902
|
-
const { mutateAsync: updateQuantity } = (0, import_react_query4.useMutation)({
|
|
1903
|
-
mutationFn: provider.updateQuantity
|
|
1904
|
-
});
|
|
1905
|
-
const { mutateAsync: setCountryAsync } = (0, import_react_query4.useMutation)({
|
|
1906
|
-
mutationFn: provider.setCountry
|
|
1907
|
-
});
|
|
1908
|
-
const { mutateAsync: clearCart } = (0, import_react_query4.useMutation)({
|
|
1909
|
-
mutationFn: provider.clearCart
|
|
1910
|
-
});
|
|
1911
|
-
const [errMsg, setErrMsg] = import_react6.default.useState("");
|
|
1912
|
-
const [isCountryOpen, setIsCountryOpen] = import_react6.default.useState(false);
|
|
1913
|
-
const {
|
|
1914
|
-
mutateAsync: continueToCheckoutAsync,
|
|
1915
|
-
isPending: isContinueToCheckoutLoading
|
|
1916
|
-
} = (0, import_react_query4.useMutation)({
|
|
1917
|
-
mutationFn: provider.redirectToNextStep
|
|
1918
|
-
});
|
|
1919
|
-
const { data: availableCountries } = (0, import_react_query4.useQuery)({
|
|
1920
|
-
queryKey: ["cart-available-countries"],
|
|
1921
|
-
queryFn: provider.getAvailableCountries
|
|
1922
|
-
});
|
|
1923
|
-
const { data: isApplePayAvailable } = (0, import_react_query4.useQuery)({
|
|
1924
|
-
queryKey: ["cart-one-click-payment"],
|
|
1925
|
-
queryFn: provider.checkIfApplePayIsAvailable
|
|
1926
|
-
});
|
|
1927
|
-
const { data, isLoading, refetch } = (0, import_react_query4.useQuery)({
|
|
1928
|
-
queryKey: ["cart"],
|
|
1929
|
-
queryFn: provider.getProducts
|
|
1930
|
-
});
|
|
1931
|
-
const { data: countryData, refetch: refetchCountry } = (0, import_react_query4.useQuery)({
|
|
1932
|
-
queryKey: ["cart-country"],
|
|
1933
|
-
queryFn: provider.getCountry
|
|
1934
|
-
});
|
|
1935
|
-
const [productsParent] = (0, import_react5.useAutoAnimate)(
|
|
1936
|
-
/* optional config */
|
|
1937
|
-
);
|
|
1938
|
-
const products = isErr(data) ? void 0 : data;
|
|
1939
|
-
const countries = isErr(availableCountries) ? [] : availableCountries;
|
|
1940
|
-
const sumOfProducts = (_a = products == null ? void 0 : products.reduce((prev, curr) => {
|
|
1941
|
-
if (curr.details == null) {
|
|
1942
|
-
return prev;
|
|
1943
|
-
}
|
|
1944
|
-
return prev + curr.details.price * curr.quantity;
|
|
1945
|
-
}, 0)) != null ? _a : 0;
|
|
1946
|
-
const currency = (_d = (_c = (_b = products == null ? void 0 : products[0]) == null ? void 0 : _b.details) == null ? void 0 : _c.currency) != null ? _d : "PLN";
|
|
1947
|
-
const isSomeProductDeliverable = (_e = products == null ? void 0 : products.some((product) => {
|
|
1948
|
-
var _a2;
|
|
1949
|
-
return ((_a2 = product.details) == null ? void 0 : _a2.isDeliverable) === true;
|
|
1950
|
-
})) != null ? _e : false;
|
|
1951
|
-
const selectedCountry = countryData != null && !isErr(countryData) && countryData != "" ? countryData : void 0;
|
|
1952
|
-
async function shouldUpdate(id, newQuantity) {
|
|
1953
|
-
if (newQuantity != null) {
|
|
1954
|
-
if (newQuantity <= 0) {
|
|
1955
|
-
await removeProduct({ id });
|
|
1956
|
-
await refetch();
|
|
1957
|
-
return;
|
|
1958
|
-
}
|
|
1959
|
-
await updateQuantity({
|
|
1960
|
-
id,
|
|
1961
|
-
quantity: newQuantity
|
|
1962
|
-
});
|
|
1963
|
-
await refetch();
|
|
1964
|
-
return;
|
|
1965
|
-
}
|
|
1966
|
-
}
|
|
1967
|
-
async function continueToCheckout() {
|
|
1968
|
-
try {
|
|
1969
|
-
setErrMsg("");
|
|
1970
|
-
const response = await continueToCheckoutAsync();
|
|
1971
|
-
if (isErr(response)) {
|
|
1972
|
-
setErrMsg(`${response.error}`);
|
|
1973
|
-
return;
|
|
1974
|
-
}
|
|
1975
|
-
await clearCart();
|
|
1976
|
-
window.location.href = response.url;
|
|
1977
|
-
} catch (e) {
|
|
1978
|
-
setErrMsg(`${e}`);
|
|
1979
|
-
}
|
|
1980
|
-
}
|
|
1981
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: `${className} flex flex-col`, ref: productsParent, children: [
|
|
1982
|
-
isLoading && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative flex w-full justify-center flex-col gap-4", children: [
|
|
1983
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Skeleton, { className: "w-full h-32" }),
|
|
1984
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Skeleton, { className: "w-full h-32" })
|
|
1985
|
-
] }),
|
|
1986
|
-
!isLoading && (products == null || products.length == 0) && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex flex-col gap-4 p-4", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "dark:text-neutral-400 text-neutral-700", children: "Brak produkt\xF3w w koszyku." }) }),
|
|
1987
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1988
|
-
"div",
|
|
1989
|
-
{
|
|
1990
|
-
className: "max-h-[70vh] overflow-clip overflow-y-scroll",
|
|
1991
|
-
children: products != null && products.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("ul", { className: "mt-5", children: products.map((product) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react6.default.Fragment, { children: product.details != null && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("li", { className: "mb-3", children: [
|
|
1992
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1993
|
-
SingleProduct_default,
|
|
1994
|
-
{
|
|
1995
|
-
quantity: product.quantity,
|
|
1996
|
-
details: product.details,
|
|
1997
|
-
shouldUpdate: (newQuantity) => {
|
|
1998
|
-
shouldUpdate(product.id, newQuantity).then().catch();
|
|
1999
|
-
}
|
|
2000
|
-
}
|
|
2001
|
-
),
|
|
2002
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("hr", { className: "h-1 dark:border-neutral-700 border-neutral-400" })
|
|
2003
|
-
] }) }, product.id)) })
|
|
2004
|
-
}
|
|
2005
|
-
),
|
|
2006
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "grow" }),
|
|
2007
|
-
sumOfProducts > 0 && currency != null && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
2008
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "mx-3 flex flex-col", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
2009
|
-
"div",
|
|
2010
|
-
{
|
|
2011
|
-
className: "flex flex-row justify-between text-lg",
|
|
2012
|
-
children: [
|
|
2013
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2014
|
-
"p",
|
|
2015
|
-
{
|
|
2016
|
-
className: "dark:text-neutral-200 text-neutral-800 text-xl",
|
|
2017
|
-
children: "Suma:"
|
|
2018
|
-
}
|
|
2019
|
-
),
|
|
2020
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex flex-col items-end", children: [
|
|
2021
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2022
|
-
"p",
|
|
2023
|
-
{
|
|
2024
|
-
className: "dark:text-neutral-200 text-neutral-800 font-medium",
|
|
2025
|
-
children: formatCurrency(sumOfProducts, currency)
|
|
2026
|
-
}
|
|
2027
|
-
),
|
|
2028
|
-
isSomeProductDeliverable && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "opacity-70 text-right text-base", children: "+ dostawa" })
|
|
2029
|
-
] })
|
|
2030
|
-
]
|
|
2031
|
-
}
|
|
2032
|
-
) }),
|
|
2033
|
-
countries && (countries == null ? void 0 : countries.length) > 1 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { children: [
|
|
2034
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2035
|
-
"h4",
|
|
2036
|
-
{
|
|
2037
|
-
className: "ml-3 text-sm dark:text-neutral-400 text-neutral-700",
|
|
2038
|
-
children: "Wybierz kraj"
|
|
2039
|
-
}
|
|
2040
|
-
),
|
|
2041
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2042
|
-
CountrySelector_default,
|
|
2043
|
-
{
|
|
2044
|
-
id: Math.random().toString(),
|
|
2045
|
-
open: isCountryOpen,
|
|
2046
|
-
onToggle: () => {
|
|
2047
|
-
setIsCountryOpen(!isCountryOpen);
|
|
2048
|
-
},
|
|
2049
|
-
onChange: (newValue) => {
|
|
2050
|
-
setCountryAsync(newValue).then(() => {
|
|
2051
|
-
refetchCountry().then().catch();
|
|
2052
|
-
});
|
|
2053
|
-
},
|
|
2054
|
-
selectedValue: selectedCountry != null ? selectedCountry : "",
|
|
2055
|
-
countries
|
|
2056
|
-
}
|
|
2057
|
-
)
|
|
2058
|
-
] }),
|
|
2059
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "mb-3 flex flex-col", children: [
|
|
2060
|
-
isApplePayAvailable && products != null && products.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w-full px-2", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ApplePay_default, { colorType: "white", style: { width: "100%" }, items: products == null ? void 0 : products.map((el) => {
|
|
2061
|
-
var _a2, _b2, _c2, _d2, _e2, _f;
|
|
2062
|
-
return {
|
|
2063
|
-
name: (_b2 = (_a2 = el.details) == null ? void 0 : _a2.name) != null ? _b2 : "",
|
|
2064
|
-
id: el.productID,
|
|
2065
|
-
price: (_d2 = (_c2 = el.details) == null ? void 0 : _c2.price) != null ? _d2 : 0,
|
|
2066
|
-
quantity: el.quantity,
|
|
2067
|
-
isDeliverable: (_f = (_e2 = el.details) == null ? void 0 : _e2.isDeliverable) != null ? _f : false,
|
|
2068
|
-
metadata: el.metadata
|
|
2069
|
-
};
|
|
2070
|
-
}) }) }),
|
|
2071
|
-
products != null && products.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w-full px-2", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(GooglePay_default, { buttonSizeMode: "fill", buttonColor: "white", style: { width: "100%" }, items: products == null ? void 0 : products.map((el) => {
|
|
2072
|
-
var _a2, _b2, _c2, _d2, _e2, _f;
|
|
2073
|
-
return {
|
|
2074
|
-
name: (_b2 = (_a2 = el.details) == null ? void 0 : _a2.name) != null ? _b2 : "",
|
|
2075
|
-
id: el.productID,
|
|
2076
|
-
price: (_d2 = (_c2 = el.details) == null ? void 0 : _c2.price) != null ? _d2 : 0,
|
|
2077
|
-
quantity: el.quantity,
|
|
2078
|
-
isDeliverable: (_f = (_e2 = el.details) == null ? void 0 : _e2.isDeliverable) != null ? _f : false,
|
|
2079
|
-
metadata: el.metadata
|
|
2080
|
-
};
|
|
2081
|
-
}) }) }),
|
|
2082
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
2083
|
-
"button",
|
|
2084
|
-
{
|
|
2085
|
-
onClick: continueToCheckout,
|
|
2086
|
-
disabled: isLoading || isContinueToCheckoutLoading || selectedCountry == null,
|
|
2087
|
-
className: "px-3 py-2 my-2 mx-2 rounded-md disabled:opacity-40 disabled:cursor-not-allowed dark:bg-neutral-300 dark:hover:bg-neutral-100 dark:text-neutral-800 hover:bg-neutral-900 text-neutral-200 bg-neutral-800 transition font-bold",
|
|
2088
|
-
children: isContinueToCheckoutLoading ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Spinner, {}) : "Nast\u0119pny krok"
|
|
2089
|
-
}
|
|
2090
|
-
),
|
|
2091
|
-
errMsg.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-red-500 text-sm text-center", children: errMsg })
|
|
2092
|
-
] })
|
|
2093
|
-
] })
|
|
2094
|
-
] });
|
|
2095
|
-
};
|
|
2096
|
-
var CartComponentContent_default = CartComponentContent;
|
|
2097
|
-
|
|
2098
|
-
// src/components/checkout/CartComponent.tsx
|
|
2099
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
2100
|
-
function CartComponent({ isVisible, shouldHide }) {
|
|
2101
|
-
const [parent] = (0, import_react7.useAutoAnimate)(
|
|
2102
|
-
/* optional config */
|
|
2103
|
-
);
|
|
2104
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { ref: parent, className: "bitsnap-checkout dark", style: { zIndex: 999999 }, children: isVisible && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
2105
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2106
|
-
"div",
|
|
2107
|
-
{
|
|
2108
|
-
className: "fixed top-0 right-0 left-0 bottom-0 bg-black/30 cursor-pointer z-10",
|
|
2109
|
-
onClick: shouldHide
|
|
2110
|
-
}
|
|
2111
|
-
),
|
|
2112
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2113
|
-
"div",
|
|
2114
|
-
{
|
|
2115
|
-
className: "fixed z-20 top-0 right-0 bottom-0 w-full md:w-[350px] xl:w-[420px] dark:bg-neutral-900 bg-neutral-300 dark:text-neutral-200 text-neutral-900 flex flex-col",
|
|
2116
|
-
children: [
|
|
2117
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2118
|
-
"div",
|
|
2119
|
-
{
|
|
2120
|
-
className: "mx-3 mt-7 flex justify-between items-center",
|
|
2121
|
-
children: [
|
|
2122
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h1", { className: "text-2xl font-medium", children: "Koszyk" }),
|
|
2123
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2124
|
-
"button",
|
|
2125
|
-
{
|
|
2126
|
-
className: "rounded-full dark:hover:bg-neutral-700 hover:bg-neutral-400 p-2 transition",
|
|
2127
|
-
onClick: shouldHide,
|
|
2128
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
2129
|
-
"svg",
|
|
2130
|
-
{
|
|
2131
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2132
|
-
width: "24",
|
|
2133
|
-
height: "24",
|
|
2134
|
-
viewBox: "0 0 24 24",
|
|
2135
|
-
fill: "none",
|
|
2136
|
-
stroke: "currentColor",
|
|
2137
|
-
strokeWidth: "2",
|
|
2138
|
-
strokeLinecap: "round",
|
|
2139
|
-
strokeLinejoin: "round",
|
|
2140
|
-
className: "lucide lucide-x",
|
|
2141
|
-
children: [
|
|
2142
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
2143
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
2144
|
-
]
|
|
2145
|
-
}
|
|
2146
|
-
)
|
|
2147
|
-
}
|
|
2148
|
-
)
|
|
2149
|
-
]
|
|
2150
|
-
}
|
|
2151
|
-
),
|
|
2152
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CartComponentContent_default, { className: "grow" })
|
|
2153
|
-
]
|
|
2154
|
-
}
|
|
2155
|
-
)
|
|
2156
|
-
] }) });
|
|
2157
|
-
}
|
|
2158
|
-
var WrapperCartComponent = (props) => {
|
|
2159
|
-
if (typeof window === "undefined") {
|
|
2160
|
-
return null;
|
|
2161
|
-
}
|
|
2162
|
-
return (0, import_react_dom.createPortal)(
|
|
2163
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CartProvider_default, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(CartComponent, { ...props }) }),
|
|
2164
|
-
document.body
|
|
2165
|
-
);
|
|
2166
|
-
};
|
|
2167
|
-
var CartComponent_default = WrapperCartComponent;
|
|
2168
|
-
|
|
2169
|
-
// src/components/checkout/BitsnapCart.tsx
|
|
2170
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2171
|
-
var cartAddToCartSchema = import_zod3.default.object({
|
|
2172
|
-
id: import_zod3.default.string(),
|
|
2173
|
-
isSubscription: import_zod3.default.boolean().default(false),
|
|
2174
|
-
quantity: import_zod3.default.number(),
|
|
2175
|
-
metadata: import_zod3.default.record(import_zod3.default.string(), import_zod3.default.string().optional()).optional()
|
|
2176
|
-
});
|
|
2177
|
-
function BitsnapCart({
|
|
2178
|
-
projectID,
|
|
2179
|
-
children,
|
|
2180
|
-
onVisibleChange,
|
|
2181
|
-
className,
|
|
2182
|
-
numberOfProductsInCartOptions
|
|
2183
|
-
}) {
|
|
2184
|
-
const { isCartVisible, showCart, hideCart, numberOfProductsInCart } = useCheckoutStore();
|
|
2185
|
-
function sentPostMessageToIframe(msg) {
|
|
2186
|
-
const iframes = document.querySelectorAll("iframe");
|
|
2187
|
-
iframes.forEach((iframe) => {
|
|
2188
|
-
var _a;
|
|
2189
|
-
(_a = iframe.contentWindow) == null ? void 0 : _a.postMessage(msg, "*");
|
|
2190
|
-
});
|
|
2191
|
-
}
|
|
2192
|
-
(0, import_react8.useEffect)(() => {
|
|
2193
|
-
onVisibleChange == null ? void 0 : onVisibleChange(isCartVisible);
|
|
2194
|
-
if (isCartVisible) {
|
|
2195
|
-
sendAnalyticEvent({
|
|
2196
|
-
event: "viewCart"
|
|
2197
|
-
});
|
|
2198
|
-
}
|
|
2199
|
-
}, [isCartVisible]);
|
|
2200
|
-
(0, import_react8.useEffect)(() => {
|
|
2201
|
-
setProjectID(projectID);
|
|
2202
|
-
}, [projectID]);
|
|
2203
|
-
(0, import_react8.useEffect)(() => {
|
|
2204
|
-
if (!("cart" in window)) {
|
|
2205
|
-
const projectID2 = getProjectID();
|
|
2206
|
-
if (projectID2 == null) {
|
|
2207
|
-
console.warn("There is no project ID configured.");
|
|
2208
|
-
return;
|
|
2209
|
-
}
|
|
2210
|
-
window["cart"] = {
|
|
2211
|
-
buyProduct: async (args) => {
|
|
2212
|
-
try {
|
|
2213
|
-
const payload = import_zod3.default.object({
|
|
2214
|
-
productID: import_zod3.default.string(),
|
|
2215
|
-
email: import_zod3.default.string().optional(),
|
|
2216
|
-
name: import_zod3.default.string().optional(),
|
|
2217
|
-
country: import_zod3.default.string().optional(),
|
|
2218
|
-
marketingAgreement: import_zod3.default.boolean().optional()
|
|
2219
|
-
}).parse(args);
|
|
2220
|
-
sendAnalyticEvent({
|
|
2221
|
-
event: "initiateCheckout"
|
|
2222
|
-
});
|
|
2223
|
-
const methods = getCheckoutMethods(projectID2);
|
|
2224
|
-
const result = await methods.justRedirectToPayment(payload);
|
|
2225
|
-
console.log("result", result);
|
|
2226
|
-
if (isErr(result) == false) {
|
|
2227
|
-
window.location.href = result.url;
|
|
2228
|
-
} else {
|
|
2229
|
-
alert(
|
|
2230
|
-
"Nie uda\u0142o si\u0119 przekierowa\u0107 do p\u0142atno\u015Bci. Spr\xF3buj ponownie p\xF3\u017Aniej."
|
|
2231
|
-
);
|
|
2232
|
-
}
|
|
2233
|
-
} catch (e) {
|
|
2234
|
-
console.warn(e);
|
|
2235
|
-
}
|
|
2236
|
-
}
|
|
2237
|
-
};
|
|
2238
|
-
}
|
|
2239
|
-
}, []);
|
|
2240
|
-
async function handleAddingToCart(id, payload) {
|
|
2241
|
-
const projectID2 = getProjectID();
|
|
2242
|
-
if (projectID2 == null) {
|
|
2243
|
-
console.warn("There is no project ID configured.");
|
|
2244
|
-
return;
|
|
2245
|
-
}
|
|
2246
|
-
try {
|
|
2247
|
-
const data = cartAddToCartSchema.parse(payload);
|
|
2248
|
-
if (data.isSubscription) {
|
|
2249
|
-
await handleAddingSubscriptionToCart(projectID2, data);
|
|
2250
|
-
return;
|
|
2251
|
-
}
|
|
2252
|
-
const methods = getCheckoutMethods(projectID2);
|
|
2253
|
-
await methods.addProduct({
|
|
2254
|
-
productID: data.id,
|
|
2255
|
-
quantity: data.quantity,
|
|
2256
|
-
metadata: data.metadata
|
|
2257
|
-
});
|
|
2258
|
-
sentPostMessageToIframe({
|
|
2259
|
-
id,
|
|
2260
|
-
type: "ADD_TO_CART" /* ADD_TO_CART */,
|
|
2261
|
-
success: true
|
|
2262
|
-
});
|
|
2263
|
-
showCart();
|
|
2264
|
-
} catch (e) {
|
|
2265
|
-
console.warn("cannot add item to cart", e);
|
|
2266
|
-
}
|
|
2267
|
-
}
|
|
2268
|
-
async function handleAddingSubscriptionToCart(projectID2, event) {
|
|
2269
|
-
alert(
|
|
2270
|
-
`TODO, nie jest to jeszcze zrobione ${projectID2} ${event.id} ${event.quantity}`
|
|
2271
|
-
);
|
|
2272
|
-
}
|
|
2273
|
-
function setupEventListener() {
|
|
2274
|
-
if ("__cart_is_listening" in window) {
|
|
2275
|
-
return;
|
|
2276
|
-
}
|
|
2277
|
-
window["__cart_is_listening"] = true;
|
|
2278
|
-
window.addEventListener("message", (event) => {
|
|
2279
|
-
if (typeof event.data["id"] != "undefined" && typeof event.data["type"] != "undefined") {
|
|
2280
|
-
const { id, type } = event.data;
|
|
2281
|
-
switch (type) {
|
|
2282
|
-
case "ADD_TO_CART" /* ADD_TO_CART */.toString():
|
|
2283
|
-
handleAddingToCart(id, event.data["payload"]).then().catch();
|
|
2284
|
-
break;
|
|
2285
|
-
default:
|
|
2286
|
-
break;
|
|
2287
|
-
}
|
|
2288
|
-
}
|
|
2289
|
-
});
|
|
2290
|
-
}
|
|
2291
|
-
(0, import_react8.useEffect)(() => {
|
|
2292
|
-
var _a;
|
|
2293
|
-
setupEventListener();
|
|
2294
|
-
if (typeof window !== "undefined") {
|
|
2295
|
-
try {
|
|
2296
|
-
const parsedParams = new URLSearchParams(window.location.search);
|
|
2297
|
-
const refLink = (_a = parsedParams.get("ref")) != null ? _a : parsedParams.get("utm-source");
|
|
2298
|
-
if (typeof localStorage != "undefined" && refLink && refLink.length > 0) {
|
|
2299
|
-
localStorage.setItem("bitsnap-ref", refLink);
|
|
2300
|
-
}
|
|
2301
|
-
} catch (e) {
|
|
2302
|
-
return;
|
|
2303
|
-
}
|
|
2304
|
-
}
|
|
2305
|
-
}, []);
|
|
2306
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
2307
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2308
|
-
"button",
|
|
2309
|
-
{
|
|
2310
|
-
onClick: () => isCartVisible ? hideCart() : showCart(),
|
|
2311
|
-
style: { position: "relative" },
|
|
2312
|
-
className: [
|
|
2313
|
-
"bitsnap-checkout",
|
|
2314
|
-
className != null ? className : "rounded-full hover:bg-neutral-300 transition p-1"
|
|
2315
|
-
].join(" "),
|
|
2316
|
-
children: [
|
|
2317
|
-
children ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
2318
|
-
"svg",
|
|
2319
|
-
{
|
|
2320
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2321
|
-
width: "24",
|
|
2322
|
-
height: "24",
|
|
2323
|
-
viewBox: "0 0 24 24",
|
|
2324
|
-
fill: "none",
|
|
2325
|
-
stroke: "currentColor",
|
|
2326
|
-
strokeWidth: "2",
|
|
2327
|
-
strokeLinecap: "round",
|
|
2328
|
-
strokeLinejoin: "round",
|
|
2329
|
-
className: "lucide lucide-shopping-cart",
|
|
2330
|
-
children: [
|
|
2331
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("circle", { cx: "8", cy: "21", r: "1" }),
|
|
2332
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("circle", { cx: "19", cy: "21", r: "1" }),
|
|
2333
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12" })
|
|
2334
|
-
]
|
|
2335
|
-
}
|
|
2336
|
-
),
|
|
2337
|
-
(numberOfProductsInCartOptions == null ? void 0 : numberOfProductsInCartOptions.isVisible) != false && numberOfProductsInCart > 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2338
|
-
"div",
|
|
2339
|
-
{
|
|
2340
|
-
style: {
|
|
2341
|
-
position: "absolute",
|
|
2342
|
-
bottom: -5,
|
|
2343
|
-
right: -5,
|
|
2344
|
-
background: "black",
|
|
2345
|
-
color: "white",
|
|
2346
|
-
borderRadius: "50%",
|
|
2347
|
-
width: "22px",
|
|
2348
|
-
height: "22px",
|
|
2349
|
-
display: "flex",
|
|
2350
|
-
alignItems: "center",
|
|
2351
|
-
justifyContent: "center",
|
|
2352
|
-
fontSize: "13px",
|
|
2353
|
-
fontWeight: 600,
|
|
2354
|
-
boxShadow: "0 2px 8px rgba(0, 0, 0, 0.25)",
|
|
2355
|
-
...numberOfProductsInCartOptions == null ? void 0 : numberOfProductsInCartOptions.style
|
|
2356
|
-
},
|
|
2357
|
-
children: numberOfProductsInCart
|
|
2358
|
-
}
|
|
2359
|
-
)
|
|
2360
|
-
]
|
|
2361
|
-
}
|
|
2362
|
-
),
|
|
2363
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2364
|
-
CartComponent_default,
|
|
2365
|
-
{
|
|
2366
|
-
isVisible: isCartVisible,
|
|
2367
|
-
shouldHide: () => {
|
|
2368
|
-
hideCart();
|
|
2369
|
-
}
|
|
2370
|
-
}
|
|
2371
|
-
)
|
|
2372
|
-
] });
|
|
2373
|
-
}
|
|
2374
|
-
var BitsnapCart_default = BitsnapCart;
|
|
2375
|
-
|
|
2376
|
-
// src/components/notifications/NotificationsComponentPublic.tsx
|
|
2377
|
-
var import_react19 = require("react");
|
|
2378
|
-
|
|
2379
|
-
// src/rpc-provider.tsx
|
|
2380
|
-
var import_connect_query = require("@connectrpc/connect-query");
|
|
2381
|
-
var import_connect_web2 = require("@connectrpc/connect-web");
|
|
2382
|
-
var import_react_query5 = require("@tanstack/react-query");
|
|
2383
|
-
var import_react9 = require("react");
|
|
2384
|
-
|
|
2385
|
-
// src/gen/proto/public/v1/public_api-PublicApiService_connectquery.ts
|
|
2386
|
-
var public_api_PublicApiService_connectquery_exports = {};
|
|
2387
|
-
__export(public_api_PublicApiService_connectquery_exports, {
|
|
2388
|
-
applePayValidateMerchant: () => applePayValidateMerchant,
|
|
2389
|
-
authorizeOneClickPayment: () => authorizeOneClickPayment,
|
|
2390
|
-
didBuyProduct: () => didBuyProduct,
|
|
2391
|
-
getAvailableCountForProduct: () => getAvailableCountForProduct,
|
|
2392
|
-
getNotificationSettings: () => getNotificationSettings,
|
|
2393
|
-
getNotificationSettingsDetails: () => getNotificationSettingsDetails,
|
|
2394
|
-
getOrder: () => getOrder,
|
|
2395
|
-
getOrderRetryUrl: () => getOrderRetryUrl,
|
|
2396
|
-
getPreOrderDetails: () => getPreOrderDetails,
|
|
2397
|
-
getShopProducts: () => getShopProducts,
|
|
2398
|
-
isOneClickPaymentAvailable: () => isOneClickPaymentAvailable,
|
|
2399
|
-
notifyUserAboutProductAvailability: () => notifyUserAboutProductAvailability,
|
|
2400
|
-
pushEvent: () => pushEvent,
|
|
2401
|
-
pushSendDeviceToken: () => pushSendDeviceToken,
|
|
2402
|
-
shouldShopProducts: () => shouldShopProducts,
|
|
2403
|
-
updateGlobalNotificationSettings: () => updateGlobalNotificationSettings,
|
|
2404
|
-
updateNotificationSettings: () => updateNotificationSettings,
|
|
2405
|
-
userPanelDeleteAccount: () => userPanelDeleteAccount,
|
|
2406
|
-
userPanelGetAudiobookDetails: () => userPanelGetAudiobookDetails,
|
|
2407
|
-
userPanelGetAudiobookDetailsDownloadURLs: () => userPanelGetAudiobookDetailsDownloadURLs,
|
|
2408
|
-
userPanelGetFileDetails: () => userPanelGetFileDetails,
|
|
2409
|
-
userPanelGetProducts: () => userPanelGetProducts,
|
|
2410
|
-
userPanelGetTicketDetails: () => userPanelGetTicketDetails,
|
|
2411
|
-
userPanelLogin: () => userPanelLogin,
|
|
2412
|
-
userPanelLoginWithCode: () => userPanelLoginWithCode,
|
|
2413
|
-
userPanelLogout: () => userPanelLogout
|
|
2414
|
-
});
|
|
2415
|
-
var getOrder = PublicApiService.method.getOrder;
|
|
2416
|
-
var getOrderRetryUrl = PublicApiService.method.getOrderRetryUrl;
|
|
2417
|
-
var userPanelLogin = PublicApiService.method.userPanelLogin;
|
|
2418
|
-
var userPanelLoginWithCode = PublicApiService.method.userPanelLoginWithCode;
|
|
2419
|
-
var userPanelLogout = PublicApiService.method.userPanelLogout;
|
|
2420
|
-
var userPanelDeleteAccount = PublicApiService.method.userPanelDeleteAccount;
|
|
2421
|
-
var userPanelGetProducts = PublicApiService.method.userPanelGetProducts;
|
|
2422
|
-
var userPanelGetAudiobookDetails = PublicApiService.method.userPanelGetAudiobookDetails;
|
|
2423
|
-
var userPanelGetAudiobookDetailsDownloadURLs = PublicApiService.method.userPanelGetAudiobookDetailsDownloadURLs;
|
|
2424
|
-
var userPanelGetFileDetails = PublicApiService.method.userPanelGetFileDetails;
|
|
2425
|
-
var userPanelGetTicketDetails = PublicApiService.method.userPanelGetTicketDetails;
|
|
2426
|
-
var pushSendDeviceToken = PublicApiService.method.pushSendDeviceToken;
|
|
2427
|
-
var pushEvent = PublicApiService.method.pushEvent;
|
|
2428
|
-
var shouldShopProducts = PublicApiService.method.shouldShopProducts;
|
|
2429
|
-
var getShopProducts = PublicApiService.method.getShopProducts;
|
|
2430
|
-
var didBuyProduct = PublicApiService.method.didBuyProduct;
|
|
2431
|
-
var getNotificationSettings = PublicApiService.method.getNotificationSettings;
|
|
2432
|
-
var getNotificationSettingsDetails = PublicApiService.method.getNotificationSettingsDetails;
|
|
2433
|
-
var updateGlobalNotificationSettings = PublicApiService.method.updateGlobalNotificationSettings;
|
|
2434
|
-
var updateNotificationSettings = PublicApiService.method.updateNotificationSettings;
|
|
2435
|
-
var getAvailableCountForProduct = PublicApiService.method.getAvailableCountForProduct;
|
|
2436
|
-
var isOneClickPaymentAvailable = PublicApiService.method.isOneClickPaymentAvailable;
|
|
2437
|
-
var getPreOrderDetails = PublicApiService.method.getPreOrderDetails;
|
|
2438
|
-
var applePayValidateMerchant = PublicApiService.method.applePayValidateMerchant;
|
|
2439
|
-
var authorizeOneClickPayment = PublicApiService.method.authorizeOneClickPayment;
|
|
2440
|
-
var notifyUserAboutProductAvailability = PublicApiService.method.notifyUserAboutProductAvailability;
|
|
2441
|
-
|
|
2442
|
-
// src/gen/proto/dashboard/v1/notifications-NotificationsService_connectquery.ts
|
|
2443
|
-
var notifications_NotificationsService_connectquery_exports = {};
|
|
2444
|
-
__export(notifications_NotificationsService_connectquery_exports, {
|
|
2445
|
-
createNotificationGroup: () => createNotificationGroup,
|
|
2446
|
-
createNotificationGroupUser: () => createNotificationGroupUser,
|
|
2447
|
-
createNotificationMessage: () => createNotificationMessage,
|
|
2448
|
-
createNotificationMessageJob: () => createNotificationMessageJob,
|
|
2449
|
-
createNotificationSetting: () => createNotificationSetting,
|
|
2450
|
-
createNotificationUser: () => createNotificationUser,
|
|
2451
|
-
deleteNotificationGroup: () => deleteNotificationGroup,
|
|
2452
|
-
deleteNotificationGroupUser: () => deleteNotificationGroupUser,
|
|
2453
|
-
deleteNotificationMessage: () => deleteNotificationMessage,
|
|
2454
|
-
deleteNotificationMessageJob: () => deleteNotificationMessageJob,
|
|
2455
|
-
deleteNotificationSetting: () => deleteNotificationSetting,
|
|
2456
|
-
deleteNotificationUser: () => deleteNotificationUser,
|
|
2457
|
-
getNotificationUserSettings: () => getNotificationUserSettings,
|
|
2458
|
-
getSentNotificationMessages: () => getSentNotificationMessages,
|
|
2459
|
-
getUserGroups: () => getUserGroups,
|
|
2460
|
-
readNotificationGroupUsers: () => readNotificationGroupUsers,
|
|
2461
|
-
readNotificationGroups: () => readNotificationGroups,
|
|
2462
|
-
readNotificationMessageJobs: () => readNotificationMessageJobs,
|
|
2463
|
-
readNotificationMessages: () => readNotificationMessages,
|
|
2464
|
-
readNotificationProducts: () => readNotificationProducts,
|
|
2465
|
-
readNotificationSetting: () => readNotificationSetting,
|
|
2466
|
-
readNotificationUsers: () => readNotificationUsers,
|
|
2467
|
-
updateNotificationGroup: () => updateNotificationGroup,
|
|
2468
|
-
updateNotificationGroupUser: () => updateNotificationGroupUser,
|
|
2469
|
-
updateNotificationMessage: () => updateNotificationMessage,
|
|
2470
|
-
updateNotificationMessageJob: () => updateNotificationMessageJob,
|
|
2471
|
-
updateNotificationSetting: () => updateNotificationSetting,
|
|
2472
|
-
updateNotificationUser: () => updateNotificationUser,
|
|
2473
|
-
updateUserGroups: () => updateUserGroups,
|
|
2474
|
-
verifyUserEmail: () => verifyUserEmail
|
|
2475
|
-
});
|
|
2476
|
-
|
|
2477
|
-
// src/gen/proto/dashboard/v1/notifications_pb.ts
|
|
2478
|
-
var import_codegenv27 = require("@bufbuild/protobuf/codegenv2");
|
|
2479
|
-
var import_wkt5 = require("@bufbuild/protobuf/wkt");
|
|
2480
|
-
|
|
2481
|
-
// src/gen/proto/dashboard/v1/product_pb.ts
|
|
2482
|
-
var import_codegenv26 = require("@bufbuild/protobuf/codegenv2");
|
|
2483
|
-
var import_wkt4 = require("@bufbuild/protobuf/wkt");
|
|
2484
|
-
var file_dashboard_v1_product = /* @__PURE__ */ (0, import_codegenv26.fileDesc)("ChpkYXNoYm9hcmQvdjEvcHJvZHVjdC5wcm90bxIUZGFzaGJvYXJkLnByb2R1Y3QudjEiNwogRXhjaGFuZ2VQcm9kdWN0SURzVG9OYW1lc1JlcXVlc3QSEwoLcHJvZHVjdF9pZHMYASADKAkiugEKIUV4Y2hhbmdlUHJvZHVjdElEc1RvTmFtZXNSZXNwb25zZRJgCg1wcm9kdWN0X25hbWVzGAEgAygLMkkuZGFzaGJvYXJkLnByb2R1Y3QudjEuRXhjaGFuZ2VQcm9kdWN0SURzVG9OYW1lc1Jlc3BvbnNlLlByb2R1Y3ROYW1lc0VudHJ5GjMKEVByb2R1Y3ROYW1lc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEieQobR2V0RmlsZUFjY2Vzc01lbWJlcnNSZXF1ZXN0EhIKCnByb2R1Y3RfaWQYASABKAkSEwoGc2VhcmNoGAIgASgJSACIAQESFwoKdmFyaWFudF9pZBgDIAEoCUgBiAEBQgkKB19zZWFyY2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LnByb2R1Y3QudjEuQm9vbFJlc3BvbnNlEn0KFEdldEZpbGVBY2Nlc3NNZW1iZXJzEjEuZGFzaGJvYXJkLnByb2R1Y3QudjEuR2V0RmlsZUFjY2Vzc01lbWJlcnNSZXF1ZXN0GjIuZGFzaGJvYXJkLnByb2R1Y3QudjEuR2V0RmlsZUFjY2Vzc01lbWJlcnNSZXNwb25zZRJxChBHaXZlQWNjZXNzVG9GaWxlEi0uZGFzaGJvYXJkLnByb2R1Y3QudjEuR2l2ZUFjY2Vzc1RvRmlsZVJlcXVlc3QaLi5kYXNoYm9hcmQucHJvZHVjdC52MS5HaXZlQWNjZXNzVG9GaWxlUmVzcG9uc2USdwoSUmVtb3ZlQWNjZXNzVG9GaWxlEi8uZGFzaGJvYXJkLnByb2R1Y3QudjEuUmVtb3ZlQWNjZXNzVG9GaWxlUmVxdWVzdBowLmRhc2hib2FyZC5wcm9kdWN0LnYxLlJlbW92ZUFjY2Vzc1RvRmlsZVJlc3BvbnNlYgZwcm90bzM", [import_wkt4.file_google_protobuf_empty, import_wkt4.file_google_protobuf_timestamp]);
|
|
2485
|
-
|
|
2486
|
-
// src/gen/proto/dashboard/v1/notifications_pb.ts
|
|
2487
|
-
var file_dashboard_v1_notifications = /* @__PURE__ */ (0, import_codegenv27.fileDesc)("CiBkYXNoYm9hcmQvdjEvbm90aWZpY2F0aW9ucy5wcm90bxIaZGFzaGJvYXJkLm5vdGlmaWNhdGlvbnMudjEiYAoWVmVyaWZ5VXNlckVtYWlsUmVxdWVzdBISCgVlbWFpbBgBIAEoCUgAiAEBEhEKBGNvZGUYAiABKAlIAYgBARIMCgRzbHVnGAMgASgJQggKBl9lbWFpbEIHCgVfY29kZSJ/ChdWZXJpZnlVc2VyRW1haWxSZXNwb25zZRIPCgJvaxgBIAEoCEgAiAEBEhkKDGFjY2Vzc190b2tlbhgCIAEoCUgBiAEBEhQKB3VzZXJfaWQYAyABKAlIAogBAUIFCgNfb2tCDwoNX2FjY2Vzc190b2tlbk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GlvbnMudjEuR2V0VXNlckdyb3Vwc1JlcXVlc3QaMS5kYXNoYm9hcmQubm90aWZpY2F0aW9ucy52MS5HZXRVc2VyR3JvdXBzUmVzcG9uc2USXwoQVXBkYXRlVXNlckdyb3VwcxIzLmRhc2hib2FyZC5ub3RpZmljYXRpb25zLnYxLlVwZGF0ZVVzZXJHcm91cHNSZXF1ZXN0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5YgZwcm90bzM", [import_wkt5.file_google_protobuf_timestamp, import_wkt5.file_google_protobuf_empty, file_dashboard_v1_product, file_common_v1_push_notifications]);
|
|
2488
|
-
var FailureMessage = /* @__PURE__ */ ((FailureMessage2) => {
|
|
2489
|
-
FailureMessage2[FailureMessage2["UNKNOWN"] = 0] = "UNKNOWN";
|
|
2490
|
-
FailureMessage2[FailureMessage2["PROJECT_NOT_FOUND"] = 1] = "PROJECT_NOT_FOUND";
|
|
2491
|
-
FailureMessage2[FailureMessage2["NOTIFICATION_SETTING_NOT_FOUND"] = 2] = "NOTIFICATION_SETTING_NOT_FOUND";
|
|
2492
|
-
FailureMessage2[FailureMessage2["CREATE_NOTIFICATION_SETTING_FAILED"] = 3] = "CREATE_NOTIFICATION_SETTING_FAILED";
|
|
2493
|
-
FailureMessage2[FailureMessage2["UPDATE_NOTIFICATION_SETTING_FAILED"] = 4] = "UPDATE_NOTIFICATION_SETTING_FAILED";
|
|
2494
|
-
FailureMessage2[FailureMessage2["DELETE_NOTIFICATION_SETTING_FAILED"] = 5] = "DELETE_NOTIFICATION_SETTING_FAILED";
|
|
2495
|
-
FailureMessage2[FailureMessage2["NOTIFICATION_GROUP_NOT_FOUND"] = 6] = "NOTIFICATION_GROUP_NOT_FOUND";
|
|
2496
|
-
FailureMessage2[FailureMessage2["NOTIFICATION_GROUPS_NOT_FOUND"] = 7] = "NOTIFICATION_GROUPS_NOT_FOUND";
|
|
2497
|
-
FailureMessage2[FailureMessage2["CREATE_NOTIFICATION_GROUP_FAILED"] = 8] = "CREATE_NOTIFICATION_GROUP_FAILED";
|
|
2498
|
-
FailureMessage2[FailureMessage2["UPDATE_NOTIFICATION_GROUP_FAILED"] = 9] = "UPDATE_NOTIFICATION_GROUP_FAILED";
|
|
2499
|
-
FailureMessage2[FailureMessage2["DELETE_NOTIFICATION_GROUP_FAILED"] = 10] = "DELETE_NOTIFICATION_GROUP_FAILED";
|
|
2500
|
-
FailureMessage2[FailureMessage2["NOTIFICATION_USER_NOT_FOUND"] = 11] = "NOTIFICATION_USER_NOT_FOUND";
|
|
2501
|
-
FailureMessage2[FailureMessage2["NOTIFICATION_USERS_NOT_FOUND"] = 12] = "NOTIFICATION_USERS_NOT_FOUND";
|
|
2502
|
-
FailureMessage2[FailureMessage2["CREATE_NOTIFICATION_USER_FAILED"] = 13] = "CREATE_NOTIFICATION_USER_FAILED";
|
|
2503
|
-
FailureMessage2[FailureMessage2["UPDATE_NOTIFICATION_USER_FAILED"] = 14] = "UPDATE_NOTIFICATION_USER_FAILED";
|
|
2504
|
-
FailureMessage2[FailureMessage2["DELETE_NOTIFICATION_USER_FAILED"] = 15] = "DELETE_NOTIFICATION_USER_FAILED";
|
|
2505
|
-
FailureMessage2[FailureMessage2["NOTIFICATION_GROUP_USER_NOT_FOUND"] = 16] = "NOTIFICATION_GROUP_USER_NOT_FOUND";
|
|
2506
|
-
FailureMessage2[FailureMessage2["CREATE_NOTIFICATION_GROUP_USER_FAILED"] = 17] = "CREATE_NOTIFICATION_GROUP_USER_FAILED";
|
|
2507
|
-
FailureMessage2[FailureMessage2["UPDATE_NOTIFICATION_GROUP_USER_FAILED"] = 18] = "UPDATE_NOTIFICATION_GROUP_USER_FAILED";
|
|
2508
|
-
FailureMessage2[FailureMessage2["DELETE_NOTIFICATION_GROUP_USER_FAILED"] = 19] = "DELETE_NOTIFICATION_GROUP_USER_FAILED";
|
|
2509
|
-
FailureMessage2[FailureMessage2["NOTIFICATION_MESSAGE_NOT_FOUND"] = 20] = "NOTIFICATION_MESSAGE_NOT_FOUND";
|
|
2510
|
-
FailureMessage2[FailureMessage2["NOTIFICATION_MESSAGES_NOT_FOUND"] = 21] = "NOTIFICATION_MESSAGES_NOT_FOUND";
|
|
2511
|
-
FailureMessage2[FailureMessage2["CREATE_NOTIFICATION_MESSAGE_FAILED"] = 22] = "CREATE_NOTIFICATION_MESSAGE_FAILED";
|
|
2512
|
-
FailureMessage2[FailureMessage2["UPDATE_NOTIFICATION_MESSAGE_FAILED"] = 23] = "UPDATE_NOTIFICATION_MESSAGE_FAILED";
|
|
2513
|
-
FailureMessage2[FailureMessage2["DELETE_NOTIFICATION_MESSAGE_FAILED"] = 24] = "DELETE_NOTIFICATION_MESSAGE_FAILED";
|
|
2514
|
-
FailureMessage2[FailureMessage2["NOTIFICATION_MESSAGE_JOB_NOT_FOUND"] = 25] = "NOTIFICATION_MESSAGE_JOB_NOT_FOUND";
|
|
2515
|
-
FailureMessage2[FailureMessage2["NOTIFICATION_MESSAGE_JOBS_NOT_FOUND"] = 26] = "NOTIFICATION_MESSAGE_JOBS_NOT_FOUND";
|
|
2516
|
-
FailureMessage2[FailureMessage2["CREATE_NOTIFICATION_MESSAGE_JOB_FAILED"] = 27] = "CREATE_NOTIFICATION_MESSAGE_JOB_FAILED";
|
|
2517
|
-
FailureMessage2[FailureMessage2["UPDATE_NOTIFICATION_MESSAGE_JOB_FAILED"] = 28] = "UPDATE_NOTIFICATION_MESSAGE_JOB_FAILED";
|
|
2518
|
-
FailureMessage2[FailureMessage2["DELETE_NOTIFICATION_MESSAGE_JOB_FAILED"] = 29] = "DELETE_NOTIFICATION_MESSAGE_JOB_FAILED";
|
|
2519
|
-
FailureMessage2[FailureMessage2["NOTIFICATION_SETTING_ALREADY_EXIST"] = 30] = "NOTIFICATION_SETTING_ALREADY_EXIST";
|
|
2520
|
-
FailureMessage2[FailureMessage2["NOTIFICATION_SETTING_SLUG_ALREADY_TAKEN"] = 31] = "NOTIFICATION_SETTING_SLUG_ALREADY_TAKEN";
|
|
2521
|
-
FailureMessage2[FailureMessage2["NOTIFICATION_USER_ALREADY_EXIST"] = 32] = "NOTIFICATION_USER_ALREADY_EXIST";
|
|
2522
|
-
FailureMessage2[FailureMessage2["NOTIFICATION_GROUP_ALREADY_EXIST"] = 33] = "NOTIFICATION_GROUP_ALREADY_EXIST";
|
|
2523
|
-
return FailureMessage2;
|
|
2524
|
-
})(FailureMessage || {});
|
|
2525
|
-
var NotificationsService = /* @__PURE__ */ (0, import_codegenv27.serviceDesc)(file_dashboard_v1_notifications, 0);
|
|
2526
|
-
|
|
2527
|
-
// src/gen/proto/dashboard/v1/notifications-NotificationsService_connectquery.ts
|
|
2528
|
-
var createNotificationSetting = NotificationsService.method.createNotificationSetting;
|
|
2529
|
-
var readNotificationSetting = NotificationsService.method.readNotificationSetting;
|
|
2530
|
-
var updateNotificationSetting = NotificationsService.method.updateNotificationSetting;
|
|
2531
|
-
var deleteNotificationSetting = NotificationsService.method.deleteNotificationSetting;
|
|
2532
|
-
var createNotificationGroup = NotificationsService.method.createNotificationGroup;
|
|
2533
|
-
var readNotificationGroups = NotificationsService.method.readNotificationGroups;
|
|
2534
|
-
var updateNotificationGroup = NotificationsService.method.updateNotificationGroup;
|
|
2535
|
-
var deleteNotificationGroup = NotificationsService.method.deleteNotificationGroup;
|
|
2536
|
-
var createNotificationUser = NotificationsService.method.createNotificationUser;
|
|
2537
|
-
var readNotificationUsers = NotificationsService.method.readNotificationUsers;
|
|
2538
|
-
var updateNotificationUser = NotificationsService.method.updateNotificationUser;
|
|
2539
|
-
var deleteNotificationUser = NotificationsService.method.deleteNotificationUser;
|
|
2540
|
-
var createNotificationGroupUser = NotificationsService.method.createNotificationGroupUser;
|
|
2541
|
-
var readNotificationGroupUsers = NotificationsService.method.readNotificationGroupUsers;
|
|
2542
|
-
var updateNotificationGroupUser = NotificationsService.method.updateNotificationGroupUser;
|
|
2543
|
-
var deleteNotificationGroupUser = NotificationsService.method.deleteNotificationGroupUser;
|
|
2544
|
-
var createNotificationMessage = NotificationsService.method.createNotificationMessage;
|
|
2545
|
-
var readNotificationMessages = NotificationsService.method.readNotificationMessages;
|
|
2546
|
-
var getSentNotificationMessages = NotificationsService.method.getSentNotificationMessages;
|
|
2547
|
-
var updateNotificationMessage = NotificationsService.method.updateNotificationMessage;
|
|
2548
|
-
var deleteNotificationMessage = NotificationsService.method.deleteNotificationMessage;
|
|
2549
|
-
var createNotificationMessageJob = NotificationsService.method.createNotificationMessageJob;
|
|
2550
|
-
var readNotificationMessageJobs = NotificationsService.method.readNotificationMessageJobs;
|
|
2551
|
-
var updateNotificationMessageJob = NotificationsService.method.updateNotificationMessageJob;
|
|
2552
|
-
var deleteNotificationMessageJob = NotificationsService.method.deleteNotificationMessageJob;
|
|
2553
|
-
var readNotificationProducts = NotificationsService.method.readNotificationProducts;
|
|
2554
|
-
var getNotificationUserSettings = NotificationsService.method.getNotificationUserSettings;
|
|
2555
|
-
var verifyUserEmail = NotificationsService.method.verifyUserEmail;
|
|
2556
|
-
var getUserGroups = NotificationsService.method.getUserGroups;
|
|
2557
|
-
var updateUserGroups = NotificationsService.method.updateUserGroups;
|
|
2558
|
-
|
|
2559
|
-
// src/rpc-provider.tsx
|
|
2560
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2561
|
-
console.log("HOST", HOST);
|
|
2562
|
-
var currentFinalTransportHost;
|
|
2563
|
-
var finalTransport;
|
|
2564
|
-
BigInt.prototype.toJSON = function() {
|
|
2565
|
-
return this.toString();
|
|
2566
|
-
};
|
|
2567
|
-
var rpcProvider = {
|
|
2568
|
-
publicApi: public_api_PublicApiService_connectquery_exports,
|
|
2569
|
-
notifications: notifications_NotificationsService_connectquery_exports
|
|
2570
|
-
};
|
|
2571
|
-
var useQuery4 = import_connect_query.useQuery;
|
|
2572
|
-
var useMutation3 = import_connect_query.useMutation;
|
|
2573
|
-
var RpcProvider = ({ children }) => {
|
|
2574
|
-
if (finalTransport == null || currentFinalTransportHost !== HOST) {
|
|
2575
|
-
currentFinalTransportHost = HOST;
|
|
2576
|
-
finalTransport = (0, import_connect_web2.createConnectTransport)({
|
|
2577
|
-
baseUrl: HOST + "/api/rpc",
|
|
2578
|
-
useBinaryFormat: true,
|
|
2579
|
-
// @ts-ignore
|
|
2580
|
-
fetch: async (input, init) => {
|
|
2581
|
-
return fetch(input, {
|
|
2582
|
-
...init,
|
|
2583
|
-
keepalive: false,
|
|
2584
|
-
credentials: "include"
|
|
2585
|
-
});
|
|
2586
|
-
}
|
|
2587
|
-
});
|
|
2588
|
-
}
|
|
2589
|
-
const [queryClient] = (0, import_react9.useState)(
|
|
2590
|
-
() => new import_react_query5.QueryClient({
|
|
2591
|
-
defaultOptions: { queries: { staleTime: 5e3 } }
|
|
2592
|
-
})
|
|
2593
|
-
);
|
|
2594
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_connect_query.TransportProvider, { transport: finalTransport, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_react_query5.QueryClientProvider, { client: queryClient, children }) });
|
|
2595
|
-
};
|
|
2596
|
-
|
|
2597
|
-
// src/components/notifications/NotificationsComponentPublic.tsx
|
|
2598
|
-
var import_react_query6 = require("@tanstack/react-query");
|
|
2599
|
-
var import_lucide_react11 = require("lucide-react");
|
|
2600
|
-
|
|
2601
|
-
// src/components/notifications/constants.tsx
|
|
2602
|
-
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2603
|
-
var DEFAULT_TEXTS = {
|
|
2604
|
-
title: null,
|
|
2605
|
-
description: null,
|
|
2606
|
-
managingDescription: "Zarz\u0105dzaj rodzajami powiadomie\u0144 i sposobem dostarczania.",
|
|
2607
|
-
formTitle: "Podaj Email aby zapisa\u0107 si\u0119\xA0do powiadomie\u0144",
|
|
2608
|
-
formEmailLabel: "Email",
|
|
2609
|
-
formPhoneLabel: "Numer telefonu",
|
|
2610
|
-
formPhoneOptional: "(opcjonalnie)",
|
|
2611
|
-
formEmailPlaceholder: "np. mail@gmail...",
|
|
2612
|
-
formPhonePlaceholder: "np. 663...",
|
|
2613
|
-
formSubmitButton: "Zapisz si\u0119",
|
|
2614
|
-
formSuccessMessage: "Zapisa\u0142e\u015B si\u0119 do powiadomie\u0144.",
|
|
2615
|
-
agreementText: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
2616
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { style: { color: "red" }, children: "*" }),
|
|
2617
|
-
"Wyra\u017Cam zgod\u0119 na przetwarzanie moich danych w celach marketingowych zgodnie z",
|
|
2618
|
-
" ",
|
|
2619
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2620
|
-
"a",
|
|
2621
|
-
{
|
|
2622
|
-
href: "/regulations/polityka-prywatnosci",
|
|
2623
|
-
target: "_blank",
|
|
2624
|
-
className: "cursor-alias font-bold hover:font-medium",
|
|
2625
|
-
children: "regulaminem"
|
|
2626
|
-
}
|
|
2627
|
-
),
|
|
2628
|
-
" ",
|
|
2629
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-xs font-light", children: "(zgod\u0119 mo\u017Cna w ka\u017Cdej chwili wycofa\u0107)" })
|
|
2630
|
-
] }),
|
|
2631
|
-
qrCodeTitle: "lub zainstaluj aplikacj\u0119 mobiln\u0105",
|
|
2632
|
-
qrCodeSubtitle: "Aplikacja mobilna",
|
|
2633
|
-
qrCodeScanText: "zeskanuj kod QR",
|
|
2634
|
-
groupsNoSelectionWarning: "Je\u015Bli \u017Cadna z grup nie jest zaznaczona, nie otrzymasz \u017Cadnych powiadomie\u0144.",
|
|
2635
|
-
groupsSelectAllButton: "Zaznacz wszystkie",
|
|
2636
|
-
groupsUpdateButton: "Aktualizuj",
|
|
2637
|
-
groupsUpdateSuccess: "Zaktualizowano pomy\u015Blnie.",
|
|
2638
|
-
groupsTitle: "Zarz\u0105dzaj grupami z kt\xF3rych chcesz otrzymywa\u0107 powiadomienia",
|
|
2639
|
-
manageDataTitle: "Ustawienia powiadomie\u0144",
|
|
2640
|
-
manageDataDescription: "W jaki spos\xF3b chcesz otrzymywa\u0107 powiadomienia?",
|
|
2641
|
-
manageDataUnsubscribeButton: "Odsubskrybuj",
|
|
2642
|
-
manageDataUpdatedMessage: "Zaktualizowano",
|
|
2643
|
-
manageDataUnsubscribeDescription: "Wypisz mnie z wszystkich powiadomie\u0144 i grup.",
|
|
2644
|
-
loginEmailLabel: "Email",
|
|
2645
|
-
loginEmailPlaceholder: "Wprowad\u017A sw\xF3j email",
|
|
2646
|
-
loginSendCodeButton: "Wy\u015Blij kod weryfikacyjny",
|
|
2647
|
-
loginSendingButton: "Wysy\u0142anie...",
|
|
2648
|
-
loginCodeLabel: "Wprowad\u017A kod weryfikacyjny",
|
|
2649
|
-
loginCodeSentMessage: "Wys\u0142ali\u015Bmy kod weryfikacyjny na adres",
|
|
2650
|
-
loginChangeEmailButton: "Popraw email",
|
|
2651
|
-
loginResendCodeButton: "Wy\u015Blij kod ponownie",
|
|
2652
|
-
loginInvalidEmailError: "Wprowad\u017A prawid\u0142owy adres email",
|
|
2653
|
-
loginSlugRequiredError: "Wymagany jest identyfikator projektu",
|
|
2654
|
-
loginInvalidCodeError: "Nieprawid\u0142owy kod weryfikacyjny",
|
|
2655
|
-
loginVerificationFailedError: "Weryfikacja nie powiod\u0142a si\u0119. Sprawd\u017A sw\xF3j kod.",
|
|
2656
|
-
loginSendEmailError: "Nie uda\u0142o si\u0119 wys\u0142a\u0107 kodu weryfikacyjnego",
|
|
2657
|
-
loginVerifyCodeError: "Nie uda\u0142o si\u0119 zweryfikowa\u0107 kodu",
|
|
2658
|
-
loginResendEmailError: "Nie uda\u0142o si\u0119 ponownie wys\u0142a\u0107 kodu weryfikacyjnego",
|
|
2659
|
-
loginTitle: "Wpisz email aby zarz\u0105dza\u0107 powiadomieniami",
|
|
2660
|
-
loginDescription: "Dostaniesz kod weryfikacyjny na email.",
|
|
2661
|
-
loginIHaveCode: "Mam ju\u017C kod"
|
|
2662
|
-
};
|
|
2663
|
-
|
|
2664
|
-
// src/ui/button.tsx
|
|
2665
|
-
var import_react_slot = require("@radix-ui/react-slot");
|
|
2666
|
-
var import_class_variance_authority = require("class-variance-authority");
|
|
2667
|
-
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2668
|
-
var buttonVariants = (0, import_class_variance_authority.cva)(
|
|
2669
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
2670
|
-
{
|
|
2671
|
-
variants: {
|
|
2672
|
-
variant: {
|
|
2673
|
-
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
2674
|
-
destructive: "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
2675
|
-
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
2676
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
2677
|
-
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
2678
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
2679
|
-
},
|
|
2680
|
-
size: {
|
|
2681
|
-
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
2682
|
-
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
|
|
2683
|
-
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
|
|
2684
|
-
icon: "size-9",
|
|
2685
|
-
"icon-sm": "size-8",
|
|
2686
|
-
"icon-lg": "size-10"
|
|
2687
|
-
}
|
|
2688
|
-
},
|
|
2689
|
-
defaultVariants: {
|
|
2690
|
-
variant: "default",
|
|
2691
|
-
size: "default"
|
|
2692
|
-
}
|
|
2693
|
-
}
|
|
2694
|
-
);
|
|
2695
|
-
function Button({
|
|
2696
|
-
className,
|
|
2697
|
-
variant,
|
|
2698
|
-
size,
|
|
2699
|
-
asChild = false,
|
|
2700
|
-
...props
|
|
2701
|
-
}) {
|
|
2702
|
-
const Comp = asChild ? import_react_slot.Slot : "button";
|
|
2703
|
-
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2704
|
-
Comp,
|
|
2705
|
-
{
|
|
2706
|
-
"data-slot": "button",
|
|
2707
|
-
className: cn(buttonVariants({ variant, size, className })),
|
|
2708
|
-
...props
|
|
2709
|
-
}
|
|
2710
|
-
);
|
|
2711
|
-
}
|
|
2712
|
-
|
|
2713
|
-
// src/components/notifications/NotificationHeader.tsx
|
|
2714
|
-
var import_lucide_react2 = require("lucide-react");
|
|
2715
|
-
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2716
|
-
function NotificationHeader({
|
|
2717
|
-
projectName,
|
|
2718
|
-
projectLogo,
|
|
2719
|
-
projectLogoDark,
|
|
2720
|
-
description,
|
|
2721
|
-
className,
|
|
2722
|
-
onLogout
|
|
2723
|
-
}) {
|
|
2724
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
2725
|
-
projectLogo != null || projectName != null && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2726
|
-
"h2",
|
|
2727
|
-
{
|
|
2728
|
-
className: cn(
|
|
2729
|
-
"flex max-w-44 items-center gap-3 text-lg font-medium text-black sm:max-w-none md:text-xl lg:text-2xl xl:text-3xl dark:text-neutral-100",
|
|
2730
|
-
className == null ? void 0 : className.headerTitle
|
|
2731
|
-
),
|
|
2732
|
-
children: [
|
|
2733
|
-
projectLogo != null && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
2734
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2735
|
-
"img",
|
|
2736
|
-
{
|
|
2737
|
-
src: projectLogo,
|
|
2738
|
-
alt: "",
|
|
2739
|
-
className: cn(
|
|
2740
|
-
"h-12 w-auto dark:hidden",
|
|
2741
|
-
className == null ? void 0 : className.headerLogo
|
|
2742
|
-
)
|
|
2743
|
-
}
|
|
2744
|
-
),
|
|
2745
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2746
|
-
"img",
|
|
2747
|
-
{
|
|
2748
|
-
src: projectLogoDark != null ? projectLogoDark : projectLogo,
|
|
2749
|
-
alt: "",
|
|
2750
|
-
className: cn(
|
|
2751
|
-
"hidden h-12 w-auto dark:inline",
|
|
2752
|
-
className == null ? void 0 : className.headerLogo
|
|
2753
|
-
)
|
|
2754
|
-
}
|
|
2755
|
-
)
|
|
2756
|
-
] }),
|
|
2757
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: projectName })
|
|
2758
|
-
]
|
|
2759
|
-
}
|
|
2760
|
-
),
|
|
2761
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
2762
|
-
description && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2763
|
-
"p",
|
|
2764
|
-
{
|
|
2765
|
-
className: cn(
|
|
2766
|
-
"mt-4 font-medium text-left",
|
|
2767
|
-
className == null ? void 0 : className.headerDescription
|
|
2768
|
-
),
|
|
2769
|
-
children: description
|
|
2770
|
-
}
|
|
2771
|
-
),
|
|
2772
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "grow" }),
|
|
2773
|
-
onLogout && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Button, { variant: "ghost", size: "icon-sm", onClick: onLogout, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react2.LogOutIcon, { className: "h-5 w-5" }) })
|
|
2774
|
-
] })
|
|
2775
|
-
] });
|
|
2776
|
-
}
|
|
2777
|
-
|
|
2778
|
-
// src/ui/switch.tsx
|
|
2779
|
-
var SwitchPrimitive = __toESM(require("@radix-ui/react-switch"));
|
|
2780
|
-
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
2781
|
-
function Switch({
|
|
2782
|
-
className,
|
|
2783
|
-
...props
|
|
2784
|
-
}) {
|
|
2785
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2786
|
-
SwitchPrimitive.Root,
|
|
2787
|
-
{
|
|
2788
|
-
"data-slot": "switch",
|
|
2789
|
-
className: cn(
|
|
2790
|
-
"peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
2791
|
-
className
|
|
2792
|
-
),
|
|
2793
|
-
...props,
|
|
2794
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
2795
|
-
SwitchPrimitive.Thumb,
|
|
2796
|
-
{
|
|
2797
|
-
"data-slot": "switch-thumb",
|
|
2798
|
-
className: cn(
|
|
2799
|
-
"bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0"
|
|
2800
|
-
)
|
|
2801
|
-
}
|
|
2802
|
-
)
|
|
2803
|
-
}
|
|
2804
|
-
);
|
|
2805
|
-
}
|
|
2806
|
-
|
|
2807
|
-
// src/components/notifications/NotificationGroupsList.tsx
|
|
2808
|
-
var import_react10 = require("@formkit/auto-animate/react");
|
|
2809
|
-
var import_lucide_react4 = require("lucide-react");
|
|
2810
|
-
|
|
2811
|
-
// src/ui/popover.tsx
|
|
2812
|
-
var PopoverPrimitive = __toESM(require("@radix-ui/react-popover"));
|
|
2813
|
-
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
2814
|
-
function Popover({
|
|
2815
|
-
...props
|
|
2816
|
-
}) {
|
|
2817
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PopoverPrimitive.Root, { "data-slot": "popover", ...props });
|
|
2818
|
-
}
|
|
2819
|
-
function PopoverTrigger({
|
|
2820
|
-
...props
|
|
2821
|
-
}) {
|
|
2822
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PopoverPrimitive.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
2823
|
-
}
|
|
2824
|
-
function PopoverContent({
|
|
2825
|
-
className,
|
|
2826
|
-
align = "center",
|
|
2827
|
-
sideOffset = 4,
|
|
2828
|
-
...props
|
|
2829
|
-
}) {
|
|
2830
|
-
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(PopoverPrimitive.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
2831
|
-
PopoverPrimitive.Content,
|
|
2832
|
-
{
|
|
2833
|
-
"data-slot": "popover-content",
|
|
2834
|
-
align,
|
|
2835
|
-
sideOffset,
|
|
2836
|
-
className: cn(
|
|
2837
|
-
"bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
|
|
2838
|
-
className
|
|
2839
|
-
),
|
|
2840
|
-
...props
|
|
2841
|
-
}
|
|
2842
|
-
) });
|
|
2843
|
-
}
|
|
2844
|
-
|
|
2845
|
-
// src/components/notifications/HowOftenComponent.tsx
|
|
2846
|
-
var import_lucide_react3 = require("lucide-react");
|
|
2847
|
-
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
2848
|
-
function HowOftenComponent({ regularity }) {
|
|
2849
|
-
let text = "";
|
|
2850
|
-
switch (regularity) {
|
|
2851
|
-
case "rarely":
|
|
2852
|
-
text = "rzadko";
|
|
2853
|
-
break;
|
|
2854
|
-
case "often":
|
|
2855
|
-
text = "cz\u0119sto";
|
|
2856
|
-
break;
|
|
2857
|
-
case "very_often":
|
|
2858
|
-
text = "codzienne";
|
|
2859
|
-
break;
|
|
2860
|
-
}
|
|
2861
|
-
return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(Popover, { children: [
|
|
2862
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
2863
|
-
PopoverTrigger,
|
|
2864
|
-
{
|
|
2865
|
-
onClick: (e) => {
|
|
2866
|
-
e.stopPropagation();
|
|
2867
|
-
},
|
|
2868
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
2869
|
-
"button",
|
|
2870
|
-
{
|
|
2871
|
-
type: "button",
|
|
2872
|
-
className: "flex w-[30%] cursor-help flex-col items-center justify-center text-xs md:w-[25%] xl:w-[20%]",
|
|
2873
|
-
children: [
|
|
2874
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_lucide_react3.ClockIcon, { size: 12 }),
|
|
2875
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { children: text })
|
|
2876
|
-
]
|
|
2877
|
-
}
|
|
2878
|
-
)
|
|
2879
|
-
}
|
|
2880
|
-
),
|
|
2881
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PopoverContent, { className: "w-80", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "grid gap-4", children: [
|
|
2882
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: "space-y-2", children: [
|
|
2883
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("h4", { className: "leading-none font-medium", children: "Co to oznacza?" }),
|
|
2884
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("ul", { className: "list-inside list-disc text-sm", children: [
|
|
2885
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { children: [
|
|
2886
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "font-semibold", children: "Rzadko" }),
|
|
2887
|
-
" \u2013 powiadomienia b\u0119d\u0105 wysy\u0142ane maksymalnie kilka razy w miesi\u0105cu."
|
|
2888
|
-
] }),
|
|
2889
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { children: [
|
|
2890
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "font-semibold", children: "Cz\u0119sto" }),
|
|
2891
|
-
" \u2013 powiadomienia mog\u0119 by\u0107 wysy\u0142ane kilka razy w tygodniu."
|
|
2892
|
-
] }),
|
|
2893
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("li", { children: [
|
|
2894
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("span", { className: "font-semibold", children: "Codzienne" }),
|
|
2895
|
-
" \u2013 powiadomienia b\u0119d\u0105 wysy\u0142ane nawet codziennie."
|
|
2896
|
-
] })
|
|
2897
|
-
] })
|
|
2898
|
-
] }),
|
|
2899
|
-
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: "grid gap-2" })
|
|
2900
|
-
] }) })
|
|
2901
|
-
] });
|
|
2902
|
-
}
|
|
2903
|
-
|
|
2904
|
-
// src/ui/card.tsx
|
|
2905
|
-
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
2906
|
-
function Card({ className, ...props }) {
|
|
2907
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2908
|
-
"div",
|
|
2909
|
-
{
|
|
2910
|
-
"data-slot": "card",
|
|
2911
|
-
className: cn(
|
|
2912
|
-
"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",
|
|
2913
|
-
className
|
|
2914
|
-
),
|
|
2915
|
-
...props
|
|
2916
|
-
}
|
|
2917
|
-
);
|
|
2918
|
-
}
|
|
2919
|
-
function CardHeader({ className, ...props }) {
|
|
2920
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2921
|
-
"div",
|
|
2922
|
-
{
|
|
2923
|
-
"data-slot": "card-header",
|
|
2924
|
-
className: cn(
|
|
2925
|
-
"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
|
|
2926
|
-
className
|
|
2927
|
-
),
|
|
2928
|
-
...props
|
|
2929
|
-
}
|
|
2930
|
-
);
|
|
2931
|
-
}
|
|
2932
|
-
function CardTitle({ className, ...props }) {
|
|
2933
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2934
|
-
"div",
|
|
2935
|
-
{
|
|
2936
|
-
"data-slot": "card-title",
|
|
2937
|
-
className: cn("leading-none font-semibold", className),
|
|
2938
|
-
...props
|
|
2939
|
-
}
|
|
2940
|
-
);
|
|
2941
|
-
}
|
|
2942
|
-
function CardDescription({ className, ...props }) {
|
|
2943
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2944
|
-
"div",
|
|
2945
|
-
{
|
|
2946
|
-
"data-slot": "card-description",
|
|
2947
|
-
className: cn("text-muted-foreground text-sm", className),
|
|
2948
|
-
...props
|
|
2949
|
-
}
|
|
2950
|
-
);
|
|
2951
|
-
}
|
|
2952
|
-
function CardContent({ className, ...props }) {
|
|
2953
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
2954
|
-
"div",
|
|
2955
|
-
{
|
|
2956
|
-
"data-slot": "card-content",
|
|
2957
|
-
className: cn("px-6", className),
|
|
2958
|
-
...props
|
|
2959
|
-
}
|
|
2960
|
-
);
|
|
2961
|
-
}
|
|
2962
|
-
|
|
2963
|
-
// src/components/notifications/NotificationGroupsList.tsx
|
|
2964
|
-
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
2965
|
-
function NotificationGroupsList({
|
|
2966
|
-
groups = [],
|
|
2967
|
-
isManaging,
|
|
2968
|
-
onToggle,
|
|
2969
|
-
onCheckAll,
|
|
2970
|
-
onUpdate,
|
|
2971
|
-
isUpdating,
|
|
2972
|
-
wasChanged,
|
|
2973
|
-
isUserGroupsUpdated,
|
|
2974
|
-
className,
|
|
2975
|
-
texts
|
|
2976
|
-
}) {
|
|
2977
|
-
var _a, _b, _c, _d, _e;
|
|
2978
|
-
const [groupsParent] = (0, import_react10.useAutoAnimate)();
|
|
2979
|
-
const [updateGroupsParent] = (0, import_react10.useAutoAnimate)();
|
|
2980
|
-
const hasNoSelection = groups.filter((group) => group.isOn === false).length > 0;
|
|
2981
|
-
const hasUnchecked = groups.filter((group) => group.isOn === false).length > 0;
|
|
2982
|
-
if (groups.length <= 1 && isManaging != true) {
|
|
2983
|
-
return null;
|
|
2984
|
-
}
|
|
2985
|
-
const content = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2986
|
-
"div",
|
|
2987
|
-
{
|
|
2988
|
-
ref: groupsParent,
|
|
2989
|
-
className: cn("my-5 flex flex-col gap-3", className == null ? void 0 : className.groupsList),
|
|
2990
|
-
children: [
|
|
2991
|
-
groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
2992
|
-
"div",
|
|
2993
|
-
{
|
|
2994
|
-
id: group.id,
|
|
2995
|
-
role: "button",
|
|
2996
|
-
className: cn(
|
|
2997
|
-
group.isOn ? "bg-neutral-50 hover:bg-transparent shadow-sm border-transparent dark:bg-neutral-800" : "border-neutral-200 hover:bg-neutral-50 dark:hover:border-neutral-800 shadow-sm dark:border-neutral-800",
|
|
2998
|
-
"active:bg-beige-300 flex w-full cursor-pointer items-center gap-3 rounded-xl border px-3 py-2 transition active:dark:bg-neutral-900",
|
|
2999
|
-
className == null ? void 0 : className.groupItem
|
|
3000
|
-
),
|
|
3001
|
-
onClick: (e) => {
|
|
3002
|
-
if (e.target instanceof HTMLButtonElement) {
|
|
3003
|
-
return;
|
|
3004
|
-
}
|
|
3005
|
-
onToggle(group.id);
|
|
3006
|
-
},
|
|
3007
|
-
children: [
|
|
3008
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3009
|
-
Switch,
|
|
3010
|
-
{
|
|
3011
|
-
checked: group.isOn,
|
|
3012
|
-
className: "data-[state=checked]:bg-blue-500 dark:data-[state=unchecked]:bg-neutral-700",
|
|
3013
|
-
onCheckedChange: () => {
|
|
3014
|
-
onToggle(group.id);
|
|
3015
|
-
}
|
|
3016
|
-
}
|
|
3017
|
-
),
|
|
3018
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex flex-col items-start justify-start", children: [
|
|
3019
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "font-medium text-sm", children: group.name }),
|
|
3020
|
-
group.description && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("p", { className: "text-xs font-light", children: group.description })
|
|
3021
|
-
] }),
|
|
3022
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "grow" }),
|
|
3023
|
-
group.howOften && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(HowOftenComponent, { regularity: group.howOften })
|
|
3024
|
-
]
|
|
3025
|
-
},
|
|
3026
|
-
group.id
|
|
3027
|
-
)),
|
|
3028
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex gap-2", children: [
|
|
3029
|
-
isManaging === true && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
|
|
3030
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
3031
|
-
"div",
|
|
3032
|
-
{
|
|
3033
|
-
ref: updateGroupsParent,
|
|
3034
|
-
className: "flex flex-col items-start justify-start",
|
|
3035
|
-
children: [
|
|
3036
|
-
wasChanged && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(
|
|
3037
|
-
Button,
|
|
3038
|
-
{
|
|
3039
|
-
variant: "default",
|
|
3040
|
-
size: "sm",
|
|
3041
|
-
className: "relative",
|
|
3042
|
-
disabled: isUpdating,
|
|
3043
|
-
onClick: onUpdate,
|
|
3044
|
-
children: [
|
|
3045
|
-
(_a = texts == null ? void 0 : texts.groupsUpdateButton) != null ? _a : DEFAULT_TEXTS.groupsUpdateButton,
|
|
3046
|
-
isUpdating && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Spinner, {}) })
|
|
3047
|
-
]
|
|
3048
|
-
}
|
|
3049
|
-
),
|
|
3050
|
-
isUserGroupsUpdated && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("p", { className: "mt-3 flex items-center gap-2 text-sm text-green-500", children: [
|
|
3051
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react4.CheckCircleIcon, { color: "var(--color-green-500", size: 16 }),
|
|
3052
|
-
" ",
|
|
3053
|
-
(_b = texts == null ? void 0 : texts.groupsUpdateSuccess) != null ? _b : DEFAULT_TEXTS.groupsUpdateSuccess
|
|
3054
|
-
] })
|
|
3055
|
-
]
|
|
3056
|
-
}
|
|
3057
|
-
),
|
|
3058
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "grow" })
|
|
3059
|
-
] }),
|
|
3060
|
-
hasUnchecked && /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", { className: "flex justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3061
|
-
Button,
|
|
3062
|
-
{
|
|
3063
|
-
className: "cursor-pointer dark:bg-neutral-700",
|
|
3064
|
-
onClick: onCheckAll,
|
|
3065
|
-
size: "sm",
|
|
3066
|
-
variant: "secondary",
|
|
3067
|
-
type: "button",
|
|
3068
|
-
children: (_c = texts == null ? void 0 : texts.groupsSelectAllButton) != null ? _c : DEFAULT_TEXTS.groupsSelectAllButton
|
|
3069
|
-
}
|
|
3070
|
-
) })
|
|
3071
|
-
] }),
|
|
3072
|
-
hasNoSelection && /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "flex text-left gap-2 text-xs text-yellow-500", children: [
|
|
3073
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lucide_react4.TriangleAlertIcon, { color: "orange", size: 16 }),
|
|
3074
|
-
(_d = texts == null ? void 0 : texts.groupsNoSelectionWarning) != null ? _d : DEFAULT_TEXTS.groupsNoSelectionWarning
|
|
3075
|
-
] })
|
|
3076
|
-
]
|
|
3077
|
-
}
|
|
3078
|
-
);
|
|
3079
|
-
if (isManaging == true) {
|
|
3080
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(Card, { className: "mt-5 text-left", children: [
|
|
3081
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CardHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CardTitle, { children: (_e = texts == null ? void 0 : texts.groupsTitle) != null ? _e : DEFAULT_TEXTS.groupsTitle }) }),
|
|
3082
|
-
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CardContent, { children: content })
|
|
3083
|
-
] });
|
|
3084
|
-
}
|
|
3085
|
-
return content;
|
|
3086
|
-
}
|
|
3087
|
-
|
|
3088
|
-
// src/components/notifications/QRCodeSection.tsx
|
|
3089
|
-
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
3090
|
-
function QRCodeSection({
|
|
3091
|
-
showQRCode = true,
|
|
3092
|
-
isManaging,
|
|
3093
|
-
className,
|
|
3094
|
-
texts
|
|
3095
|
-
}) {
|
|
3096
|
-
var _a, _b, _c, _d;
|
|
3097
|
-
const isBrowser = typeof window !== "undefined";
|
|
3098
|
-
const darkMode = isBrowser ? ((_a = window.matchMedia) == null ? void 0 : _a.call(window, "(prefers-color-scheme: dark)").matches) ? true : false : false;
|
|
3099
|
-
function getURL(isBrowser2) {
|
|
3100
|
-
if (isBrowser2) {
|
|
3101
|
-
return window.location.href;
|
|
3102
|
-
}
|
|
3103
|
-
return "";
|
|
3104
|
-
}
|
|
3105
|
-
if (!showQRCode) {
|
|
3106
|
-
return null;
|
|
3107
|
-
}
|
|
3108
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3109
|
-
Card,
|
|
3110
|
-
{
|
|
3111
|
-
className: cn(
|
|
3112
|
-
"bg-beige-100 rounded-xl p-4 dark:bg-neutral-700",
|
|
3113
|
-
className == null ? void 0 : className.qrCodeSection
|
|
3114
|
-
),
|
|
3115
|
-
children: [
|
|
3116
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CardHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3117
|
-
CardTitle,
|
|
3118
|
-
{
|
|
3119
|
-
className: cn(
|
|
3120
|
-
"mb-3 text-base font-medium lg:text-lg",
|
|
3121
|
-
className == null ? void 0 : className.qrCodeTitle
|
|
3122
|
-
),
|
|
3123
|
-
children: [
|
|
3124
|
-
(_b = texts == null ? void 0 : texts.qrCodeSubtitle) != null ? _b : DEFAULT_TEXTS.qrCodeSubtitle,
|
|
3125
|
-
" " + ((_c = texts == null ? void 0 : texts.qrCodeTitle) != null ? _c : DEFAULT_TEXTS.qrCodeTitle)
|
|
3126
|
-
]
|
|
3127
|
-
}
|
|
3128
|
-
) }),
|
|
3129
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(CardContent, { className: "flex flex-col items-center gap-2", children: [
|
|
3130
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "mt-1.5 mb-3 flex items-center gap-x-2", children: [
|
|
3131
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3132
|
-
"a",
|
|
3133
|
-
{
|
|
3134
|
-
href: "https://apps.apple.com/us/app/bitsnap/id6741902807",
|
|
3135
|
-
target: "_blank",
|
|
3136
|
-
className: "max-w-28 flex-1 basis-1/2 lg:max-w-36",
|
|
3137
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3138
|
-
"img",
|
|
3139
|
-
{
|
|
3140
|
-
className: "h-auto w-full",
|
|
3141
|
-
src: HOST + "/app-store-logo.png",
|
|
3142
|
-
alt: "Download on App Store"
|
|
3143
|
-
}
|
|
3144
|
-
)
|
|
3145
|
-
}
|
|
3146
|
-
),
|
|
3147
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3148
|
-
"a",
|
|
3149
|
-
{
|
|
3150
|
-
href: "https://play.google.com/store/apps/details?id=com.bitsnap.Bitsnap&pli=1",
|
|
3151
|
-
target: "_blank",
|
|
3152
|
-
className: "max-w-28 flex-1 basis-1/2 lg:max-w-36",
|
|
3153
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3154
|
-
"img",
|
|
3155
|
-
{
|
|
3156
|
-
className: "h-auto w-full",
|
|
3157
|
-
src: HOST + "/google-play-logo.png",
|
|
3158
|
-
alt: "Get in on Google Play"
|
|
3159
|
-
}
|
|
3160
|
-
)
|
|
3161
|
-
}
|
|
3162
|
-
)
|
|
3163
|
-
] }),
|
|
3164
|
-
isBrowser && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
3165
|
-
"div",
|
|
3166
|
-
{
|
|
3167
|
-
className: cn(
|
|
3168
|
-
"flex min-w-[40%] flex-col items-center gap-2 rounded-xl bg-white p-2 dark:bg-neutral-900",
|
|
3169
|
-
className == null ? void 0 : className.qrCodeContainer
|
|
3170
|
-
),
|
|
3171
|
-
children: [
|
|
3172
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
3173
|
-
"img",
|
|
3174
|
-
{
|
|
3175
|
-
className: "mt-3 w-[80%] p-1 pt-3",
|
|
3176
|
-
src: HOST + `/api/qr-gen?url=${getURL(isBrowser)}&bgColor=${!darkMode ? "F6F4F0" : "171717"}&textColor=${!darkMode ? "000000" : "ffffff"}&margin=0`
|
|
3177
|
-
}
|
|
3178
|
-
),
|
|
3179
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("p", { className: "text-xs md:text-sm", children: (_d = texts == null ? void 0 : texts.qrCodeScanText) != null ? _d : DEFAULT_TEXTS.qrCodeScanText })
|
|
3180
|
-
]
|
|
3181
|
-
}
|
|
3182
|
-
) })
|
|
3183
|
-
] })
|
|
3184
|
-
]
|
|
3185
|
-
}
|
|
3186
|
-
);
|
|
3187
|
-
}
|
|
3188
|
-
|
|
3189
|
-
// src/components/notifications/AddUserToGroups.tsx
|
|
3190
|
-
var import_react13 = require("react");
|
|
3191
|
-
var import_react_phone_number_input = require("react-phone-number-input");
|
|
3192
|
-
|
|
3193
|
-
// src/ui/input.tsx
|
|
3194
|
-
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3195
|
-
function Input({ className, type, ...props }) {
|
|
3196
|
-
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
3197
|
-
"input",
|
|
3198
|
-
{
|
|
3199
|
-
type,
|
|
3200
|
-
"data-slot": "input",
|
|
3201
|
-
className: cn(
|
|
3202
|
-
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
3203
|
-
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
3204
|
-
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
3205
|
-
className
|
|
3206
|
-
),
|
|
3207
|
-
...props
|
|
3208
|
-
}
|
|
3209
|
-
);
|
|
3210
|
-
}
|
|
3211
|
-
|
|
3212
|
-
// src/components/notifications/FormInput.tsx
|
|
3213
|
-
var import_react11 = require("@formkit/auto-animate/react");
|
|
3214
|
-
var import_react_label = require("@radix-ui/react-label");
|
|
3215
|
-
var import_lucide_react5 = require("lucide-react");
|
|
3216
|
-
var import_react12 = require("react");
|
|
3217
|
-
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3218
|
-
function FormInput({
|
|
3219
|
-
submit,
|
|
3220
|
-
isLoading,
|
|
3221
|
-
errMsg,
|
|
3222
|
-
emailLack,
|
|
3223
|
-
warnMsg,
|
|
3224
|
-
isSubmited,
|
|
3225
|
-
agreementLack,
|
|
3226
|
-
showPhoneInput = false,
|
|
3227
|
-
agreementText,
|
|
3228
|
-
className,
|
|
3229
|
-
texts
|
|
3230
|
-
}) {
|
|
3231
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
3232
|
-
const [email, setEmail] = (0, import_react12.useState)("");
|
|
3233
|
-
const [phone, setPhone] = (0, import_react12.useState)("");
|
|
3234
|
-
const [isChecked, setIsChecked] = (0, import_react12.useState)(false);
|
|
3235
|
-
const [parent] = (0, import_react11.useAutoAnimate)();
|
|
3236
|
-
function submitForm(e) {
|
|
3237
|
-
e.preventDefault();
|
|
3238
|
-
submit(email, phone, isChecked);
|
|
3239
|
-
}
|
|
3240
|
-
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3241
|
-
"form",
|
|
3242
|
-
{
|
|
3243
|
-
ref: parent,
|
|
3244
|
-
onSubmit: submitForm,
|
|
3245
|
-
className: cn("flex flex-col gap-3 text-left", className == null ? void 0 : className.formContainer),
|
|
3246
|
-
children: [
|
|
3247
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-col gap-1 text-left", children: [
|
|
3248
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_react_label.Label, { className: "text-sm", htmlFor: "bts-notifications-form-email", children: (_a = texts == null ? void 0 : texts.formEmailLabel) != null ? _a : DEFAULT_TEXTS.formEmailLabel }),
|
|
3249
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3250
|
-
Input,
|
|
3251
|
-
{
|
|
3252
|
-
value: email,
|
|
3253
|
-
onChange: (newVal) => {
|
|
3254
|
-
setEmail(newVal.currentTarget.value);
|
|
3255
|
-
},
|
|
3256
|
-
id: "bts-notifications-form-email",
|
|
3257
|
-
className: cn(emailLack === true ? "border-red-400" : ""),
|
|
3258
|
-
type: "email",
|
|
3259
|
-
placeholder: (_b = texts == null ? void 0 : texts.formEmailPlaceholder) != null ? _b : DEFAULT_TEXTS.formEmailPlaceholder
|
|
3260
|
-
}
|
|
3261
|
-
)
|
|
3262
|
-
] }),
|
|
3263
|
-
showPhoneInput && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex flex-col gap-1 text-left", children: [
|
|
3264
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_react_label.Label, { className: "text-sm", htmlFor: "bts-notifications-form-phone", children: [
|
|
3265
|
-
(_c = texts == null ? void 0 : texts.formPhoneLabel) != null ? _c : DEFAULT_TEXTS.formPhoneLabel,
|
|
3266
|
-
" ",
|
|
3267
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-neutral-500 dark:text-neutral-500", children: (_d = texts == null ? void 0 : texts.formPhoneOptional) != null ? _d : DEFAULT_TEXTS.formPhoneOptional })
|
|
3268
|
-
] }),
|
|
3269
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3270
|
-
Input,
|
|
3271
|
-
{
|
|
3272
|
-
value: phone,
|
|
3273
|
-
onChange: (newVal) => {
|
|
3274
|
-
setPhone(newVal.currentTarget.value);
|
|
3275
|
-
},
|
|
3276
|
-
id: "bts-notifications-form-phone",
|
|
3277
|
-
className: "",
|
|
3278
|
-
type: "tel",
|
|
3279
|
-
autoComplete: "tel",
|
|
3280
|
-
autoCorrect: "off",
|
|
3281
|
-
placeholder: (_e = texts == null ? void 0 : texts.formPhonePlaceholder) != null ? _e : DEFAULT_TEXTS.formPhonePlaceholder
|
|
3282
|
-
}
|
|
3283
|
-
)
|
|
3284
|
-
] }),
|
|
3285
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-start gap-x-1.5", children: [
|
|
3286
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3287
|
-
"input",
|
|
3288
|
-
{
|
|
3289
|
-
className: "cursor-pointer",
|
|
3290
|
-
id: "bts-notifications-form-marketing-consent",
|
|
3291
|
-
type: "checkbox",
|
|
3292
|
-
checked: isChecked,
|
|
3293
|
-
onChange: () => {
|
|
3294
|
-
setIsChecked(!isChecked);
|
|
3295
|
-
}
|
|
3296
|
-
}
|
|
3297
|
-
),
|
|
3298
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
3299
|
-
"label",
|
|
3300
|
-
{
|
|
3301
|
-
htmlFor: "bts-notifications-form-marketing-consent",
|
|
3302
|
-
className: cn(
|
|
3303
|
-
"cursor-pointer text-xs leading-4 transition-colors md:text-sm md:leading-4",
|
|
3304
|
-
agreementLack === true ? "text-yellow-700" : ""
|
|
3305
|
-
),
|
|
3306
|
-
children: agreementText
|
|
3307
|
-
}
|
|
3308
|
-
)
|
|
3309
|
-
] }),
|
|
3310
|
-
errMsg.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("p", { className: "mb-3 flex items-center gap-1 text-sm text-red-400", children: [
|
|
3311
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react5.TriangleAlertIcon, { color: "#ff6467", size: 16 }),
|
|
3312
|
-
" ",
|
|
3313
|
-
errMsg
|
|
3314
|
-
] }),
|
|
3315
|
-
warnMsg.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("p", { className: "mb-3 flex items-center gap-1 text-sm text-amber-400", children: [
|
|
3316
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react5.CircleAlertIcon, { color: "var(--color-amber-400)", size: 16 }),
|
|
3317
|
-
" ",
|
|
3318
|
-
warnMsg
|
|
3319
|
-
] }),
|
|
3320
|
-
isSubmited == false && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
3321
|
-
Button,
|
|
3322
|
-
{
|
|
3323
|
-
variant: "default",
|
|
3324
|
-
disabled: isLoading,
|
|
3325
|
-
className: cn(
|
|
3326
|
-
isLoading ? "cursor-not-allowed text-transparent" : "",
|
|
3327
|
-
"relative"
|
|
3328
|
-
),
|
|
3329
|
-
children: [
|
|
3330
|
-
(_f = texts == null ? void 0 : texts.formSubmitButton) != null ? _f : DEFAULT_TEXTS.formSubmitButton,
|
|
3331
|
-
isLoading && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Spinner, {}) })
|
|
3332
|
-
]
|
|
3333
|
-
}
|
|
3334
|
-
) }),
|
|
3335
|
-
isSubmited && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: "flex items-center gap-3 text-sm text-green-400", children: [
|
|
3336
|
-
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_lucide_react5.CheckCircleIcon, { size: 16 }),
|
|
3337
|
-
" ",
|
|
3338
|
-
(_g = texts == null ? void 0 : texts.formSuccessMessage) != null ? _g : DEFAULT_TEXTS.formSuccessMessage
|
|
3339
|
-
] })
|
|
3340
|
-
]
|
|
3341
|
-
}
|
|
3342
|
-
);
|
|
3343
|
-
}
|
|
3344
|
-
|
|
3345
|
-
// src/components/notifications/AddUserToGroups.tsx
|
|
3346
|
-
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3347
|
-
var emailRegex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
3348
|
-
function AddUserToGroups({
|
|
3349
|
-
groups,
|
|
3350
|
-
onToggle,
|
|
3351
|
-
onCheckAll,
|
|
3352
|
-
slug,
|
|
3353
|
-
showPhoneInput = false,
|
|
3354
|
-
agreementText,
|
|
3355
|
-
className,
|
|
3356
|
-
texts,
|
|
3357
|
-
isUpdating,
|
|
3358
|
-
wasChanged,
|
|
3359
|
-
onSuccess
|
|
3360
|
-
}) {
|
|
3361
|
-
var _a, _b;
|
|
3362
|
-
const [errMsg, setErrMsg] = (0, import_react13.useState)("");
|
|
3363
|
-
const [warnMsg, setWarnMsg] = (0, import_react13.useState)("");
|
|
3364
|
-
const [isSubmited, setIsSubmited] = (0, import_react13.useState)(false);
|
|
3365
|
-
const [agreementLack, setAgreementLack] = (0, import_react13.useState)(false);
|
|
3366
|
-
const [emailLack, setEmailLack] = (0, import_react13.useState)(false);
|
|
3367
|
-
const {
|
|
3368
|
-
mutateAsync: createNotificationUserMutation,
|
|
3369
|
-
isPending: isCreateNotificationUserPending
|
|
3370
|
-
} = useMutation3(rpcProvider.notifications.createNotificationUser);
|
|
3371
|
-
function validatePhoneNumber(phone) {
|
|
3372
|
-
if (phone == null) {
|
|
3373
|
-
return false;
|
|
3374
|
-
}
|
|
3375
|
-
return (0, import_react_phone_number_input.isValidPhoneNumber)(phone, "PL");
|
|
3376
|
-
}
|
|
3377
|
-
async function save(email, phone, agreement) {
|
|
3378
|
-
setErrMsg("");
|
|
3379
|
-
setWarnMsg("");
|
|
3380
|
-
setEmailLack(false);
|
|
3381
|
-
setIsSubmited(false);
|
|
3382
|
-
setAgreementLack(false);
|
|
3383
|
-
if (!agreement) {
|
|
3384
|
-
setAgreementLack(true);
|
|
3385
|
-
const msg = "Zgoda w tym przypadku jest wymagana.";
|
|
3386
|
-
setErrMsg(msg);
|
|
3387
|
-
return;
|
|
3388
|
-
}
|
|
3389
|
-
if (emailRegex.test(email) === false) {
|
|
3390
|
-
setErrMsg("Email jest nieprawid\u0142owy.");
|
|
3391
|
-
setEmailLack(true);
|
|
3392
|
-
return;
|
|
3393
|
-
}
|
|
3394
|
-
if (phone.length > 0) {
|
|
3395
|
-
if (validatePhoneNumber(phone) === false) {
|
|
3396
|
-
const msg = "Numer telefonu mo\u017Ce by\u0107 nieprawid\u0142owy. Zapisali\u015Bmy go ale je\u015Bli jest nieprawid\u0142owy to wpisz jeszcze raz i kliknij przycisk.";
|
|
3397
|
-
setWarnMsg(msg);
|
|
3398
|
-
}
|
|
3399
|
-
}
|
|
3400
|
-
try {
|
|
3401
|
-
const newNotificationUser = await createNotificationUserMutation({
|
|
3402
|
-
slug,
|
|
3403
|
-
email,
|
|
3404
|
-
phone,
|
|
3405
|
-
groups: groups.filter((el) => el.isOn == true).map((el) => el.id),
|
|
3406
|
-
mobileNotificationEnabled: true,
|
|
3407
|
-
emailNotificationEnabled: true,
|
|
3408
|
-
smsNotificationEnabled: true
|
|
3409
|
-
});
|
|
3410
|
-
if (newNotificationUser.result.case === "success") {
|
|
3411
|
-
setIsSubmited(true);
|
|
3412
|
-
setTimeout(() => {
|
|
3413
|
-
onSuccess == null ? void 0 : onSuccess(
|
|
3414
|
-
false,
|
|
3415
|
-
newNotificationUser.userId,
|
|
3416
|
-
newNotificationUser.accessToken
|
|
3417
|
-
);
|
|
3418
|
-
}, 1e3);
|
|
3419
|
-
return;
|
|
3420
|
-
} else {
|
|
3421
|
-
setIsSubmited(true);
|
|
3422
|
-
const failureMessage = newNotificationUser.result.value;
|
|
3423
|
-
if (failureMessage != null) {
|
|
3424
|
-
if (failureMessage == 32 /* NOTIFICATION_USER_ALREADY_EXIST */) {
|
|
3425
|
-
onSuccess == null ? void 0 : onSuccess(true, void 0, void 0);
|
|
3426
|
-
return;
|
|
3427
|
-
}
|
|
3428
|
-
console.log(`Code error: ${FailureMessage[failureMessage]}`);
|
|
3429
|
-
setErrMsg("Wyst\u0105pi\u0142 b\u0142\u0105d: " + FailureMessage[failureMessage]);
|
|
3430
|
-
return;
|
|
3431
|
-
}
|
|
3432
|
-
return;
|
|
3433
|
-
}
|
|
3434
|
-
} catch (e) {
|
|
3435
|
-
setErrMsg("Wyst\u0105pi\u0142 b\u0142\u0105d podczas zapisywania. Spr\xF3buj ponownie.");
|
|
3436
|
-
console.log(`Error: ${e}`);
|
|
3437
|
-
}
|
|
3438
|
-
}
|
|
3439
|
-
const text = (_a = texts == null ? void 0 : texts.formTitle) != null ? _a : DEFAULT_TEXTS.formTitle;
|
|
3440
|
-
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
3441
|
-
"div",
|
|
3442
|
-
{
|
|
3443
|
-
className: cn(
|
|
3444
|
-
"bg-beige-100 rounded-xl p-4 dark:bg-neutral-700",
|
|
3445
|
-
className == null ? void 0 : className.formSection
|
|
3446
|
-
),
|
|
3447
|
-
children: [
|
|
3448
|
-
text.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3449
|
-
"h3",
|
|
3450
|
-
{
|
|
3451
|
-
className: cn(
|
|
3452
|
-
"mb-3 text-base font-medium lg:text-lg",
|
|
3453
|
-
className == null ? void 0 : className.formTitle
|
|
3454
|
-
),
|
|
3455
|
-
children: text
|
|
3456
|
-
}
|
|
3457
|
-
),
|
|
3458
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3459
|
-
NotificationGroupsList,
|
|
3460
|
-
{
|
|
3461
|
-
groups,
|
|
3462
|
-
isManaging: false,
|
|
3463
|
-
onToggle: onToggle != null ? onToggle : () => {
|
|
3464
|
-
},
|
|
3465
|
-
onCheckAll: onCheckAll != null ? onCheckAll : () => {
|
|
3466
|
-
},
|
|
3467
|
-
isUpdating: isUpdating != null ? isUpdating : false,
|
|
3468
|
-
wasChanged: wasChanged != null ? wasChanged : false,
|
|
3469
|
-
isUserGroupsUpdated: false,
|
|
3470
|
-
className,
|
|
3471
|
-
texts
|
|
3472
|
-
}
|
|
3473
|
-
),
|
|
3474
|
-
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
3475
|
-
FormInput,
|
|
3476
|
-
{
|
|
3477
|
-
errMsg,
|
|
3478
|
-
emailLack,
|
|
3479
|
-
warnMsg,
|
|
3480
|
-
submit: save,
|
|
3481
|
-
isLoading: isCreateNotificationUserPending,
|
|
3482
|
-
isSubmited,
|
|
3483
|
-
agreementLack,
|
|
3484
|
-
showPhoneInput,
|
|
3485
|
-
agreementText: (_b = agreementText != null ? agreementText : texts == null ? void 0 : texts.agreementText) != null ? _b : DEFAULT_TEXTS.agreementText,
|
|
3486
|
-
className,
|
|
3487
|
-
texts
|
|
3488
|
-
}
|
|
3489
|
-
)
|
|
3490
|
-
]
|
|
3491
|
-
}
|
|
3492
|
-
);
|
|
3493
|
-
}
|
|
3494
|
-
|
|
3495
|
-
// src/components/notifications/ManageMyData.tsx
|
|
3496
|
-
var import_react15 = require("react");
|
|
3497
|
-
|
|
3498
|
-
// src/ui/skeleton.tsx
|
|
3499
|
-
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3500
|
-
function Skeleton2({ className, ...props }) {
|
|
3501
|
-
return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
3502
|
-
"div",
|
|
3503
|
-
{
|
|
3504
|
-
"data-slot": "skeleton",
|
|
3505
|
-
className: cn("bg-accent animate-pulse rounded-md", className),
|
|
3506
|
-
...props
|
|
3507
|
-
}
|
|
3508
|
-
);
|
|
3509
|
-
}
|
|
3510
|
-
|
|
3511
|
-
// src/components/notifications/ManageMyData.tsx
|
|
3512
|
-
var import_react_label2 = require("@radix-ui/react-label");
|
|
3513
|
-
var import_lucide_react7 = require("lucide-react");
|
|
3514
|
-
var import_use_debounce = require("use-debounce");
|
|
3515
|
-
|
|
3516
|
-
// src/components/notifications/UnsubscribeDialog.tsx
|
|
3517
|
-
var import_lucide_react6 = require("lucide-react");
|
|
3518
|
-
var import_react_dom2 = require("react-dom");
|
|
3519
|
-
var import_react14 = require("react");
|
|
3520
|
-
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3521
|
-
function UnsubscribeDialog({
|
|
3522
|
-
open: open2,
|
|
3523
|
-
onOpenChange,
|
|
3524
|
-
onConfirm,
|
|
3525
|
-
isDeleting = false
|
|
3526
|
-
}) {
|
|
3527
|
-
const [mounted, setMounted] = (0, import_react14.useState)(false);
|
|
3528
|
-
(0, import_react14.useEffect)(() => {
|
|
3529
|
-
setMounted(true);
|
|
3530
|
-
return () => setMounted(false);
|
|
3531
|
-
}, []);
|
|
3532
|
-
(0, import_react14.useEffect)(() => {
|
|
3533
|
-
if (open2) {
|
|
3534
|
-
document.body.style.overflow = "hidden";
|
|
3535
|
-
} else {
|
|
3536
|
-
document.body.style.overflow = "";
|
|
3537
|
-
}
|
|
3538
|
-
return () => {
|
|
3539
|
-
document.body.style.overflow = "";
|
|
3540
|
-
};
|
|
3541
|
-
}, [open2]);
|
|
3542
|
-
if (!mounted || !open2) {
|
|
3543
|
-
return null;
|
|
3544
|
-
}
|
|
3545
|
-
const handleBackdropClick = (e) => {
|
|
3546
|
-
if (e.target === e.currentTarget) {
|
|
3547
|
-
onOpenChange(false);
|
|
3548
|
-
}
|
|
3549
|
-
};
|
|
3550
|
-
const handleConfirm = () => {
|
|
3551
|
-
onConfirm();
|
|
3552
|
-
};
|
|
3553
|
-
return (0, import_react_dom2.createPortal)(
|
|
3554
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3555
|
-
"div",
|
|
3556
|
-
{
|
|
3557
|
-
className: "fixed inset-0 z-[9999] flex items-center justify-center bg-black/50 p-4",
|
|
3558
|
-
onClick: handleBackdropClick,
|
|
3559
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
3560
|
-
"div",
|
|
3561
|
-
{
|
|
3562
|
-
className: cn(
|
|
3563
|
-
"relative w-full max-w-md rounded-2xl bg-white p-6 shadow-lg",
|
|
3564
|
-
"dark:bg-neutral-800",
|
|
3565
|
-
"animate-in fade-in-0 zoom-in-95 duration-200"
|
|
3566
|
-
),
|
|
3567
|
-
onClick: (e) => e.stopPropagation(),
|
|
3568
|
-
children: [
|
|
3569
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
3570
|
-
"button",
|
|
3571
|
-
{
|
|
3572
|
-
onClick: () => onOpenChange(false),
|
|
3573
|
-
className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-white transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-neutral-950 focus:ring-offset-2 disabled:pointer-events-none dark:ring-offset-neutral-950 dark:focus:ring-neutral-300",
|
|
3574
|
-
disabled: isDeleting,
|
|
3575
|
-
children: [
|
|
3576
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react6.XIcon, { className: "h-4 w-4" }),
|
|
3577
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: "sr-only", children: "Zamknij" })
|
|
3578
|
-
]
|
|
3579
|
-
}
|
|
3580
|
-
),
|
|
3581
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col gap-4", children: [
|
|
3582
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-start gap-3", children: [
|
|
3583
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3584
|
-
import_lucide_react6.TriangleAlertIcon,
|
|
3585
|
-
{
|
|
3586
|
-
className: "h-6 w-6 text-amber-500",
|
|
3587
|
-
"aria-hidden": "true"
|
|
3588
|
-
}
|
|
3589
|
-
) }),
|
|
3590
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("h2", { className: "text-lg font-semibold text-black dark:text-neutral-100", children: "Czy na pewno chcesz si\u0119 wypisa\u0107?" }) })
|
|
3591
|
-
] }),
|
|
3592
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("p", { className: "text-sm text-neutral-600 dark:text-neutral-400", children: "Klikni\u0119cie tego przycisku spowoduje wypisanie z wszelkich powiadomie\u0144 i grup, kt\xF3re zapisa\u0142e\u015B." }),
|
|
3593
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", children: [
|
|
3594
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
3595
|
-
Button,
|
|
3596
|
-
{
|
|
3597
|
-
type: "button",
|
|
3598
|
-
variant: "ghost",
|
|
3599
|
-
onClick: () => onOpenChange(false),
|
|
3600
|
-
disabled: isDeleting,
|
|
3601
|
-
className: "sm:min-w-[100px]",
|
|
3602
|
-
children: "Anuluj"
|
|
3603
|
-
}
|
|
3604
|
-
),
|
|
3605
|
-
/* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
3606
|
-
Button,
|
|
3607
|
-
{
|
|
3608
|
-
type: "button",
|
|
3609
|
-
variant: "destructive",
|
|
3610
|
-
onClick: handleConfirm,
|
|
3611
|
-
disabled: isDeleting,
|
|
3612
|
-
className: cn(
|
|
3613
|
-
isDeleting && "cursor-not-allowed text-transparent",
|
|
3614
|
-
"relative sm:min-w-[100px]"
|
|
3615
|
-
),
|
|
3616
|
-
children: [
|
|
3617
|
-
"Usu\u0144",
|
|
3618
|
-
isDeleting && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "h-4 w-4 animate-spin rounded-full border-2 border-white border-t-transparent" }) })
|
|
3619
|
-
]
|
|
3620
|
-
}
|
|
3621
|
-
)
|
|
3622
|
-
] })
|
|
3623
|
-
] })
|
|
3624
|
-
]
|
|
3625
|
-
}
|
|
3626
|
-
)
|
|
3627
|
-
}
|
|
3628
|
-
),
|
|
3629
|
-
document.body
|
|
3630
|
-
);
|
|
3631
|
-
}
|
|
3632
|
-
|
|
3633
|
-
// src/components/notifications/ManageMyData.tsx
|
|
3634
|
-
var import_react16 = require("@formkit/auto-animate/react");
|
|
3635
|
-
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3636
|
-
function ManageMyData({
|
|
3637
|
-
accessToken,
|
|
3638
|
-
slug,
|
|
3639
|
-
userID,
|
|
3640
|
-
className,
|
|
3641
|
-
texts
|
|
3642
|
-
}) {
|
|
3643
|
-
var _a, _b, _c, _d, _e;
|
|
3644
|
-
const [parent] = (0, import_react16.useAutoAnimate)();
|
|
3645
|
-
const [parentCard] = (0, import_react16.useAutoAnimate)();
|
|
3646
|
-
const { mutateAsync: deleteMyData, isPending: isDeleting } = useMutation3(
|
|
3647
|
-
rpcProvider.notifications.deleteNotificationUser
|
|
3648
|
-
);
|
|
3649
|
-
const { mutateAsync: updateNotificationUser2, isPending: isUpdating } = useMutation3(rpcProvider.notifications.updateNotificationUser);
|
|
3650
|
-
const { data: userSettings, isFetching: isLoading } = useQuery4(
|
|
3651
|
-
rpcProvider.notifications.getNotificationUserSettings,
|
|
3652
|
-
{
|
|
3653
|
-
userId: userID,
|
|
3654
|
-
slug,
|
|
3655
|
-
accessToken
|
|
3656
|
-
}
|
|
3657
|
-
);
|
|
3658
|
-
const [email, setEmail] = (0, import_react15.useState)(false);
|
|
3659
|
-
const [phone, setPhone] = (0, import_react15.useState)(false);
|
|
3660
|
-
const [isDataUpdated, setIsDataUpdated] = (0, import_react15.useState)(false);
|
|
3661
|
-
const [push, setPush] = (0, import_react15.useState)(false);
|
|
3662
|
-
const [isDialogOpen, setIsDialogOpen] = (0, import_react15.useState)(false);
|
|
3663
|
-
const details = (userSettings == null ? void 0 : userSettings.result.case) === "success" ? (_a = userSettings == null ? void 0 : userSettings.result) == null ? void 0 : _a.value : void 0;
|
|
3664
|
-
function deleteData() {
|
|
3665
|
-
setIsDialogOpen(true);
|
|
3666
|
-
}
|
|
3667
|
-
async function handleConfirmDelete() {
|
|
3668
|
-
await deleteMyData({
|
|
3669
|
-
accessToken,
|
|
3670
|
-
slug,
|
|
3671
|
-
userId: userID
|
|
3672
|
-
});
|
|
3673
|
-
setIsDialogOpen(false);
|
|
3674
|
-
}
|
|
3675
|
-
async function updateData() {
|
|
3676
|
-
await updateNotificationUser2({
|
|
3677
|
-
accessToken,
|
|
3678
|
-
slug,
|
|
3679
|
-
notificationUserId: userID,
|
|
3680
|
-
mobileNotificationEnabled: push,
|
|
3681
|
-
emailNotificationEnabled: email,
|
|
3682
|
-
smsNotificationEnabled: phone
|
|
3683
|
-
});
|
|
3684
|
-
setIsDataUpdated(true);
|
|
3685
|
-
setTimeout(() => {
|
|
3686
|
-
setIsDataUpdated(false);
|
|
3687
|
-
}, 3e3);
|
|
3688
|
-
}
|
|
3689
|
-
const debouncedUpdateData = (0, import_use_debounce.useDebouncedCallback)((_) => {
|
|
3690
|
-
updateData();
|
|
3691
|
-
}, 300);
|
|
3692
|
-
(0, import_react15.useEffect)(() => {
|
|
3693
|
-
var _a2, _b2, _c2, _d2;
|
|
3694
|
-
const details2 = (userSettings == null ? void 0 : userSettings.result.case) === "success" ? (_a2 = userSettings == null ? void 0 : userSettings.result) == null ? void 0 : _a2.value : void 0;
|
|
3695
|
-
setEmail((_b2 = details2 == null ? void 0 : details2.emailNotificationEnabled) != null ? _b2 : false);
|
|
3696
|
-
setPhone((_c2 = details2 == null ? void 0 : details2.smsNotificationEnabled) != null ? _c2 : false);
|
|
3697
|
-
setPush((_d2 = details2 == null ? void 0 : details2.mobileNotificationEnabled) != null ? _d2 : false);
|
|
3698
|
-
}, [userSettings]);
|
|
3699
|
-
function setData(key, value) {
|
|
3700
|
-
if (key === "email") {
|
|
3701
|
-
setEmail(value);
|
|
3702
|
-
}
|
|
3703
|
-
if (key === "phone") {
|
|
3704
|
-
setPhone(value);
|
|
3705
|
-
}
|
|
3706
|
-
if (key === "push") {
|
|
3707
|
-
setPush(value);
|
|
3708
|
-
}
|
|
3709
|
-
debouncedUpdateData(true);
|
|
3710
|
-
}
|
|
3711
|
-
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
3712
|
-
"div",
|
|
3713
|
-
{
|
|
3714
|
-
className: cn(
|
|
3715
|
-
"bg-beige-100 rounded-xl p-4 dark:bg-neutral-700",
|
|
3716
|
-
className == null ? void 0 : className.manageDataSection
|
|
3717
|
-
),
|
|
3718
|
-
children: [
|
|
3719
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3720
|
-
"h3",
|
|
3721
|
-
{
|
|
3722
|
-
className: cn(
|
|
3723
|
-
"mb-3 text-base font-medium lg:text-lg",
|
|
3724
|
-
className == null ? void 0 : className.manageDataTitle
|
|
3725
|
-
),
|
|
3726
|
-
children: (_b = texts == null ? void 0 : texts.manageDataTitle) != null ? _b : DEFAULT_TEXTS.manageDataTitle
|
|
3727
|
-
}
|
|
3728
|
-
) }),
|
|
3729
|
-
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Skeleton2, { className: "h-64 w-full" }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Card, { ref: parentCard, className: cn(isUpdating && "relative"), children: [
|
|
3730
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CardHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(CardTitle, { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-sm text-left", children: (_c = texts == null ? void 0 : texts.manageDataDescription) != null ? _c : DEFAULT_TEXTS.manageDataDescription }) }) }),
|
|
3731
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(CardContent, { ref: parent, children: [
|
|
3732
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3733
|
-
"div",
|
|
3734
|
-
{
|
|
3735
|
-
className: cn(
|
|
3736
|
-
isUpdating && "opacity-50 pointer-events-none",
|
|
3737
|
-
"flex flex-col gap-2"
|
|
3738
|
-
),
|
|
3739
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex flex-col items-start gap-5 gap-x-2", children: [
|
|
3740
|
-
(details == null ? void 0 : details.emailNotificationAvailable) && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
3741
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3742
|
-
Switch,
|
|
3743
|
-
{
|
|
3744
|
-
id: "email-enabled",
|
|
3745
|
-
className: "data-[state=checked]:bg-blue-500 dark:data-[state=unchecked]:bg-neutral-600",
|
|
3746
|
-
checked: email,
|
|
3747
|
-
onCheckedChange: () => {
|
|
3748
|
-
setData("email", !email);
|
|
3749
|
-
}
|
|
3750
|
-
}
|
|
3751
|
-
),
|
|
3752
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_label2.Label, { htmlFor: "email-enabled", className: "text-sm", children: "Email" })
|
|
3753
|
-
] }),
|
|
3754
|
-
(details == null ? void 0 : details.smsNotificationAvailable) && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
3755
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3756
|
-
Switch,
|
|
3757
|
-
{
|
|
3758
|
-
id: "sms-enabled",
|
|
3759
|
-
className: "data-[state=checked]:bg-blue-500 dark:data-[state=unchecked]:bg-neutral-600",
|
|
3760
|
-
checked: phone,
|
|
3761
|
-
onCheckedChange: () => {
|
|
3762
|
-
setData("phone", !phone);
|
|
3763
|
-
}
|
|
3764
|
-
}
|
|
3765
|
-
),
|
|
3766
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_label2.Label, { htmlFor: "sms-enabled", className: "text-sm", children: "SMS" })
|
|
3767
|
-
] }),
|
|
3768
|
-
(details == null ? void 0 : details.mobileNotificationAvailable) && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
3769
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
3770
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3771
|
-
Switch,
|
|
3772
|
-
{
|
|
3773
|
-
id: "push-enabled",
|
|
3774
|
-
className: "data-[state=checked]:bg-blue-500 dark:data-[state=unchecked]:bg-neutral-600",
|
|
3775
|
-
checked: push,
|
|
3776
|
-
onCheckedChange: () => {
|
|
3777
|
-
setData("push", !push);
|
|
3778
|
-
}
|
|
3779
|
-
}
|
|
3780
|
-
),
|
|
3781
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_react_label2.Label, { htmlFor: "push-enabled", className: "text-sm", children: "Powiadomienia na telefon" })
|
|
3782
|
-
] }),
|
|
3783
|
-
(details == null ? void 0 : details.hasUserInstalledApp) === false && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
3784
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3785
|
-
import_lucide_react7.MessageCircleWarningIcon,
|
|
3786
|
-
{
|
|
3787
|
-
color: "var(--color-amber-500)",
|
|
3788
|
-
size: 26
|
|
3789
|
-
}
|
|
3790
|
-
),
|
|
3791
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-xs text-amber-500", children: "Wygl\u0105da na to, \u017Ce nie masz zainstalowanej aplikacji mobilnej. Zainstaluj i wyra\u017A zgod\u0119 na otrzymywanie powiadomie\u0144 na telefon." })
|
|
3792
|
-
] })
|
|
3793
|
-
] })
|
|
3794
|
-
] })
|
|
3795
|
-
}
|
|
3796
|
-
),
|
|
3797
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "mt-5 flex flex-col gap-2 text-left", children: [
|
|
3798
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("hr", {}),
|
|
3799
|
-
isDataUpdated && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("p", { className: "text-xs text-green-500", children: (_d = texts == null ? void 0 : texts.manageDataUpdatedMessage) != null ? _d : DEFAULT_TEXTS.manageDataUpdatedMessage }),
|
|
3800
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "flex items-center gap-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
3801
|
-
Button,
|
|
3802
|
-
{
|
|
3803
|
-
size: "sm",
|
|
3804
|
-
variant: "link",
|
|
3805
|
-
className: cn(
|
|
3806
|
-
"pl-0 ml-0",
|
|
3807
|
-
isDeleting && "cursor-not-allowed"
|
|
3808
|
-
),
|
|
3809
|
-
onClick: deleteData,
|
|
3810
|
-
children: [
|
|
3811
|
-
(_e = texts == null ? void 0 : texts.manageDataUnsubscribeButton) != null ? _e : DEFAULT_TEXTS.manageDataUnsubscribeButton,
|
|
3812
|
-
isDeleting && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Spinner, {}) })
|
|
3813
|
-
]
|
|
3814
|
-
}
|
|
3815
|
-
) })
|
|
3816
|
-
] })
|
|
3817
|
-
] }),
|
|
3818
|
-
isUpdating && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "bg-black/30 absolute inset-0 rounded-xl", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Spinner, {}) }) })
|
|
3819
|
-
] }),
|
|
3820
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
3821
|
-
UnsubscribeDialog,
|
|
3822
|
-
{
|
|
3823
|
-
open: isDialogOpen,
|
|
3824
|
-
onOpenChange: setIsDialogOpen,
|
|
3825
|
-
onConfirm: handleConfirmDelete,
|
|
3826
|
-
isDeleting
|
|
3827
|
-
}
|
|
3828
|
-
)
|
|
3829
|
-
]
|
|
3830
|
-
}
|
|
3831
|
-
);
|
|
3832
|
-
}
|
|
3833
|
-
|
|
3834
|
-
// src/components/notifications/LoginScreen.tsx
|
|
3835
|
-
var import_react17 = require("react");
|
|
3836
|
-
|
|
3837
|
-
// src/ui/label.tsx
|
|
3838
|
-
var LabelPrimitive = __toESM(require("@radix-ui/react-label"));
|
|
3839
|
-
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3840
|
-
function Label3({
|
|
3841
|
-
className,
|
|
3842
|
-
...props
|
|
3843
|
-
}) {
|
|
3844
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
3845
|
-
LabelPrimitive.Root,
|
|
3846
|
-
{
|
|
3847
|
-
"data-slot": "label",
|
|
3848
|
-
className: cn(
|
|
3849
|
-
"flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
|
|
3850
|
-
className
|
|
3851
|
-
),
|
|
3852
|
-
...props
|
|
3853
|
-
}
|
|
3854
|
-
);
|
|
3855
|
-
}
|
|
3856
|
-
|
|
3857
|
-
// src/ui/input-otp.tsx
|
|
3858
|
-
var React3 = __toESM(require("react"));
|
|
3859
|
-
var import_input_otp = require("input-otp");
|
|
3860
|
-
var import_lucide_react8 = require("lucide-react");
|
|
3861
|
-
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3862
|
-
function InputOTP({
|
|
3863
|
-
className,
|
|
3864
|
-
containerClassName,
|
|
3865
|
-
...props
|
|
3866
|
-
}) {
|
|
3867
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3868
|
-
import_input_otp.OTPInput,
|
|
3869
|
-
{
|
|
3870
|
-
"data-slot": "input-otp",
|
|
3871
|
-
containerClassName: cn(
|
|
3872
|
-
"flex items-center gap-2 has-disabled:opacity-50",
|
|
3873
|
-
containerClassName
|
|
3874
|
-
),
|
|
3875
|
-
className: cn("disabled:cursor-not-allowed", className),
|
|
3876
|
-
...props
|
|
3877
|
-
}
|
|
3878
|
-
);
|
|
3879
|
-
}
|
|
3880
|
-
function InputOTPGroup({ className, ...props }) {
|
|
3881
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
3882
|
-
"div",
|
|
3883
|
-
{
|
|
3884
|
-
"data-slot": "input-otp-group",
|
|
3885
|
-
className: cn("flex items-center", className),
|
|
3886
|
-
...props
|
|
3887
|
-
}
|
|
3888
|
-
);
|
|
3889
|
-
}
|
|
3890
|
-
function InputOTPSlot({
|
|
3891
|
-
index,
|
|
3892
|
-
className,
|
|
3893
|
-
...props
|
|
3894
|
-
}) {
|
|
3895
|
-
var _a;
|
|
3896
|
-
const inputOTPContext = React3.useContext(import_input_otp.OTPInputContext);
|
|
3897
|
-
const { char, hasFakeCaret, isActive } = (_a = inputOTPContext == null ? void 0 : inputOTPContext.slots[index]) != null ? _a : {};
|
|
3898
|
-
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
3899
|
-
"div",
|
|
3900
|
-
{
|
|
3901
|
-
"data-slot": "input-otp-slot",
|
|
3902
|
-
"data-active": isActive,
|
|
3903
|
-
className: cn(
|
|
3904
|
-
"data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",
|
|
3905
|
-
className
|
|
3906
|
-
),
|
|
3907
|
-
...props,
|
|
3908
|
-
children: [
|
|
3909
|
-
char,
|
|
3910
|
-
hasFakeCaret && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "animate-caret-blink bg-foreground h-4 w-px duration-1000" }) })
|
|
3911
|
-
]
|
|
3912
|
-
}
|
|
3913
|
-
);
|
|
3914
|
-
}
|
|
3915
|
-
|
|
3916
|
-
// src/components/notifications/LoginScreen.tsx
|
|
3917
|
-
var import_lucide_react10 = require("lucide-react");
|
|
3918
|
-
var import_react18 = require("@formkit/auto-animate/react");
|
|
3919
|
-
|
|
3920
|
-
// src/ui/dialog.tsx
|
|
3921
|
-
var DialogPrimitive = __toESM(require("@radix-ui/react-dialog"));
|
|
3922
|
-
var import_lucide_react9 = require("lucide-react");
|
|
3923
|
-
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3924
|
-
function Dialog({
|
|
3925
|
-
...props
|
|
3926
|
-
}) {
|
|
3927
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DialogPrimitive.Root, { "data-slot": "dialog", ...props });
|
|
3928
|
-
}
|
|
3929
|
-
function DialogPortal({
|
|
3930
|
-
...props
|
|
3931
|
-
}) {
|
|
3932
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DialogPrimitive.Portal, { "data-slot": "dialog-portal", ...props });
|
|
3933
|
-
}
|
|
3934
|
-
function DialogOverlay({
|
|
3935
|
-
className,
|
|
3936
|
-
...props
|
|
3937
|
-
}) {
|
|
3938
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3939
|
-
DialogPrimitive.Overlay,
|
|
3940
|
-
{
|
|
3941
|
-
"data-slot": "dialog-overlay",
|
|
3942
|
-
className: cn(
|
|
3943
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
3944
|
-
className
|
|
3945
|
-
),
|
|
3946
|
-
...props
|
|
3947
|
-
}
|
|
3948
|
-
);
|
|
3949
|
-
}
|
|
3950
|
-
function DialogContent({
|
|
3951
|
-
className,
|
|
3952
|
-
children,
|
|
3953
|
-
showCloseButton = true,
|
|
3954
|
-
...props
|
|
3955
|
-
}) {
|
|
3956
|
-
return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(DialogPortal, { "data-slot": "dialog-portal", children: [
|
|
3957
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DialogOverlay, {}),
|
|
3958
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3959
|
-
DialogPrimitive.Content,
|
|
3960
|
-
{
|
|
3961
|
-
"data-slot": "dialog-content",
|
|
3962
|
-
className: cn(
|
|
3963
|
-
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",
|
|
3964
|
-
className
|
|
3965
|
-
),
|
|
3966
|
-
...props,
|
|
3967
|
-
children: [
|
|
3968
|
-
children,
|
|
3969
|
-
showCloseButton && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
|
|
3970
|
-
DialogPrimitive.Close,
|
|
3971
|
-
{
|
|
3972
|
-
"data-slot": "dialog-close",
|
|
3973
|
-
className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
3974
|
-
children: [
|
|
3975
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_lucide_react9.XIcon, {}),
|
|
3976
|
-
/* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "sr-only", children: "Close" })
|
|
3977
|
-
]
|
|
3978
|
-
}
|
|
3979
|
-
)
|
|
3980
|
-
]
|
|
3981
|
-
}
|
|
3982
|
-
)
|
|
3983
|
-
] });
|
|
3984
|
-
}
|
|
3985
|
-
|
|
3986
|
-
// src/components/notifications/LoginScreen.tsx
|
|
3987
|
-
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3988
|
-
function LoginScreen({
|
|
3989
|
-
slug,
|
|
3990
|
-
onSuccess,
|
|
3991
|
-
onError,
|
|
3992
|
-
className,
|
|
3993
|
-
isOpen,
|
|
3994
|
-
onClose,
|
|
3995
|
-
texts
|
|
3996
|
-
}) {
|
|
3997
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
3998
|
-
const [parentContent] = (0, import_react18.useAutoAnimate)();
|
|
3999
|
-
const [parentHeader] = (0, import_react18.useAutoAnimate)();
|
|
4000
|
-
const [email, setEmail] = (0, import_react17.useState)("");
|
|
4001
|
-
const [code, setCode] = (0, import_react17.useState)("");
|
|
4002
|
-
const [isEmailSent, setIsEmailSent] = (0, import_react17.useState)(false);
|
|
4003
|
-
const [error, setError] = (0, import_react17.useState)(null);
|
|
4004
|
-
const { mutateAsync: verifyUserEmail2, isPending: isVerifying } = useMutation3(
|
|
4005
|
-
rpcProvider.notifications.verifyUserEmail
|
|
4006
|
-
);
|
|
4007
|
-
const handleSendEmail = async (e) => {
|
|
4008
|
-
var _a2;
|
|
4009
|
-
e.preventDefault();
|
|
4010
|
-
setError(null);
|
|
4011
|
-
if (!email || !email.includes("@")) {
|
|
4012
|
-
setError((_a2 = texts.loginInvalidEmailError) != null ? _a2 : "");
|
|
4013
|
-
return;
|
|
4014
|
-
}
|
|
4015
|
-
try {
|
|
4016
|
-
await verifyUserEmail2({
|
|
4017
|
-
email,
|
|
4018
|
-
slug
|
|
4019
|
-
});
|
|
4020
|
-
setIsEmailSent(true);
|
|
4021
|
-
} catch (err) {
|
|
4022
|
-
const error2 = err instanceof Error ? err : new Error(texts.loginSendEmailError);
|
|
4023
|
-
setError(error2.message);
|
|
4024
|
-
onError == null ? void 0 : onError(error2);
|
|
4025
|
-
}
|
|
4026
|
-
};
|
|
4027
|
-
const handleVerifyCode = async (value) => {
|
|
4028
|
-
var _a2, _b2;
|
|
4029
|
-
setCode(value);
|
|
4030
|
-
setError(null);
|
|
4031
|
-
if (value.length === 6) {
|
|
4032
|
-
try {
|
|
4033
|
-
const response = await verifyUserEmail2({
|
|
4034
|
-
email: void 0,
|
|
4035
|
-
code: value,
|
|
4036
|
-
slug
|
|
4037
|
-
});
|
|
4038
|
-
if (response.ok && response.accessToken) {
|
|
4039
|
-
onSuccess == null ? void 0 : onSuccess(response.userId, response.accessToken);
|
|
4040
|
-
} else {
|
|
4041
|
-
setError((_a2 = texts.loginVerificationFailedError) != null ? _a2 : "");
|
|
4042
|
-
onError == null ? void 0 : onError(new Error(texts.loginVerificationFailedError));
|
|
4043
|
-
}
|
|
4044
|
-
} catch (err) {
|
|
4045
|
-
const error2 = err instanceof Error ? err : new Error(texts.loginVerifyCodeError);
|
|
4046
|
-
if (error2.message.includes("Invalid code")) {
|
|
4047
|
-
setError((_b2 = texts.loginInvalidCodeError) != null ? _b2 : error2.message);
|
|
4048
|
-
setCode("");
|
|
4049
|
-
return;
|
|
4050
|
-
}
|
|
4051
|
-
setError(error2.message);
|
|
4052
|
-
onError == null ? void 0 : onError(error2);
|
|
4053
|
-
setCode("");
|
|
4054
|
-
}
|
|
4055
|
-
}
|
|
4056
|
-
};
|
|
4057
|
-
const handleResendEmail = async () => {
|
|
4058
|
-
var _a2;
|
|
4059
|
-
setCode("");
|
|
4060
|
-
setError(null);
|
|
4061
|
-
if (!email || !slug) {
|
|
4062
|
-
setError((_a2 = texts.loginSlugRequiredError) != null ? _a2 : "");
|
|
4063
|
-
return;
|
|
4064
|
-
}
|
|
4065
|
-
try {
|
|
4066
|
-
await verifyUserEmail2({
|
|
4067
|
-
email,
|
|
4068
|
-
slug
|
|
4069
|
-
});
|
|
4070
|
-
} catch (err) {
|
|
4071
|
-
const error2 = err instanceof Error ? err : new Error(texts.loginResendEmailError);
|
|
4072
|
-
setError(error2.message);
|
|
4073
|
-
onError == null ? void 0 : onError(error2);
|
|
4074
|
-
}
|
|
4075
|
-
};
|
|
4076
|
-
const handleChangeEmail = () => {
|
|
4077
|
-
setIsEmailSent(false);
|
|
4078
|
-
setCode("");
|
|
4079
|
-
setError(null);
|
|
4080
|
-
};
|
|
4081
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Dialog, { open: isOpen, onOpenChange: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(DialogContent, { className: "sm:max-w-[425px] min-h-[250px]", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col min-h-[250px] h-full", children: [
|
|
4082
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { ref: parentHeader, className: "flex items-start gap-2 mb-2", children: [
|
|
4083
|
-
isEmailSent && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4084
|
-
Button,
|
|
4085
|
-
{
|
|
4086
|
-
variant: "ghost",
|
|
4087
|
-
size: "icon-sm",
|
|
4088
|
-
onClick: () => {
|
|
4089
|
-
setIsEmailSent(false);
|
|
4090
|
-
},
|
|
4091
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_lucide_react10.ArrowLeft, { className: "h-5 w-5" })
|
|
4092
|
-
}
|
|
4093
|
-
),
|
|
4094
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CardTitle, { children: isEmailSent ? (_a = texts.loginCodeLabel) != null ? _a : "" : (_b = texts.loginTitle) != null ? _b : "" }) })
|
|
4095
|
-
] }),
|
|
4096
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CardDescription, { className: "mb-4", children: isEmailSent ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
|
|
4097
|
-
(_c = texts.loginCodeSentMessage) != null ? _c : "",
|
|
4098
|
-
" ",
|
|
4099
|
-
email
|
|
4100
|
-
] }) : (_d = texts.loginDescription) != null ? _d : "" }),
|
|
4101
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "flex-1 flex flex-col", children: !isEmailSent ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("form", { onSubmit: handleSendEmail, className: "flex flex-col flex-1", children: [
|
|
4102
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "space-y-2", children: [
|
|
4103
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Label3, { htmlFor: "email", children: (_e = texts.loginEmailLabel) != null ? _e : "" }),
|
|
4104
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4105
|
-
Input,
|
|
4106
|
-
{
|
|
4107
|
-
id: "email",
|
|
4108
|
-
type: "email",
|
|
4109
|
-
placeholder: (_f = texts.loginEmailPlaceholder) != null ? _f : "",
|
|
4110
|
-
value: email,
|
|
4111
|
-
onChange: (e) => setEmail(e.target.value),
|
|
4112
|
-
required: true,
|
|
4113
|
-
disabled: isVerifying,
|
|
4114
|
-
"aria-invalid": error ? "true" : "false"
|
|
4115
|
-
}
|
|
4116
|
-
)
|
|
4117
|
-
] }),
|
|
4118
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4119
|
-
"div",
|
|
4120
|
-
{
|
|
4121
|
-
className: "text-sm text-destructive mt-2 mb-1",
|
|
4122
|
-
role: "alert",
|
|
4123
|
-
children: error
|
|
4124
|
-
}
|
|
4125
|
-
),
|
|
4126
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "grow" }),
|
|
4127
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col items-start gap-0 pt-2", children: [
|
|
4128
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { type: "submit", size: "sm", disabled: isVerifying, children: isVerifying ? (_g = texts.loginSendingButton) != null ? _g : "" : (_h = texts.loginSendCodeButton) != null ? _h : "" }),
|
|
4129
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4130
|
-
Button,
|
|
4131
|
-
{
|
|
4132
|
-
type: "button",
|
|
4133
|
-
variant: "link",
|
|
4134
|
-
className: "ml-0 pl-0",
|
|
4135
|
-
size: "sm",
|
|
4136
|
-
onClick: () => {
|
|
4137
|
-
setIsEmailSent(true);
|
|
4138
|
-
},
|
|
4139
|
-
children: (_i = texts.loginIHaveCode) != null ? _i : ""
|
|
4140
|
-
}
|
|
4141
|
-
)
|
|
4142
|
-
] })
|
|
4143
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
|
|
4144
|
-
"form",
|
|
4145
|
-
{
|
|
4146
|
-
onSubmit: (e) => e.preventDefault(),
|
|
4147
|
-
className: "flex flex-col flex-1",
|
|
4148
|
-
children: [
|
|
4149
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "space-y-2", children: [
|
|
4150
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Label3, { children: (_j = texts.loginCodeLabel) != null ? _j : "" }),
|
|
4151
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4152
|
-
InputOTP,
|
|
4153
|
-
{
|
|
4154
|
-
maxLength: 6,
|
|
4155
|
-
value: code,
|
|
4156
|
-
onChange: handleVerifyCode,
|
|
4157
|
-
disabled: isVerifying,
|
|
4158
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(InputOTPGroup, { children: [
|
|
4159
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(InputOTPSlot, { index: 0 }),
|
|
4160
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(InputOTPSlot, { index: 1 }),
|
|
4161
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(InputOTPSlot, { index: 2 }),
|
|
4162
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(InputOTPSlot, { index: 3 }),
|
|
4163
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(InputOTPSlot, { index: 4 }),
|
|
4164
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(InputOTPSlot, { index: 5 })
|
|
4165
|
-
] })
|
|
4166
|
-
}
|
|
4167
|
-
),
|
|
4168
|
-
isVerifying && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Spinner, {})
|
|
4169
|
-
] }),
|
|
4170
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4171
|
-
"div",
|
|
4172
|
-
{
|
|
4173
|
-
className: "text-sm text-destructive mt-2 mb-1",
|
|
4174
|
-
role: "alert",
|
|
4175
|
-
children: error
|
|
4176
|
-
}
|
|
4177
|
-
),
|
|
4178
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: "grow" }),
|
|
4179
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "flex flex-col items-start gap-2 pt-2", children: [
|
|
4180
|
-
email.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4181
|
-
Button,
|
|
4182
|
-
{
|
|
4183
|
-
variant: "link",
|
|
4184
|
-
size: "sm",
|
|
4185
|
-
onClick: handleResendEmail,
|
|
4186
|
-
disabled: isVerifying,
|
|
4187
|
-
className: "flex-1 ml-0 pl-0",
|
|
4188
|
-
children: (_k = texts.loginResendCodeButton) != null ? _k : ""
|
|
4189
|
-
}
|
|
4190
|
-
),
|
|
4191
|
-
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
4192
|
-
Button,
|
|
4193
|
-
{
|
|
4194
|
-
variant: "link",
|
|
4195
|
-
size: "sm",
|
|
4196
|
-
onClick: handleChangeEmail,
|
|
4197
|
-
disabled: isVerifying,
|
|
4198
|
-
className: "flex-1 ml-0 pl-0",
|
|
4199
|
-
children: (_l = texts.loginChangeEmailButton) != null ? _l : ""
|
|
4200
|
-
}
|
|
4201
|
-
)
|
|
4202
|
-
] })
|
|
4203
|
-
]
|
|
4204
|
-
}
|
|
4205
|
-
) })
|
|
4206
|
-
] }) }) });
|
|
4207
|
-
}
|
|
4208
|
-
|
|
4209
|
-
// src/components/notifications/NotificationsComponentPublic.tsx
|
|
4210
|
-
var import_react20 = require("@formkit/auto-animate/react");
|
|
4211
|
-
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
4212
|
-
function reducer(state, action) {
|
|
4213
|
-
switch (action.type) {
|
|
4214
|
-
case "SET_IS_LOGGED_IN": {
|
|
4215
|
-
return {
|
|
4216
|
-
...state,
|
|
4217
|
-
isLoggedIn: action.value
|
|
4218
|
-
};
|
|
4219
|
-
}
|
|
4220
|
-
case "SET_USER_ID": {
|
|
4221
|
-
return {
|
|
4222
|
-
...state,
|
|
4223
|
-
userID: action.value
|
|
4224
|
-
};
|
|
4225
|
-
}
|
|
4226
|
-
case "SET_LOADING": {
|
|
4227
|
-
return {
|
|
4228
|
-
...state,
|
|
4229
|
-
isLoading: action.value
|
|
4230
|
-
};
|
|
4231
|
-
}
|
|
4232
|
-
case "SET_PUBLIC_GROUPS": {
|
|
4233
|
-
return {
|
|
4234
|
-
...state,
|
|
4235
|
-
groupsProvided: action.value,
|
|
4236
|
-
groups: action.value != null && action.value.length > 0 ? state.groups.filter(
|
|
4237
|
-
(group) => {
|
|
4238
|
-
var _a;
|
|
4239
|
-
return ((_a = action.value) == null ? void 0 : _a.find((g) => g.id === group.id)) != null;
|
|
4240
|
-
}
|
|
4241
|
-
) : state.groups
|
|
4242
|
-
};
|
|
4243
|
-
}
|
|
4244
|
-
case "SET_GROUPS": {
|
|
4245
|
-
const isDefaultOn = state.isLoggedIn == false || state.groupsProvided != null;
|
|
4246
|
-
const newGroupsWithIsOn = action.value.map((group) => {
|
|
4247
|
-
var _a, _b, _c;
|
|
4248
|
-
if (state.isLoggedIn == true) {
|
|
4249
|
-
return group;
|
|
4250
|
-
}
|
|
4251
|
-
return {
|
|
4252
|
-
...group,
|
|
4253
|
-
isOn: (_c = (_b = (_a = state.groupsProvided) == null ? void 0 : _a.find((g) => g.id === group.id)) == null ? void 0 : _b.isOn) != null ? _c : isDefaultOn
|
|
4254
|
-
};
|
|
4255
|
-
});
|
|
4256
|
-
return {
|
|
4257
|
-
...state,
|
|
4258
|
-
groups: newGroupsWithIsOn
|
|
4259
|
-
};
|
|
4260
|
-
}
|
|
4261
|
-
case "TOGGLE_GROUP": {
|
|
4262
|
-
const updatedGroups = state.groups.map((group) => {
|
|
4263
|
-
if (group.id === action.groupID) {
|
|
4264
|
-
return {
|
|
4265
|
-
...group,
|
|
4266
|
-
isOn: !group.isOn
|
|
4267
|
-
};
|
|
4268
|
-
}
|
|
4269
|
-
return group;
|
|
4270
|
-
});
|
|
4271
|
-
return {
|
|
4272
|
-
...state,
|
|
4273
|
-
wasChanged: true,
|
|
4274
|
-
groups: updatedGroups
|
|
4275
|
-
};
|
|
4276
|
-
}
|
|
4277
|
-
case "CHECK_ALL_GROUPS": {
|
|
4278
|
-
const updated = state.groups.map((group) => {
|
|
4279
|
-
return {
|
|
4280
|
-
...group,
|
|
4281
|
-
isOn: true
|
|
4282
|
-
};
|
|
4283
|
-
});
|
|
4284
|
-
return {
|
|
4285
|
-
...state,
|
|
4286
|
-
groups: updated,
|
|
4287
|
-
wasChanged: true
|
|
4288
|
-
};
|
|
4289
|
-
}
|
|
4290
|
-
case "SET_WAS_CHANGED":
|
|
4291
|
-
return {
|
|
4292
|
-
...state,
|
|
4293
|
-
wasChanged: action.value
|
|
4294
|
-
};
|
|
4295
|
-
case "SET_IS_USER_GROUPS_UPDATED":
|
|
4296
|
-
return {
|
|
4297
|
-
...state,
|
|
4298
|
-
isUserGroupsUpdated: action.value
|
|
4299
|
-
};
|
|
4300
|
-
case "RESET_UPDATE_STATE":
|
|
4301
|
-
return {
|
|
4302
|
-
...state,
|
|
4303
|
-
wasChanged: false,
|
|
4304
|
-
isUserGroupsUpdated: true
|
|
4305
|
-
};
|
|
4306
|
-
case "SHOW_SETTINGS":
|
|
4307
|
-
return {
|
|
4308
|
-
...state,
|
|
4309
|
-
showSettings: true
|
|
4310
|
-
};
|
|
4311
|
-
case "HIDE_SETTINGS":
|
|
4312
|
-
return {
|
|
4313
|
-
...state,
|
|
4314
|
-
showSettings: false
|
|
4315
|
-
};
|
|
4316
|
-
default:
|
|
4317
|
-
return state;
|
|
4318
|
-
}
|
|
4319
|
-
}
|
|
4320
|
-
function NotificationsComponentPublic({
|
|
4321
|
-
slug: slugProp,
|
|
4322
|
-
userID,
|
|
4323
|
-
productID: _productID,
|
|
4324
|
-
projectName,
|
|
4325
|
-
projectLogo,
|
|
4326
|
-
projectLogoDark,
|
|
4327
|
-
groups,
|
|
4328
|
-
isManaging = false,
|
|
4329
|
-
texts,
|
|
4330
|
-
showQRCode = false,
|
|
4331
|
-
showPhoneInput = false,
|
|
4332
|
-
hiddenGroupIds = [],
|
|
4333
|
-
className
|
|
4334
|
-
}) {
|
|
4335
|
-
var _a, _b, _c;
|
|
4336
|
-
const [parent] = (0, import_react20.useAutoAnimate)();
|
|
4337
|
-
let slug = (_a = slugProp != null ? slugProp : getProjectID()) != null ? _a : typeof window !== "undefined" ? window.location.hostname : "";
|
|
4338
|
-
const { mutateAsync: updateUserGroups2, isPending: isUpdating } = useMutation3(
|
|
4339
|
-
rpcProvider.notifications.updateUserGroups
|
|
4340
|
-
);
|
|
4341
|
-
const { data: userInfo, refetch: refetchAccessToken } = (0, import_react_query6.useQuery)({
|
|
4342
|
-
queryKey: ["notifications_accessToken"],
|
|
4343
|
-
queryFn: () => {
|
|
4344
|
-
var _a2, _b2;
|
|
4345
|
-
if (typeof window !== "undefined") {
|
|
4346
|
-
return {
|
|
4347
|
-
accessToken: (_a2 = localStorage.getItem("notifications_accessToken")) != null ? _a2 : void 0,
|
|
4348
|
-
userID: (_b2 = localStorage.getItem("notifications_userID")) != null ? _b2 : void 0
|
|
4349
|
-
};
|
|
4350
|
-
}
|
|
4351
|
-
return void 0;
|
|
4352
|
-
}
|
|
4353
|
-
});
|
|
4354
|
-
const {
|
|
4355
|
-
data: groupsDownloaded,
|
|
4356
|
-
isPending: isGroupsDownloading,
|
|
4357
|
-
refetch: refetchGroups
|
|
4358
|
-
} = useQuery4(rpcProvider.notifications.getUserGroups, {
|
|
4359
|
-
slug,
|
|
4360
|
-
accessToken: userInfo == null ? void 0 : userInfo.accessToken
|
|
4361
|
-
});
|
|
4362
|
-
const [state, dispatch] = (0, import_react19.useReducer)(reducer, {
|
|
4363
|
-
isLoading: isGroupsDownloading,
|
|
4364
|
-
isUserGroupsUpdated: false,
|
|
4365
|
-
wasChanged: false,
|
|
4366
|
-
groupsProvided: groups,
|
|
4367
|
-
groups: [],
|
|
4368
|
-
showSettings: userInfo != null && isManaging == true,
|
|
4369
|
-
isLoggedIn: userInfo != null,
|
|
4370
|
-
userID: void 0
|
|
4371
|
-
});
|
|
4372
|
-
(0, import_react19.useEffect)(() => {
|
|
4373
|
-
dispatch({ type: "SET_LOADING", value: isUpdating || isGroupsDownloading });
|
|
4374
|
-
}, [isUpdating, isGroupsDownloading]);
|
|
4375
|
-
(0, import_react19.useEffect)(() => {
|
|
4376
|
-
dispatch({
|
|
4377
|
-
type: "SET_IS_LOGGED_IN",
|
|
4378
|
-
value: (userInfo == null ? void 0 : userInfo.accessToken) != null
|
|
4379
|
-
});
|
|
4380
|
-
dispatch({ type: "SET_USER_ID", value: userInfo == null ? void 0 : userInfo.userID });
|
|
4381
|
-
if ((userInfo == null ? void 0 : userInfo.accessToken) != null && isManaging == true) {
|
|
4382
|
-
dispatch({ type: "SHOW_SETTINGS" });
|
|
4383
|
-
}
|
|
4384
|
-
}, [userInfo, isManaging]);
|
|
4385
|
-
(0, import_react19.useEffect)(() => {
|
|
4386
|
-
if (groupsDownloaded == null) {
|
|
4387
|
-
return;
|
|
4388
|
-
}
|
|
4389
|
-
let newGroups = groupsDownloaded.groups.map((group) => {
|
|
4390
|
-
var _a2;
|
|
4391
|
-
let howOften = "rarely";
|
|
4392
|
-
switch (group.howOften) {
|
|
4393
|
-
case 0 /* RARELY */:
|
|
4394
|
-
howOften = "rarely";
|
|
4395
|
-
break;
|
|
4396
|
-
case 1 /* OFTEN */:
|
|
4397
|
-
howOften = "often";
|
|
4398
|
-
break;
|
|
4399
|
-
case 2 /* VERY_OFTEN */:
|
|
4400
|
-
howOften = "veryOften";
|
|
4401
|
-
break;
|
|
4402
|
-
}
|
|
4403
|
-
return {
|
|
4404
|
-
id: group.id,
|
|
4405
|
-
name: group.name,
|
|
4406
|
-
description: group.description,
|
|
4407
|
-
howOften,
|
|
4408
|
-
isOn: (_a2 = group.isOn) != null ? _a2 : void 0
|
|
4409
|
-
};
|
|
4410
|
-
});
|
|
4411
|
-
dispatch({ type: "SET_GROUPS", value: newGroups });
|
|
4412
|
-
}, [groupsDownloaded, isGroupsDownloading, groups]);
|
|
4413
|
-
const timeoutRef = (0, import_react19.useRef)(null);
|
|
4414
|
-
(0, import_react19.useEffect)(() => {
|
|
4415
|
-
let preparedGroups = groups == null ? void 0 : groups.map((el) => {
|
|
4416
|
-
if (el.id.startsWith("group_")) {
|
|
4417
|
-
return el;
|
|
4418
|
-
}
|
|
4419
|
-
el.id = `group_${el.id}`;
|
|
4420
|
-
return el;
|
|
4421
|
-
});
|
|
4422
|
-
dispatch({ type: "SET_PUBLIC_GROUPS", value: preparedGroups });
|
|
4423
|
-
}, [groups]);
|
|
4424
|
-
const mergedTexts = { ...DEFAULT_TEXTS, ...texts };
|
|
4425
|
-
async function updateGroups() {
|
|
4426
|
-
await updateUserGroups2({
|
|
4427
|
-
accessToken: userInfo == null ? void 0 : userInfo.accessToken,
|
|
4428
|
-
slug,
|
|
4429
|
-
userId: userID,
|
|
4430
|
-
groupIds: state.groups.filter((el) => el.isOn === true).map((el) => el.id)
|
|
4431
|
-
});
|
|
4432
|
-
dispatch({ type: "RESET_UPDATE_STATE" });
|
|
4433
|
-
if (timeoutRef.current) {
|
|
4434
|
-
clearTimeout(timeoutRef.current);
|
|
4435
|
-
}
|
|
4436
|
-
timeoutRef.current = setTimeout(() => {
|
|
4437
|
-
dispatch({ type: "SET_IS_USER_GROUPS_UPDATED", value: false });
|
|
4438
|
-
}, 2e3);
|
|
4439
|
-
}
|
|
4440
|
-
function toggleGroup(groupID) {
|
|
4441
|
-
dispatch({ type: "TOGGLE_GROUP", groupID });
|
|
4442
|
-
}
|
|
4443
|
-
function checkAllGroups() {
|
|
4444
|
-
dispatch({ type: "CHECK_ALL_GROUPS" });
|
|
4445
|
-
}
|
|
4446
|
-
function handleSettingsClick() {
|
|
4447
|
-
dispatch({ type: "SHOW_SETTINGS" });
|
|
4448
|
-
}
|
|
4449
|
-
function handleCloseSettings() {
|
|
4450
|
-
dispatch({ type: "HIDE_SETTINGS" });
|
|
4451
|
-
}
|
|
4452
|
-
function handleLogout() {
|
|
4453
|
-
localStorage.removeItem("notifications_accessToken");
|
|
4454
|
-
localStorage.removeItem("notifications_userID");
|
|
4455
|
-
refetchAccessToken();
|
|
4456
|
-
dispatch({ type: "SET_USER_ID", value: void 0 });
|
|
4457
|
-
dispatch({ type: "SET_IS_LOGGED_IN", value: false });
|
|
4458
|
-
dispatch({ type: "HIDE_SETTINGS" });
|
|
4459
|
-
}
|
|
4460
|
-
async function handleLoginSuccess(userID2, accessToken) {
|
|
4461
|
-
if (typeof window !== "undefined") {
|
|
4462
|
-
localStorage.setItem("notifications_accessToken", accessToken);
|
|
4463
|
-
if (userID2 != null) {
|
|
4464
|
-
localStorage.setItem("notifications_userID", userID2);
|
|
4465
|
-
}
|
|
4466
|
-
}
|
|
4467
|
-
dispatch({ type: "SET_USER_ID", value: userID2 });
|
|
4468
|
-
try {
|
|
4469
|
-
await refetchAccessToken();
|
|
4470
|
-
refetchGroups().then().catch().finally(() => {
|
|
4471
|
-
if (isManaging == true) {
|
|
4472
|
-
dispatch({ type: "SHOW_SETTINGS" });
|
|
4473
|
-
}
|
|
4474
|
-
});
|
|
4475
|
-
} catch (e) {
|
|
4476
|
-
console.log(`Error: ${e}`);
|
|
4477
|
-
}
|
|
4478
|
-
}
|
|
4479
|
-
(0, import_react19.useEffect)(() => {
|
|
4480
|
-
return () => {
|
|
4481
|
-
if (timeoutRef.current) {
|
|
4482
|
-
clearTimeout(timeoutRef.current);
|
|
4483
|
-
}
|
|
4484
|
-
};
|
|
4485
|
-
}, []);
|
|
4486
|
-
const isManagingEnabled = isManaging == true && state.userID != null && (userInfo == null ? void 0 : userInfo.accessToken) != null;
|
|
4487
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("main", { className: cn("bitsnap-checkout relative", className == null ? void 0 : className.container), children: [
|
|
4488
|
-
mergedTexts.title != null && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h1", { className: "text-2xl font-semibold text-black md:text-3xl lg:text-4xl xl:text-5xl dark:text-neutral-100", children: mergedTexts.title }),
|
|
4489
|
-
!state.showSettings && isManaging && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4490
|
-
Button,
|
|
4491
|
-
{
|
|
4492
|
-
onClick: handleSettingsClick,
|
|
4493
|
-
variant: "outline",
|
|
4494
|
-
size: "icon",
|
|
4495
|
-
className: "absolute bottom-6 right-6 z-50 h-12 w-12 rounded-full shadow-lg hover:shadow-xl md:bottom-8 md:right-8",
|
|
4496
|
-
"aria-label": "Settings",
|
|
4497
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_lucide_react11.Settings, { className: "h-5 w-5" })
|
|
4498
|
-
}
|
|
4499
|
-
),
|
|
4500
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4501
|
-
"div",
|
|
4502
|
-
{
|
|
4503
|
-
className: cn(
|
|
4504
|
-
"md:pt8 relative z-0 mt-6 overflow-hidden rounded-2xl bg-white px-3 pt-6 pb-3 md:px-5 md:pb-5 dark:bg-neutral-800",
|
|
4505
|
-
className == null ? void 0 : className.header
|
|
4506
|
-
),
|
|
4507
|
-
children: state.showSettings ? (
|
|
4508
|
-
// Settings View
|
|
4509
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "space-y-6", children: state.isLoggedIn && // Managing Groups View (logged in)
|
|
4510
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
4511
|
-
"div",
|
|
4512
|
-
{
|
|
4513
|
-
className: cn(
|
|
4514
|
-
"grid grid-cols-1 gap-3 lg:gap-6",
|
|
4515
|
-
isManagingEnabled ? "md:grid-cols-2" : ""
|
|
4516
|
-
),
|
|
4517
|
-
children: [
|
|
4518
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { className: className == null ? void 0 : className.groupsContainer, children: [
|
|
4519
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4520
|
-
NotificationHeader,
|
|
4521
|
-
{
|
|
4522
|
-
projectName,
|
|
4523
|
-
projectLogo,
|
|
4524
|
-
projectLogoDark,
|
|
4525
|
-
description: mergedTexts.managingDescription,
|
|
4526
|
-
className,
|
|
4527
|
-
onLogout: handleLogout
|
|
4528
|
-
}
|
|
4529
|
-
),
|
|
4530
|
-
isGroupsDownloading && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: "flex justify-center items-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Spinner, {}) }),
|
|
4531
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4532
|
-
NotificationGroupsList,
|
|
4533
|
-
{
|
|
4534
|
-
groups: state.groups,
|
|
4535
|
-
hiddenGroupIds,
|
|
4536
|
-
isManaging,
|
|
4537
|
-
onToggle: toggleGroup,
|
|
4538
|
-
onCheckAll: checkAllGroups,
|
|
4539
|
-
onUpdate: updateGroups,
|
|
4540
|
-
isUpdating,
|
|
4541
|
-
wasChanged: state.wasChanged,
|
|
4542
|
-
isUserGroupsUpdated: state.isUserGroupsUpdated,
|
|
4543
|
-
className,
|
|
4544
|
-
texts: mergedTexts
|
|
4545
|
-
}
|
|
4546
|
-
)
|
|
4547
|
-
] }),
|
|
4548
|
-
isManagingEnabled && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4549
|
-
ManageMyData,
|
|
4550
|
-
{
|
|
4551
|
-
accessToken: (_b = userInfo.accessToken) != null ? _b : "",
|
|
4552
|
-
slug,
|
|
4553
|
-
userID: (_c = state.userID) != null ? _c : "",
|
|
4554
|
-
className,
|
|
4555
|
-
texts: mergedTexts
|
|
4556
|
-
}
|
|
4557
|
-
),
|
|
4558
|
-
showQRCode != false && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4559
|
-
QRCodeSection,
|
|
4560
|
-
{
|
|
4561
|
-
showQRCode,
|
|
4562
|
-
isManaging: true,
|
|
4563
|
-
className,
|
|
4564
|
-
texts: mergedTexts
|
|
4565
|
-
}
|
|
4566
|
-
)
|
|
4567
|
-
]
|
|
4568
|
-
}
|
|
4569
|
-
) })
|
|
4570
|
-
) : (
|
|
4571
|
-
// Default View (Form only)
|
|
4572
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { className: cn("grid grid-cols-1 gap-3 lg:gap-6"), children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4573
|
-
AddUserToGroups,
|
|
4574
|
-
{
|
|
4575
|
-
slug,
|
|
4576
|
-
onToggle: (id) => {
|
|
4577
|
-
dispatch({ type: "TOGGLE_GROUP", groupID: id });
|
|
4578
|
-
},
|
|
4579
|
-
onCheckAll: () => {
|
|
4580
|
-
dispatch({ type: "CHECK_ALL_GROUPS" });
|
|
4581
|
-
},
|
|
4582
|
-
onSuccess: (userAlreadyExists, userID2, accessToken) => {
|
|
4583
|
-
if (accessToken != null) {
|
|
4584
|
-
handleLoginSuccess(userID2, accessToken);
|
|
4585
|
-
}
|
|
4586
|
-
if (userAlreadyExists) {
|
|
4587
|
-
dispatch({ type: "SHOW_SETTINGS" });
|
|
4588
|
-
}
|
|
4589
|
-
},
|
|
4590
|
-
groups: state.groups,
|
|
4591
|
-
showPhoneInput,
|
|
4592
|
-
agreementText: mergedTexts.agreementText,
|
|
4593
|
-
className,
|
|
4594
|
-
texts: mergedTexts,
|
|
4595
|
-
wasChanged: state.wasChanged,
|
|
4596
|
-
isUpdating
|
|
4597
|
-
}
|
|
4598
|
-
) })
|
|
4599
|
-
)
|
|
4600
|
-
}
|
|
4601
|
-
),
|
|
4602
|
-
/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4603
|
-
LoginScreen,
|
|
4604
|
-
{
|
|
4605
|
-
isOpen: state.showSettings && !state.isLoggedIn,
|
|
4606
|
-
slug,
|
|
4607
|
-
onSuccess: handleLoginSuccess,
|
|
4608
|
-
texts: mergedTexts,
|
|
4609
|
-
onClose: handleCloseSettings
|
|
4610
|
-
}
|
|
4611
|
-
)
|
|
4612
|
-
] });
|
|
4613
|
-
}
|
|
4614
|
-
function Wrapper3({
|
|
4615
|
-
slug,
|
|
4616
|
-
userID,
|
|
4617
|
-
productID,
|
|
4618
|
-
projectName,
|
|
4619
|
-
projectLogo,
|
|
4620
|
-
projectLogoDark,
|
|
4621
|
-
groups,
|
|
4622
|
-
isManaging,
|
|
4623
|
-
texts,
|
|
4624
|
-
showQRCode,
|
|
4625
|
-
showPhoneInput,
|
|
4626
|
-
hiddenGroupIds,
|
|
4627
|
-
className
|
|
4628
|
-
}) {
|
|
4629
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(RpcProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
4630
|
-
NotificationsComponentPublic,
|
|
4631
|
-
{
|
|
4632
|
-
slug,
|
|
4633
|
-
userID,
|
|
4634
|
-
productID,
|
|
4635
|
-
projectName,
|
|
4636
|
-
projectLogo,
|
|
4637
|
-
projectLogoDark,
|
|
4638
|
-
groups,
|
|
4639
|
-
isManaging,
|
|
4640
|
-
texts,
|
|
4641
|
-
showQRCode,
|
|
4642
|
-
showPhoneInput,
|
|
4643
|
-
hiddenGroupIds,
|
|
4644
|
-
className
|
|
4645
|
-
}
|
|
4646
|
-
) });
|
|
4647
|
-
}
|
|
4648
|
-
var NotificationsComponentPublic_default = Wrapper3;
|
|
4649
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
4650
|
-
0 && (module.exports = {
|
|
4651
|
-
ApplePayButton,
|
|
4652
|
-
Bitsnap,
|
|
4653
|
-
BitsnapCheckout,
|
|
4654
|
-
GooglePayButton,
|
|
4655
|
-
NotificationsComponent,
|
|
4656
|
-
createCheckout,
|
|
4657
|
-
createPaymentURL,
|
|
4658
|
-
getReferenceIfPossible,
|
|
4659
|
-
injectReferenceToRequestIfNeeded,
|
|
4660
|
-
setCustomHost,
|
|
4661
|
-
setProjectID
|
|
4662
|
-
});
|
|
4663
|
-
//# sourceMappingURL=index.js.map
|