@oneclick.dev/cms-core-modules 0.0.105 → 0.0.107

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