@drawbridge/components 0.1.34 → 0.1.36

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 (328) hide show
  1. package/components/styles.css +68 -355
  2. package/dist/advertisement.js +15 -20
  3. package/dist/advertisement.mjs +15 -20
  4. package/dist/bridge/advertisements.js +4 -2
  5. package/dist/bridge/advertisements.mjs +5 -3
  6. package/dist/bridge/fields.js +89 -6
  7. package/dist/bridge/fields.mjs +89 -7
  8. package/dist/bridge/form-subdomain-agreement.js +165 -0
  9. package/dist/bridge/form-subdomain-agreement.mjs +132 -0
  10. package/dist/bridge/form-subdomain-embed.js +5 -1
  11. package/dist/bridge/form-subdomain-embed.mjs +5 -1
  12. package/dist/bridge/form-subdomain-header.js +21 -14
  13. package/dist/bridge/form-subdomain-header.mjs +20 -14
  14. package/dist/bridge/form-subdomain-issue.js +17 -8
  15. package/dist/bridge/form-subdomain-issue.mjs +17 -8
  16. package/dist/bridge/form-subdomain-missions.js +58 -52
  17. package/dist/bridge/form-subdomain-missions.mjs +60 -54
  18. package/dist/bridge/form-subdomain.js +223 -94
  19. package/dist/bridge/form-subdomain.mjs +222 -96
  20. package/dist/bridge/lib/entry.js +61 -6
  21. package/dist/bridge/lib/entry.mjs +51 -5
  22. package/dist/bridge/lib/order.js +23 -0
  23. package/dist/bridge/lib/order.mjs +20 -0
  24. package/dist/bridge/template-layout.js +5 -2
  25. package/dist/bridge/template-layout.mjs +6 -3
  26. package/dist/bridge/template-modal.js +82 -15
  27. package/dist/bridge/template-modal.mjs +83 -16
  28. package/dist/bridge/template-subdomain-gallery.js +126 -75
  29. package/dist/bridge/template-subdomain-gallery.mjs +122 -75
  30. package/dist/bridge/template-subdomain.js +16 -14
  31. package/dist/bridge/template-subdomain.mjs +17 -15
  32. package/dist/dashboard/avatar.js +5 -0
  33. package/dist/dashboard/avatar.mjs +5 -0
  34. package/dist/dashboard/campaign-form.js +1798 -0
  35. package/dist/dashboard/campaign-form.mjs +1769 -0
  36. package/dist/dashboard/card-affiliate.js +3 -2
  37. package/dist/dashboard/card-affiliate.mjs +3 -2
  38. package/dist/dashboard/card-campaign-agreement.js +172 -0
  39. package/dist/dashboard/card-campaign-agreement.mjs +139 -0
  40. package/dist/dashboard/card-campaign-switch.js +34 -9
  41. package/dist/dashboard/card-campaign-switch.mjs +32 -8
  42. package/dist/dashboard/card-order.js +6 -14
  43. package/dist/dashboard/card-order.mjs +6 -14
  44. package/dist/dashboard/card-section.js +69 -26
  45. package/dist/dashboard/card-section.mjs +65 -26
  46. package/dist/dashboard/card-shortcut.js +181 -0
  47. package/dist/dashboard/card-shortcut.mjs +152 -0
  48. package/dist/dashboard/card-tile.js +3 -35
  49. package/dist/dashboard/card-tile.mjs +3 -34
  50. package/dist/dashboard/document-blocks.js +305 -0
  51. package/dist/dashboard/document-blocks.mjs +270 -0
  52. package/dist/dashboard/drawer-subscription.js +52 -14
  53. package/dist/dashboard/drawer-subscription.mjs +52 -14
  54. package/dist/dashboard/drawer.js +20 -3
  55. package/dist/dashboard/drawer.mjs +21 -4
  56. package/dist/dashboard/dropdown.js +6 -2
  57. package/dist/dashboard/dropdown.mjs +6 -2
  58. package/dist/dashboard/form-admin-subscription-custom.js +72 -8
  59. package/dist/dashboard/form-admin-subscription-custom.mjs +72 -8
  60. package/dist/dashboard/form-ai.js +0 -148
  61. package/dist/dashboard/form-ai.mjs +1 -148
  62. package/dist/dashboard/form-filters-analytics.js +88 -37
  63. package/dist/dashboard/form-filters-analytics.mjs +85 -38
  64. package/dist/dashboard/form-organization-brand.js +30 -13
  65. package/dist/dashboard/form-organization-brand.mjs +30 -13
  66. package/dist/dashboard/form-organization-campaign-advertisement.js +38 -112
  67. package/dist/dashboard/form-organization-campaign-advertisement.mjs +38 -112
  68. package/dist/dashboard/form-organization-campaign-advertisements.js +374 -0
  69. package/dist/dashboard/form-organization-campaign-advertisements.mjs +345 -0
  70. package/dist/dashboard/form-organization-campaign-agreement.js +402 -210
  71. package/dist/dashboard/form-organization-campaign-agreement.mjs +398 -211
  72. package/dist/dashboard/form-organization-campaign-design.js +258 -0
  73. package/dist/dashboard/form-organization-campaign-design.mjs +223 -0
  74. package/dist/dashboard/form-organization-campaign-field-item.js +585 -0
  75. package/dist/dashboard/form-organization-campaign-field-item.mjs +552 -0
  76. package/dist/dashboard/form-organization-campaign-field-number.js +48 -7
  77. package/dist/dashboard/form-organization-campaign-field-number.mjs +48 -7
  78. package/dist/dashboard/form-organization-campaign-field-select.js +15 -4
  79. package/dist/dashboard/form-organization-campaign-field-select.mjs +15 -4
  80. package/dist/dashboard/form-organization-campaign-field-skill.js +359 -0
  81. package/dist/dashboard/form-organization-campaign-field-skill.mjs +330 -0
  82. package/dist/dashboard/form-organization-campaign-field-text.js +46 -6
  83. package/dist/dashboard/form-organization-campaign-field-text.mjs +46 -6
  84. package/dist/dashboard/form-organization-campaign-field-textarea.js +22 -13
  85. package/dist/dashboard/form-organization-campaign-field-textarea.mjs +22 -13
  86. package/dist/dashboard/form-organization-campaign-footer.js +178 -0
  87. package/dist/dashboard/form-organization-campaign-footer.mjs +149 -0
  88. package/dist/dashboard/form-organization-campaign-integration-age.js +2 -35
  89. package/dist/dashboard/form-organization-campaign-integration-age.mjs +2 -35
  90. package/dist/dashboard/form-organization-campaign-integration-geocode.js +4 -1
  91. package/dist/dashboard/form-organization-campaign-integration-geocode.mjs +4 -1
  92. package/dist/dashboard/form-organization-campaign-page-embed.js +1 -1
  93. package/dist/dashboard/form-organization-campaign-page-embed.mjs +1 -1
  94. package/dist/dashboard/form-organization-campaign-page-preview.js +1 -2
  95. package/dist/dashboard/form-organization-campaign-page-preview.mjs +1 -2
  96. package/dist/dashboard/form-organization-campaign-page-qr.js +2 -2
  97. package/dist/dashboard/form-organization-campaign-page-qr.mjs +2 -2
  98. package/dist/dashboard/form-organization-campaign-page-share.js +5 -5
  99. package/dist/dashboard/form-organization-campaign-page-share.mjs +5 -5
  100. package/dist/dashboard/form-organization-campaign-page-slug.js +2 -3
  101. package/dist/dashboard/form-organization-campaign-page-slug.mjs +2 -3
  102. package/dist/dashboard/form-organization-campaign-page.js +168 -265
  103. package/dist/dashboard/form-organization-campaign-page.mjs +170 -266
  104. package/dist/dashboard/form-organization-campaign-section.js +125 -107
  105. package/dist/dashboard/form-organization-campaign-section.mjs +121 -107
  106. package/dist/dashboard/form-organization-campaign.js +119 -9
  107. package/dist/dashboard/form-organization-campaign.mjs +118 -9
  108. package/dist/dashboard/form-organization-file-frame.js +7 -1
  109. package/dist/dashboard/form-organization-file-frame.mjs +7 -1
  110. package/dist/dashboard/form-organization-workflow.js +587 -530
  111. package/dist/dashboard/form-organization-workflow.mjs +588 -531
  112. package/dist/dashboard/form-organization.js +22 -0
  113. package/dist/dashboard/form-organization.mjs +22 -0
  114. package/dist/dashboard/form-reposition.js +396 -0
  115. package/dist/dashboard/form-reposition.mjs +359 -0
  116. package/dist/dashboard/form-support.js +189 -0
  117. package/dist/dashboard/form-support.mjs +160 -0
  118. package/dist/dashboard/form-tests.js +683 -0
  119. package/dist/dashboard/form-tests.mjs +646 -0
  120. package/dist/dashboard/form-verify-prize.js +114 -34
  121. package/dist/dashboard/form-verify-prize.mjs +111 -34
  122. package/dist/dashboard/google.js +8 -1
  123. package/dist/dashboard/google.mjs +8 -1
  124. package/dist/dashboard/input-array.js +2 -0
  125. package/dist/dashboard/input-array.mjs +2 -0
  126. package/dist/dashboard/input-editor.js +17 -6
  127. package/dist/dashboard/input-editor.mjs +17 -6
  128. package/dist/dashboard/input-fields.js +287 -437
  129. package/dist/dashboard/input-fields.mjs +287 -436
  130. package/dist/dashboard/input-file.js +70 -2
  131. package/dist/dashboard/input-file.mjs +70 -2
  132. package/dist/dashboard/input-font.js +64 -55
  133. package/dist/dashboard/input-font.mjs +64 -55
  134. package/dist/dashboard/input-resource.js +4 -1
  135. package/dist/dashboard/input-resource.mjs +4 -1
  136. package/dist/dashboard/lib/ab-tests.js +130 -0
  137. package/dist/dashboard/lib/ab-tests.mjs +94 -0
  138. package/dist/dashboard/lib/features.js +1 -1
  139. package/dist/dashboard/lib/features.mjs +1 -1
  140. package/dist/dashboard/lib/focus.js +93 -0
  141. package/dist/dashboard/lib/focus.mjs +69 -0
  142. package/dist/dashboard/lib/form-page.js +203 -0
  143. package/dist/dashboard/lib/form-page.mjs +155 -0
  144. package/dist/dashboard/lib/item-list.js +0 -15
  145. package/dist/dashboard/lib/item-list.mjs +0 -14
  146. package/dist/dashboard/lib/rail.js +16 -17
  147. package/dist/dashboard/lib/rail.mjs +15 -16
  148. package/dist/dashboard/lib/sms.js +8 -2
  149. package/dist/dashboard/lib/sms.mjs +6 -1
  150. package/dist/dashboard/list-resource.js +2 -0
  151. package/dist/dashboard/list-resource.mjs +2 -0
  152. package/dist/dashboard/menu.js +54 -5
  153. package/dist/dashboard/menu.mjs +53 -5
  154. package/dist/dashboard/modal.js +19 -4
  155. package/dist/dashboard/modal.mjs +20 -5
  156. package/dist/dashboard/order-sections.js +4 -0
  157. package/dist/dashboard/order-sections.mjs +4 -0
  158. package/dist/dashboard/preview.js +838 -324
  159. package/dist/dashboard/preview.mjs +826 -324
  160. package/dist/dashboard/provider-ui.js +20 -12
  161. package/dist/dashboard/provider-ui.mjs +21 -13
  162. package/dist/dashboard/recharts.js +53 -28
  163. package/dist/dashboard/recharts.mjs +53 -28
  164. package/dist/dashboard/swatch.js +35 -0
  165. package/dist/dashboard/swatch.mjs +31 -0
  166. package/dist/dashboard/table-contacts.js +6 -10
  167. package/dist/dashboard/table-contacts.mjs +6 -10
  168. package/dist/dashboard/table.js +10 -3
  169. package/dist/dashboard/table.mjs +9 -3
  170. package/dist/dashboard/template-dashboard.js +12 -7
  171. package/dist/dashboard/template-dashboard.mjs +11 -7
  172. package/dist/dashboard/template-design.js +564 -0
  173. package/dist/dashboard/template-design.mjs +531 -0
  174. package/dist/dashboard/template-rail.js +198 -126
  175. package/dist/dashboard/template-rail.mjs +196 -125
  176. package/dist/dashboard/template-socket.js +0 -3
  177. package/dist/dashboard/template-socket.mjs +0 -3
  178. package/dist/dashboard/template-test-page.js +436 -0
  179. package/dist/dashboard/template-test-page.mjs +407 -0
  180. package/dist/dashboard/template-tests.js +141 -0
  181. package/dist/dashboard/template-tests.mjs +112 -0
  182. package/dist/dashboard/template-ui.js +20 -11
  183. package/dist/dashboard/template-ui.mjs +22 -13
  184. package/dist/dashboard/template-variant.js +185 -0
  185. package/dist/dashboard/template-variant.mjs +156 -0
  186. package/dist/icons/arrow-down-long.js +47 -0
  187. package/dist/icons/arrow-down-long.mjs +28 -0
  188. package/dist/icons/arrows-pointing-out.js +46 -0
  189. package/dist/icons/arrows-pointing-out.mjs +27 -0
  190. package/dist/icons/beaker.js +46 -0
  191. package/dist/icons/beaker.mjs +27 -0
  192. package/dist/icons/identification.js +46 -0
  193. package/dist/icons/identification.mjs +27 -0
  194. package/dist/icons/lifebuoy.js +46 -0
  195. package/dist/icons/lifebuoy.mjs +27 -0
  196. package/dist/icons/rectangle-group.js +46 -0
  197. package/dist/icons/rectangle-group.mjs +27 -0
  198. package/dist/icons/rectangle-stack.js +46 -0
  199. package/dist/icons/rectangle-stack.mjs +27 -0
  200. package/dist/icons/shopping-bag.js +46 -0
  201. package/dist/icons/shopping-bag.mjs +27 -0
  202. package/dist/icons/swatch.js +46 -0
  203. package/dist/icons/swatch.mjs +27 -0
  204. package/dist/icons/window.js +46 -0
  205. package/dist/icons/window.mjs +27 -0
  206. package/dist/icons/zoom-in.js +46 -0
  207. package/dist/icons/zoom-in.mjs +27 -0
  208. package/dist/input-answer.js +60 -0
  209. package/dist/input-answer.mjs +27 -0
  210. package/dist/input-checkbox.js +7 -1
  211. package/dist/input-checkbox.mjs +7 -1
  212. package/dist/input-name.js +3 -3
  213. package/dist/input-name.mjs +3 -3
  214. package/dist/input-select.js +3 -1
  215. package/dist/input-select.mjs +3 -1
  216. package/dist/provider-font.js +4 -3
  217. package/dist/provider-font.mjs +4 -3
  218. package/dist/shared/badge.js +15 -0
  219. package/dist/shared/badge.mjs +11 -0
  220. package/dist/shared/carousel.js +11 -7
  221. package/dist/shared/carousel.mjs +11 -7
  222. package/dist/shared/document-pieces.js +295 -0
  223. package/dist/shared/document-pieces.mjs +260 -0
  224. package/dist/shared/lib/campaign.js +3 -9
  225. package/dist/shared/lib/campaign.mjs +3 -9
  226. package/dist/shared/lib/helpers.js +24 -0
  227. package/dist/shared/lib/helpers.mjs +22 -0
  228. package/dist/shared/lib/video.js +6 -0
  229. package/dist/shared/lib/video.mjs +5 -0
  230. package/dist/shared/sortable.js +27 -10
  231. package/dist/shared/sortable.mjs +27 -10
  232. package/dist/shared/tabs.js +1 -1
  233. package/dist/shared/tabs.mjs +1 -1
  234. package/dist/video.js +127 -9
  235. package/dist/video.mjs +125 -11
  236. package/package.json +176 -20
  237. package/types/bridge/fields.d.ts +6 -1
  238. package/types/bridge/form-subdomain-agreement.d.ts +27 -0
  239. package/types/bridge/form-subdomain-missions.d.ts +2 -0
  240. package/types/bridge/form-subdomain.d.ts +62 -3
  241. package/types/bridge/lib/entry.d.ts +44 -7
  242. package/types/bridge/lib/order.d.ts +13 -2
  243. package/types/bridge/subdomain-content.d.ts +1 -0
  244. package/types/bridge/template-subdomain-gallery.d.ts +13 -1
  245. package/types/dashboard/campaign-form.d.ts +42 -0
  246. package/types/dashboard/card-campaign-agreement.d.ts +26 -0
  247. package/types/dashboard/card-campaign-switch.d.ts +20 -1
  248. package/types/dashboard/card-order.d.ts +2 -2
  249. package/types/dashboard/card-section.d.ts +9 -1
  250. package/types/dashboard/card-shortcut.d.ts +38 -0
  251. package/types/dashboard/card-tile.d.ts +4 -9
  252. package/types/dashboard/document-blocks.d.ts +14 -0
  253. package/types/dashboard/drawer.d.ts +3 -0
  254. package/types/dashboard/form-ai.d.ts +0 -17
  255. package/types/dashboard/form-organization-brand.d.ts +3 -0
  256. package/types/dashboard/form-organization-campaign-advertisements.d.ts +15 -0
  257. package/types/dashboard/form-organization-campaign-agreement.d.ts +53 -10
  258. package/types/dashboard/form-organization-campaign-design.d.ts +46 -0
  259. package/types/dashboard/form-organization-campaign-field-item.d.ts +36 -0
  260. package/types/dashboard/form-organization-campaign-field-number.d.ts +4 -1
  261. package/types/dashboard/form-organization-campaign-field-select.d.ts +6 -1
  262. package/types/dashboard/form-organization-campaign-field-skill.d.ts +36 -0
  263. package/types/dashboard/form-organization-campaign-field-text.d.ts +5 -1
  264. package/types/dashboard/form-organization-campaign-field-textarea.d.ts +4 -1
  265. package/types/dashboard/form-organization-campaign-footer.d.ts +23 -0
  266. package/types/dashboard/form-organization-campaign-integration-age.d.ts +2 -1
  267. package/types/dashboard/form-organization-campaign-integration-geocode.d.ts +2 -0
  268. package/types/dashboard/form-organization-campaign-page.d.ts +9 -15
  269. package/types/dashboard/form-organization-campaign-section.d.ts +24 -8
  270. package/types/dashboard/form-organization-campaign.d.ts +3 -0
  271. package/types/dashboard/form-organization-workflow.d.ts +3 -0
  272. package/types/dashboard/form-organization.d.ts +2 -2
  273. package/types/dashboard/form-reposition.d.ts +29 -0
  274. package/types/dashboard/form-support.d.ts +14 -0
  275. package/types/dashboard/form-tests.d.ts +78 -0
  276. package/types/dashboard/form-verify-prize.d.ts +30 -3
  277. package/types/dashboard/input-editor.d.ts +9 -0
  278. package/types/dashboard/input-fields.d.ts +8 -5
  279. package/types/dashboard/input-file.d.ts +4 -0
  280. package/types/dashboard/input-resource.d.ts +1 -0
  281. package/types/dashboard/lib/ab-tests.d.ts +50 -0
  282. package/types/dashboard/lib/escape.d.ts +4 -0
  283. package/types/dashboard/lib/focus.d.ts +16 -0
  284. package/types/dashboard/lib/form-page.d.ts +25 -0
  285. package/types/dashboard/lib/item-list.d.ts +10 -5
  286. package/types/dashboard/lib/rail.d.ts +0 -1
  287. package/types/dashboard/lib/sms.d.ts +7 -0
  288. package/types/dashboard/modal.d.ts +3 -1
  289. package/types/dashboard/preview.d.ts +65 -10
  290. package/types/dashboard/recharts.d.ts +3 -0
  291. package/types/dashboard/swatch.d.ts +4 -0
  292. package/types/dashboard/template-dashboard.d.ts +3 -0
  293. package/types/dashboard/template-design.d.ts +30 -0
  294. package/types/dashboard/template-test-page.d.ts +69 -0
  295. package/types/dashboard/template-tests.d.ts +30 -0
  296. package/types/dashboard/template-variant.d.ts +18 -0
  297. package/types/icons/arrow-down-long.d.ts +5 -0
  298. package/types/icons/arrows-pointing-out.d.ts +5 -0
  299. package/types/icons/beaker.d.ts +5 -0
  300. package/types/icons/identification.d.ts +5 -0
  301. package/types/icons/lifebuoy.d.ts +5 -0
  302. package/types/icons/rectangle-group.d.ts +5 -0
  303. package/types/icons/rectangle-stack.d.ts +5 -0
  304. package/types/icons/shopping-bag.d.ts +5 -0
  305. package/types/icons/swatch.d.ts +5 -0
  306. package/types/icons/window.d.ts +5 -0
  307. package/types/icons/zoom-in.d.ts +5 -0
  308. package/types/input-answer.d.ts +15 -0
  309. package/types/input-select.d.ts +2 -0
  310. package/types/shared/button.d.ts +1 -1
  311. package/types/shared/document-pieces.d.ts +34 -0
  312. package/types/shared/lib/helpers.d.ts +22 -1
  313. package/types/shared/lib/motion.d.ts +2 -0
  314. package/types/shared/lib/video.d.ts +3 -0
  315. package/types/shared/sortable.d.ts +6 -0
  316. package/types/video.d.ts +18 -2
  317. package/dist/bridge/template-preview.js +0 -208
  318. package/dist/bridge/template-preview.mjs +0 -173
  319. package/dist/dashboard/device.js +0 -95
  320. package/dist/dashboard/device.mjs +0 -72
  321. package/dist/dashboard/form-organization-campaign-field-list.js +0 -425
  322. package/dist/dashboard/form-organization-campaign-field-list.mjs +0 -396
  323. package/dist/dashboard/item-row.js +0 -92
  324. package/dist/dashboard/item-row.mjs +0 -63
  325. package/types/bridge/template-preview.d.ts +0 -10
  326. package/types/dashboard/device.d.ts +0 -12
  327. package/types/dashboard/form-organization-campaign-field-list.d.ts +0 -36
  328. package/types/dashboard/item-row.d.ts +0 -25
@@ -0,0 +1,1769 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { Fragment, useContext, useEffect, useMemo, useState } from "react";
4
+ import { useQueryClient } from "@tanstack/react-query";
5
+ import { constants, formatCurrency, getPlanFeature } from "@drawbridge/drawbridge-utils";
6
+ import { fields as fieldFeatures, organization as organizationFeatures } from "@drawbridge/drawbridge-utils/features";
7
+ import { useModal } from "./lib/hooks.mjs";
8
+ import { textsOn } from "./lib/sms.mjs";
9
+ import { addedOnce, afterRows, ageRange, agreementRows, asksPhone, counted, footerAgreements, formParts, formSlides, giveawayLocked, itemGroup, itemPrice, lastStepId, locationText, MAX_ADS, MAX_SECTIONS, planLocked, privacyLink, readableDocuments, rowLabel, sectionOn, showsTotal } from "./lib/form-page.mjs";
10
+ import { advertisementPreview } from "../shared/lib/helpers.mjs";
11
+ import { buttonState } from "../bridge/lib/entry.mjs";
12
+ import CardSection from "./card-section.mjs";
13
+ import CardShortcut from "./card-shortcut.mjs";
14
+ import CardTask from "./card-task.mjs";
15
+ import Dropdown from "./dropdown.mjs";
16
+ import Link from "./link.mjs";
17
+ import Preview, { Slider, SliderLayout, useCard } from "./preview.mjs";
18
+ import Empty from "../shared/empty.mjs";
19
+ import Badge, { Disabled } from "../shared/badge.mjs";
20
+ import Button from "../shared/button.mjs";
21
+ import Indicator from "../shared/indicator.mjs";
22
+ import Sortable from "../shared/sortable.mjs";
23
+ import InputCheckbox from "../input-checkbox.mjs";
24
+ import ProviderFont from "../provider-font.mjs";
25
+ import { components } from "../bridge/fields.mjs";
26
+ import { FormSubdomainHeader } from "../bridge/form-subdomain-header.mjs";
27
+ import { FormSubdomainAge, FormSubdomainGeocode, FormSubdomainItemList, FormSubdomainMessage } from "../bridge/form-subdomain.mjs";
28
+ import { FormSubdomainMissions } from "../bridge/form-subdomain-missions.mjs";
29
+ import Advertisements from "../bridge/advertisements.mjs";
30
+ import { AgreementDocument } from "../bridge/form-subdomain-agreement.mjs";
31
+ import ArrowDownLong from "../icons/arrow-down-long.mjs";
32
+ import Identification from "../icons/identification.mjs";
33
+ import Lock from "../icons/lock.mjs";
34
+ import RectangleStack from "../icons/rectangle-stack.mjs";
35
+ import ShoppingBag from "../icons/shopping-bag.mjs";
36
+ import Ellipsis from "../icons/ellipsis.mjs";
37
+ import MapPin from "../icons/map-pin.mjs";
38
+ import PlusSmall from "../icons/plus-small.mjs";
39
+ const drawnAs = {
40
+ note: "textarea",
41
+ pickup: "select"
42
+ };
43
+ const buttonStates = [
44
+ {
45
+ key: "Default",
46
+ value: "button"
47
+ },
48
+ {
49
+ key: "Giveaway",
50
+ value: "active"
51
+ },
52
+ {
53
+ key: "Closed",
54
+ value: "inactive"
55
+ }
56
+ ];
57
+ const messageStates = [
58
+ {
59
+ key: "Submission success",
60
+ value: "confirmation"
61
+ },
62
+ {
63
+ key: "Already submitted",
64
+ value: "rejection"
65
+ },
66
+ {
67
+ key: "Order confirmation",
68
+ value: "order"
69
+ }
70
+ ];
71
+ const fieldType = {
72
+ information: "lead",
73
+ order: "order",
74
+ section: "additional"
75
+ };
76
+ const noop = () => {
77
+ };
78
+ const copyText = (campaign, key) => {
79
+ var _a, _b, _c, _d, _e, _f;
80
+ return ((_b = (_a = campaign == null ? void 0 : campaign.form) == null ? void 0 : _a.copy) == null ? void 0 : _b[key]) || ((_f = (_e = (_d = (_c = constants) == null ? void 0 : _c.campaign) == null ? void 0 : _d.form) == null ? void 0 : _e.copy) == null ? void 0 : _f[key]);
81
+ };
82
+ const name = (field) => (field == null ? void 0 : field.label) || (field == null ? void 0 : field.title);
83
+ const options = (items, label) => /* @__PURE__ */ jsx(
84
+ Dropdown,
85
+ {
86
+ ...{
87
+ button: {
88
+ "aria-label": label,
89
+ icon: Ellipsis
90
+ },
91
+ items
92
+ }
93
+ }
94
+ );
95
+ const menuOrUpgrade = (upgrade, items, label) => upgrade ? /* @__PURE__ */ jsx(
96
+ Button,
97
+ {
98
+ ...{
99
+ element: Link,
100
+ href: upgrade,
101
+ inline: true,
102
+ size: "small"
103
+ },
104
+ children: "Upgrade"
105
+ }
106
+ ) : options(items, label);
107
+ const Inert = ({ children }) => /* @__PURE__ */ jsx(
108
+ "div",
109
+ {
110
+ ...{
111
+ className: "pointer-events-none",
112
+ inert: true
113
+ },
114
+ children
115
+ }
116
+ );
117
+ const Drawing = ({ children, fonts, reads }) => /* @__PURE__ */ jsx(
118
+ "div",
119
+ {
120
+ ...{
121
+ className: "mx-auto w-full max-w-[28rem] px-6",
122
+ "data-reads": reads || void 0,
123
+ style: fonts == null ? void 0 : fonts.body
124
+ },
125
+ children: /* @__PURE__ */ jsx(Inert, { children: /* @__PURE__ */ jsx(
126
+ "div",
127
+ {
128
+ ...{
129
+ className: "space-y-4"
130
+ },
131
+ children
132
+ }
133
+ ) })
134
+ }
135
+ );
136
+ const GRIP = "flex items-center justify-center w-10 h-10 shrink-0 rounded bg-gray-light cursor-move touch-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-black";
137
+ const Row = ({
138
+ handle,
139
+ label,
140
+ menu,
141
+ onEdit,
142
+ type
143
+ }) => {
144
+ const text = /* @__PURE__ */ jsxs(
145
+ "span",
146
+ {
147
+ ...{
148
+ className: "block text-left"
149
+ },
150
+ children: [
151
+ /* @__PURE__ */ jsx(
152
+ "span",
153
+ {
154
+ ...{
155
+ className: "block break-words"
156
+ },
157
+ children: label
158
+ }
159
+ ),
160
+ type && /* @__PURE__ */ jsx(
161
+ "span",
162
+ {
163
+ ...{
164
+ className: "block text-sm text-gray-dark break-words"
165
+ },
166
+ children: type
167
+ }
168
+ )
169
+ ]
170
+ }
171
+ );
172
+ return /* @__PURE__ */ jsxs(
173
+ "div",
174
+ {
175
+ ...{
176
+ className: "flex items-center gap-3 min-h-14 px-3 py-2 rounded border border-gray bg-white"
177
+ },
178
+ children: [
179
+ handle,
180
+ /* @__PURE__ */ jsx(
181
+ "div",
182
+ {
183
+ ...{
184
+ className: "flex-1 min-w-0"
185
+ },
186
+ children: onEdit ? /* @__PURE__ */ jsx(
187
+ Button,
188
+ {
189
+ ...{
190
+ justify: "start",
191
+ onClick: onEdit,
192
+ variant: "link"
193
+ },
194
+ children: text
195
+ }
196
+ ) : text
197
+ }
198
+ ),
199
+ menu
200
+ ]
201
+ }
202
+ );
203
+ };
204
+ const Title = ({ description, title }) => /* @__PURE__ */ jsxs(
205
+ "span",
206
+ {
207
+ ...{
208
+ className: "block"
209
+ },
210
+ children: [
211
+ /* @__PURE__ */ jsx(
212
+ "span",
213
+ {
214
+ ...{
215
+ className: "block"
216
+ },
217
+ children: title
218
+ }
219
+ ),
220
+ description && /* @__PURE__ */ jsx(
221
+ "span",
222
+ {
223
+ ...{
224
+ className: "block text-sm"
225
+ },
226
+ children: description
227
+ }
228
+ )
229
+ ]
230
+ }
231
+ );
232
+ const skipped = {
233
+ className: " border-dashed border-gray-dark/50",
234
+ style: {
235
+ backgroundColor: "transparent"
236
+ }
237
+ };
238
+ const STROKE = 1.5;
239
+ const LINE = "text-gray-dark/50";
240
+ const Arrow = () => /* @__PURE__ */ jsx(
241
+ "div",
242
+ {
243
+ ...{
244
+ "aria-hidden": true,
245
+ className: "flex justify-center py-1 " + LINE
246
+ },
247
+ children: /* @__PURE__ */ jsx(
248
+ ArrowDownLong,
249
+ {
250
+ ...{
251
+ className: "w-3 h-12",
252
+ strokeWidth: STROKE
253
+ }
254
+ }
255
+ )
256
+ }
257
+ );
258
+ const Join = ({ end, label, onAdd, start }) => !onAdd ? /* @__PURE__ */ jsx(
259
+ "div",
260
+ {
261
+ ...{
262
+ "aria-hidden": true,
263
+ className: "flex justify-center py-1 " + LINE
264
+ },
265
+ children: /* @__PURE__ */ jsx(
266
+ ArrowDownLong,
267
+ {
268
+ ...{
269
+ className: "w-3 h-10",
270
+ strokeWidth: STROKE
271
+ }
272
+ }
273
+ )
274
+ }
275
+ ) : /* @__PURE__ */ jsxs(
276
+ "div",
277
+ {
278
+ ...{
279
+ className: "flex flex-col items-center"
280
+ },
281
+ children: [
282
+ !start && /* @__PURE__ */ jsx(
283
+ "span",
284
+ {
285
+ ...{
286
+ className: "h-3 bg-current " + LINE,
287
+ style: {
288
+ width: STROKE
289
+ }
290
+ }
291
+ }
292
+ ),
293
+ /* @__PURE__ */ jsx(
294
+ Button,
295
+ {
296
+ ...{
297
+ "aria-label": label,
298
+ icon: PlusSmall,
299
+ inline: true,
300
+ onClick: onAdd,
301
+ size: "small",
302
+ variant: "round"
303
+ }
304
+ }
305
+ ),
306
+ !end && /* @__PURE__ */ jsx(
307
+ "span",
308
+ {
309
+ ...{
310
+ className: "h-3 bg-current " + LINE,
311
+ style: {
312
+ width: STROKE
313
+ }
314
+ }
315
+ }
316
+ )
317
+ ]
318
+ }
319
+ );
320
+ const Choice = ({
321
+ disabled,
322
+ granted = true,
323
+ message,
324
+ onClick,
325
+ title,
326
+ upgrade
327
+ }) => {
328
+ const href = granted ? null : upgrade == null ? void 0 : upgrade.href;
329
+ return /* @__PURE__ */ jsxs(
330
+ Button,
331
+ {
332
+ ...{
333
+ element: href ? Link : "button",
334
+ ...href ? {
335
+ href
336
+ } : {
337
+ disabled: disabled || !granted,
338
+ icon: PlusSmall,
339
+ onClick,
340
+ type: "button"
341
+ },
342
+ justify: "between",
343
+ variant: "secondary"
344
+ },
345
+ children: [
346
+ /* @__PURE__ */ jsxs(
347
+ "span",
348
+ {
349
+ ...{
350
+ className: "flex-1 text-left"
351
+ },
352
+ children: [
353
+ /* @__PURE__ */ jsx(
354
+ "span",
355
+ {
356
+ ...{
357
+ className: "block"
358
+ },
359
+ children: title
360
+ }
361
+ ),
362
+ (message || !granted) && /* @__PURE__ */ jsx(
363
+ "span",
364
+ {
365
+ ...{
366
+ className: "block text-sm"
367
+ },
368
+ children: message
369
+ }
370
+ )
371
+ ]
372
+ }
373
+ ),
374
+ href && /* @__PURE__ */ jsx(
375
+ Button,
376
+ {
377
+ ...{
378
+ element: "span",
379
+ inline: true,
380
+ size: "small"
381
+ },
382
+ children: "Upgrade"
383
+ }
384
+ )
385
+ ]
386
+ }
387
+ );
388
+ };
389
+ const SectionChoices = ({ choices, onClose }) => /* @__PURE__ */ jsx(
390
+ "div",
391
+ {
392
+ ...{
393
+ className: "grid gap-3"
394
+ },
395
+ children: choices.map(({ description, disabled, icon, locked, onClick, title, upgrade }) => /* @__PURE__ */ jsx(
396
+ CardShortcut,
397
+ {
398
+ ...{
399
+ badge: locked && /* @__PURE__ */ jsx(
400
+ Lock,
401
+ {
402
+ ...{
403
+ "aria-label": "Locked",
404
+ className: "w-4 h-4 text-gray-dark",
405
+ role: "img"
406
+ }
407
+ }
408
+ ),
409
+ description,
410
+ icon,
411
+ title,
412
+ ...upgrade ? {
413
+ href: upgrade
414
+ } : {
415
+ disabled,
416
+ onClick: () => {
417
+ onClose();
418
+ onClick();
419
+ }
420
+ }
421
+ }
422
+ },
423
+ title
424
+ ))
425
+ }
426
+ );
427
+ const Choices = ({ choices, onClose }) => /* @__PURE__ */ jsx(
428
+ "div",
429
+ {
430
+ ...{
431
+ className: "relative w-full space-y-3"
432
+ },
433
+ children: choices.map((choice) => /* @__PURE__ */ jsx(
434
+ Choice,
435
+ {
436
+ ...{
437
+ ...choice,
438
+ onClick: () => {
439
+ onClose();
440
+ choice.onClick();
441
+ }
442
+ }
443
+ },
444
+ choice.title
445
+ ))
446
+ }
447
+ );
448
+ const Drawn = ({ currency, field, style }) => {
449
+ var _a, _b;
450
+ return (field == null ? void 0 : field.slug) === "list" ? /* @__PURE__ */ jsx(
451
+ FormSubdomainItemList,
452
+ {
453
+ ...{
454
+ currency,
455
+ field,
456
+ onChange: noop,
457
+ prices: true,
458
+ style,
459
+ value: {}
460
+ }
461
+ }
462
+ ) : ((_b = (_a = components)[drawnAs[field == null ? void 0 : field.slug] || (field == null ? void 0 : field.slug)]) == null ? void 0 : _b.call(_a, {
463
+ field,
464
+ onChange: noop,
465
+ style,
466
+ value: ""
467
+ })) || null;
468
+ };
469
+ const FooterEnd = ({
470
+ campaign,
471
+ phone,
472
+ style,
473
+ texts
474
+ }) => {
475
+ var _a, _b, _c, _d;
476
+ const agreements = (campaign == null ? void 0 : campaign.agreements) || {};
477
+ const privacy = privacyLink(agreements);
478
+ const recaptcha = Boolean((_b = (_a = campaign == null ? void 0 : campaign.integrations) == null ? void 0 : _a.recaptcha) == null ? void 0 : _b.enabled);
479
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
480
+ /* @__PURE__ */ jsx(
481
+ "div",
482
+ {
483
+ ...{
484
+ className: "space-y-3"
485
+ },
486
+ children: footerAgreements({
487
+ agreements,
488
+ phone,
489
+ texts
490
+ }).map(({ key, label }) => /* @__PURE__ */ jsx(
491
+ InputCheckbox,
492
+ {
493
+ ...{
494
+ label,
495
+ onChange: noop,
496
+ style,
497
+ value: false
498
+ }
499
+ },
500
+ key
501
+ ))
502
+ }
503
+ ),
504
+ /* @__PURE__ */ jsxs(
505
+ "div",
506
+ {
507
+ ...{
508
+ className: "pt-2"
509
+ },
510
+ children: [
511
+ /* @__PURE__ */ jsx(
512
+ Button,
513
+ {
514
+ ...{
515
+ style
516
+ },
517
+ children: ((_d = (_c = campaign == null ? void 0 : campaign.form) == null ? void 0 : _c.copy) == null ? void 0 : _d.submit) || "Submit"
518
+ }
519
+ ),
520
+ (privacy || recaptcha) && /* @__PURE__ */ jsxs(
521
+ "div",
522
+ {
523
+ ...{
524
+ className: "pt-4 space-y-2 text-center"
525
+ },
526
+ children: [
527
+ privacy && /* @__PURE__ */ jsx(
528
+ "p",
529
+ {
530
+ ...{
531
+ className: "text-xs underline"
532
+ },
533
+ children: privacy
534
+ }
535
+ ),
536
+ recaptcha && /* @__PURE__ */ jsxs(
537
+ "div",
538
+ {
539
+ ...{
540
+ className: "text-[10px] opacity-50"
541
+ },
542
+ children: [
543
+ /* @__PURE__ */ jsx("p", { children: "This site is protected by reCAPTCHA." }),
544
+ /* @__PURE__ */ jsxs("p", { children: [
545
+ "The Google ",
546
+ /* @__PURE__ */ jsx("span", { className: "underline", children: "Privacy Policy" }),
547
+ " and ",
548
+ /* @__PURE__ */ jsx("span", { className: "underline", children: "Terms of Service" }),
549
+ " apply"
550
+ ] })
551
+ ]
552
+ }
553
+ )
554
+ ]
555
+ }
556
+ )
557
+ ]
558
+ }
559
+ )
560
+ ] });
561
+ };
562
+ const Step = ({
563
+ actions,
564
+ campaign,
565
+ canManage,
566
+ collapsed,
567
+ currency,
568
+ fonts,
569
+ handle,
570
+ last,
571
+ params,
572
+ phone,
573
+ section,
574
+ sections,
575
+ style,
576
+ texts
577
+ }) => {
578
+ var _a, _b;
579
+ const queryClient = useQueryClient();
580
+ const modal = useModal({
581
+ queryClient
582
+ });
583
+ const items = section.items || [];
584
+ const type = fieldType[section.type];
585
+ const plan = planLocked(section);
586
+ const upgrade = plan ? ((_b = (_a = section.task) == null ? void 0 : _a.button) == null ? void 0 : _b.href) || null : null;
587
+ const locked = giveawayLocked(section);
588
+ const on = sectionOn(section);
589
+ const shown = on && !collapsed;
590
+ const card = useCard(section.id);
591
+ const add = () => modal.open({
592
+ message: /* @__PURE__ */ jsx(
593
+ Choices,
594
+ {
595
+ ...{
596
+ choices: (section.inputs || []).map(({ slug, title, ...input }) => ({
597
+ ...input,
598
+ disabled: addedOnce(slug, section.keys),
599
+ message: addedOnce(slug, section.keys) ? "Field has already been added" : input.granted === false ? input.message : null,
600
+ onClick: () => actions.manage({
601
+ ...input,
602
+ section,
603
+ slug,
604
+ title,
605
+ type
606
+ }),
607
+ title
608
+ })),
609
+ onClose: () => modal.close()
610
+ }
611
+ }
612
+ ),
613
+ title: "Add field to " + section.title
614
+ });
615
+ const manage = (field) => actions.manage({
616
+ ...field,
617
+ section,
618
+ type
619
+ });
620
+ const movable = section.type === "section" && sections.length > 1;
621
+ const cta = /* @__PURE__ */ jsxs(
622
+ "div",
623
+ {
624
+ ...{
625
+ className: "flex items-center gap-2"
626
+ },
627
+ children: [
628
+ !on && !plan && /* @__PURE__ */ jsx(Disabled, {}),
629
+ menuOrUpgrade(
630
+ upgrade,
631
+ [
632
+ {
633
+ disabled: plan,
634
+ element: "button",
635
+ onClick: () => actions.section({
636
+ ...section,
637
+ fallback: "Next"
638
+ }),
639
+ title: "Manage"
640
+ },
641
+ // @story fields/order-section
642
+ // Order deletes as a custom section does ( Darren, 2026-11-16 ).
643
+ (section.type === "section" || section.type === "order") && {
644
+ className: "text-red-dark",
645
+ disabled: !canManage,
646
+ element: "button",
647
+ onClick: () => actions.removeSection(section),
648
+ title: "Delete"
649
+ }
650
+ ].filter(Boolean),
651
+ section.title + " options"
652
+ ),
653
+ canManage && !upgrade && /* @__PURE__ */ jsx(
654
+ Button,
655
+ {
656
+ ...{
657
+ // The button reads Add; its name says what it adds.
658
+ "aria-label": "Add field to " + section.title,
659
+ disabled: plan,
660
+ icon: PlusSmall,
661
+ inline: true,
662
+ onClick: add,
663
+ size: "small",
664
+ variant: "success"
665
+ },
666
+ children: "Add"
667
+ }
668
+ )
669
+ ]
670
+ }
671
+ );
672
+ const editor = items.length === 0 ? /* @__PURE__ */ jsx(
673
+ Empty,
674
+ {
675
+ ...{
676
+ variant: "secondary"
677
+ },
678
+ children: /* @__PURE__ */ jsx("p", { children: "No fields have been added" })
679
+ }
680
+ ) : /* @__PURE__ */ jsx(
681
+ Sortable,
682
+ {
683
+ ...{
684
+ classNameSortableItem: "pb-2 last:pb-0",
685
+ disabled: !canManage,
686
+ handleClassName: GRIP,
687
+ handleLabel: (field) => "Move " + name(field),
688
+ items,
689
+ onSort: (sorted) => actions.reorder({
690
+ items: sorted,
691
+ section
692
+ }),
693
+ renderItem: (field, _index, handle2) => {
694
+ var _a2, _b2, _c;
695
+ const price = itemPrice(field);
696
+ return /* @__PURE__ */ jsx(
697
+ Row,
698
+ {
699
+ ...{
700
+ handle: handle2,
701
+ label: rowLabel(field),
702
+ menu: options(
703
+ [
704
+ {
705
+ disabled: canManage && !((_a2 = field == null ? void 0 : field.methods) == null ? void 0 : _a2.includes("put")),
706
+ element: "button",
707
+ onClick: () => manage(field),
708
+ title: "Manage"
709
+ },
710
+ // The skill testing question stays where it was added.
711
+ movable && (field == null ? void 0 : field.slug) !== "skill" && {
712
+ disabled: !canManage || !((_b2 = field == null ? void 0 : field.methods) == null ? void 0 : _b2.includes("put")),
713
+ element: "button",
714
+ onClick: () => actions.move({
715
+ ...field,
716
+ section,
717
+ sections,
718
+ type
719
+ }),
720
+ title: "Move"
721
+ },
722
+ // @story fields/delete
723
+ // Name and Email offer no Delete at all ( `removable : false` ).
724
+ (field == null ? void 0 : field.removable) !== false && {
725
+ className: "text-red-dark",
726
+ disabled: !canManage || !((_c = field == null ? void 0 : field.methods) == null ? void 0 : _c.includes("delete")),
727
+ element: "button",
728
+ onClick: () => actions.delete(field, section),
729
+ title: "Delete"
730
+ }
731
+ ].filter(Boolean),
732
+ name(field) + " options"
733
+ ),
734
+ onEdit: () => manage(field),
735
+ type: itemGroup(field) ? "Item group \xB7 " + field.settings.items.length + " items" : (field == null ? void 0 : field.slug) === "list" ? "Item" + (price === null ? "" : " \xB7 " + formatCurrency({
736
+ code: (currency || "usd").toUpperCase(),
737
+ display: "parts",
738
+ value: price
739
+ })) : field == null ? void 0 : field.title
740
+ }
741
+ }
742
+ );
743
+ },
744
+ sortableElement: "div"
745
+ }
746
+ }
747
+ );
748
+ const body = collapsed ? null : plan ? /* @__PURE__ */ jsx(
749
+ CardTask,
750
+ {
751
+ ...{
752
+ ...section.task,
753
+ // Upgrade sits in the header: the card keeps the plan's words.
754
+ ...upgrade && {
755
+ button: null
756
+ }
757
+ }
758
+ }
759
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
760
+ locked && /* @__PURE__ */ jsx(
761
+ "div",
762
+ {
763
+ ...{
764
+ className: "pb-4"
765
+ },
766
+ children: /* @__PURE__ */ jsx(
767
+ CardTask,
768
+ {
769
+ ...{
770
+ button: {
771
+ href: "/organizations/" + (params == null ? void 0 : params.organization) + "/campaigns/" + (params == null ? void 0 : params.campaign) + "/giveaway",
772
+ text: "Go to Giveaway"
773
+ },
774
+ message: "Orders are off while the giveaway is on."
775
+ }
776
+ }
777
+ )
778
+ }
779
+ ),
780
+ editor,
781
+ shown && /* @__PURE__ */ jsx(
782
+ Preview,
783
+ {
784
+ ...{
785
+ id: section.id
786
+ },
787
+ children: /* @__PURE__ */ jsxs(
788
+ Drawing,
789
+ {
790
+ ...{
791
+ fonts
792
+ },
793
+ children: [
794
+ /* @__PURE__ */ jsx(
795
+ FormSubdomainHeader,
796
+ {
797
+ ...{
798
+ description: section.description,
799
+ style,
800
+ title: section.title
801
+ }
802
+ }
803
+ ),
804
+ items.map((field) => /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
805
+ Drawn,
806
+ {
807
+ ...{
808
+ currency,
809
+ field,
810
+ style
811
+ }
812
+ }
813
+ ) }, field.id)),
814
+ section.type === "order" && showsTotal(items) && /* @__PURE__ */ jsxs(
815
+ "div",
816
+ {
817
+ ...{
818
+ className: "flex items-center justify-between text-sm"
819
+ },
820
+ children: [
821
+ /* @__PURE__ */ jsx("span", { children: "TOTAL \xB7 0 ITEMS" }),
822
+ /* @__PURE__ */ jsx("span", { children: formatCurrency({
823
+ code: (currency || "usd").toUpperCase(),
824
+ display: "parts",
825
+ value: 0
826
+ }) })
827
+ ]
828
+ }
829
+ ),
830
+ last ? /* @__PURE__ */ jsx(
831
+ FooterEnd,
832
+ {
833
+ ...{
834
+ campaign,
835
+ phone,
836
+ style,
837
+ texts
838
+ }
839
+ }
840
+ ) : /* @__PURE__ */ jsx(
841
+ "div",
842
+ {
843
+ ...{
844
+ className: "pt-2"
845
+ },
846
+ children: /* @__PURE__ */ jsx(
847
+ Button,
848
+ {
849
+ ...{
850
+ style
851
+ },
852
+ children: section.button || "Next"
853
+ }
854
+ )
855
+ }
856
+ )
857
+ ]
858
+ }
859
+ )
860
+ }
861
+ )
862
+ ] });
863
+ return /* @__PURE__ */ jsx(
864
+ CardSection,
865
+ {
866
+ ...{
867
+ children: body,
868
+ className: "relative shrink-0" + (on ? card.className : skipped.className),
869
+ cta,
870
+ "data-guide": "section-" + section.id,
871
+ ...on ? card.props : {
872
+ style: skipped.style
873
+ },
874
+ // A custom section drags by the handle left of its title, always shown,
875
+ // in a grey box the height of its title and description.
876
+ title: /* @__PURE__ */ jsxs(
877
+ "span",
878
+ {
879
+ ...{
880
+ className: "flex items-center gap-3"
881
+ },
882
+ children: [
883
+ handle,
884
+ /* @__PURE__ */ jsx(
885
+ Title,
886
+ {
887
+ ...section
888
+ }
889
+ )
890
+ ]
891
+ }
892
+ )
893
+ }
894
+ }
895
+ );
896
+ };
897
+ const AgeStep = ({
898
+ actions,
899
+ age,
900
+ canManage,
901
+ fonts,
902
+ style
903
+ }) => {
904
+ var _a;
905
+ const on = age.enabled !== false;
906
+ const title = ((_a = age.settings) == null ? void 0 : _a.title) || "Confirm your age";
907
+ const card = useCard("age");
908
+ return /* @__PURE__ */ jsxs(
909
+ CardSection,
910
+ {
911
+ ...{
912
+ className: "relative shrink-0" + (on ? card.className : skipped.className),
913
+ cta: /* @__PURE__ */ jsxs(
914
+ "div",
915
+ {
916
+ ...{
917
+ className: "flex items-center gap-2"
918
+ },
919
+ children: [
920
+ !on && /* @__PURE__ */ jsx(Disabled, {}),
921
+ options(
922
+ [
923
+ {
924
+ element: "button",
925
+ onClick: () => {
926
+ var _a2, _b, _c;
927
+ return actions.section({
928
+ button: (_a2 = age.settings) == null ? void 0 : _a2.button,
929
+ description: (_b = age.settings) == null ? void 0 : _b.description,
930
+ enabled: on,
931
+ fallback: "Next",
932
+ id: "age",
933
+ title: (_c = age.settings) == null ? void 0 : _c.title,
934
+ type: "age"
935
+ });
936
+ },
937
+ title: "Manage"
938
+ },
939
+ {
940
+ className: "text-red-dark",
941
+ disabled: !canManage,
942
+ element: "button",
943
+ // A section, so the section's Delete ( Darren, 2026-11-11 ).
944
+ onClick: () => actions.removeSection({
945
+ id: "age",
946
+ title
947
+ }),
948
+ title: "Delete"
949
+ }
950
+ ],
951
+ "Age gate options"
952
+ )
953
+ ]
954
+ }
955
+ ),
956
+ "data-guide": "section-age",
957
+ ...on ? card.props : {
958
+ style: skipped.style
959
+ },
960
+ title: /* @__PURE__ */ jsx(
961
+ Title,
962
+ {
963
+ ...{
964
+ description: ageRange(age.settings),
965
+ title
966
+ }
967
+ }
968
+ )
969
+ },
970
+ children: [
971
+ /* @__PURE__ */ jsx(
972
+ Row,
973
+ {
974
+ ...{
975
+ label: "Date of birth\xA0*",
976
+ menu: options(
977
+ [
978
+ {
979
+ element: "button",
980
+ onClick: () => actions.integration(age),
981
+ title: "Manage"
982
+ }
983
+ ],
984
+ "Age gate field options"
985
+ ),
986
+ onEdit: () => actions.integration(age),
987
+ type: "Age gate"
988
+ }
989
+ }
990
+ ),
991
+ on && /* @__PURE__ */ jsx(
992
+ Preview,
993
+ {
994
+ ...{
995
+ id: "age"
996
+ },
997
+ children: /* @__PURE__ */ jsx(
998
+ Drawing,
999
+ {
1000
+ ...{
1001
+ fonts
1002
+ },
1003
+ children: /* @__PURE__ */ jsx(
1004
+ FormSubdomainAge,
1005
+ {
1006
+ ...{
1007
+ style,
1008
+ values: age.settings
1009
+ }
1010
+ }
1011
+ )
1012
+ }
1013
+ )
1014
+ }
1015
+ )
1016
+ ]
1017
+ }
1018
+ );
1019
+ };
1020
+ const Location = ({
1021
+ fonts,
1022
+ item,
1023
+ style
1024
+ }) => {
1025
+ const card = useCard("location");
1026
+ return /* @__PURE__ */ jsxs(
1027
+ "div",
1028
+ {
1029
+ ...{
1030
+ className: "flex justify-center"
1031
+ },
1032
+ children: [
1033
+ /* @__PURE__ */ jsx(
1034
+ "div",
1035
+ {
1036
+ ...{
1037
+ "aria-label": "Show the location check",
1038
+ className: "rounded-full outline-offset-2 focus-visible:outline focus-visible:outline-2" + card.className,
1039
+ role: "button",
1040
+ tabIndex: 0,
1041
+ ...card.props
1042
+ },
1043
+ children: /* @__PURE__ */ jsx(
1044
+ Badge,
1045
+ {
1046
+ ...{
1047
+ className: "bg-gray",
1048
+ "data-guide": "section-geocode",
1049
+ type: null
1050
+ },
1051
+ children: /* @__PURE__ */ jsxs(
1052
+ "span",
1053
+ {
1054
+ ...{
1055
+ className: "flex items-center gap-2"
1056
+ },
1057
+ children: [
1058
+ /* @__PURE__ */ jsx(
1059
+ MapPin,
1060
+ {
1061
+ ...{
1062
+ "aria-hidden": true,
1063
+ className: "w-4 h-4"
1064
+ }
1065
+ }
1066
+ ),
1067
+ locationText(item)
1068
+ ]
1069
+ }
1070
+ )
1071
+ }
1072
+ )
1073
+ }
1074
+ ),
1075
+ /* @__PURE__ */ jsx(
1076
+ Preview,
1077
+ {
1078
+ ...{
1079
+ id: "location"
1080
+ },
1081
+ children: /* @__PURE__ */ jsx(
1082
+ Drawing,
1083
+ {
1084
+ ...{
1085
+ fonts
1086
+ },
1087
+ children: /* @__PURE__ */ jsx(
1088
+ FormSubdomainGeocode,
1089
+ {
1090
+ ...{
1091
+ still: true,
1092
+ style
1093
+ }
1094
+ }
1095
+ )
1096
+ }
1097
+ )
1098
+ }
1099
+ )
1100
+ ]
1101
+ }
1102
+ );
1103
+ };
1104
+ const Start = ({
1105
+ actions,
1106
+ campaign,
1107
+ fonts,
1108
+ style
1109
+ }) => {
1110
+ const [state, setState] = useState(() => buttonState(campaign, (campaign == null ? void 0 : campaign.valid) !== false));
1111
+ const card = useCard("start");
1112
+ const edit = () => actions.copy(buttonStates.map(({ value }) => value), "Entry button");
1113
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1114
+ /* @__PURE__ */ jsx(
1115
+ CardSection,
1116
+ {
1117
+ ...{
1118
+ className: "relative shrink-0" + card.className,
1119
+ cta: options(
1120
+ [
1121
+ {
1122
+ element: "button",
1123
+ onClick: edit,
1124
+ title: "Manage"
1125
+ }
1126
+ ],
1127
+ "Entry button options"
1128
+ ),
1129
+ "data-guide": "section-start",
1130
+ ...card.props,
1131
+ title: /* @__PURE__ */ jsx(
1132
+ Title,
1133
+ {
1134
+ ...{
1135
+ description: "Opens the form on the share page.",
1136
+ title: "Entry button"
1137
+ }
1138
+ }
1139
+ ),
1140
+ variant: "gray"
1141
+ }
1142
+ }
1143
+ ),
1144
+ /* @__PURE__ */ jsx(
1145
+ Preview,
1146
+ {
1147
+ ...{
1148
+ id: "start",
1149
+ states: {
1150
+ onChange: setState,
1151
+ options: buttonStates,
1152
+ value: state
1153
+ }
1154
+ },
1155
+ children: /* @__PURE__ */ jsx(
1156
+ Drawing,
1157
+ {
1158
+ ...{
1159
+ fonts
1160
+ },
1161
+ children: /* @__PURE__ */ jsx(
1162
+ "div",
1163
+ {
1164
+ ...{
1165
+ className: "flex justify-center"
1166
+ },
1167
+ children: /* @__PURE__ */ jsx(
1168
+ Button,
1169
+ {
1170
+ ...{
1171
+ disabled: state === "inactive",
1172
+ style
1173
+ },
1174
+ children: copyText(campaign, state)
1175
+ }
1176
+ )
1177
+ }
1178
+ )
1179
+ }
1180
+ )
1181
+ }
1182
+ )
1183
+ ] });
1184
+ };
1185
+ const Footer = ({
1186
+ actions,
1187
+ campaign,
1188
+ phone,
1189
+ texts
1190
+ }) => {
1191
+ const slider = useContext(Slider);
1192
+ const edit = () => actions.footer({
1193
+ phone,
1194
+ texts
1195
+ });
1196
+ const agreements = agreementRows(campaign == null ? void 0 : campaign.agreements, texts);
1197
+ return /* @__PURE__ */ jsxs(
1198
+ "div",
1199
+ {
1200
+ ...{
1201
+ className: "space-y-3 mt-8 pt-6 border-t border-gray-dark/20" + ((slider == null ? void 0 : slider.current) === (slider == null ? void 0 : slider.last) ? "" : " cursor-pointer"),
1202
+ "data-guide": "section-footer",
1203
+ ...slider && {
1204
+ onFocusCapture: () => slider.select(slider.last),
1205
+ onPointerDownCapture: (event) => slider.select(slider.last, event.currentTarget, event.target)
1206
+ }
1207
+ },
1208
+ children: [
1209
+ /* @__PURE__ */ jsxs(
1210
+ "div",
1211
+ {
1212
+ ...{
1213
+ className: "flex items-center justify-between gap-4"
1214
+ },
1215
+ children: [
1216
+ /* @__PURE__ */ jsx(
1217
+ "div",
1218
+ {
1219
+ ...{
1220
+ className: "text-gray-dark"
1221
+ },
1222
+ children: /* @__PURE__ */ jsx(
1223
+ Title,
1224
+ {
1225
+ ...{
1226
+ description: "Automatically added to the bottom of the last section.",
1227
+ title: "Footer"
1228
+ }
1229
+ }
1230
+ )
1231
+ }
1232
+ ),
1233
+ options(
1234
+ [
1235
+ {
1236
+ element: "button",
1237
+ onClick: edit,
1238
+ title: "Manage"
1239
+ }
1240
+ ],
1241
+ "Footer options"
1242
+ )
1243
+ ]
1244
+ }
1245
+ ),
1246
+ agreements.map(({ id, on, title }) => /* @__PURE__ */ jsxs(
1247
+ "p",
1248
+ {
1249
+ ...{
1250
+ className: "flex items-center gap-2"
1251
+ },
1252
+ children: [
1253
+ /* @__PURE__ */ jsx(
1254
+ Indicator,
1255
+ {
1256
+ ...{
1257
+ type: on ? "active" : "inactive"
1258
+ }
1259
+ }
1260
+ ),
1261
+ /* @__PURE__ */ jsx("span", { children: title }),
1262
+ /* @__PURE__ */ jsx(
1263
+ "span",
1264
+ {
1265
+ ...{
1266
+ className: "sr-only"
1267
+ },
1268
+ children: on ? ", on" : ", off"
1269
+ }
1270
+ )
1271
+ ]
1272
+ },
1273
+ id
1274
+ ))
1275
+ ]
1276
+ }
1277
+ );
1278
+ };
1279
+ const Agreements = ({ campaign, documents, fonts, style }) => {
1280
+ var _a, _b, _c, _d, _e;
1281
+ const [picked, setPicked] = useState(null);
1282
+ const id = documents.some((item) => item.value === picked) ? picked : (_a = documents[0]) == null ? void 0 : _a.value;
1283
+ return /* @__PURE__ */ jsx(
1284
+ Preview,
1285
+ {
1286
+ ...{
1287
+ id: "agreements",
1288
+ states: {
1289
+ onChange: setPicked,
1290
+ options: documents,
1291
+ value: id
1292
+ }
1293
+ },
1294
+ children: /* @__PURE__ */ jsx(
1295
+ Drawing,
1296
+ {
1297
+ ...{
1298
+ fonts,
1299
+ reads: "Agreements"
1300
+ },
1301
+ children: /* @__PURE__ */ jsx(
1302
+ AgreementDocument,
1303
+ {
1304
+ ...{
1305
+ data: (_b = campaign == null ? void 0 : campaign.preview) == null ? void 0 : _b.documents,
1306
+ style,
1307
+ value: (_e = (_d = (_c = campaign == null ? void 0 : campaign.agreements) == null ? void 0 : _c[id]) == null ? void 0 : _d.values) == null ? void 0 : _e.document
1308
+ }
1309
+ }
1310
+ )
1311
+ }
1312
+ )
1313
+ }
1314
+ );
1315
+ };
1316
+ const After = ({
1317
+ actions,
1318
+ after,
1319
+ campaign,
1320
+ canManage,
1321
+ fonts,
1322
+ organization,
1323
+ params,
1324
+ style
1325
+ }) => {
1326
+ var _a, _b, _c;
1327
+ const queryClient = useQueryClient();
1328
+ const app = queryClient.getQueryData(["app"]);
1329
+ const [response, setResponse] = useState("confirmation");
1330
+ const card = useCard("after");
1331
+ const all = after.advertisements || [];
1332
+ const missions = after.missions || [];
1333
+ const ads = all.filter((ad) => (ad == null ? void 0 : ad.status) === "published").map((ad) => {
1334
+ var _a2, _b2, _c2;
1335
+ return advertisementPreview(ad, (_c2 = (_b2 = (_a2 = app == null ? void 0 : app.enums) == null ? void 0 : _a2.advertisement) == null ? void 0 : _b2.action) == null ? void 0 : _c2.options);
1336
+ });
1337
+ const page = campaign == null ? void 0 : campaign.preview;
1338
+ const editMessages = () => actions.copy(messageStates.map(({ value }) => value), "Messages");
1339
+ const adsPlan = getPlanFeature(organization == null ? void 0 : organization.plan, organizationFeatures.advertisements.key);
1340
+ const rows = {
1341
+ advertisements: {
1342
+ edit: () => actions.advertisements(),
1343
+ label: "Advertisements",
1344
+ upgrade: !adsPlan.granted && ((_a = organization == null ? void 0 : organization.capabilities) == null ? void 0 : _a.billing) === "manage" && "/organizations/" + (params == null ? void 0 : params.organization) + "/billing",
1345
+ preview: ads.length > 0 && /* @__PURE__ */ jsx(
1346
+ Advertisements,
1347
+ {
1348
+ ...{
1349
+ campaign: campaign == null ? void 0 : campaign.id,
1350
+ items: ads,
1351
+ organization: campaign == null ? void 0 : campaign.organization,
1352
+ preview: true,
1353
+ slug: page == null ? void 0 : page.slug,
1354
+ style,
1355
+ subdomain: page == null ? void 0 : page.subdomain
1356
+ }
1357
+ }
1358
+ ),
1359
+ // Published out of every advertisement, drafts included, as Missions counts ( Darren, 2026-11-16 ).
1360
+ type: adsPlan.granted ? counted(ads.length, all.length) : adsPlan.message || organizationFeatures.advertisements.error
1361
+ },
1362
+ // No text under Message: it followed the preview's picker, which read as the
1363
+ // row changing ( Darren, 2026-11-11 ).
1364
+ message: {
1365
+ edit: editMessages,
1366
+ label: "Message",
1367
+ preview: /* @__PURE__ */ jsx(
1368
+ FormSubdomainMessage,
1369
+ {
1370
+ ...{
1371
+ message: copyText(campaign, response),
1372
+ style
1373
+ }
1374
+ }
1375
+ )
1376
+ },
1377
+ // Its Manage leaves the page for Missions, so pressing the row opens nothing:
1378
+ // it jumped away while a person only meant to show its step ( Darren, 2026-11-13 ).
1379
+ missions: {
1380
+ edit: actions.missions,
1381
+ label: "Missions",
1382
+ leaves: true,
1383
+ preview: /* @__PURE__ */ jsx(
1384
+ FormSubdomainMissions,
1385
+ {
1386
+ ...{
1387
+ missions,
1388
+ slug: page == null ? void 0 : page.slug,
1389
+ style,
1390
+ subdomain: page == null ? void 0 : page.subdomain
1391
+ }
1392
+ }
1393
+ ),
1394
+ // Switched on out of the missions the Missions page lists ( the api's count ).
1395
+ type: counted((_b = after.missionCount) == null ? void 0 : _b.on, (_c = after.missionCount) == null ? void 0 : _c.total)
1396
+ }
1397
+ };
1398
+ return /* @__PURE__ */ jsxs(
1399
+ CardSection,
1400
+ {
1401
+ ...{
1402
+ className: "relative shrink-0" + card.className,
1403
+ "data-guide": "section-after",
1404
+ ...card.props,
1405
+ title: /* @__PURE__ */ jsx(
1406
+ Title,
1407
+ {
1408
+ ...{
1409
+ description: "What a person sees once they submit.",
1410
+ title: "After entry"
1411
+ }
1412
+ }
1413
+ ),
1414
+ variant: "gray"
1415
+ },
1416
+ children: [
1417
+ /* @__PURE__ */ jsx(
1418
+ Sortable,
1419
+ {
1420
+ ...{
1421
+ classNameSortableItem: "pb-2 last:pb-0",
1422
+ disabled: !canManage,
1423
+ handleClassName: GRIP,
1424
+ handleLabel: (key) => "Move " + rows[key].label,
1425
+ items: afterRows(after.order),
1426
+ onSort: actions.reorderAfter,
1427
+ renderItem: (key, _index, handle) => /* @__PURE__ */ jsx(
1428
+ Row,
1429
+ {
1430
+ ...{
1431
+ handle,
1432
+ label: rows[key].label,
1433
+ menu: menuOrUpgrade(
1434
+ rows[key].upgrade,
1435
+ [
1436
+ {
1437
+ element: "button",
1438
+ onClick: rows[key].edit,
1439
+ title: "Manage"
1440
+ }
1441
+ ],
1442
+ rows[key].label + " options"
1443
+ ),
1444
+ // A row showing Upgrade opens nothing: Upgrade is its only control ( Darren,
1445
+ // 2026-11-12 ). Nor does Missions: only its Manage leaves the page.
1446
+ onEdit: rows[key].upgrade || rows[key].leaves ? null : rows[key].edit,
1447
+ type: rows[key].type
1448
+ }
1449
+ }
1450
+ ),
1451
+ sortableElement: "div"
1452
+ }
1453
+ }
1454
+ ),
1455
+ /* @__PURE__ */ jsx(
1456
+ Preview,
1457
+ {
1458
+ ...{
1459
+ id: "after",
1460
+ states: {
1461
+ onChange: setResponse,
1462
+ options: messageStates,
1463
+ value: response
1464
+ }
1465
+ },
1466
+ children: /* @__PURE__ */ jsx(
1467
+ Drawing,
1468
+ {
1469
+ ...{
1470
+ fonts
1471
+ },
1472
+ children: afterRows(after.order, response).map((key) => /* @__PURE__ */ jsx("div", { children: rows[key].preview }, key))
1473
+ }
1474
+ )
1475
+ }
1476
+ )
1477
+ ]
1478
+ }
1479
+ );
1480
+ };
1481
+ const CampaignForm = ({
1482
+ actions,
1483
+ campaign,
1484
+ canManage,
1485
+ onOpened,
1486
+ open,
1487
+ organization,
1488
+ params,
1489
+ sections,
1490
+ style
1491
+ }) => {
1492
+ var _a, _b;
1493
+ const queryClient = useQueryClient();
1494
+ const modal = useModal({
1495
+ queryClient
1496
+ });
1497
+ const [dragging, setDragging] = useState(false);
1498
+ const parts = formParts(sections);
1499
+ const { after, age, customs, information, location, order } = parts;
1500
+ const steps = [information, ...customs, order].filter(Boolean);
1501
+ const lastId = lastStepId(steps);
1502
+ const phone = asksPhone(steps);
1503
+ const texts = textsOn(organization);
1504
+ const currency = ((_a = organization == null ? void 0 : organization.defaults) == null ? void 0 : _a.currency) || "usd";
1505
+ const documents = useMemo(() => readableDocuments(campaign == null ? void 0 : campaign.agreements, texts), [campaign == null ? void 0 : campaign.agreements, texts]);
1506
+ useEffect(() => {
1507
+ if (open !== "footer") return;
1508
+ actions.footer({
1509
+ phone,
1510
+ texts
1511
+ });
1512
+ onOpened == null ? void 0 : onOpened();
1513
+ }, [open]);
1514
+ const choices = customs.map((section) => ({
1515
+ description: section.description,
1516
+ label: section.title,
1517
+ questions: (section.items || []).length,
1518
+ value: section.id
1519
+ }));
1520
+ const orderPlan = getPlanFeature(organization == null ? void 0 : organization.plan, fieldFeatures.order.key);
1521
+ const addOrder = {
1522
+ description: "Items to buy, last in the form",
1523
+ icon: ShoppingBag,
1524
+ onClick: actions.addOrder,
1525
+ title: "Order",
1526
+ ...!orderPlan.granted && {
1527
+ description: orderPlan.message,
1528
+ disabled: true,
1529
+ locked: true,
1530
+ upgrade: ((_b = organization == null ? void 0 : organization.capabilities) == null ? void 0 : _b.billing) === "manage" ? "/organizations/" + (params == null ? void 0 : params.organization) + "/billing" : null
1531
+ }
1532
+ };
1533
+ const addSection = (before) => ({
1534
+ description: customs.length >= MAX_SECTIONS ? "A form can have up to " + MAX_SECTIONS + " sections" : "A step with its own questions",
1535
+ disabled: customs.length >= MAX_SECTIONS,
1536
+ icon: RectangleStack,
1537
+ onClick: () => actions.addSection(before),
1538
+ title: "Section"
1539
+ });
1540
+ const addAge = {
1541
+ description: "Asks their age before the form",
1542
+ icon: Identification,
1543
+ onClick: actions.addAge,
1544
+ title: "Age gate"
1545
+ };
1546
+ const choose = (choices2) => () => modal.open({
1547
+ message: /* @__PURE__ */ jsx(
1548
+ SectionChoices,
1549
+ {
1550
+ ...{
1551
+ choices: choices2,
1552
+ onClose: () => modal.close()
1553
+ }
1554
+ }
1555
+ ),
1556
+ title: "Add section"
1557
+ });
1558
+ const middle = (before) => canManage && customs.length < MAX_SECTIONS ? choose([addSection(before)]) : null;
1559
+ const step = (section, fonts, handle, collapsed) => /* @__PURE__ */ jsx(
1560
+ Step,
1561
+ {
1562
+ ...{
1563
+ actions,
1564
+ campaign,
1565
+ canManage,
1566
+ collapsed,
1567
+ currency,
1568
+ fonts,
1569
+ handle,
1570
+ last: section.id === lastId,
1571
+ params,
1572
+ phone,
1573
+ section,
1574
+ sections: choices,
1575
+ style,
1576
+ texts
1577
+ }
1578
+ }
1579
+ );
1580
+ return /* @__PURE__ */ jsx(
1581
+ ProviderFont,
1582
+ {
1583
+ ...style,
1584
+ children: (fonts) => /* @__PURE__ */ jsxs(
1585
+ SliderLayout,
1586
+ {
1587
+ ...{
1588
+ blank: dragging,
1589
+ last: lastId,
1590
+ slides: formSlides(parts, documents.length > 0),
1591
+ style
1592
+ },
1593
+ children: [
1594
+ /* @__PURE__ */ jsx(
1595
+ Start,
1596
+ {
1597
+ ...{
1598
+ actions,
1599
+ campaign,
1600
+ fonts,
1601
+ style
1602
+ }
1603
+ }
1604
+ ),
1605
+ /* @__PURE__ */ jsx(Arrow, {}),
1606
+ location && /* @__PURE__ */ jsxs(Fragment, { children: [
1607
+ /* @__PURE__ */ jsx(
1608
+ Location,
1609
+ {
1610
+ ...{
1611
+ fonts,
1612
+ item: location,
1613
+ style
1614
+ }
1615
+ }
1616
+ ),
1617
+ /* @__PURE__ */ jsx(Arrow, {})
1618
+ ] }),
1619
+ /* @__PURE__ */ jsxs(
1620
+ CardSection,
1621
+ {
1622
+ ...{
1623
+ className: "shrink-0",
1624
+ "data-guide": "section-fields",
1625
+ title: "Fields",
1626
+ variant: "gray"
1627
+ },
1628
+ children: [
1629
+ !age && canManage && /* @__PURE__ */ jsx(
1630
+ Join,
1631
+ {
1632
+ ...{
1633
+ label: "Add an age gate",
1634
+ onAdd: choose([addAge]),
1635
+ start: true
1636
+ }
1637
+ }
1638
+ ),
1639
+ age && /* @__PURE__ */ jsx(
1640
+ AgeStep,
1641
+ {
1642
+ ...{
1643
+ actions,
1644
+ age,
1645
+ canManage,
1646
+ fonts,
1647
+ style
1648
+ }
1649
+ }
1650
+ ),
1651
+ information && /* @__PURE__ */ jsxs(Fragment, { children: [
1652
+ age && /* @__PURE__ */ jsx(Join, {}),
1653
+ step(information, fonts)
1654
+ ] }),
1655
+ /* @__PURE__ */ jsx(
1656
+ Sortable,
1657
+ {
1658
+ ...{
1659
+ disabled: !canManage,
1660
+ handleClassName: GRIP,
1661
+ handleLabel: (section) => "Move " + section.title,
1662
+ items: customs,
1663
+ onDragging: setDragging,
1664
+ onSort: (sorted) => actions.reorderSections(sorted.map((section) => section.id)),
1665
+ renderItem: (section, _index, handle) => /* @__PURE__ */ jsxs(Fragment, { children: [
1666
+ dragging ? /* @__PURE__ */ jsx(
1667
+ "div",
1668
+ {
1669
+ ...{
1670
+ className: "h-4"
1671
+ }
1672
+ }
1673
+ ) : /* @__PURE__ */ jsx(
1674
+ Join,
1675
+ {
1676
+ ...{
1677
+ label: "Add a section here",
1678
+ onAdd: middle(section.id)
1679
+ }
1680
+ }
1681
+ ),
1682
+ step(section, fonts, handle, dragging)
1683
+ ] }),
1684
+ sortableElement: "div"
1685
+ }
1686
+ }
1687
+ ),
1688
+ order && /* @__PURE__ */ jsxs(Fragment, { children: [
1689
+ dragging ? /* @__PURE__ */ jsx(
1690
+ "div",
1691
+ {
1692
+ ...{
1693
+ className: "h-4"
1694
+ }
1695
+ }
1696
+ ) : /* @__PURE__ */ jsx(
1697
+ Join,
1698
+ {
1699
+ ...{
1700
+ label: "Add a section here",
1701
+ onAdd: middle()
1702
+ }
1703
+ }
1704
+ ),
1705
+ step(order, fonts)
1706
+ ] }),
1707
+ !order && canManage && /* @__PURE__ */ jsx(
1708
+ Join,
1709
+ {
1710
+ ...{
1711
+ end: true,
1712
+ label: "Add an order or a section here",
1713
+ onAdd: choose([addOrder, addSection()])
1714
+ }
1715
+ }
1716
+ ),
1717
+ lastId && /* @__PURE__ */ jsx(
1718
+ Footer,
1719
+ {
1720
+ ...{
1721
+ actions,
1722
+ campaign,
1723
+ phone,
1724
+ texts
1725
+ }
1726
+ }
1727
+ ),
1728
+ documents.length > 0 && /* @__PURE__ */ jsx(
1729
+ Agreements,
1730
+ {
1731
+ ...{
1732
+ campaign,
1733
+ documents,
1734
+ fonts,
1735
+ style
1736
+ }
1737
+ }
1738
+ )
1739
+ ]
1740
+ }
1741
+ ),
1742
+ after && /* @__PURE__ */ jsxs(Fragment, { children: [
1743
+ /* @__PURE__ */ jsx(Arrow, {}),
1744
+ /* @__PURE__ */ jsx(
1745
+ After,
1746
+ {
1747
+ ...{
1748
+ actions,
1749
+ after,
1750
+ campaign,
1751
+ canManage,
1752
+ fonts,
1753
+ organization,
1754
+ params,
1755
+ style
1756
+ }
1757
+ }
1758
+ )
1759
+ ] })
1760
+ ]
1761
+ }
1762
+ )
1763
+ }
1764
+ );
1765
+ };
1766
+ var campaign_form_default = CampaignForm;
1767
+ export {
1768
+ campaign_form_default as default
1769
+ };