@drawbridge/components 0.1.48 → 0.1.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/dist/bridge/fields.js +0 -278
  2. package/dist/bridge/fields.mjs +1 -276
  3. package/dist/bridge/form-subdomain-shop-modal.js +274 -234
  4. package/dist/bridge/form-subdomain-shop-modal.mjs +275 -233
  5. package/dist/bridge/form-subdomain.js +0 -7
  6. package/dist/bridge/form-subdomain.mjs +2 -9
  7. package/dist/bridge/lib/age-gate.js +0 -12
  8. package/dist/bridge/lib/age-gate.mjs +0 -11
  9. package/dist/bridge/lib/checkout-kit.js +32 -2
  10. package/dist/bridge/lib/checkout-kit.mjs +32 -2
  11. package/dist/bridge/lib/entry.js +3 -3
  12. package/dist/bridge/lib/entry.mjs +2 -2
  13. package/dist/bridge/product-tile.js +6 -9
  14. package/dist/bridge/product-tile.mjs +6 -9
  15. package/dist/bridge/template-layout.js +123 -238
  16. package/dist/bridge/template-layout.mjs +124 -239
  17. package/dist/bridge/template-modal.js +73 -28
  18. package/dist/bridge/template-modal.mjs +74 -29
  19. package/dist/dashboard/buttons-subscription.js +1 -1
  20. package/dist/dashboard/buttons-subscription.mjs +1 -1
  21. package/dist/dashboard/campaign-form.js +2 -7
  22. package/dist/dashboard/campaign-form.mjs +2 -7
  23. package/dist/dashboard/card-order.js +4 -22
  24. package/dist/dashboard/card-order.mjs +4 -22
  25. package/dist/dashboard/document-blocks.js +17 -4
  26. package/dist/dashboard/document-blocks.mjs +17 -4
  27. package/dist/dashboard/form-admin-provider.js +17 -71
  28. package/dist/dashboard/form-admin-provider.mjs +17 -71
  29. package/dist/dashboard/form-file-upload.js +2 -3
  30. package/dist/dashboard/form-file-upload.mjs +3 -4
  31. package/dist/dashboard/form-organization-campaign-advertisements.js +6 -47
  32. package/dist/dashboard/form-organization-campaign-advertisements.mjs +6 -47
  33. package/dist/dashboard/form-organization-campaign-agreement.js +121 -83
  34. package/dist/dashboard/form-organization-campaign-agreement.mjs +121 -83
  35. package/dist/dashboard/form-organization-campaign.js +0 -82
  36. package/dist/dashboard/form-organization-campaign.mjs +0 -81
  37. package/dist/dashboard/form-organization-connection.js +6 -48
  38. package/dist/dashboard/form-organization-connection.mjs +7 -48
  39. package/dist/dashboard/form-organization-workflow.js +1 -72
  40. package/dist/dashboard/form-organization-workflow.mjs +1 -69
  41. package/dist/dashboard/form-otc.js +5 -4
  42. package/dist/dashboard/form-otc.mjs +5 -4
  43. package/dist/dashboard/form-stripe.js +5 -12
  44. package/dist/dashboard/form-stripe.mjs +5 -12
  45. package/dist/dashboard/input-fields.js +158 -11
  46. package/dist/dashboard/input-fields.mjs +158 -11
  47. package/dist/dashboard/input-file.js +4 -21
  48. package/dist/dashboard/input-file.mjs +4 -21
  49. package/dist/dashboard/lib/connection-controls.js +2 -5
  50. package/dist/dashboard/lib/connection-controls.mjs +1 -3
  51. package/dist/dashboard/lib/form-page.js +1 -1
  52. package/dist/dashboard/lib/form-page.mjs +1 -1
  53. package/dist/dashboard/lib/uppy.js +1 -10
  54. package/dist/dashboard/lib/uppy.mjs +2 -11
  55. package/dist/dashboard/order-sections.js +6 -456
  56. package/dist/dashboard/order-sections.mjs +7 -453
  57. package/dist/dashboard/provider-ui.js +7 -9
  58. package/dist/dashboard/provider-ui.mjs +7 -9
  59. package/dist/dashboard/template-ui.js +12 -4
  60. package/dist/dashboard/template-ui.mjs +12 -4
  61. package/dist/input-checkbox.js +10 -28
  62. package/dist/input-checkbox.mjs +10 -28
  63. package/dist/product.js +24 -96
  64. package/dist/product.mjs +25 -97
  65. package/dist/shared/lib/helpers.js +6 -54
  66. package/dist/shared/lib/helpers.mjs +8 -53
  67. package/package.json +4 -74
  68. package/types/bridge/fields.d.ts +2 -14
  69. package/types/bridge/form-subdomain-shop-modal.d.ts +3 -27
  70. package/types/bridge/lib/age-gate.d.ts +0 -5
  71. package/types/bridge/lib/checkout-kit.d.ts +10 -2
  72. package/types/bridge/lib/entry.d.ts +3 -3
  73. package/types/dashboard/card-order.d.ts +0 -6
  74. package/types/dashboard/document-blocks.d.ts +3 -2
  75. package/types/dashboard/form-admin-provider.d.ts +2 -9
  76. package/types/dashboard/form-file-upload.d.ts +1 -2
  77. package/types/dashboard/form-organization-campaign-advertisements.d.ts +0 -3
  78. package/types/dashboard/form-organization-campaign-agreement.d.ts +5 -2
  79. package/types/dashboard/form-organization-campaign.d.ts +0 -3
  80. package/types/dashboard/form-organization-connection.d.ts +0 -11
  81. package/types/dashboard/form-otc.d.ts +1 -5
  82. package/types/dashboard/form-stripe.d.ts +2 -3
  83. package/types/dashboard/input-file.d.ts +0 -2
  84. package/types/dashboard/order-sections.d.ts +1 -24
  85. package/types/input-checkbox.d.ts +0 -2
  86. package/types/shared/lib/helpers.d.ts +0 -4
  87. package/dist/bridge/cart-drawer.js +0 -152
  88. package/dist/bridge/cart-drawer.mjs +0 -123
  89. package/dist/bridge/form-subdomain-checkout.js +0 -687
  90. package/dist/bridge/form-subdomain-checkout.mjs +0 -665
  91. package/dist/bridge/lib/cart.js +0 -79
  92. package/dist/bridge/lib/cart.mjs +0 -48
  93. package/dist/dashboard/embed-stripe.js +0 -145
  94. package/dist/dashboard/embed-stripe.mjs +0 -116
  95. package/dist/dashboard/form-organization-campaign-field-birthday.js +0 -193
  96. package/dist/dashboard/form-organization-campaign-field-birthday.mjs +0 -164
  97. package/dist/dashboard/form-organization-campaign-field-rating.js +0 -246
  98. package/dist/dashboard/form-organization-campaign-field-rating.mjs +0 -217
  99. package/dist/dashboard/form-organization-product.js +0 -1461
  100. package/dist/dashboard/form-organization-product.mjs +0 -1425
  101. package/dist/dashboard/input-gallery.js +0 -201
  102. package/dist/dashboard/input-gallery.mjs +0 -172
  103. package/dist/dashboard/lib/products.js +0 -169
  104. package/dist/dashboard/lib/products.mjs +0 -135
  105. package/dist/dashboard/lib/settings-paths.js +0 -35
  106. package/dist/dashboard/lib/settings-paths.mjs +0 -11
  107. package/dist/dashboard/shipping-rates.js +0 -404
  108. package/dist/dashboard/shipping-rates.mjs +0 -371
  109. package/dist/dashboard/template-buyer.js +0 -301
  110. package/dist/dashboard/template-buyer.mjs +0 -267
  111. package/dist/shared/order-summary.js +0 -139
  112. package/dist/shared/order-summary.mjs +0 -110
  113. package/types/bridge/cart-drawer.d.ts +0 -31
  114. package/types/bridge/form-subdomain-checkout.d.ts +0 -20
  115. package/types/bridge/lib/cart.d.ts +0 -44
  116. package/types/dashboard/embed-stripe.d.ts +0 -25
  117. package/types/dashboard/form-organization-campaign-field-birthday.d.ts +0 -31
  118. package/types/dashboard/form-organization-campaign-field-rating.d.ts +0 -33
  119. package/types/dashboard/form-organization-product.d.ts +0 -24
  120. package/types/dashboard/input-gallery.d.ts +0 -14
  121. package/types/dashboard/lib/products.d.ts +0 -14
  122. package/types/dashboard/lib/settings-paths.d.ts +0 -5
  123. package/types/dashboard/shipping-rates.d.ts +0 -26
  124. package/types/dashboard/template-buyer.d.ts +0 -50
  125. package/types/shared/order-summary.d.ts +0 -19
@@ -1,32 +1,15 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { useState } from "react";
4
3
  import { useQueryClient } from "@tanstack/react-query";
5
- import { formatCurrency, formatDateString } from "@drawbridge/drawbridge-utils";
4
+ import { formatDateString } from "@drawbridge/drawbridge-utils";
6
5
  import { request } from "@drawbridge/drawbridge-utils/fetch";
7
- import { CARRIERS, paymentOf, shopifyOrderUrl } from "@drawbridge/drawbridge-utils/products";
8
- import { Controller, useForm } from "../shared/lib/form.mjs";
9
- import { statusBadge } from "../shared/lib/helpers.mjs";
10
6
  import { useCallbacks, useModal } from "./lib/hooks.mjs";
11
- import CardDataItem from "./card-data-item.mjs";
12
7
  import CardSection from "./card-section.mjs";
13
- import CardSetting from "./card-setting.mjs";
14
8
  import CardTask from "./card-task.mjs";
15
- import EmbedStripe from "./embed-stripe.mjs";
16
9
  import FormAction from "./form-action.mjs";
17
10
  import Paged from "./paged.mjs";
18
- import AddressLines from "../shared/address-lines.mjs";
19
11
  import Badge from "../shared/badge.mjs";
20
12
  import Button from "../shared/button.mjs";
21
- import Empty from "../shared/empty.mjs";
22
- import Fieldset from "../shared/fieldset.mjs";
23
- import Form from "../shared/form.mjs";
24
- import OrderSummary from "../shared/order-summary.mjs";
25
- import InputCheckbox from "../input-checkbox.mjs";
26
- import InputGroup from "../input-group.mjs";
27
- import InputSelect from "../input-select.mjs";
28
- import InputText from "../input-text.mjs";
29
- import External from "../icons/external.mjs";
30
13
  import Plus from "../icons/plus.mjs";
31
14
  const date = (value) => formatDateString({
32
15
  date: value,
@@ -45,8 +28,8 @@ const useConfirm = () => {
45
28
  const { onError } = useCallbacks({
46
29
  queryClient
47
30
  });
48
- return ({ action, body, endpoint, message, method = "PUT", onSuccess, task, title, warning }) => modal.open({
49
- title: title || action,
31
+ return ({ action, body, endpoint, message, method = "PUT", onSuccess, task, warning }) => modal.open({
32
+ title: action,
50
33
  message: /* @__PURE__ */ jsxs(
51
34
  FormAction,
52
35
  {
@@ -93,305 +76,19 @@ const fulfillmentControls = ({ manage, order }) => {
93
76
  var _a;
94
77
  const editable = Boolean(manage) && (order == null ? void 0 : order.status) === "open";
95
78
  return {
96
- add: editable && ((_a = order == null ? void 0 : order.fulfillment) == null ? void 0 : _a.status) !== "fulfilled" && (order == null ? void 0 : order.payment) !== "refunded",
79
+ add: editable && ((_a = order == null ? void 0 : order.fulfillment) == null ? void 0 : _a.status) !== "fulfilled",
97
80
  cancel: editable
98
81
  };
99
82
  };
100
- const stripeOrder = (order) => {
101
- var _a;
102
- return ((_a = order == null ? void 0 : order.provider) == null ? void 0 : _a.slug) === "stripe";
103
- };
104
- const moneyOf = (order) => (value) => formatCurrency({ code: ((order == null ? void 0 : order.currency) || "usd").toUpperCase(), value: value || 0 });
105
- const FormFulfill = ({ endpoint, onError, onSuccess }) => {
106
- const { control, formState, handleSubmit } = useForm({
107
- values: {
108
- carrier: CARRIERS[0],
109
- emailed: true,
110
- tracking: ""
111
- }
112
- });
113
- const onSubmit = async ({ carrier, emailed, tracking }) => {
114
- try {
115
- onSuccess(await request({
116
- body: {
117
- carrier,
118
- emailed: Boolean(emailed),
119
- tracking: (tracking || "").trim()
120
- },
121
- endpoint: endpoint + "/fulfillment",
122
- method: "POST"
123
- }));
124
- } catch (error) {
125
- onError == null ? void 0 : onError(error);
126
- }
127
- };
128
- return /* @__PURE__ */ jsxs(
129
- Form,
130
- {
131
- ...{
132
- className: "relative w-full space-y-6",
133
- onSubmit: handleSubmit(onSubmit)
134
- },
135
- children: [
136
- /* @__PURE__ */ jsxs(
137
- Fieldset,
138
- {
139
- ...{
140
- className: "space-y-6",
141
- disabled: formState == null ? void 0 : formState.isSubmitting
142
- },
143
- children: [
144
- /* @__PURE__ */ jsx(
145
- Controller,
146
- {
147
- ...{
148
- control,
149
- name: "carrier",
150
- render: ({ field: { onChange, value } }) => /* @__PURE__ */ jsx(
151
- InputGroup,
152
- {
153
- ...{
154
- input: /* @__PURE__ */ jsx(
155
- InputSelect,
156
- {
157
- ...{
158
- onChange,
159
- options: CARRIERS.map((carrier) => ({
160
- label: carrier,
161
- value: carrier
162
- })),
163
- value
164
- }
165
- }
166
- ),
167
- label: "Carrier"
168
- }
169
- }
170
- )
171
- }
172
- }
173
- ),
174
- /* @__PURE__ */ jsx(
175
- Controller,
176
- {
177
- ...{
178
- control,
179
- name: "tracking",
180
- render: ({ field: { onChange, value } }) => /* @__PURE__ */ jsx(
181
- InputGroup,
182
- {
183
- ...{
184
- input: /* @__PURE__ */ jsx(
185
- InputText,
186
- {
187
- ...{
188
- onChange,
189
- value: value || ""
190
- }
191
- }
192
- ),
193
- label: "Tracking number"
194
- }
195
- }
196
- )
197
- }
198
- }
199
- ),
200
- /* @__PURE__ */ jsx(
201
- Controller,
202
- {
203
- ...{
204
- control,
205
- name: "emailed",
206
- render: ({ field: { onChange, value } }) => /* @__PURE__ */ jsx(
207
- InputCheckbox,
208
- {
209
- ...{
210
- label: "Email the customer their tracking details",
211
- onChange,
212
- value
213
- }
214
- }
215
- )
216
- }
217
- }
218
- )
219
- ]
220
- }
221
- ),
222
- /* @__PURE__ */ jsx(
223
- Fieldset,
224
- {
225
- ...{
226
- disabled: formState == null ? void 0 : formState.isSubmitting
227
- },
228
- children: /* @__PURE__ */ jsx(
229
- Button,
230
- {
231
- ...{
232
- loading: formState == null ? void 0 : formState.isSubmitting,
233
- type: "submit"
234
- },
235
- children: "Mark as fulfilled"
236
- }
237
- )
238
- }
239
- )
240
- ]
241
- }
242
- );
243
- };
244
- const ShopifyFulfillment = ({ order }) => {
245
- var _a, _b, _c;
246
- const status = statusBadge("fulfillment", (_a = order == null ? void 0 : order.fulfillment) == null ? void 0 : _a.status);
247
- const href = shopifyOrderUrl({ domain: (_b = order == null ? void 0 : order.source) == null ? void 0 : _b.domain, providerId: (_c = order == null ? void 0 : order.provider) == null ? void 0 : _c.id });
248
- return status && /* @__PURE__ */ jsx(
249
- CardSection,
250
- {
251
- ...{
252
- className: "shrink-0",
253
- cta: href && /* @__PURE__ */ jsx(
254
- Button,
255
- {
256
- ...{
257
- ...small,
258
- "aria-label": "Open in Shopify",
259
- element: "a",
260
- href,
261
- icon: External,
262
- target: "_blank"
263
- }
264
- }
265
- ),
266
- title: "Fulfillment"
267
- },
268
- children: /* @__PURE__ */ jsx(
269
- Empty,
270
- {
271
- ...{
272
- variant: "secondary"
273
- },
274
- children: /* @__PURE__ */ jsx("p", { children: "This order is " + status.text.toLowerCase() + " in Shopify" })
275
- }
276
- )
277
- }
278
- );
279
- };
280
83
  const small = {
281
84
  inline: true,
282
85
  size: "small",
283
86
  variant: "secondary"
284
87
  };
285
- const PaidRow = ({ cancel, disabled, item }) => /* @__PURE__ */ jsxs(
286
- "div",
287
- {
288
- ...{
289
- className: "space-y-3 py-4 first:pt-0 last:pb-0"
290
- },
291
- children: [
292
- /* @__PURE__ */ jsxs(
293
- "div",
294
- {
295
- ...{
296
- className: "flex items-center justify-between gap-4"
297
- },
298
- children: [
299
- /* @__PURE__ */ jsxs(
300
- "div",
301
- {
302
- ...{
303
- className: "flex items-center gap-3 min-w-0"
304
- },
305
- children: [
306
- /* @__PURE__ */ jsx(
307
- "p",
308
- {
309
- ...{
310
- className: "break-words"
311
- },
312
- children: item.tracking || "No tracking number"
313
- }
314
- ),
315
- /* @__PURE__ */ jsx(
316
- Badge,
317
- {
318
- ...{
319
- type: item.status === "active" ? "success" : "secondary"
320
- },
321
- children: item.status === "active" ? "Fulfilled" : "Canceled"
322
- }
323
- )
324
- ]
325
- }
326
- ),
327
- item.status === "active" && /* @__PURE__ */ jsx(
328
- Button,
329
- {
330
- ...{
331
- ...small,
332
- disabled,
333
- onClick: cancel
334
- },
335
- children: "Cancel"
336
- }
337
- )
338
- ]
339
- }
340
- ),
341
- /* @__PURE__ */ jsx(
342
- "div",
343
- {
344
- ...{
345
- className: "grid grid-cols-3 gap-6"
346
- },
347
- children: [
348
- ["Carrier", item.carrier || "\u2014"],
349
- ["Date", date(item.createdAt)],
350
- ["Customer", item.emailed ? "Emailed" : "Not emailed"]
351
- ].map(([label, value]) => /* @__PURE__ */ jsx(
352
- CardDataItem,
353
- {
354
- ...{
355
- className: "flex flex-col min-w-0",
356
- classNameSlotLeft: "text-sm disabled",
357
- classNameSlotRight: "break-words",
358
- element: "div",
359
- label,
360
- value
361
- }
362
- },
363
- label
364
- ))
365
- }
366
- )
367
- ]
368
- }
369
- );
370
88
  const OrderFulfillment = ({ endpoint, manage, onSuccess, order }) => {
371
- var _a;
372
- const queryClient = useQueryClient();
373
- const modal = useModal({
374
- queryClient
375
- });
376
- const { onError } = useCallbacks({
377
- queryClient
378
- });
379
89
  const confirm = useConfirm();
380
90
  const controls = fulfillmentControls({ manage, order });
381
- const paid = stripeOrder(order);
382
- const fulfill = () => paid ? modal.open({
383
- message: /* @__PURE__ */ jsx(
384
- FormFulfill,
385
- {
386
- ...{
387
- endpoint,
388
- onError,
389
- onSuccess
390
- }
391
- }
392
- ),
393
- title: "Mark as fulfilled"
394
- }) : confirm({
91
+ const fulfill = () => confirm({
395
92
  action: "Mark as fulfilled",
396
93
  endpoint: endpoint + "/fulfillment",
397
94
  message: "Mark this order as fulfilled?",
@@ -404,11 +101,9 @@ const OrderFulfillment = ({ endpoint, manage, onSuccess, order }) => {
404
101
  status: "canceled"
405
102
  },
406
103
  endpoint: endpoint + "/fulfillment/" + item.id,
407
- message: paid ? "The order goes back to Unfulfilled. The customer is not emailed." : "Cancel this fulfillment?",
104
+ message: "Cancel this fulfillment?",
408
105
  onSuccess
409
106
  });
410
- if (((_a = order == null ? void 0 : order.provider) == null ? void 0 : _a.slug) === "shopify") return /* @__PURE__ */ jsx(ShopifyFulfillment, { ...{ order } });
411
- if (paid && !(order == null ? void 0 : order.fulfillment)) return null;
412
107
  const cta = /* @__PURE__ */ jsx(
413
108
  Button,
414
109
  {
@@ -449,17 +144,7 @@ const OrderFulfillment = ({ endpoint, manage, onSuccess, order }) => {
449
144
  ...{
450
145
  className: "divide-y divide-gray"
451
146
  },
452
- children: items.map((item) => paid ? /* @__PURE__ */ jsx(
453
- PaidRow,
454
- {
455
- ...{
456
- cancel: () => cancel(item),
457
- disabled: !controls.cancel,
458
- item
459
- }
460
- },
461
- item.id
462
- ) : /* @__PURE__ */ jsxs(
147
+ children: items.map((item) => /* @__PURE__ */ jsxs(
463
148
  "div",
464
149
  {
465
150
  ...{
@@ -508,139 +193,8 @@ const OrderFulfillment = ({ endpoint, manage, onSuccess, order }) => {
508
193
  }
509
194
  );
510
195
  };
511
- const OrderSummarySection = ({ order }) => {
512
- var _a, _b;
513
- const money = moneyOf(order);
514
- const { shipping, subtotal, tax, total } = (order == null ? void 0 : order.amounts) || {};
515
- const rate = (_b = (_a = order == null ? void 0 : order.shipping) == null ? void 0 : _a.rate) == null ? void 0 : _b.name;
516
- return /* @__PURE__ */ jsx(
517
- CardSection,
518
- {
519
- ...{
520
- className: "shrink-0",
521
- title: "Summary"
522
- },
523
- children: /* @__PURE__ */ jsx(
524
- OrderSummary,
525
- {
526
- ...{
527
- rows: [
528
- ["Subtotal", money(subtotal)],
529
- [rate ? "Shipping (" + rate + ")" : "Shipping", money(shipping)],
530
- ["Tax", money(tax)],
531
- ["Total", money(total)]
532
- ]
533
- }
534
- }
535
- )
536
- }
537
- );
538
- };
539
- const OrderCustomer = ({ order }) => {
540
- var _a, _b, _c, _d;
541
- const name = [(_a = order == null ? void 0 : order.customer) == null ? void 0 : _a.firstName, (_b = order == null ? void 0 : order.customer) == null ? void 0 : _b.lastName].filter(Boolean).join(" ");
542
- return /* @__PURE__ */ jsx(
543
- CardSection,
544
- {
545
- ...{
546
- className: "shrink-0",
547
- title: "Customer"
548
- },
549
- children: /* @__PURE__ */ jsx(
550
- CardSetting,
551
- {
552
- ...{
553
- rows: [
554
- {
555
- label: "Name",
556
- value: name || "\u2014"
557
- },
558
- {
559
- label: "Email",
560
- value: ((_c = order == null ? void 0 : order.customer) == null ? void 0 : _c.email) || "\u2014"
561
- },
562
- ((_d = order == null ? void 0 : order.shipping) == null ? void 0 : _d.address) && {
563
- label: "Ships to",
564
- value: /* @__PURE__ */ jsx(AddressLines, { ...order.shipping.address })
565
- }
566
- ].filter(Boolean)
567
- }
568
- }
569
- )
570
- }
571
- );
572
- };
573
- const OrderPayment = ({ endpoint, onClose, order }) => {
574
- var _a, _b;
575
- const [open, setOpen] = useState(false);
576
- const status = statusBadge("payment", paymentOf(order));
577
- return /* @__PURE__ */ jsxs(
578
- CardSection,
579
- {
580
- ...{
581
- className: "shrink-0",
582
- title: "Payment"
583
- },
584
- children: [
585
- /* @__PURE__ */ jsx(
586
- CardSetting,
587
- {
588
- ...{
589
- rows: [
590
- {
591
- label: "Amount",
592
- value: moneyOf(order)((_a = order == null ? void 0 : order.amounts) == null ? void 0 : _a.total)
593
- },
594
- {
595
- label: "Status",
596
- value: (status == null ? void 0 : status.text) || "\u2014"
597
- }
598
- ]
599
- }
600
- }
601
- ),
602
- /* @__PURE__ */ jsx(
603
- "div",
604
- {
605
- ...{
606
- className: "pt-4"
607
- },
608
- children: /* @__PURE__ */ jsx(
609
- Button,
610
- {
611
- ...{
612
- ...small,
613
- onClick: () => setOpen(true)
614
- },
615
- children: "Refund"
616
- }
617
- )
618
- }
619
- ),
620
- open && /* @__PURE__ */ jsx(
621
- EmbedStripe,
622
- {
623
- ...{
624
- component: "payment_details",
625
- endpoint,
626
- onClose: () => {
627
- setOpen(false);
628
- onClose == null ? void 0 : onClose();
629
- },
630
- payment: (_b = order == null ? void 0 : order.provider) == null ? void 0 : _b.id
631
- }
632
- }
633
- )
634
- ]
635
- }
636
- );
637
- };
638
196
  export {
639
- FormFulfill,
640
- OrderCustomer,
641
197
  OrderFulfillment,
642
- OrderPayment,
643
- OrderSummarySection,
644
198
  fulfillmentControls,
645
199
  useConfirm
646
200
  };
@@ -43,12 +43,11 @@ var import_guard_navigation = __toESM(require("./guard-navigation"));
43
43
  var import_modal = __toESM(require("./modal"));
44
44
  var import_notice = __toESM(require("./notice"));
45
45
  var import_loader = require("../shared/loader");
46
- var import_helpers = require("../shared/lib/helpers");
47
46
  const ProviderUi = ({
48
47
  children,
49
48
  token
50
49
  }) => {
51
- var _a, _b, _c, _d, _e, _f, _g, _h;
50
+ var _a, _b, _c, _d, _e, _f;
52
51
  const queryClient = (0, import_react_query.useQueryClient)();
53
52
  queryClient.setQueryDefaults(["socket"], { structuralSharing: false });
54
53
  const tokenRef = (0, import_react.useRef)(token);
@@ -182,9 +181,8 @@ const ProviderUi = ({
182
181
  }
183
182
  ]
184
183
  });
185
- (0, import_helpers.setStripeKey)((_b = (_a = app == null ? void 0 : app.data) == null ? void 0 : _a.credentials) == null ? void 0 : _b.stripePublishableKey);
186
- const expired = ((_c = account == null ? void 0 : account.error) == null ? void 0 : _c.status) === 401 && typeof window !== "undefined" ? (0, import_navigation.expiredSessionHref)({
187
- csrf: (_d = document.cookie.match(/(?:^|;\s*)drawbridge\.csrf=([^;]+)/)) == null ? void 0 : _d[1],
184
+ const expired = ((_a = account == null ? void 0 : account.error) == null ? void 0 : _a.status) === 401 && typeof window !== "undefined" ? (0, import_navigation.expiredSessionHref)({
185
+ csrf: (_b = document.cookie.match(/(?:^|;\s*)drawbridge\.csrf=([^;]+)/)) == null ? void 0 : _b[1],
188
186
  pathname: window.location.pathname,
189
187
  search: window.location.search
190
188
  }) : null;
@@ -218,7 +216,7 @@ const ProviderUi = ({
218
216
  ...{
219
217
  button: false,
220
218
  href: false,
221
- message: (_e = app == null ? void 0 : app.error) == null ? void 0 : _e.message
219
+ message: (_c = app == null ? void 0 : app.error) == null ? void 0 : _c.message
222
220
  }
223
221
  }
224
222
  );
@@ -231,7 +229,7 @@ const ProviderUi = ({
231
229
  {
232
230
  ...{
233
231
  button: false,
234
- message: (_f = account == null ? void 0 : account.error) == null ? void 0 : _f.message
232
+ message: (_d = account == null ? void 0 : account.error) == null ? void 0 : _d.message
235
233
  }
236
234
  }
237
235
  );
@@ -243,7 +241,7 @@ const ProviderUi = ({
243
241
  ...{
244
242
  button: "Sign in",
245
243
  href: "/auth",
246
- message: (_g = account == null ? void 0 : account.error) == null ? void 0 : _g.message
244
+ message: (_e = account == null ? void 0 : account.error) == null ? void 0 : _e.message
247
245
  }
248
246
  }
249
247
  );
@@ -263,7 +261,7 @@ const ProviderUi = ({
263
261
  })
264
262
  )
265
263
  },
266
- children: (_h = drawer == null ? void 0 : drawer.data) == null ? void 0 : _h.children
264
+ children: (_f = drawer == null ? void 0 : drawer.data) == null ? void 0 : _f.children
267
265
  }
268
266
  ),
269
267
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
@@ -11,12 +11,11 @@ import GuardNavigation from "./guard-navigation.mjs";
11
11
  import Modal from "./modal.mjs";
12
12
  import Notice from "./notice.mjs";
13
13
  import { LogoLoader } from "../shared/loader.mjs";
14
- import { setStripeKey } from "../shared/lib/helpers.mjs";
15
14
  const ProviderUi = ({
16
15
  children,
17
16
  token
18
17
  }) => {
19
- var _a, _b, _c, _d, _e, _f, _g, _h;
18
+ var _a, _b, _c, _d, _e, _f;
20
19
  const queryClient = useQueryClient();
21
20
  queryClient.setQueryDefaults(["socket"], { structuralSharing: false });
22
21
  const tokenRef = useRef(token);
@@ -150,9 +149,8 @@ const ProviderUi = ({
150
149
  }
151
150
  ]
152
151
  });
153
- setStripeKey((_b = (_a = app == null ? void 0 : app.data) == null ? void 0 : _a.credentials) == null ? void 0 : _b.stripePublishableKey);
154
- const expired = ((_c = account == null ? void 0 : account.error) == null ? void 0 : _c.status) === 401 && typeof window !== "undefined" ? expiredSessionHref({
155
- csrf: (_d = document.cookie.match(/(?:^|;\s*)drawbridge\.csrf=([^;]+)/)) == null ? void 0 : _d[1],
152
+ const expired = ((_a = account == null ? void 0 : account.error) == null ? void 0 : _a.status) === 401 && typeof window !== "undefined" ? expiredSessionHref({
153
+ csrf: (_b = document.cookie.match(/(?:^|;\s*)drawbridge\.csrf=([^;]+)/)) == null ? void 0 : _b[1],
156
154
  pathname: window.location.pathname,
157
155
  search: window.location.search
158
156
  }) : null;
@@ -186,7 +184,7 @@ const ProviderUi = ({
186
184
  ...{
187
185
  button: false,
188
186
  href: false,
189
- message: (_e = app == null ? void 0 : app.error) == null ? void 0 : _e.message
187
+ message: (_c = app == null ? void 0 : app.error) == null ? void 0 : _c.message
190
188
  }
191
189
  }
192
190
  );
@@ -199,7 +197,7 @@ const ProviderUi = ({
199
197
  {
200
198
  ...{
201
199
  button: false,
202
- message: (_f = account == null ? void 0 : account.error) == null ? void 0 : _f.message
200
+ message: (_d = account == null ? void 0 : account.error) == null ? void 0 : _d.message
203
201
  }
204
202
  }
205
203
  );
@@ -211,7 +209,7 @@ const ProviderUi = ({
211
209
  ...{
212
210
  button: "Sign in",
213
211
  href: "/auth",
214
- message: (_g = account == null ? void 0 : account.error) == null ? void 0 : _g.message
212
+ message: (_e = account == null ? void 0 : account.error) == null ? void 0 : _e.message
215
213
  }
216
214
  }
217
215
  );
@@ -231,7 +229,7 @@ const ProviderUi = ({
231
229
  })
232
230
  )
233
231
  },
234
- children: (_h = drawer == null ? void 0 : drawer.data) == null ? void 0 : _h.children
232
+ children: (_f = drawer == null ? void 0 : drawer.data) == null ? void 0 : _f.children
235
233
  }
236
234
  ),
237
235
  /* @__PURE__ */ jsx(
@@ -175,12 +175,20 @@ const TemplateUIHeaderSettings = ({
175
175
  }
176
176
  ),
177
177
  error && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
178
- import_indicator.default,
178
+ "span",
179
179
  {
180
180
  ...{
181
- className: "absolute top-1.5 right-1.5 w-2 h-2",
182
- type: "warning"
183
- }
181
+ className: "absolute top-1.5 right-1.5 flex pointer-events-none"
182
+ },
183
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
184
+ import_indicator.default,
185
+ {
186
+ ...{
187
+ className: "w-2 h-2",
188
+ type: "warning"
189
+ }
190
+ }
191
+ )
184
192
  }
185
193
  )
186
194
  ]
@@ -143,12 +143,20 @@ const TemplateUIHeaderSettings = ({
143
143
  }
144
144
  ),
145
145
  error && /* @__PURE__ */ jsx(
146
- Indicator,
146
+ "span",
147
147
  {
148
148
  ...{
149
- className: "absolute top-1.5 right-1.5 w-2 h-2",
150
- type: "warning"
151
- }
149
+ className: "absolute top-1.5 right-1.5 flex pointer-events-none"
150
+ },
151
+ children: /* @__PURE__ */ jsx(
152
+ Indicator,
153
+ {
154
+ ...{
155
+ className: "w-2 h-2",
156
+ type: "warning"
157
+ }
158
+ }
159
+ )
152
160
  }
153
161
  )
154
162
  ]