@ozdao/prometheus-framework 0.1.24 → 0.1.27

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. package/dist/BackofficeGallery-0e0132f5.mjs +306 -0
  2. package/dist/BackofficeGallery-a52a27b6.js +1 -0
  3. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-19e23006.mjs +1945 -0
  4. package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-f3d37f29.js +1 -0
  5. package/dist/Button-d8e72ac0.mjs +296 -0
  6. package/dist/Button-ee08e6bf.js +1 -0
  7. package/dist/ButtonFollow-00d85977.mjs +133 -0
  8. package/dist/ButtonFollow-7c0180b3.js +1 -0
  9. package/dist/CardOrganization-3f4a13d3.mjs +230 -0
  10. package/dist/CardOrganization-bf366e4e.js +1 -0
  11. package/dist/Feed-0b1dad65.js +1 -0
  12. package/dist/Feed-8110366a.mjs +439 -0
  13. package/dist/Feed-82ad8e29.mjs +368 -0
  14. package/dist/Feed-c8b1c72d.js +1 -0
  15. package/dist/Image-2269667e.js +9 -0
  16. package/dist/Image-7dcfe90d.mjs +477 -0
  17. package/dist/MenuItem-1216a99f.js +1 -0
  18. package/dist/MenuItem-97c50b97.mjs +93 -0
  19. package/dist/Popup-0420381f.js +1 -0
  20. package/dist/Popup-47b37484.mjs +76 -0
  21. package/dist/Product-977a8a7f.js +7 -0
  22. package/dist/Product-bbe7171a.mjs +842 -0
  23. package/dist/ProductEdit-e4cad9d1.js +1 -0
  24. package/dist/ProductEdit-f7a9af17.mjs +303 -0
  25. package/dist/ProfileBlogposts-5379335e.js +1 -0
  26. package/dist/ProfileBlogposts-5deee0c5.mjs +65 -0
  27. package/dist/ProfileComments-3cf3e265.mjs +44 -0
  28. package/dist/ProfileComments-8c9146ef.js +1 -0
  29. package/dist/ProfileEvents-7502ed90.mjs +57 -0
  30. package/dist/ProfileEvents-ea023c17.js +1 -0
  31. package/dist/ProfileLikes-23b6f2f9.js +1 -0
  32. package/dist/ProfileLikes-5b52e4ae.mjs +44 -0
  33. package/dist/ProfileOrganizations-769325c7.js +1 -0
  34. package/dist/ProfileOrganizations-c5151835.mjs +214 -0
  35. package/dist/Publics-4438ca51.js +1 -0
  36. package/dist/Publics-538180a8.mjs +45 -0
  37. package/dist/UploadImage-33f6a9f4.js +1 -0
  38. package/dist/UploadImage-f7b0335f.mjs +83 -0
  39. package/dist/UploadImageMultiple-297b3897.js +1 -0
  40. package/dist/UploadImageMultiple-7b132ba0.mjs +58 -0
  41. package/dist/auth-2f9b2dfc.js +7 -0
  42. package/dist/auth-b047fdc0.mjs +612 -0
  43. package/dist/auth.client.cjs +8 -8
  44. package/dist/auth.client.js +24 -23
  45. package/dist/auth.validation-02e0629b.mjs +20 -0
  46. package/dist/auth.validation-6a59443b.js +1 -0
  47. package/dist/backoffice.client.cjs +1 -1
  48. package/dist/backoffice.client.js +1 -1
  49. package/dist/community.client.cjs +1 -1
  50. package/dist/community.client.js +69 -68
  51. package/dist/events.client.cjs +2 -2
  52. package/dist/events.client.js +21 -20
  53. package/dist/index-0ab9d59c.mjs +934 -0
  54. package/dist/index-7ecbf72a.js +2 -0
  55. package/dist/legal.client.cjs +1 -0
  56. package/dist/legal.client.js +8460 -0
  57. package/dist/modules/landing/components/pages/Legal.vue.d.ts +2 -0
  58. package/dist/modules/landing/components/pages/legal/Cookies.vue.d.ts +2 -0
  59. package/dist/modules/landing/components/pages/legal/Privacy.vue.d.ts +2 -0
  60. package/dist/modules/landing/components/pages/legal/Terms.vue.d.ts +2 -0
  61. package/dist/modules/legal/components/pages/Legal.vue.d.ts +2 -0
  62. package/dist/modules/legal/components/pages/legal/Cookies.vue.d.ts +2 -0
  63. package/dist/modules/legal/components/pages/legal/Privacy.vue.d.ts +2 -0
  64. package/dist/modules/legal/components/pages/legal/Terms.vue.d.ts +2 -0
  65. package/dist/organizations-aed4245d.mjs +122 -0
  66. package/dist/organizations-bb8f676d.js +1 -0
  67. package/dist/organizations.client-5548024c.js +3 -0
  68. package/dist/organizations.client-976762d2.mjs +3021 -0
  69. package/dist/organizations.client.cjs +1 -1
  70. package/dist/organizations.client.js +45 -44
  71. package/dist/style.css +1 -1
  72. package/dist/users.client.cjs +1 -1
  73. package/dist/users.client.js +254 -324
  74. package/package.json +5 -1
  75. package/src/modules/community/components/pages/CreateBlogPost.vue +1 -1
  76. package/src/modules/constructor/components/sections/Constructor.vue +3 -3
  77. package/src/modules/landing/landing.client.js +1 -2
  78. package/src/modules/legal/components/pages/Legal.vue +43 -0
  79. package/src/modules/legal/components/pages/legal/Cookies.vue +370 -0
  80. package/src/modules/legal/components/pages/legal/Privacy.vue +4284 -0
  81. package/src/modules/legal/components/pages/legal/Terms.vue +1283 -0
  82. package/src/modules/legal/legal.client.js +18 -0
  83. package/src/modules/legal/router/legal.js +22 -0
  84. package/src/modules/users/components/pages/Profile.vue +13 -0
@@ -0,0 +1 @@
1
+ "use strict";const t=require("vue"),V=require("./index-7ecbf72a.js"),g=require("./_plugin-vue_export-helper-f246444f.js");var $=function e(i,s){if(i===s)return!0;if(i&&s&&typeof i=="object"&&typeof s=="object"){if(i.constructor!==s.constructor)return!1;var n,r,o;if(Array.isArray(i)){if(n=i.length,n!=s.length)return!1;for(r=n;r--!==0;)if(!e(i[r],s[r]))return!1;return!0}if(i.constructor===RegExp)return i.source===s.source&&i.flags===s.flags;if(i.valueOf!==Object.prototype.valueOf)return i.valueOf()===s.valueOf();if(i.toString!==Object.prototype.toString)return i.toString()===s.toString();if(o=Object.keys(i),n=o.length,n!==Object.keys(s).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(s,o[r]))return!1;for(r=n;r--!==0;){var l=o[r];if(!e(i[l],s[l]))return!1}return!0}return i!==i&&s!==s};const O=V.getDefaultExportFromCjs($),B=(e,i)=>i.filter(s=>{const{text:n}=e;if(typeof s.rule=="string")return!new RegExp(s.rule).test(n);if(s.rule instanceof RegExp)return!s.rule.test(n);if({}.toString.call(s.rule)==="[object Function]")return s.rule(e)}).map(s=>s.classes),c=e=>JSON.parse(JSON.stringify(e)),C=(e,i)=>{let s=0;for(;s<e.length;){if(i(e[s],s,e))return s;s++}return-1},k=(e,i,s=[],n)=>{e.text===void 0&&(e={text:e});const r=B(e,s),o=C(i,d=>d===e),l=c(i),a=o!==-1?l.splice(o,1)[0]:c(e);return(n?n(l,a):l.map(d=>d.text).indexOf(a.text)!==-1)&&r.push("ti-duplicate"),r.length===0?r.push("ti-valid"):r.push("ti-invalid"),r},m=(e,...i)=>{e.text===void 0&&(e={text:e});const s=c(e);return s.tiClasses=k(e,...i),s},D=(e,...i)=>e.map(s=>m(s,e,...i));const L={name:"TagInput",props:{scope:{type:Object}}},A=["maxlength"];function N(e,i,s,n,r,o){return s.scope.edit?t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:0,"onUpdate:modelValue":i[0]||(i[0]=l=>s.scope.tag.text=l),maxlength:s.scope.maxlength,type:"text",class:"ti-tag-input",size:"1",onInput:i[1]||(i[1]=l=>s.scope.validateTag(s.scope.index,l)),onBlur:i[2]||(i[2]=l=>s.scope.performCancelEdit(s.scope.index)),onKeydown:i[3]||(i[3]=l=>s.scope.performSaveEdit(s.scope.index,l))},null,40,A)),[[t.vModelText,s.scope.tag.text]]):t.createCommentVNode("",!0)}const M=g._export_sfc(L,[["render",N],["__scopeId","data-v-a1f1c345"]]),b=e=>!e.some(i=>{const s=!i.text;s&&console.warn('Missing property "text"',i);let n=!1;return i.classes&&(n=typeof i.classes!="string"),n&&console.warn('Property "classes" must be type of string',i),s||n}),w=e=>!e.some(i=>{if(typeof i=="number"){const s=isFinite(i)&&Math.floor(i)===i;return s||console.warn("Only numerics are allowed for this prop. Found:",i),!s}else if(typeof i=="string"){const s=/\W|[a-z]|!\d/i.test(i);return s||console.warn("Only alpha strings are allowed for this prop. Found:",i),!s}else return console.warn("Only numeric and string values are allowed. Found:",i),!1}),F={modelValue:{type:String,default:"",required:!0},tags:{type:Array,default:()=>[],validator:b},autocompleteItems:{type:Array,default:()=>[],validator:b},allowEditTags:{type:Boolean,default:!1},autocompleteFilterDuplicates:{default:!0,type:Boolean},addOnlyFromAutocomplete:{type:Boolean,default:!1},autocompleteMinLength:{type:Number,default:1},autocompleteAlwaysOpen:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:"Add Tag"},addOnKey:{type:Array,default:()=>[13],validator:w},saveOnKey:{type:Array,default:()=>[13],validator:w},maxTags:{type:Number},maxlength:{type:Number},validation:{type:Array,default:()=>[],validator(e){return!e.some(i=>{const s=!i.rule;s&&console.warn('Property "rule" is missing',i);const n=i.rule&&(typeof i.rule=="string"||i.rule instanceof RegExp||{}.toString.call(i.rule)==="[object Function]");n||console.warn("A rule must be type of string, RegExp or function. Found:",JSON.stringify(i.rule));const r=!i.classes;r&&console.warn('Property "classes" is missing',i);const o=i.type&&typeof i.type!="string";return o&&console.warn('Property "type" must be type of string. Found:',i),!n||s||r||o})}},separators:{type:Array,default:()=>[";"],validator(e){return!e.some(i=>{const s=typeof i!="string";return s&&console.warn("Separators must be type of string. Found:",i),s})}},avoidAddingDuplicates:{type:Boolean,default:!0},addOnBlur:{type:Boolean,default:!0},isDuplicate:{type:Function,default:null},addFromPaste:{type:Boolean,default:!0},deleteOnBackspace:{default:!0,type:Boolean},onBeforeAddingTag:Function,onBeforeDeletingTag:Function,onBeforeEditingTag:Function,onBeforeSavingTag:Function},I={name:"VueTagsInput",components:{TagInput:M},props:F,emits:["adding-duplicate","before-adding-tag","before-deleting-tag","before-editing-tag","before-saving-tag","max-tags-reached","saving-duplicate","tags-changed","tag-clicked","update:modelValue","update:tags"],inheritAttrs:!1,data(){return{tagCenter:[],newTag:null,tagsCopy:[],tagsEditStatus:null,deletionMark:null,deletionMarkTime:null,selectedItem:null,focused:null}},computed:{autocompleteOpen(){return this.autocompleteAlwaysOpen?!0:this.newTag!==null&&this.newTag.length>=this.autocompleteMinLength&&this.filteredAutocompleteItems.length>0&&this.focused},filteredAutocompleteItems(){const e=this.autocompleteItems.map(i=>m(i,this.tags,this.validation,this.isDuplicate));return this.autocompleteFilterDuplicates?e.filter(this.duplicateFilter):e}},methods:{createClasses:k,getSelectedIndex(e){const i=this.filteredAutocompleteItems,s=this.selectedItem,n=i.length-1;if(i.length!==0)return s===null?0:e==="before"&&s===0?n:e==="after"&&s===n?0:e==="after"?s+1:s-1},selectDefaultItem(){this.addOnlyFromAutocomplete&&this.filteredAutocompleteItems.length>0?this.selectedItem=0:this.selectedItem=null},selectItem(e,i){e.preventDefault(),this.selectedItem=this.getSelectedIndex(i)},isSelected(e){return this.selectedItem===e},isMarked(e){return this.deletionMark===e},setTagCenter(e){e&&this.tagCenter.push(e)},invokeDelete(){if(!this.deleteOnBackspace||this.newTag.length>0)return;const e=this.tagsCopy.length-1;this.deletionMark===null?(this.deletionMarkTime=setTimeout(()=>this.deletionMark=null,1e3),this.deletionMark=e):this.performDeleteTag(e)},addTagsFromPaste(){this.addFromPaste&&setTimeout(()=>this.performAddTags(this.newTag),10)},performEditTag(e){this.allowEditTags&&(this.onBeforeAddingTag||this.editTag(e),this.$emit("before-editing-tag",{index:e,tag:this.tagsCopy[e],editTag:()=>this.editTag(e)}))},editTag(e){this.allowEditTags&&(this.toggleEditMode(e),this.focus(e))},toggleEditMode(e){!this.allowEditTags||this.disabled||(this.tagsEditStatus[e]=!this.tagsEditStatus[e])},createChangedTag(e,i){const s=this.tagsCopy[e];s.text=i?i.target.value:this.tagsCopy[e].text,this.tagsCopy[e]=m(s,this.tagsCopy,this.validation,this.isDuplicate)},focus(e){this.$nextTick(()=>{const i=this.tagCenter[e].querySelector("input.ti-tag-input");i&&i.focus()})},quote(e){return e.replace(/([()[{*+.$^\\|?])/g,"\\$1")},cancelEdit(e){this.tags[e]&&(this.tagsCopy[e]=c(m(this.tags[e],this.tags,this.validation,this.isDuplicate)),this.tagsEditStatus[e]=!1)},hasForbiddingAddRule(e){return e.some(i=>{const s=this.validation.find(n=>i===n.classes);return s?s.disableAdd:!1})},createTagTexts(e){const i=new RegExp(this.separators.map(s=>this.quote(s)).join("|"));return e.split(i).map(s=>({text:s}))},performDeleteTag(e){this.onBeforeDeletingTag||this.deleteTag(e),this.$emit("before-deleting-tag",{index:e,tag:this.tagsCopy[e],deleteTag:()=>this.deleteTag(e)})},deleteTag(e){this.disabled||(this.deletionMark=null,clearTimeout(this.deletionMarkTime),this.tagsCopy.splice(e,1),this.$emit("update:tags",this.tagsCopy),this.$emit("tags-changed",this.tagsCopy))},noTriggerKey(e,i){const s=this[i].indexOf(e.keyCode)!==-1||this[i].indexOf(e.key)!==-1;return s&&e.preventDefault(),!s},performAddTags(e,i,s){if(this.disabled||i&&this.noTriggerKey(i,"addOnKey"))return;let n=[];typeof e=="object"&&(n=[e]),typeof e=="string"&&(n=this.createTagTexts(e)),n=n.filter(r=>r.text.trim().length>0),n.forEach(r=>{r=m(r,this.tags,this.validation,this.isDuplicate),this.onBeforeAddingTag||this.addTag(r,s),this.$emit("before-adding-tag",{tag:r,addTag:()=>this.addTag(r,s)})})},duplicateFilter(e){return this.isDuplicate?!this.isDuplicate(this.tagsCopy,e):!this.tagsCopy.find(i=>i.text===e.text)},addTag(e,i="new-tag-input"){const s=this.filteredAutocompleteItems.map(n=>n.text);this.addOnlyFromAutocomplete&&s.indexOf(e.text)===-1||this.$nextTick(()=>{if(this.maxTags&&this.maxTags<=this.tagsCopy.length)return this.$emit("max-tags-reached",e);if(this.avoidAddingDuplicates&&!this.duplicateFilter(e))return this.$emit("adding-duplicate",e);this.hasForbiddingAddRule(e.tiClasses)||(this.newTag="",this.tagsCopy.push(e),this.$emit("update:tags",this.tagsCopy),i==="autocomplete"&&this.$refs.newTagInput.focus(),this.$emit("tags-changed",this.tagsCopy))})},performSaveTag(e,i){const s=this.tagsCopy[e];this.disabled||i&&this.noTriggerKey(i,"addOnKey")||s.text.trim().length!==0&&(this["on-before-saving-tag"]||this.saveTag(e,s),this.$emit("before-saving-tag",{index:e,tag:s,saveTag:()=>this.saveTag(e,s)}))},saveTag(e,i){if(this.avoidAddingDuplicates){const s=c(this.tagsCopy),n=s.splice(e,1)[0];if(this.isDuplicate?this.isDuplicate(s,n):s.map(o=>o.text).indexOf(n.text)!==-1)return this.$emit("saving-duplicate",i)}this.hasForbiddingAddRule(i.tiClasses)||(this.tagsCopy[e]=i,this.toggleEditMode(e),this.$emit("update:tags",this.tagsCopy),this.$emit("tags-changed",this.tagsCopy))},tagsEqual(){return!this.tagsCopy.some((e,i)=>!O(e,this.tags[i]))},updateNewTag(e){const i=e.target.value;this.newTag=i,this.$emit("update:modelValue",i)},initTags(){this.tagsCopy=D(this.tags,this.validation,this.isDuplicate),this.tagsEditStatus=c(this.tags).map(()=>!1),this.tagsEqual()||this.$emit("update:tags",this.tagsCopy)},blurredOnClick(e){this.$el.contains(e.target)||this.$el.contains(document.activeElement)||this.performBlur(e)},performBlur(){this.addOnBlur&&this.focused&&this.performAddTags(this.newTag),this.focused=!1}},watch:{modelValue(e){this.addOnlyFromAutocomplete||(this.selectedItem=null),this.newTag=e},tags:{handler(){this.initTags()},deep:!0},autocompleteOpen:"selectDefaultItem"},created(){this.newTag=this.modelValue,this.initTags()},mounted(){this.selectDefaultItem(),document.addEventListener("click",this.blurredOnClick)},beforeUpdate(){this.tagCenter=[]},unmounted(){document.removeEventListener("click",this.blurredOnClick)}};const K={class:"ti-input"},P={key:0,class:"ti-tags"},z=["onClick"],R={class:"ti-content"},H={key:0,class:"ti-tag-left"},G=["onClick"],j={key:1,class:"ti-tag-right"},q={class:"ti-actions"},U=["onClick"],J=["onClick"],W={class:"ti-new-tag-input-wrapper"},Y=["placeholder","value","maxlength","disabled"],Q=["onMouseover"],X=["onClick"];function Z(e,i,s,n,r,o){const l=t.resolveComponent("tag-input");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["vue-tags-input",[{"ti-disabled":e.disabled},{"ti-focus":e.focused},e.$attrs.class]]),style:t.normalizeStyle(e.$attrs.style)},[t.createElementVNode("div",K,[e.tagsCopy?(t.openBlock(),t.createElementBlock("ul",P,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.tagsCopy,(a,u)=>(t.openBlock(),t.createElementBlock("li",{key:u,style:t.normalizeStyle(a.style),class:t.normalizeClass([[{"ti-editing":e.tagsEditStatus[u]},a.tiClasses,a.classes,{"ti-deletion-mark":e.isMarked(u)}],"ti-tag"]),tabindex:"0",onClick:d=>e.$emit("tag-clicked",{tag:a,index:u})},[t.createElementVNode("div",R,[e.$slots["tag-left"]?(t.openBlock(),t.createElementBlock("div",H,[t.renderSlot(e.$slots,"tag-left",{tag:a,index:u,edit:e.tagsEditStatus[u],performSaveEdit:e.performSaveTag,performDelete:e.performDeleteTag,performCancelEdit:e.cancelEdit,performOpenEdit:e.performEditTag,deletionMark:e.isMarked(u)},void 0,!0)])):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_for:!0,ref:e.setTagCenter,class:"ti-tag-center"},[e.$slots["tag-center"]?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass({"ti-hidden":e.tagsEditStatus[u]}),onClick:d=>e.performEditTag(u)},t.toDisplayString(a.text),11,G)),e.$slots["tag-center"]?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(l,{key:1,scope:{edit:e.tagsEditStatus[u],maxlength:e.maxlength,tag:a,index:u,validateTag:e.createChangedTag,performCancelEdit:e.cancelEdit,performSaveEdit:e.performSaveTag}},null,8,["scope"])),t.renderSlot(e.$slots,"tag-center",{tag:a,index:u,maxlength:e.maxlength,edit:e.tagsEditStatus[u],performSaveEdit:e.performSaveTag,performDelete:e.performDeleteTag,performCancelEdit:e.cancelEdit,validateTag:e.createChangedTag,performOpenEdit:e.performEditTag,deletionMark:e.isMarked(u)},void 0,!0)],512),e.$slots["tag-right"]?(t.openBlock(),t.createElementBlock("div",j,[t.renderSlot(e.$slots,"tag-right",{tag:a,index:u,edit:e.tagsEditStatus[u],performSaveEdit:e.performSaveTag,performDelete:e.performDeleteTag,performCancelEdit:e.cancelEdit,performOpenEdit:e.performEditTag,deletionMark:e.isMarked(u)},void 0,!0)])):t.createCommentVNode("",!0)]),t.createElementVNode("div",q,[e.$slots["tag-actions"]?t.createCommentVNode("",!0):t.withDirectives((t.openBlock(),t.createElementBlock("i",{key:0,class:"ti-icon-undo",onClick:d=>e.cancelEdit(u)},null,8,U)),[[t.vShow,e.tagsEditStatus[u]]]),e.$slots["tag-actions"]?t.createCommentVNode("",!0):t.withDirectives((t.openBlock(),t.createElementBlock("i",{key:1,class:"ti-icon-close",onClick:d=>e.performDeleteTag(u)},null,8,J)),[[t.vShow,!e.tagsEditStatus[u]]]),e.$slots["tag-actions"]?t.renderSlot(e.$slots,"tag-actions",{key:2,tag:a,index:u,edit:e.tagsEditStatus[u],performSaveEdit:e.performSaveTag,performDelete:e.performDeleteTag,performCancelEdit:e.cancelEdit,performOpenEdit:e.performEditTag,deletionMark:e.isMarked(u)},void 0,!0):t.createCommentVNode("",!0)])],14,z))),128)),t.createElementVNode("li",W,[t.createElementVNode("input",t.mergeProps({ref:"newTagInput"},e.$attrs,{class:[[e.createClasses(e.newTag,e.tags,e.validation,e.isDuplicate)],"ti-new-tag-input"],placeholder:e.placeholder,value:e.newTag,maxlength:e.maxlength,disabled:e.disabled,type:"text",size:"1",onKeydown:[i[0]||(i[0]=a=>e.performAddTags(e.filteredAutocompleteItems[e.selectedItem]||e.newTag,a)),i[2]||(i[2]=t.withKeys((...a)=>e.invokeDelete&&e.invokeDelete(...a),["delete"])),i[3]||(i[3]=t.withKeys((...a)=>e.performBlur&&e.performBlur(...a),["tab"])),i[4]||(i[4]=t.withKeys(a=>e.selectItem(a,"before"),["up"])),i[5]||(i[5]=t.withKeys(a=>e.selectItem(a,"after"),["down"]))],onPaste:i[1]||(i[1]=(...a)=>e.addTagsFromPaste&&e.addTagsFromPaste(...a)),onInput:i[6]||(i[6]=(...a)=>e.updateNewTag&&e.updateNewTag(...a)),onFocus:i[7]||(i[7]=a=>e.focused=!0),onClick:i[8]||(i[8]=a=>e.addOnlyFromAutocomplete?!1:e.selectedItem=null)}),null,16,Y)])])):t.createCommentVNode("",!0)]),t.renderSlot(e.$slots,"between-elements",{},void 0,!0),e.autocompleteOpen?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["ti-autocomplete",e.$attrs.class]),onMouseout:i[9]||(i[9]=a=>e.selectedItem=null)},[t.renderSlot(e.$slots,"autocomplete-header",{},void 0,!0),t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filteredAutocompleteItems,(a,u)=>(t.openBlock(),t.createElementBlock("li",{key:u,style:t.normalizeStyle(a.style),class:t.normalizeClass([[a.tiClasses,a.classes,{"ti-selected-item":e.isSelected(u)}],"ti-item"]),onMouseover:d=>e.disabled?!1:e.selectedItem=u},[e.$slots["autocomplete-item"]?t.renderSlot(e.$slots,"autocomplete-item",{key:1,item:a,index:u,performAdd:d=>e.performAddTags(d,void 0,"autocomplete"),selected:e.isSelected(u)},void 0,!0):(t.openBlock(),t.createElementBlock("div",{key:0,onClick:d=>e.performAddTags(a,void 0,"autocomplete")},t.toDisplayString(a.text),9,X))],46,Q))),128))]),t.renderSlot(e.$slots,"autocomplete-footer",{},void 0,!0)],34)):t.createCommentVNode("",!0)],6)}const x=g._export_sfc(I,[["render",Z],["__scopeId","data-v-d14eec25"]]);const _=t.createElementVNode("h5",{class:"mn-thin"},"Tags (maximum 20):",-1),ee={class:"mn-medium"},te=t.createElementVNode("p",{class:"p-small mn-thin"},"Suggested:",-1),ie=["onClick"],se={key:1},le={__name:"BlockTags",props:["tags"],emits:["tags-changed"],setup(e,{emit:i}){const s=e,n=t.ref(""),r=t.ref([]),o=t.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);s.tags&&(r.value=s.tags.map(h=>({text:h})));const l=t.computed(()=>o.value.filter(h=>h.text.toLowerCase().includes(n.value.toLowerCase()))),a=t.computed(()=>o.value.filter(h=>!r.value.some(p=>p.text===h.text)));function u(h){r.value.push(h),i("tags-changed",r.value.map(p=>p.text))}function d(h){r.value=h,i("tags-changed",r.value.map(p=>p.text))}return(h,p)=>(t.openBlock(),t.createElementBlock("div",null,[_,t.createVNode(x,{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=f=>n.value=f),tags:r.value,"autocomplete-items":t.unref(l),"add-on-key":[13,":",";",","],"save-on-key":[13,":",";",","],separators:[";",","],"max-tags":20,maxlength:20,placeholder:"Please add tags","add-from-paste":!0,"allow-edit-tags":!0,onTagsChanged:d,class:"mn-thin bg-grey radius-medium pd-small"},null,8,["modelValue","tags","autocomplete-items"]),t.createElementVNode("p",ee,[te,t.unref(a).length>0?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(t.unref(a),(f,E)=>(t.openBlock(),t.createElementBlock("span",{onClick:Fe=>u(f),class:t.normalizeClass(["cursor-pointer ti-tag-toDefactor",{"mn-r-micro":E!==t.unref(a).length-1}])},t.toDisplayString(f.text),11,ie))),256)):(t.openBlock(),t.createElementBlock("span",se,"You added all suggested tags"))])]))}};const ne={class:"flex-v-center flex-nowrap flex"},re={key:0,class:"mn-r-auto t-transp mn-r-small"},ae=["name","value","checked"],oe={__name:"Checkbox",props:{label:String,name:String,value:String,radio:{type:[Array,Boolean,Object],default:()=>[]}},emits:["update:radio"],setup(e,{emit:i}){const s=e,n=r=>{if(Array.isArray(s.radio)){let o=[...s.radio];if(r.target.checked)o.push(s.value);else{const l=o.indexOf(s.value);l!==-1&&o.splice(l,1)}i("update:radio",o)}else typeof s.radio=="boolean"&&i("update:radio",r.target.checked)};return(r,o)=>(t.openBlock(),t.createElementBlock("label",ne,[e.label?(t.openBlock(),t.createElementBlock("div",re,[t.createElementVNode("span",null,t.toDisplayString(e.label),1)])):t.createCommentVNode("",!0),t.createElementVNode("input",{onChange:n,class:"round radiobutton",type:"checkbox",name:e.name,value:e.value,checked:Array.isArray(e.radio)?e.radio.includes(e.value):e.radio},null,40,ae),t.createElementVNode("div",{class:t.normalizeClass(["transition-elastic pd-thin h-2r w-4r radius-extra",{"bg-grey":!(Array.isArray(e.radio)?e.radio.includes(e.value):e.radio),"bg-main":Array.isArray(e.radio)?e.radio.includes(e.value):e.radio}])},[t.createElementVNode("div",{class:t.normalizeClass(["transition-linear w-1r h-1r radius-extra h-100 bg-white",{"mn-r-auto":!(Array.isArray(e.radio)?e.radio.includes(e.value):e.radio),"mn-l-auto":Array.isArray(e.radio)?e.radio.includes(e.value):e.radio}])},null,2)],2)]))}},ue=g._export_sfc(oe,[["__scopeId","data-v-f641f618"]]);function y(e){return e===0?!1:Array.isArray(e)&&e.length===0?!0:!e}function de(e){return(...i)=>!e(...i)}function he(e,i){return e===void 0&&(e="undefined"),e===null&&(e="null"),e===!1&&(e="false"),e.toString().toLowerCase().indexOf(i.trim())!==-1}function T(e,i,s,n){return i?e.filter(r=>he(n(r,s),i)).sort((r,o)=>n(r,s).length-n(o,s).length):e}function pe(e){return e.filter(i=>!i.$isLabel)}function v(e,i){return s=>s.reduce((n,r)=>r[e]&&r[e].length?(n.push({$groupLabel:r[i],$isLabel:!0}),n.concat(r[e])):n,[])}function ce(e,i,s,n,r){return o=>o.map(l=>{if(!l[s])return console.warn("Options passed to vue-multiselect do not contain groups, despite the config."),[];const a=T(l[s],e,i,r);return a.length?{[n]:l[n],[s]:a}:[]})}const S=(...e)=>i=>e.reduce((s,n)=>n(s),i),me={data(){return{search:"",isOpen:!1,preferredOpenDirection:"below",optimizedHeight:this.maxHeight}},props:{internalSearch:{type:Boolean,default:!0},options:{type:Array,required:!0},multiple:{type:Boolean,default:!1},trackBy:{type:String},label:{type:String},searchable:{type:Boolean,default:!0},clearOnSelect:{type:Boolean,default:!0},hideSelected:{type:Boolean,default:!1},placeholder:{type:String,default:"Select option"},allowEmpty:{type:Boolean,default:!0},resetAfter:{type:Boolean,default:!1},closeOnSelect:{type:Boolean,default:!0},customLabel:{type:Function,default(e,i){return y(e)?"":i?e[i]:e}},taggable:{type:Boolean,default:!1},tagPlaceholder:{type:String,default:"Press enter to create a tag"},tagPosition:{type:String,default:"top"},max:{type:[Number,Boolean],default:!1},id:{default:null},optionsLimit:{type:Number,default:1e3},groupValues:{type:String},groupLabel:{type:String},groupSelect:{type:Boolean,default:!1},blockKeys:{type:Array,default(){return[]}},preserveSearch:{type:Boolean,default:!1},preselectFirst:{type:Boolean,default:!1},preventAutofocus:{type:Boolean,default:!1}},mounted(){!this.multiple&&this.max&&console.warn("[Vue-Multiselect warn]: Max prop should not be used when prop Multiple equals false."),this.preselectFirst&&!this.internalValue.length&&this.options.length&&this.select(this.filteredOptions[0])},computed:{internalValue(){return this.modelValue||this.modelValue===0?Array.isArray(this.modelValue)?this.modelValue:[this.modelValue]:[]},filteredOptions(){const e=this.search||"",i=e.toLowerCase().trim();let s=this.options.concat();return this.internalSearch?s=this.groupValues?this.filterAndFlat(s,i,this.label):T(s,i,this.label,this.customLabel):s=this.groupValues?v(this.groupValues,this.groupLabel)(s):s,s=this.hideSelected?s.filter(de(this.isSelected)):s,this.taggable&&i.length&&!this.isExistingOption(i)&&(this.tagPosition==="bottom"?s.push({isTag:!0,label:e}):s.unshift({isTag:!0,label:e})),s.slice(0,this.optionsLimit)},valueKeys(){return this.trackBy?this.internalValue.map(e=>e[this.trackBy]):this.internalValue},optionKeys(){return(this.groupValues?this.flatAndStrip(this.options):this.options).map(i=>this.customLabel(i,this.label).toString().toLowerCase())},currentOptionLabel(){return this.multiple?this.searchable?"":this.placeholder:this.internalValue.length?this.getOptionLabel(this.internalValue[0]):this.searchable?"":this.placeholder}},watch:{internalValue:{handler(){this.resetAfter&&this.internalValue.length&&(this.search="",this.$emit("update:modelValue",this.multiple?[]:null))},deep:!0},search(){this.$emit("search-change",this.search)}},emits:["open","search-change","close","select","update:modelValue","remove","tag"],methods:{getValue(){return this.multiple?this.internalValue:this.internalValue.length===0?null:this.internalValue[0]},filterAndFlat(e,i,s){return S(ce(i,s,this.groupValues,this.groupLabel,this.customLabel),v(this.groupValues,this.groupLabel))(e)},flatAndStrip(e){return S(v(this.groupValues,this.groupLabel),pe)(e)},updateSearch(e){this.search=e},isExistingOption(e){return this.options?this.optionKeys.indexOf(e)>-1:!1},isSelected(e){const i=this.trackBy?e[this.trackBy]:e;return this.valueKeys.indexOf(i)>-1},isOptionDisabled(e){return!!e.$isDisabled},getOptionLabel(e){if(y(e))return"";if(e.isTag)return e.label;if(e.$isLabel)return e.$groupLabel;const i=this.customLabel(e,this.label);return y(i)?"":i},select(e,i){if(e.$isLabel&&this.groupSelect){this.selectGroup(e);return}if(!(this.blockKeys.indexOf(i)!==-1||this.disabled||e.$isDisabled||e.$isLabel)&&!(this.max&&this.multiple&&this.internalValue.length===this.max)&&!(i==="Tab"&&!this.pointerDirty)){if(e.isTag)this.$emit("tag",e.label,this.id),this.search="",this.closeOnSelect&&!this.multiple&&this.deactivate();else{if(this.isSelected(e)){i!=="Tab"&&this.removeElement(e);return}this.multiple?this.$emit("update:modelValue",this.internalValue.concat([e])):this.$emit("update:modelValue",e),this.$emit("select",e,this.id),this.clearOnSelect&&(this.search="")}this.closeOnSelect&&this.deactivate()}},selectGroup(e){const i=this.options.find(s=>s[this.groupLabel]===e.$groupLabel);if(i){if(this.wholeGroupSelected(i)){this.$emit("remove",i[this.groupValues],this.id);const s=this.internalValue.filter(n=>i[this.groupValues].indexOf(n)===-1);this.$emit("update:modelValue",s)}else{let s=i[this.groupValues].filter(n=>!(this.isOptionDisabled(n)||this.isSelected(n)));this.max&&s.splice(this.max-this.internalValue.length),this.$emit("select",s,this.id),this.$emit("update:modelValue",this.internalValue.concat(s))}this.closeOnSelect&&this.deactivate()}},wholeGroupSelected(e){return e[this.groupValues].every(i=>this.isSelected(i)||this.isOptionDisabled(i))},wholeGroupDisabled(e){return e[this.groupValues].every(this.isOptionDisabled)},removeElement(e,i=!0){if(this.disabled||e.$isDisabled)return;if(!this.allowEmpty&&this.internalValue.length<=1){this.deactivate();return}const s=typeof e=="object"?this.valueKeys.indexOf(e[this.trackBy]):this.valueKeys.indexOf(e);if(this.multiple){const n=this.internalValue.slice(0,s).concat(this.internalValue.slice(s+1));this.$emit("update:modelValue",n)}else this.$emit("update:modelValue",null);this.$emit("remove",e,this.id),this.closeOnSelect&&i&&this.deactivate()},removeLastElement(){this.blockKeys.indexOf("Delete")===-1&&this.search.length===0&&Array.isArray(this.internalValue)&&this.internalValue.length&&this.removeElement(this.internalValue[this.internalValue.length-1],!1)},activate(){this.isOpen||this.disabled||(this.adjustPosition(),this.groupValues&&this.pointer===0&&this.filteredOptions.length&&(this.pointer=1),this.isOpen=!0,this.searchable?(this.preserveSearch||(this.search=""),this.preventAutofocus||this.$nextTick(()=>this.$refs.search&&this.$refs.search.focus())):this.preventAutofocus||typeof this.$el<"u"&&this.$el.focus(),this.$emit("open",this.id))},deactivate(){this.isOpen&&(this.isOpen=!1,this.searchable?typeof this.$refs.search<"u"&&this.$refs.search.blur():typeof this.$el<"u"&&this.$el.blur(),this.preserveSearch||(this.search=""),this.$emit("close",this.getValue(),this.id))},toggle(){this.isOpen?this.deactivate():this.activate()},adjustPosition(){if(typeof window>"u")return;const e=this.$el.getBoundingClientRect().top,i=window.innerHeight-this.$el.getBoundingClientRect().bottom;i>this.maxHeight||i>e||this.openDirection==="below"||this.openDirection==="bottom"?(this.preferredOpenDirection="below",this.optimizedHeight=Math.min(i-40,this.maxHeight)):(this.preferredOpenDirection="above",this.optimizedHeight=Math.min(e-40,this.maxHeight))}}},fe={data(){return{pointer:0,pointerDirty:!1}},props:{showPointer:{type:Boolean,default:!0},optionHeight:{type:Number,default:40}},computed:{pointerPosition(){return this.pointer*this.optionHeight},visibleElements(){return this.optimizedHeight/this.optionHeight}},watch:{filteredOptions(){this.pointerAdjust()},isOpen(){this.pointerDirty=!1},pointer(){this.$refs.search&&this.$refs.search.setAttribute("aria-activedescendant",this.id+"-"+this.pointer.toString())}},methods:{optionHighlight(e,i){return{"multiselect__option--highlight":e===this.pointer&&this.showPointer,"multiselect__option--selected":this.isSelected(i)}},groupHighlight(e,i){if(!this.groupSelect)return["multiselect__option--disabled",{"multiselect__option--group":i.$isLabel}];const s=this.options.find(n=>n[this.groupLabel]===i.$groupLabel);return s&&!this.wholeGroupDisabled(s)?["multiselect__option--group",{"multiselect__option--highlight":e===this.pointer&&this.showPointer},{"multiselect__option--group-selected":this.wholeGroupSelected(s)}]:"multiselect__option--disabled"},addPointerElement({key:e}="Enter"){this.filteredOptions.length>0&&this.select(this.filteredOptions[this.pointer],e),this.pointerReset()},pointerForward(){this.pointer<this.filteredOptions.length-1&&(this.pointer++,this.$refs.list.scrollTop<=this.pointerPosition-(this.visibleElements-1)*this.optionHeight&&(this.$refs.list.scrollTop=this.pointerPosition-(this.visibleElements-1)*this.optionHeight),this.filteredOptions[this.pointer]&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerForward()),this.pointerDirty=!0},pointerBackward(){this.pointer>0?(this.pointer--,this.$refs.list.scrollTop>=this.pointerPosition&&(this.$refs.list.scrollTop=this.pointerPosition),this.filteredOptions[this.pointer]&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerBackward()):this.filteredOptions[this.pointer]&&this.filteredOptions[0].$isLabel&&!this.groupSelect&&this.pointerForward(),this.pointerDirty=!0},pointerReset(){this.closeOnSelect&&(this.pointer=0,this.$refs.list&&(this.$refs.list.scrollTop=0))},pointerAdjust(){this.pointer>=this.filteredOptions.length-1&&(this.pointer=this.filteredOptions.length?this.filteredOptions.length-1:0),this.filteredOptions.length>0&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerForward()},pointerSet(e){this.pointer=e,this.pointerDirty=!0}}};const ge={name:"vue-multiselect",mixins:[me,fe],compatConfig:{MODE:3,ATTR_ENUMERATED_COERCION:!1},props:{name:{type:String,default:""},modelValue:{type:null,default(){return[]}},selectLabel:{type:String,default:"Press enter to select"},selectGroupLabel:{type:String,default:"Press enter to select group"},selectedLabel:{type:String,default:"Selected"},deselectLabel:{type:String,default:"Press enter to remove"},deselectGroupLabel:{type:String,default:"Press enter to deselect group"},showLabels:{type:Boolean,default:!0},limit:{type:Number,default:99999},maxHeight:{type:Number,default:300},limitText:{type:Function,default:e=>`and ${e} more`},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},openDirection:{type:String,default:""},showNoOptions:{type:Boolean,default:!0},showNoResults:{type:Boolean,default:!0},tabindex:{type:Number,default:0}},computed:{hasOptionGroup(){return this.groupValues&&this.groupLabel&&this.groupSelect},isSingleLabelVisible(){return(this.singleValue||this.singleValue===0)&&(!this.isOpen||!this.searchable)&&!this.visibleValues.length},isPlaceholderVisible(){return!this.internalValue.length&&(!this.searchable||!this.isOpen)},visibleValues(){return this.multiple?this.internalValue.slice(0,this.limit):[]},singleValue(){return this.internalValue[0]},deselectLabelText(){return this.showLabels?this.deselectLabel:""},deselectGroupLabelText(){return this.showLabels?this.deselectGroupLabel:""},selectLabelText(){return this.showLabels?this.selectLabel:""},selectGroupLabelText(){return this.showLabels?this.selectGroupLabel:""},selectedLabelText(){return this.showLabels?this.selectedLabel:""},inputStyle(){return this.searchable||this.multiple&&this.modelValue&&this.modelValue.length?this.isOpen?{width:"100%"}:{width:"0",position:"absolute",padding:"0"}:""},contentStyle(){return this.options.length?{display:"inline-block"}:{display:"block"}},isAbove(){return this.openDirection==="above"||this.openDirection==="top"?!0:this.openDirection==="below"||this.openDirection==="bottom"?!1:this.preferredOpenDirection==="above"},showSearchInput(){return this.searchable&&(this.hasSingleSelectedSlot&&(this.visibleSingleValue||this.visibleSingleValue===0)?this.isOpen:!0)}}},ye=["tabindex","aria-owns"],ve={ref:"tags",class:"multiselect__tags"},be={class:"multiselect__tags-wrap"},we=["textContent"],Se=["onKeypress","onMousedown"],ke=["textContent"],Te={class:"multiselect__spinner"},Ee=["name","id","placeholder","value","disabled","tabindex","aria-controls"],Ve=["id"],$e={key:0},Oe={class:"multiselect__option"},Be=["id","role"],Ce=["onClick","onMouseenter","data-select","data-selected","data-deselect"],De=["data-select","data-deselect","onMouseenter","onMousedown"],Le={class:"multiselect__option"},Ae={class:"multiselect__option"};function Ne(e,i,s,n,r,o){return t.openBlock(),t.createElementBlock("div",{tabindex:e.searchable?-1:s.tabindex,class:t.normalizeClass([{"multiselect--active":e.isOpen,"multiselect--disabled":s.disabled,"multiselect--above":o.isAbove,"multiselect--has-options-group":o.hasOptionGroup},"multiselect"]),onFocus:i[13]||(i[13]=l=>e.activate()),onBlur:i[14]||(i[14]=l=>e.searchable?!1:e.deactivate()),onKeydown:[i[15]||(i[15]=t.withKeys(t.withModifiers(l=>e.pointerForward(),["self","prevent"]),["down"])),i[16]||(i[16]=t.withKeys(t.withModifiers(l=>e.pointerBackward(),["self","prevent"]),["up"]))],onKeypress:i[17]||(i[17]=t.withKeys(t.withModifiers(l=>e.addPointerElement(l),["stop","self"]),["enter","tab"])),onKeyup:i[18]||(i[18]=t.withKeys(l=>e.deactivate(),["esc"])),role:"combobox","aria-owns":"listbox-"+e.id},[t.renderSlot(e.$slots,"caret",{toggle:e.toggle},()=>[t.createElementVNode("div",{onMousedown:i[0]||(i[0]=t.withModifiers(l=>e.toggle(),["prevent","stop"])),class:"multiselect__select"},null,32)]),t.renderSlot(e.$slots,"clear",{search:e.search}),t.createElementVNode("div",ve,[t.renderSlot(e.$slots,"selection",{search:e.search,remove:e.removeElement,values:o.visibleValues,isOpen:e.isOpen},()=>[t.withDirectives(t.createElementVNode("div",be,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.visibleValues,(l,a)=>t.renderSlot(e.$slots,"tag",{option:l,search:e.search,remove:e.removeElement},()=>[(t.openBlock(),t.createElementBlock("span",{class:"multiselect__tag",key:a},[t.createElementVNode("span",{textContent:t.toDisplayString(e.getOptionLabel(l))},null,8,we),t.createElementVNode("i",{tabindex:"1",onKeypress:t.withKeys(t.withModifiers(u=>e.removeElement(l),["prevent"]),["enter"]),onMousedown:t.withModifiers(u=>e.removeElement(l),["prevent"]),class:"multiselect__tag-icon"},null,40,Se)]))])),256))],512),[[t.vShow,o.visibleValues.length>0]]),e.internalValue&&e.internalValue.length>s.limit?t.renderSlot(e.$slots,"limit",{key:0},()=>[t.createElementVNode("strong",{class:"multiselect__strong",textContent:t.toDisplayString(s.limitText(e.internalValue.length-s.limit))},null,8,ke)]):t.createCommentVNode("",!0)]),t.createVNode(t.Transition,{name:"multiselect__loading"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"loading",{},()=>[t.withDirectives(t.createElementVNode("div",Te,null,512),[[t.vShow,s.loading]])])]),_:3}),e.searchable?(t.openBlock(),t.createElementBlock("input",{key:0,ref:"search",name:s.name,id:e.id,type:"text",autocomplete:"off",spellcheck:"false",placeholder:e.placeholder,style:t.normalizeStyle(o.inputStyle),value:e.search,disabled:s.disabled,tabindex:s.tabindex,onInput:i[1]||(i[1]=l=>e.updateSearch(l.target.value)),onFocus:i[2]||(i[2]=t.withModifiers(l=>e.activate(),["prevent"])),onBlur:i[3]||(i[3]=t.withModifiers(l=>e.deactivate(),["prevent"])),onKeyup:i[4]||(i[4]=t.withKeys(l=>e.deactivate(),["esc"])),onKeydown:[i[5]||(i[5]=t.withKeys(t.withModifiers(l=>e.pointerForward(),["prevent"]),["down"])),i[6]||(i[6]=t.withKeys(t.withModifiers(l=>e.pointerBackward(),["prevent"]),["up"])),i[8]||(i[8]=t.withKeys(t.withModifiers(l=>e.removeLastElement(),["stop"]),["delete"]))],onKeypress:i[7]||(i[7]=t.withKeys(t.withModifiers(l=>e.addPointerElement(l),["prevent","stop","self"]),["enter"])),class:"multiselect__input","aria-controls":"listbox-"+e.id},null,44,Ee)):t.createCommentVNode("",!0),o.isSingleLabelVisible?(t.openBlock(),t.createElementBlock("span",{key:1,class:"multiselect__single",onMousedown:i[9]||(i[9]=t.withModifiers((...l)=>e.toggle&&e.toggle(...l),["prevent"]))},[t.renderSlot(e.$slots,"singleLabel",{option:o.singleValue},()=>[t.createTextVNode(t.toDisplayString(e.currentOptionLabel),1)])],32)):t.createCommentVNode("",!0),o.isPlaceholderVisible?(t.openBlock(),t.createElementBlock("span",{key:2,class:"multiselect__placeholder",onMousedown:i[10]||(i[10]=t.withModifiers((...l)=>e.toggle&&e.toggle(...l),["prevent"]))},[t.renderSlot(e.$slots,"placeholder",{},()=>[t.createTextVNode(t.toDisplayString(e.placeholder),1)])],32)):t.createCommentVNode("",!0)],512),t.createVNode(t.Transition,{name:"multiselect"},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(["multiselect__content-wrapper",e.$attrs.class]),onFocus:i[11]||(i[11]=(...l)=>e.activate&&e.activate(...l)),tabindex:"-1",onMousedown:i[12]||(i[12]=t.withModifiers(()=>{},["prevent"])),style:t.normalizeStyle({maxHeight:e.optimizedHeight+"px"}),ref:"list"},[t.createElementVNode("ul",{class:"multiselect__content",style:t.normalizeStyle(o.contentStyle),role:"listbox",id:"listbox-"+e.id},[t.renderSlot(e.$slots,"beforeList"),e.multiple&&e.max===e.internalValue.length?(t.openBlock(),t.createElementBlock("li",$e,[t.createElementVNode("span",Oe,[t.renderSlot(e.$slots,"maxElements",{},()=>[t.createTextVNode("Maximum of "+t.toDisplayString(e.max)+" options selected. First remove a selected option to select another.",1)])])])):t.createCommentVNode("",!0),!e.max||e.internalValue.length<e.max?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(e.filteredOptions,(l,a)=>(t.openBlock(),t.createElementBlock("li",{class:"multiselect__element",key:a,id:e.id+"-"+a,role:l&&(l.$isLabel||l.$isDisabled)?null:"option"},[l&&(l.$isLabel||l.$isDisabled)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.optionHighlight(a,l),"multiselect__option"]),onClick:t.withModifiers(u=>e.select(l),["stop"]),onMouseenter:t.withModifiers(u=>e.pointerSet(a),["self"]),"data-select":l&&l.isTag?e.tagPlaceholder:o.selectLabelText,"data-selected":o.selectedLabelText,"data-deselect":o.deselectLabelText},[t.renderSlot(e.$slots,"option",{option:l,search:e.search,index:a},()=>[t.createElementVNode("span",null,t.toDisplayString(e.getOptionLabel(l)),1)])],42,Ce)),l&&(l.$isLabel||l.$isDisabled)?(t.openBlock(),t.createElementBlock("span",{key:1,"data-select":e.groupSelect&&o.selectGroupLabelText,"data-deselect":e.groupSelect&&o.deselectGroupLabelText,class:t.normalizeClass([e.groupHighlight(a,l),"multiselect__option"]),onMouseenter:t.withModifiers(u=>e.groupSelect&&e.pointerSet(a),["self"]),onMousedown:t.withModifiers(u=>e.selectGroup(l),["prevent"])},[t.renderSlot(e.$slots,"option",{option:l,search:e.search,index:a},()=>[t.createElementVNode("span",null,t.toDisplayString(e.getOptionLabel(l)),1)])],42,De)):t.createCommentVNode("",!0)],8,Be))),128)):t.createCommentVNode("",!0),t.withDirectives(t.createElementVNode("li",null,[t.createElementVNode("span",Le,[t.renderSlot(e.$slots,"noResult",{search:e.search},()=>[t.createTextVNode("No elements found. Consider changing the search query.")])])],512),[[t.vShow,s.showNoResults&&e.filteredOptions.length===0&&e.search&&!s.loading]]),t.withDirectives(t.createElementVNode("li",null,[t.createElementVNode("span",Ae,[t.renderSlot(e.$slots,"noOptions",{},()=>[t.createTextVNode("List is empty.")])])],512),[[t.vShow,s.showNoOptions&&(e.options.length===0||o.hasOptionGroup===!0&&e.filteredOptions.length===0)&&!e.search&&!s.loading]]),t.renderSlot(e.$slots,"afterList")],12,Ve)],38),[[t.vShow,e.isOpen]])]),_:3})],42,ye)}const Me=g._export_sfc(ge,[["render",Ne]]);exports.Checkbox=ue;exports.SelectMulti=Me;exports._sfc_main=le;
@@ -0,0 +1,296 @@
1
+ import { ref as f, openBlock as u, createElementBlock as o, Fragment as p, createElementVNode as e, normalizeClass as y, toDisplayString as h, createCommentVNode as d, createVNode as v, Transition as m, withCtx as b, withModifiers as x, renderSlot as k, createTextVNode as c } from "vue";
2
+ import "./index-0ab9d59c.mjs";
3
+ import { _ as w } from "./_plugin-vue_export-helper-dad06003.mjs";
4
+ const C = {
5
+ key: 0,
6
+ class: "t-transp mn-r-small"
7
+ }, N = { class: "w-100" }, _ = ["type", "value", "placeholder"], M = ["value", "placeholder"], B = {
8
+ key: 0,
9
+ class: "mn-t-thin mn-thin mn-b-thin invalid-feedback"
10
+ }, F = {
11
+ __name: "Field",
12
+ props: {
13
+ label: null,
14
+ type: "text",
15
+ placeholder: "Enter something here",
16
+ field: null,
17
+ validation: !1,
18
+ disabled: !1
19
+ },
20
+ emits: ["update:field", "focus", "blur"],
21
+ setup(a, { emit: n }) {
22
+ const i = f(a.field);
23
+ return (r, t) => (u(), o(p, null, [
24
+ e("div", {
25
+ class: y([[r.$attrs.class, { "bg-fourth-nano": a.validation }], "flex-center flex-nowrap flex"])
26
+ }, [
27
+ a.label ? (u(), o("div", C, [
28
+ e("span", null, h(a.label), 1)
29
+ ])) : d("", !0),
30
+ e("div", N, [
31
+ a.type !== "textarea" ? (u(), o("input", {
32
+ key: 0,
33
+ onInput: t[0] || (t[0] = (l) => i.value = n("update:field", l.target.value)),
34
+ onFocus: t[1] || (t[1] = (l) => n("focus", l)),
35
+ onBlur: t[2] || (t[2] = (l) => n("blur", l)),
36
+ type: a.type,
37
+ class: "w-100",
38
+ value: a.field,
39
+ placeholder: a.placeholder
40
+ }, null, 40, _)) : (u(), o("textarea", {
41
+ key: 1,
42
+ onInput: t[3] || (t[3] = (l) => i.value = n("update:field", l.target.value)),
43
+ onFocus: t[4] || (t[4] = (l) => n("focus", l)),
44
+ onBlur: t[5] || (t[5] = (l) => n("blur", l)),
45
+ class: "w-100",
46
+ value: a.field,
47
+ placeholder: a.placeholder
48
+ }, null, 40, M))
49
+ ])
50
+ ], 2),
51
+ v(m, { name: "fade" }, {
52
+ default: b(() => [
53
+ a.validation ? (u(), o("div", B, " * " + h(a.validation.message), 1)) : d("", !0)
54
+ ]),
55
+ _: 1
56
+ })
57
+ ], 64));
58
+ }
59
+ }, H = /* @__PURE__ */ w(F, [["__scopeId", "data-v-e4056b41"]]), $ = ["onClick", "disabled"], I = { key: 0 }, E = {
60
+ key: 0,
61
+ class: "loading"
62
+ }, T = /* @__PURE__ */ e("span", null, [
63
+ /* @__PURE__ */ e("svg", {
64
+ class: "i-small",
65
+ width: "135",
66
+ height: "140",
67
+ viewBox: "0 0 135 140",
68
+ xmlns: "http://www.w3.org/2000/svg",
69
+ fill: "#fff"
70
+ }, [
71
+ /* @__PURE__ */ e("rect", {
72
+ y: "10",
73
+ width: "15",
74
+ height: "120",
75
+ rx: "6"
76
+ }, [
77
+ /* @__PURE__ */ e("animate", {
78
+ attributeName: "height",
79
+ begin: "0.5s",
80
+ dur: "1s",
81
+ values: "120;110;100;90;80;70;60;50;40;140;120",
82
+ calcMode: "linear",
83
+ repeatCount: "indefinite"
84
+ }),
85
+ /* @__PURE__ */ c(),
86
+ /* @__PURE__ */ e("animate", {
87
+ attributeName: "y",
88
+ begin: "0.5s",
89
+ dur: "1s",
90
+ values: "10;15;20;25;30;35;40;45;50;0;10",
91
+ calcMode: "linear",
92
+ repeatCount: "indefinite"
93
+ })
94
+ ]),
95
+ /* @__PURE__ */ e("rect", {
96
+ x: "30",
97
+ y: "10",
98
+ width: "15",
99
+ height: "120",
100
+ rx: "6"
101
+ }, [
102
+ /* @__PURE__ */ e("animate", {
103
+ attributeName: "height",
104
+ begin: "0.25s",
105
+ dur: "1s",
106
+ values: "120;110;100;90;80;70;60;50;40;140;120",
107
+ calcMode: "linear",
108
+ repeatCount: "indefinite"
109
+ }),
110
+ /* @__PURE__ */ c(),
111
+ /* @__PURE__ */ e("animate", {
112
+ attributeName: "y",
113
+ begin: "0.25s",
114
+ dur: "1s",
115
+ values: "10;15;20;25;30;35;40;45;50;0;10",
116
+ calcMode: "linear",
117
+ repeatCount: "indefinite"
118
+ })
119
+ ]),
120
+ /* @__PURE__ */ e("rect", {
121
+ x: "60",
122
+ width: "15",
123
+ height: "140",
124
+ rx: "6"
125
+ }, [
126
+ /* @__PURE__ */ e("animate", {
127
+ attributeName: "height",
128
+ begin: "0s",
129
+ dur: "1s",
130
+ values: "120;110;100;90;80;70;60;50;40;140;120",
131
+ calcMode: "linear",
132
+ repeatCount: "indefinite"
133
+ }),
134
+ /* @__PURE__ */ c(),
135
+ /* @__PURE__ */ e("animate", {
136
+ attributeName: "y",
137
+ begin: "0s",
138
+ dur: "1s",
139
+ values: "10;15;20;25;30;35;40;45;50;0;10",
140
+ calcMode: "linear",
141
+ repeatCount: "indefinite"
142
+ })
143
+ ]),
144
+ /* @__PURE__ */ e("rect", {
145
+ x: "90",
146
+ y: "10",
147
+ width: "15",
148
+ height: "120",
149
+ rx: "6"
150
+ }, [
151
+ /* @__PURE__ */ e("animate", {
152
+ attributeName: "height",
153
+ begin: "0.25s",
154
+ dur: "1s",
155
+ values: "120;110;100;90;80;70;60;50;40;140;120",
156
+ calcMode: "linear",
157
+ repeatCount: "indefinite"
158
+ }),
159
+ /* @__PURE__ */ c(),
160
+ /* @__PURE__ */ e("animate", {
161
+ attributeName: "y",
162
+ begin: "0.25s",
163
+ dur: "1s",
164
+ values: "10;15;20;25;30;35;40;45;50;0;10",
165
+ calcMode: "linear",
166
+ repeatCount: "indefinite"
167
+ })
168
+ ]),
169
+ /* @__PURE__ */ e("rect", {
170
+ x: "120",
171
+ y: "10",
172
+ width: "15",
173
+ height: "120",
174
+ rx: "6"
175
+ }, [
176
+ /* @__PURE__ */ e("animate", {
177
+ attributeName: "height",
178
+ begin: "0.5s",
179
+ dur: "1s",
180
+ values: "120;110;100;90;80;70;60;50;40;140;120",
181
+ calcMode: "linear",
182
+ repeatCount: "indefinite"
183
+ }),
184
+ /* @__PURE__ */ c(),
185
+ /* @__PURE__ */ e("animate", {
186
+ attributeName: "y",
187
+ begin: "0.5s",
188
+ dur: "1s",
189
+ values: "10;15;20;25;30;35;40;45;50;0;10",
190
+ calcMode: "linear",
191
+ repeatCount: "indefinite"
192
+ })
193
+ ])
194
+ ])
195
+ ], -1), L = [
196
+ T
197
+ ], V = {
198
+ key: 0,
199
+ class: "h4 loading"
200
+ }, D = /* @__PURE__ */ e("span", { class: "p-small t-white" }, "✔", -1), S = [
201
+ D
202
+ ], z = {
203
+ key: 0,
204
+ class: "error"
205
+ }, J = {
206
+ __name: "Button",
207
+ props: {
208
+ submit: {
209
+ type: Function,
210
+ default: async () => {
211
+ console.log("Button click.");
212
+ }
213
+ },
214
+ callback: {
215
+ type: Function,
216
+ default: async () => {
217
+ console.log("Button callback.");
218
+ }
219
+ },
220
+ callbackDelay: {
221
+ type: Number,
222
+ default: 750
223
+ },
224
+ validation: {
225
+ type: Boolean,
226
+ default: !1
227
+ }
228
+ },
229
+ setup(a) {
230
+ const n = a, s = f(null), i = f(null), r = f(!1), t = f(!1);
231
+ async function l() {
232
+ s.value.style["pointer-events"] = "none", i.value = null, r.value = !0;
233
+ try {
234
+ await n.submit(), s.value.classList.replace("bg-main", "bg-light-main"), r.value = !1, t.value = !0, setTimeout(() => {
235
+ s.value && (s.value.classList.replace("bg-light-main", "bg-main"), s.value.style.pointerEvents = "auto", r.value = !1, t.value = !1, i.value = null);
236
+ }, 500), n.callback && setTimeout(() => n.callback(), n.callbackDelay);
237
+ } catch {
238
+ s.value.classList.replace("bg-main", "bg-fourth-nano"), i.value = "❌", setTimeout(() => {
239
+ s.value.classList.replace("bg-fourth-nano", "bg-main"), s.value.style.pointerEvents = "auto", r.value = !1, t.value = !1, i.value = null;
240
+ }, 1330);
241
+ }
242
+ }
243
+ return (g, j) => (u(), o("button", {
244
+ onClick: x(l, ["stop"]),
245
+ disabled: a.validation,
246
+ ref_key: "button",
247
+ ref: s,
248
+ class: "w-100 bg-main button"
249
+ }, [
250
+ v(m, {
251
+ mode: "out-in",
252
+ name: "fadeIn"
253
+ }, {
254
+ default: b(() => [
255
+ !r.value && !i.value && !t.value ? (u(), o("span", I, [
256
+ k(g.$slots, "default")
257
+ ])) : d("", !0)
258
+ ]),
259
+ _: 3
260
+ }),
261
+ v(m, {
262
+ mode: "out-in",
263
+ name: "fadeIn"
264
+ }, {
265
+ default: b(() => [
266
+ r.value && !i.value ? (u(), o("div", E, L)) : d("", !0)
267
+ ]),
268
+ _: 1
269
+ }),
270
+ v(m, {
271
+ mode: "out-in",
272
+ name: "fadeIn"
273
+ }, {
274
+ default: b(() => [
275
+ t.value ? (u(), o("div", V, S)) : d("", !0)
276
+ ]),
277
+ _: 1
278
+ }),
279
+ v(m, {
280
+ mode: "out-in",
281
+ name: "fadeIn"
282
+ }, {
283
+ default: b(() => [
284
+ i.value ? (u(), o("div", z, [
285
+ e("span", null, h(i.value), 1)
286
+ ])) : d("", !0)
287
+ ]),
288
+ _: 1
289
+ })
290
+ ], 8, $));
291
+ }
292
+ };
293
+ export {
294
+ H as F,
295
+ J as _
296
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue");require("./index-7ecbf72a.js");const c=require("./_plugin-vue_export-helper-f246444f.js"),u={key:0,class:"t-transp mn-r-small"},d={class:"w-100"},m=["type","value","placeholder"],f=["value","placeholder"],v={key:0,class:"mn-t-thin mn-thin mn-b-thin invalid-feedback"},h={__name:"Field",props:{label:null,type:"text",placeholder:"Enter something here",field:null,validation:!1,disabled:!1},emits:["update:field","focus","blur"],setup(a,{emit:n}){const o=a,i=e.ref(o.field);return(r,t)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:e.normalizeClass([[r.$attrs.class,{"bg-fourth-nano":a.validation}],"flex-center flex-nowrap flex"])},[a.label?(e.openBlock(),e.createElementBlock("div",u,[e.createElementVNode("span",null,e.toDisplayString(a.label),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",d,[a.type!=="textarea"?(e.openBlock(),e.createElementBlock("input",{key:0,onInput:t[0]||(t[0]=l=>i.value=n("update:field",l.target.value)),onFocus:t[1]||(t[1]=l=>n("focus",l)),onBlur:t[2]||(t[2]=l=>n("blur",l)),type:a.type,class:"w-100",value:a.field,placeholder:a.placeholder},null,40,m)):(e.openBlock(),e.createElementBlock("textarea",{key:1,onInput:t[3]||(t[3]=l=>i.value=n("update:field",l.target.value)),onFocus:t[4]||(t[4]=l=>n("focus",l)),onBlur:t[5]||(t[5]=l=>n("blur",l)),class:"w-100",value:a.field,placeholder:a.placeholder},null,40,f))])],2),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[a.validation?(e.openBlock(),e.createElementBlock("div",v," * "+e.toDisplayString(a.validation.message),1)):e.createCommentVNode("",!0)]),_:1})],64))}},b=c._export_sfc(h,[["__scopeId","data-v-e4056b41"]]),p=["onClick","disabled"],g={key:0},N={key:0,class:"loading"},k=e.createElementVNode("span",null,[e.createElementVNode("svg",{class:"i-small",width:"135",height:"140",viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:"#fff"},[e.createElementVNode("rect",{y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"60",width:"15",height:"140",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})])])],-1),y=[k],V={key:0,class:"h4 loading"},E=e.createElementVNode("span",{class:"p-small t-white"},"✔",-1),x=[E],B={key:0,class:"error"},w={__name:"Button",props:{submit:{type:Function,default:async()=>{console.log("Button click.")}},callback:{type:Function,default:async()=>{console.log("Button callback.")}},callbackDelay:{type:Number,default:750},validation:{type:Boolean,default:!1}},setup(a){const n=a,o=e.ref(null),i=e.ref(null),r=e.ref(!1),t=e.ref(!1);async function l(){o.value.style["pointer-events"]="none",i.value=null,r.value=!0;try{await n.submit(),o.value.classList.replace("bg-main","bg-light-main"),r.value=!1,t.value=!0,setTimeout(()=>{o.value&&(o.value.classList.replace("bg-light-main","bg-main"),o.value.style.pointerEvents="auto",r.value=!1,t.value=!1,i.value=null)},500),n.callback&&setTimeout(()=>n.callback(),n.callbackDelay)}catch{o.value.classList.replace("bg-main","bg-fourth-nano"),i.value="❌",setTimeout(()=>{o.value.classList.replace("bg-fourth-nano","bg-main"),o.value.style.pointerEvents="auto",r.value=!1,t.value=!1,i.value=null},1330)}}return(s,C)=>(e.openBlock(),e.createElementBlock("button",{onClick:e.withModifiers(l,["stop"]),disabled:a.validation,ref_key:"button",ref:o,class:"w-100 bg-main button"},[e.createVNode(e.Transition,{mode:"out-in",name:"fadeIn"},{default:e.withCtx(()=>[!r.value&&!i.value&&!t.value?(e.openBlock(),e.createElementBlock("span",g,[e.renderSlot(s.$slots,"default")])):e.createCommentVNode("",!0)]),_:3}),e.createVNode(e.Transition,{mode:"out-in",name:"fadeIn"},{default:e.withCtx(()=>[r.value&&!i.value?(e.openBlock(),e.createElementBlock("div",N,y)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{mode:"out-in",name:"fadeIn"},{default:e.withCtx(()=>[t.value?(e.openBlock(),e.createElementBlock("div",V,x)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{mode:"out-in",name:"fadeIn"},{default:e.withCtx(()=>[i.value?(e.openBlock(),e.createElementBlock("div",B,[e.createElementVNode("span",null,e.toDisplayString(i.value),1)])):e.createCommentVNode("",!0)]),_:1})],8,p))}};exports.Field=b;exports._sfc_main=w;
@@ -0,0 +1,133 @@
1
+ import { reactive as d, watch as b, openBlock as h, createBlock as y, withCtx as _, createTextVNode as f, toDisplayString as g } from "vue";
2
+ import { _ as w } from "./Button-d8e72ac0.mjs";
3
+ import "./auth-b047fdc0.mjs";
4
+ import { a as I } from "./index-0ab9d59c.mjs";
5
+ import { s as p } from "./globals-96ba60e4.mjs";
6
+ import { _ as M } from "./_plugin-vue_export-helper-dad06003.mjs";
7
+ const m = I.create({
8
+ baseURL: process.env.API_URL,
9
+ withCredentials: !0
10
+ }), i = d({
11
+ memberships: [],
12
+ error: null
13
+ }), u = {
14
+ async read({ user: r, type: e, target: t, role: s }) {
15
+ try {
16
+ const o = await m.get("/api/memberships", { params: { user: r, type: e, target: t, role: s } });
17
+ return i.error = null, i.memberships = o.data, Promise.resolve(o.data);
18
+ } catch (o) {
19
+ return p(o), Promise.reject(o);
20
+ }
21
+ },
22
+ async create(r) {
23
+ try {
24
+ const e = await m.post("/api/memberships/create", r);
25
+ return i.error = null, Promise.resolve(e.data);
26
+ } catch (e) {
27
+ return p(e), Promise.reject(e);
28
+ }
29
+ },
30
+ async update(r) {
31
+ try {
32
+ const e = await m.post("/api/memberships/update", r);
33
+ return i.error = null, Promise.resolve(e.data);
34
+ } catch (e) {
35
+ return p(e), Promise.reject(e);
36
+ }
37
+ },
38
+ async delete(r) {
39
+ try {
40
+ const e = await m.post("/api/memberships/delete", r);
41
+ return i.error = null, Promise.resolve(e.data);
42
+ } catch (e) {
43
+ return p(e), Promise.reject(e);
44
+ }
45
+ }
46
+ }, P = {
47
+ handleMembershipUpdate(r, e, t) {
48
+ let s;
49
+ if (Array.isArray(r) ? s = r.find((o) => o._id === e.target) : typeof r == "object" && r._id === e.target && (s = r), s)
50
+ if (s.isMember = t, t)
51
+ s.memberships.push(e), s.numberOfMemberships += 1;
52
+ else {
53
+ const o = s.memberships.findIndex((l) => l._id === e._id);
54
+ o !== -1 && (s.memberships.splice(o, 1), s.numberOfMemberships -= 1);
55
+ }
56
+ }
57
+ };
58
+ b(i, (r) => {
59
+ });
60
+ const O = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
61
+ __proto__: null,
62
+ actions: u,
63
+ mutations: P,
64
+ state: i
65
+ }, Symbol.toStringTag, { value: "Module" }));
66
+ const v = {
67
+ __name: "ButtonFollow",
68
+ props: {
69
+ type: {
70
+ type: String,
71
+ required: !0
72
+ },
73
+ userId: {
74
+ type: String,
75
+ required: !0
76
+ },
77
+ isMember: {
78
+ type: Boolean,
79
+ required: !0
80
+ },
81
+ targetId: {
82
+ type: String,
83
+ required: !0
84
+ }
85
+ },
86
+ emits: ["updateMembership"],
87
+ setup(r, { emit: e }) {
88
+ const t = r, s = async () => {
89
+ t.isMember ? await l(t.targetId) : await o(t.targetId);
90
+ };
91
+ async function o(c) {
92
+ try {
93
+ const a = {
94
+ type: t.type,
95
+ target: c,
96
+ user: t.userId
97
+ }, n = await u.create(a);
98
+ e("updateMembership", { membership: n, isMember: !0, targetId: t.targetId });
99
+ } catch (a) {
100
+ throw console.log(a), a;
101
+ }
102
+ }
103
+ async function l(c) {
104
+ const a = {
105
+ type: t.type,
106
+ target: c,
107
+ user: t.userId
108
+ };
109
+ try {
110
+ const n = await u.delete(a);
111
+ e("updateMembership", { membership: n, isMember: !1, targetId: t.targetId });
112
+ } catch (n) {
113
+ throw console.log(n), n;
114
+ }
115
+ }
116
+ return (c, a) => (h(), y(w, {
117
+ submit: s,
118
+ class: "bg-main button-small button"
119
+ }, {
120
+ default: _(() => [
121
+ f(g(r.isMember ? "Unfollow" : "Follow"), 1)
122
+ ]),
123
+ _: 1
124
+ }));
125
+ }
126
+ }, U = /* @__PURE__ */ M(v, [["__scopeId", "data-v-c50e046c"]]);
127
+ export {
128
+ U as B,
129
+ u as a,
130
+ O as b,
131
+ P as m,
132
+ i as s
133
+ };
@@ -0,0 +1 @@
1
+ "use strict";const a=require("vue"),h=require("./Button-ee08e6bf.js");require("./auth-2f9b2dfc.js");const y=require("./index-7ecbf72a.js"),l=require("./globals-928eb13c.js"),_=require("./_plugin-vue_export-helper-f246444f.js"),p=y.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),i=a.reactive({memberships:[],error:null}),m={async read({user:r,type:e,target:t,role:s}){try{const o=await p.get("/api/memberships",{params:{user:r,type:e,target:t,role:s}});return i.error=null,i.memberships=o.data,Promise.resolve(o.data)}catch(o){return l.setError(o),Promise.reject(o)}},async create(r){try{const e=await p.post("/api/memberships/create",r);return i.error=null,Promise.resolve(e.data)}catch(e){return l.setError(e),Promise.reject(e)}},async update(r){try{const e=await p.post("/api/memberships/update",r);return i.error=null,Promise.resolve(e.data)}catch(e){return l.setError(e),Promise.reject(e)}},async delete(r){try{const e=await p.post("/api/memberships/delete",r);return i.error=null,Promise.resolve(e.data)}catch(e){return l.setError(e),Promise.reject(e)}}},b={handleMembershipUpdate(r,e,t){let s;if(Array.isArray(r)?s=r.find(o=>o._id===e.target):typeof r=="object"&&r._id===e.target&&(s=r),s)if(s.isMember=t,t)s.memberships.push(e),s.numberOfMemberships+=1;else{const o=s.memberships.findIndex(d=>d._id===e._id);o!==-1&&(s.memberships.splice(o,1),s.numberOfMemberships-=1)}}};a.watch(i,r=>{});const g=Object.freeze(Object.defineProperty({__proto__:null,actions:m,mutations:b,state:i},Symbol.toStringTag,{value:"Module"}));const f={__name:"ButtonFollow",props:{type:{type:String,required:!0},userId:{type:String,required:!0},isMember:{type:Boolean,required:!0},targetId:{type:String,required:!0}},emits:["updateMembership"],setup(r,{emit:e}){const t=r,s=async()=>{t.isMember?await d(t.targetId):await o(t.targetId)};async function o(u){try{const n={type:t.type,target:u,user:t.userId},c=await m.create(n);e("updateMembership",{membership:c,isMember:!0,targetId:t.targetId})}catch(n){throw console.log(n),n}}async function d(u){const n={type:t.type,target:u,user:t.userId};try{const c=await m.delete(n);e("updateMembership",{membership:c,isMember:!1,targetId:t.targetId})}catch(c){throw console.log(c),c}}return(u,n)=>(a.openBlock(),a.createBlock(h._sfc_main,{submit:s,class:"bg-main button-small button"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(r.isMember?"Unfollow":"Follow"),1)]),_:1}))}},w=_._export_sfc(f,[["__scopeId","data-v-c50e046c"]]);exports.ButtonFollow=w;exports.actions=m;exports.memberships=g;exports.mutations=b;exports.state=i;