@ozdao/prometheus-framework 0.0.87 → 0.0.89

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-300fcb55.js +1 -0
  2. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-afba007a.mjs +1944 -0
  3. package/dist/ButtonFollow-001c4a65.mjs +130 -0
  4. package/dist/ButtonFollow-48043cc7.js +1 -0
  5. package/dist/CardHeader-0677d446.js +1 -0
  6. package/dist/CardHeader-e361dada.mjs +96 -0
  7. package/dist/CardOrganization-51309400.js +1 -0
  8. package/dist/CardOrganization-bacc2ef6.mjs +202 -0
  9. package/dist/Feed-4b28adc5.mjs +423 -0
  10. package/dist/Feed-51e4e232.js +1 -0
  11. package/dist/Feed-5d8d5c21.js +1 -0
  12. package/dist/Feed-76b2997e.mjs +367 -0
  13. package/dist/Feed-dc8b66bf.mjs +367 -0
  14. package/dist/Feed-eeb63363.js +1 -0
  15. package/dist/IconEdit-3028a3b7.js +1 -0
  16. package/dist/IconEdit-8df23653.mjs +205 -0
  17. package/dist/Image-30f04604.js +9 -0
  18. package/dist/Image-6c7584f5.mjs +477 -0
  19. package/dist/Image-6ec294f3.mjs +477 -0
  20. package/dist/Image-9a870c88.js +9 -0
  21. package/dist/PlaceholderUserpic-10fd9026.js +1 -0
  22. package/dist/PlaceholderUserpic-eb9820ce.mjs +28 -0
  23. package/dist/Popup-7c331e1c.js +1 -0
  24. package/dist/Popup-bdf043ba.mjs +76 -0
  25. package/dist/Product-1724d88d.mjs +837 -0
  26. package/dist/Product-a94d8b65.js +7 -0
  27. package/dist/Product-b233e2a3.js +7 -0
  28. package/dist/Product-eb00f35e.mjs +837 -0
  29. package/dist/ProductEdit-57484f1e.mjs +349 -0
  30. package/dist/ProductEdit-61413d02.mjs +349 -0
  31. package/dist/ProductEdit-ef301baa.js +1 -0
  32. package/dist/ProductEdit-fca68ff9.js +1 -0
  33. package/dist/ProfileBlogposts-6704a38c.js +1 -0
  34. package/dist/ProfileBlogposts-775b1cfa.mjs +63 -0
  35. package/dist/ProfileComments-175e42da.js +1 -0
  36. package/dist/ProfileComments-fd7d66bf.mjs +43 -0
  37. package/dist/ProfileEvents-1cfe6858.mjs +55 -0
  38. package/dist/ProfileEvents-4f2a5f00.js +1 -0
  39. package/dist/ProfileEvents-7a51a9e6.mjs +55 -0
  40. package/dist/ProfileEvents-d8e16509.js +1 -0
  41. package/dist/ProfileLikes-20a8a3c9.mjs +43 -0
  42. package/dist/ProfileLikes-b3b1350a.js +1 -0
  43. package/dist/ProfileOrganizations-4b866823.mjs +211 -0
  44. package/dist/ProfileOrganizations-6d3a43e4.js +1 -0
  45. package/dist/Publics-0e44c61e.mjs +122 -0
  46. package/dist/Publics-4e1c14fc.js +1 -0
  47. package/dist/Tab-a243605d.mjs +46 -0
  48. package/dist/UploadImage-6e312c46.mjs +83 -0
  49. package/dist/UploadImage-9e7e7468.js +1 -0
  50. package/dist/auth-2bc18d1e.js +8 -0
  51. package/dist/auth-fefd15a3.mjs +1503 -0
  52. package/dist/auth.client.cjs +1 -1
  53. package/dist/auth.client.js +5 -5
  54. package/dist/auth.validation-4a617c0b.mjs +20 -0
  55. package/dist/auth.validation-78a90fed.js +1 -0
  56. package/dist/community.client.cjs +1 -1
  57. package/dist/community.client.js +206 -222
  58. package/dist/components/Field/Field.vue.d.ts.map +1 -1
  59. package/dist/components/FieldPhone/FieldPhone(script-setup).vue.d.ts +3 -3
  60. package/dist/components/FieldPhone/FieldPhone.vue.d.ts +1 -1
  61. package/dist/events.client.cjs +1 -1
  62. package/dist/events.client.js +332 -312
  63. package/dist/events.server.js +77 -0
  64. package/dist/events.server.mjs +77 -0
  65. package/dist/inputs.validation-14e8e01f.mjs +93 -0
  66. package/dist/main.css +1 -1
  67. package/dist/organizations-1581c013.mjs +121 -0
  68. package/dist/organizations-c455dad7.js +1 -0
  69. package/dist/organizations.client-040ec107.js +3 -0
  70. package/dist/organizations.client-686845be.mjs +3179 -0
  71. package/dist/organizations.client-7937e180.mjs +3037 -0
  72. package/dist/organizations.client-99bfc474.js +3 -0
  73. package/dist/organizations.client.cjs +1 -1
  74. package/dist/organizations.client.js +39 -39
  75. package/dist/organizations.server.js +7 -3
  76. package/dist/organizations.server.mjs +7 -3
  77. package/dist/prometheus-framework.cjs.js +1 -1
  78. package/dist/prometheus-framework.es.js +3 -2
  79. package/dist/style.css +1 -1
  80. package/dist/users.client.cjs +1 -1
  81. package/dist/users.client.js +265 -256
  82. package/dist/users.server.js +2 -2
  83. package/dist/users.server.mjs +2 -2
  84. package/package.json +1 -1
  85. package/src/components/Field/Field.vue +2 -1
  86. package/src/modules/community/components/pages/CreateBlogPost.vue +2 -1
  87. package/src/modules/events/components/blocks/CardEvent.vue +1 -1
  88. package/src/modules/events/components/pages/EditEvent.vue +9 -3
  89. package/src/modules/events/components/pages/Event.vue +43 -4
  90. package/src/modules/events/middlewares/server/index.js +10 -0
  91. package/src/modules/events/middlewares/server/verifyEvent.js +60 -0
  92. package/src/modules/events/routes/events.routes.js +14 -1
  93. package/src/modules/organizations/components/blocks/Socials.vue +16 -3
  94. package/src/modules/organizations/components/pages/OrganizationEdit.vue +39 -15
  95. package/src/modules/organizations/components/sections/DetailsTab.vue +13 -9
  96. package/src/modules/organizations/controllers/organizations.controller.js +1 -1
  97. package/src/modules/organizations/models/organization.model.js +6 -2
  98. package/src/modules/organizations/store/organizations.js +2 -2
  99. package/src/modules/users/components/pages/Profile.vue +26 -11
  100. package/src/modules/users/components/pages/ProfileEdit.vue +28 -10
  101. package/src/modules/users/models/user.model.js +2 -2
  102. package/src/modules/users/store/users.js +1 -2
@@ -1 +1 @@
1
- {"version":3,"file":"Field.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Field/Field.vue"],"names":[],"mappings":"AAuFA,OAAO,wKAAwK,CAAA;;AAG/K,wBAAqF"}
1
+ {"version":3,"file":"Field.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Field/Field.vue"],"names":[],"mappings":"AAwFA,OAAO,wKAAwK,CAAA;;AAG/K,wBAAqF"}
@@ -19,11 +19,11 @@ declare const _default: {
19
19
  $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{}>>, {
20
20
  $props: {
21
21
  readonly mode?: string | undefined;
22
+ readonly disabled?: boolean | undefined;
22
23
  readonly allCountries?: unknown[] | undefined;
23
24
  readonly autoFormat?: boolean | undefined;
24
25
  readonly customValidate?: boolean | RegExp | undefined;
25
26
  readonly defaultCountry?: string | undefined;
26
- readonly disabled?: boolean | undefined;
27
27
  readonly autoDefaultCountry?: boolean | undefined;
28
28
  readonly dropdownOptions?: Record<string, any> | undefined;
29
29
  readonly ignoredCountries?: unknown[] | undefined;
@@ -75,11 +75,11 @@ declare const _default: {
75
75
  } & Readonly<import("vue").ExtractPropTypes<{}>> & import("vue").ShallowUnwrapRef<{
76
76
  $props: {
77
77
  readonly mode?: string | undefined;
78
+ readonly disabled?: boolean | undefined;
78
79
  readonly allCountries?: unknown[] | undefined;
79
80
  readonly autoFormat?: boolean | undefined;
80
81
  readonly customValidate?: boolean | RegExp | undefined;
81
82
  readonly defaultCountry?: string | undefined;
82
- readonly disabled?: boolean | undefined;
83
83
  readonly autoDefaultCountry?: boolean | undefined;
84
84
  readonly dropdownOptions?: Record<string, any> | undefined;
85
85
  readonly ignoredCountries?: unknown[] | undefined;
@@ -115,11 +115,11 @@ declare const _default: {
115
115
  } & import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{}>>, {
116
116
  $props: {
117
117
  readonly mode?: string | undefined;
118
+ readonly disabled?: boolean | undefined;
118
119
  readonly allCountries?: unknown[] | undefined;
119
120
  readonly autoFormat?: boolean | undefined;
120
121
  readonly customValidate?: boolean | RegExp | undefined;
121
122
  readonly defaultCountry?: string | undefined;
122
- readonly disabled?: boolean | undefined;
123
123
  readonly autoDefaultCountry?: boolean | undefined;
124
124
  readonly dropdownOptions?: Record<string, any> | undefined;
125
125
  readonly ignoredCountries?: unknown[] | undefined;
@@ -522,11 +522,11 @@ declare const _default: import("vue").DefineComponent<{
522
522
  }>>, {
523
523
  validation: boolean | Record<string, any>;
524
524
  mode: string;
525
+ disabled: boolean;
525
526
  allCountries: unknown[];
526
527
  autoFormat: boolean;
527
528
  customValidate: boolean | RegExp;
528
529
  defaultCountry: string;
529
- disabled: boolean;
530
530
  autoDefaultCountry: boolean;
531
531
  dropdownOptions: Record<string, any>;
532
532
  ignoredCountries: unknown[];
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("./Feed-8fd41524.js"),e=require("vue"),V=require("./EmptyState-7658d7d6.js"),g=require("./auth-5aa8e90c.js"),y=require("vue-router"),E=require("./Breadcrumbs.vue_vue_type_style_index_0_lang-15e71ec4.js"),x=require("./Comments-63f154a6.js"),T=require("./Popup-105ef2c3.js"),$=require("./UploadImage-441e8526.js"),q=require("./organizations-af43bda4.js"),b=require("./globals-928eb13c.js");require("vue-i18n");require("./CardHeader-925a972b.js");require("./PlaceholderUserpic-d64d6dd5.js");require("./vue-draggable-next.esm-bundler-80731ae0.js");const I={},O={width:"100%",height:"50",xmlns:"http://www.w3.org/2000/svg"},z=e.createStaticVNode('<rect x="0" y="0" width="100%" height="100%" fill="rgb(var(--grey))"></rect><rect x="15" y="15" rx="3" ry="3" width="40" height="20" fill="rgba(var(--black),0.05)"></rect><rect x="65" y="15" rx="3" ry="3" width="150" height="20" fill="rgba(var(--black),0.05)"></rect><circle cx="250" cy="25" r="10" fill="rgba(var(--black),0.1)"></circle><circle cx="265" cy="25" r="10" fill="rgba(var(--black),0.05)"></circle><circle cx="280" cy="25" r="10" fill="rgba(var(--black),0.025)"></circle><rect x="-25%" y="0" width="25%" height="100%" fill="#fff" opacity="0.3"><animate attributeName="x" from="-25%" to="100%" dur="2s" repeatCount="indefinite"></animate></rect>',7),j=[z];function F(c,r){return e.openBlock(),e.createElementBlock("svg",O,j)}const L=g._export_sfc(I,[["render",F]]);const U={class:"today-events"},R={__name:"List",props:{category:{type:String,default:null},organization:{type:String,default:null},owner:{type:String,default:null},user:{type:[String,Number],default:null},period:{type:String,default:null},status:{type:String,default:null}},setup(c){const r=c,n=e.ref([]),t=e.ref(!0),s=e.ref(0),m=e.ref(5);return e.onMounted(async()=>{const a=await f.read({skip:s.value,limit:m.value,sortOrder:"desc",category:r.category,user:r.user,owner:r.owner,organization:r.organization,period:r.period,status:r.status});n.value=a,t.value=!1}),(a,u)=>(e.openBlock(),e.createElementBlock("section",U,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[t.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(m.value,p=>(e.openBlock(),e.createBlock(L,{key:p}))),128)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!t.value&&n.value.length<1?(e.openBlock(),e.createBlock(V._sfc_main,{key:0,title:"No Events Today",description:"Today, are no events available. Please check back later.",class:"pd-medium mn-thin bg-grey radius-big"})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"container"},{default:e.withCtx(()=>[!t.value&&n.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.value,(p,_)=>(e.openBlock(),e.createBlock(f._sfc_main$1,{onClick:v=>a.$router.push({name:"Event",params:{url:p.url}}),key:p._id,event:p,owner:c.user,type:"short",class:e.normalizeClass(["pd-medium",{"br-b br-solid br-black-transp-10":_!==n.value.length-1}])},null,8,["onClick","event","owner","class"]))),128)):e.createCommentVNode("",!0)]),_:1})]))}},M=["onClick"],A={class:"t-transp"},J={__name:"DatePicker",props:["date","locale"],setup(c,{emit:r}){const n=c,t=e.ref(null);let s;if(n.date){const i=parseInt(n.date.substring(0,2)),h=parseInt(n.date.substring(2,4))-1,o=parseInt(n.date.substring(4));s=new Date(o,h,i),console.log("Data"+s)}else s=new Date,console.log("No data"+s);s.setHours(0,0,0,0);const m=e.ref(new Date(s)),a=v(s,30);e.onMounted(()=>{if(t.value){const i=t.value.getElementsByClassName("selected")[0]||t.value.getElementsByClassName("bg-main")[0];i&&(t.value.scrollLeft=i.offsetLeft-t.value.offsetWidth/2+i.offsetWidth/2)}});function u(i){m.value=i;const h=p(i);r("update:date",h)}function p(i){return`${i.getDate().toString().padStart(2,"0")}${(i.getMonth()+1).toString().padStart(2,"0")}${i.getFullYear()}`}function _(i){return i.toLocaleDateString(n.locale?n.locale:"en",{weekday:"narrow"}).toUpperCase()}function v(i,h){const o=[];for(let l=-15;l<h-15;l++){const d=new Date(i);d.setDate(i.getDate()+l),d.setHours(0,0,0,0),o.push(d)}return o}return(i,h)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{class:"w-100 o-scroll flex-nowrap flex",ref_key:"scrollContainer",ref:t,style:{"scroll-snap-type":"x mandatory"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),o=>(e.openBlock(),e.createElementBlock("div",{key:o.toString(),onClick:l=>u(o),class:e.normalizeClass([{selected:m.value.toDateString()===o.toDateString()},"cursor-pointer mn-r-small mn-l-small flex-column flex-center flex"])},[e.createElementVNode("span",A,e.toDisplayString(_(o)),1),e.createElementVNode("span",{class:e.normalizeClass([{"bg-main":m.value.toDateString()===o.toDateString()},"transition-ease-in-out t-semi flex-center flex radius-big i-semi day-number"])},e.toDisplayString(o.getDate()),3)],10,M))),128))],512)]))}},G={class:"pd-thin min-h-100vh"},H=e.createElementVNode("div",{class:"mn-thin br-solid br-1px br-grey bg-grey radius-big"},null,-1),W={class:""},C={__name:"layoutEvents",setup(c){const r=y.useRoute(),n=y.useRouter(),s=m(new Date);function m(a){return`${a.getDate().toString().padStart(2,"0")}${(a.getMonth()+1).toString().padStart(2,"0")}${a.getFullYear()}`}if(r.query){const a=r.query,u={tags:a.tags?a.tags.split(","):null,date:a.date?a.date:s};f.state.filter=u}else{const a={date:s};f.state.filter=a}return e.watch(()=>f.state.filter,(a,u)=>{const p={...r.query};Object.keys(u).forEach(v=>{p[v]&&delete p[v]});const _=Object.fromEntries(Object.entries(a).filter(([v,i])=>Array.isArray(i)&&i.length>0||typeof i=="string"&&i).map(([v,i])=>[v,Array.isArray(i)?i.join(","):i]));Object.assign(p,_),n.push({query:p})},{deep:!0}),(a,u)=>{const p=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",G,[e.createVNode(J,{date:f.state.filter.date,"onUpdate:date":u[0]||(u[0]=_=>f.state.filter.date=_),locale:a.$i18n.locale,class:"radius-small bg-grey pd-l-zero pd-r-zero pd-medium"},null,8,["date","locale"]),H,e.createElementVNode("section",W,[e.createVNode(p,null,{default:e.withCtx(({Component:_,route:v})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(_),{ref:"page",key:v.query}))]),_:2},1024)]),_:1})])])}}},Y={key:0,class:"pd-thin"},Q={class:"mn-thin radius-small w-100 h-10r bg-grey flex-center flex-column flex"},K=e.createElementVNode("h4",null,"Upload Event Cover",-1),X=e.createElementVNode("h3",{class:"mn-small"},"Date",-1),Z=e.createElementVNode("h3",{class:"mn-small"},"Description",-1),ee={key:0,class:"w-100 bg-grey pd-big radius-big"},te={key:1,class:"pd-thin pos-fixed pos-l-0 pos-b-0 w-100"},re={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},ae={class:"w-m-66r t-left pd-big bg-white radius-big"},ne=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),oe=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),se={key:0,class:"mn-thin"},le={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},S={__name:"EditEvent",setup(c){const r=y.useRoute(),n=y.useRouter();let t=e.ref(null),s=e.ref(null);const m=e.ref([]),a=e.ref(null);e.onMounted(async()=>{if(r.params.url){const l=await f.read({user:g.state.user._id,url:r.params.url});t.value=l.pop()}else f.clean(),t.value=f.state.current;t.value.owner||(t.value.owner={target:g.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:g.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(a.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo});const o=await q.actions.read({user:g.state.user._id,postable:g.state.user._id});s.value=o.map(l=>({name:l.profile.name,_id:l._id,photo:l.profile.photo}))});const u=e.ref(!1);function p(){u.value=!0}function _(){u.value=!1}function v(){m.value.length>0&&m.value.map(o=>o.text),t.value.status="draft",r.params.url?f.update(t.value).then(o=>{n.push({name:"Event",params:{url:o.url}})}).catch(o=>{console.error(o)}):f.create(t.value).then(o=>{n.push({name:"Event",params:{url:o.url}})}).catch(o=>{console.error(o)})}function i(){confirm("Are you sure you want to delete this event?")&&(void 0)(t.value._id).then(o=>{n.push({name:"Drafts"})}).catch(o=>{console.error(o)})}function h(){a.value&&(t.value.owner={target:a.value._id,type:"organization"}),a.value||(t.value.creator.hidden=!1),a.value||(t.value.organization=t.value.creator),t.value.status="published",console.log(t.value),r.params.url?f.update(t.value).then(o=>{n.push({name:"Blogevent",params:{url:o.url}})}).catch(o=>{console.log(o)}):f.create(t.value).then(o=>{n.push({name:"Blogevent",params:{url:o.url}})}).catch(o=>{console.log(o)})}return(o,l)=>e.unref(t)?(e.openBlock(),e.createElementBlock("article",Y,[e.createElementVNode("div",Q,[e.createVNode($._sfc_main,{photo:e.unref(t).cover,"onUpdate:photo":l[0]||(l[0]=d=>e.unref(t).cover=d),uploadPath:"users/"+g.state.user._id+"/events",class:"h-4r w-4r aspect-1x1 o-hidden mn-thin radius-extra"},null,8,["photo","uploadPath"]),K]),e.createVNode(g.Field,{field:e.unref(t).name,"onUpdate:field":l[1]||(l[1]=d=>e.unref(t).name=d),placeholder:"Event name",class:"mn-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(g.Field,{field:e.unref(t).description,"onUpdate:field":l[2]||(l[2]=d=>e.unref(t).description=d),type:"textfield",placeholder:"Enter short description",class:"mn-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),X,e.createVNode(g.Field,{field:e.unref(t).date.start,"onUpdate:field":l[3]||(l[3]=d=>e.unref(t).date.start=d),label:"Start",type:"datetime-local",placeholder:"Not specified",class:"mn-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(g.Field,{field:e.unref(t).date.end,"onUpdate:field":l[4]||(l[4]=d=>e.unref(t).date.end=d),label:"End",type:"datetime-local",placeholder:"Not specified",class:"mn-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),Z,e.unref(t)?(e.openBlock(),e.createElementBlock("section",ee,[e.createVNode(x._sfc_main,{content:e.unref(t).content,onUpdate:l[5]||(l[5]=d=>e.unref(t).content=d)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",te,[e.createElementVNode("div",re,[e.unref(r).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:l[6]||(l[6]=d=>i()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:l[7]||(l[7]=d=>v()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:l[8]||(l[8]=d=>p()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode(T._sfc_main,{title:"Добавить участника",onClosePopup:_,isPopupOpen:u.value},{default:e.withCtx(()=>[e.createElementVNode("div",ae,[ne,e.createVNode(E._sfc_main,{onTagsChanged:l[9]||(l[9]=d=>e.unref(t).tags=d),tags:e.unref(t).tags},null,8,["tags"]),oe,e.createVNode(E.SelectMulti,{modelValue:a.value,"onUpdate:modelValue":l[10]||(l[10]=d=>a.value=d),options:e.unref(s),multiple:!1,taggable:!1,placeholder:"Type to search or add tag",label:"name","track-by":"_id",class:"mn-medium bg-grey radius-medium pd-small"},null,8,["modelValue","options"]),a.value?(e.openBlock(),e.createElementBlock("h5",se,"Options:")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("div",le,[e.createVNode(E.Checkbox,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":l[11]||(l[11]=d=>e.unref(t).creator.hidden=d),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(g._sfc_main,{submit:h,callback:o.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])])]),_:1},8,["isPopupOpen"])])):e.createCommentVNode("",!0)}},N=Object.freeze(Object.defineProperty({__proto__:null,default:S},Symbol.toStringTag,{value:"Module"})),w=g.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),k=e.reactive({tickets:[],error:null}),B={async read({user:c,type:r,target:n,role:t}){try{const s=await w.get("/api/tickets",{params:{user:c,type:r,target:n,role:t}});return k.error=null,k.tickets=s.data,Promise.resolve(s.data)}catch(s){return b.setError(s),Promise.reject(s)}},async create(c){try{const r=await w.post("/api/tickets/create",c);return k.error=null,Promise.resolve(r.data)}catch(r){return b.setError(r),Promise.reject(r)}},async update(c){try{const r=await w.post("/api/tickets/update",c);return k.error=null,Promise.resolve(r.data)}catch(r){return b.setError(r),Promise.reject(r)}},async delete(c){try{const r=await w.post("/api/tickets/delete",c);return k.error=null,Promise.resolve(r.data)}catch(r){return b.setError(r),Promise.reject(r)}}},ie={handleTicketUpdate(c,r,n){let t;if(Array.isArray(c)?t=c.find(s=>s._id===r.target):typeof c=="object"&&c._id===r.target&&(t=c),t)if(t.hasTicket=n,n)t.tickets.push(r),t.numberOfTickets+=1;else{const s=t.tickets.findIndex(m=>m._id===r._id);s!==-1&&(t.tickets.splice(s,1),t.numberOfTickets-=1)}}};e.watch(k,c=>{});const ce={__name:"ButtonJoin",props:{type:{type:String,required:!0},userId:{type:String,required:!0},hasTicket:{type:Boolean,required:!0},targetId:{type:String,required:!0}},emits:["updateTicket"],setup(c,{emit:r}){const n=c,t=async()=>{n.hasTicket?await m(n.targetId):await s(n.targetId)};async function s(a){try{const u={type:n.type,target:a,user:n.userId},p=await B.create(u);r("updateTicket",{ticket:p,hasTicket:!0,targetId:n.targetId})}catch(u){throw console.log(u),u}}async function m(a){const u={type:n.type,target:a,user:n.userId};try{const p=await B.delete(u);r("updateTicket",{ticket:p,hasTicket:!1,targetId:n.targetId})}catch(p){throw console.log(p),p}}return(a,u)=>(e.openBlock(),e.createBlock(g._sfc_main,{submit:t,class:"bg-main button-small button"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(c.hasTicket?"Leave":"Join"),1)]),_:1}))}},ue=g._export_sfc(ce,[["__scopeId","data-v-d5c351bb"]]),de={class:"pd-thin"},D={__name:"Event",setup(c){const r=y.useRoute(),n=({ticket:m,hasTicket:a,targetId:u})=>{ie.handleTicketUpdate(t.value,m,a,u)},t=e.ref(null),s=e.ref(!0);return e.onMounted(async()=>{s.value=!0;const m=await f.read({user:g.state.user._id,url:r.params.url});t.value=m[0],s.value=!1}),(m,a)=>(e.openBlock(),e.createElementBlock("section",de,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},e.renderList(3,u=>e.createVNode(f.SkeletonEvent,{key:u})),64)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!s.value&&!t.value?(e.openBlock(),e.createBlock(V._sfc_main,{key:0,title:"No Event Found",description:"Currently, there are no events available. Please check back later.",class:"pd-medium mn-thin bg-grey radius-big"})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"container"},{default:e.withCtx(()=>[!s.value&&t.value?(e.openBlock(),e.createBlock(f._sfc_main$1,{key:0,onClick:a[0]||(a[0]=u=>m.$router.push({name:"Event",params:{url:t.value.url}})),event:t.value,owner:t.value.owner,user:g.state.user._id,type:"normal",class:e.normalizeClass(["mn-medium",{"br-b br-solid br-black-transp-10":m.index!==t.value.length-1}])},{default:e.withCtx(()=>[g.state.user._id?(e.openBlock(),e.createBlock(ue,{key:0,type:"event",hasTicket:t.value.hasTicket,targetId:t.value._id,userId:g.state.user._id,class:"mn-small w-100 pd-medium mn-auto",onUpdateTicket:n},null,8,["hasTicket","targetId","userId"])):e.createCommentVNode("",!0)]),_:1},8,["event","owner","user","class"])):e.createCommentVNode("",!0),!s.value&&t.value?(e.openBlock(),e.createBlock(x._sfc_main$1,{key:1,type:"event",target:t.value._id,owner:g.state.user._id},null,8,["target","owner"])):e.createCommentVNode("",!0)]),_:1})]))}},pe=Object.freeze(Object.defineProperty({__proto__:null,default:D},Symbol.toStringTag,{value:"Module"})),P={__name:"Events",setup(c){const r=y.useRoute();return y.useRouter(),(n,t)=>(e.openBlock(),e.createElementBlock("section",null,[e.createVNode(f._sfc_main,{category:e.unref(r).params.category,user:g.state.user._id,period:e.unref(r).query.period,selectedDate:f.state.filter.date},null,8,["category","user","period","selectedDate"])]))}},me=Object.freeze(Object.defineProperty({__proto__:null,default:P},Symbol.toStringTag,{value:"Module"})),fe=[{path:"events",component:C,meta:{title:{en:"Events",ru:"События"}},children:[{path:":category?",name:"Events",component:()=>Promise.resolve().then(()=>me)}]},{path:"events/create",name:"Create Event",meta:{title:{en:"Create Event",ru:"Создать Событие"},authorize:[]},component:()=>Promise.resolve().then(()=>N)},{path:"events/:url",name:"Event",meta:{title:{en:"Event",ru:"Событие"}},component:()=>Promise.resolve().then(()=>pe)},{path:"events/:url/edit",name:"Edit Event",meta:{authorize:[]},component:()=>Promise.resolve().then(()=>N)}];exports.CardEvent=f._sfc_main$1;exports.Feed=f._sfc_main;exports.eventsStore=f.events;exports.EditEvent=S;exports.EventPage=D;exports.EventsLayout=C;exports.EventsPage=P;exports.List=R;exports.eventsRoutes=fe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("./Feed-eeb63363.js"),e=require("vue"),V=require("./EmptyState-7658d7d6.js"),v=require("./auth-2bc18d1e.js"),y=require("vue-router"),E=require("./Breadcrumbs.vue_vue_type_style_index_0_lang-300fcb55.js"),B=require("./Image-30f04604.js"),P=require("./Popup-7c331e1c.js"),$=require("./UploadImage-9e7e7468.js"),q=require("./organizations-c455dad7.js"),b=require("./globals-928eb13c.js");require("vue-i18n");require("./CardHeader-0677d446.js");require("./PlaceholderUserpic-10fd9026.js");require("./vue-draggable-next.esm-bundler-80731ae0.js");const I={},L={width:"100%",height:"50",xmlns:"http://www.w3.org/2000/svg"},O=e.createStaticVNode('<rect x="0" y="0" width="100%" height="100%" fill="rgb(var(--grey))"></rect><rect x="15" y="15" rx="3" ry="3" width="40" height="20" fill="rgba(var(--black),0.05)"></rect><rect x="65" y="15" rx="3" ry="3" width="150" height="20" fill="rgba(var(--black),0.05)"></rect><circle cx="250" cy="25" r="10" fill="rgba(var(--black),0.1)"></circle><circle cx="265" cy="25" r="10" fill="rgba(var(--black),0.05)"></circle><circle cx="280" cy="25" r="10" fill="rgba(var(--black),0.025)"></circle><rect x="-25%" y="0" width="25%" height="100%" fill="#fff" opacity="0.3"><animate attributeName="x" from="-25%" to="100%" dur="2s" repeatCount="indefinite"></animate></rect>',7),U=[O];function F(p,r){return e.openBlock(),e.createElementBlock("svg",L,U)}const j=v._export_sfc(I,[["render",F]]);const z={class:"today-events"},M={__name:"List",props:{category:{type:String,default:null},organization:{type:String,default:null},owner:{type:String,default:null},user:{type:[String,Number],default:null},period:{type:String,default:null},status:{type:String,default:null}},setup(p){const r=p,n=e.ref([]),t=e.ref(!0),i=e.ref(0),c=e.ref(5);return e.onMounted(async()=>{const a=await g.read({skip:i.value,limit:c.value,sortOrder:"desc",category:r.category,user:r.user,owner:r.owner,organization:r.organization,period:r.period,status:r.status});n.value=a,t.value=!1}),(a,o)=>(e.openBlock(),e.createElementBlock("section",z,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[t.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(c.value,d=>(e.openBlock(),e.createBlock(j,{key:d}))),128)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!t.value&&n.value.length<1?(e.openBlock(),e.createBlock(V._sfc_main,{key:0,title:"No Events Today",description:"Today, are no events available. Please check back later.",class:"pd-medium mn-thin bg-grey radius-big"})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"container"},{default:e.withCtx(()=>[!t.value&&n.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.value,(d,f)=>(e.openBlock(),e.createBlock(g._sfc_main$1,{onClick:_=>a.$router.push({name:"Event",params:{url:d.url}}),key:d._id,event:d,owner:p.user,type:"short",class:e.normalizeClass(["pd-medium",{"br-b br-solid br-black-transp-10":f!==n.value.length-1}])},null,8,["onClick","event","owner","class"]))),128)):e.createCommentVNode("",!0)]),_:1})]))}},R=["onClick"],A={class:"t-transp"},H={__name:"DatePicker",props:["date","locale"],setup(p,{emit:r}){const n=p,t=e.ref(null);let i;if(n.date){const u=parseInt(n.date.substring(0,2)),h=parseInt(n.date.substring(2,4))-1,s=parseInt(n.date.substring(4));i=new Date(s,h,u),console.log("Data"+i)}else i=new Date,console.log("No data"+i);i.setHours(0,0,0,0);const c=e.ref(new Date(i)),a=_(i,30);e.onMounted(()=>{if(t.value){const u=t.value.getElementsByClassName("selected")[0]||t.value.getElementsByClassName("bg-main")[0];u&&(t.value.scrollLeft=u.offsetLeft-t.value.offsetWidth/2+u.offsetWidth/2)}});function o(u){c.value=u;const h=d(u);r("update:date",h)}function d(u){return`${u.getDate().toString().padStart(2,"0")}${(u.getMonth()+1).toString().padStart(2,"0")}${u.getFullYear()}`}function f(u){return u.toLocaleDateString(n.locale?n.locale:"en",{weekday:"narrow"}).toUpperCase()}function _(u,h){const s=[];for(let l=-15;l<h-15;l++){const m=new Date(u);m.setDate(u.getDate()+l),m.setHours(0,0,0,0),s.push(m)}return s}return(u,h)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{class:"w-100 o-scroll flex-nowrap flex",ref_key:"scrollContainer",ref:t,style:{"scroll-snap-type":"x mandatory"}},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(a),s=>(e.openBlock(),e.createElementBlock("div",{key:s.toString(),onClick:l=>o(s),class:e.normalizeClass([{selected:c.value.toDateString()===s.toDateString()},"cursor-pointer mn-r-small mn-l-small flex-column flex-center flex"])},[e.createElementVNode("span",A,e.toDisplayString(f(s)),1),e.createElementVNode("span",{class:e.normalizeClass([{"bg-main":c.value.toDateString()===s.toDateString()},"transition-ease-in-out t-semi flex-center flex radius-big i-semi day-number"])},e.toDisplayString(s.getDate()),3)],10,R))),128))],512)]))}},J={class:"pd-thin min-h-100vh"},G=e.createElementVNode("div",{class:"mn-thin br-solid br-1px br-grey bg-grey radius-big"},null,-1),W={class:""},C={__name:"layoutEvents",setup(p){const r=y.useRoute(),n=y.useRouter(),i=c(new Date);function c(a){return`${a.getDate().toString().padStart(2,"0")}${(a.getMonth()+1).toString().padStart(2,"0")}${a.getFullYear()}`}if(r.query){const a=r.query,o={tags:a.tags?a.tags.split(","):null,date:a.date?a.date:i};g.state.filter=o}else{const a={date:i};g.state.filter=a}return e.watch(()=>g.state.filter,(a,o)=>{const d={...r.query};Object.keys(o).forEach(_=>{d[_]&&delete d[_]});const f=Object.fromEntries(Object.entries(a).filter(([_,u])=>Array.isArray(u)&&u.length>0||typeof u=="string"&&u).map(([_,u])=>[_,Array.isArray(u)?u.join(","):u]));Object.assign(d,f),n.push({query:d})},{deep:!0}),(a,o)=>{const d=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",J,[e.createVNode(H,{date:g.state.filter.date,"onUpdate:date":o[0]||(o[0]=f=>g.state.filter.date=f),locale:a.$i18n.locale,class:"radius-small bg-grey pd-l-zero pd-r-zero pd-medium"},null,8,["date","locale"]),G,e.createElementVNode("section",W,[e.createVNode(d,null,{default:e.withCtx(({Component:f,route:_})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(f),{ref:"page",key:_.query}))]),_:2},1024)]),_:1})])])}}},Y={key:0,class:"pd-thin"},Q={class:"mn-thin radius-small w-100 h-10r bg-grey flex-center flex-column flex"},K=e.createElementVNode("h4",null,"Upload Event Cover",-1),X=e.createElementVNode("h3",{class:"mn-small"},"Date",-1),Z=e.createElementVNode("h3",{class:"mn-small"},"Description",-1),ee={key:0,class:"pd-b-extra w-100 bg-grey pd-big radius-big"},te={key:1,class:"pd-thin pos-fixed pos-l-0 pos-b-0 w-100"},re={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},ae={class:"w-m-66r t-left pd-big bg-white radius-big"},ne=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),oe=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),se={key:0,class:"mn-thin"},le={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},D={__name:"EditEvent",setup(p){const r=y.useRoute(),n=y.useRouter();let t=e.ref(null),i=e.ref(null);const c=e.ref([]),a=e.ref(null);e.onMounted(async()=>{if(r.params.url){const l=await g.read({user:v.state.user._id,url:r.params.url});t.value=l.pop(),t.value.date.start=t.value.date.start.slice(0,16),t.value.date.end=t.value.date.end.slice(0,16)}else g.clean(),t.value=g.state.current;t.value.owner||(t.value.owner={target:v.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:v.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(a.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo});const s=await q.actions.read({user:v.state.user._id,postable:v.state.user._id,limit:100});i.value=s.map(l=>({name:l.profile.name,_id:l._id,photo:l.profile.photo}))});const o=e.ref(!1);function d(){o.value=!0}function f(){o.value=!1}function _(){c.value.length>0&&c.value.map(s=>s.text),t.value.status="draft",r.params.url?g.update(t.value).then(s=>{n.push({name:"Event",params:{url:s.url}})}).catch(s=>{console.error(s)}):g.create(t.value).then(s=>{n.push({name:"Event",params:{url:s.url}})}).catch(s=>{console.error(s)})}function u(){confirm("Are you sure you want to delete this event?")&&(void 0)(t.value._id).then(s=>{n.push({name:"Drafts"})}).catch(s=>{console.error(s)})}function h(){a.value&&(t.value.owner={target:a.value._id,type:"organization"}),a.value||(t.value.creator.hidden=!1),a.value||(t.value.organization=t.value.creator),t.value.status="published",console.log(t.value),r.params.url?g.update(t.value).then(s=>{n.push({name:"Blogevent",params:{url:s.url}})}).catch(s=>{console.log(s)}):g.create(t.value).then(s=>{n.push({name:"Event",params:{url:s.url}})}).catch(s=>{console.log(s)})}return(s,l)=>e.unref(t)?(e.openBlock(),e.createElementBlock("article",Y,[e.createElementVNode("div",Q,[e.createVNode($._sfc_main,{photo:e.unref(t).cover,"onUpdate:photo":l[0]||(l[0]=m=>e.unref(t).cover=m),uploadPath:"users/"+v.state.user._id+"/events",class:"h-4r w-4r aspect-1x1 o-hidden mn-thin radius-extra"},null,8,["photo","uploadPath"]),K]),e.createVNode(v.Field,{field:e.unref(t).name,"onUpdate:field":l[1]||(l[1]=m=>e.unref(t).name=m),placeholder:"Event name",class:"mn-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(v.Field,{field:e.unref(t).description,"onUpdate:field":l[2]||(l[2]=m=>e.unref(t).description=m),type:"textfield",placeholder:"Enter short description",class:"mn-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),X,e.createTextVNode(" "+e.toDisplayString(e.unref(t).date.start)+" ",1),e.createVNode(v.Field,{field:e.unref(t).date.start,"onUpdate:field":l[3]||(l[3]=m=>e.unref(t).date.start=m),label:"Start",type:"datetime-local",placeholder:"Not specified",class:"mn-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(v.Field,{field:e.unref(t).date.end,"onUpdate:field":l[4]||(l[4]=m=>e.unref(t).date.end=m),label:"End",type:"datetime-local",placeholder:"Not specified",class:"mn-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),Z,e.unref(t)?(e.openBlock(),e.createElementBlock("section",ee,[e.createVNode(B._sfc_main,{content:e.unref(t).content,onUpdate:l[5]||(l[5]=m=>e.unref(t).content=m)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",te,[e.createElementVNode("div",re,[e.unref(r).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:l[6]||(l[6]=m=>u()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:l[7]||(l[7]=m=>_()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:l[8]||(l[8]=m=>d()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode(P._sfc_main,{title:"Добавить участника",onClosePopup:f,isPopupOpen:o.value},{default:e.withCtx(()=>[e.createElementVNode("div",ae,[ne,e.createVNode(E._sfc_main,{onTagsChanged:l[9]||(l[9]=m=>e.unref(t).tags=m),tags:e.unref(t).tags},null,8,["tags"]),oe,e.createVNode(E.SelectMulti,{modelValue:a.value,"onUpdate:modelValue":l[10]||(l[10]=m=>a.value=m),options:e.unref(i),multiple:!1,taggable:!1,placeholder:"Type to search or add tag",label:"name","track-by":"_id",class:"mn-medium bg-grey radius-medium pd-small"},null,8,["modelValue","options"]),a.value?(e.openBlock(),e.createElementBlock("h5",se,"Options:")):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("div",le,[e.createVNode(E.Checkbox,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":l[11]||(l[11]=m=>e.unref(t).creator.hidden=m),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(v._sfc_main,{submit:h,callback:s.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])])]),_:1},8,["isPopupOpen"])])):e.createCommentVNode("",!0)}},N=Object.freeze(Object.defineProperty({__proto__:null,default:D},Symbol.toStringTag,{value:"Module"})),w=v.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),k=e.reactive({tickets:[],error:null}),x={async read({user:p,type:r,target:n,role:t}){try{const i=await w.get("/api/tickets",{params:{user:p,type:r,target:n,role:t}});return k.error=null,k.tickets=i.data,Promise.resolve(i.data)}catch(i){return b.setError(i),Promise.reject(i)}},async create(p){try{const r=await w.post("/api/tickets/create",p);return k.error=null,Promise.resolve(r.data)}catch(r){return b.setError(r),Promise.reject(r)}},async update(p){try{const r=await w.post("/api/tickets/update",p);return k.error=null,Promise.resolve(r.data)}catch(r){return b.setError(r),Promise.reject(r)}},async delete(p){try{const r=await w.post("/api/tickets/delete",p);return k.error=null,Promise.resolve(r.data)}catch(r){return b.setError(r),Promise.reject(r)}}},ie={handleTicketUpdate(p,r,n){let t;if(Array.isArray(p)?t=p.find(i=>i._id===r.target):typeof p=="object"&&p._id===r.target&&(t=p),t)if(t.hasTicket=n,n)t.tickets.push(r),t.numberOfTickets+=1;else{const i=t.tickets.findIndex(c=>c._id===r._id);i!==-1&&(t.tickets.splice(i,1),t.numberOfTickets-=1)}}};e.watch(k,p=>{});const ce={__name:"ButtonJoin",props:{type:{type:String,required:!0},userId:{type:String,required:!0},hasTicket:{type:Boolean,required:!0},targetId:{type:String,required:!0}},emits:["updateTicket"],setup(p,{emit:r}){const n=p,t=async()=>{n.hasTicket?await c(n.targetId):await i(n.targetId)};async function i(a){try{const o={type:n.type,target:a,user:n.userId},d=await x.create(o);r("updateTicket",{ticket:d,hasTicket:!0,targetId:n.targetId})}catch(o){throw console.log(o),o}}async function c(a){const o={type:n.type,target:a,user:n.userId};try{const d=await x.delete(o);r("updateTicket",{ticket:d,hasTicket:!1,targetId:n.targetId})}catch(d){throw console.log(d),d}}return(a,o)=>(e.openBlock(),e.createBlock(v._sfc_main,{submit:t,class:"bg-main button-small button"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(p.hasTicket?"Leave":"Join"),1)]),_:1}))}},ue=v._export_sfc(ce,[["__scopeId","data-v-d5c351bb"]]),de={class:"pd-thin"},S={__name:"Event",setup(p){const r=y.useRoute(),n=({ticket:o,hasTicket:d,targetId:f})=>{ie.handleTicketUpdate(c.value,o,d,f)},t={Textarea:"p",H2:"h2",Bullets:"p",Caption:"p",ImageUpload:B._sfc_main$2};function i(o){return o.type==="Textarea"?{innerHTML:o.content,class:"p-medium"}:o.type==="H2"?{innerHTML:o.content,class:"h3"}:o.type==="Caption"?{innerHTML:o.content}:o.type==="ImageUpload"?{src:o.content}:{}}const c=e.ref(null),a=e.ref(!0);return e.onMounted(async()=>{a.value=!0;const o=await g.read({user:v.state.user._id,url:r.params.url});c.value=o[0],a.value=!1}),(o,d)=>(e.openBlock(),e.createElementBlock("section",de,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},e.renderList(3,f=>e.createVNode(g.SkeletonEvent,{key:f})),64)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!a.value&&!c.value?(e.openBlock(),e.createBlock(V._sfc_main,{key:0,title:"No Event Found",description:"Currently, there are no events available. Please check back later.",class:"pd-medium mn-thin bg-grey radius-big"})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"container"},{default:e.withCtx(()=>[!a.value&&c.value?(e.openBlock(),e.createBlock(g._sfc_main$1,{key:0,onClick:d[0]||(d[0]=f=>o.$router.push({name:"Event",params:{url:c.value.url}})),event:c.value,owner:c.value.owner,user:v.state.user._id,type:"normal",class:"mn-medium bg-grey radius-big"},{default:e.withCtx(()=>[v.state.user._id?(e.openBlock(),e.createBlock(ue,{key:0,type:"event",hasTicket:c.value.hasTicket,targetId:c.value._id,userId:v.state.user._id,class:"mn-small w-100 pd-medium mn-auto",onUpdateTicket:n},null,8,["hasTicket","targetId","userId"])):e.createCommentVNode("",!0),e.createElementVNode("section",null,[c.value&&c.value.content?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(c.value.content,(f,_)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t[f.type]),e.mergeProps({key:_,index:_,component:f,prop:f,class:f.class,content:"content"},i(f),{class:"mn-regular"}),null,16,["index","component","prop","class"]))),128)):e.createCommentVNode("",!0)])]),_:1},8,["event","owner","user"])):e.createCommentVNode("",!0),!a.value&&c.value?(e.openBlock(),e.createBlock(B._sfc_main$1,{key:1,type:"event",target:c.value._id,owner:v.state.user._id},null,8,["target","owner"])):e.createCommentVNode("",!0)]),_:1})]))}},pe=Object.freeze(Object.defineProperty({__proto__:null,default:S},Symbol.toStringTag,{value:"Module"})),T={__name:"Events",setup(p){const r=y.useRoute();return y.useRouter(),(n,t)=>(e.openBlock(),e.createElementBlock("section",null,[e.createVNode(g._sfc_main,{category:e.unref(r).params.category,user:v.state.user._id,period:e.unref(r).query.period,selectedDate:g.state.filter.date},null,8,["category","user","period","selectedDate"])]))}},me=Object.freeze(Object.defineProperty({__proto__:null,default:T},Symbol.toStringTag,{value:"Module"})),fe=[{path:"events",component:C,meta:{title:{en:"Events",ru:"События"}},children:[{path:":category?",name:"Events",component:()=>Promise.resolve().then(()=>me)}]},{path:"events/create",name:"Create Event",meta:{title:{en:"Create Event",ru:"Создать Событие"},authorize:[]},component:()=>Promise.resolve().then(()=>N)},{path:"events/:url",name:"Event",meta:{title:{en:"Event",ru:"Событие"}},component:()=>Promise.resolve().then(()=>pe)},{path:"events/:url/edit",name:"Edit Event",meta:{authorize:[]},component:()=>Promise.resolve().then(()=>N)}];exports.CardEvent=g._sfc_main$1;exports.Feed=g._sfc_main;exports.eventsStore=g.events;exports.EditEvent=D;exports.EventPage=S;exports.EventsLayout=C;exports.EventsPage=T;exports.List=M;exports.eventsRoutes=fe;