@makeswift/runtime 0.0.0-1faafb3 → 0.0.0-20221019211549

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 (619) hide show
  1. package/api.js +1 -0
  2. package/box-model.js +1 -0
  3. package/builder.js +1 -0
  4. package/components.js +1 -0
  5. package/controls.js +1 -0
  6. package/dist/Box.cjs.js +507 -0
  7. package/dist/Box.cjs.js.map +1 -0
  8. package/dist/Box.es.js +501 -0
  9. package/dist/Box.es.js.map +1 -0
  10. package/dist/Button.cjs.js +315 -0
  11. package/dist/Button.cjs.js.map +1 -0
  12. package/dist/Button.es.js +308 -0
  13. package/dist/Button.es.js.map +1 -0
  14. package/dist/Carousel.cjs.js +493 -0
  15. package/dist/Carousel.cjs.js.map +1 -0
  16. package/dist/Carousel.es.js +487 -0
  17. package/dist/Carousel.es.js.map +1 -0
  18. package/dist/Countdown.cjs.js +347 -0
  19. package/dist/Countdown.cjs.js.map +1 -0
  20. package/dist/Countdown.es.js +341 -0
  21. package/dist/Countdown.es.js.map +1 -0
  22. package/dist/Divider.cjs.js +122 -0
  23. package/dist/Divider.cjs.js.map +1 -0
  24. package/dist/Divider.es.js +116 -0
  25. package/dist/Divider.es.js.map +1 -0
  26. package/dist/Embed.cjs.js +136 -0
  27. package/dist/Embed.cjs.js.map +1 -0
  28. package/dist/Embed.es.js +130 -0
  29. package/dist/Embed.es.js.map +1 -0
  30. package/dist/Form.cjs.js +1731 -0
  31. package/dist/Form.cjs.js.map +1 -0
  32. package/dist/Form.es.js +1704 -0
  33. package/dist/Form.es.js.map +1 -0
  34. package/dist/Image.cjs2.js +155 -0
  35. package/dist/Image.cjs2.js.map +1 -0
  36. package/dist/Image.es2.js +148 -0
  37. package/dist/Image.es2.js.map +1 -0
  38. package/dist/Navigation.cjs.js +742 -0
  39. package/dist/Navigation.cjs.js.map +1 -0
  40. package/dist/Navigation.es.js +716 -0
  41. package/dist/Navigation.es.js.map +1 -0
  42. package/dist/Root.cjs.js +149 -0
  43. package/dist/Root.cjs.js.map +1 -0
  44. package/dist/Root.es.js +143 -0
  45. package/dist/Root.es.js.map +1 -0
  46. package/dist/SocialLinks.cjs.js +906 -0
  47. package/dist/SocialLinks.cjs.js.map +1 -0
  48. package/dist/SocialLinks.es.js +880 -0
  49. package/dist/SocialLinks.es.js.map +1 -0
  50. package/dist/Text.cjs.js +482 -0
  51. package/dist/Text.cjs.js.map +1 -0
  52. package/dist/Text.es.js +474 -0
  53. package/dist/Text.es.js.map +1 -0
  54. package/dist/Video.cjs.js +128 -0
  55. package/dist/Video.cjs.js.map +1 -0
  56. package/dist/Video.es.js +121 -0
  57. package/dist/Video.es.js.map +1 -0
  58. package/dist/actions.cjs.js +140 -17
  59. package/dist/actions.cjs.js.map +1 -1
  60. package/dist/actions.es.js +122 -16
  61. package/dist/actions.es.js.map +1 -1
  62. package/dist/api.cjs.js +6 -0
  63. package/dist/api.cjs.js.map +1 -0
  64. package/dist/api.es.js +3 -0
  65. package/dist/api.es.js.map +1 -0
  66. package/dist/box-model.cjs.js +2 -2
  67. package/dist/box-model.es.js +1 -0
  68. package/dist/box-model.es.js.map +1 -1
  69. package/dist/box-models.cjs.js +28 -156
  70. package/dist/box-models.cjs.js.map +1 -1
  71. package/dist/box-models.es.js +31 -159
  72. package/dist/box-models.es.js.map +1 -1
  73. package/dist/builder.cjs.js +13 -0
  74. package/dist/builder.cjs.js.map +1 -0
  75. package/dist/builder.es.js +4 -0
  76. package/dist/builder.es.js.map +1 -0
  77. package/dist/color.cjs.js +8 -0
  78. package/dist/color.cjs.js.map +1 -0
  79. package/dist/color.es.js +6 -0
  80. package/dist/color.es.js.map +1 -0
  81. package/dist/components.cjs.js +107 -6901
  82. package/dist/components.cjs.js.map +1 -1
  83. package/dist/components.es.js +66 -6866
  84. package/dist/components.es.js.map +1 -1
  85. package/dist/constants.cjs.js +15 -0
  86. package/dist/constants.cjs.js.map +1 -0
  87. package/dist/constants.es.js +14 -0
  88. package/dist/constants.es.js.map +1 -0
  89. package/dist/control-serialization.cjs.js +485 -0
  90. package/dist/control-serialization.cjs.js.map +1 -0
  91. package/dist/control-serialization.es.js +478 -0
  92. package/dist/control-serialization.es.js.map +1 -0
  93. package/dist/controls.cjs.js +38 -0
  94. package/dist/controls.cjs.js.map +1 -0
  95. package/dist/controls.es.js +6 -0
  96. package/dist/controls.es.js.map +1 -0
  97. package/dist/cssMediaRules.cjs.js +210 -0
  98. package/dist/cssMediaRules.cjs.js.map +1 -0
  99. package/dist/cssMediaRules.es.js +201 -0
  100. package/dist/cssMediaRules.es.js.map +1 -0
  101. package/dist/graphql.cjs.js +365 -0
  102. package/dist/graphql.cjs.js.map +1 -0
  103. package/dist/graphql.es.js +356 -0
  104. package/dist/graphql.es.js.map +1 -0
  105. package/dist/image.cjs.js +282 -0
  106. package/dist/image.cjs.js.map +1 -0
  107. package/dist/image.es.js +240 -0
  108. package/dist/image.es.js.map +1 -0
  109. package/dist/index.cjs.js +3211 -0
  110. package/dist/index.cjs.js.map +1 -0
  111. package/dist/index.cjs2.js +522 -0
  112. package/dist/index.cjs2.js.map +1 -0
  113. package/dist/index.cjs3.js +146 -0
  114. package/dist/index.cjs3.js.map +1 -0
  115. package/dist/index.cjs4.js +18 -0
  116. package/dist/index.cjs4.js.map +1 -0
  117. package/dist/index.es.js +3104 -0
  118. package/dist/index.es.js.map +1 -0
  119. package/dist/index.es2.js +514 -0
  120. package/dist/index.es2.js.map +1 -0
  121. package/dist/index.es3.js +140 -0
  122. package/dist/index.es3.js.map +1 -0
  123. package/dist/index.es4.js +13 -0
  124. package/dist/index.es4.js.map +1 -0
  125. package/dist/main.cjs.js +16 -2
  126. package/dist/main.cjs.js.map +1 -1
  127. package/dist/main.es.js +7 -1
  128. package/dist/main.es.js.map +1 -1
  129. package/dist/next.cjs.js +432 -0
  130. package/dist/next.cjs.js.map +1 -0
  131. package/dist/next.es.js +416 -0
  132. package/dist/next.es.js.map +1 -0
  133. package/dist/placeholders.cjs.js +13 -0
  134. package/dist/placeholders.cjs.js.map +1 -0
  135. package/dist/placeholders.es.js +12 -0
  136. package/dist/placeholders.es.js.map +1 -0
  137. package/dist/prop-controllers.cjs.js +6 -175
  138. package/dist/prop-controllers.cjs.js.map +1 -1
  139. package/dist/prop-controllers.es.js +2 -173
  140. package/dist/prop-controllers.es.js.map +1 -1
  141. package/dist/react-builder-preview.cjs.js +257 -4138
  142. package/dist/react-builder-preview.cjs.js.map +1 -1
  143. package/dist/react-builder-preview.es.js +249 -4134
  144. package/dist/react-builder-preview.es.js.map +1 -1
  145. package/dist/react-page.cjs.js +602 -0
  146. package/dist/react-page.cjs.js.map +1 -0
  147. package/dist/react-page.es.js +566 -0
  148. package/dist/react-page.es.js.map +1 -0
  149. package/dist/react.cjs.js +41 -7
  150. package/dist/react.cjs.js.map +1 -1
  151. package/dist/react.es.js +33 -1
  152. package/dist/react.es.js.map +1 -1
  153. package/dist/shape.cjs.js +20 -0
  154. package/dist/shape.cjs.js.map +1 -0
  155. package/dist/shape.es.js +14 -0
  156. package/dist/shape.es.js.map +1 -0
  157. package/dist/slot.cjs.js +130 -0
  158. package/dist/slot.cjs.js.map +1 -0
  159. package/dist/slot.es.js +123 -0
  160. package/dist/slot.es.js.map +1 -0
  161. package/dist/text-input.cjs.js +38 -0
  162. package/dist/text-input.cjs.js.map +1 -0
  163. package/dist/text-input.es.js +26 -0
  164. package/dist/text-input.es.js.map +1 -0
  165. package/dist/types/src/api/constants.d.ts +4 -0
  166. package/dist/types/src/api/constants.d.ts.map +1 -0
  167. package/dist/types/src/api/generated/graphql.d.ts +175 -0
  168. package/dist/types/src/api/generated/graphql.d.ts.map +1 -0
  169. package/dist/types/src/api/index.d.ts +3 -0
  170. package/dist/types/src/api/index.d.ts.map +1 -0
  171. package/dist/types/src/api/introspection.d.ts +10 -0
  172. package/dist/types/src/api/introspection.d.ts.map +1 -0
  173. package/dist/types/src/api/react.d.ts +27 -0
  174. package/dist/types/src/api/react.d.ts.map +1 -0
  175. package/dist/types/src/api/types.d.ts +4 -0
  176. package/dist/types/src/api/types.d.ts.map +1 -0
  177. package/dist/types/src/box-model.d.ts +3 -0
  178. package/dist/types/src/box-model.d.ts.map +1 -0
  179. package/dist/types/src/builder/index.d.ts +2 -0
  180. package/dist/types/src/builder/index.d.ts.map +1 -0
  181. package/dist/types/src/builder/serialization/control-serialization.d.ts +301 -0
  182. package/dist/types/src/builder/serialization/control-serialization.d.ts.map +1 -0
  183. package/dist/types/src/builder/serialization/controls/combobox.d.ts +5 -0
  184. package/dist/types/src/builder/serialization/controls/combobox.d.ts.map +1 -0
  185. package/dist/types/src/builder/serialization/controls/list.d.ts +5 -0
  186. package/dist/types/src/builder/serialization/controls/list.d.ts.map +1 -0
  187. package/dist/types/src/builder/serialization/controls/shape.d.ts +5 -0
  188. package/dist/types/src/builder/serialization/controls/shape.d.ts.map +1 -0
  189. package/dist/types/src/builder/serialization/controls/types.d.ts +10 -0
  190. package/dist/types/src/builder/serialization/controls/types.d.ts.map +1 -0
  191. package/dist/types/src/builder/serialization/function-serialization.d.ts +12 -0
  192. package/dist/types/src/builder/serialization/function-serialization.d.ts.map +1 -0
  193. package/dist/types/src/builder/serialization/index.d.ts +4 -0
  194. package/dist/types/src/builder/serialization/index.d.ts.map +1 -0
  195. package/dist/types/{components → src/components/builtin}/Box/Box.d.ts +8 -5
  196. package/dist/types/src/components/builtin/Box/Box.d.ts.map +1 -0
  197. package/dist/types/{components → src/components/builtin}/Box/animations.d.ts +3 -10
  198. package/dist/types/src/components/builtin/Box/animations.d.ts.map +1 -0
  199. package/dist/types/{components → src/components/builtin}/Box/components/Placeholder/index.d.ts +0 -0
  200. package/dist/types/src/components/builtin/Box/components/Placeholder/index.d.ts.map +1 -0
  201. package/dist/types/src/components/builtin/Box/constants.d.ts +9 -0
  202. package/dist/types/src/components/builtin/Box/constants.d.ts.map +1 -0
  203. package/dist/types/{components → src/components/builtin}/Box/index.d.ts +1 -1
  204. package/dist/types/src/components/builtin/Box/index.d.ts.map +1 -0
  205. package/dist/types/src/components/builtin/Box/register.d.ts +3 -0
  206. package/dist/types/src/components/builtin/Box/register.d.ts.map +1 -0
  207. package/dist/types/src/components/builtin/Button/Button.d.ts +117 -0
  208. package/dist/types/src/components/builtin/Button/Button.d.ts.map +1 -0
  209. package/dist/types/src/components/builtin/Button/contants.d.ts +2 -0
  210. package/dist/types/src/components/builtin/Button/contants.d.ts.map +1 -0
  211. package/dist/types/src/components/builtin/Button/index.d.ts +2 -0
  212. package/dist/types/src/components/builtin/Button/index.d.ts.map +1 -0
  213. package/dist/types/src/components/builtin/Button/register.d.ts +3 -0
  214. package/dist/types/src/components/builtin/Button/register.d.ts.map +1 -0
  215. package/dist/types/src/components/builtin/Carousel/Carousel.d.ts +26 -0
  216. package/dist/types/src/components/builtin/Carousel/Carousel.d.ts.map +1 -0
  217. package/dist/types/src/components/builtin/Carousel/index.d.ts +2 -0
  218. package/dist/types/src/components/builtin/Carousel/index.d.ts.map +1 -0
  219. package/dist/types/src/components/builtin/Carousel/register.d.ts +3 -0
  220. package/dist/types/src/components/builtin/Carousel/register.d.ts.map +1 -0
  221. package/dist/types/src/components/builtin/Countdown/Countdown.d.ts +25 -0
  222. package/dist/types/src/components/builtin/Countdown/Countdown.d.ts.map +1 -0
  223. package/dist/types/src/components/builtin/Countdown/index.d.ts +2 -0
  224. package/dist/types/src/components/builtin/Countdown/index.d.ts.map +1 -0
  225. package/dist/types/src/components/builtin/Countdown/register.d.ts +3 -0
  226. package/dist/types/src/components/builtin/Countdown/register.d.ts.map +1 -0
  227. package/dist/types/src/components/builtin/Divider/Divider.d.ts +15 -0
  228. package/dist/types/src/components/builtin/Divider/Divider.d.ts.map +1 -0
  229. package/dist/types/src/components/builtin/Divider/index.d.ts +2 -0
  230. package/dist/types/src/components/builtin/Divider/index.d.ts.map +1 -0
  231. package/dist/types/src/components/builtin/Divider/register.d.ts +3 -0
  232. package/dist/types/src/components/builtin/Divider/register.d.ts.map +1 -0
  233. package/dist/types/src/components/builtin/Embed/Embed.d.ts +11 -0
  234. package/dist/types/src/components/builtin/Embed/Embed.d.ts.map +1 -0
  235. package/dist/types/src/components/builtin/Embed/index.d.ts +2 -0
  236. package/dist/types/src/components/builtin/Embed/index.d.ts.map +1 -0
  237. package/dist/types/src/components/builtin/Embed/register.d.ts +3 -0
  238. package/dist/types/src/components/builtin/Embed/register.d.ts.map +1 -0
  239. package/dist/types/src/components/builtin/Form/Form.d.ts +33 -0
  240. package/dist/types/src/components/builtin/Form/Form.d.ts.map +1 -0
  241. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts +15 -0
  242. package/dist/types/src/components/builtin/Form/components/Field/components/Checkbox/index.d.ts.map +1 -0
  243. package/dist/types/src/components/builtin/Form/components/Field/components/CheckboxTableField/index.d.ts +15 -0
  244. package/dist/types/src/components/builtin/Form/components/Field/components/CheckboxTableField/index.d.ts.map +1 -0
  245. package/dist/types/src/components/builtin/Form/components/Field/components/EmailTableField/index.d.ts +11 -0
  246. package/dist/types/src/components/builtin/Form/components/Field/components/EmailTableField/index.d.ts.map +1 -0
  247. package/dist/types/src/components/builtin/Form/components/Field/components/Input/index.d.ts +14 -0
  248. package/dist/types/src/components/builtin/Form/components/Field/components/Input/index.d.ts.map +1 -0
  249. package/dist/types/src/components/builtin/Form/components/Field/components/Label/index.d.ts +16 -0
  250. package/dist/types/src/components/builtin/Form/components/Field/components/Label/index.d.ts.map +1 -0
  251. package/dist/types/src/components/builtin/Form/components/Field/components/LongTextTableField/index.d.ts +10 -0
  252. package/dist/types/src/components/builtin/Form/components/Field/components/LongTextTableField/index.d.ts.map +1 -0
  253. package/dist/types/src/components/builtin/Form/components/Field/components/MultipleSelectTableField/index.d.ts +23 -0
  254. package/dist/types/src/components/builtin/Form/components/Field/components/MultipleSelectTableField/index.d.ts.map +1 -0
  255. package/dist/types/src/components/builtin/Form/components/Field/components/NumberTableField/index.d.ts +11 -0
  256. package/dist/types/src/components/builtin/Form/components/Field/components/NumberTableField/index.d.ts.map +1 -0
  257. package/dist/types/src/components/builtin/Form/components/Field/components/PhoneNumberTableField/index.d.ts +11 -0
  258. package/dist/types/src/components/builtin/Form/components/Field/components/PhoneNumberTableField/index.d.ts.map +1 -0
  259. package/dist/types/src/components/builtin/Form/components/Field/components/PlaceholderTableField/index.d.ts +3 -0
  260. package/dist/types/src/components/builtin/Form/components/Field/components/PlaceholderTableField/index.d.ts.map +1 -0
  261. package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts +17 -0
  262. package/dist/types/src/components/builtin/Form/components/Field/components/RadioButton/index.d.ts.map +1 -0
  263. package/dist/types/src/components/builtin/Form/components/Field/components/SingleLineTextTableField/index.d.ts +11 -0
  264. package/dist/types/src/components/builtin/Form/components/Field/components/SingleLineTextTableField/index.d.ts.map +1 -0
  265. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnRadioButtonGroup/index.d.ts +23 -0
  266. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnRadioButtonGroup/index.d.ts.map +1 -0
  267. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnSingleSelect/index.d.ts +19 -0
  268. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/components/TableColumnSingleSelect/index.d.ts.map +1 -0
  269. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/index.d.ts +24 -0
  270. package/dist/types/src/components/builtin/Form/components/Field/components/SingleSelectTableField/index.d.ts.map +1 -0
  271. package/dist/types/src/components/builtin/Form/components/Field/components/TextArea/index.d.ts +13 -0
  272. package/dist/types/src/components/builtin/Form/components/Field/components/TextArea/index.d.ts.map +1 -0
  273. package/dist/types/src/components/builtin/Form/components/Field/components/URLTableField/index.d.ts +11 -0
  274. package/dist/types/src/components/builtin/Form/components/Field/components/URLTableField/index.d.ts.map +1 -0
  275. package/dist/types/src/components/builtin/Form/components/Field/index.d.ts +19 -0
  276. package/dist/types/src/components/builtin/Form/components/Field/index.d.ts.map +1 -0
  277. package/dist/types/src/components/builtin/Form/components/Field/services/cssField.d.ts +11 -0
  278. package/dist/types/src/components/builtin/Form/components/Field/services/cssField.d.ts.map +1 -0
  279. package/dist/types/src/components/builtin/Form/components/Placeholder/index.d.ts +10 -0
  280. package/dist/types/src/components/builtin/Form/components/Placeholder/index.d.ts.map +1 -0
  281. package/dist/types/src/components/builtin/Form/components/Spinner/index.d.ts +3 -0
  282. package/dist/types/src/components/builtin/Form/components/Spinner/index.d.ts.map +1 -0
  283. package/dist/types/src/components/builtin/Form/context/FormContext.d.ts +39 -0
  284. package/dist/types/src/components/builtin/Form/context/FormContext.d.ts.map +1 -0
  285. package/dist/types/src/components/builtin/Form/index.d.ts +2 -0
  286. package/dist/types/src/components/builtin/Form/index.d.ts.map +1 -0
  287. package/dist/types/src/components/builtin/Form/register.d.ts +3 -0
  288. package/dist/types/src/components/builtin/Form/register.d.ts.map +1 -0
  289. package/dist/types/src/components/builtin/Form/types.d.ts +62 -0
  290. package/dist/types/src/components/builtin/Form/types.d.ts.map +1 -0
  291. package/dist/types/src/components/builtin/Image/Image.d.ts +26 -0
  292. package/dist/types/src/components/builtin/Image/Image.d.ts.map +1 -0
  293. package/dist/types/src/components/builtin/Image/index.d.ts +2 -0
  294. package/dist/types/src/components/builtin/Image/index.d.ts.map +1 -0
  295. package/dist/types/src/components/builtin/Image/register.d.ts +3 -0
  296. package/dist/types/src/components/builtin/Image/register.d.ts.map +1 -0
  297. package/dist/types/src/components/builtin/Navigation/Navigation.d.ts +24 -0
  298. package/dist/types/src/components/builtin/Navigation/Navigation.d.ts.map +1 -0
  299. package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts +100 -0
  300. package/dist/types/src/components/builtin/Navigation/components/DropDownButton/index.d.ts.map +1 -0
  301. package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts +8 -0
  302. package/dist/types/src/components/builtin/Navigation/components/LinksPlaceholder/index.d.ts.map +1 -0
  303. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts +101 -0
  304. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/components/MobileDropDownButton/index.d.ts.map +1 -0
  305. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts +14 -0
  306. package/dist/types/src/components/builtin/Navigation/components/MobileMenu/index.d.ts.map +1 -0
  307. package/dist/types/src/components/builtin/Navigation/index.d.ts +2 -0
  308. package/dist/types/src/components/builtin/Navigation/index.d.ts.map +1 -0
  309. package/dist/types/src/components/builtin/Navigation/register.d.ts +3 -0
  310. package/dist/types/src/components/builtin/Navigation/register.d.ts.map +1 -0
  311. package/dist/types/src/components/builtin/Root/Root.d.ts +12 -0
  312. package/dist/types/src/components/builtin/Root/Root.d.ts.map +1 -0
  313. package/dist/types/{components → src/components/builtin}/Root/components/Placeholder/index.d.ts +0 -0
  314. package/dist/types/src/components/builtin/Root/components/Placeholder/index.d.ts.map +1 -0
  315. package/dist/types/{components → src/components/builtin}/Root/index.d.ts +0 -0
  316. package/dist/types/src/components/builtin/Root/index.d.ts.map +1 -0
  317. package/dist/types/src/components/builtin/Root/register.d.ts +3 -0
  318. package/dist/types/src/components/builtin/Root/register.d.ts.map +1 -0
  319. package/dist/types/src/components/builtin/SocialLinks/SocialLinks.d.ts +19 -0
  320. package/dist/types/src/components/builtin/SocialLinks/SocialLinks.d.ts.map +1 -0
  321. package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts +8 -0
  322. package/dist/types/src/components/builtin/SocialLinks/components/SocialLinksPlaceholder/index.d.ts.map +1 -0
  323. package/dist/types/src/components/builtin/SocialLinks/index.d.ts +2 -0
  324. package/dist/types/src/components/builtin/SocialLinks/index.d.ts.map +1 -0
  325. package/dist/types/src/components/builtin/SocialLinks/options.d.ts +118 -0
  326. package/dist/types/src/components/builtin/SocialLinks/options.d.ts.map +1 -0
  327. package/dist/types/src/components/builtin/SocialLinks/register.d.ts +3 -0
  328. package/dist/types/src/components/builtin/SocialLinks/register.d.ts.map +1 -0
  329. package/dist/types/src/components/builtin/Text/Text.d.ts +16 -0
  330. package/dist/types/src/components/builtin/Text/Text.d.ts.map +1 -0
  331. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Block/index.d.ts +13 -0
  332. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Block/index.d.ts.map +1 -0
  333. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Mark/hooks/useTypographyMark.d.ts +25 -0
  334. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Mark/hooks/useTypographyMark.d.ts.map +1 -0
  335. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Mark/index.d.ts +13 -0
  336. package/dist/types/src/components/builtin/Text/components/RichTextEditor/components/Mark/index.d.ts.map +1 -0
  337. package/dist/types/src/components/builtin/Text/components/RichTextEditor/index.d.ts +5 -0
  338. package/dist/types/src/components/builtin/Text/components/RichTextEditor/index.d.ts.map +1 -0
  339. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesBlocks.d.ts +3 -0
  340. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesBlocks.d.ts.map +1 -0
  341. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesMarks.d.ts +3 -0
  342. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/DeviceOverridesMarks.d.ts.map +1 -0
  343. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/Inlines.d.ts +3 -0
  344. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/Inlines.d.ts.map +1 -0
  345. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/Link.d.ts +3 -0
  346. package/dist/types/src/components/builtin/Text/components/RichTextEditor/plugins/Link.d.ts.map +1 -0
  347. package/dist/types/src/components/builtin/Text/index.d.ts +2 -0
  348. package/dist/types/src/components/builtin/Text/index.d.ts.map +1 -0
  349. package/dist/types/src/components/builtin/Text/register.d.ts +3 -0
  350. package/dist/types/src/components/builtin/Text/register.d.ts.map +1 -0
  351. package/dist/types/src/components/builtin/Video/Video.d.ts +12 -0
  352. package/dist/types/src/components/builtin/Video/Video.d.ts.map +1 -0
  353. package/dist/types/src/components/builtin/Video/index.d.ts +2 -0
  354. package/dist/types/src/components/builtin/Video/index.d.ts.map +1 -0
  355. package/dist/types/src/components/builtin/Video/register.d.ts +3 -0
  356. package/dist/types/src/components/builtin/Video/register.d.ts.map +1 -0
  357. package/dist/types/src/components/builtin/constants.d.ts +20 -0
  358. package/dist/types/src/components/builtin/constants.d.ts.map +1 -0
  359. package/dist/types/src/components/builtin/index.d.ts +16 -0
  360. package/dist/types/src/components/builtin/index.d.ts.map +1 -0
  361. package/dist/types/src/components/builtin/register.d.ts +3 -0
  362. package/dist/types/src/components/builtin/register.d.ts.map +1 -0
  363. package/dist/types/src/components/hooks/index.d.ts +8 -0
  364. package/dist/types/src/components/hooks/index.d.ts.map +1 -0
  365. package/dist/types/src/components/hooks/useBackgrounds.d.ts +59 -0
  366. package/dist/types/src/components/hooks/useBackgrounds.d.ts.map +1 -0
  367. package/dist/types/src/components/hooks/useBorder.d.ts +19 -0
  368. package/dist/types/src/components/hooks/useBorder.d.ts.map +1 -0
  369. package/dist/types/src/components/hooks/useBoxShadow.d.ts +19 -0
  370. package/dist/types/src/components/hooks/useBoxShadow.d.ts.map +1 -0
  371. package/dist/types/src/components/hooks/useFile.d.ts +13 -0
  372. package/dist/types/src/components/hooks/useFile.d.ts.map +1 -0
  373. package/dist/types/src/components/hooks/useIsomorphicLayoutEffect.d.ts +3 -0
  374. package/dist/types/src/components/hooks/useIsomorphicLayoutEffect.d.ts.map +1 -0
  375. package/dist/types/{components → src/components}/hooks/useMediaQuery.d.ts +0 -0
  376. package/dist/types/src/components/hooks/useMediaQuery.d.ts.map +1 -0
  377. package/dist/types/src/components/hooks/usePage.d.ts +7 -0
  378. package/dist/types/src/components/hooks/usePage.d.ts.map +1 -0
  379. package/dist/types/src/components/hooks/useResponsiveColor.d.ts +7 -0
  380. package/dist/types/src/components/hooks/useResponsiveColor.d.ts.map +1 -0
  381. package/dist/types/src/components/hooks/useTableFormFieldRefs.d.ts +8 -0
  382. package/dist/types/src/components/hooks/useTableFormFieldRefs.d.ts.map +1 -0
  383. package/dist/types/src/components/hooks/useTypography.d.ts +24 -0
  384. package/dist/types/src/components/hooks/useTypography.d.ts.map +1 -0
  385. package/dist/types/src/components/index.d.ts +5 -0
  386. package/dist/types/src/components/index.d.ts.map +1 -0
  387. package/dist/types/src/components/page/BodySnippet.d.ts +7 -0
  388. package/dist/types/src/components/page/BodySnippet.d.ts.map +1 -0
  389. package/dist/types/src/components/page/Page.d.ts +28 -0
  390. package/dist/types/src/components/page/Page.d.ts.map +1 -0
  391. package/dist/types/src/components/page/index.d.ts +2 -0
  392. package/dist/types/src/components/page/index.d.ts.map +1 -0
  393. package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts +11 -0
  394. package/dist/types/src/components/shared/BackgroundsContainer/components/BackgroundVideo/index.d.ts.map +1 -0
  395. package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts +8 -0
  396. package/dist/types/src/components/shared/BackgroundsContainer/components/Backgrounds/index.d.ts.map +1 -0
  397. package/dist/types/src/components/shared/BackgroundsContainer/components/Parallax/index.d.ts +11 -0
  398. package/dist/types/src/components/shared/BackgroundsContainer/components/Parallax/index.d.ts.map +1 -0
  399. package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts +11 -0
  400. package/dist/types/src/components/shared/BackgroundsContainer/index.d.ts.map +1 -0
  401. package/dist/types/src/components/shared/FallbackComponent/FallbackComponent.d.ts +7 -0
  402. package/dist/types/src/components/shared/FallbackComponent/FallbackComponent.d.ts.map +1 -0
  403. package/dist/types/src/components/shared/FallbackComponent/index.d.ts +2 -0
  404. package/dist/types/src/components/shared/FallbackComponent/index.d.ts.map +1 -0
  405. package/dist/types/src/components/shared/GutterContainer/index.d.ts +8 -0
  406. package/dist/types/src/components/shared/GutterContainer/index.d.ts.map +1 -0
  407. package/dist/types/src/components/shared/Link/index.d.ts +9 -0
  408. package/dist/types/src/components/shared/Link/index.d.ts.map +1 -0
  409. package/dist/types/src/components/utils/colorToString.d.ts +3 -0
  410. package/dist/types/src/components/utils/colorToString.d.ts.map +1 -0
  411. package/dist/types/{components → src/components}/utils/columns.d.ts +0 -0
  412. package/dist/types/src/components/utils/columns.d.ts.map +1 -0
  413. package/dist/types/{components → src/components}/utils/cssMediaRules.d.ts +23 -1
  414. package/dist/types/src/components/utils/cssMediaRules.d.ts.map +1 -0
  415. package/dist/types/{components → src/components}/utils/devices.d.ts +1 -0
  416. package/dist/types/src/components/utils/devices.d.ts.map +1 -0
  417. package/dist/types/src/components/utils/isNonNullable.d.ts +2 -0
  418. package/dist/types/src/components/utils/isNonNullable.d.ts.map +1 -0
  419. package/dist/types/src/components/utils/placeholders.d.ts +17 -0
  420. package/dist/types/src/components/utils/placeholders.d.ts.map +1 -0
  421. package/dist/types/src/components/utils/queries.d.ts +10 -0
  422. package/dist/types/src/components/utils/queries.d.ts.map +1 -0
  423. package/dist/types/src/components/utils/responsive-style.d.ts +9 -0
  424. package/dist/types/src/components/utils/responsive-style.d.ts.map +1 -0
  425. package/dist/types/src/components/utils/types.d.ts +10 -0
  426. package/dist/types/src/components/utils/types.d.ts.map +1 -0
  427. package/dist/types/src/controls/checkbox.d.ts +13 -0
  428. package/dist/types/src/controls/checkbox.d.ts.map +1 -0
  429. package/dist/types/src/controls/color.d.ts +16 -0
  430. package/dist/types/src/controls/color.d.ts.map +1 -0
  431. package/dist/types/src/controls/combobox.d.ts +22 -0
  432. package/dist/types/src/controls/combobox.d.ts.map +1 -0
  433. package/dist/types/src/controls/control.d.ts +14 -0
  434. package/dist/types/src/controls/control.d.ts.map +1 -0
  435. package/dist/types/src/controls/image.d.ts +24 -0
  436. package/dist/types/src/controls/image.d.ts.map +1 -0
  437. package/dist/types/src/controls/index.d.ts +15 -0
  438. package/dist/types/src/controls/index.d.ts.map +1 -0
  439. package/dist/types/src/controls/link.d.ts +50 -0
  440. package/dist/types/src/controls/link.d.ts.map +1 -0
  441. package/dist/types/src/controls/list.d.ts +26 -0
  442. package/dist/types/src/controls/list.d.ts.map +1 -0
  443. package/dist/types/src/controls/number.d.ts +18 -0
  444. package/dist/types/src/controls/number.d.ts.map +1 -0
  445. package/dist/types/src/controls/select.d.ts +22 -0
  446. package/dist/types/src/controls/select.d.ts.map +1 -0
  447. package/dist/types/src/controls/shape.d.ts +15 -0
  448. package/dist/types/src/controls/shape.d.ts.map +1 -0
  449. package/dist/types/src/controls/slot.d.ts +42 -0
  450. package/dist/types/src/controls/slot.d.ts.map +1 -0
  451. package/dist/types/src/controls/style.d.ts +206 -0
  452. package/dist/types/src/controls/style.d.ts.map +1 -0
  453. package/dist/types/src/controls/text-area.d.ts +14 -0
  454. package/dist/types/src/controls/text-area.d.ts.map +1 -0
  455. package/dist/types/src/controls/text-input.d.ts +13 -0
  456. package/dist/types/src/controls/text-input.d.ts.map +1 -0
  457. package/dist/types/src/controls/types.d.ts +14 -0
  458. package/dist/types/src/controls/types.d.ts.map +1 -0
  459. package/dist/types/{index.d.ts → src/index.d.ts} +3 -1
  460. package/dist/types/src/index.d.ts.map +1 -0
  461. package/dist/types/src/next/api-handler.d.ts +31 -0
  462. package/dist/types/src/next/api-handler.d.ts.map +1 -0
  463. package/dist/types/src/next/client.d.ts +68 -0
  464. package/dist/types/src/next/client.d.ts.map +1 -0
  465. package/dist/types/src/next/document.d.ts +7 -0
  466. package/dist/types/src/next/document.d.ts.map +1 -0
  467. package/dist/types/src/next/dynamic.d.ts +13 -0
  468. package/dist/types/src/next/dynamic.d.ts.map +1 -0
  469. package/dist/types/src/next/index.d.ts +24 -0
  470. package/dist/types/src/next/index.d.ts.map +1 -0
  471. package/dist/types/src/next/preview-mode.d.ts +11 -0
  472. package/dist/types/src/next/preview-mode.d.ts.map +1 -0
  473. package/dist/types/{prop-controllers → src/prop-controllers}/descriptors.d.ts +132 -45
  474. package/dist/types/src/prop-controllers/descriptors.d.ts.map +1 -0
  475. package/dist/types/src/prop-controllers/index.d.ts +5 -0
  476. package/dist/types/src/prop-controllers/index.d.ts.map +1 -0
  477. package/dist/types/src/prop-controllers/instances.d.ts +102 -0
  478. package/dist/types/src/prop-controllers/instances.d.ts.map +1 -0
  479. package/dist/types/src/prop-controllers/introspection.d.ts +10 -0
  480. package/dist/types/src/prop-controllers/introspection.d.ts.map +1 -0
  481. package/dist/types/src/react.d.ts +4 -0
  482. package/dist/types/src/react.d.ts.map +1 -0
  483. package/dist/types/src/runtimes/react/components/index.d.ts +2 -0
  484. package/dist/types/src/runtimes/react/components/index.d.ts.map +1 -0
  485. package/dist/types/src/runtimes/react/components/render-hook.d.ts +14 -0
  486. package/dist/types/src/runtimes/react/components/render-hook.d.ts.map +1 -0
  487. package/dist/types/src/runtimes/react/controls/checkbox.d.ts +4 -0
  488. package/dist/types/src/runtimes/react/controls/checkbox.d.ts.map +1 -0
  489. package/dist/types/src/runtimes/react/controls/color.d.ts +4 -0
  490. package/dist/types/src/runtimes/react/controls/color.d.ts.map +1 -0
  491. package/dist/types/src/runtimes/react/controls/combobox.d.ts +4 -0
  492. package/dist/types/src/runtimes/react/controls/combobox.d.ts.map +1 -0
  493. package/dist/types/src/runtimes/react/controls/control.d.ts +22 -0
  494. package/dist/types/src/runtimes/react/controls/control.d.ts.map +1 -0
  495. package/dist/types/src/runtimes/react/controls/image.d.ts +13 -0
  496. package/dist/types/src/runtimes/react/controls/image.d.ts.map +1 -0
  497. package/dist/types/src/runtimes/react/controls/link.d.ts +11 -0
  498. package/dist/types/src/runtimes/react/controls/link.d.ts.map +1 -0
  499. package/dist/types/src/runtimes/react/controls/list.d.ts +13 -0
  500. package/dist/types/src/runtimes/react/controls/list.d.ts.map +1 -0
  501. package/dist/types/src/runtimes/react/controls/number.d.ts +4 -0
  502. package/dist/types/src/runtimes/react/controls/number.d.ts.map +1 -0
  503. package/dist/types/src/runtimes/react/controls/select.d.ts +4 -0
  504. package/dist/types/src/runtimes/react/controls/select.d.ts.map +1 -0
  505. package/dist/types/src/runtimes/react/controls/shape.d.ts +14 -0
  506. package/dist/types/src/runtimes/react/controls/shape.d.ts.map +1 -0
  507. package/dist/types/src/runtimes/react/controls/slot.d.ts +30 -0
  508. package/dist/types/src/runtimes/react/controls/slot.d.ts.map +1 -0
  509. package/dist/types/src/runtimes/react/controls/style.d.ts +4 -0
  510. package/dist/types/src/runtimes/react/controls/style.d.ts.map +1 -0
  511. package/dist/types/src/runtimes/react/controls/text-area.d.ts +4 -0
  512. package/dist/types/src/runtimes/react/controls/text-area.d.ts.map +1 -0
  513. package/dist/types/src/runtimes/react/controls/text-input.d.ts +4 -0
  514. package/dist/types/src/runtimes/react/controls/text-input.d.ts.map +1 -0
  515. package/dist/types/src/runtimes/react/controls.d.ts +13 -0
  516. package/dist/types/src/runtimes/react/controls.d.ts.map +1 -0
  517. package/dist/types/src/runtimes/react/find-dom-node.d.ts +7 -0
  518. package/dist/types/src/runtimes/react/find-dom-node.d.ts.map +1 -0
  519. package/dist/types/src/runtimes/react/index.d.ts +48 -0
  520. package/dist/types/src/runtimes/react/index.d.ts.map +1 -0
  521. package/dist/types/src/runtimes/react/use-style.d.ts +3 -0
  522. package/dist/types/src/runtimes/react/use-style.d.ts.map +1 -0
  523. package/dist/types/src/state/actions.d.ts +291 -0
  524. package/dist/types/src/state/actions.d.ts.map +1 -0
  525. package/dist/types/{state → src/state}/modules/box-models.d.ts +5 -5
  526. package/dist/types/src/state/modules/box-models.d.ts.map +1 -0
  527. package/dist/types/{state → src/state}/modules/components-meta.d.ts +0 -0
  528. package/dist/types/src/state/modules/components-meta.d.ts.map +1 -0
  529. package/dist/types/src/state/modules/is-in-builder.d.ts +6 -0
  530. package/dist/types/src/state/modules/is-in-builder.d.ts.map +1 -0
  531. package/dist/types/src/state/modules/prop-controller-handles.d.ts +17 -0
  532. package/dist/types/src/state/modules/prop-controller-handles.d.ts.map +1 -0
  533. package/dist/types/{state → src/state}/modules/prop-controllers.d.ts +1 -0
  534. package/dist/types/src/state/modules/prop-controllers.d.ts.map +1 -0
  535. package/dist/types/{state → src/state}/modules/react-components.d.ts +4 -2
  536. package/dist/types/src/state/modules/react-components.d.ts.map +1 -0
  537. package/dist/types/{state → src/state}/modules/read-only-documents.d.ts +8 -4
  538. package/dist/types/src/state/modules/read-only-documents.d.ts.map +1 -0
  539. package/dist/types/{state → src/state}/modules/read-write-documents.d.ts +1 -1
  540. package/dist/types/src/state/modules/read-write-documents.d.ts.map +1 -0
  541. package/dist/types/{state → src/state}/react-builder-preview.d.ts +16 -11
  542. package/dist/types/src/state/react-builder-preview.d.ts.map +1 -0
  543. package/dist/types/src/state/react-page.d.ts +38 -0
  544. package/dist/types/src/state/react-page.d.ts.map +1 -0
  545. package/dist/types/src/utils/clamp.d.ts +3 -0
  546. package/dist/types/src/utils/clamp.d.ts.map +1 -0
  547. package/dist/types/src/utils/coalesce.d.ts +3 -0
  548. package/dist/types/src/utils/coalesce.d.ts.map +1 -0
  549. package/dist/types/src/utils/constants.d.ts +6 -0
  550. package/dist/types/src/utils/constants.d.ts.map +1 -0
  551. package/dist/types/{utils → src/utils}/deepEqual.d.ts +0 -0
  552. package/dist/types/src/utils/deepEqual.d.ts.map +1 -0
  553. package/dist/types/src/utils/intersection.d.ts +4 -0
  554. package/dist/types/src/utils/intersection.d.ts.map +1 -0
  555. package/dist/types/{utils → src/utils}/is.d.ts +0 -0
  556. package/dist/types/src/utils/is.d.ts.map +1 -0
  557. package/dist/types/src/utils/keys.d.ts +5 -0
  558. package/dist/types/src/utils/keys.d.ts.map +1 -0
  559. package/dist/types/{utils → src/utils}/shallowEqual.d.ts +0 -0
  560. package/dist/types/src/utils/shallowEqual.d.ts.map +1 -0
  561. package/dist/types/src/utils/shallowMerge.d.ts +2 -0
  562. package/dist/types/src/utils/shallowMerge.d.ts.map +1 -0
  563. package/dist/useBoxShadow.cjs.js +78 -0
  564. package/dist/useBoxShadow.cjs.js.map +1 -0
  565. package/dist/useBoxShadow.es.js +77 -0
  566. package/dist/useBoxShadow.es.js.map +1 -0
  567. package/dist/useMediaQuery.cjs.js +26 -0
  568. package/dist/useMediaQuery.cjs.js.map +1 -0
  569. package/dist/useMediaQuery.es.js +25 -0
  570. package/dist/useMediaQuery.es.js.map +1 -0
  571. package/next/plugin.js +1 -0
  572. package/next.js +1 -0
  573. package/package.json +105 -24
  574. package/prop-controllers.js +1 -0
  575. package/react.js +1 -0
  576. package/dist/react.cjs2.js +0 -835
  577. package/dist/react.cjs2.js.map +0 -1
  578. package/dist/react.es2.js +0 -810
  579. package/dist/react.es2.js.map +0 -1
  580. package/dist/types/box-model.d.ts +0 -3
  581. package/dist/types/box-model.d.ts.map +0 -1
  582. package/dist/types/components/Box/Box.d.ts.map +0 -1
  583. package/dist/types/components/Box/animations.d.ts.map +0 -1
  584. package/dist/types/components/Box/components/Placeholder/index.d.ts.map +0 -1
  585. package/dist/types/components/Box/index.d.ts.map +0 -1
  586. package/dist/types/components/Root/Root.d.ts +0 -11
  587. package/dist/types/components/Root/Root.d.ts.map +0 -1
  588. package/dist/types/components/Root/components/Placeholder/index.d.ts.map +0 -1
  589. package/dist/types/components/Root/index.d.ts.map +0 -1
  590. package/dist/types/components/hooks/index.d.ts +0 -2
  591. package/dist/types/components/hooks/index.d.ts.map +0 -1
  592. package/dist/types/components/hooks/useMediaQuery.d.ts.map +0 -1
  593. package/dist/types/components/index.d.ts +0 -4
  594. package/dist/types/components/index.d.ts.map +0 -1
  595. package/dist/types/components/utils/columns.d.ts.map +0 -1
  596. package/dist/types/components/utils/cssMediaRules.d.ts.map +0 -1
  597. package/dist/types/components/utils/devices.d.ts.map +0 -1
  598. package/dist/types/index.d.ts.map +0 -1
  599. package/dist/types/prop-controllers/descriptors.d.ts.map +0 -1
  600. package/dist/types/prop-controllers/index.d.ts +0 -3
  601. package/dist/types/prop-controllers/index.d.ts.map +0 -1
  602. package/dist/types/react.d.ts +0 -4
  603. package/dist/types/react.d.ts.map +0 -1
  604. package/dist/types/runtimes/react.d.ts +0 -28
  605. package/dist/types/runtimes/react.d.ts.map +0 -1
  606. package/dist/types/state/actions.d.ts +0 -124
  607. package/dist/types/state/actions.d.ts.map +0 -1
  608. package/dist/types/state/modules/box-models.d.ts.map +0 -1
  609. package/dist/types/state/modules/components-meta.d.ts.map +0 -1
  610. package/dist/types/state/modules/prop-controllers.d.ts.map +0 -1
  611. package/dist/types/state/modules/react-components.d.ts.map +0 -1
  612. package/dist/types/state/modules/read-only-documents.d.ts.map +0 -1
  613. package/dist/types/state/modules/read-write-documents.d.ts.map +0 -1
  614. package/dist/types/state/react-builder-preview.d.ts.map +0 -1
  615. package/dist/types/state/react-page.d.ts +0 -28
  616. package/dist/types/state/react-page.d.ts.map +0 -1
  617. package/dist/types/utils/deepEqual.d.ts.map +0 -1
  618. package/dist/types/utils/is.d.ts.map +0 -1
  619. package/dist/types/utils/shallowEqual.d.ts.map +0 -1
@@ -0,0 +1,3104 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ var __restKey = (key) => typeof key === "symbol" ? key : key + "";
21
+ var __objRest = (source, exclude) => {
22
+ var target = {};
23
+ for (var prop in source)
24
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
25
+ target[prop] = source[prop];
26
+ if (source != null && __getOwnPropSymbols)
27
+ for (var prop of __getOwnPropSymbols(source)) {
28
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
29
+ target[prop] = source[prop];
30
+ }
31
+ return target;
32
+ };
33
+ var __publicField = (obj, key, value) => {
34
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
35
+ return value;
36
+ };
37
+ var _e;
38
+ import * as React from "react";
39
+ import { useEffect, createContext, useContext, useState, useMemo, useRef, Children, createElement, forwardRef, useLayoutEffect, useCallback, Component, memo, useImperativeHandle } from "react";
40
+ import { useSyncExternalStoreWithSelector } from "use-sync-external-store/shim/with-selector";
41
+ import { g as getPropControllerDescriptors, i as isElementReference, a as getElementSwatchIds, b as getFileIds, d as getTypographyIds, e as getTableIds, f as getPageIds, h as getElementChildren, j as createDocumentReference, k as getComponentPropControllerDescriptors, l as getPropControllers, m as configureStore, n as getDocument, o as getElementId, p as getIsInBuilder, q as getReactComponent, c as createDocument } from "./react-page.es.js";
42
+ import { f as registerComponentHandleEffect, g as mountComponentEffect, h as registerComponentEffect, j as registerReactComponentEffect, k as registerDocumentEffect } from "./actions.es.js";
43
+ import dynamic from "next/dynamic";
44
+ import { gql, useQuery as useQuery$1, useMutation as useMutation$1, ApolloClient, InMemoryCache } from "@apollo/client";
45
+ import { BatchHttpLink } from "@apollo/client/link/batch-http";
46
+ import { KeyUtils } from "slate";
47
+ import { P as PagePathnameSliceFragmentDoc } from "./graphql.es.js";
48
+ import { T as Types, E as ElementID, B as Backgrounds, W as Width, R as ResponsiveIconRadioGroup, M as Margin, P as Padding, a as Border, b as BorderRadius, S as Shadows, G as GapY, c as GapX, e as ResponsiveSelect, f as ResponsiveNumber, C as Checkbox, g as Grid, h as TextInput, L as Link, i as ResponsiveColor, j as TextStyle, k as Images, N as Number, D as Date$1, F as Font, l as ResponsiveLength, m as TextArea, n as Table, o as TableFormFields, p as Image, q as ResponsiveOpacity, r as NavigationLinks, s as SocialLinks, t as RichText, V as Video, u as StyleControlProperty, v as ImageControlValueFormat, I as ImageControlType, w as StyleControlType, x as WidthControlValueFormats } from "./image.es.js";
49
+ import { S as ShapeControlType, L as ListControlType, C as ComboboxControlType } from "./shape.es.js";
50
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
51
+ import styled from "styled-components";
52
+ import { L as LinkControlType, S as SelectControlType, T as TextAreaControlType, a as TextInputControlType, N as NumberControlType, C as CheckboxControlType } from "./text-input.es.js";
53
+ import { C as ColorControlType } from "./color.es.js";
54
+ import { S as SlotControlType } from "./slot.es.js";
55
+ import { cache, cx, css } from "@emotion/css";
56
+ import ColorHelper from "color";
57
+ import scrollIntoView from "scroll-into-view-if-needed";
58
+ import { g as getBox } from "./box-models.es.js";
59
+ import { findDOMNode } from "react-dom";
60
+ import parse from "html-react-parser";
61
+ import Head from "next/head";
62
+ import "@emotion/server/create-instance";
63
+ import "next/document";
64
+ import "cookie";
65
+ import "cors";
66
+ import "http-proxy";
67
+ import "set-cookie-parser";
68
+ import uuid from "uuid/v4";
69
+ import ipsum from "corporate-ipsum";
70
+ const SCRIPT_TAG = "script";
71
+ function BodySnippet({
72
+ code,
73
+ cleanup
74
+ }) {
75
+ useEffect(() => {
76
+ const container = document.createElement("div");
77
+ container.innerHTML = code;
78
+ const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT);
79
+ const scripts = [];
80
+ while (walker.nextNode()) {
81
+ if (walker.currentNode instanceof HTMLScriptElement)
82
+ scripts.push(walker.currentNode);
83
+ }
84
+ scripts.forEach((inlineScript) => {
85
+ var _a;
86
+ const executableScript = document.createElement(SCRIPT_TAG);
87
+ executableScript.textContent = inlineScript.textContent;
88
+ Array.from(inlineScript.attributes).forEach(({
89
+ name,
90
+ value
91
+ }) => {
92
+ executableScript.setAttribute(name, value);
93
+ });
94
+ (_a = inlineScript.parentNode) == null ? void 0 : _a.replaceChild(executableScript, inlineScript);
95
+ });
96
+ const nodes = Array.from(container.childNodes);
97
+ document.body.append(...nodes);
98
+ return () => {
99
+ nodes.forEach((node) => {
100
+ var _a;
101
+ (_a = node.parentNode) == null ? void 0 : _a.removeChild(node);
102
+ });
103
+ if (cleanup == null)
104
+ return;
105
+ const cleanUp = new Function(cleanup);
106
+ try {
107
+ cleanUp();
108
+ } catch {
109
+ }
110
+ };
111
+ }, [code, cleanup]);
112
+ return null;
113
+ }
114
+ const SWATCHES_BY_ID = gql`
115
+ query SwatchesById($ids: [ID!]!) {
116
+ swatches(ids: $ids) {
117
+ id
118
+ hue
119
+ saturation
120
+ lightness
121
+ }
122
+ }
123
+ `;
124
+ const FILE_BY_ID = gql`
125
+ query FileById($id: ID!) {
126
+ file(id: $id) {
127
+ id
128
+ name
129
+ publicUrl
130
+ extension
131
+ dimensions {
132
+ width
133
+ height
134
+ }
135
+ }
136
+ }
137
+ `;
138
+ const FILES_BY_ID = gql`
139
+ query FilesById($ids: [ID!]!) {
140
+ files(ids: $ids) {
141
+ id
142
+ name
143
+ publicUrl
144
+ extension
145
+ dimensions {
146
+ width
147
+ height
148
+ }
149
+ }
150
+ }
151
+ `;
152
+ const PAGE_PATHNAMES_BY_ID = gql`
153
+ query PagePathnamesById($ids: [ID!]!) {
154
+ pagePathnamesById(ids: $ids) {
155
+ id
156
+ pathname
157
+ }
158
+ }
159
+ `;
160
+ const TYPOGRAPHY_FRAGMENT = gql`
161
+ fragment Typography on Typography {
162
+ id
163
+ name
164
+ style {
165
+ deviceId
166
+ value {
167
+ fontFamily
168
+ fontSize {
169
+ value
170
+ unit
171
+ }
172
+ color {
173
+ swatchId
174
+ alpha
175
+ }
176
+ lineHeight
177
+ letterSpacing
178
+ fontWeight
179
+ textAlign
180
+ uppercase
181
+ underline
182
+ strikethrough
183
+ italic
184
+ }
185
+ }
186
+ }
187
+ `;
188
+ const TYPOGRAPHIES_BY_ID = gql`
189
+ query TypographiesById($ids: [ID!]!) {
190
+ typographies(ids: $ids) {
191
+ ...Typography
192
+ }
193
+ }
194
+
195
+ ${TYPOGRAPHY_FRAGMENT}
196
+ `;
197
+ const TABLE_BY_ID = gql`
198
+ query TableById($id: ID!) {
199
+ table(id: $id) {
200
+ id
201
+ name
202
+ columns {
203
+ id
204
+ name
205
+ ... on MultipleSelectTableColumn {
206
+ options {
207
+ id
208
+ name
209
+ }
210
+ }
211
+ ... on SingleSelectTableColumn {
212
+ options {
213
+ id
214
+ name
215
+ }
216
+ }
217
+ }
218
+ }
219
+ }
220
+ `;
221
+ const ELEMENT_REFERENCE_GLOBAL_ELEMENT = gql`
222
+ query ElementReferenceGlobalElement($id: ID!) {
223
+ globalElement(id: $id) {
224
+ id
225
+ data
226
+ }
227
+ }
228
+ `;
229
+ const INTROSPECTION_QUERY = gql`
230
+ query Introspection(
231
+ $swatchIds: [ID!]!
232
+ $fileIds: [ID!]!
233
+ $pageIds: [ID!]!
234
+ $typographyIds: [ID!]!
235
+ $tableIds: [ID!]!
236
+ ) {
237
+ swatches(ids: $swatchIds) {
238
+ id
239
+ hue
240
+ saturation
241
+ lightness
242
+ }
243
+
244
+ files(ids: $fileIds) {
245
+ id
246
+ name
247
+ publicUrl
248
+ extension
249
+ dimensions {
250
+ width
251
+ height
252
+ }
253
+ }
254
+
255
+ pagePathnamesById(ids: $pageIds) {
256
+ id
257
+ pathname
258
+ }
259
+
260
+ typographies(ids: $typographyIds) {
261
+ ...Typography
262
+ }
263
+
264
+ tables(ids: $tableIds) {
265
+ id
266
+ name
267
+ columns {
268
+ id
269
+ name
270
+ ... on MultipleSelectTableColumn {
271
+ options {
272
+ id
273
+ name
274
+ }
275
+ }
276
+ ... on SingleSelectTableColumn {
277
+ options {
278
+ id
279
+ name
280
+ }
281
+ }
282
+ }
283
+ }
284
+ }
285
+
286
+ ${TYPOGRAPHY_FRAGMENT}
287
+ `;
288
+ async function introspect(element, client, store) {
289
+ var _a, _b, _c;
290
+ const descriptors = getPropControllerDescriptors(store.getState());
291
+ const swatchIds = /* @__PURE__ */ new Set();
292
+ const fileIds = /* @__PURE__ */ new Set();
293
+ const typographyIds = /* @__PURE__ */ new Set();
294
+ const tableIds = /* @__PURE__ */ new Set();
295
+ const pageIds = /* @__PURE__ */ new Set();
296
+ const remaining = [element];
297
+ let current;
298
+ while (current = remaining.pop()) {
299
+ let getResourcesFromElementDescriptors = function(elementDescriptors2, props) {
300
+ Object.entries(elementDescriptors2).forEach(([propName, descriptor]) => {
301
+ getElementSwatchIds(descriptor, props[propName]).forEach((swatchId) => {
302
+ swatchIds.add(swatchId);
303
+ });
304
+ getFileIds(descriptor, props[propName]).forEach((fileId) => fileIds.add(fileId));
305
+ getTypographyIds(descriptor, props[propName]).forEach((typographyId) => typographyIds.add(typographyId));
306
+ getTableIds(descriptor, props[propName]).forEach((tableId) => tableIds.add(tableId));
307
+ getPageIds(descriptor, props[propName]).forEach((pageId) => pageIds.add(pageId));
308
+ getElementChildren(descriptor, props[propName]).forEach((child) => remaining.push(child));
309
+ if (descriptor.type === ShapeControlType) {
310
+ const prop = props[propName];
311
+ if (prop == null)
312
+ return;
313
+ getResourcesFromElementDescriptors(descriptor.config.type, prop);
314
+ }
315
+ if (descriptor.type === ListControlType) {
316
+ const prop = props[propName];
317
+ if (prop == null)
318
+ return;
319
+ prop.forEach((item) => {
320
+ getResourcesFromElementDescriptors({ propName: descriptor.config.type }, { propName: item.value });
321
+ });
322
+ }
323
+ if (descriptor.type === Types.Shape) {
324
+ const prop = props[propName];
325
+ if (prop == null)
326
+ return;
327
+ getResourcesFromElementDescriptors(descriptor.options.type, prop);
328
+ }
329
+ if (descriptor.type === Types.List) {
330
+ const prop = props[propName];
331
+ if (prop == null)
332
+ return;
333
+ prop.forEach((item) => {
334
+ getResourcesFromElementDescriptors({ propName: descriptor.options.type }, { propName: item.value });
335
+ });
336
+ }
337
+ });
338
+ };
339
+ let element2;
340
+ if (isElementReference(current)) {
341
+ const query = await client.query({
342
+ query: ELEMENT_REFERENCE_GLOBAL_ELEMENT,
343
+ variables: { id: current.value }
344
+ });
345
+ const elementData = (_b = (_a = query.data) == null ? void 0 : _a.globalElement) == null ? void 0 : _b.data;
346
+ if (elementData == null)
347
+ continue;
348
+ element2 = elementData;
349
+ } else {
350
+ element2 = current;
351
+ }
352
+ const elementDescriptors = descriptors.get(element2.type);
353
+ if (elementDescriptors == null)
354
+ continue;
355
+ getResourcesFromElementDescriptors(elementDescriptors, element2.props);
356
+ }
357
+ const typographiesResult = await client.query({
358
+ query: TYPOGRAPHIES_BY_ID,
359
+ variables: { ids: [...typographyIds] }
360
+ });
361
+ (_c = typographiesResult == null ? void 0 : typographiesResult.data) == null ? void 0 : _c.typographies.forEach((typography) => {
362
+ typography == null ? void 0 : typography.style.forEach((style) => {
363
+ var _a2;
364
+ const swatchId = (_a2 = style.value.color) == null ? void 0 : _a2.swatchId;
365
+ if (swatchId != null)
366
+ swatchIds.add(swatchId);
367
+ });
368
+ });
369
+ return {
370
+ swatchIds: [...swatchIds],
371
+ fileIds: [...fileIds],
372
+ typographyIds: [...typographyIds],
373
+ tableIds: [...tableIds],
374
+ pageIds: [...pageIds]
375
+ };
376
+ }
377
+ const typePolicies = {
378
+ Query: {
379
+ fields: {
380
+ swatches(existingData, {
381
+ args,
382
+ toReference
383
+ }) {
384
+ return existingData != null ? existingData : args == null ? void 0 : args.ids.map((id) => toReference({
385
+ __typename: "Swatch",
386
+ id
387
+ }, true));
388
+ },
389
+ file(existingData, {
390
+ args,
391
+ toReference
392
+ }) {
393
+ return existingData != null ? existingData : toReference({
394
+ __typename: "File",
395
+ id: args == null ? void 0 : args.id
396
+ }, true);
397
+ },
398
+ files(existingData, {
399
+ args,
400
+ toReference
401
+ }) {
402
+ return existingData != null ? existingData : args == null ? void 0 : args.ids.map((id) => toReference({
403
+ __typename: "File",
404
+ id
405
+ }, true));
406
+ },
407
+ typographies(existingData, {
408
+ args,
409
+ toReference
410
+ }) {
411
+ return existingData != null ? existingData : args == null ? void 0 : args.ids.map((id) => toReference({
412
+ __typename: "Typography",
413
+ id
414
+ }, true));
415
+ },
416
+ pagePathnamesById(existingData, {
417
+ args,
418
+ toReference
419
+ }) {
420
+ return existingData != null ? existingData : args == null ? void 0 : args.ids.map((id) => toReference({
421
+ __typename: "PagePathnameSlice",
422
+ id
423
+ }, true));
424
+ },
425
+ globalElement(existingData, {
426
+ args,
427
+ toReference
428
+ }) {
429
+ return existingData != null ? existingData : toReference({
430
+ __typename: "GlobalElement",
431
+ id: args == null ? void 0 : args.id
432
+ }, true);
433
+ },
434
+ table(existingData, {
435
+ args,
436
+ toReference
437
+ }) {
438
+ return existingData != null ? existingData : toReference({
439
+ __typename: "Table",
440
+ id: args == null ? void 0 : args.id
441
+ }, true);
442
+ },
443
+ page(existingData, {
444
+ args,
445
+ toReference
446
+ }) {
447
+ return existingData != null ? existingData : toReference({
448
+ __typename: "Page",
449
+ id: args == null ? void 0 : args.id
450
+ }, true);
451
+ },
452
+ site(existingData, {
453
+ args,
454
+ toReference
455
+ }) {
456
+ return existingData != null ? existingData : toReference({
457
+ __typename: "Site",
458
+ id: args == null ? void 0 : args.id
459
+ }, true);
460
+ }
461
+ }
462
+ }
463
+ };
464
+ function createApolloClient({
465
+ uri,
466
+ cacheData
467
+ }) {
468
+ const cache2 = new InMemoryCache({
469
+ typePolicies
470
+ });
471
+ if (cacheData)
472
+ cache2.restore(cacheData);
473
+ return new ApolloClient({
474
+ link: new BatchHttpLink({
475
+ uri,
476
+ batchMax: 100
477
+ }),
478
+ cache: cache2
479
+ });
480
+ }
481
+ class MakeswiftClient {
482
+ constructor({
483
+ uri,
484
+ cacheData
485
+ }) {
486
+ __publicField(this, "apolloClient");
487
+ this.apolloClient = createApolloClient({
488
+ uri,
489
+ cacheData
490
+ });
491
+ }
492
+ async prefetch(element) {
493
+ const introspectionData = await introspect(element, this.apolloClient, storeContextDefaultValue);
494
+ const res = await this.apolloClient.query({
495
+ query: INTROSPECTION_QUERY,
496
+ variables: introspectionData
497
+ });
498
+ res.data.pagePathnamesById.forEach((pagePathnameSlice) => {
499
+ if (pagePathnameSlice == null)
500
+ return;
501
+ const id = Buffer.from(`Page:${pagePathnameSlice.id}`).toString("base64");
502
+ this.apolloClient.cache.writeFragment({
503
+ fragment: PagePathnameSliceFragmentDoc,
504
+ data: __spreadProps(__spreadValues({}, pagePathnameSlice), {
505
+ id
506
+ })
507
+ });
508
+ });
509
+ KeyUtils.resetGenerator();
510
+ return this.apolloClient.cache.extract();
511
+ }
512
+ updateCacheData(cacheData) {
513
+ this.apolloClient.cache.restore(cacheData);
514
+ }
515
+ }
516
+ const Context$2 = createContext(void 0);
517
+ function useQuery(query, options) {
518
+ const client = useContext(Context$2);
519
+ return useQuery$1(query, __spreadValues({
520
+ client: client == null ? void 0 : client.apolloClient
521
+ }, options));
522
+ }
523
+ function useMutation(mutation, options) {
524
+ const client = useContext(Context$2);
525
+ return useMutation$1(mutation, __spreadValues({
526
+ client: client == null ? void 0 : client.apolloClient
527
+ }, options));
528
+ }
529
+ function MakeswiftProvider({
530
+ client,
531
+ children
532
+ }) {
533
+ return /* @__PURE__ */ jsx(Context$2.Provider, {
534
+ value: client,
535
+ children
536
+ });
537
+ }
538
+ function is(x, y) {
539
+ if (x === y)
540
+ return x !== 0 || y !== 0 || 1 / x === 1 / y;
541
+ return x !== x && y !== y;
542
+ }
543
+ const { hasOwnProperty: hasOwnProperty$1 } = Object.prototype;
544
+ const shallowEqual = (a, b) => {
545
+ if (is(a, b))
546
+ return true;
547
+ if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
548
+ return false;
549
+ const keysA = Object.keys(a);
550
+ const keysB = Object.keys(b);
551
+ if (keysA.length !== keysB.length)
552
+ return false;
553
+ for (let i = 0; i < keysA.length; i += 1) {
554
+ if (!hasOwnProperty$1.call(b, keysA[i]) || !is(a[keysA[i]], b[keysA[i]]))
555
+ return false;
556
+ }
557
+ return true;
558
+ };
559
+ const { hasOwnProperty } = Object.prototype;
560
+ const deepEqual = (a, b) => {
561
+ if (shallowEqual(a, b))
562
+ return true;
563
+ if (typeof a !== "object" || a === null || typeof b !== "object" || b === null)
564
+ return false;
565
+ const keysA = Object.keys(a);
566
+ const keysB = Object.keys(b);
567
+ if (keysA.length !== keysB.length)
568
+ return false;
569
+ for (let i = 0; i < keysA.length; i += 1) {
570
+ if (!hasOwnProperty.call(b, keysA[i]) || !deepEqual(a[keysA[i]], b[keysA[i]]))
571
+ return false;
572
+ }
573
+ return true;
574
+ };
575
+ const SnippetLocation = {
576
+ Body: "BODY",
577
+ Head: "HEAD"
578
+ };
579
+ const defaultFavicon = {
580
+ mimetype: "image/png",
581
+ publicUrl: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCAAAACXBIWXMAABcRAAAXEQHKJvM/AAABjElEQVRYhc2XzU3EMBCFB8TddAAXn6EE6GCpgNABZ1/IXnymBOgAOmA7YM8+ABVsXEHQQFaKQryeN3Yk3ilKJtEnv/nLUd/3pFG0riGi88yrnQn+UfJ5FUi0riWiB2H4nQn+KRd0DFP8agXEfkqCYJBoHdtxIQxfm+DfFgEhoith3NYE30o/qgGR2BJB+xY7kdYEL8oNFUi0jiFMJuxVWrJqEMFxsyUNCsE6AeNztvBp7aJ143vXksoRnwhYtmNdSoIQa6RlO9YXEWW7KgoCleOgxgTf1QZBT+RZ2lXFING6UxCCq+ceeUE8fYdknY599v9sJvzGBP+yCEgC7GPmETc0OJ+0awAlkhe2pAbIXAeFZ8xe2g2Nk3c3ub0xwWt6zY9qbmiqGVMbZK21ZC/YmhlbeBMTzZNDQqcvDb1kM1x32iqZSt1HaqukfKvq34BAOTLsrH+ETNmUkKHHA+428RgeclPVWozeSyAI2EdWB34jtqXNTAySOY3i/KgFIlqOa4GkFmBegorzg4joG07he/M7zl6jAAAAAElFTkSuQmCC"
582
+ };
583
+ const VALID_TAG_REGEX = /^[a-zA-Z][a-zA-Z:_.\-\d]*$/;
584
+ const VALID_HEAD_ELEMENT_TYPES = ["title", "base", "link", "style", "meta", "script", "noscript", "template"];
585
+ function snippetToElement(snippet) {
586
+ return Children.map(parse(snippet.code), (element) => {
587
+ if (typeof element === "string")
588
+ return element;
589
+ if (!VALID_TAG_REGEX.test(element.type))
590
+ return null;
591
+ const key = element.key ? `${snippet.id}:${element.key}` : snippet.id;
592
+ return createElement(element.type, __spreadProps(__spreadValues({}, element.props), {
593
+ key
594
+ }));
595
+ });
596
+ }
597
+ const filterUsedSnippetProperties = ({
598
+ code,
599
+ builderEnabled,
600
+ liveEnabled,
601
+ location,
602
+ cleanup
603
+ }) => ({
604
+ code,
605
+ builderEnabled,
606
+ liveEnabled,
607
+ location,
608
+ cleanup
609
+ });
610
+ const PAGE_SNIPPETS_QUERY = gql`
611
+ query PageById($id: ID!) {
612
+ page(id: $id) {
613
+ __typename
614
+ id
615
+ snippets {
616
+ __typename
617
+ id
618
+ name
619
+ code
620
+ cleanup
621
+ location
622
+ shouldAddToNewPages
623
+ liveEnabled
624
+ builderEnabled
625
+ }
626
+ }
627
+ }
628
+ `;
629
+ const SITE_FONTS_QUERY = gql`
630
+ query SiteById($id: ID!) {
631
+ site(id: $id) {
632
+ id
633
+ googleFonts {
634
+ edges {
635
+ activeVariants {
636
+ specifier
637
+ }
638
+ node {
639
+ family
640
+ variants {
641
+ specifier
642
+ }
643
+ }
644
+ }
645
+ }
646
+ }
647
+ }
648
+ `;
649
+ function Page({
650
+ document: page
651
+ }) {
652
+ var _a;
653
+ const isInBuilder = useIsInBuilder();
654
+ const [snippets, setSnippets] = useState(page.snippets);
655
+ useQuery(PAGE_SNIPPETS_QUERY, {
656
+ variables: {
657
+ id: page.id
658
+ },
659
+ skip: isInBuilder === false,
660
+ fetchPolicy: "cache-only",
661
+ onCompleted(data) {
662
+ if (data == null)
663
+ return;
664
+ const oldSnippets = snippets.map(filterUsedSnippetProperties);
665
+ const newSnippets = data.page.snippets.map(filterUsedSnippetProperties);
666
+ if (deepEqual(newSnippets, oldSnippets))
667
+ return;
668
+ setSnippets(data.page.snippets);
669
+ }
670
+ });
671
+ const {
672
+ data: siteData
673
+ } = useQuery(SITE_FONTS_QUERY, {
674
+ variables: {
675
+ id: page.site.id
676
+ },
677
+ skip: isInBuilder === false,
678
+ fetchPolicy: "cache-only"
679
+ });
680
+ const favicon = (_a = page.meta.favicon) != null ? _a : defaultFavicon;
681
+ const {
682
+ title,
683
+ description,
684
+ keywords,
685
+ socialImage
686
+ } = page.meta;
687
+ const {
688
+ canonicalUrl,
689
+ isIndexingBlocked
690
+ } = page.seo;
691
+ const fontFamilyParamValue = useMemo(() => {
692
+ if ((siteData == null ? void 0 : siteData.site) == null) {
693
+ return page.fonts.map(({
694
+ family,
695
+ variants
696
+ }) => {
697
+ return `${family.replace(/ /g, "+")}:${variants.join()}`;
698
+ }).join("|");
699
+ }
700
+ return siteData.site.googleFonts.edges.filter((edge) => edge != null).map(({
701
+ activeVariants,
702
+ node: {
703
+ family,
704
+ variants
705
+ }
706
+ }) => {
707
+ const activeVariantSpecifiers = variants.filter((variant) => activeVariants.some((activeVariant) => activeVariant.specifier === variant.specifier)).map((variant) => variant.specifier).join();
708
+ return `${family.replace(/ /g, "+")}:${activeVariantSpecifiers}`;
709
+ }).join("|");
710
+ }, [siteData, page]);
711
+ const filteredSnippets = useMemo(() => snippets.filter((snippet) => isInBuilder ? snippet.builderEnabled : snippet.liveEnabled), [snippets, isInBuilder]);
712
+ const headSnippets = useMemo(() => filteredSnippets.filter((snippet) => snippet.location === SnippetLocation.Head), [filteredSnippets]);
713
+ const previousHeadSnippets = useRef(null);
714
+ useEffect(() => {
715
+ var _a2;
716
+ const headSnippetsToCleanUp = ((_a2 = previousHeadSnippets.current) != null ? _a2 : []).filter((previousSnippet) => previousSnippet.cleanup != null).filter((previousSnippet) => !headSnippets.some((snippet) => previousSnippet.id === snippet.id));
717
+ headSnippetsToCleanUp.forEach((snippetToCleanUp) => {
718
+ if (snippetToCleanUp.cleanup == null)
719
+ return;
720
+ const cleanUp = new Function(snippetToCleanUp.cleanup);
721
+ try {
722
+ cleanUp();
723
+ } catch {
724
+ }
725
+ });
726
+ previousHeadSnippets.current = headSnippets;
727
+ }, [headSnippets]);
728
+ return /* @__PURE__ */ jsxs(Fragment, {
729
+ children: [/* @__PURE__ */ jsxs(Head, {
730
+ children: [/* @__PURE__ */ jsx("style", {
731
+ children: `
732
+ html {
733
+ font-family: sans-serif;
734
+ }
735
+ div#__next {
736
+ overflow: hidden;
737
+ }
738
+ `
739
+ }), /* @__PURE__ */ jsx("link", {
740
+ rel: "icon",
741
+ type: favicon.mimetype,
742
+ href: favicon.publicUrl
743
+ }), canonicalUrl && /* @__PURE__ */ jsx("link", {
744
+ rel: "canonical",
745
+ href: canonicalUrl
746
+ }), isIndexingBlocked && /* @__PURE__ */ jsx("meta", {
747
+ name: "robots",
748
+ content: "noindex"
749
+ }), title && /* @__PURE__ */ jsxs(Fragment, {
750
+ children: [/* @__PURE__ */ jsx("title", {
751
+ children: title
752
+ }), /* @__PURE__ */ jsx("meta", {
753
+ property: "og:title",
754
+ content: title
755
+ }), /* @__PURE__ */ jsx("meta", {
756
+ name: "twitter:title",
757
+ content: title
758
+ }), /* @__PURE__ */ jsx("meta", {
759
+ itemProp: "name",
760
+ content: title
761
+ })]
762
+ }), description && /* @__PURE__ */ jsxs(Fragment, {
763
+ children: [/* @__PURE__ */ jsx("meta", {
764
+ name: "description",
765
+ content: description
766
+ }), /* @__PURE__ */ jsx("meta", {
767
+ property: "og:description",
768
+ content: description
769
+ }), /* @__PURE__ */ jsx("meta", {
770
+ name: "twitter:description",
771
+ content: description
772
+ }), /* @__PURE__ */ jsx("meta", {
773
+ itemProp: "description",
774
+ content: description
775
+ })]
776
+ }), keywords && /* @__PURE__ */ jsx("meta", {
777
+ name: "keywords",
778
+ content: keywords
779
+ }), socialImage && /* @__PURE__ */ jsxs(Fragment, {
780
+ children: [/* @__PURE__ */ jsx("meta", {
781
+ property: "og:image",
782
+ content: socialImage.publicUrl
783
+ }), /* @__PURE__ */ jsx("meta", {
784
+ property: "og:image:type",
785
+ content: socialImage.mimetype
786
+ }), /* @__PURE__ */ jsx("meta", {
787
+ name: "twitter:image",
788
+ content: socialImage.publicUrl
789
+ }), /* @__PURE__ */ jsx("meta", {
790
+ name: "twitter:card",
791
+ content: "summary_large_image"
792
+ }), /* @__PURE__ */ jsx("meta", {
793
+ itemProp: "image",
794
+ content: socialImage.publicUrl
795
+ })]
796
+ }), fontFamilyParamValue !== "" && /* @__PURE__ */ jsx(Fragment, {
797
+ children: /* @__PURE__ */ jsx("link", {
798
+ rel: "stylesheet",
799
+ href: `https://fonts.googleapis.com/css?family=${fontFamilyParamValue}&display=swap`
800
+ })
801
+ }), headSnippets.map(snippetToElement).map((children) => Children.map(children, (child) => {
802
+ if (typeof child === "string")
803
+ return child;
804
+ if (VALID_HEAD_ELEMENT_TYPES.includes(child.type))
805
+ return child;
806
+ return null;
807
+ }))]
808
+ }), /* @__PURE__ */ jsx(DocumentReference, {
809
+ documentReference: createDocumentReference(page.id)
810
+ }), filteredSnippets.filter((snippet) => snippet.location === SnippetLocation.Body).map((snippet) => /* @__PURE__ */ jsx(BodySnippet, {
811
+ code: snippet.code,
812
+ cleanup: snippet.cleanup
813
+ }, snippet.id))]
814
+ });
815
+ }
816
+ const FORWARDED_NEXT_DYNAMIC_REF_KEY = "__forwarded_next_dynamic_ref__";
817
+ function saveForwardedRef(props, ref) {
818
+ return __spreadProps(__spreadValues({}, props), {
819
+ [FORWARDED_NEXT_DYNAMIC_REF_KEY]: ref
820
+ });
821
+ }
822
+ function loadForwardedRef(_a) {
823
+ var _b = _a, {
824
+ [FORWARDED_NEXT_DYNAMIC_REF_KEY]: ref
825
+ } = _b, props = __objRest(_b, [
826
+ __restKey(FORWARDED_NEXT_DYNAMIC_REF_KEY)
827
+ ]);
828
+ return __spreadProps(__spreadValues({}, props), {
829
+ ref
830
+ });
831
+ }
832
+ function resolve(obj) {
833
+ return obj && obj.__esModule ? obj.default : obj;
834
+ }
835
+ function forwardNextDynamicRef(nextDynamicThunk) {
836
+ const Dynamic = nextDynamicThunk((loaderComponent) => loaderComponent.then((moduleOrComponent) => ({
837
+ __esModule: true,
838
+ default: (props) => createElement(resolve(moduleOrComponent), loadForwardedRef(props))
839
+ })));
840
+ return forwardRef((props, ref) => /* @__PURE__ */ jsx(Dynamic, __spreadValues({}, saveForwardedRef(props, ref))));
841
+ }
842
+ const keys = (o) => Object.keys(o);
843
+ const coalesce = (...args) => {
844
+ let i;
845
+ for (i = 0; i < args.length - 1; i += 1) {
846
+ if (args[i] != null)
847
+ return args[i];
848
+ }
849
+ return args[i];
850
+ };
851
+ function shallowMerge(a, b) {
852
+ const bKeys = keys(b);
853
+ const merged = __spreadValues({}, a);
854
+ bKeys.forEach((key) => {
855
+ merged[key] = coalesce(merged[key], b[key]);
856
+ });
857
+ return merged;
858
+ }
859
+ const DEVICES = [
860
+ { id: "desktop", minWidth: 769 },
861
+ { id: "tablet", minWidth: 576, maxWidth: 768 },
862
+ { id: "mobile", maxWidth: 575 }
863
+ ];
864
+ const getDevice = (deviceId) => {
865
+ const device = DEVICES.find(({ id }) => id === deviceId);
866
+ if (device == null)
867
+ throw new Error(`Unrecognized device ID: "${deviceId}".`);
868
+ return device;
869
+ };
870
+ function defaultStrategy(value, fallbacks) {
871
+ return value || fallbacks[0];
872
+ }
873
+ function shallowMergeFallbacks(value, fallbacks) {
874
+ return [value, ...fallbacks].filter((override) => Boolean(override)).reduce((a, b) => ({
875
+ deviceId: a.deviceId || b.deviceId,
876
+ value: shallowMerge(a.value, b.value)
877
+ }));
878
+ }
879
+ function findDeviceOverride(values = [], deviceId, strategy = defaultStrategy) {
880
+ const value = values.find(({ deviceId: d }) => d === deviceId);
881
+ const fallbacks = DEVICES.slice(0, DEVICES.findIndex((d) => d.id === deviceId) + 1).reverse().map((d) => values.find((v) => v.deviceId === d.id)).filter((override) => Boolean(override));
882
+ return value != null || fallbacks.length > 0 ? strategy(value, fallbacks) : void 0;
883
+ }
884
+ function join(responsiveValues, joinFn, strategy) {
885
+ return DEVICES.map(({ id }) => id).map((deviceId) => {
886
+ const value = joinFn(responsiveValues.map((responsiveValue) => {
887
+ const deviceValue = responsiveValue && findDeviceOverride(responsiveValue, deviceId, strategy);
888
+ return deviceValue == null ? void 0 : deviceValue.value;
889
+ }));
890
+ if (value == null)
891
+ return null;
892
+ return { deviceId, value };
893
+ }).filter((override) => Boolean(override));
894
+ }
895
+ const getDeviceMediaQuery = (device) => {
896
+ const parts = ["@media only screen"];
897
+ if (device.minWidth != null) {
898
+ parts.push(`(min-width: ${device.minWidth}px)`);
899
+ }
900
+ if (device.maxWidth != null) {
901
+ parts.push(`(max-width: ${device.maxWidth}px)`);
902
+ }
903
+ return parts.join(" and ");
904
+ };
905
+ const MakeswiftComponentType = {
906
+ Box: "./components/Box/index.js",
907
+ Button: "./components/Button/index.js",
908
+ Carousel: "./components/Carousel/index.js",
909
+ Countdown: "./components/Countdown/index.js",
910
+ Divider: "./components/Divider/index.js",
911
+ Embed: "./components/Embed/index.js",
912
+ Form: "./components/Form/index.js",
913
+ Image: "./components/Image/index.js",
914
+ Navigation: "./components/Navigation/index.js",
915
+ Root: "./components/Root/index.js",
916
+ SocialLinks: "./components/SocialLinks/index.js",
917
+ Text: "./components/Text/index.js",
918
+ Video: "./components/Video/index.js"
919
+ };
920
+ const DEFAULT_BOX_ANIMATE_TYPE = "none";
921
+ const DEFAULT_BOX_ANIMATE_DELAY = 0;
922
+ const DEFAULT_BOX_ANIMATE_DURATION = 0.75;
923
+ const DEFAULT_ITEM_ANIMATE_TYPE = "none";
924
+ const DEFAULT_ITEM_ANIMATE_DELAY = 0;
925
+ const DEFAULT_ITEM_ANIMATE_DURATION = 0.75;
926
+ const DEFAULT_ITEM_STAGGER_DURATION = 0;
927
+ function registerComponent$c(runtime) {
928
+ function isHiddenBasedOnAnimationType(props, deviceId, property) {
929
+ var _a, _b;
930
+ const animateIn = props[property];
931
+ return ((_b = (_a = findDeviceOverride(animateIn, deviceId)) == null ? void 0 : _a.value) != null ? _b : "none") === "none";
932
+ }
933
+ const isHiddenBasedOnBoxAnimation = (props, deviceId) => isHiddenBasedOnAnimationType(props, deviceId, "boxAnimateType");
934
+ const isHiddenBasedOnItemAnimation = (props, deviceId) => isHiddenBasedOnAnimationType(props, deviceId, "itemAnimateType");
935
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic(() => patch(import("./Box.es.js")))), {
936
+ type: MakeswiftComponentType.Box,
937
+ label: "Box",
938
+ props: {
939
+ id: ElementID(),
940
+ backgrounds: Backgrounds(),
941
+ width: Width(),
942
+ height: ResponsiveIconRadioGroup({
943
+ label: "Height",
944
+ options: [
945
+ { value: "auto", label: "Auto", icon: "HeightAuto16" },
946
+ { value: "stretch", label: "Stretch", icon: "HeightMatch16" }
947
+ ],
948
+ defaultValue: "auto"
949
+ }),
950
+ verticalAlign: ResponsiveIconRadioGroup({
951
+ label: "Align items",
952
+ options: [
953
+ { value: "flex-start", label: "Top", icon: "VerticalAlignStart16" },
954
+ { value: "center", label: "Middle", icon: "VerticalAlignMiddle16" },
955
+ { value: "flex-end", label: "Bottom", icon: "VerticalAlignEnd16" },
956
+ {
957
+ value: "space-between",
958
+ label: "Space between",
959
+ icon: "VerticalAlignSpaceBetween16"
960
+ }
961
+ ],
962
+ defaultValue: "flex-start"
963
+ }),
964
+ margin: Margin(),
965
+ padding: Padding({
966
+ preset: [
967
+ {
968
+ deviceId: "desktop",
969
+ value: {
970
+ paddingTop: { value: 10, unit: "px" },
971
+ paddingRight: { value: 10, unit: "px" },
972
+ paddingBottom: { value: 10, unit: "px" },
973
+ paddingLeft: { value: 10, unit: "px" }
974
+ }
975
+ }
976
+ ]
977
+ }),
978
+ border: Border(),
979
+ borderRadius: BorderRadius(),
980
+ boxShadow: Shadows(),
981
+ rowGap: GapY((props) => ({
982
+ hidden: props.children == null
983
+ })),
984
+ columnGap: GapX((props) => ({
985
+ hidden: props.children == null
986
+ })),
987
+ boxAnimateType: ResponsiveSelect({
988
+ label: "Animate box in",
989
+ labelOrientation: "vertical",
990
+ options: [
991
+ { value: "none", label: "None" },
992
+ { value: "fadeIn", label: "Fade in" },
993
+ { value: "fadeRight", label: "Fade right" },
994
+ { value: "fadeDown", label: "Fade down" },
995
+ { value: "fadeLeft", label: "Fade left" },
996
+ { value: "fadeUp", label: "Fade up" },
997
+ { value: "blurIn", label: "Blur in" },
998
+ { value: "scaleUp", label: "Scale up" },
999
+ { value: "scaleDown", label: "Scale down" }
1000
+ ],
1001
+ defaultValue: "none"
1002
+ }),
1003
+ boxAnimateDuration: ResponsiveNumber((props, device) => ({
1004
+ label: "Box duration",
1005
+ defaultValue: DEFAULT_BOX_ANIMATE_DURATION,
1006
+ min: 0.1,
1007
+ step: 0.05,
1008
+ suffix: "s",
1009
+ hidden: isHiddenBasedOnBoxAnimation(props, device)
1010
+ })),
1011
+ boxAnimateDelay: ResponsiveNumber((props, device) => ({
1012
+ label: "Box delay",
1013
+ defaultValue: DEFAULT_BOX_ANIMATE_DELAY,
1014
+ min: 0,
1015
+ step: 0.05,
1016
+ suffix: "s",
1017
+ hidden: isHiddenBasedOnBoxAnimation(props, device)
1018
+ })),
1019
+ itemAnimateType: ResponsiveSelect({
1020
+ label: "Animate items in",
1021
+ labelOrientation: "vertical",
1022
+ options: [
1023
+ { value: "none", label: "None" },
1024
+ { value: "fadeIn", label: "Fade in" },
1025
+ { value: "fadeRight", label: "Fade right" },
1026
+ { value: "fadeDown", label: "Fade down" },
1027
+ { value: "fadeLeft", label: "Fade left" },
1028
+ { value: "fadeUp", label: "Fade up" },
1029
+ { value: "blurIn", label: "Blur in" },
1030
+ { value: "scaleUp", label: "Scale up" },
1031
+ { value: "scaleDown", label: "Scale down" }
1032
+ ],
1033
+ defaultValue: "none"
1034
+ }),
1035
+ itemAnimateDuration: ResponsiveNumber((props, device) => ({
1036
+ label: "Items duration",
1037
+ defaultValue: DEFAULT_BOX_ANIMATE_DURATION,
1038
+ min: 0.1,
1039
+ step: 0.05,
1040
+ suffix: "s",
1041
+ hidden: isHiddenBasedOnItemAnimation(props, device)
1042
+ })),
1043
+ itemAnimateDelay: ResponsiveNumber((props, device) => ({
1044
+ label: "Items delay",
1045
+ defaultValue: DEFAULT_ITEM_ANIMATE_DELAY,
1046
+ min: 0,
1047
+ step: 0.05,
1048
+ suffix: "s",
1049
+ hidden: isHiddenBasedOnItemAnimation(props, device)
1050
+ })),
1051
+ itemStaggerDuration: ResponsiveNumber((props, device) => ({
1052
+ label: "Stagger",
1053
+ min: 0,
1054
+ step: 0.05,
1055
+ suffix: "s",
1056
+ defaultValue: DEFAULT_ITEM_STAGGER_DURATION,
1057
+ hidden: isHiddenBasedOnItemAnimation(props, device)
1058
+ })),
1059
+ hidePlaceholder: Checkbox((props) => ({
1060
+ label: "Hide placeholder",
1061
+ hidden: props.children != null
1062
+ })),
1063
+ children: Grid()
1064
+ }
1065
+ });
1066
+ }
1067
+ function registerComponent$b(runtime) {
1068
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic(() => patch(import("./Button.es.js")))), {
1069
+ type: MakeswiftComponentType.Button,
1070
+ label: "Button",
1071
+ props: {
1072
+ id: ElementID(),
1073
+ children: TextInput({ placeholder: "Button text" }),
1074
+ link: Link({
1075
+ defaultValue: {
1076
+ type: "OPEN_PAGE",
1077
+ payload: {
1078
+ pageId: null,
1079
+ openInNewTab: false
1080
+ }
1081
+ }
1082
+ }),
1083
+ variant: ResponsiveSelect({
1084
+ label: "Style",
1085
+ labelOrientation: "horizontal",
1086
+ options: [
1087
+ { value: "flat", label: "Flat" },
1088
+ { value: "outline", label: "Outline" },
1089
+ { value: "shadow", label: "Floating" },
1090
+ { value: "clear", label: "Clear" },
1091
+ { value: "blocky", label: "Blocky" },
1092
+ { value: "bubbly", label: "Bubbly" },
1093
+ { value: "skewed", label: "Skewed" }
1094
+ ],
1095
+ defaultValue: "flat"
1096
+ }),
1097
+ shape: ResponsiveIconRadioGroup({
1098
+ label: "Shape",
1099
+ options: [
1100
+ { label: "Pill", value: "pill", icon: "ButtonPill16" },
1101
+ { label: "Rounded", value: "rounded", icon: "ButtonRounded16" },
1102
+ { label: "Square", value: "square", icon: "ButtonSquare16" }
1103
+ ],
1104
+ defaultValue: "rounded"
1105
+ }),
1106
+ size: ResponsiveIconRadioGroup({
1107
+ label: "Size",
1108
+ options: [
1109
+ { label: "Small", value: "small", icon: "SizeSmall16" },
1110
+ { label: "Medium", value: "medium", icon: "SizeMedium16" },
1111
+ { label: "Large", value: "large", icon: "SizeLarge16" }
1112
+ ],
1113
+ defaultValue: "medium"
1114
+ }),
1115
+ color: ResponsiveColor((props, device) => {
1116
+ var _a;
1117
+ const variant = props.variant;
1118
+ const hidden = ((_a = findDeviceOverride(variant, device)) == null ? void 0 : _a.value) === "clear";
1119
+ return { placeholder: "black", hidden };
1120
+ }),
1121
+ textColor: ResponsiveColor({
1122
+ label: "Text color",
1123
+ placeholder: "white"
1124
+ }),
1125
+ textStyle: TextStyle(),
1126
+ width: Width(),
1127
+ margin: Margin()
1128
+ }
1129
+ });
1130
+ }
1131
+ function registerComponent$a(runtime) {
1132
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic(() => patch(import("./Carousel.es.js")))), {
1133
+ type: MakeswiftComponentType.Carousel,
1134
+ label: "Carousel",
1135
+ icon: "Carousel40",
1136
+ props: {
1137
+ id: ElementID(),
1138
+ images: Images({
1139
+ preset: [
1140
+ { key: uuid(), props: {} },
1141
+ { key: uuid(), props: {} },
1142
+ { key: uuid(), props: {} }
1143
+ ]
1144
+ }),
1145
+ width: Width({ defaultValue: { value: 400, unit: "px" } }),
1146
+ margin: Margin(),
1147
+ pageSize: ResponsiveNumber((props) => {
1148
+ var _a;
1149
+ const images = props.images;
1150
+ const imagesLength = (_a = images == null ? void 0 : images.length) != null ? _a : 0;
1151
+ return {
1152
+ label: "Images shown",
1153
+ defaultValue: 1,
1154
+ min: 1,
1155
+ max: imagesLength,
1156
+ step: 1
1157
+ };
1158
+ }),
1159
+ step: ResponsiveNumber((props, device) => {
1160
+ var _a, _b;
1161
+ const pageSize = props.pageSize;
1162
+ const pageSizeValue = (_b = (_a = findDeviceOverride(pageSize, device)) == null ? void 0 : _a.value) != null ? _b : 1;
1163
+ return {
1164
+ label: "Step",
1165
+ defaultValue: 1,
1166
+ min: 1,
1167
+ max: pageSizeValue,
1168
+ step: 1
1169
+ };
1170
+ }),
1171
+ slideAlignment: ResponsiveIconRadioGroup({
1172
+ label: "Alignment",
1173
+ options: [
1174
+ { label: "Top", value: "flex-start", icon: "VerticalAlignStart16" },
1175
+ { label: "Middle", value: "center", icon: "VerticalAlignMiddle16" },
1176
+ { label: "Bottom", value: "flex-end", icon: "VerticalAlignEnd16" }
1177
+ ],
1178
+ defaultValue: "center"
1179
+ }),
1180
+ gap: GapX({
1181
+ label: "Gap",
1182
+ step: 5,
1183
+ defaultValue: { value: 0, unit: "px" }
1184
+ }),
1185
+ autoplay: Checkbox({ label: "Autoplay" }),
1186
+ delay: Number((props) => ({
1187
+ label: "Delay",
1188
+ preset: 5,
1189
+ min: 1,
1190
+ step: 0.1,
1191
+ suffix: "seconds",
1192
+ hidden: !props.autoplay
1193
+ })),
1194
+ showArrows: Checkbox({ preset: true, label: "Show arrows" }),
1195
+ arrowPosition: ResponsiveIconRadioGroup((props) => ({
1196
+ label: "Arrow position",
1197
+ options: [
1198
+ { label: "Inside", value: "inside", icon: "ArrowInside16" },
1199
+ { label: "Center", value: "center", icon: "ArrowCenter16" },
1200
+ { label: "Outside", value: "outside", icon: "ArrowOutside16" }
1201
+ ],
1202
+ defaultValue: "inside",
1203
+ hidden: props.showArrows === false
1204
+ })),
1205
+ arrowColor: ResponsiveColor((props) => ({
1206
+ label: "Arrow color",
1207
+ placeholder: "black",
1208
+ hidden: props.showArrows === false
1209
+ })),
1210
+ arrowBackground: ResponsiveColor((props) => ({
1211
+ label: "Arrow background",
1212
+ placeholder: "white",
1213
+ hidden: props.showArrows === false
1214
+ })),
1215
+ showDots: Checkbox({ preset: true, label: "Show dots" }),
1216
+ dotColor: ResponsiveColor((props) => ({
1217
+ label: "Dot color",
1218
+ placeholder: "black",
1219
+ hidden: props.showDots === false
1220
+ })),
1221
+ slideBorder: Border(),
1222
+ slideBorderRadius: BorderRadius()
1223
+ }
1224
+ });
1225
+ }
1226
+ function registerComponent$9(runtime) {
1227
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic(() => patch(import("./Countdown.es.js")))), {
1228
+ type: MakeswiftComponentType.Countdown,
1229
+ label: "Countdown",
1230
+ icon: "Countdown40",
1231
+ props: {
1232
+ id: ElementID(),
1233
+ date: Date$1(() => ({
1234
+ preset: new Date(Date.now() + 1e3 * 60 * 60 * 24 * 2).toISOString()
1235
+ })),
1236
+ variant: ResponsiveIconRadioGroup({
1237
+ label: "Style",
1238
+ options: [
1239
+ { label: "Filled", value: "filled", icon: "CountdownSolid16" },
1240
+ {
1241
+ label: "Filled split",
1242
+ value: "filled-split",
1243
+ icon: "CountdownSolidSplit16"
1244
+ },
1245
+ { label: "Outline", value: "outline", icon: "CountdownOutline16" },
1246
+ {
1247
+ label: "Outline split",
1248
+ value: "outline-split",
1249
+ icon: "CountdownOutlineSplit16"
1250
+ },
1251
+ { label: "Clear", value: "clear", icon: "CountdownNaked16" }
1252
+ ],
1253
+ defaultValue: "filled"
1254
+ }),
1255
+ shape: ResponsiveIconRadioGroup({
1256
+ label: "Shape",
1257
+ options: [
1258
+ { label: "Pill", value: "pill", icon: "ButtonPill16" },
1259
+ { label: "Rounded", value: "rounded", icon: "ButtonRounded16" },
1260
+ { label: "Square", value: "square", icon: "ButtonSquare16" }
1261
+ ],
1262
+ defaultValue: "rounded"
1263
+ }),
1264
+ size: ResponsiveIconRadioGroup({
1265
+ label: "Size",
1266
+ options: [
1267
+ { label: "Small", value: "small", icon: "SizeSmall16" },
1268
+ { label: "Medium", value: "medium", icon: "SizeMedium16" },
1269
+ { label: "Large", value: "large", icon: "SizeLarge16" }
1270
+ ],
1271
+ defaultValue: "medium"
1272
+ }),
1273
+ gap: GapX({
1274
+ preset: [{ deviceId: "desktop", value: { value: 10, unit: "px" } }],
1275
+ label: "Gap",
1276
+ step: 1,
1277
+ min: 0,
1278
+ max: 100,
1279
+ defaultValue: { value: 0, unit: "px" }
1280
+ }),
1281
+ numberFont: Font({ label: "Number font" }),
1282
+ numberColor: ResponsiveColor({
1283
+ label: "Number color",
1284
+ placeholder: "white"
1285
+ }),
1286
+ blockColor: ResponsiveColor({
1287
+ label: "Block color",
1288
+ placeholder: "black"
1289
+ }),
1290
+ labelFont: Font({ label: "Label font" }),
1291
+ labelColor: ResponsiveColor({
1292
+ label: "Label color",
1293
+ placeholder: "black"
1294
+ }),
1295
+ width: Width({ defaultValue: { value: 560, unit: "px" } }),
1296
+ margin: Margin(),
1297
+ daysLabel: TextInput({ label: "Days label", placeholder: "Days" }),
1298
+ hoursLabel: TextInput({ label: "Hours label", placeholder: "Hours" }),
1299
+ minutesLabel: TextInput({
1300
+ label: "Minutes label",
1301
+ placeholder: "Minutes"
1302
+ }),
1303
+ secondsLabel: TextInput({
1304
+ label: "Seconds label",
1305
+ placeholder: "Seconds"
1306
+ })
1307
+ }
1308
+ });
1309
+ }
1310
+ function registerComponent$8(runtime) {
1311
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic(() => patch(import("./Divider.es.js")))), {
1312
+ type: MakeswiftComponentType.Divider,
1313
+ label: "Divider",
1314
+ icon: "Divider40",
1315
+ props: {
1316
+ id: ElementID(),
1317
+ variant: ResponsiveSelect({
1318
+ label: "Style",
1319
+ labelOrientation: "horizontal",
1320
+ options: [
1321
+ { value: "solid", label: "Solid" },
1322
+ { value: "dashed", label: "Dashed" },
1323
+ { value: "dotted", label: "Dotted" },
1324
+ { value: "blended", label: "Blended" }
1325
+ ],
1326
+ defaultValue: "solid"
1327
+ }),
1328
+ thickness: ResponsiveLength({
1329
+ label: "Height",
1330
+ defaultValue: { value: 1, unit: "px" },
1331
+ options: [{ value: "px", label: "Pixels", icon: "Px16" }]
1332
+ }),
1333
+ color: ResponsiveColor({ placeholder: "black" }),
1334
+ width: Width({ defaultValue: { value: 100, unit: "%" } }),
1335
+ margin: Margin()
1336
+ }
1337
+ });
1338
+ }
1339
+ function registerComponent$7(runtime) {
1340
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic(() => patch(import("./Embed.es.js")))), {
1341
+ type: MakeswiftComponentType.Embed,
1342
+ label: "Embed",
1343
+ icon: "Code40",
1344
+ props: {
1345
+ id: ElementID(),
1346
+ html: TextArea({ label: "Code", rows: 20 }),
1347
+ width: Width({}),
1348
+ margin: Margin()
1349
+ }
1350
+ });
1351
+ }
1352
+ const Alignments = {
1353
+ LEFT: "left",
1354
+ CENTER: "center",
1355
+ RIGHT: "right"
1356
+ };
1357
+ const Shapes = Object.freeze({
1358
+ SQUARE: "square",
1359
+ ROUNDED: "rounded",
1360
+ PILL: "pill"
1361
+ });
1362
+ const Sizes = Object.freeze({
1363
+ SMALL: "small",
1364
+ MEDIUM: "medium",
1365
+ LARGE: "large"
1366
+ });
1367
+ const Contrasts = Object.freeze({
1368
+ LIGHT: "light",
1369
+ DARK: "dark"
1370
+ });
1371
+ const Context$1 = createContext({});
1372
+ function useFormContext() {
1373
+ return useContext(Context$1);
1374
+ }
1375
+ const { Provider } = Context$1;
1376
+ function registerComponent$6(runtime) {
1377
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic(() => patch(import("./Form.es.js")))), {
1378
+ type: MakeswiftComponentType.Form,
1379
+ label: "Form",
1380
+ icon: "Form40",
1381
+ props: {
1382
+ id: ElementID(),
1383
+ tableId: Table(),
1384
+ fields: TableFormFields(),
1385
+ submitLink: Link((props) => ({
1386
+ label: "Redirect to",
1387
+ options: [
1388
+ { value: "OPEN_PAGE", label: "Open page" },
1389
+ { value: "OPEN_URL", label: "Open URL" }
1390
+ ],
1391
+ hidden: props.tableId == null
1392
+ })),
1393
+ gap: GapY((props) => ({
1394
+ preset: [{ deviceId: "desktop", value: { value: 10, unit: "px" } }],
1395
+ label: "Gap",
1396
+ defaultValue: { value: 0, unit: "px" },
1397
+ hidden: props.tableId == null
1398
+ })),
1399
+ shape: ResponsiveIconRadioGroup((props) => ({
1400
+ label: "Shape",
1401
+ options: [
1402
+ { label: "Pill", value: Shapes.PILL, icon: "ButtonPill16" },
1403
+ { label: "Rounded", value: Shapes.ROUNDED, icon: "ButtonRounded16" },
1404
+ { label: "Square", value: Shapes.SQUARE, icon: "ButtonSquare16" }
1405
+ ],
1406
+ defaultValue: Shapes.ROUNDED,
1407
+ hidden: props.tableId == null
1408
+ })),
1409
+ size: ResponsiveIconRadioGroup((props) => ({
1410
+ label: "Size",
1411
+ options: [
1412
+ { label: "Small", value: Sizes.SMALL, icon: "SizeSmall16" },
1413
+ { label: "Medium", value: Sizes.MEDIUM, icon: "SizeMedium16" },
1414
+ { label: "Large", value: Sizes.LARGE, icon: "SizeLarge16" }
1415
+ ],
1416
+ defaultValue: Sizes.MEDIUM,
1417
+ hidden: (props == null ? void 0 : props.tableId) == null
1418
+ })),
1419
+ contrast: ResponsiveIconRadioGroup((props) => ({
1420
+ label: "Color",
1421
+ options: [
1422
+ { label: "Light mode", value: Contrasts.LIGHT, icon: "Sun16" },
1423
+ { label: "Dark mode", value: Contrasts.DARK, icon: "Moon16" }
1424
+ ],
1425
+ defaultValue: Contrasts.LIGHT,
1426
+ hidden: props.tableId == null
1427
+ })),
1428
+ labelTextStyle: TextStyle({ label: "Label text style" }),
1429
+ labelTextColor: ResponsiveColor((props, device) => {
1430
+ const hidden = props.tableId == null;
1431
+ const responsiveContrast = props.contrast;
1432
+ const contrast = findDeviceOverride(responsiveContrast, device);
1433
+ return {
1434
+ hidden,
1435
+ label: "Label text color",
1436
+ placeholder: (contrast == null ? void 0 : contrast.value) === Contrasts.DARK ? "rgba(255,255,255,0.95)" : "rgba(0,0,0,0.8)"
1437
+ };
1438
+ }),
1439
+ submitTextStyle: TextStyle({ label: "Button text style" }),
1440
+ brandColor: ResponsiveColor((props) => ({
1441
+ label: "Button color",
1442
+ placeholder: "black",
1443
+ hidden: props.tableId == null
1444
+ })),
1445
+ submitTextColor: ResponsiveColor((props) => ({
1446
+ label: "Button text color",
1447
+ placeholder: "white",
1448
+ hidden: props.tableId == null
1449
+ })),
1450
+ submitLabel: TextInput((props) => ({
1451
+ label: "Button label",
1452
+ placeholder: "Submit",
1453
+ hidden: props.tableId == null
1454
+ })),
1455
+ submitVariant: ResponsiveSelect((props) => ({
1456
+ label: "Button style",
1457
+ options: [
1458
+ { value: "flat", label: "Flat" },
1459
+ { value: "outline", label: "Outline" },
1460
+ { value: "shadow", label: "Floating" },
1461
+ { value: "clear", label: "Clear" },
1462
+ { value: "blocky", label: "Blocky" },
1463
+ { value: "bubbly", label: "Bubbly" },
1464
+ { value: "skewed", label: "Skewed" }
1465
+ ],
1466
+ defaultValue: "flat",
1467
+ hidden: props.tableId == null
1468
+ })),
1469
+ submitWidth: ResponsiveLength((props) => ({
1470
+ label: "Button width",
1471
+ hidden: props.tableId == null
1472
+ })),
1473
+ submitAlignment: ResponsiveIconRadioGroup((props) => ({
1474
+ label: "Button alignment",
1475
+ options: [
1476
+ { label: "Left", value: Alignments.LEFT, icon: "AlignLeft16" },
1477
+ { label: "Center", value: Alignments.CENTER, icon: "AlignCenter16" },
1478
+ { label: "Right", value: Alignments.RIGHT, icon: "AlignRight16" }
1479
+ ],
1480
+ defaultValue: Alignments.CENTER,
1481
+ hidden: props.tableId == null
1482
+ })),
1483
+ width: Width({
1484
+ preset: [{ deviceId: "desktop", value: { value: 550, unit: "px" } }],
1485
+ defaultValue: { value: 100, unit: "%" }
1486
+ }),
1487
+ margin: Margin()
1488
+ }
1489
+ });
1490
+ }
1491
+ function registerComponent$5(runtime) {
1492
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic(() => patch(import("./Image.es2.js")))), {
1493
+ type: MakeswiftComponentType.Image,
1494
+ label: "Image",
1495
+ props: {
1496
+ id: ElementID(),
1497
+ file: Image(),
1498
+ altText: TextInput({ label: "Alt text" }),
1499
+ link: Link({ label: "On click" }),
1500
+ width: Width(),
1501
+ margin: Margin(),
1502
+ padding: Padding(),
1503
+ border: Border(),
1504
+ borderRadius: BorderRadius(),
1505
+ boxShadow: Shadows(),
1506
+ opacity: ResponsiveOpacity()
1507
+ }
1508
+ });
1509
+ }
1510
+ function registerComponent$4(runtime) {
1511
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic(() => patch(import("./Navigation.es.js")))), {
1512
+ type: MakeswiftComponentType.Navigation,
1513
+ label: "Navigation",
1514
+ icon: "Navigation40",
1515
+ props: {
1516
+ id: ElementID(),
1517
+ links: NavigationLinks(),
1518
+ linkTextStyle: TextStyle((props) => {
1519
+ const links = props.links;
1520
+ return {
1521
+ label: "Link text style",
1522
+ hidden: links == null || links.length === 0
1523
+ };
1524
+ }),
1525
+ showLogo: Checkbox({ preset: true, label: "Show logo" }),
1526
+ logoFile: Image((props) => ({
1527
+ label: "Logo",
1528
+ hidden: props.showLogo === false
1529
+ })),
1530
+ logoWidth: ResponsiveLength((props) => ({
1531
+ preset: [{ deviceId: "desktop", value: { value: 100, unit: "px" } }],
1532
+ label: "Logo width",
1533
+ min: 0,
1534
+ max: 1e3,
1535
+ options: [{ value: "px", label: "Pixels", icon: "Px16" }],
1536
+ hidden: props.showLogo === false
1537
+ })),
1538
+ logoAltText: TextInput((props) => ({
1539
+ label: "Logo alt text",
1540
+ hidden: props.showLogo === false
1541
+ })),
1542
+ logoLink: Link((props) => ({
1543
+ label: "Logo on click",
1544
+ hidden: props.showLogo === false
1545
+ })),
1546
+ alignment: ResponsiveIconRadioGroup({
1547
+ label: "Alignment",
1548
+ options: [
1549
+ { label: "Left", value: "flex-start", icon: "AlignLeft16" },
1550
+ { label: "Center", value: "center", icon: "AlignCenter16" },
1551
+ { label: "End", value: "flex-end", icon: "AlignRight16" }
1552
+ ],
1553
+ defaultValue: "flex-end"
1554
+ }),
1555
+ gutter: GapX({
1556
+ preset: [{ deviceId: "desktop", value: { value: 10, unit: "px" } }],
1557
+ label: "Link gap",
1558
+ min: 0,
1559
+ max: 100,
1560
+ step: 1,
1561
+ defaultValue: { value: 0, unit: "px" }
1562
+ }),
1563
+ mobileMenuAnimation: ResponsiveSelect({
1564
+ label: "Mobile menu",
1565
+ options: [
1566
+ { value: "coverRight", label: "Cover from right" },
1567
+ { value: "coverLeft", label: "Cover from left" }
1568
+ ]
1569
+ }),
1570
+ mobileMenuOpenIconColor: ResponsiveColor((props, device) => {
1571
+ const mobileMenuAnimation = props.mobileMenuAnimation;
1572
+ const hidden = !findDeviceOverride(mobileMenuAnimation, device);
1573
+ return {
1574
+ label: "Open icon color",
1575
+ placeholder: "rgba(161, 168, 194, 0.5)",
1576
+ hidden
1577
+ };
1578
+ }),
1579
+ mobileMenuCloseIconColor: ResponsiveColor((props, device) => {
1580
+ const mobileMenuAnimation = props.mobileMenuAnimation;
1581
+ const hidden = !findDeviceOverride(mobileMenuAnimation, device);
1582
+ return {
1583
+ label: "Close icon color",
1584
+ placeholder: "rgba(161, 168, 194, 0.5)",
1585
+ hidden
1586
+ };
1587
+ }),
1588
+ mobileMenuBackgroundColor: ResponsiveColor((props, device) => {
1589
+ const mobileMenuAnimation = props.mobileMenuAnimation;
1590
+ const hidden = !findDeviceOverride(mobileMenuAnimation, device);
1591
+ return {
1592
+ label: "Menu BG color",
1593
+ placeholder: "black",
1594
+ hidden
1595
+ };
1596
+ }),
1597
+ width: Width({ defaultValue: { value: 100, unit: "%" } }),
1598
+ margin: Margin()
1599
+ }
1600
+ });
1601
+ }
1602
+ function registerComponent$3(runtime) {
1603
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic(() => patch(import("./Root.es.js")))), {
1604
+ type: MakeswiftComponentType.Root,
1605
+ label: "Page",
1606
+ hidden: true,
1607
+ props: {
1608
+ children: Grid(),
1609
+ backgrounds: Backgrounds(),
1610
+ rowGap: GapY(),
1611
+ columnGap: GapX()
1612
+ }
1613
+ });
1614
+ }
1615
+ function registerComponent$2(runtime) {
1616
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic(() => patch(import("./SocialLinks.es.js")))), {
1617
+ type: MakeswiftComponentType.SocialLinks,
1618
+ label: "Social Links",
1619
+ icon: "SocialLinks40",
1620
+ props: {
1621
+ id: ElementID(),
1622
+ links: SocialLinks({
1623
+ preset: {
1624
+ links: [
1625
+ {
1626
+ id: "facebook",
1627
+ payload: { type: "facebook", url: "https://www.facebook.com" }
1628
+ },
1629
+ {
1630
+ id: "instagram",
1631
+ payload: { type: "instagram", url: "https://www.instagram.com" }
1632
+ },
1633
+ {
1634
+ id: "twitter",
1635
+ payload: { type: "twitter", url: "https://www.twitter.com" }
1636
+ }
1637
+ ],
1638
+ openInNewTab: false
1639
+ }
1640
+ }),
1641
+ shape: ResponsiveIconRadioGroup((props) => {
1642
+ const links = props.links;
1643
+ return {
1644
+ label: "Shape",
1645
+ options: [
1646
+ { label: "Naked", value: "naked", icon: "Star16" },
1647
+ { label: "Circle", value: "circle", icon: "StarCircle16" },
1648
+ { label: "Rounded", value: "rounded", icon: "StarRoundedSquare16" },
1649
+ { label: "Square", value: "square", icon: "StarSquare16" }
1650
+ ],
1651
+ defaultValue: "naked",
1652
+ hidden: links == null || links.links.length === 0
1653
+ };
1654
+ }),
1655
+ size: ResponsiveIconRadioGroup((props) => {
1656
+ const links = props.links;
1657
+ return {
1658
+ label: "Size",
1659
+ options: [
1660
+ { label: "Small", value: "small", icon: "SizeSmall16" },
1661
+ { label: "Medium", value: "medium", icon: "SizeMedium16" },
1662
+ { label: "Large", value: "large", icon: "SizeLarge16" }
1663
+ ],
1664
+ defaultValue: "medium",
1665
+ hidden: links == null || links.links.length === 0
1666
+ };
1667
+ }),
1668
+ hoverStyle: ResponsiveSelect((props) => {
1669
+ const links = props.links;
1670
+ const hidden = links == null || links.links.length === 0;
1671
+ return {
1672
+ label: "On hover",
1673
+ options: [
1674
+ { value: "none", label: "None" },
1675
+ { value: "grow", label: "Grow" },
1676
+ { value: "shrink", label: "Shrink" },
1677
+ { value: "fade", label: "Fade" }
1678
+ ],
1679
+ defaultValue: "none",
1680
+ labelOrientation: "horizontal",
1681
+ hidden
1682
+ };
1683
+ }),
1684
+ fill: ResponsiveColor((props) => {
1685
+ const links = props.links;
1686
+ const hidden = links == null || links.links.length === 0;
1687
+ return {
1688
+ label: "Icon color",
1689
+ hidden
1690
+ };
1691
+ }),
1692
+ backgroundColor: ResponsiveColor((props) => {
1693
+ const links = props.links;
1694
+ const hidden = links == null || links.links.length === 0;
1695
+ return {
1696
+ label: "Shape color",
1697
+ hidden
1698
+ };
1699
+ }),
1700
+ alignment: ResponsiveIconRadioGroup({
1701
+ label: "Alignment",
1702
+ options: [
1703
+ { label: "flex-start", value: "flex-start", icon: "AlignLeft16" },
1704
+ { label: "center", value: "center", icon: "AlignCenter16" },
1705
+ { label: "flex-end", value: "flex-end", icon: "AlignRight16" }
1706
+ ],
1707
+ defaultValue: "center"
1708
+ }),
1709
+ gutter: GapX({
1710
+ preset: [{ deviceId: "desktop", value: { value: 10, unit: "px" } }],
1711
+ label: "Link gap",
1712
+ min: 0,
1713
+ max: 100,
1714
+ step: 1,
1715
+ defaultValue: { value: 0, unit: "px" }
1716
+ }),
1717
+ width: Width({ defaultValue: { value: 100, unit: "%" } }),
1718
+ margin: Margin({
1719
+ preset: [
1720
+ {
1721
+ deviceId: "desktop",
1722
+ value: {
1723
+ marginTop: { value: 10, unit: "px" },
1724
+ marginRight: "auto",
1725
+ marginBottom: { value: 10, unit: "px" },
1726
+ marginLeft: "auto"
1727
+ }
1728
+ }
1729
+ ]
1730
+ })
1731
+ }
1732
+ });
1733
+ }
1734
+ function registerComponent$1(runtime) {
1735
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic(() => patch(import("./Text.es.js")))), {
1736
+ type: MakeswiftComponentType.Text,
1737
+ label: "Text",
1738
+ props: {
1739
+ id: ElementID(),
1740
+ text: RichText(() => ({
1741
+ preset: {
1742
+ document: {
1743
+ nodes: [
1744
+ {
1745
+ object: "block",
1746
+ type: "paragraph",
1747
+ nodes: [
1748
+ {
1749
+ object: "text",
1750
+ text: ipsum(3),
1751
+ marks: [
1752
+ {
1753
+ object: "mark",
1754
+ type: "typography",
1755
+ data: {
1756
+ value: {
1757
+ id: null,
1758
+ style: [
1759
+ {
1760
+ deviceId: "mobile",
1761
+ value: { fontSize: { value: 16, unit: "px" } }
1762
+ },
1763
+ {
1764
+ deviceId: "desktop",
1765
+ value: {
1766
+ fontWeight: 400,
1767
+ fontSize: { value: 18, unit: "px" },
1768
+ lineHeight: 1.5
1769
+ }
1770
+ }
1771
+ ]
1772
+ }
1773
+ }
1774
+ }
1775
+ ]
1776
+ }
1777
+ ]
1778
+ }
1779
+ ]
1780
+ }
1781
+ }
1782
+ })),
1783
+ width: Width({
1784
+ preset: [{ deviceId: "desktop", value: { value: 700, unit: "px" } }],
1785
+ defaultValue: { value: 100, unit: "%" }
1786
+ }),
1787
+ margin: Margin({
1788
+ preset: [
1789
+ {
1790
+ deviceId: "desktop",
1791
+ value: {
1792
+ marginTop: null,
1793
+ marginRight: "auto",
1794
+ marginBottom: { value: 20, unit: "px" },
1795
+ marginLeft: "auto"
1796
+ }
1797
+ }
1798
+ ]
1799
+ })
1800
+ }
1801
+ });
1802
+ }
1803
+ function registerComponent(runtime) {
1804
+ return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic(() => patch(import("./Video.es.js")))), {
1805
+ type: MakeswiftComponentType.Video,
1806
+ label: "Video",
1807
+ icon: "Video40",
1808
+ props: {
1809
+ id: ElementID(),
1810
+ video: Video({ preset: { controls: true } }),
1811
+ width: Width({ defaultValue: { value: 560, unit: "px" } }),
1812
+ margin: Margin(),
1813
+ borderRadius: BorderRadius()
1814
+ }
1815
+ });
1816
+ }
1817
+ function registerBuiltinComponents(runtime) {
1818
+ const unregisterBoxComponent = registerComponent$c(runtime);
1819
+ const unregisterButtonComponent = registerComponent$b(runtime);
1820
+ const unregisterCarouselComponent = registerComponent$a(runtime);
1821
+ const unregisterCountdownComponent = registerComponent$9(runtime);
1822
+ const unregisterDividerComponent = registerComponent$8(runtime);
1823
+ const unregisterEmbedComponent = registerComponent$7(runtime);
1824
+ const unregisterFormComponent = registerComponent$6(runtime);
1825
+ const unregisterImageComponent = registerComponent$5(runtime);
1826
+ const unregisterNavigationComponent = registerComponent$4(runtime);
1827
+ const unregisterRootComponent = registerComponent$3(runtime);
1828
+ const unregisterSocialLinksComponent = registerComponent$2(runtime);
1829
+ const unregisterTextComponent = registerComponent$1(runtime);
1830
+ const unregisterVideoComponent = registerComponent(runtime);
1831
+ return () => {
1832
+ unregisterBoxComponent();
1833
+ unregisterButtonComponent();
1834
+ unregisterCarouselComponent();
1835
+ unregisterCountdownComponent();
1836
+ unregisterDividerComponent();
1837
+ unregisterEmbedComponent();
1838
+ unregisterFormComponent();
1839
+ unregisterImageComponent();
1840
+ unregisterNavigationComponent();
1841
+ unregisterRootComponent();
1842
+ unregisterSocialLinksComponent();
1843
+ unregisterTextComponent();
1844
+ unregisterTextComponent();
1845
+ unregisterVideoComponent();
1846
+ };
1847
+ }
1848
+ var _path;
1849
+ function _extends() {
1850
+ _extends = Object.assign || function(target) {
1851
+ for (var i = 1; i < arguments.length; i++) {
1852
+ var source = arguments[i];
1853
+ for (var key in source) {
1854
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
1855
+ target[key] = source[key];
1856
+ }
1857
+ }
1858
+ }
1859
+ return target;
1860
+ };
1861
+ return _extends.apply(this, arguments);
1862
+ }
1863
+ var SvgWarning20 = function SvgWarning202(props) {
1864
+ return /* @__PURE__ */ React.createElement("svg", _extends({
1865
+ width: 20,
1866
+ height: 20,
1867
+ viewBox: "0 0 20 20",
1868
+ xmlns: "http://www.w3.org/2000/svg"
1869
+ }, props), _path || (_path = /* @__PURE__ */ React.createElement("path", {
1870
+ fillRule: "evenodd",
1871
+ clipRule: "evenodd",
1872
+ d: "M2.89864 18H17.1014C18.4183 18 19.2633 16.6003 18.65 15.4349L11.5486 1.94236C10.8925 0.69577 9.10749 0.695766 8.45139 1.94236L1.35003 15.4349C0.736692 16.6003 1.58174 18 2.89864 18ZM9 6C9 5.44772 9.44771 5 10 5C10.5523 5 11 5.44772 11 6V11C11 11.5523 10.5523 12 10 12C9.44771 12 9 11.5523 9 11V6ZM11.25 14.75C11.25 15.4404 10.6904 16 10 16C9.30964 16 8.75 15.4404 8.75 14.75C8.75 14.0596 9.30964 13.5 10 13.5C10.6904 13.5 11.25 14.0596 11.25 14.75Z"
1873
+ })));
1874
+ };
1875
+ const ErrorDiv = styled("div")`
1876
+ width: 100%;
1877
+ height: 54px;
1878
+ background-color: #fcedf2;
1879
+ border-radius: 6px;
1880
+ padding: 16px;
1881
+ display: flex;
1882
+ align-items: center;
1883
+ gap: 8px;
1884
+ color: #c73e6d;
1885
+ fill: currentColor;
1886
+ font-family: Heebo, sans-serif;
1887
+ font-size: 16px;
1888
+ `;
1889
+ const FallbackComponent = forwardRef(function FallbackComponent2({
1890
+ text
1891
+ }, ref) {
1892
+ return /* @__PURE__ */ jsxs(ErrorDiv, {
1893
+ ref,
1894
+ children: [/* @__PURE__ */ jsx(SvgWarning20, {}), /* @__PURE__ */ jsx("span", {
1895
+ children: text
1896
+ })]
1897
+ });
1898
+ });
1899
+ function isNonNullable(value) {
1900
+ return value != null;
1901
+ }
1902
+ function mapSideColor(swatches, _c) {
1903
+ var _d = _c, { color } = _d, restOfSide = __objRest(_d, ["color"]);
1904
+ return __spreadProps(__spreadValues({}, restOfSide), {
1905
+ color: color && {
1906
+ alpha: color.alpha,
1907
+ swatch: swatches.find((s) => s && s.id === color.swatchId)
1908
+ }
1909
+ });
1910
+ }
1911
+ function useBorder(value) {
1912
+ const swatchIds = value == null ? [] : [
1913
+ ...Array.from(new Set(value.map(({ value: { borderTop, borderLeft, borderBottom, borderRight } }) => [
1914
+ borderTop && borderTop.color && borderTop.color.swatchId,
1915
+ borderBottom && borderBottom.color && borderBottom.color.swatchId,
1916
+ borderLeft && borderLeft.color && borderLeft.color.swatchId,
1917
+ borderRight && borderRight.color && borderRight.color.swatchId
1918
+ ]).reduce((a, b) => a.concat(b)).filter(isNonNullable)))
1919
+ ];
1920
+ const skip = value == null || swatchIds.length === 0;
1921
+ const { error, data = {} } = useQuery(SWATCHES_BY_ID, { skip, variables: { ids: swatchIds } });
1922
+ if (value == null || error != null)
1923
+ return null;
1924
+ const { swatches = [] } = data;
1925
+ return value.map((_a) => {
1926
+ var _b = _a, { value: { borderTop, borderBottom, borderLeft, borderRight } } = _b, rest = __objRest(_b, ["value"]);
1927
+ return __spreadProps(__spreadValues({}, rest), {
1928
+ value: {
1929
+ borderTop: borderTop && mapSideColor(swatches, borderTop),
1930
+ borderBottom: borderBottom && mapSideColor(swatches, borderBottom),
1931
+ borderLeft: borderLeft && mapSideColor(swatches, borderLeft),
1932
+ borderRight: borderRight && mapSideColor(swatches, borderRight)
1933
+ }
1934
+ });
1935
+ });
1936
+ }
1937
+ function useResponsiveColor(color) {
1938
+ const swatchIds = color == null ? [] : [...Array.from(new Set(color.map(({ value: v }) => v && v.swatchId).filter(isNonNullable)))];
1939
+ const skip = swatchIds.length === 0;
1940
+ const { error, data = {} } = useQuery(SWATCHES_BY_ID, { skip, variables: { ids: swatchIds } });
1941
+ if (color == null || error != null)
1942
+ return null;
1943
+ const { swatches = [] } = data;
1944
+ return color.map((_a) => {
1945
+ var _b = _a, { value: v } = _b, rest = __objRest(_b, ["value"]);
1946
+ const { swatchId, alpha } = v;
1947
+ const swatch = swatches.find((s) => s && s.id === swatchId);
1948
+ return swatch == null ? null : __spreadProps(__spreadValues({}, rest), { value: { swatch, alpha } });
1949
+ }).filter(isNonNullable);
1950
+ }
1951
+ function useFile(fileId) {
1952
+ const { error, data = {} } = useQuery(FILE_BY_ID, {
1953
+ skip: fileId == null,
1954
+ variables: { id: fileId }
1955
+ });
1956
+ if (fileId == null || error != null)
1957
+ return null;
1958
+ return data.file;
1959
+ }
1960
+ const isSSR = typeof window === "undefined" || /ServerSideRendering/.test(window.navigator && window.navigator.userAgent);
1961
+ const useIsomorphicLayoutEffect = isSSR ? useEffect : useLayoutEffect;
1962
+ function usePage(pageId) {
1963
+ const { error, data = {} } = useQuery(PAGE_PATHNAMES_BY_ID, {
1964
+ skip: pageId == null,
1965
+ variables: { ids: [pageId] }
1966
+ });
1967
+ if (pageId == null || error != null)
1968
+ return null;
1969
+ const { pagePathnamesById: [page] = [] } = data;
1970
+ return page;
1971
+ }
1972
+ function responsiveStyle(responsiveValues, join$1, strategy) {
1973
+ return join(responsiveValues, join$1, strategy).reduce((acc, { deviceId, value }) => {
1974
+ const device = getDevice(deviceId);
1975
+ const mediaQuery = getDeviceMediaQuery(device);
1976
+ return __spreadProps(__spreadValues({}, acc), {
1977
+ [mediaQuery]: __spreadValues(__spreadValues({}, acc[mediaQuery]), value)
1978
+ });
1979
+ }, {});
1980
+ }
1981
+ function responsiveWidth(widthData, defaultValue = "100%") {
1982
+ return __spreadValues({
1983
+ maxWidth: "100%"
1984
+ }, responsiveStyle([widthData], ([width = defaultValue]) => ({
1985
+ width: typeof width === "object" ? `${width.value}${width.unit}` : width
1986
+ })));
1987
+ }
1988
+ function colorToString(color) {
1989
+ return color && color.swatch ? `hsla(${color.swatch.hue},${color.swatch.saturation}%,${color.swatch.lightness}%,${color.alpha})` : "";
1990
+ }
1991
+ function murmur2(str) {
1992
+ var h = 0;
1993
+ var k, i = 0, len = str.length;
1994
+ for (; len >= 4; ++i, len -= 4) {
1995
+ k = str.charCodeAt(i) & 255 | (str.charCodeAt(++i) & 255) << 8 | (str.charCodeAt(++i) & 255) << 16 | (str.charCodeAt(++i) & 255) << 24;
1996
+ k = (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16);
1997
+ k ^= k >>> 24;
1998
+ h = (k & 65535) * 1540483477 + ((k >>> 16) * 59797 << 16) ^ (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
1999
+ }
2000
+ switch (len) {
2001
+ case 3:
2002
+ h ^= (str.charCodeAt(i + 2) & 255) << 16;
2003
+ case 2:
2004
+ h ^= (str.charCodeAt(i + 1) & 255) << 8;
2005
+ case 1:
2006
+ h ^= str.charCodeAt(i) & 255;
2007
+ h = (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
2008
+ }
2009
+ h ^= h >>> 13;
2010
+ h = (h & 65535) * 1540483477 + ((h >>> 16) * 59797 << 16);
2011
+ return ((h ^ h >>> 15) >>> 0).toString(36);
2012
+ }
2013
+ var unitlessKeys = {
2014
+ animationIterationCount: 1,
2015
+ borderImageOutset: 1,
2016
+ borderImageSlice: 1,
2017
+ borderImageWidth: 1,
2018
+ boxFlex: 1,
2019
+ boxFlexGroup: 1,
2020
+ boxOrdinalGroup: 1,
2021
+ columnCount: 1,
2022
+ columns: 1,
2023
+ flex: 1,
2024
+ flexGrow: 1,
2025
+ flexPositive: 1,
2026
+ flexShrink: 1,
2027
+ flexNegative: 1,
2028
+ flexOrder: 1,
2029
+ gridRow: 1,
2030
+ gridRowEnd: 1,
2031
+ gridRowSpan: 1,
2032
+ gridRowStart: 1,
2033
+ gridColumn: 1,
2034
+ gridColumnEnd: 1,
2035
+ gridColumnSpan: 1,
2036
+ gridColumnStart: 1,
2037
+ msGridRow: 1,
2038
+ msGridRowSpan: 1,
2039
+ msGridColumn: 1,
2040
+ msGridColumnSpan: 1,
2041
+ fontWeight: 1,
2042
+ lineHeight: 1,
2043
+ opacity: 1,
2044
+ order: 1,
2045
+ orphans: 1,
2046
+ tabSize: 1,
2047
+ widows: 1,
2048
+ zIndex: 1,
2049
+ zoom: 1,
2050
+ WebkitLineClamp: 1,
2051
+ fillOpacity: 1,
2052
+ floodOpacity: 1,
2053
+ stopOpacity: 1,
2054
+ strokeDasharray: 1,
2055
+ strokeDashoffset: 1,
2056
+ strokeMiterlimit: 1,
2057
+ strokeOpacity: 1,
2058
+ strokeWidth: 1
2059
+ };
2060
+ function memoize(fn) {
2061
+ var cache2 = /* @__PURE__ */ Object.create(null);
2062
+ return function(arg) {
2063
+ if (cache2[arg] === void 0)
2064
+ cache2[arg] = fn(arg);
2065
+ return cache2[arg];
2066
+ };
2067
+ }
2068
+ var hyphenateRegex = /[A-Z]|^ms/g;
2069
+ var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;
2070
+ var isCustomProperty = function isCustomProperty2(property) {
2071
+ return property.charCodeAt(1) === 45;
2072
+ };
2073
+ var isProcessableValue = function isProcessableValue2(value) {
2074
+ return value != null && typeof value !== "boolean";
2075
+ };
2076
+ var processStyleName = /* @__PURE__ */ memoize(function(styleName) {
2077
+ return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, "-$&").toLowerCase();
2078
+ });
2079
+ var processStyleValue = function processStyleValue2(key, value) {
2080
+ switch (key) {
2081
+ case "animation":
2082
+ case "animationName": {
2083
+ if (typeof value === "string") {
2084
+ return value.replace(animationRegex, function(match, p1, p2) {
2085
+ cursor = {
2086
+ name: p1,
2087
+ styles: p2,
2088
+ next: cursor
2089
+ };
2090
+ return p1;
2091
+ });
2092
+ }
2093
+ }
2094
+ }
2095
+ if (unitlessKeys[key] !== 1 && !isCustomProperty(key) && typeof value === "number" && value !== 0) {
2096
+ return value + "px";
2097
+ }
2098
+ return value;
2099
+ };
2100
+ function handleInterpolation(mergedProps, registered, interpolation) {
2101
+ if (interpolation == null) {
2102
+ return "";
2103
+ }
2104
+ if (interpolation.__emotion_styles !== void 0) {
2105
+ return interpolation;
2106
+ }
2107
+ switch (typeof interpolation) {
2108
+ case "boolean": {
2109
+ return "";
2110
+ }
2111
+ case "object": {
2112
+ if (interpolation.anim === 1) {
2113
+ cursor = {
2114
+ name: interpolation.name,
2115
+ styles: interpolation.styles,
2116
+ next: cursor
2117
+ };
2118
+ return interpolation.name;
2119
+ }
2120
+ if (interpolation.styles !== void 0) {
2121
+ var next = interpolation.next;
2122
+ if (next !== void 0) {
2123
+ while (next !== void 0) {
2124
+ cursor = {
2125
+ name: next.name,
2126
+ styles: next.styles,
2127
+ next: cursor
2128
+ };
2129
+ next = next.next;
2130
+ }
2131
+ }
2132
+ var styles = interpolation.styles + ";";
2133
+ return styles;
2134
+ }
2135
+ return createStringFromObject(mergedProps, registered, interpolation);
2136
+ }
2137
+ case "function": {
2138
+ if (mergedProps !== void 0) {
2139
+ var previousCursor = cursor;
2140
+ var result = interpolation(mergedProps);
2141
+ cursor = previousCursor;
2142
+ return handleInterpolation(mergedProps, registered, result);
2143
+ }
2144
+ break;
2145
+ }
2146
+ }
2147
+ if (registered == null) {
2148
+ return interpolation;
2149
+ }
2150
+ var cached = registered[interpolation];
2151
+ return cached !== void 0 ? cached : interpolation;
2152
+ }
2153
+ function createStringFromObject(mergedProps, registered, obj) {
2154
+ var string = "";
2155
+ if (Array.isArray(obj)) {
2156
+ for (var i = 0; i < obj.length; i++) {
2157
+ string += handleInterpolation(mergedProps, registered, obj[i]) + ";";
2158
+ }
2159
+ } else {
2160
+ for (var _key in obj) {
2161
+ var value = obj[_key];
2162
+ if (typeof value !== "object") {
2163
+ if (registered != null && registered[value] !== void 0) {
2164
+ string += _key + "{" + registered[value] + "}";
2165
+ } else if (isProcessableValue(value)) {
2166
+ string += processStyleName(_key) + ":" + processStyleValue(_key, value) + ";";
2167
+ }
2168
+ } else {
2169
+ if (_key === "NO_COMPONENT_SELECTOR" && false) {
2170
+ throw new Error("Component selectors can only be used in conjunction with @emotion/babel-plugin.");
2171
+ }
2172
+ if (Array.isArray(value) && typeof value[0] === "string" && (registered == null || registered[value[0]] === void 0)) {
2173
+ for (var _i = 0; _i < value.length; _i++) {
2174
+ if (isProcessableValue(value[_i])) {
2175
+ string += processStyleName(_key) + ":" + processStyleValue(_key, value[_i]) + ";";
2176
+ }
2177
+ }
2178
+ } else {
2179
+ var interpolated = handleInterpolation(mergedProps, registered, value);
2180
+ switch (_key) {
2181
+ case "animation":
2182
+ case "animationName": {
2183
+ string += processStyleName(_key) + ":" + interpolated + ";";
2184
+ break;
2185
+ }
2186
+ default: {
2187
+ string += _key + "{" + interpolated + "}";
2188
+ }
2189
+ }
2190
+ }
2191
+ }
2192
+ }
2193
+ }
2194
+ return string;
2195
+ }
2196
+ var labelPattern = /label:\s*([^\s;\n{]+)\s*(;|$)/g;
2197
+ var cursor;
2198
+ var serializeStyles = function serializeStyles2(args, registered, mergedProps) {
2199
+ if (args.length === 1 && typeof args[0] === "object" && args[0] !== null && args[0].styles !== void 0) {
2200
+ return args[0];
2201
+ }
2202
+ var stringMode = true;
2203
+ var styles = "";
2204
+ cursor = void 0;
2205
+ var strings = args[0];
2206
+ if (strings == null || strings.raw === void 0) {
2207
+ stringMode = false;
2208
+ styles += handleInterpolation(mergedProps, registered, strings);
2209
+ } else {
2210
+ styles += strings[0];
2211
+ }
2212
+ for (var i = 1; i < args.length; i++) {
2213
+ styles += handleInterpolation(mergedProps, registered, args[i]);
2214
+ if (stringMode) {
2215
+ styles += strings[i];
2216
+ }
2217
+ }
2218
+ labelPattern.lastIndex = 0;
2219
+ var identifierName = "";
2220
+ var match;
2221
+ while ((match = labelPattern.exec(styles)) !== null) {
2222
+ identifierName += "-" + match[1];
2223
+ }
2224
+ var name = murmur2(styles) + identifierName;
2225
+ return {
2226
+ name,
2227
+ styles,
2228
+ next: cursor
2229
+ };
2230
+ };
2231
+ var isBrowser = true;
2232
+ var registerStyles = function registerStyles2(cache2, serialized, isStringTag) {
2233
+ var className = cache2.key + "-" + serialized.name;
2234
+ if ((isStringTag === false || isBrowser === false) && cache2.registered[className] === void 0) {
2235
+ cache2.registered[className] = serialized.styles;
2236
+ }
2237
+ };
2238
+ var insertStyles = function insertStyles2(cache2, serialized, isStringTag) {
2239
+ registerStyles(cache2, serialized, isStringTag);
2240
+ var className = cache2.key + "-" + serialized.name;
2241
+ if (cache2.inserted[serialized.name] === void 0) {
2242
+ var current = serialized;
2243
+ do {
2244
+ cache2.insert(serialized === current ? "." + className : "", current, cache2.sheet, true);
2245
+ current = current.next;
2246
+ } while (current !== void 0);
2247
+ }
2248
+ };
2249
+ const isServer = typeof window === "undefined";
2250
+ const useInsertionEffectSpecifier = "useInsertionEffect";
2251
+ const useInsertionEffect = (_e = React[useInsertionEffectSpecifier]) != null ? _e : React.useLayoutEffect;
2252
+ function useStyle(style) {
2253
+ const serialized = serializeStyles([style], cache.registered);
2254
+ registerStyles(cache, serialized, false);
2255
+ useInsertionEffect(() => {
2256
+ insertStyles(cache, serialized, false);
2257
+ });
2258
+ if (isServer)
2259
+ insertStyles(cache, serialized, false);
2260
+ return `${cache.key}-${serialized.name}`;
2261
+ }
2262
+ function useStyleControlCssObject(style, controlDefinition) {
2263
+ const { properties } = controlDefinition.config;
2264
+ return __spreadValues(__spreadValues({}, properties.includes(StyleControlProperty.Width) && {
2265
+ maxWidth: "100%"
2266
+ }), responsiveStyle([
2267
+ style == null ? void 0 : style.width,
2268
+ style == null ? void 0 : style.margin,
2269
+ style == null ? void 0 : style.padding,
2270
+ useBorder(style == null ? void 0 : style.border),
2271
+ style == null ? void 0 : style.borderRadius,
2272
+ style == null ? void 0 : style.textStyle
2273
+ ], ([width, margin, padding, border, borderRadius, textStyle]) => {
2274
+ var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
2275
+ return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, properties.includes(StyleControlProperty.Width) && {
2276
+ width: (_a = widthToString(width)) != null ? _a : "100%"
2277
+ }), properties.includes(StyleControlProperty.Margin) && {
2278
+ marginTop: (_b = marginToString(margin == null ? void 0 : margin.marginTop)) != null ? _b : 0,
2279
+ marginRight: (_c = marginToString(margin == null ? void 0 : margin.marginRight)) != null ? _c : "auto",
2280
+ marginBottom: (_d = marginToString(margin == null ? void 0 : margin.marginBottom)) != null ? _d : 0,
2281
+ marginLeft: (_e2 = marginToString(margin == null ? void 0 : margin.marginLeft)) != null ? _e2 : "auto"
2282
+ }), properties.includes(StyleControlProperty.Padding) && {
2283
+ paddingTop: (_f = paddingToString(padding == null ? void 0 : padding.paddingTop)) != null ? _f : 0,
2284
+ paddingRight: (_g = paddingToString(padding == null ? void 0 : padding.paddingRight)) != null ? _g : 0,
2285
+ paddingBottom: (_h = paddingToString(padding == null ? void 0 : padding.paddingBottom)) != null ? _h : 0,
2286
+ paddingLeft: (_i = paddingToString(padding == null ? void 0 : padding.paddingLeft)) != null ? _i : 0
2287
+ }), properties.includes(StyleControlProperty.Border) && {
2288
+ borderTop: (_j = borderSideToString(border == null ? void 0 : border.borderTop)) != null ? _j : "0 solid black",
2289
+ borderRight: (_k = borderSideToString(border == null ? void 0 : border.borderRight)) != null ? _k : "0 solid black",
2290
+ borderBottom: (_l = borderSideToString(border == null ? void 0 : border.borderBottom)) != null ? _l : "0 solid black",
2291
+ borderLeft: (_m = borderSideToString(border == null ? void 0 : border.borderLeft)) != null ? _m : "0 solid black"
2292
+ }), properties.includes(StyleControlProperty.BorderRadius) && {
2293
+ borderTopLeftRadius: (_n = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopLeftRadius)) != null ? _n : 0,
2294
+ borderTopRightRadius: (_o = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopRightRadius)) != null ? _o : 0,
2295
+ borderBottomRightRadius: (_p = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomRightRadius)) != null ? _p : 0,
2296
+ borderBottomLeftRadius: (_q = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomLeftRadius)) != null ? _q : 0
2297
+ }), properties.includes(StyleControlProperty.TextStyle) && __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, (textStyle == null ? void 0 : textStyle.fontFamily) && { fontFamily: textStyle.fontFamily }), (textStyle == null ? void 0 : textStyle.letterSpacing) && { letterSpacing: textStyle.letterSpacing }), (textStyle == null ? void 0 : textStyle.fontSize) && { fontSize: fontSizeToString(textStyle.fontSize) }), (textStyle == null ? void 0 : textStyle.fontWeight) && { fontWeight: textStyle.fontWeight }), {
2298
+ textTransform: (_r = textStyle == null ? void 0 : textStyle.textTransform) != null ? _r : [],
2299
+ fontStyle: (_s = textStyle == null ? void 0 : textStyle.fontStyle) != null ? _s : []
2300
+ }));
2301
+ }));
2302
+ function widthToString(widthProperty) {
2303
+ if (widthProperty == null)
2304
+ return null;
2305
+ return `${widthProperty.value}${widthProperty.unit}`;
2306
+ }
2307
+ function marginToString(marginProperty) {
2308
+ if (marginProperty == null)
2309
+ return null;
2310
+ if (marginProperty === "auto")
2311
+ return marginProperty;
2312
+ return `${marginProperty.value}${marginProperty.unit}`;
2313
+ }
2314
+ function paddingToString(paddingProperty) {
2315
+ if (paddingProperty == null)
2316
+ return null;
2317
+ return `${paddingProperty.value}${paddingProperty.unit}`;
2318
+ }
2319
+ function borderSideToString(borderSide) {
2320
+ if (borderSide == null)
2321
+ return null;
2322
+ const { width, color, style: style2 } = borderSide;
2323
+ return `${width != null ? width : 0}px ${style2} ${color != null ? colorToString(color) : "black"}`;
2324
+ }
2325
+ function borderRadiusToString(borderRadius) {
2326
+ if (borderRadius == null)
2327
+ return null;
2328
+ return `${borderRadius.value}${borderRadius.unit}`;
2329
+ }
2330
+ function fontSizeToString(fontSize) {
2331
+ return `${fontSize.value}${fontSize.unit}`;
2332
+ }
2333
+ }
2334
+ function useFormattedStyle(styleControlData, controlDefinition) {
2335
+ const style = useStyleControlCssObject(styleControlData, controlDefinition);
2336
+ return useStyle(style);
2337
+ }
2338
+ function RenderHook({
2339
+ hook: useHook,
2340
+ parameters,
2341
+ children
2342
+ }) {
2343
+ return children(useHook(...parameters));
2344
+ }
2345
+ function useCheckboxControlValue(data, definition) {
2346
+ return data != null ? data : definition.config.defaultValue;
2347
+ }
2348
+ function useColorValue(data, definition) {
2349
+ var _a, _b;
2350
+ const result = useQuery(SWATCHES_BY_ID, {
2351
+ variables: { ids: [data == null ? void 0 : data.swatchId] },
2352
+ skip: (data == null ? void 0 : data.swatchId) == null
2353
+ });
2354
+ if (data === void 0) {
2355
+ const { defaultValue } = definition.config;
2356
+ if (defaultValue === void 0)
2357
+ return void 0;
2358
+ let defaultColor;
2359
+ try {
2360
+ defaultColor = ColorHelper(definition.config.defaultValue);
2361
+ } catch {
2362
+ defaultColor = ColorHelper();
2363
+ }
2364
+ return defaultColor.rgb().string();
2365
+ }
2366
+ const [swatch] = (_b = (_a = result.data) == null ? void 0 : _a.swatches) != null ? _b : [null];
2367
+ return ColorHelper({ h: swatch == null ? void 0 : swatch.hue, s: swatch == null ? void 0 : swatch.saturation, l: swatch == null ? void 0 : swatch.lightness }).alpha(data.alpha).rgb().string();
2368
+ }
2369
+ function useComboboxControlValue(data) {
2370
+ return data == null ? void 0 : data.value;
2371
+ }
2372
+ function useImageControlValue(data, definition) {
2373
+ var _a;
2374
+ const format = (_a = definition.config.format) != null ? _a : ImageControlValueFormat.URL;
2375
+ const file = useFile(data);
2376
+ if (format === ImageControlValueFormat.URL) {
2377
+ return file == null ? void 0 : file.publicUrl;
2378
+ }
2379
+ if (file == null || file.dimensions == null)
2380
+ return void 0;
2381
+ return {
2382
+ url: file.publicUrl,
2383
+ dimensions: { width: file.dimensions.width, height: file.dimensions.height }
2384
+ };
2385
+ }
2386
+ function useLinkControlValue(link, _definition) {
2387
+ var _a;
2388
+ const page = usePage(link && link.type === "OPEN_PAGE" ? link.payload.pageId : null);
2389
+ const elementKey = (link == null ? void 0 : link.type) === "SCROLL_TO_ELEMENT" ? (_a = link.payload.elementIdConfig) == null ? void 0 : _a.elementKey : null;
2390
+ const elementId = useElementId(elementKey);
2391
+ let href = "#";
2392
+ let target;
2393
+ let block;
2394
+ if (link) {
2395
+ switch (link.type) {
2396
+ case "OPEN_PAGE": {
2397
+ if (page)
2398
+ href = `/${page.pathname}`;
2399
+ target = link.payload.openInNewTab ? "_blank" : "_self";
2400
+ break;
2401
+ }
2402
+ case "OPEN_URL": {
2403
+ href = link.payload.url;
2404
+ target = link.payload.openInNewTab ? "_blank" : "_self";
2405
+ break;
2406
+ }
2407
+ case "SEND_EMAIL": {
2408
+ const { to, subject = "", body = "" } = link.payload;
2409
+ if (to != null)
2410
+ href = `mailto:${to}?subject=${subject}&body=${body}`;
2411
+ break;
2412
+ }
2413
+ case "CALL_PHONE": {
2414
+ href = `tel:${link.payload.phoneNumber}`;
2415
+ break;
2416
+ }
2417
+ case "SCROLL_TO_ELEMENT": {
2418
+ href = `#${elementId != null ? elementId : ""}`;
2419
+ block = link.payload.block;
2420
+ break;
2421
+ }
2422
+ default:
2423
+ throw new RangeError(`Invalid link type "${link.type}."`);
2424
+ }
2425
+ }
2426
+ const handleClick = useCallback((event) => {
2427
+ if (event.defaultPrevented)
2428
+ return;
2429
+ if (link && link.type === "SCROLL_TO_ELEMENT") {
2430
+ let hash;
2431
+ try {
2432
+ hash = new URL(`http://www.example.com/${href}`).hash;
2433
+ } catch (error) {
2434
+ console.error(`Link received invalid href: ${href}`, error);
2435
+ }
2436
+ if (href != null && href === hash) {
2437
+ event.preventDefault();
2438
+ const view = event.view;
2439
+ scrollIntoView(view.document.querySelector(hash), {
2440
+ behavior: "smooth",
2441
+ block
2442
+ });
2443
+ if (view.location.hash !== hash)
2444
+ view.history.pushState({}, "", hash);
2445
+ }
2446
+ }
2447
+ }, [link, href, block]);
2448
+ const res = useMemo(() => ({ href, target, onClick: handleClick }), [href, target, handleClick]);
2449
+ return res;
2450
+ }
2451
+ function ListControlValue({
2452
+ definition,
2453
+ data,
2454
+ children
2455
+ }) {
2456
+ return (data != null ? data : []).reduce((renderFn, item) => (listControlValue) => /* @__PURE__ */ jsx(ControlValue, {
2457
+ definition: definition.config.type,
2458
+ data: item.value,
2459
+ children: (value) => renderFn([value, ...listControlValue])
2460
+ }), children)([]);
2461
+ }
2462
+ function useNumber(numberControlData, controlDefinition) {
2463
+ return numberControlData != null ? numberControlData : controlDefinition.config.defaultValue;
2464
+ }
2465
+ function useSelectControlValue(data, definition) {
2466
+ return data != null ? data : definition == null ? void 0 : definition.config.defaultValue;
2467
+ }
2468
+ function ShapeControlValue({
2469
+ definition,
2470
+ data,
2471
+ children
2472
+ }) {
2473
+ return Object.entries(definition.config.type).reduceRight((renderFn, [key, controlDefinition]) => (shapeControlValue) => /* @__PURE__ */ jsx(ControlValue, {
2474
+ definition: controlDefinition,
2475
+ data: data == null ? void 0 : data[key],
2476
+ children: (value) => renderFn(__spreadProps(__spreadValues({}, shapeControlValue), {
2477
+ [key]: value
2478
+ }))
2479
+ }), children)({});
2480
+ }
2481
+ function useTextAreaValue(data, definition) {
2482
+ return data != null ? data : definition.config.defaultValue;
2483
+ }
2484
+ function useTextInputValue(data, definition) {
2485
+ return data != null ? data : definition.config.defaultValue;
2486
+ }
2487
+ function ControlValue({
2488
+ data,
2489
+ definition,
2490
+ children
2491
+ }) {
2492
+ switch (definition.type) {
2493
+ case CheckboxControlType:
2494
+ return /* @__PURE__ */ jsx(RenderHook, {
2495
+ hook: useCheckboxControlValue,
2496
+ parameters: [data, definition],
2497
+ children: (value) => children(value)
2498
+ }, definition.type);
2499
+ case NumberControlType:
2500
+ return /* @__PURE__ */ jsx(RenderHook, {
2501
+ hook: useNumber,
2502
+ parameters: [data, definition],
2503
+ children: (value) => children(value)
2504
+ }, definition.type);
2505
+ case TextInputControlType:
2506
+ return /* @__PURE__ */ jsx(RenderHook, {
2507
+ hook: useTextInputValue,
2508
+ parameters: [data, definition],
2509
+ children: (value) => children(value)
2510
+ }, definition.type);
2511
+ case TextAreaControlType:
2512
+ return /* @__PURE__ */ jsx(RenderHook, {
2513
+ hook: useTextAreaValue,
2514
+ parameters: [data, definition],
2515
+ children: (value) => children(value)
2516
+ }, definition.type);
2517
+ case SelectControlType:
2518
+ return /* @__PURE__ */ jsx(RenderHook, {
2519
+ hook: useSelectControlValue,
2520
+ parameters: [data, definition],
2521
+ children: (value) => children(value)
2522
+ }, definition.type);
2523
+ case ColorControlType:
2524
+ return /* @__PURE__ */ jsx(RenderHook, {
2525
+ hook: useColorValue,
2526
+ parameters: [data, definition],
2527
+ children: (value) => children(value)
2528
+ }, definition.type);
2529
+ case ImageControlType:
2530
+ return /* @__PURE__ */ jsx(RenderHook, {
2531
+ hook: useImageControlValue,
2532
+ parameters: [data, definition],
2533
+ children: (value) => children(value)
2534
+ }, definition.type);
2535
+ case LinkControlType:
2536
+ return /* @__PURE__ */ jsx(RenderHook, {
2537
+ hook: useLinkControlValue,
2538
+ parameters: [data, definition],
2539
+ children: (value) => children(value)
2540
+ }, definition.type);
2541
+ case ComboboxControlType:
2542
+ return /* @__PURE__ */ jsx(RenderHook, {
2543
+ hook: useComboboxControlValue,
2544
+ parameters: [data],
2545
+ children: (value) => children(value)
2546
+ }, definition.type);
2547
+ case ShapeControlType:
2548
+ return /* @__PURE__ */ jsx(ShapeControlValue, {
2549
+ definition,
2550
+ data,
2551
+ children: (value) => children(value)
2552
+ });
2553
+ case ListControlType:
2554
+ return /* @__PURE__ */ jsx(ListControlValue, {
2555
+ definition,
2556
+ data,
2557
+ children: (value) => children(value)
2558
+ });
2559
+ default:
2560
+ return children(data);
2561
+ }
2562
+ }
2563
+ const getIndexes = (spans, index) => {
2564
+ const flattened = spans.reduce((a, s) => a.concat(s), []);
2565
+ if (index < 0 || index > flattened.length)
2566
+ throw new RangeError();
2567
+ let remainder = index;
2568
+ let rowIndex = 0;
2569
+ while (rowIndex < spans.length - 1 && remainder >= spans[rowIndex].length) {
2570
+ remainder -= spans[rowIndex].length;
2571
+ rowIndex += 1;
2572
+ }
2573
+ return [rowIndex, remainder];
2574
+ };
2575
+ function useSlot(data, control) {
2576
+ if (data == null || data.elements.length === 0) {
2577
+ return /* @__PURE__ */ jsx(Slot.Placeholder, {
2578
+ control
2579
+ });
2580
+ }
2581
+ return /* @__PURE__ */ jsx(Slot, {
2582
+ control,
2583
+ children: data.elements.map((element, i) => /* @__PURE__ */ jsx(Slot.Item, {
2584
+ control,
2585
+ grid: data.columns,
2586
+ index: i,
2587
+ children: /* @__PURE__ */ jsx(Element, {
2588
+ element
2589
+ })
2590
+ }, element.key))
2591
+ });
2592
+ }
2593
+ function Slot(_f) {
2594
+ var _g = _f, {
2595
+ as,
2596
+ control,
2597
+ children,
2598
+ className
2599
+ } = _g, restOfProps = __objRest(_g, [
2600
+ "as",
2601
+ "control",
2602
+ "children",
2603
+ "className"
2604
+ ]);
2605
+ const As = as != null ? as : "div";
2606
+ const [element, setElement] = useState(null);
2607
+ const baseClassName = useStyle({
2608
+ display: "flex",
2609
+ flexWrap: "wrap",
2610
+ width: "100%"
2611
+ });
2612
+ useEffect(() => {
2613
+ if (element == null || control == null)
2614
+ return;
2615
+ return pollBoxModel({
2616
+ element,
2617
+ onBoxModelChange: (boxModel) => control.changeContainerBoxModel(boxModel)
2618
+ });
2619
+ }, [element, control]);
2620
+ return /* @__PURE__ */ jsx(As, __spreadProps(__spreadValues({}, restOfProps), {
2621
+ ref: setElement,
2622
+ className: cx(baseClassName, className),
2623
+ children
2624
+ }));
2625
+ }
2626
+ Slot.Placeholder = SlotPlaceholder;
2627
+ Slot.Item = SlotItem;
2628
+ function SlotItem(_h) {
2629
+ var _i = _h, {
2630
+ as,
2631
+ control,
2632
+ grid,
2633
+ index,
2634
+ children,
2635
+ className
2636
+ } = _i, restOfProps = __objRest(_i, [
2637
+ "as",
2638
+ "control",
2639
+ "grid",
2640
+ "index",
2641
+ "children",
2642
+ "className"
2643
+ ]);
2644
+ const As = as != null ? as : "div";
2645
+ const [element, setElement] = useState(null);
2646
+ const baseClassName = useStyle(__spreadValues({
2647
+ display: "flex"
2648
+ }, responsiveStyle([grid], ([{
2649
+ count = 12,
2650
+ spans = [[12]]
2651
+ } = {}]) => {
2652
+ const [rowIndex, columnIndex] = getIndexes(spans, index);
2653
+ const span = spans[rowIndex][columnIndex];
2654
+ const flexBasis = `calc(100% * ${(span / count).toFixed(5)})`;
2655
+ return span === 0 ? {
2656
+ display: "none"
2657
+ } : {
2658
+ flexBasis,
2659
+ minWidth: flexBasis
2660
+ };
2661
+ })));
2662
+ useEffect(() => {
2663
+ if (element == null || control == null)
2664
+ return;
2665
+ return pollBoxModel({
2666
+ element,
2667
+ onBoxModelChange: (boxModel) => control.changeItemBoxModel(index, boxModel)
2668
+ });
2669
+ }, [element, control, index]);
2670
+ return /* @__PURE__ */ jsx(As, __spreadProps(__spreadValues({}, restOfProps), {
2671
+ ref: setElement,
2672
+ className: cx(baseClassName, className),
2673
+ children
2674
+ }));
2675
+ }
2676
+ function SlotPlaceholder({
2677
+ control
2678
+ }) {
2679
+ const [element, setElement] = useState(null);
2680
+ useEffect(() => {
2681
+ if (element == null || control == null)
2682
+ return;
2683
+ return pollBoxModel({
2684
+ element,
2685
+ onBoxModelChange: (boxModel) => control.changeContainerBoxModel(boxModel)
2686
+ });
2687
+ }, [element, control]);
2688
+ return /* @__PURE__ */ jsx("div", {
2689
+ ref: setElement,
2690
+ className: useStyle({
2691
+ width: "100%",
2692
+ background: "rgba(161, 168, 194, 0.18)",
2693
+ height: "80px"
2694
+ }),
2695
+ children: /* @__PURE__ */ jsx("svg", {
2696
+ xmlns: "http://www.w3.org/2000/svg",
2697
+ width: "100%",
2698
+ height: "100%",
2699
+ className: useStyle({
2700
+ overflow: "visible",
2701
+ padding: 8
2702
+ }),
2703
+ children: /* @__PURE__ */ jsx("rect", {
2704
+ x: 0,
2705
+ y: 0,
2706
+ width: "100%",
2707
+ height: "100%",
2708
+ strokeWidth: 2,
2709
+ strokeDasharray: "4 2",
2710
+ fill: "none",
2711
+ stroke: "rgba(161, 168, 194, 0.40)",
2712
+ rx: "4",
2713
+ ry: "4"
2714
+ })
2715
+ })
2716
+ });
2717
+ }
2718
+ function pollBoxModel({
2719
+ element,
2720
+ onBoxModelChange
2721
+ }) {
2722
+ let currentBoxModel = null;
2723
+ const handleAnimationFrameRequest = () => {
2724
+ const measuredBoxModel = getBox(element);
2725
+ if (!deepEqual(currentBoxModel, measuredBoxModel)) {
2726
+ currentBoxModel = measuredBoxModel;
2727
+ onBoxModelChange(currentBoxModel);
2728
+ }
2729
+ animationFrameHandle = requestAnimationFrame(handleAnimationFrameRequest);
2730
+ };
2731
+ let animationFrameHandle = requestAnimationFrame(handleAnimationFrameRequest);
2732
+ return () => {
2733
+ cancelAnimationFrame(animationFrameHandle);
2734
+ };
2735
+ }
2736
+ function useDeviceMode() {
2737
+ return "desktop";
2738
+ }
2739
+ function useWidth(value, descriptor, props) {
2740
+ const deviceMode = useDeviceMode();
2741
+ const options = useMemo(() => typeof descriptor.options === "function" ? descriptor.options(props, deviceMode) : descriptor.options, [props, deviceMode]);
2742
+ return useMemo(() => options.format === WidthControlValueFormats.ClassName ? css(responsiveWidth(value, options.defaultValue)) : value, [value, options.defaultValue, options.format]);
2743
+ }
2744
+ function PropsValue({
2745
+ element,
2746
+ children
2747
+ }) {
2748
+ var _a;
2749
+ const store = useStore();
2750
+ const propControllerDescriptorsRef = useRef((_a = getComponentPropControllerDescriptors(store.getState(), element.type)) != null ? _a : {});
2751
+ const props = element.props;
2752
+ const documentKey = useDocumentKey();
2753
+ const propControllers = useSelector((state) => {
2754
+ if (documentKey == null)
2755
+ return null;
2756
+ return getPropControllers(state, documentKey, element.key);
2757
+ });
2758
+ return Object.entries(propControllerDescriptorsRef.current).reduceRight((renderFn, [propName, descriptor]) => (propsValue) => {
2759
+ var _a2;
2760
+ switch (descriptor.type) {
2761
+ case CheckboxControlType:
2762
+ case NumberControlType:
2763
+ case TextInputControlType:
2764
+ case TextAreaControlType:
2765
+ case SelectControlType:
2766
+ case ColorControlType:
2767
+ case ImageControlType:
2768
+ case ComboboxControlType:
2769
+ case ShapeControlType:
2770
+ case ListControlType:
2771
+ case LinkControlType:
2772
+ return /* @__PURE__ */ jsx(ControlValue, {
2773
+ definition: descriptor,
2774
+ data: props[propName],
2775
+ children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
2776
+ [propName]: value
2777
+ }))
2778
+ });
2779
+ case StyleControlType:
2780
+ return /* @__PURE__ */ jsx(RenderHook, {
2781
+ hook: useFormattedStyle,
2782
+ parameters: [props[propName], descriptor],
2783
+ children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
2784
+ [propName]: value
2785
+ }))
2786
+ }, descriptor.type);
2787
+ case SlotControlType: {
2788
+ const control = (_a2 = propControllers == null ? void 0 : propControllers[propName]) != null ? _a2 : null;
2789
+ return /* @__PURE__ */ jsx(RenderHook, {
2790
+ hook: useSlot,
2791
+ parameters: [props[propName], control],
2792
+ children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
2793
+ [propName]: value
2794
+ }))
2795
+ }, descriptor.type);
2796
+ }
2797
+ case Types.Width:
2798
+ return /* @__PURE__ */ jsx(RenderHook, {
2799
+ hook: useWidth,
2800
+ parameters: [props[propName], descriptor, props],
2801
+ children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
2802
+ [propName]: value
2803
+ }))
2804
+ }, descriptor.type);
2805
+ case Types.ResponsiveColor:
2806
+ return /* @__PURE__ */ jsx(RenderHook, {
2807
+ hook: useResponsiveColor,
2808
+ parameters: [props[propName]],
2809
+ children: (value) => renderFn(__spreadProps(__spreadValues({}, propsValue), {
2810
+ [propName]: value
2811
+ }))
2812
+ }, descriptor.type);
2813
+ default:
2814
+ return renderFn(__spreadProps(__spreadValues({}, propsValue), {
2815
+ [propName]: props[propName]
2816
+ }));
2817
+ }
2818
+ }, children)({});
2819
+ }
2820
+ function suppressWarningAndFindDomNode(instance) {
2821
+ const error = console.error;
2822
+ console.error = (...args) => {
2823
+ if (typeof args[0] === "string" && args[0].includes("%s is deprecated in StrictMode."))
2824
+ return;
2825
+ return error.apply(console, args);
2826
+ };
2827
+ const foundDomNode = findDOMNode(instance);
2828
+ console.error = error;
2829
+ return foundDomNode;
2830
+ }
2831
+ class FindDomNodeClassComponent extends Component {
2832
+ componentDidMount() {
2833
+ this.setInnerRef(suppressWarningAndFindDomNode(this));
2834
+ }
2835
+ componentDidUpdate() {
2836
+ this.setInnerRef(suppressWarningAndFindDomNode(this));
2837
+ }
2838
+ setInnerRef(current) {
2839
+ const {
2840
+ innerRef
2841
+ } = this.props;
2842
+ if (innerRef == null)
2843
+ return;
2844
+ if (typeof innerRef === "function")
2845
+ innerRef(current);
2846
+ else
2847
+ innerRef.current = current;
2848
+ }
2849
+ render() {
2850
+ return /* @__PURE__ */ jsx(Fragment, {
2851
+ children: this.props.children
2852
+ });
2853
+ }
2854
+ }
2855
+ const FindDomNode = forwardRef(function FindDomNode2(props, ref) {
2856
+ return /* @__PURE__ */ jsx(FindDomNodeClassComponent, __spreadProps(__spreadValues({}, props), {
2857
+ innerRef: ref
2858
+ }));
2859
+ });
2860
+ const storeContextDefaultValue = configureStore();
2861
+ function createReactRuntime(store) {
2862
+ return {
2863
+ registerComponent(component, {
2864
+ type,
2865
+ label,
2866
+ icon = "Cube40",
2867
+ hidden = false,
2868
+ props
2869
+ }) {
2870
+ const unregisterComponent = store.dispatch(registerComponentEffect(type, {
2871
+ label,
2872
+ icon,
2873
+ hidden
2874
+ }, props != null ? props : {}));
2875
+ const unregisterReactComponent = store.dispatch(registerReactComponentEffect(type, component));
2876
+ return () => {
2877
+ unregisterComponent();
2878
+ unregisterReactComponent();
2879
+ };
2880
+ }
2881
+ };
2882
+ }
2883
+ const ReactRuntime = createReactRuntime(storeContextDefaultValue);
2884
+ registerBuiltinComponents(ReactRuntime);
2885
+ const Context = createContext(storeContextDefaultValue);
2886
+ function RuntimeProvider({
2887
+ client,
2888
+ children,
2889
+ rootElements
2890
+ }) {
2891
+ const [store, setStore] = useState(() => {
2892
+ const store2 = configureStore({
2893
+ preloadedState: storeContextDefaultValue.getState(),
2894
+ rootElements
2895
+ });
2896
+ return store2;
2897
+ });
2898
+ useEffect(() => {
2899
+ var _a;
2900
+ const unregisterDocuments = Array.from((_a = rootElements == null ? void 0 : rootElements.entries()) != null ? _a : []).map(([documentKey, rootElement]) => store.dispatch(registerDocumentEffect(createDocument(documentKey, rootElement))));
2901
+ return () => {
2902
+ unregisterDocuments.forEach((unregisterDocument) => {
2903
+ unregisterDocument();
2904
+ });
2905
+ };
2906
+ }, [store, rootElements]);
2907
+ useEffect(() => {
2908
+ const isInBuilder = window.parent !== window;
2909
+ if (isInBuilder)
2910
+ setReactBuilderPreviewStore();
2911
+ async function setReactBuilderPreviewStore() {
2912
+ const ReactBuilderPreview = await import("./react-builder-preview.es.js");
2913
+ setStore((store2) => ReactBuilderPreview.configureStore({
2914
+ preloadedState: store2.getState(),
2915
+ client: client.apolloClient
2916
+ }));
2917
+ }
2918
+ }, [client]);
2919
+ return /* @__PURE__ */ jsx(Context.Provider, {
2920
+ value: store,
2921
+ children: /* @__PURE__ */ jsx(MakeswiftProvider, {
2922
+ client,
2923
+ children
2924
+ })
2925
+ });
2926
+ }
2927
+ const PageContext = createContext(null);
2928
+ function usePageIdOrNull() {
2929
+ return useContext(PageContext);
2930
+ }
2931
+ function usePageId() {
2932
+ const pageIdOrNull = usePageIdOrNull();
2933
+ if (pageIdOrNull == null)
2934
+ throw new Error("`usePageId` must be used with `<PageProvider>`");
2935
+ return pageIdOrNull;
2936
+ }
2937
+ function PageProvider({
2938
+ id,
2939
+ children
2940
+ }) {
2941
+ return /* @__PURE__ */ jsx(PageContext.Provider, {
2942
+ value: id,
2943
+ children
2944
+ });
2945
+ }
2946
+ const DocumentContext = createContext(null);
2947
+ function useDocumentKey() {
2948
+ return useContext(DocumentContext);
2949
+ }
2950
+ function useStore() {
2951
+ return useContext(Context);
2952
+ }
2953
+ function useSelector(selector) {
2954
+ const store = useStore();
2955
+ return useSyncExternalStoreWithSelector(store.subscribe, store.getState, store.getState, selector);
2956
+ }
2957
+ function useComponent(type) {
2958
+ return useSelector((state) => getReactComponent(state, type));
2959
+ }
2960
+ function useElementId(elementKey) {
2961
+ const documentKey = useDocumentKey();
2962
+ return useSelector((state) => documentKey == null || elementKey == null ? null : getElementId(state, documentKey, elementKey));
2963
+ }
2964
+ function useDocument(documentKey) {
2965
+ return useSelector((state) => getDocument(state, documentKey));
2966
+ }
2967
+ function useIsInBuilder() {
2968
+ return useSelector((state) => getIsInBuilder(state));
2969
+ }
2970
+ function useDispatch() {
2971
+ const store = useContext(Context);
2972
+ return store.dispatch;
2973
+ }
2974
+ const originalError = console.error;
2975
+ let patched = false;
2976
+ function suppressRefWarning(ownerName) {
2977
+ if (patched === false) {
2978
+ console.error = (...args) => {
2979
+ if (typeof args[0] === "string" && args[0].includes("Function components cannot be given refs.") && args[0].includes(`Check the render method of \`${ownerName}\`.`)) {
2980
+ return;
2981
+ }
2982
+ return originalError(...args);
2983
+ };
2984
+ patched = true;
2985
+ }
2986
+ }
2987
+ const ElementData = memo(forwardRef(function ElementData2({
2988
+ elementData
2989
+ }, ref) {
2990
+ const Component2 = useComponent(elementData.type);
2991
+ const [handle, setHandle] = useState(null);
2992
+ const [foundDomNode, setFoundDomNode] = useState(null);
2993
+ useImperativeHandle(ref, () => handle != null ? handle : foundDomNode, [handle, foundDomNode]);
2994
+ suppressRefWarning(`\`ForwardRef(${ElementData2.name})\``);
2995
+ if (Component2 == null) {
2996
+ return /* @__PURE__ */ jsx(FallbackComponent, {
2997
+ ref: setHandle,
2998
+ text: "Component not found"
2999
+ });
3000
+ }
3001
+ return /* @__PURE__ */ jsx(FindDomNode, {
3002
+ ref: setFoundDomNode,
3003
+ children: /* @__PURE__ */ jsx(PropsValue, {
3004
+ element: elementData,
3005
+ children: (props) => /* @__PURE__ */ createElement(Component2, __spreadProps(__spreadValues({}, props), {
3006
+ key: elementData.key,
3007
+ ref: setHandle
3008
+ }))
3009
+ })
3010
+ });
3011
+ }));
3012
+ const DisableRegisterElement = createContext(false);
3013
+ const ElementReference = memo(forwardRef(function ElementReference2({
3014
+ elementReference
3015
+ }, ref) {
3016
+ var _a;
3017
+ const {
3018
+ error,
3019
+ data
3020
+ } = useQuery(ELEMENT_REFERENCE_GLOBAL_ELEMENT, {
3021
+ variables: {
3022
+ id: elementReference.value
3023
+ }
3024
+ });
3025
+ const globalElementData = (_a = data == null ? void 0 : data.globalElement) == null ? void 0 : _a.data;
3026
+ const elementReferenceDocument = useDocument(elementReference.key);
3027
+ if (error != null) {
3028
+ return /* @__PURE__ */ jsx(FallbackComponent, {
3029
+ ref,
3030
+ text: "Something went wrong!"
3031
+ });
3032
+ }
3033
+ if (globalElementData == null) {
3034
+ return /* @__PURE__ */ jsx(FallbackComponent, {
3035
+ ref,
3036
+ text: "This global component doesn't exist"
3037
+ });
3038
+ }
3039
+ return elementReferenceDocument != null ? /* @__PURE__ */ jsx(Document, {
3040
+ document: elementReferenceDocument,
3041
+ ref
3042
+ }) : /* @__PURE__ */ jsx(DisableRegisterElement.Provider, {
3043
+ value: true,
3044
+ children: /* @__PURE__ */ jsx(ElementData, {
3045
+ elementData: globalElementData,
3046
+ ref
3047
+ })
3048
+ });
3049
+ }));
3050
+ const Element = memo(forwardRef(function Element2({
3051
+ element
3052
+ }, ref) {
3053
+ const elementKey = element.key;
3054
+ const dispatch = useDispatch();
3055
+ const documentKey = useDocumentKey();
3056
+ const [handle, setHandle] = useState(null);
3057
+ const isRegisterElementDisabled = useContext(DisableRegisterElement);
3058
+ useImperativeHandle(ref, () => handle, [handle]);
3059
+ useEffect(() => {
3060
+ if (documentKey == null || isRegisterElementDisabled)
3061
+ return;
3062
+ return dispatch(registerComponentHandleEffect(documentKey, elementKey, handle));
3063
+ }, [dispatch, documentKey, elementKey, handle, isRegisterElementDisabled]);
3064
+ useEffect(() => {
3065
+ if (documentKey == null || isRegisterElementDisabled)
3066
+ return;
3067
+ return dispatch(mountComponentEffect(documentKey, elementKey));
3068
+ }, [dispatch, documentKey, elementKey, isRegisterElementDisabled]);
3069
+ return isElementReference(element) ? /* @__PURE__ */ jsx(ElementReference, {
3070
+ ref: setHandle,
3071
+ elementReference: element
3072
+ }, elementKey) : /* @__PURE__ */ jsx(ElementData, {
3073
+ ref: setHandle,
3074
+ elementData: element
3075
+ }, elementKey);
3076
+ }));
3077
+ const Document = memo(forwardRef(function Document2({
3078
+ document: document2
3079
+ }, ref) {
3080
+ return /* @__PURE__ */ jsx(DocumentContext.Provider, {
3081
+ value: document2.key,
3082
+ children: /* @__PURE__ */ jsx(Element, {
3083
+ ref,
3084
+ element: document2.rootElement
3085
+ })
3086
+ });
3087
+ }));
3088
+ const DocumentReference = memo(forwardRef(function DocumentReference2({
3089
+ documentReference
3090
+ }, ref) {
3091
+ const document2 = useDocument(documentReference.key);
3092
+ if (document2 == null) {
3093
+ return /* @__PURE__ */ jsx(FallbackComponent, {
3094
+ ref,
3095
+ text: "Document not found"
3096
+ });
3097
+ }
3098
+ return /* @__PURE__ */ jsx(Document, {
3099
+ ref,
3100
+ document: document2
3101
+ });
3102
+ }));
3103
+ export { Alignments as A, TYPOGRAPHIES_BY_ID as B, Contrasts as C, DocumentReference as D, Element as E, SWATCHES_BY_ID as F, shallowMergeFallbacks as G, join as H, getDevice as I, getDeviceMediaQuery as J, getIndexes as K, isNonNullable as L, MakeswiftComponentType as M, FILES_BY_ID as N, useElementId as O, PageProvider as P, MakeswiftClient as Q, RuntimeProvider as R, SITE_FONTS_QUERY as S, TABLE_BY_ID as T, forwardNextDynamicRef as U, deepEqual as V, ReactRuntime as a, usePageId as b, DEFAULT_BOX_ANIMATE_TYPE as c, DEFAULT_BOX_ANIMATE_DELAY as d, DEFAULT_BOX_ANIMATE_DURATION as e, DEFAULT_ITEM_ANIMATE_TYPE as f, DEFAULT_ITEM_ANIMATE_DELAY as g, DEFAULT_ITEM_ANIMATE_DURATION as h, DEFAULT_ITEM_STAGGER_DURATION as i, useBorder as j, useResponsiveColor as k, useFile as l, usePage as m, PAGE_SNIPPETS_QUERY as n, Page as o, colorToString as p, useIsomorphicLayoutEffect as q, Shapes as r, Sizes as s, useFormContext as t, useIsInBuilder as u, useQuery as v, useMutation as w, Provider as x, DEVICES as y, findDeviceOverride as z };
3104
+ //# sourceMappingURL=index.es.js.map