@oneclick.dev/cms-core-modules 0.0.109 → 0.0.111

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 (578) hide show
  1. package/dist/Acquisition-DgzDQH51.js +1 -0
  2. package/dist/Acquisition-FV3QpaUX.mjs +400 -0
  3. package/dist/AgendaOpeningHoursCard-B7ROIPWw.js +1 -0
  4. package/dist/AgendaOpeningHoursCard-Cp4wxUeK.mjs +172 -0
  5. package/dist/AppointmentDetailsCard-33WpATpV.mjs +161 -0
  6. package/dist/AppointmentDetailsCard-DpLM5IrB.js +1 -0
  7. package/dist/AppointmentEditor-BeOtYV6u.mjs +196 -0
  8. package/dist/AppointmentEditor-CaTfbkIf.js +1 -0
  9. package/dist/AppointmentListTable-DZJNmTMb.mjs +177 -0
  10. package/dist/AppointmentListTable-Dieu9US_.js +1 -0
  11. package/dist/Audience-BSgNvcVb.js +1 -0
  12. package/dist/Audience-ka0b7YPE.mjs +489 -0
  13. package/dist/Components-C83O-xlF.mjs +623 -0
  14. package/dist/Components-DXbx0RLV.js +1 -0
  15. package/dist/Content-BHr_rPVY.js +1 -0
  16. package/dist/Content-CYOZKvWK.mjs +358 -0
  17. package/dist/ContentEditor-pZPfo0qN.mjs +30802 -0
  18. package/dist/ContentEditor-tYkh4vRV.js +462 -0
  19. package/dist/CountryBreakdownCard-D7BK3nRD.js +1 -0
  20. package/dist/CountryBreakdownCard-DVxNz2DJ.mjs +196 -0
  21. package/dist/Create--MOBOTA-.js +1 -0
  22. package/dist/Create-BXNLRQag.mjs +1251 -0
  23. package/dist/DateFormatter-CSAbE3BC.js +1 -0
  24. package/dist/DateFormatter-qbhRYxI_.mjs +738 -0
  25. package/dist/Detail-BCOcP2ql.mjs +585 -0
  26. package/dist/Detail-Btzwo0Y3.mjs +3477 -0
  27. package/dist/Detail-Byk781b4.mjs +26 -0
  28. package/dist/Detail-C8wQiDcv.js +1 -0
  29. package/dist/Detail-CPqug27l.js +1 -0
  30. package/dist/Detail-ChD5XurA.mjs +379 -0
  31. package/dist/Detail-CjuhjPby.js +1 -0
  32. package/dist/Detail-DnX7tsqN.mjs +649 -0
  33. package/dist/Detail-RISEJJab.js +1 -0
  34. package/dist/Detail-mvSGbnFU.js +1 -0
  35. package/dist/DeviceBreakdownCard-DRhQ9ufG.js +1 -0
  36. package/dist/DeviceBreakdownCard-W1frLe0L.mjs +159 -0
  37. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-DWMqQvHl.mjs +76 -0
  38. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-kpjbVSXg.js +1 -0
  39. package/dist/Entries-BdhUyJR5.mjs +728 -0
  40. package/dist/Entries-CEXM_SkO.js +1 -0
  41. package/dist/Find-D4Qa45qC.js +1 -0
  42. package/dist/Find-zN_dKz4p.mjs +229 -0
  43. package/dist/GlobalStyling-C9VthHWK.mjs +1588 -0
  44. package/dist/GlobalStyling-CnSlXkZc.js +25 -0
  45. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Baqy-rTT.js +1 -0
  46. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Dx4Bpa2m.mjs +1263 -0
  47. package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-COrK1j0S.js +1 -0
  48. package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-Vb3q8EVv.mjs +330 -0
  49. package/dist/Overview-98nkJUWN.mjs +481 -0
  50. package/dist/Overview-BCpJNiEB.mjs +190 -0
  51. package/dist/Overview-BDlBCUI_.js +1 -0
  52. package/dist/Overview-BR_y8x3W.mjs +860 -0
  53. package/dist/Overview-BbvfH1u-.js +1 -0
  54. package/dist/Overview-Bn1Xx3_j.js +1 -0
  55. package/dist/Overview-CIa1E-HH.mjs +178 -0
  56. package/dist/Overview-CX-n6W7d.js +1 -0
  57. package/dist/Overview-DAxCu9XC.js +1 -0
  58. package/dist/Overview-Dl8cMlsr.js +1 -0
  59. package/dist/Overview-MpgkLB6m.mjs +567 -0
  60. package/dist/Overview-Su8ZUbMs.mjs +26 -0
  61. package/dist/Overview-T-lsy3UZ.js +1 -0
  62. package/dist/Overview-lWAyyenp.mjs +632 -0
  63. package/dist/PeakHoursCard-9-EZFZLR.mjs +182 -0
  64. package/dist/PeakHoursCard-BR5zmta4.js +1 -0
  65. package/dist/ProductDetailsCard-6nHikw4V.mjs +121 -0
  66. package/dist/ProductDetailsCard-Bn7qrgmc.js +1 -0
  67. package/dist/RealtimeCard--APfRNc8.js +1 -0
  68. package/dist/RealtimeCard-fvQlJcM7.mjs +126 -0
  69. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CuwREvXD.js +349 -0
  70. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-GYNZ_yhD.mjs +3077 -0
  71. package/dist/SearchTermsCard-BsB-63aH.js +1 -0
  72. package/dist/SearchTermsCard-BzVrHKqQ.mjs +201 -0
  73. package/dist/SendPush-COns44j7.js +1 -0
  74. package/dist/SendPush-CPIOjVX4.mjs +184 -0
  75. package/dist/SeoHealth-C5npw7mE.js +1 -0
  76. package/dist/SeoHealth-bVQj_Xgm.mjs +615 -0
  77. package/dist/TableView-Bf1fdJrD.mjs +6159 -0
  78. package/dist/TableView-DNcXyIMu.js +4 -0
  79. package/dist/TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js +1 -0
  80. package/dist/TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs +40 -0
  81. package/dist/TopPagesCard-BDeA997A.js +1 -0
  82. package/dist/TopPagesCard-CTozhOr_.mjs +159 -0
  83. package/dist/TrafficSourcesCard-BxtCKsqx.mjs +197 -0
  84. package/dist/TrafficSourcesCard-C3ziDTUL.js +1 -0
  85. package/dist/View-CsudjxCE.mjs +30 -0
  86. package/dist/View-Dw_wA6kK.js +1 -0
  87. package/dist/VisitorStatsCard-BmByE_Hi.js +1 -0
  88. package/dist/VisitorStatsCard-CXizEbVK.mjs +174 -0
  89. package/dist/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
  90. package/dist/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
  91. package/dist/agenda-BaJu3-1c.js +1 -0
  92. package/dist/agenda-BwVY_8oM.mjs +1165 -0
  93. package/dist/availability-CMrRa5y2.mjs +269 -0
  94. package/dist/availability-Cf2YfMwM.js +1 -0
  95. package/dist/booking-data-DgJd0BcM.mjs +889 -0
  96. package/dist/booking-data-Di5GmH_8.js +1 -0
  97. package/dist/cms-core-modules.css +1 -2
  98. package/dist/countries-BTPvmrsb.mjs +4 -0
  99. package/dist/countries-CgZ081No.js +1 -0
  100. package/dist/exceptions-B6P9UiCj.js +1 -0
  101. package/dist/exceptions-De9-FvdP.mjs +646 -0
  102. package/dist/google-CvtuJwgk.mjs +4 -0
  103. package/dist/google-D4N3gb01.js +1 -0
  104. package/dist/index-4tjmIans.js +1 -0
  105. package/dist/index-9HVlmvK3.js +1 -0
  106. package/dist/index-B8GvmAwh.mjs +1403 -0
  107. package/dist/index-BIF2RB7k.mjs +2836 -0
  108. package/dist/index-BWDwEd8D.mjs +24 -0
  109. package/dist/index-BfBBm9uY.mjs +24 -0
  110. package/dist/index-Bkq58CeQ.mjs +22 -0
  111. package/dist/index-ByRsp77L.js +70 -0
  112. package/dist/index-CFzn2Lus.mjs +172 -0
  113. package/dist/index-CJQQBRLY.js +1 -0
  114. package/dist/index-CQkOH2_3.mjs +24 -0
  115. package/dist/index-CSxYBeVA.js +1 -0
  116. package/dist/index-CU-tbS5W.mjs +24 -0
  117. package/dist/index-CZn2nDLv.mjs +34 -0
  118. package/dist/index-CkVwMqpn.mjs +3857 -0
  119. package/dist/index-CkiNvRzs.js +1 -0
  120. package/dist/index-Co4ON2Di.js +1 -0
  121. package/dist/index-Cpnn_Pxd.mjs +24 -0
  122. package/dist/index-CsVeM3PA.mjs +24 -0
  123. package/dist/index-CwqrAU-H.js +1 -0
  124. package/dist/index-CxETuRsG.js +1 -0
  125. package/dist/index-Cz-baGax.js +1 -0
  126. package/dist/index-DFQGVHTs.js +1 -0
  127. package/dist/index-DL6orwdK.js +35 -0
  128. package/dist/index-DPd3waTN.js +1 -0
  129. package/dist/index-DRqJOqUR.mjs +3484 -0
  130. package/dist/index-DUlYrnXH.js +58 -0
  131. package/dist/index-DZV720u-.mjs +439 -0
  132. package/dist/index-D_nfGegA.js +184 -0
  133. package/dist/index-DjWuIBxh.js +1 -0
  134. package/dist/index-Dnn2SCSl.js +1 -0
  135. package/dist/index-Dpl9sU6a.mjs +12 -0
  136. package/dist/index-DrXxXB2F.mjs +138 -0
  137. package/dist/index-DtSvAFLL.js +54 -0
  138. package/dist/index-L54VBzwJ.mjs +109 -0
  139. package/dist/index-R2oUDsjx.js +1 -0
  140. package/dist/index-RLz1QPrf.mjs +203 -0
  141. package/dist/index-UtjLbLw-.js +1 -0
  142. package/dist/index-cOnxXTbF.mjs +24 -0
  143. package/dist/index-hH3e-IYz.mjs +1187 -0
  144. package/dist/index-hlylYYgy.mjs +24 -0
  145. package/dist/index-ijdf0d9-.js +1 -0
  146. package/dist/index.cjs.js +1 -1
  147. package/dist/index.mjs +806 -1095
  148. package/dist/interpolation-CHn59tIC.js +1 -0
  149. package/dist/interpolation-w7IRDJwK.mjs +180 -0
  150. package/dist/math-BJ-oX_IM.mjs +80 -0
  151. package/dist/math-emotyaF6.js +1 -0
  152. package/dist/orders-C65SlpJy.mjs +618 -0
  153. package/dist/orders-XVzWAgG1.js +1 -0
  154. package/dist/payment-C3ohkehF.mjs +1080 -0
  155. package/dist/payment-Dfr-Ro-a.js +1 -0
  156. package/dist/regular-1LXNPviB.js +1 -0
  157. package/dist/regular-_05oq5Tx.mjs +1101 -0
  158. package/dist/resources-CxeFd57z.js +1 -0
  159. package/dist/resources-DwYxn2Vi.mjs +811 -0
  160. package/dist/server-handlers.cjs.js +1 -1
  161. package/dist/server-handlers.mjs +996 -1049
  162. package/dist/src/appointments/chat-components/AgendaOpeningHoursCard.vue.d.ts +15 -0
  163. package/dist/src/appointments/chat-components/AppointmentDetailsCard.vue.d.ts +14 -0
  164. package/dist/src/appointments/chat-components/AppointmentEditor.vue.d.ts +14 -0
  165. package/dist/src/appointments/chat-components/AppointmentListTable.vue.d.ts +14 -0
  166. package/dist/src/appointments/components/create/StepNavigation.vue.d.ts +32 -0
  167. package/dist/src/appointments/components/create/regular/Step1.vue.d.ts +2 -0
  168. package/dist/src/appointments/components/create/regular/Step2.vue.d.ts +2 -0
  169. package/dist/src/appointments/components/create/regular/Step3.vue.d.ts +2 -0
  170. package/dist/src/appointments/components/create/regular/Step4.vue.d.ts +2 -0
  171. package/dist/src/appointments/components/edit/CustomerInformationFieldEditorDialog.vue.d.ts +24 -0
  172. package/dist/src/appointments/components/edit/EditLayout.vue.d.ts +17 -0
  173. package/dist/src/appointments/components/edit/Event24hSidebar.vue.d.ts +2 -0
  174. package/dist/src/appointments/components/edit/EventDialog/ApproveReservationDialog.vue.d.ts +8 -0
  175. package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +136 -0
  176. package/dist/src/appointments/components/edit/EventDialog/CancelReservationDialog.vue.d.ts +8 -0
  177. package/dist/src/appointments/components/edit/EventDialog/EventDialog.vue.d.ts +11 -0
  178. package/dist/src/appointments/components/edit/EventDialog/OrderDetailDialog.vue.d.ts +55 -0
  179. package/dist/src/appointments/components/edit/EventDialog/RejectReservationDialog.vue.d.ts +8 -0
  180. package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +87 -0
  181. package/dist/src/appointments/components/edit/EventDialog/TimelineChart.vue.d.ts +24 -0
  182. package/dist/src/appointments/components/edit/EventDialog/TransferReservationDialog.vue.d.ts +4 -0
  183. package/dist/src/appointments/components/edit/EventTimeIndicator.vue.d.ts +12 -0
  184. package/dist/src/appointments/components/edit/EventTimeline.vue.d.ts +48 -0
  185. package/dist/src/appointments/components/edit/EventView.vue.d.ts +9 -0
  186. package/dist/src/appointments/components/edit/ExceptionDialog.vue.d.ts +29 -0
  187. package/dist/src/appointments/components/edit/MetadataSchemaEditorDialog.vue.d.ts +12 -0
  188. package/dist/src/appointments/components/edit/NewReservationDialog/CustomerInformation.vue.d.ts +10 -0
  189. package/dist/src/appointments/components/edit/NewReservationDialog/NewReservationDialog.vue.d.ts +26 -0
  190. package/dist/src/appointments/components/edit/NewReservationDialog/QuickReservationAdder.vue.d.ts +26 -0
  191. package/dist/src/appointments/components/edit/NewReservationDialog/ReservationLines.vue.d.ts +31 -0
  192. package/dist/src/appointments/components/edit/OrderMetadataDisplay.vue.d.ts +21 -0
  193. package/dist/src/appointments/components/edit/PaymentAddons/Addon.vue.d.ts +22 -0
  194. package/dist/src/appointments/components/edit/PaymentAddons/AddonList.vue.d.ts +5 -0
  195. package/dist/src/appointments/components/edit/PaymentAddons/index.vue.d.ts +15 -0
  196. package/dist/src/appointments/components/edit/ResourceEditorDialog.vue.d.ts +13 -0
  197. package/dist/src/appointments/components/edit/dashboard/Timeline.vue.d.ts +36 -0
  198. package/dist/src/appointments/components/edit/dashboard/timeline/ResourceSelector.vue.d.ts +50 -0
  199. package/dist/src/appointments/index.d.ts +12 -9
  200. package/dist/src/appointments/index.vue.d.ts +22 -0
  201. package/dist/src/appointments/metadata.d.ts +1 -1
  202. package/dist/src/appointments/pages/Overview.vue.d.ts +4 -0
  203. package/dist/src/appointments/pages/create/index.vue.d.ts +2 -0
  204. package/dist/src/appointments/pages/create/regular.vue.d.ts +6 -0
  205. package/dist/src/appointments/pages/edit/agenda.vue.d.ts +4 -0
  206. package/dist/src/appointments/pages/edit/availability.vue.d.ts +2 -0
  207. package/dist/src/appointments/pages/edit/booking-data.vue.d.ts +65 -0
  208. package/dist/src/appointments/pages/edit/index.vue.d.ts +2 -0
  209. package/dist/src/appointments/pages/edit/payment.vue.d.ts +2 -0
  210. package/dist/src/appointments/pages/edit/resources.vue.d.ts +28 -0
  211. package/dist/src/appointments/routes.d.ts +6 -3
  212. package/dist/src/contentManager/components/components/ComponentDialog.vue.d.ts +12 -0
  213. package/dist/src/contentManager/components/components/ComponentGridItem.vue.d.ts +16 -0
  214. package/dist/src/contentManager/components/content-editor/ApiDocs.vue.d.ts +2 -0
  215. package/dist/src/contentManager/components/content-editor/ContentLayout.vue.d.ts +49 -0
  216. package/dist/src/contentManager/components/content-editor/ContentSettings.vue.d.ts +24 -0
  217. package/dist/src/contentManager/components/content-editor/ContentStructuredContentSections.vue.d.ts +4 -0
  218. package/dist/src/contentManager/components/content-editor/Header.vue.d.ts +64 -0
  219. package/dist/src/contentManager/components/content-editor/LivePreviewWrapper.vue.d.ts +53 -0
  220. package/dist/src/contentManager/components/content-editor/Locales.vue.d.ts +44 -0
  221. package/dist/src/contentManager/components/content-editor/NewSectionDialog.vue.d.ts +21 -0
  222. package/dist/src/contentManager/components/content-editor/PageSettings.vue.d.ts +2 -0
  223. package/dist/src/contentManager/components/content-editor/SEO.vue.d.ts +14 -0
  224. package/dist/src/contentManager/components/content-editor/SidebarSectionWrapper.vue.d.ts +39 -0
  225. package/dist/src/contentManager/components/content-editor/Status.vue.d.ts +2 -0
  226. package/dist/src/contentManager/components/content-editor/Versions.vue.d.ts +63 -0
  227. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Button.vue.d.ts +94 -0
  228. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Card.vue.d.ts +92 -0
  229. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Column.vue.d.ts +92 -0
  230. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Container.vue.d.ts +92 -0
  231. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Divider.vue.d.ts +92 -0
  232. package/dist/src/contentManager/components/content-editor/tiptap-extensions/EmptySpace.vue.d.ts +94 -0
  233. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Heading.vue.d.ts +92 -0
  234. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Image.vue.d.ts +92 -0
  235. package/dist/src/contentManager/components/content-editor/tiptap-extensions/LockBlocks.d.ts +0 -15
  236. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Map.vue.d.ts +92 -0
  237. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Paragraph.vue.d.ts +92 -0
  238. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Row.vue.d.ts +115 -0
  239. package/dist/src/contentManager/components/content-editor/tiptap-extensions/ScopedSelectAll.d.ts +1 -2
  240. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Stack.vue.d.ts +115 -0
  241. package/dist/src/contentManager/components/content-editor/tiptap-extensions/TrailingNodeInContainers.d.ts +1 -4
  242. package/dist/src/contentManager/components/content-editor/tiptap-extensions/Video.vue.d.ts +92 -0
  243. package/dist/src/contentManager/components/content-editor/tiptap-extensions/extension-details/DetailsNodeView.vue.d.ts +92 -0
  244. package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/NodeLabel.vue.d.ts +108 -0
  245. package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/ResizeHandlers.vue.d.ts +20 -0
  246. package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/TopMarginDragger.vue.d.ts +104 -0
  247. package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/useFocus.d.ts +1 -0
  248. package/dist/src/contentManager/components/content-editor/tiptap-menus/BubbleMenuClassBuilder.vue.d.ts +19 -0
  249. package/dist/src/contentManager/components/content-editor/tiptap-menus/BubbleMenuLinkBuilder.vue.d.ts +19 -0
  250. package/dist/src/contentManager/components/content-editor/tiptap-menus/BubbleMenuToggleButton.vue.d.ts +29 -0
  251. package/dist/src/contentManager/components/content-editor/tiptap-menus/DefaultBubbleMenu.vue.d.ts +13 -0
  252. package/dist/src/contentManager/components/content-editor/tiptap-menus/ElementEditorMenu.vue.d.ts +19 -0
  253. package/dist/src/contentManager/components/content-editor/tiptap-menus/EmojiMenu.vue.d.ts +8 -0
  254. package/dist/src/contentManager/components/content-editor/tiptap-menus/NewNodeView.vue.d.ts +47 -0
  255. package/dist/src/contentManager/components/content-editor/tiptap-menus/SlashMenu.vue.d.ts +6 -0
  256. package/dist/src/contentManager/components/content-editor/tiptap-menus/SlashMenuButton.vue.d.ts +17 -0
  257. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/ButtonMenu.vue.d.ts +13 -0
  258. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/CardMenu.vue.d.ts +13 -0
  259. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/ColumnMenu.vue.d.ts +13 -0
  260. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/DividerMenu.vue.d.ts +13 -0
  261. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/EmptySpaceMenu.vue.d.ts +13 -0
  262. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/HeadingMenu.vue.d.ts +13 -0
  263. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/ImageMenu.vue.d.ts +13 -0
  264. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/MapMenu.vue.d.ts +13 -0
  265. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/RowMenu.vue.d.ts +13 -0
  266. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/StackMenu.vue.d.ts +13 -0
  267. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/TextMenu.vue.d.ts +13 -0
  268. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/VideoMenu.vue.d.ts +13 -0
  269. package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/index.d.ts +132 -12
  270. package/dist/src/contentManager/components/overview/CollectionDialog.vue.d.ts +30 -0
  271. package/dist/src/contentManager/components/overview/CollectionsGridView.vue.d.ts +18 -0
  272. package/dist/src/contentManager/components/overview/ContentEntryContextMenu.vue.d.ts +27 -0
  273. package/dist/src/contentManager/components/overview/FilterPopover.vue.d.ts +2 -0
  274. package/dist/src/contentManager/components/overview/ListView.vue.d.ts +12 -0
  275. package/dist/src/contentManager/components/styling/ButtonStyleDialog.vue.d.ts +24 -0
  276. package/dist/src/contentManager/components/styling/CardStyleDialog.vue.d.ts +24 -0
  277. package/dist/src/contentManager/components/styling/SectionStyleDialog.vue.d.ts +24 -0
  278. package/dist/src/contentManager/index.d.ts +14 -5
  279. package/dist/src/contentManager/index.vue.d.ts +22 -0
  280. package/dist/src/contentManager/metadata.d.ts +1 -1
  281. package/dist/src/contentManager/pages/Components.vue.d.ts +27 -0
  282. package/dist/src/contentManager/pages/ContentEditor.vue.d.ts +14 -0
  283. package/dist/src/contentManager/pages/Entries.vue.d.ts +16 -0
  284. package/dist/src/contentManager/pages/GlobalStyling.vue.d.ts +117 -0
  285. package/dist/src/contentManager/pages/Overview.vue.d.ts +57 -0
  286. package/dist/src/contentManager/routes.d.ts +12 -3
  287. package/dist/src/custom/index.d.ts +2 -2
  288. package/dist/src/custom/index.vue.d.ts +2 -0
  289. package/dist/src/custom/pages/View.vue.d.ts +2 -0
  290. package/dist/src/custom/routes.d.ts +1 -1
  291. package/dist/src/googleAnalytics/chat-components/CountryBreakdownCard.vue.d.ts +14 -0
  292. package/dist/src/googleAnalytics/chat-components/DeviceBreakdownCard.vue.d.ts +14 -0
  293. package/dist/src/googleAnalytics/chat-components/PeakHoursCard.vue.d.ts +14 -0
  294. package/dist/src/googleAnalytics/chat-components/RealtimeCard.vue.d.ts +14 -0
  295. package/dist/src/googleAnalytics/chat-components/SearchTermsCard.vue.d.ts +14 -0
  296. package/dist/src/googleAnalytics/chat-components/TopPagesCard.vue.d.ts +14 -0
  297. package/dist/src/googleAnalytics/chat-components/TrafficSourcesCard.vue.d.ts +14 -0
  298. package/dist/src/googleAnalytics/chat-components/VisitorStatsCard.vue.d.ts +14 -0
  299. package/dist/src/googleAnalytics/components/seo-health/SeoClicksChart.vue.d.ts +5 -0
  300. package/dist/src/googleAnalytics/components/seo-health/SeoImpressionsChart.vue.d.ts +5 -0
  301. package/dist/src/googleAnalytics/components/seo-health/SeoKeywordsTab.vue.d.ts +5 -0
  302. package/dist/src/googleAnalytics/components/seo-health/SeoKpiCards.vue.d.ts +10 -0
  303. package/dist/src/googleAnalytics/components/seo-health/SeoMappingTab.vue.d.ts +5 -0
  304. package/dist/src/googleAnalytics/components/seo-health/SeoPagesTab.vue.d.ts +5 -0
  305. package/dist/src/googleAnalytics/components/seo-health/SeoRankingDistribution.vue.d.ts +5 -0
  306. package/dist/src/googleAnalytics/index.d.ts +10 -10
  307. package/dist/src/googleAnalytics/index.vue.d.ts +2 -0
  308. package/dist/src/googleAnalytics/pages/Acquisition.vue.d.ts +2 -0
  309. package/dist/src/googleAnalytics/pages/Audience.vue.d.ts +2 -0
  310. package/dist/src/googleAnalytics/pages/Content.vue.d.ts +2 -0
  311. package/dist/src/googleAnalytics/pages/Overview.vue.d.ts +2 -0
  312. package/dist/src/googleAnalytics/pages/SeoHealth.vue.d.ts +2 -0
  313. package/dist/src/googleAnalytics/routes.d.ts +1 -1
  314. package/dist/src/mailTemplates/components/TemplateList.vue.d.ts +2 -0
  315. package/dist/src/mailTemplates/index.d.ts +3 -3
  316. package/dist/src/mailTemplates/index.vue.d.ts +22 -0
  317. package/dist/src/mailTemplates/metadata.d.ts +1 -1
  318. package/dist/src/mailTemplates/pages/Detail.vue.d.ts +14 -0
  319. package/dist/src/mailTemplates/pages/Overview.vue.d.ts +14 -0
  320. package/dist/src/mailTemplates/routes.d.ts +1 -1
  321. package/dist/src/productCollections/components/detail/Main.vue.d.ts +2 -0
  322. package/dist/src/productCollections/components/detail/SEO.vue.d.ts +2 -0
  323. package/dist/src/productCollections/components/detail/Status.vue.d.ts +2 -0
  324. package/dist/src/productCollections/components/overview/ListView.vue.d.ts +12 -0
  325. package/dist/src/productCollections/index.d.ts +3 -3
  326. package/dist/src/productCollections/index.vue.d.ts +22 -0
  327. package/dist/src/productCollections/metadata.d.ts +1 -1
  328. package/dist/src/productCollections/pages/Detail.vue.d.ts +14 -0
  329. package/dist/src/productCollections/pages/Overview.vue.d.ts +16 -0
  330. package/dist/src/productCollections/routes.d.ts +1 -1
  331. package/dist/src/products/chat-components/ProductDetailsCard.vue.d.ts +14 -0
  332. package/dist/src/products/components/detail/Collections.vue.d.ts +14 -0
  333. package/dist/src/products/components/detail/Inventory.vue.d.ts +2 -0
  334. package/dist/src/products/components/detail/Main.vue.d.ts +2 -0
  335. package/dist/src/products/components/detail/NewSection.vue.d.ts +2 -0
  336. package/dist/src/products/components/detail/Price.vue.d.ts +2 -0
  337. package/dist/src/products/components/detail/SEO.vue.d.ts +2 -0
  338. package/dist/src/products/components/detail/Shipping.vue.d.ts +2 -0
  339. package/dist/src/products/components/detail/Status.vue.d.ts +2 -0
  340. package/dist/src/products/components/detail/price/UnitPriceDialog.vue.d.ts +17 -0
  341. package/dist/src/products/components/detail/variants/Option.vue.d.ts +33 -0
  342. package/dist/src/products/components/detail/variants/VariantList.vue.d.ts +38 -0
  343. package/dist/src/products/components/overview/FilterPopover.vue.d.ts +2 -0
  344. package/dist/src/products/components/overview/GridView.vue.d.ts +12 -0
  345. package/dist/src/products/components/overview/ListView.vue.d.ts +12 -0
  346. package/dist/src/products/components/overview/ProductContextMenu.vue.d.ts +27 -0
  347. package/dist/src/products/index.d.ts +4 -4
  348. package/dist/src/products/index.vue.d.ts +22 -0
  349. package/dist/src/products/metadata.d.ts +1 -1
  350. package/dist/src/products/pages/Detail.vue.d.ts +14 -0
  351. package/dist/src/products/pages/Overview.vue.d.ts +16 -0
  352. package/dist/src/products/routes.d.ts +1 -1
  353. package/dist/src/promoCodes/components/create/DateRange.vue.d.ts +2 -0
  354. package/dist/src/promoCodes/components/create/MultiCodes.vue.d.ts +2 -0
  355. package/dist/src/promoCodes/components/create/Note.vue.d.ts +2 -0
  356. package/dist/src/promoCodes/components/create/SingleCode.vue.d.ts +2 -0
  357. package/dist/src/promoCodes/components/create/TypeAndValue/TypeDetailDialog.vue.d.ts +6 -0
  358. package/dist/src/promoCodes/components/create/TypeAndValue/TypeManageDialog.vue.d.ts +18 -0
  359. package/dist/src/promoCodes/components/create/TypeAndValue/index.vue.d.ts +2 -0
  360. package/dist/src/promoCodes/index.d.ts +3 -3
  361. package/dist/src/promoCodes/index.vue.d.ts +22 -0
  362. package/dist/src/promoCodes/metadata.d.ts +1 -1
  363. package/dist/src/promoCodes/pages/Create.vue.d.ts +16 -0
  364. package/dist/src/promoCodes/pages/Detail.vue.d.ts +14 -0
  365. package/dist/src/promoCodes/pages/Find.vue.d.ts +16 -0
  366. package/dist/src/promoCodes/routes.d.ts +1 -1
  367. package/dist/src/push-notifications/components/PreviewAndroid.vue.d.ts +28 -0
  368. package/dist/src/push-notifications/components/PreviewIPhone.vue.d.ts +28 -0
  369. package/dist/src/push-notifications/components/PushPreview.vue.d.ts +28 -0
  370. package/dist/src/push-notifications/index.d.ts +3 -3
  371. package/dist/src/push-notifications/index.vue.d.ts +22 -0
  372. package/dist/src/push-notifications/metadata.d.ts +1 -1
  373. package/dist/src/push-notifications/pages/SendPush.vue.d.ts +14 -0
  374. package/dist/src/push-notifications/routes.d.ts +1 -1
  375. package/dist/src/shared/BrandLogo.vue.d.ts +12 -0
  376. package/dist/src/shared/DrawerToggle.vue.d.ts +60 -0
  377. package/dist/src/shared/VerticalToggle.vue.d.ts +60 -0
  378. package/dist/src/shippingOptions/components/detail/Condition.vue.d.ts +2 -0
  379. package/dist/src/shippingOptions/components/detail/Countries.vue.d.ts +2 -0
  380. package/dist/src/shippingOptions/components/detail/Example.vue.d.ts +2 -0
  381. package/dist/src/shippingOptions/components/detail/Main.vue.d.ts +2 -0
  382. package/dist/src/shippingOptions/components/overview/ListView.vue.d.ts +12 -0
  383. package/dist/src/shippingOptions/index.d.ts +3 -3
  384. package/dist/src/shippingOptions/index.vue.d.ts +22 -0
  385. package/dist/src/shippingOptions/metadata.d.ts +1 -1
  386. package/dist/src/shippingOptions/pages/Detail.vue.d.ts +14 -0
  387. package/dist/src/shippingOptions/pages/Overview.vue.d.ts +16 -0
  388. package/dist/src/shippingOptions/routes.d.ts +1 -1
  389. package/dist/src/table/components/DataTable.vue.d.ts +18 -0
  390. package/dist/src/table/components/DataTableAction.vue.d.ts +14 -0
  391. package/dist/src/table/components/DataTableMobileRowActionDrawer.vue.d.ts +4 -0
  392. package/dist/src/table/components/DataTablePagination.vue.d.ts +6 -0
  393. package/dist/src/table/components/actions/ActionDialog.vue.d.ts +19 -0
  394. package/dist/src/table/components/actions/CtaActionDialog.vue.d.ts +4 -0
  395. package/dist/src/table/components/columns/ColumnDropdown.vue.d.ts +2 -0
  396. package/dist/src/table/components/columns/ColumnEditorDialog.vue.d.ts +34 -0
  397. package/dist/src/table/components/columns/DialogTableColumnItem.vue.d.ts +12 -0
  398. package/dist/src/table/components/date-range-filter/DateRangeFilter.vue.d.ts +2 -0
  399. package/dist/src/table/components/date-range-filter/DateRangeSettingsDialog.vue.d.ts +27 -0
  400. package/dist/src/table/components/filters/FilterDialog.vue.d.ts +12 -0
  401. package/dist/src/table/components/filters/Filters.vue.d.ts +27 -0
  402. package/dist/src/table/components/search/Search.vue.d.ts +2 -0
  403. package/dist/src/table/components/sort/SortMode.vue.d.ts +2 -0
  404. package/dist/src/table/components/sort/SortModeSettingsDialog.vue.d.ts +18 -0
  405. package/dist/src/table/components/stats/StatDialog.vue.d.ts +12 -0
  406. package/dist/src/table/components/stats/Stats.vue.d.ts +27 -0
  407. package/dist/src/table/flow-builder-extensions/TableRowEditor.vue.d.ts +16 -0
  408. package/dist/src/table/flow-builder-extensions/row-item.d.ts +17 -3
  409. package/dist/src/table/index.d.ts +2 -2
  410. package/dist/src/table/index.vue.d.ts +22 -0
  411. package/dist/src/table/pages/TableView.vue.d.ts +54 -0
  412. package/dist/src/table/routes.d.ts +1 -1
  413. package/dist/src/types/index.d.ts +0 -6
  414. package/dist/utils-CanmrIWO.mjs +47 -0
  415. package/dist/utils-Yd6F5mea.js +3 -0
  416. package/dist/vee-validate-zod-ByykgYKJ.js +1 -0
  417. package/dist/vee-validate-zod-DNjTLCgh.mjs +4402 -0
  418. package/package.json +56 -55
  419. package/dist/Acquisition-DypEyPSO.js +0 -1
  420. package/dist/Acquisition-TCNX-th6.mjs +0 -308
  421. package/dist/AgendaOpeningHoursCard-BIhm0vpV.js +0 -1
  422. package/dist/AgendaOpeningHoursCard-BKUdJxRI.mjs +0 -133
  423. package/dist/AppointmentDetailsCard-C5rQ5jsW.js +0 -1
  424. package/dist/AppointmentDetailsCard-NRHeNP2L.mjs +0 -111
  425. package/dist/AppointmentEditor-BcF8CiD-.mjs +0 -150
  426. package/dist/AppointmentEditor-BlhFtoCm.js +0 -1
  427. package/dist/AppointmentListTable-B-ReBVtV.js +0 -1
  428. package/dist/AppointmentListTable-DHmy-iid.mjs +0 -129
  429. package/dist/Audience-CfWHjjg8.mjs +0 -394
  430. package/dist/Audience-Cj4TyauW.js +0 -1
  431. package/dist/Components-BehelN4r.js +0 -1
  432. package/dist/Components-CR6zukUU.mjs +0 -468
  433. package/dist/Content-C5Iye3t0.mjs +0 -257
  434. package/dist/Content-eOfBx52Y.js +0 -1
  435. package/dist/ContentEditor-BgL4qEeg.mjs +0 -26835
  436. package/dist/ContentEditor-Tlu3w0Hu.js +0 -462
  437. package/dist/CountryBreakdownCard-CWVyB8be.mjs +0 -151
  438. package/dist/CountryBreakdownCard-Db-pMiNe.js +0 -1
  439. package/dist/Create-B1it8S4m.js +0 -1
  440. package/dist/Create-DbYi0FAI.mjs +0 -907
  441. package/dist/DateFormatter-DLrDYkby.mjs +0 -630
  442. package/dist/DateFormatter-Dni0Oq8r.js +0 -1
  443. package/dist/Detail-D-eahJGO.mjs +0 -21
  444. package/dist/Detail-D0kdPPIm.mjs +0 -2757
  445. package/dist/Detail-DAafePYi.mjs +0 -485
  446. package/dist/Detail-DYpv4fYg.js +0 -1
  447. package/dist/Detail-Dc_ui4LM.js +0 -1
  448. package/dist/Detail-DccUekl_.js +0 -1
  449. package/dist/Detail-Dhz0V0Vf.js +0 -1
  450. package/dist/Detail-DjnGY0F8.mjs +0 -282
  451. package/dist/Detail-DplAitHg.mjs +0 -447
  452. package/dist/Detail-SugyeSxb.js +0 -1
  453. package/dist/DeviceBreakdownCard-CzxZT6To.js +0 -1
  454. package/dist/DeviceBreakdownCard-eEwPjzKl.mjs +0 -115
  455. package/dist/EditLayout-Bnz9q_jd.js +0 -1
  456. package/dist/EditLayout-J_DGXb8v.mjs +0 -99
  457. package/dist/Entries-CgpWg6fE.js +0 -1
  458. package/dist/Entries-CkGTXcAq.mjs +0 -575
  459. package/dist/Find-Bz0TNJzk.mjs +0 -164
  460. package/dist/Find-D-ItTXaZ.js +0 -1
  461. package/dist/GlobalStyling-CSQPF7o_.mjs +0 -1162
  462. package/dist/GlobalStyling-DabldMZh.js +0 -15
  463. package/dist/NewReservationDialog-BhIiY2B9.js +0 -1
  464. package/dist/NewReservationDialog-CN49aGcM.mjs +0 -1002
  465. package/dist/OrderDetailDialog-BJ01DZFe.js +0 -1
  466. package/dist/OrderDetailDialog-CoVQ_rzs.mjs +0 -215
  467. package/dist/Overview-9FMgn5hT.mjs +0 -492
  468. package/dist/Overview-BOOwMQ-c.mjs +0 -636
  469. package/dist/Overview-Biz3h60w.js +0 -1
  470. package/dist/Overview-C2K2ofdS.js +0 -1
  471. package/dist/Overview-CFHOXP9N.mjs +0 -123
  472. package/dist/Overview-CTJe7J5_.js +0 -1
  473. package/dist/Overview-Cvj2i9eW.js +0 -1
  474. package/dist/Overview-D2I1F8Dm.mjs +0 -21
  475. package/dist/Overview-DFOc9emt.mjs +0 -345
  476. package/dist/Overview-Dmhfb94Y.js +0 -1
  477. package/dist/Overview-PPzv7weG.mjs +0 -450
  478. package/dist/Overview-qFKcXHVF.js +0 -1
  479. package/dist/Overview-xkmYYTae.mjs +0 -133
  480. package/dist/Overview-yPsLvR2c.js +0 -1
  481. package/dist/PeakHoursCard-CtgEP-ez.mjs +0 -157
  482. package/dist/PeakHoursCard-DPeoMyhu.js +0 -1
  483. package/dist/ProductDetailsCard-B0WhmzO-.mjs +0 -98
  484. package/dist/ProductDetailsCard-C1ROuH6l.js +0 -1
  485. package/dist/RealtimeCard-DQno-Okz.js +0 -1
  486. package/dist/RealtimeCard-dR-g1iDo.mjs +0 -92
  487. package/dist/ReservationDetailDialog-Cdo6h0RD.mjs +0 -2163
  488. package/dist/ReservationDetailDialog-DZTFD2xI.js +0 -349
  489. package/dist/SearchTermsCard-BXJSXz_k.js +0 -1
  490. package/dist/SearchTermsCard-DsaxLKwP.mjs +0 -146
  491. package/dist/SendPush-Bssi-OZD.mjs +0 -150
  492. package/dist/SendPush-BuaYboRH.js +0 -1
  493. package/dist/SeoHealth-CP-kL0us.js +0 -1
  494. package/dist/SeoHealth-Cxp_Gb3Y.mjs +0 -459
  495. package/dist/TableView-7iwBkQ_k.mjs +0 -4757
  496. package/dist/TableView-BB_oIYYZ.js +0 -4
  497. package/dist/TemplateList-CNcM_Kgq.mjs +0 -56
  498. package/dist/TemplateList-VuPcBUJO.js +0 -1
  499. package/dist/TopPagesCard-CvDECn3_.mjs +0 -117
  500. package/dist/TopPagesCard-DNdATXJE.js +0 -1
  501. package/dist/TrafficSourcesCard-BLpBr7u0.mjs +0 -151
  502. package/dist/TrafficSourcesCard-_3gRUCw3.js +0 -1
  503. package/dist/View-DSnUHI7h.mjs +0 -30
  504. package/dist/View-Dbcfpdqh.js +0 -1
  505. package/dist/VisitorStatsCard-CFEnXSjF.mjs +0 -185
  506. package/dist/VisitorStatsCard-C_jhQxDW.js +0 -1
  507. package/dist/_plugin-vue_export-helper-5u7tqpWC.js +0 -1
  508. package/dist/_plugin-vue_export-helper-BJQSo0im.mjs +0 -8
  509. package/dist/agenda-CzMRcQTA.mjs +0 -989
  510. package/dist/agenda-D4zWRYSQ.js +0 -1
  511. package/dist/appointments-9syR5TZE.js +0 -1
  512. package/dist/appointments-BBmOJMhM.mjs +0 -23
  513. package/dist/array-BH1uH7XT.js +0 -1
  514. package/dist/array-DnDL9cFz.mjs +0 -98
  515. package/dist/availability-CAXB7Yd6.js +0 -1
  516. package/dist/availability-Dp7eF-ZK.mjs +0 -215
  517. package/dist/booking-data-Bysf6e5x.mjs +0 -724
  518. package/dist/booking-data-C6SGjC2X.js +0 -1
  519. package/dist/chunk-DQi1bQcV.js +0 -1
  520. package/dist/contentManager-D7JxXCwE.js +0 -1
  521. package/dist/contentManager-tfy0x1LD.mjs +0 -22
  522. package/dist/context-AQKfnJ4t.mjs +0 -3809
  523. package/dist/context-ubyMq9Xe.js +0 -54
  524. package/dist/core-Dhgr4ctC.mjs +0 -202
  525. package/dist/core-_HKfBlaZ.js +0 -1
  526. package/dist/countries-MXLT3mVe.mjs +0 -4
  527. package/dist/countries-OCd5qPxG.js +0 -1
  528. package/dist/create-BfNc2C7N.js +0 -1
  529. package/dist/create-C7JlIlIh.mjs +0 -95
  530. package/dist/custom-BwN9-6Mb.js +0 -1
  531. package/dist/custom-INNwaWla.mjs +0 -13
  532. package/dist/dist-BCVg7FKM.js +0 -1
  533. package/dist/dist-DIhK9VWh.mjs +0 -3045
  534. package/dist/edit-BiI2VG60.js +0 -35
  535. package/dist/edit-DD3iFBEh.mjs +0 -1097
  536. package/dist/exceptions-DICMaDcH.mjs +0 -462
  537. package/dist/exceptions-DpWqMNuG.js +0 -1
  538. package/dist/google-Bcc4XZnV.mjs +0 -4
  539. package/dist/google-DTSRmJ51.js +0 -1
  540. package/dist/googleAnalytics-BSaqRR_L.js +0 -1
  541. package/dist/googleAnalytics-Cg-iWblZ.mjs +0 -47
  542. package/dist/interpolation-B8OzkMyi.mjs +0 -131
  543. package/dist/interpolation-DpAqtGOW.js +0 -1
  544. package/dist/lib-4wSi00Vr.js +0 -1
  545. package/dist/lib-BZgXUui5.mjs +0 -198
  546. package/dist/line-DJdnFNI7.js +0 -75
  547. package/dist/line-tYLnEDGV.mjs +0 -1500
  548. package/dist/mailTemplates-BNk8fhVS.mjs +0 -23
  549. package/dist/mailTemplates-DswHzyQe.js +0 -1
  550. package/dist/orders-CIc0JlKX.mjs +0 -512
  551. package/dist/orders-DwPSi_pD.js +0 -1
  552. package/dist/payment-BsNWFaDm.js +0 -1
  553. package/dist/payment-Ced5_dpa.mjs +0 -718
  554. package/dist/productCollections-Cuvw_8zC.js +0 -1
  555. package/dist/productCollections-D0AxRlzr.mjs +0 -23
  556. package/dist/products-DUD-ZMkR.mjs +0 -22
  557. package/dist/products-DvX9B-Ul.js +0 -1
  558. package/dist/promoCodes-BCWqN6w4.mjs +0 -23
  559. package/dist/promoCodes-CEZ4LYot.js +0 -1
  560. package/dist/push-notifications-BGp4XWo9.js +0 -1
  561. package/dist/push-notifications-C7W7KuzR.mjs +0 -23
  562. package/dist/regular-BCFrS6lK.mjs +0 -908
  563. package/dist/regular-DBqPgT8C.js +0 -1
  564. package/dist/resources-DwsMmWgm.mjs +0 -669
  565. package/dist/resources-Dz81GkHe.js +0 -1
  566. package/dist/shippingOptions-C3NEJff1.mjs +0 -23
  567. package/dist/shippingOptions-Cy040ZW1.js +0 -1
  568. package/dist/single-container-BJmmqq65.mjs +0 -468
  569. package/dist/single-container-Xoo0Xzxv.js +0 -58
  570. package/dist/src/vue-shim.d.ts +0 -7
  571. package/dist/table-DWw0fs3S.js +0 -1
  572. package/dist/table-LXt5DQOL.mjs +0 -23
  573. package/dist/utils-CVIHqQsU.js +0 -3
  574. package/dist/utils-h3owcMtS.mjs +0 -37
  575. package/dist/vee-validate-zod-BmXMJo8W.js +0 -1
  576. package/dist/vee-validate-zod-D9dZzbWZ.mjs +0 -4985
  577. package/dist/xy-container-CuQSwrtB.mjs +0 -3180
  578. package/dist/xy-container-_6YpscZh.js +0 -158
@@ -1,2757 +0,0 @@
1
- import { t as e } from "./lib-BZgXUui5.mjs";
2
- import { t } from "./google-Bcc4XZnV.mjs";
3
- import { a as n, c as r, d as i, i as a, l as o, n as s, o as c, r as l, s as u, t as d, u as f } from "./vee-validate-zod-D9dZzbWZ.mjs";
4
- import { useConfirmation as p, useFirebaseIntegration as m, useModuleBreadcrumbs as h, useModulePermissions as g, useModuleRoute as ee } from "@oneclick.dev/cms-kit";
5
- import { Fragment as _, computed as v, createBlock as y, createCommentVNode as b, createElementBlock as x, createElementVNode as S, createTextVNode as C, createVNode as w, defineComponent as T, inject as te, isRef as E, nextTick as D, normalizeClass as O, onMounted as ne, openBlock as k, provide as re, ref as A, renderList as j, resolveComponent as M, toDisplayString as N, unref as P, useTemplateRef as F, watch as I, withAsyncContext as ie, withCtx as L, withKeys as R, withModifiers as z } from "vue";
6
- import { Archive as ae, ChevronDown as oe, ChevronRight as se, CircleX as ce, GripVertical as le, ImagePlus as B, Info as V, ListFilter as ue, Loader2 as de, Plus as fe, PlusCircle as H, Search as pe, Tag as U, Trash as me, Trash2 as he, X as ge } from "@lucide/vue";
7
- import { animations as _e } from "@formkit/drag-and-drop";
8
- //#region src/products/components/detail/Main.vue?vue&type=script&setup=true&lang.ts
9
- var ve = { class: "flex flex-col gap-4" }, ye = { class: "flex flex-col" }, be = {
10
- key: 0,
11
- class: "text-red-500 text-sm mt-1"
12
- }, xe = { class: "flex flex-col gap-4" }, Se = { class: "flex flex-col" }, Ce = {
13
- key: 0,
14
- class: "text-red-500 text-sm mt-1"
15
- }, we = { class: "flex flex-col gap-4" }, Te = { class: "flex flex-col" }, Ee = {
16
- key: 0,
17
- class: "text-red-500 text-sm mt-1"
18
- }, De = /* @__PURE__ */ T({
19
- __name: "Main",
20
- setup(e) {
21
- let t = te("sources"), n = te("defaultSource"), { errors: r } = i(), { value: a } = o("title"), { value: s } = o("description"), { value: c } = o("media");
22
- return (e, i) => {
23
- let o = M("Label"), l = M("Input"), u = M("Textarea"), d = M("MediaPicker"), f = M("CardContent"), p = M("Card");
24
- return k(), y(p, null, {
25
- default: L(() => [w(f, { class: "flex flex-col gap-4" }, {
26
- default: L(() => [
27
- S("div", ve, [S("div", ye, [
28
- w(o, {
29
- for: "title",
30
- class: "text-sm mb-2"
31
- }, {
32
- default: L(() => [...i[3] ||= [C("Title", -1)]]),
33
- _: 1
34
- }),
35
- w(l, {
36
- type: "text",
37
- id: "title",
38
- placeholder: "T-shirt with red heart",
39
- modelValue: P(a),
40
- "onUpdate:modelValue": i[0] ||= (e) => E(a) ? a.value = e : null
41
- }, null, 8, ["modelValue"]),
42
- P(r).title ? (k(), x("p", be, N(P(r).title), 1)) : b("", !0)
43
- ])]),
44
- S("div", xe, [S("div", Se, [
45
- w(o, {
46
- for: "description",
47
- class: "text-sm mb-2"
48
- }, {
49
- default: L(() => [...i[4] ||= [C("Description", -1)]]),
50
- _: 1
51
- }),
52
- w(u, {
53
- id: "description",
54
- placeholder: "Lovely T-shirt featuring a red heart",
55
- modelValue: P(s),
56
- "onUpdate:modelValue": i[1] ||= (e) => E(s) ? s.value = e : null
57
- }, null, 8, ["modelValue"]),
58
- P(r).description ? (k(), x("p", Ce, N(P(r).description), 1)) : b("", !0)
59
- ])]),
60
- S("div", we, [S("div", Te, [
61
- w(o, {
62
- for: "media",
63
- class: "text-sm mb-2"
64
- }, {
65
- default: L(() => [...i[5] ||= [C("Media", -1)]]),
66
- _: 1
67
- }),
68
- w(d, {
69
- id: "media",
70
- modelValue: P(c),
71
- "onUpdate:modelValue": i[2] ||= (e) => E(c) ? c.value = e : null,
72
- sources: P(t),
73
- defaultSource: P(n)
74
- }, null, 8, [
75
- "modelValue",
76
- "sources",
77
- "defaultSource"
78
- ]),
79
- P(r).media ? (k(), x("p", Ee, N(P(r).media), 1)) : b("", !0)
80
- ])])
81
- ]),
82
- _: 1
83
- })]),
84
- _: 1
85
- });
86
- };
87
- }
88
- }), Oe = { class: "grid grid-cols-2 gap-4 mb-4" }, ke = { class: "relative" }, Ae = {
89
- key: 0,
90
- class: "text-red-500 text-sm mt-1"
91
- }, je = { class: "relative" }, Me = { class: "absolute right-2 top-1/2 -translate-y-1/2" }, Ne = {
92
- key: 0,
93
- class: "text-red-500 text-sm mt-1"
94
- }, Pe = { class: "flex items-center gap-2 mb-4" }, Fe = { class: "flex items-center border-t mt-4 pt-4" }, Ie = { class: "relative" }, Le = {
95
- key: 0,
96
- class: "text-red-500 text-sm mt-1"
97
- }, Re = /* @__PURE__ */ T({
98
- __name: "Price",
99
- setup(e) {
100
- let { errors: t } = i(), { value: n } = o("price"), { value: r } = o("compareAtPrice"), { value: a } = o("isTaxable"), { value: s } = o("costPerItem");
101
- return v(() => Number(n.value) > 0), (e, i) => {
102
- let o = M("Label"), c = M("Input"), l = M("TooltipTrigger"), u = M("TooltipContent"), d = M("Tooltip"), f = M("Checkbox"), p = M("CardContent"), m = M("Card");
103
- return k(), y(m, null, {
104
- default: L(() => [w(p, null, {
105
- default: L(() => [
106
- i[12] ||= S("h3", { class: "text-lg font-semibold mb-4" }, "Pricing", -1),
107
- S("div", Oe, [S("div", null, [
108
- w(o, {
109
- for: "price",
110
- class: "text-sm mb-2"
111
- }, {
112
- default: L(() => [...i[4] ||= [C("Price", -1)]]),
113
- _: 1
114
- }),
115
- S("div", ke, [w(c, {
116
- type: "number",
117
- id: "price",
118
- class: "pl-10 no-spinner",
119
- modelValue: P(n),
120
- "onUpdate:modelValue": i[0] ||= (e) => E(n) ? n.value = e : null
121
- }, null, 8, ["modelValue"]), i[5] ||= S("span", { class: "absolute left-4 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none" }, "€", -1)]),
122
- P(t).price ? (k(), x("p", Ae, N(P(t).price), 1)) : b("", !0)
123
- ]), S("div", null, [
124
- w(o, {
125
- for: "compare-at-price",
126
- class: "text-sm mb-2"
127
- }, {
128
- default: L(() => [...i[6] ||= [C("Compare-at price", -1)]]),
129
- _: 1
130
- }),
131
- S("div", je, [
132
- w(c, {
133
- type: "number",
134
- id: "compare-at-price",
135
- class: "pl-10 no-spinner",
136
- modelValue: P(r),
137
- "onUpdate:modelValue": i[1] ||= (e) => E(r) ? r.value = e : null
138
- }, null, 8, ["modelValue"]),
139
- i[8] ||= S("span", { class: "absolute left-4 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none" }, "€", -1),
140
- w(d, null, {
141
- default: L(() => [w(l, { "as-child": "" }, {
142
- default: L(() => [S("button", Me, [w(P(V), { class: "size-4 text-muted-foreground" })])]),
143
- _: 1
144
- }), w(u, null, {
145
- default: L(() => [...i[7] ||= [S("p", null, [
146
- C(" To display a markdown, enter a value higher than your price."),
147
- S("br"),
148
- C(" Often shown with a strikethrough (e.g. "),
149
- S("span", { class: "font-semibold line-through" }, "€25,00"),
150
- C("). ")
151
- ], -1)]]),
152
- _: 1
153
- })]),
154
- _: 1
155
- })
156
- ]),
157
- P(t).compareAtPrice ? (k(), x("p", Ne, N(P(t).compareAtPrice), 1)) : b("", !0)
158
- ])]),
159
- S("div", Pe, [w(f, {
160
- id: "charge-tax",
161
- modelValue: P(a),
162
- "onUpdate:modelValue": i[2] ||= (e) => E(a) ? a.value = e : null
163
- }, null, 8, ["modelValue"]), w(o, {
164
- for: "charge-tax",
165
- class: "text-sm"
166
- }, {
167
- default: L(() => [...i[9] ||= [C("Charge tax on this product", -1)]]),
168
- _: 1
169
- })]),
170
- S("div", Fe, [S("div", null, [
171
- w(o, {
172
- for: "cost-per-item",
173
- class: "text-sm mb-2"
174
- }, {
175
- default: L(() => [...i[10] ||= [C("Cost per item", -1)]]),
176
- _: 1
177
- }),
178
- S("div", Ie, [w(c, {
179
- type: "number",
180
- id: "cost-per-item",
181
- class: "pl-10 no-spinner",
182
- modelValue: P(s),
183
- "onUpdate:modelValue": i[3] ||= (e) => E(s) ? s.value = e : null
184
- }, null, 8, ["modelValue"]), i[11] ||= S("span", { class: "absolute left-4 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none" }, "€", -1)]),
185
- P(t).costPerItem ? (k(), x("p", Le, N(P(t).costPerItem), 1)) : b("", !0)
186
- ])])
187
- ]),
188
- _: 1
189
- })]),
190
- _: 1
191
- });
192
- };
193
- }
194
- }), ze = { class: "grid grid-cols-2 gap-4 mb-4" }, Be = { class: "flex items-center gap-2 mb-4" }, Ve = {
195
- key: 0,
196
- class: "grid grid-cols-2 gap-4 mb-4"
197
- }, He = { class: "flex items-center gap-2" }, Ue = /* @__PURE__ */ T({
198
- __name: "Inventory",
199
- setup(e) {
200
- let { errors: t } = i(), { value: n } = o("sku"), { value: r } = o("barcode"), { value: a } = o("trackInventory"), { value: s } = o("allowBackorder"), { value: c } = o("stock"), { value: l } = o("options"), { value: u } = o("variants"), d = v(() => u.value.reduce((e, t) => t.stock < 0 ? e : e + t.stock, 0));
201
- return (e, t) => {
202
- let i = M("Label"), o = M("Input"), u = M("Checkbox"), f = M("TooltipTrigger"), p = M("TooltipContent"), m = M("Tooltip"), h = M("CardContent"), g = M("Card");
203
- return k(), y(g, null, {
204
- default: L(() => [w(h, null, {
205
- default: L(() => [
206
- t[12] ||= S("h3", { class: "text-lg font-semibold mb-4" }, "Inventory", -1),
207
- S("div", ze, [S("div", null, [w(i, {
208
- for: "sku",
209
- class: "text-sm mb-2"
210
- }, {
211
- default: L(() => [...t[6] ||= [C("SKU (Stock Keeping Unit)", -1)]]),
212
- _: 1
213
- }), w(o, {
214
- id: "sku",
215
- modelValue: P(n),
216
- "onUpdate:modelValue": t[0] ||= (e) => E(n) ? n.value = e : null
217
- }, null, 8, ["modelValue"])]), S("div", null, [w(i, {
218
- for: "barcode",
219
- class: "text-sm mb-2"
220
- }, {
221
- default: L(() => [...t[7] ||= [C("Barcode (ISBN, UPC, GTIN, etc.)", -1)]]),
222
- _: 1
223
- }), w(o, {
224
- id: "barcode",
225
- modelValue: P(r),
226
- "onUpdate:modelValue": t[1] ||= (e) => E(r) ? r.value = e : null
227
- }, null, 8, ["modelValue"])])]),
228
- S("div", Be, [w(u, {
229
- id: "track-quantity",
230
- modelValue: P(a),
231
- "onUpdate:modelValue": t[2] ||= (e) => E(a) ? a.value = e : null
232
- }, null, 8, ["modelValue"]), w(i, {
233
- for: "track-quantity",
234
- class: "text-sm"
235
- }, {
236
- default: L(() => [...t[8] ||= [C("Track quantity", -1)]]),
237
- _: 1
238
- })]),
239
- P(a) ? (k(), x("div", Ve, [S("div", null, [w(i, {
240
- for: "stock",
241
- class: "text-sm mb-2"
242
- }, {
243
- default: L(() => [...t[9] ||= [C("Stock", -1)]]),
244
- _: 1
245
- }), !P(l) || P(l)?.length === 0 ? (k(), y(o, {
246
- key: 0,
247
- id: "stock",
248
- type: "number",
249
- modelValue: P(c),
250
- "onUpdate:modelValue": t[3] ||= (e) => E(c) ? c.value = e : null,
251
- class: "no-spinner"
252
- }, null, 8, ["modelValue"])) : (k(), y(m, { key: 1 }, {
253
- default: L(() => [w(f, { class: "cursor-not-allowed" }, {
254
- default: L(() => [w(o, {
255
- modelValue: d.value,
256
- "onUpdate:modelValue": t[4] ||= (e) => d.value = e,
257
- disabled: "",
258
- class: "no-spinner"
259
- }, null, 8, ["modelValue"])]),
260
- _: 1
261
- }), w(p, null, {
262
- default: L(() => [...t[10] ||= [S("p", null, "Total stock of all variants", -1)]]),
263
- _: 1
264
- })]),
265
- _: 1
266
- }))])])) : b("", !0),
267
- S("div", He, [w(u, {
268
- id: "continue-selling",
269
- modelValue: P(s),
270
- "onUpdate:modelValue": t[5] ||= (e) => E(s) ? s.value = e : null
271
- }, null, 8, ["modelValue"]), w(i, {
272
- for: "continue-selling",
273
- class: "text-sm"
274
- }, {
275
- default: L(() => [...t[11] ||= [C("Continue selling when out of stock", -1)]]),
276
- _: 1
277
- })])
278
- ]),
279
- _: 1
280
- })]),
281
- _: 1
282
- });
283
- };
284
- }
285
- }), We = { class: "flex items-center gap-2 mb-4" }, Ge = {
286
- key: 0,
287
- class: "grid grid-cols-2 gap-4 mb-4"
288
- }, Ke = /* @__PURE__ */ T({
289
- __name: "Shipping",
290
- setup(e) {
291
- let { errors: t } = i(), { value: n } = o("isPhysicalProduct"), { value: r } = o("weight"), { value: a } = o("weightUnit");
292
- return (e, t) => {
293
- let i = M("Checkbox"), o = M("Label"), s = M("Input"), c = M("SelectValue"), l = M("SelectTrigger"), u = M("SelectItem"), d = M("SelectGroup"), f = M("SelectContent"), p = M("Select"), m = M("CardContent"), h = M("Card");
294
- return k(), y(h, null, {
295
- default: L(() => [w(m, null, {
296
- default: L(() => [
297
- t[10] ||= S("h3", { class: "text-lg font-semibold mb-4" }, "Shipping", -1),
298
- S("div", We, [w(i, {
299
- id: "is-physical-product",
300
- modelValue: P(n),
301
- "onUpdate:modelValue": t[0] ||= (e) => E(n) ? n.value = e : null
302
- }, null, 8, ["modelValue"]), w(o, {
303
- for: "is-physical-product",
304
- class: "text-sm"
305
- }, {
306
- default: L(() => [...t[3] ||= [C("This is a physical product", -1)]]),
307
- _: 1
308
- })]),
309
- P(n) ? (k(), x("div", Ge, [S("div", null, [w(o, {
310
- for: "weight",
311
- class: "text-sm mb-2"
312
- }, {
313
- default: L(() => [...t[4] ||= [C("Weight", -1)]]),
314
- _: 1
315
- }), w(s, {
316
- id: "weight",
317
- type: "number",
318
- modelValue: P(r),
319
- "onUpdate:modelValue": t[1] ||= (e) => E(r) ? r.value = e : null,
320
- class: "no-spinner"
321
- }, null, 8, ["modelValue"])]), S("div", null, [w(o, {
322
- for: "weight-unit",
323
- class: "text-sm mb-2"
324
- }, {
325
- default: L(() => [...t[5] ||= [C("Weight unit", -1)]]),
326
- _: 1
327
- }), w(p, {
328
- modelValue: P(a),
329
- "onUpdate:modelValue": t[2] ||= (e) => E(a) ? a.value = e : null
330
- }, {
331
- default: L(() => [w(l, null, {
332
- default: L(() => [w(c, { placeholder: "Select unit" })]),
333
- _: 1
334
- }), w(f, null, {
335
- default: L(() => [w(d, null, {
336
- default: L(() => [
337
- w(u, { value: "lb" }, {
338
- default: L(() => [...t[6] ||= [C(" lb ", -1)]]),
339
- _: 1
340
- }),
341
- w(u, { value: "oz" }, {
342
- default: L(() => [...t[7] ||= [C(" oz ", -1)]]),
343
- _: 1
344
- }),
345
- w(u, { value: "kg" }, {
346
- default: L(() => [...t[8] ||= [C(" kg ", -1)]]),
347
- _: 1
348
- }),
349
- w(u, { value: "g" }, {
350
- default: L(() => [...t[9] ||= [C(" g ", -1)]]),
351
- _: 1
352
- })
353
- ]),
354
- _: 1
355
- })]),
356
- _: 1
357
- })]),
358
- _: 1
359
- }, 8, ["modelValue"])])])) : b("", !0)
360
- ]),
361
- _: 1
362
- })]),
363
- _: 1
364
- });
365
- };
366
- }
367
- });
368
- //#endregion
369
- //#region ../node_modules/.pnpm/@formkit+drag-and-drop@0.5.3/node_modules/@formkit/drag-and-drop/index.mjs
370
- function W(e) {
371
- e.preventDefault();
372
- }
373
- function G(e) {
374
- e.stopPropagation();
375
- }
376
- function qe() {
377
- let e = /* @__PURE__ */ new Map();
378
- return [function(t, n) {
379
- e.get(t) && e.get(t).forEach((e) => {
380
- e(n);
381
- });
382
- }, function(t, n) {
383
- let r = e.get(t) ?? [];
384
- r.push(n), e.set(t, r);
385
- }];
386
- }
387
- var [Je, Ye] = qe();
388
- function Xe(e, t) {
389
- return e.source === t.source && e.flags.split("").sort().join("") === t.flags.split("").sort().join("");
390
- }
391
- function Ze(e, t, n = !0, r = ["__key"]) {
392
- if (e === t) return !0;
393
- if (typeof t == "object" && typeof e == "object" && e && t !== null) {
394
- if (e instanceof Map || e instanceof Set) return !1;
395
- if (e instanceof Date && t instanceof Date) return e.getTime() === t.getTime();
396
- if (e instanceof RegExp && t instanceof RegExp) return Xe(e, t);
397
- if (e === null || t === null) return !1;
398
- let i = e, a = t;
399
- if (Object.keys(i).length !== Object.keys(a).length) return !1;
400
- for (let e of r) if ((e in i || e in a) && i[e] !== a[e]) return !1;
401
- for (let e in i) if (!(e in a) || i[e] !== a[e] && !n || n && !Ze(i[e], a[e], n, r)) return !1;
402
- return !0;
403
- }
404
- return !1;
405
- }
406
- function Qe(e) {
407
- return e.split(" ").filter((e) => e);
408
- }
409
- function $e(e) {
410
- return {
411
- x: e.clientX,
412
- y: e.clientY
413
- };
414
- }
415
- var et = typeof window < "u", K = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap();
416
- function tt() {
417
- if (!et) return !1;
418
- if ("userAgentData" in navigator) return navigator.userAgentData.mobile === !0;
419
- let e = navigator.userAgent, t = /android|iphone|ipod/i.test(e), n = /iPad/.test(e) || e.includes("Macintosh") && navigator.maxTouchPoints > 1;
420
- return t || n;
421
- }
422
- var J = {
423
- affectedNodes: [],
424
- coordinates: {
425
- x: 0,
426
- y: 0
427
- },
428
- currentTargetValue: void 0,
429
- on: Ye,
430
- emit: Je,
431
- originalZIndex: void 0,
432
- pointerSelection: !1,
433
- preventEnter: !1,
434
- rootUserSelect: void 0,
435
- nodePointerdown: void 0,
436
- longPress: !1,
437
- scrolling: !1,
438
- longPressTimeout: void 0,
439
- remapJustFinished: !1,
440
- selectedNodes: [],
441
- selectedParent: void 0,
442
- preventSynthDrag: !1,
443
- pointerDown: void 0,
444
- lastScrollContainerX: null,
445
- lastScrollContainerY: null,
446
- rootScrollWidth: void 0,
447
- rootScrollHeight: void 0,
448
- dragItemRect: void 0,
449
- windowScrollX: void 0,
450
- windowScrollY: void 0,
451
- lastScrollDirectionX: void 0,
452
- lastScrollDirectionY: void 0,
453
- scrollDebounceTimeout: void 0,
454
- frameIdX: void 0,
455
- frameIdY: void 0
456
- }, Y = !1, nt, rt;
457
- function it() {
458
- J.scrollDebounceTimeout && clearTimeout(J.scrollDebounceTimeout), J.longPressTimeout && clearTimeout(J.longPressTimeout), J.frameIdX !== void 0 && cancelAnimationFrame(J.frameIdX), J.frameIdY !== void 0 && cancelAnimationFrame(J.frameIdY), J = {
459
- affectedNodes: [],
460
- coordinates: {
461
- x: 0,
462
- y: 0
463
- },
464
- on: Ye,
465
- emit: Je,
466
- currentTargetValue: void 0,
467
- originalZIndex: void 0,
468
- pointerId: void 0,
469
- preventEnter: !1,
470
- remapJustFinished: !1,
471
- selectedNodes: [],
472
- nodePointerdown: void 0,
473
- rootUserSelect: void 0,
474
- preventSynthDrag: !1,
475
- scrolling: !1,
476
- selectedParent: void 0,
477
- pointerSelection: !1,
478
- synthScrollDirection: void 0,
479
- draggedNodeDisplay: void 0,
480
- synthDragScrolling: !1,
481
- longPress: !1,
482
- pointerDown: void 0,
483
- longPressTimeout: void 0,
484
- lastScrollContainerX: null,
485
- lastScrollContainerY: null,
486
- rootScrollWidth: void 0,
487
- rootScrollHeight: void 0,
488
- dragItemRect: void 0,
489
- windowScrollX: void 0,
490
- windowScrollY: void 0,
491
- lastScrollDirectionX: void 0,
492
- lastScrollDirectionY: void 0,
493
- scrollDebounceTimeout: void 0,
494
- frameIdX: void 0,
495
- frameIdY: void 0
496
- };
497
- }
498
- function at(e) {
499
- return Object.assign(J, e), e.initialParent.data.emit("dragStarted", J), Y = !1, J.emit("dragStarted", J), J;
500
- }
501
- function ot() {
502
- J.activeState && ht(J.activeState.parent, void 0, J), J.selectedState && gt(J.selectedState.nodes, J.selectedState.parent, J), J.selectedState = J.activeState = void 0;
503
- }
504
- function st() {
505
- if (J.pointerDown && (J.pointerDown.node.el.draggable = !0), J.pointerDown = void 0, !Z(J)) return;
506
- let e = J.currentParent.data.config;
507
- Z(J) && e.handleEnd(J);
508
- }
509
- function ct(e) {
510
- e.key === "Escape" && (J.selectedState && gt(J.selectedState.nodes, J.selectedState.parent, J), J.activeState && ht(J.activeState.parent, void 0, J), J.selectedState = J.activeState = void 0);
511
- }
512
- function lt(e) {
513
- if (!X(J)) return;
514
- Y = !0;
515
- let t = J.initialParent.data.config.handleEnd;
516
- t(J);
517
- }
518
- function ut(e) {
519
- if (!X(J)) return;
520
- W(e);
521
- let { x: t, y: n } = $e(e);
522
- X(J) && _n({
523
- x: t,
524
- y: n
525
- }, e, J);
526
- }
527
- function dt(e) {
528
- if (!J.pointerDown || !J.pointerDown.validated) return;
529
- let t = J.pointerDown.parent.data.config;
530
- if (!(e.pointerType === "mouse" && !tt())) if (Z(J)) Z(J) && en(e, J);
531
- else {
532
- if (W(e), t.longPress && !J.longPress) {
533
- clearTimeout(J.longPressTimeout), J.longPress = !1;
534
- return;
535
- }
536
- let n = t.draggedNodes(J.pointerDown);
537
- t.dragstartClasses(J.pointerDown.node, n, t, !0);
538
- let r = J.pointerDown.node.el.getBoundingClientRect();
539
- en(e, Xt(J.pointerDown.node, J.pointerDown.parent, e, J, n, r), !0);
540
- }
541
- }
542
- function ft({ parent: e, getValues: t, setValues: n, config: r = {} }) {
543
- if (!et) return;
544
- nt ||= bn(document, {
545
- dragover: ut,
546
- pointerdown: ot,
547
- pointerup: st,
548
- keydown: ct,
549
- drop: lt,
550
- pointermove: dt,
551
- pointercancel: Q(r.handlePointercancel),
552
- touchmove: (e) => {
553
- X(J) && e.cancelable && W(e);
554
- },
555
- contextmenu: (e) => {
556
- Z(J) && W(e);
557
- }
558
- }), Ct(e);
559
- let [i, a] = qe(), o = {
560
- getValues: t,
561
- setValues: n,
562
- config: {
563
- dragDropEffect: r.dragDropEffect ?? "move",
564
- dragEffectAllowed: r.dragEffectAllowed ?? "move",
565
- draggedNodes: Pt,
566
- dragstartClasses: Rt,
567
- handleNodeKeydown: Vt,
568
- handleDragstart: It,
569
- handleNodeDragover: tn,
570
- handleParentDragover: nn,
571
- handleNodeDrop: Ut,
572
- handleNodeFocus: Wt,
573
- handleNodeBlur: Gt,
574
- handlePointercancel: qt,
575
- handleEnd: Jt,
576
- handleDragend: Kt,
577
- handleParentFocus: vt,
578
- handleNodePointerup: Yt,
579
- handleNodePointerover: Ht,
580
- handleParentPointerover: rn,
581
- handleParentScroll: Ft,
582
- handleNodePointerdown: Lt,
583
- handleNodeDragenter: on,
584
- handleNodeDragleave: sn,
585
- handleParentDrop: St,
586
- multiDrag: r.multiDrag ?? !1,
587
- nativeDrag: r.nativeDrag ?? !0,
588
- performSort: mt,
589
- performTransfer: yt,
590
- root: r.root ?? document,
591
- setupNode: Tt,
592
- setupNodeRemap: Et,
593
- reapplyDragClasses: Dt,
594
- tearDownNode: kt,
595
- tearDownNodeRemap: Ot,
596
- remapFinished: Mt,
597
- threshold: {
598
- horizontal: 0,
599
- vertical: 0
600
- },
601
- ...r
602
- },
603
- enabledNodes: [],
604
- abortControllers: {},
605
- privateClasses: [],
606
- on: a,
607
- emit: i
608
- };
609
- new MutationObserver(At).observe(e, { childList: !0 }), K.set(e, o), r.plugins?.forEach((t) => {
610
- t(e)?.tearDown?.();
611
- }), r.plugins?.forEach((t) => {
612
- t(e)?.tearDown?.();
613
- }), r.plugins?.forEach((t) => {
614
- t(e)?.setup?.();
615
- }), wt(e, o), jt(e, !0);
616
- }
617
- function pt(e, t, n, r, i, a) {
618
- let { x: o, y: s } = $e(n), c = e.el.getBoundingClientRect();
619
- return {
620
- affectedNodes: [],
621
- ascendingDirection: !1,
622
- clonedDraggedEls: [],
623
- coordinates: {
624
- x: o,
625
- y: s
626
- },
627
- draggedNode: {
628
- el: e.el,
629
- data: e.data
630
- },
631
- draggedNodes: r,
632
- incomingDirection: void 0,
633
- initialIndex: e.data.index,
634
- initialParent: {
635
- el: t.el,
636
- data: t.data
637
- },
638
- currentParent: {
639
- el: t.el,
640
- data: t.data
641
- },
642
- longPress: t.data.config.longPress ?? !1,
643
- longPressTimeout: void 0,
644
- currentTargetValue: e.data.value,
645
- scrollEls: [],
646
- startLeft: i || o - (c?.left ?? 0),
647
- startTop: a || s - (c?.top ?? 0),
648
- targetIndex: e.data.index,
649
- transferred: !1
650
- };
651
- }
652
- function mt({ parent: e, draggedNodes: t, targetNodes: n }) {
653
- jt(e.el);
654
- let r = t.map((e) => e.data.value), i = bt(e.el, e.data), a = t[0].data.index, o = [...e.data.enabledNodes], s = [...i.filter((e) => !r.some((t) => Ze(e, t)))];
655
- s.splice(n[0].data.index, 0, ...r), "draggedNode" in J && (J.currentTargetValue = n[0].data.value), xt(e.el, e.data, [...s]), e.data.config.onSort && e.data.config.onSort({
656
- parent: {
657
- el: e.el,
658
- data: e.data
659
- },
660
- previousValues: [...i],
661
- previousNodes: [...o],
662
- nodes: [...e.data.enabledNodes],
663
- values: [...s],
664
- draggedNodes: t,
665
- previousPosition: a,
666
- position: n[0].data.index,
667
- targetNodes: n,
668
- state: J
669
- });
670
- }
671
- function ht(e, t, n) {
672
- if (!t) {
673
- n.activeState = void 0;
674
- return;
675
- }
676
- n.activeState = {
677
- node: t,
678
- parent: e
679
- };
680
- }
681
- function gt(e, t, n) {
682
- let r = t.data.config.selectedClass;
683
- if (!n.selectedState) return;
684
- let i = Array.from(e);
685
- $(e.map((e) => e.el), r);
686
- for (let e of i) {
687
- e.el.setAttribute("aria-selected", "false");
688
- let t = n.selectedState.nodes.findIndex((t) => t.el === e.el);
689
- t !== -1 && n.selectedState.nodes.splice(t, 1);
690
- }
691
- }
692
- function _t(e, t, n, r, i = !1) {
693
- r.pointerSelection = i;
694
- for (let n of t) n.el.setAttribute("aria-selected", "true"), fn([n.el], e.data.config.selectedClass, !0);
695
- r.selectedState = {
696
- nodes: t,
697
- parent: e
698
- }, ht(e, n, r);
699
- }
700
- function vt(e, t) {
701
- let n = e.targetData.parent.data.enabledNodes[0];
702
- n && (t.selectedState && t.selectedState.parent.el !== e.targetData.parent.el ? ht(e.targetData.parent, n, t) : t.selectedState || ht(e.targetData.parent, n, t));
703
- }
704
- function yt({ currentParent: e, targetParent: t, initialParent: n, draggedNodes: r, initialIndex: i, targetNodes: a, state: o }) {
705
- jt(n.el);
706
- let s = r.map((e) => e.data.value), c = [...bt(e.el, e.data).filter((e) => !s.some((t) => Ze(e, t)))], l = bt(t.el, t.data), u = n.el === t.el && t.data.config.sortable === !1, d;
707
- a.length ? (d = u ? i : t.data.config.sortable === !1 ? t.data.enabledNodes.length : a[0].data.index, l.splice(d, 0, ...s)) : (d = u ? i : t.data.enabledNodes.length, l.splice(d, 0, ...s)), xt(e.el, e.data, c), xt(t.el, t.data, l), t.data.config.onTransfer && t.data.config.onTransfer({
708
- sourceParent: e,
709
- targetParent: t,
710
- initialParent: n,
711
- draggedNodes: r,
712
- targetIndex: d,
713
- state: o,
714
- targetNodes: a
715
- }), e.data.config.onTransfer && e.data.config.onTransfer({
716
- sourceParent: e,
717
- targetParent: t,
718
- initialParent: n,
719
- draggedNodes: r,
720
- targetIndex: d,
721
- state: o,
722
- targetNodes: a || []
723
- });
724
- }
725
- function bt(e, t) {
726
- return [...t.getValues(e)];
727
- }
728
- function xt(e, t, n) {
729
- t.setValues(n, e);
730
- }
731
- function St(e, t) {
732
- G(e.e), Y = !0;
733
- let n = t.initialParent.data.config.handleEnd;
734
- n(t);
735
- }
736
- function Ct(e) {
737
- let t = K.get(e);
738
- t && t.abortControllers.mainParent && t.abortControllers.mainParent.abort();
739
- }
740
- function X(e) {
741
- return "draggedNode" in e && !!e.draggedNode;
742
- }
743
- function Z(e) {
744
- return "synthDragging" in e && !!e.synthDragging;
745
- }
746
- function wt(e, t) {
747
- t.abortControllers.mainParent = bn(e, {
748
- dragover: dn(t.config.handleParentDragover),
749
- handleParentPointerover: t.config.handleParentPointerover,
750
- scroll: dn(t.config.handleParentScroll),
751
- drop: dn(t.config.handleParentDrop),
752
- hasNestedParent: (e) => {
753
- let t = K.get(e.target);
754
- t && (t.nestedParent = e.detail.parent);
755
- },
756
- focus: dn(t.config.handleParentFocus)
757
- }), t.config.externalDragHandle && t.config.externalDragHandle.el && t.config.externalDragHandle.callback && (t.abortControllers.externalDragHandle = bn(t.config.externalDragHandle.el, { pointerdown: (e) => {
758
- if (!t.config.externalDragHandle || !t.config.externalDragHandle.callback) return;
759
- let n = t.config.externalDragHandle.callback();
760
- if (!yn(n)) {
761
- console.warn("No draggable item found from external drag handle callback");
762
- return;
763
- }
764
- let r = q.get(n);
765
- if (!r) return;
766
- let i = n.parentNode;
767
- if (!(i instanceof HTMLElement)) return;
768
- let a = K.get(i);
769
- a && (J.pointerDown = {
770
- parent: {
771
- el: i,
772
- data: a
773
- },
774
- node: {
775
- el: n,
776
- data: r
777
- },
778
- validated: !0
779
- }, n.draggable = !0);
780
- } }));
781
- }
782
- function Tt(e) {
783
- let t = e.parent.data.config;
784
- e.node.data.abortControllers.mainNode = bn(e.node.el, {
785
- keydown: Q(t.handleNodeKeydown),
786
- dragstart: Q(t.handleDragstart),
787
- dragover: Q(t.handleNodeDragover),
788
- dragenter: Q(t.handleNodeDragenter),
789
- dragleave: Q(t.handleNodeDragleave),
790
- dragend: Q(t.handleDragend),
791
- drop: Q(t.handleNodeDrop),
792
- focus: Q(t.handleNodeFocus),
793
- blur: Q(t.handleNodeBlur),
794
- pointerup: Q(t.handleNodePointerup),
795
- pointercancel: Q(t.handlePointercancel),
796
- pointerdown: Q(t.handleNodePointerdown),
797
- handleNodePointerover: t.handleNodePointerover,
798
- touchmove: (e) => {
799
- X(J) && e.cancelable && W(e);
800
- },
801
- contextmenu: (e) => {
802
- Z(J) && W(e);
803
- }
804
- }), e.node.el.draggable = !0, t.reapplyDragClasses(e.node.el, e.parent.data), e.parent.data.config.plugins?.forEach((t) => {
805
- t(e.parent.el)?.setupNode?.(e);
806
- });
807
- }
808
- function Et(e) {
809
- q.set(e.node.el, e.node.data), e.parent.data.config.plugins?.forEach((t) => {
810
- t(e.parent.el)?.setupNodeRemap?.(e);
811
- });
812
- }
813
- function Dt(e, t) {
814
- if (!X(J)) return;
815
- let n = Z(J) ? t.config.synthDropZoneClass : t.config.dropZoneClass;
816
- J.draggedNode.el === e && fn([e], n, !0);
817
- }
818
- function Ot(e) {
819
- e.parent.data.config.plugins?.forEach((t) => {
820
- t(e.parent.el)?.tearDownNodeRemap?.(e);
821
- });
822
- }
823
- function kt(e) {
824
- e.parent.data.config.plugins?.forEach((t) => {
825
- t(e.parent.el)?.tearDownNode?.(e);
826
- }), e.node.el.draggable = !1, e.node.data?.abortControllers?.mainNode && e.node.data?.abortControllers?.mainNode.abort();
827
- }
828
- function At(e) {
829
- if (e.length === 1 && e[0].addedNodes.length === 1 && !(e[0].addedNodes[0] instanceof HTMLElement)) return;
830
- let t = e[0].target;
831
- t instanceof HTMLElement && K.get(t) && jt(t);
832
- }
833
- function jt(e, t) {
834
- let n = K.get(e);
835
- if (!n) return;
836
- n.privateClasses = Array.from(e.classList);
837
- let r = [], i = n.config;
838
- for (let a = 0; a < e.children.length; a++) {
839
- let o = e.children[a];
840
- if (!yn(o) || o.id === "dnd-dragged-node-clone") continue;
841
- let s = q.get(o);
842
- (t || !s) && i.tearDownNode({
843
- parent: {
844
- el: e,
845
- data: n
846
- },
847
- node: {
848
- el: o,
849
- data: s
850
- }
851
- }), !i.disabled && (!i.draggable || i.draggable && i.draggable(o)) && r.push(o);
852
- }
853
- if (r.length !== n.getValues(e).length && !i.disabled) {
854
- console.warn("The number of draggable items defined in the parent element does not match the number of values. This may cause unexpected behavior.");
855
- return;
856
- }
857
- let a = n.getValues(e), o = [];
858
- for (let s = 0; s < r.length; s++) {
859
- let c = r[s], l = q.get(c);
860
- if (i.draggableValue && !i.draggableValue(a[s])) continue;
861
- let u = Object.assign(l ?? {
862
- privateClasses: [],
863
- abortControllers: {}
864
- }, {
865
- value: a[s],
866
- index: s
867
- });
868
- if (!X(J) && J.activeState && Ze(J.activeState.node.data.value, u.value) && ht({
869
- data: n,
870
- el: e
871
- }, {
872
- el: c,
873
- data: u
874
- }, J), X(J) && Ze(J.draggedNode.data.value, u.value)) {
875
- J.draggedNode.data = u, J.draggedNode.el = c;
876
- let e = J.draggedNodes.find((e) => e.data.value === u.value);
877
- e && (e.el = c);
878
- }
879
- o.push({
880
- el: c,
881
- data: u
882
- }), (t || !l) && i.setupNode({
883
- parent: {
884
- el: e,
885
- data: n
886
- },
887
- node: {
888
- el: c,
889
- data: u
890
- }
891
- }), Et({
892
- parent: {
893
- el: e,
894
- data: n
895
- },
896
- node: {
897
- el: c,
898
- data: u
899
- }
900
- });
901
- }
902
- K.set(e, {
903
- ...n,
904
- enabledNodes: o
905
- }), i.remapFinished(n), n.config.plugins?.forEach((t) => {
906
- t(e)?.remapFinished?.();
907
- });
908
- }
909
- function Mt() {
910
- J.remapJustFinished = !0, "draggedNode" in J && (J.affectedNodes = []);
911
- }
912
- function Nt(e) {
913
- return !!e.targetData.parent.data.config.nativeDrag;
914
- }
915
- function Pt(e) {
916
- return e.parent.data.config.multiDrag ? J.selectedState ? [e.node, ...J.selectedState?.nodes.filter((t) => t.el !== e.node.el)] : [] : [e.node];
917
- }
918
- function Ft(e) {
919
- X(J) && (J.emit("scrollStarted", J), !Z(J) && (J.preventEnter = !0, rt && clearTimeout(rt), rt = setTimeout(() => {
920
- J.preventEnter = !1, J.emit("scrollEnded", J);
921
- }, 100)));
922
- }
923
- function It(e, t) {
924
- let n = e.targetData.parent.data.config;
925
- if (!n.nativeDrag || !Nt(e) || !Bt({
926
- x: e.e.clientX,
927
- y: e.e.clientY,
928
- node: e.targetData.node,
929
- config: n
930
- })) {
931
- W(e.e);
932
- return;
933
- }
934
- let r = n.draggedNodes({
935
- parent: e.targetData.parent,
936
- node: e.targetData.node
937
- });
938
- r.length === 0 && (r = [e.targetData.node]), n.dragstartClasses(e.targetData.node, r, n);
939
- let i = zt(e, r);
940
- if (n.onDragstart) {
941
- let t = {
942
- parent: e.targetData.parent,
943
- values: bt(e.targetData.parent.el, e.targetData.parent.data),
944
- draggedNode: i.draggedNode,
945
- draggedNodes: i.draggedNodes,
946
- position: i.initialIndex,
947
- state: i
948
- };
949
- n.onDragstart(t);
950
- }
951
- }
952
- function Lt(e, t) {
953
- if (G(e.e), t.pointerDown = {
954
- parent: e.targetData.parent,
955
- node: e.targetData.node,
956
- validated: !1
957
- }, !Bt({
958
- x: e.e.clientX,
959
- y: e.e.clientY,
960
- node: e.targetData.node,
961
- config: e.targetData.parent.data.config
962
- })) return;
963
- t.pointerDown.validated = !0, Zt(e, t, e.targetData.node);
964
- let n = e.targetData.parent.data, r = [e.targetData.node], i = e.e.ctrlKey || e.e.metaKey, a = e.e.shiftKey, o = e.targetData.node;
965
- if (i && n.config.multiDrag) {
966
- r = t.selectedState ? t.selectedState.nodes.findIndex((e) => e.el === o.el) === -1 ? [...t.selectedState.nodes, o] : t.selectedState.nodes.filter((e) => e.el !== o.el) : [o], _t(e.targetData.parent, r, e.targetData.node, t, !0);
967
- return;
968
- }
969
- if (a && n.config.multiDrag) {
970
- let n = e.targetData.parent.data.enabledNodes;
971
- if (t.selectedState && t.activeState) if (t.selectedState.parent.el !== e.targetData.parent.el) {
972
- gt(t.selectedState.nodes, t.selectedState.parent, t), t.selectedState = void 0;
973
- for (let e = 0; e <= o.data.index; e++) r.push(n[e]);
974
- } else {
975
- let [i, a] = t.activeState.node.data.index < e.targetData.node.data.index ? [t.activeState.node.data.index, e.targetData.node.data.index] : [e.targetData.node.data.index, t.activeState.node.data.index];
976
- r = n.slice(i, a + 1);
977
- }
978
- else for (let e = 0; e <= o.data.index; e++) r.push(n[e]);
979
- _t(e.targetData.parent, r, e.targetData.node, t, !0);
980
- return;
981
- }
982
- t.selectedState?.nodes?.length ? t.selectedState.nodes.findIndex((t) => t.el === e.targetData.node.el) === -1 && (t.selectedState.parent.el === e.targetData.parent.el && n.config.multiDrag && tt() ? r.push(...t.selectedState.nodes) : gt(t.selectedState.nodes, e.targetData.parent, t), _t(e.targetData.parent, r, e.targetData.node, t, !0)) : _t(e.targetData.parent, [e.targetData.node], e.targetData.node, t, !0);
983
- }
984
- function Rt(e, t, n, r = !1) {
985
- fn(t.map((e) => e.el), r ? n.synthDraggingClass : n.draggingClass), setTimeout(() => {
986
- $(t.map((e) => e.el), r ? n.synthDraggingClass : n.draggingClass), fn(t.map((e) => e.el), r ? n.synthDragPlaceholderClass : n.dragPlaceholderClass), fn(t.map((e) => e.el), r ? n.synthDropZoneClass : n.dropZoneClass), $(t.map((e) => e.el), n.selectedClass);
987
- });
988
- }
989
- function zt(e, t) {
990
- G(e.e);
991
- let n = at(pt(e.targetData.node, e.targetData.parent, e.e, t));
992
- if (e.e.dataTransfer) {
993
- let r = e.targetData.parent.data.config;
994
- e.e.dataTransfer.dropEffect = r.dragDropEffect, e.e.dataTransfer.effectAllowed = r.dragEffectAllowed;
995
- let i;
996
- if (e.e.dataTransfer.setData("text/plain", ""), r.dragImage) i = r.dragImage(e, t);
997
- else if (!r.multiDrag || t.length === 1) return e.targetData.node.el.style.zIndex = "9999", e.targetData.node.el.style.boxSizing = "border-box", e.e.dataTransfer.setDragImage(e.targetData.node.el, e.e.offsetX, e.e.offsetY), n.originalZIndex = e.targetData.node.el.style.zIndex, n;
998
- else {
999
- let n = document.createElement("div");
1000
- n.setAttribute("id", "dnd-dragged-node-clone"), n.setAttribute("popover", "manual");
1001
- for (let e of t) {
1002
- let t = e.el.cloneNode(!0);
1003
- t.id = e.el.id + "-clone", t.style.pointerEvents = "none", n.appendChild(t);
1004
- }
1005
- let { width: r } = t[0].el.getBoundingClientRect();
1006
- Object.assign(n.style, {
1007
- display: "flex",
1008
- flexDirection: "column",
1009
- width: `${r}px`,
1010
- position: "absolute",
1011
- pointerEvents: "none",
1012
- zIndex: "9999",
1013
- left: "-9999px",
1014
- boxSizing: "border-box",
1015
- background: "transparent",
1016
- overflow: "hidden"
1017
- }), e.targetData.parent.el.appendChild(n), n.showPopover(), n.getBoundingClientRect(), i = n, e.e.dataTransfer.setDragImage(i, e.e.offsetX, e.e.offsetY);
1018
- }
1019
- setTimeout(() => {
1020
- i?.remove();
1021
- });
1022
- }
1023
- return n;
1024
- }
1025
- function Bt({ x: e, y: t, node: n, config: r }) {
1026
- if (r.externalDragHandle) return !1;
1027
- if (!r.dragHandle) return !0;
1028
- let i = n.el.querySelectorAll(r.dragHandle);
1029
- if (!i) return !1;
1030
- let a = r.root.elementFromPoint(e, t);
1031
- if (!a) return !1;
1032
- for (let e of Array.from(i)) if (a === e || e.contains(a)) return !0;
1033
- return !1;
1034
- }
1035
- function Vt(e) {}
1036
- function Ht(e) {
1037
- e.detail.targetData.parent.el === e.detail.state.currentParent.el ? ln(e.detail, e.detail.state) : un(e.detail, e.detail.state);
1038
- }
1039
- function Ut(e, t) {
1040
- let n = e.targetData.parent.data.config;
1041
- n.nativeDrag && (G(e.e), Y = !0, n.handleEnd(t));
1042
- }
1043
- function Wt(e) {
1044
- e.e.target !== e.e.currentTarget && J.pointerDown && (J.pointerDown.node.el.draggable = !1);
1045
- }
1046
- function Gt(e) {
1047
- e.e.target !== e.e.currentTarget && J.pointerDown && (J.pointerDown.node.el.draggable = !0);
1048
- }
1049
- function Kt(e, t) {
1050
- let n = e.targetData.parent.data.config;
1051
- if (n.nativeDrag) {
1052
- if (W(e.e), G(e.e), Y) {
1053
- Y = !1;
1054
- return;
1055
- }
1056
- n.handleEnd(t);
1057
- }
1058
- }
1059
- function qt(e, t) {
1060
- if (!Z(t)) return;
1061
- if (W(e.e), Y) {
1062
- Y = !1;
1063
- return;
1064
- }
1065
- let n = K.get(t.initialParent.el)?.config;
1066
- n?.onDragend && n.onDragend({
1067
- parent: t.currentParent,
1068
- values: bt(t.currentParent.el, t.currentParent.data),
1069
- draggedNode: t.draggedNode,
1070
- draggedNodes: t.draggedNodes,
1071
- state: t
1072
- }), n?.handleEnd(t);
1073
- }
1074
- function Jt(e) {
1075
- e.draggedNode && (e.draggedNode.el.draggable = !0);
1076
- let t = e.draggedNodes.map((e) => e.el), n = e.initialParent.data, r = Z(e), i = K.get(e.initialParent.el)?.config, a = r ? i?.synthDropZoneClass : i?.dropZoneClass, o = n?.config?.longPressClass, s = r ? n?.config?.synthDragPlaceholderClass : n?.config?.dragPlaceholderClass, c = e.originalZIndex;
1077
- Z(e) && (e.clonedDraggedNode && e.clonedDraggedNode.remove(), e.longPressTimeout && clearTimeout(e.longPressTimeout)), Qt(e), e.lastScrollDirectionX = void 0, e.lastScrollDirectionY = void 0, e.preventEnter = !1, e.scrollDebounceTimeout &&= (clearTimeout(e.scrollDebounceTimeout), void 0), c !== void 0 && e.draggedNode && (e.draggedNode.el.style.zIndex = c), requestAnimationFrame(() => {
1078
- $(t, a), $(t, o), $(t, s);
1079
- }), gt(e.draggedNodes, e.currentParent, e), ht(e.currentParent, void 0, e);
1080
- let l = { ...e };
1081
- i?.onDragend?.({
1082
- parent: l.currentParent,
1083
- values: bt(l.currentParent.el, l.currentParent.data),
1084
- draggedNode: l.draggedNode,
1085
- draggedNodes: l.draggedNodes,
1086
- state: l
1087
- }), e.emit("dragEnded", l), it();
1088
- }
1089
- function Yt(e, t) {
1090
- G(e.e), !t.pointerSelection && t.selectedState && gt(t.selectedState.nodes, e.targetData.parent, t);
1091
- let n = e.targetData.parent.data.config;
1092
- t.pointerSelection = !1, "longPressTimeout" in t && t.longPressTimeout && clearTimeout(t.longPressTimeout), t.longPress = !1, $(e.targetData.parent.data.enabledNodes.map((e) => e.el), n.longPressClass), X(t) && n.handleEnd(t);
1093
- }
1094
- function Xt(e, t, n, r, i, a) {
1095
- let o = t.data.config, s, c, l = /* @__PURE__ */ "display.flexDirection.alignItems.justifyContent.padding.paddingTop.margin.marginTop.marginBottom.marginLeft.marginRight.paddingBottom.paddingLeft.paddingRight.border.borderRadius.background.backgroundColor.boxShadow.font.color.lineHeight.gap.width.height.boxSizing.overflow".split("."), u = (e, t) => {
1096
- let n = window.getComputedStyle(e);
1097
- l.forEach((e) => {
1098
- t.style[e] = n[e];
1099
- });
1100
- }, d = (e, t = {}) => {
1101
- Object.assign(e.style, {
1102
- position: "absolute",
1103
- zIndex: "9999",
1104
- pointerEvents: "none",
1105
- willChange: "transform",
1106
- boxSizing: "border-box",
1107
- opacity: "0",
1108
- overflow: "hidden",
1109
- width: `${a.width}px`,
1110
- height: `${a.height}px`,
1111
- ...t
1112
- });
1113
- };
1114
- if (o.synthDragImage) c = o.synthDragImage(e, t, n, i), s = c.dragImage, s.setAttribute("popover", "manual"), d(s);
1115
- else if (!o.multiDrag || i.length === 1) s = e.el.cloneNode(!0), u(e.el, s), s.setAttribute("popover", "manual"), d(s);
1116
- else {
1117
- let e = document.createElement("div");
1118
- e.setAttribute("popover", "manual"), i.forEach((t) => {
1119
- let n = t.el.cloneNode(!0);
1120
- u(t.el, n), n.style.pointerEvents = "none", n.style.margin = "0", e.append(n);
1121
- }), e.style.display = "flex", e.style.flexDirection = "column", e.style.padding = "0", e.style.margin = "0", e.style.position = "absolute", e.style.zIndex = "9999", e.style.pointerEvents = "none", s = e;
1122
- }
1123
- s.id = "dnd-dragged-node-clone", t.el.appendChild(s), s.showPopover();
1124
- let f = {
1125
- clonedDraggedEls: [],
1126
- clonedDraggedNode: s,
1127
- synthDragScrolling: !1,
1128
- synthDragging: !0,
1129
- rootScrollWidth: document.scrollingElement?.scrollWidth,
1130
- rootScrollHeight: document.scrollingElement?.scrollHeight
1131
- };
1132
- return at({
1133
- ...pt(e, t, n, i, c?.offsetX, c?.offsetY),
1134
- ...f
1135
- });
1136
- }
1137
- function Zt(e, t, n) {
1138
- let r = e.targetData.parent.data.config;
1139
- t.longPressTimeout = setTimeout(() => {
1140
- t && (t.longPress = !0, r.longPressClass && e.e.cancelable && fn([n.el], r.longPressClass), W(e.e));
1141
- }, r.longPressDuration || 1e3);
1142
- }
1143
- function Qt(e, t = !0, n = !0) {
1144
- t && (e.frameIdX !== void 0 && (cancelAnimationFrame(e.frameIdX), e.frameIdX = void 0), e.lastScrollDirectionX = void 0), n && (e.frameIdY !== void 0 && (cancelAnimationFrame(e.frameIdY), e.frameIdY = void 0), e.lastScrollDirectionY = void 0), !e.frameIdX && !e.frameIdY && (e.preventEnter = !1);
1145
- }
1146
- function $t(e, t = !1) {
1147
- let { x: n, y: r } = e.coordinates, i = e.startLeft ?? 0, a = e.startTop ?? 0, o = window.scrollX ?? 0, s = window.scrollY ?? 0, c = n - i + o, l = r - a + s;
1148
- e.clonedDraggedNode.style.transform = `translate3d(${c}px, ${l}px, 0px)`, t && (e.clonedDraggedNode.style.opacity = "1", $(e.draggedNodes.map((e) => e.el), e.initialParent.data.config?.longPressClass));
1149
- }
1150
- function en(e, t, n = !1) {
1151
- let r = $e(e);
1152
- t.coordinates.x = r.x, t.coordinates.y = r.y, $t(t, n), t.scrollDebounceTimeout &&= (clearTimeout(t.scrollDebounceTimeout), void 0), t.scrollDebounceTimeout = setTimeout(() => {
1153
- Z(t) && _n(t.coordinates, e, t);
1154
- }, 16);
1155
- let i = vn(r);
1156
- if (!i) {
1157
- document.dispatchEvent(new CustomEvent("handleRootPointerover", { detail: {
1158
- e,
1159
- state: t
1160
- } }));
1161
- return;
1162
- }
1163
- let a = {
1164
- e,
1165
- targetData: i,
1166
- state: t
1167
- };
1168
- "node" in i ? i.node.el.dispatchEvent(new CustomEvent("handleNodePointerover", { detail: a })) : i.parent.el.dispatchEvent(new CustomEvent("handleParentPointerover", { detail: a }));
1169
- }
1170
- function tn(e, t) {
1171
- if (!e.targetData.parent.data.config.nativeDrag) return;
1172
- let { x: n, y: r } = $e(e.e);
1173
- t.coordinates.y = r, t.coordinates.x = n, W(e.e), G(e.e), X(t) && _n({
1174
- x: n,
1175
- y: r
1176
- }, e.e, t), e.targetData.parent.el === t.currentParent?.el ? ln(e, t) : un(e, t);
1177
- }
1178
- function nn(e, t) {
1179
- if (!e.targetData.parent.data.config.nativeDrag) return;
1180
- W(e.e), G(e.e);
1181
- let { x: n, y: r } = $e(e.e);
1182
- X(t) && _n({
1183
- x: n,
1184
- y: r
1185
- }, e.e, t), un(e, t);
1186
- }
1187
- function rn(e) {
1188
- e.detail.targetData.parent.el !== e.detail.state.currentParent.el && un(e.detail, e.detail.state);
1189
- }
1190
- function an({ currentParent: e, targetParent: t, initialParent: n, draggedNodes: r, state: i }) {
1191
- if (t.el === e.el) return !1;
1192
- let a = t.data.config;
1193
- if (r[0].el.contains(t.el) || a.dropZone === !1) return !1;
1194
- let o = n.data.config;
1195
- return a.accepts ? a.accepts(t, n, e, i) : !(!a.group || a.group !== o.group);
1196
- }
1197
- function on(e, t) {
1198
- W(e.e);
1199
- }
1200
- function sn(e, t) {
1201
- W(e.e);
1202
- }
1203
- function cn(e, t, n, r) {
1204
- if (t.affectedNodes.map((e) => e.data.value).includes(e.targetData.node.data.value)) return !1;
1205
- if (t.remapJustFinished) return t.remapJustFinished = !1, (e.targetData.node.data.value === t.currentTargetValue || t.draggedNodes.map((e) => e.el).includes(e.targetData.node.el)) && (t.currentTargetValue = e.targetData.node.data.value), !1;
1206
- if (t.preventEnter) return !1;
1207
- if (t.draggedNodes.map((e) => e.el).includes(e.targetData.node.el)) return t.currentTargetValue = void 0, !1;
1208
- if (e.targetData.node.data.value === t.currentTargetValue || e.targetData.parent.el !== t.currentParent?.el || e.targetData.parent.data.config.sortable === !1 || e.targetData.node.el.contains(t.draggedNodes[0].el)) return !1;
1209
- let i = e.targetData.node.el.getBoundingClientRect(), a = t.draggedNode.el.getBoundingClientRect(), o = i.y - a.y, s = i.x - a.x, c;
1210
- c = Math.abs(o) > Math.abs(s) ? o > 0 ? "above" : "below" : s > 0 ? "left" : "right";
1211
- let l = t.currentParent.data.config.threshold;
1212
- switch (c) {
1213
- case "left":
1214
- if (n > i.x + i.width * l.horizontal) return t.incomingDirection = "left", !0;
1215
- break;
1216
- case "right":
1217
- if (n < i.x + i.width * (1 - l.horizontal)) return t.incomingDirection = "right", !0;
1218
- break;
1219
- case "above":
1220
- if (r > i.y + i.height * l.vertical) return t.incomingDirection = "above", !0;
1221
- break;
1222
- case "below":
1223
- if (r < i.y + i.height * (1 - l.vertical)) return t.incomingDirection = "below", !0;
1224
- break;
1225
- default: break;
1226
- }
1227
- return !1;
1228
- }
1229
- function ln(e, t) {
1230
- let { x: n, y: r } = $e(e.e);
1231
- if (!cn(e, t, n, r)) return;
1232
- let i = t.draggedNode.data.index > e.targetData.node.data.index ? [e.targetData.node.data.index, t.draggedNode.data.index] : [t.draggedNode.data.index, e.targetData.node.data.index];
1233
- t.targetIndex = e.targetData.node.data.index, t.affectedNodes = e.targetData.parent.data.enabledNodes.filter((e) => i[0] <= e.data.index && e.data.index <= i[1] && e.el !== t.draggedNode.el), e.targetData.parent.data.config.performSort({
1234
- parent: e.targetData.parent,
1235
- draggedNodes: t.draggedNodes,
1236
- targetNodes: [e.targetData.node]
1237
- });
1238
- }
1239
- function Q(e) {
1240
- function t(e) {
1241
- let t = q.get(e);
1242
- if (!t) return;
1243
- let n = K.get(e.parentNode);
1244
- if (n) return {
1245
- node: {
1246
- el: e,
1247
- data: t
1248
- },
1249
- parent: {
1250
- el: e.parentNode,
1251
- data: n
1252
- }
1253
- };
1254
- }
1255
- return (n) => {
1256
- let r = t(n.currentTarget);
1257
- if (r) return e({
1258
- e: n,
1259
- targetData: r
1260
- }, J);
1261
- };
1262
- }
1263
- function un(e, t) {
1264
- W(e.e), an({
1265
- currentParent: t.currentParent,
1266
- targetParent: e.targetData.parent,
1267
- initialParent: t.initialParent,
1268
- draggedNodes: t.draggedNodes,
1269
- state: t
1270
- }) && (e.targetData.parent.data.config.performTransfer({
1271
- currentParent: t.currentParent,
1272
- targetParent: e.targetData.parent,
1273
- initialParent: t.initialParent,
1274
- draggedNodes: t.draggedNodes,
1275
- initialIndex: t.initialIndex,
1276
- state: t,
1277
- targetNodes: "node" in e.targetData ? [e.targetData.node] : []
1278
- }), t.currentParent = e.targetData.parent, t.transferred = !0);
1279
- }
1280
- function dn(e) {
1281
- function t(e) {
1282
- let t = K.get(e);
1283
- if (t) return { parent: {
1284
- el: e,
1285
- data: t
1286
- } };
1287
- }
1288
- return (n) => {
1289
- let r = t(n.currentTarget);
1290
- if (r) return e({
1291
- e: n,
1292
- targetData: r
1293
- }, J);
1294
- };
1295
- }
1296
- function fn(e, t, n = !1) {
1297
- function r(e, t) {
1298
- q.set(e, t);
1299
- }
1300
- for (let i of e) {
1301
- let e = pn(i, t, q.get(i), n);
1302
- e && r(i, e);
1303
- }
1304
- }
1305
- function pn(e, t, n, r = !1) {
1306
- if (!t) return;
1307
- let i = Qe(t);
1308
- if (!i.length) return;
1309
- if (!n) {
1310
- e.classList.add(...i);
1311
- return;
1312
- }
1313
- let a = [];
1314
- for (let t of i) e.classList.contains(t) ? e.classList.contains(t) && r === !1 && a.push(t) : e.classList.add(t);
1315
- return n.privateClasses = a, n;
1316
- }
1317
- function $(e, t) {
1318
- if (!t) return;
1319
- let n = Qe(t);
1320
- if (n.length) for (let t of e) {
1321
- if (!yn(t)) {
1322
- t.classList.remove(...n);
1323
- continue;
1324
- }
1325
- let e = q.get(t) || K.get(t);
1326
- if (e) for (let r of n) e.privateClasses.includes(r) || t.classList.remove(r);
1327
- }
1328
- }
1329
- function mn(e, t, n, r, i) {
1330
- let a = .075, o = i.axis === "x", s = e === document.scrollingElement, c = o ? "scrollLeft" : "scrollTop", l = o ? "clientWidth" : "clientHeight", u = o ? "offsetWidth" : "offsetHeight", d = o ? "scrollWidth" : "scrollHeight", f = o ? t.clientX : t.clientY, p = o ? r.left : r.top, m = o ? n.overflowX : n.overflowY;
1331
- if (s) {
1332
- let t = e[c], n = e[l], r = t > 0, s = t + n < (o ? i.state.rootScrollWidth || 0 : e[d]);
1333
- return o ? {
1334
- left: r && f < n * a,
1335
- right: s && f > n * (1 - a)
1336
- } : {
1337
- up: r && f < n * a,
1338
- down: s && f > n * (1 - a)
1339
- };
1340
- }
1341
- if ((m === "auto" || m === "scroll") && e !== document.body && e !== document.documentElement) {
1342
- let t = e[d], n = e[u], r = e[c], i = r > 0, s = r < t - n;
1343
- return o ? {
1344
- left: i && f < p + n * a,
1345
- right: s && f > p + n * (1 - a)
1346
- } : {
1347
- up: i && f < p + n * a,
1348
- down: s && f > p + n * (1 - a)
1349
- };
1350
- }
1351
- return o ? {
1352
- left: !1,
1353
- right: !1
1354
- } : {
1355
- up: !1,
1356
- down: !1
1357
- };
1358
- }
1359
- function hn(e, t, n, r) {
1360
- if (!X(n) || !n.draggedNode) return;
1361
- n.preventEnter = !0;
1362
- let i = r.axis === "x", a = r.direction === "positive" ? 1 : -1, o = i ? "lastScrollDirectionX" : "lastScrollDirectionY", s = i ? "frameIdX" : "frameIdY";
1363
- n[s] !== void 0 && (cancelAnimationFrame(n[s]), n[s] = void 0), n[o] = r.direction;
1364
- let c = () => {
1365
- if (!X(n) || !n.draggedNode) {
1366
- n[s] !== void 0 && (cancelAnimationFrame(n[s]), n[s] = void 0);
1367
- return;
1368
- }
1369
- let t = i ? "scrollLeft" : "scrollTop", r = i ? "clientWidth" : "clientHeight", l = i ? "scrollWidth" : "scrollHeight", u = e[t], d = e[r], f = e[l];
1370
- if (!(a > 0 ? u + d < f : u > 0)) {
1371
- n[s] = void 0, n[o] = void 0;
1372
- return;
1373
- }
1374
- e[t] += 20 * a, Z(n) && $t(n), n[s] = requestAnimationFrame(c);
1375
- };
1376
- n[s] = requestAnimationFrame(c);
1377
- }
1378
- function gn(e, t, n) {
1379
- let r = e.getBoundingClientRect();
1380
- return t >= r.left && t <= r.right && n >= r.top && n <= r.bottom;
1381
- }
1382
- function _n(e, t, n) {
1383
- if (!X(n) || !n.draggedNode) return;
1384
- Qt(n);
1385
- let { x: r, y: i } = e, a = !1, o = (e, r, i) => {
1386
- hn(i, t, n, {
1387
- axis: e,
1388
- direction: r
1389
- }), a = !0;
1390
- }, s = (e) => {
1391
- let r = window.getComputedStyle(e), i = e.getBoundingClientRect(), a = mn(e, t, r, i, {
1392
- axis: "x",
1393
- state: n
1394
- }), s = mn(e, t, r, i, { axis: "y" });
1395
- (a.left || a.right) && (n.lastScrollContainerX = e, o("x", a.right ? "positive" : "negative", e)), (s.up || s.down) && (n.lastScrollContainerY = e, o("y", s.down ? "positive" : "negative", e));
1396
- };
1397
- if (n.lastScrollContainerX && gn(n.lastScrollContainerX, r, i) && s(n.lastScrollContainerX), !a && n.lastScrollContainerY && gn(n.lastScrollContainerY, r, i) && s(n.lastScrollContainerY), !a) {
1398
- let e = document.elementFromPoint(r, i);
1399
- for (; e && !(a && n.lastScrollContainerX && n.lastScrollContainerY);) e instanceof HTMLElement && s(e), e = e.parentElement;
1400
- }
1401
- if (!a) {
1402
- let e = document.scrollingElement;
1403
- e instanceof HTMLElement && s(e);
1404
- }
1405
- a || Qt(n);
1406
- }
1407
- function vn(e) {
1408
- let t = document.elementFromPoint(e.x, e.y);
1409
- if (!yn(t)) return;
1410
- let n, r = !0;
1411
- for (; t && r;) {
1412
- if (q.has(t) || K.has(t)) {
1413
- r = !1, n = K.has(t);
1414
- break;
1415
- }
1416
- t = t.parentNode;
1417
- }
1418
- if (n) {
1419
- let e = K.get(t);
1420
- return e ? { parent: {
1421
- el: t,
1422
- data: e
1423
- } } : void 0;
1424
- } else {
1425
- let e = q.get(t);
1426
- if (!e) return;
1427
- let n = K.get(t.parentNode);
1428
- return n ? {
1429
- node: {
1430
- el: t,
1431
- data: e
1432
- },
1433
- parent: {
1434
- el: t.parentNode,
1435
- data: n
1436
- }
1437
- } : void 0;
1438
- }
1439
- }
1440
- function yn(e) {
1441
- return e instanceof HTMLElement && e.parentNode instanceof HTMLElement;
1442
- }
1443
- function bn(e, t) {
1444
- let n = new AbortController();
1445
- for (let r in t) {
1446
- let i = t[r];
1447
- e.addEventListener(r, i, {
1448
- signal: n.signal,
1449
- passive: !1,
1450
- capture: r === "focus" || r === "blur"
1451
- });
1452
- }
1453
- return n;
1454
- }
1455
- //#endregion
1456
- //#region ../node_modules/.pnpm/@formkit+drag-and-drop@0.5.3/node_modules/@formkit/drag-and-drop/vue/index.mjs
1457
- function xn(e) {
1458
- if (e instanceof HTMLElement) return e;
1459
- if (e.value instanceof HTMLElement) return e.value;
1460
- if ("$el" in e && e.$el instanceof HTMLElement) return e.$el;
1461
- }
1462
- function Sn(e, t) {
1463
- Array.isArray(e) || (e = [e]);
1464
- for (let n of e) {
1465
- let e = xn(n);
1466
- if (e) return t(e);
1467
- let r = I(n, (e) => {
1468
- if (!e) return;
1469
- let n = xn(e);
1470
- n ? t(n) : console.warn("Invalid parent element", e), r();
1471
- });
1472
- }
1473
- }
1474
- var Cn = /* @__PURE__ */ new WeakMap();
1475
- function wn(e) {
1476
- let t = Cn.get(e);
1477
- return t ? "value" in t ? t.value : t : (console.warn("No values found for parent element"), []);
1478
- }
1479
- function Tn(e, t) {
1480
- let n = Cn.get(t);
1481
- n && "value" in n && (n.value = e);
1482
- }
1483
- function En(e) {
1484
- et && (Array.isArray(e) || (e = [e]), e.forEach((e) => {
1485
- let { parent: t, values: n, ...r } = e;
1486
- Sn(t, Dn(r, n));
1487
- }));
1488
- }
1489
- function Dn(e, t) {
1490
- return (n) => {
1491
- Cn.set(n, t), ft({
1492
- parent: n,
1493
- getValues: wn,
1494
- setValues: Tn,
1495
- config: { ...e }
1496
- });
1497
- };
1498
- }
1499
- //#endregion
1500
- //#region src/products/components/detail/variants/Option.vue?vue&type=script&setup=true&lang.ts
1501
- var On = {
1502
- key: 0,
1503
- class: "flex gap-4 p-6 border-b last:border-b-0"
1504
- }, kn = { class: "option-drag-handle flex-none mt-9.5 cursor-grab" }, An = { class: "flex-1" }, jn = { class: "mb-3" }, Mn = { class: "flex items-center" }, Nn = {
1505
- key: 0,
1506
- class: "mt-1 text-sm text-red-600"
1507
- }, Pn = { class: "flex items-center gap-1" }, Fn = { class: "mb-2" }, In = {
1508
- key: 0,
1509
- class: "option-value-drag-handle absolute -left-7 top-1/2 -translate-y-1/2 flex-none mr-2 cursor-grab"
1510
- }, Ln = ["onClick"], Rn = { class: "flex justify-between" }, zn = { class: "flex-1" }, Bn = { class: "text-sm mb-2" }, Vn = { class: "flex flex-wrap gap-2" }, Hn = {
1511
- key: 0,
1512
- class: "px-2 py-1 border rounded-full bg-muted text-muted-foreground text-sm"
1513
- }, Un = /* @__PURE__ */ T({
1514
- __name: "Option",
1515
- props: { option: {
1516
- type: Object,
1517
- required: !0
1518
- } },
1519
- emits: ["update:option", "remove"],
1520
- setup(e, { expose: t, emit: n }) {
1521
- let r = e, { confirm: i } = p(), a = n, o = v({
1522
- get() {
1523
- return r.option;
1524
- },
1525
- set(e) {
1526
- a("update:option", e);
1527
- }
1528
- }), s = v({
1529
- get() {
1530
- return o.value.values;
1531
- },
1532
- set(e) {
1533
- o.value.values = e;
1534
- }
1535
- }), c = F("valueListRef"), l = A(!1);
1536
- I(l, async (e) => {
1537
- e || (await D(), En({
1538
- parent: c?.value,
1539
- values: s,
1540
- group: "valueList",
1541
- dragHandle: ".option-value-drag-handle",
1542
- plugins: [_e()]
1543
- }));
1544
- }, { immediate: !0 });
1545
- let u = () => Math.random().toString(36).substring(2, 15), d = () => {
1546
- o.value.values.push({
1547
- id: u(),
1548
- value: ""
1549
- });
1550
- }, f = async () => {
1551
- (o.value.name.trim() || o.value.values.filter((e) => e.value.trim() !== "").length > 0) && !await i("Are you sure you want to remove this option?") || a("remove");
1552
- }, m = (e) => {
1553
- o.value.values.splice(e, 1);
1554
- }, h = (e) => {
1555
- e.name.trim() ? e.nameError = void 0 : e.nameError = "Option name is required.";
1556
- }, g = (e, t) => {
1557
- let n = e.target, r = o.value.values;
1558
- if (e.key === "Backspace" && n.value === "" && r?.length > 2) {
1559
- m(t);
1560
- return;
1561
- }
1562
- }, ee = (e, t) => {
1563
- e.target;
1564
- let n = o.value.values, r = n?.[t];
1565
- r.touched = !0, n?.every((e) => e.value.trim() !== "") && d();
1566
- }, y = (e) => {
1567
- let t = o.value, n = t?.values.every((t, n) => t.value.trim() !== "" || n === e);
1568
- t && t.values[e].value.trim() === "" && !n && m(e);
1569
- };
1570
- return t({ minified: l }), (e, t) => {
1571
- let n = M("Input"), r = M("Button");
1572
- return l.value ? (k(), x("div", {
1573
- key: 1,
1574
- class: "flex gap-4 p-6 border-b last:border-b-0 hover:bg-accent dark:hover:bg-accent/50 cursor-pointer transition-colors duration-200",
1575
- onClick: t[5] ||= (e) => l.value = !1
1576
- }, [S("div", null, [S("div", {
1577
- class: "option-drag-handle flex-none mt-5 cursor-grab",
1578
- onClick: t[4] ||= z(() => {}, ["stop"])
1579
- }, [w(P(le), { class: "size-4 text-gray-400" })])]), S("div", zn, [S("p", Bn, N(o.value.name), 1), S("div", Vn, [(k(!0), x(_, null, j(s.value, (e) => (k(), x(_, { key: e.id }, [e.value ? (k(), x("span", Hn, N(e.value), 1)) : b("", !0)], 64))), 128))])])])) : (k(), x("div", On, [S("div", null, [S("div", kn, [w(P(le), { class: "size-4 text-gray-400" })])]), S("div", An, [
1580
- S("div", jn, [
1581
- t[6] ||= S("label", { class: "block text-sm mb-2" }, "Option name", -1),
1582
- S("div", Mn, [w(n, {
1583
- modelValue: o.value.name,
1584
- "onUpdate:modelValue": t[0] ||= (e) => o.value.name = e,
1585
- onBlur: t[1] ||= (e) => h(o.value),
1586
- "aria-invalid": o.value.nameError ? "true" : "false",
1587
- placeholder: "Color",
1588
- spellcheck: "false"
1589
- }, null, 8, ["modelValue", "aria-invalid"])]),
1590
- o.value.nameError ? (k(), x("p", Nn, [S("span", Pn, [w(P(ce), { class: "size-4" }), C(" " + N(o.value.nameError), 1)])])) : b("", !0)
1591
- ]),
1592
- S("div", Fn, [t[7] ||= S("label", { class: "block text-sm mb-2" }, "Option values", -1), S("div", {
1593
- ref_key: "valueListRef",
1594
- ref: c
1595
- }, [s.value ? (k(!0), x(_, { key: 0 }, j(s.value, (e, t) => (k(), x("div", {
1596
- key: e.id,
1597
- class: "relative flex items-center mb-2"
1598
- }, [
1599
- e.touched ? (k(), x("div", In, [w(P(le), { class: "size-4 text-gray-400" })])) : b("", !0),
1600
- w(n, {
1601
- modelValue: e.value,
1602
- "onUpdate:modelValue": (t) => e.value = t,
1603
- placeholder: "Option value",
1604
- class: "pr-12",
1605
- onKeydown: (e) => g(e, t),
1606
- onKeyup: (e) => ee(e, t),
1607
- onBlur: (e) => y(t),
1608
- spellcheck: "false"
1609
- }, null, 8, [
1610
- "modelValue",
1611
- "onUpdate:modelValue",
1612
- "onKeydown",
1613
- "onKeyup",
1614
- "onBlur"
1615
- ]),
1616
- s.value.length > 2 && e.touched ? (k(), x("button", {
1617
- key: 1,
1618
- onClick: (e) => m(t),
1619
- class: "absolute right-2 top-1/2 -translate-y-1/2 ml-2 p-2 text-muted-foreground/50 hover:text-muted-foreground",
1620
- type: "button"
1621
- }, [w(P(he), { class: "size-4" })], 8, Ln)) : b("", !0)
1622
- ]))), 128)) : b("", !0)], 512)]),
1623
- S("div", Rn, [w(r, {
1624
- size: "sm",
1625
- variant: "outline",
1626
- onClick: t[2] ||= (e) => f(),
1627
- class: "text-red-500 hover:text-red-600"
1628
- }, {
1629
- default: L(() => [...t[8] ||= [C("Delete", -1)]]),
1630
- _: 1
1631
- }), w(r, {
1632
- size: "sm",
1633
- onClick: t[3] ||= (e) => l.value = !0,
1634
- disabled: o.value.name.trim() === ""
1635
- }, {
1636
- default: L(() => [...t[9] ||= [C("Done", -1)]]),
1637
- _: 1
1638
- }, 8, ["disabled"])])
1639
- ])]));
1640
- };
1641
- }
1642
- }), Wn = /* @__PURE__ */ T({
1643
- __name: "Options",
1644
- props: { modelValue: {
1645
- type: Array,
1646
- default: () => []
1647
- } },
1648
- emits: ["update:modelValue"],
1649
- setup(e, { expose: t, emit: n }) {
1650
- let r = e, i = n, a = A([]), o = F("optionsListRefElement"), s = F("optionRefs"), c = v({
1651
- get() {
1652
- return r.modelValue;
1653
- },
1654
- set(e) {
1655
- i("update:modelValue", e);
1656
- }
1657
- }), l = A(!1);
1658
- I(c, (e) => {
1659
- l.value || (!a.value || a.value.length === 0 && e.length > 0) && (l.value = !0, a.value = e ? JSON.parse(JSON.stringify(e)) : []);
1660
- }, { deep: !0 }), I(a, (e) => {
1661
- c.value = e?.map((e) => ({
1662
- ...e,
1663
- values: e.values.filter((e) => e.value.trim() !== "")
1664
- })), !h.value && e.length > 0 && g();
1665
- }, { deep: !0 });
1666
- let u = () => Math.random().toString(36).substring(2, 15), d = () => {
1667
- let e = {
1668
- id: u(),
1669
- name: "",
1670
- values: [{
1671
- id: u(),
1672
- value: ""
1673
- }],
1674
- nameError: void 0
1675
- };
1676
- a.value.push(e);
1677
- }, f = () => {
1678
- s.value?.forEach((e) => {
1679
- e && (e.minified = !0);
1680
- });
1681
- }, p = (e) => {
1682
- let t = a.value.findIndex((t) => t.id === e.id);
1683
- t !== -1 && (a.value[t] = e);
1684
- }, m = (e) => {
1685
- let t = a.value.findIndex((t) => t.id === e.id);
1686
- t !== -1 && a.value.splice(t, 1);
1687
- }, h = A(!1), g = () => {
1688
- try {
1689
- h.value = !0, En({
1690
- parent: o?.value,
1691
- values: a,
1692
- group: "optionsList",
1693
- dragHandle: ".option-drag-handle",
1694
- plugins: [_e()]
1695
- });
1696
- } catch (e) {
1697
- console.error(e);
1698
- }
1699
- };
1700
- return ne(() => {
1701
- a.value = r.modelValue ? JSON.parse(JSON.stringify(r.modelValue)) : [], a.value.length > 0 && g();
1702
- }), t({ minifyAll: f }), (e, t) => {
1703
- let n = M("Button");
1704
- return k(), x("div", null, [S("div", { class: O(["rounded-lg", a.value.length > 0 ? "border mb-6" : ""]) }, [S("div", {
1705
- ref_key: "optionsListRefElement",
1706
- ref: o
1707
- }, [(k(!0), x(_, null, j(a.value, (e) => (k(), y(Un, {
1708
- ref_for: !0,
1709
- ref_key: "optionRefs",
1710
- ref: s,
1711
- key: e.id,
1712
- option: e,
1713
- "onUpdate:option": t[0] ||= (e) => p(e),
1714
- onRemove: (t) => m(e)
1715
- }, null, 8, ["option", "onRemove"]))), 128))], 512), a.value && a.value.length < 3 ? (k(), x("div", {
1716
- key: 0,
1717
- class: O(a.value.length > 0 ? "border-t" : "")
1718
- }, [a.value.length === 0 ? (k(), y(n, {
1719
- key: 0,
1720
- onClick: d,
1721
- variant: "outline"
1722
- }, {
1723
- default: L(() => [w(P(H), { class: "size-4" }), t[1] ||= C(" Add options like size or color ", -1)]),
1724
- _: 1
1725
- })) : (k(), y(n, {
1726
- key: 1,
1727
- onClick: d,
1728
- variant: "ghost",
1729
- class: "w-full justify-start pl-2 rounded-t-none"
1730
- }, {
1731
- default: L(() => [w(P(H), { class: "size-4" }), t[2] ||= C(" Add another option ", -1)]),
1732
- _: 1
1733
- }))], 2)) : b("", !0)], 2)]);
1734
- };
1735
- }
1736
- }), Gn = { key: 0 }, Kn = { class: "flex items-center justify-between gap-2 mb-2" }, qn = {
1737
- key: 0,
1738
- class: "flex items-center gap-2"
1739
- }, Jn = {
1740
- key: 0,
1741
- class: "mb-4"
1742
- }, Yn = { class: "flex flex-wrap gap-2" }, Xn = ["onClick"], Zn = { class: "-mx-6 w-[calc(100%+3rem)]" }, Qn = { class: "text-muted-foreground text-xs" }, $n = { class: "z-[101] sticky -top-4 py-2 font-normal bg-accent dark:bg-border" }, er = { class: "z-[101] sticky -top-4 py-2 font-normal whitespace-nowrap bg-accent dark:bg-border" }, tr = { class: "flex items-center gap-2" }, nr = { class: "z-[101] sticky -top-4 py-2 pr-6 font-normal bg-accent dark:bg-border" }, rr = { class: "text-sm" }, ir = ["onClick"], ar = { class: "w-10 p-2" }, or = { class: "p-2" }, sr = { class: "flex items-stretch gap-2" }, cr = ["src"], lr = {
1743
- key: 2,
1744
- class: "relative"
1745
- }, ur = ["src"], dr = ["src"], fr = { class: "flex flex-col justify-center px-2" }, pr = { class: "text-md mb-0.5 hover:underline select-none" }, mr = { class: "flex items-center gap-1 text-xs text-muted-foreground hover:opacity-70 transition-opacity duration-200 cursor-pointer select-none" }, hr = { class: "p-2 w-[30%]" }, gr = { class: "relative" }, _r = { key: 0 }, vr = { key: 1 }, yr = {
1746
- key: 0,
1747
- class: "absolute inset-0 top-1/2 -translate-y-1/2 px-2 truncate text-sm text-muted-foreground w-full text-center pointer-events-none"
1748
- }, br = { class: "p-2 w-[18%]" }, xr = { class: "w-10" }, Sr = { class: "w-10 p-2 translate-x-10" }, Cr = { class: "p-2 pl-12" }, wr = { class: "flex items-stretch gap-2" }, Tr = ["src"], Er = { class: "flex flex-col justify-center px-2" }, Dr = { class: "p-2 w-[30%]" }, Or = { class: "p-2 w-[18%] group" }, kr = { class: "text-center text-sm text-muted-foreground bg-accent dark:bg-border p-3 -mx-6 -mb-6 rounded-b-lg" }, Ar = { key: 0 }, jr = /* @__PURE__ */ T({
1749
- __name: "VariantList",
1750
- props: {
1751
- options: {
1752
- type: Object,
1753
- required: !0
1754
- },
1755
- modelValue: {
1756
- type: Array,
1757
- required: !0
1758
- },
1759
- hide: {
1760
- type: Boolean,
1761
- default: !1
1762
- }
1763
- },
1764
- emits: ["update:modelValue"],
1765
- setup(e, { expose: t, emit: n }) {
1766
- let r = e, i = n, a = v({
1767
- get() {
1768
- return r.modelValue;
1769
- },
1770
- set(e) {
1771
- i("update:modelValue", e);
1772
- }
1773
- }), o = te("sources"), s = A(""), c = A(""), l = A(!1), u = A([]), d = A({}), f = () => {
1774
- Object.keys(r.options).length > 0 && (c.value = Object.keys(r.options)[0]);
1775
- };
1776
- I(() => r.options, () => {
1777
- c.value === "" && f();
1778
- }, {
1779
- immediate: !0,
1780
- deep: !0
1781
- }), I(d, (e) => {
1782
- p();
1783
- }, { deep: !0 }), I(() => r.hide, (e) => {
1784
- e || (f(), p());
1785
- });
1786
- function p() {
1787
- if (!d.value) {
1788
- a.value = [];
1789
- return;
1790
- }
1791
- let e = [];
1792
- Object.keys(d.value)?.forEach((t) => {
1793
- e.push({
1794
- combinedOptions: t,
1795
- name: g(t),
1796
- disabled: !1,
1797
- price: d.value[t].price,
1798
- stock: d.value[t].stock,
1799
- image: d.value[t].image,
1800
- options: ee(t)
1801
- });
1802
- }), a.value = e.filter((e) => e.options?.length === Object.keys(r.options).length && e.options?.every((e) => Object.entries(r.options).find(([t, n]) => n.id === e.optionId)));
1803
- }
1804
- function m(e) {
1805
- return e.reduce((e, t) => e.flatMap((e) => t.map((t) => [...e, t])), [[]]);
1806
- }
1807
- function h(e) {
1808
- return e.slice().sort((e, t) => e.optionId.localeCompare(t.optionId)).map(({ optionId: e, valueId: t }) => `${e}:${t}`).join("|");
1809
- }
1810
- let g = (e) => e.split("|").map((e) => {
1811
- let [t, n] = e.split(":");
1812
- return {
1813
- optionId: t,
1814
- valueId: n
1815
- };
1816
- }).map((e) => (r.options?.[e.optionId])?.values?.find((t) => t.id === e.valueId)?.value || "").join(" "), ee = (e) => e.split("|").map((e) => {
1817
- let [t, n] = e.split(":");
1818
- return {
1819
- optionId: t,
1820
- valueId: n
1821
- };
1822
- }).map((e) => {
1823
- let t = r.options?.[e.optionId], n = t?.values?.find((t) => t.id === e.valueId);
1824
- return {
1825
- optionId: t?.id,
1826
- option: t?.name,
1827
- valueId: n?.id,
1828
- value: n?.value
1829
- };
1830
- }), T = v(() => m(Object.values(r.options).map((e) => e.values.map((t) => ({
1831
- optionId: e.id,
1832
- optionName: e.name,
1833
- valueId: t.id,
1834
- value: t.value
1835
- })))).map((e) => {
1836
- let t = h(e);
1837
- return d.value[t] || (d.value[t] = {
1838
- price: 0,
1839
- stock: 0
1840
- }), {
1841
- key: t,
1842
- options: e,
1843
- ...d.value[t]
1844
- };
1845
- })), E = v(() => {
1846
- let e = [...T.value];
1847
- return s.value && (e = e.filter((e) => e.options?.find((e) => e.value.toLowerCase().includes(s.value.toLowerCase())))), e;
1848
- }), re = (e, t) => {
1849
- let n = E.value.filter((e) => e.options?.find((e) => e.optionId === c.value)?.valueId === t);
1850
- n && n.forEach((t) => {
1851
- d.value[h(t.options)].image = e;
1852
- });
1853
- }, F = (e) => T.value.filter((t) => t.options?.find((e) => e.optionId === c.value)?.valueId === e).every((e) => !e.image), ie = (e) => {
1854
- let t = T.value.filter((t) => t.options?.find((e) => e.optionId === c.value)?.valueId === e);
1855
- return t.filter((e, n) => e.image && t.findIndex((t) => t.image === e.image) === n).length === 1;
1856
- }, ae = (e) => T.value.filter((t) => t.options?.find((e) => e.optionId === c.value)?.valueId === e).filter((e) => e.image)[0]?.image, se = (e) => T.value.filter((t) => t.options?.find((e) => e.optionId === c.value)?.valueId === e).filter((e) => e.image)[1]?.image, ce = (e) => {
1857
- let t = T.value.filter((t) => t.options?.find((t) => t.valueId === e));
1858
- if (t.length === 0) return "0";
1859
- let n = t.map((e) => e.price);
1860
- return Math.min(...n) === Math.max(...n) ? n[0]?.toString() || "0" : `${Math.min(...n)} - ${Math.max(...n)}`;
1861
- }, le = (e) => T.value.filter((t) => t.options?.find((t) => t.valueId === e)).reduce((e, t) => t.stock > 0 ? e + t.stock : e, 0), V = (e) => T.value.filter((t) => t.options?.find((t) => t.valueId === e)).reduce((e, t) => t.stock < 0 ? e + t.stock : e, 0), de = () => {
1862
- let e = 0;
1863
- return r.options?.[c.value]?.values?.forEach((t) => {
1864
- e += le(t.id);
1865
- }), e;
1866
- }, fe = () => {
1867
- let e = 0;
1868
- return r.options?.[c.value]?.values?.forEach((t) => {
1869
- e += V(t.id);
1870
- }), e;
1871
- }, H = A(null), U = A(""), me = async (e, t) => {
1872
- e.preventDefault();
1873
- let n = E?.value?.filter((e) => e.options?.find((e) => e.optionId === c.value)?.valueId === t.id).map((e) => e.price), r = n.length === 0 ? !0 : n.every((e) => e === n[0]);
1874
- H.value = t.id, U.value = r ? n[0].toString() : "", await D(), document.getElementById(`variant-price-${t.id}`)?.focus(), document.getElementById(`variant-price-${t.id}`)?.select();
1875
- }, he = (e) => {
1876
- _e(e), H.value = null, U.value = "";
1877
- }, _e = (e) => {
1878
- if (U.value.trim() && Number(U.value.trim().replace(",", ".")) > 0) {
1879
- let t = Number(U.value.trim().replace(",", "."));
1880
- E?.value?.filter((t) => t.options?.find((e) => e.optionId === c.value)?.valueId === e).forEach((e) => {
1881
- d.value[h(e.options)].price = t;
1882
- });
1883
- }
1884
- };
1885
- return ne(() => {
1886
- f();
1887
- }), t({
1888
- setVariantMap: (e) => {
1889
- d.value = e.reduce((e, t) => (e[t.combinedOptions] = {
1890
- price: t.price,
1891
- stock: t.stock,
1892
- image: t.image
1893
- }, e), {});
1894
- },
1895
- refreshVariants: p
1896
- }), (t, n) => {
1897
- let r = M("SelectValue"), i = M("SelectTrigger"), a = M("SelectItem"), f = M("SelectContent"), p = M("Select"), m = M("Button"), g = M("Input"), ee = M("PopoverTrigger"), v = M("RadioGroupItem"), T = M("Label"), te = M("RadioGroup"), D = M("PopoverContent"), ne = M("Popover"), A = M("Checkbox"), I = M("TooltipTrigger"), V = M("TooltipContent"), ve = M("Tooltip"), ye = M("MediaPickerDialog"), be = M("NumberFieldInput"), xe = M("NumberFieldContent"), Se = M("NumberField"), Ce = M("NumberFieldDecrement"), we = M("NumberFieldIncrement");
1898
- return e.hide ? b("", !0) : (k(), x("div", Gn, [
1899
- S("div", Kn, [Object.keys(e.options).length > 1 ? (k(), x("div", qn, [n[13] ||= S("p", null, "Group by", -1), w(p, {
1900
- modelValue: c.value,
1901
- "onUpdate:modelValue": n[0] ||= (e) => c.value = e
1902
- }, {
1903
- default: L(() => [w(i, { size: "sm" }, {
1904
- default: L(() => [w(r, { placeholder: "Option" })]),
1905
- _: 1
1906
- }), w(f, null, {
1907
- default: L(() => [(k(!0), x(_, null, j(e.options, (e) => (k(), y(a, {
1908
- key: e.id,
1909
- value: e.id
1910
- }, {
1911
- default: L(() => [C(N(e.name), 1)]),
1912
- _: 2
1913
- }, 1032, ["value"]))), 128))]),
1914
- _: 1
1915
- })]),
1916
- _: 1
1917
- }, 8, ["modelValue"])])) : b("", !0), l.value ? (k(), y(m, {
1918
- key: 2,
1919
- variant: "outline",
1920
- onClick: n[2] ||= (e) => l.value = !1,
1921
- size: "sm",
1922
- class: "ml-auto"
1923
- }, {
1924
- default: L(() => [...n[14] ||= [C(" Cancel ", -1)]]),
1925
- _: 1
1926
- })) : (k(), y(m, {
1927
- key: 1,
1928
- variant: "outline",
1929
- onClick: n[1] ||= (e) => l.value = !0,
1930
- size: "sm",
1931
- class: "ml-auto"
1932
- }, {
1933
- default: L(() => [w(P(pe), { class: "size-4" }), w(P(ue), { class: "size-4" })]),
1934
- _: 1
1935
- }))]),
1936
- l.value ? (k(), x("div", Jn, [S("div", { class: O(["relative", { "mb-4": Object.keys(e.options).length > 0 }]) }, [w(g, {
1937
- placeholder: "Search",
1938
- class: "pl-10",
1939
- modelValue: s.value,
1940
- "onUpdate:modelValue": n[3] ||= (e) => s.value = e
1941
- }, null, 8, ["modelValue"]), w(P(pe), { class: "size-4 absolute left-3 top-1/2 -translate-y-1/2 pointer-events-none" })], 2), S("div", Yn, [(k(!0), x(_, null, j(e.options, (e) => (k(), y(ne, { key: e.id }, {
1942
- default: L(() => [w(ee, { asChild: "" }, {
1943
- default: L(() => [w(m, {
1944
- variant: "outline",
1945
- size: "sm",
1946
- class: "border-dashed"
1947
- }, {
1948
- default: L(() => [e.groupBy ? (k(), x(_, { key: 1 }, [C(N(e.name) + " is " + N(e.values.find((t) => t.id === e.groupBy)?.value) + " ", 1), S("div", {
1949
- class: "p-2",
1950
- onClick: z((t) => e.groupBy = "", ["stop"])
1951
- }, [w(P(ge), { class: "size-3" })], 8, Xn)], 64)) : (k(), x(_, { key: 0 }, [C(N(e.name) + " ", 1), w(P(oe), { class: "size-3" })], 64))]),
1952
- _: 2
1953
- }, 1024)]),
1954
- _: 2
1955
- }, 1024), w(D, null, {
1956
- default: L(() => [w(te, {
1957
- modelValue: e.groupBy,
1958
- "onUpdate:modelValue": (t) => e.groupBy = t,
1959
- class: "mb-4"
1960
- }, {
1961
- default: L(() => [(k(!0), x(_, null, j(e.values, (e) => (k(), x("div", {
1962
- class: "flex items-center space-x-2",
1963
- key: e.id
1964
- }, [w(v, {
1965
- id: e.id,
1966
- value: e.id,
1967
- class: "border-ring"
1968
- }, null, 8, ["id", "value"]), w(T, { for: e.id }, {
1969
- default: L(() => [C(N(e.value), 1)]),
1970
- _: 2
1971
- }, 1032, ["for"])]))), 128))]),
1972
- _: 2
1973
- }, 1032, ["modelValue", "onUpdate:modelValue"]), w(m, {
1974
- variant: "ghost",
1975
- onClick: (t) => e.groupBy = "",
1976
- size: "sm",
1977
- class: "ml-auto",
1978
- disabled: !e.groupBy
1979
- }, {
1980
- default: L(() => [...n[15] ||= [C(" Clear ", -1)]]),
1981
- _: 1
1982
- }, 8, ["onClick", "disabled"])]),
1983
- _: 2
1984
- }, 1024)]),
1985
- _: 2
1986
- }, 1024))), 128))])])) : b("", !0),
1987
- c.value ? (k(), x(_, { key: 1 }, [S("table", Zn, [S("thead", Qn, [S("tr", null, [
1988
- S("th", $n, [w(A, { class: "border-muted-foreground translate-y-0.5" })]),
1989
- S("th", er, [S("div", tr, [
1990
- n[16] ||= S("span", null, "Variant", -1),
1991
- n[17] ||= S("span", null, "·", -1),
1992
- u.value.length > 0 ? (k(), x("button", {
1993
- key: 0,
1994
- class: "hover:underline cursor-pointer",
1995
- onClick: n[4] ||= (e) => u.value = []
1996
- }, "Collapse all")) : (k(), x("button", {
1997
- key: 1,
1998
- class: "hover:underline cursor-pointer",
1999
- onClick: n[5] ||= (t) => u.value = e.options[c.value].values.map((e) => e.id)
2000
- }, "Expand all"))
2001
- ])]),
2002
- n[20] ||= S("th", { class: "z-[101] sticky -top-4 py-2 font-normal bg-accent dark:bg-border" }, "Price", -1),
2003
- S("th", nr, [w(ve, null, {
2004
- default: L(() => [w(I, { class: "underline decoration-dashed underline-offset-4" }, {
2005
- default: L(() => [...n[18] ||= [C("Available", -1)]]),
2006
- _: 1
2007
- }), w(V, null, {
2008
- default: L(() => [...n[19] ||= [S("p", null, "Inventory at your store that can be sold.", -1)]]),
2009
- _: 1
2010
- })]),
2011
- _: 1
2012
- })])
2013
- ])]), S("tbody", rr, [(k(!0), x(_, null, j(e.options[c.value].values, (e) => (k(), x(_, { key: e.id }, [S("tr", {
2014
- class: "hover:bg-accent/50 cursor-pointer transition-colors duration-200 border-b border-input",
2015
- onClick: (t) => u.value.includes(e.id) ? u.value.splice(u.value.indexOf(e.id), 1) : u.value.push(e.id)
2016
- }, [
2017
- S("td", ar, [w(A, {
2018
- class: "border-muted-foreground translate-y-0.5",
2019
- onClick: n[6] ||= z(() => {}, ["stop"])
2020
- })]),
2021
- S("td", or, [S("div", sr, [S("div", null, [w(ye, {
2022
- sources: P(o),
2023
- maxFiles: 1,
2024
- "initial-value": F(e.id) ? [] : ie(e.id) ? [ae(e.id)] : [ae(e.id), se(e.id)],
2025
- onSubmit: (t) => re(t, e.id)
2026
- }, {
2027
- default: L(() => [S("button", {
2028
- onClick: n[7] ||= z(() => {}, ["stop"]),
2029
- tabindex: "-1",
2030
- class: "cursor-pointer"
2031
- }, [F(e.id) ? (k(), y(m, {
2032
- key: 0,
2033
- variant: "outline",
2034
- class: "size-15 border-dashed cursor-pointer"
2035
- }, {
2036
- default: L(() => [w(P(B))]),
2037
- _: 1
2038
- })) : ie(e.id) ? (k(), x("img", {
2039
- key: 1,
2040
- src: ae(e.id),
2041
- class: "size-15 rounded-md object-cover",
2042
- draggable: "false"
2043
- }, null, 8, cr)) : (k(), x("div", lr, [S("img", {
2044
- src: se(e.id),
2045
- class: "absolute rotate-[12deg] size-15 rounded-md object-cover",
2046
- draggable: "false"
2047
- }, null, 8, ur), S("img", {
2048
- src: ae(e.id),
2049
- class: "relative size-15 rounded-md shadow object-cover",
2050
- draggable: "false"
2051
- }, null, 8, dr)]))])]),
2052
- _: 2
2053
- }, 1032, [
2054
- "sources",
2055
- "initial-value",
2056
- "onSubmit"
2057
- ])]), S("div", fr, [S("p", pr, N(e.value), 1), S("button", mr, [C(N(E.value?.filter((t) => t.options?.find((e) => e.optionId === c.value)?.valueId === e.id).length) + " variants ", 1), w(P(oe), { class: O(["size-3 transition-transform duration-200", u.value.includes(e.id) ? "rotate-180" : ""]) }, null, 8, ["class"])])])])]),
2058
- S("td", hr, [S("div", gr, [w(ve, null, {
2059
- default: L(() => [w(I, {
2060
- class: "w-full",
2061
- asChild: ""
2062
- }, {
2063
- default: L(() => [w(g, {
2064
- id: `variant-price-${e.id}`,
2065
- modelValue: U.value,
2066
- "onUpdate:modelValue": n[8] ||= (e) => U.value = e,
2067
- class: O(["dark:bg-transparent dark:border-ring/50 text-center", H.value === e.id ? "" : "text-transparent"]),
2068
- onClick: n[9] ||= z(() => {}, ["stop"]),
2069
- onFocus: (t) => me(t, e),
2070
- onBlur: (t) => he(e.id),
2071
- onKeydown: R((t) => _e(e.id), ["enter"])
2072
- }, null, 8, [
2073
- "id",
2074
- "modelValue",
2075
- "class",
2076
- "onFocus",
2077
- "onBlur",
2078
- "onKeydown"
2079
- ])]),
2080
- _: 2
2081
- }, 1024), w(V, null, {
2082
- default: L(() => [E.value?.filter((t) => t.options?.find((e) => e.optionId === c.value)?.valueId === e.id).length === 1 ? (k(), x("p", _r, "Applies to 1 variant")) : (k(), x("p", vr, "Applies to all " + N(E.value?.filter((t) => t.options?.find((e) => e.optionId === c.value)?.valueId === e.id).length) + " variants", 1))]),
2083
- _: 2
2084
- }, 1024)]),
2085
- _: 2
2086
- }, 1024), H.value === e.id ? b("", !0) : (k(), x("span", yr, N(ce(e.id)), 1))])]),
2087
- S("td", br, [w(ve, null, {
2088
- default: L(() => [w(I, {
2089
- class: "w-full focus-visible:outline-none",
2090
- onClick: n[10] ||= z(() => {}, ["stop"])
2091
- }, {
2092
- default: L(() => [w(Se, null, {
2093
- default: L(() => [w(xe, null, {
2094
- default: L(() => [w(be, {
2095
- value: le(e.id),
2096
- class: "dark:border-ring/50",
2097
- disabled: ""
2098
- }, null, 8, ["value"])]),
2099
- _: 2
2100
- }, 1024)]),
2101
- _: 2
2102
- }, 1024)]),
2103
- _: 2
2104
- }, 1024), w(V, null, {
2105
- default: L(() => [...n[21] ||= [S("p", null, "Update for individual variants only", -1)]]),
2106
- _: 1
2107
- })]),
2108
- _: 2
2109
- }, 1024)])
2110
- ], 8, ir), u.value.includes(e.id) ? (k(!0), x(_, { key: 0 }, j(E.value?.filter((t) => t.options?.find((e) => e.optionId === c.value)?.valueId === e.id), (e) => (k(), x("tr", {
2111
- key: e.id,
2112
- class: "hover:bg-accent/50 cursor-pointer transition-colors duration-200 border-b border-input"
2113
- }, [
2114
- S("td", xr, [S("div", Sr, [w(A, {
2115
- class: "border-muted-foreground translate-y-0.5",
2116
- onClick: n[11] ||= z(() => {}, ["stop"])
2117
- })])]),
2118
- S("td", Cr, [S("div", wr, [S("div", null, [w(ye, {
2119
- sources: P(o),
2120
- maxFiles: 1,
2121
- "initial-value": d.value[h(e.options)].image ? [d.value[h(e.options)].image] : [],
2122
- onSubmit: (t) => d.value[h(e.options)].image = t
2123
- }, {
2124
- default: L(() => [S("button", {
2125
- onClick: n[12] ||= z(() => {}, ["stop"]),
2126
- tabindex: "-1",
2127
- class: "cursor-pointer"
2128
- }, [d.value[h(e.options)].image ? (k(), x("img", {
2129
- key: 0,
2130
- src: d.value[h(e.options)].image,
2131
- class: "size-10 object-cover rounded-md",
2132
- draggable: "false"
2133
- }, null, 8, Tr)) : (k(), y(m, {
2134
- key: 1,
2135
- variant: "outline",
2136
- class: "size-10 border-dashed cursor-pointer"
2137
- }, {
2138
- default: L(() => [w(P(B))]),
2139
- _: 1
2140
- }))])]),
2141
- _: 2
2142
- }, 1032, [
2143
- "sources",
2144
- "initial-value",
2145
- "onSubmit"
2146
- ])]), S("div", Er, [S("p", null, N(e.options.filter((e) => e.optionId !== c.value).map((e) => e.value).join(" / ")), 1)])])]),
2147
- S("td", Dr, [w(Se, {
2148
- "format-options": {
2149
- style: "currency",
2150
- currency: "EUR",
2151
- currencyDisplay: "symbol",
2152
- currencySign: "standard"
2153
- },
2154
- modelValue: d.value[h(e.options)].price,
2155
- "onUpdate:modelValue": (t) => d.value[h(e.options)].price = t,
2156
- min: 0
2157
- }, {
2158
- default: L(() => [w(xe, null, {
2159
- default: L(() => [w(be, { class: "dark:border-ring/50" })]),
2160
- _: 1
2161
- })]),
2162
- _: 1
2163
- }, 8, ["modelValue", "onUpdate:modelValue"])]),
2164
- S("td", Or, [w(Se, {
2165
- modelValue: d.value[h(e.options)].stock,
2166
- "onUpdate:modelValue": (t) => d.value[h(e.options)].stock = t
2167
- }, {
2168
- default: L(() => [w(xe, null, {
2169
- default: L(() => [
2170
- w(Ce, { class: "group-hover:opacity-100 opacity-0 transition-opacity duration-200" }),
2171
- w(be, { class: "dark:border-ring/50" }),
2172
- w(we, { class: "group-hover:opacity-100 opacity-0 transition-opacity duration-200" })
2173
- ]),
2174
- _: 1
2175
- })]),
2176
- _: 1
2177
- }, 8, ["modelValue", "onUpdate:modelValue"])])
2178
- ]))), 128)) : b("", !0)], 64))), 128))])]), S("div", kr, [
2179
- C(" Total inventory at Webshop: " + N(de()) + " ", 1),
2180
- fe() < 0 ? (k(), x("span", Ar, "(" + N(fe()) + ")", 1)) : b("", !0),
2181
- n[22] ||= C(" available ", -1)
2182
- ])], 64)) : b("", !0)
2183
- ]));
2184
- };
2185
- }
2186
- }), Mr = /* @__PURE__ */ T({
2187
- __name: "Variants",
2188
- setup(e) {
2189
- let { params: t } = ee(), { value: n } = o("options"), { value: r } = o("variants"), i = A([]), a = A([]), s = F("optionsEl"), c = F("variantsEl");
2190
- I(i, async (e) => {
2191
- n.value = e ? JSON.parse(JSON.stringify(e)) : [], await D(), c.value?.refreshVariants();
2192
- }, { deep: !0 }), I(a, (e) => {
2193
- r.value = e ? JSON.parse(JSON.stringify(e)) : [];
2194
- }, { deep: !0 });
2195
- let l = A(!1), u = A(!1);
2196
- I(n, async (e) => {
2197
- t.value.productId == "new" || !e || Array.isArray(e) && e.length === 0 || l.value || (l.value = !0, i.value = JSON.parse(JSON.stringify(e)), await D(), e.length > 1 && s.value?.minifyAll());
2198
- }, {
2199
- deep: !0,
2200
- immediate: !0
2201
- }), I(r, async (e) => {
2202
- t.value.productId == "new" || !e || Array.isArray(e) && e.length === 0 || u.value || (u.value = !0, a.value = JSON.parse(JSON.stringify(e)), await D(), c.value?.setVariantMap(e));
2203
- }, {
2204
- deep: !0,
2205
- immediate: !0
2206
- });
2207
- let d = v(() => {
2208
- let e = i.value || [], t = {};
2209
- return !e || !Array.isArray(e) || e.forEach((e) => {
2210
- !e.name.trim() || e.values?.filter((e) => e.value.trim() !== "")?.length === 0 || (t[e.id] = {
2211
- id: e.id,
2212
- name: e.name,
2213
- values: e.values?.map((e) => ({
2214
- id: e.id,
2215
- value: e.value
2216
- }))?.filter((e) => e.value.trim() !== "") || []
2217
- });
2218
- }), t;
2219
- });
2220
- return (e, t) => {
2221
- let n = M("CardContent"), r = M("Card");
2222
- return k(), y(r, null, {
2223
- default: L(() => [w(n, null, {
2224
- default: L(() => [
2225
- t[2] ||= S("h3", { class: "text-lg font-semibold mb-4" }, "Variants", -1),
2226
- w(Wn, {
2227
- modelValue: i.value,
2228
- "onUpdate:modelValue": t[0] ||= (e) => i.value = e,
2229
- ref_key: "optionsEl",
2230
- ref: s
2231
- }, null, 8, ["modelValue"]),
2232
- w(jr, {
2233
- ref_key: "variantsEl",
2234
- ref: c,
2235
- options: d.value,
2236
- modelValue: a.value,
2237
- "onUpdate:modelValue": t[1] ||= (e) => a.value = e,
2238
- hide: Object.keys(d.value).length === 0
2239
- }, null, 8, [
2240
- "options",
2241
- "modelValue",
2242
- "hide"
2243
- ])
2244
- ]),
2245
- _: 1
2246
- })]),
2247
- _: 1
2248
- });
2249
- };
2250
- }
2251
- }), Nr = { class: "bg-white dark:bg-gray-50 border-4 dark:border-gray-600 p-4 rounded-lg mb-4" }, Pr = { class: "flex items-center gap-2 mb-2" }, Fr = ["src"], Ir = { class: "text-[#1a0dab] text-lg" }, Lr = { class: "text-[#006621] text-[13px]" }, Rr = { class: "text-[#545454] text-[13px]" }, zr = { class: "flex flex-col gap-4 mb-4" }, Br = { class: "flex flex-col" }, Vr = {
2252
- key: 0,
2253
- class: "text-red-500 text-sm mt-1"
2254
- }, Hr = { class: "flex flex-col gap-4 mb-4" }, Ur = { class: "flex flex-col" }, Wr = {
2255
- key: 0,
2256
- class: "text-red-500 text-sm mt-1"
2257
- }, Gr = { class: "flex flex-col gap-4" }, Kr = { class: "flex flex-col" }, qr = { class: "flex gap-2" }, Jr = {
2258
- key: 0,
2259
- class: "text-red-500 text-sm mt-1"
2260
- }, Yr = {
2261
- key: 1,
2262
- class: "text-[#545454] text-[13px]"
2263
- }, Xr = {
2264
- key: 2,
2265
- class: "text-orange-500 text-[13px]"
2266
- }, Zr = /* @__PURE__ */ T({
2267
- __name: "SEO",
2268
- setup(e) {
2269
- let { errors: n } = i(), { value: r } = o("title"), { value: a } = o("slug"), { value: s } = o("seo");
2270
- function c(e) {
2271
- return e ? e.normalize("NFD").replace(/[̀-ͯ]/g, "").toLowerCase().replace(/[^\w\s-]/g, "").trim().replace(/[-\s]+/g, "-") : "";
2272
- }
2273
- return I(r, (e, t) => {
2274
- (!a.value || c(t) === a.value) && (a.value = c(e)), (!s.value.title || t === s.value.title) && (s.value.title = e);
2275
- }), (e, r) => {
2276
- let i = M("Label"), o = M("Input"), c = M("Textarea"), l = M("ProgressCircle"), u = M("CardContent"), d = M("Card");
2277
- return k(), y(d, null, {
2278
- default: L(() => [w(u, null, {
2279
- default: L(() => [
2280
- r[7] ||= S("h3", { class: "text-lg font-semibold mb-4" }, "Search engine listing", -1),
2281
- S("div", Nr, [
2282
- S("div", Pr, [S("img", {
2283
- src: P(t),
2284
- alt: "Google",
2285
- class: "w-16 pointer-events-none",
2286
- draggable: "false"
2287
- }, null, 8, Fr), r[3] ||= S("span", { class: "text-[#4186f5] font-medium text-xs" }, "Preview", -1)]),
2288
- S("p", Ir, N(P(s).title), 1),
2289
- S("p", Lr, N(P(a)), 1),
2290
- S("p", Rr, N(P(s).description?.slice(0, 155)) + N(P(s).description?.length > 155 ? " ..." : ""), 1)
2291
- ]),
2292
- S("div", zr, [S("div", Br, [
2293
- w(i, {
2294
- for: "slug",
2295
- class: "text-sm mb-2"
2296
- }, {
2297
- default: L(() => [...r[4] ||= [C("Slug", -1)]]),
2298
- _: 1
2299
- }),
2300
- w(o, {
2301
- id: "slug",
2302
- placeholder: "t-shirt-with-red-heart",
2303
- modelValue: P(a),
2304
- "onUpdate:modelValue": r[0] ||= (e) => E(a) ? a.value = e : null
2305
- }, null, 8, ["modelValue"]),
2306
- P(n).slug ? (k(), x("p", Vr, N(P(n).slug), 1)) : b("", !0)
2307
- ])]),
2308
- S("div", Hr, [S("div", Ur, [
2309
- w(i, {
2310
- for: "meta-title",
2311
- class: "text-sm mb-2"
2312
- }, {
2313
- default: L(() => [...r[5] ||= [C("Title", -1)]]),
2314
- _: 1
2315
- }),
2316
- w(o, {
2317
- id: "meta-title",
2318
- placeholder: "T-shirt with red heart",
2319
- modelValue: P(s).title,
2320
- "onUpdate:modelValue": r[1] ||= (e) => P(s).title = e
2321
- }, null, 8, ["modelValue"]),
2322
- P(n).seo?.title ? (k(), x("p", Wr, N(P(n).seo.title), 1)) : b("", !0)
2323
- ])]),
2324
- S("div", Gr, [S("div", Kr, [
2325
- w(i, {
2326
- for: "meta-description",
2327
- class: "text-sm mb-2"
2328
- }, {
2329
- default: L(() => [...r[6] ||= [C("Description", -1)]]),
2330
- _: 1
2331
- }),
2332
- w(c, {
2333
- id: "meta-description",
2334
- placeholder: "Lovely T-shirt featuring a red heart",
2335
- modelValue: P(s).description,
2336
- "onUpdate:modelValue": r[2] ||= (e) => P(s).description = e,
2337
- class: "mb-2 resize-none"
2338
- }, null, 8, ["modelValue"]),
2339
- S("div", qr, [w(l, { progress: (P(s).description?.length ?? 0) / 155 }, null, 8, ["progress"]), P(n).seo?.description ? (k(), x("p", Jr, N(P(n).seo.description), 1)) : P(s).description?.length < 155 ? (k(), x("p", Yr, N(P(s).description.length) + " characters", 1)) : (k(), x("p", Xr, "Please keep it under 155 characters"))])
2340
- ])])
2341
- ]),
2342
- _: 1
2343
- })]),
2344
- _: 1
2345
- });
2346
- };
2347
- }
2348
- }), Qr = /* @__PURE__ */ T({
2349
- __name: "NewSection",
2350
- setup(e) {
2351
- return (e, t) => {
2352
- let n = M("Button"), r = M("CardContent"), i = M("Card");
2353
- return k(), x(_, null, [t[3] ||= S("hr", { class: "my-4" }, null, -1), w(i, null, {
2354
- default: L(() => [w(r, null, {
2355
- default: L(() => [
2356
- t[1] ||= S("h2", { class: "text-lg font-medium" }, "New Section", -1),
2357
- t[2] ||= S("p", { class: "text-sm text-muted-foreground mb-4" }, "As an admin, you can define new sections within the product detail page.", -1),
2358
- w(n, null, {
2359
- default: L(() => [w(P(fe), { class: "size-4" }), t[0] ||= C(" Create new section ", -1)]),
2360
- _: 1
2361
- })
2362
- ]),
2363
- _: 1
2364
- })]),
2365
- _: 1
2366
- })], 64);
2367
- };
2368
- }
2369
- }), $r = { class: "flex items-center gap-2" }, ei = {
2370
- key: 0,
2371
- class: "size-3 rounded-full bg-green-500"
2372
- }, ti = {
2373
- key: 1,
2374
- class: "size-3 rounded-full bg-blue-500"
2375
- }, ni = {
2376
- key: 2,
2377
- class: "size-3 rounded-full bg-gray-300"
2378
- }, ri = /* @__PURE__ */ T({
2379
- __name: "Status",
2380
- setup(e) {
2381
- let { errors: t } = i(), { value: n } = o("status");
2382
- return (e, t) => {
2383
- let r = M("SelectValue"), i = M("SelectTrigger"), a = M("SelectItem"), o = M("SelectGroup"), s = M("SelectContent"), c = M("Select"), l = M("CardContent"), u = M("Card");
2384
- return k(), y(u, null, {
2385
- default: L(() => [w(l, null, {
2386
- default: L(() => [t[4] ||= S("h3", { class: "text-lg font-semibold mb-4" }, "Status", -1), w(c, {
2387
- modelValue: P(n),
2388
- "onUpdate:modelValue": t[0] ||= (e) => E(n) ? n.value = e : null,
2389
- class: "w-full"
2390
- }, {
2391
- default: L(() => [w(i, { class: "w-full" }, {
2392
- default: L(() => [S("div", $r, [P(n) === "published" ? (k(), x("span", ei)) : P(n) === "draft" ? (k(), x("span", ti)) : P(n) === "archived" ? (k(), x("span", ni)) : b("", !0), w(r, { placeholder: "Status" })])]),
2393
- _: 1
2394
- }), w(s, null, {
2395
- default: L(() => [w(o, null, {
2396
- default: L(() => [
2397
- w(a, { value: "published" }, {
2398
- default: L(() => [...t[1] ||= [S("span", { class: "size-3 rounded-full bg-green-500" }, null, -1), C(" Published ", -1)]]),
2399
- _: 1
2400
- }),
2401
- w(a, { value: "draft" }, {
2402
- default: L(() => [...t[2] ||= [S("span", { class: "size-3 rounded-full bg-blue-500" }, null, -1), C(" Draft ", -1)]]),
2403
- _: 1
2404
- }),
2405
- w(a, { value: "archived" }, {
2406
- default: L(() => [...t[3] ||= [S("span", { class: "size-3 rounded-full bg-gray-300" }, null, -1), C(" Archived ", -1)]]),
2407
- _: 1
2408
- })
2409
- ]),
2410
- _: 1
2411
- })]),
2412
- _: 1
2413
- })]),
2414
- _: 1
2415
- }, 8, ["modelValue"])]),
2416
- _: 1
2417
- })]),
2418
- _: 1
2419
- });
2420
- };
2421
- }
2422
- }), ii = { class: "flex items-center gap-2 truncate" }, ai = /* @__PURE__ */ T({
2423
- __name: "Collections",
2424
- props: { config: {
2425
- type: Object,
2426
- required: !0
2427
- } },
2428
- setup(e) {
2429
- let t = e, n = m(t.config.project), r = async () => {
2430
- if (!t.config.collectionsCollection) return [];
2431
- let e = t.config.collectionsCollection.split(":");
2432
- return e.length === 2 && (await n.get(e[0]))?.[e[1]] || [];
2433
- }, a = A([]);
2434
- (async () => {
2435
- a.value = await r();
2436
- })();
2437
- let { errors: s } = i(), { value: c } = o("collections");
2438
- return (e, t) => {
2439
- let n = M("SelectValue"), r = M("SelectTrigger"), i = M("SelectLabel"), o = M("SelectItem"), s = M("SelectGroup"), l = M("SelectContent"), u = M("Select"), d = M("CardContent"), f = M("Card");
2440
- return k(), y(f, null, {
2441
- default: L(() => [w(d, null, {
2442
- default: L(() => [t[5] ||= S("h3", { class: "text-lg font-semibold mb-4" }, "Collections", -1), w(u, {
2443
- modelValue: P(c),
2444
- "onUpdate:modelValue": t[0] ||= (e) => E(c) ? c.value = e : null,
2445
- class: "w-full",
2446
- multiple: !0
2447
- }, {
2448
- default: L(() => [w(r, { class: "w-full" }, {
2449
- default: L(() => [S("div", ii, [w(n, { placeholder: "Collections" })])]),
2450
- _: 1
2451
- }), w(l, null, {
2452
- default: L(() => [w(s, null, {
2453
- default: L(() => [w(i, null, {
2454
- default: L(() => [...t[1] ||= [C("Active collections", -1)]]),
2455
- _: 1
2456
- }), (k(!0), x(_, null, j(a.value.filter((e) => e.status === "published"), (e) => (k(), y(o, {
2457
- key: e.id,
2458
- value: e.id
2459
- }, {
2460
- default: L(() => [t[2] ||= S("div", { class: "size-2 rounded-full bg-green-500" }, null, -1), C(" " + N(e.title), 1)]),
2461
- _: 2
2462
- }, 1032, ["value"]))), 128))]),
2463
- _: 1
2464
- }), w(s, null, {
2465
- default: L(() => [w(i, null, {
2466
- default: L(() => [...t[3] ||= [C("Drafts", -1)]]),
2467
- _: 1
2468
- }), (k(!0), x(_, null, j(a.value.filter((e) => e.status === "draft"), (e) => (k(), y(o, {
2469
- key: e.id,
2470
- value: e.id
2471
- }, {
2472
- default: L(() => [t[4] ||= S("div", { class: "size-2 rounded-full bg-blue-500" }, null, -1), C(" " + N(e.title), 1)]),
2473
- _: 2
2474
- }, 1032, ["value"]))), 128))]),
2475
- _: 1
2476
- })]),
2477
- _: 1
2478
- })]),
2479
- _: 1
2480
- }, 8, ["modelValue"])]),
2481
- _: 1
2482
- })]),
2483
- _: 1
2484
- });
2485
- };
2486
- }
2487
- }), oi = { class: "relative @container" }, si = { class: "flex flex-row gap-4 justify-between max-w-5xl mx-auto mt-4 mb-6" }, ci = { class: "flex items-center" }, li = { class: "text-lg font-semibold mx-2" }, ui = {
2488
- key: 0,
2489
- class: "bg-green-500 text-green-950 px-2 py-1 rounded-lg text-xs"
2490
- }, di = {
2491
- key: 1,
2492
- class: "bg-blue-500 text-blue-950 px-2 py-1 rounded-lg text-xs"
2493
- }, fi = {
2494
- key: 2,
2495
- class: "bg-gray-300 dark:bg-gray-500 text-gray-950 px-2 py-1 rounded-lg text-xs"
2496
- }, pi = { class: "flex flex-col @3xl:flex-row gap-4 max-w-5xl mx-auto pb-24" }, mi = { class: "flex flex-col gap-4 w-full @3xl:w-2/3" }, hi = { class: "flex flex-col gap-4 w-full @3xl:w-1/3" }, gi = {
2497
- key: 0,
2498
- class: "fixed bottom-4 left-0 md:left-12 right-0 min-w-xs max-w-5xl w-[calc(100%-2rem)] md:w-[calc(100%-5rem)] xl:w-[calc(100%-2rem)] h-16 border border-white/10 backdrop-blur-sm border-t border-border flex items-center justify-center px-4 mx-auto z-[9999] rounded-xl overflow-hidden shadow bg-[radial-gradient(#ffffff80,transparent)] dark:bg-[radial-gradient(#00000080,transparent)]"
2499
- }, _i = { class: "w-full max-w-5xl flex items-center justify-end mx-auto" }, vi = /* @__PURE__ */ T({
2500
- __name: "Detail",
2501
- props: { config: {
2502
- type: Object,
2503
- required: !0
2504
- } },
2505
- async setup(t) {
2506
- let i, o, _ = t, { hasPermission: T, hasAnyPermission: te, isAdmin: E } = g(), { params: D, navigateTo: O } = ee(), { confirm: j } = p(), F = m(_.config.project);
2507
- re("sources", _.config.allowedMediaSources), re("defaultSource", _.config.defaultUploadMediaSource);
2508
- let I = A(!1), R = v(() => !D.value.productId || D.value.productId === "new"), z = A(""), oe = A([]);
2509
- oe.value = ([i, o] = ie(() => Se()), i = await i, o(), i);
2510
- let { handleSubmit: ce, errors: le, values: B, setValues: V } = f({
2511
- validationSchema: d(c({
2512
- title: r().min(1, "Title is required"),
2513
- description: r().optional(),
2514
- media: s(r()).optional(),
2515
- price: a.number().positive("Must be positive"),
2516
- compareAtPrice: u((e) => e === "" ? void 0 : e, a.number().positive("Must be positive").optional()),
2517
- isTaxable: l().optional(),
2518
- costPerItem: u((e) => e === "" ? void 0 : e, a.number().positive("Must be positive").optional()),
2519
- currency: r(),
2520
- stock: u((e) => e === "" ? void 0 : e, a.number().optional()),
2521
- trackInventory: l().optional(),
2522
- allowBackorder: l().optional(),
2523
- isPhysicalProduct: l().optional(),
2524
- weight: u((e) => e === "" ? void 0 : e, a.number().optional()),
2525
- weightUnit: r().optional(),
2526
- slug: r(),
2527
- seo: c({
2528
- title: r().optional(),
2529
- description: r().optional()
2530
- }).optional(),
2531
- createdAt: n(),
2532
- updatedAt: n(),
2533
- status: r(),
2534
- options: s(c({
2535
- id: r(),
2536
- name: r().min(1),
2537
- values: s(c({
2538
- id: r(),
2539
- value: r()
2540
- }))
2541
- })).optional(),
2542
- variants: s(c({
2543
- combinedOptions: r().min(1),
2544
- name: r().min(1),
2545
- disabled: l().optional(),
2546
- price: a.number().positive("Must be positive"),
2547
- stock: u((e) => e === "" ? void 0 : e, a.number().optional()),
2548
- image: r().optional(),
2549
- options: s(c({
2550
- optionId: r(),
2551
- option: r(),
2552
- valueId: r(),
2553
- value: r()
2554
- }))
2555
- })).optional(),
2556
- tags: s(r()).optional(),
2557
- collections: s(r()).optional()
2558
- })),
2559
- initialValues: {
2560
- createdAt: /* @__PURE__ */ new Date(),
2561
- updatedAt: /* @__PURE__ */ new Date(),
2562
- status: "draft",
2563
- options: [],
2564
- variants: [],
2565
- media: [],
2566
- isTaxable: !1,
2567
- trackInventory: !1,
2568
- allowBackorder: !1,
2569
- isPhysicalProduct: !0,
2570
- weight: 0,
2571
- weightUnit: "kg",
2572
- tags: [],
2573
- collections: [],
2574
- currency: _.config.defaultCurrency || "USD",
2575
- price: 1,
2576
- stock: 0,
2577
- seo: {
2578
- title: "",
2579
- description: ""
2580
- }
2581
- }
2582
- });
2583
- h(() => [{ text: R.value ? "New Product" : B.title || "Product" }]);
2584
- let ue = (e) => {
2585
- let t = {
2586
- ...e,
2587
- maxPrice: fe(),
2588
- minPrice: H(),
2589
- maxCompareAtPrice: he(),
2590
- minCompareAtPrice: pe(),
2591
- isSingleVariant: !e.variants || e.variants.length === 0,
2592
- variantsTotal: e.variants?.length || 1,
2593
- stock: ge(),
2594
- featuredMedia: e.media?.[0]
2595
- };
2596
- return t.isPhysicalProduct ? t.type = "physical" : (t.weight = 0, t.weightUnit = "kg", t.type = "digital"), t;
2597
- }, fe = () => !B.variants || B.variants.length === 0 ? B.price : Math.max(...B.variants.map((e) => e.price)), H = () => !B.variants || B.variants.length === 0 ? B.price : Math.min(...B.variants.map((e) => e.price)), pe = () => B.compareAtPrice, he = () => B.compareAtPrice, ge = () => !B.variants || B.variants.length === 0 ? B.stock : B.variants.reduce((e, t) => t.stock < 0 ? e : e + t.stock, 0), _e = ce(async (t) => {
2598
- I.value = !0;
2599
- let n = ue(t);
2600
- if (R.value) {
2601
- if (await Ce(n.slug)) {
2602
- e.error("Product slug already exists");
2603
- return;
2604
- }
2605
- n.createdAt = /* @__PURE__ */ new Date(), n.updatedAt = /* @__PURE__ */ new Date(), O((await F.add(_.config.productCollection, n)).id), e.success("Product created");
2606
- } else {
2607
- if (z.value !== n.slug && await Ce(n.slug)) {
2608
- e.error("Product slug already exists");
2609
- return;
2610
- }
2611
- n.updatedAt = /* @__PURE__ */ new Date(), await F.update(_.config.productCollection, D.value.productId, n), O(`${D.value.productId}`), e.success("Product updated");
2612
- }
2613
- I.value = !1;
2614
- }), ve = async () => {
2615
- let t = await F.get(_.config.productCollection, D.value.productId);
2616
- if (!t) {
2617
- e.error("Product not found"), O("");
2618
- return;
2619
- }
2620
- t.createdAt = new Date(t.createdAt), t.updatedAt = new Date(t.updatedAt), t.options?.forEach((e) => {
2621
- e.values.forEach((e) => {
2622
- e.touched = !0;
2623
- }), e.values.push({
2624
- id: Math.random().toString(36).substring(2, 15),
2625
- value: ""
2626
- });
2627
- }), V(t), z.value = t.slug;
2628
- }, ye = async () => {
2629
- try {
2630
- let t = { ...B }, n = t.slug + "-copy", r = 2;
2631
- for (; await Ce(n);) n = t.slug + "-copy-" + r, r++;
2632
- t.id = void 0, t.createdAt = /* @__PURE__ */ new Date(), t.updatedAt = /* @__PURE__ */ new Date(), t.slug = n, t.status = "draft", t.title += " (copy)", O((await F.add(_.config.productCollection, t)).id), e.success("Product duplicated");
2633
- } catch {
2634
- e.error("Failed to duplicate product");
2635
- }
2636
- }, be = async () => {
2637
- try {
2638
- await F.update(_.config.productCollection, D.value.productId, { status: "archived" }), V({ status: "archived" }, { force: !1 }), e.success("Product archived");
2639
- } catch {
2640
- e.error("Failed to archive product");
2641
- }
2642
- }, xe = async () => {
2643
- if (await j("Are you sure you want to delete this product?")) try {
2644
- await F.remove(_.config.productCollection, D.value.productId), O(""), e.success("Product deleted");
2645
- } catch {
2646
- e.error("Failed to delete product");
2647
- }
2648
- };
2649
- async function Se() {
2650
- if (!_.config.collectionsCollection) return [];
2651
- let e = _.config.collectionsCollection.split(":");
2652
- return e.length === 2 && (await F.get(e[0]))?.[e[1]] || [];
2653
- }
2654
- async function Ce(e) {
2655
- return (await F.find(_.config.productCollection, { filters: [{
2656
- field: "slug",
2657
- operator: "==",
2658
- value: e
2659
- }] })).length > 0;
2660
- }
2661
- return ne(() => {
2662
- R.value || ve();
2663
- }), (e, n) => {
2664
- let r = M("Button"), i = M("MenubarTrigger"), a = M("MenubarMenu"), o = M("MenubarItem"), s = M("MenubarContent"), c = M("Menubar");
2665
- return k(), x("div", oi, [
2666
- S("div", si, [S("div", ci, [
2667
- w(r, {
2668
- variant: "ghost",
2669
- onClick: n[0] ||= (e) => P(O)("")
2670
- }, {
2671
- default: L(() => [w(P(U), { class: "size-4" })]),
2672
- _: 1
2673
- }),
2674
- w(P(se), { class: "size-3" }),
2675
- S("h1", li, N(R.value ? "New Product" : P(B).title), 1),
2676
- P(B).status === "published" ? (k(), x("span", ui, "Published")) : P(B).status === "draft" ? (k(), x("span", di, "Draft")) : P(B).status === "archived" ? (k(), x("span", fi, "Archived")) : b("", !0)
2677
- ]), R.value ? b("", !0) : (k(), y(c, {
2678
- key: 0,
2679
- class: "rounded-lg shadow-xs"
2680
- }, {
2681
- default: L(() => [
2682
- P(T)("create-product") ? (k(), y(a, { key: 0 }, {
2683
- default: L(() => [w(i, { onClick: ye }, {
2684
- default: L(() => [...n[1] ||= [C("Duplicate", -1)]]),
2685
- _: 1
2686
- })]),
2687
- _: 1
2688
- })) : b("", !0),
2689
- w(a, null, {
2690
- default: L(() => [w(i, null, {
2691
- default: L(() => [...n[2] ||= [C("Preview", -1)]]),
2692
- _: 1
2693
- })]),
2694
- _: 1
2695
- }),
2696
- P(te)("edit-product", "delete-product") ? (k(), y(a, { key: 1 }, {
2697
- default: L(() => [w(i, null, {
2698
- default: L(() => [...n[3] ||= [C("More actions", -1)]]),
2699
- _: 1
2700
- }), w(s, null, {
2701
- default: L(() => [P(T)("edit-product") ? (k(), y(o, {
2702
- key: 0,
2703
- onClick: be
2704
- }, {
2705
- default: L(() => [w(P(ae), { class: "size-4" }), n[4] ||= C(" Archive product ", -1)]),
2706
- _: 1
2707
- })) : b("", !0), P(T)("delete-product") ? (k(), y(o, {
2708
- key: 1,
2709
- variant: "destructive",
2710
- onClick: xe
2711
- }, {
2712
- default: L(() => [w(P(me), { class: "size-4" }), n[5] ||= C(" Delete product ", -1)]),
2713
- _: 1
2714
- })) : b("", !0)]),
2715
- _: 1
2716
- })]),
2717
- _: 1
2718
- })) : b("", !0)
2719
- ]),
2720
- _: 1
2721
- }))]),
2722
- S("div", pi, [S("div", mi, [
2723
- w(De),
2724
- w(Re),
2725
- w(Ue),
2726
- w(Ke),
2727
- w(Mr),
2728
- w(Zr),
2729
- P(E)() ? (k(), y(Qr, { key: 0 })) : b("", !0)
2730
- ]), S("div", hi, [w(ri), w(ai, { config: t.config }, null, 8, ["config"])])]),
2731
- P(te)("create-product", "edit-product") ? (k(), x("div", gi, [S("div", _i, [R.value && P(T)("create-product") ? (k(), y(r, {
2732
- key: 0,
2733
- onClick: P(_e),
2734
- disabled: I.value
2735
- }, {
2736
- default: L(() => [I.value ? (k(), y(P(de), {
2737
- key: 0,
2738
- class: "size-4 animate-spin"
2739
- })) : b("", !0), C(" " + N(I.value ? "Creating" : "Create") + " New Product ", 1)]),
2740
- _: 1
2741
- }, 8, ["onClick", "disabled"])) : P(T)("edit-product") ? (k(), y(r, {
2742
- key: 1,
2743
- onClick: P(_e),
2744
- disabled: I.value
2745
- }, {
2746
- default: L(() => [I.value ? (k(), y(P(de), {
2747
- key: 0,
2748
- class: "size-4 animate-spin"
2749
- })) : b("", !0), C(" " + N(I.value ? "Saving" : "Save") + " Changes ", 1)]),
2750
- _: 1
2751
- }, 8, ["onClick", "disabled"])) : b("", !0)])])) : b("", !0)
2752
- ]);
2753
- };
2754
- }
2755
- });
2756
- //#endregion
2757
- export { vi as default };