1import{bQ as l,de as m,e4 as d,cA as f,cj as n,ak as t,ai as k,cV as c,ah as a,aq as h,aj as p,ek as P,ap as _,bP as g,dA as $,l as C,cx as E}from"./CV8q8LvW.js";import{E as q}from"./6iGq84OS.js";import w from"./jBrunqZi.js";import{E as I}from"./C0Zry4II.js";import N from"./C0NMPIJF.js";import{_ as y}from"./DlAUqK2U.js";import"./cIwEY4YV.js";import"./Fs2LdC1n.js";import"./CQ6r6SYr.js";const z={name:"SelectLicences",description:["`SelectLicences` allows user to select licences"].join(" "),components:{DaButton:N,Loader:w},props:{min:{type:Number,default:1}},data(){return{nbLicences:3,updated:!1,loading:!1,error:null}},computed:{...l(d,["user"]),...l(m,["company"]),teamSizeHelper(){return this.nbLicences>20?this.$t("settings.billing.payement.team_size.large"):this.nbLicences>10?this.$t("settings.billing.payement.team_size.medium"):this.nbLicences>5?this.$t("settings.billing.payement.team_size.small"):this.nbLicences>2?this.$t("settings.billing.payement.team_size.tiny"):this.nbLicences===2?this.$t("settings.billing.payement.team_size.two"):this.$t("settings.billing.payement.team_size.solo")}},mounted(){this.nbLicences=this.company.nbLicences},methods:{updateLicences(){if(this.nbLicences-this.company.nbLicences>0){let e=this.company.outboundPlan.toUpperCase();e==="ENTERPRISE"&&(e="ENT"),window.open("https://store.datananas.com/#!/checkout?prd=DAFR_LICENCES_"+e+"&quantity="+(this.nbLicences-this.company.nbLicences))}else this.error=this.$t("settings.billing.payement.minimum_licence")}}},B={class:"update-licences"},U={key:1,class:"success"},V={key:2,class:"select-licences"},Q={key:0,class:"nb"},T={key:1,class:"nb"},j={class:"helper-users"},A={key:2,class:"error"},R={class:"update-button"},D={class:"secure"};function H(e,o,L,v,s,i){const u=w,b=I,r=f("da-button");return n(),t("div",B,[s.loading?(n(),k(u,{key:0})):s.updated?(n(),t("div",U,c(e.$t("settings.billing.payement.licences_updated")),1)):(n(),t("div",V,[s.nbLicences<=20?(n(),t("div",Q,c(e.$t("settings.billing.licences",{nb:s.nbLicences},s.nbLicences)),1)):(n(),t("div",T,c(e.$t("settings.billing.max_licences.title")),1)),a("div",j,c(i.teamSizeHelper),1),h(b,{modelValue:s.nbLicences,"onUpdate:modelValue":o[0]||(o[0]=S=>s.nbLicences=S),size:"small",min:e.company.nbLicences,max:21},null,8,["modelValue","min"]),s.error?(n(),t("div",A,c(s.error),1)):p("",!0),a("div",R,[h(r,{type:"primary",onClick:o[1]||(o[1]=S=>i.updateLicences())},{default:P(()=>[_(c(e.$t("settings.billing.payement.update")),1)]),_:1})]),a("div",D,[o[2]||(o[2]=a("i",{class:"el-icon-goods"},null,-1)),_(" "+c(e.$t("settings.billing.payement.secured")),1)])]))])}const F=y(z,[["render",H],["__scopeId","data-v-605e377c"]]),M={name:"Plan",description:["`Plan` allows user to see his current subscription plan"].join(" "),components:{SelectLicences:F},data(){return{quotas:null,edit:null,displayedQuotas:["users_number","contact_create"]}},computed:{...l(d,["user","hasScope"]),...l(m,["company"]),showPlanChange(){return this.hasScope("companies:update-subscription")?["light","pro","enterprise"].includes(this.company.outboundPlan):!1},minLicences(){return this.quotas&&this.quotas.users_number[1]||1}},mounted(){this.loadInfos()},methods:{...g(d,["refreshUser"]),...g(m,["getQuotas"]),...g($,["SHOW_SUBSCRIBE"]),quotaPercent(e){return Math.min(Math.round(e[1]/e[0]*100),100)},progressColor(e){return e<90?"#13ce66":e<97?"#ec8024":"#f56c6c"},getPeriod(e){return e===1?"monthly":e===12?"yearly":e===6?"6months":null},loadInfos(){this.refreshUser(),this.getQuotas({_id:this.user.companyId._id}).then(e=>this.quotas=e)},openShop(){window.open("https://www.datananas.com/tarifs")}}},G={class:"plan"},O={class:"plan-infos"},W={class:"info plan"},J={class:"info"},K={key:1},X={key:0,class:"quotas"};function Y(e,o,L,v,s,i){const u=f("SelectLicences"),b=q;return n(),t("div",G,[a("div",O,[a("div",W,[_(c(e.$t("settings.billing.subscription"))+" "+c(e.$t(`settings.billing.plan.${e.company.outboundPlan}`)||"-")+" "+c(e.$t(`settings.billing.${i.getPeriod(e.company.period)}`)||e.company.period||"-")+" ",1),i.showPlanChange?(n(),t("i",{key:0,class:"icon-edit",onClick:o[0]||(o[0]=r=>i.openShop())})):p("",!0)]),a("div",J,[s.edit==="licences"?(n(),k(u,{key:0,class:"update-licences",min:i.minLicences,onUpdated:i.loadInfos},null,8,["min","onUpdated"])):(n(),t("div",K,[_(c(e.$t("settings.billing.licences",{nb:e.company.nbLicences},e.company.nbLicences))+" ",1),i.showPlanChange?(n(),t("i",{key:0,class:"icon-edit",onClick:o[1]||(o[1]=r=>s.edit="licences")})):p("",!0)]))]),s.quotas?(n(),t("div",X,[(n(!0),t(C,null,E(s.displayedQuotas,r=>(n(),t("div",{key:r,class:"quota"},[a("span",null,c(e.$t(`settings.billing.quotas.${r}`,{used:s.quotas[r][1],limit:s.quotas[r][0]})),1),h(b,{"show-text":!1,percentage:i.quotaPercent(s.quotas[r]),color:i.progressColor(i.quotaPercent(s.quotas[r]))},null,8,["percentage","color"])]))),128))])):p("",!0)])])}
1const Z=y(M,[["render",Y],["__scopeId","data-v-19738667"]]),x={name:"Billing",components:{Plan:Z},data(){return{activeName:"Billing"}},computed:{...l(m,["company","hasTrial"]),...l(d,["hasScope"]),hasInvoiceScope(){return this.$hasPartialScope("invoices:filter:company")}},mounted(){this.hasTrial&&(window.location.href="https://www.datananas.com/tarifs")}},ee={class:"billing-container"};function se(e,o,L,v,s,i){const u=f("Plan");return n(),t("div",ee,[h(u)])}const pe=y(x,[["render",se]]);export{pe as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.