@ozdao/prometheus-framework 0.0.85 → 0.0.87

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-15e71ec4.js +1 -0
  2. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-628f013e.mjs +138 -0
  3. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-cdbafd07.mjs +1944 -0
  4. package/dist/ButtonFollow-728aab73.mjs +130 -0
  5. package/dist/CardHeader-ce5a1a75.mjs +96 -0
  6. package/dist/CardOrganization-58b54995.js +1 -0
  7. package/dist/CardOrganization-91e79698.mjs +320 -0
  8. package/dist/CardOrganization-ee5c34ab.js +1 -0
  9. package/dist/CardOrganization-f70bd169.mjs +202 -0
  10. package/dist/Comments-63f154a6.js +9 -0
  11. package/dist/Comments-c092550f.mjs +76 -0
  12. package/dist/Comments-c5afa4d6.mjs +459 -0
  13. package/dist/EditProductImages-61ff4321.mjs +236 -0
  14. package/dist/Feed-8fd41524.js +1 -0
  15. package/dist/Feed-926cf4f3.mjs +355 -0
  16. package/dist/Feed-a31c43c2.mjs +423 -0
  17. package/dist/Feed-ecf37814.mjs +367 -0
  18. package/dist/IconEdit-736c89be.js +1 -0
  19. package/dist/IconEdit-e9fd4c6c.mjs +21 -0
  20. package/dist/PlaceholderUserpic-995da0fc.mjs +28 -0
  21. package/dist/Popup-0c791801.mjs +76 -0
  22. package/dist/Popup-105ef2c3.js +1 -0
  23. package/dist/Popup-82fb2c8a.mjs +76 -0
  24. package/dist/Product-2f3d592f.mjs +837 -0
  25. package/dist/Product-2fbf9d99.js +7 -0
  26. package/dist/Product-6c37ef35.js +7 -0
  27. package/dist/Product-7087b358.mjs +837 -0
  28. package/dist/ProductEdit-20709821.mjs +349 -0
  29. package/dist/ProductEdit-a81d13b9.js +1 -0
  30. package/dist/ProductEdit-c5067942.mjs +113 -0
  31. package/dist/ProfileBlogposts-79d5c858.mjs +63 -0
  32. package/dist/ProfileBlogposts-eca9916c.js +1 -0
  33. package/dist/ProfileBlogposts-fb014bc6.mjs +63 -0
  34. package/dist/ProfileComments-48f3d4bc.mjs +43 -0
  35. package/dist/ProfileComments-58094a50.mjs +43 -0
  36. package/dist/ProfileComments-b919f021.js +1 -0
  37. package/dist/ProfileEvents-05485e20.js +1 -0
  38. package/dist/ProfileEvents-20695376.mjs +55 -0
  39. package/dist/ProfileEvents-5d206e3d.mjs +55 -0
  40. package/dist/ProfileLikes-2f3a4488.js +1 -0
  41. package/dist/ProfileLikes-503712ec.mjs +43 -0
  42. package/dist/ProfileLikes-b5ac7f48.mjs +43 -0
  43. package/dist/ProfileOrganizations-0b76e38f.js +1 -0
  44. package/dist/ProfileOrganizations-32ab1e30.mjs +211 -0
  45. package/dist/ProfileOrganizations-3f305f4e.mjs +210 -0
  46. package/dist/ProfileOrganizations-50fce34e.js +1 -0
  47. package/dist/Publics-3f277c17.js +1 -0
  48. package/dist/Publics-49dbeafc.js +1 -0
  49. package/dist/Publics-9ebffff1.mjs +122 -0
  50. package/dist/Publics-b0fad2b0.mjs +1926 -0
  51. package/dist/Tab-58cd105f.mjs +46 -0
  52. package/dist/Tab-6f0a4909.js +1 -0
  53. package/dist/UploadImage-441e8526.js +1 -0
  54. package/dist/UploadImage-d1dbc280.mjs +99 -0
  55. package/dist/UploadImage-ff8f9a0c.mjs +83 -0
  56. package/dist/auth-35ef1791.mjs +1502 -0
  57. package/dist/auth.client.cjs +2 -2
  58. package/dist/auth.client.js +61 -41
  59. package/dist/auth.validation-29113f37.mjs +20 -0
  60. package/dist/categories-d669f3af.mjs +225 -0
  61. package/dist/community.client.cjs +1 -9
  62. package/dist/community.client.js +369 -741
  63. package/dist/community.server.js +16 -4
  64. package/dist/community.server.mjs +16 -4
  65. package/dist/events.client.cjs +1 -1
  66. package/dist/events.client.js +433 -331
  67. package/dist/events.server.js +19 -2
  68. package/dist/events.server.mjs +19 -2
  69. package/dist/inputs.validation-24ae76b9.js +1 -0
  70. package/dist/modules/constructor/components/elements/Bullets.vue.d.ts +15 -0
  71. package/dist/modules/constructor/components/elements/Caption.vue.d.ts +15 -0
  72. package/dist/modules/constructor/components/elements/H2.vue.d.ts +16 -0
  73. package/dist/modules/constructor/components/elements/Image.vue.d.ts +8 -0
  74. package/dist/modules/constructor/components/elements/ImageUpload.vue.d.ts +9 -0
  75. package/dist/modules/constructor/components/elements/Textarea.vue.d.ts +12 -0
  76. package/dist/modules/constructor/components/sections/Constructor.vue.d.ts +7 -0
  77. package/dist/modules/events/components/sections/Feed.vue.d.ts +1 -0
  78. package/dist/modules/icons/entities/IconCommunity.vue.d.ts +2 -0
  79. package/dist/organizations-1b4c84ee.mjs +121 -0
  80. package/dist/organizations-af43bda4.js +1 -0
  81. package/dist/organizations.client-253c8068.mjs +3179 -0
  82. package/dist/organizations.client-c60d7659.js +3 -0
  83. package/dist/organizations.client.cjs +1 -3
  84. package/dist/organizations.client.js +50 -3026
  85. package/dist/organizations.server.js +1 -1
  86. package/dist/organizations.server.mjs +1 -1
  87. package/dist/style.css +1 -1
  88. package/dist/users.client.cjs +1 -1
  89. package/dist/users.client.js +245 -208
  90. package/package.json +1 -1
  91. package/src/modules/auth/router/auth.js +28 -7
  92. package/src/modules/community/community.client.js +1 -12
  93. package/src/modules/community/components/pages/BlogPost.vue +1 -1
  94. package/src/modules/community/components/pages/CreateBlogPost.vue +8 -151
  95. package/src/modules/community/middlewares/server/verifyBlogpost.js +24 -11
  96. package/src/modules/{community → constructor}/components/elements/Textarea.vue +3 -11
  97. package/src/modules/constructor/components/sections/Constructor.vue +167 -0
  98. package/src/modules/events/components/blocks/CardEvent.vue +14 -6
  99. package/src/modules/events/components/pages/EditEvent.vue +228 -133
  100. package/src/modules/events/components/sections/Feed.vue +7 -1
  101. package/src/modules/events/controllers/events.controller.js +9 -0
  102. package/src/modules/events/controllers/tickets.controller.js +2 -1
  103. package/src/modules/events/models/event.model.js +10 -0
  104. package/src/modules/events/store/events.js +15 -19
  105. package/src/modules/icons/entities/IconCommunity.vue +8 -0
  106. package/src/modules/organizations/components/blocks/CardOrganization.vue +3 -5
  107. package/src/modules/organizations/components/sections/Publics.vue +3 -3
  108. package/src/modules/organizations/controllers/organizations.controller.js +1 -1
  109. package/src/modules/organizations/organizations.client.js +0 -2
  110. package/src/modules/users/components/pages/Profile.vue +15 -4
  111. package/src/modules/users/components/pages/ProfileEvents.vue +3 -3
  112. package/src/modules/organizations/components/blocks/CardOrganizationSocial.vue +0 -46
  113. /package/src/modules/{community → constructor}/components/elements/Bullets.vue +0 -0
  114. /package/src/modules/{community → constructor}/components/elements/Caption.vue +0 -0
  115. /package/src/modules/{community → constructor}/components/elements/H2.vue +0 -0
  116. /package/src/modules/{community → constructor}/components/elements/Image.vue +0 -0
  117. /package/src/modules/{community → constructor}/components/elements/ImageUpload.vue +0 -0
@@ -1,9 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),B=require("vue-router"),D=require("./Breadcrumbs.vue_vue_type_style_index_0_lang-c6f3a0f0.js"),g=require("./Feed-55c5907a.js"),_=require("./auth-5aa8e90c.js"),X=require("./Popup-9479e39a.js"),S=require("./Publics-c9d5aa74.js"),Y=require("./vue-draggable-next.esm-bundler-80731ae0.js"),Z=require("./CardOrganization-0291683b.js"),ee=require("./EmptyState-7658d7d6.js"),F=require("./Comments-1aec0e5e.js"),te=require("vue-i18n");require("./globals-928eb13c.js");require("./CardHeader-925a972b.js");require("./PlaceholderUserpic-d64d6dd5.js");require("./ButtonFollow-2ce169ca.js");const oe={class:"min-h-100vh pd-thin"},ne={class:"mn-thin flex-v-center t-left flex-nowrap flex"},le={class:"flex-v-center flex-nowrap flex t-left"},ae=e.createElementVNode("span",{class:""},"Topics for ",-1),re={class:"bg-grey pd-medium radius-big mn-semi flex-nowrap flex"},se={class:""},U={__name:"Community",setup(a){const r=B.useRoute(),o=B.useRouter();return(t,s)=>{const u=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",oe,[e.createElementVNode("header",ne,[e.createElementVNode("h2",le,[ae,e.createVNode(D.Select,{options:["today","week","month","year"],select:g.state.filter.period,"onUpdate:select":s[0]||(s[0]=n=>g.state.filter.period=n),placeholder:"Select type",class:"w-max mn-l-small bg-grey pd-thin radius-medium h2 t-center t-black"},null,8,["select"])])]),e.createElementVNode("ul",re,[e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="featured"},"mn-r-small t-medium pd-small radius-small"]),onClick:s[1]||(s[1]=n=>e.unref(o).push({name:"Blog"}))},"👑 Featured",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="popular"},"mn-r-small t-medium pd-small radius-small"]),onClick:s[2]||(s[2]=n=>e.unref(o).push({name:"Blog",params:{category:"popular"}}))},"🔥 Popular",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="new"},"mn-r-small t-medium pd-small radius-small"]),onClick:s[3]||(s[3]=n=>e.unref(o).push({name:"Blog",params:{category:"new"}}))},"🆕 New",2),_.state.user._id?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="following"},"t-medium pd-small radius-small"]),onClick:s[4]||(s[4]=n=>e.unref(o).push({name:"Blog",params:{category:"following"}}))},"👥 Following",2)):e.createCommentVNode("",!0)]),e.createElementVNode("section",se,[e.createVNode(u,null,{default:e.withCtx(({Component:n,route:c})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n),{ref:"page",key:c.query}))]),_:2},1024)]),_:1})])])}}};const ce=["placeholder"],I={__name:"Textarea",props:["obj","label","prop","value","content","textarea","placeholder","index","ref","setFocus"],emits:["deleteBlock","updateBlock","addBlock","focus"],setup(a,{emit:r}){const o=a;e.ref(o);const t=e.ref(null);e.ref(0);function s(l){let i=l.target.value.split(/\n+/);if(i.length>1){o.prop[o.content]=i[0],e.nextTick(()=>{c()});let m=i.slice(1).map(h=>({__name:"Textarea",content:h}));r("addBlock","Textarea","",o.index,{blocks:m,ref:t})}else l.target.value.trim()===""&&l.target.value.includes(`
2
-
3
- `)&&(console.log("We are adding new block:"+o.index+newBlocks+t),r("addBlock","Textarea","",o.index,{blocks:newBlocks,ref:t})),c()}function u(l){(l.keyCode===8||l.keyCode===46)&&o.prop[o.content].trim()===""&&r("deleteBlock",o.prop)}function n(){e.nextTick(()=>{t.value.focus(),r("updateBlock",o.prop,{setFocus:!1})})}function c(){t.value.style.height="1rem",t.value.style.height=t.value.scrollHeight+"px"}return e.onUpdated(()=>{o.setFocus&&e.nextTick(()=>{n()}),c()}),e.onMounted(()=>{o.setFocus&&e.nextTick(()=>{n()}),c()}),e.watch(()=>o.prop[o.content],l=>{}),(l,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":i[0]||(i[0]=m=>a.prop[a.content]=m),placeholder:a.placeholder?a.placeholder:"Enter text",onInput:s,onFocus:i[1]||(i[1]=m=>r("focus",t.value)),onKeyup:u,ref_key:"textarea",ref:t,class:"text-area mn-thin"},`
4
- `,40,ce),[[e.vModelText,a.prop[a.content]]])]))}};const ie=["placeholder"],z={__name:"H2",props:["obj","label","prop","value","content","textarea","placeholder","index","ref","setFocus"],emits:["deleteBlock","updateBlock","addBlock","focus"],setup(a,{emit:r}){const o=a;e.ref(o);const t=e.ref(null);e.ref(0);function s(l){let i=l.target.value.split(/\n+/);if(i.length>1){o.prop[o.content]=i[0],e.nextTick(()=>{c()});let m=i.slice(1).map(h=>({type:"Textarea",content:h}));r("addBlock","Textarea","",o.index,{blocks:m,ref:t})}else l.target.value.trim()===""&&l.target.value.includes(`
5
-
6
- `)&&(console.log("We are adding new block:"+o.index+newBlocks+t),r("addBlock","Textarea","",o.index,{blocks:newBlocks,ref:t})),c()}function u(l){(l.keyCode===8||l.keyCode===46)&&o.prop[o.content].trim()===""&&r("deleteBlock",o.prop)}function n(){e.nextTick(()=>{t.value.focus(),r("updateBlock",o.prop,{setFocus:!1})})}function c(){t.value.style.height="1rem",t.value.style.height=t.value.scrollHeight+"px"}return e.onUpdated(()=>{o.setFocus&&e.nextTick(()=>{n()}),c()}),e.onMounted(()=>{o.setFocus&&e.nextTick(()=>{n()}),c()}),e.watch(()=>o.prop[o.content],l=>{}),(l,i)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":i[0]||(i[0]=m=>a.prop[a.content]=m),placeholder:a.placeholder?a.placeholder:"Enter text",onInput:s,onFocus:i[1]||(i[1]=m=>r("focus",t.value)),onKeyup:u,ref_key:"textarea",ref:t,class:"h3 text-area mn-thin"},`
7
- `,40,ie),[[e.vModelText,a.prop[a.content]]])]))}},ue=["placeholder"],q={__name:"Caption",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(a,{emit:r}){const o=a;e.ref(o);const t=e.ref(null);function s(n){const c=/^\s*[-*]\s+(.*)/;let i=n.target.value.split(/\n+/).map(m=>{const h=c.exec(m);return h?h[1]:null}).filter(m=>m!==null);i.length>0?(o.prop[o.content]=i,u()):n.target.value.trim()===""&&(o.prop[o.content]=[],u())}function u(){t.value.style.height="1rem",t.value.style.height=t.value.scrollHeight+"px"}return e.onUpdated(()=>{u()}),e.onMounted(()=>{u()}),e.watch(()=>o.prop[o.content],n=>{(!n||n.length===0)&&r("deleteBlock",o.prop)}),(n,c)=>(e.openBlock(),e.createElementBlock("div",null,[e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=l=>a.prop[a.content]=l),placeholder:a.placeholder?a.placeholder:"Enter text",onInput:s,onFocus:c[1]||(c[1]=l=>r("focus",t.value)),ref_key:"textarea",ref:t,class:"br-l br-solid br-main pd-l-small text-area mn-small"},`
8
- `,40,ue),[[e.vModelText,a.prop[a.content]]])]))}},de=["placeholder"],H={__name:"Bullets",props:["obj","label","prop","value","content","textarea","placeholder","index","ref"],emits:["deleteBlock","addBlock","focus"],setup(a,{emit:r}){const o=a;e.ref(o);const t=e.ref(null);function s(n){const c=/^\s*[-*]\s+(.*)/;let i=n.target.value.split(/\n+/).map(m=>{const h=c.exec(m);return h?h[1]:null}).filter(m=>m!==null);i.length>0?(o.prop[o.content]=i,u()):n.target.value.trim()===""&&(o.prop[o.content]=[],u())}function u(){t.value.style.height="1rem",t.value.style.height=t.value.scrollHeight+"px"}return e.onUpdated(()=>{u()}),e.onMounted(()=>{u()}),e.watch(()=>o.prop[o.content],n=>{(!n||n.length===0)&&r("deleteBlock",o.prop)}),(n,c)=>(e.openBlock(),e.createElementBlock("div",null,[e.createTextVNode(e.toDisplayString(a.prop[a.content])+" ",1),e.withDirectives(e.createElementVNode("textarea",{"onUpdate:modelValue":c[0]||(c[0]=l=>a.prop[a.content]=l),placeholder:a.placeholder?a.placeholder:"Enter text",onInput:s,onFocus:c[1]||(c[1]=l=>r("focus",t.value)),ref_key:"textarea",ref:t,class:"text-area mn-small"},`
9
- `,40,de),[[e.vModelText,a.prop[a.content]]])]))}},pe=["src"],me={key:1,class:"t-transp pd-extra"},L={__name:"ImageUpload",props:["label","value","prop"],emits:["input","updateBlock"],setup(a,{emit:r}){const o=a,t=e.ref(null),s=e.ref(null);function u(){s.value.click()}async function n(l){let i=l.target.files[0];console.log(i);let m=new FormData,h="unsorted";m.append("file",i),console.log(m.has("file"));try{let V=await _.axios.create({baseURL:process.env.API_URL,withCredentials:!0}).post(`/api/upload/file?folderName=${encodeURIComponent(h)}`,m,{headers:{"Content-Type":"multipart/form-data"}});t.value=V.data.filepath,console.log(t.value),r("input",t.value),r("updateBlock",o.prop,{content:t.value})}catch(w){console.error(w)}}function c(l){l.preventDefault(),n({target:{files:l.dataTransfer.files}})}return(l,i)=>(e.openBlock(),e.createElementBlock("div",{onClick:u,onDrop:c,onDragover:i[0]||(i[0]=e.withModifiers(()=>{},["prevent"])),class:"w-100 radius-big bg-white image-upload-area flex-v-center flex-h-center flex t-black mn-small"},[a.prop.content?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.prop.content,alt:"Uploaded image",class:"w-100 h-30r object-fit-contain"},null,8,pe)):(e.openBlock(),e.createElementBlock("span",me,"Click or drag-and-drop your image")),e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:s,onChange:n,style:{display:"none"}},null,544)],32))}},fe={class:"pd-thin"},ge={key:0,class:"h-100 w-100 bg-grey pd-big radius-big"},he={class:"w-full h-full"},ve=["onMouseover"],_e={key:0,class:"z-index-5 radius-thin mn-small relative left-0 mt-2 w-max bg-white shadow-lg rounded"},ke=["onClick"],be=["onClick"],ye=["onClick"],xe={key:1,class:"pd-thin pos-fixed pos-l-0 pos-b-0 w-100"},we={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},Be={class:"w-m-66r t-left pd-big bg-white radius-big"},Ne=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),Ve=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),Ce={key:0,class:"mn-thin"},Ee={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},j={__name:"CreateBlogPost",setup(a){const r=B.useRoute(),o=B.useRouter();let t=e.ref(null),s=e.ref(null);const u=e.ref([]),n=e.ref(null);e.onMounted(async()=>{if(r.params.url){const p=await g.read({user:_.state.user._id,url:r.params.url});t.value=p.pop()}else g.clean(),t.value=g.state.current;t.value.owner||(t.value.owner={target:_.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:_.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(n.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo});const d=await Z.actions.read({user:_.state.user._id,postable:_.state.user._id});console.log(d),s.value=d.map(p=>({name:p.profile.name,_id:p._id,photo:p.profile.photo}))});const c=e.ref(""),l=e.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);e.computed(()=>l.value.filter(d=>d.text.toLowerCase().includes(c.value.toLowerCase()))),e.computed(()=>l.value.filter(d=>!u.value.some(p=>p.text===d.text)));const i=e.ref(!1);function m(){i.value=!0}function h(){i.value=!1}function w(){u.value.length>0&&u.value.map(d=>d.text),t.value.status="draft",r.params.url?g.update(t.value).then(d=>{o.push({name:"BlogPost",params:{url:d.url}})}).catch(d=>{console.log(d)}):g.create(t.value).then(d=>{o.push({name:"BlogPost",params:{url:d.url}})}).catch(d=>{console.log(d)})}function V(){n.value&&(t.value.owner={target:n.value._id,type:"organization"}),n.value||(t.value.creator.hidden=!1),n.value||(t.value.organization=t.value.creator),t.value.status="published",console.log(t.value),r.params.url?g.update(t.value).then(d=>{o.push({name:"BlogPost",params:{url:d.url}})}).catch(d=>{console.log(d)}):g.create(t.value).then(d=>{o.push({name:"BlogPost",params:{url:d.url}})}).catch(d=>{console.log(d)})}function $(){confirm("Are you sure you want to delete this post?")&&g.remove(t.value._id).then(d=>{o.push({name:"User Blogposts",params:{_id:t.value.creator.target._id}})}).catch(d=>{console.log(d)})}const E={Textarea:I,H2:z,Bullets:H,Caption:q,ImageUpload:L};function N(d="Textarea",p="",f,k){console.log("We are adding new block (functuin HandleAddBlock):"+d+p+f+k);let x={order:t.value.content.length+1,type:d,style:"",class:"",content:p,blocks:[],setFocus:!0};if(k&&k.blocks&&Array.isArray(k.blocks)){let P=k.blocks.map(Q=>({...x,content:Q.content})),W=[(k.index||f)+1,0].concat(P);t.value.content.splice.apply(t.value.content,W);const G=P[P.length-1];console.log("New block is"+G)}else f!==void 0?(t.value.content.splice(f+1,0,x),console.log("Latest block is"+x)):(console.log("Another block is"+x),t.value.content.push(x));b.value=null}function T(d,p){const f=t.value.content.findIndex(k=>k===d);f!==-1&&(t.value.content[f]={...t.value.content[f],...p})}function C(d){let p=t.value.content.findIndex(f=>f===d);p!==-1&&t.value.content.splice(p,1),t.value.content[p-1].setFocus=!0}const b=e.ref(null),v=e.ref(!1),y=e.ref(!1);function J(){v.value=!0}function K(){v.value=!1}return e.watchEffect(()=>{t.value&&t.value.content.length===0&&N("Textarea","")}),(d,p)=>(e.openBlock(),e.createElementBlock("article",fe,[e.unref(t)?(e.openBlock(),e.createElementBlock("section",ge,[e.createElementVNode("div",he,[e.createVNode(I,{prop:e.unref(t),content:"name",placeholder:"Enter post title",class:"h2"},null,8,["prop"])]),e.unref(t).content?(e.openBlock(),e.createBlock(e.unref(Y.VueDraggableNext),{key:0,class:"w-full",list:e.unref(t).content,onStart:J,onEnd:K},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).content,(f,k)=>(e.openBlock(),e.createElementBlock("div",{key:k,class:"relative"},[e.createElementVNode("div",{onMouseover:x=>(b.value=k,y.value=!1),class:"w-full h-full"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(E[f.type]),{index:k,component:f,prop:f,class:e.normalizeClass(f.class),setFocus:f.setFocus,content:"content",onDeleteBlock:C,onAddBlock:N,onUpdateBlock:T},null,40,["index","component","prop","class","setFocus"]))],40,ve),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[b.value===k?(e.openBlock(),e.createElementBlock("div",{key:0,class:"pos-absolute pos-r-100 pos-t-0 z-index-4 i-semi",onMousedown:p[1]||(p[1]=e.withModifiers(x=>v.value=!0,["prevent"]))},[e.createElementVNode("button",{onClick:p[0]||(p[0]=x=>y.value=!y.value),class:"mn-small w-100 i-semi bg-white radius-thin"},e.toDisplayString(f.content?"...":"+"),1),y.value?(e.openBlock(),e.createElementBlock("div",_e,[e.createElementVNode("button",{onClick:x=>C(f),class:"block w-max text-left px-4 py-2 hover:bg-gray-200"},"Удалить",8,ke),e.createElementVNode("button",{onClick:x=>N("ImageUpload","",k),class:"block w-max text-left px-4 py-2 hover:bg-gray-200"},"Добавить изображение",8,be),e.createElementVNode("button",{onClick:x=>N("H2","",k),class:"block w-max text-left px-4 py-2 hover:bg-gray-200"},"Добавить заголовок",8,ye)])):e.createCommentVNode("",!0)],32)):e.createCommentVNode("",!0)]),_:2},1024)]))),128))]),_:1},8,["list"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",xe,[e.createElementVNode("div",we,[e.unref(r).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:p[2]||(p[2]=f=>$()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:p[3]||(p[3]=f=>w()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:p[4]||(p[4]=f=>m()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode(X._sfc_main,{title:"Добавить участника",onClosePopup:h,isPopupOpen:i.value},{default:e.withCtx(()=>[e.createElementVNode("div",Be,[Ne,e.createVNode(S._sfc_main,{onTagsChanged:p[5]||(p[5]=f=>e.unref(t).tags=f),tags:e.unref(t).tags},null,8,["tags"]),Ve,e.createVNode(S.SelectMulti,{modelValue:n.value,"onUpdate:modelValue":p[6]||(p[6]=f=>n.value=f),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"]),n.value?(e.openBlock(),e.createElementBlock("h5",Ce,"Options:")):e.createCommentVNode("",!0),n.value?(e.openBlock(),e.createElementBlock("div",Ee,[e.createVNode(D.Checkbox,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":p[7]||(p[7]=f=>e.unref(t).creator.hidden=f),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(_._sfc_main,{submit:V,callback:d.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])])]),_:1},8,["isPopupOpen"])]))}},M=Object.freeze(Object.defineProperty({__proto__:null,default:j},Symbol.toStringTag,{value:"Module"})),$e={},Te={width:"100%",height:"20rem",xmlns:"http://www.w3.org/2000/svg"},Pe=e.createStaticVNode('<rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" fill="rgb(var(--grey))"></rect><rect x="15" y="15" rx="4" ry="4" width="40%" height="20" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="45" rx="5" ry="5" width="70%" height="50" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="110" rx="3" ry="3" width="90%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="130" rx="3" ry="3" width="70%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="-25%" y="0" width="25%" height="100%" fill="#fff" mask="url(#myMask)" opacity="0.3"><animate attributeName="x" from="-25%" to="100%" dur="2s" repeatCount="indefinite"></animate></rect>',6),Se=[Pe];function Ie(a,r){return e.openBlock(),e.createElementBlock("svg",Te,Se)}const Me=_._export_sfc($e,[["render",Ie]]),De={class:"w-100 bg-white radius-big image-upload-area flex-v-center flex-h-center flex t-black mn-small"},Fe=["src"],A={__name:"Image",props:["label","value","prop"],setup(a){return e.ref(null),(r,o)=>(e.openBlock(),e.createElementBlock("div",De,[a.prop.content?(e.openBlock(),e.createElementBlock("img",{key:0,src:a.prop.content,alt:"Uploaded image",class:"w-100 h-30r object-fit-contain"},null,8,Fe)):e.createCommentVNode("",!0)]))}},Ue={class:"pd-thin"},O={__name:"BlogPost",setup(a){const r=B.useRoute(),o=e.ref(null),t=e.ref(!0);e.onMounted(async()=>{t.value=!0;const n=await g.read({user:_.state.user._id,url:r.params.url});o.value=n[0],t.value=!1});const s={Textarea:"p",H2:"h2",Bullets:"p",Caption:"p",ImageUpload:A};function u(n){return n.type==="Textarea"?{innerHTML:n.content,class:"p-medium"}:n.type==="H2"?{innerHTML:n.content,class:"h3"}:n.type==="Caption"?{innerHTML:n.content}:n.type==="ImageUpload"?{src:n.content}:{}}return(n,c)=>(e.openBlock(),e.createElementBlock("section",Ue,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[t.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},e.renderList(3,l=>e.createVNode(Me,{key:l})),64)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!t.value&&!o.value?(e.openBlock(),e.createBlock(ee._sfc_main,{key:0,title:"No Blogpost Found",description:"Currently, there are no blogposts 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&&o.value?(e.openBlock(),e.createBlock(g._sfc_main$1,{key:0,onClick:c[0]||(c[0]=l=>n.$router.push({name:"Blogpost",params:{url:o.value.url}})),blogpost:o.value,user:_.state.user._id,type:"blogpostPage",class:e.normalizeClass(["mn-medium",{"br-b br-solid br-black-transp-10":n.index!==o.value.length-1}])},{default:e.withCtx(()=>[e.createElementVNode("section",null,[o.value&&o.value.content?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(o.value.content,(l,i)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(s[l.type]),e.mergeProps({key:i,index:i,component:l,prop:l,class:l.class,content:"content"},u(l),{class:"mn-regular"}),null,16,["index","component","prop","class"]))),128)):e.createCommentVNode("",!0)])]),_:1},8,["blogpost","user","class"])):e.createCommentVNode("",!0),e.createVNode(S._sfc_main$1,{class:"mn-small"}),!t.value&&o.value?(e.openBlock(),e.createBlock(F._sfc_main,{key:1,type:"blogpost",target:o.value._id,owner:_.state.user._id},null,8,["target","owner"])):e.createCommentVNode("",!0)]),_:1})]))}},ze=Object.freeze(Object.defineProperty({__proto__:null,default:O},Symbol.toStringTag,{value:"Module"})),R={__name:"Blog",setup(a){const r=B.useRoute(),o=B.useRouter();return r.params.category||(r.params.category="featured"),e.onMounted(()=>{if(r.query){const t=r.query,s={tags:t.tags?t.tags.split(","):[],period:t.period?t.period:"year"};g.state.filter=s}}),e.watch(()=>g.state.filter,(t,s)=>{const u={...r.query};Object.keys(s).forEach(c=>{u[c]&&delete u[c]});const n=Object.fromEntries(Object.entries(t).filter(([c,l])=>Array.isArray(l)&&l.length>0||typeof l=="string"&&l).map(([c,l])=>[c,Array.isArray(l)?l.join(","):l]));Object.assign(u,n),o.push({query:u})},{deep:!0}),(t,s)=>(e.openBlock(),e.createElementBlock("section",null,[e.createVNode(g._sfc_main,{category:e.unref(r).params.category,user:_.state.user._id,period:e.unref(r).query.period},null,8,["category","user","period"])]))}},qe=Object.freeze(Object.defineProperty({__proto__:null,default:R},Symbol.toStringTag,{value:"Module"})),He={class:"w-100 cols-4 t-left flex-nowrap flex"},Le={key:0,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},je=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"👍",-1),Ae={class:"t-semi uppercase"},Oe=e.createElementVNode("br",null,null,-1),Re={key:1,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},Je=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"💬",-1),Ke={class:"t-semi uppercase"},We=e.createElementVNode("br",null,null,-1),Ge={key:2,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},Qe=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"👍",-1),Xe={class:"t-semi uppercase"},Ye=e.createElementVNode("br",null,null,-1),Ze={__name:"Activity",props:{likes:Number,comments:Number,subscriptions:Number},setup(a){return(r,o)=>(e.openBlock(),e.createElementBlock("section",He,[a.likes?(e.openBlock(),e.createElementBlock("div",Le,[je,e.createElementVNode("span",Ae,[e.createTextVNode(e.toDisplayString(a.likes),1),Oe,e.createTextVNode("likes")])])):e.createCommentVNode("",!0),a.comments?(e.openBlock(),e.createElementBlock("div",Re,[Je,e.createElementVNode("span",Ke,[e.createTextVNode(e.toDisplayString(a.comments),1),We,e.createTextVNode("comments")])])):e.createCommentVNode("",!0),a.subscriptions?(e.openBlock(),e.createElementBlock("div",Ge,[Qe,e.createElementVNode("span",Xe,[e.createTextVNode(e.toDisplayString(a.subscriptions),1),Ye,e.createTextVNode("subscriptions")])])):e.createCommentVNode("",!0)]))}},et={class:"pd-thin radius-extra flex-nowrap flex"},tt=["innerHTML"],ot={__name:"FieldBig",props:{input:String,placeholder:{type:String},action:{type:String,default:"Action"},placeholderTexts:{type:Object,default:()=>({en:["First placeholder","Second placeholder","Third placeholder"],ru:["Первый плейсхолдер","Второй плейсхолдер","Третий плейсхолдер"]})},typingSpeed:{type:Number,default:200},loopTyping:{type:Boolean,default:!1},enableTyping:{type:Boolean,default:!1}},emits:["update:input","action"],setup(a,{emit:r}){const o=a,{t,locale:s}=te.useI18n();let u=e.ref(0),n=e.ref(o.input),c=e.ref(o.placeholder),l=e.ref(o.enableTyping),i=e.ref(null),m=e.ref(""),h=e.ref(!0),w=null;function V(){r("action")}function $(b){r("update:input",b),m.value=b}function E(){u.value=(u.value+1)%o.placeholderTexts[s.value].length}function N(){l.value=!1,clearInterval(i.value),c.value=o.placeholder,m.value||(n.value="")}function T(){!m.value&&o.enableTyping&&(l.value=!0,c.value="",C())}function C(){let b=o.placeholderTexts[s.value][u.value],v=0,y=!1;w=setInterval(()=>{h.value=!h.value},200),i.value=setInterval(()=>{l.value&&(y?(n.value=n.value.slice(0,-1),n.value=b.substring(0,v)+(h.value&&v%2?"|":""),v--):(n.value=b.substring(0,v)+(h.value&&v%2?"|":""),v++),v>b.length&&o.loopTyping&&setTimeout(()=>{y=!0,n.value=b.substring(0,v)},333),v===0&&y&&(y=!1,E(),b=o.placeholderTexts[s.value][u.value]))},o.typingSpeed)}return e.onMounted(()=>{o.enableTyping&&C()}),e.watchEffect(()=>{l.value||(clearInterval(i.value),clearInterval(w))}),(b,v)=>(e.openBlock(),e.createElementBlock("div",et,[e.createVNode(_.Field,{field:e.unref(n),"onUpdate:field":[v[0]||(v[0]=y=>e.isRef(n)?n.value=y:n=y),$],placeholder:e.unref(c),onInput:E,onFocus:N,onBlur:T,class:"w-100 pd-small p-big"},null,8,["field","placeholder"]),a.action?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:V,class:"w-min hover_bg-white hover-t-black t-black bg-main button",innerHTML:a.action},null,8,tt)):e.createCommentVNode("",!0)]))}};const nt={class:"pd-thin"},lt={class:"o-hidden t-black bg-main pd-big radius-big"},at=e.createElementVNode("header",{class:"t-center z-index-1 mn-big"},[e.createElementVNode("h2",{class:"mn-l-auto mn-r-auto w-m-40r mn-medium"},"Stay Updated with The Latest in Cannabis."),e.createElementVNode("p",{class:"t-transp p-big"},"Subscribe to our newsletter for news, insights, and more from the Weeder universe.")],-1),rt={class:"z-index-1 mn-big w-100 flex-nowrap flex"},st=e.createElementVNode("div",{class:"w-100 h-100 pos-absolute pos-t-50-negative pos-r-0 z-index-0 grid"},[e.createElementVNode("div",{class:"spiral"})],-1),ct={__name:"SubscribeNewsletter",setup(a){let r=e.ref("");return(o,t)=>(e.openBlock(),e.createElementBlock("section",nt,[e.createElementVNode("div",lt,[at,e.createElementVNode("div",rt,[e.createVNode(ot,{input:e.unref(r),typingSpeed:75,loopTyping:!1,enableTyping:!1,placeholder:"Please enter your email",action:"Subscribe","onUpdate:input":t[0]||(t[0]=s=>e.isRef(r)?r.value=s:r=s),onAction:t[1]||(t[1]=s=>o.router.push({name:"Product Recommmendation",query:{mood:o.mood}})),class:"mn-l-auto mn-r-auto bg-white t-black w-50"},null,8,["input"])]),st])]))}};const it={class:"container container-joinus"},ut={class:"content"},dt={class:"h0 mn-big"},pt=e.createElementVNode("p",{class:"w-m-33r t-center mn-small p-big"},"Together, we're shaping the future of the globals cannabis community.",-1),mt=e.createElementVNode("button",{class:"bg-black t-white button"},"Join Now",-1),ft={__name:"JoinUs",setup(a){const r=e.ref(120950),o=e.ref(["/assets/images/reviews/01.png","/assets/images/reviews/02.png","/assets/images/reviews/03.png","/assets/images/reviews/04.png","/assets/images/reviews/05.png","/assets/images/reviews/06.png"]),t=()=>{setInterval(()=>{r.value+=Math.floor(Math.random()*5)+1},330)},s={minSize:"6rem",maxSize:"10rem",minDuration:5,maxDuration:15,spawnPoints:[10,90]};e.onMounted(()=>{u(),t()});const u=()=>{o.value.forEach((n,c)=>{let l=document.createElement("img");l.src=n,l.classList.add("floating-image");let i=s.spawnPoints[Math.floor(Math.random()*s.spawnPoints.length)],m=(Math.random()-.5)*2*10;l.style.left=`${i+m}%`,l.style.animationDuration=`${Math.random()*(s.maxDuration-s.minDuration)+s.minDuration}s`,document.querySelector(".container").appendChild(l),l.addEventListener("animationiteration",()=>{const h=s.spawnPoints[Math.floor(Math.random()*s.spawnPoints.length)],w=(Math.random()-.5)*2*10;l.style.left=`${h+w}%`})})};return(n,c)=>(e.openBlock(),e.createElementBlock("div",it,[e.createElementVNode("div",ut,[e.createElementVNode("span",dt,e.toDisplayString(r.value.toLocaleString()),1),pt,mt])]))}};const gt=a=>(e.pushScopeId("data-v-18db0d1b"),a=a(),e.popScopeId(),a),ht={class:"community-feed"},vt=gt(()=>e.createElementVNode("h2",{class:"w-m-75r mn-auto pd-t-big pd-b-big t-center"},"Discover the Vibrant Community",-1)),_t={class:"grid-container"},kt={__name:"HotPosts",async setup(a){let r,o;const t=e.ref([]),s=async()=>{const n=await g.read({skip:0,limit:7,period:"year"});console.log(n),t.value=n};[r,o]=e.withAsyncContext(()=>s()),await r,o();const u=n=>{switch(n){case 0:return"grid-item-2x2";case 1:return"grid-item-2x1";case 2:return"grid-item-1x1";case 3:case 4:return"grid-item-1x1";case 6:return"grid-item-2x1";default:return""}};return(n,c)=>(e.openBlock(),e.createElementBlock("section",ht,[vt,e.createElementVNode("div",_t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(l,i)=>(e.openBlock(),e.createBlock(g._sfc_main$1,{blogpost:l,owner:_.state.user._id,key:i,class:e.normalizeClass(u(i))},null,8,["blogpost","owner","class"]))),128))])]))}},bt=_._export_sfc(kt,[["__scopeId","data-v-18db0d1b"]]),yt=[{path:"community",component:U,meta:{title:{en:"Community",ru:"Коммьюнити"}},children:[{path:":category?",name:"Blog",component:()=>Promise.resolve().then(()=>qe)}]},{path:"community/posts/create",name:"Create BlogPost",meta:{title:{en:"Create Post",ru:"Создать Пост"},authorize:[]},component:()=>Promise.resolve().then(()=>M)},{path:"community/posts/:url",name:"BlogPost",meta:{title:{en:"Post",ru:"Пост"}},component:()=>Promise.resolve().then(()=>ze)},{path:"community/posts/:url/edit",name:"Edit BlogPost",meta:{title:{en:"Edit Post",ru:"Редактировать пост"},authorize:[]},component:()=>Promise.resolve().then(()=>M)}];exports.CardBlogpost=g._sfc_main$1;exports.Feed=g._sfc_main;exports.FooterBlogpost=g._sfc_main$2;exports.blogpostsStore=g.blogposts;exports.reactionsStore=g.reactions;exports.Comments=F._sfc_main;exports.Activity=Ze;exports.Blog=R;exports.BlogPost=O;exports.Bullets=H;exports.Caption=q;exports.Community=U;exports.CreateBlogPost=j;exports.H2=z;exports.HotPosts=bt;exports.Image=A;exports.ImageUpload=L;exports.JoinUs=ft;exports.SubscribeNewsletter=ct;exports.Textarea=I;exports.blogpostsRoutes=yt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),w=require("vue-router"),$=require("./Publics-3f277c17.js"),u=require("./Feed-55c5907a.js"),g=require("./auth-5aa8e90c.js"),x=require("./Comments-63f154a6.js"),M=require("./Popup-105ef2c3.js"),V=require("./Breadcrumbs.vue_vue_type_style_index_0_lang-15e71ec4.js"),I=require("./organizations-af43bda4.js"),z=require("./EmptyState-7658d7d6.js"),D=require("vue-i18n");require("./globals-928eb13c.js");require("./CardOrganization-ee5c34ab.js");require("./ButtonFollow-2ce169ca.js");require("./CardHeader-925a972b.js");require("./PlaceholderUserpic-d64d6dd5.js");require("./vue-draggable-next.esm-bundler-80731ae0.js");const F={class:"min-h-100vh pd-thin"},O={class:"mn-thin flex-v-center t-left flex-nowrap flex"},j={class:"flex-v-center flex-nowrap flex t-left"},L=e.createElementVNode("span",{class:""},"Topics for ",-1),U={class:"bg-grey pd-medium radius-big mn-semi flex-nowrap flex"},A={class:""},P={__name:"Community",setup(i){const r=w.useRoute(),n=w.useRouter();return(t,a)=>{const d=e.resolveComponent("router-view");return e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("header",O,[e.createElementVNode("h2",j,[L,e.createVNode($.Select,{options:["today","week","month","year"],select:u.state.filter.period,"onUpdate:select":a[0]||(a[0]=o=>u.state.filter.period=o),placeholder:"Select type",class:"w-max mn-l-small bg-grey pd-thin radius-medium h2 t-center t-black"},null,8,["select"])])]),e.createElementVNode("ul",U,[e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="featured"},"mn-r-small t-medium pd-small radius-small"]),onClick:a[1]||(a[1]=o=>e.unref(n).push({name:"Blog"}))},"👑 Featured",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="popular"},"mn-r-small t-medium pd-small radius-small"]),onClick:a[2]||(a[2]=o=>e.unref(n).push({name:"Blog",params:{category:"popular"}}))},"🔥 Popular",2),e.createElementVNode("li",{class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="new"},"mn-r-small t-medium pd-small radius-small"]),onClick:a[3]||(a[3]=o=>e.unref(n).push({name:"Blog",params:{category:"new"}}))},"🆕 New",2),g.state.user._id?(e.openBlock(),e.createElementBlock("li",{key:0,class:e.normalizeClass([{"t-white bg-black":e.unref(r).params.category==="following"},"t-medium pd-small radius-small"]),onClick:a[4]||(a[4]=o=>e.unref(n).push({name:"Blog",params:{category:"following"}}))},"👥 Following",2)):e.createCommentVNode("",!0)]),e.createElementVNode("section",A,[e.createVNode(d,null,{default:e.withCtx(({Component:o,route:m})=>[e.createVNode(e.Transition,{name:"scaleIn",mode:"out-in"},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o),{ref:"page",key:m.query}))]),_:2},1024)]),_:1})])])}}},H={class:"pd-thin"},R={key:0,class:"h-100 w-100 bg-grey pd-big radius-big"},J={class:"w-full h-full"},G={key:1,class:"pd-thin pos-fixed pos-l-0 pos-b-0 w-100"},Q={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},W={class:"w-m-66r t-left pd-big bg-white radius-big"},K=e.createElementVNode("h3",{class:"mn-small"},"Final Touches",-1),X=e.createElementVNode("h5",{class:"mn-thin"},"Add to public:",-1),Y={key:0,class:"mn-thin"},Z={key:1,class:"mn-medium br-grey br-2px br-solid pd-small radius-big"},T={__name:"CreateBlogPost",setup(i){const r=w.useRoute(),n=w.useRouter();let t=e.ref(null),a=e.ref(null);const d=e.ref([]),o=e.ref(null);e.onMounted(async()=>{if(r.params.url){const c=await u.read({user:g.state.user._id,url:r.params.url});t.value=c.pop()}else u.clean(),t.value=u.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"&&(o.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo});const l=await I.actions.read({user:g.state.user._id,postable:g.state.user._id});console.log(l),a.value=l.map(c=>({name:c.profile.name,_id:c._id,photo:c.profile.photo}))});const m=e.ref(""),s=e.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);e.computed(()=>s.value.filter(l=>l.text.toLowerCase().includes(m.value.toLowerCase()))),e.computed(()=>s.value.filter(l=>!d.value.some(c=>c.text===l.text)));const p=e.ref(!1);function b(){p.value=!0}function v(){p.value=!1}function k(){d.value.length>0&&d.value.map(l=>l.text),t.value.status="draft",r.params.url?u.update(t.value).then(l=>{n.push({name:"BlogPost",params:{url:l.url}})}).catch(l=>{console.log(l)}):u.create(t.value).then(l=>{n.push({name:"BlogPost",params:{url:l.url}})}).catch(l=>{console.log(l)})}function B(){o.value&&(t.value.owner={target:o.value._id,type:"organization"}),o.value||(t.value.creator.hidden=!1),o.value||(t.value.organization=t.value.creator),t.value.status="published",console.log(t.value),r.params.url?u.update(t.value).then(l=>{n.push({name:"BlogPost",params:{url:l.url}})}).catch(l=>{console.log(l)}):u.create(t.value).then(l=>{n.push({name:"BlogPost",params:{url:l.url}})}).catch(l=>{console.log(l)})}function N(){confirm("Are you sure you want to delete this post?")&&u.remove(t.value._id).then(l=>{n.push({name:"User Blogposts",params:{_id:t.value.creator.target._id}})}).catch(l=>{console.log(l)})}return(l,c)=>(e.openBlock(),e.createElementBlock("article",H,[e.unref(t)?(e.openBlock(),e.createElementBlock("section",R,[e.createElementVNode("div",J,[e.createVNode(x._sfc_main$2,{prop:e.unref(t),content:"name",placeholder:"Enter post title",class:"h2"},null,8,["prop"])]),e.createVNode(x._sfc_main,{content:e.unref(t).content,onUpdate:c[0]||(c[0]=f=>e.unref(t).content=f)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",G,[e.createElementVNode("div",Q,[e.unref(r).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:c[1]||(c[1]=f=>N()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:c[2]||(c[2]=f=>k()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:c[3]||(c[3]=f=>b()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode(M._sfc_main,{title:"Добавить участника",onClosePopup:v,isPopupOpen:p.value},{default:e.withCtx(()=>[e.createElementVNode("div",W,[K,e.createVNode(V._sfc_main,{onTagsChanged:c[4]||(c[4]=f=>e.unref(t).tags=f),tags:e.unref(t).tags},null,8,["tags"]),X,e.createVNode(V.SelectMulti,{modelValue:o.value,"onUpdate:modelValue":c[5]||(c[5]=f=>o.value=f),options:e.unref(a),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"]),o.value?(e.openBlock(),e.createElementBlock("h5",Y,"Options:")):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",Z,[e.createVNode(V.Checkbox,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":c[6]||(c[6]=f=>e.unref(t).creator.hidden=f),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(g._sfc_main,{submit:B,callback:l.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])])]),_:1},8,["isPopupOpen"])]))}},C=Object.freeze(Object.defineProperty({__proto__:null,default:T},Symbol.toStringTag,{value:"Module"})),ee={},te={width:"100%",height:"20rem",xmlns:"http://www.w3.org/2000/svg"},oe=e.createStaticVNode('<rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" fill="rgb(var(--grey))"></rect><rect x="15" y="15" rx="4" ry="4" width="40%" height="20" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="45" rx="5" ry="5" width="70%" height="50" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="110" rx="3" ry="3" width="90%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="130" rx="3" ry="3" width="70%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="-25%" y="0" width="25%" height="100%" fill="#fff" mask="url(#myMask)" opacity="0.3"><animate attributeName="x" from="-25%" to="100%" dur="2s" repeatCount="indefinite"></animate></rect>',6),ne=[oe];function ae(i,r){return e.openBlock(),e.createElementBlock("svg",te,ne)}const re=g._export_sfc(ee,[["render",ae]]),se={class:"w-100 bg-white radius-big image-upload-area flex-v-center flex-h-center flex t-black mn-small"},le=["src"],ie={__name:"Image",props:["label","value","prop"],setup(i){return e.ref(null),(r,n)=>(e.openBlock(),e.createElementBlock("div",se,[i.prop.content?(e.openBlock(),e.createElementBlock("img",{key:0,src:i.prop.content,alt:"Uploaded image",class:"w-100 h-30r object-fit-contain"},null,8,le)):e.createCommentVNode("",!0)]))}},ce={class:"pd-thin"},S={__name:"BlogPost",setup(i){const r=w.useRoute(),n=e.ref(null),t=e.ref(!0);e.onMounted(async()=>{t.value=!0;const o=await u.read({user:g.state.user._id,url:r.params.url});n.value=o[0],t.value=!1});const a={Textarea:"p",H2:"h2",Bullets:"p",Caption:"p",ImageUpload:ie};function d(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}:{}}return(o,m)=>(e.openBlock(),e.createElementBlock("section",ce,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"fade",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[t.value?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},e.renderList(3,s=>e.createVNode(re,{key:s})),64)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[!t.value&&!n.value?(e.openBlock(),e.createBlock(z._sfc_main,{key:0,title:"No Blogpost Found",description:"Currently, there are no blogposts 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?(e.openBlock(),e.createBlock(u._sfc_main$1,{key:0,onClick:m[0]||(m[0]=s=>o.$router.push({name:"Blogpost",params:{url:n.value.url}})),blogpost:n.value,user:g.state.user._id,type:"blogpostPage",class:e.normalizeClass(["mn-medium",{"br-b br-solid br-black-transp-10":o.index!==n.value.length-1}])},{default:e.withCtx(()=>[e.createElementVNode("section",null,[n.value&&n.value.content?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(n.value.content,(s,p)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a[s.type]),e.mergeProps({key:p,index:p,component:s,prop:s,class:s.class,content:"content"},d(s),{class:"mn-regular"}),null,16,["index","component","prop","class"]))),128)):e.createCommentVNode("",!0)])]),_:1},8,["blogpost","user","class"])):e.createCommentVNode("",!0),e.createVNode($._sfc_main,{class:"mn-small"}),!t.value&&n.value?(e.openBlock(),e.createBlock(x._sfc_main$1,{key:1,type:"blogpost",target:n.value._id,owner:g.state.user._id},null,8,["target","owner"])):e.createCommentVNode("",!0)]),_:1})]))}},ue=Object.freeze(Object.defineProperty({__proto__:null,default:S},Symbol.toStringTag,{value:"Module"})),q={__name:"Blog",setup(i){const r=w.useRoute(),n=w.useRouter();return r.params.category||(r.params.category="featured"),e.onMounted(()=>{if(r.query){const t=r.query,a={tags:t.tags?t.tags.split(","):[],period:t.period?t.period:"year"};u.state.filter=a}}),e.watch(()=>u.state.filter,(t,a)=>{const d={...r.query};Object.keys(a).forEach(m=>{d[m]&&delete d[m]});const o=Object.fromEntries(Object.entries(t).filter(([m,s])=>Array.isArray(s)&&s.length>0||typeof s=="string"&&s).map(([m,s])=>[m,Array.isArray(s)?s.join(","):s]));Object.assign(d,o),n.push({query:d})},{deep:!0}),(t,a)=>(e.openBlock(),e.createElementBlock("section",null,[e.createVNode(u._sfc_main,{category:e.unref(r).params.category,user:g.state.user._id,period:e.unref(r).query.period},null,8,["category","user","period"])]))}},de=Object.freeze(Object.defineProperty({__proto__:null,default:q},Symbol.toStringTag,{value:"Module"})),me={class:"w-100 cols-4 t-left flex-nowrap flex"},pe={key:0,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},ge=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"👍",-1),fe={class:"t-semi uppercase"},_e=e.createElementVNode("br",null,null,-1),he={key:1,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},ve=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"💬",-1),be={class:"t-semi uppercase"},ye=e.createElementVNode("br",null,null,-1),we={key:2,class:"w-100 br-2px br-solid br-white-transp-10 radius-small pd-small flex-v-center flex-nowrap flex"},ke=e.createElementVNode("p",{class:"h4 i-medium mn-r-small"},"👍",-1),xe={class:"t-semi uppercase"},Be=e.createElementVNode("br",null,null,-1),Ne={__name:"Activity",props:{likes:Number,comments:Number,subscriptions:Number},setup(i){return(r,n)=>(e.openBlock(),e.createElementBlock("section",me,[i.likes?(e.openBlock(),e.createElementBlock("div",pe,[ge,e.createElementVNode("span",fe,[e.createTextVNode(e.toDisplayString(i.likes),1),_e,e.createTextVNode("likes")])])):e.createCommentVNode("",!0),i.comments?(e.openBlock(),e.createElementBlock("div",he,[ve,e.createElementVNode("span",be,[e.createTextVNode(e.toDisplayString(i.comments),1),ye,e.createTextVNode("comments")])])):e.createCommentVNode("",!0),i.subscriptions?(e.openBlock(),e.createElementBlock("div",we,[ke,e.createElementVNode("span",xe,[e.createTextVNode(e.toDisplayString(i.subscriptions),1),Be,e.createTextVNode("subscriptions")])])):e.createCommentVNode("",!0)]))}},Ve={class:"pd-thin radius-extra flex-nowrap flex"},Ee=["innerHTML"],Ce={__name:"FieldBig",props:{input:String,placeholder:{type:String},action:{type:String,default:"Action"},placeholderTexts:{type:Object,default:()=>({en:["First placeholder","Second placeholder","Third placeholder"],ru:["Первый плейсхолдер","Второй плейсхолдер","Третий плейсхолдер"]})},typingSpeed:{type:Number,default:200},loopTyping:{type:Boolean,default:!1},enableTyping:{type:Boolean,default:!1}},emits:["update:input","action"],setup(i,{emit:r}){const n=i,{t,locale:a}=D.useI18n();let d=e.ref(0),o=e.ref(n.input),m=e.ref(n.placeholder),s=e.ref(n.enableTyping),p=e.ref(null),b=e.ref(""),v=e.ref(!0),k=null;function B(){r("action")}function N(h){r("update:input",h),b.value=h}function l(){d.value=(d.value+1)%n.placeholderTexts[a.value].length}function c(){s.value=!1,clearInterval(p.value),m.value=n.placeholder,b.value||(o.value="")}function f(){!b.value&&n.enableTyping&&(s.value=!0,m.value="",E())}function E(){let h=n.placeholderTexts[a.value][d.value],_=0,y=!1;k=setInterval(()=>{v.value=!v.value},200),p.value=setInterval(()=>{s.value&&(y?(o.value=o.value.slice(0,-1),o.value=h.substring(0,_)+(v.value&&_%2?"|":""),_--):(o.value=h.substring(0,_)+(v.value&&_%2?"|":""),_++),_>h.length&&n.loopTyping&&setTimeout(()=>{y=!0,o.value=h.substring(0,_)},333),_===0&&y&&(y=!1,l(),h=n.placeholderTexts[a.value][d.value]))},n.typingSpeed)}return e.onMounted(()=>{n.enableTyping&&E()}),e.watchEffect(()=>{s.value||(clearInterval(p.value),clearInterval(k))}),(h,_)=>(e.openBlock(),e.createElementBlock("div",Ve,[e.createVNode(g.Field,{field:e.unref(o),"onUpdate:field":[_[0]||(_[0]=y=>e.isRef(o)?o.value=y:o=y),N],placeholder:e.unref(m),onInput:l,onFocus:c,onBlur:f,class:"w-100 pd-small p-big"},null,8,["field","placeholder"]),i.action?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:B,class:"w-min hover_bg-white hover-t-black t-black bg-main button",innerHTML:i.action},null,8,Ee)):e.createCommentVNode("",!0)]))}};const $e={class:"pd-thin"},Pe={class:"o-hidden t-black bg-main pd-big radius-big"},Te=e.createElementVNode("header",{class:"t-center z-index-1 mn-big"},[e.createElementVNode("h2",{class:"mn-l-auto mn-r-auto w-m-40r mn-medium"},"Stay Updated with The Latest in Cannabis."),e.createElementVNode("p",{class:"t-transp p-big"},"Subscribe to our newsletter for news, insights, and more from the Weeder universe.")],-1),Se={class:"z-index-1 mn-big w-100 flex-nowrap flex"},qe=e.createElementVNode("div",{class:"w-100 h-100 pos-absolute pos-t-50-negative pos-r-0 z-index-0 grid"},[e.createElementVNode("div",{class:"spiral"})],-1),Me={__name:"SubscribeNewsletter",setup(i){let r=e.ref("");return(n,t)=>(e.openBlock(),e.createElementBlock("section",$e,[e.createElementVNode("div",Pe,[Te,e.createElementVNode("div",Se,[e.createVNode(Ce,{input:e.unref(r),typingSpeed:75,loopTyping:!1,enableTyping:!1,placeholder:"Please enter your email",action:"Subscribe","onUpdate:input":t[0]||(t[0]=a=>e.isRef(r)?r.value=a:r=a),onAction:t[1]||(t[1]=a=>n.router.push({name:"Product Recommmendation",query:{mood:n.mood}})),class:"mn-l-auto mn-r-auto bg-white t-black w-50"},null,8,["input"])]),qe])]))}};const Ie={class:"container container-joinus"},ze={class:"content"},De={class:"h0 mn-big"},Fe=e.createElementVNode("p",{class:"w-m-33r t-center mn-small p-big"},"Together, we're shaping the future of the globals cannabis community.",-1),Oe=e.createElementVNode("button",{class:"bg-black t-white button"},"Join Now",-1),je={__name:"JoinUs",setup(i){const r=e.ref(120950),n=e.ref(["/assets/images/reviews/01.png","/assets/images/reviews/02.png","/assets/images/reviews/03.png","/assets/images/reviews/04.png","/assets/images/reviews/05.png","/assets/images/reviews/06.png"]),t=()=>{setInterval(()=>{r.value+=Math.floor(Math.random()*5)+1},330)},a={minSize:"6rem",maxSize:"10rem",minDuration:5,maxDuration:15,spawnPoints:[10,90]};e.onMounted(()=>{d(),t()});const d=()=>{n.value.forEach((o,m)=>{let s=document.createElement("img");s.src=o,s.classList.add("floating-image");let p=a.spawnPoints[Math.floor(Math.random()*a.spawnPoints.length)],b=(Math.random()-.5)*2*10;s.style.left=`${p+b}%`,s.style.animationDuration=`${Math.random()*(a.maxDuration-a.minDuration)+a.minDuration}s`,document.querySelector(".container").appendChild(s),s.addEventListener("animationiteration",()=>{const v=a.spawnPoints[Math.floor(Math.random()*a.spawnPoints.length)],k=(Math.random()-.5)*2*10;s.style.left=`${v+k}%`})})};return(o,m)=>(e.openBlock(),e.createElementBlock("div",Ie,[e.createElementVNode("div",ze,[e.createElementVNode("span",De,e.toDisplayString(r.value.toLocaleString()),1),Fe,Oe])]))}};const Le=i=>(e.pushScopeId("data-v-18db0d1b"),i=i(),e.popScopeId(),i),Ue={class:"community-feed"},Ae=Le(()=>e.createElementVNode("h2",{class:"w-m-75r mn-auto pd-t-big pd-b-big t-center"},"Discover the Vibrant Community",-1)),He={class:"grid-container"},Re={__name:"HotPosts",async setup(i){let r,n;const t=e.ref([]),a=async()=>{const o=await u.read({skip:0,limit:7,period:"year"});console.log(o),t.value=o};[r,n]=e.withAsyncContext(()=>a()),await r,n();const d=o=>{switch(o){case 0:return"grid-item-2x2";case 1:return"grid-item-2x1";case 2:return"grid-item-1x1";case 3:case 4:return"grid-item-1x1";case 6:return"grid-item-2x1";default:return""}};return(o,m)=>(e.openBlock(),e.createElementBlock("section",Ue,[Ae,e.createElementVNode("div",He,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(s,p)=>(e.openBlock(),e.createBlock(u._sfc_main$1,{blogpost:s,owner:g.state.user._id,key:p,class:e.normalizeClass(d(p))},null,8,["blogpost","owner","class"]))),128))])]))}},Je=g._export_sfc(Re,[["__scopeId","data-v-18db0d1b"]]),Ge=[{path:"community",component:P,meta:{title:{en:"Community",ru:"Коммьюнити"}},children:[{path:":category?",name:"Blog",component:()=>Promise.resolve().then(()=>de)}]},{path:"community/posts/create",name:"Create BlogPost",meta:{title:{en:"Create Post",ru:"Создать Пост"},authorize:[]},component:()=>Promise.resolve().then(()=>C)},{path:"community/posts/:url",name:"BlogPost",meta:{title:{en:"Post",ru:"Пост"}},component:()=>Promise.resolve().then(()=>ue)},{path:"community/posts/:url/edit",name:"Edit BlogPost",meta:{title:{en:"Edit Post",ru:"Редактировать пост"},authorize:[]},component:()=>Promise.resolve().then(()=>C)}];exports.CardBlogpost=u._sfc_main$1;exports.Feed=u._sfc_main;exports.FooterBlogpost=u._sfc_main$2;exports.blogpostsStore=u.blogposts;exports.reactionsStore=u.reactions;exports.Comments=x._sfc_main$1;exports.Activity=Ne;exports.Blog=q;exports.BlogPost=S;exports.Community=P;exports.CreateBlogPost=T;exports.HotPosts=Je;exports.JoinUs=je;exports.SubscribeNewsletter=Me;exports.blogpostsRoutes=Ge;