@drawbridge/components 0.1.13 → 0.1.15
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/components/styles.css +364 -2
- package/dist/advertisement.js +3 -1
- package/dist/advertisement.mjs +3 -1
- package/dist/bridge/advertisements.js +2 -0
- package/dist/bridge/advertisements.mjs +2 -0
- package/dist/bridge/countdown.js +2 -1
- package/dist/bridge/countdown.mjs +2 -1
- package/dist/bridge/form-subdomain-embed.js +18 -20
- package/dist/bridge/form-subdomain-embed.mjs +18 -20
- package/dist/bridge/form-subdomain-header.js +24 -1
- package/dist/bridge/form-subdomain-header.mjs +24 -1
- package/dist/bridge/form-subdomain-missions.js +577 -0
- package/dist/bridge/form-subdomain-missions.mjs +540 -0
- package/dist/bridge/form-subdomain.js +530 -220
- package/dist/bridge/form-subdomain.mjs +533 -222
- package/dist/bridge/lib/entry.js +59 -0
- package/dist/bridge/lib/entry.mjs +29 -0
- package/dist/bridge/lib/location.js +38 -0
- package/dist/bridge/lib/location.mjs +13 -0
- package/dist/bridge/lib/order.js +71 -0
- package/dist/bridge/lib/order.mjs +44 -0
- package/dist/bridge/lib/url.js +9 -0
- package/dist/bridge/lib/url.mjs +7 -0
- package/dist/bridge/share-button.js +5 -3
- package/dist/bridge/share-button.mjs +5 -3
- package/dist/bridge/subdomain-content.js +7 -6
- package/dist/bridge/subdomain-content.mjs +7 -6
- package/dist/bridge/template-layout.js +59 -21
- package/dist/bridge/template-layout.mjs +59 -21
- package/dist/bridge/template-modal.js +42 -76
- package/dist/bridge/template-modal.mjs +39 -73
- package/dist/bridge/template-preview.js +208 -0
- package/dist/bridge/template-preview.mjs +173 -0
- package/dist/bridge/template-subdomain-gallery.js +6 -2
- package/dist/bridge/template-subdomain-gallery.mjs +6 -2
- package/dist/bridge/template-subdomain-link.js +6 -1
- package/dist/bridge/template-subdomain-link.mjs +6 -1
- package/dist/bridge/template-subdomain.js +20 -15
- package/dist/bridge/template-subdomain.mjs +20 -15
- package/dist/dashboard/accordion.js +74 -39
- package/dist/dashboard/accordion.mjs +74 -39
- package/dist/dashboard/avatar.js +109 -3
- package/dist/dashboard/avatar.mjs +106 -4
- package/dist/dashboard/buttons-subscription.js +384 -0
- package/dist/dashboard/buttons-subscription.mjs +349 -0
- package/dist/dashboard/card-campaign-switch.js +277 -0
- package/dist/dashboard/card-campaign-switch.mjs +243 -0
- package/dist/dashboard/card-order.js +231 -29
- package/dist/dashboard/card-order.mjs +231 -29
- package/dist/dashboard/card-section.js +26 -2
- package/dist/dashboard/card-section.mjs +26 -2
- package/dist/dashboard/card-tile.js +6 -7
- package/dist/dashboard/card-tile.mjs +6 -7
- package/dist/dashboard/connection-workflows.js +205 -0
- package/dist/dashboard/connection-workflows.mjs +171 -0
- package/dist/dashboard/device.js +95 -0
- package/dist/dashboard/device.mjs +72 -0
- package/dist/dashboard/form-admin-campaign.js +19 -50
- package/dist/dashboard/form-admin-campaign.mjs +20 -51
- package/dist/dashboard/form-ai.js +9 -6
- package/dist/dashboard/form-ai.mjs +9 -6
- package/dist/dashboard/form-auth.js +35 -25
- package/dist/dashboard/form-auth.mjs +36 -26
- package/dist/dashboard/form-file.js +10 -1
- package/dist/dashboard/form-file.mjs +10 -1
- package/dist/dashboard/form-filters-analytics.js +14 -1
- package/dist/dashboard/form-filters-analytics.mjs +15 -2
- package/dist/dashboard/form-organization-campaign-advertisement.js +15 -1
- package/dist/dashboard/form-organization-campaign-advertisement.mjs +16 -2
- package/dist/dashboard/form-organization-campaign-agreement.js +215 -164
- package/dist/dashboard/form-organization-campaign-agreement.mjs +215 -164
- package/dist/dashboard/form-organization-campaign-field-email.js +0 -34
- package/dist/dashboard/form-organization-campaign-field-email.mjs +0 -34
- package/dist/dashboard/form-organization-campaign-field-list.js +466 -0
- package/dist/dashboard/form-organization-campaign-field-list.mjs +437 -0
- package/dist/dashboard/form-organization-campaign-field-phone.js +0 -34
- package/dist/dashboard/form-organization-campaign-field-phone.mjs +0 -34
- package/dist/dashboard/form-organization-campaign-field-remove.js +66 -0
- package/dist/dashboard/form-organization-campaign-field-remove.mjs +33 -0
- package/dist/dashboard/form-organization-campaign-field-select.js +51 -5
- package/dist/dashboard/form-organization-campaign-field-select.mjs +51 -5
- package/dist/dashboard/form-organization-campaign-field-textarea.js +46 -8
- package/dist/dashboard/form-organization-campaign-field-textarea.mjs +46 -8
- package/dist/dashboard/form-organization-campaign-integration-age.js +6 -12
- package/dist/dashboard/form-organization-campaign-integration-age.mjs +6 -12
- package/dist/dashboard/form-organization-campaign-integration-enable.js +52 -24
- package/dist/dashboard/form-organization-campaign-integration-enable.mjs +54 -26
- package/dist/dashboard/form-organization-campaign-integration-geocode.js +6 -12
- package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +6 -12
- package/dist/dashboard/form-organization-campaign-integration-gtm.js +6 -12
- package/dist/dashboard/form-organization-campaign-integration-gtm.mjs +6 -12
- package/dist/dashboard/form-organization-campaign-link.js +7 -1
- package/dist/dashboard/form-organization-campaign-link.mjs +7 -1
- package/dist/dashboard/form-organization-campaign-mission.js +291 -0
- package/dist/dashboard/form-organization-campaign-mission.mjs +258 -0
- package/dist/dashboard/form-organization-campaign-page-embed.js +13 -2
- package/dist/dashboard/form-organization-campaign-page-embed.mjs +12 -1
- package/dist/dashboard/form-organization-campaign-page.js +20 -11
- package/dist/dashboard/form-organization-campaign-page.mjs +20 -11
- package/dist/dashboard/form-organization-campaign-prize-edit.js +12 -1
- package/dist/dashboard/form-organization-campaign-prize-edit.mjs +12 -1
- package/dist/dashboard/form-organization-campaign-section.js +243 -0
- package/dist/dashboard/form-organization-campaign-section.mjs +214 -0
- package/dist/dashboard/form-organization-campaign.js +114 -469
- package/dist/dashboard/form-organization-campaign.mjs +113 -467
- package/dist/dashboard/form-organization-export.js +4 -7
- package/dist/dashboard/form-organization-export.mjs +4 -7
- package/dist/dashboard/form-organization-identity.js +46 -51
- package/dist/dashboard/form-organization-identity.mjs +46 -51
- package/dist/dashboard/form-organization-workflow.js +708 -687
- package/dist/dashboard/form-organization-workflow.mjs +704 -683
- package/dist/dashboard/form-organization.js +82 -110
- package/dist/dashboard/form-organization.mjs +81 -109
- package/dist/dashboard/form-otc.js +4 -5
- package/dist/dashboard/form-otc.mjs +4 -5
- package/dist/dashboard/form-payment-methods.js +20 -9
- package/dist/dashboard/form-payment-methods.mjs +20 -9
- package/dist/dashboard/form-stripe.js +30 -0
- package/dist/dashboard/form-stripe.mjs +26 -0
- package/dist/dashboard/input-array.js +4 -2
- package/dist/dashboard/input-array.mjs +4 -2
- package/dist/dashboard/input-combobox.js +7 -3
- package/dist/dashboard/input-combobox.mjs +7 -3
- package/dist/dashboard/input-date.js +7 -0
- package/dist/dashboard/input-date.mjs +7 -0
- package/dist/dashboard/input-fields.js +80 -20
- package/dist/dashboard/input-fields.mjs +80 -20
- package/dist/dashboard/input-file.js +21 -1
- package/dist/dashboard/input-file.mjs +21 -1
- package/dist/dashboard/input-font.js +10 -1
- package/dist/dashboard/input-font.mjs +10 -1
- package/dist/dashboard/lib/item-list.js +57 -0
- package/dist/dashboard/lib/item-list.mjs +33 -0
- package/dist/dashboard/lib/menu.js +50 -0
- package/dist/dashboard/lib/menu.mjs +26 -0
- package/dist/dashboard/locked.js +82 -0
- package/dist/dashboard/locked.mjs +53 -0
- package/dist/dashboard/menu.js +72 -19
- package/dist/dashboard/menu.mjs +72 -19
- package/dist/dashboard/note-ai.js +69 -0
- package/dist/dashboard/note-ai.mjs +36 -0
- package/dist/dashboard/preview.js +419 -0
- package/dist/dashboard/preview.mjs +384 -0
- package/dist/dashboard/steps.js +39 -13
- package/dist/dashboard/steps.mjs +37 -12
- package/dist/dashboard/table-contacts.js +136 -0
- package/dist/dashboard/table-contacts.mjs +103 -0
- package/dist/dashboard/template-not-found.js +4 -2
- package/dist/dashboard/template-not-found.mjs +4 -2
- package/dist/dashboard/template-socket.js +20 -7
- package/dist/dashboard/template-socket.mjs +20 -7
- package/dist/icons/desktop.js +46 -0
- package/dist/icons/desktop.mjs +27 -0
- package/dist/icons/phone.js +46 -0
- package/dist/icons/phone.mjs +27 -0
- package/dist/icons/puzzle-piece.js +46 -0
- package/dist/icons/puzzle-piece.mjs +27 -0
- package/dist/icons/tablet.js +46 -0
- package/dist/icons/tablet.mjs +27 -0
- package/dist/icons/users.js +46 -0
- package/dist/icons/users.mjs +27 -0
- package/dist/input-checkbox.js +1 -0
- package/dist/input-checkbox.mjs +1 -0
- package/dist/input-code.js +83 -0
- package/dist/input-code.mjs +50 -0
- package/dist/input-text.js +2 -1
- package/dist/input-text.mjs +2 -1
- package/dist/shared/button.js +1 -1
- package/dist/shared/button.mjs +1 -1
- package/dist/shared/input-checkbox-list.js +0 -1
- package/dist/shared/input-checkbox-list.mjs +0 -1
- package/dist/shared/input-switch.js +6 -1
- package/dist/shared/input-switch.mjs +6 -1
- package/dist/shared/lib/campaign.js +123 -0
- package/dist/shared/lib/campaign.mjs +96 -0
- package/dist/shared/lib/helpers.js +14 -2
- package/dist/shared/lib/helpers.mjs +13 -2
- package/package.json +133 -13
- package/types/bridge/form-subdomain-header.d.ts +2 -0
- package/types/bridge/form-subdomain-missions.d.ts +38 -0
- package/types/bridge/form-subdomain.d.ts +23 -1
- package/types/bridge/lib/entry.d.ts +26 -0
- package/types/bridge/lib/location.d.ts +13 -0
- package/types/bridge/lib/order.d.ts +30 -0
- package/types/bridge/lib/url.d.ts +19 -0
- package/types/bridge/template-modal.d.ts +1 -1
- package/types/bridge/template-preview.d.ts +10 -0
- package/types/bridge/template-subdomain-link.d.ts +2 -0
- package/types/dashboard/accordion.d.ts +2 -0
- package/types/dashboard/avatar.d.ts +18 -2
- package/types/dashboard/buttons-subscription.d.ts +22 -0
- package/types/dashboard/card-campaign-switch.d.ts +32 -0
- package/types/dashboard/card-order.d.ts +25 -1
- package/types/dashboard/card-section.d.ts +2 -0
- package/types/dashboard/connection-workflows.d.ts +33 -0
- package/types/dashboard/device.d.ts +12 -0
- package/types/dashboard/form-admin-campaign.d.ts +3 -2
- package/types/dashboard/form-ai.d.ts +2 -2
- package/types/dashboard/form-organization-campaign-agreement.d.ts +18 -12
- package/types/dashboard/form-organization-campaign-field-email.d.ts +1 -2
- package/types/dashboard/form-organization-campaign-field-list.d.ts +36 -0
- package/types/dashboard/form-organization-campaign-field-phone.d.ts +1 -2
- package/types/dashboard/form-organization-campaign-field-remove.d.ts +22 -0
- package/types/dashboard/form-organization-campaign-field-select.d.ts +2 -1
- package/types/dashboard/form-organization-campaign-field-textarea.d.ts +2 -1
- package/types/dashboard/form-organization-campaign-integration-age.d.ts +3 -3
- package/types/dashboard/form-organization-campaign-integration-enable.d.ts +3 -3
- package/types/dashboard/form-organization-campaign-mission.d.ts +40 -0
- package/types/dashboard/form-organization-campaign-section.d.ts +29 -0
- package/types/dashboard/form-organization-campaign.d.ts +27 -17
- package/types/dashboard/form-organization-identity.d.ts +2 -0
- package/types/dashboard/form-organization-workflow.d.ts +56 -47
- package/types/dashboard/form-organization.d.ts +7 -2
- package/types/dashboard/form-stripe.d.ts +3 -0
- package/types/dashboard/input-combobox.d.ts +2 -0
- package/types/dashboard/input-date.d.ts +2 -0
- package/types/dashboard/input-fields.d.ts +3 -2
- package/types/dashboard/input-file.d.ts +4 -0
- package/types/dashboard/lib/item-list.d.ts +14 -0
- package/types/dashboard/lib/menu.d.ts +17 -0
- package/types/dashboard/locked.d.ts +10 -0
- package/types/dashboard/menu.d.ts +10 -2
- package/types/dashboard/note-ai.d.ts +15 -0
- package/types/dashboard/preview.d.ts +33 -0
- package/types/dashboard/steps.d.ts +19 -4
- package/types/dashboard/table-cell-title.d.ts +2 -2
- package/types/dashboard/table-contacts.d.ts +2 -0
- package/types/icons/desktop.d.ts +5 -0
- package/types/icons/phone.d.ts +5 -0
- package/types/icons/puzzle-piece.d.ts +5 -0
- package/types/icons/tablet.d.ts +5 -0
- package/types/icons/users.d.ts +5 -0
- package/types/input-code.d.ts +23 -0
- package/types/shared/input-switch.d.ts +2 -0
- package/types/shared/lib/campaign.d.ts +35 -0
- package/types/shared/lib/helpers.d.ts +3 -0
- package/dist/dashboard/card-integration.js +0 -187
- package/dist/dashboard/card-integration.mjs +0 -158
- package/dist/dashboard/iframe.js +0 -159
- package/dist/dashboard/iframe.mjs +0 -130
- package/types/dashboard/card-integration.d.ts +0 -24
- package/types/dashboard/iframe.d.ts +0 -18
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var tablet_exports = {};
|
|
19
|
+
__export(tablet_exports, {
|
|
20
|
+
default: () => tablet_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(tablet_exports);
|
|
23
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24
|
+
const Tablet = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
25
|
+
"svg",
|
|
26
|
+
{
|
|
27
|
+
...{
|
|
28
|
+
fill: "none",
|
|
29
|
+
stroke: "currentColor",
|
|
30
|
+
strokeWidth: 1.5,
|
|
31
|
+
viewBox: "0 0 24 24",
|
|
32
|
+
...props
|
|
33
|
+
},
|
|
34
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
35
|
+
"path",
|
|
36
|
+
{
|
|
37
|
+
...{
|
|
38
|
+
d: "M6.75 2.25h10.5A2.25 2.25 0 0 1 19.5 4.5v15a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5v-15a2.25 2.25 0 0 1 2.25-2.25ZM10.5 18.75h3",
|
|
39
|
+
strokeLinecap: "round",
|
|
40
|
+
strokeLinejoin: "round"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
var tablet_default = Tablet;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const Tablet = (props) => /* @__PURE__ */ jsx(
|
|
3
|
+
"svg",
|
|
4
|
+
{
|
|
5
|
+
...{
|
|
6
|
+
fill: "none",
|
|
7
|
+
stroke: "currentColor",
|
|
8
|
+
strokeWidth: 1.5,
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
...props
|
|
11
|
+
},
|
|
12
|
+
children: /* @__PURE__ */ jsx(
|
|
13
|
+
"path",
|
|
14
|
+
{
|
|
15
|
+
...{
|
|
16
|
+
d: "M6.75 2.25h10.5A2.25 2.25 0 0 1 19.5 4.5v15a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5v-15a2.25 2.25 0 0 1 2.25-2.25ZM10.5 18.75h3",
|
|
17
|
+
strokeLinecap: "round",
|
|
18
|
+
strokeLinejoin: "round"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
var tablet_default = Tablet;
|
|
25
|
+
export {
|
|
26
|
+
tablet_default as default
|
|
27
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var users_exports = {};
|
|
19
|
+
__export(users_exports, {
|
|
20
|
+
default: () => users_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(users_exports);
|
|
23
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
24
|
+
const Users = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
25
|
+
"svg",
|
|
26
|
+
{
|
|
27
|
+
...{
|
|
28
|
+
fill: "none",
|
|
29
|
+
stroke: "currentColor",
|
|
30
|
+
strokeWidth: 1.5,
|
|
31
|
+
viewBox: "0 0 24 24",
|
|
32
|
+
...props
|
|
33
|
+
},
|
|
34
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
35
|
+
"path",
|
|
36
|
+
{
|
|
37
|
+
...{
|
|
38
|
+
d: "M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z",
|
|
39
|
+
strokeLinecap: "round",
|
|
40
|
+
strokeLinejoin: "round"
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
var users_default = Users;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const Users = (props) => /* @__PURE__ */ jsx(
|
|
3
|
+
"svg",
|
|
4
|
+
{
|
|
5
|
+
...{
|
|
6
|
+
fill: "none",
|
|
7
|
+
stroke: "currentColor",
|
|
8
|
+
strokeWidth: 1.5,
|
|
9
|
+
viewBox: "0 0 24 24",
|
|
10
|
+
...props
|
|
11
|
+
},
|
|
12
|
+
children: /* @__PURE__ */ jsx(
|
|
13
|
+
"path",
|
|
14
|
+
{
|
|
15
|
+
...{
|
|
16
|
+
d: "M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z",
|
|
17
|
+
strokeLinecap: "round",
|
|
18
|
+
strokeLinejoin: "round"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
var users_default = Users;
|
|
25
|
+
export {
|
|
26
|
+
users_default as default
|
|
27
|
+
};
|
package/dist/input-checkbox.js
CHANGED
package/dist/input-checkbox.mjs
CHANGED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use client";
|
|
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
|
+
var input_code_exports = {};
|
|
30
|
+
__export(input_code_exports, {
|
|
31
|
+
codeDigits: () => codeDigits,
|
|
32
|
+
default: () => input_code_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(input_code_exports);
|
|
35
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
36
|
+
var import_input_text = __toESM(require("./input-text"));
|
|
37
|
+
const codeDigits = (value, length = 6) => String(value ?? "").replace(/\D/g, "").slice(0, length);
|
|
38
|
+
const InputCode = ({
|
|
39
|
+
autoFocus,
|
|
40
|
+
disabled,
|
|
41
|
+
id,
|
|
42
|
+
length = 6,
|
|
43
|
+
name,
|
|
44
|
+
onChange,
|
|
45
|
+
onComplete,
|
|
46
|
+
style,
|
|
47
|
+
value
|
|
48
|
+
}) => {
|
|
49
|
+
const digits = codeDigits(value, length);
|
|
50
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
51
|
+
import_input_text.default,
|
|
52
|
+
{
|
|
53
|
+
...{
|
|
54
|
+
// An `id` means a <label htmlFor> names it ( InputGroup's ); only a
|
|
55
|
+
// bare field names itself.
|
|
56
|
+
...!id && {
|
|
57
|
+
"aria-label": "Verification code"
|
|
58
|
+
},
|
|
59
|
+
autoComplete: "one-time-code",
|
|
60
|
+
autoFocus,
|
|
61
|
+
disabled,
|
|
62
|
+
id,
|
|
63
|
+
inputMode: "numeric",
|
|
64
|
+
maxLength: length,
|
|
65
|
+
name,
|
|
66
|
+
onChange: (text) => {
|
|
67
|
+
const next = codeDigits(text, length);
|
|
68
|
+
onChange == null ? void 0 : onChange(next);
|
|
69
|
+
if (next.length === length && next !== digits) onComplete == null ? void 0 : onComplete(next);
|
|
70
|
+
},
|
|
71
|
+
pattern: "[0-9]*",
|
|
72
|
+
style,
|
|
73
|
+
type: "text",
|
|
74
|
+
value: digits
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
var input_code_default = InputCode;
|
|
80
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
81
|
+
0 && (module.exports = {
|
|
82
|
+
codeDigits
|
|
83
|
+
});
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import InputText from "./input-text.mjs";
|
|
4
|
+
const codeDigits = (value, length = 6) => String(value ?? "").replace(/\D/g, "").slice(0, length);
|
|
5
|
+
const InputCode = ({
|
|
6
|
+
autoFocus,
|
|
7
|
+
disabled,
|
|
8
|
+
id,
|
|
9
|
+
length = 6,
|
|
10
|
+
name,
|
|
11
|
+
onChange,
|
|
12
|
+
onComplete,
|
|
13
|
+
style,
|
|
14
|
+
value
|
|
15
|
+
}) => {
|
|
16
|
+
const digits = codeDigits(value, length);
|
|
17
|
+
return /* @__PURE__ */ jsx(
|
|
18
|
+
InputText,
|
|
19
|
+
{
|
|
20
|
+
...{
|
|
21
|
+
// An `id` means a <label htmlFor> names it ( InputGroup's ); only a
|
|
22
|
+
// bare field names itself.
|
|
23
|
+
...!id && {
|
|
24
|
+
"aria-label": "Verification code"
|
|
25
|
+
},
|
|
26
|
+
autoComplete: "one-time-code",
|
|
27
|
+
autoFocus,
|
|
28
|
+
disabled,
|
|
29
|
+
id,
|
|
30
|
+
inputMode: "numeric",
|
|
31
|
+
maxLength: length,
|
|
32
|
+
name,
|
|
33
|
+
onChange: (text) => {
|
|
34
|
+
const next = codeDigits(text, length);
|
|
35
|
+
onChange == null ? void 0 : onChange(next);
|
|
36
|
+
if (next.length === length && next !== digits) onComplete == null ? void 0 : onComplete(next);
|
|
37
|
+
},
|
|
38
|
+
pattern: "[0-9]*",
|
|
39
|
+
style,
|
|
40
|
+
type: "text",
|
|
41
|
+
value: digits
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
};
|
|
46
|
+
var input_code_default = InputCode;
|
|
47
|
+
export {
|
|
48
|
+
codeDigits,
|
|
49
|
+
input_code_default as default
|
|
50
|
+
};
|
package/dist/input-text.js
CHANGED
|
@@ -31,6 +31,7 @@ const InputText = ({
|
|
|
31
31
|
...rest
|
|
32
32
|
}) => {
|
|
33
33
|
const classes = ["input"];
|
|
34
|
+
const { backgroundColor, ...unbranded } = (0, import_styles.inputStyle)(style);
|
|
34
35
|
if (className) {
|
|
35
36
|
classes.push(className);
|
|
36
37
|
}
|
|
@@ -42,7 +43,7 @@ const InputText = ({
|
|
|
42
43
|
...rest,
|
|
43
44
|
className: classes.join(" "),
|
|
44
45
|
onChange: ({ target }) => onChange(target.value),
|
|
45
|
-
style:
|
|
46
|
+
style: rest.readOnly && !style ? unbranded : { backgroundColor, ...unbranded },
|
|
46
47
|
value
|
|
47
48
|
}
|
|
48
49
|
}
|
package/dist/input-text.mjs
CHANGED
|
@@ -9,6 +9,7 @@ const InputText = ({
|
|
|
9
9
|
...rest
|
|
10
10
|
}) => {
|
|
11
11
|
const classes = ["input"];
|
|
12
|
+
const { backgroundColor, ...unbranded } = inputStyle(style);
|
|
12
13
|
if (className) {
|
|
13
14
|
classes.push(className);
|
|
14
15
|
}
|
|
@@ -20,7 +21,7 @@ const InputText = ({
|
|
|
20
21
|
...rest,
|
|
21
22
|
className: classes.join(" "),
|
|
22
23
|
onChange: ({ target }) => onChange(target.value),
|
|
23
|
-
style:
|
|
24
|
+
style: rest.readOnly && !style ? unbranded : { backgroundColor, ...unbranded },
|
|
24
25
|
value
|
|
25
26
|
}
|
|
26
27
|
}
|
package/dist/shared/button.js
CHANGED
|
@@ -68,7 +68,7 @@ const Button = (0, import_react.forwardRef)(({
|
|
|
68
68
|
if (size === "small") classes.push("small");
|
|
69
69
|
if (Icon && !labelled) classes.push("icon");
|
|
70
70
|
const text = typeof children === "string" || typeof children === "number";
|
|
71
|
-
if (inline) classes.push(variant !== "link" || style ? "w-fit" : text && !Icon ? "inline" : "inline-flex w-fit");
|
|
71
|
+
if (inline) classes.push(variant !== "link" || style ? "w-fit" : text && !Icon ? "inline w-fit" : "inline-flex w-fit");
|
|
72
72
|
if (justify === "start") classes.push("justify-start");
|
|
73
73
|
if (justify === "end") classes.push("justify-end");
|
|
74
74
|
if (justify === "between" && Icon && labelled) classes.push("justify-between");
|
package/dist/shared/button.mjs
CHANGED
|
@@ -36,7 +36,7 @@ const Button = forwardRef(({
|
|
|
36
36
|
if (size === "small") classes.push("small");
|
|
37
37
|
if (Icon && !labelled) classes.push("icon");
|
|
38
38
|
const text = typeof children === "string" || typeof children === "number";
|
|
39
|
-
if (inline) classes.push(variant !== "link" || style ? "w-fit" : text && !Icon ? "inline" : "inline-flex w-fit");
|
|
39
|
+
if (inline) classes.push(variant !== "link" || style ? "w-fit" : text && !Icon ? "inline w-fit" : "inline-flex w-fit");
|
|
40
40
|
if (justify === "start") classes.push("justify-start");
|
|
41
41
|
if (justify === "end") classes.push("justify-end");
|
|
42
42
|
if (justify === "between" && Icon && labelled) classes.push("justify-between");
|
|
@@ -35,6 +35,7 @@ var import_react = require("@headlessui/react");
|
|
|
35
35
|
var import_button = __toESM(require("./button"));
|
|
36
36
|
var import_styles = require("../styles");
|
|
37
37
|
const InputSwitch = ({
|
|
38
|
+
"aria-label": ariaLabel,
|
|
38
39
|
disabled,
|
|
39
40
|
helper,
|
|
40
41
|
onChange,
|
|
@@ -56,7 +57,9 @@ const InputSwitch = ({
|
|
|
56
57
|
],
|
|
57
58
|
track: [
|
|
58
59
|
"flex items-center shrink-0 rounded-full border transition ease-in-out duration-200",
|
|
59
|
-
|
|
60
|
+
// Off keeps a black outline, as inputs have, so it reads on gray too
|
|
61
|
+
// (Darren, Dulce Local walk, 2026-10-29).
|
|
62
|
+
value ? "bg-black border-black" : "border-black",
|
|
60
63
|
small ? "h-7 w-11" : "h-10 w-16"
|
|
61
64
|
]
|
|
62
65
|
};
|
|
@@ -68,6 +71,8 @@ const InputSwitch = ({
|
|
|
68
71
|
import_react.Switch,
|
|
69
72
|
{
|
|
70
73
|
...{
|
|
74
|
+
// A switch with no text beside it ( a page header's ) names itself.
|
|
75
|
+
...ariaLabel && { "aria-label": ariaLabel },
|
|
71
76
|
as: import_button.default,
|
|
72
77
|
checked: value,
|
|
73
78
|
disabled,
|
|
@@ -3,6 +3,7 @@ import { Switch } from "@headlessui/react";
|
|
|
3
3
|
import Button from "./button.mjs";
|
|
4
4
|
import { buttonStyle, inputStyle, textStyle } from "../styles.mjs";
|
|
5
5
|
const InputSwitch = ({
|
|
6
|
+
"aria-label": ariaLabel,
|
|
6
7
|
disabled,
|
|
7
8
|
helper,
|
|
8
9
|
onChange,
|
|
@@ -24,7 +25,9 @@ const InputSwitch = ({
|
|
|
24
25
|
],
|
|
25
26
|
track: [
|
|
26
27
|
"flex items-center shrink-0 rounded-full border transition ease-in-out duration-200",
|
|
27
|
-
|
|
28
|
+
// Off keeps a black outline, as inputs have, so it reads on gray too
|
|
29
|
+
// (Darren, Dulce Local walk, 2026-10-29).
|
|
30
|
+
value ? "bg-black border-black" : "border-black",
|
|
28
31
|
small ? "h-7 w-11" : "h-10 w-16"
|
|
29
32
|
]
|
|
30
33
|
};
|
|
@@ -36,6 +39,8 @@ const InputSwitch = ({
|
|
|
36
39
|
Switch,
|
|
37
40
|
{
|
|
38
41
|
...{
|
|
42
|
+
// A switch with no text beside it ( a page header's ) names itself.
|
|
43
|
+
...ariaLabel && { "aria-label": ariaLabel },
|
|
39
44
|
as: Button,
|
|
40
45
|
checked: value,
|
|
41
46
|
disabled,
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var campaign_exports = {};
|
|
19
|
+
__export(campaign_exports, {
|
|
20
|
+
awardingCard: () => awardingCard,
|
|
21
|
+
campaignSwitch: () => campaignSwitch,
|
|
22
|
+
campaignSwitches: () => campaignSwitches,
|
|
23
|
+
leadCapture: () => leadCapture,
|
|
24
|
+
switchLock: () => switchLock
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(campaign_exports);
|
|
27
|
+
const campaignSwitches = (current, key, on) => {
|
|
28
|
+
const next = {
|
|
29
|
+
form: Boolean(current == null ? void 0 : current.form),
|
|
30
|
+
giveaway: Boolean(current == null ? void 0 : current.giveaway),
|
|
31
|
+
[key]: Boolean(on)
|
|
32
|
+
};
|
|
33
|
+
if (key === "giveaway" && next.giveaway) next.form = true;
|
|
34
|
+
if (key === "form" && !next.form) next.giveaway = false;
|
|
35
|
+
return next;
|
|
36
|
+
};
|
|
37
|
+
const campaignSwitch = (campaign, key, on) => {
|
|
38
|
+
var _a, _b;
|
|
39
|
+
const form = Boolean((_a = campaign == null ? void 0 : campaign.form) == null ? void 0 : _a.enabled);
|
|
40
|
+
const giveaway = Boolean((_b = campaign == null ? void 0 : campaign.giveaway) == null ? void 0 : _b.enabled);
|
|
41
|
+
const copy = {
|
|
42
|
+
form: on ? [
|
|
43
|
+
"Turn on the form?",
|
|
44
|
+
"Your pages show the entry form again and new leads are collected."
|
|
45
|
+
] : [
|
|
46
|
+
"Turn off the form?",
|
|
47
|
+
"Your pages stop showing the entry form. Leads, fields and settings are kept." + (giveaway ? " The giveaway turns off too, because entries come from the form." : "")
|
|
48
|
+
],
|
|
49
|
+
giveaway: on ? [
|
|
50
|
+
"Turn on the giveaway?",
|
|
51
|
+
// @story campaigns/giveaway-module
|
|
52
|
+
// The giveaway wins over an order form ( the api's `ordering` ), and
|
|
53
|
+
// says so (Darren, 2026-11-03).
|
|
54
|
+
"Entries are awarded while a range in your schedule is running." + (form ? "" : " The form turns on too, because entries come from the form.") + ((campaign == null ? void 0 : campaign.ordering) ? " Giveaways can't run with an order form, so the form stops taking orders. Your order and its fields are kept." : "")
|
|
55
|
+
] : [
|
|
56
|
+
"Turn off the giveaway?",
|
|
57
|
+
"Entries stop being awarded. Prizes, schedule, missions and draws are kept, and come back when you turn it on."
|
|
58
|
+
]
|
|
59
|
+
}[key];
|
|
60
|
+
return {
|
|
61
|
+
body: {
|
|
62
|
+
[key]: {
|
|
63
|
+
enabled: Boolean(on)
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
message: copy[1],
|
|
67
|
+
title: copy[0]
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
const switchLock = (campaign, key, disabled) => disabled ? "You need Manage on Campaigns to change this" : null;
|
|
71
|
+
const leadCapture = (campaign) => {
|
|
72
|
+
var _a, _b;
|
|
73
|
+
if (!((_a = campaign == null ? void 0 : campaign.form) == null ? void 0 : _a.enabled)) return "Off";
|
|
74
|
+
return ((_b = campaign == null ? void 0 : campaign.giveaway) == null ? void 0 : _b.enabled) ? "Form and Giveaway" : "Form";
|
|
75
|
+
};
|
|
76
|
+
const reasons = {
|
|
77
|
+
"No range is running": {
|
|
78
|
+
giveaway: ["No range is running", "Add a range to your schedule to start awarding entries"],
|
|
79
|
+
overview: "No range is running, so no entries are awarded"
|
|
80
|
+
},
|
|
81
|
+
"No prizes are published": {
|
|
82
|
+
giveaway: ["No prizes are published", "Publish a prize to start awarding entries"],
|
|
83
|
+
overview: "No prizes are published"
|
|
84
|
+
},
|
|
85
|
+
"No mission is on": {
|
|
86
|
+
giveaway: ["No mission is on", "Turn on a mission to start awarding entries"],
|
|
87
|
+
overview: "No mission is on"
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const awardingCard = (campaign, page = "overview") => {
|
|
91
|
+
var _a, _b;
|
|
92
|
+
if (!((_a = campaign == null ? void 0 : campaign.giveaway) == null ? void 0 : _a.enabled)) return null;
|
|
93
|
+
const running = (((_b = campaign == null ? void 0 : campaign.range) == null ? void 0 : _b.title) || "Current range") + " is running";
|
|
94
|
+
if (campaign == null ? void 0 : campaign.awarding) {
|
|
95
|
+
return page === "giveaway" ? {
|
|
96
|
+
message: running,
|
|
97
|
+
title: "Schedule",
|
|
98
|
+
type: "success"
|
|
99
|
+
} : {
|
|
100
|
+
message: running,
|
|
101
|
+
title: "Awarding entries now",
|
|
102
|
+
type: "success"
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
const first = ((campaign == null ? void 0 : campaign.awardingErrors) || []).map((error) => reasons[error == null ? void 0 : error.message]).find(Boolean) || reasons["No range is running"];
|
|
106
|
+
return page === "giveaway" ? {
|
|
107
|
+
message: first.giveaway[1],
|
|
108
|
+
title: first.giveaway[0],
|
|
109
|
+
type: "warning"
|
|
110
|
+
} : {
|
|
111
|
+
message: first.overview,
|
|
112
|
+
title: "Not awarding entries",
|
|
113
|
+
type: "warning"
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
117
|
+
0 && (module.exports = {
|
|
118
|
+
awardingCard,
|
|
119
|
+
campaignSwitch,
|
|
120
|
+
campaignSwitches,
|
|
121
|
+
leadCapture,
|
|
122
|
+
switchLock
|
|
123
|
+
});
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
const campaignSwitches = (current, key, on) => {
|
|
2
|
+
const next = {
|
|
3
|
+
form: Boolean(current == null ? void 0 : current.form),
|
|
4
|
+
giveaway: Boolean(current == null ? void 0 : current.giveaway),
|
|
5
|
+
[key]: Boolean(on)
|
|
6
|
+
};
|
|
7
|
+
if (key === "giveaway" && next.giveaway) next.form = true;
|
|
8
|
+
if (key === "form" && !next.form) next.giveaway = false;
|
|
9
|
+
return next;
|
|
10
|
+
};
|
|
11
|
+
const campaignSwitch = (campaign, key, on) => {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
const form = Boolean((_a = campaign == null ? void 0 : campaign.form) == null ? void 0 : _a.enabled);
|
|
14
|
+
const giveaway = Boolean((_b = campaign == null ? void 0 : campaign.giveaway) == null ? void 0 : _b.enabled);
|
|
15
|
+
const copy = {
|
|
16
|
+
form: on ? [
|
|
17
|
+
"Turn on the form?",
|
|
18
|
+
"Your pages show the entry form again and new leads are collected."
|
|
19
|
+
] : [
|
|
20
|
+
"Turn off the form?",
|
|
21
|
+
"Your pages stop showing the entry form. Leads, fields and settings are kept." + (giveaway ? " The giveaway turns off too, because entries come from the form." : "")
|
|
22
|
+
],
|
|
23
|
+
giveaway: on ? [
|
|
24
|
+
"Turn on the giveaway?",
|
|
25
|
+
// @story campaigns/giveaway-module
|
|
26
|
+
// The giveaway wins over an order form ( the api's `ordering` ), and
|
|
27
|
+
// says so (Darren, 2026-11-03).
|
|
28
|
+
"Entries are awarded while a range in your schedule is running." + (form ? "" : " The form turns on too, because entries come from the form.") + ((campaign == null ? void 0 : campaign.ordering) ? " Giveaways can't run with an order form, so the form stops taking orders. Your order and its fields are kept." : "")
|
|
29
|
+
] : [
|
|
30
|
+
"Turn off the giveaway?",
|
|
31
|
+
"Entries stop being awarded. Prizes, schedule, missions and draws are kept, and come back when you turn it on."
|
|
32
|
+
]
|
|
33
|
+
}[key];
|
|
34
|
+
return {
|
|
35
|
+
body: {
|
|
36
|
+
[key]: {
|
|
37
|
+
enabled: Boolean(on)
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
message: copy[1],
|
|
41
|
+
title: copy[0]
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
const switchLock = (campaign, key, disabled) => disabled ? "You need Manage on Campaigns to change this" : null;
|
|
45
|
+
const leadCapture = (campaign) => {
|
|
46
|
+
var _a, _b;
|
|
47
|
+
if (!((_a = campaign == null ? void 0 : campaign.form) == null ? void 0 : _a.enabled)) return "Off";
|
|
48
|
+
return ((_b = campaign == null ? void 0 : campaign.giveaway) == null ? void 0 : _b.enabled) ? "Form and Giveaway" : "Form";
|
|
49
|
+
};
|
|
50
|
+
const reasons = {
|
|
51
|
+
"No range is running": {
|
|
52
|
+
giveaway: ["No range is running", "Add a range to your schedule to start awarding entries"],
|
|
53
|
+
overview: "No range is running, so no entries are awarded"
|
|
54
|
+
},
|
|
55
|
+
"No prizes are published": {
|
|
56
|
+
giveaway: ["No prizes are published", "Publish a prize to start awarding entries"],
|
|
57
|
+
overview: "No prizes are published"
|
|
58
|
+
},
|
|
59
|
+
"No mission is on": {
|
|
60
|
+
giveaway: ["No mission is on", "Turn on a mission to start awarding entries"],
|
|
61
|
+
overview: "No mission is on"
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const awardingCard = (campaign, page = "overview") => {
|
|
65
|
+
var _a, _b;
|
|
66
|
+
if (!((_a = campaign == null ? void 0 : campaign.giveaway) == null ? void 0 : _a.enabled)) return null;
|
|
67
|
+
const running = (((_b = campaign == null ? void 0 : campaign.range) == null ? void 0 : _b.title) || "Current range") + " is running";
|
|
68
|
+
if (campaign == null ? void 0 : campaign.awarding) {
|
|
69
|
+
return page === "giveaway" ? {
|
|
70
|
+
message: running,
|
|
71
|
+
title: "Schedule",
|
|
72
|
+
type: "success"
|
|
73
|
+
} : {
|
|
74
|
+
message: running,
|
|
75
|
+
title: "Awarding entries now",
|
|
76
|
+
type: "success"
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
const first = ((campaign == null ? void 0 : campaign.awardingErrors) || []).map((error) => reasons[error == null ? void 0 : error.message]).find(Boolean) || reasons["No range is running"];
|
|
80
|
+
return page === "giveaway" ? {
|
|
81
|
+
message: first.giveaway[1],
|
|
82
|
+
title: first.giveaway[0],
|
|
83
|
+
type: "warning"
|
|
84
|
+
} : {
|
|
85
|
+
message: first.overview,
|
|
86
|
+
title: "Not awarding entries",
|
|
87
|
+
type: "warning"
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
export {
|
|
91
|
+
awardingCard,
|
|
92
|
+
campaignSwitch,
|
|
93
|
+
campaignSwitches,
|
|
94
|
+
leadCapture,
|
|
95
|
+
switchLock
|
|
96
|
+
};
|