(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-41a1b1ec"],{"3a66":function(t,e,i){"use strict";i.d(e,"a",(function(){return r}));var s=i("fe6c"),a=i("58df");function r(t,e=[]){return Object(a["a"])(Object(s["b"])(["absolute","fixed"])).extend({name:"applicationable",props:{app:Boolean},computed:{applicationProperty(){return t}},watch:{app(t,e){e?this.removeApplication(!0):this.callUpdate()},applicationProperty(t,e){this.$vuetify.application.unregister(this._uid,e)}},activated(){this.callUpdate()},created(){for(let t=0,i=e.length;t<i;t++)this.$watch(e[t],this.callUpdate);this.callUpdate()},mounted(){this.callUpdate()},deactivated(){this.removeApplication()},destroyed(){this.removeApplication()},methods:{callUpdate(){this.app&&this.$vuetify.application.register(this._uid,this.applicationProperty,this.updateApplication())},removeApplication(t=!1){(t||this.app)&&this.$vuetify.application.unregister(this._uid,this.applicationProperty)},updateApplication:()=>0}})}},"413d":function(t,e,i){"use strict";i("9129")},7958:function(t,e,i){},9129:function(t,e,i){},"96a9":function(t,e,i){},bf51:function(t,e,i){"use strict";i.r(e);var s=i("8336"),a=i("ce7e"),r=i("132d"),n=i("8860"),o=i("da13"),h=i("5d23"),l=i("e449"),c=i("f774"),d=i("e0c7"),u=i("8654"),p=(i("96a9"),i("24b2")),g=i("f977"),v=i("80d2"),m=p["a"].extend({name:"v-virtual-scroll",directives:{Scroll:g["b"]},props:{bench:{type:[Number,String],default:0},itemHeight:{type:[Number,String],required:!0},items:{type:Array,default:()=>[]}},data:()=>({first:0,last:0,scrollTop:0}),computed:{__bench(){return parseInt(this.bench,10)},__itemHeight(){return parseInt(this.itemHeight,10)},firstToRender(){return Math.max(0,this.first-this.__bench)},lastToRender(){return Math.min(this.items.length,this.last+this.__bench)}},watch:{height:"onScroll",itemHeight:"onScroll"},mounted(){this.last=this.getLast(0)},methods:{getChildren(){return this.items.slice(this.firstToRender,this.lastToRender).map(this.genChild)},genChild(t,e){e+=this.firstToRender;const i=Object(v["h"])(e*this.__itemHeight);return this.$createElement("div",{staticClass:"v-virtual-scroll__item",style:{top:i},key:e},Object(v["s"])(this,"default",{index:e,item:t}))},getFirst(){return Math.floor(this.scrollTop/this.__itemHeight)},getLast(t){const e=parseInt(this.height||0,10)||this.$el.clientHeight;return t+Math.ceil(e/this.__itemHeight)},onScroll(){this.scrollTop=this.$el.scrollTop,this.first=this.getFirst(),this.last=this.getLast(this.first)}},render(t){const e=t("div",{staticClass:"v-virtual-scroll__container",style:{height:Object(v["h"])(this.items.length*this.__itemHeight)}},this.getChildren());return t("div",{staticClass:"v-virtual-scroll",style:this.measurableStyles,directives:[{name:"scroll",modifiers:{self:!0},value:this.onScroll}],on:this.$listeners},[e])}}),b=function(){var t=this,e=t._self._c;return e(c["a"],{staticClass:"sidebar-six",staticStyle:{"z-index":"50"},style:{backgroundColor:t.appBarColor},attrs:{value:t.show,dark:"",height:"100%",width:"280px","mobile-breakpoint":960,floating:!0,app:""},on:{input:t.toggleShow}},[e("div",{staticClass:"ps d-flex flex-column",staticStyle:{height:"100%"},style:{backgroundColor:t.appBarColor}},[e("div",{staticStyle:{position:"sticky",top:"0px","z-index":"1"},style:{backgroundColor:t.appBarColor}},[e("div",{staticClass:"pa-5 top-toolbar text-center"},[e("router-link",{attrs:{to:"/admin/organization"}},[e("img",{staticClass:"unselectable non-draggable",attrs:{alt:"logo",height:"40",src:i("f06c")}})])],1),e("div",{staticClass:"mb-4"},[t.selectedOrganization?e(l["a"],{attrs:{rounded:"0 b-lg","offset-y":"",eager:"","z-index":"50",transition:"slide-y-transition"},scopedSlots:t._u([{key:"activator",fn:function({on:i,attrs:s}){return[e("div",t._g(t._b({staticClass:"pa-3 mx-4 rounded-lg white--text d-flex space-between",class:{"rounded-b-0":t.showMenu},style:{backgroundColor:t.adjustBrightness(t.appBarColor,20)}},"div",s,!1),i),[e("div",{staticClass:"flex-1 d-flex align-center gap-2"},[e("base-avatar",{attrs:{src:t.selectedOrganization.photo,seed:t.selectedOrganization.id,size:35,avatarStyle:"shapes",color:"secondary lighten-2"}}),e("div",[e("p",{staticClass:"subtitle-1 mb-0 text-capitalize font-weight-black",staticStyle:{"line-height":"1.3rem"}},[t._v(" "+t._s(t.selectedOrganization.name)+" ")]),t.selectedOrganization.OrganizationMember.length?e("p",{staticClass:"text-subtitle-2 mb-0 grey--text text--lighten-1"}):t.selectedOrganization.GrantingOrganizations.length?e("p",{staticClass:"text-subtitle-2 mb-0 grey--text text--lighten-1"},[t._v(" Via "),e("i",{staticClass:"font-weight-bold"},[t._v(t._s(t.selectedOrganization.GrantingOrganizations[0].accessingOrganization.name))])]):t._e()])],1),e(r["a"],{attrs:{right:""}},[t._v("mdi-chevron-down")])],1)]}}],null,!1,3922182250),model:{value:t.showMenu,callback:function(e){t.showMenu=e},expression:"showMenu"}},[e(n["a"],{style:{backgroundColor:t.adjustBrightness(t.appBarColor,20)},attrs:{color:"text--white py-0"}},[t.orgs.length>5||t.search?e(u["a"],{ref:"search",staticClass:"mx-4 pt-4 mb-3",attrs:{placeholder:"Pesquisar",outlined:"",dark:"",dense:"","hide-details":"",autofocus:""},on:{click:function(t){t.stopPropagation()},keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.stopPropagation(),t.selectFirstOrg.apply(null,arguments))}},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}}):t._e(),0==t.orgs.length&&t.search?e("span",{staticClass:"mx-4 py-4"},[t._v(" Nenhuma organização encontrada ")]):t._e(),e(m,{attrs:{items:t.orgs,"item-height":48,height:"300"},scopedSlots:t._u([{key:"default",fn:function({item:i}){return[e(o["a"],{attrs:{dark:""},on:{click:function(e){return t.selectOrg(i.id)}}},[e("div",{staticClass:"d-flex align-center gap-3",staticStyle:{"max-width":"100%"}},[e("base-avatar",{attrs:{src:i.photo,seed:i.id,size:25,avatarStyle:"shapes",color:"secondary lighten-2"}}),e("span",{staticClass:"text-truncate text-16"},[t._v(" "+t._s(i.name)+" ")])],1)])]}}],null,!1,3864674460)}),t.config.sudoMode?e(a["a"],{staticClass:"my-1 grey"}):t._e(),t.config.sudoMode?e(o["a"],{attrs:{dark:""},on:{click:t.createOrg}},[e(h["c"],[t._v(" Criar Organização ")])],1):t._e()],1)],1):t._e(),t.config.opMode?e("div",{staticClass:"d-flex justify-center"},[e("base-copier",{attrs:{value:t.selectedOrganization.id||"","hide-icon":""},scopedSlots:t._u([{key:"default",fn:function({copy:i,icon:a}){return[e(s["a"],{staticClass:"text-overline lh-1 d-block grey--text mt-2",staticStyle:{"margin-bottom":"-12px"},attrs:{text:"","x-small":""},on:{click:i}},[t._v(" #"+t._s(t._f("shortId")(t.selectedOrganization.id))+" "),e(r["a"],{attrs:{right:"","x-small":""}},[t._v(t._s(a))])],1)]}}],null,!1,3963231667)})],1):t._e()],1),e(a["a"],{})],1),e("vue-perfect-scrollbar",{staticClass:"ps flex-grow-1",staticStyle:{height:"100%"},attrs:{settings:{suppressScrollX:!0,wheelPropagation:!1}}},[e(n["a"],{staticClass:"py-0 mx-4",attrs:{dense:""}},[t._l(t.computedItems,(function(i,s){return[i.subheader?e("div",{key:i.subheader},[e(d["a"],[t._v(" "+t._s(i.subheader)+" ")]),e(a["a"])],1):t._e(),i.children?e("base-item-group-two",{key:"group-"+s,attrs:{item:i}}):i.subheader?t._e():e("base-item-two",{key:"item-"+s,attrs:{item:i}})]}))],2)],1),t.hasPermission([32,1024])?e("div",{staticClass:"px-6 py-4 pb-7 pt-0",staticStyle:{position:"sticky",bottom:"0px"},style:{backgroundColor:t.appBarColor}},[e(a["a"],{staticClass:"mb-4"}),e("div",[e(s["a"],{staticClass:"text-capitalize",attrs:{block:"",large:"",color:"primary",to:{name:"admin.sell"},id:"nav-sell-btn"}},[t._v(" Vender! ")])],1)],1):t._e()],1)])},f=[],y=(i("14d9"),i("5377"),i("2f62")),w=i("4811"),_=i("19e7"),x={data(){return{selectedItem:0,group:null,showMenu:!1,appBarColor:w["b"],search:""}},computed:{...Object(y["c"])(["getThemeMode"]),...Object(y["c"])("organization",["organizations","selectedOrganization"]),...Object(y["c"])("organization",{orgHasFlag:"hasFlag"}),...Object(y["c"])("auth",["hasPermission","hasFlag","config"]),show(){let t=this.getThemeMode.verticalSidebarDrawer,e=this.selectedOrganization;return t&&!!e},orgs(){return this.organizations.filter(t=>{if(this.selectedOrganization&&t.id===this.selectedOrganization.id)return!1;if(!this.search)return!0;const e=this.textNormalizer(this.search);return this.textNormalizer(t.name).includes(e)})},getMiniVariant(){return this.miniVariant},computedItems(){const t=[],e=this.selectedOrganization;if(!e)return t;const i=this.$store.getters["auth/userPermissions"].find(t=>t.organizationId===e.id),s=_["a"].map(t=>{var e=t.children.filter(t=>{if(t.flags){const e=Object.entries(t.flags).every(([t,e])=>this.hasFlag(t,e)||this.orgHasFlag(t,e));if(!e)return!1}return!(null===i||void 0===i||!i.owner)||(!t.permission||this.hasPermission(t.permission))});return{...t,children:e}});return s.forEach(e=>{e.children.length&&e.children.forEach((i,s)=>{t.push({...i,divider:0==s?e.divider:void 0})})}),t}},methods:{...Object(y["b"])(["changeVerticalSidebarDrawer"]),...Object(y["b"])("organization",["selectOrganization","getAllOrganizations"]),textNormalizer(t){return t.trim().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/([^\w]+|\s+)/g,"-").replace(/\-\-+/g,"-").replace(/(^-+|-+$)/,"").toLowerCase()},adjustBrightness(t,e){t=t.replace(/^#/,"");let i=parseInt(t.substring(0,2),16)+e,s=parseInt(t.substring(2,4),16)+e,a=parseInt(t.substring(4,6),16)+e;return i=Math.max(Math.min(255,i),0).toString(16),s=Math.max(Math.min(255,s),0).toString(16),a=Math.max(Math.min(255,a),0).toString(16),`#${i.padStart(2,"0")}${s.padStart(2,"0")}${a.padStart(2,"0")}`},toggleShow(t){t||this.changeVerticalSidebarDrawer(t)},async getOrgs(){await this.getAllOrganizations()},selectOrg(t){this.selectOrganization(t)},createOrg(){this.$router.push("/admin/organization/create")},toggleSidebar(){this.changeVerticalSidebarDrawer(),this.expandOnHover=!this.expandOnHover},openSidebar(){this.changeVerticalSidebarDrawer(!0)},selectFirstOrg(){this.orgs.length&&(this.showMenu=!1,this.selectOrg(this.orgs[0].id))}},watch:{async showMenu(t){t||(this.search="")}},async beforeMount(){await this.getOrgs(),document.addEventListener("keydown",t=>{t.ctrlKey&&"p"===t.key&&(t.preventDefault(),this.openSidebar(),this.$nextTick(()=>{this.showMenu=!0}))})}},O=x,C=(i("413d"),i("2877")),M=Object(C["a"])(O,b,f,!1,null,null,null);e["default"]=M.exports},f06c:function(t,e,i){t.exports=i.p+"img/logo-light.942329cd.png"},f774:function(t,e,i){"use strict";i("14d9"),i("7958");var s=i("adda"),a=i("3a66"),r=i("a9ad"),n=i("b848"),o=i("e4cd"),h=i("e707"),l=i("d10f"),c=i("7560"),d=i("a293"),u=i("dc22"),p=i("c3f0"),g=i("80d2"),v=i("58df");const m=Object(v["a"])(Object(a["a"])("left",["isActive","isMobile","miniVariant","expandOnHover","permanent","right","temporary","width"]),r["a"],n["a"],o["a"],h["a"],l["a"],c["a"]);e["a"]=m.extend({name:"v-navigation-drawer",directives:{ClickOutside:d["a"],Resize:u["a"],Touch:p["a"]},provide(){return{isInNav:"nav"===this.tag}},props:{bottom:Boolean,clipped:Boolean,disableResizeWatcher:Boolean,disableRouteWatcher:Boolean,expandOnHover:Boolean,floating:Boolean,height:{type:[Number,String],default(){return this.app?"100vh":"100%"}},miniVariant:Boolean,miniVariantWidth:{type:[Number,String],default:56},permanent:Boolean,right:Boolean,src:{type:[String,Object],default:""},stateless:Boolean,tag:{type:String,default(){return this.app?"nav":"aside"}},temporary:Boolean,touchless:Boolean,width:{type:[Number,String],default:256},value:null},data:()=>({isMouseover:!1,touchArea:{left:0,right:0},stackMinZIndex:6}),computed:{applicationProperty(){return this.right?"right":"left"},classes(){return{"v-navigation-drawer":!0,"v-navigation-drawer--absolute":this.absolute,"v-navigation-drawer--bottom":this.bottom,"v-navigation-drawer--clipped":this.clipped,"v-navigation-drawer--close":!this.isActive,"v-navigation-drawer--fixed":!this.absolute&&(this.app||this.fixed),"v-navigation-drawer--floating":this.floating,"v-navigation-drawer--is-mobile":this.isMobile,"v-navigation-drawer--is-mouseover":this.isMouseover,"v-navigation-drawer--mini-variant":this.isMiniVariant,"v-navigation-drawer--custom-mini-variant":56!==Number(this.miniVariantWidth),"v-navigation-drawer--open":this.isActive,"v-navigation-drawer--open-on-hover":this.expandOnHover,"v-navigation-drawer--right":this.right,"v-navigation-drawer--temporary":this.temporary,...this.themeClasses}},computedMaxHeight(){if(!this.hasApp)return null;const t=this.$vuetify.application.bottom+this.$vuetify.application.footer+this.$vuetify.application.bar;return this.clipped?t+this.$vuetify.application.top:t},computedTop(){if(!this.hasApp)return 0;let t=this.$vuetify.application.bar;return t+=this.clipped?this.$vuetify.application.top:0,t},computedTransform(){return this.isActive?0:this.isBottom||this.right?100:-100},computedWidth(){return this.isMiniVariant?this.miniVariantWidth:this.width},hasApp(){return this.app&&!this.isMobile&&!this.temporary},isBottom(){return this.bottom&&this.isMobile},isMiniVariant(){return!this.expandOnHover&&this.miniVariant||this.expandOnHover&&!this.isMouseover},isMobile(){return!this.stateless&&!this.permanent&&o["a"].options.computed.isMobile.call(this)},reactsToClick(){return!this.stateless&&!this.permanent&&(this.isMobile||this.temporary)},reactsToMobile(){return this.app&&!this.disableResizeWatcher&&!this.permanent&&!this.stateless&&!this.temporary},reactsToResize(){return!this.disableResizeWatcher&&!this.stateless},reactsToRoute(){return!this.disableRouteWatcher&&!this.stateless&&(this.temporary||this.isMobile)},showOverlay(){return!this.hideOverlay&&this.isActive&&(this.isMobile||this.temporary)},styles(){const t=this.isBottom?"translateY":"translateX";return{height:Object(g["h"])(this.height),top:this.isBottom?"auto":Object(g["h"])(this.computedTop),maxHeight:null!=this.computedMaxHeight?`calc(100% - ${Object(g["h"])(this.computedMaxHeight)})`:void 0,transform:`${t}(${Object(g["h"])(this.computedTransform,"%")})`,width:Object(g["h"])(this.computedWidth)}}},watch:{$route:"onRouteChange",isActive(t){this.$emit("input",t)},isMobile(t,e){!t&&this.isActive&&!this.temporary&&this.removeOverlay(),null!=e&&this.reactsToResize&&this.reactsToMobile&&(this.isActive=!t)},permanent(t){t&&(this.isActive=!0)},showOverlay(t){t?this.genOverlay():this.removeOverlay()},value(t){this.permanent||(null!=t?t!==this.isActive&&(this.isActive=t):this.init())},expandOnHover:"updateMiniVariant",isMouseover(t){this.updateMiniVariant(!t)}},beforeMount(){this.init()},methods:{calculateTouchArea(){const t=this.$el.parentNode;if(!t)return;const e=t.getBoundingClientRect();this.touchArea={left:e.left+50,right:e.right-50}},closeConditional(){return this.isActive&&!this._isDestroyed&&this.reactsToClick},genAppend(){return this.genPosition("append")},genBackground(){const t={height:"100%",width:"100%",src:this.src},e=this.$scopedSlots.img?this.$scopedSlots.img(t):this.$createElement(s["a"],{props:t});return this.$createElement("div",{staticClass:"v-navigation-drawer__image"},[e])},genDirectives(){const t=[{name:"click-outside",value:{handler:()=>{this.isActive=!1},closeConditional:this.closeConditional,include:this.getOpenDependentElements}}];return this.touchless||this.stateless||t.push({name:"touch",value:{parent:!0,left:this.swipeLeft,right:this.swipeRight}}),t},genListeners(){const t={mouseenter:()=>this.isMouseover=!0,mouseleave:()=>this.isMouseover=!1,transitionend:t=>{if(t.target!==t.currentTarget)return;this.$emit("transitionend",t);const e=document.createEvent("UIEvents");e.initUIEvent("resize",!0,!1,window,0),window.dispatchEvent(e)}};return this.miniVariant&&(t.click=()=>this.$emit("update:mini-variant",!1)),t},genPosition(t){const e=Object(g["s"])(this,t);return e?this.$createElement("div",{staticClass:"v-navigation-drawer__"+t},e):e},genPrepend(){return this.genPosition("prepend")},genContent(){return this.$createElement("div",{staticClass:"v-navigation-drawer__content"},this.$slots.default)},genBorder(){return this.$createElement("div",{staticClass:"v-navigation-drawer__border"})},init(){this.permanent?this.isActive=!0:this.stateless||null!=this.value?this.isActive=this.value:this.temporary||(this.isActive=!this.isMobile)},onRouteChange(){this.reactsToRoute&&this.closeConditional()&&(this.isActive=!1)},swipeLeft(t){this.isActive&&this.right||(this.calculateTouchArea(),Math.abs(t.touchendX-t.touchstartX)<100||(this.right&&t.touchstartX>=this.touchArea.right?this.isActive=!0:!this.right&&this.isActive&&(this.isActive=!1)))},swipeRight(t){this.isActive&&!this.right||(this.calculateTouchArea(),Math.abs(t.touchendX-t.touchstartX)<100||(!this.right&&t.touchstartX<=this.touchArea.left?this.isActive=!0:this.right&&this.isActive&&(this.isActive=!1)))},updateApplication(){if(!this.isActive||this.isMobile||this.temporary||!this.$el)return 0;const t=Number(this.miniVariant?this.miniVariantWidth:this.width);return isNaN(t)?this.$el.clientWidth:t},updateMiniVariant(t){this.expandOnHover&&this.miniVariant!==t&&this.$emit("update:mini-variant",t)}},render(t){const e=[this.genPrepend(),this.genContent(),this.genAppend(),this.genBorder()];return(this.src||Object(g["s"])(this,"img"))&&e.unshift(this.genBackground()),t(this.tag,this.setBackgroundColor(this.color,{class:this.classes,style:this.styles,directives:this.genDirectives(),on:this.genListeners()}),e)}})},f977:function(t,e,i){"use strict";function s(t,e,i){const{self:s=!1}=e.modifiers||{},a=e.value,r="object"===typeof a&&a.options||{passive:!0},n="function"===typeof a||"handleEvent"in a?a:a.handler,o=s?t:e.arg?document.querySelector(e.arg):window;o&&(o.addEventListener("scroll",n,r),t._onScroll=Object(t._onScroll),t._onScroll[i.context._uid]={handler:n,options:r,target:s?void 0:o})}function a(t,e,i){var s;if(!(null===(s=t._onScroll)||void 0===s?void 0:s[i.context._uid]))return;const{handler:a,options:r,target:n=t}=t._onScroll[i.context._uid];n.removeEventListener("scroll",a,r),delete t._onScroll[i.context._uid]}i.d(e,"a",(function(){return r}));const r={inserted:s,unbind:a};e["b"]=r}}]);
//# sourceMappingURL=chunk-41a1b1ec.4209aa2f.js.map