@oneclick.dev/cms-core-modules 0.0.58 → 0.0.60

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 (147) hide show
  1. package/dist/{Components-D9yIIosM.mjs → Components-C83O-xlF.mjs} +1 -1
  2. package/dist/{ContentEditor-DCmt_y_R.js → ContentEditor-BAepN3Yd.js} +51 -34
  3. package/dist/{ContentEditor-CtGeIzC4.mjs → ContentEditor-BPjWW3d1.mjs} +12341 -10099
  4. package/dist/Create-Bh4g6QW4.js +1 -0
  5. package/dist/{Create-Bwf1RXdG.mjs → Create-Cf7pvh5G.mjs} +38 -39
  6. package/dist/DateFormatter-BPPBZp1j.js +1 -0
  7. package/dist/{CalendarDate-CRT2Viyt.mjs → DateFormatter-DsmlAuYV.mjs} +353 -256
  8. package/dist/{Detail-CpfOQChd.mjs → Detail-B4b_FLDa.mjs} +2 -2
  9. package/dist/{Detail-B-PnkcXD.mjs → Detail-BGD75ul4.mjs} +2 -2
  10. package/dist/{Detail-Dd_OkpcN.js → Detail-BayNaAg9.js} +1 -1
  11. package/dist/{Detail-C4E1T87K.mjs → Detail-Byk781b4.mjs} +3 -3
  12. package/dist/{Detail-Cd5CBVN0.js → Detail-CnK-qbhE.js} +1 -1
  13. package/dist/Detail-CtbWzq-R.js +1 -0
  14. package/dist/{Detail-CNfTDUE5.js → Detail-Cxd2VMOl.js} +1 -1
  15. package/dist/{Detail-BVlGSjOq.mjs → Detail-D10shmpK.mjs} +6 -7
  16. package/dist/{Detail-CwagT6gQ.mjs → Detail-U0mgLKt6.mjs} +2 -2
  17. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-CcysXzmW.mjs +75 -0
  18. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-Czu6Dcde.js +1 -0
  19. package/dist/{Entries-zyhycw1M.mjs → Entries-C6Di46My.mjs} +1 -1
  20. package/dist/{Find-BPR0uU-Z.mjs → Find-B4sAEx0B.mjs} +2 -2
  21. package/dist/{Find-BidEQJxT.js → Find-Ds6OvuH6.js} +1 -1
  22. package/dist/{GlobalStyling-BLQ_1W2y.mjs → GlobalStyling-C9VthHWK.mjs} +1 -1
  23. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-BJitmbPE.mjs +396 -0
  24. package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-D50uTpZY.js +1 -0
  25. package/dist/Overview-B-8TLLjh.js +1 -0
  26. package/dist/{Overview-CDN88OSM.mjs → Overview-BCpJNiEB.mjs} +1 -1
  27. package/dist/Overview-B_99j5eA.js +1 -0
  28. package/dist/{Overview-BLsZMHNW.mjs → Overview-CIa1E-HH.mjs} +1 -1
  29. package/dist/{Overview-D1nJLBe1.mjs → Overview-CgViRnNc.mjs} +1 -1
  30. package/dist/Overview-DtWvKB3W.mjs +327 -0
  31. package/dist/Overview-HvlDEgqi.mjs +862 -0
  32. package/dist/{Overview-BH3NwvNX.mjs → Overview-Su8ZUbMs.mjs} +3 -3
  33. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CI8YgHdU.js +345 -0
  34. package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-P-MWwcVh.mjs +2093 -0
  35. package/dist/{TableView-CS13LLxk.mjs → TableView-B8iLWWcP.mjs} +48394 -36321
  36. package/dist/TableView-BxK6R8v3.js +312 -0
  37. package/dist/{TemplateList.vue_vue_type_script_setup_true_lang-BiLAkhIA.mjs → TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs} +5 -5
  38. package/dist/{View-C7axVP9t.mjs → View-DDXN0tKD.mjs} +7 -7
  39. package/dist/View-DfzaVOzS.js +1 -0
  40. package/dist/agenda-D81m29_4.mjs +1135 -0
  41. package/dist/agenda-uzPPxgsW.js +1 -0
  42. package/dist/availability-B-tRp8hB.mjs +629 -0
  43. package/dist/availability-BiBbzEIM.js +1 -0
  44. package/dist/{exceptions-D3b18TiY.mjs → exceptions-BFchkR06.mjs} +70 -71
  45. package/dist/exceptions-C-DPRNQa.js +1 -0
  46. package/dist/index-4tjmIans.js +1 -0
  47. package/dist/index-AmUV8LZQ.mjs +176 -0
  48. package/dist/index-BDaVYdkD.mjs +7763 -0
  49. package/dist/{index-DT1wWnUk.mjs → index-BWDwEd8D.mjs} +1 -1
  50. package/dist/{index-CImCyE3L.mjs → index-BfBBm9uY.mjs} +1 -1
  51. package/dist/{index-DMoyoaks.mjs → index-Bkq58CeQ.mjs} +2 -2
  52. package/dist/{index-DI6mydpm.mjs → index-CABh6Qn6.mjs} +2 -2
  53. package/dist/{index-CQiY-oTN.mjs → index-CQkOH2_3.mjs} +1 -1
  54. package/dist/{index-Bwi1mtkq.mjs → index-CU-tbS5W.mjs} +1 -1
  55. package/dist/{index-BzuHN-r8.mjs → index-Cpnn_Pxd.mjs} +1 -1
  56. package/dist/index-CxETuRsG.js +1 -0
  57. package/dist/{index-DyCHxFp3.mjs → index-DRqJOqUR.mjs} +502 -449
  58. package/dist/index-DTago6vW-Bhr8E1Y6.js +88 -0
  59. package/dist/index-DTago6vW-CnomHQ_S.mjs +4123 -0
  60. package/dist/index-DfV8-6ON.js +245 -0
  61. package/dist/index-Dnn2SCSl.js +1 -0
  62. package/dist/{index-BEGU8Kme.mjs → index-Dpl9sU6a.mjs} +2 -2
  63. package/dist/index-Uf7TwBuW.mjs +110 -0
  64. package/dist/index-YMaY4uuk-BgpTtr73.js +1 -0
  65. package/dist/{index-CKPshlZ8-BQiiP6r_.mjs → index-YMaY4uuk-C_xV5K9Z.mjs} +399 -363
  66. package/dist/{index--jjEzba7.mjs → index-cOnxXTbF.mjs} +1 -1
  67. package/dist/index-hlylYYgy.mjs +24 -0
  68. package/dist/index.cjs.js +1 -1
  69. package/dist/index.mjs +98 -81
  70. package/dist/orders-Bh8w0ueq.mjs +346 -0
  71. package/dist/orders-Dt0zMz97.js +1 -0
  72. package/dist/payment-BQaAqQ5q.js +1 -0
  73. package/dist/payment-BbWByERf.mjs +1080 -0
  74. package/dist/regular-1LXNPviB.js +1 -0
  75. package/dist/regular-_05oq5Tx.mjs +1101 -0
  76. package/dist/regular-slots-Bs3WJB3U.js +1 -0
  77. package/dist/regular-slots-C2NYxLPn.mjs +222 -0
  78. package/dist/resources-DgPnEv76.mjs +811 -0
  79. package/dist/resources-eb0pivDL.js +1 -0
  80. package/dist/src/appointments/components/edit/EditLayout.vue.d.ts +2 -2
  81. package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +92 -0
  82. package/dist/src/appointments/components/edit/EventDialog/CancelReservationDialog.vue.d.ts +8 -0
  83. package/dist/src/appointments/components/edit/EventDialog/EventDialog.vue.d.ts +10 -0
  84. package/dist/src/appointments/components/edit/{EventDialog.vue.d.ts → EventDialog/ResendConfirmationDialog.vue.d.ts} +1 -1
  85. package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +51 -0
  86. package/dist/src/appointments/components/edit/EventDialog/TimelineChart.vue.d.ts +24 -0
  87. package/dist/src/appointments/components/edit/EventDialog/TransferReservationDialog.vue.d.ts +4 -0
  88. package/dist/src/appointments/components/edit/EventTimeline.vue.d.ts +15 -7
  89. package/dist/src/appointments/components/edit/NewReservationDialog/NewReservationDialog.vue.d.ts +2 -0
  90. package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +68 -0
  91. package/dist/src/appointments/components/edit/dashboard/Timeline.vue.d.ts +15 -0
  92. package/dist/src/appointments/components/edit/dashboard/timeline/ResourceSelector.vue.d.ts +50 -0
  93. package/dist/src/appointments/config.d.ts +30 -0
  94. package/dist/src/appointments/index.d.ts +32 -5
  95. package/dist/src/appointments/pages/edit/agenda.vue.d.ts +1 -1
  96. package/dist/src/appointments/pages/edit/availability.vue.d.ts +1 -1
  97. package/dist/src/appointments/pages/edit/index.vue.d.ts +1 -1
  98. package/dist/src/appointments/pages/edit/orders.vue.d.ts +64 -0
  99. package/dist/src/appointments/pages/edit/payment.vue.d.ts +1 -1
  100. package/dist/src/appointments/pages/edit/regular-slots.vue.d.ts +1 -1
  101. package/dist/src/appointments/pages/edit/resources.vue.d.ts +1 -1
  102. package/dist/src/appointments/routes.d.ts +2 -5
  103. package/dist/src/appointments/types.d.ts +16 -0
  104. package/dist/src/appointments/utils/printReservation.d.ts +45 -0
  105. package/dist/src/content-manager/components/content-editor/ContentStructuredContentSections.vue.d.ts +4 -0
  106. package/dist/src/content-manager/components/content-editor/PageSettings.vue.d.ts +2 -0
  107. package/dist/src/content-manager/components/content-editor/SidebarSectionWrapper.vue.d.ts +11 -1
  108. package/dist/src/content-manager/types.d.ts +5 -0
  109. package/dist/{vee-validate-zod-BPQyEfpF.js → vee-validate-zod-ByykgYKJ.js} +1 -1
  110. package/dist/{vee-validate-zod-IXkfh-6Q.mjs → vee-validate-zod-CcOwoF6y.mjs} +4 -4
  111. package/package.json +4 -2
  112. package/dist/CalendarDate-CWtpXgpD.js +0 -1
  113. package/dist/Create-BP8TX6rj.js +0 -1
  114. package/dist/DateFormatter-BbcSwTs4.js +0 -1
  115. package/dist/DateFormatter-CbO0PVUK.mjs +0 -99
  116. package/dist/Detail-DUo6qKqO.js +0 -1
  117. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-BWuKVkvV.js +0 -1
  118. package/dist/EditLayout.vue_vue_type_script_setup_true_lang-D0-EcU0_.mjs +0 -55
  119. package/dist/Overview-BNMZ9MUK.js +0 -1
  120. package/dist/Overview-CEPodGCn.mjs +0 -311
  121. package/dist/Overview-CvquDPhB.js +0 -1
  122. package/dist/Overview-D67UjG6n.mjs +0 -947
  123. package/dist/RegularSlotEditor.vue_vue_type_script_setup_true_lang-0xZSq0rx.js +0 -1
  124. package/dist/RegularSlotEditor.vue_vue_type_script_setup_true_lang-Bj_PVLLV.mjs +0 -392
  125. package/dist/TableView-Dv4YXBD1.js +0 -111
  126. package/dist/View-7qb_ohVo.js +0 -1
  127. package/dist/agenda-B49oKGeh.mjs +0 -706
  128. package/dist/agenda-DipQ5IWP.js +0 -1
  129. package/dist/availability-C7q9tq6l.js +0 -1
  130. package/dist/availability-DeCkqiu8.mjs +0 -613
  131. package/dist/exceptions-DJ9zWX3k.js +0 -1
  132. package/dist/index-CKPshlZ8-CIz1tDwX.js +0 -1
  133. package/dist/index-DUeFrD-B.js +0 -1
  134. package/dist/index-DsnoK4ia.mjs +0 -579
  135. package/dist/index-WL1P6d3j.js +0 -1
  136. package/dist/index-_mG-aU3Z.mjs +0 -87
  137. package/dist/index-_sQDF1pH.js +0 -1
  138. package/dist/index-klI238nT.mjs +0 -24
  139. package/dist/payment-kTjsV0Jj.js +0 -1
  140. package/dist/payment-zpCM0LD-.mjs +0 -981
  141. package/dist/regular-C4_3YXqx.mjs +0 -602
  142. package/dist/regular-DFwPEbZO.js +0 -1
  143. package/dist/regular-slots-4ooEpICB.mjs +0 -67
  144. package/dist/regular-slots-BAVGbomI.js +0 -1
  145. package/dist/resources-MpQkSstv.mjs +0 -563
  146. package/dist/resources-iM28T3dD.js +0 -1
  147. package/dist/src/appointments/components/edit/RegularSlotEditor.vue.d.ts +0 -16
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),B=require("lucide-vue-next"),_=require("@oneclick.dev/cms-kit"),X=require("./index-CxETuRsG.js"),j=require("./utils-D6CaKJbp.js"),y=require("./index-ijdf0d9-.js"),J={class:"grid @md:grid-cols-2 @2xl:grid-cols-3 @3xl:grid-cols-4 @4xl:grid-cols-5 @5xl:grid-cols-6 gap-6"},Y=["onClick","onContextmenu"],Z=["src"],ee={class:"font-semibold"},te={class:"text-sm text-muted-foreground flex items-center gap-2"},oe={class:"flex items-center gap-2"},ne={key:0},le=e.defineComponent({__name:"GridView",props:{products:{type:Array,required:!0}},setup(T){const o=e.inject("selection"),{navigateTo:f}=_.useModuleRoute(),{hasPermission:g}=_.useModulePermissions(),v=(i,l)=>{const u=l.ctrlKey||l.metaKey;if(l.shiftKey)console.log("range");else if(u||o.value.length>0){const x=o.value.indexOf(i.id);x>-1?o.value.splice(x,1):o.value.push(i.id)}else o.value=[],f(i.id)},n=i=>{i.target.closest(".GRID_ITEM")||(o.value=[])},d=(i,l)=>{l.ctrlKey||l.metaKey?o.value.includes(i.id)?o.value.splice(o.value.indexOf(i.id),1):o.value.push(i.id):o.value.includes(i.id)||(o.value=[i.id])};return(i,l)=>(e.openBlock(),e.createElementBlock("div",{class:"@container mb-4 flex-1 select-none",onClick:l[0]||(l[0]=u=>o.value=[]),onContextmenu:n},[e.createElementVNode("div",J,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.products,u=>(e.openBlock(),e.createElementBlock("div",{key:u.id,onClick:e.withModifiers(k=>v(u,k),["stop"]),onContextmenu:k=>d(u,k),class:"GRID_ITEM cursor-pointer"},[e.createElementVNode("div",{class:e.normalizeClass(["aspect-square bg-muted rounded-xl overflow-hidden mb-2 transition-all duration-200",{"outline outline-4 outline-primary/50":e.unref(o).includes(u.id)}])},[u.featuredMedia?(e.openBlock(),e.createElementBlock("img",{key:0,src:u.featuredMedia,class:"w-full h-full object-cover pointer-events-none",draggable:"false"},null,8,Z)):e.createCommentVNode("",!0)],2),e.createElementVNode("div",null,[e.createElementVNode("p",ee,e.toDisplayString(u.title),1),e.createElementVNode("p",te,[e.createElementVNode("span",oe,[u.status==="published"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[l[1]||(l[1]=e.createElementVNode("span",{class:"block shrink-0 size-3 rounded-full bg-green-500"},null,-1)),l[2]||(l[2]=e.createTextVNode(" Published ",-1))],64)):u.status==="draft"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[l[3]||(l[3]=e.createElementVNode("span",{class:"block shrink-0 size-3 rounded-full bg-blue-500"},null,-1)),l[4]||(l[4]=e.createTextVNode(" Draft ",-1))],64)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:2},[l[5]||(l[5]=e.createElementVNode("span",{class:"block shrink-0 size-3 rounded-full bg-gray-300"},null,-1)),l[6]||(l[6]=e.createTextVNode(" Archived ",-1))],64))]),u.variantsTotal>1?(e.openBlock(),e.createElementBlock("span",ne,"| "+e.toDisplayString(u.variantsTotal)+" variants",1)):e.createCommentVNode("",!0)])])],40,Y))),128))])],32))}}),re={class:"flex items-center gap-2"},se={key:0,class:"bg-green-500 text-green-950 px-2 py-1 rounded-lg text-xs"},ae={key:1,class:"bg-blue-500 text-blue-950 px-2 py-1 rounded-lg text-xs"},ie={key:2,class:"bg-gray-500 text-gray-950 px-2 py-1 rounded-lg text-xs"},ce=e.defineComponent({__name:"ListView",props:{products:{type:Array,required:!0}},setup(T){const o=e.inject("selection"),{navigateTo:f}=_.useModuleRoute(),{hasPermission:g}=_.useModulePermissions(),v=(n,d)=>{n?o.value.push(d):o.value=o.value.filter(i=>i!==d)};return(n,d)=>{const i=e.resolveComponent("TableHead"),l=e.resolveComponent("TableRow"),u=e.resolveComponent("TableHeader"),k=e.resolveComponent("Checkbox"),x=e.resolveComponent("TableCell"),m=e.resolveComponent("AvatarImage"),t=e.resolveComponent("AvatarFallback"),p=e.resolveComponent("Avatar"),C=e.resolveComponent("TableBody"),V=e.resolveComponent("Table"),N=e.resolveComponent("Card");return e.openBlock(),e.createBlock(N,{class:"w-full py-4 px-4"},{default:e.withCtx(()=>[e.createVNode(V,{class:"rounded overflow-hidden"},{default:e.withCtx(()=>[e.createVNode(u,null,{default:e.withCtx(()=>[e.createVNode(l,null,{default:e.withCtx(()=>[e.unref(o)?.length>0?(e.openBlock(),e.createBlock(i,{key:0})):e.createCommentVNode("",!0),e.createVNode(i,null,{default:e.withCtx(()=>[...d[1]||(d[1]=[e.createTextVNode("Title",-1)])]),_:1}),e.createVNode(i,null,{default:e.withCtx(()=>[...d[2]||(d[2]=[e.createTextVNode("Status",-1)])]),_:1}),e.createVNode(i,null,{default:e.withCtx(()=>[...d[3]||(d[3]=[e.createTextVNode(" Variants",-1)])]),_:1}),e.createVNode(i,null,{default:e.withCtx(()=>[...d[4]||(d[4]=[e.createTextVNode("Price",-1)])]),_:1})]),_:1})]),_:1}),e.createVNode(C,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(T.products,c=>(e.openBlock(),e.createBlock(l,{key:c.id,onClick:w=>e.unref(f)(c.id),class:"cursor-pointer"},{default:e.withCtx(()=>[e.unref(o)?.length>0?(e.openBlock(),e.createBlock(x,{key:0},{default:e.withCtx(()=>[e.createVNode(k,{"model-value":e.unref(o)?.includes(c.id),"onUpdate:modelValue":w=>v(w,c.id),onClick:d[0]||(d[0]=e.withModifiers(()=>{},["prevent","stop"]))},null,8,["model-value","onUpdate:modelValue"])]),_:2},1024)):e.createCommentVNode("",!0),e.createVNode(x,{class:"font-medium"},{default:e.withCtx(()=>[e.createElementVNode("div",re,[e.createVNode(p,{class:"size-12 rounded-xl"},{default:e.withCtx(()=>[e.createVNode(m,{src:c.media?.[0],class:"object-cover"},null,8,["src"]),e.createVNode(t,{class:"rounded-xl"})]),_:2},1024),e.createElementVNode("span",null,e.toDisplayString(c.title),1)])]),_:2},1024),e.createVNode(x,null,{default:e.withCtx(()=>[c.status==="published"?(e.openBlock(),e.createElementBlock("span",se,"Published")):c.status==="draft"?(e.openBlock(),e.createElementBlock("span",ae,"Draft")):c.status==="archived"?(e.openBlock(),e.createElementBlock("span",ie,"Archived")):e.createCommentVNode("",!0)]),_:2},1024),e.createVNode(x,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.variantsTotal),1)]),_:2},1024),e.createVNode(x,{class:"text-right"},{default:e.withCtx(()=>[e.createTextVNode(" € "+e.toDisplayString(c.price||0),1)]),_:2},1024)]),_:2},1032,["onClick"]))),128))]),_:1})]),_:1})]),_:1})}}}),de={class:"truncate"},ue={key:0},me={key:1},pe={key:2},fe={key:3},ve={class:"relative w-full max-w-sm items-center"},Ce={class:"truncate"},xe={class:"truncate"},ge={class:"flex items-center space-x-2 mb-4"},Ve={class:"flex items-center space-x-2 mb-4"},Ne={class:"flex items-center space-x-2 mb-4"},ke=e.defineComponent({__name:"FilterPopover",setup(T){const o=e.inject("filter"),f=e.inject("collections"),g=()=>{o.value={collections:[],published:!0,draft:!0,archived:!1}};return(v,n)=>{const d=e.resolveComponent("Button"),i=e.resolveComponent("PopoverTrigger"),l=e.resolveComponent("ComboboxTrigger"),u=e.resolveComponent("ComboboxAnchor"),k=e.resolveComponent("ComboboxInput"),x=e.resolveComponent("ComboboxEmpty"),m=e.resolveComponent("ComboboxItemIndicator"),t=e.resolveComponent("ComboboxItem"),p=e.resolveComponent("ScrollArea"),C=e.resolveComponent("ComboboxGroup"),V=e.resolveComponent("ComboboxList"),N=e.resolveComponent("Combobox"),c=e.resolveComponent("Checkbox"),w=e.resolveComponent("PopoverContent"),h=e.resolveComponent("Popover");return e.openBlock(),e.createBlock(h,null,{default:e.withCtx(()=>[e.createVNode(i,{asChild:""},{default:e.withCtx(()=>[e.createVNode(d,{variant:"outline"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.Filter),{class:"size-4"}),n[4]||(n[4]=e.createTextVNode(" Filter ",-1))]),_:1})]),_:1}),e.createVNode(w,{class:"w-64"},{default:e.withCtx(()=>[n[14]||(n[14]=e.createElementVNode("p",{class:"text-sm font-medium text-muted-foreground mb-4"}," Filter by Collection ",-1)),e.createVNode(N,{modelValue:e.unref(o).collections,"onUpdate:modelValue":n[0]||(n[0]=s=>e.unref(o).collections=s),by:"id",multiple:!0,class:"mb-6"},{default:e.withCtx(()=>[e.createVNode(u,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(l,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(d,{variant:"outline",class:"justify-between w-full"},{default:e.withCtx(()=>[e.createElementVNode("span",de,[e.unref(o).collections.length===1?(e.openBlock(),e.createElementBlock("span",ue,e.toDisplayString(e.unref(f).find(s=>s.id===e.unref(o).collections[0])?.title),1)):e.unref(o).collections.length===2?(e.openBlock(),e.createElementBlock("span",me,e.toDisplayString(e.unref(f).find(s=>s.id===e.unref(o).collections[0])?.title)+", "+e.toDisplayString(e.unref(f).find(s=>s.id===e.unref(o).collections[1])?.title),1)):e.unref(o).collections.length>2?(e.openBlock(),e.createElementBlock("span",pe,e.toDisplayString(e.unref(f).find(s=>s.id===e.unref(o).collections[0])?.title)+", "+e.toDisplayString(e.unref(f).find(s=>s.id===e.unref(o).collections[1])?.title)+" + "+e.toDisplayString(e.unref(o).collections.length-2),1)):(e.openBlock(),e.createElementBlock("span",fe,"Select collection"))]),e.createVNode(e.unref(B.ChevronsUpDown),{class:"ml-2 size-4 shrink-0 opacity-50"})]),_:1})]),_:1})]),_:1}),e.createVNode(V,null,{default:e.withCtx(()=>[e.createElementVNode("div",ve,[e.createVNode(k,{placeholder:"Select category..."})]),e.createVNode(x,null,{default:e.withCtx(()=>[...n[5]||(n[5]=[e.createTextVNode(" No category found. ",-1)])]),_:1}),e.unref(f)?.filter(s=>s.status==="published")?.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n[7]||(n[7]=e.createElementVNode("p",{class:"px-2 py-1.5 text-sm font-medium mt-2"},"Published",-1)),e.createVNode(C,null,{default:e.withCtx(()=>[e.createVNode(p,{class:"max-h-[200px] overflow-y-auto"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f).filter(s=>s.status==="published"),s=>(e.openBlock(),e.createBlock(t,{key:s.id,value:s.id},{default:e.withCtx(()=>[n[6]||(n[6]=e.createElementVNode("span",{class:"size-2 rounded-full bg-green-500"},null,-1)),e.createElementVNode("span",Ce,e.toDisplayString(s.title),1),e.createVNode(m,null,{default:e.withCtx(()=>[e.createVNode(e.unref(B.Check),{class:e.normalizeClass(e.unref(j.classNames)("ml-auto size-4"))},null,8,["class"])]),_:1})]),_:2},1032,["value"]))),128))]),_:1})]),_:1})],64)):e.createCommentVNode("",!0),e.unref(f)?.filter(s=>s.status==="draft")?.length>0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n[9]||(n[9]=e.createElementVNode("p",{class:"px-2 py-1.5 text-sm font-medium"},"Drafts",-1)),e.createVNode(C,null,{default:e.withCtx(()=>[e.createVNode(p,{class:"max-h-[200px] overflow-y-auto"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(f).filter(s=>s.status==="draft"),s=>(e.openBlock(),e.createBlock(t,{key:s.id,value:s.id},{default:e.withCtx(()=>[n[8]||(n[8]=e.createElementVNode("span",{class:"size-2 rounded-full bg-blue-500"},null,-1)),e.createElementVNode("span",xe,e.toDisplayString(s.title),1),e.createVNode(m,null,{default:e.withCtx(()=>[e.createVNode(e.unref(B.Check),{class:e.normalizeClass(e.unref(j.classNames)("ml-auto size-4"))},null,8,["class"])]),_:1})]),_:2},1032,["value"]))),128))]),_:1})]),_:1})],64)):e.createCommentVNode("",!0)]),_:1})]),_:1},8,["modelValue"]),n[15]||(n[15]=e.createElementVNode("p",{class:"text-sm font-medium text-muted-foreground mb-4"}," Filter by Status ",-1)),e.createElementVNode("div",ge,[e.createVNode(c,{id:"chk_published_products",modelValue:e.unref(o).published,"onUpdate:modelValue":n[1]||(n[1]=s=>e.unref(o).published=s)},null,8,["modelValue"]),n[10]||(n[10]=e.createElementVNode("label",{for:"chk_published_products",class:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"}," Show published products ",-1))]),e.createElementVNode("div",Ve,[e.createVNode(c,{id:"chk_draft_products",modelValue:e.unref(o).draft,"onUpdate:modelValue":n[2]||(n[2]=s=>e.unref(o).draft=s)},null,8,["modelValue"]),n[11]||(n[11]=e.createElementVNode("label",{for:"chk_draft_products",class:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"}," Show draft products ",-1))]),e.createElementVNode("div",Ne,[e.createVNode(c,{id:"chk_archived_products",modelValue:e.unref(o).archived,"onUpdate:modelValue":n[3]||(n[3]=s=>e.unref(o).archived=s)},null,8,["modelValue"]),n[12]||(n[12]=e.createElementVNode("label",{for:"chk_archived_products",class:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"}," Show archived products ",-1))]),e.unref(o).collections.length>0||!e.unref(o).published||!e.unref(o).draft||e.unref(o).archived?(e.openBlock(),e.createBlock(d,{key:0,variant:"secondary",class:"ml-auto my-2",size:"sm",onClick:g},{default:e.withCtx(()=>[e.createVNode(e.unref(B.RotateCcw),{class:"size-3"}),n[13]||(n[13]=e.createElementVNode("span",{class:"ml-0.5 text-xs"},"Reset filters",-1))]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1})}}}),be=e.defineComponent({__name:"ProductContextMenu",emits:["selectAll","duplicateProduct","deleteProduct","deleteSelection"],setup(T,{emit:o}){const f=o,g=e.inject("products"),v=e.inject("selection"),n=e.inject("config"),{hasPermission:d}=_.useModulePermissions(),{navigateTo:i}=_.useModuleRoute(),l=e.computed(()=>v.value?.length!==1?null:g.value?.find(m=>m.id===v.value[0])),u=m=>{let t=n.previewUrl;t=t.replace("{{ id","{{id"),t=t.replace("id }}","id}}"),t=t.replace("{{id}}",m.id),t=t.replace("{{ slug","{{slug"),t=t.replace("slug }}","slug}}"),t=t.replace("{{slug}}",m.slug),window.open(t,"_blank")},k=async(m,t)=>{try{if(!["draft","published","archived"].includes(t))return;await _.useFirebaseIntegration(n.project).update(n.productCollection,m.id,{status:t}),m.status=t,y.toast.success("Product status changed")}catch{y.toast.error("Failed to change product status")}},x=async m=>{try{if(!["draft","published","archived"].includes(m))return;const t=_.useFirebaseIntegration(n.project),p=[];v.value.forEach(async C=>{p.push(t.update(n.productCollection,C,{status:m}))}),y.toast.promise(Promise.all(p),{loading:`Changing status of ${v.value.length} products...`,success:()=>{const C=v.value.length;return v.value.forEach(V=>{g.value.find(N=>N.id==V).status=m}),v.value=[],`Product status changed for ${C} products`},error:C=>"Failed to change product status"})}catch{y.toast.error("Failed to change product status")}};return(m,t)=>{const p=e.resolveComponent("ContextMenuTrigger"),C=e.resolveComponent("ContextMenuShortcut"),V=e.resolveComponent("ContextMenuItem"),N=e.resolveComponent("ContextMenuContent"),c=e.resolveComponent("ContextMenuSeparator"),w=e.resolveComponent("ContextMenuSubTrigger"),h=e.resolveComponent("ContextMenuCheckboxItem"),s=e.resolveComponent("ContextMenuSubContent"),$=e.resolveComponent("ContextMenuSub"),z=e.resolveComponent("ContextMenu");return e.openBlock(),e.createBlock(z,null,{default:e.withCtx(()=>[e.createVNode(p,{class:"flex flex-1"},{default:e.withCtx(()=>[e.renderSlot(m.$slots,"default")]),_:3}),e.unref(v).length===0?(e.openBlock(),e.createBlock(N,{key:0,class:"w-64"},{default:e.withCtx(()=>[e.createVNode(V,{inset:"",onClick:t[0]||(t[0]=b=>f("selectAll"))},{default:e.withCtx(()=>[t[13]||(t[13]=e.createTextVNode(" Select all ",-1)),e.createVNode(C,null,{default:e.withCtx(()=>[...t[12]||(t[12]=[e.createTextVNode("⌘ + A",-1)])]),_:1})]),_:1})]),_:1})):e.createCommentVNode("",!0),e.unref(v).length===1&&l.value?(e.openBlock(),e.createBlock(N,{key:1,class:"w-64"},{default:e.withCtx(()=>[e.createVNode(V,{inset:"",onClick:t[1]||(t[1]=b=>e.unref(i)(l.value.id))},{default:e.withCtx(()=>[...t[14]||(t[14]=[e.createTextVNode(" Edit product ",-1)])]),_:1}),e.createVNode(c),e.unref(n).previewUrl?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createVNode(V,{inset:"",onClick:t[2]||(t[2]=b=>u(l.value))},{default:e.withCtx(()=>[t[15]||(t[15]=e.createTextVNode(" Preview product ",-1)),e.createVNode(C,null,{default:e.withCtx(()=>[e.createVNode(e.unref(B.ExternalLink),{class:"size-4"})]),_:1})]),_:1}),e.createVNode(c)],64)):e.createCommentVNode("",!0),e.createVNode(V,{inset:"",onClick:t[3]||(t[3]=b=>f("duplicateProduct",l.value))},{default:e.withCtx(()=>[...t[16]||(t[16]=[e.createTextVNode(" Duplicate product ",-1)])]),_:1}),e.createVNode($,null,{default:e.withCtx(()=>[e.createVNode(w,{inset:""},{default:e.withCtx(()=>[...t[17]||(t[17]=[e.createTextVNode(" Change status ",-1)])]),_:1}),e.createVNode(s,{class:"w-48"},{default:e.withCtx(()=>[e.createVNode(h,{onClick:t[4]||(t[4]=b=>k(l.value,"draft")),modelValue:l.value.status==="draft"},{default:e.withCtx(()=>[...t[18]||(t[18]=[e.createElementVNode("span",{class:"size-2 rounded-full bg-blue-500"},null,-1),e.createTextVNode(" Draft ",-1)])]),_:1},8,["modelValue"]),e.createVNode(h,{onClick:t[5]||(t[5]=b=>k(l.value,"published")),modelValue:l.value.status==="published"},{default:e.withCtx(()=>[...t[19]||(t[19]=[e.createElementVNode("span",{class:"size-2 rounded-full bg-green-500"},null,-1),e.createTextVNode(" Published ",-1)])]),_:1},8,["modelValue"]),e.createVNode(h,{onClick:t[6]||(t[6]=b=>k(l.value,"archived")),modelValue:l.value.status==="archived"},{default:e.withCtx(()=>[...t[20]||(t[20]=[e.createElementVNode("span",{class:"size-2 rounded-full bg-gray-300"},null,-1),e.createTextVNode(" Archived ",-1)])]),_:1},8,["modelValue"])]),_:1})]),_:1}),e.createVNode(V,{inset:"",variant:"destructive",onClick:t[7]||(t[7]=b=>f("deleteProduct",l.value))},{default:e.withCtx(()=>[...t[21]||(t[21]=[e.createTextVNode(" Delete product ",-1)])]),_:1})]),_:1})):e.createCommentVNode("",!0),e.unref(v).length>1?(e.openBlock(),e.createBlock(N,{key:2,class:"w-64"},{default:e.withCtx(()=>[e.createVNode($,null,{default:e.withCtx(()=>[e.createVNode(w,{inset:""},{default:e.withCtx(()=>[e.createTextVNode(" Change status ("+e.toDisplayString(e.unref(v).length)+") ",1)]),_:1}),e.createVNode(s,{class:"w-48"},{default:e.withCtx(()=>[e.createVNode(h,{onClick:t[8]||(t[8]=b=>x("draft"))},{default:e.withCtx(()=>[...t[22]||(t[22]=[e.createElementVNode("span",{class:"size-2 rounded-full bg-blue-500"},null,-1),e.createTextVNode(" Draft ",-1)])]),_:1}),e.createVNode(h,{onClick:t[9]||(t[9]=b=>x("published"))},{default:e.withCtx(()=>[...t[23]||(t[23]=[e.createElementVNode("span",{class:"size-2 rounded-full bg-green-500"},null,-1),e.createTextVNode(" Published ",-1)])]),_:1}),e.createVNode(h,{onClick:t[10]||(t[10]=b=>x("archived"))},{default:e.withCtx(()=>[...t[24]||(t[24]=[e.createElementVNode("span",{class:"size-2 rounded-full bg-gray-300"},null,-1),e.createTextVNode(" Archived ",-1)])]),_:1})]),_:1})]),_:1}),e.createVNode(V,{inset:"",variant:"destructive",onClick:t[11]||(t[11]=b=>f("deleteSelection"))},{default:e.withCtx(()=>[e.createTextVNode(" Delete products ("+e.toDisplayString(e.unref(v).length)+") ",1)]),_:1})]),_:1})):e.createCommentVNode("",!0)]),_:3})}}}),_e={class:"relative flex flex-col flex-1"},we={ref:"container",class:"flex items-center justify-between gap-4 w-full mt-12 mb-8"},he={class:"flex items-center gap-4"},ye={class:"text-lg whitespace-nowrap"},Be={class:"relative w-full max-w-sm items-center"},Ee={class:"absolute start-0 inset-y-0 flex items-center justify-center px-2"},Pe={class:"flex items-center gap-4"},Te={class:"flex flex-1"},Se=e.defineComponent({__name:"Overview",props:{config:{type:Object,required:!0}},async setup(T){let o,f;const g=T,{hasPermission:v}=_.useModulePermissions(),{navigateTo:n}=_.useModuleRoute(),{confirm:d}=_.useConfirmation();_.useModuleBreadcrumbs(()=>[]);const i=_.useFirebaseIntegration(g.config.project),l=e.ref([]),u=async()=>{const a=await i.find(g.config.productCollection);l.value=a||[]},k=e.useTemplateRef("container"),{width:x}=X.useElementSize(k),m=e.ref("grid"),t=e.ref(1),p=e.ref([]),C=e.ref(""),V=e.ref([]);V.value=([o,f]=e.withAsyncContext(()=>h()),o=await o,f(),o);const N=e.computed(()=>m.value==="grid"?x.value<768?6:x.value<896?8:x.value<1024?10:12:10),c=e.computed(()=>l.value.filter(a=>!(S.value.collections.length>0&&!a.collections?.some(r=>S.value.collections.includes(r))||!S.value.published&&a.status==="published"||!S.value.draft&&a.status==="draft"||!S.value.archived&&a.status==="archived")).filter(a=>a.title.toLowerCase().includes(C.value.toLowerCase())||a.slug.toLowerCase().includes(C.value.toLowerCase())||a.id.toLowerCase().includes(C.value.toLowerCase()))),w=e.computed(()=>{if(c.value.length<=N.value)return c.value;const a=(t.value-1)*N.value,r=a+N.value;return c.value.slice(a,r)});async function h(){if(!g.config.collectionsCollection)return[];const a=g.config.collectionsCollection.split(":");return a.length!==2?[]:(await i.get(a[0]))?.[a[1]]||[]}async function s(a){return(await i.find(g.config.productCollection,{filters:[{field:"slug",operator:"==",value:a}]})).length>0}const $=()=>{p.value=w.value.map(a=>a.id)},z=async a=>{try{let r={...a},P=r.slug+"-copy",M=2;for(;await s(P);)P=r.slug+"-copy-"+M,M++;r.id=void 0,r.createdAt=new Date,r.updatedAt=new Date,r.slug=P,r.status="draft",r.title=r.title+" (copy)";const F=await i.add(g.config.productCollection,r);n(F.id),y.toast.success("Product duplicated")}catch{y.toast.error("Failed to duplicate product")}},b=async a=>{if(await d(`Are you sure you want to delete "${a.title}"?`))try{await i.remove(g.config.productCollection,a.id),l.value=l.value.filter(P=>P.id!==a.id),p.value=[],y.toast.success("Product deleted")}catch{y.toast.error("Failed to delete product")}},A=async()=>{if(await d(`Are you sure you want to delete all selected products (${p.value.length})?`))try{p.value.forEach(async r=>{await i.remove(g.config.productCollection,r)}),l.value=l.value.filter(r=>!p.value.includes(r.id)),p.value=[],y.toast.success("Products deleted")}catch{y.toast.error("Failed to delete products")}},S=e.ref({collections:[],published:!0,draft:!0,archived:!1});e.watch(S,()=>{t.value=1});const I=a=>{a.target?.matches("input, textarea")||a.target?.isContentEditable||(a.key==="Escape"&&(p.value=[]),(a.metaKey||a.ctrlKey)&&a.key.toLowerCase()==="a"&&(a.preventDefault(),$()))};return e.onMounted(()=>{u(),window.addEventListener("keydown",I)}),e.onUnmounted(()=>{window.removeEventListener("keydown",I)}),e.provide("config",g.config),e.provide("filter",S),e.provide("products",l),e.provide("collections",V),e.provide("selection",p),(a,r)=>{const P=e.resolveComponent("Input"),M=e.resolveComponent("Button"),F=e.resolveComponent("SegmentedControlButton"),R=e.resolveComponent("SegmentedControl"),U=e.resolveComponent("PaginationFirst"),K=e.resolveComponent("PaginationPrev"),q=e.resolveComponent("PaginationListItem"),G=e.resolveComponent("PaginationEllipsis"),O=e.resolveComponent("PaginationNext"),H=e.resolveComponent("PaginationLast"),Q=e.resolveComponent("PaginationList"),W=e.resolveComponent("Pagination");return e.openBlock(),e.createElementBlock("div",_e,[e.createElementVNode("div",we,[e.createElementVNode("div",he,[e.createElementVNode("p",ye,e.toDisplayString(c.value?.length)+" products",1),e.createElementVNode("div",Be,[e.createVNode(P,{id:"search",type:"text",placeholder:"Search...",class:"pl-8",onKeydown:r[0]||(r[0]=e.withKeys(E=>C.value="",["escape"])),modelValue:C.value,"onUpdate:modelValue":r[1]||(r[1]=E=>C.value=E)},null,8,["modelValue"]),e.createElementVNode("span",Ee,[e.createVNode(e.unref(B.Search),{class:"size-4 text-muted-foreground"})])])]),e.createElementVNode("div",Pe,[p.value.length>0?(e.openBlock(),e.createBlock(M,{key:0,variant:"destructive",onClick:A},{default:e.withCtx(()=>[e.createTextVNode(" Delete Selection ("+e.toDisplayString(p.value.length)+") ",1)]),_:1})):e.createCommentVNode("",!0),e.unref(v)("create-product")?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createVNode(M,{variant:"outline",onClick:r[2]||(r[2]=E=>e.unref(n)("new"))},{default:e.withCtx(()=>[e.createVNode(e.unref(B.Plus),{class:"size-4"}),r[5]||(r[5]=e.createTextVNode(" New Product ",-1))]),_:1}),r[6]||(r[6]=e.createElementVNode("div",{class:"w-[1px] h-8 bg-border"},null,-1))],64)):e.createCommentVNode("",!0),e.createVNode(ke),r[7]||(r[7]=e.createElementVNode("div",{class:"w-[1px] h-8 bg-border"},null,-1)),e.createElementVNode("div",null,[e.createVNode(R,{modelValue:m.value,"onUpdate:modelValue":r[3]||(r[3]=E=>m.value=E),"aria-label":"View mode"},{default:e.withCtx(()=>[e.createVNode(F,{value:"grid"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.LayoutGrid),{class:"size-4"})]),_:1}),e.createVNode(F,{value:"list"},{default:e.withCtx(()=>[e.createVNode(e.unref(B.List),{class:"size-4"})]),_:1})]),_:1},8,["modelValue"])])])],512),e.createElementVNode("div",Te,[e.createVNode(be,{onSelectAll:$,onDuplicateProduct:z,onDeleteProduct:b,onDeleteSelection:A},{default:e.withCtx(()=>[m.value==="grid"?(e.openBlock(),e.createBlock(le,{key:0,products:w.value},null,8,["products"])):(e.openBlock(),e.createBlock(ce,{key:1,products:w.value},null,8,["products"]))]),_:1})]),c.value?.length>N.value?(e.openBlock(),e.createBlock(W,{key:0,page:t.value,"onUpdate:page":r[4]||(r[4]=E=>t.value=E),"items-per-page":N.value,total:c.value?.length,"sibling-count":1,"show-edges":""},{default:e.withCtx(()=>[e.createVNode(Q,{class:"flex items-center gap-1"},{default:e.withCtx(({items:E})=>[e.createVNode(U),e.createVNode(K),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E,(D,L)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[D.type==="page"?(e.openBlock(),e.createBlock(q,{key:L,value:D.value,"as-child":""},{default:e.withCtx(()=>[e.createVNode(M,{class:"size-10 p-0",variant:D.value===t.value?"default":"outline"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(D.value),1)]),_:2},1032,["variant"])]),_:2},1032,["value"])):(e.openBlock(),e.createBlock(G,{key:D.type,index:L},null,8,["index"]))],64))),256)),e.createVNode(O),e.createVNode(H)]),_:1})]),_:1},8,["page","items-per-page","total"])):e.createCommentVNode("",!0)])}}});exports.default=Se;
@@ -1,4 +1,4 @@
1
- import { defineComponent as $, resolveComponent as n, createBlock as g, openBlock as a, withCtx as t, createVNode as e, createTextVNode as _, createElementBlock as v, Fragment as j, renderList as z, unref as c, createElementVNode as r, createCommentVNode as T, toDisplayString as h, ref as V, computed as I, onMounted as L, withKeys as N } from "vue";
1
+ import { defineComponent as $, resolveComponent as n, openBlock as a, createBlock as g, withCtx as t, createVNode as e, createTextVNode as _, createElementBlock as v, Fragment as j, renderList as z, unref as c, createElementVNode as r, createCommentVNode as T, toDisplayString as h, ref as V, computed as I, onMounted as L, withKeys as N } from "vue";
2
2
  import { Pencil as F, Search as H, Plus as M } from "lucide-vue-next";
3
3
  import { useModuleRoute as P, useModulePermissions as S, useLogs as E, useModuleBreadcrumbs as R, useFirebaseIntegration as q } from "@oneclick.dev/cms-kit";
4
4
  const D = { class: "flex items-center gap-2" }, K = {
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),f=require("@oneclick.dev/cms-kit"),i=require("lucide-vue-next"),z={class:"container mx-auto p-8"},G={key:0},R={class:"flex gap-2"},H={key:2},P={class:"flex justify-between items-center gap-4 mb-4"},q={key:0,class:"flex items-center gap-2"},F={class:"mr-2"},J=["onClick"],L={class:"flex justify-between items-center mb-2"},U={class:"flex flex-col items-start"},Y={class:"text-lg font-medium"},K={class:"text-sm text-muted-foreground"},X={key:0},Q={key:1},W={key:0,class:"flex justify-end mt-8"},Z=e.defineComponent({__name:"Overview",setup(ee){const{config:c}=f.useModule(),C=f.useFirebaseIntegration(c.project),{navigateTo:x}=f.useModuleRoute(),{confirm:b}=f.useConfirmation(),{hasPermission:u}=f.useModulePermissions();f.useModuleBreadcrumbs(()=>[]);const v=e.ref(null),s=e.ref(!1),a=e.ref([]),V=e.ref("importAgendasInput"),A=n=>{s.value=!0,a.value=[n]},N=async()=>{v.value=await C.find(c.agendaCollection)},M=async n=>{if(!u("create-agendas"))return;const t=await C.get(c.agendaCollection,n);if(!t){alert("Agenda not found");return}const r=prompt("Enter name for duplicated agenda",t.serviceName+" (Copy)");if(!r)return;const l={...t,serviceName:r};delete l.id,await C.add(c.agendaCollection,l),await N()},T=async n=>{!u("delete-agendas")||!await b("Are you sure you want to delete this agenda? This action cannot be undone.")||(await C.remove(c.agendaCollection,n),await N())},I=async()=>{let n=v.value.filter(l=>a.value.includes(l.id));n=n.map(l=>{const{id:p,...m}=l;return m});const t="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(n,null,2)),r=document.createElement("a");r.setAttribute("href",t),r.setAttribute("download","agendas_export.json"),document.body.appendChild(r),r.click(),r.remove(),s.value=!1,a.value=[]},D=async n=>{const t=n.target;if(!t.files||t.files.length===0)return;const l=await t.files[0].text();let p;try{p=JSON.parse(l)}catch{alert("Invalid JSON file");return}if(!Array.isArray(p)){alert("Invalid agendas format");return}for(const m of p)await C.add(c.agendaCollection,m);t.value="",await N()};return N(),(n,t)=>{const r=e.resolveComponent("Spinner"),l=e.resolveComponent("EmptyMedia"),p=e.resolveComponent("EmptyTitle"),m=e.resolveComponent("EmptyDescription"),$=e.resolveComponent("EmptyHeader"),d=e.resolveComponent("Button"),S=e.resolveComponent("EmptyContent"),j=e.resolveComponent("Empty"),_=e.resolveComponent("DropdownMenuTrigger"),g=e.resolveComponent("DropdownMenuItem"),w=e.resolveComponent("DropdownMenuGroup"),y=e.resolveComponent("DropdownMenuContent"),B=e.resolveComponent("DropdownMenu"),E=e.resolveComponent("ButtonGroup"),h=e.resolveComponent("Checkbox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",z,[v.value===null?(e.openBlock(),e.createElementBlock("div",G,[e.createVNode(r,{class:"mx-auto"})])):v.value.length===0?(e.openBlock(),e.createBlock(j,{key:1},{default:e.withCtx(()=>[e.createVNode($,null,{default:e.withCtx(()=>[e.createVNode(l,{variant:"icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.CalendarX),{class:"size-4-6"})]),_:1}),e.createVNode(p,null,{default:e.withCtx(()=>[...t[4]||(t[4]=[e.createTextVNode("No Agendas Yet",-1)])]),_:1}),e.createVNode(m,null,{default:e.withCtx(()=>[...t[5]||(t[5]=[e.createTextVNode(" You haven't created any agenda yet. Get started by creating your first agenda. ",-1)])]),_:1})]),_:1}),e.createVNode(S,null,{default:e.withCtx(()=>[e.createElementVNode("div",R,[e.createVNode(d,{onClick:t[0]||(t[0]=o=>e.unref(x)("/create"))},{default:e.withCtx(()=>[...t[6]||(t[6]=[e.createTextVNode("Create Agenda",-1)])]),_:1})])]),_:1})]),_:1})):(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("div",P,[t[9]||(t[9]=e.createElementVNode("h2",{class:"text-2xl font-bold"},"Agendas",-1)),s.value?(e.openBlock(),e.createElementBlock("div",q,[e.createElementVNode("span",F,e.toDisplayString(a.value.length)+" selected",1),e.createVNode(d,{variant:"outline",onClick:t[1]||(t[1]=o=>{s.value=!1,a.value=[]})},{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode(" Cancel ",-1)])]),_:1}),e.createVNode(d,{onClick:I,disabled:a.value.length===0},{default:e.withCtx(()=>[...t[8]||(t[8]=[e.createTextVNode(" Export ",-1)])]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,o=>(e.openBlock(),e.createElementBlock("button",{key:o.id,class:e.normalizeClass(["block w-full mb-4 p-4 border rounded-md bg-background",{"cursor-pointer hover:bg-accent focus-visible:outline-0 focus:ring-2 ring-ring/50":s.value}]),onClick:k=>s.value?a.value.includes(o.id)?a.value=a.value.filter(O=>O!==o.id):a.value.push(o.id):null},[e.createElementVNode("div",L,[e.createElementVNode("div",U,[e.createElementVNode("h3",Y,e.toDisplayString(o.serviceName),1),e.createElementVNode("p",K,[o.type==="regular"?(e.openBlock(),e.createElementBlock("span",X,"Regular Agenda")):e.createCommentVNode("",!0)])]),s.value?(e.openBlock(),e.createElementBlock("div",Q,[a.value.includes(o.id)?(e.openBlock(),e.createBlock(h,{key:0,tabindex:"-1",defaultValue:!0})):(e.openBlock(),e.createBlock(h,{key:1,tabindex:"-1",defaultValue:!1}))])):(e.openBlock(),e.createBlock(E,{key:0},{default:e.withCtx(()=>[e.unref(u)("edit-agendas")?(e.openBlock(),e.createBlock(d,{key:0,variant:"outline",onClick:k=>e.unref(x)(`/edit/${o.id}`)},{default:e.withCtx(()=>[...t[10]||(t[10]=[e.createTextVNode(" Edit Agenda ",-1)])]),_:1},8,["onClick"])):(e.openBlock(),e.createBlock(d,{key:1,variant:"outline",onClick:k=>e.unref(x)(`/edit/${o.id}/agenda`)},{default:e.withCtx(()=>[...t[11]||(t[11]=[e.createTextVNode(" View Agenda ",-1)])]),_:1},8,["onClick"])),e.createVNode(B,null,{default:e.withCtx(()=>[e.createVNode(_,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(d,{variant:"outline",size:"icon","aria-label":"More Options"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.MoreHorizontalIcon))]),_:1})]),_:1}),e.createVNode(y,{align:"end",class:"w-52"},{default:e.withCtx(()=>[e.createVNode(w,null,{default:e.withCtx(()=>[e.unref(u)("create-agendas")?(e.openBlock(),e.createBlock(g,{key:0,onClick:k=>M(o.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(i.Copy)),t[12]||(t[12]=e.createTextVNode(" Duplicate Agenda ",-1))]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.createVNode(g,null,{default:e.withCtx(()=>[e.createVNode(e.unref(i.ChevronsLeftRightEllipsis)),t[13]||(t[13]=e.createTextVNode(" API Set-up ",-1))]),_:1}),e.createVNode(g,{onClick:k=>A(o.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(i.Upload)),t[14]||(t[14]=e.createTextVNode(" Export Agenda ",-1))]),_:1},8,["onClick"]),e.unref(u)("delete-agendas")?(e.openBlock(),e.createBlock(g,{key:1,variant:"destructive",onClick:k=>T(o.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(i.Trash2Icon)),t[15]||(t[15]=e.createTextVNode(" Remove Agenda ",-1))]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))])],10,J))),128)),e.unref(u)("create-agendas")?(e.openBlock(),e.createElementBlock("div",W,[e.createVNode(E,null,{default:e.withCtx(()=>[e.createVNode(d,{onClick:t[2]||(t[2]=o=>e.unref(x)("/create")),class:"border-r"},{default:e.withCtx(()=>[...t[16]||(t[16]=[e.createTextVNode("New Agenda",-1)])]),_:1}),e.createVNode(B,null,{default:e.withCtx(()=>[e.createVNode(_,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(d,{size:"icon","aria-label":"More Options"},{default:e.withCtx(()=>[e.createVNode(e.unref(i.MoreHorizontalIcon))]),_:1})]),_:1}),e.createVNode(y,{align:"end",class:"w-52"},{default:e.withCtx(()=>[e.createVNode(w,null,{default:e.withCtx(()=>[e.createVNode(g,{onClick:t[3]||(t[3]=o=>V.value.click())},{default:e.withCtx(()=>[e.createVNode(e.unref(i.ImportIcon)),t[17]||(t[17]=e.createTextVNode(" Import Agendas... ",-1))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})])):e.createCommentVNode("",!0)]))]),e.createElementVNode("input",{type:"file",ref_key:"importAgendasInput",ref:V,class:"hidden",accept:".json,application/json",onChange:D},null,544)],64)}}});exports.default=Z;
@@ -1,4 +1,4 @@
1
- import { defineComponent as B, resolveComponent as i, createBlock as x, openBlock as a, withCtx as n, createVNode as e, createTextVNode as _, createElementBlock as f, Fragment as O, renderList as P, unref as c, createElementVNode as o, toDisplayString as g, createCommentVNode as y, ref as E, onMounted as N, withKeys as j } from "vue";
1
+ import { defineComponent as B, resolveComponent as i, openBlock as a, createBlock as x, withCtx as n, createVNode as e, createTextVNode as _, createElementBlock as f, Fragment as O, renderList as P, unref as c, createElementVNode as o, toDisplayString as g, createCommentVNode as y, ref as E, onMounted as N, withKeys as j } from "vue";
2
2
  import { Pencil as z, Search as H, Plus as M } from "lucide-vue-next";
3
3
  import { useModuleRoute as $, useModulePermissions as V, useLogs as R, useModuleBreadcrumbs as F, useFirebaseIntegration as I } from "@oneclick.dev/cms-kit";
4
4
  import { r as L } from "./countries-BTPvmrsb.mjs";
@@ -1,4 +1,4 @@
1
- import { defineComponent as G, resolveComponent as n, createElementBlock as k, openBlock as c, Fragment as te, renderList as le, createBlock as w, unref as b, withCtx as l, createElementVNode as o, normalizeClass as oe, resolveDynamicComponent as ne, createCommentVNode as U, toDisplayString as P, createVNode as t, withModifiers as Ee, createTextVNode as d, ref as v, computed as q, useTemplateRef as Se, onMounted as De } from "vue";
1
+ import { defineComponent as G, resolveComponent as n, openBlock as c, createElementBlock as k, Fragment as te, renderList as le, createBlock as w, unref as b, withCtx as l, createElementVNode as o, normalizeClass as oe, resolveDynamicComponent as ne, toDisplayString as P, createCommentVNode as U, createVNode as t, withModifiers as Ee, createTextVNode as d, ref as v, computed as q, useTemplateRef as Se, onMounted as De } from "vue";
2
2
  import { icons as ae, EllipsisVertical as Te, Paintbrush as Pe, ToyBrick as Me, Plus as Ue } from "lucide-vue-next";
3
3
  import { useModuleRoute as se, useConfirmation as ie, useModuleStorage as $e, useModulePermissions as Ne, useModuleBreadcrumbs as Ae, useFirebaseIntegration as Re } from "@oneclick.dev/cms-kit";
4
4
  import { i as Le } from "./interpolation-BHSqsh8Q.mjs";
@@ -0,0 +1,327 @@
1
+ import { defineComponent as q, ref as D, resolveComponent as s, openBlock as o, createElementBlock as f, Fragment as V, createElementVNode as p, createVNode as t, createBlock as g, withCtx as n, unref as l, createTextVNode as i, toDisplayString as O, createCommentVNode as E, renderList as K, normalizeClass as Q } from "vue";
2
+ import { useModule as W, useFirebaseIntegration as Z, useModuleRoute as ee, useConfirmation as te, useModulePermissions as ne, useModuleBreadcrumbs as oe } from "@oneclick.dev/cms-kit";
3
+ import { CalendarX as ae, MoreHorizontalIcon as z, Copy as le, ChevronsLeftRightEllipsis as se, Upload as ie, Trash2Icon as de, ImportIcon as re } from "lucide-vue-next";
4
+ const ue = { class: "container mx-auto p-8" }, ce = { key: 0 }, pe = { class: "flex gap-2" }, fe = { key: 2 }, me = { class: "flex justify-between items-center gap-4 mb-4" }, ge = {
5
+ key: 0,
6
+ class: "flex items-center gap-2"
7
+ }, ve = { class: "mr-2" }, _e = ["onClick"], ye = { class: "flex justify-between items-center mb-2" }, Ce = { class: "flex flex-col items-start" }, ke = { class: "text-lg font-medium" }, we = { class: "text-sm text-muted-foreground" }, xe = { key: 0 }, be = { key: 1 }, Ae = {
8
+ key: 0,
9
+ class: "flex justify-end mt-8"
10
+ }, Ne = /* @__PURE__ */ q({
11
+ __name: "Overview",
12
+ setup(Ee) {
13
+ const { config: _ } = W(), w = Z(_.project), { navigateTo: M } = ee(), { confirm: G } = te(), { hasPermission: y } = ne();
14
+ oe(() => []);
15
+ const x = D(null), v = D(!1), r = D([]), N = D("importAgendasInput"), R = (d) => {
16
+ v.value = !0, r.value = [d];
17
+ }, I = async () => {
18
+ x.value = await w.find(_.agendaCollection);
19
+ }, H = async (d) => {
20
+ if (!y("create-agendas")) return;
21
+ const e = await w.get(_.agendaCollection, d);
22
+ if (!e) {
23
+ alert("Agenda not found");
24
+ return;
25
+ }
26
+ const u = prompt("Enter name for duplicated agenda", e.serviceName + " (Copy)");
27
+ if (!u)
28
+ return;
29
+ const c = { ...e, serviceName: u };
30
+ delete c.id, await w.add(_.agendaCollection, c), await I();
31
+ }, J = async (d) => {
32
+ !y("delete-agendas") || !await G("Are you sure you want to delete this agenda? This action cannot be undone.") || (await w.remove(_.agendaCollection, d), await I());
33
+ }, P = async () => {
34
+ let d = x.value.filter((c) => r.value.includes(c.id));
35
+ d = d.map((c) => {
36
+ const { id: C, ...k } = c;
37
+ return k;
38
+ });
39
+ const e = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(d, null, 2)), u = document.createElement("a");
40
+ u.setAttribute("href", e), u.setAttribute("download", "agendas_export.json"), document.body.appendChild(u), u.click(), u.remove(), v.value = !1, r.value = [];
41
+ }, F = async (d) => {
42
+ const e = d.target;
43
+ if (!e.files || e.files.length === 0)
44
+ return;
45
+ const c = await e.files[0].text();
46
+ let C;
47
+ try {
48
+ C = JSON.parse(c);
49
+ } catch {
50
+ alert("Invalid JSON file");
51
+ return;
52
+ }
53
+ if (!Array.isArray(C)) {
54
+ alert("Invalid agendas format");
55
+ return;
56
+ }
57
+ for (const k of C)
58
+ await w.add(_.agendaCollection, k);
59
+ e.value = "", await I();
60
+ };
61
+ return I(), (d, e) => {
62
+ const u = s("Spinner"), c = s("EmptyMedia"), C = s("EmptyTitle"), k = s("EmptyDescription"), L = s("EmptyHeader"), m = s("Button"), U = s("EmptyContent"), Y = s("Empty"), $ = s("DropdownMenuTrigger"), b = s("DropdownMenuItem"), j = s("DropdownMenuGroup"), B = s("DropdownMenuContent"), S = s("DropdownMenu"), T = s("ButtonGroup"), h = s("Checkbox");
63
+ return o(), f(V, null, [
64
+ p("div", ue, [
65
+ x.value === null ? (o(), f("div", ce, [
66
+ t(u, { class: "mx-auto" })
67
+ ])) : x.value.length === 0 ? (o(), g(Y, { key: 1 }, {
68
+ default: n(() => [
69
+ t(L, null, {
70
+ default: n(() => [
71
+ t(c, { variant: "icon" }, {
72
+ default: n(() => [
73
+ t(l(ae), { class: "size-4-6" })
74
+ ]),
75
+ _: 1
76
+ }),
77
+ t(C, null, {
78
+ default: n(() => [...e[4] || (e[4] = [
79
+ i("No Agendas Yet", -1)
80
+ ])]),
81
+ _: 1
82
+ }),
83
+ t(k, null, {
84
+ default: n(() => [...e[5] || (e[5] = [
85
+ i(" You haven't created any agenda yet. Get started by creating your first agenda. ", -1)
86
+ ])]),
87
+ _: 1
88
+ })
89
+ ]),
90
+ _: 1
91
+ }),
92
+ t(U, null, {
93
+ default: n(() => [
94
+ p("div", pe, [
95
+ t(m, {
96
+ onClick: e[0] || (e[0] = (a) => l(M)("/create"))
97
+ }, {
98
+ default: n(() => [...e[6] || (e[6] = [
99
+ i("Create Agenda", -1)
100
+ ])]),
101
+ _: 1
102
+ })
103
+ ])
104
+ ]),
105
+ _: 1
106
+ })
107
+ ]),
108
+ _: 1
109
+ })) : (o(), f("div", fe, [
110
+ p("div", me, [
111
+ e[9] || (e[9] = p("h2", { class: "text-2xl font-bold" }, "Agendas", -1)),
112
+ v.value ? (o(), f("div", ge, [
113
+ p("span", ve, O(r.value.length) + " selected", 1),
114
+ t(m, {
115
+ variant: "outline",
116
+ onClick: e[1] || (e[1] = (a) => {
117
+ v.value = !1, r.value = [];
118
+ })
119
+ }, {
120
+ default: n(() => [...e[7] || (e[7] = [
121
+ i(" Cancel ", -1)
122
+ ])]),
123
+ _: 1
124
+ }),
125
+ t(m, {
126
+ onClick: P,
127
+ disabled: r.value.length === 0
128
+ }, {
129
+ default: n(() => [...e[8] || (e[8] = [
130
+ i(" Export ", -1)
131
+ ])]),
132
+ _: 1
133
+ }, 8, ["disabled"])
134
+ ])) : E("", !0)
135
+ ]),
136
+ (o(!0), f(V, null, K(x.value, (a) => (o(), f("button", {
137
+ key: a.id,
138
+ class: Q(["block w-full mb-4 p-4 border rounded-md bg-background", { "cursor-pointer hover:bg-accent focus-visible:outline-0 focus:ring-2 ring-ring/50": v.value }]),
139
+ onClick: (A) => v.value ? r.value.includes(a.id) ? r.value = r.value.filter((X) => X !== a.id) : r.value.push(a.id) : null
140
+ }, [
141
+ p("div", ye, [
142
+ p("div", Ce, [
143
+ p("h3", ke, O(a.serviceName), 1),
144
+ p("p", we, [
145
+ a.type === "regular" ? (o(), f("span", xe, "Regular Agenda")) : E("", !0)
146
+ ])
147
+ ]),
148
+ v.value ? (o(), f("div", be, [
149
+ r.value.includes(a.id) ? (o(), g(h, {
150
+ key: 0,
151
+ tabindex: "-1",
152
+ defaultValue: !0
153
+ })) : (o(), g(h, {
154
+ key: 1,
155
+ tabindex: "-1",
156
+ defaultValue: !1
157
+ }))
158
+ ])) : (o(), g(T, { key: 0 }, {
159
+ default: n(() => [
160
+ l(y)("edit-agendas") ? (o(), g(m, {
161
+ key: 0,
162
+ variant: "outline",
163
+ onClick: (A) => l(M)(`/edit/${a.id}`)
164
+ }, {
165
+ default: n(() => [...e[10] || (e[10] = [
166
+ i(" Edit Agenda ", -1)
167
+ ])]),
168
+ _: 1
169
+ }, 8, ["onClick"])) : (o(), g(m, {
170
+ key: 1,
171
+ variant: "outline",
172
+ onClick: (A) => l(M)(`/edit/${a.id}/agenda`)
173
+ }, {
174
+ default: n(() => [...e[11] || (e[11] = [
175
+ i(" View Agenda ", -1)
176
+ ])]),
177
+ _: 1
178
+ }, 8, ["onClick"])),
179
+ t(S, null, {
180
+ default: n(() => [
181
+ t($, { "as-child": "" }, {
182
+ default: n(() => [
183
+ t(m, {
184
+ variant: "outline",
185
+ size: "icon",
186
+ "aria-label": "More Options"
187
+ }, {
188
+ default: n(() => [
189
+ t(l(z))
190
+ ]),
191
+ _: 1
192
+ })
193
+ ]),
194
+ _: 1
195
+ }),
196
+ t(B, {
197
+ align: "end",
198
+ class: "w-52"
199
+ }, {
200
+ default: n(() => [
201
+ t(j, null, {
202
+ default: n(() => [
203
+ l(y)("create-agendas") ? (o(), g(b, {
204
+ key: 0,
205
+ onClick: (A) => H(a.id)
206
+ }, {
207
+ default: n(() => [
208
+ t(l(le)),
209
+ e[12] || (e[12] = i(" Duplicate Agenda ", -1))
210
+ ]),
211
+ _: 1
212
+ }, 8, ["onClick"])) : E("", !0),
213
+ t(b, null, {
214
+ default: n(() => [
215
+ t(l(se)),
216
+ e[13] || (e[13] = i(" API Set-up ", -1))
217
+ ]),
218
+ _: 1
219
+ }),
220
+ t(b, {
221
+ onClick: (A) => R(a.id)
222
+ }, {
223
+ default: n(() => [
224
+ t(l(ie)),
225
+ e[14] || (e[14] = i(" Export Agenda ", -1))
226
+ ]),
227
+ _: 1
228
+ }, 8, ["onClick"]),
229
+ l(y)("delete-agendas") ? (o(), g(b, {
230
+ key: 1,
231
+ variant: "destructive",
232
+ onClick: (A) => J(a.id)
233
+ }, {
234
+ default: n(() => [
235
+ t(l(de)),
236
+ e[15] || (e[15] = i(" Remove Agenda ", -1))
237
+ ]),
238
+ _: 1
239
+ }, 8, ["onClick"])) : E("", !0)
240
+ ]),
241
+ _: 2
242
+ }, 1024)
243
+ ]),
244
+ _: 2
245
+ }, 1024)
246
+ ]),
247
+ _: 2
248
+ }, 1024)
249
+ ]),
250
+ _: 2
251
+ }, 1024))
252
+ ])
253
+ ], 10, _e))), 128)),
254
+ l(y)("create-agendas") ? (o(), f("div", Ae, [
255
+ t(T, null, {
256
+ default: n(() => [
257
+ t(m, {
258
+ onClick: e[2] || (e[2] = (a) => l(M)("/create")),
259
+ class: "border-r"
260
+ }, {
261
+ default: n(() => [...e[16] || (e[16] = [
262
+ i("New Agenda", -1)
263
+ ])]),
264
+ _: 1
265
+ }),
266
+ t(S, null, {
267
+ default: n(() => [
268
+ t($, { "as-child": "" }, {
269
+ default: n(() => [
270
+ t(m, {
271
+ size: "icon",
272
+ "aria-label": "More Options"
273
+ }, {
274
+ default: n(() => [
275
+ t(l(z))
276
+ ]),
277
+ _: 1
278
+ })
279
+ ]),
280
+ _: 1
281
+ }),
282
+ t(B, {
283
+ align: "end",
284
+ class: "w-52"
285
+ }, {
286
+ default: n(() => [
287
+ t(j, null, {
288
+ default: n(() => [
289
+ t(b, {
290
+ onClick: e[3] || (e[3] = (a) => N.value.click())
291
+ }, {
292
+ default: n(() => [
293
+ t(l(re)),
294
+ e[17] || (e[17] = i(" Import Agendas... ", -1))
295
+ ]),
296
+ _: 1
297
+ })
298
+ ]),
299
+ _: 1
300
+ })
301
+ ]),
302
+ _: 1
303
+ })
304
+ ]),
305
+ _: 1
306
+ })
307
+ ]),
308
+ _: 1
309
+ })
310
+ ])) : E("", !0)
311
+ ]))
312
+ ]),
313
+ p("input", {
314
+ type: "file",
315
+ ref_key: "importAgendasInput",
316
+ ref: N,
317
+ class: "hidden",
318
+ accept: ".json,application/json",
319
+ onChange: F
320
+ }, null, 544)
321
+ ], 64);
322
+ };
323
+ }
324
+ });
325
+ export {
326
+ Ne as default
327
+ };