diff --git a/dist/assets/About.4f938d31.css b/dist/assets/About.4f938d31.css deleted file mode 100644 index 731fbab..0000000 --- a/dist/assets/About.4f938d31.css +++ /dev/null @@ -1 +0,0 @@ -.about[data-v-107fcc3f]{display:flex;flex-direction:column;align-items:center} diff --git a/dist/assets/About.7de7290d.js b/dist/assets/About.571f5314.js similarity index 67% rename from dist/assets/About.7de7290d.js rename to dist/assets/About.571f5314.js index 816f009..b9b3bd9 100644 --- a/dist/assets/About.7de7290d.js +++ b/dist/assets/About.571f5314.js @@ -1 +1 @@ -import{_}from"./ListPageTop.dad49f81.js";import{n as o,_ as a}from"./index.154e9cc6.js";import"./VBreadcrumbs.a2278375.js";const s={components:{ListPageTop:_},data(){return{breads:[{text:"About",disabled:!0,href:"/about"}]}},methods:{}};var n=function(){var t=this,r=t._self._c;return r("div",[r(_,{attrs:{breads:t.breads}}),t._m(0)],1)},i=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"about"},[t("img",{staticStyle:{"padding-bottom":"20px"},attrs:{alt:"Starkiller",width:"200px",src:a}}),t("span",[e._v("Starkiller is developed by "),t("a",{attrs:{href:"https://bc-security.org/blog",target:"_blank",rel:"noopener noreferrer"}},[e._v("BC Security")]),e._v(".")]),t("span",[e._v("If you would like to contribute please visit our "),t("a",{attrs:{href:"https://github.com/BC-SECURITY/Starkiller",target:"_blank",rel:"noopener noreferrer"}},[e._v("GitHub")]),e._v(". ")])])}],l=o(s,n,i,!1,null,"107fcc3f",null,null);const d=l.exports;export{d as default}; +import{_}from"./ListPageTop.2a204a11.js";import{n as a,_ as o}from"./index.85262dd3.js";import"./VBreadcrumbs.32f4f2d0.js";const s={components:{ListPageTop:_},data(){return{breads:[{text:"About",disabled:!0,href:"/about"}]}},methods:{}};var n=function(){var t=this,r=t._self._c;return r("div",[r(_,{attrs:{breads:t.breads}}),t._m(0)],1)},i=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"about"},[t("img",{staticStyle:{"padding-bottom":"20px"},attrs:{alt:"Starkiller",width:"200px",src:o}}),t("span",[e._v("Starkiller is developed by "),t("a",{attrs:{href:"https://bc-security.org/blog",target:"_blank",rel:"noopener noreferrer"}},[e._v("BC Security")]),e._v(".")]),t("span",[e._v("If you would like to contribute please visit our "),t("a",{attrs:{href:"https://github.com/BC-SECURITY/Starkiller",target:"_blank",rel:"noopener noreferrer"}},[e._v("GitHub")]),e._v(". ")])])}],l=a(s,n,i,!1,null,"ca353d84",null,null);const d=l.exports;export{d as default}; diff --git a/dist/assets/About.e2651601.css b/dist/assets/About.e2651601.css new file mode 100644 index 0000000..d532fc0 --- /dev/null +++ b/dist/assets/About.e2651601.css @@ -0,0 +1 @@ +.about[data-v-ca353d84]{display:flex;flex-direction:column;align-items:center} diff --git a/dist/assets/AdvancedTable.65916e9e.js b/dist/assets/AdvancedTable.8f5cf108.js similarity index 68% rename from dist/assets/AdvancedTable.65916e9e.js rename to dist/assets/AdvancedTable.8f5cf108.js index bddf279..90d541a 100644 --- a/dist/assets/AdvancedTable.65916e9e.js +++ b/dist/assets/AdvancedTable.8f5cf108.js @@ -1 +1 @@ -import{n as l,r as n}from"./index.154e9cc6.js";import{_}from"./VExpansionPanels.1f915cd7.js";const a={name:"AdvancedTable"};var s=function(){var e=this,t=e._self._c;return t("div",{staticStyle:{display:"flex","flex-direction":"row","flex-wrap":"wrap"}},[t(n,{staticClass:"mr-2 pa-2",staticStyle:{"flex-basis":"250px"},attrs:{elevation:"2",outlined:""}},[t(_,{staticClass:"mb-6",attrs:{multiple:""}},[e._t("filters")],2)],1),t(n,{staticStyle:{flex:"1","min-width":"0"},attrs:{elevation:"2",outlined:""}},[e._t("table")],2)],1)},i=[],r=l(a,s,i,!1,null,null,null,null);const m=r.exports;export{m as _}; +import{n as l,f as n}from"./index.85262dd3.js";import{_}from"./VExpansionPanels.d99facd5.js";const a={name:"AdvancedTable"};var s=function(){var e=this,t=e._self._c;return t("div",{staticStyle:{display:"flex","flex-direction":"row","flex-wrap":"wrap"}},[t(n,{staticClass:"mr-2 pa-2",staticStyle:{"flex-basis":"250px"},attrs:{elevation:"2",outlined:""}},[t(_,{staticClass:"mb-6",attrs:{multiple:""}},[e._t("filters")],2)],1),t(n,{staticStyle:{flex:"1","min-width":"0"},attrs:{elevation:"2",outlined:""}},[e._t("table")],2)],1)},i=[],o=l(a,s,i,!1,null,null,null,null);const m=o.exports;export{m as _}; diff --git a/dist/assets/AdvancedTable.e3b0c442.css b/dist/assets/AdvancedTable.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/AgentEdit.4e2d6baf.js b/dist/assets/AgentEdit.4e2d6baf.js deleted file mode 100644 index b1b0aa2..0000000 --- a/dist/assets/AgentEdit.4e2d6baf.js +++ /dev/null @@ -1 +0,0 @@ -import{z as I,m as v,C,bd as Fe,c as f,T as D,b as g,s as Be,be as Le,bf as le,al as q,aC as oe,g as Ne,F as Q,ah as he,aJ as Ye,J as h,aI as Ve,aH as Re,bg as je,H as G,aK as Ue,n as k,j as T,a as S,i as qe,bh as We,bi as He,bj as Ke,bk as ee,aE as O,aR as F,r as b,aS as B,aF as P,aG as L,bl as V,bm as de,bn as Ze,b7 as Je,k as Xe,l as Qe,a9 as Ge,bo as et,bp as tt,bq as it,aT as Z,ad as te,b1 as st,b2 as nt,b3 as at,br as rt,bs as lt,b8 as ot,bt as ht,o as dt}from"./index.154e9cc6.js";import{h as W}from"./moment.9709ab41.js";import{b as z,c as x,a as ce,_ as ue}from"./ErrorStateAlert.3518d55f.js";import{a as ct,b as pe,f as ut,c as pt}from"./GeneralForm.6b452c3e.js";import{_ as me,b as mt}from"./VSelect.27a57f2b.js";import{_ as fe}from"./AgentTasksList.bd1fbdb1.js";import{_ as N}from"./AgentExecuteModule.cd5c09de.js";import{l as ft}from"./index.e9f2ede5.js";import{_ as H}from"./VTooltip.b258437e.js";import{_ as ge}from"./TagViewer.b07ca85a.js";import{_ as w}from"./TooltipButton.6022e185.js";import{_ as ve}from"./TooltipButtonToggle.63686f71.js";import{_ as gt,a as A,b as vt,c as M}from"./VTabItem.9e30abd4.js";import{_ as _t}from"./VBreadcrumbs.a2278375.js";import"./index.41ea8dd2.js";import"./download-api.dfe5301b.js";import"./VSwitch.4adac3f4.js";import"./index.27090f0f.js";import"./DateTimeDisplay.97700a4a.js";import"./ansi_up.bcd3942b.js";import"./download-stager.85a6b476.js";import"./VPagination.90d5be16.js";import"./VDataTable.71ce8bb9.js";import"./ExpansionPanelFilter.5838fe52.js";import"./VExpansionPanelHeader.d8fbc23c.js";import"./ExpansionPanelSearch.7dcac59a.js";import"./AdvancedTable.65916e9e.js";import"./VExpansionPanels.1f915cd7.js";import"./ListPageTop.dad49f81.js";import"./tag-api.5e19879c.js";import"./TechniqueChips.5e972795.js";import"./InfoViewer.ad34ab3b.js";const Y=I.extend({name:"localable",props:{locale:String},computed:{currentLocale(){return this.locale||this.$vuetify.lang.current}}});function yt(t,e=0,i=1){let s;return t<100&&t>=0?(s=new Date(Date.UTC(t,e,i)),isFinite(s.getUTCFullYear())&&s.setUTCFullYear(t)):s=new Date(Date.UTC(t,e,i)),s}function K(t,e,i){const s=7+e-i;return-((7+yt(t,0,s).getUTCDay()-e)%7)+s-1}function bt(t,e,i,s){let n=[0,31,59,90,120,151,181,212,243,273,304,334][e];return e>1&&J(t)&&n++,n+i}function R(t,e,i){const s=K(t,e,i),n=K(t+1,e,i);return((J(t)?366:365)-s+n)/7}function kt(t,e,i,s,n){const a=K(t,s,n),r=Math.ceil((bt(t,e,i)-a)/7);return r<1?r+R(t-1,s,n):r>R(t,s,n)?r-R(t,s,n):r}function J(t){return t%4===0&&t%100!==0||t%400===0}const $t=[0,31,28,31,30,31,30,31,31,30,31,30,31],wt=[0,31,29,31,30,31,30,31,31,30,31,30,31];function xt(t,e){return J(t)?wt[e]:$t[e]}const Ct=v(C).extend({methods:{genPickerButton(t,e,i,s=!1,n=""){const a=this[t]===e,r=l=>{l.stopPropagation(),this.$emit(`update:${Fe(t)}`,e)};return this.$createElement("div",{staticClass:`v-picker__title__btn ${n}`.trim(),class:{"v-picker__title__btn--active":a,"v-picker__title__btn--readonly":s},on:a||s?void 0:{click:r}},Array.isArray(i)?i:[i])}}}),St=v(Ct).extend({name:"v-date-picker-title",props:{date:{type:String,default:""},disabled:Boolean,readonly:Boolean,selectingYear:Boolean,value:{type:String},year:{type:[Number,String],default:""},yearIcon:{type:String}},data:()=>({isReversing:!1}),computed:{computedTransition(){return this.isReversing?"picker-reverse-transition":"picker-transition"}},watch:{value(t,e){this.isReversing=t(n.endsWith(e)&&(s[n.slice(0,-e.length)]=a=>t.$emit(n,i,a)),s),{})}function j(t,e){return Object.keys(t.$listeners).reduce((i,s)=>(s.endsWith(e)&&(i[s]=t.$listeners[s]),i),{})}const Tt=(t,e,i)=>(e=e>>0,t=String(t),i=String(i),t.length>e?String(t):(e=e-t.length,e>i.length&&(i+=i.repeat(e/i.length)),i.slice(0,e)+String(t))),d=(t,e=2)=>Tt(t,e,"0");function $(t,e,i={start:0,length:0}){const s=n=>{const[a,r,l]=n.trim().split(" ")[0].split("-");return[d(a,4),d(r||1),d(l||1)].join("-")};try{const n=new Intl.DateTimeFormat(t||void 0,e);return a=>n.format(new Date(`${s(a)}T00:00:00+00:00`))}catch{return i.start||i.length?a=>s(a).substr(i.start||0,i.length):void 0}}const ye=(t,e)=>{const[i,s]=t.split("-").map(Number);return s+e===0?`${i-1}-12`:s+e===13?`${i+1}-01`:`${i}-${d(s+e)}`},p=(t,e)=>{const[i,s=1,n=1]=t.split("-");return`${i}-${d(s)}-${d(n)}`.substr(0,{date:10,month:7,year:4}[e])},Dt=v(C,Y,D).extend({name:"v-date-picker-header",props:{disabled:Boolean,format:Function,min:String,max:String,nextAriaLabel:String,nextIcon:{type:String,default:"$next"},prevAriaLabel:String,prevIcon:{type:String,default:"$prev"},readonly:Boolean,value:{type:[Number,String],required:!0}},data(){return{isReversing:!1}},computed:{formatter(){return this.format?this.format:String(this.value).split("-")[1]?$(this.currentLocale,{month:"long",year:"numeric",timeZone:"UTC"},{length:7}):$(this.currentLocale,{year:"numeric",timeZone:"UTC"},{length:4})}},watch:{value(t,e){this.isReversing=t0?this.nextAriaLabel:this.prevAriaLabel,i=e?this.$vuetify.lang.t(e):void 0,s=this.disabled||t<0&&this.min&&this.calculateChange(t)0&&this.max&&this.calculateChange(t)>this.max;return this.$createElement(g,{attrs:{"aria-label":i},props:{dark:this.dark,disabled:s,icon:!0,light:this.light},on:{click:n=>{n.stopPropagation(),this.$emit("input",this.calculateChange(t))}}},[this.$createElement(f,t<0==!this.$vuetify.rtl?this.prevIcon:this.nextIcon)])},calculateChange(t){const[e,i]=String(this.value).split("-").map(Number);return i==null?`${e+t}`:ye(String(this.value),t)},genHeader(){const t=!this.disabled&&(this.color||"accent"),e=this.$createElement("div",this.setTextColor(t,{key:String(this.value)}),[this.$createElement("button",{attrs:{type:"button"},on:{click:()=>this.$emit("toggle")}},[this.$slots.default||this.formatter(String(this.value))])]),i=this.$createElement("transition",{props:{name:this.isReversing===!this.$vuetify.rtl?"tab-reverse-transition":"tab-transition"}},[e]);return this.$createElement("div",{staticClass:"v-date-picker-header__value",class:{"v-date-picker-header__value--disabled":this.disabled}},[i])}},render(){return this.$createElement("div",{staticClass:"v-date-picker-header",class:{"v-date-picker-header--disabled":this.disabled,...this.themeClasses}},[this.genBtn(-1),this.genHeader(),this.genBtn(1)])}});function be(t,e,i,s){return(!s||s(t))&&(!e||t>=e.substr(0,10))&&(!i||t<=i)}const ke=v(C,Y,D).extend({directives:{Touch:Be},props:{allowedDates:Function,current:String,disabled:Boolean,format:Function,events:{type:[Array,Function,Object],default:()=>null},eventColor:{type:[Array,Function,Object,String],default:()=>"warning"},min:String,max:String,range:Boolean,readonly:Boolean,scrollable:Boolean,tableDate:{type:String,required:!0},value:[String,Array]},data:()=>({isReversing:!1,wheelThrottle:null}),computed:{computedTransition(){return this.isReversing===!this.$vuetify.rtl?"tab-reverse-transition":"tab-transition"},displayedMonth(){return Number(this.tableDate.split("-")[1])-1},displayedYear(){return Number(this.tableDate.split("-")[0])}},watch:{tableDate(t,e){this.isReversing=t{e&&!this.readonly&&this.$emit("input",t)}},_e(this,`:${i}`,t))},genButton(t,e,i,s,n=!1){const a=be(t,this.min,this.max,this.allowedDates),r=this.isSelected(t)&&a,l=t===this.current,o=r?this.setBackgroundColor:this.setTextColor,c=(r||l)&&(this.color||"accent");let _=!1,m=!1;return this.range&&!!this.value&&Array.isArray(this.value)&&(_=t===this.value[0],m=t===this.value[this.value.length-1]),this.$createElement("button",o(c,{staticClass:"v-btn",class:this.genButtonClasses(a&&!n,e,r,l,_,m),attrs:{type:"button"},domProps:{disabled:this.disabled||!a||n},on:this.genButtonEvents(t,a,i)}),[this.$createElement("div",{staticClass:"v-btn__content"},[s(t)]),this.genEvents(t)])},getEventColors(t){const e=n=>Array.isArray(n)?n:[n];let i,s=[];if(Array.isArray(this.events)?i=this.events.includes(t):this.events instanceof Function?i=this.events(t)||!1:this.events?i=this.events[t]||!1:i=!1,i)i!==!0?s=e(i):typeof this.eventColor=="string"?s=[this.eventColor]:typeof this.eventColor=="function"?s=e(this.eventColor(t)):Array.isArray(this.eventColor)?s=this.eventColor:s=e(this.eventColor[t]);else return[];return s.filter(n=>n)},genEvents(t){const e=this.getEventColors(t);return e.length?this.$createElement("div",{staticClass:"v-date-picker-table__events"},e.map(i=>this.$createElement("div",this.setBackgroundColor(i)))):null},isValidScroll(t,e){const i=e(t),s=i.split("-").length===1?"year":"month";return t<0&&(this.min?i>=p(this.min,s):!0)||t>0&&(this.max?i<=p(this.max,s):!0)},wheel(t,e){this.$emit("update:table-date",e(t.deltaY))},touch(t,e){this.$emit("update:table-date",e(t))},genTable(t,e,i){const s=this.$createElement("transition",{props:{name:this.computedTransition}},[this.$createElement("table",{key:this.tableDate},e)]),n={name:"touch",value:{left:a=>a.offsetX<-15&&this.isValidScroll(1,i)&&this.touch(1,i),right:a=>a.offsetX>15&&this.isValidScroll(-1,i)&&this.touch(-1,i)}};return this.$createElement("div",{staticClass:t,class:{"v-date-picker-table--disabled":this.disabled,...this.themeClasses},on:!this.disabled&&this.scrollable?{wheel:a=>{a.preventDefault(),this.isValidScroll(a.deltaY,i)&&this.wheelThrottle(a,i)}}:void 0,directives:[n]},[s])},isSelected(t){if(Array.isArray(this.value))if(this.range&&this.value.length===2){const[e,i]=[...this.value].sort();return e<=t&&t<=i}else return this.value.indexOf(t)!==-1;return t===this.value}}}),Pt=v(ke).extend({name:"v-date-picker-date-table",props:{firstDayOfWeek:{type:[String,Number],default:0},localeFirstDayOfYear:{type:[String,Number],default:0},showAdjacentMonths:Boolean,showWeek:Boolean,weekdayFormat:Function},computed:{formatter(){return this.format||$(this.currentLocale,{day:"numeric",timeZone:"UTC"},{start:8,length:2})},weekdayFormatter(){return this.weekdayFormat||$(this.currentLocale,{weekday:"narrow",timeZone:"UTC"})},weekDays(){const t=parseInt(this.firstDayOfWeek,10);return this.weekdayFormatter?q(7).map(e=>this.weekdayFormatter(`2017-01-${t+e+15}`)):q(7).map(e=>["S","M","T","W","T","F","S"][(e+t)%7])}},methods:{calculateTableDate(t){return ye(this.tableDate,Math.sign(t||1))},genTHead(){const t=this.weekDays.map(e=>this.$createElement("th",e));return this.showWeek&&t.unshift(this.$createElement("th")),this.$createElement("thead",this.genTR(t))},weekDaysBeforeFirstDayOfTheMonth(){return(new Date(`${this.displayedYear}-${d(this.displayedMonth+1)}-01T00:00:00+00:00`).getUTCDay()-parseInt(this.firstDayOfWeek)+7)%7},getWeekNumber(t){return kt(this.displayedYear,this.displayedMonth,t,parseInt(this.firstDayOfWeek),parseInt(this.localeFirstDayOfYear))},genWeekNumber(t){return this.$createElement("td",[this.$createElement("small",{staticClass:"v-date-picker-table--date__week"},String(t).padStart(2,"0"))])},genTBody(){const t=[],e=new Date(this.displayedYear,this.displayedMonth+1,0).getDate();let i=[],s=this.weekDaysBeforeFirstDayOfTheMonth();this.showWeek&&i.push(this.genWeekNumber(this.getWeekNumber(1)));const n=this.displayedMonth?this.displayedYear:this.displayedYear-1,a=(this.displayedMonth+11)%12,r=new Date(this.displayedYear,this.displayedMonth,0).getDate(),l=this.showWeek?8:7;for(;s--;){const m=`${n}-${d(a+1)}-${d(r-s)}`;i.push(this.$createElement("td",this.showAdjacentMonths?[this.genButton(m,!0,"date",this.formatter,!0)]:[]))}for(s=1;s<=e;s++){const m=`${this.displayedYear}-${d(this.displayedMonth+1)}-${d(s)}`;i.push(this.$createElement("td",[this.genButton(m,!0,"date",this.formatter)])),i.length%l===0&&(t.push(this.genTR(i)),i=[],this.showWeek&&(s{const l=s*e.length+r,o=`${this.displayedYear}-${d(l+1)}`;return this.$createElement("td",{key:l},[this.genButton(o,!1,"month",this.formatter)])});t.push(this.$createElement("tr",{key:s},n))}return this.$createElement("tbody",t)}},render(){return this.genTable("v-date-picker-table v-date-picker-table--month",[this.genTBody()],this.calculateTableDate)}});const At=v(C,Y).extend({name:"v-date-picker-years",props:{format:Function,min:[Number,String],max:[Number,String],readonly:Boolean,value:[Number,String]},data(){return{defaultColor:"primary"}},computed:{formatter(){return this.format||$(this.currentLocale,{year:"numeric",timeZone:"UTC"},{length:4})}},mounted(){setTimeout(()=>{const t=this.$el.getElementsByClassName("active")[0];t?this.$el.scrollTop=t.offsetTop-this.$el.offsetHeight/2+t.offsetHeight/2:this.min&&!this.max?this.$el.scrollTop=this.$el.scrollHeight:!this.min&&this.max?this.$el.scrollTop=0:this.$el.scrollTop=this.$el.scrollHeight/2-this.$el.offsetHeight/2})},methods:{genYearItem(t){const e=this.formatter(`${t}`),i=parseInt(this.value,10)===t,s=i&&(this.color||"primary");return this.$createElement("li",this.setTextColor(s,{key:t,class:{active:i},on:le({click:()=>this.$emit("input",t)},_e(this,":year",t))}),e)},genYearItems(){const t=[],e=this.value?parseInt(this.value,10):new Date().getFullYear(),i=this.max?parseInt(this.max,10):e+100,s=Math.min(i,this.min?parseInt(this.min,10):e-100);for(let n=i;n>=s;n--)t.push(this.genYearItem(n));return t}},render(){return this.$createElement("ul",{staticClass:"v-date-picker-years",ref:"years"},this.genYearItems())}});const Mt=v(C,oe,D).extend({name:"v-picker",props:{flat:Boolean,fullWidth:Boolean,landscape:Boolean,noTitle:Boolean,transition:{type:String,default:"fade-transition"},width:{type:[Number,String],default:290}},computed:{computedTitleColor(){const t=this.isDark?!1:this.color||"primary";return this.color||t}},methods:{genTitle(){return this.$createElement("div",this.setBackgroundColor(this.computedTitleColor,{staticClass:"v-picker__title",class:{"v-picker__title--landscape":this.landscape}}),this.$slots.title)},genBodyTransition(){return this.$createElement("transition",{props:{name:this.transition}},this.$slots.default)},genBody(){return this.$createElement("div",{staticClass:"v-picker__body",class:{"v-picker__body--no-title":this.noTitle,...this.themeClasses},style:this.fullWidth?void 0:{width:Ne(this.width)}},[this.genBodyTransition()])},genActions(){return this.$createElement("div",{staticClass:"v-picker__actions v-card__actions",class:{"v-picker__actions--no-title":this.noTitle}},this.$slots.actions)}},render(t){return t("div",{staticClass:"v-picker v-card",class:{"v-picker--flat":this.flat,"v-picker--landscape":this.landscape,"v-picker--full-width":this.fullWidth,...this.themeClasses,...this.elevationClasses}},[this.$slots.title?this.genTitle():null,this.genBody(),this.$slots.actions?this.genActions():null])}}),It=v(C,oe,D).extend({name:"picker",props:{flat:Boolean,fullWidth:Boolean,headerColor:String,landscape:Boolean,noTitle:Boolean,width:{type:[Number,String],default:290}},methods:{genPickerTitle(){return null},genPickerBody(){return null},genPickerActionsSlot(){return this.$scopedSlots.default?this.$scopedSlots.default({save:this.save,cancel:this.cancel}):this.$slots.default},genPicker(t){const e=[];if(!this.noTitle){const s=this.genPickerTitle();s&&e.push(s)}const i=this.genPickerBody();return i&&e.push(i),e.push(this.$createElement("template",{slot:"actions"},[this.genPickerActionsSlot()])),this.$createElement(Mt,{staticClass:t,props:{color:this.headerColor||this.color,dark:this.dark,elevation:this.elevation,flat:this.flat,fullWidth:this.fullWidth,landscape:this.landscape,light:this.light,width:this.width,noTitle:this.noTitle}},e)}}}),Et=v(Y,It).extend({name:"v-date-picker",props:{activePicker:String,allowedDates:Function,dayFormat:Function,disabled:Boolean,events:{type:[Array,Function,Object],default:()=>null},eventColor:{type:[Array,Function,Object,String],default:()=>"warning"},firstDayOfWeek:{type:[String,Number],default:0},headerDateFormat:Function,localeFirstDayOfYear:{type:[String,Number],default:0},max:String,min:String,monthFormat:Function,multiple:Boolean,nextIcon:{type:String,default:"$next"},nextMonthAriaLabel:{type:String,default:"$vuetify.datePicker.nextMonthAriaLabel"},nextYearAriaLabel:{type:String,default:"$vuetify.datePicker.nextYearAriaLabel"},pickerDate:String,prevIcon:{type:String,default:"$prev"},prevMonthAriaLabel:{type:String,default:"$vuetify.datePicker.prevMonthAriaLabel"},prevYearAriaLabel:{type:String,default:"$vuetify.datePicker.prevYearAriaLabel"},range:Boolean,reactive:Boolean,readonly:Boolean,scrollable:Boolean,showCurrent:{type:[Boolean,String],default:!0},selectedItemsText:{type:String,default:"$vuetify.datePicker.itemsSelected"},showAdjacentMonths:Boolean,showWeek:Boolean,titleDateFormat:Function,type:{type:String,default:"date",validator:t=>["date","month"].includes(t)},value:[Array,String],weekdayFormat:Function,yearFormat:Function,yearIcon:String},data(){const t=new Date;return{internalActivePicker:this.type.toUpperCase(),inputDay:null,inputMonth:null,inputYear:null,isReversing:!1,now:t,tableDate:(()=>{if(this.pickerDate)return this.pickerDate;const e=Q(this.value),i=e[e.length-1]||(typeof this.showCurrent=="string"?this.showCurrent:`${t.getFullYear()}-${t.getMonth()+1}`);return p(i,this.type==="date"?"month":"year")})()}},computed:{multipleValue(){return Q(this.value)},isMultiple(){return this.multiple||this.range},lastValue(){return this.isMultiple?this.multipleValue[this.multipleValue.length-1]:this.value},selectedMonths(){return!this.value||this.type==="month"?this.value:this.isMultiple?this.multipleValue.map(t=>t.substr(0,7)):this.value.substr(0,7)},current(){return this.showCurrent===!0?p(`${this.now.getFullYear()}-${this.now.getMonth()+1}-${this.now.getDate()}`,this.type):this.showCurrent||null},inputDate(){return this.type==="date"?`${this.inputYear}-${d(this.inputMonth+1)}-${d(this.inputDay)}`:`${this.inputYear}-${d(this.inputMonth+1)}`},tableMonth(){return Number((this.pickerDate||this.tableDate).split("-")[1])-1},tableYear(){return Number((this.pickerDate||this.tableDate).split("-")[0])},minMonth(){return this.min?p(this.min,"month"):null},maxMonth(){return this.max?p(this.max,"month"):null},minYear(){return this.min?p(this.min,"year"):null},maxYear(){return this.max?p(this.max,"year"):null},formatters(){return{year:this.yearFormat||$(this.currentLocale,{year:"numeric",timeZone:"UTC"},{length:4}),titleDate:this.titleDateFormat||(this.isMultiple?this.defaultTitleMultipleDateFormatter:this.defaultTitleDateFormatter)}},defaultTitleMultipleDateFormatter(){return t=>t.length?t.length===1?this.defaultTitleDateFormatter(t[0]):this.$vuetify.lang.t(this.selectedItemsText,t.length):"-"},defaultTitleDateFormatter(){const t={year:{year:"numeric",timeZone:"UTC"},month:{month:"long",timeZone:"UTC"},date:{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}},e=$(this.currentLocale,t[this.type],{start:0,length:{date:10,month:7,year:4}[this.type]}),i=s=>e(s).replace(/([^\d\s])([\d])/g,(n,a,r)=>`${a} ${r}`).replace(", ",",
");return this.landscape?i:e}},watch:{internalActivePicker:{immediate:!0,handler(t){this.$emit("update:active-picker",t)}},activePicker(t){this.internalActivePicker=t},tableDate(t,e){const i=this.type==="month"?"year":"month";this.isReversing=p(t,i)p(i,t)).filter(this.isDateAllowed);this.$emit("input",this.isMultiple?e:e[0])}}},created(){this.checkMultipleProp(),this.pickerDate!==this.tableDate&&this.$emit("update:picker-date",this.tableDate),this.setInputDate()},methods:{emitInput(t){if(this.range){if(this.multipleValue.length!==1)this.$emit("input",[t]);else{const i=[this.multipleValue[0],t];this.$emit("input",i),this.$emit("change",i)}return}const e=this.multiple?this.multipleValue.indexOf(t)===-1?this.multipleValue.concat([t]):this.multipleValue.filter(i=>i!==t):t;this.$emit("input",e),this.multiple||this.$emit("change",t)},checkMultipleProp(){if(this.value==null)return;const t=this.value.constructor.name,e=this.isMultiple?"Array":"String";t!==e&&he(`Value must be ${this.isMultiple?"an":"a"} ${e}, got ${t}`,this)},isDateAllowed(t){return be(t,this.min,this.max,this.allowedDates)},yearClick(t){this.inputYear=t,this.type==="month"?this.tableDate=`${t}`:this.tableDate=`${t}-${d((this.tableMonth||0)+1)}`,this.internalActivePicker="MONTH",this.reactive&&!this.readonly&&!this.isMultiple&&this.isDateAllowed(this.inputDate)&&this.$emit("input",this.inputDate)},monthClick(t){const[e,i]=t.split("-");this.inputYear=parseInt(e,10),this.inputMonth=parseInt(i,10)-1,this.type==="date"?(this.inputDay&&(this.inputDay=Math.min(this.inputDay,xt(this.inputYear,this.inputMonth+1))),this.tableDate=t,this.internalActivePicker="DATE",this.reactive&&!this.readonly&&!this.isMultiple&&this.isDateAllowed(this.inputDate)&&this.$emit("input",this.inputDate)):this.emitInput(this.inputDate)},dateClick(t){const[e,i,s]=t.split("-");this.inputYear=parseInt(e,10),this.inputMonth=parseInt(i,10)-1,this.inputDay=parseInt(s,10),this.emitInput(this.inputDate)},genPickerTitle(){return this.$createElement(St,{props:{date:this.value?this.formatters.titleDate(this.isMultiple?this.multipleValue:this.value):"",disabled:this.disabled,readonly:this.readonly,selectingYear:this.internalActivePicker==="YEAR",year:this.formatters.year(this.multipleValue.length?`${this.inputYear}`:this.tableDate),yearIcon:this.yearIcon,value:this.multipleValue[0]},slot:"title",on:{"update:selecting-year":t=>this.internalActivePicker=t?"YEAR":this.type.toUpperCase()}})},genTableHeader(){return this.$createElement(Dt,{props:{nextIcon:this.nextIcon,color:this.color,dark:this.dark,disabled:this.disabled,format:this.headerDateFormat,light:this.light,locale:this.locale,min:this.internalActivePicker==="DATE"?this.minMonth:this.minYear,max:this.internalActivePicker==="DATE"?this.maxMonth:this.maxYear,nextAriaLabel:this.internalActivePicker==="DATE"?this.nextMonthAriaLabel:this.nextYearAriaLabel,prevAriaLabel:this.internalActivePicker==="DATE"?this.prevMonthAriaLabel:this.prevYearAriaLabel,prevIcon:this.prevIcon,readonly:this.readonly,value:this.internalActivePicker==="DATE"?`${d(this.tableYear,4)}-${d(this.tableMonth+1)}`:`${d(this.tableYear,4)}`},on:{toggle:()=>this.internalActivePicker=this.internalActivePicker==="DATE"?"MONTH":"YEAR",input:t=>this.tableDate=t}})},genDateTable(){return this.$createElement(Pt,{props:{allowedDates:this.allowedDates,color:this.color,current:this.current,dark:this.dark,disabled:this.disabled,events:this.events,eventColor:this.eventColor,firstDayOfWeek:this.firstDayOfWeek,format:this.dayFormat,light:this.light,locale:this.locale,localeFirstDayOfYear:this.localeFirstDayOfYear,min:this.min,max:this.max,range:this.range,readonly:this.readonly,scrollable:this.scrollable,showAdjacentMonths:this.showAdjacentMonths,showWeek:this.showWeek,tableDate:`${d(this.tableYear,4)}-${d(this.tableMonth+1)}`,value:this.value,weekdayFormat:this.weekdayFormat},ref:"table",on:{input:this.dateClick,"update:table-date":t=>this.tableDate=t,...j(this,":date")}})},genMonthTable(){return this.$createElement(zt,{props:{allowedDates:this.type==="month"?this.allowedDates:null,color:this.color,current:this.current?p(this.current,"month"):null,dark:this.dark,disabled:this.disabled,events:this.type==="month"?this.events:null,eventColor:this.type==="month"?this.eventColor:null,format:this.monthFormat,light:this.light,locale:this.locale,min:this.minMonth,max:this.maxMonth,range:this.range,readonly:this.readonly&&this.type==="month",scrollable:this.scrollable,value:this.selectedMonths,tableDate:`${d(this.tableYear,4)}`},ref:"table",on:{input:this.monthClick,"update:table-date":t=>this.tableDate=t,...j(this,":month")}})},genYears(){return this.$createElement(At,{props:{color:this.color,format:this.yearFormat,locale:this.locale,min:this.minYear,max:this.maxYear,value:this.tableYear},on:{input:this.yearClick,...j(this,":year")}})},genPickerBody(){const t=this.internalActivePicker==="YEAR"?[this.genYears()]:[this.genTableHeader(),this.internalActivePicker==="DATE"?this.genDateTable():this.genMonthTable()];return this.$createElement("div",{key:this.internalActivePicker},t)},setInputDate(){if(this.lastValue){const t=this.lastValue.split("-");this.inputYear=parseInt(t[0],10),this.inputMonth=parseInt(t[1],10)-1,this.type==="date"&&(this.inputDay=parseInt(t[2],10))}else this.inputYear=this.inputYear||this.now.getFullYear(),this.inputMonth=this.inputMonth==null?this.inputMonth:this.now.getMonth(),this.inputDay=this.inputDay||this.now.getDate()}},render(){return this.genPicker("v-picker--date")}});const Ot=v(C,Ye("treeview")),$e={activatable:Boolean,activeClass:{type:String,default:"v-treeview-node--active"},color:{type:String,default:"primary"},disablePerNode:Boolean,expandIcon:{type:String,default:"$subgroup"},indeterminateIcon:{type:String,default:"$checkboxIndeterminate"},itemChildren:{type:String,default:"children"},itemDisabled:{type:String,default:"disabled"},itemKey:{type:String,default:"id"},itemText:{type:String,default:"name"},loadChildren:Function,loadingIcon:{type:String,default:"$loading"},offIcon:{type:String,default:"$checkboxOff"},onIcon:{type:String,default:"$checkboxOn"},openOnClick:Boolean,rounded:Boolean,selectable:Boolean,selectedColor:{type:String,default:"accent"},shaped:Boolean,transition:Boolean,selectionType:{type:String,default:"leaf",validator:t=>["leaf","independent"].includes(t)}},we=Ot.extend().extend({name:"v-treeview-node",inject:{treeview:{default:null}},props:{level:Number,item:{type:Object,default:()=>null},parentIsDisabled:Boolean,...$e},data:()=>({hasLoaded:!1,isActive:!1,isIndeterminate:!1,isLoading:!1,isOpen:!1,isSelected:!1}),computed:{disabled(){return h(this.item,this.itemDisabled)||!this.disablePerNode&&this.parentIsDisabled&&this.selectionType==="leaf"},key(){return h(this.item,this.itemKey)},children(){const t=h(this.item,this.itemChildren);return t&&t.filter(e=>!this.treeview.isExcluded(h(e,this.itemKey)))},text(){return h(this.item,this.itemText)},scopedProps(){return{item:this.item,leaf:!this.children,selected:this.isSelected,indeterminate:this.isIndeterminate,active:this.isActive,open:this.isOpen}},computedIcon(){return this.isIndeterminate?this.indeterminateIcon:this.isSelected?this.onIcon:this.offIcon},hasChildren(){return!!this.children&&(!!this.children.length||!!this.loadChildren)}},created(){this.treeview.register(this)},beforeDestroy(){this.treeview.unregister(this)},methods:{checkChildren(){return new Promise(t=>{if(!this.children||this.children.length||!this.loadChildren||this.hasLoaded)return t();this.isLoading=!0,t(this.loadChildren(this.item))}).then(()=>{this.isLoading=!1,this.hasLoaded=!0})},open(){this.isOpen=!this.isOpen,this.treeview.updateOpen(this.key,this.isOpen),this.treeview.emitOpen()},genLabel(){const t=[];return this.$scopedSlots.label?t.push(this.$scopedSlots.label(this.scopedProps)):t.push(this.text),this.$createElement("div",{slot:"label",staticClass:"v-treeview-node__label"},t)},genPrependSlot(){return this.$scopedSlots.prepend?this.$createElement("div",{staticClass:"v-treeview-node__prepend"},this.$scopedSlots.prepend(this.scopedProps)):null},genAppendSlot(){return this.$scopedSlots.append?this.$createElement("div",{staticClass:"v-treeview-node__append"},this.$scopedSlots.append(this.scopedProps)):null},genContent(){const t=[this.genPrependSlot(),this.genLabel(),this.genAppendSlot()];return this.$createElement("div",{staticClass:"v-treeview-node__content"},t)},genToggle(){return this.$createElement(f,{staticClass:"v-treeview-node__toggle",class:{"v-treeview-node__toggle--open":this.isOpen,"v-treeview-node__toggle--loading":this.isLoading},slot:"prepend",on:{click:t=>{t.stopPropagation(),!this.isLoading&&this.checkChildren().then(()=>this.open())}}},[this.isLoading?this.loadingIcon:this.expandIcon])},genCheckbox(){return this.$createElement(f,{staticClass:"v-treeview-node__checkbox",props:{color:this.isSelected||this.isIndeterminate?this.selectedColor:void 0,disabled:this.disabled},on:{click:t=>{t.stopPropagation(),!this.isLoading&&this.checkChildren().then(()=>{this.$nextTick(()=>{this.isSelected=!this.isSelected,this.isIndeterminate=!1,this.treeview.updateSelected(this.key,this.isSelected),this.treeview.emitSelected()})})}}},[this.computedIcon])},genLevel(t){return q(t).map(()=>this.$createElement("div",{staticClass:"v-treeview-node__level"}))},genNode(){const t=[this.genContent()];return this.selectable&&t.unshift(this.genCheckbox()),this.hasChildren?t.unshift(this.genToggle()):t.unshift(...this.genLevel(1)),t.unshift(...this.genLevel(this.level)),this.$createElement("div",this.setTextColor(this.isActive&&this.color,{staticClass:"v-treeview-node__root",class:{[this.activeClass]:this.isActive},on:{click:()=>{this.openOnClick&&this.hasChildren?this.checkChildren().then(this.open):this.activatable&&!this.disabled&&(this.isActive=!this.isActive,this.treeview.updateActive(this.key,this.isActive),this.treeview.emitActive())}}}),t)},genChild(t,e){return this.$createElement(we,{key:h(t,this.itemKey),props:{activatable:this.activatable,activeClass:this.activeClass,item:t,selectable:this.selectable,selectedColor:this.selectedColor,color:this.color,disablePerNode:this.disablePerNode,expandIcon:this.expandIcon,indeterminateIcon:this.indeterminateIcon,offIcon:this.offIcon,onIcon:this.onIcon,loadingIcon:this.loadingIcon,itemKey:this.itemKey,itemText:this.itemText,itemDisabled:this.itemDisabled,itemChildren:this.itemChildren,loadChildren:this.loadChildren,transition:this.transition,openOnClick:this.openOnClick,rounded:this.rounded,shaped:this.shaped,level:this.level+1,selectionType:this.selectionType,parentIsDisabled:e},scopedSlots:this.$scopedSlots})},genChildrenWrapper(){if(!this.isOpen||!this.children)return null;const t=[this.children.map(e=>this.genChild(e,this.disabled))];return this.$createElement("div",{staticClass:"v-treeview-node__children"},t)},genTransition(){return this.$createElement(Ve,[this.genChildrenWrapper()])}},render(t){const e=[this.genNode()];return this.transition?e.push(this.genTransition()):e.push(this.genChildrenWrapper()),t("div",{staticClass:"v-treeview-node",class:{"v-treeview-node--leaf":!this.hasChildren,"v-treeview-node--click":this.openOnClick,"v-treeview-node--disabled":this.disabled,"v-treeview-node--rounded":this.rounded,"v-treeview-node--shaped":this.shaped,"v-treeview-node--selected":this.isSelected},attrs:{"aria-expanded":String(this.isOpen)}},e)}}),Ft=we;function Bt(t,e,i){return h(t,i).toLocaleLowerCase().indexOf(e.toLocaleLowerCase())>-1}function xe(t,e,i,s,n,a,r){if(t(e,i,n))return!0;const l=h(e,a);if(l){let o=!1;for(let c=0;c[]},dense:Boolean,disabled:Boolean,filter:Function,hoverable:Boolean,items:{type:Array,default:()=>[]},multipleActive:Boolean,open:{type:Array,default:()=>[]},openAll:Boolean,returnObject:{type:Boolean,default:!1},search:String,value:{type:Array,default:()=>[]},...$e},data:()=>({level:-1,activeCache:new Set,nodes:{},openCache:new Set,selectedCache:new Set}),computed:{excludedItems(){const t=new Set;if(!this.search)return t;for(let e=0;eh(this.nodes[n].item,this.itemKey)),e=this.getKeys(this.items),i=je(e,t);if(!i.length&&e.lengthdelete this.nodes[n]);const s=[...this.selectedCache];this.selectedCache=new Set,this.activeCache=new Set,this.openCache=new Set,this.buildTree(this.items),G(s,[...this.selectedCache])||this.emitSelected()},deep:!0},active(t){this.handleNodeCacheWatcher(t,this.activeCache,this.updateActive,this.emitActive)},value(t){this.handleNodeCacheWatcher(t,this.selectedCache,this.updateSelected,this.emitSelected)},open(t){this.handleNodeCacheWatcher(t,this.openCache,this.updateOpen,this.emitOpen)}},created(){const t=e=>this.returnObject?h(e,this.itemKey):e;this.buildTree(this.items);for(const e of this.value.map(t))this.updateSelected(e,!0,!0);for(const e of this.active.map(t))this.updateActive(e,!0)},mounted(){(this.$slots.prepend||this.$slots.append)&&he("The prepend and append slots require a slot-scope attribute",this),this.openAll?this.updateAll(!0):(this.open.forEach(t=>this.updateOpen(this.returnObject?h(t,this.itemKey):t,!0)),this.emitOpen())},methods:{updateAll(t){Object.keys(this.nodes).forEach(e=>this.updateOpen(h(this.nodes[e].item,this.itemKey),t)),this.emitOpen()},getKeys(t,e=[]){for(let i=0;ih(c,this.itemKey)),item:n};if(this.buildTree(r,a),this.selectionType!=="independent"&&e!==null&&!this.nodes.hasOwnProperty(a)&&this.nodes.hasOwnProperty(e)?o.isSelected=this.nodes[e].isSelected:(o.isSelected=l.isSelected,o.isIndeterminate=l.isIndeterminate),o.isActive=l.isActive,o.isOpen=l.isOpen,this.nodes[a]=o,r.length&&this.selectionType!=="independent"){const{isSelected:c,isIndeterminate:_}=this.calculateState(a,this.nodes);o.isSelected=c,o.isIndeterminate=_}this.nodes[a].isSelected&&(this.selectionType==="independent"||o.children.length===0)&&this.selectedCache.add(a),this.nodes[a].isActive&&this.activeCache.add(a),this.nodes[a].isOpen&&this.openCache.add(a),this.updateVnodeState(a)}},calculateState(t,e){const i=e[t].children,s=i.reduce((r,l)=>(r[0]+=+Boolean(e[l].isSelected),r[1]+=+Boolean(e[l].isIndeterminate),r),[0,0]),n=!!i.length&&s[0]===i.length,a=!n&&(s[0]>0||s[1]>0);return{isSelected:n,isIndeterminate:a}},emitOpen(){this.emitNodeCache("update:open",this.openCache)},emitSelected(){this.emitNodeCache("input",this.selectedCache)},emitActive(){this.emitNodeCache("update:active",this.activeCache)},emitNodeCache(t,e){this.$emit(t,this.returnObject?[...e].map(i=>this.nodes[i].item):[...e])},handleNodeCacheWatcher(t,e,i,s){t=this.returnObject?t.map(a=>h(a,this.itemKey)):t;const n=[...e];G(n,t)||(n.forEach(a=>i(a,!1)),t.forEach(a=>i(a,!0)),s())},getDescendants(t,e=[]){const i=this.nodes[t].children;e.push(...i);for(let s=0;s{this.nodes[s].isActive=!1,this.updateVnodeState(s),this.activeCache.delete(s)});const i=this.nodes[t];!i||(e?this.activeCache.add(t):this.activeCache.delete(t),i.isActive=e,this.updateVnodeState(t))},updateSelected(t,e,i=!1){if(!this.nodes.hasOwnProperty(t))return;const s=new Map;if(this.selectionType!=="independent"){for(const a of this.getDescendants(t))(!h(this.nodes[a].item,this.itemDisabled)||i)&&(this.nodes[a].isSelected=e,this.nodes[a].isIndeterminate=!1,s.set(a,e));const n=this.calculateState(t,this.nodes);this.nodes[t].isSelected=e,this.nodes[t].isIndeterminate=n.isIndeterminate,s.set(t,e);for(const a of this.getParents(t)){const r=this.calculateState(a,this.nodes);this.nodes[a].isSelected=r.isSelected,this.nodes[a].isIndeterminate=r.isIndeterminate,s.set(a,r.isSelected)}}else this.nodes[t].isSelected=e,this.nodes[t].isIndeterminate=!1,s.set(t,e);for(const[n,a]of s.entries())this.updateVnodeState(n),!(this.selectionType==="leaf"&&this.isParent(n))&&(a===!0?this.selectedCache.add(n):this.selectedCache.delete(n))},updateOpen(t,e){if(!this.nodes.hasOwnProperty(t))return;const i=this.nodes[t],s=h(i.item,this.itemChildren);s&&!s.length&&i.vnode&&!i.vnode.hasLoaded?i.vnode.checkChildren().then(()=>this.updateOpen(t,e)):s&&s.length&&(i.isOpen=e,i.isOpen?this.openCache.add(t):this.openCache.delete(t),this.updateVnodeState(t))},updateVnodeState(t){const e=this.nodes[t];e&&e.vnode&&(e.vnode.isSelected=e.isSelected,e.vnode.isIndeterminate=e.isIndeterminate,e.vnode.isActive=e.isActive,e.vnode.isOpen=e.isOpen)},isExcluded(t){return!!this.search&&this.excludedItems.has(t)}},render(t){const e=this.items.length?this.items.filter(i=>!this.isExcluded(h(i,this.itemKey))).map(i=>Ft.options.methods.genChild.bind(this)(i,this.disabled||h(i,this.itemDisabled))):this.$slots.default;return t("div",{staticClass:"v-treeview",class:{"v-treeview--hoverable":this.hoverable,"v-treeview--dense":this.dense,...this.themeClasses}},e)}});const Nt={components:{},props:{editable:{type:Boolean,default:!0},label:{type:String,required:!0},value:{type:[String,Number],default:""},dataType:{type:String,default:"string"},suggestedValues:{type:Array,default:()=>[]},strict:{type:Boolean,default:!1},rules:{type:Array,default:()=>[]}},data(){return{internalValue:this.value,editing:!1,menu:!1,original:"",moment:W}},computed:{dirty(){return this.original!==this.internalValue},...Ue({isDarkMode:"application/isDarkMode"})},watch:{internalValue(t){this.$emit("input",t)}},mounted(){this.original=this.value},methods:{clicked(){!this.editable||(this.editing=!0,this.$nextTick(()=>{this.dataType==="date"||this.dataType==="date-range"?this.menu=!0:this.$refs.field.focus()}))},async update(){this.$refs.field.validate&&this.$refs.field.validate()===!1||(this.label==="Delay"?this.internalValue=Math.floor(this.internalValue):this.label==="Jitter"&&(this.internalValue=Math.floor(this.internalValue*10)/10),await this.$nextTick(),this.editing=!1,this.$emit("update"))},revert(){this.editing=!1,this.internalValue=this.original},async clear(){this.internalValue="",await this.$nextTick(),this.editing=!1,this.$emit("update")},getColClass(){return this.editing===!1&&this.editable===!0?this.isDarkMode?"column-not-editing-dark":"column-not-editing":""}}};var Yt=function(){var e=this,i=e._self._c;return i(z,{staticClass:"pb-5"},[i(x,{attrs:{cols:"4"}},[i("span",{staticClass:"text--bold"},[e._v(e._s(e.label))])]),i(x,{class:e.getColClass(),attrs:{cols:"6"},on:{click:e.clicked}},[e.editing&&e.editable?[e.suggestedValues.length>0&&e.strict?i(ct,{ref:"field",attrs:{items:e.suggestedValues,label:e.label,outlined:"",dense:""},on:{blur:e.update,keyup:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:e.update.apply(null,arguments)}},model:{value:e.internalValue,callback:function(s){e.internalValue=s},expression:"internalValue"}}):e.dataType==="date"||e.dataType==="date-range"?i(me,{ref:"menu",attrs:{"close-on-content-click":!1,transition:"scale-transition","offset-y":"","min-width":"auto"},scopedSlots:e._u([{key:"activator",fn:function({on:s,attrs:n}){return[i(T,e._g(e._b({ref:"field",attrs:{label:"Picker in menu","prepend-icon":"mdi-calendar",readonly:"",clearable:""},on:{"click:clear":e.clear},model:{value:e.internalValue,callback:function(a){e.internalValue=a},expression:"internalValue"}},"v-text-field",n,!1),s))]}}],null,!1,2992141911),model:{value:e.menu,callback:function(s){e.menu=s},expression:"menu"}},[i(Et,{attrs:{outlined:"",dense:"",range:e.dataType==="date-range",min:e.moment().format("YYYY-MM-DD")},on:{blur:e.update,keyup:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:e.update.apply(null,arguments)}},model:{value:e.internalValue,callback:function(s){e.internalValue=s},expression:"internalValue"}},[i(S),i(g,{attrs:{text:"",color:"primary"},on:{click:function(s){e.menu=!1,e.editing=!1,e.revert()}}},[e._v(" Cancel ")]),i(g,{attrs:{text:"",color:"primary"},on:{click:function(s){e.menu=!1,e.update()}}},[e._v(" OK ")])],1)],1):e.dataType==="string"||e.dataType==="number"?i(T,{ref:"field",staticStyle:{"margin-bottom":"-45px"},attrs:{rules:e.rules,label:e.label,type:e.dataType==="string"?"text":"number",step:e.label==="Jitter"?"0.1":"1",max:e.label==="Jitter"?"1":"",min:"0",outlined:"",dense:"",required:""},on:{blur:e.update,keyup:function(s){return!s.type.indexOf("key")&&e._k(s.keyCode,"enter",13,s.key,"Enter")?null:e.update.apply(null,arguments)}},model:{value:e.internalValue,callback:function(s){e.internalValue=s},expression:"internalValue"}}):e._e()]:i("span",{staticClass:"ml-3"},[e._v(" "+e._s(e.internalValue)+" ")])],2)],1)},Vt=[],Rt=k(Nt,Yt,Vt,!1,null,null,null,null);const u=Rt.exports;const jt={components:{ClickToEdit:u},props:{agent:{type:Object,required:!0},readOnly:{type:Boolean,default:!1}},data(){return{valid:!0,nameLoading:!1,loading:!1,labelPosition:"left",rules:{},form:{},moment:W,workingHoursRules:[t=>/^[0-9]{1,2}:[0-5][0-9]-[0-9]{1,2}:[0-5][0-9]$/.test(t)||"Must be in the format 00:00-24:00"],nameRules:[t=>!!t||"Name is required",t=>!!t&&t.length>2||"Name must be at least 3 characters"],jitterRules:[t=>!Number.isNaN(t)||"Jitter must be a number",t=>t>=0&&t<=1||"Jitter must be between 0 and 1"],delayRules:[t=>!Number.isNaN(t)||"Delay must be a number",t=>t>=0||"Delay must be a positive number"]}},computed:{...qe({listeners:t=>t.listener.listeners}),fields(){return Object.keys(this.agent).map(t=>({name:t,Value:typeof this.agent[t]=="boolean"?`${this.agent[t]}`:this.agent[t]}))},requiredFields(){return this.fields.filter(t=>["name"].indexOf(t.name)<0)}},watch:{fields:{immediate:!0,handler(t){const e=t.reduce((i,s)=>{if(s.name==="kill_date"&&s.Value&&s.Value.length>0){const n=s.Value.split("/"),a=n[2],r=n[0],l=n[1];i[s.name]=`${a}-${r}-${l}`}else i[s.name]=s.Value;return i},{});I.set(this,"form",e)}}},mounted(){this.$store.dispatch("listener/getListeners")},methods:{async updateName(){if(this.agent.name!==this.form.name){try{await this.$store.dispatch("agent/rename",{sessionId:this.agent.session_id,newName:this.form.name})}catch(t){this.$snack.error(`Update agent listener failed: ${t}`);return}this.$snack.info(`Agent ${this.agent.name} name updated`)}},async updateListener(){if(this.agent.listener!==this.form.listener){try{const t=this.listeners.filter(e=>e.name===this.form.listener)[0].id;await We(this.agent.session_id,t)}catch(t){this.$snack.error(`Update agent listener failed: ${t}`);return}this.$snack.info(`Tasked agent to change listener to: ${this.form.listener}`),await this.$store.dispatch("agent/getAgent",{sessionId:this.form.name})}},async updateKillDate(){let t="";if(this.form.kill_date&&this.form.kill_date.length>0&&(t=W(this.form.kill_date).format("MM/DD/YYYY")),this.agent.kill_date!==t){try{await He(this.agent.session_id,t)}catch(e){this.$snack.error(`Update agent kill date failed: ${e}`);return}this.$snack.info(`Tasked agent to change kill date to: ${t}`),this.$store.dispatch("agent/getAgent",{sessionId:this.form.name})}},async updateWorkingHours(){if(this.agent.working_hours!==this.form.working_hours){try{await Ke(this.agent.session_id,this.form.working_hours)}catch(t){this.$snack.error(`Update agent working hours failed: ${t}`);return}this.$snack.info(`Tasked agent to change working hours to: ${this.form.working_hours}`)}},async updateDelay(){if(this.agent.delay!==this.form.delay){try{await ee(this.agent.session_id,this.form.delay,this.form.jitter)}catch(t){this.$snack.error(`Update agent delay failed: ${t}`);return}this.$snack.info(`Tasked agent to change delay to: ${this.form.delay}`)}},async updateJitter(){if(this.agent.jitter!==this.form.jitter){try{await ee(this.agent.session_id,this.form.delay,this.form.jitter)}catch(t){this.$snack.error(`Update agent delay failed: ${t}`);return}this.$snack.info(`Tasked agent to change jitter to: ${this.form.jitter}`)}},fieldExists(t){return this.fields.filter(e=>e.name===t).length>0}}};var Ut=function(){var e=this,i=e._self._c;return i("div",{staticStyle:{padding:"10px"}},[e.agent.session_id?i(O,{ref:"form",model:{value:e.valid,callback:function(s){e.valid=s},expression:"valid"}},[i(u,{attrs:{label:"Session ID",editable:!1,value:e.form.session_id}}),i(u,{attrs:{label:"Name",rules:e.nameRules,editable:!e.readOnly},on:{update:e.updateName},model:{value:e.form.name,callback:function(s){e.$set(e.form,"name",s)},expression:"form.name"}}),i(u,{attrs:{label:"External IP",value:e.form.external_ip,editable:!1}}),i(u,{attrs:{label:"Internal IP",value:e.form.internal_ip,editable:!1}}),i(u,{attrs:{label:"Host Name",value:e.form.hostname,editable:!1}}),i(u,{attrs:{label:"Username",value:e.form.username,editable:!1}}),i(u,{attrs:{label:"Listener","data-type":"string","suggested-values":e.listeners.map(s=>s.name),strict:!0,editable:!e.readOnly},on:{update:e.updateListener},model:{value:e.form.listener,callback:function(s){e.$set(e.form,"listener",s)},expression:"form.listener"}}),i(u,{attrs:{label:"Kill Date","data-type":"date",editable:!e.readOnly},on:{update:e.updateKillDate},model:{value:e.form.kill_date,callback:function(s){e.$set(e.form,"kill_date",s)},expression:"form.kill_date"}}),i(u,{attrs:{label:"Working Hours",rules:e.workingHoursRules,editable:!e.readOnly},on:{update:e.updateWorkingHours},model:{value:e.form.working_hours,callback:function(s){e.$set(e.form,"working_hours",s)},expression:"form.working_hours"}}),i(u,{attrs:{label:"Check In Time",value:e.moment(e.form.checkin_time).fromNow(),editable:!1}}),i(u,{attrs:{label:"Last Seen Time",value:e.moment(e.form.lastseen_time).fromNow(),editable:!1}}),i(u,{attrs:{label:"Delay","data-type":"number",rules:e.delayRules,editable:!e.readOnly},on:{update:e.updateDelay},model:{value:e.form.delay,callback:function(s){e.$set(e.form,"delay",s)},expression:"form.delay"}}),i(u,{attrs:{label:"Jitter","data-type":"number",rules:e.jitterRules,editable:!e.readOnly},on:{update:e.updateJitter},model:{value:e.form.jitter,callback:function(s){e.$set(e.form,"jitter",s)},expression:"form.jitter"}}),i(u,{attrs:{label:"Lost Limit","data-type":"number",editable:!1},model:{value:e.form.lost_limit,callback:function(s){e.$set(e.form,"lost_limit",s)},expression:"form.lost_limit"}}),i(u,{attrs:{label:"OS Details",value:e.form.os_details,editable:!1}}),i(u,{attrs:{label:"Architecture",value:e.form.architecture,editable:!1}}),i(u,{attrs:{label:"Process ID",value:e.form.process_id,editable:!1}}),i(u,{attrs:{label:"Process Name",value:e.form.process_name,editable:!1}}),i(u,{attrs:{label:"Language",value:e.form.language,editable:!1}}),i(u,{attrs:{label:"Language Version",value:e.form.language_version,editable:!1}}),i(u,{attrs:{label:"Profile",value:e.form.profile,editable:!1}})],1):e._e()],1)},qt=[],Wt=k(jt,Ut,qt,!1,null,"dbc9c040",null,null);const Ce=Wt.exports,Ht={components:{AgentExecuteModule:N},props:{value:Boolean,loading:{type:Boolean,default:!1},agent:{type:String,required:!0},moduleName:{type:String,required:!0},moduleOptionDefaults:{type:Object,default:()=>{}}},data(){return{}},computed:{show:{get(){return this.value},set(t){this.$emit("input",t)}}},methods:{async submit(){!this.$refs.executeform.validate()||(this.$refs.executeform.create(),this.show=!1)}}};var Kt=function(){var e=this,i=e._self._c;return i(F,{ref:"downloadDialog",attrs:{"max-width":"800px"},model:{value:e.show,callback:function(s){e.show=s},expression:"show"}},[i(b,[i(B,[i("span",{staticClass:"headline"})]),i(P,[e.show?i(N,{ref:"executeform",attrs:{agents:[e.agent],"module-name":e.moduleName,"module-option-defaults":e.moduleOptionDefaults,"show-submit":!1},on:{submitted:e.submit}}):e._e()],1),i(L,[i(S),i(g,{attrs:{color:"error",text:""},on:{click:function(s){s.stopPropagation(),e.show=!1}}},[e._v(" Close ")]),i(g,{attrs:{color:"primary",loading:e.loading},on:{click:e.submit}},[e._v(" Submit ")])],1)],1)],1)},Zt=[],Jt=k(Ht,Kt,Zt,!1,null,null,null,null);const Se=Jt.exports;async function ie(t=1e3){return new Promise(e=>setTimeout(e,t))}const Xt={components:{ExecuteModuleDialog:Se},props:{agent:{type:Object,required:!0},readOnly:{type:Boolean,default:!1}},data(){return{files:{html:"mdi-language-html5",js:"mdi-nodejs",json:"mdi-json",md:"mdi-markdown",pdf:"mdi-file-pdf",png:"mdi-file-image",txt:"mdi-file-document-outline",xls:"mdi-file-excel",xlsx:"mdi-file-excel",ppt:"mdi-file-powerpoint",pptx:"mdi-file-powerpoint",jpg:"mdi-file-image",jpeg:"mdi-file-image",gif:"mdi-file-image",doc:"mdi-file-word",docx:"mdi-file-word"},tree:[],open:[],showMenu:!1,menuPosition:{x:0,y:0},selected:{},force:{},currentlyLoading:{},loading:!1,debouncedLoadChildren:null,executeDialog:!1,moduleName:"",moduleOptionDefaults:{}}},computed:{menuItems(){return[{id:"close",name:"Close",fileOption:!1,folderOption:!0},{id:"open",name:"Open",fileOption:!1,folderOption:!0},{id:"refresh",name:"Refresh",fileOption:!1,folderOption:!0},{id:"download",name:"Download to Empire",fileOption:!0,folderOption:!1},{id:"zip",name:"Zip Folder",fileOption:!1,folderOption:!0},{id:"upload",name:"Upload",folderOption:!0,fileOption:!1}].filter(t=>this.selected.file?t.fileOption===!0:t.folderOption===!0).filter(t=>!(t.id==="zip"&&this.agent.language!=="powershell")).filter(t=>{if(t.id==="open"){if(this.open.find(e=>e===this.selected.id))return!1}else if((t.id==="close"||t.id==="refresh")&&!this.open.find(e=>e===this.selected.id))return!1;return!0})}},watch:{agent:{handler(){this.initialize()}}},async mounted(){this.agent&&this.initialize()},methods:{async initialize(){this.debouncedLoadChildren=ft(this.loadChildren,500,{leading:!0}),this.loading=!0;try{const t=await V(this.agent.session_id,"/");t.sort(this.sortFiles),this.tree=t.map(e=>this.transform(e))}catch{if(this.readOnly){this.loading=!1;return}const e=await this.scrapeDirectory("/");let i=0,s=0;for(;i<10;){if(await ie(6e3),await this.checkTaskComplete(e.id)){s=!0;break}i++}s||this.$snack.error("Agent didn't respond in time. Please try again later.");const n=await V(this.agent.session_id,"/");n.sort(this.sortFiles),this.tree=n.map(a=>this.transform(a))}this.loading=!1},async clickAction(t){if(t==="open")this.open.push(this.selected.id);else if(t==="close")this.open.splice(this.open.findIndex(e=>e===this.selected.id),1);else if(t==="refresh"){this.selected.children=[];const e=this.$refs.treeview.nodes[this.selected.id];this.open.splice(this.open.findIndex(i=>i===this.selected.id),1),await I.nextTick(),e.vnode.hasLoaded=!1,this.force[this.selected.id]=!0,await I.nextTick(),this.open.push(this.selected.id)}else t==="download"?(de(this.agent.session_id,this.selected.path),this.$snack.success(`Tasked ${this.agent.session_id} for download ${this.selected.path}`)):t==="zip"?this.prepareZip():t==="upload"&&this.$emit("openUploadDialog",{pathToFile:this.selected.path})},prepareZip(){const t={agent:this.agent.session_id,Folder:this.selected.path,ZipFileName:`${this.selected.path}\\${this.selected.path.split("\\").pop()}.zip`};this.moduleName="powershell/management/zipfolder",this.moduleOptionDefaults=t,this.executeDialog=!0},show(t,e){e.preventDefault(),this.showMenu=!1,this.menuPosition.x=e.clientX,this.menuPosition.y=e.clientY,this.selected=t,this.$nextTick(()=>{this.showMenu=!0})},transform(t){return{file:t.is_file===!0?t.name.split(".").pop():!1,...t,children:t.is_file===!1?[]:void 0}},async loadChildren(t,{stopTrying:e}={}){if(this.currentlyLoading[t.id])return Promise.resolve();this.currentlyLoading[t.id]=!0;const i=await V(this.agent.session_id,t.id);if(i.sort(this.sortFiles),!this.force[t.id]&&i.length>0)return this.removeFromCurrentlyLoading(t.id),t.children=i.map(s=>this.transform(s)),Promise.resolve();if(!e&&!this.readOnly){console.log(e,this.readOnly),this.$snack.success(`Attempting to retrieve directory: ${t.path} with id ${t.id}`);const s=await this.scrapeDirectory(t.path);let n=0,a=!1;for(;n<10;){if(await ie(6e3),await this.checkTaskComplete(s.id)){console.log("task complete",s.id),a=!0;break}n++}return a||this.$snack.error("Agent didn't respond in time. Please try again later."),this.removeFromForce(t.id),this.removeFromCurrentlyLoading(t.id),Promise.resolve(this.loadChildren(t,{stopTrying:!0}))}return this.removeFromForce(t.id),this.removeFromCurrentlyLoading(t.id),Promise.resolve()},removeFromForce(t){this.force[t]&&delete this.force[t]},removeFromCurrentlyLoading(t){this.currentlyLoading[t]&&delete this.currentlyLoading[t]},async scrapeDirectory(t){return Ze(this.agent.session_id,t)},async checkTaskComplete(t){try{return!!(await Je(this.agent.session_id,t)).output}catch{return!1}},sortFiles(t,e){const i=t.name.toLowerCase(),s=e.name.toLowerCase();return is?1:0}}};var Qt=function(){var e=this,i=e._self._c;return e.agent.language==="ironpython"?i("div",[i(ce,{attrs:{prominent:"",type:"error"}},[i(z,{attrs:{align:"center"}},[i(x,{staticClass:"grow"},[e._v(" The File Browser is not yet implemented for this agent language. ")])],1)],1)],1):i("div",[i(Se,{attrs:{agent:e.agent.session_id,"module-name":e.moduleName,"module-option-defaults":e.moduleOptionDefaults},model:{value:e.executeDialog,callback:function(s){e.executeDialog=s},expression:"executeDialog"}}),e.loading?i(f,{staticClass:"fa-3x fas fa-spinner fa-spin",staticStyle:{width:"50px"}}):e._e(),i(Lt,{ref:"treeview",attrs:{dense:"",hoverable:"","open-on-click":"","item-key":"id","load-children":e.debouncedLoadChildren,open:e.open,items:e.tree},on:{"update:open":function(s){e.open=s}},scopedSlots:e._u([{key:"label",fn:function({item:s,open:n}){return[i(g,{staticClass:"text-left",staticStyle:{"margin-left":"-15px",width:"100%"},attrs:{text:""},on:{contextmenu:function(a){return e.show(s,a)}}},[i("div",{staticStyle:{display:"flex","justify-content":"fle -start"}},[s.file?i(f,[e._v(" "+e._s(e.files[s.file]||"mdi-file")+" ")]):i(f,[e._v(" "+e._s(n?"mdi-folder-open":"mdi-folder")+" ")]),i("span",{staticClass:"ml-2"},[e._v(e._s(s.name))])],1)])]}}])}),i(me,{attrs:{"position-x":e.menuPosition.x,"position-y":e.menuPosition.y,"close-on-content-click":"",absolute:"","offset-y":""},model:{value:e.showMenu,callback:function(s){e.showMenu=s},expression:"showMenu"}},[i(Xe,e._l(e.menuItems,function(s){return i(Qe,{key:s.id,on:{click:function(n){return e.clickAction(s.id)}}},[i(Ge,[e._v(e._s(s.name))])],1)}),1)],1)],1)},Gt=[],ei=k(Xt,Qt,Gt,!1,null,null,null,null);const Te=ei.exports;const ti={props:{agent:{type:Object,required:!0}},data(){return{loading:!1,form:{command:"",literal:!1,scriptCommand:!1},literal:{disabled:!1,tooltipText:"This will ensure that aliased commands such as whoami or ps do not execute the built-in agent aliases."},scriptCommand:{tooltipText:'Execute a script command. The function being executing should first be loading via the "Script Import" functionality.'},commands:[]}},watch:{"form.scriptCommand":{handler(t){t?(this.form.literal=!1,this.literal.disabled=!0):this.literal.disabled=!1}}},methods:{async submit(){this.form.command.length<1||(this.loading=!0,this.form.command.trim()==="sysinfo"?await et(this.agent.session_id):this.form.scriptCommand?await tt(this.agent.session_id,this.form.command):await it(this.agent.session_id,this.form.command,this.form.literal),this.form.command="",this.loading=!1,this.$snack.success(`Shell Command queued for ${this.agent.name}`))}}};var ii=function(){var e=this,i=e._self._c;return i("div",{staticStyle:{padding:"10px"}},[i(O,{ref:"form",staticClass:"form",nativeOn:{submit:function(s){return s.preventDefault(),e.submit.apply(null,arguments)}}},[i(Z,[i(z,[i(x,{attrs:{cols:"10"}},[i("div",{staticStyle:{display:"flex"}},[i(te,{staticClass:"pr-2",attrs:{label:"Script Command"},model:{value:e.form.scriptCommand,callback:function(s){e.$set(e.form,"scriptCommand",s)},expression:"form.scriptCommand"}}),i(H,{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function({on:s}){return[i(f,e._g({staticClass:"pr-2",attrs:{small:""}},s),[e._v(" fa-question-circle ")])]}}])},[i("p",[e._v(e._s(e.scriptCommand.tooltipText))])]),i(te,{staticClass:"pr-2",attrs:{label:"Literal",disabled:e.literal.disabled},model:{value:e.form.literal,callback:function(s){e.$set(e.form,"literal",s)},expression:"form.literal"}}),i(H,{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function({on:s}){return[i(f,e._g({staticClass:"pr-2",attrs:{small:""}},s),[e._v(" fa-question-circle ")])]}}])},[i("p",[e._v(e._s(e.literal.tooltipText))])]),i(T,{attrs:{dense:"",outlined:"",label:"Shell Command"},model:{value:e.form.command,callback:function(s){e.$set(e.form,"command",s)},expression:"form.command"}})],1)]),i(x,{attrs:{cols:"2",md:"2"}},[i(g,{attrs:{color:"primary",loading:e.loading,type:"submit"}},[e._v(" Run ")])],1)],1)],1)],1)],1)},si=[],ni=k(ti,ii,si,!1,null,"e1aa775c",null,null);const De=ni.exports,ai={props:{value:Boolean,loading:{type:Boolean,default:!1}},data(){return{pathToFile:"",rules:{pathToFile:[t=>!!t||"PathToFile is required"]}}},computed:{show:{get(){return this.value},set(t){this.$emit("input",t)}}},watch:{value(t){t===!1&&this.$refs.form.reset()}},methods:{async submit(){!this.$refs.form.validate()||this.$emit("submit",{pathToFile:this.pathToFile})}}};var ri=function(){var e=this,i=e._self._c;return i(F,{ref:"downloadDialog",attrs:{"max-width":"500px"},model:{value:e.show,callback:function(s){e.show=s},expression:"show"}},[i(b,[i(B,[i("span",{staticClass:"headline"},[e._v("Download")])]),i(P,[i(O,{ref:"form",on:{submit:function(s){s.preventDefault()}}},[i(Z,[i(z,[i(x,{attrs:{cols:"12"}},[i(T,{attrs:{label:"path/to/file",rules:e.rules.pathToFile,outlined:"",dense:"",required:""},model:{value:e.pathToFile,callback:function(s){e.pathToFile=s},expression:"pathToFile"}})],1)],1)],1)],1)],1),i(L,[i(S),i(g,{attrs:{color:"blue darken-1",text:""},on:{click:function(s){s.stopPropagation(),e.show=!1}}},[e._v(" Close ")]),i(g,{attrs:{color:"blue darken-1",text:"",loading:e.loading},on:{click:e.submit}},[e._v(" Save ")])],1)],1)],1)},li=[],oi=k(ai,ri,li,!1,null,null,null,null);const Pe=oi.exports,U=1048576,hi={components:{FileInput:pe},props:{value:Boolean,language:{type:String,default:""},loading:{type:Boolean,default:!1},pathToFile:{type:String,default:""}},data(){return{formatBytes:ut,maxBytes:U,descriptionLimit:80,entries:[],internalPathToFile:this.pathToFile,file:null,rules:{pathToFile:[t=>!!t||"PathToFile is required"],fileInput:[t=>!!t||"File required",t=>!!t&&t.size!!t||"File required",t=>!!t&&t.sizee in t?vi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,bi=(t,e)=>{for(var i in e||(e={}))Me.call(e,i)&&ne(t,i,e[i]);if(E)for(var i of E(e))Ie.call(e,i)&&ne(t,i,e[i]);return t},ki=(t,e)=>_i(t,yi(e)),$i=(t,e)=>{var i={};for(var s in t)Me.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(t!=null&&E)for(var s of E(t))e.indexOf(s)<0&&Ie.call(t,s)&&(i[s]=t[s]);return i};function Ee(t,e,i,s,n,a,r,l){var o=typeof t=="function"?t.options:t;e&&(o.render=e,o.staticRenderFns=i,o._compiled=!0),s&&(o.functional=!0),a&&(o._scopeId="data-v-"+a);var c;if(r?(c=function(y){y=y||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!y&&typeof __VUE_SSR_CONTEXT__<"u"&&(y=__VUE_SSR_CONTEXT__),n&&n.call(this,y),y&&y._registeredComponents&&y._registeredComponents.add(r)},o._ssrRegister=c):n&&(c=l?function(){n.call(this,(o.functional?this.parent:this).$root.$options.shadowRoot)}:n),c)if(o.functional){o._injectStyles=c;var _=o.render;o.render=function(Oe,X){return c.call(X),_(Oe,X)}}else{var m=o.beforeCreate;o.beforeCreate=m?[].concat(m,c):[c]}return{exports:t,options:o}}const wi={name:"splitpanes",props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((t,e)=>(t[e.id]=e)&&t,{})}},methods:{updatePaneComponents(){this.panes.forEach(t=>{t.update&&t.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[t.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(t,e){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=e},onMouseMove(t){this.touch.mouseDown&&(t.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(t)),this.$emit("resize",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(t,e){"ontouchstart"in window&&(t.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===e?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(t,e),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=e,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[e])},onSplitterDblClick(t,e){let i=0;this.panes=this.panes.map((s,n)=>(s.size=n===e?s.max:s.min,n!==e&&(i+=s.min),s)),this.panes[e].size-=i,this.$emit("pane-maximize",this.panes[e])},onPaneClick(t,e){this.$emit("pane-click",this.indexedPanes[e])},getCurrentMouseDrag(t){const e=this.container.getBoundingClientRect(),{clientX:i,clientY:s}="ontouchstart"in window&&t.touches?t.touches[0]:t;return{x:i-e.left,y:s-e.top}},getCurrentDragPercentage(t){t=t[this.horizontal?"y":"x"];const e=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(t=e-t),t*100/e},calculatePanesSize(t){const e=this.touch.activeSplitter;let i={prevPanesSize:this.sumPrevPanesSize(e),nextPanesSize:this.sumNextPanesSize(e),prevReachedMinPanes:0,nextReachedMinPanes:0};const s=0+(this.pushOtherPanes?0:i.prevPanesSize),n=100-(this.pushOtherPanes?0:i.nextPanesSize),a=Math.max(Math.min(this.getCurrentDragPercentage(t),n),s);let r=[e,e+1],l=this.panes[r[0]]||null,o=this.panes[r[1]]||null;const c=l.max<100&&a>=l.max+i.prevPanesSize,_=o.max<100&&a<=100-(o.max+this.sumNextPanesSize(e+1));if(c||_){c?(l.size=l.max,o.size=Math.max(100-l.max-i.prevPanesSize-i.nextPanesSize,0)):(l.size=Math.max(100-o.max-i.prevPanesSize-this.sumNextPanesSize(e+1),0),o.size=o.max);return}if(this.pushOtherPanes){const m=this.doPushOtherPanes(i,a);if(!m)return;({sums:i,panesToResize:r}=m),l=this.panes[r[0]]||null,o=this.panes[r[1]]||null}l!==null&&(l.size=Math.min(Math.max(a-i.prevPanesSize-i.prevReachedMinPanes,l.min),l.max)),o!==null&&(o.size=Math.min(Math.max(100-a-i.nextPanesSize-i.nextReachedMinPanes,o.min),o.max))},doPushOtherPanes(t,e){const i=this.touch.activeSplitter,s=[i,i+1];return e{a>s[0]&&a<=i&&(n.size=n.min,t.prevReachedMinPanes+=n.min)}),t.prevPanesSize=this.sumPrevPanesSize(s[0]),s[0]===void 0)?(t.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((n,a)=>{a>0&&a<=i&&(n.size=n.min,t.prevReachedMinPanes+=n.min)}),this.panes[s[1]].size=100-t.prevReachedMinPanes-this.panes[0].min-t.prevPanesSize-t.nextPanesSize,null):e>100-t.nextPanesSize-this.panes[s[1]].min&&(s[1]=this.findNextExpandedPane(i).index,t.nextReachedMinPanes=0,s[1]>i+1&&this.panes.forEach((n,a)=>{a>i&&a{a=i+1&&(n.size=n.min,t.nextReachedMinPanes+=n.min)}),this.panes[s[0]].size=100-t.prevPanesSize-t.nextReachedMinPanes-this.panes[this.panesCount-1].min-t.nextPanesSize,null):{sums:t,panesToResize:s}},sumPrevPanesSize(t){return this.panes.reduce((e,i,s)=>e+(se+(s>t+1?i.size:0),0)},findPrevExpandedPane(t){return[...this.panes].reverse().find(i=>i.indexi.min)||{}},findNextExpandedPane(t){return this.panes.find(i=>i.index>t+1&&i.size>i.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(e=>{const i=e.classList.contains("splitpanes__pane"),s=e.classList.contains("splitpanes__splitter");if(!i&&!s){e.parentNode.removeChild(e),console.warn("Splitpanes: Only elements are allowed at the root of . One of your DOM nodes was removed.");return}})},addSplitter(t,e,i=!1){const s=t-1,n=document.createElement("div");n.classList.add("splitpanes__splitter"),i||(n.onmousedown=a=>this.onMouseDown(a,s),typeof window<"u"&&"ontouchstart"in window&&(n.ontouchstart=a=>this.onMouseDown(a,s)),n.onclick=a=>this.onSplitterClick(a,s+1)),this.dblClickSplitter&&(n.ondblclick=a=>this.onSplitterDblClick(a,s+1)),e.parentNode.insertBefore(n,e)},removeSplitter(t){t.onmousedown=void 0,t.onclick=void 0,t.ondblclick=void 0,t.parentNode.removeChild(t)},redoSplitters(){const t=Array.from(this.container.children);t.forEach(i=>{i.className.includes("splitpanes__splitter")&&this.removeSplitter(i)});let e=0;t.forEach(i=>{i.className.includes("splitpanes__pane")&&(!e&&this.firstSplitter?this.addSplitter(e,i,!0):e&&this.addSplitter(e,i),e++)})},requestUpdate(t){var e=t,{target:i}=e,s=$i(e,["target"]);const n=this.indexedPanes[i._uid];Object.entries(s).forEach(([a,r])=>n[a]=r)},onPaneAdd(t){let e=-1;Array.from(t.$el.parentNode.children).some(n=>(n.className.includes("splitpanes__pane")&&e++,n===t.$el));const i=parseFloat(t.minSize),s=parseFloat(t.maxSize);this.panes.splice(e,0,{id:t._uid,index:e,min:isNaN(i)?0:i,max:isNaN(s)?100:s,size:t.size===null?null:parseFloat(t.size),givenSize:t.size,update:t.update}),this.panes.forEach((n,a)=>n.index=a),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[e]}),this.$emit("pane-add",{index:e,panes:this.panes.map(n=>({min:n.min,max:n.max,size:n.size}))})})},onPaneRemove(t){const e=this.panes.findIndex(s=>s.id===t._uid),i=this.panes.splice(e,1)[0];this.panes.forEach((s,n)=>s.index=n),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:ki(bi({},i),{index:e})}),this.$emit("pane-remove",{removed:i,panes:this.panes.map(s=>({min:s.min,max:s.max,size:s.size}))})})},resetPaneSizes(t={}){!t.addedPane&&!t.removedPane?this.initialPanesSizing():this.panes.some(e=>e.givenSize!==null||e.min||e.max<100)?this.equalizeAfterAddOrRemove(t):this.equalize(),this.ready&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size})))},equalize(){const t=100/this.panesCount;let e=0,i=[],s=[];this.panes.forEach(n=>{n.size=Math.max(Math.min(t,n.max),n.min),e-=n.size,n.size>=n.max&&i.push(n.id),n.size<=n.min&&s.push(n.id)}),e>.1&&this.readjustSizes(e,i,s)},initialPanesSizing(){100/this.panesCount;let t=100,e=[],i=[],s=0;this.panes.forEach(a=>{t-=a.size,a.size!==null&&s++,a.size>=a.max&&e.push(a.id),a.size<=a.min&&i.push(a.id)});let n=100;t>.1&&(this.panes.forEach(a=>{a.size===null&&(a.size=Math.max(Math.min(t/(this.panesCount-s),a.max),a.min)),n-=a.size}),n>.1&&this.readjustSizes(t,e,i))},equalizeAfterAddOrRemove({addedPane:t,removedPane:e}={}){let i=100/this.panesCount,s=0,n=[],a=[];t&&t.givenSize!==null&&(i=(100-t.givenSize)/(this.panesCount-1)),this.panes.forEach(r=>{s-=r.size,r.size>=r.max&&n.push(r.id),r.size<=r.min&&a.push(r.id)}),!(Math.abs(s)<.1)&&(this.panes.forEach(r=>{t&&t.givenSize!==null&&t.id===r.id||(r.size=Math.max(Math.min(i,r.max),r.min)),s-=r.size,r.size>=r.max&&n.push(r.id),r.size<=r.min&&a.push(r.id)}),s>.1&&this.readjustSizes(s,n,a))},readjustSizes(t,e,i){let s;t>0?s=t/(this.panesCount-e.length):s=t/(this.panesCount-i.length),this.panes.forEach((n,a)=>{if(t>0&&!e.includes(n.id)){const r=Math.max(Math.min(n.size+s,n.max),n.min),l=r-n.size;t-=l,n.size=r}else if(!i.includes(n.id)){const r=Math.max(Math.min(n.size+s,n.max),n.min),l=r-n.size;t-=l,n.size=r}n.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[n.id].size}%`})}),Math.abs(t)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(t){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((i,s)=>{i.ondblclick=t?n=>this.onSplitterDblClick(n,s):void 0})}},beforeDestroy(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.$emit("ready"),this.ready=!0},render(t){return t("div",{ref:"container",class:["splitpanes",`splitpanes--${this.horizontal?"horizontal":"vertical"}`,{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default)}};let xi,Ci;const ae={};var Si=Ee(wi,xi,Ci,!1,Ti,null,null,null);function Ti(t){for(let e in ae)this[e]=ae[e]}var Di=function(){return Si.exports}(),Pi=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"splitpanes__pane",style:t.style,on:{click:function(s){return t.onPaneClick(s,t._uid)}}},[t._t("default")],2)},zi=[];const Ai={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:null},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeDestroy(){this.onPaneRemove(this)},methods:{update(t){this.style=t}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(t){this.requestUpdate({target:this,size:t})},minSizeNumber(t){this.requestUpdate({target:this,min:t})},maxSizeNumber(t){this.requestUpdate({target:this,max:t})}}},re={};var Mi=Ee(Ai,Pi,zi,!1,Ii,null,null,null);function Ii(t){for(let e in re)this[e]=re[e]}var Ei=function(){return Mi.exports}();const Oi={name:"AgentEdit",components:{TagViewer:ge,AgentForm:Ce,AgentInteract:De,AgentExecuteModule:N,AgentFileBrowser:Te,AgentTasksList:fe,AgentUploadDialog:ze,AgentScriptImportDialog:Ae,AgentDownloadDialog:Pe,TooltipButton:w,TooltipButtonToggle:ve,ErrorStateAlert:ue,Splitpanes:Di,Pane:Ei},data(){return{agent:{},nameLoading:!1,uploadLoading:!1,downloadLoading:!1,scriptImportLoading:!1,nameDialog:!1,uploadDialog:!1,downloadDialog:!1,scriptImportDialog:!1,initialized:!0,errorState:!1,paneSize:100,rightPaneInitialized:!1,pathToFile:"",isRefreshTasks:!0}},computed:{breads(){return[{text:"Agents",disabled:this.isChild,to:"/agents",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/agent-edit"}]},archived(){return this.agent.archived},breadcrumbName(){return this.agent.name||this.id},id(){return this.$route.params.id},isChild(){return!!this.$route.query.hideSideBar},hideSideBar(){return this.$route.query.hideSideBar},tab:{set(t){this.$router.replace({query:{...this.$route.query,tab:t}})},get(){return this.$route.query.tab||"interact"}}},watch:{id(t){t&&this.getAgent(t)},paneSize(t){this.rightPaneInitialized||t<99&&(this.rightPaneInitialized=!0)},uploadDialog(t){t||(this.pathToFile="")}},mounted(){this.getAgent(this.$route.params.id)},methods:{deleteTag(t){st(this.agent.session_id,t.id).then(()=>{this.agent.tags=this.agent.tags.filter(e=>e.id!==t.id)}).catch(e=>this.$snack.error(`Error: ${e}`))},updateTag(t){nt(this.agent.session_id,t).then(e=>{const i=this.agent.tags.findIndex(s=>s.id===e.id);this.agent.tags.splice(i,1,e),this.$snack.success("Tag updated")}).catch(e=>this.$snack.error(`Error: ${e}`))},addTag(t){at(this.agent.session_id,t).then(e=>{this.agent.tags.push(e)}).catch(e=>this.$snack.error(`Error: ${e}`))},toggleCollapsePane(){this.paneSize>95?this.paneSize=50:this.paneSize=100},splitPaneHeight(){return`height: calc(96vh - 104px ${this.isChild?"":"- 36px"})`},popout(){window.open(`${window.location.href}/?hideSideBar=true`,"popup","width=600,height=600"),this.$router.push({name:"agents"})},getAgent(t){rt(t).then(e=>{this.agent=e}).catch(()=>{this.errorState=!0})},async doScriptImport({file:t}){if(!(this.scriptImportLoading||t==null)){this.scriptImportLoading=!0;try{await lt(this.agent.session_id,t),this.$snack.success(`Tasked agent ${this.agent.name} to import script ${t.filename}`)}catch(e){this.$snack.error(`Error: ${e}`)}this.scriptImportLoading=!1,this.scriptImportDialog=!1}},async killAgent(){await this.$root.$confirm("Kill Agent",`Do you want to kill agent ${this.agent.name}?`,{color:"red"})&&(this.$store.dispatch("agent/killAgent",{sessionId:this.agent.session_id}),this.$snack.success(`Agent ${this.agent.name} tasked to run TASK_EXIT.`),this.$router.push({name:"agents"}))},async clearQueue(){const e=(await ot(this.agent.session_id,{limit:-1,page:1,status:"queued"})).records.map(i=>i.id);if(e.length===0){this.$snack.info("No queued tasks to clear.");return}await this.$root.$confirm("",`Do you want to clear ${e.length} queued tasks?`,{color:"red"})&&(this.$store.dispatch("agent/clearQueue",{name:this.agent.session_id,tasks:e}),this.$snack.success(`Clearing queued tasks for Agent ${this.agent.session_id}.`))},openUploadDialogPrefilled({pathToFile:t}){this.uploadDialog=!0,this.pathToFile=t},async doUpload({file:t,pathToFile:e}){if(!(this.uploadLoading||t==null||e==null||e.length<1)){this.uploadLoading=!0;try{await ht(this.agent.session_id,t,e),this.$snack.success(`Tasked agent ${this.agent.name} to upload file to ${e}`)}catch(i){this.$snack.error(`Error: ${i}`)}this.uploadLoading=!1,this.uploadDialog=!1}},async doDownload({pathToFile:t}){if(!(this.downloadLoading||t==null||t.length<1)){this.downloadLoading=!0;try{await de(this.agent.session_id,t),this.$snack.success(`Tasked agent ${this.agent.name} to downloaded file ${t}`)}catch(e){this.$snack.error(`Error: ${e}`)}this.downloadLoading=!1,this.downloadDialog=!1}},scrollResults(){}}};var Fi=function(){var e=this,i=e._self._c;return i("div",[i("div",[i("portal",{attrs:{to:"app-bar-extension"}},[i("div",{staticStyle:{display:"flex","flex-direction":"row",width:"100%"}},[i(gt,{attrs:{"align-with-title":""},model:{value:e.tab,callback:function(s){e.tab=s},expression:"tab"}},[i(A,{key:"interact",attrs:{href:"#interact"}},[e._v(" Interact "),i(f,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-terminal ")])],1),i(A,{key:"file-browser",attrs:{href:"#file-browser"}},[e._v(" File Browser "),i(f,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-folder-open ")])],1),i(A,{key:"tasks",attrs:{href:"#tasks"}},[e._v(" Tasks "),i(f,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-sticky-note ")])],1),i(A,{key:"view",attrs:{href:"#view"}},[e._v(" View "),i(f,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-eye ")])],1)],1),i("div",{staticStyle:{display:"flex","flex-direction":"row"}},[e._e()],1)],1)]),i("portal",{attrs:{to:"app-bar"}},[i("div",{staticClass:"v-toolbar__content",staticStyle:{width:"100%"}},[i(_t,{attrs:{items:e.breads}}),e.agent.high_integrity?i(H,{attrs:{bottom:""},scopedSlots:e._u([{key:"activator",fn:function({on:s}){return[i(f,e._g({attrs:{small:""}},s),[e._v(" fa-user-cog ")])]}}],null,!1,1636569802)},[i("span",[e._v("Elevated Process")])]):e._e(),e.initialized&&e.archived?i(mt,[e._v(" Archived ")]):e._e(),i(S),e.errorState?e._e():i("div",{staticClass:"pt-2",staticStyle:{display:"flex","flex-direction":"row","align-items":"center"}},[i(Ae,{attrs:{loading:e.scriptImportLoading},on:{submit:e.doScriptImport},model:{value:e.scriptImportDialog,callback:function(s){e.scriptImportDialog=s},expression:"scriptImportDialog"}}),i(ze,{attrs:{language:e.agent.language,loading:e.uploadLoading,"path-to-file":e.pathToFile},on:{submit:e.doUpload},model:{value:e.uploadDialog,callback:function(s){e.uploadDialog=s},expression:"uploadDialog"}}),i(Pe,{attrs:{loading:e.downloadLoading},on:{submit:e.doDownload},model:{value:e.downloadDialog,callback:function(s){e.downloadDialog=s},expression:"downloadDialog"}}),e.initialized&&!e.archived?i(ve,{attrs:{icon:"fa-redo","button-text":e.isRefreshTasks?"On":"Off",text:"Auto-refresh tasks"},model:{value:e.isRefreshTasks,callback:function(s){e.isRefreshTasks=s},expression:"isRefreshTasks"}}):e._e(),e.initialized&&!e.archived?i(w,{attrs:{icon:"fa-calendar-times",text:"Clear Queued Tasks"},on:{click:e.clearQueue}}):e._e(),e.initialized&&!e.archived?i(w,{attrs:{icon:"fa-upload",text:"Upload"},on:{click:function(s){e.uploadDialog=!0}}}):e._e(),e.initialized&&!e.archived?i(w,{attrs:{icon:"fa-download",text:"Download"},on:{click:function(s){e.downloadDialog=!0}}}):e._e(),e.initialized&&!e.archived?i(w,{attrs:{icon:"fa-file-import",text:"Import Script"},on:{click:function(s){e.scriptImportDialog=!0}}}):e._e(),e.hideSideBar?e._e():i(w,{attrs:{icon:"fa-external-link-alt",text:"Popout"},on:{click:e.popout}}),e.initialized&&!e.archived?i(w,{attrs:{icon:"fa-trash-alt",text:"Kill Agent",color:"error"},on:{click:e.killAgent}}):e._e()],1)],1)]),i(ge,{attrs:{tags:e.agent.tags},on:{"update-tag":e.updateTag,"delete-tag":e.deleteTag,"new-tag":e.addTag}}),e.errorState?i(ue,{attrs:{"resource-id":e.id,"resource-type":"agent"}}):e._e(),e.errorState?e._e():i("div",{style:e.splitPaneHeight()},[i("splitpanes",{attrs:{disabled:!0},on:{resize:function(s){e.paneSize=s[0].size}}},[i("pane",{attrs:{"min-size":"30",size:e.paneSize}},[i(vt,{staticClass:"scrollable-pane",model:{value:e.tab,callback:function(s){e.tab=s},expression:"tab"}},[i(M,{key:"interact",attrs:{value:"interact",transition:!1,"reverse-transition":!1}},[e.initialized&&!e.archived?i(b,{attrs:{flat:""}},[i(De,{attrs:{agent:e.agent}}),i(dt),i("h4",{staticClass:"pl-4 pt-2"},[e._v(" Execute Module ")]),i(N,{attrs:{agents:[e.agent.session_id]}})],1):e.initialized&&e.archived?i(b,{attrs:{flat:""}},[i(P,[i(ce,{attrs:{type:"error",icon:"fa-exclamation-triangle",value:!0}},[e._v(" This agent is archived. ")])],1)],1):e._e()],1),i(M,{key:"browser",attrs:{value:"file-browser",transition:!1,"reverse-transition":!1}},[i(b,{attrs:{flat:""}},[i(Te,{attrs:{agent:e.agent,"read-only":e.initialized&&e.archived},on:{openUploadDialog:e.openUploadDialogPrefilled}})],1)],1),i(M,{key:"tasks",attrs:{value:"tasks",transition:!1,"reverse-transition":!1}},[i(b,{attrs:{flat:""}},[i(fe,{attrs:{agent:e.agent,"refresh-tasks":e.isRefreshTasks}})],1)],1),i(M,{key:"view",attrs:{value:"view",transition:!1,"reverse-transition":!1}},[i(b,{attrs:{flat:""}},[i(Ce,{attrs:{"read-only":e.initialized&&e.archived,agent:e.agent}})],1)],1)],1)],1)],1)],1)],1)])},Bi=[],Li=k(Oi,Fi,Bi,!1,null,null,null,null);const vs=Li.exports;export{vs as default}; diff --git a/dist/assets/AgentEdit.6ec6b625.js b/dist/assets/AgentEdit.6ec6b625.js new file mode 100644 index 0000000..df86284 --- /dev/null +++ b/dist/assets/AgentEdit.6ec6b625.js @@ -0,0 +1,9 @@ +import{D as Pe,m as K,C as ie,bg as xi,c as W,T as fe,b as Y,t as Bi,bh as Pi,bi as gn,ai as gt,az as yn,v as Ai,H as Yt,a6 as bn,aG as Ti,N as R,aF as Mi,aE as ji,bj as Ri,J as Kt,aH as vn,n as G,p as Cn,o as pe,a as ue,e as wn,b3 as Oi,b4 as Li,b5 as Ii,bk as zi,bl as Ni,bm as Vi,bn as yt,aB as Me,aP as je,f as ee,aQ as Re,aC as me,aD as Oe,bo as ot,bp as _n,bq as qi,b9 as Fn,g as Hi,h as Wi,V as Ui,bd as I,br as Ji,bs as Ee,bt as Be,bu as bt,bv as Yi,aR as St,a1 as Gt,bw as Ki,bx as Gi,bb as Zi,by as Xi,l as Qi}from"./index.85262dd3.js";import{h as vt}from"./moment.9709ab41.js";import{b as De,c as ne,a as kn,_ as En}from"./ErrorStateAlert.5e9140da.js";import{a as er,b as $n,f as tr,c as nr}from"./GeneralForm.fe5154ff.js";import{_ as Sn}from"./TagViewer.a3da6a20.js";import{_ as xn}from"./AgentTasksList.3c2e6ebb.js";import{_ as Le}from"./AgentExecuteModule.05011db5.js";import{l as ir}from"./index.c62fa657.js";import{A as rr}from"./ansi_up.de92b8a0.js";import{_ as Ct}from"./VTooltip.0c849a74.js";import{_ as Q}from"./TooltipButton.6f10f736.js";import{_ as Bn}from"./TooltipButtonToggle.3ddc5ac1.js";import{_ as Zt,a as se,b as Xt,c as ae}from"./VTabItem.35a0348a.js";import{_ as sr}from"./VBreadcrumbs.32f4f2d0.js";import{a as ar}from"./VSelect.8543571f.js";import"./VSwitch.8a27782c.js";import"./DateTimeDisplay.c35d52fb.js";import"./download-stager.cac59e06.js";import"./VPagination.873af1be.js";import"./VDataTable.125536b6.js";import"./ExpansionPanelFilter.8ec031fa.js";import"./VExpansionPanelHeader.1232ca65.js";import"./ExpansionPanelSearch.252e89f2.js";import"./AdvancedTable.8f5cf108.js";import"./VExpansionPanels.d99facd5.js";import"./ListPageTop.2a204a11.js";import"./tag-api.d2d18349.js";import"./TechniqueChips.6a91dd2f.js";import"./InfoViewer.448169ad.js";const Ie=Pe.extend({name:"localable",props:{locale:String},computed:{currentLocale(){return this.locale||this.$vuetify.lang.current}}});function or(e,t=0,n=1){let r;return e<100&&e>=0?(r=new Date(Date.UTC(e,t,n)),isFinite(r.getUTCFullYear())&&r.setUTCFullYear(e)):r=new Date(Date.UTC(e,t,n)),r}function wt(e,t,n){const r=7+t-n;return-((7+or(e,0,r).getUTCDay()-t)%7)+r-1}function lr(e,t,n,r){let i=[0,31,59,90,120,151,181,212,243,273,304,334][t];return t>1&&xt(e)&&i++,i+n}function lt(e,t,n){const r=wt(e,t,n),i=wt(e+1,t,n);return((xt(e)?366:365)-r+i)/7}function ur(e,t,n,r,i){const a=wt(e,r,i),o=Math.ceil((lr(e,t,n)-a)/7);return o<1?o+lt(e-1,r,i):o>lt(e,r,i)?o-lt(e,r,i):o}function xt(e){return e%4===0&&e%100!==0||e%400===0}const cr=[0,31,28,31,30,31,30,31,31,30,31,30,31],dr=[0,31,29,31,30,31,30,31,31,30,31,30,31];function hr(e,t){return xt(e)?dr[t]:cr[t]}const pr=K(ie).extend({methods:{genPickerButton(e,t,n,r=!1,i=""){const a=this[e]===t,o=u=>{u.stopPropagation(),this.$emit(`update:${xi(e)}`,t)};return this.$createElement("div",{staticClass:`v-picker__title__btn ${i}`.trim(),class:{"v-picker__title__btn--active":a,"v-picker__title__btn--readonly":r},on:a||r?void 0:{click:o}},Array.isArray(n)?n:[n])}}}),fr=K(pr).extend({name:"v-date-picker-title",props:{date:{type:String,default:""},disabled:Boolean,readonly:Boolean,selectingYear:Boolean,value:{type:String},year:{type:[Number,String],default:""},yearIcon:{type:String}},data:()=>({isReversing:!1}),computed:{computedTransition(){return this.isReversing?"picker-reverse-transition":"picker-transition"}},watch:{value(e,t){this.isReversing=e(i.endsWith(t)&&(r[i.slice(0,-t.length)]=a=>e.$emit(i,n,a)),r),{})}function ut(e,t){return Object.keys(e.$listeners).reduce((n,r)=>(r.endsWith(t)&&(n[r]=e.$listeners[r]),n),{})}const mr=(e,t,n)=>(t=t>>0,e=String(e),n=String(n),e.length>t?String(e):(t=t-e.length,t>n.length&&(n+=n.repeat(t/n.length)),n.slice(0,t)+String(e))),L=(e,t=2)=>mr(e,t,"0");function te(e,t,n={start:0,length:0}){const r=i=>{const[a,o,u]=i.trim().split(" ")[0].split("-");return[L(a,4),L(o||1),L(u||1)].join("-")};try{const i=new Intl.DateTimeFormat(e||void 0,t);return a=>i.format(new Date(`${r(a)}T00:00:00+00:00`))}catch{return n.start||n.length?a=>r(a).substr(n.start||0,n.length):void 0}}const An=(e,t)=>{const[n,r]=e.split("-").map(Number);return r+t===0?`${n-1}-12`:r+t===13?`${n+1}-01`:`${n}-${L(r+t)}`},U=(e,t)=>{const[n,r=1,i=1]=e.split("-");return`${n}-${L(r)}-${L(i)}`.substr(0,{date:10,month:7,year:4}[t])},Dr=K(ie,Ie,fe).extend({name:"v-date-picker-header",props:{disabled:Boolean,format:Function,min:String,max:String,nextAriaLabel:String,nextIcon:{type:String,default:"$next"},prevAriaLabel:String,prevIcon:{type:String,default:"$prev"},readonly:Boolean,value:{type:[Number,String],required:!0}},data(){return{isReversing:!1}},computed:{formatter(){return this.format?this.format:String(this.value).split("-")[1]?te(this.currentLocale,{month:"long",year:"numeric",timeZone:"UTC"},{length:7}):te(this.currentLocale,{year:"numeric",timeZone:"UTC"},{length:4})}},watch:{value(e,t){this.isReversing=e0?this.nextAriaLabel:this.prevAriaLabel,n=t?this.$vuetify.lang.t(t):void 0,r=this.disabled||e<0&&this.min&&this.calculateChange(e)0&&this.max&&this.calculateChange(e)>this.max;return this.$createElement(Y,{attrs:{"aria-label":n},props:{dark:this.dark,disabled:r,icon:!0,light:this.light},on:{click:i=>{i.stopPropagation(),this.$emit("input",this.calculateChange(e))}}},[this.$createElement(W,e<0==!this.$vuetify.rtl?this.prevIcon:this.nextIcon)])},calculateChange(e){const[t,n]=String(this.value).split("-").map(Number);return n==null?`${t+e}`:An(String(this.value),e)},genHeader(){const e=!this.disabled&&(this.color||"accent"),t=this.$createElement("div",this.setTextColor(e,{key:String(this.value)}),[this.$createElement("button",{attrs:{type:"button"},on:{click:()=>this.$emit("toggle")}},[this.$slots.default||this.formatter(String(this.value))])]),n=this.$createElement("transition",{props:{name:this.isReversing===!this.$vuetify.rtl?"tab-reverse-transition":"tab-transition"}},[t]);return this.$createElement("div",{staticClass:"v-date-picker-header__value",class:{"v-date-picker-header__value--disabled":this.disabled}},[n])}},render(){return this.$createElement("div",{staticClass:"v-date-picker-header",class:{"v-date-picker-header--disabled":this.disabled,...this.themeClasses}},[this.genBtn(-1),this.genHeader(),this.genBtn(1)])}});function Tn(e,t,n,r){return(!r||r(e))&&(!t||e>=t.substr(0,10))&&(!n||e<=n)}const Mn=K(ie,Ie,fe).extend({directives:{Touch:Bi},props:{allowedDates:Function,current:String,disabled:Boolean,format:Function,events:{type:[Array,Function,Object],default:()=>null},eventColor:{type:[Array,Function,Object,String],default:()=>"warning"},min:String,max:String,range:Boolean,readonly:Boolean,scrollable:Boolean,tableDate:{type:String,required:!0},value:[String,Array]},data:()=>({isReversing:!1,wheelThrottle:null}),computed:{computedTransition(){return this.isReversing===!this.$vuetify.rtl?"tab-reverse-transition":"tab-transition"},displayedMonth(){return Number(this.tableDate.split("-")[1])-1},displayedYear(){return Number(this.tableDate.split("-")[0])}},watch:{tableDate(e,t){this.isReversing=e{t&&!this.readonly&&this.$emit("input",e)}},Pn(this,`:${n}`,e))},genButton(e,t,n,r,i=!1){const a=Tn(e,this.min,this.max,this.allowedDates),o=this.isSelected(e)&&a,u=e===this.current,c=o?this.setBackgroundColor:this.setTextColor,d=(o||u)&&(this.color||"accent");let p=!1,f=!1;return this.range&&!!this.value&&Array.isArray(this.value)&&(p=e===this.value[0],f=e===this.value[this.value.length-1]),this.$createElement("button",c(d,{staticClass:"v-btn",class:this.genButtonClasses(a&&!i,t,o,u,p,f),attrs:{type:"button"},domProps:{disabled:this.disabled||!a||i},on:this.genButtonEvents(e,a,n)}),[this.$createElement("div",{staticClass:"v-btn__content"},[r(e)]),this.genEvents(e)])},getEventColors(e){const t=i=>Array.isArray(i)?i:[i];let n,r=[];if(Array.isArray(this.events)?n=this.events.includes(e):this.events instanceof Function?n=this.events(e)||!1:this.events?n=this.events[e]||!1:n=!1,n)n!==!0?r=t(n):typeof this.eventColor=="string"?r=[this.eventColor]:typeof this.eventColor=="function"?r=t(this.eventColor(e)):Array.isArray(this.eventColor)?r=this.eventColor:r=t(this.eventColor[e]);else return[];return r.filter(i=>i)},genEvents(e){const t=this.getEventColors(e);return t.length?this.$createElement("div",{staticClass:"v-date-picker-table__events"},t.map(n=>this.$createElement("div",this.setBackgroundColor(n)))):null},isValidScroll(e,t){const n=t(e),r=n.split("-").length===1?"year":"month";return e<0&&(this.min?n>=U(this.min,r):!0)||e>0&&(this.max?n<=U(this.max,r):!0)},wheel(e,t){this.$emit("update:table-date",t(e.deltaY))},touch(e,t){this.$emit("update:table-date",t(e))},genTable(e,t,n){const r=this.$createElement("transition",{props:{name:this.computedTransition}},[this.$createElement("table",{key:this.tableDate},t)]),i={name:"touch",value:{left:a=>a.offsetX<-15&&this.isValidScroll(1,n)&&this.touch(1,n),right:a=>a.offsetX>15&&this.isValidScroll(-1,n)&&this.touch(-1,n)}};return this.$createElement("div",{staticClass:e,class:{"v-date-picker-table--disabled":this.disabled,...this.themeClasses},on:!this.disabled&&this.scrollable?{wheel:a=>{a.preventDefault(),this.isValidScroll(a.deltaY,n)&&this.wheelThrottle(a,n)}}:void 0,directives:[i]},[r])},isSelected(e){if(Array.isArray(this.value))if(this.range&&this.value.length===2){const[t,n]=[...this.value].sort();return t<=e&&e<=n}else return this.value.indexOf(e)!==-1;return e===this.value}}}),gr=K(Mn).extend({name:"v-date-picker-date-table",props:{firstDayOfWeek:{type:[String,Number],default:0},localeFirstDayOfYear:{type:[String,Number],default:0},showAdjacentMonths:Boolean,showWeek:Boolean,weekdayFormat:Function},computed:{formatter(){return this.format||te(this.currentLocale,{day:"numeric",timeZone:"UTC"},{start:8,length:2})},weekdayFormatter(){return this.weekdayFormat||te(this.currentLocale,{weekday:"narrow",timeZone:"UTC"})},weekDays(){const e=parseInt(this.firstDayOfWeek,10);return this.weekdayFormatter?gt(7).map(t=>this.weekdayFormatter(`2017-01-${e+t+15}`)):gt(7).map(t=>["S","M","T","W","T","F","S"][(t+e)%7])}},methods:{calculateTableDate(e){return An(this.tableDate,Math.sign(e||1))},genTHead(){const e=this.weekDays.map(t=>this.$createElement("th",t));return this.showWeek&&e.unshift(this.$createElement("th")),this.$createElement("thead",this.genTR(e))},weekDaysBeforeFirstDayOfTheMonth(){return(new Date(`${this.displayedYear}-${L(this.displayedMonth+1)}-01T00:00:00+00:00`).getUTCDay()-parseInt(this.firstDayOfWeek)+7)%7},getWeekNumber(e){return ur(this.displayedYear,this.displayedMonth,e,parseInt(this.firstDayOfWeek),parseInt(this.localeFirstDayOfYear))},genWeekNumber(e){return this.$createElement("td",[this.$createElement("small",{staticClass:"v-date-picker-table--date__week"},String(e).padStart(2,"0"))])},genTBody(){const e=[],t=new Date(this.displayedYear,this.displayedMonth+1,0).getDate();let n=[],r=this.weekDaysBeforeFirstDayOfTheMonth();this.showWeek&&n.push(this.genWeekNumber(this.getWeekNumber(1)));const i=this.displayedMonth?this.displayedYear:this.displayedYear-1,a=(this.displayedMonth+11)%12,o=new Date(this.displayedYear,this.displayedMonth,0).getDate(),u=this.showWeek?8:7;for(;r--;){const f=`${i}-${L(a+1)}-${L(o-r)}`;n.push(this.$createElement("td",this.showAdjacentMonths?[this.genButton(f,!0,"date",this.formatter,!0)]:[]))}for(r=1;r<=t;r++){const f=`${this.displayedYear}-${L(this.displayedMonth+1)}-${L(r)}`;n.push(this.$createElement("td",[this.genButton(f,!0,"date",this.formatter)])),n.length%u===0&&(e.push(this.genTR(n)),n=[],this.showWeek&&(r{const u=r*t.length+o,c=`${this.displayedYear}-${L(u+1)}`;return this.$createElement("td",{key:u},[this.genButton(c,!1,"month",this.formatter)])});e.push(this.$createElement("tr",{key:r},i))}return this.$createElement("tbody",e)}},render(){return this.genTable("v-date-picker-table v-date-picker-table--month",[this.genTBody()],this.calculateTableDate)}});const br=K(ie,Ie).extend({name:"v-date-picker-years",props:{format:Function,min:[Number,String],max:[Number,String],readonly:Boolean,value:[Number,String]},data(){return{defaultColor:"primary"}},computed:{formatter(){return this.format||te(this.currentLocale,{year:"numeric",timeZone:"UTC"},{length:4})}},mounted(){setTimeout(()=>{const e=this.$el.getElementsByClassName("active")[0];e?this.$el.scrollTop=e.offsetTop-this.$el.offsetHeight/2+e.offsetHeight/2:this.min&&!this.max?this.$el.scrollTop=this.$el.scrollHeight:!this.min&&this.max?this.$el.scrollTop=0:this.$el.scrollTop=this.$el.scrollHeight/2-this.$el.offsetHeight/2})},methods:{genYearItem(e){const t=this.formatter(`${e}`),n=parseInt(this.value,10)===e,r=n&&(this.color||"primary");return this.$createElement("li",this.setTextColor(r,{key:e,class:{active:n},on:gn({click:()=>this.$emit("input",e)},Pn(this,":year",e))}),t)},genYearItems(){const e=[],t=this.value?parseInt(this.value,10):new Date().getFullYear(),n=this.max?parseInt(this.max,10):t+100,r=Math.min(n,this.min?parseInt(this.min,10):t-100);for(let i=n;i>=r;i--)e.push(this.genYearItem(i));return e}},render(){return this.$createElement("ul",{staticClass:"v-date-picker-years",ref:"years"},this.genYearItems())}});const vr=K(ie,yn,fe).extend({name:"v-picker",props:{flat:Boolean,fullWidth:Boolean,landscape:Boolean,noTitle:Boolean,transition:{type:String,default:"fade-transition"},width:{type:[Number,String],default:290}},computed:{computedTitleColor(){const e=this.isDark?!1:this.color||"primary";return this.color||e}},methods:{genTitle(){return this.$createElement("div",this.setBackgroundColor(this.computedTitleColor,{staticClass:"v-picker__title",class:{"v-picker__title--landscape":this.landscape}}),this.$slots.title)},genBodyTransition(){return this.$createElement("transition",{props:{name:this.transition}},this.$slots.default)},genBody(){return this.$createElement("div",{staticClass:"v-picker__body",class:{"v-picker__body--no-title":this.noTitle,...this.themeClasses},style:this.fullWidth?void 0:{width:Ai(this.width)}},[this.genBodyTransition()])},genActions(){return this.$createElement("div",{staticClass:"v-picker__actions v-card__actions",class:{"v-picker__actions--no-title":this.noTitle}},this.$slots.actions)}},render(e){return e("div",{staticClass:"v-picker v-card",class:{"v-picker--flat":this.flat,"v-picker--landscape":this.landscape,"v-picker--full-width":this.fullWidth,...this.themeClasses,...this.elevationClasses}},[this.$slots.title?this.genTitle():null,this.genBody(),this.$slots.actions?this.genActions():null])}}),Cr=K(ie,yn,fe).extend({name:"picker",props:{flat:Boolean,fullWidth:Boolean,headerColor:String,landscape:Boolean,noTitle:Boolean,width:{type:[Number,String],default:290}},methods:{genPickerTitle(){return null},genPickerBody(){return null},genPickerActionsSlot(){return this.$scopedSlots.default?this.$scopedSlots.default({save:this.save,cancel:this.cancel}):this.$slots.default},genPicker(e){const t=[];if(!this.noTitle){const r=this.genPickerTitle();r&&t.push(r)}const n=this.genPickerBody();return n&&t.push(n),t.push(this.$createElement("template",{slot:"actions"},[this.genPickerActionsSlot()])),this.$createElement(vr,{staticClass:e,props:{color:this.headerColor||this.color,dark:this.dark,elevation:this.elevation,flat:this.flat,fullWidth:this.fullWidth,landscape:this.landscape,light:this.light,width:this.width,noTitle:this.noTitle}},t)}}}),wr=K(Ie,Cr).extend({name:"v-date-picker",props:{activePicker:String,allowedDates:Function,dayFormat:Function,disabled:Boolean,events:{type:[Array,Function,Object],default:()=>null},eventColor:{type:[Array,Function,Object,String],default:()=>"warning"},firstDayOfWeek:{type:[String,Number],default:0},headerDateFormat:Function,localeFirstDayOfYear:{type:[String,Number],default:0},max:String,min:String,monthFormat:Function,multiple:Boolean,nextIcon:{type:String,default:"$next"},nextMonthAriaLabel:{type:String,default:"$vuetify.datePicker.nextMonthAriaLabel"},nextYearAriaLabel:{type:String,default:"$vuetify.datePicker.nextYearAriaLabel"},pickerDate:String,prevIcon:{type:String,default:"$prev"},prevMonthAriaLabel:{type:String,default:"$vuetify.datePicker.prevMonthAriaLabel"},prevYearAriaLabel:{type:String,default:"$vuetify.datePicker.prevYearAriaLabel"},range:Boolean,reactive:Boolean,readonly:Boolean,scrollable:Boolean,showCurrent:{type:[Boolean,String],default:!0},selectedItemsText:{type:String,default:"$vuetify.datePicker.itemsSelected"},showAdjacentMonths:Boolean,showWeek:Boolean,titleDateFormat:Function,type:{type:String,default:"date",validator:e=>["date","month"].includes(e)},value:[Array,String],weekdayFormat:Function,yearFormat:Function,yearIcon:String},data(){const e=new Date;return{internalActivePicker:this.type.toUpperCase(),inputDay:null,inputMonth:null,inputYear:null,isReversing:!1,now:e,tableDate:(()=>{if(this.pickerDate)return this.pickerDate;const t=Yt(this.value),n=t[t.length-1]||(typeof this.showCurrent=="string"?this.showCurrent:`${e.getFullYear()}-${e.getMonth()+1}`);return U(n,this.type==="date"?"month":"year")})()}},computed:{multipleValue(){return Yt(this.value)},isMultiple(){return this.multiple||this.range},lastValue(){return this.isMultiple?this.multipleValue[this.multipleValue.length-1]:this.value},selectedMonths(){return!this.value||this.type==="month"?this.value:this.isMultiple?this.multipleValue.map(e=>e.substr(0,7)):this.value.substr(0,7)},current(){return this.showCurrent===!0?U(`${this.now.getFullYear()}-${this.now.getMonth()+1}-${this.now.getDate()}`,this.type):this.showCurrent||null},inputDate(){return this.type==="date"?`${this.inputYear}-${L(this.inputMonth+1)}-${L(this.inputDay)}`:`${this.inputYear}-${L(this.inputMonth+1)}`},tableMonth(){return Number((this.pickerDate||this.tableDate).split("-")[1])-1},tableYear(){return Number((this.pickerDate||this.tableDate).split("-")[0])},minMonth(){return this.min?U(this.min,"month"):null},maxMonth(){return this.max?U(this.max,"month"):null},minYear(){return this.min?U(this.min,"year"):null},maxYear(){return this.max?U(this.max,"year"):null},formatters(){return{year:this.yearFormat||te(this.currentLocale,{year:"numeric",timeZone:"UTC"},{length:4}),titleDate:this.titleDateFormat||(this.isMultiple?this.defaultTitleMultipleDateFormatter:this.defaultTitleDateFormatter)}},defaultTitleMultipleDateFormatter(){return e=>e.length?e.length===1?this.defaultTitleDateFormatter(e[0]):this.$vuetify.lang.t(this.selectedItemsText,e.length):"-"},defaultTitleDateFormatter(){const e={year:{year:"numeric",timeZone:"UTC"},month:{month:"long",timeZone:"UTC"},date:{weekday:"short",month:"short",day:"numeric",timeZone:"UTC"}},t=te(this.currentLocale,e[this.type],{start:0,length:{date:10,month:7,year:4}[this.type]}),n=r=>t(r).replace(/([^\d\s])([\d])/g,(i,a,o)=>`${a} ${o}`).replace(", ",",
");return this.landscape?n:t}},watch:{internalActivePicker:{immediate:!0,handler(e){this.$emit("update:active-picker",e)}},activePicker(e){this.internalActivePicker=e},tableDate(e,t){const n=this.type==="month"?"year":"month";this.isReversing=U(e,n)U(n,e)).filter(this.isDateAllowed);this.$emit("input",this.isMultiple?t:t[0])}}},created(){this.checkMultipleProp(),this.pickerDate!==this.tableDate&&this.$emit("update:picker-date",this.tableDate),this.setInputDate()},methods:{emitInput(e){if(this.range){if(this.multipleValue.length!==1)this.$emit("input",[e]);else{const n=[this.multipleValue[0],e];this.$emit("input",n),this.$emit("change",n)}return}const t=this.multiple?this.multipleValue.indexOf(e)===-1?this.multipleValue.concat([e]):this.multipleValue.filter(n=>n!==e):e;this.$emit("input",t),this.multiple||this.$emit("change",e)},checkMultipleProp(){if(this.value==null)return;const e=this.value.constructor.name,t=this.isMultiple?"Array":"String";e!==t&&bn(`Value must be ${this.isMultiple?"an":"a"} ${t}, got ${e}`,this)},isDateAllowed(e){return Tn(e,this.min,this.max,this.allowedDates)},yearClick(e){this.inputYear=e,this.type==="month"?this.tableDate=`${e}`:this.tableDate=`${e}-${L((this.tableMonth||0)+1)}`,this.internalActivePicker="MONTH",this.reactive&&!this.readonly&&!this.isMultiple&&this.isDateAllowed(this.inputDate)&&this.$emit("input",this.inputDate)},monthClick(e){const[t,n]=e.split("-");this.inputYear=parseInt(t,10),this.inputMonth=parseInt(n,10)-1,this.type==="date"?(this.inputDay&&(this.inputDay=Math.min(this.inputDay,hr(this.inputYear,this.inputMonth+1))),this.tableDate=e,this.internalActivePicker="DATE",this.reactive&&!this.readonly&&!this.isMultiple&&this.isDateAllowed(this.inputDate)&&this.$emit("input",this.inputDate)):this.emitInput(this.inputDate)},dateClick(e){const[t,n,r]=e.split("-");this.inputYear=parseInt(t,10),this.inputMonth=parseInt(n,10)-1,this.inputDay=parseInt(r,10),this.emitInput(this.inputDate)},genPickerTitle(){return this.$createElement(fr,{props:{date:this.value?this.formatters.titleDate(this.isMultiple?this.multipleValue:this.value):"",disabled:this.disabled,readonly:this.readonly,selectingYear:this.internalActivePicker==="YEAR",year:this.formatters.year(this.multipleValue.length?`${this.inputYear}`:this.tableDate),yearIcon:this.yearIcon,value:this.multipleValue[0]},slot:"title",on:{"update:selecting-year":e=>this.internalActivePicker=e?"YEAR":this.type.toUpperCase()}})},genTableHeader(){return this.$createElement(Dr,{props:{nextIcon:this.nextIcon,color:this.color,dark:this.dark,disabled:this.disabled,format:this.headerDateFormat,light:this.light,locale:this.locale,min:this.internalActivePicker==="DATE"?this.minMonth:this.minYear,max:this.internalActivePicker==="DATE"?this.maxMonth:this.maxYear,nextAriaLabel:this.internalActivePicker==="DATE"?this.nextMonthAriaLabel:this.nextYearAriaLabel,prevAriaLabel:this.internalActivePicker==="DATE"?this.prevMonthAriaLabel:this.prevYearAriaLabel,prevIcon:this.prevIcon,readonly:this.readonly,value:this.internalActivePicker==="DATE"?`${L(this.tableYear,4)}-${L(this.tableMonth+1)}`:`${L(this.tableYear,4)}`},on:{toggle:()=>this.internalActivePicker=this.internalActivePicker==="DATE"?"MONTH":"YEAR",input:e=>this.tableDate=e}})},genDateTable(){return this.$createElement(gr,{props:{allowedDates:this.allowedDates,color:this.color,current:this.current,dark:this.dark,disabled:this.disabled,events:this.events,eventColor:this.eventColor,firstDayOfWeek:this.firstDayOfWeek,format:this.dayFormat,light:this.light,locale:this.locale,localeFirstDayOfYear:this.localeFirstDayOfYear,min:this.min,max:this.max,range:this.range,readonly:this.readonly,scrollable:this.scrollable,showAdjacentMonths:this.showAdjacentMonths,showWeek:this.showWeek,tableDate:`${L(this.tableYear,4)}-${L(this.tableMonth+1)}`,value:this.value,weekdayFormat:this.weekdayFormat},ref:"table",on:{input:this.dateClick,"update:table-date":e=>this.tableDate=e,...ut(this,":date")}})},genMonthTable(){return this.$createElement(yr,{props:{allowedDates:this.type==="month"?this.allowedDates:null,color:this.color,current:this.current?U(this.current,"month"):null,dark:this.dark,disabled:this.disabled,events:this.type==="month"?this.events:null,eventColor:this.type==="month"?this.eventColor:null,format:this.monthFormat,light:this.light,locale:this.locale,min:this.minMonth,max:this.maxMonth,range:this.range,readonly:this.readonly&&this.type==="month",scrollable:this.scrollable,value:this.selectedMonths,tableDate:`${L(this.tableYear,4)}`},ref:"table",on:{input:this.monthClick,"update:table-date":e=>this.tableDate=e,...ut(this,":month")}})},genYears(){return this.$createElement(br,{props:{color:this.color,format:this.yearFormat,locale:this.locale,min:this.minYear,max:this.maxYear,value:this.tableYear},on:{input:this.yearClick,...ut(this,":year")}})},genPickerBody(){const e=this.internalActivePicker==="YEAR"?[this.genYears()]:[this.genTableHeader(),this.internalActivePicker==="DATE"?this.genDateTable():this.genMonthTable()];return this.$createElement("div",{key:this.internalActivePicker},e)},setInputDate(){if(this.lastValue){const e=this.lastValue.split("-");this.inputYear=parseInt(e[0],10),this.inputMonth=parseInt(e[1],10)-1,this.type==="date"&&(this.inputDay=parseInt(e[2],10))}else this.inputYear=this.inputYear||this.now.getFullYear(),this.inputMonth=this.inputMonth==null?this.inputMonth:this.now.getMonth(),this.inputDay=this.inputDay||this.now.getDate()}},render(){return this.genPicker("v-picker--date")}});const _r=K(ie,Ti("treeview")),jn={activatable:Boolean,activeClass:{type:String,default:"v-treeview-node--active"},color:{type:String,default:"primary"},disablePerNode:Boolean,expandIcon:{type:String,default:"$subgroup"},indeterminateIcon:{type:String,default:"$checkboxIndeterminate"},itemChildren:{type:String,default:"children"},itemDisabled:{type:String,default:"disabled"},itemKey:{type:String,default:"id"},itemText:{type:String,default:"name"},loadChildren:Function,loadingIcon:{type:String,default:"$loading"},offIcon:{type:String,default:"$checkboxOff"},onIcon:{type:String,default:"$checkboxOn"},openOnClick:Boolean,rounded:Boolean,selectable:Boolean,selectedColor:{type:String,default:"accent"},shaped:Boolean,transition:Boolean,selectionType:{type:String,default:"leaf",validator:e=>["leaf","independent"].includes(e)}},Rn=_r.extend().extend({name:"v-treeview-node",inject:{treeview:{default:null}},props:{level:Number,item:{type:Object,default:()=>null},parentIsDisabled:Boolean,...jn},data:()=>({hasLoaded:!1,isActive:!1,isIndeterminate:!1,isLoading:!1,isOpen:!1,isSelected:!1}),computed:{disabled(){return R(this.item,this.itemDisabled)||!this.disablePerNode&&this.parentIsDisabled&&this.selectionType==="leaf"},key(){return R(this.item,this.itemKey)},children(){const e=R(this.item,this.itemChildren);return e&&e.filter(t=>!this.treeview.isExcluded(R(t,this.itemKey)))},text(){return R(this.item,this.itemText)},scopedProps(){return{item:this.item,leaf:!this.children,selected:this.isSelected,indeterminate:this.isIndeterminate,active:this.isActive,open:this.isOpen}},computedIcon(){return this.isIndeterminate?this.indeterminateIcon:this.isSelected?this.onIcon:this.offIcon},hasChildren(){return!!this.children&&(!!this.children.length||!!this.loadChildren)}},created(){this.treeview.register(this)},beforeDestroy(){this.treeview.unregister(this)},methods:{checkChildren(){return new Promise(e=>{if(!this.children||this.children.length||!this.loadChildren||this.hasLoaded)return e();this.isLoading=!0,e(this.loadChildren(this.item))}).then(()=>{this.isLoading=!1,this.hasLoaded=!0})},open(){this.isOpen=!this.isOpen,this.treeview.updateOpen(this.key,this.isOpen),this.treeview.emitOpen()},genLabel(){const e=[];return this.$scopedSlots.label?e.push(this.$scopedSlots.label(this.scopedProps)):e.push(this.text),this.$createElement("div",{slot:"label",staticClass:"v-treeview-node__label"},e)},genPrependSlot(){return this.$scopedSlots.prepend?this.$createElement("div",{staticClass:"v-treeview-node__prepend"},this.$scopedSlots.prepend(this.scopedProps)):null},genAppendSlot(){return this.$scopedSlots.append?this.$createElement("div",{staticClass:"v-treeview-node__append"},this.$scopedSlots.append(this.scopedProps)):null},genContent(){const e=[this.genPrependSlot(),this.genLabel(),this.genAppendSlot()];return this.$createElement("div",{staticClass:"v-treeview-node__content"},e)},genToggle(){return this.$createElement(W,{staticClass:"v-treeview-node__toggle",class:{"v-treeview-node__toggle--open":this.isOpen,"v-treeview-node__toggle--loading":this.isLoading},slot:"prepend",on:{click:e=>{e.stopPropagation(),!this.isLoading&&this.checkChildren().then(()=>this.open())}}},[this.isLoading?this.loadingIcon:this.expandIcon])},genCheckbox(){return this.$createElement(W,{staticClass:"v-treeview-node__checkbox",props:{color:this.isSelected||this.isIndeterminate?this.selectedColor:void 0,disabled:this.disabled},on:{click:e=>{e.stopPropagation(),!this.isLoading&&this.checkChildren().then(()=>{this.$nextTick(()=>{this.isSelected=!this.isSelected,this.isIndeterminate=!1,this.treeview.updateSelected(this.key,this.isSelected),this.treeview.emitSelected()})})}}},[this.computedIcon])},genLevel(e){return gt(e).map(()=>this.$createElement("div",{staticClass:"v-treeview-node__level"}))},genNode(){const e=[this.genContent()];return this.selectable&&e.unshift(this.genCheckbox()),this.hasChildren?e.unshift(this.genToggle()):e.unshift(...this.genLevel(1)),e.unshift(...this.genLevel(this.level)),this.$createElement("div",this.setTextColor(this.isActive&&this.color,{staticClass:"v-treeview-node__root",class:{[this.activeClass]:this.isActive},on:{click:()=>{this.openOnClick&&this.hasChildren?this.checkChildren().then(this.open):this.activatable&&!this.disabled&&(this.isActive=!this.isActive,this.treeview.updateActive(this.key,this.isActive),this.treeview.emitActive())}}}),e)},genChild(e,t){return this.$createElement(Rn,{key:R(e,this.itemKey),props:{activatable:this.activatable,activeClass:this.activeClass,item:e,selectable:this.selectable,selectedColor:this.selectedColor,color:this.color,disablePerNode:this.disablePerNode,expandIcon:this.expandIcon,indeterminateIcon:this.indeterminateIcon,offIcon:this.offIcon,onIcon:this.onIcon,loadingIcon:this.loadingIcon,itemKey:this.itemKey,itemText:this.itemText,itemDisabled:this.itemDisabled,itemChildren:this.itemChildren,loadChildren:this.loadChildren,transition:this.transition,openOnClick:this.openOnClick,rounded:this.rounded,shaped:this.shaped,level:this.level+1,selectionType:this.selectionType,parentIsDisabled:t},scopedSlots:this.$scopedSlots})},genChildrenWrapper(){if(!this.isOpen||!this.children)return null;const e=[this.children.map(t=>this.genChild(t,this.disabled))];return this.$createElement("div",{staticClass:"v-treeview-node__children"},e)},genTransition(){return this.$createElement(Mi,[this.genChildrenWrapper()])}},render(e){const t=[this.genNode()];return this.transition?t.push(this.genTransition()):t.push(this.genChildrenWrapper()),e("div",{staticClass:"v-treeview-node",class:{"v-treeview-node--leaf":!this.hasChildren,"v-treeview-node--click":this.openOnClick,"v-treeview-node--disabled":this.disabled,"v-treeview-node--rounded":this.rounded,"v-treeview-node--shaped":this.shaped,"v-treeview-node--selected":this.isSelected},attrs:{"aria-expanded":String(this.isOpen)}},t)}}),Fr=Rn;function kr(e,t,n){return R(e,n).toLocaleLowerCase().indexOf(t.toLocaleLowerCase())>-1}function On(e,t,n,r,i,a,o){if(e(t,n,i))return!0;const u=R(t,a);if(u){let c=!1;for(let d=0;d[]},dense:Boolean,disabled:Boolean,filter:Function,hoverable:Boolean,items:{type:Array,default:()=>[]},multipleActive:Boolean,open:{type:Array,default:()=>[]},openAll:Boolean,returnObject:{type:Boolean,default:!1},search:String,value:{type:Array,default:()=>[]},...jn},data:()=>({level:-1,activeCache:new Set,nodes:{},openCache:new Set,selectedCache:new Set}),computed:{excludedItems(){const e=new Set;if(!this.search)return e;for(let t=0;tR(this.nodes[i].item,this.itemKey)),t=this.getKeys(this.items),n=Ri(t,e);if(!n.length&&t.lengthdelete this.nodes[i]);const r=[...this.selectedCache];this.selectedCache=new Set,this.activeCache=new Set,this.openCache=new Set,this.buildTree(this.items),Kt(r,[...this.selectedCache])||this.emitSelected()},deep:!0},active(e){this.handleNodeCacheWatcher(e,this.activeCache,this.updateActive,this.emitActive)},value(e){this.handleNodeCacheWatcher(e,this.selectedCache,this.updateSelected,this.emitSelected)},open(e){this.handleNodeCacheWatcher(e,this.openCache,this.updateOpen,this.emitOpen)}},created(){const e=t=>this.returnObject?R(t,this.itemKey):t;this.buildTree(this.items);for(const t of this.value.map(e))this.updateSelected(t,!0,!0);for(const t of this.active.map(e))this.updateActive(t,!0)},mounted(){(this.$slots.prepend||this.$slots.append)&&bn("The prepend and append slots require a slot-scope attribute",this),this.openAll?this.updateAll(!0):(this.open.forEach(e=>this.updateOpen(this.returnObject?R(e,this.itemKey):e,!0)),this.emitOpen())},methods:{updateAll(e){Object.keys(this.nodes).forEach(t=>this.updateOpen(R(this.nodes[t].item,this.itemKey),e)),this.emitOpen()},getKeys(e,t=[]){for(let n=0;nR(d,this.itemKey)),item:i};if(this.buildTree(o,a),this.selectionType!=="independent"&&t!==null&&!this.nodes.hasOwnProperty(a)&&this.nodes.hasOwnProperty(t)?c.isSelected=this.nodes[t].isSelected:(c.isSelected=u.isSelected,c.isIndeterminate=u.isIndeterminate),c.isActive=u.isActive,c.isOpen=u.isOpen,this.nodes[a]=c,o.length&&this.selectionType!=="independent"){const{isSelected:d,isIndeterminate:p}=this.calculateState(a,this.nodes);c.isSelected=d,c.isIndeterminate=p}this.nodes[a].isSelected&&(this.selectionType==="independent"||c.children.length===0)&&this.selectedCache.add(a),this.nodes[a].isActive&&this.activeCache.add(a),this.nodes[a].isOpen&&this.openCache.add(a),this.updateVnodeState(a)}},calculateState(e,t){const n=t[e].children,r=n.reduce((o,u)=>(o[0]+=+Boolean(t[u].isSelected),o[1]+=+Boolean(t[u].isIndeterminate),o),[0,0]),i=!!n.length&&r[0]===n.length,a=!i&&(r[0]>0||r[1]>0);return{isSelected:i,isIndeterminate:a}},emitOpen(){this.emitNodeCache("update:open",this.openCache)},emitSelected(){this.emitNodeCache("input",this.selectedCache)},emitActive(){this.emitNodeCache("update:active",this.activeCache)},emitNodeCache(e,t){this.$emit(e,this.returnObject?[...t].map(n=>this.nodes[n].item):[...t])},handleNodeCacheWatcher(e,t,n,r){e=this.returnObject?e.map(a=>R(a,this.itemKey)):e;const i=[...t];Kt(i,e)||(i.forEach(a=>n(a,!1)),e.forEach(a=>n(a,!0)),r())},getDescendants(e,t=[]){const n=this.nodes[e].children;t.push(...n);for(let r=0;r{this.nodes[r].isActive=!1,this.updateVnodeState(r),this.activeCache.delete(r)});const n=this.nodes[e];!n||(t?this.activeCache.add(e):this.activeCache.delete(e),n.isActive=t,this.updateVnodeState(e))},updateSelected(e,t,n=!1){if(!this.nodes.hasOwnProperty(e))return;const r=new Map;if(this.selectionType!=="independent"){for(const a of this.getDescendants(e))(!R(this.nodes[a].item,this.itemDisabled)||n)&&(this.nodes[a].isSelected=t,this.nodes[a].isIndeterminate=!1,r.set(a,t));const i=this.calculateState(e,this.nodes);this.nodes[e].isSelected=t,this.nodes[e].isIndeterminate=i.isIndeterminate,r.set(e,t);for(const a of this.getParents(e)){const o=this.calculateState(a,this.nodes);this.nodes[a].isSelected=o.isSelected,this.nodes[a].isIndeterminate=o.isIndeterminate,r.set(a,o.isSelected)}}else this.nodes[e].isSelected=t,this.nodes[e].isIndeterminate=!1,r.set(e,t);for(const[i,a]of r.entries())this.updateVnodeState(i),!(this.selectionType==="leaf"&&this.isParent(i))&&(a===!0?this.selectedCache.add(i):this.selectedCache.delete(i))},updateOpen(e,t){if(!this.nodes.hasOwnProperty(e))return;const n=this.nodes[e],r=R(n.item,this.itemChildren);r&&!r.length&&n.vnode&&!n.vnode.hasLoaded?n.vnode.checkChildren().then(()=>this.updateOpen(e,t)):r&&r.length&&(n.isOpen=t,n.isOpen?this.openCache.add(e):this.openCache.delete(e),this.updateVnodeState(e))},updateVnodeState(e){const t=this.nodes[e];t&&t.vnode&&(t.vnode.isSelected=t.isSelected,t.vnode.isIndeterminate=t.isIndeterminate,t.vnode.isActive=t.isActive,t.vnode.isOpen=t.isOpen)},isExcluded(e){return!!this.search&&this.excludedItems.has(e)}},render(e){const t=this.items.length?this.items.filter(n=>!this.isExcluded(R(n,this.itemKey))).map(n=>Fr.options.methods.genChild.bind(this)(n,this.disabled||R(n,this.itemDisabled))):this.$slots.default;return e("div",{staticClass:"v-treeview",class:{"v-treeview--hoverable":this.hoverable,"v-treeview--dense":this.dense,...this.themeClasses}},t)}});const $r={components:{},props:{editable:{type:Boolean,default:!0},label:{type:String,required:!0},value:{type:[String,Number],default:""},dataType:{type:String,default:"string"},suggestedValues:{type:Array,default:()=>[]},strict:{type:Boolean,default:!1},rules:{type:Array,default:()=>[]}},data(){return{internalValue:this.value,editing:!1,menu:!1,original:"",moment:vt}},computed:{dirty(){return this.original!==this.internalValue},...vn({isDarkMode:"application/isDarkMode"})},watch:{internalValue(e){this.$emit("input",e)}},mounted(){this.original=this.value},methods:{clicked(){!this.editable||(this.editing=!0,this.$nextTick(()=>{this.dataType==="date"||this.dataType==="date-range"?this.menu=!0:this.$refs.field.focus()}))},async update(){this.$refs.field.validate&&this.$refs.field.validate()===!1||(this.label==="Delay"?this.internalValue=Math.floor(this.internalValue):this.label==="Jitter"&&(this.internalValue=Math.floor(this.internalValue*10)/10),await this.$nextTick(),this.editing=!1,this.$emit("update"))},revert(){this.editing=!1,this.internalValue=this.original},async clear(){this.internalValue="",await this.$nextTick(),this.editing=!1,this.$emit("update")},getColClass(){return this.editing===!1&&this.editable===!0?this.isDarkMode?"column-not-editing-dark":"column-not-editing":""}}};var Sr=function(){var t=this,n=t._self._c;return n(De,{staticClass:"pb-5"},[n(ne,{attrs:{cols:"4"}},[n("span",{staticClass:"text--bold"},[t._v(t._s(t.label))])]),n(ne,{class:t.getColClass(),attrs:{cols:"6"},on:{click:t.clicked}},[t.editing&&t.editable?[t.suggestedValues.length>0&&t.strict?n(er,{ref:"field",attrs:{items:t.suggestedValues,label:t.label,outlined:"",dense:""},on:{blur:t.update,keyup:function(r){return!r.type.indexOf("key")&&t._k(r.keyCode,"enter",13,r.key,"Enter")?null:t.update.apply(null,arguments)}},model:{value:t.internalValue,callback:function(r){t.internalValue=r},expression:"internalValue"}}):t.dataType==="date"||t.dataType==="date-range"?n(Cn,{ref:"menu",attrs:{"close-on-content-click":!1,transition:"scale-transition","offset-y":"","min-width":"auto"},scopedSlots:t._u([{key:"activator",fn:function({on:r,attrs:i}){return[n(pe,t._g(t._b({ref:"field",attrs:{label:"Picker in menu","prepend-icon":"mdi-calendar",readonly:"",clearable:""},on:{"click:clear":t.clear},model:{value:t.internalValue,callback:function(a){t.internalValue=a},expression:"internalValue"}},"v-text-field",i,!1),r))]}}],null,!1,2992141911),model:{value:t.menu,callback:function(r){t.menu=r},expression:"menu"}},[n(wr,{attrs:{outlined:"",dense:"",range:t.dataType==="date-range",min:t.moment().format("YYYY-MM-DD")},on:{blur:t.update,keyup:function(r){return!r.type.indexOf("key")&&t._k(r.keyCode,"enter",13,r.key,"Enter")?null:t.update.apply(null,arguments)}},model:{value:t.internalValue,callback:function(r){t.internalValue=r},expression:"internalValue"}},[n(ue),n(Y,{attrs:{text:"",color:"primary"},on:{click:function(r){t.menu=!1,t.editing=!1,t.revert()}}},[t._v(" Cancel ")]),n(Y,{attrs:{text:"",color:"primary"},on:{click:function(r){t.menu=!1,t.update()}}},[t._v(" OK ")])],1)],1):t.dataType==="string"||t.dataType==="number"?n(pe,{ref:"field",staticStyle:{"margin-bottom":"-45px"},attrs:{rules:t.rules,label:t.label,type:t.dataType==="string"?"text":"number",step:t.label==="Jitter"?"0.1":"1",max:t.label==="Jitter"?"1":"",min:"0",outlined:"",dense:"",required:""},on:{blur:t.update,keyup:function(r){return!r.type.indexOf("key")&&t._k(r.keyCode,"enter",13,r.key,"Enter")?null:t.update.apply(null,arguments)}},model:{value:t.internalValue,callback:function(r){t.internalValue=r},expression:"internalValue"}}):t._e()]:n("span",{staticClass:"ml-3"},[t._v(" "+t._s(t.internalValue)+" ")])],2)],1)},xr=[],Br=G($r,Sr,xr,!1,null,null,null,null);const z=Br.exports;const Pr={components:{TagViewer:Sn,ClickToEdit:z},props:{agent:{type:Object,required:!0},readOnly:{type:Boolean,default:!1}},data(){return{valid:!0,nameLoading:!1,loading:!1,labelPosition:"left",rules:{},form:{},moment:vt,workingHoursRules:[e=>/^[0-9]{1,2}:[0-5][0-9]-[0-9]{1,2}:[0-5][0-9]$/.test(e)||"Must be in the format 00:00-24:00"],nameRules:[e=>!!e||"Name is required",e=>!!e&&e.length>2||"Name must be at least 3 characters"],jitterRules:[e=>!Number.isNaN(e)||"Jitter must be a number",e=>e>=0&&e<=1||"Jitter must be between 0 and 1"],delayRules:[e=>!Number.isNaN(e)||"Delay must be a number",e=>e>=0||"Delay must be a positive number"]}},computed:{...wn({listeners:e=>e.listener.listeners}),fields(){return Object.keys(this.agent).map(e=>({name:e,Value:typeof this.agent[e]=="boolean"?`${this.agent[e]}`:this.agent[e]}))},requiredFields(){return this.fields.filter(e=>["name"].indexOf(e.name)<0)}},watch:{fields:{immediate:!0,handler(e){const t=e.reduce((n,r)=>{if(r.name==="kill_date"&&r.Value&&r.Value.length>0){const i=r.Value.split("/"),a=i[2],o=i[0],u=i[1];n[r.name]=`${a}-${o}-${u}`}else n[r.name]=r.Value;return n},{});Pe.set(this,"form",t)}}},mounted(){this.$store.dispatch("listener/getListeners")},methods:{deleteTag(e){Oi(this.agent.session_id,e.id).then(()=>{this.$emit("refresh-agent")}).catch(t=>this.$snack.error(`Error: ${t}`))},updateTag(e){Li(this.agent.session_id,e).then(()=>{this.$emit("refresh-agent"),this.$snack.success("Tag updated")}).catch(t=>this.$snack.error(`Error: ${t}`))},addTag(e){Ii(this.agent.session_id,e).then(()=>{this.$emit("refresh-agent")}).catch(t=>this.$snack.error(`Error: ${t}`))},async updateName(){if(this.agent.name!==this.form.name){try{await this.$store.dispatch("agent/rename",{sessionId:this.agent.session_id,newName:this.form.name})}catch(e){this.$snack.error(`Update agent listener failed: ${e}`);return}this.$snack.info(`Agent ${this.agent.name} name updated`)}},async updateListener(){if(this.agent.listener!==this.form.listener){try{const e=this.listeners.filter(t=>t.name===this.form.listener)[0].id;await zi(this.agent.session_id,e)}catch(e){this.$snack.error(`Update agent listener failed: ${e}`);return}this.$snack.info(`Tasked agent to change listener to: ${this.form.listener}`),await this.$store.dispatch("agent/getAgent",{sessionId:this.form.name})}},async updateKillDate(){let e="";if(this.form.kill_date&&this.form.kill_date.length>0&&(e=vt(this.form.kill_date).format("MM/DD/YYYY")),this.agent.kill_date!==e){try{await Ni(this.agent.session_id,e)}catch(t){this.$snack.error(`Update agent kill date failed: ${t}`);return}this.$snack.info(`Tasked agent to change kill date to: ${e}`),this.$store.dispatch("agent/getAgent",{sessionId:this.form.name})}},async updateWorkingHours(){if(this.agent.working_hours!==this.form.working_hours){try{await Vi(this.agent.session_id,this.form.working_hours)}catch(e){this.$snack.error(`Update agent working hours failed: ${e}`);return}this.$snack.info(`Tasked agent to change working hours to: ${this.form.working_hours}`)}},async updateDelay(){if(this.agent.delay!==this.form.delay){try{await yt(this.agent.session_id,this.form.delay,this.form.jitter)}catch(e){this.$snack.error(`Update agent delay failed: ${e}`);return}this.$snack.info(`Tasked agent to change delay to: ${this.form.delay}`)}},async updateJitter(){if(this.agent.jitter!==this.form.jitter){try{await yt(this.agent.session_id,this.form.delay,this.form.jitter)}catch(e){this.$snack.error(`Update agent delay failed: ${e}`);return}this.$snack.info(`Tasked agent to change jitter to: ${this.form.jitter}`)}},fieldExists(e){return this.fields.filter(t=>t.name===e).length>0}}};var Ar=function(){var t=this,n=t._self._c;return n("div",{staticStyle:{padding:"10px"}},[n(Sn,{attrs:{tags:t.agent.tags},on:{"update-tag":t.updateTag,"delete-tag":t.deleteTag,"new-tag":t.addTag}}),t.agent.session_id?n(Me,{ref:"form",model:{value:t.valid,callback:function(r){t.valid=r},expression:"valid"}},[n(z,{attrs:{label:"Session ID",editable:!1,value:t.form.session_id}}),n(z,{attrs:{label:"Name",rules:t.nameRules,editable:!t.readOnly},on:{update:t.updateName},model:{value:t.form.name,callback:function(r){t.$set(t.form,"name",r)},expression:"form.name"}}),n(z,{attrs:{label:"External IP",value:t.form.external_ip,editable:!1}}),n(z,{attrs:{label:"Internal IP",value:t.form.internal_ip,editable:!1}}),n(z,{attrs:{label:"Host Name",value:t.form.hostname,editable:!1}}),n(z,{attrs:{label:"Username",value:t.form.username,editable:!1}}),n(z,{attrs:{label:"Listener","data-type":"string","suggested-values":t.listeners.map(r=>r.name),strict:!0,editable:!t.readOnly},on:{update:t.updateListener},model:{value:t.form.listener,callback:function(r){t.$set(t.form,"listener",r)},expression:"form.listener"}}),n(z,{attrs:{label:"Kill Date","data-type":"date",editable:!t.readOnly},on:{update:t.updateKillDate},model:{value:t.form.kill_date,callback:function(r){t.$set(t.form,"kill_date",r)},expression:"form.kill_date"}}),n(z,{attrs:{label:"Working Hours",rules:t.workingHoursRules,editable:!t.readOnly},on:{update:t.updateWorkingHours},model:{value:t.form.working_hours,callback:function(r){t.$set(t.form,"working_hours",r)},expression:"form.working_hours"}}),n(z,{attrs:{label:"Check In Time",value:t.moment(t.form.checkin_time).fromNow(),editable:!1}}),n(z,{attrs:{label:"Last Seen Time",value:t.moment(t.form.lastseen_time).fromNow(),editable:!1}}),n(z,{attrs:{label:"Delay","data-type":"number",rules:t.delayRules,editable:!t.readOnly},on:{update:t.updateDelay},model:{value:t.form.delay,callback:function(r){t.$set(t.form,"delay",r)},expression:"form.delay"}}),n(z,{attrs:{label:"Jitter","data-type":"number",rules:t.jitterRules,editable:!t.readOnly},on:{update:t.updateJitter},model:{value:t.form.jitter,callback:function(r){t.$set(t.form,"jitter",r)},expression:"form.jitter"}}),n(z,{attrs:{label:"Lost Limit","data-type":"number",editable:!1},model:{value:t.form.lost_limit,callback:function(r){t.$set(t.form,"lost_limit",r)},expression:"form.lost_limit"}}),n(z,{attrs:{label:"OS Details",value:t.form.os_details,editable:!1}}),n(z,{attrs:{label:"Architecture",value:t.form.architecture,editable:!1}}),n(z,{attrs:{label:"Process ID",value:t.form.process_id,editable:!1}}),n(z,{attrs:{label:"Process Name",value:t.form.process_name,editable:!1}}),n(z,{attrs:{label:"Language",value:t.form.language,editable:!1}}),n(z,{attrs:{label:"Language Version",value:t.form.language_version,editable:!1}}),n(z,{attrs:{label:"Profile",value:t.form.profile,editable:!1}})],1):t._e()],1)},Tr=[],Mr=G(Pr,Ar,Tr,!1,null,"711a6720",null,null);const Ln=Mr.exports,jr={components:{AgentExecuteModule:Le},props:{value:Boolean,loading:{type:Boolean,default:!1},agent:{type:String,required:!0},moduleName:{type:String,required:!0},moduleOptionDefaults:{type:Object,default:()=>{}}},data(){return{}},computed:{show:{get(){return this.value},set(e){this.$emit("input",e)}}},methods:{async submit(){!this.$refs.executeform.validate()||(this.$refs.executeform.create(),this.show=!1)}}};var Rr=function(){var t=this,n=t._self._c;return n(je,{ref:"downloadDialog",attrs:{"max-width":"800px"},model:{value:t.show,callback:function(r){t.show=r},expression:"show"}},[n(ee,[n(Re,[n("span",{staticClass:"headline"})]),n(me,[t.show?n(Le,{ref:"executeform",attrs:{agents:[t.agent],"module-name":t.moduleName,"module-option-defaults":t.moduleOptionDefaults,"show-submit":!1},on:{submitted:t.submit}}):t._e()],1),n(Oe,[n(ue),n(Y,{attrs:{color:"error",text:""},on:{click:function(r){r.stopPropagation(),t.show=!1}}},[t._v(" Close ")]),n(Y,{attrs:{color:"primary",loading:t.loading},on:{click:t.submit}},[t._v(" Submit ")])],1)],1)],1)},Or=[],Lr=G(jr,Rr,Or,!1,null,null,null,null);const In=Lr.exports;async function _t(e=1e3){return new Promise(t=>setTimeout(t,e))}const Ir={components:{ExecuteModuleDialog:In},props:{agent:{type:Object,required:!0},readOnly:{type:Boolean,default:!1}},data(){return{files:{html:"mdi-language-html5",js:"mdi-nodejs",json:"mdi-json",md:"mdi-markdown",pdf:"mdi-file-pdf",png:"mdi-file-image",txt:"mdi-file-document-outline",xls:"mdi-file-excel",xlsx:"mdi-file-excel",ppt:"mdi-file-powerpoint",pptx:"mdi-file-powerpoint",jpg:"mdi-file-image",jpeg:"mdi-file-image",gif:"mdi-file-image",doc:"mdi-file-word",docx:"mdi-file-word"},tree:[],open:[],showMenu:!1,menuPosition:{x:0,y:0},selected:{},force:{},currentlyLoading:{},loading:!1,debouncedLoadChildren:null,executeDialog:!1,moduleName:"",moduleOptionDefaults:{}}},computed:{menuItems(){return[{id:"close",name:"Close",fileOption:!1,folderOption:!0},{id:"open",name:"Open",fileOption:!1,folderOption:!0},{id:"refresh",name:"Refresh",fileOption:!1,folderOption:!0},{id:"download",name:"Download to Empire",fileOption:!0,folderOption:!1},{id:"zip",name:"Zip Folder",fileOption:!1,folderOption:!0},{id:"upload",name:"Upload",folderOption:!0,fileOption:!1}].filter(e=>this.selected.file?e.fileOption===!0:e.folderOption===!0).filter(e=>!(e.id==="zip"&&this.agent.language!=="powershell")).filter(e=>{if(e.id==="open"){if(this.open.find(t=>t===this.selected.id))return!1}else if((e.id==="close"||e.id==="refresh")&&!this.open.find(t=>t===this.selected.id))return!1;return!0})}},watch:{agent:{handler(){this.initialize()}}},async mounted(){this.agent&&this.initialize()},methods:{async initialize(){this.debouncedLoadChildren=ir(this.loadChildren,500,{leading:!0}),this.loading=!0;try{const e=await ot(this.agent.session_id,"/");e.sort(this.sortFiles),this.tree=e.map(t=>this.transform(t))}catch{if(this.readOnly){this.loading=!1;return}const t=await this.scrapeDirectory("/");let n=0,r=0;for(;n<10;){if(await _t(6e3),await this.checkTaskComplete(t.id)){r=!0;break}n++}r||this.$snack.error("Agent didn't respond in time. Please try again later.");const i=await ot(this.agent.session_id,"/");i.sort(this.sortFiles),this.tree=i.map(a=>this.transform(a))}this.loading=!1},async clickAction(e){if(e==="open")this.open.push(this.selected.id);else if(e==="close")this.open.splice(this.open.findIndex(t=>t===this.selected.id),1);else if(e==="refresh"){this.selected.children=[];const t=this.$refs.treeview.nodes[this.selected.id];this.open.splice(this.open.findIndex(n=>n===this.selected.id),1),await Pe.nextTick(),t.vnode.hasLoaded=!1,this.force[this.selected.id]=!0,await Pe.nextTick(),this.open.push(this.selected.id)}else e==="download"?(_n(this.agent.session_id,this.selected.path),this.$snack.success(`Tasked ${this.agent.session_id} for download ${this.selected.path}`)):e==="zip"?this.prepareZip():e==="upload"&&this.$emit("openUploadDialog",{pathToFile:this.selected.path})},prepareZip(){const e={agent:this.agent.session_id,Folder:this.selected.path,ZipFileName:`${this.selected.path}\\${this.selected.path.split("\\").pop()}.zip`};this.moduleName="powershell/management/zipfolder",this.moduleOptionDefaults=e,this.executeDialog=!0},show(e,t){t.preventDefault(),this.showMenu=!1,this.menuPosition.x=t.clientX,this.menuPosition.y=t.clientY,this.selected=e,this.$nextTick(()=>{this.showMenu=!0})},transform(e){return{file:e.is_file===!0?e.name.split(".").pop():!1,...e,children:e.is_file===!1?[]:void 0}},async loadChildren(e,{stopTrying:t}={}){if(this.currentlyLoading[e.id])return Promise.resolve();this.currentlyLoading[e.id]=!0;const n=await ot(this.agent.session_id,e.id);if(n.sort(this.sortFiles),!this.force[e.id]&&n.length>0)return this.removeFromCurrentlyLoading(e.id),e.children=n.map(r=>this.transform(r)),Promise.resolve();if(!t&&!this.readOnly){console.log(t,this.readOnly),this.$snack.success(`Attempting to retrieve directory: ${e.path} with id ${e.id}`);const r=await this.scrapeDirectory(e.path);let i=0,a=!1;for(;i<10;){if(await _t(6e3),await this.checkTaskComplete(r.id)){console.log("task complete",r.id),a=!0;break}i++}return a||this.$snack.error("Agent didn't respond in time. Please try again later."),this.removeFromForce(e.id),this.removeFromCurrentlyLoading(e.id),Promise.resolve(this.loadChildren(e,{stopTrying:!0}))}return this.removeFromForce(e.id),this.removeFromCurrentlyLoading(e.id),Promise.resolve()},removeFromForce(e){this.force[e]&&delete this.force[e]},removeFromCurrentlyLoading(e){this.currentlyLoading[e]&&delete this.currentlyLoading[e]},async scrapeDirectory(e){return qi(this.agent.session_id,e)},async checkTaskComplete(e){try{return!!(await Fn(this.agent.session_id,e)).output}catch{return!1}},sortFiles(e,t){const n=e.name.toLowerCase(),r=t.name.toLowerCase();return nr?1:0}}};var zr=function(){var t=this,n=t._self._c;return t.agent.language==="ironpython"?n("div",[n(kn,{attrs:{prominent:"",type:"error"}},[n(De,{attrs:{align:"center"}},[n(ne,{staticClass:"grow"},[t._v(" The File Browser is not yet implemented for this agent language. ")])],1)],1)],1):n("div",[n(In,{attrs:{agent:t.agent.session_id,"module-name":t.moduleName,"module-option-defaults":t.moduleOptionDefaults},model:{value:t.executeDialog,callback:function(r){t.executeDialog=r},expression:"executeDialog"}}),t.loading?n(W,{staticClass:"fa-3x fas fa-spinner fa-spin",staticStyle:{width:"50px"}}):t._e(),n(Er,{ref:"treeview",attrs:{dense:"",hoverable:"","open-on-click":"","item-key":"id","load-children":t.debouncedLoadChildren,open:t.open,items:t.tree},on:{"update:open":function(r){t.open=r}},scopedSlots:t._u([{key:"label",fn:function({item:r,open:i}){return[n(Y,{staticClass:"text-left",staticStyle:{"margin-left":"-15px",width:"100%"},attrs:{text:""},on:{contextmenu:function(a){return t.show(r,a)}}},[n("div",{staticStyle:{display:"flex","justify-content":"fle -start"}},[r.file?n(W,[t._v(" "+t._s(t.files[r.file]||"mdi-file")+" ")]):n(W,[t._v(" "+t._s(i?"mdi-folder-open":"mdi-folder")+" ")]),n("span",{staticClass:"ml-2"},[t._v(t._s(r.name))])],1)])]}}])}),n(Cn,{attrs:{"position-x":t.menuPosition.x,"position-y":t.menuPosition.y,"close-on-content-click":"",absolute:"","offset-y":""},model:{value:t.showMenu,callback:function(r){t.showMenu=r},expression:"showMenu"}},[n(Hi,t._l(t.menuItems,function(r){return n(Wi,{key:r.id,on:{click:function(i){return t.clickAction(r.id)}}},[n(Ui,[t._v(t._s(r.name))])],1)}),1)],1)],1)},Nr=[],Vr=G(Ir,zr,Nr,!1,null,null,null,null);const zn=Vr.exports;var Ft={},ze={},ge={},ye={},re={exports:{}},qr=({onlyFirst:e=!1}={})=>{const t=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(t,e?void 0:"g")};const Hr=qr;var Bt=e=>typeof e=="string"?e.replace(Hr(),""):e,Ne={exports:{}};const Nn=e=>Number.isNaN(e)?!1:e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141);Ne.exports=Nn;Ne.exports.default=Nn;var Wr=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g};const Ur=Bt,Jr=Ne.exports,Yr=Wr,Vn=e=>{if(typeof e!="string"||e.length===0||(e=Ur(e),e.length===0))return 0;e=e.replace(Yr()," ");let t=0;for(let n=0;n=127&&r<=159||r>=768&&r<=879||(r>65535&&n++,t+=Jr(r)?2:1)}return t};re.exports=Vn;re.exports.default=Vn;var q={};const Qt="[\uD800-\uDBFF][\uDC00-\uDFFF]",Kr=e=>e&&e.exact?new RegExp(`^${Qt}$`):new RegExp(Qt,"g");var Gr=Kr,qn={exports:{}},ct,en;function Zr(){return en||(en=1,ct={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),ct}var dt,tn;function Hn(){if(tn)return dt;tn=1;const e=Zr(),t={};for(const i of Object.keys(e))t[e[i]]=i;const n={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};dt=n;for(const i of Object.keys(n)){if(!("channels"in n[i]))throw new Error("missing channels property: "+i);if(!("labels"in n[i]))throw new Error("missing channel labels property: "+i);if(n[i].labels.length!==n[i].channels)throw new Error("channel and label counts mismatch: "+i);const{channels:a,labels:o}=n[i];delete n[i].channels,delete n[i].labels,Object.defineProperty(n[i],"channels",{value:a}),Object.defineProperty(n[i],"labels",{value:o})}n.rgb.hsl=function(i){const a=i[0]/255,o=i[1]/255,u=i[2]/255,c=Math.min(a,o,u),d=Math.max(a,o,u),p=d-c;let f,g;d===c?f=0:a===d?f=(o-u)/p:o===d?f=2+(u-a)/p:u===d&&(f=4+(a-o)/p),f=Math.min(f*60,360),f<0&&(f+=360);const b=(c+d)/2;return d===c?g=0:b<=.5?g=p/(d+c):g=p/(2-d-c),[f,g*100,b*100]},n.rgb.hsv=function(i){let a,o,u,c,d;const p=i[0]/255,f=i[1]/255,g=i[2]/255,b=Math.max(p,f,g),_=b-Math.min(p,f,g),S=function(B){return(b-B)/6/_+1/2};return _===0?(c=0,d=0):(d=_/b,a=S(p),o=S(f),u=S(g),p===b?c=u-o:f===b?c=1/3+a-u:g===b&&(c=2/3+o-a),c<0?c+=1:c>1&&(c-=1)),[c*360,d*100,b*100]},n.rgb.hwb=function(i){const a=i[0],o=i[1];let u=i[2];const c=n.rgb.hsl(i)[0],d=1/255*Math.min(a,Math.min(o,u));return u=1-1/255*Math.max(a,Math.max(o,u)),[c,d*100,u*100]},n.rgb.cmyk=function(i){const a=i[0]/255,o=i[1]/255,u=i[2]/255,c=Math.min(1-a,1-o,1-u),d=(1-a-c)/(1-c)||0,p=(1-o-c)/(1-c)||0,f=(1-u-c)/(1-c)||0;return[d*100,p*100,f*100,c*100]};function r(i,a){return(i[0]-a[0])**2+(i[1]-a[1])**2+(i[2]-a[2])**2}return n.rgb.keyword=function(i){const a=t[i];if(a)return a;let o=1/0,u;for(const c of Object.keys(e)){const d=e[c],p=r(i,d);p.04045?((a+.055)/1.055)**2.4:a/12.92,o=o>.04045?((o+.055)/1.055)**2.4:o/12.92,u=u>.04045?((u+.055)/1.055)**2.4:u/12.92;const c=a*.4124+o*.3576+u*.1805,d=a*.2126+o*.7152+u*.0722,p=a*.0193+o*.1192+u*.9505;return[c*100,d*100,p*100]},n.rgb.lab=function(i){const a=n.rgb.xyz(i);let o=a[0],u=a[1],c=a[2];o/=95.047,u/=100,c/=108.883,o=o>.008856?o**(1/3):7.787*o+16/116,u=u>.008856?u**(1/3):7.787*u+16/116,c=c>.008856?c**(1/3):7.787*c+16/116;const d=116*u-16,p=500*(o-u),f=200*(u-c);return[d,p,f]},n.hsl.rgb=function(i){const a=i[0]/360,o=i[1]/100,u=i[2]/100;let c,d,p;if(o===0)return p=u*255,[p,p,p];u<.5?c=u*(1+o):c=u+o-u*o;const f=2*u-c,g=[0,0,0];for(let b=0;b<3;b++)d=a+1/3*-(b-1),d<0&&d++,d>1&&d--,6*d<1?p=f+(c-f)*6*d:2*d<1?p=c:3*d<2?p=f+(c-f)*(2/3-d)*6:p=f,g[b]=p*255;return g},n.hsl.hsv=function(i){const a=i[0];let o=i[1]/100,u=i[2]/100,c=o;const d=Math.max(u,.01);u*=2,o*=u<=1?u:2-u,c*=d<=1?d:2-d;const p=(u+o)/2,f=u===0?2*c/(d+c):2*o/(u+o);return[a,f*100,p*100]},n.hsv.rgb=function(i){const a=i[0]/60,o=i[1]/100;let u=i[2]/100;const c=Math.floor(a)%6,d=a-Math.floor(a),p=255*u*(1-o),f=255*u*(1-o*d),g=255*u*(1-o*(1-d));switch(u*=255,c){case 0:return[u,g,p];case 1:return[f,u,p];case 2:return[p,u,g];case 3:return[p,f,u];case 4:return[g,p,u];case 5:return[u,p,f]}},n.hsv.hsl=function(i){const a=i[0],o=i[1]/100,u=i[2]/100,c=Math.max(u,.01);let d,p;p=(2-o)*u;const f=(2-o)*c;return d=o*c,d/=f<=1?f:2-f,d=d||0,p/=2,[a,d*100,p*100]},n.hwb.rgb=function(i){const a=i[0]/360;let o=i[1]/100,u=i[2]/100;const c=o+u;let d;c>1&&(o/=c,u/=c);const p=Math.floor(6*a),f=1-u;d=6*a-p,(p&1)!==0&&(d=1-d);const g=o+d*(f-o);let b,_,S;switch(p){default:case 6:case 0:b=f,_=g,S=o;break;case 1:b=g,_=f,S=o;break;case 2:b=o,_=f,S=g;break;case 3:b=o,_=g,S=f;break;case 4:b=g,_=o,S=f;break;case 5:b=f,_=o,S=g;break}return[b*255,_*255,S*255]},n.cmyk.rgb=function(i){const a=i[0]/100,o=i[1]/100,u=i[2]/100,c=i[3]/100,d=1-Math.min(1,a*(1-c)+c),p=1-Math.min(1,o*(1-c)+c),f=1-Math.min(1,u*(1-c)+c);return[d*255,p*255,f*255]},n.xyz.rgb=function(i){const a=i[0]/100,o=i[1]/100,u=i[2]/100;let c,d,p;return c=a*3.2406+o*-1.5372+u*-.4986,d=a*-.9689+o*1.8758+u*.0415,p=a*.0557+o*-.204+u*1.057,c=c>.0031308?1.055*c**(1/2.4)-.055:c*12.92,d=d>.0031308?1.055*d**(1/2.4)-.055:d*12.92,p=p>.0031308?1.055*p**(1/2.4)-.055:p*12.92,c=Math.min(Math.max(0,c),1),d=Math.min(Math.max(0,d),1),p=Math.min(Math.max(0,p),1),[c*255,d*255,p*255]},n.xyz.lab=function(i){let a=i[0],o=i[1],u=i[2];a/=95.047,o/=100,u/=108.883,a=a>.008856?a**(1/3):7.787*a+16/116,o=o>.008856?o**(1/3):7.787*o+16/116,u=u>.008856?u**(1/3):7.787*u+16/116;const c=116*o-16,d=500*(a-o),p=200*(o-u);return[c,d,p]},n.lab.xyz=function(i){const a=i[0],o=i[1],u=i[2];let c,d,p;d=(a+16)/116,c=o/500+d,p=d-u/200;const f=d**3,g=c**3,b=p**3;return d=f>.008856?f:(d-16/116)/7.787,c=g>.008856?g:(c-16/116)/7.787,p=b>.008856?b:(p-16/116)/7.787,c*=95.047,d*=100,p*=108.883,[c,d,p]},n.lab.lch=function(i){const a=i[0],o=i[1],u=i[2];let c;c=Math.atan2(u,o)*360/2/Math.PI,c<0&&(c+=360);const p=Math.sqrt(o*o+u*u);return[a,p,c]},n.lch.lab=function(i){const a=i[0],o=i[1],c=i[2]/360*2*Math.PI,d=o*Math.cos(c),p=o*Math.sin(c);return[a,d,p]},n.rgb.ansi16=function(i,a=null){const[o,u,c]=i;let d=a===null?n.rgb.hsv(i)[2]:a;if(d=Math.round(d/50),d===0)return 30;let p=30+(Math.round(c/255)<<2|Math.round(u/255)<<1|Math.round(o/255));return d===2&&(p+=60),p},n.hsv.ansi16=function(i){return n.rgb.ansi16(n.hsv.rgb(i),i[2])},n.rgb.ansi256=function(i){const a=i[0],o=i[1],u=i[2];return a===o&&o===u?a<8?16:a>248?231:Math.round((a-8)/247*24)+232:16+36*Math.round(a/255*5)+6*Math.round(o/255*5)+Math.round(u/255*5)},n.ansi16.rgb=function(i){let a=i%10;if(a===0||a===7)return i>50&&(a+=3.5),a=a/10.5*255,[a,a,a];const o=(~~(i>50)+1)*.5,u=(a&1)*o*255,c=(a>>1&1)*o*255,d=(a>>2&1)*o*255;return[u,c,d]},n.ansi256.rgb=function(i){if(i>=232){const d=(i-232)*10+8;return[d,d,d]}i-=16;let a;const o=Math.floor(i/36)/5*255,u=Math.floor((a=i%36)/6)/5*255,c=a%6/5*255;return[o,u,c]},n.rgb.hex=function(i){const o=(((Math.round(i[0])&255)<<16)+((Math.round(i[1])&255)<<8)+(Math.round(i[2])&255)).toString(16).toUpperCase();return"000000".substring(o.length)+o},n.hex.rgb=function(i){const a=i.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!a)return[0,0,0];let o=a[0];a[0].length===3&&(o=o.split("").map(f=>f+f).join(""));const u=parseInt(o,16),c=u>>16&255,d=u>>8&255,p=u&255;return[c,d,p]},n.rgb.hcg=function(i){const a=i[0]/255,o=i[1]/255,u=i[2]/255,c=Math.max(Math.max(a,o),u),d=Math.min(Math.min(a,o),u),p=c-d;let f,g;return p<1?f=d/(1-p):f=0,p<=0?g=0:c===a?g=(o-u)/p%6:c===o?g=2+(u-a)/p:g=4+(a-o)/p,g/=6,g%=1,[g*360,p*100,f*100]},n.hsl.hcg=function(i){const a=i[1]/100,o=i[2]/100,u=o<.5?2*a*o:2*a*(1-o);let c=0;return u<1&&(c=(o-.5*u)/(1-u)),[i[0],u*100,c*100]},n.hsv.hcg=function(i){const a=i[1]/100,o=i[2]/100,u=a*o;let c=0;return u<1&&(c=(o-u)/(1-u)),[i[0],u*100,c*100]},n.hcg.rgb=function(i){const a=i[0]/360,o=i[1]/100,u=i[2]/100;if(o===0)return[u*255,u*255,u*255];const c=[0,0,0],d=a%1*6,p=d%1,f=1-p;let g=0;switch(Math.floor(d)){case 0:c[0]=1,c[1]=p,c[2]=0;break;case 1:c[0]=f,c[1]=1,c[2]=0;break;case 2:c[0]=0,c[1]=1,c[2]=p;break;case 3:c[0]=0,c[1]=f,c[2]=1;break;case 4:c[0]=p,c[1]=0,c[2]=1;break;default:c[0]=1,c[1]=0,c[2]=f}return g=(1-o)*u,[(o*c[0]+g)*255,(o*c[1]+g)*255,(o*c[2]+g)*255]},n.hcg.hsv=function(i){const a=i[1]/100,o=i[2]/100,u=a+o*(1-a);let c=0;return u>0&&(c=a/u),[i[0],c*100,u*100]},n.hcg.hsl=function(i){const a=i[1]/100,u=i[2]/100*(1-a)+.5*a;let c=0;return u>0&&u<.5?c=a/(2*u):u>=.5&&u<1&&(c=a/(2*(1-u))),[i[0],c*100,u*100]},n.hcg.hwb=function(i){const a=i[1]/100,o=i[2]/100,u=a+o*(1-a);return[i[0],(u-a)*100,(1-u)*100]},n.hwb.hcg=function(i){const a=i[1]/100,u=1-i[2]/100,c=u-a;let d=0;return c<1&&(d=(u-c)/(1-c)),[i[0],c*100,d*100]},n.apple.rgb=function(i){return[i[0]/65535*255,i[1]/65535*255,i[2]/65535*255]},n.rgb.apple=function(i){return[i[0]/255*65535,i[1]/255*65535,i[2]/255*65535]},n.gray.rgb=function(i){return[i[0]/100*255,i[0]/100*255,i[0]/100*255]},n.gray.hsl=function(i){return[0,0,i[0]]},n.gray.hsv=n.gray.hsl,n.gray.hwb=function(i){return[0,100,i[0]]},n.gray.cmyk=function(i){return[0,0,0,i[0]]},n.gray.lab=function(i){return[i[0],0,0]},n.gray.hex=function(i){const a=Math.round(i[0]/100*255)&255,u=((a<<16)+(a<<8)+a).toString(16).toUpperCase();return"000000".substring(u.length)+u},n.rgb.gray=function(i){return[(i[0]+i[1]+i[2])/3/255*100]},dt}var ht,nn;function Xr(){if(nn)return ht;nn=1;const e=Hn();function t(){const a={},o=Object.keys(e);for(let u=o.length,c=0;c1&&(c=d),o(c))};return"conversion"in o&&(u.conversion=o.conversion),u}function a(o){const u=function(...c){const d=c[0];if(d==null)return d;d.length>1&&(c=d);const p=o(c);if(typeof p=="object")for(let f=p.length,g=0;g{n[o]={},Object.defineProperty(n[o],"channels",{value:e[o].channels}),Object.defineProperty(n[o],"labels",{value:e[o].labels});const u=t(o);Object.keys(u).forEach(d=>{const p=u[d];n[o][d]=a(p),n[o][d].raw=i(p)})}),pt=n,pt}(function(e){const t=(p,f)=>(...g)=>`\x1B[${p(...g)+f}m`,n=(p,f)=>(...g)=>{const b=p(...g);return`\x1B[${38+f};5;${b}m`},r=(p,f)=>(...g)=>{const b=p(...g);return`\x1B[${38+f};2;${b[0]};${b[1]};${b[2]}m`},i=p=>p,a=(p,f,g)=>[p,f,g],o=(p,f,g)=>{Object.defineProperty(p,f,{get:()=>{const b=g();return Object.defineProperty(p,f,{value:b,enumerable:!0,configurable:!0}),b},enumerable:!0,configurable:!0})};let u;const c=(p,f,g,b)=>{u===void 0&&(u=Qr());const _=b?10:0,S={};for(const[B,M]of Object.entries(u)){const j=B==="ansi16"?"ansi":B;B===f?S[j]=p(g,_):typeof M=="object"&&(S[j]=p(M[f],_))}return S};function d(){const p=new Map,f={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};f.color.gray=f.color.blackBright,f.bgColor.bgGray=f.bgColor.bgBlackBright,f.color.grey=f.color.blackBright,f.bgColor.bgGrey=f.bgColor.bgBlackBright;for(const[g,b]of Object.entries(f)){for(const[_,S]of Object.entries(b))f[_]={open:`\x1B[${S[0]}m`,close:`\x1B[${S[1]}m`},b[_]=f[_],p.set(S[0],S[1]);Object.defineProperty(f,g,{value:b,enumerable:!1})}return Object.defineProperty(f,"codes",{value:p,enumerable:!1}),f.color.close="\x1B[39m",f.bgColor.close="\x1B[49m",o(f.color,"ansi",()=>c(t,"ansi16",i,!1)),o(f.color,"ansi256",()=>c(n,"ansi256",i,!1)),o(f.color,"ansi16m",()=>c(r,"rgb",a,!1)),o(f.bgColor,"ansi",()=>c(t,"ansi16",i,!0)),o(f.bgColor,"ansi256",()=>c(n,"ansi256",i,!0)),o(f.bgColor,"ansi16m",()=>c(r,"rgb",a,!0)),f}Object.defineProperty(e,"exports",{enumerable:!0,get:d})})(qn);const es=Ne.exports,ts=Gr,sn=qn.exports,Wn=["\x1B","\x9B"],$e=e=>`${Wn[0]}[${e}m`,an=(e,t,n)=>{let r=[];e=[...e];for(let i of e){const a=i;i.includes(";")&&(i=i.split(";")[0][0]+"0");const o=sn.codes.get(Number.parseInt(i,10));if(o){const u=e.indexOf(o.toString());u===-1?r.push($e(t?o:a)):e.splice(u,1)}else if(t){r.push($e(0));break}else r.push($e(a))}if(t&&(r=r.filter((i,a)=>r.indexOf(i)===a),n!==void 0)){const i=$e(sn.codes.get(Number.parseInt(n,10)));r=r.reduce((a,o)=>o===i?[o,...a]:[...a,o],[])}return r.join("")};var Pt=(e,t,n)=>{const r=[...e],i=[];let a=typeof n=="number"?n:r.length,o=!1,u,c=0,d="";for(const[p,f]of r.entries()){let g=!1;if(Wn.includes(f)){const b=/\d[^m]*/.exec(e.slice(p,p+18));u=b&&b.length>0?b[0]:void 0,ct&&c<=a)d+=f;else if(c===t&&!o&&u!==void 0)d=an(i);else if(c>=a){d+=an(i,!0,u);break}}return d},be={};Object.defineProperty(be,"__esModule",{value:!0});be.getBorderCharacters=void 0;const ns=e=>{if(e==="honeywell")return{topBody:"\u2550",topJoin:"\u2564",topLeft:"\u2554",topRight:"\u2557",bottomBody:"\u2550",bottomJoin:"\u2567",bottomLeft:"\u255A",bottomRight:"\u255D",bodyLeft:"\u2551",bodyRight:"\u2551",bodyJoin:"\u2502",headerJoin:"\u252C",joinBody:"\u2500",joinLeft:"\u255F",joinRight:"\u2562",joinJoin:"\u253C",joinMiddleDown:"\u252C",joinMiddleUp:"\u2534",joinMiddleLeft:"\u2524",joinMiddleRight:"\u251C"};if(e==="norc")return{topBody:"\u2500",topJoin:"\u252C",topLeft:"\u250C",topRight:"\u2510",bottomBody:"\u2500",bottomJoin:"\u2534",bottomLeft:"\u2514",bottomRight:"\u2518",bodyLeft:"\u2502",bodyRight:"\u2502",bodyJoin:"\u2502",headerJoin:"\u252C",joinBody:"\u2500",joinLeft:"\u251C",joinRight:"\u2524",joinJoin:"\u253C",joinMiddleDown:"\u252C",joinMiddleUp:"\u2534",joinMiddleLeft:"\u2524",joinMiddleRight:"\u251C"};if(e==="ramac")return{topBody:"-",topJoin:"+",topLeft:"+",topRight:"+",bottomBody:"-",bottomJoin:"+",bottomLeft:"+",bottomRight:"+",bodyLeft:"|",bodyRight:"|",bodyJoin:"|",headerJoin:"+",joinBody:"-",joinLeft:"|",joinRight:"|",joinJoin:"|",joinMiddleDown:"+",joinMiddleUp:"+",joinMiddleLeft:"+",joinMiddleRight:"+"};if(e==="void")return{topBody:"",topJoin:"",topLeft:"",topRight:"",bottomBody:"",bottomJoin:"",bottomLeft:"",bottomRight:"",bodyLeft:"",bodyRight:"",bodyJoin:"",headerJoin:"",joinBody:"",joinLeft:"",joinRight:"",joinJoin:"",joinMiddleDown:"",joinMiddleUp:"",joinMiddleLeft:"",joinMiddleRight:""};throw new Error('Unknown border template "'+e+'".')};be.getBorderCharacters=ns;(function(e){var t=I&&I.__importDefault||function(F){return F&&F.__esModule?F:{default:F}};Object.defineProperty(e,"__esModule",{value:!0}),e.isCellInRange=e.areCellEqual=e.calculateRangeCoordinate=e.findOriginalRowIndex=e.flatten=e.extractTruncates=e.sumArray=e.sequence=e.distributeUnevenly=e.countSpaceSequence=e.groupBySizes=e.makeBorderConfig=e.splitAnsi=e.normalizeString=void 0;const n=t(Pt),r=t(re.exports),i=t(Bt),a=be,o=F=>F.replace(/\r\n/g,` +`);e.normalizeString=o;const u=F=>{const l=(0,i.default)(F).split(` +`).map(r.default),m=[];let A=0;return l.forEach(T=>{m.push(T===0?"":(0,n.default)(F,A,A+T)),A+=T+1}),m};e.splitAnsi=u;const c=F=>({...(0,a.getBorderCharacters)("honeywell"),...F});e.makeBorderConfig=c;const d=(F,l)=>{let m=0;return l.map(A=>{const T=F.slice(m,m+A);return m+=A,T})};e.groupBySizes=d;const p=F=>{var l,m;return(m=(l=F.match(/\s+/g))===null||l===void 0?void 0:l.length)!==null&&m!==void 0?m:0};e.countSpaceSequence=p;const f=(F,l)=>Array.from({length:l}).fill(Math.floor(F/l)).map((A,T)=>A+(TArray.from({length:l-F+1},(m,A)=>A+F);e.sequence=g;const b=F=>F.reduce((l,m)=>l+m,0);e.sumArray=b;const _=F=>F.columns.map(({truncate:l})=>l);e.extractTruncates=_;const S=F=>[].concat(...F);e.flatten=S;const B=(F,l)=>(0,e.flatten)(F.map((A,T)=>Array.from({length:A},()=>T)))[l];e.findOriginalRowIndex=B;const M=F=>{const{row:l,col:m,colSpan:A=1,rowSpan:T=1}=F;return{bottomRight:{col:m+A-1,row:l+T-1},topLeft:{col:m,row:l}}};e.calculateRangeCoordinate=M;const j=(F,l)=>F.row===l.row&&F.col===l.col;e.areCellEqual=j;const H=(F,{topLeft:l,bottomRight:m})=>l.row<=F.row&&F.row<=m.row&&l.col<=F.col&&F.col<=m.col;e.isCellInRange=H})(q);var is=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ye,"__esModule",{value:!0});ye.alignString=void 0;const rs=is(re.exports),on=q,kt=(e,t)=>e+" ".repeat(t),ss=(e,t)=>" ".repeat(t)+e,as=(e,t)=>" ".repeat(Math.floor(t/2))+e+" ".repeat(Math.ceil(t/2)),os=(e,t)=>{const n=(0,on.countSpaceSequence)(e);if(n===0)return kt(e,t);const r=(0,on.distributeUnevenly)(t,n);if(Math.max(...r)>3)return kt(e,t);let i=0;return e.replace(/\s+/g,a=>a+" ".repeat(r[i++]))},ls=(e,t,n)=>{const r=(0,rs.default)(e);if(r===t)return e;if(r>t)throw new Error("Subject parameter value width cannot be greater than the container width.");if(r===0)return" ".repeat(t);const i=t-r;return n==="left"?kt(e,i):n==="right"?ss(e,i):n==="justify"?os(e,i):as(e,i)};ye.alignString=ls;Object.defineProperty(ge,"__esModule",{value:!0});ge.alignTableData=void 0;const us=ye,cs=(e,t)=>e.map((n,r)=>n.map((i,a)=>{var o;const{width:u,alignment:c}=t.columns[a];return((o=t.spanningCellManager)===null||o===void 0?void 0:o.getContainingRange({col:a,row:r},{mapped:!0}))?i:(0,us.alignString)(i,u,c)}));ge.alignTableData=cs;var ve={},Ve={},ce={},qe={},Un=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(qe,"__esModule",{value:!0});qe.wrapString=void 0;const ln=Un(Pt),ds=Un(re.exports),hs=(e,t)=>{let n=e;const r=[];do r.push((0,ln.default)(n,0,t)),n=(0,ln.default)(n,t).trim();while((0,ds.default)(n));return r};qe.wrapString=hs;var He={},Jn=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(He,"__esModule",{value:!0});He.wrapWord=void 0;const ps=Jn(Pt),fs=Jn(Bt),ms=(e,t)=>{let n=(0,fs.default)(e);const r=[],i=new RegExp("(^.{1,"+String(Math.max(t,1))+"}(\\s+|$))|(^.{1,"+String(Math.max(t-1,1))+"}(\\\\|/|_|\\.|,|;|-))");do{let a;const o=i.exec(n);if(o){a=o[0],n=n.slice(a.length);const u=a.trim().length,c=a.length-u;r.push([u,c])}else a=n.slice(0,t),n=n.slice(t),r.push([a.length,0])}while(n.length);return r},Ds=(e,t)=>{const n=[];let r=0;return ms(e,t).forEach(([i,a])=>{n.push((0,ps.default)(e,r,r+i)),r+=i+a}),n};He.wrapWord=Ds;Object.defineProperty(ce,"__esModule",{value:!0});ce.wrapCell=void 0;const gs=q,ys=qe,bs=He,vs=(e,t,n)=>{const r=(0,gs.splitAnsi)(e);for(let i=0;i(0,Cs.wrapCell)(e,t,n).length;Ve.calculateCellHeight=ws;Object.defineProperty(ve,"__esModule",{value:!0});ve.calculateRowHeights=void 0;const _s=Ve,un=q,Fs=(e,t)=>{const n=[];for(const[r,i]of e.entries()){let a=1;i.forEach((o,u)=>{var c;const d=(c=t.spanningCellManager)===null||c===void 0?void 0:c.getContainingRange({col:u,row:r});if(!d){const b=(0,_s.calculateCellHeight)(o,t.columns[u].width,t.columns[u].wrapWord);a=Math.max(a,b);return}const{topLeft:p,bottomRight:f,height:g}=d;if(r===f.row){const b=(0,un.sumArray)(n.slice(p.row)),_=f.row-p.row,S=(0,un.sequence)(p.row+1,f.row).filter(M=>{var j;return!(!((j=t.drawHorizontalLine)===null||j===void 0)&&j.call(t,M,e.length))}).length,B=g-b-_+S;a=Math.max(a,B)}}),n.push(a)}return n};ve.calculateRowHeights=Fs;var At={},de={};Object.defineProperty(de,"__esModule",{value:!0});de.drawContent=void 0;const ks=e=>{const{contents:t,separatorGetter:n,drawSeparator:r,spanningCellManager:i,rowIndex:a,elementType:o}=e,u=t.length,c=[];return r(0,u)&&c.push(n(0,u)),t.forEach((d,p)=>{if((!o||o==="border"||o==="row")&&c.push(d),o==="cell"&&a===void 0&&c.push(d),o==="cell"&&a!==void 0){const f=i==null?void 0:i.getContainingRange({col:p,row:a});(!f||p===f.topLeft.col)&&c.push(d)}if(p+1{const{separator:f,horizontalBorderIndex:g,spanningCellManager:b}=p;return d.map((_,S)=>{const B=f.body.repeat(_);if(g===void 0)return B;const M=b==null?void 0:b.getContainingRange({col:S,row:g});if(!M)return B;const{topLeft:j}=M;return g===j.row?B:S!==j.col?"":M.extractBorderContent(g)})};e.drawBorderSegments=n;const r=d=>{const{separator:p,spanningCellManager:f,horizontalBorderIndex:g,rowCount:b}=d;return(_,S)=>{const B=f==null?void 0:f.inSameRange;if(g!==void 0&&B){const M={col:_,row:g-1},j={col:_-1,row:g},H={col:_-1,row:g-1},F={col:_,row:g},l=[[H,M],[M,F],[F,j],[j,H]];if(_===0)return B(F,M)&&p.bodyJoinOuter?p.bodyJoinOuter:p.left;if(_===S)return B(H,j)&&p.bodyJoinOuter?p.bodyJoinOuter:p.right;if(g===0)return B(F,j)?p.body:p.join;if(g===b)return B(M,H)?p.body:p.join;const m=l.map(A=>B(...A)).filter(Boolean).length;if(m===0)return p.join;if(m===4)return"";if(m===2)return B(...l[1])&&B(...l[3])&&p.bodyJoinInner?p.bodyJoinInner:p.body;if(m===1){if(!p.joinRight||!p.joinLeft||!p.joinUp||!p.joinDown)throw new Error(`Can not get border separator for position [${g}, ${_}]`);return B(...l[0])?p.joinDown:B(...l[1])?p.joinLeft:B(...l[2])?p.joinUp:p.joinRight}throw new Error("Invalid case")}return _===0?p.left:_===S?p.right:p.join}};e.createSeparatorGetter=r;const i=(d,p)=>{const f=(0,e.drawBorderSegments)(d,p),{drawVerticalLine:g,horizontalBorderIndex:b,spanningCellManager:_}=p;return(0,t.drawContent)({contents:f,drawSeparator:g,elementType:"border",rowIndex:b,separatorGetter:(0,e.createSeparatorGetter)(p),spanningCellManager:_})+` +`};e.drawBorder=i;const a=(d,p)=>{const{border:f}=p,g=(0,e.drawBorder)(d,{...p,separator:{body:f.topBody,join:f.topJoin,left:f.topLeft,right:f.topRight}});return g===` +`?"":g};e.drawBorderTop=a;const o=(d,p)=>{const{border:f}=p;return(0,e.drawBorder)(d,{...p,separator:{body:f.joinBody,bodyJoinInner:f.bodyJoin,bodyJoinOuter:f.bodyLeft,join:f.joinJoin,joinDown:f.joinMiddleDown,joinLeft:f.joinMiddleLeft,joinRight:f.joinMiddleRight,joinUp:f.joinMiddleUp,left:f.joinLeft,right:f.joinRight}})};e.drawBorderJoin=o;const u=(d,p)=>{const{border:f}=p;return(0,e.drawBorder)(d,{...p,separator:{body:f.bottomBody,join:f.bottomJoin,left:f.bottomLeft,right:f.bottomRight}})};e.drawBorderBottom=u;const c=(d,p)=>(f,g)=>{const b={...p,horizontalBorderIndex:f};return f===0?(0,e.drawBorderTop)(d,b):f===g?(0,e.drawBorderBottom)(d,b):(0,e.drawBorderJoin)(d,b)};e.createTableBorderGetter=c})(At);var Ce={};Object.defineProperty(Ce,"__esModule",{value:!0});Ce.drawRow=void 0;const Es=de,$s=(e,t)=>{const{border:n,drawVerticalLine:r,rowIndex:i,spanningCellManager:a}=t;return(0,Es.drawContent)({contents:e,drawSeparator:r,elementType:"cell",rowIndex:i,separatorGetter:(o,u)=>o===0?n.bodyLeft:o===u?n.bodyRight:n.bodyJoin,spanningCellManager:a})+` +`};Ce.drawRow=$s;var We={},we={},Yn={},Tt={},Ss=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n};Object.defineProperty(Tt,"__esModule",{value:!0});const Kn=Ss;Kn.code='require("ajv/dist/runtime/equal").default';Tt.default=Kn;(function(e){e["config.json"]=B;const t={$id:"config.json",$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{border:{$ref:"shared.json#/definitions/borders"},header:{type:"object",properties:{content:{type:"string"},alignment:{$ref:"shared.json#/definitions/alignment"},wrapWord:{type:"boolean"},truncate:{type:"integer"},paddingLeft:{type:"integer"},paddingRight:{type:"integer"}},required:["content"],additionalProperties:!1},columns:{$ref:"shared.json#/definitions/columns"},columnDefault:{$ref:"shared.json#/definitions/column"},drawVerticalLine:{typeof:"function"},drawHorizontalLine:{typeof:"function"},singleLine:{typeof:"boolean"},spanningCells:{type:"array",items:{type:"object",properties:{col:{type:"integer",minimum:0},row:{type:"integer",minimum:0},colSpan:{type:"integer",minimum:1},rowSpan:{type:"integer",minimum:1},alignment:{$ref:"shared.json#/definitions/alignment"},verticalAlignment:{$ref:"shared.json#/definitions/verticalAlignment"},wrapWord:{type:"boolean"},truncate:{type:"integer"},paddingLeft:{type:"integer"},paddingRight:{type:"integer"}},required:["row","col"],additionalProperties:!1}}},additionalProperties:!1},n={type:"object",properties:{topBody:{$ref:"#/definitions/border"},topJoin:{$ref:"#/definitions/border"},topLeft:{$ref:"#/definitions/border"},topRight:{$ref:"#/definitions/border"},bottomBody:{$ref:"#/definitions/border"},bottomJoin:{$ref:"#/definitions/border"},bottomLeft:{$ref:"#/definitions/border"},bottomRight:{$ref:"#/definitions/border"},bodyLeft:{$ref:"#/definitions/border"},bodyRight:{$ref:"#/definitions/border"},bodyJoin:{$ref:"#/definitions/border"},headerJoin:{$ref:"#/definitions/border"},joinBody:{$ref:"#/definitions/border"},joinLeft:{$ref:"#/definitions/border"},joinRight:{$ref:"#/definitions/border"},joinJoin:{$ref:"#/definitions/border"},joinMiddleUp:{$ref:"#/definitions/border"},joinMiddleDown:{$ref:"#/definitions/border"},joinMiddleLeft:{$ref:"#/definitions/border"},joinMiddleRight:{$ref:"#/definitions/border"}},additionalProperties:!1},r=Object.prototype.hasOwnProperty;function i(l,{instancePath:m="",parentData:A,parentDataProperty:T,rootData:C=l}={}){let s=null,D=0;if(typeof l!="string"){const h={instancePath:m,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[h]:s.push(h),D++}return i.errors=s,D===0}function a(l,{instancePath:m="",parentData:A,parentDataProperty:T,rootData:C=l}={}){let s=null,D=0;if(l&&typeof l=="object"&&!Array.isArray(l)){for(const h in l)if(!r.call(n.properties,h)){const y={instancePath:m,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:h},message:"must NOT have additional properties"};s===null?s=[y]:s.push(y),D++}l.topBody!==void 0&&(i(l.topBody,{instancePath:m+"/topBody",parentData:l,parentDataProperty:"topBody",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.topJoin!==void 0&&(i(l.topJoin,{instancePath:m+"/topJoin",parentData:l,parentDataProperty:"topJoin",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.topLeft!==void 0&&(i(l.topLeft,{instancePath:m+"/topLeft",parentData:l,parentDataProperty:"topLeft",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.topRight!==void 0&&(i(l.topRight,{instancePath:m+"/topRight",parentData:l,parentDataProperty:"topRight",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.bottomBody!==void 0&&(i(l.bottomBody,{instancePath:m+"/bottomBody",parentData:l,parentDataProperty:"bottomBody",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.bottomJoin!==void 0&&(i(l.bottomJoin,{instancePath:m+"/bottomJoin",parentData:l,parentDataProperty:"bottomJoin",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.bottomLeft!==void 0&&(i(l.bottomLeft,{instancePath:m+"/bottomLeft",parentData:l,parentDataProperty:"bottomLeft",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.bottomRight!==void 0&&(i(l.bottomRight,{instancePath:m+"/bottomRight",parentData:l,parentDataProperty:"bottomRight",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.bodyLeft!==void 0&&(i(l.bodyLeft,{instancePath:m+"/bodyLeft",parentData:l,parentDataProperty:"bodyLeft",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.bodyRight!==void 0&&(i(l.bodyRight,{instancePath:m+"/bodyRight",parentData:l,parentDataProperty:"bodyRight",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.bodyJoin!==void 0&&(i(l.bodyJoin,{instancePath:m+"/bodyJoin",parentData:l,parentDataProperty:"bodyJoin",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.headerJoin!==void 0&&(i(l.headerJoin,{instancePath:m+"/headerJoin",parentData:l,parentDataProperty:"headerJoin",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.joinBody!==void 0&&(i(l.joinBody,{instancePath:m+"/joinBody",parentData:l,parentDataProperty:"joinBody",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.joinLeft!==void 0&&(i(l.joinLeft,{instancePath:m+"/joinLeft",parentData:l,parentDataProperty:"joinLeft",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.joinRight!==void 0&&(i(l.joinRight,{instancePath:m+"/joinRight",parentData:l,parentDataProperty:"joinRight",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.joinJoin!==void 0&&(i(l.joinJoin,{instancePath:m+"/joinJoin",parentData:l,parentDataProperty:"joinJoin",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.joinMiddleUp!==void 0&&(i(l.joinMiddleUp,{instancePath:m+"/joinMiddleUp",parentData:l,parentDataProperty:"joinMiddleUp",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.joinMiddleDown!==void 0&&(i(l.joinMiddleDown,{instancePath:m+"/joinMiddleDown",parentData:l,parentDataProperty:"joinMiddleDown",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.joinMiddleLeft!==void 0&&(i(l.joinMiddleLeft,{instancePath:m+"/joinMiddleLeft",parentData:l,parentDataProperty:"joinMiddleLeft",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.joinMiddleRight!==void 0&&(i(l.joinMiddleRight,{instancePath:m+"/joinMiddleRight",parentData:l,parentDataProperty:"joinMiddleRight",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length))}else{const h={instancePath:m,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[h]:s.push(h),D++}return a.errors=s,D===0}const o={type:"string",enum:["left","right","center","justify"]};Tt.default;function u(l,{instancePath:m="",parentData:A,parentDataProperty:T,rootData:C=l}={}){let s=null,D=0;if(typeof l!="string"){const h={instancePath:m,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[h]:s.push(h),D++}if(!(l==="left"||l==="right"||l==="center"||l==="justify")){const h={instancePath:m,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:o.enum},message:"must be equal to one of the allowed values"};s===null?s=[h]:s.push(h),D++}return u.errors=s,D===0}const c=new RegExp("^[0-9]+$","u");function d(l,{instancePath:m="",parentData:A,parentDataProperty:T,rootData:C=l}={}){let s=null,D=0;if(typeof l!="string"){const h={instancePath:m,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[h]:s.push(h),D++}if(!(l==="left"||l==="right"||l==="center"||l==="justify")){const h={instancePath:m,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:o.enum},message:"must be equal to one of the allowed values"};s===null?s=[h]:s.push(h),D++}return d.errors=s,D===0}const p={type:"string",enum:["top","middle","bottom"]};function f(l,{instancePath:m="",parentData:A,parentDataProperty:T,rootData:C=l}={}){let s=null,D=0;if(typeof l!="string"){const h={instancePath:m,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[h]:s.push(h),D++}if(!(l==="top"||l==="middle"||l==="bottom")){const h={instancePath:m,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:p.enum},message:"must be equal to one of the allowed values"};s===null?s=[h]:s.push(h),D++}return f.errors=s,D===0}function g(l,{instancePath:m="",parentData:A,parentDataProperty:T,rootData:C=l}={}){let s=null,D=0;if(l&&typeof l=="object"&&!Array.isArray(l)){for(const h in l)if(!(h==="alignment"||h==="verticalAlignment"||h==="width"||h==="wrapWord"||h==="truncate"||h==="paddingLeft"||h==="paddingRight")){const y={instancePath:m,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:h},message:"must NOT have additional properties"};s===null?s=[y]:s.push(y),D++}if(l.alignment!==void 0&&(d(l.alignment,{instancePath:m+"/alignment",parentData:l,parentDataProperty:"alignment",rootData:C})||(s=s===null?d.errors:s.concat(d.errors),D=s.length)),l.verticalAlignment!==void 0&&(f(l.verticalAlignment,{instancePath:m+"/verticalAlignment",parentData:l,parentDataProperty:"verticalAlignment",rootData:C})||(s=s===null?f.errors:s.concat(f.errors),D=s.length)),l.width!==void 0){let h=l.width;if(!(typeof h=="number"&&!(h%1)&&!isNaN(h)&&isFinite(h))){const y={instancePath:m+"/width",schemaPath:"#/properties/width/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[y]:s.push(y),D++}if(typeof h=="number"&&isFinite(h)&&(h<1||isNaN(h))){const y={instancePath:m+"/width",schemaPath:"#/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};s===null?s=[y]:s.push(y),D++}}if(l.wrapWord!==void 0&&typeof l.wrapWord!="boolean"){const h={instancePath:m+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};s===null?s=[h]:s.push(h),D++}if(l.truncate!==void 0){let h=l.truncate;if(!(typeof h=="number"&&!(h%1)&&!isNaN(h)&&isFinite(h))){const y={instancePath:m+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[y]:s.push(y),D++}}if(l.paddingLeft!==void 0){let h=l.paddingLeft;if(!(typeof h=="number"&&!(h%1)&&!isNaN(h)&&isFinite(h))){const y={instancePath:m+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[y]:s.push(y),D++}}if(l.paddingRight!==void 0){let h=l.paddingRight;if(!(typeof h=="number"&&!(h%1)&&!isNaN(h)&&isFinite(h))){const y={instancePath:m+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[y]:s.push(y),D++}}}else{const h={instancePath:m,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[h]:s.push(h),D++}return g.errors=s,D===0}function b(l,{instancePath:m="",parentData:A,parentDataProperty:T,rootData:C=l}={}){let s=null,D=0;const h=D;let y=!1,k=null;const P=D;if(l&&typeof l=="object"&&!Array.isArray(l)){for(const x in l)if(!c.test(x)){const V={instancePath:m,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:x},message:"must NOT have additional properties"};s===null?s=[V]:s.push(V),D++}for(const x in l)c.test(x)&&(g(l[x],{instancePath:m+"/"+x.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:l,parentDataProperty:x,rootData:C})||(s=s===null?g.errors:s.concat(g.errors),D=s.length))}else{const x={instancePath:m,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[x]:s.push(x),D++}var E=P===D;E&&(y=!0,k=0);const w=D;if(Array.isArray(l)){const x=l.length;for(let V=0;V=",limit:1},message:"must be >= 1"};s===null?s=[y]:s.push(y),D++}}if(l.wrapWord!==void 0&&typeof l.wrapWord!="boolean"){const h={instancePath:m+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};s===null?s=[h]:s.push(h),D++}if(l.truncate!==void 0){let h=l.truncate;if(!(typeof h=="number"&&!(h%1)&&!isNaN(h)&&isFinite(h))){const y={instancePath:m+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[y]:s.push(y),D++}}if(l.paddingLeft!==void 0){let h=l.paddingLeft;if(!(typeof h=="number"&&!(h%1)&&!isNaN(h)&&isFinite(h))){const y={instancePath:m+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[y]:s.push(y),D++}}if(l.paddingRight!==void 0){let h=l.paddingRight;if(!(typeof h=="number"&&!(h%1)&&!isNaN(h)&&isFinite(h))){const y={instancePath:m+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[y]:s.push(y),D++}}}else{const h={instancePath:m,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[h]:s.push(h),D++}return _.errors=s,D===0}function S(l,{instancePath:m="",parentData:A,parentDataProperty:T,rootData:C=l}={}){let s=null,D=0;if(typeof l!="string"){const h={instancePath:m,schemaPath:"#/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[h]:s.push(h),D++}if(!(l==="top"||l==="middle"||l==="bottom")){const h={instancePath:m,schemaPath:"#/enum",keyword:"enum",params:{allowedValues:p.enum},message:"must be equal to one of the allowed values"};s===null?s=[h]:s.push(h),D++}return S.errors=s,D===0}function B(l,{instancePath:m="",parentData:A,parentDataProperty:T,rootData:C=l}={}){let s=null,D=0;if(l&&typeof l=="object"&&!Array.isArray(l)){for(const h in l)if(!(h==="border"||h==="header"||h==="columns"||h==="columnDefault"||h==="drawVerticalLine"||h==="drawHorizontalLine"||h==="singleLine"||h==="spanningCells")){const y={instancePath:m,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:h},message:"must NOT have additional properties"};s===null?s=[y]:s.push(y),D++}if(l.border!==void 0&&(a(l.border,{instancePath:m+"/border",parentData:l,parentDataProperty:"border",rootData:C})||(s=s===null?a.errors:s.concat(a.errors),D=s.length)),l.header!==void 0){let h=l.header;if(h&&typeof h=="object"&&!Array.isArray(h)){if(h.content===void 0){const y={instancePath:m+"/header",schemaPath:"#/properties/header/required",keyword:"required",params:{missingProperty:"content"},message:"must have required property 'content'"};s===null?s=[y]:s.push(y),D++}for(const y in h)if(!(y==="content"||y==="alignment"||y==="wrapWord"||y==="truncate"||y==="paddingLeft"||y==="paddingRight")){const k={instancePath:m+"/header",schemaPath:"#/properties/header/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:y},message:"must NOT have additional properties"};s===null?s=[k]:s.push(k),D++}if(h.content!==void 0&&typeof h.content!="string"){const y={instancePath:m+"/header/content",schemaPath:"#/properties/header/properties/content/type",keyword:"type",params:{type:"string"},message:"must be string"};s===null?s=[y]:s.push(y),D++}if(h.alignment!==void 0&&(u(h.alignment,{instancePath:m+"/header/alignment",parentData:h,parentDataProperty:"alignment",rootData:C})||(s=s===null?u.errors:s.concat(u.errors),D=s.length)),h.wrapWord!==void 0&&typeof h.wrapWord!="boolean"){const y={instancePath:m+"/header/wrapWord",schemaPath:"#/properties/header/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};s===null?s=[y]:s.push(y),D++}if(h.truncate!==void 0){let y=h.truncate;if(!(typeof y=="number"&&!(y%1)&&!isNaN(y)&&isFinite(y))){const k={instancePath:m+"/header/truncate",schemaPath:"#/properties/header/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[k]:s.push(k),D++}}if(h.paddingLeft!==void 0){let y=h.paddingLeft;if(!(typeof y=="number"&&!(y%1)&&!isNaN(y)&&isFinite(y))){const k={instancePath:m+"/header/paddingLeft",schemaPath:"#/properties/header/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[k]:s.push(k),D++}}if(h.paddingRight!==void 0){let y=h.paddingRight;if(!(typeof y=="number"&&!(y%1)&&!isNaN(y)&&isFinite(y))){const k={instancePath:m+"/header/paddingRight",schemaPath:"#/properties/header/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[k]:s.push(k),D++}}}else{const y={instancePath:m+"/header",schemaPath:"#/properties/header/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[y]:s.push(y),D++}}if(l.columns!==void 0&&(b(l.columns,{instancePath:m+"/columns",parentData:l,parentDataProperty:"columns",rootData:C})||(s=s===null?b.errors:s.concat(b.errors),D=s.length)),l.columnDefault!==void 0&&(_(l.columnDefault,{instancePath:m+"/columnDefault",parentData:l,parentDataProperty:"columnDefault",rootData:C})||(s=s===null?_.errors:s.concat(_.errors),D=s.length)),l.drawVerticalLine!==void 0&&typeof l.drawVerticalLine!="function"){const h={instancePath:m+"/drawVerticalLine",schemaPath:"#/properties/drawVerticalLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};s===null?s=[h]:s.push(h),D++}if(l.drawHorizontalLine!==void 0&&typeof l.drawHorizontalLine!="function"){const h={instancePath:m+"/drawHorizontalLine",schemaPath:"#/properties/drawHorizontalLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};s===null?s=[h]:s.push(h),D++}if(l.singleLine!==void 0&&typeof l.singleLine!="boolean"){const h={instancePath:m+"/singleLine",schemaPath:"#/properties/singleLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};s===null?s=[h]:s.push(h),D++}if(l.spanningCells!==void 0){let h=l.spanningCells;if(Array.isArray(h)){const y=h.length;for(let k=0;k=",limit:0},message:"must be >= 0"};s===null?s=[E]:s.push(E),D++}}if(P.row!==void 0){let w=P.row;if(!(typeof w=="number"&&!(w%1)&&!isNaN(w)&&isFinite(w))){const E={instancePath:m+"/spanningCells/"+k+"/row",schemaPath:"#/properties/spanningCells/items/properties/row/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[E]:s.push(E),D++}if(typeof w=="number"&&isFinite(w)&&(w<0||isNaN(w))){const E={instancePath:m+"/spanningCells/"+k+"/row",schemaPath:"#/properties/spanningCells/items/properties/row/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};s===null?s=[E]:s.push(E),D++}}if(P.colSpan!==void 0){let w=P.colSpan;if(!(typeof w=="number"&&!(w%1)&&!isNaN(w)&&isFinite(w))){const E={instancePath:m+"/spanningCells/"+k+"/colSpan",schemaPath:"#/properties/spanningCells/items/properties/colSpan/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[E]:s.push(E),D++}if(typeof w=="number"&&isFinite(w)&&(w<1||isNaN(w))){const E={instancePath:m+"/spanningCells/"+k+"/colSpan",schemaPath:"#/properties/spanningCells/items/properties/colSpan/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};s===null?s=[E]:s.push(E),D++}}if(P.rowSpan!==void 0){let w=P.rowSpan;if(!(typeof w=="number"&&!(w%1)&&!isNaN(w)&&isFinite(w))){const E={instancePath:m+"/spanningCells/"+k+"/rowSpan",schemaPath:"#/properties/spanningCells/items/properties/rowSpan/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[E]:s.push(E),D++}if(typeof w=="number"&&isFinite(w)&&(w<1||isNaN(w))){const E={instancePath:m+"/spanningCells/"+k+"/rowSpan",schemaPath:"#/properties/spanningCells/items/properties/rowSpan/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};s===null?s=[E]:s.push(E),D++}}if(P.alignment!==void 0&&(u(P.alignment,{instancePath:m+"/spanningCells/"+k+"/alignment",parentData:P,parentDataProperty:"alignment",rootData:C})||(s=s===null?u.errors:s.concat(u.errors),D=s.length)),P.verticalAlignment!==void 0&&(S(P.verticalAlignment,{instancePath:m+"/spanningCells/"+k+"/verticalAlignment",parentData:P,parentDataProperty:"verticalAlignment",rootData:C})||(s=s===null?S.errors:s.concat(S.errors),D=s.length)),P.wrapWord!==void 0&&typeof P.wrapWord!="boolean"){const w={instancePath:m+"/spanningCells/"+k+"/wrapWord",schemaPath:"#/properties/spanningCells/items/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};s===null?s=[w]:s.push(w),D++}if(P.truncate!==void 0){let w=P.truncate;if(!(typeof w=="number"&&!(w%1)&&!isNaN(w)&&isFinite(w))){const E={instancePath:m+"/spanningCells/"+k+"/truncate",schemaPath:"#/properties/spanningCells/items/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[E]:s.push(E),D++}}if(P.paddingLeft!==void 0){let w=P.paddingLeft;if(!(typeof w=="number"&&!(w%1)&&!isNaN(w)&&isFinite(w))){const E={instancePath:m+"/spanningCells/"+k+"/paddingLeft",schemaPath:"#/properties/spanningCells/items/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[E]:s.push(E),D++}}if(P.paddingRight!==void 0){let w=P.paddingRight;if(!(typeof w=="number"&&!(w%1)&&!isNaN(w)&&isFinite(w))){const E={instancePath:m+"/spanningCells/"+k+"/paddingRight",schemaPath:"#/properties/spanningCells/items/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[E]:s.push(E),D++}}}else{const w={instancePath:m+"/spanningCells/"+k,schemaPath:"#/properties/spanningCells/items/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[w]:s.push(w),D++}}}else{const y={instancePath:m+"/spanningCells",schemaPath:"#/properties/spanningCells/type",keyword:"type",params:{type:"array"},message:"must be array"};s===null?s=[y]:s.push(y),D++}}}else{const h={instancePath:m,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[h]:s.push(h),D++}return B.errors=s,D===0}e["streamConfig.json"]=F;function M(l,{instancePath:m="",parentData:A,parentDataProperty:T,rootData:C=l}={}){let s=null,D=0;if(l&&typeof l=="object"&&!Array.isArray(l)){for(const h in l)if(!r.call(n.properties,h)){const y={instancePath:m,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:h},message:"must NOT have additional properties"};s===null?s=[y]:s.push(y),D++}l.topBody!==void 0&&(i(l.topBody,{instancePath:m+"/topBody",parentData:l,parentDataProperty:"topBody",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.topJoin!==void 0&&(i(l.topJoin,{instancePath:m+"/topJoin",parentData:l,parentDataProperty:"topJoin",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.topLeft!==void 0&&(i(l.topLeft,{instancePath:m+"/topLeft",parentData:l,parentDataProperty:"topLeft",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.topRight!==void 0&&(i(l.topRight,{instancePath:m+"/topRight",parentData:l,parentDataProperty:"topRight",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.bottomBody!==void 0&&(i(l.bottomBody,{instancePath:m+"/bottomBody",parentData:l,parentDataProperty:"bottomBody",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.bottomJoin!==void 0&&(i(l.bottomJoin,{instancePath:m+"/bottomJoin",parentData:l,parentDataProperty:"bottomJoin",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.bottomLeft!==void 0&&(i(l.bottomLeft,{instancePath:m+"/bottomLeft",parentData:l,parentDataProperty:"bottomLeft",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.bottomRight!==void 0&&(i(l.bottomRight,{instancePath:m+"/bottomRight",parentData:l,parentDataProperty:"bottomRight",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.bodyLeft!==void 0&&(i(l.bodyLeft,{instancePath:m+"/bodyLeft",parentData:l,parentDataProperty:"bodyLeft",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.bodyRight!==void 0&&(i(l.bodyRight,{instancePath:m+"/bodyRight",parentData:l,parentDataProperty:"bodyRight",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.bodyJoin!==void 0&&(i(l.bodyJoin,{instancePath:m+"/bodyJoin",parentData:l,parentDataProperty:"bodyJoin",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.headerJoin!==void 0&&(i(l.headerJoin,{instancePath:m+"/headerJoin",parentData:l,parentDataProperty:"headerJoin",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.joinBody!==void 0&&(i(l.joinBody,{instancePath:m+"/joinBody",parentData:l,parentDataProperty:"joinBody",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.joinLeft!==void 0&&(i(l.joinLeft,{instancePath:m+"/joinLeft",parentData:l,parentDataProperty:"joinLeft",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.joinRight!==void 0&&(i(l.joinRight,{instancePath:m+"/joinRight",parentData:l,parentDataProperty:"joinRight",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.joinJoin!==void 0&&(i(l.joinJoin,{instancePath:m+"/joinJoin",parentData:l,parentDataProperty:"joinJoin",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.joinMiddleUp!==void 0&&(i(l.joinMiddleUp,{instancePath:m+"/joinMiddleUp",parentData:l,parentDataProperty:"joinMiddleUp",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.joinMiddleDown!==void 0&&(i(l.joinMiddleDown,{instancePath:m+"/joinMiddleDown",parentData:l,parentDataProperty:"joinMiddleDown",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.joinMiddleLeft!==void 0&&(i(l.joinMiddleLeft,{instancePath:m+"/joinMiddleLeft",parentData:l,parentDataProperty:"joinMiddleLeft",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length)),l.joinMiddleRight!==void 0&&(i(l.joinMiddleRight,{instancePath:m+"/joinMiddleRight",parentData:l,parentDataProperty:"joinMiddleRight",rootData:C})||(s=s===null?i.errors:s.concat(i.errors),D=s.length))}else{const h={instancePath:m,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[h]:s.push(h),D++}return M.errors=s,D===0}function j(l,{instancePath:m="",parentData:A,parentDataProperty:T,rootData:C=l}={}){let s=null,D=0;const h=D;let y=!1,k=null;const P=D;if(l&&typeof l=="object"&&!Array.isArray(l)){for(const x in l)if(!c.test(x)){const V={instancePath:m,schemaPath:"#/oneOf/0/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:x},message:"must NOT have additional properties"};s===null?s=[V]:s.push(V),D++}for(const x in l)c.test(x)&&(g(l[x],{instancePath:m+"/"+x.replace(/~/g,"~0").replace(/\//g,"~1"),parentData:l,parentDataProperty:x,rootData:C})||(s=s===null?g.errors:s.concat(g.errors),D=s.length))}else{const x={instancePath:m,schemaPath:"#/oneOf/0/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[x]:s.push(x),D++}var E=P===D;E&&(y=!0,k=0);const w=D;if(Array.isArray(l)){const x=l.length;for(let V=0;V=",limit:1},message:"must be >= 1"};s===null?s=[y]:s.push(y),D++}}if(l.wrapWord!==void 0&&typeof l.wrapWord!="boolean"){const h={instancePath:m+"/wrapWord",schemaPath:"#/properties/wrapWord/type",keyword:"type",params:{type:"boolean"},message:"must be boolean"};s===null?s=[h]:s.push(h),D++}if(l.truncate!==void 0){let h=l.truncate;if(!(typeof h=="number"&&!(h%1)&&!isNaN(h)&&isFinite(h))){const y={instancePath:m+"/truncate",schemaPath:"#/properties/truncate/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[y]:s.push(y),D++}}if(l.paddingLeft!==void 0){let h=l.paddingLeft;if(!(typeof h=="number"&&!(h%1)&&!isNaN(h)&&isFinite(h))){const y={instancePath:m+"/paddingLeft",schemaPath:"#/properties/paddingLeft/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[y]:s.push(y),D++}}if(l.paddingRight!==void 0){let h=l.paddingRight;if(!(typeof h=="number"&&!(h%1)&&!isNaN(h)&&isFinite(h))){const y={instancePath:m+"/paddingRight",schemaPath:"#/properties/paddingRight/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[y]:s.push(y),D++}}}else{const h={instancePath:m,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[h]:s.push(h),D++}return H.errors=s,D===0}function F(l,{instancePath:m="",parentData:A,parentDataProperty:T,rootData:C=l}={}){let s=null,D=0;if(l&&typeof l=="object"&&!Array.isArray(l)){if(l.columnDefault===void 0){const h={instancePath:m,schemaPath:"#/required",keyword:"required",params:{missingProperty:"columnDefault"},message:"must have required property 'columnDefault'"};s===null?s=[h]:s.push(h),D++}if(l.columnCount===void 0){const h={instancePath:m,schemaPath:"#/required",keyword:"required",params:{missingProperty:"columnCount"},message:"must have required property 'columnCount'"};s===null?s=[h]:s.push(h),D++}for(const h in l)if(!(h==="border"||h==="columns"||h==="columnDefault"||h==="columnCount"||h==="drawVerticalLine")){const y={instancePath:m,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty:h},message:"must NOT have additional properties"};s===null?s=[y]:s.push(y),D++}if(l.border!==void 0&&(M(l.border,{instancePath:m+"/border",parentData:l,parentDataProperty:"border",rootData:C})||(s=s===null?M.errors:s.concat(M.errors),D=s.length)),l.columns!==void 0&&(j(l.columns,{instancePath:m+"/columns",parentData:l,parentDataProperty:"columns",rootData:C})||(s=s===null?j.errors:s.concat(j.errors),D=s.length)),l.columnDefault!==void 0&&(H(l.columnDefault,{instancePath:m+"/columnDefault",parentData:l,parentDataProperty:"columnDefault",rootData:C})||(s=s===null?H.errors:s.concat(H.errors),D=s.length)),l.columnCount!==void 0){let h=l.columnCount;if(!(typeof h=="number"&&!(h%1)&&!isNaN(h)&&isFinite(h))){const y={instancePath:m+"/columnCount",schemaPath:"#/properties/columnCount/type",keyword:"type",params:{type:"integer"},message:"must be integer"};s===null?s=[y]:s.push(y),D++}if(typeof h=="number"&&isFinite(h)&&(h<1||isNaN(h))){const y={instancePath:m+"/columnCount",schemaPath:"#/properties/columnCount/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};s===null?s=[y]:s.push(y),D++}}if(l.drawVerticalLine!==void 0&&typeof l.drawVerticalLine!="function"){const h={instancePath:m+"/drawVerticalLine",schemaPath:"#/properties/drawVerticalLine/typeof",keyword:"typeof",params:{},message:'must pass "typeof" keyword validation'};s===null?s=[h]:s.push(h),D++}}else{const h={instancePath:m,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};s===null?s=[h]:s.push(h),D++}return F.errors=s,D===0}})(Yn);var xs=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(we,"__esModule",{value:!0});we.validateConfig=void 0;const Bs=xs(Yn),Ps=(e,t)=>{const n=Bs.default[e];if(!n(t)&&n.errors){const r=n.errors.map(i=>({message:i.message,params:i.params,schemaPath:i.schemaPath}));throw console.log("config",t),console.log("errors",r),new Error("Invalid config.")}};we.validateConfig=Ps;Object.defineProperty(We,"__esModule",{value:!0});We.makeStreamConfig=void 0;const As=q,Ts=we,Ms=(e,t={},n)=>Array.from({length:e}).map((r,i)=>({alignment:"left",paddingLeft:1,paddingRight:1,truncate:Number.POSITIVE_INFINITY,verticalAlignment:"top",wrapWord:!1,...n,...t[i]})),js=e=>{if((0,Ts.validateConfig)("streamConfig.json",e),e.columnDefault.width===void 0)throw new Error("Must provide config.columnDefault.width when creating a stream.");return{drawVerticalLine:()=>!0,...e,border:(0,As.makeBorderConfig)(e.border),columns:Ms(e.columnCount,e.columns,e.columnDefault)}};We.makeStreamConfig=js;var Ue={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.mapDataUsingRowHeights=e.padCellVertically=void 0;const t=q,n=ce,r=o=>new Array(o).fill(""),i=(o,u,c)=>{const d=u-o.length;return c==="top"?[...o,...r(d)]:c==="bottom"?[...r(d),...o]:[...r(Math.floor(d/2)),...o,...r(Math.ceil(d/2))]};e.padCellVertically=i;const a=(o,u,c)=>{const d=o[0].length,p=o.map((f,g)=>{const b=u[g],_=Array.from({length:b},()=>new Array(d).fill(""));return f.forEach((S,B)=>{var M;const j=(M=c.spanningCellManager)===null||M===void 0?void 0:M.getContainingRange({col:B,row:g});if(j){j.extractCellContent(g).forEach((l,m)=>{_[m][B]=l});return}const H=(0,n.wrapCell)(S,c.columns[B].width,c.columns[B].wrapWord);(0,e.padCellVertically)(H,b,c.columns[B].verticalAlignment).forEach((l,m)=>{_[m][B]=l})}),_});return(0,t.flatten)(p)};e.mapDataUsingRowHeights=a})(Ue);var Je={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.padTableData=e.padString=void 0;const t=(r,i,a)=>" ".repeat(i)+r+" ".repeat(a);e.padString=t;const n=(r,i)=>r.map((a,o)=>a.map((u,c)=>{var d;if((d=i.spanningCellManager)===null||d===void 0?void 0:d.getContainingRange({col:c,row:o},{mapped:!0}))return u;const{paddingLeft:f,paddingRight:g}=i.columns[c];return(0,e.padString)(u,f,g)}));e.padTableData=n})(Je);var _e={};Object.defineProperty(_e,"__esModule",{value:!0});_e.stringifyTableData=void 0;const Rs=q,Os=e=>e.map(t=>t.map(n=>(0,Rs.normalizeString)(String(n))));_e.stringifyTableData=Os;var Ye={},Et={exports:{}};(function(e,t){var n=30,r="...",i=1/0,a=17976931348623157e292,o=0/0,u="[object RegExp]",c="[object Symbol]",d=/^\s+|\s+$/g,p=/\w*$/,f=/^[-+]0x[0-9a-f]+$/i,g=/^0b[01]+$/i,b=/^0o[0-7]+$/i,_="\\ud800-\\udfff",S="\\u0300-\\u036f\\ufe20-\\ufe23",B="\\u20d0-\\u20f0",M="\\ufe0e\\ufe0f",j="["+_+"]",H="["+S+B+"]",F="\\ud83c[\\udffb-\\udfff]",l="(?:"+H+"|"+F+")",m="[^"+_+"]",A="(?:\\ud83c[\\udde6-\\uddff]){2}",T="[\\ud800-\\udbff][\\udc00-\\udfff]",C="\\u200d",s=l+"?",D="["+M+"]?",h="(?:"+C+"(?:"+[m,A,T].join("|")+")"+D+s+")*",y=D+s+h,k="(?:"+[m+H+"?",H,A,T,j].join("|")+")",P=RegExp(F+"(?="+F+")|"+k+y,"g"),w=RegExp("["+C+_+S+B+M+"]"),E=parseInt,x=typeof I=="object"&&I&&I.Object===Object&&I,V=typeof self=="object"&&self&&self.Object===Object&&self,li=x||V||Function("return this")(),Mt=t&&!t.nodeType&&t,jt=Mt&&!0&&e&&!e.nodeType&&e,ui=jt&&jt.exports===Mt,Rt=ui&&x.process,Ot=function(){try{return Rt&&Rt.binding("util")}catch{}}(),Lt=Ot&&Ot.isRegExp,ci=hi("length");function di(v){return v.split("")}function hi(v){return function($){return $==null?void 0:$[v]}}function pi(v){return function($){return v($)}}function st(v){return w.test(v)}function fi(v){return st(v)?Di(v):ci(v)}function mi(v){return st(v)?gi(v):di(v)}function Di(v){for(var $=P.lastIndex=0;P.test(v);)$++;return $}function gi(v){return v.match(P)||[]}var yi=Object.prototype,It=yi.toString,zt=li.Symbol,Nt=zt?zt.prototype:void 0,Vt=Nt?Nt.toString:void 0;function bi(v){return Fe(v)&&It.call(v)==u}function vi(v,$,O){var J=-1,N=v.length;$<0&&($=-$>N?0:N+$),O=O>N?N:O,O<0&&(O+=N),N=$>O?0:O-$>>>0,$>>>=0;for(var he=Array(N);++J=J?v:vi(v,$,O)}function Fe(v){var $=typeof v;return!!v&&($=="object"||$=="function")}function wi(v){return!!v&&typeof v=="object"}var _i=Lt?pi(Lt):bi;function qt(v){return typeof v=="symbol"||wi(v)&&It.call(v)==c}function Fi(v){if(!v)return v===0?v:0;if(v=Ei(v),v===i||v===-i){var $=v<0?-1:1;return $*a}return v===v?v:0}function ki(v){var $=Fi(v),O=$%1;return $===$?O?$-O:$:0}function Ei(v){if(typeof v=="number")return v;if(qt(v))return o;if(Fe(v)){var $=typeof v.valueOf=="function"?v.valueOf():v;v=Fe($)?$+"":$}if(typeof v!="string")return v===0?v:+v;v=v.replace(d,"");var O=g.test(v);return O||b.test(v)?E(v.slice(2),O?2:8):f.test(v)?o:+v}function Ht(v){return v==null?"":at(v)}function $i(v,$){var O=n,J=r;if(Fe($)){var N="separator"in $?$.separator:N;O="length"in $?ki($.length):O,J="omission"in $?at($.omission):J}v=Ht(v);var he=v.length;if(st(v)){var ke=mi(v);he=ke.length}if(O>=he)return v;var Z=O-fi(J);if(Z<1)return J;var X=ke?Ci(ke,0,Z).join(""):v.slice(0,Z);if(N===void 0)return X+J;if(ke&&(Z+=X.length-Z),_i(N)){if(v.slice(Z).search(N)){var Wt,Si=X;for(N.global||(N=RegExp(N.source,Ht(p.exec(N))+"g")),N.lastIndex=0;Wt=N.exec(Si);)var Ut=Wt.index;X=X.slice(0,Ut===void 0?Z:Ut)}}else if(v.indexOf(at(N),Z)!=Z){var Jt=X.lastIndexOf(N);Jt>-1&&(X=X.slice(0,Jt))}return X+J}e.exports=$i})(Et,Et.exports);(function(e){var t=I&&I.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(e,"__esModule",{value:!0}),e.truncateTableData=e.truncateString=void 0;const n=t(Et.exports),r=(a,o)=>(0,n.default)(a,{length:o,omission:"\u2026"});e.truncateString=r;const i=(a,o)=>a.map(u=>u.map((c,d)=>(0,e.truncateString)(c,o[d])));e.truncateTableData=i})(Ye);Object.defineProperty(ze,"__esModule",{value:!0});ze.createStream=void 0;const Ls=ge,Is=ve,Ae=At,Gn=Ce,zs=We,Ns=Ue,Vs=Je,qs=_e,Hs=Ye,Ws=q,Zn=(e,t)=>{let n=(0,qs.stringifyTableData)(e);n=(0,Hs.truncateTableData)(n,(0,Ws.extractTruncates)(t));const r=(0,Is.calculateRowHeights)(n,t);return n=(0,Ns.mapDataUsingRowHeights)(n,r,t),n=(0,Ls.alignTableData)(n,t),n=(0,Vs.padTableData)(n,t),n},Us=(e,t,n)=>{const i=Zn([e],n).map(o=>(0,Gn.drawRow)(o,n)).join("");let a;a="",a+=(0,Ae.drawBorderTop)(t,n),a+=i,a+=(0,Ae.drawBorderBottom)(t,n),a=a.trimEnd(),process.stdout.write(a)},Js=(e,t,n)=>{const i=Zn([e],n).map(u=>(0,Gn.drawRow)(u,n)).join("");let a="";const o=(0,Ae.drawBorderBottom)(t,n);o!==` +`&&(a="\r\x1B[K"),a+=(0,Ae.drawBorderJoin)(t,n),a+=i,a+=o,a=a.trimEnd(),process.stdout.write(a)},Ys=e=>{const t=(0,zs.makeStreamConfig)(e),n=Object.values(t.columns).map(i=>i.width+i.paddingLeft+i.paddingRight);let r=!0;return{write:i=>{if(i.length!==t.columnCount)throw new Error("Row cell count does not match the config.columnCount.");r?(r=!1,Us(i,n,t)):Js(i,n,t)}}};ze.createStream=Ys;var Ke={},Ge={};Object.defineProperty(Ge,"__esModule",{value:!0});Ge.calculateOutputColumnWidths=void 0;const Ks=e=>e.columns.map(t=>t.paddingLeft+t.width+t.paddingRight);Ge.calculateOutputColumnWidths=Ks;var Ze={};Object.defineProperty(Ze,"__esModule",{value:!0});Ze.drawTable=void 0;const Gs=At,Zs=de,Xs=Ce,Qs=q,ea=(e,t,n,r)=>{const{drawHorizontalLine:i,singleLine:a}=r,o=(0,Qs.groupBySizes)(e,n).map((u,c)=>u.map(d=>(0,Xs.drawRow)(d,{...r,rowIndex:c})).join(""));return(0,Zs.drawContent)({contents:o,drawSeparator:(u,c)=>(u===0||u===c||!a)&&i(u,c),elementType:"row",rowIndex:-1,separatorGetter:(0,Gs.createTableBorderGetter)(t,{...r,rowCount:o.length}),spanningCellManager:r.spanningCellManager})};Ze.drawTable=ea;var Xe={};Object.defineProperty(Xe,"__esModule",{value:!0});Xe.injectHeaderConfig=void 0;const ta=(e,t)=>{var n;let r=(n=t.spanningCells)!==null&&n!==void 0?n:[];const i=t.header,a=[...e];if(i){r=r.map(({row:c,...d})=>({...d,row:c+1}));const{content:o,...u}=i;r.unshift({alignment:"center",col:0,colSpan:e[0].length,paddingLeft:1,paddingRight:1,row:0,wrapWord:!1,...u}),a.unshift([o,...Array.from({length:e[0].length-1}).fill("")])}return[a,r]};Xe.injectHeaderConfig=ta;var Qe={},Xn={};(function(e){var t=I&&I.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(e,"__esModule",{value:!0}),e.calculateMaximumColumnWidths=e.calculateMaximumCellWidth=void 0;const n=t(re.exports),r=q,i=o=>Math.max(...o.split(` +`).map(n.default));e.calculateMaximumCellWidth=i;const a=(o,u=[])=>{const c=new Array(o[0].length).fill(0),d=u.map(r.calculateRangeCoordinate),p=(f,g)=>d.some(b=>(0,r.isCellInRange)({col:g,row:f},b));return o.forEach((f,g)=>{f.forEach((b,_)=>{p(g,_)||(c[_]=Math.max(c[_],(0,e.calculateMaximumCellWidth)(b)))})}),c};e.calculateMaximumColumnWidths=a})(Xn);var et={},le={},na=I&&I.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(le,"__esModule",{value:!0});le.alignVerticalRangeContent=le.wrapRangeContent=void 0;const ia=na(re.exports),ra=ye,sa=Ue,aa=Je,oa=Ye,cn=q,la=ce,ua=(e,t,n)=>{const{topLeft:r,paddingRight:i,paddingLeft:a,truncate:o,wrapWord:u,alignment:c}=e,d=n.rows[r.row][r.col],p=t-a-i;return(0,la.wrapCell)((0,oa.truncateString)(d,o),p,u).map(f=>{const g=(0,ra.alignString)(f,p,c);return(0,aa.padString)(g,a,i)})};le.wrapRangeContent=ua;const ca=(e,t,n)=>{const{rows:r,drawHorizontalLine:i,rowHeights:a}=n,{topLeft:o,bottomRight:u,verticalAlignment:c}=e;if(a.length===0)return[];const d=(0,cn.sumArray)(a.slice(o.row,u.row+1)),p=u.row-o.row,f=(0,cn.sequence)(o.row+1,u.row).filter(b=>!i(b,r.length)).length,g=d+p-f;return(0,sa.padCellVertically)(t,g,c).map(b=>b.length===0?" ".repeat((0,ia.default)(t[0])):b)};le.alignVerticalRangeContent=ca;var tt={};Object.defineProperty(tt,"__esModule",{value:!0});tt.calculateSpanningCellWidth=void 0;const ft=q,da=(e,t)=>{const{columnsConfig:n,drawVerticalLine:r}=t,{topLeft:i,bottomRight:a}=e,o=(0,ft.sumArray)(n.slice(i.col,a.col+1).map(({width:p})=>p)),u=i.col===a.col?n[i.col].paddingRight+n[a.col].paddingLeft:(0,ft.sumArray)(n.slice(i.col,a.col+1).map(({paddingLeft:p,paddingRight:f})=>p+f)),c=a.col-i.col,d=(0,ft.sequence)(i.col+1,a.col).filter(p=>!r(p,n.length)).length;return o+u+c-d};tt.calculateSpanningCellWidth=da;var nt={};Object.defineProperty(nt,"__esModule",{value:!0});nt.makeRangeConfig=void 0;const ha=q,pa=(e,t)=>{var n;const{topLeft:r,bottomRight:i}=(0,ha.calculateRangeCoordinate)(e);return{...{...t[r.col],...e,paddingRight:(n=e.paddingRight)!==null&&n!==void 0?n:t[i.col].paddingRight},bottomRight:i,topLeft:r}};nt.makeRangeConfig=pa;Object.defineProperty(et,"__esModule",{value:!0});et.createSpanningCellManager=void 0;const dn=le,fa=tt,ma=nt,oe=q,$t=(e,t)=>t.find(n=>(0,oe.isCellInRange)(e,n)),hn=(e,t)=>{const n=(0,fa.calculateSpanningCellWidth)(e,t),r=(0,dn.wrapRangeContent)(e,n,t),i=(0,dn.alignVerticalRangeContent)(e,r,t);return{...e,extractBorderContent:u=>{const{topLeft:c}=e,d=(0,oe.sumArray)(t.rowHeights.slice(c.row,u))+(u-c.row-1);return i[d]},extractCellContent:u=>{const{topLeft:c}=e,{drawHorizontalLine:d,rowHeights:p}=t,f=u-c.row,g=(0,oe.sequence)(c.row+1,u).filter(_=>!(d!=null&&d(_,p.length))).length,b=(0,oe.sumArray)(p.slice(c.row,u))+f-g;return i.slice(b,b+p[u])},height:r.length,width:n}},Da=(e,t,n)=>{const r=$t(e,n),i=$t(t,n);return r&&i?(0,oe.areCellEqual)(r.topLeft,i.topLeft):!1},ga=e=>{const{row:t,col:n}=e.topLeft;return`${t}/${n}`},ya=e=>{const{spanningCellConfigs:t,columnsConfig:n}=e,r=t.map(o=>(0,ma.makeRangeConfig)(o,n)),i={};let a=[];return{getContainingRange:(o,u)=>{var c;const d=u!=null&&u.mapped?(0,oe.findOriginalRowIndex)(a,o.row):o.row,p=$t({...o,row:d},r);if(!p)return;if(a.length===0)return hn(p,{...e,rowHeights:a});const f=ga(p);return(c=i[f])!==null&&c!==void 0||(i[f]=hn(p,{...e,rowHeights:a})),i[f]},inSameRange:(o,u)=>Da(o,u,r),rowHeights:a,setRowHeights:o=>{a=o}}};et.createSpanningCellManager=ya;var it={};Object.defineProperty(it,"__esModule",{value:!0});it.validateSpanningCellConfig=void 0;const mt=q,Se=(e,t,n)=>e<=n&&n<=t,ba=(e,t)=>{const[n,r]=[e.length,e[0].length];t.forEach((o,u)=>{const{colSpan:c,rowSpan:d}=o;if(c===void 0&&d===void 0)throw new Error(`Expect at least colSpan or rowSpan is provided in config.spanningCells[${u}]`);if(c!==void 0&&c<1)throw new Error(`Expect colSpan is not equal zero, instead got: ${c} in config.spanningCells[${u}]`);if(d!==void 0&&d<1)throw new Error(`Expect rowSpan is not equal zero, instead got: ${d} in config.spanningCells[${u}]`)});const i=t.map(mt.calculateRangeCoordinate);i.forEach(({topLeft:o,bottomRight:u},c)=>{if(!Se(0,r-1,o.col)||!Se(0,n-1,o.row)||!Se(0,r-1,u.col)||!Se(0,n-1,u.row))throw new Error(`Some cells in config.spanningCells[${c}] are out of the table`)});const a=Array.from({length:n},()=>Array.from({length:r}));i.forEach(({topLeft:o,bottomRight:u},c)=>{(0,mt.sequence)(o.row,u.row).forEach(d=>{(0,mt.sequence)(o.col,u.col).forEach(p=>{if(a[d][p]!==void 0)throw new Error(`Spanning cells in config.spanningCells[${a[d][p]}] and config.spanningCells[${c}] are overlap each other`);a[d][p]=c})})})};it.validateSpanningCellConfig=ba;Object.defineProperty(Qe,"__esModule",{value:!0});Qe.makeTableConfig=void 0;const va=Xn,Ca=et,wa=q,_a=we,Fa=it,ka=(e,t,n,r)=>{const i=(0,va.calculateMaximumColumnWidths)(e,r);return e[0].map((a,o)=>({alignment:"left",paddingLeft:1,paddingRight:1,truncate:Number.POSITIVE_INFINITY,verticalAlignment:"top",width:i[o],wrapWord:!1,...n,...t==null?void 0:t[o]}))},Ea=(e,t={},n)=>{var r,i,a,o,u;(0,_a.validateConfig)("config.json",t),(0,Fa.validateSpanningCellConfig)(e,(r=t.spanningCells)!==null&&r!==void 0?r:[]);const c=(i=n!=null?n:t.spanningCells)!==null&&i!==void 0?i:[],d=ka(e,t.columns,t.columnDefault,c),p=(a=t.drawVerticalLine)!==null&&a!==void 0?a:()=>!0,f=(o=t.drawHorizontalLine)!==null&&o!==void 0?o:()=>!0;return{...t,border:(0,wa.makeBorderConfig)(t.border),columns:d,drawHorizontalLine:f,drawVerticalLine:p,singleLine:(u=t.singleLine)!==null&&u!==void 0?u:!1,spanningCellManager:(0,Ca.createSpanningCellManager)({columnsConfig:d,drawHorizontalLine:f,drawVerticalLine:p,rows:e,spanningCellConfigs:c})}};Qe.makeTableConfig=Ea;var rt={};Object.defineProperty(rt,"__esModule",{value:!0});rt.validateTableData=void 0;const $a=q,Sa=e=>{if(!Array.isArray(e))throw new TypeError("Table data must be an array.");if(e.length===0)throw new Error("Table must define at least one row.");if(e[0].length===0)throw new Error("Table must define at least one column.");const t=e[0].length;for(const n of e){if(!Array.isArray(n))throw new TypeError("Table row data must be an array.");if(n.length!==t)throw new Error("Table must have a consistent number of cells.");for(const r of n)if(/[\u0001-\u0006\u0008\u0009\u000B-\u001A]/.test((0,$a.normalizeString)(String(r))))throw new Error("Table data must not contain control characters.")}};rt.validateTableData=Sa;Object.defineProperty(Ke,"__esModule",{value:!0});Ke.table=void 0;const xa=ge,Ba=Ge,Pa=ve,Aa=Ze,Ta=Xe,Ma=Qe,ja=Ue,Ra=Je,Oa=_e,La=Ye,Ia=q,za=rt,Na=(e,t={})=>{(0,za.validateTableData)(e);let n=(0,Oa.stringifyTableData)(e);const[r,i]=(0,Ta.injectHeaderConfig)(n,t),a=(0,Ma.makeTableConfig)(r,t,i);n=(0,La.truncateTableData)(r,(0,Ia.extractTruncates)(a));const o=(0,Pa.calculateRowHeights)(n,a);a.spanningCellManager.setRowHeights(o),n=(0,ja.mapDataUsingRowHeights)(n,o,a),n=(0,xa.alignTableData)(n,a),n=(0,Ra.padTableData)(n,a);const u=(0,Ba.calculateOutputColumnWidths)(a);return(0,Aa.drawTable)(n,u,o,a)};Ke.table=Na;var Qn={};Object.defineProperty(Qn,"__esModule",{value:!0});(function(e){var t=I&&I.__createBinding||(Object.create?function(o,u,c,d){d===void 0&&(d=c),Object.defineProperty(o,d,{enumerable:!0,get:function(){return u[c]}})}:function(o,u,c,d){d===void 0&&(d=c),o[d]=u[c]}),n=I&&I.__exportStar||function(o,u){for(var c in o)c!=="default"&&!Object.prototype.hasOwnProperty.call(u,c)&&t(u,o,c)};Object.defineProperty(e,"__esModule",{value:!0}),e.getBorderCharacters=e.createStream=e.table=void 0;const r=ze;Object.defineProperty(e,"createStream",{enumerable:!0,get:function(){return r.createStream}});const i=be;Object.defineProperty(e,"getBorderCharacters",{enumerable:!0,get:function(){return i.getBorderCharacters}});const a=Ke;Object.defineProperty(e,"table",{enumerable:!0,get:function(){return a.table}}),n(Qn,e)})(Ft);function xe(e,t){const n=Array.from(e);return Array.from(t).some((r,i,a)=>n.every((o,u)=>o===a[i+u]))}const Va={name:"AgentTerminal",props:{agent:{type:Object,required:!0}},data(){return{currentInput:"",outputLines:[],currentModule:null,moduleOptions:{},commandHistory:[],historyIndex:-1,moduleName:"",currentOptions:{},suggestions:[],currentSuggestionIndex:-1,tableConfig:{border:{topBody:"\u2500",topJoin:"\u252C",topLeft:"\u250C",topRight:"\u2510",bottomBody:"\u2500",bottomJoin:"\u2534",bottomLeft:"\u2514",bottomRight:"\u2518",bodyLeft:"\u2502",bodyRight:"\u2502",bodyJoin:"\u2502",joinBody:"\u2500",joinLeft:"\u251C",joinRight:"\u2524",joinJoin:"\u253C"}},helpCommands:[{command:"help",description:"Display the help menu for the current menu",usage:"help"},{command:"clear",description:"Clear the terminal output.",usage:"clear"},{command:"back",description:"Return to the main menu from a module.",usage:"back"},{command:"usemodule",description:"Use a specific module by name.",usage:"usemodule "},{command:"whoami",description:"Display current user.",usage:"whoami"},{command:"sysinfo",description:"Tasks the specified agent to update sysinfo.",usage:"sysinfo"},{command:"shell",description:"Tasks the specified agent to execute a shell command.",usage:"shell [--literal / -l] "},{command:"ps",description:"Display the processes running on the agent's system.",usage:"ps"},{command:"sc",description:"Run the powershell_collection_screenshot module with Ratio set to 80.",usage:"sc"},{command:"sherlock",description:"PowerShell script to quickly find missing software patches for local privilege escalation vulnerabilities.",usage:"sherlock"},{command:"socks",description:"Create a SOCKS proxy on the specified port",usage:"socks 1080"},{command:"revtoself",description:"Revert to self on the existing Agent",usage:"revtoself"},{command:"sleep",description:"Tasks specified agent to update delay (s) and jitter (0.0 - 1.0).",usage:"sleep "}],moduleHelpCommands:[{command:"execute",description:"Execute the selected module",usage:"execute"},{command:"generate",description:"Generate the selected module",usage:"generate"},{command:"help",description:"Display the help menu for the current menu",usage:"help"},{command:"info",description:"Print default info on the current record.",usage:"info"},{command:"options",description:"Print the current record options",usage:"options"},{command:"set",description:"Set a field for the current record.",usage:"set "},{command:"unset",description:"Unset a record option",usage:"unset "},{command:"clear",description:"Clear the terminal output.",usage:"clear"},{command:"back",description:"Return to the main menu from a module.",usage:"back"}],isShellMenu:!1,currentDir:"loading..."}},computed:{...wn({allModules:e=>e.module.modules}),currentPrompt(){const e=this.colorizeText("(Empire: ","white"),t=this.colorizeText(" )>","white");let n="";return this.currentModule?n=this.colorizeText(`usemodule/${this.currentModule.id}`,"red"):this.isShellMenu?n=this.colorizeText(this.currentDir,"green"):n=this.colorizeText(this.agent.session_id,"red"),e+n+t}},watch:{currentInput(e){e&&this.generateSuggestions()},outputLines(e){localStorage.setItem(this.storageName(),JSON.stringify(e))}},async mounted(){var t;this.$refs.inputField.focus(),((t=this.allModules)==null?void 0:t.length)===0&&this.$store.dispatch("module/getModules");const e=localStorage.getItem(this.storageName());e&&(this.outputLines=JSON.parse(e)),this.scrollToBottom()},methods:{storageName(){return`terminal-history-${this.agent.session_id}`},ctrlCHandler(e){this.isShellMenu&&(this.isShellMenu=!1),this.addLine(`${this.currentPrompt} ${this.currentInput}`),this.currentInput=""},applySuggestion(e){this.currentInput=e,this.suggestions=[],this.currentSuggestionIndex=0},handleKeyEvents(e){e.code==="ArrowUp"?(e.preventDefault(),this.historyIndex>0&&(this.historyIndex--,this.currentInput=this.commandHistory[this.historyIndex])):e.code==="ArrowDown"?this.historyIndex1?this.currentSuggestionIndex=(this.currentSuggestionIndex+1)%this.suggestions.length:this.suggestions.length===1&&(this.currentInput=this.suggestions[0],this.suggestions=[]),this.$nextTick(()=>{const t=this.$refs.suggestionList,n=t.children[this.currentSuggestionIndex];n&&(n.offsetTop+n.clientHeight>t.clientHeight?t.scrollTop=n.offsetTop+n.clientHeight-t.clientHeight:n.offsetTop0&&(this.suggestions=[]);return}const e=this.currentInput.toLowerCase().trim(),t=e.split(" ");let n=[],r=[];if(e.startsWith("usemodule")){const i=e.replace("usemodule","").trim();n=this.allModules.filter(o=>xe(i,o.id.toLowerCase())).map(o=>`usemodule ${o.id}`)}this.currentModule?((t[0]==="set"||t[0]==="unset")&&(n=Object.keys(this.moduleOptions).filter(i=>i!=="Agent"&&xe((t[1]||"").toLowerCase(),i.toLowerCase())).map(i=>`${t[0]} ${i}`)),r=this.moduleHelpCommands.map(i=>i.command.toLowerCase()).filter(i=>xe(e,i)).map(i=>i)):r=this.helpCommands.map(i=>i.command.toLowerCase()).filter(i=>xe(e,i)).map(i=>i),this.suggestions=[...new Set([...n,...r])]},processCommand(){if(this.suggestions.length>0&&this.currentSuggestionIndex!==-1){this.currentInput=this.suggestions[this.currentSuggestionIndex],this.suggestions=[],this.currentSuggestionIndex=-1;return}if(!this.currentInput.trim()){this.addLine(""),this.addLine(this.currentPrompt),this.currentInput="";return}this.suggestions=[],this.addLine(`${this.currentPrompt} ${this.currentInput}`);const e=this.currentInput.split(" "),t=e[0],n=e.slice(1);if(this.isShellMenu)this.shellCommandOperator(this.currentInput);else if(t==="back")this.currentModule?this.currentModule=null:this.addLine("Already at the main menu.");else if(this.currentInput==="options")this.currentModule?this.displayAllOptionValues():this.addLine("No module is currently selected.");else if(this.currentModule&&Object.keys(this.moduleOptions).includes(this.currentInput))this.displayOptionValue(this.currentInput);else if(this.currentModule)switch(t){case"set":this.setModuleOption(n[0],n.slice(1).join(" "));break;case"execute":this.executeCurrentModule();break;case"unset":this.unsetModuleOption(n[0]);break;case"generate":this.executeCurrentModule();break;default:switch(this.currentInput){case"help":this.displayHelpMenu();break;case"clear":this.outputLines=[];break;default:this.addError(`Command '${this.currentInput}' not found.`);break}}else switch(t){case"whoami":this.runShellCommand("whoami");break;case"usemodule":this.useModule(n[0]);break;case"sysinfo":this.getSysInfo();break;case"shell":n.length<1?(this.isShellMenu=!0,this.updateCurrentDirectory(),this.addInfo(`Shell session started on ${this.agent.session_id}`),this.addInfo("Exit shell menu with Ctrl+C.")):this.runShellCommand(e.slice(1).join(" "));break;case"ps":this.runShellCommand("ps");break;case"sc":this.executeScreenshotModule();break;case"set":this.setModuleOption(n[0],n.slice(1).join(" "));break;case"sherlock":this.executeSherlockModule();break;case"revtoself":this.executeRevToSelfModule();break;case"execute":this.executeCurrentModule();break;case"socks":if(this.agent.language==="ironpython"){const r=n.length>0?n[0]:1080;Ji(this.agent.session_id,r).then(()=>{this.addInfo(`SOCKS proxy created on port ${r}`)}).catch(i=>{this.addError(`Error creating SOCKS proxy: ${i.message}`)})}else this.addError("Use Invoke-Socks Proxy module for non-Ironpython Agents.");break;case"sleep":if(n.length<2)this.addError("Invalid command. Usage: sleep ");else{const[r,i]=n;yt(this.agent.session_id,r,i),this.addLine(`Tasked agent to sleep delay/jitter ${r}/${i}`)}break;default:switch(this.currentInput){case"help":this.displayHelpMenu();break;case"clear":this.outputLines=[];break;default:this.addError(`Command '${this.currentInput}' not found.`);break}}this.currentInput.trim()&&(this.commandHistory.push(this.currentInput),this.historyIndex=this.commandHistory.length),this.currentInput=""},unsetModuleOption(e){if(!this.currentModule){this.addError("No module is currently selected.");return}if(!this.moduleOptions[e]){this.addError(`Option "${e}" not found in module ${this.currentModule.name}.`);return}this.moduleOptions[e].value=null,this.addInfo(`Unset ${e}.`)},async executeRevToSelfModule(){try{const e=this.agent.session_id,t=await Ee("powershell_credentials_tokens",{RevToSelf:!0,Agent:e},!1,!1);this.pollForResult(t.id),this.addInfo("RevToSelf module executed")}catch(e){this.addError(`Error executing command: ${e.message}`)}},async executeSherlockModule(){try{const e=this.agent.session_id,t=await Ee("powershell_privesc_sherlock",{Agent:e},!1,!1);this.pollForResult(t.id),this.addInfo("Sherlock module executed")}catch(e){this.addError(`Error executing command: ${e.message}`)}},async runShellCommand(e){if(!this.agent||!this.agent.session_id){this.addError("Error: agent data is not available.");return}const t=e.startsWith("--literal")||e.startsWith("-l");t&&(e=e.replace("--literal","").replace("-l","").trim());try{const n=await Be(this.agent.session_id,e,t);this.pollForResult(n.id)}catch(n){this.addError(`Error executing command: ${n.message}`)}},async pollForResult(e,t={print:!0,attempts:30,delay:5e3}){t.attempts||(t.attempts=30),t.delay||(t.delay=5e3);let n=null,r=!1,i=0,a=!1;for(;i{const e=this.$refs.output;e.scrollTop=e.scrollHeight})},displayTable(e){e.split(` +`).forEach(t=>{this.addLine(t,"indent-5-spaces")})},ansiToHTML(e){let t=e;return t=new rr().ansi_to_html(t),t},async useModule(e){const t=this.allModules.find(n=>n.id===e);if(!t){this.addError(`Module with name '${e}' not found.`);return}this.currentModule=t,this.moduleOptions=t.options||{},this.currentOptions={...this.moduleOptions},this.addLine(`${this.colorizeText("Module:","green")} ${t.name}`,"indent-5-spaces"),this.addLine(`${this.colorizeText("Description:","green")} ${t.description}`,"indent-5-spaces"),this.displayModuleOptions()},displayModuleOptions(){this.moduleOptions.Agent.value=this.agent.session_id;const e={...this.tableConfig,columns:{1:{width:20},2:{width:8},3:{width:40}}},t=[[this.colorizeText("Option Name","green"),this.colorizeText("Value","green"),this.colorizeText("Required","green"),this.colorizeText("Description","green")]];Object.entries(this.moduleOptions).forEach(([r,i])=>{r!=="Agent"&&t.push([r,i.value,i.required,i.description])});const n=Ft.table(t,e);this.displayTable(n),this.addInfo('Use "set " to set an option value.')},displayOptionValue(e){const t=this.moduleOptions[e],n=t&&t.value?t.value:"N/A";this.addLine(`${this.colorizeText(e,"green")}: ${n}`)},displayAllOptionValues(){Object.keys(this.currentOptions).forEach(e=>{this.displayOptionValue(e)})},setModuleOption(e,t){if(!this.currentModule){this.addError("No module is currently selected.");return}if(!this.moduleOptions[e]){this.addError(`Option "${e}" not found in module ${this.currentModule.name}.`);return}if(e==="Agent"){this.addError("Error: Cannot set the Agent option.");return}this.moduleOptions[e].value=t,this.addInfo(`Set ${e} to ${t}.`)},async executeCurrentModule(){if(!this.currentModule){this.addError("No module is currently selected.");return}const e=Object.entries(this.moduleOptions).filter(([t,n])=>n.required&&!n.value).map(([t,n])=>t);if(e.length>0){this.addError(`Missing required options: ${e.join(", ")}`);return}this.addInfo(`Executing module ${this.currentModule.name}...`);try{const t=Object.entries(this.moduleOptions).reduce((r,[i,a])=>(r[i]=a.value,r),{});let n;try{n=await Ee(this.currentModule.id,t,!1,!1)}catch(r){this.addError(`Error executing module: ${r.error}`);return}this.currentModule=null,this.moduleOptions={},this.pollForResult(n.id)}catch(t){this.addError(`Error executing module: ${t.message}`)}},async getSysInfo(){const e=await bt(this.agent.session_id);this.pollForResult(e.id)},displayHelpMenu(){this.currentModule&&(this.helpCommands=this.moduleHelpCommands);const e={...this.tableConfig,columns:{1:{width:40},2:{width:30}}},t=[[this.colorizeText("Command","green"),this.colorizeText("Description","green"),this.colorizeText("Usage","green")]];this.helpCommands.forEach(n=>{t.push([n.command,n.description,n.usage])}),this.displayTable(Ft.table(t,e))},colorizeText(e,t=""){let n="";const r="\x1B[1m";switch(t.toLowerCase()){case"red":n="\x1B[91m";break;case"green":n="\x1B[92m";break;case"blue":n="\x1B[94m";break;case"yellow":n="\x1B[93m";break;case"white":n="\x1B[97m";break;default:return e}return`${r}${n}${e}\x1B[0m`},async executeScreenshotModule(){try{const e=this.agent.session_id,t=await Ee("powershell_collection_screenshot",{Ratio:80,Agent:e},!1,!1);this.pollForResult(t.id),this.addInfo("Screenshot saved to downloads")}catch(e){this.addError(`Error executing command: ${e.message}`)}}}};var qa=function(){var t=this,n=t._self._c;return n("div",{staticClass:"terminal-container"},[n("div",{ref:"output",staticClass:"terminal-output"},t._l(t.outputLines,function(r,i){return n("div",{key:i,class:r.cssClasses,staticStyle:{"white-space":"pre-wrap"},domProps:{innerHTML:t._s(t.ansiToHTML(r.content))}})}),0),n("div",{staticClass:"terminal-input"},[n("span",{staticClass:"prompt",domProps:{innerHTML:t._s(t.ansiToHTML(t.currentPrompt))}}),n("input",{directives:[{name:"model",rawName:"v-model",value:t.currentInput,expression:"currentInput"}],ref:"inputField",domProps:{value:t.currentInput},on:{keyup:[function(r){return!r.type.indexOf("key")&&t._k(r.keyCode,"c",void 0,r.key,void 0)||!r.ctrlKey?null:(r.preventDefault(),r.stopPropagation(),t.ctrlCHandler.apply(null,arguments))},function(r){return!r.type.indexOf("key")&&t._k(r.keyCode,"enter",13,r.key,"Enter")?null:t.processCommand.apply(null,arguments)}],keydown:t.handleKeyEvents,input:function(r){r.target.composing||(t.currentInput=r.target.value)}}})]),n("div",{directives:[{name:"show",rawName:"v-show",value:t.suggestions.length,expression:"suggestions.length"}],ref:"suggestionList",staticClass:"autocomplete-suggestions"},t._l(t.suggestions,function(r,i){return n("div",{key:i,staticClass:"suggestion",class:{highlighted:i===t.currentSuggestionIndex},on:{click:function(a){return t.applySuggestion(r)},keyup:function(a){return!a.type.indexOf("key")&&t._k(a.keyCode,"enter",13,a.key,"Enter")?null:t.applySuggestion(r)}}},[t._v(" "+t._s(r)+" ")])}),0)])},Ha=[],Wa=G(Va,qa,Ha,!1,null,"a5b6e3b9",null,null);const ei=Wa.exports;const Ua={props:{agent:{type:Object,required:!0}},data(){return{loading:!1,form:{command:"",literal:!1,scriptCommand:!1},literal:{disabled:!1,tooltipText:"This will ensure that aliased commands such as whoami or ps do not execute the built-in agent aliases."},scriptCommand:{tooltipText:'Execute a script command. The function being executing should first be loading via the "Script Import" functionality.'},commands:[]}},watch:{"form.scriptCommand":{handler(e){e?(this.form.literal=!1,this.literal.disabled=!0):this.literal.disabled=!1}}},methods:{async submit(){this.form.command.length<1||(this.loading=!0,this.form.command.trim()==="sysinfo"?await bt(this.agent.session_id):this.form.scriptCommand?await Yi(this.agent.session_id,this.form.command):await Be(this.agent.session_id,this.form.command,this.form.literal),this.form.command="",this.loading=!1,this.$snack.success(`Shell Command queued for ${this.agent.name}`))}}};var Ja=function(){var t=this,n=t._self._c;return n("div",{staticStyle:{padding:"10px"}},[n(Me,{ref:"form",staticClass:"form",nativeOn:{submit:function(r){return r.preventDefault(),t.submit.apply(null,arguments)}}},[n(St,[n(De,[n(ne,{attrs:{cols:"10"}},[n("div",{staticStyle:{display:"flex"}},[n(Gt,{staticClass:"pr-2",attrs:{label:"Script Command"},model:{value:t.form.scriptCommand,callback:function(r){t.$set(t.form,"scriptCommand",r)},expression:"form.scriptCommand"}}),n(Ct,{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function({on:r}){return[n(W,t._g({staticClass:"pr-2",attrs:{small:""}},r),[t._v(" fa-question-circle ")])]}}])},[n("p",[t._v(t._s(t.scriptCommand.tooltipText))])]),n(Gt,{staticClass:"pr-2",attrs:{label:"Literal",disabled:t.literal.disabled},model:{value:t.form.literal,callback:function(r){t.$set(t.form,"literal",r)},expression:"form.literal"}}),n(Ct,{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function({on:r}){return[n(W,t._g({staticClass:"pr-2",attrs:{small:""}},r),[t._v(" fa-question-circle ")])]}}])},[n("p",[t._v(t._s(t.literal.tooltipText))])]),n(pe,{attrs:{dense:"",outlined:"",label:"Shell Command"},model:{value:t.form.command,callback:function(r){t.$set(t.form,"command",r)},expression:"form.command"}})],1)]),n(ne,{attrs:{cols:"2",md:"2"}},[n(Y,{attrs:{color:"primary",loading:t.loading,type:"submit"}},[t._v(" Run ")])],1)],1)],1)],1)],1)},Ya=[],Ka=G(Ua,Ja,Ya,!1,null,"acc6d274",null,null);const ti=Ka.exports,Ga={props:{value:Boolean,loading:{type:Boolean,default:!1}},data(){return{pathToFile:"",rules:{pathToFile:[e=>!!e||"PathToFile is required"]}}},computed:{show:{get(){return this.value},set(e){this.$emit("input",e)}}},watch:{value(e){e===!1&&this.$refs.form.reset()}},methods:{async submit(){!this.$refs.form.validate()||this.$emit("submit",{pathToFile:this.pathToFile})}}};var Za=function(){var t=this,n=t._self._c;return n(je,{ref:"downloadDialog",attrs:{"max-width":"500px"},model:{value:t.show,callback:function(r){t.show=r},expression:"show"}},[n(ee,[n(Re,[n("span",{staticClass:"headline"},[t._v("Download")])]),n(me,[n(Me,{ref:"form",on:{submit:function(r){r.preventDefault()}}},[n(St,[n(De,[n(ne,{attrs:{cols:"12"}},[n(pe,{attrs:{label:"path/to/file",rules:t.rules.pathToFile,outlined:"",dense:"",required:""},model:{value:t.pathToFile,callback:function(r){t.pathToFile=r},expression:"pathToFile"}})],1)],1)],1)],1)],1),n(Oe,[n(ue),n(Y,{attrs:{color:"blue darken-1",text:""},on:{click:function(r){r.stopPropagation(),t.show=!1}}},[t._v(" Close ")]),n(Y,{attrs:{color:"blue darken-1",text:"",loading:t.loading},on:{click:t.submit}},[t._v(" Save ")])],1)],1)],1)},Xa=[],Qa=G(Ga,Za,Xa,!1,null,null,null,null);const ni=Qa.exports,Dt=1048576,eo={components:{FileInput:$n},props:{value:Boolean,language:{type:String,default:""},loading:{type:Boolean,default:!1},pathToFile:{type:String,default:""}},data(){return{formatBytes:tr,maxBytes:Dt,descriptionLimit:80,entries:[],internalPathToFile:this.pathToFile,file:null,rules:{pathToFile:[e=>!!e||"PathToFile is required"],fileInput:[e=>!!e||"File required",e=>!!e&&e.size!!e||"File required",e=>!!e&&e.sizet in e?lo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ho=(e,t)=>{for(var n in t||(t={}))si.call(t,n)&&fn(e,n,t[n]);if(Te)for(var n of Te(t))ai.call(t,n)&&fn(e,n,t[n]);return e},po=(e,t)=>uo(e,co(t)),fo=(e,t)=>{var n={};for(var r in e)si.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Te)for(var r of Te(e))t.indexOf(r)<0&&ai.call(e,r)&&(n[r]=e[r]);return n};function oi(e,t,n,r,i,a,o,u){var c=typeof e=="function"?e.options:e;t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),a&&(c._scopeId="data-v-"+a);var d;if(o?(d=function(g){g=g||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,!g&&typeof __VUE_SSR_CONTEXT__<"u"&&(g=__VUE_SSR_CONTEXT__),i&&i.call(this,g),g&&g._registeredComponents&&g._registeredComponents.add(o)},c._ssrRegister=d):i&&(d=u?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),d)if(c.functional){c._injectStyles=d;var p=c.render;c.render=function(b,_){return d.call(_),p(b,_)}}else{var f=c.beforeCreate;c.beforeCreate=f?[].concat(f,d):[d]}return{exports:e,options:c}}const mo={name:"splitpanes",props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((e,t)=>(e[t.id]=t)&&e,{})}},methods:{updatePaneComponents(){this.panes.forEach(e=>{e.update&&e.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[e.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(e,t){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=t},onMouseMove(e){this.touch.mouseDown&&(e.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(e)),this.$emit("resize",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(e,t){"ontouchstart"in window&&(e.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===t?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(e,t),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=t,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[t])},onSplitterDblClick(e,t){let n=0;this.panes=this.panes.map((r,i)=>(r.size=i===t?r.max:r.min,i!==t&&(n+=r.min),r)),this.panes[t].size-=n,this.$emit("pane-maximize",this.panes[t])},onPaneClick(e,t){this.$emit("pane-click",this.indexedPanes[t])},getCurrentMouseDrag(e){const t=this.container.getBoundingClientRect(),{clientX:n,clientY:r}="ontouchstart"in window&&e.touches?e.touches[0]:e;return{x:n-t.left,y:r-t.top}},getCurrentDragPercentage(e){e=e[this.horizontal?"y":"x"];const t=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(e=t-e),e*100/t},calculatePanesSize(e){const t=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(t),nextPanesSize:this.sumNextPanesSize(t),prevReachedMinPanes:0,nextReachedMinPanes:0};const r=0+(this.pushOtherPanes?0:n.prevPanesSize),i=100-(this.pushOtherPanes?0:n.nextPanesSize),a=Math.max(Math.min(this.getCurrentDragPercentage(e),i),r);let o=[t,t+1],u=this.panes[o[0]]||null,c=this.panes[o[1]]||null;const d=u.max<100&&a>=u.max+n.prevPanesSize,p=c.max<100&&a<=100-(c.max+this.sumNextPanesSize(t+1));if(d||p){d?(u.size=u.max,c.size=Math.max(100-u.max-n.prevPanesSize-n.nextPanesSize,0)):(u.size=Math.max(100-c.max-n.prevPanesSize-this.sumNextPanesSize(t+1),0),c.size=c.max);return}if(this.pushOtherPanes){const f=this.doPushOtherPanes(n,a);if(!f)return;({sums:n,panesToResize:o}=f),u=this.panes[o[0]]||null,c=this.panes[o[1]]||null}u!==null&&(u.size=Math.min(Math.max(a-n.prevPanesSize-n.prevReachedMinPanes,u.min),u.max)),c!==null&&(c.size=Math.min(Math.max(100-a-n.nextPanesSize-n.nextReachedMinPanes,c.min),c.max))},doPushOtherPanes(e,t){const n=this.touch.activeSplitter,r=[n,n+1];return t{a>r[0]&&a<=n&&(i.size=i.min,e.prevReachedMinPanes+=i.min)}),e.prevPanesSize=this.sumPrevPanesSize(r[0]),r[0]===void 0)?(e.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((i,a)=>{a>0&&a<=n&&(i.size=i.min,e.prevReachedMinPanes+=i.min)}),this.panes[r[1]].size=100-e.prevReachedMinPanes-this.panes[0].min-e.prevPanesSize-e.nextPanesSize,null):t>100-e.nextPanesSize-this.panes[r[1]].min&&(r[1]=this.findNextExpandedPane(n).index,e.nextReachedMinPanes=0,r[1]>n+1&&this.panes.forEach((i,a)=>{a>n&&a{a=n+1&&(i.size=i.min,e.nextReachedMinPanes+=i.min)}),this.panes[r[0]].size=100-e.prevPanesSize-e.nextReachedMinPanes-this.panes[this.panesCount-1].min-e.nextPanesSize,null):{sums:e,panesToResize:r}},sumPrevPanesSize(e){return this.panes.reduce((t,n,r)=>t+(rt+(r>e+1?n.size:0),0)},findPrevExpandedPane(e){return[...this.panes].reverse().find(n=>n.indexn.min)||{}},findNextExpandedPane(e){return this.panes.find(n=>n.index>e+1&&n.size>n.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(t=>{const n=t.classList.contains("splitpanes__pane"),r=t.classList.contains("splitpanes__splitter");if(!n&&!r){t.parentNode.removeChild(t),console.warn("Splitpanes: Only elements are allowed at the root of . One of your DOM nodes was removed.");return}})},addSplitter(e,t,n=!1){const r=e-1,i=document.createElement("div");i.classList.add("splitpanes__splitter"),n||(i.onmousedown=a=>this.onMouseDown(a,r),typeof window<"u"&&"ontouchstart"in window&&(i.ontouchstart=a=>this.onMouseDown(a,r)),i.onclick=a=>this.onSplitterClick(a,r+1)),this.dblClickSplitter&&(i.ondblclick=a=>this.onSplitterDblClick(a,r+1)),t.parentNode.insertBefore(i,t)},removeSplitter(e){e.onmousedown=void 0,e.onclick=void 0,e.ondblclick=void 0,e.parentNode.removeChild(e)},redoSplitters(){const e=Array.from(this.container.children);e.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let t=0;e.forEach(n=>{n.className.includes("splitpanes__pane")&&(!t&&this.firstSplitter?this.addSplitter(t,n,!0):t&&this.addSplitter(t,n),t++)})},requestUpdate(e){var t=e,{target:n}=t,r=fo(t,["target"]);const i=this.indexedPanes[n._uid];Object.entries(r).forEach(([a,o])=>i[a]=o)},onPaneAdd(e){let t=-1;Array.from(e.$el.parentNode.children).some(i=>(i.className.includes("splitpanes__pane")&&t++,i===e.$el));const n=parseFloat(e.minSize),r=parseFloat(e.maxSize);this.panes.splice(t,0,{id:e._uid,index:t,min:isNaN(n)?0:n,max:isNaN(r)?100:r,size:e.size===null?null:parseFloat(e.size),givenSize:e.size,update:e.update}),this.panes.forEach((i,a)=>i.index=a),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[t]}),this.$emit("pane-add",{index:t,panes:this.panes.map(i=>({min:i.min,max:i.max,size:i.size}))})})},onPaneRemove(e){const t=this.panes.findIndex(r=>r.id===e._uid),n=this.panes.splice(t,1)[0];this.panes.forEach((r,i)=>r.index=i),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:po(ho({},n),{index:t})}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(r=>({min:r.min,max:r.max,size:r.size}))})})},resetPaneSizes(e={}){!e.addedPane&&!e.removedPane?this.initialPanesSizing():this.panes.some(t=>t.givenSize!==null||t.min||t.max<100)?this.equalizeAfterAddOrRemove(e):this.equalize(),this.ready&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size})))},equalize(){const e=100/this.panesCount;let t=0,n=[],r=[];this.panes.forEach(i=>{i.size=Math.max(Math.min(e,i.max),i.min),t-=i.size,i.size>=i.max&&n.push(i.id),i.size<=i.min&&r.push(i.id)}),t>.1&&this.readjustSizes(t,n,r)},initialPanesSizing(){100/this.panesCount;let e=100,t=[],n=[],r=0;this.panes.forEach(a=>{e-=a.size,a.size!==null&&r++,a.size>=a.max&&t.push(a.id),a.size<=a.min&&n.push(a.id)});let i=100;e>.1&&(this.panes.forEach(a=>{a.size===null&&(a.size=Math.max(Math.min(e/(this.panesCount-r),a.max),a.min)),i-=a.size}),i>.1&&this.readjustSizes(e,t,n))},equalizeAfterAddOrRemove({addedPane:e,removedPane:t}={}){let n=100/this.panesCount,r=0,i=[],a=[];e&&e.givenSize!==null&&(n=(100-e.givenSize)/(this.panesCount-1)),this.panes.forEach(o=>{r-=o.size,o.size>=o.max&&i.push(o.id),o.size<=o.min&&a.push(o.id)}),!(Math.abs(r)<.1)&&(this.panes.forEach(o=>{e&&e.givenSize!==null&&e.id===o.id||(o.size=Math.max(Math.min(n,o.max),o.min)),r-=o.size,o.size>=o.max&&i.push(o.id),o.size<=o.min&&a.push(o.id)}),r>.1&&this.readjustSizes(r,i,a))},readjustSizes(e,t,n){let r;e>0?r=e/(this.panesCount-t.length):r=e/(this.panesCount-n.length),this.panes.forEach((i,a)=>{if(e>0&&!t.includes(i.id)){const o=Math.max(Math.min(i.size+r,i.max),i.min),u=o-i.size;e-=u,i.size=o}else if(!n.includes(i.id)){const o=Math.max(Math.min(i.size+r,i.max),i.min),u=o-i.size;e-=u,i.size=o}i.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[i.id].size}%`})}),Math.abs(e)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(e){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((n,r)=>{n.ondblclick=e?i=>this.onSplitterDblClick(i,r):void 0})}},beforeDestroy(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.$emit("ready"),this.ready=!0},render(e){return e("div",{ref:"container",class:["splitpanes",`splitpanes--${this.horizontal?"horizontal":"vertical"}`,{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default)}};let Do,go;const mn={};var yo=oi(mo,Do,go,!1,bo,null,null,null);function bo(e){for(let t in mn)this[t]=mn[t]}var vo=function(){return yo.exports}(),Co=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"splitpanes__pane",style:e.style,on:{click:function(r){return e.onPaneClick(r,e._uid)}}},[e._t("default")],2)},wo=[];const _o={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:null},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeDestroy(){this.onPaneRemove(this)},methods:{update(e){this.style=e}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(e){this.requestUpdate({target:this,size:e})},minSizeNumber(e){this.requestUpdate({target:this,min:e})},maxSizeNumber(e){this.requestUpdate({target:this,max:e})}}},Dn={};var Fo=oi(_o,Co,wo,!1,ko,null,null,null);function ko(e){for(let t in Dn)this[t]=Dn[t]}var Eo=function(){return Fo.exports}();const $o={name:"AgentEdit",components:{AgentForm:Ln,AgentInteract:ti,AgentExecuteModule:Le,AgentFileBrowser:zn,AgentTasksList:xn,AgentTerminal:ei,AgentUploadDialog:ii,AgentScriptImportDialog:ri,AgentDownloadDialog:ni,TooltipButton:Q,TooltipButtonToggle:Bn,ErrorStateAlert:En,Splitpanes:vo,Pane:Eo},data(){return{agent:{},nameLoading:!1,uploadLoading:!1,downloadLoading:!1,scriptImportLoading:!1,nameDialog:!1,uploadDialog:!1,downloadDialog:!1,scriptImportDialog:!1,initialized:!0,errorState:!1,paneSize:100,rightPaneInitialized:!1,pathToFile:"",isRefreshTasks:!0,interactTab:"form"}},computed:{...vn({subscribedAgents:"agent/subscribed"}),subscribed(){return this.subscribedAgents[this.id]||!1},breads(){return[{text:"Agents",disabled:this.isChild,to:"/agents",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/agent-edit"}]},archived(){return this.agent.archived},breadcrumbName(){return this.agent.name||this.id},id(){return this.$route.params.id},isChild(){return!!this.$route.query.hideSideBar},hideSideBar(){return this.$route.query.hideSideBar},tab:{set(e){this.$router.replace({query:{...this.$route.query,tab:e}})},get(){return this.$route.query.tab||"interact"}}},watch:{id(e){e&&this.getAgent(e)},paneSize(e){this.rightPaneInitialized||e<99&&(this.rightPaneInitialized=!0)},uploadDialog(e){e||(this.pathToFile="")}},mounted(){this.getAgent(this.$route.params.id)},methods:{subscribe(){this.$store.dispatch("agent/subscribe",{sessionId:this.id})},unsubscribe(){this.$store.dispatch("agent/unsubscribe",{sessionId:this.id})},toggleCollapsePane(){this.paneSize>95?this.paneSize=50:this.paneSize=100},splitPaneHeight(){return`height: calc(96vh - 104px ${this.isChild?"":"- 36px"})`},popout(){window.open(`${window.location.href}/?hideSideBar=true`,"popup","width=600,height=600"),this.$router.push({name:"agents"})},getAgent(e){Ki(e).then(t=>{this.agent=t}).catch(()=>{this.errorState=!0})},async doScriptImport({file:e}){if(!(this.scriptImportLoading||e==null)){this.scriptImportLoading=!0;try{await Gi(this.agent.session_id,e),this.$snack.success(`Tasked agent ${this.agent.name} to import script ${e.filename}`)}catch(t){this.$snack.error(`Error: ${t}`)}this.scriptImportLoading=!1,this.scriptImportDialog=!1}},async killAgent(){await this.$root.$confirm("Kill Agent",`Do you want to kill agent ${this.agent.name}?`,{color:"red"})&&(this.$store.dispatch("agent/killAgent",{sessionId:this.agent.session_id}),this.$snack.success(`Agent ${this.agent.name} tasked to run TASK_EXIT.`),this.$router.push({name:"agents"}))},async clearQueue(){const t=(await Zi(this.agent.session_id,{limit:-1,page:1,status:"queued"})).records.map(n=>n.id);if(t.length===0){this.$snack.info("No queued tasks to clear.");return}await this.$root.$confirm("",`Do you want to clear ${t.length} queued tasks?`,{color:"red"})&&(this.$store.dispatch("agent/clearQueue",{name:this.agent.session_id,tasks:t}),this.$snack.success(`Clearing queued tasks for Agent ${this.agent.session_id}.`))},openUploadDialogPrefilled({pathToFile:e}){this.uploadDialog=!0,this.pathToFile=e},async doUpload({file:e,pathToFile:t}){if(!(this.uploadLoading||e==null||t==null||t.length<1)){this.uploadLoading=!0;try{await Xi(this.agent.session_id,e,t),this.$snack.success(`Tasked agent ${this.agent.name} to upload file to ${t}`)}catch(n){this.$snack.error(`Error: ${n}`)}this.uploadLoading=!1,this.uploadDialog=!1}},async doDownload({pathToFile:e}){if(!(this.downloadLoading||e==null||e.length<1)){this.downloadLoading=!0;try{await _n(this.agent.session_id,e),this.$snack.success(`Tasked agent ${this.agent.name} to downloaded file ${e}`)}catch(t){this.$snack.error(`Error: ${t}`)}this.downloadLoading=!1,this.downloadDialog=!1}},scrollResults(){}}};var So=function(){var t=this,n=t._self._c;return n("div",[n("div",[n("portal",{attrs:{to:"app-bar-extension"}},[n("div",{staticStyle:{display:"flex","flex-direction":"row",width:"100%"}},[n(Zt,{attrs:{"align-with-title":""},model:{value:t.tab,callback:function(r){t.tab=r},expression:"tab"}},[n(se,{key:"interact",attrs:{href:"#interact"}},[t._v(" Interact "),n(W,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-arrow-pointer ")])],1),n(se,{key:"file-browser",attrs:{href:"#file-browser"}},[t._v(" File Browser "),n(W,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-folder-open ")])],1),n(se,{key:"tasks",attrs:{href:"#tasks"}},[t._v(" Tasks "),n(W,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-sticky-note ")])],1),n(se,{key:"view",attrs:{href:"#view"}},[t._v(" View "),n(W,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-eye ")])],1)],1),n("div",{staticStyle:{display:"flex","flex-direction":"row"}},[t._e()],1)],1)]),n("portal",{attrs:{to:"app-bar"}},[n("div",{staticClass:"v-toolbar__content",staticStyle:{width:"100%"}},[n(sr,{attrs:{items:t.breads}}),t.agent.high_integrity?n(Ct,{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function({on:r}){return[n(W,t._g({attrs:{small:""}},r),[t._v(" fa-user-cog ")])]}}],null,!1,1636569802)},[n("span",[t._v("Elevated Process")])]):t._e(),t.initialized&&t.archived?n(ar,[t._v(" Archived ")]):t._e(),n(ue),!t.errorState&&t.initialized&&!t.archived?n("div",{staticClass:"pt-2",staticStyle:{display:"flex","flex-direction":"row","align-items":"center"}},[n(ri,{attrs:{loading:t.scriptImportLoading},on:{submit:t.doScriptImport},model:{value:t.scriptImportDialog,callback:function(r){t.scriptImportDialog=r},expression:"scriptImportDialog"}}),n(ii,{attrs:{language:t.agent.language,loading:t.uploadLoading,"path-to-file":t.pathToFile},on:{submit:t.doUpload},model:{value:t.uploadDialog,callback:function(r){t.uploadDialog=r},expression:"uploadDialog"}}),n(ni,{attrs:{loading:t.downloadLoading},on:{submit:t.doDownload},model:{value:t.downloadDialog,callback:function(r){t.downloadDialog=r},expression:"downloadDialog"}}),n(Bn,{attrs:{icon:"fa-redo","button-text":t.isRefreshTasks?"On":"Off",text:"Auto-refresh tasks"},model:{value:t.isRefreshTasks,callback:function(r){t.isRefreshTasks=r},expression:"isRefreshTasks"}}),n(Q,{attrs:{icon:"fa-calendar-times",text:"Clear Queued Tasks"},on:{click:t.clearQueue}}),n(Q,{attrs:{icon:"fa-upload",text:"Upload"},on:{click:function(r){t.uploadDialog=!0}}}),n(Q,{attrs:{icon:"fa-download",text:"Download"},on:{click:function(r){t.downloadDialog=!0}}}),n(Q,{attrs:{icon:"fa-file-import",text:"Import Script"},on:{click:function(r){t.scriptImportDialog=!0}}}),t.hideSideBar?t._e():n(Q,{attrs:{icon:"fa-external-link-alt",text:"Popout"},on:{click:t.popout}}),t.subscribed?n(Q,{attrs:{icon:"fa-bell-slash",text:"Unsubscribe from Notifications"},on:{click:t.unsubscribe}}):n(Q,{attrs:{icon:"fa-bell",text:"Subscribe to Notifications"},on:{click:t.subscribe}}),t.initialized&&!t.archived?n(Q,{attrs:{icon:"fa-trash-alt",text:"Kill Agent",color:"error"},on:{click:t.killAgent}}):t._e()],1):t._e()],1)]),t.errorState?n(En,{attrs:{"resource-id":t.id,"resource-type":"agent"}}):t._e(),t.errorState?t._e():n("div",{style:t.splitPaneHeight()},[n("splitpanes",{attrs:{disabled:!0},on:{resize:function(r){t.paneSize=r[0].size}}},[n("pane",{attrs:{"min-size":"30",size:t.paneSize}},[n(Xt,{staticClass:"scrollable-pane",model:{value:t.tab,callback:function(r){t.tab=r},expression:"tab"}},[n(ae,{key:"interact",attrs:{value:"interact",transition:!1,"reverse-transition":!1}},[t.initialized&&!t.archived?n(ee,{attrs:{flat:""}},[n(Zt,{attrs:{height:30,"align-with-title":""},model:{value:t.interactTab,callback:function(r){t.interactTab=r},expression:"interactTab"}},[n(se,{key:"form",attrs:{href:"#form"}},[t._v(" Form "),n(W,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-list-check ")])],1),n(se,{key:"terminal",attrs:{href:"#terminal"}},[t._v(" Terminal (Beta) "),n(W,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-terminal ")])],1)],1),n(Xt,{model:{value:t.interactTab,callback:function(r){t.interactTab=r},expression:"interactTab"}},[n(ae,{key:"form",attrs:{value:"form",transition:!1,"reverse-transition":!1}},[n(ti,{attrs:{agent:t.agent}}),n(Qi),n("h4",{staticClass:"pl-4 pt-2"},[t._v("Execute Module")]),n(Le,{attrs:{agents:[t.agent.session_id]}})],1),n(ae,{key:"terminal",staticStyle:{height:"75vh"},attrs:{value:"terminal",transition:!1,"reverse-transition":!1}},[n(ei,{staticClass:"mt-2",attrs:{agent:t.agent}})],1)],1)],1):t.initialized&&t.archived?n(ee,{attrs:{flat:""}},[n(me,[n(kn,{attrs:{type:"error",icon:"fa-exclamation-triangle",value:!0}},[t._v(" This agent is archived. ")])],1)],1):t._e()],1),n(ae,{key:"browser",attrs:{value:"file-browser",transition:!1,"reverse-transition":!1}},[n(ee,{attrs:{flat:""}},[n(zn,{attrs:{agent:t.agent,"read-only":t.initialized&&t.archived},on:{openUploadDialog:t.openUploadDialogPrefilled}})],1)],1),n(ae,{key:"tasks",attrs:{value:"tasks",transition:!1,"reverse-transition":!1}},[n(ee,{attrs:{flat:""}},[n(xn,{attrs:{agent:t.agent,"refresh-tasks":t.isRefreshTasks}})],1)],1),n(ae,{key:"view",attrs:{value:"view",transition:!1,"reverse-transition":!1}},[n(ee,{attrs:{flat:""}},[n(Ln,{attrs:{"read-only":t.initialized&&t.archived,agent:t.agent},on:{"refresh-agent":function(r){return t.getAgent(t.id)}}})],1)],1)],1)],1)],1)],1)],1)])},xo=[],Bo=G($o,So,xo,!1,null,null,null,null);const al=Bo.exports;export{al as default}; diff --git a/dist/assets/AgentEdit.1ab1b8c0.css b/dist/assets/AgentEdit.9c7772ac.css similarity index 63% rename from dist/assets/AgentEdit.1ab1b8c0.css rename to dist/assets/AgentEdit.9c7772ac.css index b9a6d49..3763f62 100644 --- a/dist/assets/AgentEdit.1ab1b8c0.css +++ b/dist/assets/AgentEdit.9c7772ac.css @@ -1 +1 @@ -.v-date-picker-title{display:flex;justify-content:space-between;flex-direction:column;flex-wrap:wrap;line-height:1}.v-application--is-ltr .v-date-picker-title .v-picker__title__btn{text-align:left}.v-application--is-rtl .v-date-picker-title .v-picker__title__btn{text-align:right}.v-date-picker-title__year{align-items:center;display:inline-flex;font-size:14px;font-weight:500;margin-bottom:8px}.v-date-picker-title__date{font-size:34px;text-align:left;font-weight:500;position:relative;overflow:hidden;padding-bottom:8px;margin-bottom:-8px}.v-date-picker-title__date>div{position:relative}.v-date-picker-title--disabled{pointer-events:none}.theme--light.v-date-picker-header .v-date-picker-header__value:not(.v-date-picker-header__value--disabled) button:not(:hover):not(:focus){color:#000000de}.theme--light.v-date-picker-header .v-date-picker-header__value--disabled button{color:#00000061}.theme--dark.v-date-picker-header .v-date-picker-header__value:not(.v-date-picker-header__value--disabled) button:not(:hover):not(:focus){color:#fff}.theme--dark.v-date-picker-header .v-date-picker-header__value--disabled button{color:#ffffff80}.v-date-picker-header{padding:4px 16px;align-items:center;display:flex;justify-content:space-between;position:relative}.v-date-picker-header .v-btn{margin:0;z-index:auto}.v-date-picker-header .v-icon{cursor:pointer;user-select:none}.v-date-picker-header__value{flex:1;text-align:center;position:relative;overflow:hidden}.v-date-picker-header__value div{transition:.3s cubic-bezier(.25,.8,.5,1);width:100%}.v-date-picker-header__value button{cursor:pointer;font-weight:700;outline:none;padding:.5rem;transition:.3s cubic-bezier(.25,.8,.5,1)}.v-date-picker-header--disabled{pointer-events:none}.theme--light.v-date-picker-table th,.theme--light.v-date-picker-table .v-date-picker-table--date__week{color:#00000061}.theme--dark.v-date-picker-table th,.theme--dark.v-date-picker-table .v-date-picker-table--date__week{color:#ffffff80}.v-date-picker-table{position:relative;padding:0 12px;height:242px}.v-date-picker-table table{transition:.3s cubic-bezier(.25,.8,.5,1);top:0;table-layout:fixed;width:100%}.v-date-picker-table td,.v-date-picker-table th{text-align:center;position:relative}.v-date-picker-table th{font-size:12px}.v-date-picker-table--date .v-btn{height:32px;width:32px}.v-date-picker-table .v-btn{z-index:auto;margin:0;font-size:12px}.v-date-picker-table .v-btn.v-btn--active{color:#fff}.v-date-picker-table--month td{width:33.333333%;height:56px;vertical-align:middle;text-align:center}.v-date-picker-table--month td .v-btn{margin:0 auto;max-width:140px;min-width:40px;width:100%}.v-date-picker-table--date th{padding:8px 0;font-weight:600}.v-date-picker-table--date td{width:45px}.v-date-picker-table__events{height:8px;left:0;position:absolute;text-align:center;white-space:pre;width:100%}.v-date-picker-table__events>div{border-radius:50%;display:inline-block;height:8px;margin:0 1px;width:8px}.v-date-picker-table--date .v-date-picker-table__events{bottom:6px}.v-date-picker-table--month .v-date-picker-table__events{bottom:8px}.v-date-picker-table__current .v-date-picker-table__events{margin-bottom:-1px}.v-date-picker-table--disabled{pointer-events:none}.v-date-picker-years{font-size:16px;font-weight:400;height:290px;list-style-type:none;overflow:auto;text-align:center}.v-date-picker-years.v-date-picker-years{padding:0}.v-date-picker-years li{cursor:pointer;padding:8px 0;transition:none}.v-date-picker-years li.active{font-size:26px;font-weight:500;padding:10px 0}.v-date-picker-years li:hover{background:rgba(0,0,0,.12)}.v-picker--landscape .v-date-picker-years{padding:0;height:290px}.theme--light.v-picker__title{background:#e0e0e0}.theme--dark.v-picker__title{background:#616161}.theme--light.v-picker__body{background:#FFFFFF}.theme--dark.v-picker__body{background:#424242}.v-picker{border-radius:4px;contain:layout style;display:inline-flex;flex-direction:column;font-size:1rem;vertical-align:top;position:relative}.v-picker--full-width{display:flex;width:100%}.v-picker--full-width>.v-picker__body{margin:initial}.v-picker__title{color:#fff;border-top-left-radius:4px;border-top-right-radius:4px;padding:16px}.v-picker__title__btn{transition:.3s cubic-bezier(.25,.8,.5,1)}.v-picker__title__btn:not(.v-picker__title__btn--active){opacity:.6;cursor:pointer}.v-picker__title__btn:not(.v-picker__title__btn--active):hover:not(:focus){opacity:1}.v-picker__title__btn--readonly{pointer-events:none}.v-picker__title__btn--active{opacity:1}.v-picker__body{height:auto;overflow:hidden;position:relative;z-index:0;flex:1 0 auto;display:flex;flex-direction:column;align-items:center;margin:0 auto}.v-picker__body>div{width:100%}.v-picker__body>div.fade-transition-leave-active{position:absolute}.v-picker--landscape .v-picker__title{border-top-right-radius:0;border-bottom-right-radius:0;width:170px;position:absolute;top:0;height:100%;z-index:1}.v-application--is-ltr .v-picker--landscape .v-picker__title{left:0}.v-application--is-rtl .v-picker--landscape .v-picker__title{right:0}.v-application--is-ltr .v-picker--landscape .v-picker__body:not(.v-picker__body--no-title),.v-application--is-ltr .v-picker--landscape .v-picker__actions:not(.v-picker__actions--no-title){margin-left:170px;margin-right:0}.v-application--is-rtl .v-picker--landscape .v-picker__body:not(.v-picker__body--no-title),.v-application--is-rtl .v-picker--landscape .v-picker__actions:not(.v-picker__actions--no-title){margin-right:170px;margin-left:0}.v-picker--flat{box-shadow:0 0 #0003,0 0 #00000024,0 0 #0000001f}.theme--light.v-treeview{color:#000000de}.theme--light.v-treeview--hoverable .v-treeview-node__root:hover:before,.theme--light.v-treeview .v-treeview-node--click>.v-treeview-node__root:hover:before{opacity:.04}.theme--light.v-treeview--hoverable .v-treeview-node__root:focus:before,.theme--light.v-treeview .v-treeview-node--click>.v-treeview-node__root:focus:before{opacity:.12}.theme--light.v-treeview--hoverable .v-treeview-node__root--active:hover:before,.theme--light.v-treeview--hoverable .v-treeview-node__root--active:before,.theme--light.v-treeview .v-treeview-node--click>.v-treeview-node__root--active:hover:before,.theme--light.v-treeview .v-treeview-node--click>.v-treeview-node__root--active:before{opacity:.12}.theme--light.v-treeview--hoverable .v-treeview-node__root--active:focus:before,.theme--light.v-treeview .v-treeview-node--click>.v-treeview-node__root--active:focus:before{opacity:.16}.theme--light.v-treeview .v-treeview-node__root.v-treeview-node--active:hover:before,.theme--light.v-treeview .v-treeview-node__root.v-treeview-node--active:before{opacity:.12}.theme--light.v-treeview .v-treeview-node__root.v-treeview-node--active:focus:before{opacity:.16}.theme--light.v-treeview .v-treeview-node--disabled>.v-treeview-node__root>.v-treeview-node__content{color:#00000061!important}.theme--dark.v-treeview{color:#fff}.theme--dark.v-treeview--hoverable .v-treeview-node__root:hover:before,.theme--dark.v-treeview .v-treeview-node--click>.v-treeview-node__root:hover:before{opacity:.08}.theme--dark.v-treeview--hoverable .v-treeview-node__root:focus:before,.theme--dark.v-treeview .v-treeview-node--click>.v-treeview-node__root:focus:before{opacity:.24}.theme--dark.v-treeview--hoverable .v-treeview-node__root--active:hover:before,.theme--dark.v-treeview--hoverable .v-treeview-node__root--active:before,.theme--dark.v-treeview .v-treeview-node--click>.v-treeview-node__root--active:hover:before,.theme--dark.v-treeview .v-treeview-node--click>.v-treeview-node__root--active:before{opacity:.24}.theme--dark.v-treeview--hoverable .v-treeview-node__root--active:focus:before,.theme--dark.v-treeview .v-treeview-node--click>.v-treeview-node__root--active:focus:before{opacity:.32}.theme--dark.v-treeview .v-treeview-node__root.v-treeview-node--active:hover:before,.theme--dark.v-treeview .v-treeview-node__root.v-treeview-node--active:before{opacity:.24}.theme--dark.v-treeview .v-treeview-node__root.v-treeview-node--active:focus:before{opacity:.32}.theme--dark.v-treeview .v-treeview-node--disabled>.v-treeview-node__root>.v-treeview-node__content{color:#ffffff80!important}.v-treeview-node.v-treeview-node--shaped .v-treeview-node__root,.v-treeview-node.v-treeview-node--shaped .v-treeview-node__root:before{border-bottom-right-radius:24px!important;border-top-right-radius:24px!important}.v-treeview-node.v-treeview-node--shaped .v-treeview-node__root{margin-top:8px;margin-bottom:8px}.v-treeview-node.v-treeview-node--rounded .v-treeview-node__root,.v-treeview-node.v-treeview-node--rounded .v-treeview-node__root:before{border-radius:24px!important}.v-treeview-node.v-treeview-node--rounded .v-treeview-node__root{margin-top:8px;margin-bottom:8px}.v-treeview-node--click>.v-treeview-node__root,.v-treeview-node--click>.v-treeview-node__root>.v-treeview-node__content>*{cursor:pointer;user-select:none}.v-treeview-node.v-treeview-node--active .v-treeview-node__content .v-icon{color:inherit}.v-treeview-node__root{display:flex;align-items:center;min-height:48px;padding-left:8px;padding-right:8px;position:relative}.v-treeview-node__root:before{background-color:currentColor;bottom:0;content:"";left:0;opacity:0;pointer-events:none;position:absolute;right:0;top:0;transition:.3s cubic-bezier(.25,.8,.5,1)}.v-treeview-node__root:after{content:"";font-size:0;min-height:inherit}.v-treeview-node__children{transition:all .2s cubic-bezier(0,0,.2,1)}.v-treeview--dense .v-treeview-node__root{min-height:40px}.v-treeview--dense.v-treeview-node--shaped .v-treeview-node__root,.v-treeview--dense.v-treeview-node--shaped .v-treeview-node__root:before{border-bottom-right-radius:20px!important;border-top-right-radius:20px!important}.v-treeview--dense.v-treeview-node--shaped .v-treeview-node__root{margin-top:8px;margin-bottom:8px}.v-treeview--dense.v-treeview-node--rounded .v-treeview-node__root,.v-treeview--dense.v-treeview-node--rounded .v-treeview-node__root:before{border-radius:20px!important}.v-treeview--dense.v-treeview-node--rounded .v-treeview-node__root{margin-top:8px;margin-bottom:8px}.v-treeview-node__checkbox{width:24px;user-select:none}.v-application--is-ltr .v-treeview-node__checkbox{margin-left:6px}.v-application--is-rtl .v-treeview-node__checkbox{margin-right:6px}.v-treeview-node__toggle{width:24px;user-select:none}.v-treeview-node__toggle--loading{animation:progress-circular-rotate 1s linear infinite}.v-application--is-ltr .v-treeview-node__toggle{transform:rotate(-90deg)}.v-application--is-ltr .v-treeview-node__toggle--open{transform:none}.v-application--is-rtl .v-treeview-node__toggle{transform:rotate(90deg)}.v-application--is-rtl .v-treeview-node__toggle--open{transform:none}.v-treeview-node__prepend{min-width:24px}.v-application--is-ltr .v-treeview-node__prepend{margin-right:6px}.v-application--is-rtl .v-treeview-node__prepend{margin-left:6px}.v-treeview-node__append{min-width:24px}.v-application--is-ltr .v-treeview-node__append{margin-left:6px}.v-application--is-rtl .v-treeview-node__append{margin-right:6px}.v-treeview-node__level{width:24px}.v-treeview-node__label{flex:1;font-size:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.v-treeview-node__content{align-items:center;display:flex;flex-basis:0%;flex-grow:1;flex-shrink:0;min-width:0}.v-treeview-node__content .v-btn{flex-grow:0!important;flex-shrink:1!important}.v-application--is-ltr .v-treeview-node__content{margin-left:6px}.v-application--is-rtl .v-treeview-node__content{margin-right:6px}.column-not-editing{background-color:#0000001a;border-radius:5px;height:45px;cursor:pointer}.column-not-editing-dark{background-color:#ffffff1a;border-radius:5px;height:45px;cursor:pointer}.form[data-v-dbc9c040]{max-width:600px;width:100%}.v-treeview .v-btn__content{justify-content:left}.v-treeview .v-btn__content div{align-items:center}.splitpanes{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;height:100%}.splitpanes--vertical{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.splitpanes--horizontal{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.splitpanes--dragging *{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.splitpanes__pane{width:100%;height:100%;overflow:hidden}.splitpanes--vertical .splitpanes__pane{-webkit-transition:width .2s ease-out;-o-transition:width .2s ease-out;transition:width .2s ease-out}.splitpanes--horizontal .splitpanes__pane{-webkit-transition:height .2s ease-out;-o-transition:height .2s ease-out;transition:height .2s ease-out}.splitpanes--dragging .splitpanes__pane{-webkit-transition:none;-o-transition:none;transition:none}.splitpanes__splitter{-ms-touch-action:none;touch-action:none}.splitpanes--vertical>.splitpanes__splitter{min-width:1px;cursor:col-resize}.splitpanes--horizontal>.splitpanes__splitter{min-height:1px;cursor:row-resize}.splitpanes.default-theme .splitpanes__pane{background-color:#f2f2f2}.splitpanes.default-theme .splitpanes__splitter{background-color:#fff;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;-ms-flex-negative:0;flex-shrink:0}.splitpanes.default-theme .splitpanes__splitter:before,.splitpanes.default-theme .splitpanes__splitter:after{content:"";position:absolute;top:50%;left:50%;background-color:#00000026;-webkit-transition:background-color .3s;-o-transition:background-color .3s;transition:background-color .3s}.splitpanes.default-theme .splitpanes__splitter:hover:before,.splitpanes.default-theme .splitpanes__splitter:hover:after{background-color:#00000040}.splitpanes.default-theme .splitpanes__splitter:first-child{cursor:auto}.default-theme.splitpanes .splitpanes .splitpanes__splitter{z-index:1}.default-theme.splitpanes--vertical>.splitpanes__splitter,.default-theme .splitpanes--vertical>.splitpanes__splitter{width:7px;border-left:1px solid #eee;margin-left:-1px}.default-theme.splitpanes--vertical>.splitpanes__splitter:before,.default-theme.splitpanes--vertical>.splitpanes__splitter:after,.default-theme .splitpanes--vertical>.splitpanes__splitter:before,.default-theme .splitpanes--vertical>.splitpanes__splitter:after{-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);width:1px;height:30px}.default-theme.splitpanes--vertical>.splitpanes__splitter:before,.default-theme .splitpanes--vertical>.splitpanes__splitter:before{margin-left:-2px}.default-theme.splitpanes--vertical>.splitpanes__splitter:after,.default-theme .splitpanes--vertical>.splitpanes__splitter:after{margin-left:1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter,.default-theme .splitpanes--horizontal>.splitpanes__splitter{height:7px;border-top:1px solid #eee;margin-top:-1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:before,.default-theme.splitpanes--horizontal>.splitpanes__splitter:after,.default-theme .splitpanes--horizontal>.splitpanes__splitter:before,.default-theme .splitpanes--horizontal>.splitpanes__splitter:after{-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translate(-50%);width:30px;height:1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:before,.default-theme .splitpanes--horizontal>.splitpanes__splitter:before{margin-top:-2px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:after,.default-theme .splitpanes--horizontal>.splitpanes__splitter:after{margin-top:1px}.scrollable-pane{height:100%;overflow-y:auto;overflow-x:hidden}.v-toolbar__content>div>.v-tabs>.v-slide-group.v-tabs-bar,.v-toolbar__extension>div>.v-tabs>.v-slide-group.v-tabs-bar{background-color:inherit}.splitpanes__splitter{background-color:#fff;box-sizing:border-box;position:relative;flex-shrink:0}.splitpanes__splitter:before,.splitpanes__splitter:after{content:"";position:absolute;top:50%;left:50%;background-color:#00000026;transition:background-color .3s}.splitpanes__splitter:hover:before,.splitpanes__splitter:hover:after{background-color:#00000040}.splitpanes__splitter:first-child{cursor:auto}.splitpanes .splitpanes .splitpanes__splitter{z-index:1}.splitpanes--vertical>.splitpanes__splitter,.splitpanes--vertical>.splitpanes__splitter{width:7px;border-left:1px solid #eee;margin-left:-1px}.splitpanes--vertical>.splitpanes__splitter:before,.splitpanes--vertical>.splitpanes__splitter:after,.splitpanes--vertical>.splitpanes__splitter:before,.splitpanes--vertical>.splitpanes__splitter:after{transform:translateY(-50%);width:1px;height:30px}.splitpanes--vertical>.splitpanes__splitter:before,.splitpanes--vertical>.splitpanes__splitter:before{margin-left:-2px}.splitpanes--vertical>.splitpanes__splitter:after,.splitpanes--vertical>.splitpanes__splitter:after{margin-left:1px}.splitpanes--horizontal>.splitpanes__splitter,.splitpanes--horizontal>.splitpanes__splitter{height:7px;border-top:1px solid #eee;margin-top:-1px}.splitpanes--horizontal>.splitpanes__splitter:before,.splitpanes--horizontal>.splitpanes__splitter:after,.splitpanes--horizontal>.splitpanes__splitter:before,.splitpanes--horizontal>.splitpanes__splitter:after{transform:translate(-50%);width:30px;height:1px}.splitpanes--horizontal>.splitpanes__splitter:before,.splitpanes--horizontal>.splitpanes__splitter:before{margin-top:-2px}.splitpanes--horizontal>.splitpanes__splitter:after,.splitpanes--horizontal>.splitpanes__splitter:after{margin-top:1px} +.v-date-picker-title{display:flex;justify-content:space-between;flex-direction:column;flex-wrap:wrap;line-height:1}.v-application--is-ltr .v-date-picker-title .v-picker__title__btn{text-align:left}.v-application--is-rtl .v-date-picker-title .v-picker__title__btn{text-align:right}.v-date-picker-title__year{align-items:center;display:inline-flex;font-size:14px;font-weight:500;margin-bottom:8px}.v-date-picker-title__date{font-size:34px;text-align:left;font-weight:500;position:relative;overflow:hidden;padding-bottom:8px;margin-bottom:-8px}.v-date-picker-title__date>div{position:relative}.v-date-picker-title--disabled{pointer-events:none}.theme--light.v-date-picker-header .v-date-picker-header__value:not(.v-date-picker-header__value--disabled) button:not(:hover):not(:focus){color:#000000de}.theme--light.v-date-picker-header .v-date-picker-header__value--disabled button{color:#00000061}.theme--dark.v-date-picker-header .v-date-picker-header__value:not(.v-date-picker-header__value--disabled) button:not(:hover):not(:focus){color:#fff}.theme--dark.v-date-picker-header .v-date-picker-header__value--disabled button{color:#ffffff80}.v-date-picker-header{padding:4px 16px;align-items:center;display:flex;justify-content:space-between;position:relative}.v-date-picker-header .v-btn{margin:0;z-index:auto}.v-date-picker-header .v-icon{cursor:pointer;user-select:none}.v-date-picker-header__value{flex:1;text-align:center;position:relative;overflow:hidden}.v-date-picker-header__value div{transition:.3s cubic-bezier(.25,.8,.5,1);width:100%}.v-date-picker-header__value button{cursor:pointer;font-weight:700;outline:none;padding:.5rem;transition:.3s cubic-bezier(.25,.8,.5,1)}.v-date-picker-header--disabled{pointer-events:none}.theme--light.v-date-picker-table th,.theme--light.v-date-picker-table .v-date-picker-table--date__week{color:#00000061}.theme--dark.v-date-picker-table th,.theme--dark.v-date-picker-table .v-date-picker-table--date__week{color:#ffffff80}.v-date-picker-table{position:relative;padding:0 12px;height:242px}.v-date-picker-table table{transition:.3s cubic-bezier(.25,.8,.5,1);top:0;table-layout:fixed;width:100%}.v-date-picker-table td,.v-date-picker-table th{text-align:center;position:relative}.v-date-picker-table th{font-size:12px}.v-date-picker-table--date .v-btn{height:32px;width:32px}.v-date-picker-table .v-btn{z-index:auto;margin:0;font-size:12px}.v-date-picker-table .v-btn.v-btn--active{color:#fff}.v-date-picker-table--month td{width:33.333333%;height:56px;vertical-align:middle;text-align:center}.v-date-picker-table--month td .v-btn{margin:0 auto;max-width:140px;min-width:40px;width:100%}.v-date-picker-table--date th{padding:8px 0;font-weight:600}.v-date-picker-table--date td{width:45px}.v-date-picker-table__events{height:8px;left:0;position:absolute;text-align:center;white-space:pre;width:100%}.v-date-picker-table__events>div{border-radius:50%;display:inline-block;height:8px;margin:0 1px;width:8px}.v-date-picker-table--date .v-date-picker-table__events{bottom:6px}.v-date-picker-table--month .v-date-picker-table__events{bottom:8px}.v-date-picker-table__current .v-date-picker-table__events{margin-bottom:-1px}.v-date-picker-table--disabled{pointer-events:none}.v-date-picker-years{font-size:16px;font-weight:400;height:290px;list-style-type:none;overflow:auto;text-align:center}.v-date-picker-years.v-date-picker-years{padding:0}.v-date-picker-years li{cursor:pointer;padding:8px 0;transition:none}.v-date-picker-years li.active{font-size:26px;font-weight:500;padding:10px 0}.v-date-picker-years li:hover{background:rgba(0,0,0,.12)}.v-picker--landscape .v-date-picker-years{padding:0;height:290px}.theme--light.v-picker__title{background:#e0e0e0}.theme--dark.v-picker__title{background:#616161}.theme--light.v-picker__body{background:#FFFFFF}.theme--dark.v-picker__body{background:#424242}.v-picker{border-radius:4px;contain:layout style;display:inline-flex;flex-direction:column;font-size:1rem;vertical-align:top;position:relative}.v-picker--full-width{display:flex;width:100%}.v-picker--full-width>.v-picker__body{margin:initial}.v-picker__title{color:#fff;border-top-left-radius:4px;border-top-right-radius:4px;padding:16px}.v-picker__title__btn{transition:.3s cubic-bezier(.25,.8,.5,1)}.v-picker__title__btn:not(.v-picker__title__btn--active){opacity:.6;cursor:pointer}.v-picker__title__btn:not(.v-picker__title__btn--active):hover:not(:focus){opacity:1}.v-picker__title__btn--readonly{pointer-events:none}.v-picker__title__btn--active{opacity:1}.v-picker__body{height:auto;overflow:hidden;position:relative;z-index:0;flex:1 0 auto;display:flex;flex-direction:column;align-items:center;margin:0 auto}.v-picker__body>div{width:100%}.v-picker__body>div.fade-transition-leave-active{position:absolute}.v-picker--landscape .v-picker__title{border-top-right-radius:0;border-bottom-right-radius:0;width:170px;position:absolute;top:0;height:100%;z-index:1}.v-application--is-ltr .v-picker--landscape .v-picker__title{left:0}.v-application--is-rtl .v-picker--landscape .v-picker__title{right:0}.v-application--is-ltr .v-picker--landscape .v-picker__body:not(.v-picker__body--no-title),.v-application--is-ltr .v-picker--landscape .v-picker__actions:not(.v-picker__actions--no-title){margin-left:170px;margin-right:0}.v-application--is-rtl .v-picker--landscape .v-picker__body:not(.v-picker__body--no-title),.v-application--is-rtl .v-picker--landscape .v-picker__actions:not(.v-picker__actions--no-title){margin-right:170px;margin-left:0}.v-picker--flat{box-shadow:0 0 #0003,0 0 #00000024,0 0 #0000001f}.theme--light.v-treeview{color:#000000de}.theme--light.v-treeview--hoverable .v-treeview-node__root:hover:before,.theme--light.v-treeview .v-treeview-node--click>.v-treeview-node__root:hover:before{opacity:.04}.theme--light.v-treeview--hoverable .v-treeview-node__root:focus:before,.theme--light.v-treeview .v-treeview-node--click>.v-treeview-node__root:focus:before{opacity:.12}.theme--light.v-treeview--hoverable .v-treeview-node__root--active:hover:before,.theme--light.v-treeview--hoverable .v-treeview-node__root--active:before,.theme--light.v-treeview .v-treeview-node--click>.v-treeview-node__root--active:hover:before,.theme--light.v-treeview .v-treeview-node--click>.v-treeview-node__root--active:before{opacity:.12}.theme--light.v-treeview--hoverable .v-treeview-node__root--active:focus:before,.theme--light.v-treeview .v-treeview-node--click>.v-treeview-node__root--active:focus:before{opacity:.16}.theme--light.v-treeview .v-treeview-node__root.v-treeview-node--active:hover:before,.theme--light.v-treeview .v-treeview-node__root.v-treeview-node--active:before{opacity:.12}.theme--light.v-treeview .v-treeview-node__root.v-treeview-node--active:focus:before{opacity:.16}.theme--light.v-treeview .v-treeview-node--disabled>.v-treeview-node__root>.v-treeview-node__content{color:#00000061!important}.theme--dark.v-treeview{color:#fff}.theme--dark.v-treeview--hoverable .v-treeview-node__root:hover:before,.theme--dark.v-treeview .v-treeview-node--click>.v-treeview-node__root:hover:before{opacity:.08}.theme--dark.v-treeview--hoverable .v-treeview-node__root:focus:before,.theme--dark.v-treeview .v-treeview-node--click>.v-treeview-node__root:focus:before{opacity:.24}.theme--dark.v-treeview--hoverable .v-treeview-node__root--active:hover:before,.theme--dark.v-treeview--hoverable .v-treeview-node__root--active:before,.theme--dark.v-treeview .v-treeview-node--click>.v-treeview-node__root--active:hover:before,.theme--dark.v-treeview .v-treeview-node--click>.v-treeview-node__root--active:before{opacity:.24}.theme--dark.v-treeview--hoverable .v-treeview-node__root--active:focus:before,.theme--dark.v-treeview .v-treeview-node--click>.v-treeview-node__root--active:focus:before{opacity:.32}.theme--dark.v-treeview .v-treeview-node__root.v-treeview-node--active:hover:before,.theme--dark.v-treeview .v-treeview-node__root.v-treeview-node--active:before{opacity:.24}.theme--dark.v-treeview .v-treeview-node__root.v-treeview-node--active:focus:before{opacity:.32}.theme--dark.v-treeview .v-treeview-node--disabled>.v-treeview-node__root>.v-treeview-node__content{color:#ffffff80!important}.v-treeview-node.v-treeview-node--shaped .v-treeview-node__root,.v-treeview-node.v-treeview-node--shaped .v-treeview-node__root:before{border-bottom-right-radius:24px!important;border-top-right-radius:24px!important}.v-treeview-node.v-treeview-node--shaped .v-treeview-node__root{margin-top:8px;margin-bottom:8px}.v-treeview-node.v-treeview-node--rounded .v-treeview-node__root,.v-treeview-node.v-treeview-node--rounded .v-treeview-node__root:before{border-radius:24px!important}.v-treeview-node.v-treeview-node--rounded .v-treeview-node__root{margin-top:8px;margin-bottom:8px}.v-treeview-node--click>.v-treeview-node__root,.v-treeview-node--click>.v-treeview-node__root>.v-treeview-node__content>*{cursor:pointer;user-select:none}.v-treeview-node.v-treeview-node--active .v-treeview-node__content .v-icon{color:inherit}.v-treeview-node__root{display:flex;align-items:center;min-height:48px;padding-left:8px;padding-right:8px;position:relative}.v-treeview-node__root:before{background-color:currentColor;bottom:0;content:"";left:0;opacity:0;pointer-events:none;position:absolute;right:0;top:0;transition:.3s cubic-bezier(.25,.8,.5,1)}.v-treeview-node__root:after{content:"";font-size:0;min-height:inherit}.v-treeview-node__children{transition:all .2s cubic-bezier(0,0,.2,1)}.v-treeview--dense .v-treeview-node__root{min-height:40px}.v-treeview--dense.v-treeview-node--shaped .v-treeview-node__root,.v-treeview--dense.v-treeview-node--shaped .v-treeview-node__root:before{border-bottom-right-radius:20px!important;border-top-right-radius:20px!important}.v-treeview--dense.v-treeview-node--shaped .v-treeview-node__root{margin-top:8px;margin-bottom:8px}.v-treeview--dense.v-treeview-node--rounded .v-treeview-node__root,.v-treeview--dense.v-treeview-node--rounded .v-treeview-node__root:before{border-radius:20px!important}.v-treeview--dense.v-treeview-node--rounded .v-treeview-node__root{margin-top:8px;margin-bottom:8px}.v-treeview-node__checkbox{width:24px;user-select:none}.v-application--is-ltr .v-treeview-node__checkbox{margin-left:6px}.v-application--is-rtl .v-treeview-node__checkbox{margin-right:6px}.v-treeview-node__toggle{width:24px;user-select:none}.v-treeview-node__toggle--loading{animation:progress-circular-rotate 1s linear infinite}.v-application--is-ltr .v-treeview-node__toggle{transform:rotate(-90deg)}.v-application--is-ltr .v-treeview-node__toggle--open{transform:none}.v-application--is-rtl .v-treeview-node__toggle{transform:rotate(90deg)}.v-application--is-rtl .v-treeview-node__toggle--open{transform:none}.v-treeview-node__prepend{min-width:24px}.v-application--is-ltr .v-treeview-node__prepend{margin-right:6px}.v-application--is-rtl .v-treeview-node__prepend{margin-left:6px}.v-treeview-node__append{min-width:24px}.v-application--is-ltr .v-treeview-node__append{margin-left:6px}.v-application--is-rtl .v-treeview-node__append{margin-right:6px}.v-treeview-node__level{width:24px}.v-treeview-node__label{flex:1;font-size:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.v-treeview-node__content{align-items:center;display:flex;flex-basis:0%;flex-grow:1;flex-shrink:0;min-width:0}.v-treeview-node__content .v-btn{flex-grow:0!important;flex-shrink:1!important}.v-application--is-ltr .v-treeview-node__content{margin-left:6px}.v-application--is-rtl .v-treeview-node__content{margin-right:6px}.column-not-editing{background-color:#0000001a;border-radius:5px;height:45px;cursor:pointer}.column-not-editing-dark{background-color:#ffffff1a;border-radius:5px;height:45px;cursor:pointer}.form[data-v-711a6720]{max-width:600px;width:100%}.v-treeview .v-btn__content{justify-content:left}.v-treeview .v-btn__content div{align-items:center}.terminal-container[data-v-a5b6e3b9]{font-family:Courier New,Courier,monospace;font-size:14px;max-height:55vh;padding:10px;background-color:#424242fc;color:#fff;border:1px solid #57d9a3;overflow:auto}.terminal-output[data-v-a5b6e3b9]{max-height:50vh;overflow-y:auto}.terminal-input[data-v-a5b6e3b9]{display:flex}.terminal-input input[data-v-a5b6e3b9]{background-color:transparent;color:#fff;border:none;outline:none;flex:1}.error-text[data-v-a5b6e3b9]{color:red;font-weight:700;margin-right:5px}.error-text[data-v-a5b6e3b9]:before{content:"[!] "}.info-text[data-v-a5b6e3b9]{color:#009dff;font-weight:700;margin-right:5px}.info-text[data-v-a5b6e3b9]:before{content:"[*] "}.prompt[data-v-a5b6e3b9]{color:red;font-weight:700;margin-right:5px}.autocomplete-suggestions[data-v-a5b6e3b9]{position:absolute;background-color:#3c3f43;border:1px solid #57d9a3;border-radius:5px;z-index:1;max-height:150px;overflow-y:auto;width:100%;box-sizing:border-box;padding:5px;margin-top:5px;margin-bottom:5px}.suggestion[data-v-a5b6e3b9]{padding:5px 10px;cursor:pointer}.suggestion[data-v-a5b6e3b9]:hover{background-color:#3c3f43}.empire-text[data-v-a5b6e3b9]{color:#fff}.preserve-newlines[data-v-a5b6e3b9]{white-space:pre-line}.indent-5-spaces[data-v-a5b6e3b9]{padding-left:5ch;white-space:pre-wrap}.highlighted[data-v-a5b6e3b9]{background-color:#007bff;color:#fff}.splitpanes{display:-webkit-box;display:-ms-flexbox;display:flex;width:100%;height:100%}.splitpanes--vertical{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.splitpanes--horizontal{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.splitpanes--dragging *{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.splitpanes__pane{width:100%;height:100%;overflow:hidden}.splitpanes--vertical .splitpanes__pane{-webkit-transition:width .2s ease-out;-o-transition:width .2s ease-out;transition:width .2s ease-out}.splitpanes--horizontal .splitpanes__pane{-webkit-transition:height .2s ease-out;-o-transition:height .2s ease-out;transition:height .2s ease-out}.splitpanes--dragging .splitpanes__pane{-webkit-transition:none;-o-transition:none;transition:none}.splitpanes__splitter{-ms-touch-action:none;touch-action:none}.splitpanes--vertical>.splitpanes__splitter{min-width:1px;cursor:col-resize}.splitpanes--horizontal>.splitpanes__splitter{min-height:1px;cursor:row-resize}.splitpanes.default-theme .splitpanes__pane{background-color:#f2f2f2}.splitpanes.default-theme .splitpanes__splitter{background-color:#fff;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;-ms-flex-negative:0;flex-shrink:0}.splitpanes.default-theme .splitpanes__splitter:before,.splitpanes.default-theme .splitpanes__splitter:after{content:"";position:absolute;top:50%;left:50%;background-color:#00000026;-webkit-transition:background-color .3s;-o-transition:background-color .3s;transition:background-color .3s}.splitpanes.default-theme .splitpanes__splitter:hover:before,.splitpanes.default-theme .splitpanes__splitter:hover:after{background-color:#00000040}.splitpanes.default-theme .splitpanes__splitter:first-child{cursor:auto}.default-theme.splitpanes .splitpanes .splitpanes__splitter{z-index:1}.default-theme.splitpanes--vertical>.splitpanes__splitter,.default-theme .splitpanes--vertical>.splitpanes__splitter{width:7px;border-left:1px solid #eee;margin-left:-1px}.default-theme.splitpanes--vertical>.splitpanes__splitter:before,.default-theme.splitpanes--vertical>.splitpanes__splitter:after,.default-theme .splitpanes--vertical>.splitpanes__splitter:before,.default-theme .splitpanes--vertical>.splitpanes__splitter:after{-webkit-transform:translateY(-50%);-ms-transform:translateY(-50%);transform:translateY(-50%);width:1px;height:30px}.default-theme.splitpanes--vertical>.splitpanes__splitter:before,.default-theme .splitpanes--vertical>.splitpanes__splitter:before{margin-left:-2px}.default-theme.splitpanes--vertical>.splitpanes__splitter:after,.default-theme .splitpanes--vertical>.splitpanes__splitter:after{margin-left:1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter,.default-theme .splitpanes--horizontal>.splitpanes__splitter{height:7px;border-top:1px solid #eee;margin-top:-1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:before,.default-theme.splitpanes--horizontal>.splitpanes__splitter:after,.default-theme .splitpanes--horizontal>.splitpanes__splitter:before,.default-theme .splitpanes--horizontal>.splitpanes__splitter:after{-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translate(-50%);width:30px;height:1px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:before,.default-theme .splitpanes--horizontal>.splitpanes__splitter:before{margin-top:-2px}.default-theme.splitpanes--horizontal>.splitpanes__splitter:after,.default-theme .splitpanes--horizontal>.splitpanes__splitter:after{margin-top:1px}.scrollable-pane{height:100%;overflow-y:auto;overflow-x:hidden}.v-toolbar__content>div>.v-tabs>.v-slide-group.v-tabs-bar,.v-toolbar__extension>div>.v-tabs>.v-slide-group.v-tabs-bar{background-color:inherit}.splitpanes__splitter{background-color:#fff;box-sizing:border-box;position:relative;flex-shrink:0}.splitpanes__splitter:before,.splitpanes__splitter:after{content:"";position:absolute;top:50%;left:50%;background-color:#00000026;transition:background-color .3s}.splitpanes__splitter:hover:before,.splitpanes__splitter:hover:after{background-color:#00000040}.splitpanes__splitter:first-child{cursor:auto}.splitpanes .splitpanes .splitpanes__splitter{z-index:1}.splitpanes--vertical>.splitpanes__splitter,.splitpanes--vertical>.splitpanes__splitter{width:7px;border-left:1px solid #eee;margin-left:-1px}.splitpanes--vertical>.splitpanes__splitter:before,.splitpanes--vertical>.splitpanes__splitter:after,.splitpanes--vertical>.splitpanes__splitter:before,.splitpanes--vertical>.splitpanes__splitter:after{transform:translateY(-50%);width:1px;height:30px}.splitpanes--vertical>.splitpanes__splitter:before,.splitpanes--vertical>.splitpanes__splitter:before{margin-left:-2px}.splitpanes--vertical>.splitpanes__splitter:after,.splitpanes--vertical>.splitpanes__splitter:after{margin-left:1px}.splitpanes--horizontal>.splitpanes__splitter,.splitpanes--horizontal>.splitpanes__splitter{height:7px;border-top:1px solid #eee;margin-top:-1px}.splitpanes--horizontal>.splitpanes__splitter:before,.splitpanes--horizontal>.splitpanes__splitter:after,.splitpanes--horizontal>.splitpanes__splitter:before,.splitpanes--horizontal>.splitpanes__splitter:after{transform:translate(-50%);width:30px;height:1px}.splitpanes--horizontal>.splitpanes__splitter:before,.splitpanes--horizontal>.splitpanes__splitter:before{margin-top:-2px}.splitpanes--horizontal>.splitpanes__splitter:after,.splitpanes--horizontal>.splitpanes__splitter:after{margin-top:1px} diff --git a/dist/assets/AgentExecuteModule.cd5c09de.js b/dist/assets/AgentExecuteModule.05011db5.js similarity index 89% rename from dist/assets/AgentExecuteModule.cd5c09de.js rename to dist/assets/AgentExecuteModule.05011db5.js index 4cacdd4..0104e28 100644 --- a/dist/assets/AgentExecuteModule.cd5c09de.js +++ b/dist/assets/AgentExecuteModule.05011db5.js @@ -1 +1 @@ -import{_ as l,a as d}from"./GeneralForm.6b452c3e.js";import{_ as i}from"./TechniqueChips.5e972795.js";import{_ as r}from"./InfoViewer.ad34ab3b.js";import{_ as u,a as c,b as m,c as h}from"./ErrorStateAlert.3518d55f.js";import{i as _,bu as g,n as p,ad as a,b as o,aR as f,r as v,aS as k,aF as y,aG as x,a as C}from"./index.154e9cc6.js";import{_ as b}from"./VDataTable.71ce8bb9.js";const I={components:{InfoViewer:r,GeneralForm:l,TechniqueChips:i,ErrorStateAlert:u},props:{agents:{type:Array,default:()=>[]},showSubmit:{type:Boolean,default:!0},moduleName:{type:String,default:""},moduleOptionDefaults:{type:Object,default:()=>{}}},data(){return{loading:!1,selectedModule:"",selectedItem:{},results:[],reset:!0,headers:[{text:"Agent",value:"agent"},{text:"Result",value:"result"}],showDialog:!1,form:{},errorState:!1,ignoreAdminCheck:!1,ignoreLanguageCheck:!1}},computed:{..._({modules:s=>s.module.modules.filter(e=>e.enabled===!0),selectOptions:s=>s.module.modules.filter(e=>e.enabled===!0).map(e=>e.id)}),moduleOptions(){let{options:s}=this.selectedItem;return s=s||{},s&&s.Agent&&delete s.Agent,Object.keys(this.moduleOptionDefaults||{}).forEach(e=>{s[e]&&(s[e].value=this.moduleOptionDefaults[e])}),s},moduleInfo(){return Object.keys(this.selectedItem).length===0?{}:{authors:this.selectedItem.authors,description:this.selectedItem.description,comments:this.selectedItem.comments,extraDetails:[{key:"Language",value:this.selectedItem.language},{key:"MinLanguageVersion",value:this.selectedItem.min_language_version},{key:"Background",value:this.selectedItem.background},{key:"OpsecSafe",value:this.selectedItem.opsec_safe},{key:"NeedsAdmin",value:this.selectedItem.needs_admin},{key:"OutputExtensions",value:this.selectedItem.output_extensions}]}},errorStateMessage(){return`The resource 'module/${this.moduleName}' Not Found or is Disabled.`}},watch:{modules(s){s.length>0&&this.handleSelect(this.moduleName)},selectedModule(s){this.emitModuleChange(s)},moduleName:{immediate:!0,handler(s){this.selectedModule=s,this.handleSelect(s)}}},async mounted(){this.$store.dispatch("module/getModules")},methods:{async handleSelect(s){if(this.errorState=!1,s===""||s==null){this.reset=!1,this.selectedItem={},setTimeout(()=>{this.reset=!0},500);return}const e=this.modules.find(t=>t.id===s);this.reset=!1,this.selectedItem=e||{},Object.keys(this.selectedItem).length===0&&(this.errorState=!0),setTimeout(()=>{this.reset=!0},500)},rowClass(s){return s.status==="rejected"?"red":""},emitModuleChange(s){this.$emit("moduleChange",s)},validate(){return this.$refs.generalform.$refs.form.validate()},async create(){if(this.agents.length<1||this.loading||!this.validate())return;this.loading=!0;const s=await Promise.allSettled(this.agents.map(e=>g(this.selectedModule,{...this.form,Agent:e},this.ignoreAdminCheck,this.ignoreLanguageCheck)));if(s.some(e=>e.status==="rejected")){const e=s.reduce((t,n)=>(t[n.status].push(n),t),{rejected:[],fulfilled:[]});this.agents.length>1?(this.$snack.warn(`Module failed to execute for ${e.rejected.length} out of ${this.agents.length} agents.`),this.results=s,this.showDialog=!0):this.$snack.error(`Error: ${s[0].reason.error}`)}else{const e=this.agents.length>1?`${this.agents.length} agents.`:`${this.agents[0]}.`;this.$snack.info(`Module execution queued for ${e}`),this.selectedItem={},this.selectedModule="",this.$emit("submitted")}this.loading=!1}}};var S=function(){var e=this,t=e._self._c;return t("div",[e.errorState?t(u,{attrs:{"resource-id":e.moduleName,"resource-type":"module",message:e.errorStateMessage}}):t("div",{staticStyle:{padding:"0 10px 10px 10px"}},[t(r,{staticClass:"info-viewer",attrs:{info:e.moduleInfo}}),t("span",{staticClass:"mr-2 mb-4"},[e._v("Executing on Agents: "+e._s(e.agents.join(", ")))]),t(i,{attrs:{techniques:e.selectedItem.techniques}}),t(d,{attrs:{items:e.selectOptions,loading:!e.reset,placeholder:"Please enter a module name",outlined:"",dense:"",clearable:""},on:{change:e.handleSelect},model:{value:e.selectedModule,callback:function(n){e.selectedModule=n},expression:"selectedModule"}}),e.selectedItem.opsec_safe===!1?t(c,{attrs:{type:"warning"}},[t(m,{attrs:{align:"center"}},[t(h,{staticClass:"grow",staticStyle:{"word-wrap":"word-break",width:"500px"}},[e._v(" This module is not opsec safe. ")])],1)],1):e._e(),Object.keys(e.selectedItem).length>0?t("div",{staticStyle:{display:"flex","flex-direction":"row"}},[t(a,{staticClass:"pa-1",attrs:{label:"Ignore Admin Check",color:"primary"},model:{value:e.ignoreAdminCheck,callback:function(n){e.ignoreAdminCheck=n},expression:"ignoreAdminCheck"}}),t(a,{staticClass:"pa-1",attrs:{label:"Ignore Language Version Check",color:"primary"},model:{value:e.ignoreLanguageCheck,callback:function(n){e.ignoreLanguageCheck=n},expression:"ignoreLanguageCheck"}})],1):e._e(),e.reset?t(l,{ref:"generalform",attrs:{options:e.moduleOptions},model:{value:e.form,callback:function(n){e.form=n},expression:"form"}}):e._e(),e.showSubmit?t(o,{attrs:{loading:e.loading,color:"primary"},on:{click:e.create}},[e._v(" Submit ")]):e._e(),t(f,{ref:"nameDialog",attrs:{"max-width":"900px"},model:{value:e.showDialog,callback:function(n){e.showDialog=n},expression:"showDialog"}},[t(v,[t(k,[t("span",{staticClass:"headline"},[e._v("Execution Result")])]),t(y,[t(b,{attrs:{dense:"",items:e.results,headers:e.headers,"item-class":e.rowClass},scopedSlots:e._u([{key:"item.agent",fn:function({item:n}){return[t("div",[n.status==="rejected"?[t("span",[e._v(e._s(n.reason.agent))])]:[t("span",[e._v(e._s(n.value.agent))])]],2)]}},{key:"item.result",fn:function({item:n}){return[t("div",[n.status==="rejected"?[t("span",[e._v(e._s(n.reason.error))])]:[t("span",[e._v(e._s(n.value.message))])]],2)]}}])})],1),t(x,[t(C),t(o,{attrs:{color:"blue darken-1",text:""},on:{click:function(n){e.showDialog=!1}}},[e._v(" Okay ")])],1)],1)],1)],1)],1)},w=[],M=p(I,S,w,!1,null,"4a3ee904",null,null);const N=M.exports;export{N as _}; +import{_ as l,a as c}from"./GeneralForm.fe5154ff.js";import{_ as i}from"./TechniqueChips.6a91dd2f.js";import{_ as r}from"./InfoViewer.448169ad.js";import{_ as u,a as d,b as m,c as h}from"./ErrorStateAlert.5e9140da.js";import{e as _,bs as g,n as p,a1 as a,b as o,aP as f,f as v,aQ as k,aC as y,aD as x,a as C}from"./index.85262dd3.js";import{_ as b}from"./VDataTable.125536b6.js";const I={components:{InfoViewer:r,GeneralForm:l,TechniqueChips:i,ErrorStateAlert:u},props:{agents:{type:Array,default:()=>[]},showSubmit:{type:Boolean,default:!0},moduleName:{type:String,default:""},moduleOptionDefaults:{type:Object,default:()=>{}}},data(){return{loading:!1,selectedModule:"",selectedItem:{},results:[],reset:!0,headers:[{text:"Agent",value:"agent"},{text:"Result",value:"result"}],showDialog:!1,form:{},errorState:!1,ignoreAdminCheck:!1,ignoreLanguageCheck:!1}},computed:{..._({modules:s=>s.module.modules.filter(e=>e.enabled===!0),selectOptions:s=>s.module.modules.filter(e=>e.enabled===!0).map(e=>e.id)}),moduleOptions(){let{options:s}=this.selectedItem;return s=s||{},s&&s.Agent&&delete s.Agent,Object.keys(this.moduleOptionDefaults||{}).forEach(e=>{s[e]&&(s[e].value=this.moduleOptionDefaults[e])}),s},moduleInfo(){return Object.keys(this.selectedItem).length===0?{}:{authors:this.selectedItem.authors,description:this.selectedItem.description,comments:this.selectedItem.comments,extraDetails:[{key:"Language",value:this.selectedItem.language},{key:"MinLanguageVersion",value:this.selectedItem.min_language_version},{key:"Background",value:this.selectedItem.background},{key:"OpsecSafe",value:this.selectedItem.opsec_safe},{key:"NeedsAdmin",value:this.selectedItem.needs_admin},{key:"OutputExtensions",value:this.selectedItem.output_extensions}]}},errorStateMessage(){return`The resource 'module/${this.moduleName}' Not Found or is Disabled.`}},watch:{modules(s){s.length>0&&this.handleSelect(this.moduleName)},selectedModule(s){this.emitModuleChange(s)},moduleName:{immediate:!0,handler(s){this.selectedModule=s,this.handleSelect(s)}}},async mounted(){this.$store.dispatch("module/getModules")},methods:{async handleSelect(s){if(this.errorState=!1,s===""||s==null){this.reset=!1,this.selectedItem={},setTimeout(()=>{this.reset=!0},500);return}const e=this.modules.find(t=>t.id===s);this.reset=!1,this.selectedItem=e||{},Object.keys(this.selectedItem).length===0&&(this.errorState=!0),setTimeout(()=>{this.reset=!0},500)},rowClass(s){return s.status==="rejected"?"red":""},emitModuleChange(s){this.$emit("moduleChange",s)},validate(){return this.$refs.generalform.$refs.form.validate()},async create(){if(this.agents.length<1||this.loading||!this.validate())return;this.loading=!0;const s=await Promise.allSettled(this.agents.map(e=>g(this.selectedModule,{...this.form,Agent:e},this.ignoreAdminCheck,this.ignoreLanguageCheck)));if(s.some(e=>e.status==="rejected")){const e=s.reduce((t,n)=>(t[n.status].push(n),t),{rejected:[],fulfilled:[]});this.agents.length>1?(this.$snack.warn(`Module failed to execute for ${e.rejected.length} out of ${this.agents.length} agents.`),this.results=s,this.showDialog=!0):this.$snack.error(`Error: ${s[0].reason.error}`)}else{const e=this.agents.length>1?`${this.agents.length} agents.`:`${this.agents[0]}.`;this.$snack.info(`Module execution queued for ${e}`),this.selectedItem={},this.selectedModule="",this.$emit("submitted")}this.loading=!1}}};var w=function(){var e=this,t=e._self._c;return t("div",[e.errorState?t(u,{attrs:{"resource-id":e.moduleName,"resource-type":"module",message:e.errorStateMessage}}):t("div",{staticStyle:{padding:"0 10px 10px 10px"}},[t(r,{staticClass:"info-viewer",attrs:{info:e.moduleInfo}}),t("span",{staticClass:"mr-2 mb-4"},[e._v("Executing on Agents: "+e._s(e.agents.join(", ")))]),t(i,{attrs:{techniques:e.selectedItem.techniques}}),t(c,{attrs:{items:e.selectOptions,loading:!e.reset,placeholder:"Please enter a module name",outlined:"",dense:"",clearable:""},on:{change:e.handleSelect},model:{value:e.selectedModule,callback:function(n){e.selectedModule=n},expression:"selectedModule"}}),e.selectedItem.opsec_safe===!1?t(d,{attrs:{type:"warning"}},[t(m,{attrs:{align:"center"}},[t(h,{staticClass:"grow",staticStyle:{"word-wrap":"word-break",width:"500px"}},[e._v(" This module is not opsec safe. ")])],1)],1):e._e(),Object.keys(e.selectedItem).length>0?t("div",{staticStyle:{display:"flex","flex-direction":"row"}},[t(a,{staticClass:"pa-1",attrs:{label:"Ignore Admin Check",color:"primary"},model:{value:e.ignoreAdminCheck,callback:function(n){e.ignoreAdminCheck=n},expression:"ignoreAdminCheck"}}),t(a,{staticClass:"pa-1",attrs:{label:"Ignore Language Version Check",color:"primary"},model:{value:e.ignoreLanguageCheck,callback:function(n){e.ignoreLanguageCheck=n},expression:"ignoreLanguageCheck"}})],1):e._e(),e.reset?t(l,{ref:"generalform",attrs:{options:e.moduleOptions},model:{value:e.form,callback:function(n){e.form=n},expression:"form"}}):e._e(),e.showSubmit?t(o,{attrs:{loading:e.loading,color:"primary"},on:{click:e.create}},[e._v(" Submit ")]):e._e(),t(f,{ref:"nameDialog",attrs:{"max-width":"900px"},model:{value:e.showDialog,callback:function(n){e.showDialog=n},expression:"showDialog"}},[t(v,[t(k,[t("span",{staticClass:"headline"},[e._v("Execution Result")])]),t(y,[t(b,{attrs:{dense:"",items:e.results,headers:e.headers,"item-class":e.rowClass},scopedSlots:e._u([{key:"item.agent",fn:function({item:n}){return[t("div",[n.status==="rejected"?[t("span",[e._v(e._s(n.reason.agent))])]:[t("span",[e._v(e._s(n.value.agent))])]],2)]}},{key:"item.result",fn:function({item:n}){return[t("div",[n.status==="rejected"?[t("span",[e._v(e._s(n.reason.error))])]:[t("span",[e._v(e._s(n.value.message))])]],2)]}}])})],1),t(x,[t(C),t(o,{attrs:{color:"blue darken-1",text:""},on:{click:function(n){e.showDialog=!1}}},[e._v(" Okay ")])],1)],1)],1)],1)],1)},S=[],M=p(I,w,S,!1,null,"9652e891",null,null);const N=M.exports;export{N as _}; diff --git a/dist/assets/AgentExecuteModule.ca690aa0.css b/dist/assets/AgentExecuteModule.ca690aa0.css new file mode 100644 index 0000000..fb04860 --- /dev/null +++ b/dist/assets/AgentExecuteModule.ca690aa0.css @@ -0,0 +1 @@ +.red[data-v-9652e891]{background-color:#bd4c4c} diff --git a/dist/assets/AgentExecuteModule.f649fa0b.css b/dist/assets/AgentExecuteModule.f649fa0b.css deleted file mode 100644 index 12c0dab..0000000 --- a/dist/assets/AgentExecuteModule.f649fa0b.css +++ /dev/null @@ -1 +0,0 @@ -.red[data-v-4a3ee904]{background-color:#bd4c4c} diff --git a/dist/assets/AgentTasksList.3c2e6ebb.js b/dist/assets/AgentTasksList.3c2e6ebb.js new file mode 100644 index 0000000..d8b7635 --- /dev/null +++ b/dist/assets/AgentTasksList.3c2e6ebb.js @@ -0,0 +1 @@ +import{_ as g}from"./TagViewer.a3da6a20.js";import{_ as h}from"./DateTimeDisplay.c35d52fb.js";import{_}from"./TooltipButton.6f10f736.js";import{n as f,b6 as I,b7 as w,b8 as q,D as c,a_ as $,b9 as d,ba as P,bb as A,b as p,bc as C,c as r,p as D,g as O,h as i,i as u,a as S,e as B}from"./index.85262dd3.js";import{h as m}from"./moment.9709ab41.js";import{l as T}from"./index.c62fa657.js";import{A as U}from"./ansi_up.de92b8a0.js";import{D as k}from"./download-stager.cac59e06.js";import{_ as G}from"./VPagination.873af1be.js";import{_ as F}from"./VDataTable.125536b6.js";import{_ as j}from"./VSwitch.8a27782c.js";import{_ as l}from"./ExpansionPanelFilter.8ec031fa.js";import{_ as b}from"./ExpansionPanelSearch.252e89f2.js";import{_ as x}from"./AdvancedTable.8f5cf108.js";import{_ as v}from"./ListPageTop.2a204a11.js";import{g as E}from"./tag-api.d2d18349.js";const H={name:"AgentTasksTable",components:{DateTimeDisplay:h,TagViewer:g,TooltipButton:_},mixins:[k],props:{agent:{type:Object,required:!1,default:null},refreshTasks:{type:Boolean,default:!1},hideColumns:{type:Array,default:()=>[]},selectedAgents:{type:Array,default:()=>[]},selectedUsers:{type:Array,default:()=>[]},selectedTags:{type:Array,default:()=>[]},search:{type:String,default:""},noFilters:{type:Boolean,default:!1}},data(){return{tasks:[],currentPage:1,totalPages:1,totalItems:0,itemsPerPage:10,loading:!1,moment:m,sortBy:"updated_at",sortDesc:!0,refreshInterval:null,expandedTasks:{},debouncedGetTasks:T(this.getTasks,500)}},computed:{headers(){return[{text:"Task ID",value:"id",sortable:!0},{text:"Status",value:"status",sortable:!0},{text:"Agent",value:"agent_id",sortable:!0},{text:"Task Input",value:"input",sortable:!1},{text:"Task Name",value:"task_name",sortable:!1},{text:"User",value:"username",sortable:!1},{text:"Updated At",value:"updated_at",sortable:!0},{text:"Tags",value:"tags",sortable:!1,width:400},{text:"Actions",value:"actions",sortable:!1}].filter(t=>!this.hideColumns.includes(t.value))}},watch:{refreshTasks:{handler(t){t?(this.debouncedGetTasks?this.debouncedGetTasks():this.getTasks(),this.refreshInterval=setInterval(()=>{this.debouncedGetTasks()},8e3)):clearInterval(this.refreshInterval)},immediate:!0},currentPage(){this.debouncedGetTasks()},agent(){this.debouncedGetTasks()},selectedAgents(){this.debouncedGetTasks()},selectedUsers(){this.debouncedGetTasks()},selectedTags(){this.debouncedGetTasks()},search(){this.debouncedGetTasks()}},async mounted(){this.debouncedGetTasks()},beforeDestroy(){clearInterval(this.refreshInterval)},methods:{stripAnsi(t){return t.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g,"")},isAnsi(t){return this.stripAnsi(t)!==t},ansiToHtml(t){return new U().ansi_to_html(t)},deleteTag(t,e){I(t.agent_id,t.id,e.id).then(()=>{this.$set(t,"tags",t.tags.filter(s=>s.id!==e.id)),this.$emit("refresh-tags")}).catch(s=>this.$snack.error(`Error: ${s}`))},updateTag(t,e){w(t.agent_id,t.id,e).then(s=>{const n=t.tags.findIndex(a=>a.id===s.id);t.tags.splice(n,1,s),this.$emit("refresh-tags"),this.$snack.success("Tag updated")}).catch(s=>this.$snack.error(`Error: ${s}`))},addTag(t,e){q(t.agent_id,t.id,e).then(s=>{this.$set(t,"tags",[...t.tags,s]),this.$emit("refresh-tags")}).catch(s=>this.$snack.error(`Error: ${s}`))},truncateMessage(t){return t?t.length>30?`${t.substr(0,30)}...`:t:""},updateTaskBackgroundColor(t){t.backgroundColor==="black"?t.backgroundColor="white":t.backgroundColor="black",this.expandedTasks[t.uniqueId].backgroundColor=t.backgroundColor,c.set(this.tasks,this.tasks.indexOf(t),t)},isDownload(t){return t.downloads&&t.downloads.length>0},downloadFile(t){$(t.id)},hasOutput(t){return!!t.output},async downloadInput(t){var e;if(t.input){if(!((e=this.expandedTasks[t.uniqueId])!=null&&e.full_input)){const s=await d(t.agent_id,t.id);this.expandedTasks[t.uniqueId]={...this.expandedTasks[t.uniqueId],...s}}this.downloadText(this.expandedTasks[t.uniqueId].full_input,`${t.uniqueId}-input.txt`)}},downloadOutput(t){t.output&&this.downloadText(t.output,`${t.uniqueId}-output.txt`)},async copyInput(t){var e;if(t.input){if(!((e=this.expandedTasks[t.uniqueId])!=null&&e.full_input)){const s=await d(t.agent_id,t.id);this.expandedTasks[t.uniqueId]={...this.expandedTasks[t.uniqueId],...s}}try{navigator.clipboard.writeText(this.expandedTasks[t.uniqueId].full_input)}catch{this.$snack.warn("Failed to copy to clipboard. You must be on HTTPS or localhost.")}}},copyOutput(t){if(t.output)try{navigator.clipboard.writeText(t.output)}catch{this.$snack.warn("Failed to copy to clipboard. You must be on HTTPS or localhost.")}},imageData(t,e){var n;const s=(n=this.expandedTasks[t.uniqueId])==null?void 0:n.downloads;if(s){const a=s.find(o=>o.id===e.id);if(a)return a.image}return null},async getImagesForTask(t){var e;if(!this.expandedTasks[t.uniqueId].imagesRetrieved){const s=await d(t.agent_id,t.id);this.expandedTasks[t.uniqueId]={...this.expandedTasks[t.uniqueId],...s},this.expandedTasks[t.uniqueId].imagesRetrieved=!0}for(let s=0;s0?(this.sortBy=t.sortBy[0],this.sortDesc=t.sortDesc[0]):(this.sortBy="id",this.sortDesc=!0),this.debouncedGetTasks()},async getTasks(){if(!this.noFilters&&(this.selectedAgents.length===0||this.selectedUsers.length===0)){this.tasks=[],this.currentPage=1,this.totalPages=1,this.totalItems=0;return}this.loading=!0;let t=null;this.selectedAgents.length>0&&(t=this.selectedAgents);const e=await A(t,{page:this.currentPage,limit:this.itemsPerPage,sortBy:this.sortBy,sortOrder:this.sortDesc?"desc":"asc",users:this.selectedUsers,tags:this.selectedTags,search:this.search});this.currentPage=e.page,this.totalPages=e.total_pages,this.totalItems=e.total,this.tasks=e.records.map(s=>(s.uniqueId=`${s.agent_id}-${s.id}`,this.expandedTasks[s.uniqueId]||(this.expandedTasks[s.uniqueId]={}),this.expandedTasks[s.uniqueId].expandedInput&&(s.expandedInput=!0),this.expandedTasks[s.uniqueId].backgroundColor=this.expandedTasks[s.uniqueId].backgroundColor||"black",s.backgroundColor=this.expandedTasks[s.uniqueId].backgroundColor,this.isAnsi(s.output||"")&&(this.expandedTasks[s.uniqueId].htmlOutput=this.ansiToHtml(s.output)),s)),this.tasks=e.records,this.loading=!1}}};var L=function(){var e=this,s=e._self._c;return s("div",[s(G,{attrs:{length:e.totalPages,"total-visible":10},on:{input:e.handlePageChange},model:{value:e.currentPage,callback:function(n){e.currentPage=n},expression:"currentPage"}}),s(F,{attrs:{headers:e.headers,items:e.tasks,"item-key":"uniqueId","sort-by":e.sortBy,"sort-desc":e.sortDesc,"server-items-length":e.totalItems,"footer-props":{"items-per-page-options":[10,25,50,100]},"items-per-page":e.itemsPerPage,loading:e.loading,page:e.currentPage,"show-expand":""},on:{"update:itemsPerPage":function(n){e.itemsPerPage=n},"update:items-per-page":function(n){e.itemsPerPage=n},"update:options":e.handleOptionsChange},scopedSlots:e._u([{key:"expanded-item",fn:function({headers:n,item:a}){return[s("td",{attrs:{colspan:n.length}},[s("div",[s("div",{staticStyle:{display:"flex","justify-content":"space-between","align-items":"center"}},[s("div",[s(_,{attrs:{icon:a.expandedInput?"fa-minus":"fa-plus",text:"See Full Input","x-small":""},on:{click:function(o){return e.toggleSeeFullInput(a)}}}),a.expandedInput?s("span",[e._v("Showing full input")]):e._e()],1),s(j,{attrs:{"false-value":"white","true-value":"black",label:"Dark Background"},on:{change:function(o){return e.updateTaskBackgroundColor(a)}},model:{value:e.expandedTasks[a.uniqueId].backgroundColor,callback:function(o){e.$set(e.expandedTasks[a.uniqueId],"backgroundColor",o)},expression:"expandedTasks[item.uniqueId].backgroundColor"}})],1),s("p",[s("b",[e._v("Task Input:")])]),s("p",{class:"mono "+(e.expandedTasks[a.uniqueId].backgroundColor==="white"?"font-black":"font-white"),style:"background-color: "+e.expandedTasks[a.uniqueId].backgroundColor+";"},[e._v(" "+e._s(a.expandedInput?e.expandedTasks[a.uniqueId].full_input:a.input)+" ")]),s("p",[s("b",[e._v("Task Output:")])]),a.downloads.length>0&&a.downloads.some(o=>o.filename.match(/[^/]+(jpg|jpeg|png|gif)$/))?s("div",[s(p,{attrs:{text:"","x-small":""},on:{click:function(o){return e.getImagesForTask(a)}}},[e._v(" View Images ")]),s("div",e._l(a.downloads,function(o){return s(C,{key:o.id,attrs:{src:e.imageData(a,o),alt:o.filename,"max-width":700,contain:""}})}),1)],1):e._e(),s("div",{class:"mono "+(e.expandedTasks[a.uniqueId].backgroundColor==="white"?"font-black":"font-white"),style:"background-color: "+e.expandedTasks[a.uniqueId].backgroundColor+";"},[e.expandedTasks[a.uniqueId].htmlOutput?s("div",{domProps:{innerHTML:e._s(e.expandedTasks[a.uniqueId].htmlOutput)}}):s("div",[e._v(" "+e._s(a.output)+" ")])])])])]}},{key:"item.status",fn:function({item:n}){return[n.status==="pulled"?s(r,{attrs:{color:"green",small:""}},[e._v(" fa-check-square ")]):n.status==="queued"?s(r,{attrs:{color:"orange",small:""}},[e._v(" fa-clock ")]):e._e()]}},e.agent?null:{key:"item.agent_id",fn:function({item:n}){return[s("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"agentEdit",params:{id:n.agent_id}}}},[e._v(" "+e._s(n.agent_id)+" ")])]}},{key:"item.input",fn:function({item:n}){return[s("span",[e._v(e._s(e.truncateMessage(n.input)))])]}},{key:"item.task_name",fn:function({item:n}){return[s("span",[e._v(e._s(n.module_name==null?n.task_name:n.module_name))])]}},{key:"item.updated_at",fn:function({item:n}){return[s(h,{attrs:{timestamp:n.updated_at}})]}},{key:"item.tags",fn:function({item:n}){return[s(g,{attrs:{tags:n.tags},on:{"update-tag":function(a){return e.updateTag(n,...arguments)},"delete-tag":function(a){return e.deleteTag(n,...arguments)},"new-tag":function(a){return e.addTag(n,...arguments)}}})]}},{key:"item.actions",fn:function({item:n}){return[s(D,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:a,attrs:o}){return[s(p,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",o,!1),a),[s(r,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[s(O,{staticClass:"ml-2 mr-2"},[s(i,{key:"downloadInput",attrs:{link:""},on:{click:function(a){return e.downloadInput(n)}}},[s(u,[s(r,[e._v("fa-download")]),e._v(" Download Input ")],1)],1),e.hasOutput(n)?s(i,{key:"downloadOutput",attrs:{link:""},on:{click:function(a){return e.downloadOutput(n)}}},[s(u,[s(r,[e._v("fa-download")]),e._v(" Download Output ")],1)],1):e._e(),s(i,{key:"clipboardInput",attrs:{link:""},on:{click:function(a){return e.copyInput(n)}}},[s(u,[s(r,[e._v("fa-paperclip")]),e._v(" Copy Input to Clipboard ")],1)],1),e.hasOutput(n)?s(i,{key:"clipboardOutput",attrs:{link:""},on:{click:function(a){return e.copyOutput(n)}}},[s(u,[s(r,[e._v("fa-paperclip")]),e._v(" Copy Output to Clipboard ")],1)],1):e._e(),s(S),e._l(n.downloads,function(a){return s(i,{key:"download-"+a.id,attrs:{link:""},on:{click:function(o){return e.downloadFile(a)}}},[s(u,[s(r,[e._v("fa-download")]),e._v(" Download "+e._s(a.filename)+" ")],1)],1)})],2)],1)]}}],null,!0)})],1)},R=[],M=f(H,L,R,!1,null,null,null,null);const y=M.exports;const V={name:"AgentTasksList",components:{AdvancedTable:x,ExpansionPanelFilter:l,ExpansionPanelSearch:b,AgentTasksTable:y,ListPageTop:v},mixins:[k],props:{agent:{type:Object,required:!1,default:null},refreshTasks:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},data(){return{breads:[{text:"Agents",disabled:!0,href:"/agents"},{text:"Tasks",disabled:!0,href:"/agents?tab=tasks"}],tasks:[],search:"",loading:!1,moment:m,selectedAgents:[],selectedUsers:[],selectedTags:[],tags:[],debouncedGetTasks:T(this.getTasks,500)}},computed:{...B({agents:t=>t.agent.agents,users:t=>{const e=t.user.users;return e.push({id:0,username:"Non-User"}),e}})},watch:{agent:{handler(t){t&&(this.selectedAgents=[t.session_id])},immediate:!0}},async mounted(){await Promise.all([this.$store.dispatch("agent/getAgents"),this.$store.dispatch("user/getUsers"),this.getTags()])},methods:{async getTags(){const t=await E({page:1,limit:-1,sources:"agent_task"}),e=[];t.records.forEach(s=>{e.find(a=>a.name===s.name&&a.value===s.value)||e.push(s)}),this.tags=e},getTasks(){this.$refs.agentTasksTable.debouncedGetTasks()}}};var N=function(){var e=this,s=e._self._c;return s("div",[e.active?s(v,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!0,"show-delete":!1},on:{refresh:e.getTasks}}):e._e(),s(x,{scopedSlots:e._u([{key:"filters",fn:function(){return[s(b,{attrs:{title:"Search",label:"Search"},model:{value:e.search,callback:function(n){e.search=n},expression:"search"}}),e.agent?e._e():s(l,{attrs:{title:"Agents",label:"name","item-key":"session_id","item-value":"session_id",items:e.agents},model:{value:e.selectedAgents,callback:function(n){e.selectedAgents=n},expression:"selectedAgents"}}),s(l,{attrs:{title:"Users",label:"username","item-key":"id","item-value":"id",items:e.users},model:{value:e.selectedUsers,callback:function(n){e.selectedUsers=n},expression:"selectedUsers"}}),s(l,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(n){e.selectedTags=n},expression:"selectedTags"}})]},proxy:!0},{key:"table",fn:function(){return[s(y,{ref:"agentTasksTable",attrs:{agent:e.agent,"refresh-tasks":e.refreshTasks,"hide-columns":["id","task_name"],"selected-agents":e.selectedAgents,"selected-users":e.selectedUsers,"selected-tags":e.selectedTags,search:e.search},on:{"refresh-tags":e.getTags}})]},proxy:!0}])})],1)},Y=[],z=f(V,N,Y,!1,null,null,null,null);const le=z.exports;export{le as _}; diff --git a/dist/assets/AgentTasksList.bd1fbdb1.js b/dist/assets/AgentTasksList.bd1fbdb1.js deleted file mode 100644 index d85ac32..0000000 --- a/dist/assets/AgentTasksList.bd1fbdb1.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as g}from"./TagViewer.b07ca85a.js";import{_ as h}from"./DateTimeDisplay.97700a4a.js";import{_}from"./TooltipButton.6022e185.js";import{n as f,b4 as I,b5 as w,b6 as q,z as c,b7 as d,b8 as $,b as p,b9 as P,c as r,k as A,l as i,V as u,a as C,i as O}from"./index.154e9cc6.js";import{h as m}from"./moment.9709ab41.js";import{l as T}from"./index.e9f2ede5.js";import{A as D}from"./ansi_up.bcd3942b.js";import{D as k}from"./download-stager.85a6b476.js";import{b as S,d as B}from"./download-api.dfe5301b.js";import{_ as U}from"./VPagination.90d5be16.js";import{_ as G}from"./VDataTable.71ce8bb9.js";import{_ as F}from"./VSwitch.4adac3f4.js";import{_ as j}from"./VSelect.27a57f2b.js";import{_ as l}from"./ExpansionPanelFilter.5838fe52.js";import{_ as b}from"./ExpansionPanelSearch.7dcac59a.js";import{_ as x}from"./AdvancedTable.65916e9e.js";import{_ as v}from"./ListPageTop.dad49f81.js";import{g as E}from"./tag-api.5e19879c.js";const H={name:"AgentTasksTable",components:{DateTimeDisplay:h,TagViewer:g,TooltipButton:_},mixins:[k],props:{agent:{type:Object,required:!1,default:null},refreshTasks:{type:Boolean,default:!1},hideColumns:{type:Array,default:()=>[]},selectedAgents:{type:Array,default:()=>[]},selectedUsers:{type:Array,default:()=>[]},selectedTags:{type:Array,default:()=>[]},search:{type:String,default:""},noFilters:{type:Boolean,default:!1}},data(){return{tasks:[],currentPage:1,totalPages:1,totalItems:0,itemsPerPage:10,loading:!1,moment:m,sortBy:"updated_at",sortDesc:!0,refreshInterval:null,expandedTasks:{},debouncedGetTasks:T(this.getTasks,500)}},computed:{headers(){return[{text:"Task ID",value:"id",sortable:!0},{text:"Status",value:"status",sortable:!0},{text:"Agent",value:"agent_id",sortable:!0},{text:"Task Input",value:"input",sortable:!1},{text:"Task Name",value:"task_name",sortable:!1},{text:"User",value:"username",sortable:!1},{text:"Updated At",value:"updated_at",sortable:!0},{text:"Tags",value:"tags",sortable:!1,width:400},{text:"Actions",value:"actions",sortable:!1}].filter(t=>!this.hideColumns.includes(t.value))}},watch:{refreshTasks:{handler(t){t?(this.debouncedGetTasks?this.debouncedGetTasks():this.getTasks(),this.refreshInterval=setInterval(()=>{this.debouncedGetTasks()},8e3)):clearInterval(this.refreshInterval)},immediate:!0},currentPage(){this.debouncedGetTasks()},agent(){this.debouncedGetTasks()},selectedAgents(){this.debouncedGetTasks()},selectedUsers(){this.debouncedGetTasks()},selectedTags(){this.debouncedGetTasks()},search(){this.debouncedGetTasks()}},async mounted(){this.debouncedGetTasks()},beforeDestroy(){clearInterval(this.refreshInterval)},methods:{stripAnsi(t){return t.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g,"")},isAnsi(t){return this.stripAnsi(t)!==t},ansiToHtml(t){return new D().ansi_to_html(t)},deleteTag(t,e){I(t.agent_id,t.id,e.id).then(()=>{this.$set(t,"tags",t.tags.filter(s=>s.id!==e.id)),this.$emit("refresh-tags")}).catch(s=>this.$snack.error(`Error: ${s}`))},updateTag(t,e){w(t.agent_id,t.id,e).then(s=>{const n=t.tags.findIndex(a=>a.id===s.id);t.tags.splice(n,1,s),this.$emit("refresh-tags"),this.$snack.success("Tag updated")}).catch(s=>this.$snack.error(`Error: ${s}`))},addTag(t,e){q(t.agent_id,t.id,e).then(s=>{this.$set(t,"tags",[...t.tags,s]),this.$emit("refresh-tags")}).catch(s=>this.$snack.error(`Error: ${s}`))},truncateMessage(t){return t?t.length>30?`${t.substr(0,30)}...`:t:""},updateTaskBackgroundColor(t){t.backgroundColor==="black"?t.backgroundColor="white":t.backgroundColor="black",this.expandedTasks[t.uniqueId].backgroundColor=t.backgroundColor,c.set(this.tasks,this.tasks.indexOf(t),t)},isDownload(t){return t.downloads&&t.downloads.length>0},downloadFile(t){S(t.id)},hasOutput(t){return!!t.output},async downloadInput(t){var e;if(t.input){if(!((e=this.expandedTasks[t.uniqueId])!=null&&e.full_input)){const s=await d(t.agent_id,t.id);this.expandedTasks[t.uniqueId]={...this.expandedTasks[t.uniqueId],...s}}this.downloadText(this.expandedTasks[t.uniqueId].full_input,`${t.uniqueId}-input.txt`)}},downloadOutput(t){t.output&&this.downloadText(t.output,`${t.uniqueId}-output.txt`)},async copyInput(t){var e;if(t.input){if(!((e=this.expandedTasks[t.uniqueId])!=null&&e.full_input)){const s=await d(t.agent_id,t.id);this.expandedTasks[t.uniqueId]={...this.expandedTasks[t.uniqueId],...s}}try{navigator.clipboard.writeText(this.expandedTasks[t.uniqueId].full_input)}catch{this.$snack.warn("Failed to copy to clipboard. You must be on HTTPS or localhost.")}}},copyOutput(t){if(t.output)try{navigator.clipboard.writeText(t.output)}catch{this.$snack.warn("Failed to copy to clipboard. You must be on HTTPS or localhost.")}},imageData(t,e){var n;const s=(n=this.expandedTasks[t.uniqueId])==null?void 0:n.downloads;if(s){const a=s.find(o=>o.id===e.id);if(a)return a.image}return null},async getImagesForTask(t){var e;if(!this.expandedTasks[t.uniqueId].imagesRetrieved){const s=await d(t.agent_id,t.id);this.expandedTasks[t.uniqueId]={...this.expandedTasks[t.uniqueId],...s},this.expandedTasks[t.uniqueId].imagesRetrieved=!0}for(let s=0;s0?(this.sortBy=t.sortBy[0],this.sortDesc=t.sortDesc[0]):(this.sortBy="id",this.sortDesc=!0),this.debouncedGetTasks()},async getTasks(){if(!this.noFilters&&(this.selectedAgents.length===0||this.selectedUsers.length===0)){this.tasks=[],this.currentPage=1,this.totalPages=1,this.totalItems=0;return}this.loading=!0;let t=null;this.selectedAgents.length>0&&(t=this.selectedAgents);const e=await $(t,{page:this.currentPage,limit:this.itemsPerPage,sortBy:this.sortBy,sortOrder:this.sortDesc?"desc":"asc",users:this.selectedUsers,tags:this.selectedTags,search:this.search});this.currentPage=e.page,this.totalPages=e.total_pages,this.totalItems=e.total,this.tasks=e.records.map(s=>(s.uniqueId=`${s.agent_id}-${s.id}`,this.expandedTasks[s.uniqueId]||(this.expandedTasks[s.uniqueId]={}),this.expandedTasks[s.uniqueId].expandedInput&&(s.expandedInput=!0),this.expandedTasks[s.uniqueId].backgroundColor=this.expandedTasks[s.uniqueId].backgroundColor||"black",s.backgroundColor=this.expandedTasks[s.uniqueId].backgroundColor,this.isAnsi(s.output||"")&&(this.expandedTasks[s.uniqueId].htmlOutput=this.ansiToHtml(s.output)),s)),this.tasks=e.records,this.loading=!1}}};var L=function(){var e=this,s=e._self._c;return s("div",[s(U,{attrs:{length:e.totalPages,"total-visible":10},on:{input:e.handlePageChange},model:{value:e.currentPage,callback:function(n){e.currentPage=n},expression:"currentPage"}}),s(G,{attrs:{headers:e.headers,items:e.tasks,"item-key":"uniqueId","sort-by":e.sortBy,"sort-desc":e.sortDesc,"server-items-length":e.totalItems,"footer-props":{"items-per-page-options":[10,25,50,100]},"items-per-page":e.itemsPerPage,loading:e.loading,page:e.currentPage,"show-expand":""},on:{"update:itemsPerPage":function(n){e.itemsPerPage=n},"update:items-per-page":function(n){e.itemsPerPage=n},"update:options":e.handleOptionsChange},scopedSlots:e._u([{key:"expanded-item",fn:function({headers:n,item:a}){return[s("td",{attrs:{colspan:n.length}},[s("div",[s("div",{staticStyle:{display:"flex","justify-content":"space-between","align-items":"center"}},[s("div",[s(_,{attrs:{icon:a.expandedInput?"fa-minus":"fa-plus",text:"See Full Input","x-small":""},on:{click:function(o){return e.toggleSeeFullInput(a)}}}),a.expandedInput?s("span",[e._v("Showing full input")]):e._e()],1),s(F,{attrs:{"false-value":"white","true-value":"black",label:"Dark Background"},on:{change:function(o){return e.updateTaskBackgroundColor(a)}},model:{value:e.expandedTasks[a.uniqueId].backgroundColor,callback:function(o){e.$set(e.expandedTasks[a.uniqueId],"backgroundColor",o)},expression:"expandedTasks[item.uniqueId].backgroundColor"}})],1),s("p",[s("b",[e._v("Task Input:")])]),s("p",{class:"mono "+(e.expandedTasks[a.uniqueId].backgroundColor==="white"?"font-black":"font-white"),style:"background-color: "+e.expandedTasks[a.uniqueId].backgroundColor+";"},[e._v(" "+e._s(a.expandedInput?e.expandedTasks[a.uniqueId].full_input:a.input)+" ")]),s("p",[s("b",[e._v("Task Output:")])]),a.downloads.length>0&&a.downloads.some(o=>o.filename.match(/[^/]+(jpg|jpeg|png|gif)$/))?s("div",[s(p,{attrs:{text:"","x-small":""},on:{click:function(o){return e.getImagesForTask(a)}}},[e._v(" View Images ")]),s("div",e._l(a.downloads,function(o){return s(P,{key:o.id,attrs:{src:e.imageData(a,o),alt:o.filename,"max-width":700,contain:""}})}),1)],1):e._e(),s("div",{class:"mono "+(e.expandedTasks[a.uniqueId].backgroundColor==="white"?"font-black":"font-white"),style:"background-color: "+e.expandedTasks[a.uniqueId].backgroundColor+";"},[e.expandedTasks[a.uniqueId].htmlOutput?s("div",{domProps:{innerHTML:e._s(e.expandedTasks[a.uniqueId].htmlOutput)}}):s("div",[e._v(" "+e._s(a.output)+" ")])])])])]}},{key:"item.status",fn:function({item:n}){return[n.status==="pulled"?s(r,{attrs:{color:"green",small:""}},[e._v(" fa-check-square ")]):n.status==="queued"?s(r,{attrs:{color:"orange",small:""}},[e._v(" fa-clock ")]):e._e()]}},e.agent?null:{key:"item.agent_id",fn:function({item:n}){return[s("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"agentEdit",params:{id:n.agent_id}}}},[e._v(" "+e._s(n.agent_id)+" ")])]}},{key:"item.input",fn:function({item:n}){return[s("span",[e._v(e._s(e.truncateMessage(n.input)))])]}},{key:"item.task_name",fn:function({item:n}){return[s("span",[e._v(e._s(n.module_name==null?n.task_name:n.module_name))])]}},{key:"item.updated_at",fn:function({item:n}){return[s(h,{attrs:{timestamp:n.updated_at}})]}},{key:"item.tags",fn:function({item:n}){return[s(g,{attrs:{tags:n.tags},on:{"update-tag":function(a){return e.updateTag(n,...arguments)},"delete-tag":function(a){return e.deleteTag(n,...arguments)},"new-tag":function(a){return e.addTag(n,...arguments)}}})]}},{key:"item.actions",fn:function({item:n}){return[s(j,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:a,attrs:o}){return[s(p,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",o,!1),a),[s(r,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[s(A,{staticClass:"ml-2 mr-2"},[s(i,{key:"downloadInput",attrs:{link:""},on:{click:function(a){return e.downloadInput(n)}}},[s(u,[s(r,[e._v("fa-download")]),e._v(" Download Input ")],1)],1),e.hasOutput(n)?s(i,{key:"downloadOutput",attrs:{link:""},on:{click:function(a){return e.downloadOutput(n)}}},[s(u,[s(r,[e._v("fa-download")]),e._v(" Download Output ")],1)],1):e._e(),s(i,{key:"clipboardInput",attrs:{link:""},on:{click:function(a){return e.copyInput(n)}}},[s(u,[s(r,[e._v("fa-paperclip")]),e._v(" Copy Input to Clipboard ")],1)],1),e.hasOutput(n)?s(i,{key:"clipboardOutput",attrs:{link:""},on:{click:function(a){return e.copyOutput(n)}}},[s(u,[s(r,[e._v("fa-paperclip")]),e._v(" Copy Output to Clipboard ")],1)],1):e._e(),s(C),e._l(n.downloads,function(a){return s(i,{key:"download-"+a.id,attrs:{link:""},on:{click:function(o){return e.downloadFile(a)}}},[s(u,[s(r,[e._v("fa-download")]),e._v(" Download "+e._s(a.filename)+" ")],1)],1)})],2)],1)]}}],null,!0)})],1)},R=[],V=f(H,L,R,!1,null,null,null,null);const y=V.exports;const M={name:"AgentTasksList",components:{AdvancedTable:x,ExpansionPanelFilter:l,ExpansionPanelSearch:b,AgentTasksTable:y,ListPageTop:v},mixins:[k],props:{agent:{type:Object,required:!1,default:null},refreshTasks:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},data(){return{breads:[{text:"Agents",disabled:!0,href:"/agents"},{text:"Tasks",disabled:!0,href:"/agents?tab=tasks"}],tasks:[],search:"",loading:!1,moment:m,selectedAgents:[],selectedUsers:[],selectedTags:[],tags:[],debouncedGetTasks:T(this.getTasks,500)}},computed:{...O({agents:t=>t.agent.agents,users:t=>{const e=t.user.users;return e.push({id:0,username:"Non-User"}),e}})},watch:{agent:{handler(t){t&&(this.selectedAgents=[t.session_id])},immediate:!0}},async mounted(){await Promise.all([this.$store.dispatch("agent/getAgents"),this.$store.dispatch("user/getUsers"),this.getTags()])},methods:{async getTags(){const t=await E({page:1,limit:-1,sources:"agent_task"}),e=[];t.records.forEach(s=>{e.find(a=>a.name===s.name&&a.value===s.value)||e.push(s)}),this.tags=e},getTasks(){this.$refs.agentTasksTable.debouncedGetTasks()}}};var z=function(){var e=this,s=e._self._c;return s("div",[e.active?s(v,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!0,"show-delete":!1},on:{refresh:e.getTasks}}):e._e(),s(x,{scopedSlots:e._u([{key:"filters",fn:function(){return[s(b,{attrs:{title:"Search",label:"Search"},model:{value:e.search,callback:function(n){e.search=n},expression:"search"}}),e.agent?e._e():s(l,{attrs:{title:"Agents",label:"name","item-key":"session_id","item-value":"session_id",items:e.agents},model:{value:e.selectedAgents,callback:function(n){e.selectedAgents=n},expression:"selectedAgents"}}),s(l,{attrs:{title:"Users",label:"username","item-key":"id","item-value":"id",items:e.users},model:{value:e.selectedUsers,callback:function(n){e.selectedUsers=n},expression:"selectedUsers"}}),s(l,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(n){e.selectedTags=n},expression:"selectedTags"}})]},proxy:!0},{key:"table",fn:function(){return[s(y,{ref:"agentTasksTable",attrs:{agent:e.agent,"refresh-tasks":e.refreshTasks,"hide-columns":["id","task_name"],"selected-agents":e.selectedAgents,"selected-users":e.selectedUsers,"selected-tags":e.selectedTags,search:e.search},on:{"refresh-tags":e.getTags}})]},proxy:!0}])})],1)},N=[],Y=f(M,z,N,!1,null,null,null,null);const pe=Y.exports;export{pe as _}; diff --git a/dist/assets/Agents.2c90f0c8.js b/dist/assets/Agents.2c90f0c8.js new file mode 100644 index 0000000..abc378b --- /dev/null +++ b/dist/assets/Agents.2c90f0c8.js @@ -0,0 +1 @@ +import{_ as A}from"./AgentTasksList.3c2e6ebb.js";import{_ as x}from"./TagViewer.a3da6a20.js";import{_ as d}from"./DateTimeDisplay.c35d52fb.js";import{h as b}from"./moment.9709ab41.js";import{e as y,b3 as C,b4 as E,b5 as F,n as _,p as g,b as l,c as r,g as h,h as i,a1 as p,l as m,f as u,i as c}from"./index.85262dd3.js";import{_ as L}from"./VDataTable.125536b6.js";import{_ as I}from"./VTooltip.0c849a74.js";import{_ as T}from"./ExpansionPanelFilter.8ec031fa.js";import{_ as $}from"./AdvancedTable.8f5cf108.js";import{_ as w}from"./ListPageTop.2a204a11.js";import{g as P}from"./tag-api.d2d18349.js";import{_ as f}from"./VSwitch.8a27782c.js";import{_ as D,a as v,b as M,c as k}from"./VTabItem.35a0348a.js";import"./TooltipButton.6f10f736.js";import"./index.c62fa657.js";import"./ansi_up.de92b8a0.js";import"./download-stager.cac59e06.js";import"./VPagination.873af1be.js";import"./ExpansionPanelSearch.252e89f2.js";import"./VExpansionPanelHeader.1232ca65.js";import"./VSelect.8543571f.js";import"./VExpansionPanels.d99facd5.js";import"./VBreadcrumbs.32f4f2d0.js";const K={name:"AgentsTable",components:{DateTimeDisplay:d,TagViewer:x},props:{input:{type:Array,default:()=>[]},selectedTags:{type:Array,default:()=>[]},hideStaleAgents:{type:Boolean,required:!0},hideArchivedAgents:{type:Boolean,required:!0}},data(){return{loading:!1,headersFull:[{text:"Name",value:"name",defaultHeader:!0,alwaysShow:!0,order:1},{text:"Last Seen",value:"lastseen_time",defaultHeader:!0,alwaysShow:!0,order:2},{text:"First Seen",value:"checkin_time",defaultHeader:!0,alwaysShow:!0,order:3},{text:"Listener",value:"listener",order:4},{text:"Hostname",value:"hostname",defaultHeader:!0,order:5},{text:"Process",value:"process_name",defaultHeader:!0,order:6},{text:"Process ID",value:"process_id",order:7},{text:"Architecture",value:"architecture",order:8},{text:"Language",value:"language",defaultHeader:!0,order:9},{text:"Language Version",value:"language_version",order:10},{text:"Username",value:"username",defaultHeader:!0,order:11},{text:"Working Hours",value:"working_hours",order:12},{text:"External IP",value:"external_ip",order:13},{text:"Internal IP",value:"internal_ip",defaultHeader:!0,order:14},{text:"Delay",value:"delay",order:15},{text:"Jitter",value:"jitter",order:16},{text:"Tags",value:"tags",order:17},{text:"Actions",value:"actions",defaultHeader:!0,alwaysShow:!0,order:18}],selectedHeadersTemp:[],selected:[],showHeaderMenu:!1,moment:b}},computed:{...y({agents:s=>s.agent.agents,agentsStatus:s=>s.agent.status,selectedHeadersState:s=>s.application.agentHeaders}),selectedAll:{set(s){this.selectedHeadersTemp=[...this.staticHeaders],s&&this.headersFull.forEach(e=>{this.selectedHeadersTemp.push(e)})},get(){return this.selectedHeadersTemp.length===this.count}},headers(){return this.headersFull.filter(s=>this.selectedHeaders.findIndex(e=>e.text===s.text)>-1).sort((s,e)=>s.order-e.order)},selectableHeaders(){return this.headersFull.filter(s=>!s.alwaysShow)},staticHeaders(){return this.headersFull.filter(s=>s.alwaysShow)},sortedAgents(){let s=this.agents.slice();return s.sort((e,t)=>-e.lastseen_time.localeCompare(t.lastseen_time)),this.hideStaleAgents&&(s=s.filter(e=>!e.stale)),this.hideArchivedAgents&&(s=s.filter(e=>!e.archived)),this.selectedTags.length===0||(s=s.filter(e=>e.tags.map(a=>`${a.name}:${a.value}`).some(a=>this.selectedTags.includes(a)))),s},selectedHeaders:{set(s){this.$store.dispatch("application/agentHeaders",s)},get(){return this.selectedHeadersState}}},watch:{selectedTags(){this.getAgents()},selected(s){this.$emit("input",s)}},async mounted(){this.getAgents(),this.selectedHeaders.length===0&&(this.selectedHeaders=this.headersFull.filter(s=>s.defaultHeader===!0)),this.selectedHeadersTemp=[...this.selectedHeaders]},methods:{deleteTag(s,e){C(s.session_id,e.id).then(()=>{s.tags=s.tags.filter(t=>t.id!==e.id),this.$emit("refresh-tags")}).catch(t=>this.$snack.error(`Error: ${t}`))},updateTag(s,e){E(s.session_id,e).then(t=>{const a=s.tags.findIndex(n=>n.id===t.id);s.tags.splice(a,1,t),this.$emit("refresh-tags"),this.$snack.success("Tag updated")}).catch(t=>this.$snack.error(`Error: ${t}`))},addTag(s,e){F(s.session_id,e).then(t=>{s.tags.push(t),this.$emit("refresh-tags")}).catch(t=>this.$snack.error(`Error: ${t}`))},submitHeaderForm(){this.selectedHeaders=[...this.selectedHeadersTemp],this.showHeaderMenu=!1},getAgents(){this.$store.dispatch("agent/getAgents")},async killAgent(s){this.$emit("killAgent",s)},popout(s){window.open(`${window.location.href}/${s.name}?hideSideBar=true`,"popup","width=600,height=600")},truncateMessage(s){return s?s.length>30?`${s.substr(0,30)}...`:s:""},rowClass(s){return s.stale?"warning-row":""}}};var q=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"ml-3 mr-3 align-center",staticStyle:{display:"flex","flex-direction":"row-reverse"}},[t("div",{staticStyle:{height:"40px"}}),t(g,{attrs:{"offset-y":"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function({on:a,attrs:n}){return[t(l,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",n,!1),a),[t(r,[e._v("mdi-format-columns")])],1)]}}]),model:{value:e.showHeaderMenu,callback:function(a){e.showHeaderMenu=a},expression:"showHeaderMenu"}},[t(h,{staticStyle:{"overflow-y":"auto"},attrs:{"max-height":"400px"}},[t(i,[t(p,{attrs:{label:"Select All"},model:{value:e.selectedAll,callback:function(a){e.selectedAll=a},expression:"selectedAll"}})],1),t(m,{staticClass:"pb-4"}),e._l(e.selectableHeaders,function(a,n){return t(i,{key:n},[t(p,{attrs:{label:a.text,value:a},model:{value:e.selectedHeadersTemp,callback:function(o){e.selectedHeadersTemp=o},expression:"selectedHeadersTemp"}})],1)})],2),t(u,{staticClass:"pt-4"},[t(l,{staticClass:"mb-4",attrs:{text:""},on:{click:function(a){e.showHeaderMenu=!1}}},[e._v(" Cancel ")]),t(l,{staticClass:"ml-4 mb-4",attrs:{text:""},on:{click:e.submitHeaderForm}},[e._v(" Save ")])],1)],1)],1),t(L,{attrs:{loading:e.agentsStatus==="loading","item-class":e.rowClass,headers:e.headers,items:e.sortedAgents,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"session_id",dense:"","show-select":""},scopedSlots:e._u([{key:"item.name",fn:function({item:a}){return[t(I,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:n}){return[a.high_integrity?t(r,e._g({attrs:{small:""}},n),[e._v(" fa-user-cog ")]):e._e()]}}],null,!0)},[t("span",[e._v("Elevated Process")])]),t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"agentEdit",params:{id:a.session_id}}}},[e._v(" "+e._s(a.name)+" ")])]}},{key:"item.lastseen_time",fn:function({item:a}){return[t(d,{attrs:{timestamp:a.lastseen_time}})]}},{key:"item.checkin_time",fn:function({item:a}){return[t(d,{attrs:{timestamp:a.checkin_time}})]}},{key:"item.listener",fn:function({item:a}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"listenerEdit",params:{id:a.listener}}}},[e._v(" "+e._s(a.listener)+" ")])]}},{key:"item.process_name",fn:function({item:a}){return[t("span",[e._v(e._s(e.truncateMessage(a.process_name)))])]}},{key:"item.tags",fn:function({item:a}){return[t(x,{attrs:{tags:a.tags},on:{"update-tag":function(n){return e.updateTag(a,...arguments)},"delete-tag":function(n){return e.deleteTag(a,...arguments)},"new-tag":function(n){return e.addTag(a,...arguments)}}})]}},{key:"item.actions",fn:function({item:a}){return[t(g,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:n,attrs:o}){return[t(l,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",o,!1),n),[t(r,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(h,{staticClass:"ml-2 mr-2"},[t(i,{key:"view",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"agentEdit",params:{id:a.session_id}}}},[t(c,[t(r,[e._v("fa-binoculars")]),e._v(" View ")],1)],1)],1),t(i,{key:"popout",attrs:{link:""},on:{click:function(n){return e.popout(a)}}},[t(c,[t(r,[e._v(" fa-external-link-alt ")]),e._v(" Popout ")],1)],1),t(m,{staticClass:"pb-4"}),t(i,{key:"delete",attrs:{link:""},on:{click:function(n){return e.killAgent(a)}}},[t(c,[t(r,[e._v("fa-trash-alt")]),e._v(" Kill ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(a){e.selected=a},expression:"selected"}})],1)},B=[],V=_(K,q,B,!1,null,"35a78316",null,null);const H=V.exports;const R={name:"AgentsList",components:{AdvancedTable:$,ExpansionPanelFilter:T,AgentsTable:H,ListPageTop:w},props:{active:{type:Boolean,default:!1}},data(){return{breads:[{text:"Agents",disabled:!0,href:"/agents"},{text:"List",disabled:!0,href:"/agents?tab=list-view"}],selected:[],selectedTags:[],tags:[],moment:b}},computed:{...y({agents:s=>s.agent.agents,hideStaleAgents:s=>s.application.hideStaleAgents,hideArchivedAgents:s=>s.application.hideArchivedAgents}),sortedAgents(){let s=this.agents.slice();return s.sort((e,t)=>-e.lastseen_time.localeCompare(t.lastseen_time)),this.hideStaleAgents&&(s=s.filter(e=>!e.stale)),this.hideArchivedAgents&&(s=s.filter(e=>!e.archived)),this.selectedTags.length===0||(s=s.filter(e=>e.tags.map(a=>`${a.name}:${a.value}`).some(a=>this.selectedTags.includes(a)))),s},showDelete(){return this.selected.length>0},hideStaleAgentsCheckbox:{set(s){this.$store.dispatch("application/hideStaleAgents",s)},get(){return this.hideStaleAgents}},hideArchivedAgentsCheckbox:{set(s){this.$store.dispatch("application/hideArchivedAgents",s)},get(){return this.hideArchivedAgents}}},async mounted(){this.getTags()},methods:{async getTags(){const s=await P({page:1,limit:-1,sources:"agent"}),e=[];s.records.forEach(t=>{e.find(n=>n.name===t.name&&n.value===t.value)||e.push(t)}),this.tags=e},async killAgents(){await this.$root.$confirm("Kill Agent",`Do you want to kill ${this.selected.length} agents?`,{color:"red"})&&(this.selected.forEach(s=>{this.$store.dispatch("agent/killAgent",{sessionId:s.session_id})}),this.$snack.success(`${this.selected.length} agents tasked to run TASK_EXIT.`),this.selected=[])},getAgents(){this.$refs.agentsTable.getAgents()},async killAgent(s){await this.$root.$confirm("Kill Agent",`Do you want to kill agent ${s.name}?`,{color:"red"})&&(this.$store.dispatch("agent/killAgent",{sessionId:s.session_id}),this.$snack.success(`Agent ${s.name} tasked to run TASK_EXIT.`))}}};var X=function(){var e=this,t=e._self._c;return t("div",[e.active?t(w,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!0,"show-delete":e.showDelete,"delete-text":"Kill"},on:{delete:e.killAgents,refresh:e.getAgents}}):e._e(),t($,{scopedSlots:e._u([{key:"filters",fn:function(){return[t(f,{attrs:{label:"Hide Stale Agents"},model:{value:e.hideStaleAgentsCheckbox,callback:function(a){e.hideStaleAgentsCheckbox=a},expression:"hideStaleAgentsCheckbox"}}),t(f,{staticClass:"pl-4",attrs:{label:"Hide Archived Agents"},model:{value:e.hideArchivedAgentsCheckbox,callback:function(a){e.hideArchivedAgentsCheckbox=a},expression:"hideArchivedAgentsCheckbox"}}),t(T,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(a){e.selectedTags=a},expression:"selectedTags"}})]},proxy:!0},{key:"table",fn:function(){return[t(H,{ref:"agentsTable",attrs:{"hide-stale-agents":e.hideStaleAgentsCheckbox,"hide-archived-agents":e.hideArchivedAgentsCheckbox,"selected-tags":e.selectedTags},on:{"refresh-tags":e.getTags},model:{value:e.selected,callback:function(a){e.selected=a},expression:"selected"}})]},proxy:!0}])})],1)},j=[],z=_(R,X,j,!1,null,"42b94296",null,null);const S=z.exports;const J={name:"Agents",components:{AgentsList:S,AgentTasksList:A},data(){return{}},computed:{tab:{set(s){this.$router.replace({query:{...this.$route.query,tab:s}})},get(){return this.$route.query.tab||"list-view"}}}};var N=function(){var e=this,t=e._self._c;return t("div",[t("portal",{attrs:{to:"app-bar-extension"}},[t("div",{staticStyle:{display:"flex","flex-direction":"row",width:"100%"}},[t(D,{attrs:{"align-with-title":""},model:{value:e.tab,callback:function(a){e.tab=a},expression:"tab"}},[t(v,{key:"list-view",attrs:{href:"#list-view"}},[e._v(" List "),t(r,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-list ")])],1),t(v,{key:"tasks",attrs:{href:"#tasks"}},[e._v(" Tasks "),t(r,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-sticky-note ")])],1)],1)],1)]),t(M,{model:{value:e.tab,callback:function(a){e.tab=a},expression:"tab"}},[t(k,{key:"list-view",attrs:{value:"list-view",transition:!1,"reverse-transition":!1}},[t(u,{attrs:{flat:""}},[t(S,{attrs:{active:e.tab==="list-view"}})],1)],1),t(k,{key:"tasks",attrs:{value:"tasks",transition:!1,"reverse-transition":!1}},[t(u,{attrs:{flat:""}},[t(A,{attrs:{active:e.tab==="tasks"}})],1)],1)],1)],1)},O=[],U=_(J,N,O,!1,null,null,null,null);const ve=U.exports;export{ve as default}; diff --git a/dist/assets/Agents.60e7738c.js b/dist/assets/Agents.60e7738c.js deleted file mode 100644 index 00b3a66..0000000 --- a/dist/assets/Agents.60e7738c.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as A}from"./AgentTasksList.bd1fbdb1.js";import{_ as x}from"./TagViewer.b07ca85a.js";import{_ as d}from"./DateTimeDisplay.97700a4a.js";import{h as b}from"./moment.9709ab41.js";import{i as y,b1 as C,b2 as E,b3 as F,n as _,b as l,c as r,k as g,l as i,ad as h,o as p,r as u,V as c}from"./index.154e9cc6.js";import{_ as m}from"./VSelect.27a57f2b.js";import{_ as L}from"./VDataTable.71ce8bb9.js";import{_ as I}from"./VTooltip.b258437e.js";import{_ as T}from"./ExpansionPanelFilter.5838fe52.js";import{_ as $}from"./AdvancedTable.65916e9e.js";import{_ as w}from"./ListPageTop.dad49f81.js";import{g as P}from"./tag-api.5e19879c.js";import{_ as f}from"./VSwitch.4adac3f4.js";import{_ as D,a as v,b as M,c as k}from"./VTabItem.9e30abd4.js";import"./TooltipButton.6022e185.js";import"./index.e9f2ede5.js";import"./ansi_up.bcd3942b.js";import"./download-stager.85a6b476.js";import"./download-api.dfe5301b.js";import"./VPagination.90d5be16.js";import"./ExpansionPanelSearch.7dcac59a.js";import"./VExpansionPanelHeader.d8fbc23c.js";import"./index.27090f0f.js";import"./VExpansionPanels.1f915cd7.js";import"./VBreadcrumbs.a2278375.js";const K={name:"AgentsTable",components:{DateTimeDisplay:d,TagViewer:x},props:{input:{type:Array,default:()=>[]},selectedTags:{type:Array,default:()=>[]},hideStaleAgents:{type:Boolean,required:!0},hideArchivedAgents:{type:Boolean,required:!0}},data(){return{loading:!1,headersFull:[{text:"Name",value:"name",defaultHeader:!0,alwaysShow:!0,order:1},{text:"Last Seen",value:"lastseen_time",defaultHeader:!0,alwaysShow:!0,order:2},{text:"First Seen",value:"checkin_time",defaultHeader:!0,alwaysShow:!0,order:3},{text:"Listener",value:"listener",order:4},{text:"Hostname",value:"hostname",defaultHeader:!0,order:5},{text:"Process",value:"process_name",defaultHeader:!0,order:6},{text:"Process ID",value:"process_id",order:7},{text:"Architecture",value:"architecture",order:8},{text:"Language",value:"language",defaultHeader:!0,order:9},{text:"Language Version",value:"language_version",order:10},{text:"Username",value:"username",defaultHeader:!0,order:11},{text:"Working Hours",value:"working_hours",order:12},{text:"External IP",value:"external_ip",order:13},{text:"Internal IP",value:"internal_ip",defaultHeader:!0,order:14},{text:"Delay",value:"delay",order:15},{text:"Jitter",value:"jitter",order:16},{text:"Tags",value:"tags",order:17},{text:"Actions",value:"actions",defaultHeader:!0,alwaysShow:!0,order:18}],selectedHeadersTemp:[],selected:[],showHeaderMenu:!1,moment:b}},computed:{...y({agents:s=>s.agent.agents,agentsStatus:s=>s.agent.status,selectedHeadersState:s=>s.application.agentHeaders}),selectedAll:{set(s){this.selectedHeadersTemp=[...this.staticHeaders],s&&this.headersFull.forEach(e=>{this.selectedHeadersTemp.push(e)})},get(){return this.selectedHeadersTemp.length===this.count}},headers(){return this.headersFull.filter(s=>this.selectedHeaders.findIndex(e=>e.text===s.text)>-1).sort((s,e)=>s.order-e.order)},selectableHeaders(){return this.headersFull.filter(s=>!s.alwaysShow)},staticHeaders(){return this.headersFull.filter(s=>s.alwaysShow)},sortedAgents(){let s=this.agents.slice();return s.sort((e,t)=>-e.lastseen_time.localeCompare(t.lastseen_time)),this.hideStaleAgents&&(s=s.filter(e=>!e.stale)),this.hideArchivedAgents&&(s=s.filter(e=>!e.archived)),this.selectedTags.length===0||(s=s.filter(e=>e.tags.map(a=>`${a.name}:${a.value}`).some(a=>this.selectedTags.includes(a)))),s},selectedHeaders:{set(s){this.$store.dispatch("application/agentHeaders",s)},get(){return this.selectedHeadersState}}},watch:{selectedTags(){this.getAgents()},selected(s){this.$emit("input",s)}},async mounted(){this.getAgents(),this.selectedHeaders.length===0&&(this.selectedHeaders=this.headersFull.filter(s=>s.defaultHeader===!0)),this.selectedHeadersTemp=[...this.selectedHeaders]},methods:{deleteTag(s,e){C(s.session_id,e.id).then(()=>{s.tags=s.tags.filter(t=>t.id!==e.id),this.$emit("refresh-tags")}).catch(t=>this.$snack.error(`Error: ${t}`))},updateTag(s,e){E(s.session_id,e).then(t=>{const a=s.tags.findIndex(n=>n.id===t.id);s.tags.splice(a,1,t),this.$emit("refresh-tags"),this.$snack.success("Tag updated")}).catch(t=>this.$snack.error(`Error: ${t}`))},addTag(s,e){F(s.session_id,e).then(t=>{s.tags.push(t),this.$emit("refresh-tags")}).catch(t=>this.$snack.error(`Error: ${t}`))},submitHeaderForm(){this.selectedHeaders=[...this.selectedHeadersTemp],this.showHeaderMenu=!1},getAgents(){this.$store.dispatch("agent/getAgents")},async killAgent(s){this.$emit("killAgent",s)},popout(s){window.open(`${window.location.href}/${s.name}?hideSideBar=true`,"popup","width=600,height=600")},truncateMessage(s){return s?s.length>30?`${s.substr(0,30)}...`:s:""},rowClass(s){return s.stale?"warning-row":""}}};var q=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"ml-3 mr-3 align-center",staticStyle:{display:"flex","flex-direction":"row-reverse"}},[t("div",{staticStyle:{height:"40px"}}),t(m,{attrs:{"offset-y":"","close-on-content-click":!1},scopedSlots:e._u([{key:"activator",fn:function({on:a,attrs:n}){return[t(l,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",n,!1),a),[t(r,[e._v("mdi-format-columns")])],1)]}}]),model:{value:e.showHeaderMenu,callback:function(a){e.showHeaderMenu=a},expression:"showHeaderMenu"}},[t(g,{staticStyle:{"overflow-y":"auto"},attrs:{"max-height":"400px"}},[t(i,[t(h,{attrs:{label:"Select All"},model:{value:e.selectedAll,callback:function(a){e.selectedAll=a},expression:"selectedAll"}})],1),t(p,{staticClass:"pb-4"}),e._l(e.selectableHeaders,function(a,n){return t(i,{key:n},[t(h,{attrs:{label:a.text,value:a},model:{value:e.selectedHeadersTemp,callback:function(o){e.selectedHeadersTemp=o},expression:"selectedHeadersTemp"}})],1)})],2),t(u,{staticClass:"pt-4"},[t(l,{staticClass:"mb-4",attrs:{text:""},on:{click:function(a){e.showHeaderMenu=!1}}},[e._v(" Cancel ")]),t(l,{staticClass:"ml-4 mb-4",attrs:{text:""},on:{click:e.submitHeaderForm}},[e._v(" Save ")])],1)],1)],1),t(L,{attrs:{loading:e.agentsStatus==="loading","item-class":e.rowClass,headers:e.headers,items:e.sortedAgents,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"session_id",dense:"","show-select":""},scopedSlots:e._u([{key:"item.name",fn:function({item:a}){return[t(I,{attrs:{top:""},scopedSlots:e._u([{key:"activator",fn:function({on:n}){return[a.high_integrity?t(r,e._g({attrs:{small:""}},n),[e._v(" fa-user-cog ")]):e._e()]}}],null,!0)},[t("span",[e._v("Elevated Process")])]),t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"agentEdit",params:{id:a.session_id}}}},[e._v(" "+e._s(a.name)+" ")])]}},{key:"item.lastseen_time",fn:function({item:a}){return[t(d,{attrs:{timestamp:a.lastseen_time}})]}},{key:"item.checkin_time",fn:function({item:a}){return[t(d,{attrs:{timestamp:a.checkin_time}})]}},{key:"item.listener",fn:function({item:a}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"listenerEdit",params:{id:a.listener}}}},[e._v(" "+e._s(a.listener)+" ")])]}},{key:"item.process_name",fn:function({item:a}){return[t("span",[e._v(e._s(e.truncateMessage(a.process_name)))])]}},{key:"item.tags",fn:function({item:a}){return[t(x,{attrs:{tags:a.tags},on:{"update-tag":function(n){return e.updateTag(a,...arguments)},"delete-tag":function(n){return e.deleteTag(a,...arguments)},"new-tag":function(n){return e.addTag(a,...arguments)}}})]}},{key:"item.actions",fn:function({item:a}){return[t(m,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:n,attrs:o}){return[t(l,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",o,!1),n),[t(r,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(g,{staticClass:"ml-2 mr-2"},[t(i,{key:"view",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"agentEdit",params:{id:a.session_id}}}},[t(c,[t(r,[e._v("fa-binoculars")]),e._v(" View ")],1)],1)],1),t(i,{key:"popout",attrs:{link:""},on:{click:function(n){return e.popout(a)}}},[t(c,[t(r,[e._v(" fa-external-link-alt ")]),e._v(" Popout ")],1)],1),t(p,{staticClass:"pb-4"}),t(i,{key:"delete",attrs:{link:""},on:{click:function(n){return e.killAgent(a)}}},[t(c,[t(r,[e._v("fa-trash-alt")]),e._v(" Kill ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(a){e.selected=a},expression:"selected"}})],1)},V=[],B=_(K,q,V,!1,null,"de10bb65",null,null);const H=B.exports;const R={name:"AgentsList",components:{AdvancedTable:$,ExpansionPanelFilter:T,AgentsTable:H,ListPageTop:w},props:{active:{type:Boolean,default:!1}},data(){return{breads:[{text:"Agents",disabled:!0,href:"/agents"},{text:"List",disabled:!0,href:"/agents?tab=list-view"}],selected:[],selectedTags:[],tags:[],moment:b}},computed:{...y({agents:s=>s.agent.agents,hideStaleAgents:s=>s.application.hideStaleAgents,hideArchivedAgents:s=>s.application.hideArchivedAgents}),sortedAgents(){let s=this.agents.slice();return s.sort((e,t)=>-e.lastseen_time.localeCompare(t.lastseen_time)),this.hideStaleAgents&&(s=s.filter(e=>!e.stale)),this.hideArchivedAgents&&(s=s.filter(e=>!e.archived)),this.selectedTags.length===0||(s=s.filter(e=>e.tags.map(a=>`${a.name}:${a.value}`).some(a=>this.selectedTags.includes(a)))),s},showDelete(){return this.selected.length>0},hideStaleAgentsCheckbox:{set(s){this.$store.dispatch("application/hideStaleAgents",s)},get(){return this.hideStaleAgents}},hideArchivedAgentsCheckbox:{set(s){this.$store.dispatch("application/hideArchivedAgents",s)},get(){return this.hideArchivedAgents}}},async mounted(){this.getTags()},methods:{async getTags(){const s=await P({page:1,limit:-1,sources:"agent"}),e=[];s.records.forEach(t=>{e.find(n=>n.name===t.name&&n.value===t.value)||e.push(t)}),this.tags=e},async killAgents(){await this.$root.$confirm("Kill Agent",`Do you want to kill ${this.selected.length} agents?`,{color:"red"})&&(this.selected.forEach(s=>{this.$store.dispatch("agent/killAgent",{sessionId:s.session_id})}),this.$snack.success(`${this.selected.length} agents tasked to run TASK_EXIT.`),this.selected=[])},getAgents(){this.$refs.agentsTable.getAgents()},async killAgent(s){await this.$root.$confirm("Kill Agent",`Do you want to kill agent ${s.name}?`,{color:"red"})&&(this.$store.dispatch("agent/killAgent",{sessionId:s.session_id}),this.$snack.success(`Agent ${s.name} tasked to run TASK_EXIT.`))}}};var X=function(){var e=this,t=e._self._c;return t("div",[e.active?t(w,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!0,"show-delete":e.showDelete,"delete-text":"Kill"},on:{delete:e.killAgents,refresh:e.getAgents}}):e._e(),t($,{scopedSlots:e._u([{key:"filters",fn:function(){return[t(f,{attrs:{label:"Hide Stale Agents"},model:{value:e.hideStaleAgentsCheckbox,callback:function(a){e.hideStaleAgentsCheckbox=a},expression:"hideStaleAgentsCheckbox"}}),t(f,{staticClass:"pl-4",attrs:{label:"Hide Archived Agents"},model:{value:e.hideArchivedAgentsCheckbox,callback:function(a){e.hideArchivedAgentsCheckbox=a},expression:"hideArchivedAgentsCheckbox"}}),t(T,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(a){e.selectedTags=a},expression:"selectedTags"}})]},proxy:!0},{key:"table",fn:function(){return[t(H,{ref:"agentsTable",attrs:{"hide-stale-agents":e.hideStaleAgentsCheckbox,"hide-archived-agents":e.hideArchivedAgentsCheckbox,"selected-tags":e.selectedTags},on:{"refresh-tags":e.getTags},model:{value:e.selected,callback:function(a){e.selected=a},expression:"selected"}})]},proxy:!0}])})],1)},j=[],z=_(R,X,j,!1,null,"deb068c4",null,null);const S=z.exports;const J={name:"Agents",components:{AgentsList:S,AgentTasksList:A},data(){return{}},computed:{tab:{set(s){this.$router.replace({query:{...this.$route.query,tab:s}})},get(){return this.$route.query.tab||"list-view"}}}};var N=function(){var e=this,t=e._self._c;return t("div",[t("portal",{attrs:{to:"app-bar-extension"}},[t("div",{staticStyle:{display:"flex","flex-direction":"row",width:"100%"}},[t(D,{attrs:{"align-with-title":""},model:{value:e.tab,callback:function(a){e.tab=a},expression:"tab"}},[t(v,{key:"list-view",attrs:{href:"#list-view"}},[e._v(" List "),t(r,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-list ")])],1),t(v,{key:"tasks",attrs:{href:"#tasks"}},[e._v(" Tasks "),t(r,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-sticky-note ")])],1)],1)],1)]),t(M,{model:{value:e.tab,callback:function(a){e.tab=a},expression:"tab"}},[t(k,{key:"list-view",attrs:{value:"list-view",transition:!1,"reverse-transition":!1}},[t(u,{attrs:{flat:""}},[t(S,{attrs:{active:e.tab==="list-view"}})],1)],1),t(k,{key:"tasks",attrs:{value:"tasks",transition:!1,"reverse-transition":!1}},[t(u,{attrs:{flat:""}},[t(A,{attrs:{active:e.tab==="tasks"}})],1)],1)],1)],1)},O=[],U=_(J,N,O,!1,null,null,null,null);const Ae=U.exports;export{Ae as default}; diff --git a/dist/assets/BypassEdit.3727ca7b.js b/dist/assets/BypassEdit.3727ca7b.js new file mode 100644 index 0000000..d47ab00 --- /dev/null +++ b/dist/assets/BypassEdit.3727ca7b.js @@ -0,0 +1 @@ +import{_ as i}from"./ErrorStateAlert.5e9140da.js";import{_ as n}from"./EditPageTop.30f77a9c.js";import{n as o,bM as u,bN as l,bO as d,D as m,f as p,aB as c,o as r}from"./index.85262dd3.js";import{_ as h}from"./VTextarea.aac91b1e.js";import"./TooltipButton.6f10f736.js";import"./VTooltip.0c849a74.js";import"./VBreadcrumbs.32f4f2d0.js";const f={name:"BypassEdit",components:{ErrorStateAlert:i,EditPageTop:n},data(){return{form:{},rules:{name:[s=>!!s||"Name is required",s=>!!s&&s.length>2||"Name must be larger than 2 characters"],language:[s=>!!s||"Language is required",s=>!!s&&s.length>2||"Language must be larger than 2 characters"],code:[s=>!!s||"Code is required"]},bypass:{},valid:!0,loading:!1,errorState:!1}},computed:{isNew(){return this.$route.name==="bypassNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"View"},canEdit(){return!0},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"bypassNew",params:{copy:!0,id:this.id}}:{}},breads(){return[{text:"Bypasses",disabled:!1,to:"/bypasses",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/bypasses-edit"}]},breadcrumbName(){return this.isCopy?"New":this.form.name?this.form.name:this.id?this.id:"New"}},watch:{id(s){s&&this.getBypass(s)}},mounted(){!this.isNew||this.isCopy?this.getBypass(this.$route.params.id):this.initialLoad=!0},methods:{async submit(){this.loading||!this.$refs.form.validate()||(this.loading=!0,this.id>0?u(this.form.id,this.form.name,this.form.code,this.form.language).then(()=>{this.$snack.success("Bypass updated"),this.loading=!1}).catch(s=>{this.$snack.error(`Error: ${s}`),this.loading=!1}):l(this.form.name,this.form.code,this.form.language).then(({id:s})=>{this.$snack.success("Bypass created"),this.loading=!1,this.$router.push({name:"bypassEdit",params:{id:s}})}).catch(s=>{this.$snack.error(`Error: ${s}`),this.loading=!1}))},async deleteBypass(){if(await this.$root.$confirm("Delete",`Are you sure you want to delete bypass ${this.form.name}?`,{color:"red"}))try{await this.$store.dispatch("bypass/deleteBypass",this.form.id),this.$router.push({name:"bypasses"})}catch(s){this.$snack.error(`Error: ${s}`)}},getBypass(s){d(s).then(e=>{this.bypass={...e},this.initialLoad=!0,m.set(this,"form",{...e})}).catch(()=>{this.errorState=!0})}}};var y=function(){var e=this,t=e._self._c;return t("div",[t(n,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"disable-submit":!e.canEdit&&e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading&&e.initialLoad,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.deleteBypass}}),t("div",{staticClass:"headers"},[t("h3",[e._v(e._s(e.mode)+" Bypass")])]),e.errorState?t(i,{attrs:{"resource-id":e.id,"resource-type":"bypass"}}):t(p,{staticStyle:{padding:"10px"}},[t(c,{ref:"form",nativeOn:{submit:function(a){return a.preventDefault(),e.submit.apply(null,arguments)}},model:{value:e.valid,callback:function(a){e.valid=a},expression:"valid"}},[t(r,{attrs:{rules:e.rules.name,label:"name",outlined:"",dense:"",required:"",disabled:!e.isNew},model:{value:e.form.name,callback:function(a){e.$set(e.form,"name",a)},expression:"form.name"}}),t(r,{attrs:{rules:e.rules.language,label:"language",outlined:"",dense:"",required:""},model:{value:e.form.language,callback:function(a){e.$set(e.form,"language",a)},expression:"form.language"}}),t(h,{attrs:{rules:e.rules.code,label:"code",outlined:"",dense:"",required:"","auto-grow":""},model:{value:e.form.code,callback:function(a){e.$set(e.form,"code",a)},expression:"form.code"}})],1)],1)],1)},_=[],g=o(f,y,_,!1,null,null,null,null);const x=g.exports;export{x as default}; diff --git a/dist/assets/BypassEdit.b7428d00.js b/dist/assets/BypassEdit.b7428d00.js deleted file mode 100644 index a4188f3..0000000 --- a/dist/assets/BypassEdit.b7428d00.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i}from"./ErrorStateAlert.3518d55f.js";import{_ as n}from"./EditPageTop.0db28cea.js";import{n as o,bI as u,bJ as l,bK as d,z as m,r as p,aE as c,j as r}from"./index.154e9cc6.js";import{_ as h}from"./VTextarea.7a9da2ee.js";import"./index.41ea8dd2.js";import"./TooltipButton.6022e185.js";import"./VTooltip.b258437e.js";import"./index.27090f0f.js";import"./VBreadcrumbs.a2278375.js";const f={name:"BypassEdit",components:{ErrorStateAlert:i,EditPageTop:n},data(){return{form:{},rules:{name:[s=>!!s||"Name is required",s=>!!s&&s.length>2||"Name must be larger than 2 characters"],language:[s=>!!s||"Language is required",s=>!!s&&s.length>2||"Language must be larger than 2 characters"],code:[s=>!!s||"Code is required"]},bypass:{},valid:!0,loading:!1,errorState:!1}},computed:{isNew(){return this.$route.name==="bypassNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"View"},canEdit(){return!0},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"bypassNew",params:{copy:!0,id:this.id}}:{}},breads(){return[{text:"Bypasses",disabled:!1,to:"/bypasses",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/bypasses-edit"}]},breadcrumbName(){return this.isCopy?"New":this.form.name?this.form.name:this.id?this.id:"New"}},watch:{id(s){s&&this.getBypass(s)}},mounted(){!this.isNew||this.isCopy?this.getBypass(this.$route.params.id):this.initialLoad=!0},methods:{async submit(){this.loading||!this.$refs.form.validate()||(this.loading=!0,this.id>0?u(this.form.id,this.form.name,this.form.code,this.form.language).then(()=>{this.$snack.success("Bypass updated"),this.loading=!1}).catch(s=>{this.$snack.error(`Error: ${s}`),this.loading=!1}):l(this.form.name,this.form.code,this.form.language).then(({id:s})=>{this.$snack.success("Bypass created"),this.loading=!1,this.$router.push({name:"bypassEdit",params:{id:s}})}).catch(s=>{this.$snack.error(`Error: ${s}`),this.loading=!1}))},async deleteBypass(){if(await this.$root.$confirm("Delete",`Are you sure you want to delete bypass ${this.form.name}?`,{color:"red"}))try{await this.$store.dispatch("bypass/deleteBypass",this.form.id),this.$router.push({name:"bypasses"})}catch(s){this.$snack.error(`Error: ${s}`)}},getBypass(s){d(s).then(e=>{this.bypass={...e},this.initialLoad=!0,m.set(this,"form",{...e})}).catch(()=>{this.errorState=!0})}}};var y=function(){var e=this,t=e._self._c;return t("div",[t(n,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"disable-submit":!e.canEdit&&e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading&&e.initialLoad,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.deleteBypass}}),t("div",{staticClass:"headers"},[t("h3",[e._v(e._s(e.mode)+" Bypass")])]),e.errorState?t(i,{attrs:{"resource-id":e.id,"resource-type":"bypass"}}):t(p,{staticStyle:{padding:"10px"}},[t(c,{ref:"form",nativeOn:{submit:function(a){return a.preventDefault(),e.submit.apply(null,arguments)}},model:{value:e.valid,callback:function(a){e.valid=a},expression:"valid"}},[t(r,{attrs:{rules:e.rules.name,label:"name",outlined:"",dense:"",required:"",disabled:!e.isNew},model:{value:e.form.name,callback:function(a){e.$set(e.form,"name",a)},expression:"form.name"}}),t(r,{attrs:{rules:e.rules.language,label:"language",outlined:"",dense:"",required:""},model:{value:e.form.language,callback:function(a){e.$set(e.form,"language",a)},expression:"form.language"}}),t(h,{attrs:{rules:e.rules.code,label:"code",outlined:"",dense:"",required:"","auto-grow":""},model:{value:e.form.code,callback:function(a){e.$set(e.form,"code",a)},expression:"form.code"}})],1)],1)],1)},_=[],g=o(f,y,_,!1,null,null,null,null);const L=g.exports;export{L as default}; diff --git a/dist/assets/BypassEdit.e3b0c442.css b/dist/assets/BypassEdit.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/Bypasses.53389166.js b/dist/assets/Bypasses.53389166.js new file mode 100644 index 0000000..94e9d76 --- /dev/null +++ b/dist/assets/Bypasses.53389166.js @@ -0,0 +1 @@ +import{_ as p}from"./DateTimeDisplay.c35d52fb.js";import{_ as l}from"./ListPageTop.2a204a11.js";import{h as u}from"./moment.9709ab41.js";import{e as _,n as d,p as m,b as y,c as o,g as f,h as n,i as r,l as h}from"./index.85262dd3.js";import{_ as b}from"./VDataTable.125536b6.js";import"./VTooltip.0c849a74.js";import"./VBreadcrumbs.32f4f2d0.js";import"./VSelect.8543571f.js";const v={name:"Bypasses",components:{DateTimeDisplay:p,ListPageTop:l},data(){return{breads:[{text:"Bypasses",disabled:!0,href:"/bypasses"}],headers:[{text:"Name",value:"name"},{text:"Updated At",value:"updated_at"},{text:"Actions",value:"actions",sortable:!1}],sortBy:"name",sortDesc:!1,moment:u,selected:[]}},computed:{..._({bypasses:a=>a.bypass.bypasses}),showDelete(){return this.selected.length>0}},mounted(){this.getBypasses()},methods:{getBypasses(){this.$store.dispatch("bypass/getBypasses")},create(){this.$router.push({name:"bypassNew"})},view(a){this.$router.push({name:"bypassEdit",params:{id:a.id}})},async deleteBypass(a){await this.$root.$confirm("Delete",`Are you sure you want to delete bypass ${a.name}?`,{color:"red"})&&this.$store.dispatch("bypass/deleteBypass",a.id)},async deleteBypasses(){await this.$root.$confirm("Delete",`Are you sure you want to delete ${this.selected.length} bypasses?`,{color:"red"})&&this.selected.forEach(a=>{this.$store.dispatch("bypass/deleteBypass",a.id)})}}};var g=function(){var e=this,s=e._self._c;return s("div",[s(l,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"show-delete":e.showDelete},on:{create:e.create,delete:e.deleteBypasses,refresh:e.getBypasses}}),s(b,{attrs:{headers:e.headers,items:e.bypasses,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"name",dense:"","show-select":"","sort-by":e.sortBy,"sort-desc":e.sortDesc},on:{"update:sortBy":function(t){e.sortBy=t},"update:sort-by":function(t){e.sortBy=t},"update:sortDesc":function(t){e.sortDesc=t},"update:sort-desc":function(t){e.sortDesc=t}},scopedSlots:e._u([{key:"item.name",fn:function({item:t}){return[s("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"bypassEdit",params:{id:t.id}}}},[e._v(" "+e._s(t.name)+" ")])]}},{key:"item.updated_at",fn:function({item:t}){return[s(p,{attrs:{timestamp:t.updated_at}})]}},{key:"item.actions",fn:function({item:t}){return[s(m,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:i,attrs:c}){return[s(y,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",c,!1),i),[s(o,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[s(f,{staticClass:"ml-2 mr-2"},[s(n,{key:"view",attrs:{link:""}},[s("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"bypassEdit",params:{id:t.id}}}},[s(r,[s(o,[e._v("fa-binoculars")]),e._v(" View ")],1)],1)],1),s(n,{key:"copy",attrs:{to:{name:"bypassNew",params:{copy:!0,id:t.id}},link:""}},[s(r,[s(o,[e._v("fa-clone")]),e._v(" Copy ")],1)],1),s(h,{staticClass:"pb-4"}),s(n,{key:"delete",attrs:{link:""},on:{click:function(i){return e.deleteBypass(t)}}},[s(r,[s(o,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(t){e.selected=t},expression:"selected"}})],1)},B=[],k=d(v,g,B,!1,null,null,null,null);const N=k.exports;export{N as default}; diff --git a/dist/assets/Bypasses.a7c53e29.js b/dist/assets/Bypasses.a7c53e29.js deleted file mode 100644 index 6dfb190..0000000 --- a/dist/assets/Bypasses.a7c53e29.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as p}from"./DateTimeDisplay.97700a4a.js";import{_ as l}from"./ListPageTop.dad49f81.js";import{h as u}from"./moment.9709ab41.js";import{i as _,n as d,b as m,c as o,k as y,l as n,V as r,o as f}from"./index.154e9cc6.js";import{_ as h}from"./VDataTable.71ce8bb9.js";import{_ as b}from"./VSelect.27a57f2b.js";import"./VTooltip.b258437e.js";import"./index.27090f0f.js";import"./VBreadcrumbs.a2278375.js";const v={name:"Bypasses",components:{DateTimeDisplay:p,ListPageTop:l},data(){return{breads:[{text:"Bypasses",disabled:!0,href:"/bypasses"}],headers:[{text:"Name",value:"name"},{text:"Updated At",value:"updated_at"},{text:"Actions",value:"actions",sortable:!1}],sortBy:"name",sortDesc:!1,moment:u,selected:[]}},computed:{..._({bypasses:a=>a.bypass.bypasses}),showDelete(){return this.selected.length>0}},mounted(){this.getBypasses()},methods:{getBypasses(){this.$store.dispatch("bypass/getBypasses")},create(){this.$router.push({name:"bypassNew"})},view(a){this.$router.push({name:"bypassEdit",params:{id:a.id}})},async deleteBypass(a){await this.$root.$confirm("Delete",`Are you sure you want to delete bypass ${a.name}?`,{color:"red"})&&this.$store.dispatch("bypass/deleteBypass",a.id)},async deleteBypasses(){await this.$root.$confirm("Delete",`Are you sure you want to delete ${this.selected.length} bypasses?`,{color:"red"})&&this.selected.forEach(a=>{this.$store.dispatch("bypass/deleteBypass",a.id)})}}};var g=function(){var e=this,s=e._self._c;return s("div",[s(l,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"show-delete":e.showDelete},on:{create:e.create,delete:e.deleteBypasses,refresh:e.getBypasses}}),s(h,{attrs:{headers:e.headers,items:e.bypasses,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"name",dense:"","show-select":"","sort-by":e.sortBy,"sort-desc":e.sortDesc},on:{"update:sortBy":function(t){e.sortBy=t},"update:sort-by":function(t){e.sortBy=t},"update:sortDesc":function(t){e.sortDesc=t},"update:sort-desc":function(t){e.sortDesc=t}},scopedSlots:e._u([{key:"item.name",fn:function({item:t}){return[s("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"bypassEdit",params:{id:t.id}}}},[e._v(" "+e._s(t.name)+" ")])]}},{key:"item.updated_at",fn:function({item:t}){return[s(p,{attrs:{timestamp:t.updated_at}})]}},{key:"item.actions",fn:function({item:t}){return[s(b,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:i,attrs:c}){return[s(m,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",c,!1),i),[s(o,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[s(y,{staticClass:"ml-2 mr-2"},[s(n,{key:"view",attrs:{link:""}},[s("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"bypassEdit",params:{id:t.id}}}},[s(r,[s(o,[e._v("fa-binoculars")]),e._v(" View ")],1)],1)],1),s(n,{key:"copy",attrs:{to:{name:"bypassNew",params:{copy:!0,id:t.id}},link:""}},[s(r,[s(o,[e._v("fa-clone")]),e._v(" Copy ")],1)],1),s(f,{staticClass:"pb-4"}),s(n,{key:"delete",attrs:{link:""},on:{click:function(i){return e.deleteBypass(t)}}},[s(r,[s(o,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(t){e.selected=t},expression:"selected"}})],1)},B=[],k=d(v,g,B,!1,null,null,null,null);const P=k.exports;export{P as default}; diff --git a/dist/assets/Bypasses.e3b0c442.css b/dist/assets/Bypasses.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/CredentialEdit.0a0ce4e6.js b/dist/assets/CredentialEdit.0a0ce4e6.js new file mode 100644 index 0000000..be8de54 --- /dev/null +++ b/dist/assets/CredentialEdit.0a0ce4e6.js @@ -0,0 +1 @@ +import{_ as a}from"./GeneralForm.fe5154ff.js";import{_ as s}from"./ErrorStateAlert.5e9140da.js";import{_ as n}from"./TagViewer.a3da6a20.js";import{_ as d}from"./EditPageTop.30f77a9c.js";import{n as o,bC as l,bD as u,bE as c,bG as h,bH as p,bI as m,f as _}from"./index.85262dd3.js";import"./VSelect.8543571f.js";import"./VSwitch.8a27782c.js";import"./TooltipButton.6f10f736.js";import"./VTooltip.0c849a74.js";import"./VBreadcrumbs.32f4f2d0.js";const f={name:"CredentialEdit",components:{TagViewer:n,GeneralForm:a,ErrorStateAlert:s,EditPageTop:d},data(){return{reset:!0,loading:!1,initialLoad:!1,credential:{},form:{},errorState:!1}},computed:{breads(){return[{text:"Credentials",disabled:!1,to:"/credentials",exact:!0},{text:this.id&&!this.isCopy?`${this.id}`:"New",disabled:!0,to:"/credential-edit"}]},isNew(){return this.$route.name==="credentialNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"Edit"},canEdit(){return!0},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"credentialNew",params:{copy:!0,id:this.id}}:{}},options(){const t={credtype:{required:!0,strict:!0,suggested_values:["plaintext","hash"]},domain:{required:!0},username:{required:!0},password:{required:!0},host:{required:!0},os:{required:!1},sid:{required:!1},notes:{required:!1}};return Object.keys(this.credential).forEach(e=>{e!=="id"&&t[e]&&(t[e].value=this.credential[e])}),t}},mounted(){!this.isNew||this.isCopy?this.getCredential(this.$route.params.id):this.initialLoad=!0},methods:{deleteTag(t){l(this.credential.id,t.id).then(()=>{this.credential.tags=this.credential.tags.filter(e=>e!==t)}).catch(e=>this.$snack.error(`Error: ${e}`))},updateTag(t){u(this.credential.id,t).then(e=>{const r=this.credential.tags.findIndex(i=>i.id===e.id);this.credential.tags.splice(r,1,e),this.$snack.success("Tag updated")}).catch(e=>this.$snack.error(`Error: ${e}`))},addTag(t){c(this.credential.id,t).then(e=>{this.credential.tags.push(e)}).catch(e=>this.$snack.error(`Error: ${e}`))},submit(){this.loading||!this.$refs.generalform.$refs.form.validate()||(this.loading=!0,this.id>0?h(this.id,this.form).then(()=>{this.loading=!1}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}):p(this.form).then(({id:t})=>{this.loading=!1,this.$router.push({name:"credentialEdit",params:{id:t}})}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}),this.loading=!1)},async deleteCredential(){if(await this.$root.$confirm("Delete",`Are you sure you want to delete credential ${this.id}?`,{color:"red"}))try{this.$store.dispatch("credential/deleteCredential",this.id),this.$router.push({name:"credentials"})}catch(t){this.$snack.error(`Error: ${t}`)}},getCredential(t){m(t).then(e=>{this.reset=!1,this.credential=e,this.initialLoad=!0,setTimeout(()=>{this.reset=!0},500)}).catch(()=>{this.errorState=!0})}}};var g=function(){var e=this,r=e._self._c;return r("div",[r(d,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading&&e.initialLoad,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.deleteCredential}}),r("h3",[e._v(e._s(e.mode)+" Credential")]),e.isNew?e._e():r(n,{attrs:{tags:e.credential.tags},on:{"update-tag":e.updateTag,"delete-tag":e.deleteTag,"new-tag":e.addTag}}),e.errorState?r(s,{attrs:{"resource-id":e.id,"resource-type":"credential"}}):r(_,{staticStyle:{padding:"10px"}},[e.reset?r(a,{ref:"generalform",attrs:{options:e.options,readonly:!e.canEdit},model:{value:e.form,callback:function(i){e.form=i},expression:"form"}}):e._e()],1)],1)},$=[],y=o(f,g,$,!1,null,null,null,null);const N=y.exports;export{N as default}; diff --git a/dist/assets/CredentialEdit.e3b0c442.css b/dist/assets/CredentialEdit.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/CredentialEdit.ec4c6664.js b/dist/assets/CredentialEdit.ec4c6664.js deleted file mode 100644 index bb5b3a7..0000000 --- a/dist/assets/CredentialEdit.ec4c6664.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as a}from"./GeneralForm.6b452c3e.js";import{_ as s}from"./ErrorStateAlert.3518d55f.js";import{_ as n}from"./TagViewer.b07ca85a.js";import{_ as d}from"./EditPageTop.0db28cea.js";import{n as o,by as l,bz as u,bA as c,bC as h,bD as p,bE as m,r as _}from"./index.154e9cc6.js";import"./download-api.dfe5301b.js";import"./VSelect.27a57f2b.js";import"./index.27090f0f.js";import"./VSwitch.4adac3f4.js";import"./index.41ea8dd2.js";import"./TooltipButton.6022e185.js";import"./VTooltip.b258437e.js";import"./VBreadcrumbs.a2278375.js";const f={name:"CredentialEdit",components:{TagViewer:n,GeneralForm:a,ErrorStateAlert:s,EditPageTop:d},data(){return{reset:!0,loading:!1,initialLoad:!1,credential:{},form:{},errorState:!1}},computed:{breads(){return[{text:"Credentials",disabled:!1,to:"/credentials",exact:!0},{text:this.id&&!this.isCopy?`${this.id}`:"New",disabled:!0,to:"/credential-edit"}]},isNew(){return this.$route.name==="credentialNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"Edit"},canEdit(){return!0},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"credentialNew",params:{copy:!0,id:this.id}}:{}},options(){const t={credtype:{required:!0,strict:!0,suggested_values:["plaintext","hash"]},domain:{required:!0},username:{required:!0},password:{required:!0},host:{required:!0},os:{required:!1},sid:{required:!1},notes:{required:!1}};return Object.keys(this.credential).forEach(e=>{e!=="id"&&t[e]&&(t[e].value=this.credential[e])}),t}},mounted(){!this.isNew||this.isCopy?this.getCredential(this.$route.params.id):this.initialLoad=!0},methods:{deleteTag(t){l(this.credential.id,t.id).then(()=>{this.credential.tags=this.credential.tags.filter(e=>e!==t)}).catch(e=>this.$snack.error(`Error: ${e}`))},updateTag(t){u(this.credential.id,t).then(e=>{const r=this.credential.tags.findIndex(i=>i.id===e.id);this.credential.tags.splice(r,1,e),this.$snack.success("Tag updated")}).catch(e=>this.$snack.error(`Error: ${e}`))},addTag(t){c(this.credential.id,t).then(e=>{this.credential.tags.push(e)}).catch(e=>this.$snack.error(`Error: ${e}`))},submit(){this.loading||!this.$refs.generalform.$refs.form.validate()||(this.loading=!0,this.id>0?h(this.id,this.form).then(()=>{this.loading=!1}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}):p(this.form).then(({id:t})=>{this.loading=!1,this.$router.push({name:"credentialEdit",params:{id:t}})}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}),this.loading=!1)},async deleteCredential(){if(await this.$root.$confirm("Delete",`Are you sure you want to delete credential ${this.id}?`,{color:"red"}))try{this.$store.dispatch("credential/deleteCredential",this.id),this.$router.push({name:"credentials"})}catch(t){this.$snack.error(`Error: ${t}`)}},getCredential(t){m(t).then(e=>{this.reset=!1,this.credential=e,this.initialLoad=!0,setTimeout(()=>{this.reset=!0},500)}).catch(()=>{this.errorState=!0})}}};var g=function(){var e=this,r=e._self._c;return r("div",[r(d,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading&&e.initialLoad,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.deleteCredential}}),r("h3",[e._v(e._s(e.mode)+" Credential")]),e.isNew?e._e():r(n,{attrs:{tags:e.credential.tags},on:{"update-tag":e.updateTag,"delete-tag":e.deleteTag,"new-tag":e.addTag}}),e.errorState?r(s,{attrs:{"resource-id":e.id,"resource-type":"credential"}}):r(_,{staticStyle:{padding:"10px"}},[e.reset?r(a,{ref:"generalform",attrs:{options:e.options,readonly:!e.canEdit},model:{value:e.form,callback:function(i){e.form=i},expression:"form"}}):e._e()],1)],1)},$=[],y=o(f,g,$,!1,null,null,null,null);const z=y.exports;export{z as default}; diff --git a/dist/assets/Credentials.555e3984.js b/dist/assets/Credentials.555e3984.js deleted file mode 100644 index 00d9560..0000000 --- a/dist/assets/Credentials.555e3984.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as c}from"./TagViewer.b07ca85a.js";import{_ as d}from"./ExpansionPanelFilter.5838fe52.js";import{_ as u}from"./ExpansionPanelSearch.7dcac59a.js";import{_ as p}from"./ListPageTop.dad49f81.js";import{l as g}from"./index.e9f2ede5.js";import{g as m}from"./tag-api.5e19879c.js";import{n as h,by as f,bz as v,bA as y,bB as T,r as l,b as C,c as i,k as b,l as r,V as o,o as x}from"./index.154e9cc6.js";import{_ as k}from"./VExpansionPanels.1f915cd7.js";import{_ as w}from"./VDataTable.71ce8bb9.js";import{_ as $}from"./VSelect.27a57f2b.js";import"./VExpansionPanelHeader.d8fbc23c.js";import"./VBreadcrumbs.a2278375.js";import"./index.27090f0f.js";const S={name:"Credentials",components:{ExpansionPanelFilter:d,ExpansionPanelSearch:u,TagViewer:c,ListPageTop:p},data(){return{breads:[{text:"Credentials",disabled:!0,href:"/credentials"}],headers:[{text:"id",value:"id"},{text:"CredType",value:"credtype"},{text:"Username",value:"username"},{text:"Password",value:"password"},{text:"Domain",value:"domain"},{text:"Host",value:"host"},{text:"Tags",value:"tags",width:300},{text:"Actions",value:"actions",sortable:!1}],selected:[],selectedTags:[],tags:[],credentials:[],search:"",debouncedGetCredentials:g(this.getCredentials,500),loading:!1}},computed:{showDelete(){return this.selected.length>0}},watch:{search(){this.debouncedGetCredentials()},selectedTags(){this.debouncedGetCredentials()}},mounted(){this.getCredentials(),this.getTags()},methods:{async getTags(){const s=await m({page:1,limit:-1,sources:"credential"}),e=[];s.records.forEach(t=>{e.find(n=>n.name===t.name&&n.value===t.value)||e.push(t)}),this.tags=e},deleteTag(s,e){f(s.id,e.id).then(()=>{s.tags=s.tags.filter(t=>t.id!==e.id),this.getTags()}).catch(t=>this.$snack.error(`Error: ${t}`))},updateTag(s,e){v(s.id,e).then(t=>{const a=s.tags.findIndex(n=>n.id===t.id);s.tags.splice(a,1,t),this.getTags(),this.$snack.success("Tag updated")}).catch(t=>this.$snack.error(`Error: ${t}`))},addTag(s,e){y(s.id,e).then(t=>{s.tags.push(t),this.getTags()}).catch(t=>this.$snack.error(`Error: ${t}`))},async getCredentials(){this.loading=!0;try{this.credentials=await T({tags:this.selectedTags,search:this.search})}finally{this.loading=!1}},create(){this.$router.push({name:"credentialNew"})},async deleteCredential(s){await this.$root.$confirm("Delete",`Are you sure you want to delete credential ${s.id}?`,{color:"red"})&&this.$store.dispatch("credential/deleteCredential",s.id)},async deleteCredentials(){await this.$root.$confirm("Delete",`Are you sure you want to delete ${this.selected.length} credentials?`,{color:"red"})&&this.selected.forEach(s=>{this.$store.dispatch("credential/deleteCredential",s.id)})},async copyToClipboard(s){try{await navigator.clipboard.writeText(s),this.$snack.success("Output copied to clipboard")}catch{this.$snack.warn("Failed to copy to clipboard. You must be on HTTPS or localhost.")}}}};var E=function(){var e=this,t=e._self._c;return t("div",[t(p,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"show-delete":e.showDelete},on:{create:e.create,refresh:e.getCredentials,delete:e.deleteCredentials}}),t("div",{staticStyle:{display:"flex","flex-direction":"row","flex-wrap":"wrap"}},[t(l,{staticClass:"mr-2 pa-2",staticStyle:{"flex-basis":"250px"},attrs:{elevation:"2",outlined:""}},[t(k,{staticClass:"mb-6",attrs:{multiple:""}},[t(u,{attrs:{title:"Search",label:"Search"},model:{value:e.search,callback:function(a){e.search=a},expression:"search"}}),t(d,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(a){e.selectedTags=a},expression:"selectedTags"}})],1)],1),t(l,{staticStyle:{flex:"1","min-width":"0"},attrs:{elevation:"2",outlined:""}},[t(w,{attrs:{loading:e.loading,headers:e.headers,items:e.credentials,"item-key":"id",dense:"","show-select":""},scopedSlots:e._u([{key:"item.id",fn:function({item:a}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"credentialEdit",params:{id:a.id}}}},[e._v(" "+e._s(a.id)+" ")])]}},{key:"item.username",fn:function({item:a}){return[t("div",{staticClass:"point",on:{click:function(n){return e.copyToClipboard(a.username)}}},[e._v(" "+e._s(a.username)+" "),t("i",{staticClass:"fa fa-paperclip center-icon"})])]}},{key:"item.password",fn:function({item:a}){return[t("div",{staticClass:"point",on:{click:function(n){return e.copyToClipboard(a.password)}}},[e._v(" "+e._s(a.password)+" "),t("i",{staticClass:"fa fa-paperclip center-icon"})])]}},{key:"item.tags",fn:function({item:a}){return[t(c,{attrs:{tags:a.tags},on:{"update-tag":function(n){return e.updateTag(a,...arguments)},"delete-tag":function(n){return e.deleteTag(a,...arguments)},"new-tag":function(n){return e.addTag(a,...arguments)}}})]}},{key:"item.actions",fn:function({item:a}){return[t($,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:n,attrs:_}){return[t(C,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",_,!1),n),[t(i,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(b,{staticClass:"ml-2 mr-2"},[t(r,{key:"edit",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"credentialEdit",params:{id:a.id}}}},[t(o,[t(i,[e._v("fa-pencil-alt")]),e._v(" Edit ")],1)],1)],1),t(r,{key:"copy",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"credentialNew",params:{copy:!0,id:a.id}}}},[t(o,[t(i,[e._v("fa-clone")]),e._v(" Copy ")],1)],1)],1),t(x,{staticClass:"pb-4"}),t(r,{key:"delete",attrs:{link:""},on:{click:function(n){return e.deleteCredential(a)}}},[t(o,[t(i,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(a){e.selected=a},expression:"selected"}})],1)],1)],1)},D=[],P=h(S,E,D,!1,null,null,null,null);const Y=P.exports;export{Y as default}; diff --git a/dist/assets/Credentials.99ae8d25.js b/dist/assets/Credentials.99ae8d25.js new file mode 100644 index 0000000..e02a220 --- /dev/null +++ b/dist/assets/Credentials.99ae8d25.js @@ -0,0 +1 @@ +import{_ as c}from"./TagViewer.a3da6a20.js";import{_ as d}from"./ExpansionPanelFilter.8ec031fa.js";import{_ as u}from"./ExpansionPanelSearch.252e89f2.js";import{_ as p}from"./ListPageTop.2a204a11.js";import{l as g}from"./index.c62fa657.js";import{g as m}from"./tag-api.d2d18349.js";import{n as h,bC as f,bD as v,bE as y,bF as T,f as l,p as C,b,c as i,g as x,h as r,i as o,l as w}from"./index.85262dd3.js";import{_ as k}from"./VExpansionPanels.d99facd5.js";import{_ as $}from"./VDataTable.125536b6.js";import"./VSelect.8543571f.js";import"./VExpansionPanelHeader.1232ca65.js";import"./VBreadcrumbs.32f4f2d0.js";const S={name:"Credentials",components:{ExpansionPanelFilter:d,ExpansionPanelSearch:u,TagViewer:c,ListPageTop:p},data(){return{breads:[{text:"Credentials",disabled:!0,href:"/credentials"}],headers:[{text:"id",value:"id"},{text:"CredType",value:"credtype"},{text:"Username",value:"username"},{text:"Password",value:"password"},{text:"Domain",value:"domain"},{text:"Host",value:"host"},{text:"Tags",value:"tags",width:300},{text:"Actions",value:"actions",sortable:!1}],selected:[],selectedTags:[],tags:[],credentials:[],search:"",debouncedGetCredentials:g(this.getCredentials,500),loading:!1}},computed:{showDelete(){return this.selected.length>0}},watch:{search(){this.debouncedGetCredentials()},selectedTags(){this.debouncedGetCredentials()}},mounted(){this.getCredentials(),this.getTags()},methods:{async getTags(){const s=await m({page:1,limit:-1,sources:"credential"}),e=[];s.records.forEach(t=>{e.find(n=>n.name===t.name&&n.value===t.value)||e.push(t)}),this.tags=e},deleteTag(s,e){f(s.id,e.id).then(()=>{s.tags=s.tags.filter(t=>t.id!==e.id),this.getTags()}).catch(t=>this.$snack.error(`Error: ${t}`))},updateTag(s,e){v(s.id,e).then(t=>{const a=s.tags.findIndex(n=>n.id===t.id);s.tags.splice(a,1,t),this.getTags(),this.$snack.success("Tag updated")}).catch(t=>this.$snack.error(`Error: ${t}`))},addTag(s,e){y(s.id,e).then(t=>{s.tags.push(t),this.getTags()}).catch(t=>this.$snack.error(`Error: ${t}`))},async getCredentials(){this.loading=!0;try{this.credentials=await T({tags:this.selectedTags,search:this.search})}finally{this.loading=!1}},create(){this.$router.push({name:"credentialNew"})},async deleteCredential(s){await this.$root.$confirm("Delete",`Are you sure you want to delete credential ${s.id}?`,{color:"red"})&&this.$store.dispatch("credential/deleteCredential",s.id)},async deleteCredentials(){await this.$root.$confirm("Delete",`Are you sure you want to delete ${this.selected.length} credentials?`,{color:"red"})&&this.selected.forEach(s=>{this.$store.dispatch("credential/deleteCredential",s.id)})},async copyToClipboard(s){try{await navigator.clipboard.writeText(s),this.$snack.success("Output copied to clipboard")}catch{this.$snack.warn("Failed to copy to clipboard. You must be on HTTPS or localhost.")}}}};var E=function(){var e=this,t=e._self._c;return t("div",[t(p,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"show-delete":e.showDelete},on:{create:e.create,refresh:e.getCredentials,delete:e.deleteCredentials}}),t("div",{staticStyle:{display:"flex","flex-direction":"row","flex-wrap":"wrap"}},[t(l,{staticClass:"mr-2 pa-2",staticStyle:{"flex-basis":"250px"},attrs:{elevation:"2",outlined:""}},[t(k,{staticClass:"mb-6",attrs:{multiple:""}},[t(u,{attrs:{title:"Search",label:"Search"},model:{value:e.search,callback:function(a){e.search=a},expression:"search"}}),t(d,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(a){e.selectedTags=a},expression:"selectedTags"}})],1)],1),t(l,{staticStyle:{flex:"1","min-width":"0"},attrs:{elevation:"2",outlined:""}},[t($,{attrs:{loading:e.loading,headers:e.headers,items:e.credentials,"item-key":"id",dense:"","show-select":""},scopedSlots:e._u([{key:"item.id",fn:function({item:a}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"credentialEdit",params:{id:a.id}}}},[e._v(" "+e._s(a.id)+" ")])]}},{key:"item.username",fn:function({item:a}){return[t("div",{staticClass:"point",on:{click:function(n){return e.copyToClipboard(a.username)}}},[e._v(" "+e._s(a.username)+" "),t("i",{staticClass:"fa fa-paperclip center-icon"})])]}},{key:"item.password",fn:function({item:a}){return[t("div",{staticClass:"point",on:{click:function(n){return e.copyToClipboard(a.password)}}},[e._v(" "+e._s(a.password)+" "),t("i",{staticClass:"fa fa-paperclip center-icon"})])]}},{key:"item.tags",fn:function({item:a}){return[t(c,{attrs:{tags:a.tags},on:{"update-tag":function(n){return e.updateTag(a,...arguments)},"delete-tag":function(n){return e.deleteTag(a,...arguments)},"new-tag":function(n){return e.addTag(a,...arguments)}}})]}},{key:"item.actions",fn:function({item:a}){return[t(C,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:n,attrs:_}){return[t(b,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",_,!1),n),[t(i,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(x,{staticClass:"ml-2 mr-2"},[t(r,{key:"edit",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"credentialEdit",params:{id:a.id}}}},[t(o,[t(i,[e._v("fa-pencil-alt")]),e._v(" Edit ")],1)],1)],1),t(r,{key:"copy",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"credentialNew",params:{copy:!0,id:a.id}}}},[t(o,[t(i,[e._v("fa-clone")]),e._v(" Copy ")],1)],1)],1),t(w,{staticClass:"pb-4"}),t(r,{key:"delete",attrs:{link:""},on:{click:function(n){return e.deleteCredential(a)}}},[t(o,[t(i,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(a){e.selected=a},expression:"selected"}})],1)],1)],1)},D=[],P=h(S,E,D,!1,null,null,null,null);const Y=P.exports;export{Y as default}; diff --git a/dist/assets/DateTimeDisplay.97700a4a.js b/dist/assets/DateTimeDisplay.c35d52fb.js similarity index 89% rename from dist/assets/DateTimeDisplay.97700a4a.js rename to dist/assets/DateTimeDisplay.c35d52fb.js index 8d5444c..31949e0 100644 --- a/dist/assets/DateTimeDisplay.97700a4a.js +++ b/dist/assets/DateTimeDisplay.c35d52fb.js @@ -1 +1 @@ -import{h as _}from"./moment.9709ab41.js";import{n as o}from"./index.154e9cc6.js";import{_ as s}from"./VTooltip.b258437e.js";const r={name:"DateTimeDisplay",props:{timestamp:{type:String,required:!0}},data(){return{moment:_}}};var m=function(){var t=this,n=t._self._c;return n(s,{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function({on:e}){return[n("span",t._g({},e),[t._v(t._s(t.moment(t.timestamp).fromNow()))])]}}])},[n("span",[t._v(t._s(t.moment(t.timestamp).format("MMM D YYYY, h:mm:ss a")))])])},a=[],p=o(r,m,a,!1,null,null,null,null);const f=p.exports;export{f as _}; +import{h as _}from"./moment.9709ab41.js";import{n as o}from"./index.85262dd3.js";import{_ as s}from"./VTooltip.0c849a74.js";const r={name:"DateTimeDisplay",props:{timestamp:{type:String,required:!0}},data(){return{moment:_}}};var m=function(){var t=this,n=t._self._c;return n(s,{attrs:{top:""},scopedSlots:t._u([{key:"activator",fn:function({on:e}){return[n("span",t._g({},e),[t._v(t._s(t.moment(t.timestamp).fromNow()))])]}}])},[n("span",[t._v(t._s(t.moment(t.timestamp).format("MMM D YYYY, h:mm:ss a")))])])},a=[],p=o(r,m,a,!1,null,null,null,null);const f=p.exports;export{f as _}; diff --git a/dist/assets/DateTimeDisplay.e3b0c442.css b/dist/assets/DateTimeDisplay.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/Downloads.19c47680.js b/dist/assets/Downloads.19c47680.js deleted file mode 100644 index a3903f3..0000000 --- a/dist/assets/Downloads.19c47680.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as u}from"./TagViewer.b07ca85a.js";import{_ as r}from"./DateTimeDisplay.97700a4a.js";import{_ as i}from"./ExpansionPanelFilter.5838fe52.js";import{_ as d}from"./ExpansionPanelSearch.7dcac59a.js";import{_ as g}from"./TooltipButton.6022e185.js";import{_ as p}from"./ListPageTop.dad49f81.js";import{e as m,u as _,f as h,g as f,b as v,c as b}from"./download-api.dfe5301b.js";import{l as w}from"./index.e9f2ede5.js";import{h as y}from"./moment.9709ab41.js";import{g as P}from"./tag-api.5e19879c.js";import{n as T,r as l,b as x,c,k as D,a as k,l as B,V as S}from"./index.154e9cc6.js";import{_ as $}from"./VExpansionPanels.1f915cd7.js";import{_ as F}from"./VPagination.90d5be16.js";import{_ as C}from"./VDataTable.71ce8bb9.js";import{_ as G}from"./VSelect.27a57f2b.js";import"./VTooltip.b258437e.js";import"./index.27090f0f.js";import"./VExpansionPanelHeader.d8fbc23c.js";import"./VBreadcrumbs.a2278375.js";const E={name:"Downloads",components:{DateTimeDisplay:r,ExpansionPanelSearch:d,ExpansionPanelFilter:i,TagViewer:u,ListPageTop:p,TooltipButton:g},data(){return{moment:y,items:[],currentPage:1,totalPages:1,totalItems:0,itemsPerPage:10,sortBy:"updated_at",sortDesc:!0,loading:!1,search:"",breads:[{text:"Downloads",disabled:!0,href:"/downloads"}],headers:[{text:"Id",value:"id",sortable:!1},{text:"Filename",value:"filename",sortable:!0},{text:"Location",value:"location",sortable:!0},{text:"Size",value:"size",sortable:!0},{text:"Created At",value:"created_at",sortable:!0},{text:"Updated At",value:"updated_at",sortable:!0},{text:"Tags",value:"tags",sortable:!1},{text:"Actions",value:"actions",sortable:!1}],isSelecting:!1,selectedFile:null,selectedSources:[],sources:[{label:"Upload",value:"upload"},{label:"Agent Task",value:"agent_task"},{label:"Agent File",value:"agent_file"},{label:"Stager",value:"stager"}],selectedTags:[],tags:[],debouncedGetDownloads:w(this.getDownloads,500)}},watch:{search(){this.debouncedGetDownloads()},selectedSources(){this.debouncedGetDownloads()},selectedTags(){this.debouncedGetDownloads()}},async mounted(){this.selectedSources=this.sources.map(s=>s.value),this.getTags(),this.getDownloads()},methods:{async getTags(){const s=await P({page:1,limit:-1,sources:"download"}),e=[];s.records.forEach(t=>{e.find(o=>o.name===t.name&&o.value===t.value)||e.push(t)}),this.tags=e},deleteTag(s,e){m(s.id,e.id).then(()=>{s.tags=s.tags.filter(t=>t.id!==e.id),this.getTags()}).catch(t=>this.$snack.error(`Error: ${t}`))},updateTag(s,e){_(s.id,e).then(t=>{const a=s.tags.findIndex(o=>o.id===t.id);s.tags.splice(a,1,t),this.getTags(),this.$snack.success("Tag updated")}).catch(t=>this.$snack.error(`Error: ${t}`))},addTag(s,e){h(s.id,e).then(t=>{s.tags.push(t),this.getTags()}).catch(t=>this.$snack.error(`Error: ${t}`))},async getDownloads(){this.loading=!0;const s=await f({page:this.currentPage,limit:this.itemsPerPage,query:this.search,sources:this.selectedSources,sortBy:this.sortBy,sortOrder:this.sortDesc?"desc":"asc",tags:this.selectedTags});this.items=s.records,this.currentPage=s.page,this.totalPages=s.total_pages,this.totalItems=s.total,this.loading=!1},downloadFile(s){v(s.id)},async refreshDownloads(){this.debouncedGetDownloads()},handleFileImport(){this.isSelecting=!0,window.addEventListener("focus",()=>{this.isSelecting=!1},{once:!0}),this.$refs.uploader.click()},async onFileChanged(s){this.selectedFile=s.target.files[0];const e=new FormData;e.append("file",this.selectedFile),await b(e),this.$snack.success("Upload complete"),this.debouncedGetDownloads()},handlePageChange(s){this.currentPage=s,this.debouncedGetDownloads()},handleOptionsChange(s){this.currentPage=s.page,this.itemsPerPage=s.itemsPerPage,s.sortBy.length>0?(this.sortBy=s.sortBy[0],this.sortDesc=s.sortDesc[0]):(this.sortBy="updated_at",this.sortDesc=!0),this.debouncedGetDownloads()},formatBytes(s,e){if(s===0)return"0 Bytes";const t=1024,a=e||2,o=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.floor(Math.log(s)/Math.log(t));return`${parseFloat((s/t**n).toFixed(a))} ${o[n]}`}}};var I=function(){var e=this,t=e._self._c;return t("div",[t(p,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!0,"show-delete":!1},on:{refresh:e.refreshDownloads}},[t("template",{slot:"extra-stuff"},[t(g,{attrs:{icon:"fa-upload",text:"Upload"},on:{click:e.handleFileImport}}),t("input",{ref:"uploader",staticClass:"d-none",attrs:{type:"file","aria-label":"uploader"},on:{change:e.onFileChanged}})],1)],2),t("div",{staticStyle:{display:"flex","flex-direction":"row","flex-wrap":"wrap"}},[t(l,{staticClass:"mr-2 pa-2",staticStyle:{"flex-basis":"250px"},attrs:{elevation:"2",outlined:""}},[t($,{staticClass:"mb-6",attrs:{multiple:""}},[t(d,{attrs:{title:"Search",label:"Search"},model:{value:e.search,callback:function(a){e.search=a},expression:"search"}}),t(i,{attrs:{title:"Source",label:"label","item-key":"value","item-value":"value",items:e.sources},model:{value:e.selectedSources,callback:function(a){e.selectedSources=a},expression:"selectedSources"}}),t(i,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(a){e.selectedTags=a},expression:"selectedTags"}})],1)],1),t(l,{staticStyle:{flex:"1","min-width":"0"},attrs:{elevation:"2",outlined:""}},[t(F,{attrs:{length:e.totalPages,"total-visible":10},on:{input:e.handlePageChange},model:{value:e.currentPage,callback:function(a){e.currentPage=a},expression:"currentPage"}}),t(C,{attrs:{headers:e.headers,items:e.items,"item-key":"id","sort-by":e.sortBy,"sort-desc":e.sortDesc,"server-items-length":e.totalItems,"footer-props":{"items-per-page-options":[10,25,50,100]},"items-per-page":e.itemsPerPage,loading:e.loading,page:e.currentPage},on:{"update:itemsPerPage":function(a){e.itemsPerPage=a},"update:items-per-page":function(a){e.itemsPerPage=a},"update:options":e.handleOptionsChange},scopedSlots:e._u([{key:"item.updated_at",fn:function({item:a}){return[t(r,{attrs:{timestamp:a.updated_at}})]}},{key:"item.created_at",fn:function({item:a}){return[t(r,{attrs:{timestamp:a.created_at}})]}},{key:"item.size",fn:function({item:a}){return[t("span",[e._v(e._s(e.formatBytes(a.size)))])]}},{key:"item.tags",fn:function({item:a}){return[t(u,{attrs:{tags:a.tags},on:{"update-tag":function(o){return e.updateTag(a,...arguments)},"delete-tag":function(o){return e.deleteTag(a,...arguments)},"new-tag":function(o){return e.addTag(a,...arguments)}}})]}},{key:"item.actions",fn:function({item:a}){return[t(G,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:o,attrs:n}){return[t(x,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",n,!1),o),[t(c,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(D,{staticClass:"ml-2 mr-2"},[t(k),t(B,{attrs:{link:""},on:{click:function(o){return e.downloadFile(a)}}},[t(S,[t(c,[e._v("fa-download")]),e._v(" Download ")],1)],1)],1)],1)]}}])})],1)],1)],1)},z=[],A=T(E,I,z,!1,null,null,null,null);const se=A.exports;export{se as default}; diff --git a/dist/assets/Downloads.26add5ec.js b/dist/assets/Downloads.26add5ec.js new file mode 100644 index 0000000..f2a9cf2 --- /dev/null +++ b/dist/assets/Downloads.26add5ec.js @@ -0,0 +1 @@ +import{_ as d}from"./TagViewer.a3da6a20.js";import{_ as r}from"./DateTimeDisplay.c35d52fb.js";import{_ as i}from"./ExpansionPanelFilter.8ec031fa.js";import{_ as u}from"./ExpansionPanelSearch.252e89f2.js";import{_ as g}from"./TooltipButton.6f10f736.js";import{_ as p}from"./ListPageTop.2a204a11.js";import{n as m,bP as _,bQ as h,bR as f,aS as b,a_ as v,aO as w,f as l,p as y,b as P,c,g as T,a as x,h as D,i as k}from"./index.85262dd3.js";import{l as S}from"./index.c62fa657.js";import{h as B}from"./moment.9709ab41.js";import{g as $}from"./tag-api.d2d18349.js";import{_ as F}from"./VExpansionPanels.d99facd5.js";import{_ as C}from"./VPagination.873af1be.js";import{_ as G}from"./VDataTable.125536b6.js";import"./VSelect.8543571f.js";import"./VTooltip.0c849a74.js";import"./VExpansionPanelHeader.1232ca65.js";import"./VBreadcrumbs.32f4f2d0.js";const E={name:"Downloads",components:{DateTimeDisplay:r,ExpansionPanelSearch:u,ExpansionPanelFilter:i,TagViewer:d,ListPageTop:p,TooltipButton:g},data(){return{moment:B,items:[],currentPage:1,totalPages:1,totalItems:0,itemsPerPage:10,sortBy:"updated_at",sortDesc:!0,loading:!1,search:"",breads:[{text:"Downloads",disabled:!0,href:"/downloads"}],headers:[{text:"Id",value:"id",sortable:!1},{text:"Filename",value:"filename",sortable:!0},{text:"Location",value:"location",sortable:!0},{text:"Size",value:"size",sortable:!0},{text:"Created At",value:"created_at",sortable:!0},{text:"Updated At",value:"updated_at",sortable:!0},{text:"Tags",value:"tags",sortable:!1},{text:"Actions",value:"actions",sortable:!1}],isSelecting:!1,selectedFile:null,selectedSources:[],sources:[{label:"Upload",value:"upload"},{label:"Agent Task",value:"agent_task"},{label:"Agent File",value:"agent_file"},{label:"Stager",value:"stager"}],selectedTags:[],tags:[],debouncedGetDownloads:S(this.getDownloads,500)}},watch:{search(){this.debouncedGetDownloads()},selectedSources(){this.debouncedGetDownloads()},selectedTags(){this.debouncedGetDownloads()}},async mounted(){this.selectedSources=this.sources.map(s=>s.value),this.getTags(),this.getDownloads()},methods:{async getTags(){const s=await $({page:1,limit:-1,sources:"download"}),e=[];s.records.forEach(t=>{e.find(n=>n.name===t.name&&n.value===t.value)||e.push(t)}),this.tags=e},deleteTag(s,e){_(s.id,e.id).then(()=>{s.tags=s.tags.filter(t=>t.id!==e.id),this.getTags()}).catch(t=>this.$snack.error(`Error: ${t}`))},updateTag(s,e){h(s.id,e).then(t=>{const a=s.tags.findIndex(n=>n.id===t.id);s.tags.splice(a,1,t),this.getTags(),this.$snack.success("Tag updated")}).catch(t=>this.$snack.error(`Error: ${t}`))},addTag(s,e){f(s.id,e).then(t=>{s.tags.push(t),this.getTags()}).catch(t=>this.$snack.error(`Error: ${t}`))},async getDownloads(){this.loading=!0;const s=await b({page:this.currentPage,limit:this.itemsPerPage,query:this.search,sources:this.selectedSources,sortBy:this.sortBy,sortOrder:this.sortDesc?"desc":"asc",tags:this.selectedTags});this.items=s.records,this.currentPage=s.page,this.totalPages=s.total_pages,this.totalItems=s.total,this.loading=!1},downloadFile(s){v(s.id)},async refreshDownloads(){this.debouncedGetDownloads()},handleFileImport(){this.isSelecting=!0,window.addEventListener("focus",()=>{this.isSelecting=!1},{once:!0}),this.$refs.uploader.click()},async onFileChanged(s){this.selectedFile=s.target.files[0];const e=new FormData;e.append("file",this.selectedFile),await w(e),this.$snack.success("Upload complete"),this.debouncedGetDownloads()},handlePageChange(s){this.currentPage=s,this.debouncedGetDownloads()},handleOptionsChange(s){this.currentPage=s.page,this.itemsPerPage=s.itemsPerPage,s.sortBy.length>0?(this.sortBy=s.sortBy[0],this.sortDesc=s.sortDesc[0]):(this.sortBy="updated_at",this.sortDesc=!0),this.debouncedGetDownloads()},formatBytes(s,e){if(s===0)return"0 Bytes";const t=1024,a=e||2,n=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],o=Math.floor(Math.log(s)/Math.log(t));return`${parseFloat((s/t**o).toFixed(a))} ${n[o]}`}}};var I=function(){var e=this,t=e._self._c;return t("div",[t(p,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!0,"show-delete":!1},on:{refresh:e.refreshDownloads}},[t("template",{slot:"extra-stuff"},[t(g,{attrs:{icon:"fa-upload",text:"Upload"},on:{click:e.handleFileImport}}),t("input",{ref:"uploader",staticClass:"d-none",attrs:{type:"file","aria-label":"uploader"},on:{change:e.onFileChanged}})],1)],2),t("div",{staticStyle:{display:"flex","flex-direction":"row","flex-wrap":"wrap"}},[t(l,{staticClass:"mr-2 pa-2",staticStyle:{"flex-basis":"250px"},attrs:{elevation:"2",outlined:""}},[t(F,{staticClass:"mb-6",attrs:{multiple:""}},[t(u,{attrs:{title:"Search",label:"Search"},model:{value:e.search,callback:function(a){e.search=a},expression:"search"}}),t(i,{attrs:{title:"Source",label:"label","item-key":"value","item-value":"value",items:e.sources},model:{value:e.selectedSources,callback:function(a){e.selectedSources=a},expression:"selectedSources"}}),t(i,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(a){e.selectedTags=a},expression:"selectedTags"}})],1)],1),t(l,{staticStyle:{flex:"1","min-width":"0"},attrs:{elevation:"2",outlined:""}},[t(C,{attrs:{length:e.totalPages,"total-visible":10},on:{input:e.handlePageChange},model:{value:e.currentPage,callback:function(a){e.currentPage=a},expression:"currentPage"}}),t(G,{attrs:{headers:e.headers,items:e.items,"item-key":"id","sort-by":e.sortBy,"sort-desc":e.sortDesc,"server-items-length":e.totalItems,"footer-props":{"items-per-page-options":[10,25,50,100]},"items-per-page":e.itemsPerPage,loading:e.loading,page:e.currentPage},on:{"update:itemsPerPage":function(a){e.itemsPerPage=a},"update:items-per-page":function(a){e.itemsPerPage=a},"update:options":e.handleOptionsChange},scopedSlots:e._u([{key:"item.updated_at",fn:function({item:a}){return[t(r,{attrs:{timestamp:a.updated_at}})]}},{key:"item.created_at",fn:function({item:a}){return[t(r,{attrs:{timestamp:a.created_at}})]}},{key:"item.size",fn:function({item:a}){return[t("span",[e._v(e._s(e.formatBytes(a.size)))])]}},{key:"item.tags",fn:function({item:a}){return[t(d,{attrs:{tags:a.tags},on:{"update-tag":function(n){return e.updateTag(a,...arguments)},"delete-tag":function(n){return e.deleteTag(a,...arguments)},"new-tag":function(n){return e.addTag(a,...arguments)}}})]}},{key:"item.actions",fn:function({item:a}){return[t(y,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:n,attrs:o}){return[t(P,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",o,!1),n),[t(c,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(T,{staticClass:"ml-2 mr-2"},[t(x),t(D,{attrs:{link:""},on:{click:function(n){return e.downloadFile(a)}}},[t(k,[t(c,[e._v("fa-download")]),e._v(" Download ")],1)],1)],1)],1)]}}])})],1)],1)],1)},z=[],A=m(E,I,z,!1,null,null,null,null);const ee=A.exports;export{ee as default}; diff --git a/dist/assets/Downloads.e3b0c442.css b/dist/assets/Downloads.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/EditPageTop.0db28cea.js b/dist/assets/EditPageTop.0db28cea.js deleted file mode 100644 index 0d22fea..0000000 --- a/dist/assets/EditPageTop.0db28cea.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as a}from"./TooltipButton.6022e185.js";import{n as l,a as i,b as o,c as n}from"./index.154e9cc6.js";import{_ as r}from"./VBreadcrumbs.a2278375.js";const _={name:"ListPageTop",components:{TooltipButton:a},props:{deleteText:{type:String,default:"Delete"},copyText:{type:String,default:"Copy"},submitText:{type:String,default:"Submit"},showDelete:{type:Boolean,default:!1},showCopy:{type:Boolean,default:!1},showSubmit:{type:Boolean,default:!1},disableSubmit:{type:Boolean},submitLoading:{type:Boolean,default:!1},copyLink:{type:Object,default:()=>{}},smallCopy:{type:Boolean,default:!1},smallDelete:{type:Boolean,default:!1},breads:{type:Array,default:()=>[]}}};var p=function(){var t=this,e=t._self._c;return e("portal",{attrs:{to:"app-bar"}},[e("div",{staticClass:"v-toolbar__content",staticStyle:{width:"100%"}},[e(r,{attrs:{items:t.breads}}),e(i),t._t("extra-stuff"),t.showDelete&&!t.smallDelete?e(o,{staticClass:"mr-2",attrs:{color:"error",text:""},on:{click:function(s){return t.$emit("delete")}}},[t._v(" "+t._s(t.deleteText)+" "),e(n,{attrs:{right:""}},[t._v(" fa-trash-alt ")])],1):t.showDelete&&t.smallDelete?e(a,{attrs:{icon:"fa-trash-alt",color:"error",text:t.deleteText},on:{click:function(s){return t.$emit("delete")}}}):t._e(),t.showCopy&&Object.keys(t.copyLink).length>0&&!t.smallCopy?e(o,{staticClass:"mr-2",attrs:{color:"primary",text:"",to:t.copyLink}},[t._v(" "+t._s(t.copyText)+" "),e(n,{attrs:{right:""}},[t._v(" fa-copy ")])],1):t.showCopy&&Object.keys(t.copyLink).length>0&&t.smallCopy?e(a,{attrs:{icon:"fa-copy",text:t.copyText,to:t.copyLink}}):t._e(),t.showSubmit?e(o,{staticClass:"primary",attrs:{disabled:t.disableSubmit,type:"submit",loading:t.submitLoading},on:{click:function(s){return t.$emit("submit")}}},[t._v(" "+t._s(t.submitText)+" ")]):t._e()],2)])},c=[],u=l(_,p,c,!1,null,null,null,null);const b=u.exports;export{b as _}; diff --git a/dist/assets/EditPageTop.30f77a9c.js b/dist/assets/EditPageTop.30f77a9c.js new file mode 100644 index 0000000..6ca4bda --- /dev/null +++ b/dist/assets/EditPageTop.30f77a9c.js @@ -0,0 +1 @@ +import{_ as a}from"./TooltipButton.6f10f736.js";import{n,a as i,b as o,c as l}from"./index.85262dd3.js";import{_ as r}from"./VBreadcrumbs.32f4f2d0.js";const p={name:"ListPageTop",components:{TooltipButton:a},props:{deleteText:{type:String,default:"Delete"},copyText:{type:String,default:"Copy"},submitText:{type:String,default:"Submit"},showDelete:{type:Boolean,default:!1},showCopy:{type:Boolean,default:!1},showSubmit:{type:Boolean,default:!1},disableSubmit:{type:Boolean},submitLoading:{type:Boolean,default:!1},copyLink:{type:Object,default:()=>{}},smallCopy:{type:Boolean,default:!1},smallDelete:{type:Boolean,default:!1},breads:{type:Array,default:()=>[]}}};var _=function(){var t=this,e=t._self._c;return e("portal",{attrs:{to:"app-bar"}},[e("div",{staticClass:"v-toolbar__content pt-2",staticStyle:{width:"100%"}},[e(r,{attrs:{items:t.breads}}),e(i),e("div",{staticClass:"pt-2"},[t._t("extra-stuff")],2),t.showDelete&&!t.smallDelete?e(o,{staticClass:"mr-2",attrs:{color:"error",text:""},on:{click:function(s){return t.$emit("delete")}}},[t._v(" "+t._s(t.deleteText)+" "),e(l,{attrs:{right:""}},[t._v(" fa-trash-alt ")])],1):t.showDelete&&t.smallDelete?e(a,{attrs:{icon:"fa-trash-alt",color:"error",text:t.deleteText},on:{click:function(s){return t.$emit("delete")}}}):t._e(),t.showCopy&&Object.keys(t.copyLink).length>0&&!t.smallCopy?e(o,{staticClass:"mr-2",attrs:{color:"primary",text:"",to:t.copyLink}},[t._v(" "+t._s(t.copyText)+" "),e(l,{attrs:{right:""}},[t._v(" fa-copy ")])],1):t.showCopy&&Object.keys(t.copyLink).length>0&&t.smallCopy?e(a,{attrs:{icon:"fa-copy",text:t.copyText,to:t.copyLink}}):t._e(),t.showSubmit?e(o,{staticClass:"primary",attrs:{disabled:t.disableSubmit,type:"submit",loading:t.submitLoading},on:{click:function(s){return t.$emit("submit")}}},[t._v(" "+t._s(t.submitText)+" ")]):t._e()],1)])},c=[],u=n(p,_,c,!1,null,null,null,null);const b=u.exports;export{b as _}; diff --git a/dist/assets/EditPageTop.e3b0c442.css b/dist/assets/EditPageTop.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/ErrorStateAlert.3518d55f.js b/dist/assets/ErrorStateAlert.3518d55f.js deleted file mode 100644 index 249f698..0000000 --- a/dist/assets/ErrorStateAlert.3518d55f.js +++ /dev/null @@ -1 +0,0 @@ -import{m as P,e as O,aD as p,b as $,c as m,T as V,K as D,z as S,Q as k,aV as u,n as M}from"./index.154e9cc6.js";import{T as G}from"./index.41ea8dd2.js";const F=P(p,O,G).extend({name:"v-alert",props:{border:{type:String,validator(e){return["top","right","bottom","left"].includes(e)}},closeLabel:{type:String,default:"$vuetify.close"},coloredBorder:Boolean,dense:Boolean,dismissible:Boolean,closeIcon:{type:String,default:"$cancel"},icon:{default:"",type:[Boolean,String],validator(e){return typeof e=="string"||e===!1}},outlined:Boolean,prominent:Boolean,text:Boolean,type:{type:String,validator(e){return["info","error","success","warning"].includes(e)}},value:{type:Boolean,default:!0}},computed:{__cachedBorder(){if(!this.border)return null;let e={staticClass:"v-alert__border",class:{[`v-alert__border--${this.border}`]:!0}};return this.coloredBorder&&(e=this.setBackgroundColor(this.computedColor,e),e.class["v-alert__border--has-color"]=!0),this.$createElement("div",e)},__cachedDismissible(){if(!this.dismissible)return null;const e=this.iconColor;return this.$createElement($,{staticClass:"v-alert__dismissible",props:{color:e,icon:!0,small:!0},attrs:{"aria-label":this.$vuetify.lang.t(this.closeLabel)},on:{click:()=>this.isActive=!1}},[this.$createElement(m,{props:{color:e}},this.closeIcon)])},__cachedIcon(){return this.computedIcon?this.$createElement(m,{staticClass:"v-alert__icon",props:{color:this.iconColor}},this.computedIcon):null},classes(){const e={...p.options.computed.classes.call(this),"v-alert--border":Boolean(this.border),"v-alert--dense":this.dense,"v-alert--outlined":this.outlined,"v-alert--prominent":this.prominent,"v-alert--text":this.text};return this.border&&(e[`v-alert--border-${this.border}`]=!0),e},computedColor(){return this.color||this.type},computedIcon(){return this.icon===!1?!1:typeof this.icon=="string"&&this.icon?this.icon:["error","info","success","warning"].includes(this.type)?`$${this.type}`:!1},hasColoredIcon(){return this.hasText||Boolean(this.border)&&this.coloredBorder},hasText(){return this.text||this.outlined},iconColor(){return this.hasColoredIcon?this.computedColor:void 0},isDark(){return this.type&&!this.coloredBorder&&!this.outlined?!0:V.options.computed.isDark.call(this)}},created(){this.$attrs.hasOwnProperty("outline")&&D("outline","outlined",this)},methods:{genWrapper(){const e=[this.$slots.prepend||this.__cachedIcon,this.genContent(),this.__cachedBorder,this.$slots.append,this.$scopedSlots.close?this.$scopedSlots.close({toggle:this.toggle}):this.__cachedDismissible],t={staticClass:"v-alert__wrapper"};return this.$createElement("div",t,e)},genContent(){return this.$createElement("div",{staticClass:"v-alert__content"},this.$slots.default)},genAlert(){let e={staticClass:"v-alert",attrs:{role:"alert"},on:this.listeners$,class:this.classes,style:this.styles,directives:[{name:"show",value:this.isActive}]};return this.coloredBorder||(e=(this.hasText?this.setTextColor:this.setBackgroundColor)(this.computedColor,e)),this.$createElement("div",e,[this.genWrapper()])},toggle(){this.isActive=!this.isActive}},render(e){const t=this.genAlert();return this.transition?e("transition",{props:{name:this.transition,origin:this.origin,mode:this.mode}},[t]):t}}),d=["sm","md","lg","xl"],B=(()=>d.reduce((e,t)=>(e[t]={type:[Boolean,String,Number],default:!1},e),{}))(),x=(()=>d.reduce((e,t)=>(e["offset"+u(t)]={type:[String,Number],default:null},e),{}))(),j=(()=>d.reduce((e,t)=>(e["order"+u(t)]={type:[String,Number],default:null},e),{}))(),_={col:Object.keys(B),offset:Object.keys(x),order:Object.keys(j)};function K(e,t,n){let s=e;if(!(n==null||n===!1)){if(t){const i=t.replace(e,"");s+=`-${i}`}return e==="col"&&(n===""||n===!0)||(s+=`-${n}`),s.toLowerCase()}}const y=new Map,b=S.extend({name:"v-col",functional:!0,props:{cols:{type:[Boolean,String,Number],default:!1},...B,offset:{type:[String,Number],default:null},...x,order:{type:[String,Number],default:null},...j,alignSelf:{type:String,default:null,validator:e=>["auto","start","end","center","baseline","stretch"].includes(e)},tag:{type:String,default:"div"}},render(e,{props:t,data:n,children:s,parent:i}){let o="";for(const l in t)o+=String(t[l]);let r=y.get(o);if(!r){r=[];let l;for(l in _)_[l].forEach(a=>{const L=t[a],g=K(l,a,L);g&&r.push(g)});const c=r.some(a=>a.startsWith("col-"));r.push({col:!c||!t.cols,[`col-${t.cols}`]:t.cols,[`offset-${t.offset}`]:t.offset,[`order-${t.order}`]:t.order,[`align-self-${t.alignSelf}`]:t.alignSelf}),y.set(o,r)}return e(t.tag,k(n,{class:r}),s)}}),W=["sm","md","lg","xl"],h=["start","end","center"];function f(e,t){return W.reduce((n,s)=>(n[e+u(s)]=t(),n),{})}const w=e=>[...h,"baseline","stretch"].includes(e),N=f("align",()=>({type:String,default:null,validator:w})),T=e=>[...h,"space-between","space-around"].includes(e),E=f("justify",()=>({type:String,default:null,validator:T})),I=e=>[...h,"space-between","space-around","stretch"].includes(e),A=f("alignContent",()=>({type:String,default:null,validator:I})),v={align:Object.keys(N),justify:Object.keys(E),alignContent:Object.keys(A)},q={align:"align",justify:"justify",alignContent:"align-content"};function z(e,t,n){let s=q[e];if(n!=null){if(t){const i=t.replace(e,"");s+=`-${i}`}return s+=`-${n}`,s.toLowerCase()}}const C=new Map,Q=S.extend({name:"v-row",functional:!0,props:{tag:{type:String,default:"div"},dense:Boolean,noGutters:Boolean,align:{type:String,default:null,validator:w},...N,justify:{type:String,default:null,validator:T},...E,alignContent:{type:String,default:null,validator:I},...A},render(e,{props:t,data:n,children:s}){let i="";for(const r in t)i+=String(t[r]);let o=C.get(i);if(!o){o=[];let r;for(r in v)v[r].forEach(l=>{const c=t[l],a=z(r,l,c);a&&o.push(a)});o.push({"no-gutters":t.noGutters,"row--dense":t.dense,[`align-${t.align}`]:t.align,[`justify-${t.justify}`]:t.justify,[`align-content-${t.alignContent}`]:t.alignContent}),C.set(i,o)}return e(t.tag,k(n,{staticClass:"row",class:o}),s)}});const R={name:"ErrorStateAlert",props:{resourceType:{type:String,required:!0},resourceId:{type:[String,Number],required:!0},message:{type:String,default(){return`The resource '${this.resourceType}/${this.resourceId}' Not Found.`}}}};var H=function(){var t=this,n=t._self._c;return n(F,{attrs:{prominent:"",type:"error"}},[n(Q,{attrs:{align:"center"}},[n(b,{staticClass:"grow"},[t._v(" "+t._s(t.message)+" ")]),n(b,{staticClass:"shrink"},[n($,{on:{click:function(s){return t.$router.go(-1)}}},[t._v(" Go back ")])],1)],1)],1)},J=[],U=M(R,H,J,!1,null,null,null,null);const Z=U.exports;export{Z as _,F as a,Q as b,b as c}; diff --git a/dist/assets/ErrorStateAlert.5e9140da.js b/dist/assets/ErrorStateAlert.5e9140da.js new file mode 100644 index 0000000..ad5025c --- /dev/null +++ b/dist/assets/ErrorStateAlert.5e9140da.js @@ -0,0 +1 @@ +import{m as O,aT as P,aU as V,aA as p,b as $,c as _,T as D,O as M,D as S,X as k,aV as u,n as G}from"./index.85262dd3.js";const F=O(p,V,P).extend({name:"v-alert",props:{border:{type:String,validator(e){return["top","right","bottom","left"].includes(e)}},closeLabel:{type:String,default:"$vuetify.close"},coloredBorder:Boolean,dense:Boolean,dismissible:Boolean,closeIcon:{type:String,default:"$cancel"},icon:{default:"",type:[Boolean,String],validator(e){return typeof e=="string"||e===!1}},outlined:Boolean,prominent:Boolean,text:Boolean,type:{type:String,validator(e){return["info","error","success","warning"].includes(e)}},value:{type:Boolean,default:!0}},computed:{__cachedBorder(){if(!this.border)return null;let e={staticClass:"v-alert__border",class:{[`v-alert__border--${this.border}`]:!0}};return this.coloredBorder&&(e=this.setBackgroundColor(this.computedColor,e),e.class["v-alert__border--has-color"]=!0),this.$createElement("div",e)},__cachedDismissible(){if(!this.dismissible)return null;const e=this.iconColor;return this.$createElement($,{staticClass:"v-alert__dismissible",props:{color:e,icon:!0,small:!0},attrs:{"aria-label":this.$vuetify.lang.t(this.closeLabel)},on:{click:()=>this.isActive=!1}},[this.$createElement(_,{props:{color:e}},this.closeIcon)])},__cachedIcon(){return this.computedIcon?this.$createElement(_,{staticClass:"v-alert__icon",props:{color:this.iconColor}},this.computedIcon):null},classes(){const e={...p.options.computed.classes.call(this),"v-alert--border":Boolean(this.border),"v-alert--dense":this.dense,"v-alert--outlined":this.outlined,"v-alert--prominent":this.prominent,"v-alert--text":this.text};return this.border&&(e[`v-alert--border-${this.border}`]=!0),e},computedColor(){return this.color||this.type},computedIcon(){return this.icon===!1?!1:typeof this.icon=="string"&&this.icon?this.icon:["error","info","success","warning"].includes(this.type)?`$${this.type}`:!1},hasColoredIcon(){return this.hasText||Boolean(this.border)&&this.coloredBorder},hasText(){return this.text||this.outlined},iconColor(){return this.hasColoredIcon?this.computedColor:void 0},isDark(){return this.type&&!this.coloredBorder&&!this.outlined?!0:D.options.computed.isDark.call(this)}},created(){this.$attrs.hasOwnProperty("outline")&&M("outline","outlined",this)},methods:{genWrapper(){const e=[this.$slots.prepend||this.__cachedIcon,this.genContent(),this.__cachedBorder,this.$slots.append,this.$scopedSlots.close?this.$scopedSlots.close({toggle:this.toggle}):this.__cachedDismissible],t={staticClass:"v-alert__wrapper"};return this.$createElement("div",t,e)},genContent(){return this.$createElement("div",{staticClass:"v-alert__content"},this.$slots.default)},genAlert(){let e={staticClass:"v-alert",attrs:{role:"alert"},on:this.listeners$,class:this.classes,style:this.styles,directives:[{name:"show",value:this.isActive}]};return this.coloredBorder||(e=(this.hasText?this.setTextColor:this.setBackgroundColor)(this.computedColor,e)),this.$createElement("div",e,[this.genWrapper()])},toggle(){this.isActive=!this.isActive}},render(e){const t=this.genAlert();return this.transition?e("transition",{props:{name:this.transition,origin:this.origin,mode:this.mode}},[t]):t}}),d=["sm","md","lg","xl"],B=(()=>d.reduce((e,t)=>(e[t]={type:[Boolean,String,Number],default:!1},e),{}))(),x=(()=>d.reduce((e,t)=>(e["offset"+u(t)]={type:[String,Number],default:null},e),{}))(),j=(()=>d.reduce((e,t)=>(e["order"+u(t)]={type:[String,Number],default:null},e),{}))(),m={col:Object.keys(B),offset:Object.keys(x),order:Object.keys(j)};function W(e,t,n){let s=e;if(!(n==null||n===!1)){if(t){const i=t.replace(e,"");s+=`-${i}`}return e==="col"&&(n===""||n===!0)||(s+=`-${n}`),s.toLowerCase()}}const y=new Map,b=S.extend({name:"v-col",functional:!0,props:{cols:{type:[Boolean,String,Number],default:!1},...B,offset:{type:[String,Number],default:null},...x,order:{type:[String,Number],default:null},...j,alignSelf:{type:String,default:null,validator:e=>["auto","start","end","center","baseline","stretch"].includes(e)},tag:{type:String,default:"div"}},render(e,{props:t,data:n,children:s,parent:i}){let o="";for(const l in t)o+=String(t[l]);let r=y.get(o);if(!r){r=[];let l;for(l in m)m[l].forEach(a=>{const L=t[a],g=W(l,a,L);g&&r.push(g)});const c=r.some(a=>a.startsWith("col-"));r.push({col:!c||!t.cols,[`col-${t.cols}`]:t.cols,[`offset-${t.offset}`]:t.offset,[`order-${t.order}`]:t.order,[`align-self-${t.alignSelf}`]:t.alignSelf}),y.set(o,r)}return e(t.tag,k(n,{class:r}),s)}}),q=["sm","md","lg","xl"],h=["start","end","center"];function f(e,t){return q.reduce((n,s)=>(n[e+u(s)]=t(),n),{})}const w=e=>[...h,"baseline","stretch"].includes(e),N=f("align",()=>({type:String,default:null,validator:w})),T=e=>[...h,"space-between","space-around"].includes(e),E=f("justify",()=>({type:String,default:null,validator:T})),I=e=>[...h,"space-between","space-around","stretch"].includes(e),A=f("alignContent",()=>({type:String,default:null,validator:I})),v={align:Object.keys(N),justify:Object.keys(E),alignContent:Object.keys(A)},K={align:"align",justify:"justify",alignContent:"align-content"};function z(e,t,n){let s=K[e];if(n!=null){if(t){const i=t.replace(e,"");s+=`-${i}`}return s+=`-${n}`,s.toLowerCase()}}const C=new Map,R=S.extend({name:"v-row",functional:!0,props:{tag:{type:String,default:"div"},dense:Boolean,noGutters:Boolean,align:{type:String,default:null,validator:w},...N,justify:{type:String,default:null,validator:T},...E,alignContent:{type:String,default:null,validator:I},...A},render(e,{props:t,data:n,children:s}){let i="";for(const r in t)i+=String(t[r]);let o=C.get(i);if(!o){o=[];let r;for(r in v)v[r].forEach(l=>{const c=t[l],a=z(r,l,c);a&&o.push(a)});o.push({"no-gutters":t.noGutters,"row--dense":t.dense,[`align-${t.align}`]:t.align,[`justify-${t.justify}`]:t.justify,[`align-content-${t.alignContent}`]:t.alignContent}),C.set(i,o)}return e(t.tag,k(n,{staticClass:"row",class:o}),s)}});const U={name:"ErrorStateAlert",props:{resourceType:{type:String,required:!0},resourceId:{type:[String,Number],required:!0},message:{type:String,default(){return`The resource '${this.resourceType}/${this.resourceId}' Not Found.`}}}};var X=function(){var t=this,n=t._self._c;return n(F,{attrs:{prominent:"",type:"error"}},[n(R,{attrs:{align:"center"}},[n(b,{staticClass:"grow"},[t._v(" "+t._s(t.message)+" ")]),n(b,{staticClass:"shrink"},[n($,{on:{click:function(s){return t.$router.go(-1)}}},[t._v(" Go back ")])],1)],1)],1)},H=[],J=G(U,X,H,!1,null,null,null,null);const Y=J.exports;export{Y as _,F as a,R as b,b as c}; diff --git a/dist/assets/ExpansionPanelFilter.5838fe52.js b/dist/assets/ExpansionPanelFilter.8ec031fa.js similarity index 91% rename from dist/assets/ExpansionPanelFilter.5838fe52.js rename to dist/assets/ExpansionPanelFilter.8ec031fa.js index 912f85b..59e84b4 100644 --- a/dist/assets/ExpansionPanelFilter.5838fe52.js +++ b/dist/assets/ExpansionPanelFilter.8ec031fa.js @@ -1 +1 @@ -import{n as a,ad as n,o as r}from"./index.154e9cc6.js";import{_ as m,a as u,b as _}from"./VExpansionPanelHeader.d8fbc23c.js";const c={name:"ExpansionPanelFilter",props:{value:{type:Array,default:()=>[]},title:{type:String,required:!0},items:{type:Array,required:!0},itemValue:{type:String,required:!0},itemKey:{type:String,required:!0},label:{type:String,required:!0},emptyDefault:{type:Boolean,default:!1}},data(){return{selectedItems:[]}},computed:{selectedAll:{set(t){t?this.selectedItems=this.items.map(e=>e[this.itemValue]):this.selectedItems=[]},get(){return this.selectedItems.length===this.items.length}}},watch:{selectedItems:{handler(t){this.$emit("input",t)}},items:{handler(t){this.emptyDefault?this.selectedItems=[]:this.selectedItems=t.map(e=>e[this.itemValue])}}},mounted(){this.emptyDefault?this.selectedItems=[]:this.selectedItems=this.items.map(t=>t[this.itemValue])}};var o=function(){var e=this,s=e._self._c;return s(m,[s(u,{attrs:{"expand-icon":"mdi-menu-down"}},[e._v(" "+e._s(e.title)+" ")]),s(_,[s(n,{attrs:{"x-small":"",dense:"",label:"Select All"},model:{value:e.selectedAll,callback:function(l){e.selectedAll=l},expression:"selectedAll"}}),s(r,{staticClass:"pb-4"}),e._l(e.items,function(l){return s(n,{key:l[e.itemKey],attrs:{value:l[e.itemValue],"x-small":"",dense:"",label:l[e.label]},model:{value:e.selectedItems,callback:function(i){e.selectedItems=i},expression:"selectedItems"}})})],2)],1)},p=[],d=a(c,o,p,!1,null,null,null,null);const y=d.exports;export{y as _}; +import{n as a,a1 as n,l as r}from"./index.85262dd3.js";import{_ as m,a as u,b as _}from"./VExpansionPanelHeader.1232ca65.js";const c={name:"ExpansionPanelFilter",props:{value:{type:Array,default:()=>[]},title:{type:String,required:!0},items:{type:Array,required:!0},itemValue:{type:String,required:!0},itemKey:{type:String,required:!0},label:{type:String,required:!0},emptyDefault:{type:Boolean,default:!1}},data(){return{selectedItems:[]}},computed:{selectedAll:{set(t){t?this.selectedItems=this.items.map(e=>e[this.itemValue]):this.selectedItems=[]},get(){return this.selectedItems.length===this.items.length}}},watch:{selectedItems:{handler(t){this.$emit("input",t)}},items:{handler(t){this.emptyDefault?this.selectedItems=[]:this.selectedItems=t.map(e=>e[this.itemValue])}}},mounted(){this.emptyDefault?this.selectedItems=[]:this.selectedItems=this.items.map(t=>t[this.itemValue])}};var o=function(){var e=this,s=e._self._c;return s(m,[s(u,{attrs:{"expand-icon":"mdi-menu-down"}},[e._v(" "+e._s(e.title)+" ")]),s(_,[s(n,{attrs:{"x-small":"",dense:"",label:"Select All"},model:{value:e.selectedAll,callback:function(l){e.selectedAll=l},expression:"selectedAll"}}),s(r,{staticClass:"pb-4"}),e._l(e.items,function(l){return s(n,{key:l[e.itemKey],attrs:{value:l[e.itemValue],"x-small":"",dense:"",label:l[e.label]},model:{value:e.selectedItems,callback:function(i){e.selectedItems=i},expression:"selectedItems"}})})],2)],1)},p=[],d=a(c,o,p,!1,null,null,null,null);const y=d.exports;export{y as _}; diff --git a/dist/assets/ExpansionPanelFilter.e3b0c442.css b/dist/assets/ExpansionPanelFilter.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/ExpansionPanelSearch.7dcac59a.js b/dist/assets/ExpansionPanelSearch.252e89f2.js similarity index 66% rename from dist/assets/ExpansionPanelSearch.7dcac59a.js rename to dist/assets/ExpansionPanelSearch.252e89f2.js index e89bfd9..f85cbc6 100644 --- a/dist/assets/ExpansionPanelSearch.7dcac59a.js +++ b/dist/assets/ExpansionPanelSearch.252e89f2.js @@ -1 +1 @@ -import{n as l,j as r}from"./index.154e9cc6.js";import{_,a as i,b as u}from"./VExpansionPanelHeader.d8fbc23c.js";const s={name:"ExpansionPanelSearch",props:{value:{type:String,required:!0},label:{type:String,required:!0},title:{type:String,required:!0}},data(){return{internalValue:""}},watch:{internalValue:{handler(t){this.$emit("input",t)}}},mounted(){this.internalValue=this.value}};var o=function(){var n=this,e=n._self._c;return e(_,[e(i,{attrs:{"expand-icon":"mdi-menu-down"}},[n._v(" "+n._s(n.title)+" ")]),e(u,[e(r,{attrs:{label:n.label,outlined:"",dense:"",required:""},model:{value:n.internalValue,callback:function(a){n.internalValue=a},expression:"internalValue"}})],1)],1)},p=[],c=l(s,o,p,!1,null,null,null,null);const v=c.exports;export{v as _}; +import{n as l,o as r}from"./index.85262dd3.js";import{_,a as i,b as u}from"./VExpansionPanelHeader.1232ca65.js";const o={name:"ExpansionPanelSearch",props:{value:{type:String,required:!0},label:{type:String,required:!0},title:{type:String,required:!0}},data(){return{internalValue:""}},watch:{internalValue:{handler(t){this.$emit("input",t)}}},mounted(){this.internalValue=this.value}};var s=function(){var n=this,e=n._self._c;return e(_,[e(i,{attrs:{"expand-icon":"mdi-menu-down"}},[n._v(" "+n._s(n.title)+" ")]),e(u,[e(r,{attrs:{label:n.label,outlined:"",dense:"",required:""},model:{value:n.internalValue,callback:function(a){n.internalValue=a},expression:"internalValue"}})],1)],1)},p=[],c=l(o,s,p,!1,null,null,null,null);const v=c.exports;export{v as _}; diff --git a/dist/assets/ExpansionPanelSearch.e3b0c442.css b/dist/assets/ExpansionPanelSearch.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/GeneralForm.6b452c3e.js b/dist/assets/GeneralForm.6b452c3e.js deleted file mode 100644 index 94208b7..0000000 --- a/dist/assets/GeneralForm.6b452c3e.js +++ /dev/null @@ -1 +0,0 @@ -import{c as V,g as $}from"./download-api.dfe5301b.js";import{Y as D,y as a,j as o,Q as F,J as f,F as g,aP as _,aa as C,H as w,aQ as T,n as h,aR as k,r as B,aS as L,aF as z,aE as v,aT as A,aG as P,a as M,b as y,a9 as E,V as O,aU as N,aK as q,z as U,o as K}from"./index.154e9cc6.js";import{b as p,c as u}from"./ErrorStateAlert.3518d55f.js";import{V as n,d as R,b as j,c as d}from"./VSelect.27a57f2b.js";import{_ as G}from"./VSwitch.4adac3f4.js";const I={...R,offsetY:!0,offsetOverflow:!0,transition:!1},r=n.extend({name:"v-autocomplete",props:{autoSelectFirst:{type:Boolean,default:!1},filter:{type:Function,default:(e,t,s)=>s.toLocaleLowerCase().indexOf(t.toLocaleLowerCase())>-1},hideNoData:Boolean,menuProps:{type:n.options.props.menuProps.type,default:()=>I},noFilter:Boolean,searchInput:{type:String}},data(){return{lazySearch:this.searchInput}},computed:{classes(){return{...n.options.computed.classes.call(this),"v-autocomplete":!0,"v-autocomplete--is-selecting-index":this.selectedIndex>-1}},computedItems(){return this.filteredItems},selectedValues(){return this.selectedItems.map(e=>this.getValue(e))},hasDisplayedItems(){return this.hideSelected?this.filteredItems.some(e=>!this.hasItem(e)):this.filteredItems.length>0},currentRange(){return this.selectedItem==null?0:String(this.getText(this.selectedItem)).length},filteredItems(){return!this.isSearching||this.noFilter||this.internalSearch==null?this.allItems:this.allItems.filter(e=>{const t=D(e,this.itemText),s=t!=null?String(t):"";return this.filter(e,String(this.internalSearch),s)})},internalSearch:{get(){return this.lazySearch},set(e){this.lazySearch!==e&&(this.lazySearch=e,this.$emit("update:search-input",e))}},isAnyValueAllowed(){return!1},isDirty(){return this.searchIsDirty||this.selectedItems.length>0},isSearching(){return this.multiple&&this.searchIsDirty||this.searchIsDirty&&this.internalSearch!==this.getText(this.selectedItem)},menuCanShow(){return this.isFocused?this.hasDisplayedItems||!this.hideNoData:!1},$_menuProps(){const e=n.options.computed.$_menuProps.call(this);return e.contentClass=`v-autocomplete__content ${e.contentClass||""}`.trim(),{...I,...e}},searchIsDirty(){return this.internalSearch!=null&&this.internalSearch!==""},selectedItem(){return this.multiple?null:this.selectedItems.find(e=>this.valueComparator(this.getValue(e),this.getValue(this.internalValue)))},listData(){const e=n.options.computed.listData.call(this);return e.props={...e.props,items:this.virtualizedItems,noFilter:this.noFilter||!this.isSearching||!this.filteredItems.length,searchInput:this.internalSearch},e}},watch:{filteredItems:"onFilteredItemsChanged",internalValue:"setSearch",isFocused(e){e?(document.addEventListener("copy",this.onCopy),this.$refs.input&&this.$refs.input.select()):(document.removeEventListener("copy",this.onCopy),this.blur(),this.updateSelf())},isMenuActive(e){e||!this.hasSlot||(this.lazySearch=null)},items(e,t){!(t&&t.length)&&this.hideNoData&&this.isFocused&&!this.isMenuActive&&e.length&&this.activateMenu()},searchInput(e){this.lazySearch=e},internalSearch:"onInternalSearchChanged",itemText:"updateSelf"},created(){this.setSearch()},destroyed(){document.removeEventListener("copy",this.onCopy)},methods:{onFilteredItemsChanged(e,t){if(e!==t){if(!this.autoSelectFirst){const s=t[this.$refs.menu.listIndex];s?this.setMenuIndex(e.findIndex(i=>i===s)):this.setMenuIndex(-1),this.$emit("update:list-index",this.$refs.menu.listIndex)}this.$nextTick(()=>{!this.internalSearch||e.length!==1&&!this.autoSelectFirst||(this.$refs.menu.getTiles(),this.autoSelectFirst&&e.length&&(this.setMenuIndex(0),this.$emit("update:list-index",this.$refs.menu.listIndex)))})}},onInternalSearchChanged(){this.updateMenuDimensions()},updateMenuDimensions(){this.isMenuActive&&this.$refs.menu&&this.$refs.menu.updateDimensions()},changeSelectedIndex(e){this.searchIsDirty||(this.multiple&&e===a.left?this.selectedIndex===-1?this.selectedIndex=this.selectedItems.length-1:this.selectedIndex--:this.multiple&&e===a.right?this.selectedIndex>=this.selectedItems.length-1?this.selectedIndex=-1:this.selectedIndex++:(e===a.backspace||e===a.delete)&&this.deleteCurrentItem())},deleteCurrentItem(){const e=this.selectedIndex,t=this.selectedItems[e];if(!this.isInteractive||this.getDisabled(t))return;const s=this.selectedItems.length-1;if(this.selectedIndex===-1&&s!==0){this.selectedIndex=s;return}const i=this.selectedItems.length,l=e!==i-1?e:e-1;this.selectedItems[l]?this.selectItem(t):this.setValue(this.multiple?[]:null),this.selectedIndex=l},clearableCallback(){this.internalSearch=null,n.options.methods.clearableCallback.call(this)},genInput(){const e=o.options.methods.genInput.call(this);return e.data=F(e.data,{attrs:{"aria-activedescendant":f(this.$refs.menu,"activeTile.id"),autocomplete:f(e.data,"attrs.autocomplete","off")},domProps:{value:this.internalSearch}}),e},genInputSlot(){const e=n.options.methods.genInputSlot.call(this);return e.data.attrs.role="combobox",e},genSelections(){return this.hasSlot||this.multiple?n.options.methods.genSelections.call(this):[]},onClick(e){!this.isInteractive||(this.selectedIndex>-1?this.selectedIndex=-1:this.onFocus(),this.isAppendInner(e.target)||this.activateMenu())},onInput(e){if(this.selectedIndex>-1||!e.target)return;const t=e.target,s=t.value;t.value&&this.activateMenu(),!this.multiple&&s===""&&this.deleteCurrentItem(),this.internalSearch=s,this.badInput=t.validity&&t.validity.badInput},onKeyDown(e){const t=e.keyCode;(e.ctrlKey||![a.home,a.end].includes(t))&&n.options.methods.onKeyDown.call(this,e),this.changeSelectedIndex(t)},onSpaceDown(e){},onTabDown(e){n.options.methods.onTabDown.call(this,e),this.updateSelf()},onUpDown(e){e.preventDefault(),this.activateMenu()},selectItem(e){n.options.methods.selectItem.call(this,e),this.setSearch()},setSelectedItems(){n.options.methods.setSelectedItems.call(this),this.isFocused||this.setSearch()},setSearch(){this.$nextTick(()=>{(!this.multiple||!this.internalSearch||!this.isMenuActive)&&(this.internalSearch=!this.selectedItems.length||this.multiple||this.hasSlot?null:this.getText(this.selectedItem))})},updateSelf(){!this.searchIsDirty&&!this.internalValue||!this.multiple&&!this.valueComparator(this.internalSearch,this.getValue(this.internalValue))&&this.setSearch()},hasItem(e){return this.selectedValues.indexOf(this.getValue(e))>-1},onCopy(e){var t,s;if(this.selectedIndex===-1)return;const i=this.selectedItems[this.selectedIndex],l=this.getText(i);(t=e.clipboardData)===null||t===void 0||t.setData("text/plain",l),(s=e.clipboardData)===null||s===void 0||s.setData("text/vnd.vuetify.autocomplete.item+plain",l),e.preventDefault()}}}),Y=r.extend({name:"v-combobox",props:{delimiters:{type:Array,default:()=>[]},returnObject:{type:Boolean,default:!0}},data:()=>({editingIndex:-1}),computed:{computedCounterValue(){return this.multiple?this.selectedItems.length:(this.internalSearch||"").toString().length},hasSlot(){return n.options.computed.hasSlot.call(this)||this.multiple},isAnyValueAllowed(){return!0},menuCanShow(){return this.isFocused?this.hasDisplayedItems||!!this.$slots["no-data"]&&!this.hideNoData:!1},searchIsDirty(){return this.internalSearch!=null}},methods:{onInternalSearchChanged(e){if(e&&this.multiple&&this.delimiters.length){const t=this.delimiters.find(s=>e.endsWith(s));t!=null&&(this.internalSearch=e.slice(0,e.length-t.length),this.updateTags())}this.updateMenuDimensions()},genInput(){const e=r.options.methods.genInput.call(this);return delete e.data.attrs.name,e.data.on.paste=this.onPaste,e},genChipSelection(e,t){const s=n.options.methods.genChipSelection.call(this,e,t);return this.multiple&&(s.componentOptions.listeners={...s.componentOptions.listeners,dblclick:()=>{this.editingIndex=t,this.internalSearch=this.getText(e),this.selectedIndex=-1}}),s},onChipInput(e){n.options.methods.onChipInput.call(this,e),this.editingIndex=-1},onEnterDown(e){e.preventDefault(),!(this.getMenuIndex()>-1)&&this.$nextTick(this.updateSelf)},onKeyDown(e){const t=e.keyCode;(e.ctrlKey||![a.home,a.end].includes(t))&&n.options.methods.onKeyDown.call(this,e),this.multiple&&t===a.left&&this.$refs.input.selectionStart===0?this.updateSelf():t===a.enter&&this.onEnterDown(e),this.changeSelectedIndex(t)},onTabDown(e){if(this.multiple&&this.internalSearch&&this.getMenuIndex()===-1)return e.preventDefault(),e.stopPropagation(),this.updateTags();r.options.methods.onTabDown.call(this,e)},selectItem(e){this.editingIndex>-1?this.updateEditing():(r.options.methods.selectItem.call(this,e),this.internalSearch&&this.multiple&&this.getText(e).toLocaleLowerCase().includes(this.internalSearch.toLocaleLowerCase())&&(this.internalSearch=null))},setSelectedItems(){this.internalValue==null||this.internalValue===""?this.selectedItems=[]:this.selectedItems=this.multiple?this.internalValue:[this.internalValue]},setValue(e){n.options.methods.setValue.call(this,e===void 0?this.internalSearch:e)},updateEditing(){const e=this.internalValue.slice(),t=this.selectedItems.findIndex(s=>this.getText(s)===this.internalSearch);if(t>-1){const s=typeof e[t]=="object"?Object.assign({},e[t]):e[t];e.splice(t,1),e.push(s)}else e[this.editingIndex]=this.internalSearch;this.setValue(e),this.editingIndex=-1,this.internalSearch=null},updateCombobox(){if(!this.searchIsDirty)return;this.internalSearch!==this.getText(this.internalValue)&&this.setValue(),(Boolean(this.$scopedSlots.selection)||this.hasChips)&&(this.internalSearch=null)},updateSelf(){this.multiple?this.updateTags():this.updateCombobox()},updateTags(){const e=this.getMenuIndex();if(e<0&&!this.searchIsDirty||!this.internalSearch)return;if(this.editingIndex>-1)return this.updateEditing();const t=this.selectedItems.findIndex(i=>this.internalSearch===this.getText(i)),s=t>-1&&typeof this.selectedItems[t]=="object"?Object.assign({},this.selectedItems[t]):this.internalSearch;if(t>-1){const i=this.internalValue.slice();i.splice(t,1),this.setValue(i)}if(e>-1)return this.internalSearch=null;this.selectItem(s),this.internalSearch=null},onPaste(e){var t;if(this.$emit("paste",e),!this.multiple||this.searchIsDirty)return;const s=(t=e.clipboardData)===null||t===void 0?void 0:t.getData("text/vnd.vuetify.autocomplete.item+plain");s&&this.findExistingIndex(s)===-1&&(e.preventDefault(),n.options.methods.selectItem.call(this,s))},clearableCallback(){this.editingIndex=-1,r.options.methods.clearableCallback.call(this)}}});const Q=o.extend({name:"v-file-input",model:{prop:"value",event:"change"},props:{chips:Boolean,clearable:{type:Boolean,default:!0},counterSizeString:{type:String,default:"$vuetify.fileInput.counterSize"},counterString:{type:String,default:"$vuetify.fileInput.counter"},hideInput:Boolean,multiple:Boolean,placeholder:String,prependIcon:{type:String,default:"$file"},readonly:{type:Boolean,default:!1},showSize:{type:[Boolean,Number],default:!1,validator:e=>typeof e=="boolean"||[1e3,1024].includes(e)},smallChips:Boolean,truncateLength:{type:[Number,String],default:22},type:{type:String,default:"file"},value:{default:void 0,validator:e=>g(e).every(t=>t!=null&&typeof t=="object")}},computed:{classes(){return{...o.options.computed.classes.call(this),"v-file-input":!0}},computedCounterValue(){const e=this.multiple&&this.lazyValue?this.lazyValue.length:this.lazyValue instanceof File?1:0;if(!this.showSize)return this.$vuetify.lang.t(this.counterString,e);const t=this.internalArrayValue.reduce((s,{size:i=0})=>s+i,0);return this.$vuetify.lang.t(this.counterSizeString,e,_(t,this.base===1024))},internalArrayValue(){return g(this.internalValue)},internalValue:{get(){return this.lazyValue},set(e){this.lazyValue=e,this.$emit("change",this.lazyValue)}},isDirty(){return this.internalArrayValue.length>0},isLabelActive(){return this.isDirty},text(){return!this.isDirty&&(this.persistentPlaceholder||this.isFocused||!this.hasLabel)?[this.placeholder]:this.internalArrayValue.map(e=>{const{name:t="",size:s=0}=e,i=this.truncateText(t);return this.showSize?`${i} (${_(s,this.base===1024)})`:i})},base(){return typeof this.showSize!="boolean"?this.showSize:void 0},hasChips(){return this.chips||this.smallChips}},watch:{readonly:{handler(e){e===!0&&C("readonly is not supported on ",this)},immediate:!0},value(e){const t=this.multiple?e:e?[e]:[];w(t,this.$refs.input.files)||(this.$refs.input.value="")}},methods:{clearableCallback(){this.internalValue=this.multiple?[]:null,this.$refs.input.value=""},genChips(){return this.isDirty?this.text.map((e,t)=>this.$createElement(j,{props:{small:this.smallChips},on:{"click:close":()=>{const s=this.internalValue;s.splice(t,1),this.internalValue=s}}},[e])):[]},genControl(){const e=o.options.methods.genControl.call(this);return this.hideInput&&(e.data.style=T(e.data.style,{display:"none"})),e},genInput(){const e=o.options.methods.genInput.call(this);return e.data.attrs.multiple=this.multiple,delete e.data.domProps.value,delete e.data.on.input,e.data.on.change=this.onInput,[this.genSelections(),e]},genPrependSlot(){if(!this.prependIcon)return null;const e=this.genIcon("prepend",()=>{this.$refs.input.click()});return this.genSlot("prepend","outer",[e])},genSelectionText(){const e=this.text.length;return e<2?this.text:this.showSize&&!this.counter?[this.computedCounterValue]:[this.$vuetify.lang.t(this.counterString,e)]},genSelections(){const e=[];return this.isDirty&&this.$scopedSlots.selection?this.internalArrayValue.forEach((t,s)=>{!this.$scopedSlots.selection||e.push(this.$scopedSlots.selection({text:this.text[s],file:t,index:s}))}):e.push(this.hasChips&&this.isDirty?this.genChips():this.genSelectionText()),this.$createElement("div",{staticClass:"v-file-input__text",class:{"v-file-input__text--placeholder":this.placeholder&&!this.isDirty,"v-file-input__text--chips":this.hasChips&&!this.$scopedSlots.selection}},e)},genTextFieldSlot(){const e=o.options.methods.genTextFieldSlot.call(this);return e.data.on={...e.data.on||{},click:t=>{t.target&&t.target.nodeName==="LABEL"||this.$refs.input.click()}},e},onInput(e){const t=[...e.target.files||[]];this.internalValue=this.multiple?t:t[0],this.initialValue=this.internalValue},onKeyDown(e){this.$emit("keydown",e)},truncateText(e){if(e.length[]}},data(){return{loading:!1,file:null}},computed:{show:{get(){return this.value},set(e){this.$emit("input",e)}}},methods:{async submit(){if(!this.$refs.form.validate())return;const e=new FormData;e.append("file",this.file);const t=await V(e);this.$emit("submit",{file:t.data})}}};var J=function(){var t=this,s=t._self._c;return s(k,{ref:"uploadDialog",attrs:{"max-width":"750px"},model:{value:t.show,callback:function(i){t.show=i},expression:"show"}},[s(B,[s(L,[s("span",{staticClass:"headline"},[t._v("Upload To Empire Server")])]),s(z,[s(v,{ref:"form",attrs:{"on-submit":"return false;"},on:{submit:function(i){i.preventDefault()}}},[s(A,[s(p,[s(u,{attrs:{cols:"12"}},[s(Q,{ref:"fileInput",attrs:{accept:"*/*",rules:t.rules,outlined:"",dense:""},model:{value:t.file,callback:function(i){t.file=i},expression:"file"}})],1)],1)],1)],1)],1),s(P,[s(M),s(y,{attrs:{color:"blue darken-1",text:""},on:{click:function(i){i.stopPropagation(),t.show=!1}}},[t._v(" Close ")]),s(y,{attrs:{color:"blue darken-1",text:"",loading:t.loading},on:{click:t.submit}},[t._v(" Upload ")])],1)],1)],1)},W=[],Z=h(H,J,W,!1,null,null,null,null);const x=Z.exports;function S(e,t){if(e===0)return"0 Bytes";const s=1024,i=t||2,l=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],c=Math.floor(Math.log(e)/Math.log(s));return`${parseFloat((e/s**c).toFixed(i))} ${l[c]}`}const X={components:{FileUploadDialog:x},props:{value:{type:[String,Array,Number],required:!0},label:{type:String,default:"Server Files"},rules:{type:Array,default:()=>[]},maximumFileSize:{type:Number,required:!1,default:-1},returnObject:{type:Boolean,required:!1,default:!1}},data(){return{internalValue:this.value,isLoading:!1,count:0,entries:[],search:null,showDialog:!1}},computed:{fileItems(){return this.entries.map(e=>{const t=e.location.length>this.descriptionLimit?`(${S(e.size)}) ${e.location.slice(0,this.descriptionLimit)}...`:`(${S(e.size)}) ${e.location}`;return{...e,description:t}})}},watch:{internalValue(e){this.$emit("input",e)},value(e){this.internalValue=e},search(){this.doSearch()}},mounted(){this.doSearch()},methods:{doSearch(e=!0){!e&&this.fileItems.length>0||this.isLoading||(this.isLoading=!0,$({page:1,limit:-1}).then(t=>{const{records:s}=t;this.maximumFileSize>0?this.entries=s.filter(i=>i.size<=this.maximumFileSize):this.entries=s,this.count=this.entries.length}).catch(t=>{console.log(t)}).finally(()=>{this.isLoading=!1}))},fileUploaded({file:e}){this.showDialog=!1,this.doSearch(!0),this.returnObject?this.internalValue=e:this.internalValue=e.id}}};var ee=function(){var t=this,s=t._self._c;return s("div",[s(x,{attrs:{rules:t.rules},on:{submit:t.fileUploaded},model:{value:t.showDialog,callback:function(i){t.showDialog=i},expression:"showDialog"}}),s(r,{attrs:{items:t.fileItems,loading:t.isLoading,"search-input":t.search,"hide-no-data":"","hide-selected":"",clearable:"","cache-items":"","item-text":"description","item-value":"id",label:t.label,placeholder:"Start typing to Search","prepend-icon":"fa-upload",outlined:"",dense:"","return-object":t.returnObject},on:{"update:searchInput":function(i){t.search=i},"update:search-input":function(i){t.search=i},"click:prepend":function(i){t.showDialog=!0}},model:{value:t.internalValue,callback:function(i){t.internalValue=i},expression:"internalValue"}})],1)},te=[],se=h(X,ee,te,!1,null,null,null,null);const b=se.exports;const ie={components:{FileInput:b},props:{value:{type:[String,Array,Number],required:!0},suggestedValues:{type:Array,default:()=>[]},strict:{type:Boolean,default:!1},name:{type:String,required:!0},rules:{type:Array,default:()=>[]},type:{type:String,default:"text"}},data(){return{internalValue:this.value}},watch:{internalValue(e){this.$emit("input",e)}},methods:{truncate(e){return e?e.length>80?`${e.substr(0,80)}...`:e:""}}};var ne=function(){var t=this,s=t._self._c;return s("div",[t.suggestedValues.length>0&&t.strict&&t.suggestedValues.includes("True")&&t.suggestedValues.includes("False")?s(G,{attrs:{"false-value":"False","true-value":"True",label:t.name},model:{value:t.internalValue,callback:function(i){t.internalValue=i},expression:"internalValue"}}):t.name==="Bypasses"?s(r,{attrs:{items:t.suggestedValues,label:t.name,outlined:"",multiple:"",chips:""},model:{value:t.internalValue,callback:function(i){t.internalValue=i},expression:"internalValue"}}):t.type==="file"?s(b,{attrs:{label:t.name},model:{value:t.internalValue,callback:function(i){t.internalValue=i},expression:"internalValue"}}):t.name==="CredID"?s(r,{attrs:{items:t.suggestedValues,label:t.name,outlined:"",dense:"","item-value":"id","item-text":"id"},scopedSlots:t._u([{key:"item",fn:function(i){return[s(E,[s(O,{domProps:{textContent:t._s(t.truncate(`${i.item.username}, ${i.item.domain}, ${i.item.password}`))}}),s(N,{domProps:{textContent:t._s(t.truncate(`id: ${i.item.id}, notes: ${i.item.notes}`))}})],1)]}}]),model:{value:t.internalValue,callback:function(i){t.internalValue=i},expression:"internalValue"}}):t.suggestedValues.length>0&&!t.strict?s(Y,{attrs:{items:t.suggestedValues,label:t.name,outlined:"",dense:""},model:{value:t.internalValue,callback:function(i){t.internalValue=i},expression:"internalValue"}}):t.suggestedValues.length>0&&t.strict?s(r,{attrs:{items:t.suggestedValues,label:t.name,outlined:"",dense:""},model:{value:t.internalValue,callback:function(i){t.internalValue=i},expression:"internalValue"}}):s(o,{attrs:{rules:t.rules,label:t.name,type:t.type==="string"?"text":"number",outlined:"",dense:"",required:""},model:{value:t.internalValue,callback:function(i){t.internalValue=i},expression:"internalValue"}})],1)},le=[],ae=h(ie,ne,le,!1,null,null,null,null);const m=ae.exports;const re={components:{DynamicFormInput:m},props:{options:{type:Object,required:!0},readonly:{type:Boolean,default:!1},priority:{type:Array,default:()=>[]}},data(){return{form:{},valid:!0}},computed:{...q({listeners:"listener/listenerNames",bypasses:"bypass/bypassNames",malleableProfiles:"malleable/profileNames",credentials:"credential/credentials"}),optionalFields(){return this.fields.filter(e=>e.required===!1).map(e=>({...e,type:this.fieldType(e)}))},requiredFields(){return this.fields.filter(e=>e.required===!0).map(e=>({...e,type:this.fieldType(e)}))},fields(){const e=Object.keys(this.options).map(t=>({name:t,...this.options[t]}));return this.priority.slice().reverse().forEach(t=>{const s=e.findIndex(i=>i.name===t);if(s>-1){const i=e.splice(s,1)[0];e.unshift(i)}}),e},rules(){return this.fields.reduce((e,t)=>(e[t.name]=[],t.required===!0&&e[t.name].push(s=>!!s||s===0||`${t.name} is required`),e),{})}},watch:{form:{handler(e){const t={...e};t.Bypasses&&(t.Bypasses=t.Bypasses.join(" ")),this.$emit("input",t)},deep:!0},fields:{immediate:!0,handler(e){const t=e.reduce((s,i)=>(i.name==="Bypasses"&&!Array.isArray(i.value)?s[i.name]=i.value.split(" ")||[]:s[i.name]=i.value==null?"":i.value,s),{});U.set(this,"form",t)}}},mounted(){var e,t,s,i;((e=this.listeners)==null?void 0:e.length)===0&&this.$store.dispatch("listener/getListeners"),((t=this.bypasses)==null?void 0:t.length)===0&&this.$store.dispatch("bypass/getBypasses"),((s=this.malleableProfiles)==null?void 0:s.length)===0&&this.$store.dispatch("malleable/getMalleableProfiles"),((i=this.credentials)==null?void 0:i.length)===0&&this.$store.dispatch("credential/getCredentials")},methods:{suggestedValuesForField(e){return["Listener","RedirectListener"].includes(e.name)?this.listeners:e.name==="Bypasses"?this.bypasses:e.name==="Profile"?this.malleableProfiles:e.name==="CredID"?this.credentials:e.suggested_values},strictForField(e){return e.name==="Listener"||e.name==="Bypasses"||e.name==="Profile"||e.name==="CredID"?!0:e.strict},fieldExists(e){return this.fields.find(t=>t.name===e)},fieldType(e){return e.value_type==="INTEGER"?"number":e.value_type==="FLOAT"?"float":e.value_type==="BOOLEAN"?"boolean":e.value_type==="STRING"?"string":e.value_type==="FILE"?"file":"string"}}};var oe=function(){var t=this,s=t._self._c;return s(v,{ref:"form",attrs:{readonly:t.readonly},nativeOn:{submit:function(i){return i.preventDefault(),t.submit.apply(null,arguments)}},model:{value:t.valid,callback:function(i){t.valid=i},expression:"valid"}},[t._l(t.requiredFields,function(i){return s(p,{key:i.name},[s(u,{attrs:{cols:"6"}},[s(m,{attrs:{"suggested-values":t.suggestedValuesForField(i),strict:t.strictForField(i),name:i.name,rules:t.rules[i.name],type:i.type},model:{value:t.form[i.name],callback:function(l){t.$set(t.form,i.name,l)},expression:"form[field.name]"}})],1),s(u,{attrs:{cols:"6"}},[s(d,[t._v(" "+t._s(i.description)+" ")])],1)],1)}),t.optionalFields.length>0?s(d,[t._v(" Optional Fields ")]):t._e(),t.optionalFields.length>0?s(K,{staticClass:"mb-8"}):t._e(),t._l(t.optionalFields,function(i){return s(p,{key:i.name},[s(u,{attrs:{cols:"6"}},[s(m,{attrs:{"suggested-values":t.suggestedValuesForField(i),strict:t.strictForField(i),name:i.name,rules:t.rules[i.name],type:i.type},model:{value:t.form[i.name],callback:function(l){t.$set(t.form,i.name,l)},expression:"form[field.name]"}})],1),s(u,{attrs:{cols:"6"}},[s(d,[t._v(" "+t._s(i.description)+" ")])],1)],1)})],2)},ue=[],he=h(re,oe,ue,!1,null,null,null,null);const ge=he.exports;export{ge as _,r as a,b,Q as c,S as f}; diff --git a/dist/assets/GeneralForm.fe5154ff.js b/dist/assets/GeneralForm.fe5154ff.js new file mode 100644 index 0000000..18b9dfc --- /dev/null +++ b/dist/assets/GeneralForm.fe5154ff.js @@ -0,0 +1 @@ +import{a0 as V,A as a,o,X as $,N as f,H as g,aM as _,ab as D,J as C,aN as F,n as h,aO as w,aP as T,f as k,aQ as B,aC as L,aB as v,aR as z,aD as A,a as M,b as y,aS as P,V as E,i as O,j as N,aH as q,D as R,l as U}from"./index.85262dd3.js";import{b as p,c as u}from"./ErrorStateAlert.5e9140da.js";import{V as n,d as j,a as K,b as d}from"./VSelect.8543571f.js";import{_ as G}from"./VSwitch.8a27782c.js";const I={...j,offsetY:!0,offsetOverflow:!0,transition:!1},r=n.extend({name:"v-autocomplete",props:{autoSelectFirst:{type:Boolean,default:!1},filter:{type:Function,default:(e,t,s)=>s.toLocaleLowerCase().indexOf(t.toLocaleLowerCase())>-1},hideNoData:Boolean,menuProps:{type:n.options.props.menuProps.type,default:()=>I},noFilter:Boolean,searchInput:{type:String}},data(){return{lazySearch:this.searchInput}},computed:{classes(){return{...n.options.computed.classes.call(this),"v-autocomplete":!0,"v-autocomplete--is-selecting-index":this.selectedIndex>-1}},computedItems(){return this.filteredItems},selectedValues(){return this.selectedItems.map(e=>this.getValue(e))},hasDisplayedItems(){return this.hideSelected?this.filteredItems.some(e=>!this.hasItem(e)):this.filteredItems.length>0},currentRange(){return this.selectedItem==null?0:String(this.getText(this.selectedItem)).length},filteredItems(){return!this.isSearching||this.noFilter||this.internalSearch==null?this.allItems:this.allItems.filter(e=>{const t=V(e,this.itemText),s=t!=null?String(t):"";return this.filter(e,String(this.internalSearch),s)})},internalSearch:{get(){return this.lazySearch},set(e){this.lazySearch!==e&&(this.lazySearch=e,this.$emit("update:search-input",e))}},isAnyValueAllowed(){return!1},isDirty(){return this.searchIsDirty||this.selectedItems.length>0},isSearching(){return this.multiple&&this.searchIsDirty||this.searchIsDirty&&this.internalSearch!==this.getText(this.selectedItem)},menuCanShow(){return this.isFocused?this.hasDisplayedItems||!this.hideNoData:!1},$_menuProps(){const e=n.options.computed.$_menuProps.call(this);return e.contentClass=`v-autocomplete__content ${e.contentClass||""}`.trim(),{...I,...e}},searchIsDirty(){return this.internalSearch!=null&&this.internalSearch!==""},selectedItem(){return this.multiple?null:this.selectedItems.find(e=>this.valueComparator(this.getValue(e),this.getValue(this.internalValue)))},listData(){const e=n.options.computed.listData.call(this);return e.props={...e.props,items:this.virtualizedItems,noFilter:this.noFilter||!this.isSearching||!this.filteredItems.length,searchInput:this.internalSearch},e}},watch:{filteredItems:"onFilteredItemsChanged",internalValue:"setSearch",isFocused(e){e?(document.addEventListener("copy",this.onCopy),this.$refs.input&&this.$refs.input.select()):(document.removeEventListener("copy",this.onCopy),this.blur(),this.updateSelf())},isMenuActive(e){e||!this.hasSlot||(this.lazySearch=null)},items(e,t){!(t&&t.length)&&this.hideNoData&&this.isFocused&&!this.isMenuActive&&e.length&&this.activateMenu()},searchInput(e){this.lazySearch=e},internalSearch:"onInternalSearchChanged",itemText:"updateSelf"},created(){this.setSearch()},destroyed(){document.removeEventListener("copy",this.onCopy)},methods:{onFilteredItemsChanged(e,t){if(e!==t){if(!this.autoSelectFirst){const s=t[this.$refs.menu.listIndex];s?this.setMenuIndex(e.findIndex(i=>i===s)):this.setMenuIndex(-1),this.$emit("update:list-index",this.$refs.menu.listIndex)}this.$nextTick(()=>{!this.internalSearch||e.length!==1&&!this.autoSelectFirst||(this.$refs.menu.getTiles(),this.autoSelectFirst&&e.length&&(this.setMenuIndex(0),this.$emit("update:list-index",this.$refs.menu.listIndex)))})}},onInternalSearchChanged(){this.updateMenuDimensions()},updateMenuDimensions(){this.isMenuActive&&this.$refs.menu&&this.$refs.menu.updateDimensions()},changeSelectedIndex(e){this.searchIsDirty||(this.multiple&&e===a.left?this.selectedIndex===-1?this.selectedIndex=this.selectedItems.length-1:this.selectedIndex--:this.multiple&&e===a.right?this.selectedIndex>=this.selectedItems.length-1?this.selectedIndex=-1:this.selectedIndex++:(e===a.backspace||e===a.delete)&&this.deleteCurrentItem())},deleteCurrentItem(){const e=this.selectedIndex,t=this.selectedItems[e];if(!this.isInteractive||this.getDisabled(t))return;const s=this.selectedItems.length-1;if(this.selectedIndex===-1&&s!==0){this.selectedIndex=s;return}const i=this.selectedItems.length,l=e!==i-1?e:e-1;this.selectedItems[l]?this.selectItem(t):this.setValue(this.multiple?[]:null),this.selectedIndex=l},clearableCallback(){this.internalSearch=null,n.options.methods.clearableCallback.call(this)},genInput(){const e=o.options.methods.genInput.call(this);return e.data=$(e.data,{attrs:{"aria-activedescendant":f(this.$refs.menu,"activeTile.id"),autocomplete:f(e.data,"attrs.autocomplete","off")},domProps:{value:this.internalSearch}}),e},genInputSlot(){const e=n.options.methods.genInputSlot.call(this);return e.data.attrs.role="combobox",e},genSelections(){return this.hasSlot||this.multiple?n.options.methods.genSelections.call(this):[]},onClick(e){!this.isInteractive||(this.selectedIndex>-1?this.selectedIndex=-1:this.onFocus(),this.isAppendInner(e.target)||this.activateMenu())},onInput(e){if(this.selectedIndex>-1||!e.target)return;const t=e.target,s=t.value;t.value&&this.activateMenu(),!this.multiple&&s===""&&this.deleteCurrentItem(),this.internalSearch=s,this.badInput=t.validity&&t.validity.badInput},onKeyDown(e){const t=e.keyCode;(e.ctrlKey||![a.home,a.end].includes(t))&&n.options.methods.onKeyDown.call(this,e),this.changeSelectedIndex(t)},onSpaceDown(e){},onTabDown(e){n.options.methods.onTabDown.call(this,e),this.updateSelf()},onUpDown(e){e.preventDefault(),this.activateMenu()},selectItem(e){n.options.methods.selectItem.call(this,e),this.setSearch()},setSelectedItems(){n.options.methods.setSelectedItems.call(this),this.isFocused||this.setSearch()},setSearch(){this.$nextTick(()=>{(!this.multiple||!this.internalSearch||!this.isMenuActive)&&(this.internalSearch=!this.selectedItems.length||this.multiple||this.hasSlot?null:this.getText(this.selectedItem))})},updateSelf(){!this.searchIsDirty&&!this.internalValue||!this.multiple&&!this.valueComparator(this.internalSearch,this.getValue(this.internalValue))&&this.setSearch()},hasItem(e){return this.selectedValues.indexOf(this.getValue(e))>-1},onCopy(e){var t,s;if(this.selectedIndex===-1)return;const i=this.selectedItems[this.selectedIndex],l=this.getText(i);(t=e.clipboardData)===null||t===void 0||t.setData("text/plain",l),(s=e.clipboardData)===null||s===void 0||s.setData("text/vnd.vuetify.autocomplete.item+plain",l),e.preventDefault()}}}),H=r.extend({name:"v-combobox",props:{delimiters:{type:Array,default:()=>[]},returnObject:{type:Boolean,default:!0}},data:()=>({editingIndex:-1}),computed:{computedCounterValue(){return this.multiple?this.selectedItems.length:(this.internalSearch||"").toString().length},hasSlot(){return n.options.computed.hasSlot.call(this)||this.multiple},isAnyValueAllowed(){return!0},menuCanShow(){return this.isFocused?this.hasDisplayedItems||!!this.$slots["no-data"]&&!this.hideNoData:!1},searchIsDirty(){return this.internalSearch!=null}},methods:{onInternalSearchChanged(e){if(e&&this.multiple&&this.delimiters.length){const t=this.delimiters.find(s=>e.endsWith(s));t!=null&&(this.internalSearch=e.slice(0,e.length-t.length),this.updateTags())}this.updateMenuDimensions()},genInput(){const e=r.options.methods.genInput.call(this);return delete e.data.attrs.name,e.data.on.paste=this.onPaste,e},genChipSelection(e,t){const s=n.options.methods.genChipSelection.call(this,e,t);return this.multiple&&(s.componentOptions.listeners={...s.componentOptions.listeners,dblclick:()=>{this.editingIndex=t,this.internalSearch=this.getText(e),this.selectedIndex=-1}}),s},onChipInput(e){n.options.methods.onChipInput.call(this,e),this.editingIndex=-1},onEnterDown(e){e.preventDefault(),!(this.getMenuIndex()>-1)&&this.$nextTick(this.updateSelf)},onKeyDown(e){const t=e.keyCode;(e.ctrlKey||![a.home,a.end].includes(t))&&n.options.methods.onKeyDown.call(this,e),this.multiple&&t===a.left&&this.$refs.input.selectionStart===0?this.updateSelf():t===a.enter&&this.onEnterDown(e),this.changeSelectedIndex(t)},onTabDown(e){if(this.multiple&&this.internalSearch&&this.getMenuIndex()===-1)return e.preventDefault(),e.stopPropagation(),this.updateTags();r.options.methods.onTabDown.call(this,e)},selectItem(e){this.editingIndex>-1?this.updateEditing():(r.options.methods.selectItem.call(this,e),this.internalSearch&&this.multiple&&this.getText(e).toLocaleLowerCase().includes(this.internalSearch.toLocaleLowerCase())&&(this.internalSearch=null))},setSelectedItems(){this.internalValue==null||this.internalValue===""?this.selectedItems=[]:this.selectedItems=this.multiple?this.internalValue:[this.internalValue]},setValue(e){n.options.methods.setValue.call(this,e===void 0?this.internalSearch:e)},updateEditing(){const e=this.internalValue.slice(),t=this.selectedItems.findIndex(s=>this.getText(s)===this.internalSearch);if(t>-1){const s=typeof e[t]=="object"?Object.assign({},e[t]):e[t];e.splice(t,1),e.push(s)}else e[this.editingIndex]=this.internalSearch;this.setValue(e),this.editingIndex=-1,this.internalSearch=null},updateCombobox(){if(!this.searchIsDirty)return;this.internalSearch!==this.getText(this.internalValue)&&this.setValue(),(Boolean(this.$scopedSlots.selection)||this.hasChips)&&(this.internalSearch=null)},updateSelf(){this.multiple?this.updateTags():this.updateCombobox()},updateTags(){const e=this.getMenuIndex();if(e<0&&!this.searchIsDirty||!this.internalSearch)return;if(this.editingIndex>-1)return this.updateEditing();const t=this.selectedItems.findIndex(i=>this.internalSearch===this.getText(i)),s=t>-1&&typeof this.selectedItems[t]=="object"?Object.assign({},this.selectedItems[t]):this.internalSearch;if(t>-1){const i=this.internalValue.slice();i.splice(t,1),this.setValue(i)}if(e>-1)return this.internalSearch=null;this.selectItem(s),this.internalSearch=null},onPaste(e){var t;if(this.$emit("paste",e),!this.multiple||this.searchIsDirty)return;const s=(t=e.clipboardData)===null||t===void 0?void 0:t.getData("text/vnd.vuetify.autocomplete.item+plain");s&&this.findExistingIndex(s)===-1&&(e.preventDefault(),n.options.methods.selectItem.call(this,s))},clearableCallback(){this.editingIndex=-1,r.options.methods.clearableCallback.call(this)}}});const Y=o.extend({name:"v-file-input",model:{prop:"value",event:"change"},props:{chips:Boolean,clearable:{type:Boolean,default:!0},counterSizeString:{type:String,default:"$vuetify.fileInput.counterSize"},counterString:{type:String,default:"$vuetify.fileInput.counter"},hideInput:Boolean,multiple:Boolean,placeholder:String,prependIcon:{type:String,default:"$file"},readonly:{type:Boolean,default:!1},showSize:{type:[Boolean,Number],default:!1,validator:e=>typeof e=="boolean"||[1e3,1024].includes(e)},smallChips:Boolean,truncateLength:{type:[Number,String],default:22},type:{type:String,default:"file"},value:{default:void 0,validator:e=>g(e).every(t=>t!=null&&typeof t=="object")}},computed:{classes(){return{...o.options.computed.classes.call(this),"v-file-input":!0}},computedCounterValue(){const e=this.multiple&&this.lazyValue?this.lazyValue.length:this.lazyValue instanceof File?1:0;if(!this.showSize)return this.$vuetify.lang.t(this.counterString,e);const t=this.internalArrayValue.reduce((s,{size:i=0})=>s+i,0);return this.$vuetify.lang.t(this.counterSizeString,e,_(t,this.base===1024))},internalArrayValue(){return g(this.internalValue)},internalValue:{get(){return this.lazyValue},set(e){this.lazyValue=e,this.$emit("change",this.lazyValue)}},isDirty(){return this.internalArrayValue.length>0},isLabelActive(){return this.isDirty},text(){return!this.isDirty&&(this.persistentPlaceholder||this.isFocused||!this.hasLabel)?[this.placeholder]:this.internalArrayValue.map(e=>{const{name:t="",size:s=0}=e,i=this.truncateText(t);return this.showSize?`${i} (${_(s,this.base===1024)})`:i})},base(){return typeof this.showSize!="boolean"?this.showSize:void 0},hasChips(){return this.chips||this.smallChips}},watch:{readonly:{handler(e){e===!0&&D("readonly is not supported on ",this)},immediate:!0},value(e){const t=this.multiple?e:e?[e]:[];C(t,this.$refs.input.files)||(this.$refs.input.value="")}},methods:{clearableCallback(){this.internalValue=this.multiple?[]:null,this.$refs.input.value=""},genChips(){return this.isDirty?this.text.map((e,t)=>this.$createElement(K,{props:{small:this.smallChips},on:{"click:close":()=>{const s=this.internalValue;s.splice(t,1),this.internalValue=s}}},[e])):[]},genControl(){const e=o.options.methods.genControl.call(this);return this.hideInput&&(e.data.style=F(e.data.style,{display:"none"})),e},genInput(){const e=o.options.methods.genInput.call(this);return e.data.attrs.multiple=this.multiple,delete e.data.domProps.value,delete e.data.on.input,e.data.on.change=this.onInput,[this.genSelections(),e]},genPrependSlot(){if(!this.prependIcon)return null;const e=this.genIcon("prepend",()=>{this.$refs.input.click()});return this.genSlot("prepend","outer",[e])},genSelectionText(){const e=this.text.length;return e<2?this.text:this.showSize&&!this.counter?[this.computedCounterValue]:[this.$vuetify.lang.t(this.counterString,e)]},genSelections(){const e=[];return this.isDirty&&this.$scopedSlots.selection?this.internalArrayValue.forEach((t,s)=>{!this.$scopedSlots.selection||e.push(this.$scopedSlots.selection({text:this.text[s],file:t,index:s}))}):e.push(this.hasChips&&this.isDirty?this.genChips():this.genSelectionText()),this.$createElement("div",{staticClass:"v-file-input__text",class:{"v-file-input__text--placeholder":this.placeholder&&!this.isDirty,"v-file-input__text--chips":this.hasChips&&!this.$scopedSlots.selection}},e)},genTextFieldSlot(){const e=o.options.methods.genTextFieldSlot.call(this);return e.data.on={...e.data.on||{},click:t=>{t.target&&t.target.nodeName==="LABEL"||this.$refs.input.click()}},e},onInput(e){const t=[...e.target.files||[]];this.internalValue=this.multiple?t:t[0],this.initialValue=this.internalValue},onKeyDown(e){this.$emit("keydown",e)},truncateText(e){if(e.length[]}},data(){return{loading:!1,file:null}},computed:{show:{get(){return this.value},set(e){this.$emit("input",e)}}},methods:{async submit(){if(!this.$refs.form.validate())return;const e=new FormData;e.append("file",this.file);const t=await w(e);this.$emit("submit",{file:t.data})}}};var Q=function(){var t=this,s=t._self._c;return s(T,{ref:"uploadDialog",attrs:{"max-width":"750px"},model:{value:t.show,callback:function(i){t.show=i},expression:"show"}},[s(k,[s(B,[s("span",{staticClass:"headline"},[t._v("Upload To Empire Server")])]),s(L,[s(v,{ref:"form",attrs:{"on-submit":"return false;"},on:{submit:function(i){i.preventDefault()}}},[s(z,[s(p,[s(u,{attrs:{cols:"12"}},[s(Y,{ref:"fileInput",attrs:{accept:"*/*",rules:t.rules,outlined:"",dense:""},model:{value:t.file,callback:function(i){t.file=i},expression:"file"}})],1)],1)],1)],1)],1),s(A,[s(M),s(y,{attrs:{color:"blue darken-1",text:""},on:{click:function(i){i.stopPropagation(),t.show=!1}}},[t._v(" Close ")]),s(y,{attrs:{color:"blue darken-1",text:"",loading:t.loading},on:{click:t.submit}},[t._v(" Upload ")])],1)],1)],1)},W=[],X=h(J,Q,W,!1,null,null,null,null);const x=X.exports;function S(e,t){if(e===0)return"0 Bytes";const s=1024,i=t||2,l=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],c=Math.floor(Math.log(e)/Math.log(s));return`${parseFloat((e/s**c).toFixed(i))} ${l[c]}`}const Z={components:{FileUploadDialog:x},props:{value:{type:[String,Array,Number],required:!0},label:{type:String,default:"Server Files"},rules:{type:Array,default:()=>[]},maximumFileSize:{type:Number,required:!1,default:-1},returnObject:{type:Boolean,required:!1,default:!1}},data(){return{internalValue:this.value,isLoading:!1,count:0,entries:[],search:null,showDialog:!1}},computed:{fileItems(){return this.entries.map(e=>{const t=e.location.length>this.descriptionLimit?`(${S(e.size)}) ${e.location.slice(0,this.descriptionLimit)}...`:`(${S(e.size)}) ${e.location}`;return{...e,description:t}})}},watch:{internalValue(e){this.$emit("input",e)},value(e){this.internalValue=e},search(){this.doSearch()}},mounted(){this.doSearch()},methods:{doSearch(e=!0){!e&&this.fileItems.length>0||this.isLoading||(this.isLoading=!0,P({page:1,limit:-1}).then(t=>{const{records:s}=t;this.maximumFileSize>0?this.entries=s.filter(i=>i.size<=this.maximumFileSize):this.entries=s,this.count=this.entries.length}).catch(t=>{console.log(t)}).finally(()=>{this.isLoading=!1}))},fileUploaded({file:e}){this.showDialog=!1,this.doSearch(!0),this.returnObject?this.internalValue=e:this.internalValue=e.id}}};var ee=function(){var t=this,s=t._self._c;return s("div",[s(x,{attrs:{rules:t.rules},on:{submit:t.fileUploaded},model:{value:t.showDialog,callback:function(i){t.showDialog=i},expression:"showDialog"}}),s(r,{attrs:{items:t.fileItems,loading:t.isLoading,"search-input":t.search,"hide-no-data":"","hide-selected":"",clearable:"","cache-items":"","item-text":"description","item-value":"id",label:t.label,placeholder:"Start typing to Search","prepend-icon":"fa-upload",outlined:"",dense:"","return-object":t.returnObject},on:{"update:searchInput":function(i){t.search=i},"update:search-input":function(i){t.search=i},"click:prepend":function(i){t.showDialog=!0}},model:{value:t.internalValue,callback:function(i){t.internalValue=i},expression:"internalValue"}})],1)},te=[],se=h(Z,ee,te,!1,null,null,null,null);const b=se.exports;const ie={components:{FileInput:b},props:{value:{type:[String,Array,Number],required:!0},suggestedValues:{type:Array,default:()=>[]},strict:{type:Boolean,default:!1},name:{type:String,required:!0},rules:{type:Array,default:()=>[]},type:{type:String,default:"text"}},data(){return{internalValue:this.value}},watch:{internalValue(e){this.$emit("input",e)}},methods:{truncate(e){return e?e.length>80?`${e.substr(0,80)}...`:e:""}}};var ne=function(){var t=this,s=t._self._c;return s("div",[t.suggestedValues.length>0&&t.strict&&t.suggestedValues.includes("True")&&t.suggestedValues.includes("False")?s(G,{attrs:{"false-value":"False","true-value":"True",label:t.name},model:{value:t.internalValue,callback:function(i){t.internalValue=i},expression:"internalValue"}}):t.name==="Bypasses"?s(r,{attrs:{items:t.suggestedValues,label:t.name,outlined:"",multiple:"",chips:""},model:{value:t.internalValue,callback:function(i){t.internalValue=i},expression:"internalValue"}}):t.type==="file"?s(b,{attrs:{label:t.name},model:{value:t.internalValue,callback:function(i){t.internalValue=i},expression:"internalValue"}}):t.name==="CredID"?s(r,{attrs:{items:t.suggestedValues,label:t.name,outlined:"",dense:"","item-value":"id","item-text":"id"},scopedSlots:t._u([{key:"item",fn:function(i){return[s(E,[s(O,{domProps:{textContent:t._s(t.truncate(`${i.item.username}, ${i.item.domain}, ${i.item.password}`))}}),s(N,{domProps:{textContent:t._s(t.truncate(`id: ${i.item.id}, notes: ${i.item.notes}`))}})],1)]}}]),model:{value:t.internalValue,callback:function(i){t.internalValue=i},expression:"internalValue"}}):t.suggestedValues.length>0&&!t.strict?s(H,{attrs:{items:t.suggestedValues,label:t.name,outlined:"",dense:""},model:{value:t.internalValue,callback:function(i){t.internalValue=i},expression:"internalValue"}}):t.suggestedValues.length>0&&t.strict?s(r,{attrs:{items:t.suggestedValues,label:t.name,outlined:"",dense:""},model:{value:t.internalValue,callback:function(i){t.internalValue=i},expression:"internalValue"}}):s(o,{attrs:{rules:t.rules,label:t.name,type:t.type==="string"?"text":"number",outlined:"",dense:"",required:""},model:{value:t.internalValue,callback:function(i){t.internalValue=i},expression:"internalValue"}})],1)},le=[],ae=h(ie,ne,le,!1,null,null,null,null);const m=ae.exports;const re={components:{DynamicFormInput:m},props:{options:{type:Object,required:!0},readonly:{type:Boolean,default:!1},priority:{type:Array,default:()=>[]}},data(){return{form:{},valid:!0}},computed:{...q({listeners:"listener/listenerNames",bypasses:"bypass/bypassNames",malleableProfiles:"malleable/profileNames",credentials:"credential/credentials"}),optionalFields(){return this.fields.filter(e=>e.required===!1).map(e=>({...e,type:this.fieldType(e)}))},requiredFields(){return this.fields.filter(e=>e.required===!0).map(e=>({...e,type:this.fieldType(e)}))},fields(){const e=Object.keys(this.options).map(t=>({name:t,...this.options[t]}));return this.priority.slice().reverse().forEach(t=>{const s=e.findIndex(i=>i.name===t);if(s>-1){const i=e.splice(s,1)[0];e.unshift(i)}}),e},rules(){return this.fields.reduce((e,t)=>(e[t.name]=[],t.required===!0&&e[t.name].push(s=>!!s||s===0||`${t.name} is required`),e),{})}},watch:{form:{handler(e){const t={...e};t.Bypasses&&(t.Bypasses=t.Bypasses.join(" ")),this.$emit("input",t)},deep:!0},fields:{immediate:!0,handler(e){const t=e.reduce((s,i)=>(i.name==="Bypasses"&&!Array.isArray(i.value)?s[i.name]=i.value.split(" ")||[]:s[i.name]=i.value==null?"":i.value,s),{});R.set(this,"form",t)}}},mounted(){var e,t,s,i;((e=this.listeners)==null?void 0:e.length)===0&&this.$store.dispatch("listener/getListeners"),((t=this.bypasses)==null?void 0:t.length)===0&&this.$store.dispatch("bypass/getBypasses"),((s=this.malleableProfiles)==null?void 0:s.length)===0&&this.$store.dispatch("malleable/getMalleableProfiles"),((i=this.credentials)==null?void 0:i.length)===0&&this.$store.dispatch("credential/getCredentials")},methods:{suggestedValuesForField(e){return["Listener","RedirectListener"].includes(e.name)?this.listeners:e.name==="Bypasses"?this.bypasses:e.name==="Profile"?this.malleableProfiles:e.name==="CredID"?this.credentials:e.suggested_values},strictForField(e){return e.name==="Listener"||e.name==="Bypasses"||e.name==="Profile"||e.name==="CredID"?!0:e.strict},fieldExists(e){return this.fields.find(t=>t.name===e)},fieldType(e){return e.value_type==="INTEGER"?"number":e.value_type==="FLOAT"?"float":e.value_type==="BOOLEAN"?"boolean":e.value_type==="STRING"?"string":e.value_type==="FILE"?"file":"string"}}};var oe=function(){var t=this,s=t._self._c;return s(v,{ref:"form",attrs:{readonly:t.readonly},nativeOn:{submit:function(i){return i.preventDefault(),t.submit.apply(null,arguments)}},model:{value:t.valid,callback:function(i){t.valid=i},expression:"valid"}},[t._l(t.requiredFields,function(i){return s(p,{key:i.name},[s(u,{attrs:{cols:"6"}},[s(m,{attrs:{"suggested-values":t.suggestedValuesForField(i),strict:t.strictForField(i),name:i.name,rules:t.rules[i.name],type:i.type},model:{value:t.form[i.name],callback:function(l){t.$set(t.form,i.name,l)},expression:"form[field.name]"}})],1),s(u,{attrs:{cols:"6"}},[s(d,[t._v(" "+t._s(i.description)+" ")])],1)],1)}),t.optionalFields.length>0?s(d,[t._v(" Optional Fields ")]):t._e(),t.optionalFields.length>0?s(U,{staticClass:"mb-8"}):t._e(),t._l(t.optionalFields,function(i){return s(p,{key:i.name},[s(u,{attrs:{cols:"6"}},[s(m,{attrs:{"suggested-values":t.suggestedValuesForField(i),strict:t.strictForField(i),name:i.name,rules:t.rules[i.name],type:i.type},model:{value:t.form[i.name],callback:function(l){t.$set(t.form,i.name,l)},expression:"form[field.name]"}})],1),s(u,{attrs:{cols:"6"}},[s(d,[t._v(" "+t._s(i.description)+" ")])],1)],1)})],2)},ue=[],he=h(re,oe,ue,!1,null,null,null,null);const fe=he.exports;export{fe as _,r as a,b,Y as c,S as f}; diff --git a/dist/assets/InfoViewer.ad34ab3b.js b/dist/assets/InfoViewer.448169ad.js similarity index 62% rename from dist/assets/InfoViewer.ad34ab3b.js rename to dist/assets/InfoViewer.448169ad.js index 1649cf8..5f735a8 100644 --- a/dist/assets/InfoViewer.ad34ab3b.js +++ b/dist/assets/InfoViewer.448169ad.js @@ -1 +1 @@ -import{n as i}from"./index.154e9cc6.js";import{_ as o}from"./VExpansionPanels.1f915cd7.js";import{_ as r,a as l,b as m}from"./VExpansionPanelHeader.d8fbc23c.js";import{b as a}from"./VSelect.27a57f2b.js";const p={props:{info:{type:Object,default:()=>{}}},methods:{formatDisplayName(s){return s.name&&s.handle?`${s.name} (${s.handle})`:s.name?s.name:s.handle?s.handle:""}}};var c=function(){var n=this,e=n._self._c;return e("div",[e(o,{staticClass:"collapse",attrs:{disabled:Object.keys(n.info).length<1}},[e(r,[Object.keys(n.info).length>0?e(l,[n._v(" "+n._s(n.info.description)+" ")]):n._e(),e(m,[e("div",{staticStyle:{"text-align":"left"}},[e("div",{staticStyle:{"margin-bottom":"10px"}},[e("span",[e("b",{staticClass:"mr-2"},[n._v("Authors:")]),n._l(n.info.authors,function(t,_){return[t.link?e(a,{key:_,staticClass:"mr-1 mb-1",attrs:{medium:"",href:t.link}},[n._v(" "+n._s(n.formatDisplayName(t))+" ")]):e(a,{key:_,staticClass:"mr-1 mb-1",attrs:{medium:"",target:"_blank",rel:"noopener noreferrer"}},[n._v(" "+n._s(n.formatDisplayName(t))+" ")])]})],2)]),e("div",{staticStyle:{"margin-bottom":"10px"}},[e("span",[e("b",{staticClass:"mr-2"},[n._v("Comments:")]),e("ul",n._l(n.info.comments,function(t,_){return e("li",{key:_},[n._v(" "+n._s(t)+" ")])}),0)])])]),n._l(n.info.extraDetails,function(t){return e("div",{key:t.key,staticStyle:{"margin-bottom":"10px"}},[e("span",[e("b",[n._v(n._s(t.key)+":")]),n._v(" "+n._s(t.value)+" ")])])})],2)],1)],1)],1)},f=[],u=i(p,c,f,!1,null,"7a81654f",null,null);const g=u.exports;export{g as _}; +import{n as a}from"./index.85262dd3.js";import{_ as o}from"./VExpansionPanels.d99facd5.js";import{_ as r,a as l,b as m}from"./VExpansionPanelHeader.1232ca65.js";import{a as i}from"./VSelect.8543571f.js";const c={props:{info:{type:Object,default:()=>{}}},methods:{formatDisplayName(s){return s.name&&s.handle?`${s.name} (${s.handle})`:s.name?s.name:s.handle?s.handle:""}}};var p=function(){var n=this,e=n._self._c;return e("div",[e(o,{staticClass:"collapse",attrs:{disabled:Object.keys(n.info).length<1}},[e(r,[Object.keys(n.info).length>0?e(l,[n._v(" "+n._s(n.info.description)+" ")]):n._e(),e(m,[e("div",{staticStyle:{"text-align":"left"}},[e("div",{staticStyle:{"margin-bottom":"10px"}},[e("span",[e("b",{staticClass:"mr-2"},[n._v("Authors:")]),n._l(n.info.authors,function(t,_){return[t.link?e(i,{key:_,staticClass:"mr-1 mb-1",attrs:{medium:"",href:t.link}},[n._v(" "+n._s(n.formatDisplayName(t))+" ")]):e(i,{key:_,staticClass:"mr-1 mb-1",attrs:{medium:"",target:"_blank",rel:"noopener noreferrer"}},[n._v(" "+n._s(n.formatDisplayName(t))+" ")])]})],2)]),e("div",{staticStyle:{"margin-bottom":"10px"}},[e("span",[e("b",{staticClass:"mr-2"},[n._v("Comments:")]),e("ul",n._l(n.info.comments,function(t,_){return e("li",{key:_},[n._v(" "+n._s(t)+" ")])}),0)])])]),n._l(n.info.extraDetails,function(t){return e("div",{key:t.key,staticStyle:{"margin-bottom":"10px"}},[e("span",[e("b",[n._v(n._s(t.key)+":")]),n._v(" "+n._s(t.value)+" ")])])})],2)],1)],1)],1)},f=[],u=a(c,p,f,!1,null,"d9b76c32",null,null);const g=u.exports;export{g as _}; diff --git a/dist/assets/InfoViewer.b3c2398f.css b/dist/assets/InfoViewer.b3c2398f.css deleted file mode 100644 index 2d36021..0000000 --- a/dist/assets/InfoViewer.b3c2398f.css +++ /dev/null @@ -1 +0,0 @@ -.collapse[data-v-7a81654f]{margin-bottom:25px} diff --git a/dist/assets/InfoViewer.fd805237.css b/dist/assets/InfoViewer.fd805237.css new file mode 100644 index 0000000..7f57a18 --- /dev/null +++ b/dist/assets/InfoViewer.fd805237.css @@ -0,0 +1 @@ +.collapse[data-v-d9b76c32]{margin-bottom:25px} diff --git a/dist/assets/ListPageTop.2a204a11.js b/dist/assets/ListPageTop.2a204a11.js new file mode 100644 index 0000000..2eef66e --- /dev/null +++ b/dist/assets/ListPageTop.2a204a11.js @@ -0,0 +1 @@ +import{n,a as o,b as r,c as s}from"./index.85262dd3.js";import{_}from"./VBreadcrumbs.32f4f2d0.js";const l={name:"ListPageTop",props:{deleteText:{type:String,default:"Delete"},refreshText:{type:String,default:"Refresh"},createText:{type:String,default:"Create"},showDelete:{type:Boolean,default:!1},showRefresh:{type:Boolean,default:!1},showCreate:{type:Boolean,default:!1},refreshLoading:{type:Boolean,default:!1},breads:{type:Array,default:()=>[]}}};var i=function(){var e=this,t=e._self._c;return t("portal",{attrs:{to:"app-bar"}},[t("div",{staticClass:"v-toolbar__content pt-2",staticStyle:{width:"100%"}},[t(_,{attrs:{items:e.breads}}),t(o),t("div",{staticClass:"pt-2"},[e._t("extra-stuff")],2),t("div",[e.showDelete?t(r,{staticClass:"mr-2",attrs:{color:"error",text:""},on:{click:function(a){return e.$emit("delete")}}},[e._v(" "+e._s(e.deleteText)+" "),t(s,{attrs:{right:""}},[e._v(" fa-trash-alt ")])],1):e._e(),e.showRefresh?t(r,{staticClass:"mr-2",attrs:{disabled:e.refreshLoading,color:"primary",text:""},on:{click:function(a){return e.$emit("refresh")}}},[e._v(" "+e._s(e.refreshText)+" "),t(s,{attrs:{right:""}},[e._v(" fa-redo "+e._s(e.refreshLoading?"fa-spin":"")+" ")])],1):e._e(),e.showCreate?t(r,{staticClass:"mr-2",attrs:{color:"primary",rounded:""},on:{click:function(a){return e.$emit("create")}}},[e._v(" "+e._s(e.createText)+" "),t(s,{attrs:{right:""}},[e._v(" fa-plus-square ")])],1):e._e()],1)],1)])},c=[],f=n(l,i,c,!1,null,null,null,null);const m=f.exports;export{m as _}; diff --git a/dist/assets/ListPageTop.dad49f81.js b/dist/assets/ListPageTop.dad49f81.js deleted file mode 100644 index f93babf..0000000 --- a/dist/assets/ListPageTop.dad49f81.js +++ /dev/null @@ -1 +0,0 @@ -import{n,a as o,b as r,c as s}from"./index.154e9cc6.js";import{_}from"./VBreadcrumbs.a2278375.js";const l={name:"ListPageTop",props:{deleteText:{type:String,default:"Delete"},refreshText:{type:String,default:"Refresh"},createText:{type:String,default:"Create"},showDelete:{type:Boolean,default:!1},showRefresh:{type:Boolean,default:!1},showCreate:{type:Boolean,default:!1},refreshLoading:{type:Boolean,default:!1},breads:{type:Array,default:()=>[]}}};var i=function(){var e=this,t=e._self._c;return t("portal",{attrs:{to:"app-bar"}},[t("div",{staticClass:"v-toolbar__content",staticStyle:{width:"100%"}},[t(_,{attrs:{items:e.breads}}),t(o),e._t("extra-stuff"),t("div",[e.showDelete?t(r,{staticClass:"mr-2",attrs:{color:"error",text:""},on:{click:function(a){return e.$emit("delete")}}},[e._v(" "+e._s(e.deleteText)+" "),t(s,{attrs:{right:""}},[e._v(" fa-trash-alt ")])],1):e._e(),e.showRefresh?t(r,{staticClass:"mr-2",attrs:{disabled:e.refreshLoading,color:"primary",text:""},on:{click:function(a){return e.$emit("refresh")}}},[e._v(" "+e._s(e.refreshText)+" "),t(s,{attrs:{right:""}},[e._v(" fa-redo "+e._s(e.refreshLoading?"fa-spin":"")+" ")])],1):e._e(),e.showCreate?t(r,{staticClass:"mr-2",attrs:{color:"primary",rounded:""},on:{click:function(a){return e.$emit("create")}}},[e._v(" "+e._s(e.createText)+" "),t(s,{attrs:{right:""}},[e._v(" fa-plus-square ")])],1):e._e()],1)],2)])},c=[],f=n(l,i,c,!1,null,null,null,null);const m=f.exports;export{m as _}; diff --git a/dist/assets/ListPageTop.e3b0c442.css b/dist/assets/ListPageTop.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/ListenerEdit.2dfa9d57.js b/dist/assets/ListenerEdit.2dfa9d57.js deleted file mode 100644 index 0105a29..0000000 --- a/dist/assets/ListenerEdit.2dfa9d57.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as l,a as u}from"./GeneralForm.6b452c3e.js";import{_ as c}from"./InfoViewer.ad34ab3b.js";import{_ as d,a as h,b as _,c as f}from"./ErrorStateAlert.3518d55f.js";import{_ as p}from"./TagViewer.b07ca85a.js";import{_ as m}from"./EditPageTop.0db28cea.js";import{aK as g,aL as w,p as $,u as b,q as y,aM as n,aN as T,aO as L,n as k,b as v,c as E,k as N,l as a,V as o,o as x,r as C}from"./index.154e9cc6.js";import{_ as S}from"./VSwitch.4adac3f4.js";import{_ as I}from"./VSelect.27a57f2b.js";import"./download-api.dfe5301b.js";import"./VExpansionPanels.1f915cd7.js";import"./VExpansionPanelHeader.d8fbc23c.js";import"./index.41ea8dd2.js";import"./TooltipButton.6022e185.js";import"./VTooltip.b258437e.js";import"./index.27090f0f.js";import"./VBreadcrumbs.a2278375.js";const M={name:"ListenerEdit",components:{TagViewer:p,InfoViewer:c,GeneralForm:l,ErrorStateAlert:d,EditPageTop:m},data(){return{listener:{options:{}},listenerTemplate:{options:{}},selectedTemplate:"",form:{},reset:!0,loading:!1,formPriorities:["Name","Host","Port"],errorState:!1,validationMessage:null,initialLoad:!1,commonStagers:["multi_launcher","multi_macro","windows_csharp_exe","windows_dll","windows_shellcode"]}},computed:{...g({listenerTemplateIds:"listener/templateIds"}),isNew(){return this.$route.name==="listenerNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"View"},canEdit(){return this.isNew||!this.listener.enabled},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"listenerNew",params:{copy:!0,id:this.id}}:{}},listenerInfo(){if(!this.listenerTemplate)return{};const t=this.listenerTemplate;return{authors:t.authors,description:t.description,comments:t.comments}},listenerOptions(){if(!this.isNew||this.isCopy){const e={};return Object.keys(this.listener.options).forEach(s=>{e[s]={...this.listenerTemplate.options[s]},e[s].value=this.listener.options[s]}),e}const{options:t}=this.listenerTemplate;return t||{}},breads(){return[{text:"Listeners",disabled:!1,to:"/listeners",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/listeners-edit"}]},breadcrumbName(){return this.isCopy?"New":this.listener.name?this.listener.name:this.id?this.id:"New"}},watch:{selectedTemplate:{async handler(t){const e=await w(t).catch(s=>this.$snack.error(`Error: ${s}`));e&&(this.reset=!1,this.listenerTemplate=e,await this.$nextTick(),this.reset=!0,this.initialLoad=!0)}},id(t){t&&this.getListener(t)}},mounted(){this.$store.dispatch("listener/getListenerTemplates"),(!this.isNew||this.isCopy)&&this.getListener(this.$route.params.id)},methods:{deleteTag(t){$(this.listener.id,t.id).then(()=>{this.listener.tags=this.listener.tags.filter(e=>e.id!==t.id)}).catch(e=>this.$snack.error(`Error: ${e}`))},updateTag(t){b(this.listener.id,t).then(e=>{const s=this.listener.tags.findIndex(i=>i.id===e.id);this.listener.tags.splice(s,1,e),this.$snack.success("Tag updated")}).catch(e=>this.$snack.error(`Error: ${e}`))},addTag(t){y(this.listener.id,t).then(e=>{this.listener.tags.push(e)}).catch(e=>this.$snack.error(`Error: ${e}`))},async submit(){this.loading||!this.$refs.generalform.$refs.form.validate()||(this.loading=!0,this.id>0?n({...this.listener,options:this.form}).then(()=>{this.$snack.success("Listener updated"),this.loading=!1}).catch(t=>{t.startsWith("[*]")?this.validationMessage=t:this.$snack.error(`Error: ${t}`),this.loading=!1}):T(this.selectedTemplate,this.form).then(({id:t})=>{this.$snack.success("Listener created"),this.loading=!1,this.$router.push({name:"listenerEdit",params:{id:t}})}).catch(t=>{t.startsWith("[*]")?this.validationMessage=t:this.$snack.error(`Error: ${t}`),this.loading=!1}))},async kill(){if(await this.$root.$confirm("Delete",`Are you sure you want to kill listener ${this.form.Name}?`,{color:"red"}))try{await this.$store.dispatch("listener/killListener",this.id),this.$router.push({name:"listeners"})}catch(t){this.$snack.error(`Error: ${t}`)}},getListener(t){L(t).then(e=>{this.listener=e,this.listener.tags.forEach(s=>{s.color=s.color||"#0E0CDA"}),this.selectedTemplate=e.template}).catch(()=>{this.errorState=!0})},async toggleEnabled(t){if(this.listener.enabled=t,t===!0&&!await this.$root.$confirm("","Re-enabling the listener will also save any unsaved option changes.",{color:"yellow"})){this.listener.enabled=!t;return}try{const e=await n({...this.listener,options:this.form});this.listener=e}catch(e){this.listener.enabled=!t,this.$snack.error(`Error: ${e}`)}}}};var O=function(){var e=this,s=e._self._c;return s("div",[s(m,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"disable-submit":!e.canEdit&&e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.kill}},[s("template",{slot:"extra-stuff"},[!e.isNew&&e.initialLoad?s(S,{staticClass:"mt-6 mr-2",attrs:{color:"green",label:"Enabled"},on:{change:e.toggleEnabled},model:{value:e.listener.enabled,callback:function(i){e.$set(e.listener,"enabled",i)},expression:"listener.enabled"}}):e._e(),!e.isNew&&e.initialLoad?s(I,{attrs:{"offset-y":"","open-on-hover":""},scopedSlots:e._u([{key:"activator",fn:function({on:i,attrs:r}){return[s(v,e._g(e._b({staticClass:"mr-5",attrs:{text:"",icon:"",small:""}},"v-btn",r,!1),i),[s(E,[e._v("fa-suitcase-rolling")])],1)]}}],null,!1,265209208)},[s(N,{staticClass:"ml-2 mr-2"},[e._l(e.commonStagers,function(i,r){return s(a,{key:r,attrs:{link:"",to:{name:"stagerNew",query:{template:i,listener:e.listener.name}}}},[s(o,[e._v(" "+e._s(i)+" ")])],1)}),s(x),s(a,{attrs:{link:"",to:{name:"stagerNew"}}},[s(o,[e._v(" Other ")])],1)],2)],1):e._e()],1)],2),s("div",{staticClass:"headers"},[s("h3",[e._v(e._s(e.mode)+" Listener")])]),e.isNew?e._e():s(p,{attrs:{tags:e.listener.tags},on:{"update-tag":e.updateTag,"delete-tag":e.deleteTag,"new-tag":e.addTag}}),e.errorState?s(d,{attrs:{"resource-id":e.id,"resource-type":"listener"}}):s(C,{staticStyle:{padding:"10px"}},[s(c,{staticClass:"info-viewer",attrs:{info:e.listenerInfo}}),s(u,{attrs:{items:e.listenerTemplateIds,loading:!e.reset,dense:"",outlined:"",label:"Type",readonly:!e.canEdit},model:{value:e.selectedTemplate,callback:function(i){e.selectedTemplate=i},expression:"selectedTemplate"}}),e.validationMessage?s(h,{attrs:{prominent:"",type:"warning"}},[s(_,{attrs:{align:"center"}},[s(f,{staticClass:"grow",staticStyle:{"word-wrap":"word-break",width:"500px"}},[e._v(" "+e._s(e.validationMessage)+" ")])],1)],1):e._e(),e.reset?s(l,{ref:"generalform",attrs:{options:e.listenerOptions,priority:e.formPriorities,readonly:!e.canEdit},model:{value:e.form,callback:function(i){e.form=i},expression:"form"}}):e._e()],1)],1)},V=[],P=k(M,O,V,!1,null,null,null,null);const Y=P.exports;export{Y as default}; diff --git a/dist/assets/ListenerEdit.7898b931.js b/dist/assets/ListenerEdit.7898b931.js new file mode 100644 index 0000000..d2bddc1 --- /dev/null +++ b/dist/assets/ListenerEdit.7898b931.js @@ -0,0 +1 @@ +import{_ as l,a as m}from"./GeneralForm.fe5154ff.js";import{_ as c}from"./InfoViewer.448169ad.js";import{_ as d,a as h,b as _,c as f}from"./ErrorStateAlert.5e9140da.js";import{_ as p}from"./TagViewer.a3da6a20.js";import{_ as u}from"./EditPageTop.30f77a9c.js";import{aH as g,aI as w,q as y,u as $,r as b,aJ as n,aK as T,aL as L,n as v,p as k,b as E,c as x,g as N,h as a,i as o,l as C,f as S}from"./index.85262dd3.js";import{_ as I}from"./VSwitch.8a27782c.js";import"./VSelect.8543571f.js";import"./VExpansionPanels.d99facd5.js";import"./VExpansionPanelHeader.1232ca65.js";import"./TooltipButton.6f10f736.js";import"./VTooltip.0c849a74.js";import"./VBreadcrumbs.32f4f2d0.js";const M={name:"ListenerEdit",components:{TagViewer:p,InfoViewer:c,GeneralForm:l,ErrorStateAlert:d,EditPageTop:u},data(){return{listener:{options:{}},listenerTemplate:{options:{}},selectedTemplate:"",form:{},reset:!0,loading:!1,formPriorities:["Name","Host","Port"],errorState:!1,validationMessage:null,initialLoad:!1,commonStagers:["multi_launcher","multi_macro","windows_csharp_exe","windows_dll","windows_shellcode"]}},computed:{...g({listenerTemplateIds:"listener/templateIds"}),isNew(){return this.$route.name==="listenerNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"View"},canEdit(){return this.isNew||!this.listener.enabled},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"listenerNew",params:{copy:!0,id:this.id}}:{}},listenerInfo(){if(!this.listenerTemplate)return{};const t=this.listenerTemplate;return{authors:t.authors,description:t.description,comments:t.comments}},listenerOptions(){if(!this.isNew||this.isCopy){const e={};return Object.keys(this.listener.options).forEach(s=>{e[s]={...this.listenerTemplate.options[s]},e[s].value=this.listener.options[s]}),e}const{options:t}=this.listenerTemplate;return t||{}},breads(){return[{text:"Listeners",disabled:!1,to:"/listeners",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/listeners-edit"}]},breadcrumbName(){return this.isCopy?"New":this.listener.name?this.listener.name:this.id?this.id:"New"}},watch:{selectedTemplate:{async handler(t){const e=await w(t).catch(s=>this.$snack.error(`Error: ${s}`));e&&(this.reset=!1,this.listenerTemplate=e,await this.$nextTick(),this.reset=!0,this.initialLoad=!0)}},id(t){t&&this.getListener(t)}},mounted(){this.$store.dispatch("listener/getListenerTemplates"),(!this.isNew||this.isCopy)&&this.getListener(this.$route.params.id)},methods:{deleteTag(t){y(this.listener.id,t.id).then(()=>{this.listener.tags=this.listener.tags.filter(e=>e.id!==t.id)}).catch(e=>this.$snack.error(`Error: ${e}`))},updateTag(t){$(this.listener.id,t).then(e=>{const s=this.listener.tags.findIndex(i=>i.id===e.id);this.listener.tags.splice(s,1,e),this.$snack.success("Tag updated")}).catch(e=>this.$snack.error(`Error: ${e}`))},addTag(t){b(this.listener.id,t).then(e=>{this.listener.tags.push(e)}).catch(e=>this.$snack.error(`Error: ${e}`))},async submit(){this.loading||!this.$refs.generalform.$refs.form.validate()||(this.loading=!0,this.id>0?n({...this.listener,options:this.form}).then(()=>{this.$snack.success("Listener updated"),this.loading=!1}).catch(t=>{t.startsWith("[*]")?this.validationMessage=t:this.$snack.error(`Error: ${t}`),this.loading=!1}):T(this.selectedTemplate,this.form).then(({id:t})=>{this.$snack.success("Listener created"),this.loading=!1,this.$router.push({name:"listenerEdit",params:{id:t}})}).catch(t=>{t.startsWith("[*]")?this.validationMessage=t:this.$snack.error(`Error: ${t}`),this.loading=!1}))},async kill(){if(await this.$root.$confirm("Delete",`Are you sure you want to kill listener ${this.form.Name}?`,{color:"red"}))try{await this.$store.dispatch("listener/killListener",this.id),this.$router.push({name:"listeners"})}catch(t){this.$snack.error(`Error: ${t}`)}},getListener(t){L(t).then(e=>{this.listener=e,this.listener.tags.forEach(s=>{s.color=s.color||"#0E0CDA"}),this.selectedTemplate=e.template}).catch(()=>{this.errorState=!0})},async toggleEnabled(t){if(this.listener.enabled=t,t===!0&&!await this.$root.$confirm("","Re-enabling the listener will also save any unsaved option changes.",{color:"yellow"})){this.listener.enabled=!t;return}try{const e=await n({...this.listener,options:this.form});this.listener=e}catch(e){this.listener.enabled=!t,this.$snack.error(`Error: ${e}`)}}}};var O=function(){var e=this,s=e._self._c;return s("div",[s(u,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"disable-submit":!e.canEdit&&e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.kill},scopedSlots:e._u([{key:"extra-stuff",fn:function(){return[s("div",{staticClass:"pt-2",staticStyle:{display:"flex","flex-direction":"row"}},[!e.isNew&&e.initialLoad?s(I,{staticClass:"mr-2",attrs:{color:"green",label:"Enabled"},on:{change:e.toggleEnabled},model:{value:e.listener.enabled,callback:function(i){e.$set(e.listener,"enabled",i)},expression:"listener.enabled"}}):e._e(),!e.isNew&&e.initialLoad?s(k,{attrs:{"offset-y":"","open-on-hover":""},scopedSlots:e._u([{key:"activator",fn:function({on:i,attrs:r}){return[s(E,e._g(e._b({staticClass:"mr-5",attrs:{text:"",icon:"",small:""}},"v-btn",r,!1),i),[s(x,[e._v("fa-suitcase-rolling")])],1)]}}],null,!1,265209208)},[s(N,{staticClass:"ml-2 mr-2"},[e._l(e.commonStagers,function(i,r){return s(a,{key:r,attrs:{link:"",to:{name:"stagerNew",query:{template:i,listener:e.listener.name}}}},[s(o,[e._v(" "+e._s(i)+" ")])],1)}),s(C),s(a,{attrs:{link:"",to:{name:"stagerNew"}}},[s(o,[e._v(" Other ")])],1)],2)],1):e._e()],1)]},proxy:!0}])}),s("div",{staticClass:"headers"},[s("h3",[e._v(e._s(e.mode)+" Listener")])]),e.isNew?e._e():s(p,{attrs:{tags:e.listener.tags},on:{"update-tag":e.updateTag,"delete-tag":e.deleteTag,"new-tag":e.addTag}}),e.errorState?s(d,{attrs:{"resource-id":e.id,"resource-type":"listener"}}):s(S,{staticStyle:{padding:"10px"}},[s(c,{staticClass:"info-viewer",attrs:{info:e.listenerInfo}}),s(m,{attrs:{items:e.listenerTemplateIds,loading:!e.reset,dense:"",outlined:"",label:"Type",readonly:!e.canEdit},model:{value:e.selectedTemplate,callback:function(i){e.selectedTemplate=i},expression:"selectedTemplate"}}),e.validationMessage?s(h,{attrs:{prominent:"",type:"warning"}},[s(_,{attrs:{align:"center"}},[s(f,{staticClass:"grow",staticStyle:{"word-wrap":"word-break",width:"500px"}},[e._v(" "+e._s(e.validationMessage)+" ")])],1)],1):e._e(),e.reset?s(l,{ref:"generalform",attrs:{options:e.listenerOptions,priority:e.formPriorities,readonly:!e.canEdit},model:{value:e.form,callback:function(i){e.form=i},expression:"form"}}):e._e()],1)],1)},P=[],V=v(M,O,P,!1,null,null,null,null);const Q=V.exports;export{Q as default}; diff --git a/dist/assets/ListenerEdit.e3b0c442.css b/dist/assets/ListenerEdit.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/Listeners.3486a304.js b/dist/assets/Listeners.3486a304.js deleted file mode 100644 index d17c7ad..0000000 --- a/dist/assets/Listeners.3486a304.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as c}from"./DateTimeDisplay.97700a4a.js";import{_ as u}from"./ListPageTop.dad49f81.js";import{h as f}from"./moment.9709ab41.js";import{m as C,e as D,T as E,f as M,C as A,g as O,h as m,c as r,i as p,n as d,j as R,b as v,k as b,l as n,V as l,o as y,p as N,u as X,q as V,r as _}from"./index.154e9cc6.js";import{_ as $}from"./VDataTable.71ce8bb9.js";import{_ as k}from"./VSelect.27a57f2b.js";import{_ as x}from"./TagViewer.b07ca85a.js";import{T as q}from"./index.41ea8dd2.js";import{_ as T}from"./ExpansionPanelFilter.5838fe52.js";import{_ as w}from"./AdvancedTable.65916e9e.js";import{g as F}from"./tag-api.5e19879c.js";import{_ as Y,a as h,b as z,c as g}from"./VTabItem.9e30abd4.js";import"./VTooltip.b258437e.js";import"./index.27090f0f.js";import"./VBreadcrumbs.a2278375.js";import"./VExpansionPanelHeader.d8fbc23c.js";import"./VExpansionPanels.1f915cd7.js";const H=C(A,M(["left","bottom"]),E,D,q).extend({name:"v-badge",props:{avatar:Boolean,bordered:Boolean,color:{type:String,default:"primary"},content:{required:!1},dot:Boolean,label:{type:String,default:"$vuetify.badge"},icon:String,inline:Boolean,offsetX:[Number,String],offsetY:[Number,String],overlap:Boolean,tile:Boolean,transition:{type:String,default:"scale-rotate-transition"},value:{default:!0}},computed:{classes(){return{"v-badge--avatar":this.avatar,"v-badge--bordered":this.bordered,"v-badge--bottom":this.bottom,"v-badge--dot":this.dot,"v-badge--icon":this.icon!=null,"v-badge--inline":this.inline,"v-badge--left":this.left,"v-badge--overlap":this.overlap,"v-badge--tile":this.tile,...this.themeClasses}},computedBottom(){return this.bottom?"auto":this.computedYOffset},computedLeft(){return this.isRtl?this.left?this.computedXOffset:"auto":this.left?"auto":this.computedXOffset},computedRight(){return this.isRtl?this.left?"auto":this.computedXOffset:this.left?this.computedXOffset:"auto"},computedTop(){return this.bottom?this.computedYOffset:"auto"},computedXOffset(){return this.calcPosition(this.offsetX)},computedYOffset(){return this.calcPosition(this.offsetY)},isRtl(){return this.$vuetify.rtl},offset(){return this.overlap?this.dot?8:12:this.dot?2:4},styles(){return this.inline?{}:{bottom:this.computedBottom,left:this.computedLeft,right:this.computedRight,top:this.computedTop}}},methods:{calcPosition(s){return`calc(100% - ${O(s||this.offset)})`},genBadge(){const s=this.$vuetify.lang,e=this.$attrs["aria-label"]||s.t(this.label),t=this.setBackgroundColor(this.color,{staticClass:"v-badge__badge",style:this.styles,attrs:{"aria-atomic":this.$attrs["aria-atomic"]||"true","aria-label":e,"aria-live":this.$attrs["aria-live"]||"polite",title:this.$attrs.title,role:this.$attrs.role||"status"},directives:[{name:"show",value:this.isActive}]}),a=this.$createElement("span",t,[this.genBadgeContent()]);return this.transition?this.$createElement("transition",{props:{name:this.transition,origin:this.origin,mode:this.mode}},[a]):a},genBadgeContent(){if(this.dot)return;const s=m(this,"badge");if(s)return s;if(this.content)return String(this.content);if(this.icon)return this.$createElement(r,this.icon)},genBadgeWrapper(){return this.$createElement("span",{staticClass:"v-badge__wrapper"},[this.genBadge()])}},render(s){const e=[this.genBadgeWrapper()],t=[m(this)],{"aria-atomic":a,"aria-label":i,"aria-live":o,role:le,title:oe,...B}=this.$attrs;return this.inline&&this.left?t.unshift(e):t.push(e),s("span",{staticClass:"v-badge",attrs:B,class:this.classes},t)}});const I={name:"MalleableProfiles",components:{DateTimeDisplay:c,ListPageTop:u},props:{active:{type:Boolean,default:!0}},data(){return{breads:[{text:"Listeners",disabled:!0,href:"/listeners"},{text:"Malleable Profiles",disabled:!0,href:"/malleable-profiles"}],headers:[{text:"Name",value:"name"},{text:"Category",value:"category"},{text:"Updated At",value:"updated_at"},{text:"Actions",value:"actions",sortable:!1}],sortBy:"name",sortDesc:!1,moment:f,filter:"",selected:[]}},computed:{...p({malleableProfiles:s=>s.malleable.malleableProfiles}),showDelete(){return this.selected.length>0}},mounted(){this.getMalleableProfiles()},methods:{getMalleableProfiles(){this.$store.dispatch("malleable/getMalleableProfiles")},create(){this.$router.push({name:"malleableProfileNew"})},view(s){this.$router.push({name:"malleableProfileEdit",params:{id:s.id}})},async deleteMalleableProfile(s){await this.$root.$confirm("Delete",`Are you sure you want to delete profile ${s.name}?`,{color:"red"})&&this.$store.dispatch("malleable/deleteMalleableProfile",s.id)},async deleteMalleableProfiles(){await this.$root.$confirm("Delete",`Are you sure you want to delete ${this.selected.length} profiles?`,{color:"red"})&&(this.selected.forEach(s=>{this.$store.dispatch("malleable/deleteMalleableProfile",s.id)}),this.selected=[])}}};var U=function(){var e=this,t=e._self._c;return t("div",[e.active?t(u,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"show-delete":e.showDelete},on:{create:e.create,delete:e.deleteMalleableProfiles,refresh:e.getMalleableProfiles}},[t("template",{slot:"extra-stuff"},[t(R,{staticStyle:{"max-width":"250px","padding-top":"25px"},attrs:{"append-icon":"mdi-magnify",outlined:"",dense:"",label:"Search"},model:{value:e.filter,callback:function(a){e.filter=a},expression:"filter"}})],1)],2):e._e(),t($,{attrs:{headers:e.headers,items:e.malleableProfiles,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"name",search:e.filter,dense:"","show-select":"","sort-by":e.sortBy,"sort-desc":e.sortDesc},on:{"update:sortBy":function(a){e.sortBy=a},"update:sort-by":function(a){e.sortBy=a},"update:sortDesc":function(a){e.sortDesc=a},"update:sort-desc":function(a){e.sortDesc=a}},scopedSlots:e._u([{key:"item.name",fn:function({item:a}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"malleableProfileEdit",params:{id:a.id}}}},[e._v(" "+e._s(a.name)+" ")])]}},{key:"item.updated_at",fn:function({item:a}){return[t(c,{attrs:{timestamp:a.updated_at}})]}},{key:"item.actions",fn:function({item:a}){return[t(k,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:i,attrs:o}){return[t(v,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",o,!1),i),[t(r,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(b,{staticClass:"ml-2 mr-2"},[t(n,{key:"view",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"malleableProfileEdit",params:{id:a.id}}}},[t(l,[t(r,[e._v("fa-binoculars")]),e._v(" View ")],1)],1)],1),t(n,{key:"copy",attrs:{to:{name:"malleableProfileNew",params:{copy:!0,id:a.id}},link:""}},[t(l,[t(r,[e._v("fa-clone")]),e._v(" Copy ")],1)],1),t(y,{staticClass:"pb-4"}),t(n,{key:"delete",attrs:{link:""},on:{click:function(i){return e.deleteMalleableProfile(a)}}},[t(l,[t(r,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(a){e.selected=a},expression:"selected"}})],1)},W=[],j=d(I,U,W,!1,null,null,null,null);const L=j.exports;const G={name:"ListenersTable",components:{DateTimeDisplay:c,TagViewer:x},props:{input:{type:Array,default:()=>[]},selectedTags:{type:Array,default:()=>[]}},data(){return{moment:f,headers:[{text:"",align:"start",sortable:!1,width:"5px",value:"enabled"},{text:"Name",value:"name"},{text:"Template",value:"template"},{text:"Host",value:"options.Host"},{text:"Port",value:"options.Port"},{text:"Created At",value:"created_at"},{text:"Tags",value:"tags",sortable:!1},{text:"Actions",value:"actions",sortable:!1}],selected:[]}},computed:{...p({listeners:s=>s.listener.listeners,listenersStatus:s=>s.listener.status}),sortedListeners(){let s=this.listeners.slice();return this.selectedTags.length===0||(s=s.filter(e=>e.tags.map(a=>`${a.name}:${a.value}`).some(a=>this.selectedTags.includes(a)))),s}},watch:{selectedTags(){this.getListeners()},selected(s){this.$emit("input",s)}},mounted(){this.getListeners()},methods:{deleteTag(s,e){N(s.id,e.id).then(()=>{s.tags=s.tags.filter(t=>t.id!==e.id),this.$emit("refresh-tags")}).catch(t=>this.$snack.error(`Error: ${t}`))},updateTag(s,e){X(s.id,e).then(t=>{const a=s.tags.findIndex(i=>i.id===t.id);s.tags.splice(a,1,t),this.$emit("refresh-tags"),this.$snack.success("Tag updated")}).catch(t=>this.$snack.error(`Error: ${t}`))},addTag(s,e){V(s.id,e).then(t=>{s.tags.push(t),this.$emit("refresh-tags")}).catch(t=>this.$snack.error(`Error: ${t}`))},async killListener(s){this.$emit("kill-listener",s)},getListeners(){this.$store.dispatch("listener/getListeners")}}};var J=function(){var e=this,t=e._self._c;return t("div",[t($,{attrs:{loading:e.listenersStatus==="loading",headers:e.headers,items:e.sortedListeners,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"id",dense:"","show-select":""},scopedSlots:e._u([{key:"item.enabled",fn:function({item:a}){return[t(H,{attrs:{dot:"",color:a.enabled===!0?"green":"red"}})]}},{key:"item.name",fn:function({item:a}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"listenerEdit",params:{id:a.id}}}},[e._v(" "+e._s(a.name)+" ")])]}},{key:"item.created_at",fn:function({item:a}){return[t(c,{attrs:{timestamp:a.created_at}})]}},{key:"item.tags",fn:function({item:a}){return[t(x,{attrs:{tags:a.tags},on:{"update-tag":function(i){return e.updateTag(a,...arguments)},"delete-tag":function(i){return e.deleteTag(a,...arguments)},"new-tag":function(i){return e.addTag(a,...arguments)}}})]}},{key:"item.actions",fn:function({item:a}){return[t(k,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:i,attrs:o}){return[t(v,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",o,!1),i),[t(r,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(b,{staticClass:"ml-2 mr-2"},[t(n,{key:"view",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"listenerEdit",params:{id:a.id}}}},[t(l,[t(r,[e._v("fa-binoculars")]),e._v(" View ")],1)],1)],1),t(n,{key:"copy",attrs:{to:{name:"listenerNew",params:{copy:!0,id:a.id}},link:""}},[t(l,[t(r,[e._v("fa-clone")]),e._v(" Copy ")],1)],1),t(y,{staticClass:"pb-4"}),t(n,{key:"delete",attrs:{link:""},on:{click:function(i){return e.killListener(a)}}},[t(l,[t(r,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(a){e.selected=a},expression:"selected"}})],1)},K=[],Q=d(G,J,K,!1,null,null,null,null);const P=Q.exports;const Z={name:"Listeners",components:{AdvancedTable:w,ListenersTable:P,ExpansionPanelFilter:T,ListPageTop:u},props:{active:{type:Boolean,default:!0}},data(){return{moment:f,breads:[{text:"Listeners",disabled:!0,href:"/listeners"},{text:"List",disabled:!0,href:"/listeners?tab=list-view"}],selected:[],tags:[],selectedTags:[]}},computed:{...p({listeners:s=>s.listener.listeners,listenersStatus:s=>s.listener.status}),showDelete(){return this.selected.length>0}},mounted(){this.getListeners(),this.getTags()},methods:{async getTags(){const s=await F({page:1,limit:-1,sources:"listener"}),e=[];s.records.forEach(t=>{e.find(i=>i.name===t.name&&i.value===t.value)||e.push(t)}),this.tags=e},create(){this.$router.push({name:"listenerNew"})},async killListener(s){await this.$root.$confirm("Delete",`Are you sure you want to kill listener ${s.name}?`,{color:"red"})&&this.$store.dispatch("listener/killListener",s.id)},async killListeners(){await this.$root.$confirm("Delete",`Are you sure you want to kill ${this.selected.length} listeners?`,{color:"red"})&&(this.selected.forEach(s=>{this.$store.dispatch("listener/killListener",s.id)}),this.selected=[])},getListeners(){this.$refs.listenersTable.getListeners()}}};var ee=function(){var e=this,t=e._self._c;return t("div",{},[e.active?t(u,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"refresh-loading":e.listenersStatus==="loading","show-delete":e.showDelete},on:{create:e.create,delete:e.killListeners,refresh:e.getListeners}}):e._e(),t(w,{scopedSlots:e._u([{key:"filters",fn:function(){return[t(T,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(a){e.selectedTags=a},expression:"selectedTags"}})]},proxy:!0},{key:"table",fn:function(){return[t(P,{ref:"listenersTable",attrs:{"selected-tags":e.selectedTags},on:{"kill-listener":e.killListener},model:{value:e.selected,callback:function(a){e.selected=a},expression:"selected"}})]},proxy:!0}])})],1)},te=[],se=d(Z,ee,te,!1,null,null,null,null);const S=se.exports;const ae={name:"Listeners",components:{ListenersList:S,MalleableProfilesList:L},data(){return{}},computed:{tab:{set(s){this.$router.replace({query:{...this.$route.query,tab:s}})},get(){return this.$route.query.tab||"list-view"}}}};var ie=function(){var e=this,t=e._self._c;return t("div",[t("portal",{attrs:{to:"app-bar-extension"}},[t("div",{staticStyle:{display:"flex","flex-direction":"row",width:"100%"}},[t(Y,{attrs:{"align-with-title":""},model:{value:e.tab,callback:function(a){e.tab=a},expression:"tab"}},[t(h,{key:"list-view",attrs:{href:"#list-view"}},[e._v(" List "),t(r,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-list ")])],1),t(h,{key:"malleable-profiles",attrs:{href:"#malleable-profiles"}},[e._v(" Malleable Profiles "),t(r,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-random ")])],1)],1)],1)]),t(z,{model:{value:e.tab,callback:function(a){e.tab=a},expression:"tab"}},[t(g,{key:"list-view",attrs:{value:"list-view",transition:!1,"reverse-transition":!1}},[t(_,{attrs:{flat:""}},[t(S,{attrs:{active:e.tab==="list-view"}})],1)],1),t(g,{key:"malleable-profiles",attrs:{value:"malleable-profiles",transition:!1,"reverse-transition":!1}},[t(_,{attrs:{flat:""}},[t(L,{attrs:{active:e.tab==="malleable-profiles"}})],1)],1)],1)],1)},re=[],ne=d(ae,ie,re,!1,null,null,null,null);const Le=ne.exports;export{Le as default}; diff --git a/dist/assets/Listeners.c37e5213.css b/dist/assets/Listeners.c37e5213.css new file mode 100644 index 0000000..fd45391 --- /dev/null +++ b/dist/assets/Listeners.c37e5213.css @@ -0,0 +1 @@ +.warning-row{background-color:#fcc}.v-data-table.theme--dark .warning-row{background-color:#bd4c4c}.v-toolbar__content>div>.v-tabs>.v-slide-group.v-tabs-bar,.v-toolbar__extension>div>.v-tabs>.v-slide-group.v-tabs-bar{background-color:inherit} diff --git a/dist/assets/Listeners.db43a360.css b/dist/assets/Listeners.db43a360.css deleted file mode 100644 index 04c0f09..0000000 --- a/dist/assets/Listeners.db43a360.css +++ /dev/null @@ -1 +0,0 @@ -.theme--light.v-badge .v-badge__badge:after{border-color:#fff}.theme--dark.v-badge .v-badge__badge:after{border-color:#1e1e1e}.v-badge{display:inline-block;line-height:1;position:relative}.v-badge__badge{border-radius:10px;color:#fff;display:inline-block;font-size:12px;height:20px;letter-spacing:0;line-height:1;min-width:20px;padding:4px 6px;pointer-events:auto;position:absolute;text-align:center;text-indent:0;top:auto;transition:.3s cubic-bezier(.25,.8,.5,1);white-space:nowrap}.v-application--is-ltr .v-badge__badge{right:auto}.v-application--is-rtl .v-badge__badge{left:auto}.v-badge__badge .v-icon{color:inherit;font-size:12px;height:12px;margin:0 -2px;width:12px}.v-badge__badge .v-img{height:12px;width:12px}.v-badge__wrapper{flex:0 1;height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}.v-badge--avatar .v-badge__badge{padding:0}.v-badge--avatar .v-badge__badge .v-avatar{height:20px!important;min-width:0!important;max-width:20px!important}.v-badge--bordered .v-badge__badge:after{border-radius:inherit;border-width:2px;border-style:solid;bottom:0;content:"";left:0;position:absolute;right:0;top:0;transform:scale(1.15)}.v-badge--dot .v-badge__badge{border-radius:4.5px;height:9px;min-width:0;padding:0;width:9px}.v-badge--dot .v-badge__badge:after{border-width:1.5px}.v-badge--icon .v-badge__badge{padding:4px 6px}.v-badge--inline{align-items:center;display:inline-flex;justify-content:center}.v-badge--inline .v-badge__badge,.v-badge--inline .v-badge__wrapper{position:relative}.v-badge--inline .v-badge__wrapper{margin:0 4px}.v-badge--tile .v-badge__badge{border-radius:0}.warning-row{background-color:#fcc}.v-data-table.theme--dark .warning-row{background-color:#bd4c4c}.v-toolbar__content>div>.v-tabs>.v-slide-group.v-tabs-bar,.v-toolbar__extension>div>.v-tabs>.v-slide-group.v-tabs-bar{background-color:inherit} diff --git a/dist/assets/Listeners.f4b93a81.js b/dist/assets/Listeners.f4b93a81.js new file mode 100644 index 0000000..57f98c5 --- /dev/null +++ b/dist/assets/Listeners.f4b93a81.js @@ -0,0 +1 @@ +import{_ as o}from"./DateTimeDisplay.c35d52fb.js";import{_ as c}from"./ListPageTop.2a204a11.js";import{h as _}from"./moment.9709ab41.js";import{e as p,n as u,o as D,p as h,b as v,c as r,g as b,h as n,i,l as y,q as S,u as M,r as C,s as E,f as m}from"./index.85262dd3.js";import{_ as k}from"./VDataTable.125536b6.js";import{_ as $}from"./TagViewer.a3da6a20.js";import{_ as x}from"./ExpansionPanelFilter.8ec031fa.js";import{_ as w}from"./AdvancedTable.8f5cf108.js";import{g as A}from"./tag-api.d2d18349.js";import{_ as B,a as f,b as N,c as g}from"./VTabItem.35a0348a.js";import"./VTooltip.0c849a74.js";import"./VBreadcrumbs.32f4f2d0.js";import"./VSelect.8543571f.js";import"./VExpansionPanelHeader.1232ca65.js";import"./VExpansionPanels.d99facd5.js";const F={name:"MalleableProfiles",components:{DateTimeDisplay:o,ListPageTop:c},props:{active:{type:Boolean,default:!0}},data(){return{breads:[{text:"Listeners",disabled:!0,href:"/listeners"},{text:"Malleable Profiles",disabled:!0,href:"/malleable-profiles"}],headers:[{text:"Name",value:"name"},{text:"Category",value:"category"},{text:"Updated At",value:"updated_at"},{text:"Actions",value:"actions",sortable:!1}],sortBy:"name",sortDesc:!1,moment:_,filter:"",selected:[]}},computed:{...p({malleableProfiles:a=>a.malleable.malleableProfiles}),showDelete(){return this.selected.length>0}},mounted(){this.getMalleableProfiles()},methods:{getMalleableProfiles(){this.$store.dispatch("malleable/getMalleableProfiles")},create(){this.$router.push({name:"malleableProfileNew"})},view(a){this.$router.push({name:"malleableProfileEdit",params:{id:a.id}})},async deleteMalleableProfile(a){await this.$root.$confirm("Delete",`Are you sure you want to delete profile ${a.name}?`,{color:"red"})&&this.$store.dispatch("malleable/deleteMalleableProfile",a.id)},async deleteMalleableProfiles(){await this.$root.$confirm("Delete",`Are you sure you want to delete ${this.selected.length} profiles?`,{color:"red"})&&(this.selected.forEach(a=>{this.$store.dispatch("malleable/deleteMalleableProfile",a.id)}),this.selected=[])}}};var q=function(){var e=this,t=e._self._c;return t("div",[e.active?t(c,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"show-delete":e.showDelete},on:{create:e.create,delete:e.deleteMalleableProfiles,refresh:e.getMalleableProfiles}},[t("template",{slot:"extra-stuff"},[t(D,{staticStyle:{"max-width":"250px","padding-top":"25px"},attrs:{"append-icon":"mdi-magnify",outlined:"",dense:"",label:"Search"},model:{value:e.filter,callback:function(s){e.filter=s},expression:"filter"}})],1)],2):e._e(),t(k,{attrs:{headers:e.headers,items:e.malleableProfiles,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"name",search:e.filter,dense:"","show-select":"","sort-by":e.sortBy,"sort-desc":e.sortDesc},on:{"update:sortBy":function(s){e.sortBy=s},"update:sort-by":function(s){e.sortBy=s},"update:sortDesc":function(s){e.sortDesc=s},"update:sort-desc":function(s){e.sortDesc=s}},scopedSlots:e._u([{key:"item.name",fn:function({item:s}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"malleableProfileEdit",params:{id:s.id}}}},[e._v(" "+e._s(s.name)+" ")])]}},{key:"item.updated_at",fn:function({item:s}){return[t(o,{attrs:{timestamp:s.updated_at}})]}},{key:"item.actions",fn:function({item:s}){return[t(h,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:l,attrs:d}){return[t(v,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",d,!1),l),[t(r,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(b,{staticClass:"ml-2 mr-2"},[t(n,{key:"view",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"malleableProfileEdit",params:{id:s.id}}}},[t(i,[t(r,[e._v("fa-binoculars")]),e._v(" View ")],1)],1)],1),t(n,{key:"copy",attrs:{to:{name:"malleableProfileNew",params:{copy:!0,id:s.id}},link:""}},[t(i,[t(r,[e._v("fa-clone")]),e._v(" Copy ")],1)],1),t(y,{staticClass:"pb-4"}),t(n,{key:"delete",attrs:{link:""},on:{click:function(l){return e.deleteMalleableProfile(s)}}},[t(i,[t(r,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(s){e.selected=s},expression:"selected"}})],1)},R=[],V=u(F,q,R,!1,null,null,null,null);const T=V.exports;const H={name:"ListenersTable",components:{DateTimeDisplay:o,TagViewer:$},props:{input:{type:Array,default:()=>[]},selectedTags:{type:Array,default:()=>[]}},data(){return{moment:_,headers:[{text:"",align:"start",sortable:!1,width:"5px",value:"enabled"},{text:"Name",value:"name"},{text:"Template",value:"template"},{text:"Host",value:"options.Host"},{text:"Port",value:"options.Port"},{text:"Created At",value:"created_at"},{text:"Tags",value:"tags",sortable:!1},{text:"Actions",value:"actions",sortable:!1}],selected:[]}},computed:{...p({listeners:a=>a.listener.listeners,listenersStatus:a=>a.listener.status}),sortedListeners(){let a=this.listeners.slice();return this.selectedTags.length===0||(a=a.filter(e=>e.tags.map(s=>`${s.name}:${s.value}`).some(s=>this.selectedTags.includes(s)))),a}},watch:{selectedTags(){this.getListeners()},selected(a){this.$emit("input",a)}},mounted(){this.getListeners()},methods:{deleteTag(a,e){S(a.id,e.id).then(()=>{a.tags=a.tags.filter(t=>t.id!==e.id),this.$emit("refresh-tags")}).catch(t=>this.$snack.error(`Error: ${t}`))},updateTag(a,e){M(a.id,e).then(t=>{const s=a.tags.findIndex(l=>l.id===t.id);a.tags.splice(s,1,t),this.$emit("refresh-tags"),this.$snack.success("Tag updated")}).catch(t=>this.$snack.error(`Error: ${t}`))},addTag(a,e){C(a.id,e).then(t=>{a.tags.push(t),this.$emit("refresh-tags")}).catch(t=>this.$snack.error(`Error: ${t}`))},async killListener(a){this.$emit("kill-listener",a)},getListeners(){this.$store.dispatch("listener/getListeners")}}};var I=function(){var e=this,t=e._self._c;return t("div",[t(k,{attrs:{loading:e.listenersStatus==="loading",headers:e.headers,items:e.sortedListeners,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"id",dense:"","show-select":""},scopedSlots:e._u([{key:"item.enabled",fn:function({item:s}){return[t(E,{attrs:{dot:"",color:s.enabled===!0?"green":"red"}})]}},{key:"item.name",fn:function({item:s}){return[t("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"listenerEdit",params:{id:s.id}}}},[e._v(" "+e._s(s.name)+" ")])]}},{key:"item.created_at",fn:function({item:s}){return[t(o,{attrs:{timestamp:s.created_at}})]}},{key:"item.tags",fn:function({item:s}){return[t($,{attrs:{tags:s.tags},on:{"update-tag":function(l){return e.updateTag(s,...arguments)},"delete-tag":function(l){return e.deleteTag(s,...arguments)},"new-tag":function(l){return e.addTag(s,...arguments)}}})]}},{key:"item.actions",fn:function({item:s}){return[t(h,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:l,attrs:d}){return[t(v,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",d,!1),l),[t(r,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(b,{staticClass:"ml-2 mr-2"},[t(n,{key:"view",attrs:{link:""}},[t("router-link",{staticClass:"text-decoration-none",staticStyle:{color:"inherit"},attrs:{to:{name:"listenerEdit",params:{id:s.id}}}},[t(i,[t(r,[e._v("fa-binoculars")]),e._v(" View ")],1)],1)],1),t(n,{key:"copy",attrs:{to:{name:"listenerNew",params:{copy:!0,id:s.id}},link:""}},[t(i,[t(r,[e._v("fa-clone")]),e._v(" Copy ")],1)],1),t(y,{staticClass:"pb-4"}),t(n,{key:"delete",attrs:{link:""},on:{click:function(l){return e.killListener(s)}}},[t(i,[t(r,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(s){e.selected=s},expression:"selected"}})],1)},O=[],z=u(H,I,O,!1,null,null,null,null);const L=z.exports;const U={name:"Listeners",components:{AdvancedTable:w,ListenersTable:L,ExpansionPanelFilter:x,ListPageTop:c},props:{active:{type:Boolean,default:!0}},data(){return{moment:_,breads:[{text:"Listeners",disabled:!0,href:"/listeners"},{text:"List",disabled:!0,href:"/listeners?tab=list-view"}],selected:[],tags:[],selectedTags:[]}},computed:{...p({listeners:a=>a.listener.listeners,listenersStatus:a=>a.listener.status}),showDelete(){return this.selected.length>0}},mounted(){this.getListeners(),this.getTags()},methods:{async getTags(){const a=await A({page:1,limit:-1,sources:"listener"}),e=[];a.records.forEach(t=>{e.find(l=>l.name===t.name&&l.value===t.value)||e.push(t)}),this.tags=e},create(){this.$router.push({name:"listenerNew"})},async killListener(a){await this.$root.$confirm("Delete",`Are you sure you want to kill listener ${a.name}?`,{color:"red"})&&this.$store.dispatch("listener/killListener",a.id)},async killListeners(){await this.$root.$confirm("Delete",`Are you sure you want to kill ${this.selected.length} listeners?`,{color:"red"})&&(this.selected.forEach(a=>{this.$store.dispatch("listener/killListener",a.id)}),this.selected=[])},getListeners(){this.$refs.listenersTable.getListeners()}}};var j=function(){var e=this,t=e._self._c;return t("div",{},[e.active?t(c,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"refresh-loading":e.listenersStatus==="loading","show-delete":e.showDelete},on:{create:e.create,delete:e.killListeners,refresh:e.getListeners}}):e._e(),t(w,{scopedSlots:e._u([{key:"filters",fn:function(){return[t(x,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(s){e.selectedTags=s},expression:"selectedTags"}})]},proxy:!0},{key:"table",fn:function(){return[t(L,{ref:"listenersTable",attrs:{"selected-tags":e.selectedTags},on:{"kill-listener":e.killListener},model:{value:e.selected,callback:function(s){e.selected=s},expression:"selected"}})]},proxy:!0}])})],1)},G=[],J=u(U,j,G,!1,null,null,null,null);const P=J.exports;const K={name:"Listeners",components:{ListenersList:P,MalleableProfilesList:T},data(){return{}},computed:{tab:{set(a){this.$router.replace({query:{...this.$route.query,tab:a}})},get(){return this.$route.query.tab||"list-view"}}}};var Q=function(){var e=this,t=e._self._c;return t("div",[t("portal",{attrs:{to:"app-bar-extension"}},[t("div",{staticStyle:{display:"flex","flex-direction":"row",width:"100%"}},[t(B,{attrs:{"align-with-title":""},model:{value:e.tab,callback:function(s){e.tab=s},expression:"tab"}},[t(f,{key:"list-view",attrs:{href:"#list-view"}},[e._v(" List "),t(r,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-list ")])],1),t(f,{key:"malleable-profiles",attrs:{href:"#malleable-profiles"}},[e._v(" Malleable Profiles "),t(r,{staticClass:"ml-1",attrs:{"x-small":""}},[e._v(" fa-random ")])],1)],1)],1)]),t(N,{model:{value:e.tab,callback:function(s){e.tab=s},expression:"tab"}},[t(g,{key:"list-view",attrs:{value:"list-view",transition:!1,"reverse-transition":!1}},[t(m,{attrs:{flat:""}},[t(P,{attrs:{active:e.tab==="list-view"}})],1)],1),t(g,{key:"malleable-profiles",attrs:{value:"malleable-profiles",transition:!1,"reverse-transition":!1}},[t(m,{attrs:{flat:""}},[t(T,{attrs:{active:e.tab==="malleable-profiles"}})],1)],1)],1)],1)},W=[],X=u(K,Q,W,!1,null,null,null,null);const pe=X.exports;export{pe as default}; diff --git a/dist/assets/MalleableProfileEdit.43012048.js b/dist/assets/MalleableProfileEdit.43012048.js deleted file mode 100644 index 414ffda..0000000 --- a/dist/assets/MalleableProfileEdit.43012048.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as l}from"./ErrorStateAlert.3518d55f.js";import{_ as s}from"./EditPageTop.0db28cea.js";import{n as o,bF as n,bG as d,bH as u,z as m,r as c,aE as f,j as i}from"./index.154e9cc6.js";import{_ as h}from"./VTextarea.7a9da2ee.js";import"./index.41ea8dd2.js";import"./TooltipButton.6022e185.js";import"./VTooltip.b258437e.js";import"./index.27090f0f.js";import"./VBreadcrumbs.a2278375.js";const p={name:"MalleableProfileEdit",components:{ErrorStateAlert:l,EditPageTop:s},data(){return{form:{},rules:{name:[t=>!!t||"Name is required",t=>!!t&&t.length>3||"Name must be larger than 3 characters"],category:[t=>!!t||"Category is required"],code:[t=>!!t||"Code is required"]},malleableProfile:{},valid:!0,loading:!1,errorState:!1,initialLoad:!1}},computed:{isNew(){return this.$route.name==="malleableProfileNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"View"},canEdit(){return!0},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"malleableProfileNew",params:{copy:!0,id:this.id}}:{}},breads(){return[{text:"Listeners",disabled:!0,to:"/listeners",exact:!0},{text:"Malleable Profiles",disabled:!1,to:"/listeners?tab=malleable-profiles",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/malleable-profiles-edit"}]},breadcrumbName(){return this.isCopy?"New":this.malleableProfile.name?this.malleableProfile.name:this.id?this.id:"New"}},watch:{id(t){t&&this.getMalleableProfile(t)}},mounted(){!this.isNew||this.isCopy?this.getMalleableProfile(this.$route.params.id):this.initialLoad=!0},methods:{async submit(){this.loading||!this.$refs.form.validate()||(this.loading=!0,this.id>0?n(this.id,this.form.data).then(()=>{this.$snack.success("Malleable Profile updated"),this.loading=!1}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}):d(this.form.name,this.form.category,this.form.data).then(({id:t})=>{this.$snack.success("Malleable Profile created"),this.loading=!1,this.$router.push({name:"malleableProfileEdit",params:{id:t}})}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}))},async deleteMalleableProfile(){if(await this.$root.$confirm("Delete",`Are you sure you want to delete profile ${this.form.name}?`,{color:"red"}))try{await this.$store.dispatch("malleable/deleteMalleableProfile",this.form.name),this.$router.push({name:"malleableProfiles"})}catch(t){this.$snack.error(`Error: ${t}`)}},getMalleableProfile(t){u(t).then(e=>{this.malleableProfile=e,this.initialLoad=!0,m.set(this,"form",{...e})}).catch(()=>{this.errorState=!0})}}};var b=function(){var e=this,a=e._self._c;return a("div",[a(s,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"disable-submit":!e.canEdit&&e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading&&e.initialLoad,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.deleteMalleableProfile}}),a("div",{staticClass:"headers"},[a("h3",[e._v(e._s(e.mode)+" Malleable Profile")])]),e.errorState?a(l,{attrs:{"resource-id":e.id,"resource-type":"malleableProfile"}}):a(c,{staticStyle:{padding:"10px"}},[a(f,{ref:"form",staticStyle:{"max-width":"500px"},nativeOn:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}},model:{value:e.valid,callback:function(r){e.valid=r},expression:"valid"}},[a(i,{attrs:{rules:e.rules.name,label:"name",outlined:"",dense:"",required:"",disabled:!e.isNew},model:{value:e.form.name,callback:function(r){e.$set(e.form,"name",r)},expression:"form.name"}}),a(i,{attrs:{rules:e.rules.category,label:"category",outlined:"",dense:"",required:"",disabled:!e.isNew},model:{value:e.form.category,callback:function(r){e.$set(e.form,"category",r)},expression:"form.category"}}),a(h,{attrs:{rules:e.rules.code,label:"code",outlined:"",dense:"",required:"","auto-grow":""},model:{value:e.form.data,callback:function(r){e.$set(e.form,"data",r)},expression:"form.data"}})],1)],1)],1)},_=[],g=o(p,b,_,!1,null,null,null,null);const E=g.exports;export{E as default}; diff --git a/dist/assets/MalleableProfileEdit.75b27d01.js b/dist/assets/MalleableProfileEdit.75b27d01.js new file mode 100644 index 0000000..19e32e3 --- /dev/null +++ b/dist/assets/MalleableProfileEdit.75b27d01.js @@ -0,0 +1 @@ +import{_ as l}from"./ErrorStateAlert.5e9140da.js";import{_ as s}from"./EditPageTop.30f77a9c.js";import{n as o,bJ as n,bK as d,bL as u,D as m,f as c,aB as f,o as i}from"./index.85262dd3.js";import{_ as h}from"./VTextarea.aac91b1e.js";import"./TooltipButton.6f10f736.js";import"./VTooltip.0c849a74.js";import"./VBreadcrumbs.32f4f2d0.js";const p={name:"MalleableProfileEdit",components:{ErrorStateAlert:l,EditPageTop:s},data(){return{form:{},rules:{name:[t=>!!t||"Name is required",t=>!!t&&t.length>3||"Name must be larger than 3 characters"],category:[t=>!!t||"Category is required"],code:[t=>!!t||"Code is required"]},malleableProfile:{},valid:!0,loading:!1,errorState:!1,initialLoad:!1}},computed:{isNew(){return this.$route.name==="malleableProfileNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"View"},canEdit(){return!0},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"malleableProfileNew",params:{copy:!0,id:this.id}}:{}},breads(){return[{text:"Listeners",disabled:!0,to:"/listeners",exact:!0},{text:"Malleable Profiles",disabled:!1,to:"/listeners?tab=malleable-profiles",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/malleable-profiles-edit"}]},breadcrumbName(){return this.isCopy?"New":this.malleableProfile.name?this.malleableProfile.name:this.id?this.id:"New"}},watch:{id(t){t&&this.getMalleableProfile(t)}},mounted(){!this.isNew||this.isCopy?this.getMalleableProfile(this.$route.params.id):this.initialLoad=!0},methods:{async submit(){this.loading||!this.$refs.form.validate()||(this.loading=!0,this.id>0?n(this.id,this.form.data).then(()=>{this.$snack.success("Malleable Profile updated"),this.loading=!1}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}):d(this.form.name,this.form.category,this.form.data).then(({id:t})=>{this.$snack.success("Malleable Profile created"),this.loading=!1,this.$router.push({name:"malleableProfileEdit",params:{id:t}})}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}))},async deleteMalleableProfile(){if(await this.$root.$confirm("Delete",`Are you sure you want to delete profile ${this.form.name}?`,{color:"red"}))try{await this.$store.dispatch("malleable/deleteMalleableProfile",this.form.name),this.$router.push({name:"malleableProfiles"})}catch(t){this.$snack.error(`Error: ${t}`)}},getMalleableProfile(t){u(t).then(e=>{this.malleableProfile=e,this.initialLoad=!0,m.set(this,"form",{...e})}).catch(()=>{this.errorState=!0})}}};var b=function(){var e=this,a=e._self._c;return a("div",[a(s,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"disable-submit":!e.canEdit&&e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading&&e.initialLoad,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.deleteMalleableProfile}}),a("div",{staticClass:"headers"},[a("h3",[e._v(e._s(e.mode)+" Malleable Profile")])]),e.errorState?a(l,{attrs:{"resource-id":e.id,"resource-type":"malleableProfile"}}):a(c,{staticStyle:{padding:"10px"}},[a(f,{ref:"form",staticStyle:{"max-width":"500px"},nativeOn:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}},model:{value:e.valid,callback:function(r){e.valid=r},expression:"valid"}},[a(i,{attrs:{rules:e.rules.name,label:"name",outlined:"",dense:"",required:"",disabled:!e.isNew},model:{value:e.form.name,callback:function(r){e.$set(e.form,"name",r)},expression:"form.name"}}),a(i,{attrs:{rules:e.rules.category,label:"category",outlined:"",dense:"",required:"",disabled:!e.isNew},model:{value:e.form.category,callback:function(r){e.$set(e.form,"category",r)},expression:"form.category"}}),a(h,{attrs:{rules:e.rules.code,label:"code",outlined:"",dense:"",required:"","auto-grow":""},model:{value:e.form.data,callback:function(r){e.$set(e.form,"data",r)},expression:"form.data"}})],1)],1)],1)},_=[],g=o(p,b,_,!1,null,null,null,null);const N=g.exports;export{N as default}; diff --git a/dist/assets/MalleableProfileEdit.e3b0c442.css b/dist/assets/MalleableProfileEdit.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/ModuleExecute.8ecdfe9e.js b/dist/assets/ModuleExecute.8ecdfe9e.js new file mode 100644 index 0000000..5c202c2 --- /dev/null +++ b/dist/assets/ModuleExecute.8ecdfe9e.js @@ -0,0 +1 @@ +import{_ as o}from"./AgentExecuteModule.05011db5.js";import{_ as n}from"./EditPageTop.30f77a9c.js";import{e as m,n as u,f as l}from"./index.85262dd3.js";import{a as r}from"./GeneralForm.fe5154ff.js";import"./TechniqueChips.6a91dd2f.js";import"./VSelect.8543571f.js";import"./InfoViewer.448169ad.js";import"./VExpansionPanels.d99facd5.js";import"./VExpansionPanelHeader.1232ca65.js";import"./ErrorStateAlert.5e9140da.js";import"./VDataTable.125536b6.js";import"./TooltipButton.6f10f736.js";import"./VTooltip.0c849a74.js";import"./VBreadcrumbs.32f4f2d0.js";import"./VSwitch.8a27782c.js";const i={name:"ModuleExecute",components:{AgentExecuteModule:o,EditPageTop:n},data(){return{selectedAgents:[],moduleName:""}},computed:{...m({agents:s=>s.agent.agents.filter(e=>e.archived===!1&&e.stale===!1)}),breads(){return[{text:"Modules",disabled:!1,to:"/modules",exact:!0},{text:`${this.moduleName}`,disabled:!0,to:"/modules/execute"}]}},mounted(){this.getAgents(),this.moduleName=this.$route.params.id},methods:{submit(){this.$refs.executeform.create()},moduleChange(s){this.moduleName=s,this.$router.push({name:"moduleExecute",params:{id:s}})},getAgents(){this.$store.dispatch("agent/getAgents")},clearAgents(){this.selectedAgents=[]}}};var d=function(){var e=this,t=e._self._c;return t("div",{staticClass:"p4"},[t(n,{attrs:{breads:e.breads,"show-submit":!0},on:{submit:e.submit}}),t("h4",{staticClass:"pl-4 pb-4"},[e._v("Execute Module")]),t(r,{attrs:{dense:"",outlined:"",chips:"",multiple:"",placeholder:"Agents",items:e.agents,"item-text":"name","item-value":"name"},model:{value:e.selectedAgents,callback:function(a){e.selectedAgents=a},expression:"selectedAgents"}}),t(l,[t(o,{ref:"executeform",attrs:{"module-name":e.moduleName,agents:e.selectedAgents,"show-submit":!1},on:{moduleChange:e.moduleChange,submitted:e.clearAgents}})],1)],1)},c=[],p=u(i,d,c,!1,null,null,null,null);const k=p.exports;export{k as default}; diff --git a/dist/assets/ModuleExecute.c42c2c52.js b/dist/assets/ModuleExecute.c42c2c52.js deleted file mode 100644 index d9e4f27..0000000 --- a/dist/assets/ModuleExecute.c42c2c52.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o}from"./AgentExecuteModule.cd5c09de.js";import{_ as n}from"./EditPageTop.0db28cea.js";import{i as a,n as r,r as u}from"./index.154e9cc6.js";import{a as l}from"./GeneralForm.6b452c3e.js";import"./TechniqueChips.5e972795.js";import"./VSelect.27a57f2b.js";import"./index.27090f0f.js";import"./InfoViewer.ad34ab3b.js";import"./VExpansionPanels.1f915cd7.js";import"./VExpansionPanelHeader.d8fbc23c.js";import"./ErrorStateAlert.3518d55f.js";import"./index.41ea8dd2.js";import"./VDataTable.71ce8bb9.js";import"./TooltipButton.6022e185.js";import"./VTooltip.b258437e.js";import"./VBreadcrumbs.a2278375.js";import"./download-api.dfe5301b.js";import"./VSwitch.4adac3f4.js";const i={name:"ModuleExecute",components:{AgentExecuteModule:o,EditPageTop:n},data(){return{selectedAgents:[],moduleName:""}},computed:{...a({agents:s=>s.agent.agents.filter(e=>e.archived===!1&&e.stale===!1)}),breads(){return[{text:"Modules",disabled:!1,to:"/modules",exact:!0},{text:`${this.moduleName}`,disabled:!0,to:"/modules/execute"}]}},mounted(){this.getAgents(),this.moduleName=this.$route.params.id},methods:{submit(){this.$refs.executeform.create()},moduleChange(s){this.moduleName=s,this.$router.push({name:"moduleExecute",params:{id:s}})},getAgents(){this.$store.dispatch("agent/getAgents")},clearAgents(){this.selectedAgents=[]}}};var d=function(){var e=this,t=e._self._c;return t("div",{staticClass:"p4"},[t(n,{attrs:{breads:e.breads,"show-submit":!0},on:{submit:e.submit}}),t("h4",{staticClass:"pl-4 pb-4"},[e._v(" Execute Module ")]),t(l,{attrs:{dense:"",outlined:"",chips:"",multiple:"",placeholder:"Agents",items:e.agents,"item-text":"name","item-value":"name"},model:{value:e.selectedAgents,callback:function(m){e.selectedAgents=m},expression:"selectedAgents"}}),t(u,[t(o,{ref:"executeform",attrs:{"module-name":e.moduleName,agents:e.selectedAgents,"show-submit":!1},on:{moduleChange:e.moduleChange,submitted:e.clearAgents}})],1)],1)},p=[],c=r(i,d,p,!1,null,null,null,null);const P=c.exports;export{P as default}; diff --git a/dist/assets/ModuleExecute.e3b0c442.css b/dist/assets/ModuleExecute.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/Modules.3b195f50.js b/dist/assets/Modules.3b195f50.js new file mode 100644 index 0000000..f3f197f --- /dev/null +++ b/dist/assets/Modules.3b195f50.js @@ -0,0 +1 @@ +import{_ as i}from"./TechniqueChips.6a91dd2f.js";import{e as m,n as u}from"./index.85262dd3.js";import{_ as r}from"./VSelect.8543571f.js";import{_ as p}from"./VDataTable.125536b6.js";import{_ as o}from"./ExpansionPanelFilter.8ec031fa.js";import{_ as f}from"./ExpansionPanelSearch.252e89f2.js";import{_ as d}from"./AdvancedTable.8f5cf108.js";import{_ as c}from"./ListPageTop.2a204a11.js";import{_ as g}from"./VSwitch.8a27782c.js";import"./VExpansionPanelHeader.1232ca65.js";import"./VExpansionPanels.d99facd5.js";import"./VBreadcrumbs.32f4f2d0.js";const h={name:"ModulesTable",components:{TechniqueChips:i},props:{showIds:{type:Boolean,default:!1},search:{type:String,default:""},needsAdmin:{type:Array,default:()=>[]},opsecSafe:{type:Array,default:()=>[]},background:{type:Array,default:()=>[]},selectedLanguages:{type:Array,default:()=>[]}},data(){return{}},computed:{...m({modules:s=>s.module.modules}),languagesUnique(){return[...new Set(this.modules.map(s=>s.language.toLowerCase()))]},headers(){const s=[{text:"Name",value:"name"},{text:"Language",value:"language",sort:this.sortLanguage},{text:"Needs Admin",value:"needs_admin",width:"75px"},{text:"Opsec Safe",value:"opsec_safe",width:"75px"},{text:"Background",value:"background",width:"75px"},{text:"Techniques",value:"techniques",width:"300px",sortable:!1}];return this.showIds&&s.unshift({text:"id",align:"start",value:"id"}),s},filteredModules(){let s=this.modules;return this.search&&(s=s.filter(e=>{const n=this.search.toLowerCase();return e.name.toLowerCase().includes(n)||e.id.toLowerCase().includes(n)||e.language.toLowerCase().includes(n)||e.description.toLowerCase().includes(n)})),s=s.filter(e=>this.needsAdmin.includes(e.needs_admin)).filter(e=>this.opsecSafe.includes(e.opsec_safe)).filter(e=>this.background.includes(e.background)).filter(e=>this.selectedLanguages.includes(e.language.toLowerCase())),s}},watch:{languagesUnique(s){this.$emit("languages-changed",s)}},mounted(){this.$store.dispatch("module/getModules")},methods:{sortLanguage(s,e){return s==null?-1:e==null?1:s.toLowerCase().localeCompare(e.toLowerCase())}}};var v=function(){var e=this,n=e._self._c;return n("div",[n(p,{attrs:{headers:e.headers,items:e.filteredModules,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"id","show-expand":"",dense:""},scopedSlots:e._u([{key:"item.id",fn:function({item:t}){return[n("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"moduleExecute",params:{id:t.id}}}},[e._v(" "+e._s(t.id)+" ")])]}},{key:"item.name",fn:function({item:t}){return[n("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"moduleExecute",params:{id:t.id}}}},[e._v(" "+e._s(t.name)+" ")])]}},{key:"item.techniques",fn:function({item:t}){return[n(i,{attrs:{techniques:t.techniques,"show-title":!1}})]}},{key:"item.needs_admin",fn:function({item:t}){return[n(r,{attrs:{disabled:""},model:{value:t.needs_admin,callback:function(a){e.$set(t,"needs_admin",a)},expression:"item.needs_admin"}})]}},{key:"item.opsec_safe",fn:function({item:t}){return[n(r,{attrs:{disabled:""},model:{value:t.opsec_safe,callback:function(a){e.$set(t,"opsec_safe",a)},expression:"item.opsec_safe"}})]}},{key:"item.background",fn:function({item:t}){return[n(r,{attrs:{disabled:""},model:{value:t.background,callback:function(a){e.$set(t,"background",a)},expression:"item.background"}})]}},{key:"expanded-item",fn:function({headers:t,item:a}){return[n("td",{attrs:{colspan:t.length}},[n("div",{staticClass:"d-flex flex-column"},[n("b",[e._v("Description:")]),e._v(" "+e._s(a.description)+" ")])])]}}])})],1)},b=[],x=u(h,v,b,!1,null,null,null,null);const _=x.exports;const k={name:"ExpansionPanelBoolean",components:{ExpansionPanelFilter:o},props:{value:{type:Array,default:()=>[]},title:{type:String,required:!0},emptyDefault:{type:Boolean,default:!1}},data(){return{selectedItems:[],items:[{value:!0,label:"True"},{value:!1,label:"False"}]}},watch:{selectedItems:{handler(s){this.$emit("input",s)}}}};var y=function(){var e=this,n=e._self._c;return n(o,{attrs:{title:e.title,label:"label","item-key":"value","item-value":"value",items:e.items,"empty-default":e.emptyDefault},model:{value:e.selectedItems,callback:function(t){e.selectedItems=t},expression:"selectedItems"}})},w=[],S=u(k,y,w,!1,null,null,null,null);const l=S.exports;const L={name:"Modules",components:{ExpansionPanelBoolean:l,ExpansionPanelFilter:o,AdvancedTable:d,ModulesTable:_,ListPageTop:c},data(){return{search:"",breads:[{text:"Modules",disabled:!0,href:"/modules"}],showIds:!1,needsAdmin:[],opsecSafe:[],background:[],languages:[],languageOptions:[]}},methods:{languagesChanged(s){this.languageOptions=s.map(e=>({label:e,value:e}))}}};var A=function(){var e=this,n=e._self._c;return n("div",[n(c,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!1,"show-delete":!1}}),n(d,{scopedSlots:e._u([{key:"filters",fn:function(){return[n(g,{attrs:{label:"Show IDs"},model:{value:e.showIds,callback:function(t){e.showIds=t},expression:"showIds"}}),n(f,{attrs:{title:"Search",label:"Search"},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}}),n(l,{attrs:{title:"Needs Admin"},model:{value:e.needsAdmin,callback:function(t){e.needsAdmin=t},expression:"needsAdmin"}}),n(l,{attrs:{title:"Opsec Safe"},model:{value:e.opsecSafe,callback:function(t){e.opsecSafe=t},expression:"opsecSafe"}}),n(l,{attrs:{title:"Background"},model:{value:e.background,callback:function(t){e.background=t},expression:"background"}}),n(o,{attrs:{title:"Language",label:"label","item-key":"value","item-value":"value",items:e.languageOptions},model:{value:e.languages,callback:function(t){e.languages=t},expression:"languages"}})]},proxy:!0},{key:"table",fn:function(){return[n(_,{attrs:{search:e.search,"show-ids":e.showIds,"needs-admin":e.needsAdmin,"opsec-safe":e.opsecSafe,background:e.background,"selected-languages":e.languages},on:{"languages-changed":e.languagesChanged}})]},proxy:!0}])})],1)},C=[],$=u(L,A,C,!1,null,null,null,null);const U=$.exports;export{U as default}; diff --git a/dist/assets/Modules.5fc7da1d.js b/dist/assets/Modules.5fc7da1d.js deleted file mode 100644 index a9f86e5..0000000 --- a/dist/assets/Modules.5fc7da1d.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i}from"./TechniqueChips.5e972795.js";import{i as m,n as u}from"./index.154e9cc6.js";import{a as r}from"./VSelect.27a57f2b.js";import{_ as p}from"./VDataTable.71ce8bb9.js";import{_ as o}from"./ExpansionPanelFilter.5838fe52.js";import{_ as f}from"./ExpansionPanelSearch.7dcac59a.js";import{_ as d}from"./AdvancedTable.65916e9e.js";import{_ as c}from"./ListPageTop.dad49f81.js";import{_ as g}from"./VSwitch.4adac3f4.js";import"./index.27090f0f.js";import"./VExpansionPanelHeader.d8fbc23c.js";import"./VExpansionPanels.1f915cd7.js";import"./VBreadcrumbs.a2278375.js";const h={name:"ModulesTable",components:{TechniqueChips:i},props:{showIds:{type:Boolean,default:!1},search:{type:String,default:""},needsAdmin:{type:Array,default:()=>[]},opsecSafe:{type:Array,default:()=>[]},background:{type:Array,default:()=>[]},selectedLanguages:{type:Array,default:()=>[]}},data(){return{}},computed:{...m({modules:s=>s.module.modules}),languagesUnique(){return[...new Set(this.modules.map(s=>s.language.toLowerCase()))]},headers(){const s=[{text:"Name",value:"name"},{text:"Language",value:"language",sort:this.sortLanguage},{text:"Needs Admin",value:"needs_admin",width:"75px"},{text:"Opsec Safe",value:"opsec_safe",width:"75px"},{text:"Background",value:"background",width:"75px"},{text:"Techniques",value:"techniques",width:"300px",sortable:!1}];return this.showIds&&s.unshift({text:"id",align:"start",value:"id"}),s},filteredModules(){let s=this.modules;return this.search&&(s=s.filter(e=>{const n=this.search.toLowerCase();return e.name.toLowerCase().includes(n)||e.id.toLowerCase().includes(n)||e.language.toLowerCase().includes(n)||e.description.toLowerCase().includes(n)})),s=s.filter(e=>this.needsAdmin.includes(e.needs_admin)).filter(e=>this.opsecSafe.includes(e.opsec_safe)).filter(e=>this.background.includes(e.background)).filter(e=>this.selectedLanguages.includes(e.language.toLowerCase())),s}},watch:{languagesUnique(s){this.$emit("languages-changed",s)}},mounted(){this.$store.dispatch("module/getModules")},methods:{sortLanguage(s,e){return s==null?-1:e==null?1:s.toLowerCase().localeCompare(e.toLowerCase())}}};var v=function(){var e=this,n=e._self._c;return n("div",[n(p,{attrs:{headers:e.headers,items:e.filteredModules,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,"item-key":"id","show-expand":"",dense:""},scopedSlots:e._u([{key:"item.id",fn:function({item:t}){return[n("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"moduleExecute",params:{id:t.id}}}},[e._v(" "+e._s(t.id)+" ")])]}},{key:"item.name",fn:function({item:t}){return[n("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"moduleExecute",params:{id:t.id}}}},[e._v(" "+e._s(t.name)+" ")])]}},{key:"item.techniques",fn:function({item:t}){return[n(i,{attrs:{techniques:t.techniques,"show-title":!1}})]}},{key:"item.needs_admin",fn:function({item:t}){return[n(r,{attrs:{disabled:""},model:{value:t.needs_admin,callback:function(a){e.$set(t,"needs_admin",a)},expression:"item.needs_admin"}})]}},{key:"item.opsec_safe",fn:function({item:t}){return[n(r,{attrs:{disabled:""},model:{value:t.opsec_safe,callback:function(a){e.$set(t,"opsec_safe",a)},expression:"item.opsec_safe"}})]}},{key:"item.background",fn:function({item:t}){return[n(r,{attrs:{disabled:""},model:{value:t.background,callback:function(a){e.$set(t,"background",a)},expression:"item.background"}})]}},{key:"expanded-item",fn:function({headers:t,item:a}){return[n("td",{attrs:{colspan:t.length}},[n("div",{staticClass:"d-flex flex-column"},[n("b",[e._v("Description:")]),e._v(" "+e._s(a.description)+" ")])])]}}])})],1)},b=[],x=u(h,v,b,!1,null,null,null,null);const _=x.exports;const k={name:"ExpansionPanelBoolean",components:{ExpansionPanelFilter:o},props:{value:{type:Array,default:()=>[]},title:{type:String,required:!0},emptyDefault:{type:Boolean,default:!1}},data(){return{selectedItems:[],items:[{value:!0,label:"True"},{value:!1,label:"False"}]}},watch:{selectedItems:{handler(s){this.$emit("input",s)}}}};var y=function(){var e=this,n=e._self._c;return n(o,{attrs:{title:e.title,label:"label","item-key":"value","item-value":"value",items:e.items,"empty-default":e.emptyDefault},model:{value:e.selectedItems,callback:function(t){e.selectedItems=t},expression:"selectedItems"}})},w=[],S=u(k,y,w,!1,null,null,null,null);const l=S.exports;const L={name:"Modules",components:{ExpansionPanelBoolean:l,ExpansionPanelFilter:o,AdvancedTable:d,ModulesTable:_,ListPageTop:c},data(){return{search:"",breads:[{text:"Modules",disabled:!0,href:"/modules"}],showIds:!1,needsAdmin:[],opsecSafe:[],background:[],languages:[],languageOptions:[]}},methods:{languagesChanged(s){this.languageOptions=s.map(e=>({label:e,value:e}))}}};var A=function(){var e=this,n=e._self._c;return n("div",[n(c,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!1,"show-delete":!1}}),n(d,{scopedSlots:e._u([{key:"filters",fn:function(){return[n(g,{attrs:{label:"Show IDs"},model:{value:e.showIds,callback:function(t){e.showIds=t},expression:"showIds"}}),n(f,{attrs:{title:"Search",label:"Search"},model:{value:e.search,callback:function(t){e.search=t},expression:"search"}}),n(l,{attrs:{title:"Needs Admin"},model:{value:e.needsAdmin,callback:function(t){e.needsAdmin=t},expression:"needsAdmin"}}),n(l,{attrs:{title:"Opsec Safe"},model:{value:e.opsecSafe,callback:function(t){e.opsecSafe=t},expression:"opsecSafe"}}),n(l,{attrs:{title:"Background"},model:{value:e.background,callback:function(t){e.background=t},expression:"background"}}),n(o,{attrs:{title:"Language",label:"label","item-key":"value","item-value":"value",items:e.languageOptions},model:{value:e.languages,callback:function(t){e.languages=t},expression:"languages"}})]},proxy:!0},{key:"table",fn:function(){return[n(_,{attrs:{search:e.search,"show-ids":e.showIds,"needs-admin":e.needsAdmin,"opsec-safe":e.opsecSafe,background:e.background,"selected-languages":e.languages},on:{"languages-changed":e.languagesChanged}})]},proxy:!0}])})],1)},C=[],$=u(L,A,C,!1,null,null,null,null);const z=$.exports;export{z as default}; diff --git a/dist/assets/Modules.e3b0c442.css b/dist/assets/Modules.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/Notifications.362b48cb.js b/dist/assets/Notifications.362b48cb.js new file mode 100644 index 0000000..b36a750 --- /dev/null +++ b/dist/assets/Notifications.362b48cb.js @@ -0,0 +1 @@ +import{_ as a}from"./ListPageTop.2a204a11.js";import{e as _,n as r,b as e,c,f as l,g as p,h as u,V as f,i as m,j as d,k as v,l as g}from"./index.85262dd3.js";import"./VBreadcrumbs.32f4f2d0.js";const x={name:"Notifications",components:{ListPageTop:a},computed:{..._({notifications:s=>s.application.notifications})},beforeDestroy(){this.$store.dispatch("application/markAllNotificationsAsRead")},methods:{clearNotifications(){this.$store.dispatch("application/clearNotifications")}}};var y=function(){var t=this,n=t._self._c;return n("div",[n(a,{attrs:{breads:[{text:"Notifications",disabled:!0,to:"/notifications"}]},scopedSlots:t._u([{key:"extra-stuff",fn:function(){return[n(e,{attrs:{color:"primary",text:""},on:{click:t.clearNotifications}},[t._v(" Clear "),n(c,{attrs:{right:""}},[t._v(" mdi-delete ")])],1)]},proxy:!0}])}),n(l,{staticClass:"mr-2 pa-2",staticStyle:{"flex-basis":"250px"},attrs:{elevation:"2",outlined:""}},[n(p,[t._l(t.notifications,function(o,i){return[n(u,{key:`list-'${i}`,style:o.read?"":"background-color: rgba(118, 127, 134, 0.5);",attrs:{to:o.route,link:""}},[n(f,[n(m,[t._v(" "+t._s(o.title)+" ")]),n(d,[t._v(" "+t._s(o.text)+" ")])],1),n(v,[o.route?n(e,{attrs:{color:"primary",text:"",to:o.route}},[t._v(" "+t._s(o.buttonText)+" ")]):t._e()],1)],1),n(g,{key:`divider-${i}`})]})],2)],1)],1)},b=[],h=r(x,y,b,!1,null,null,null,null);const L=h.exports;export{L as default}; diff --git a/dist/assets/Obfuscation.72032c42.js b/dist/assets/Obfuscation.72032c42.js new file mode 100644 index 0000000..efbcf1e --- /dev/null +++ b/dist/assets/Obfuscation.72032c42.js @@ -0,0 +1 @@ +import{_ as g}from"./ListPageTop.2a204a11.js";import{e as k,c7 as v,c8 as x,c9 as p,ca as K,cb as $,n as C,aP as _,f as i,aQ as l,aC as d,aR as y,aB as m,o as u,b as r,aD as f,a as b,a1 as D,c,p as P,g as S,l as T,h as w,i as h,cc as R}from"./index.85262dd3.js";import{_ as M}from"./VDataTable.125536b6.js";import{_ as O}from"./VSwitch.8a27782c.js";import"./VBreadcrumbs.32f4f2d0.js";import"./VSelect.8543571f.js";const q={components:{ListPageTop:g},data(){return{valid:!0,keywordDialog:!1,keywordDialogTitle:"",editedKeyword:{},preobfuscateDialog:!1,editedPreobfuscate:{},reobfuscate:!1,breads:[{text:"Obfuscation",disabled:!0,href:"/obfuscation"}],command:"",readonly:!1,headers:[{text:"Keyword",value:"keyword"},{text:"Replacement",value:"replacement"},{text:"Actions",value:"actions",sortable:!1,width:15}],rules:{keyword:[s=>!!s||"Keyword is required"],replacement:[s=>!!s||"Replacement is required"]}}},computed:{...k({keywords:s=>s.obfuscation.keywords,configs:s=>s.obfuscation.configs})},mounted(){this.refresh()},methods:{refresh(){this.refreshKeywords(),this.refreshConfigs()},refreshKeywords(){this.$store.dispatch("obfuscation/getKeywords")},refreshConfigs(){this.$store.dispatch("obfuscation/getConfigs")},toggleEditing(s){console.log("editing"),this.$set(s,"editing",!s.editing)},editKeyword(s){this.editedKeyword={...s},this.keywordDialogTitle="Edit Keyword",this.keywordDialog=!0},createKeyword(){this.editedKeyword={keyword:"",replacement:""},this.keywordDialogTitle="New Keyword",this.keywordDialog=!0},generateRandom(){this.editedKeyword.replacement=Math.random().toString(36).substring(2,8)},async saveKeyword(){if(!!this.$refs.form.validate())try{this.editedKeyword.id?await x(this.editedKeyword):await v(this.editedKeyword),this.refreshKeywords(),this.keywordDialog=!1}catch(s){this.$snack.error(`${s}`)}},async deleteKeyword(s){await this.$root.$confirm("Delete",`Are you sure you want to delete keyword ${s.keyword}?`,{color:"red"})&&this.$store.dispatch("obfuscation/deleteKeyword",s.id)},async editConfig(s){try{await p(s),s.preobfuscatable?this.$snack.success('Updated config. Use "preobfuscate" to re-apply obfuscation.'):this.$snack.success("Updated config.")}catch(e){this.$snack.error(`${e}`)}},openPreobfuscateDialog(s){this.editedPreobfuscate={...s},this.reobfuscate=!1,this.preobfuscateDialog=!0},async preobfuscateModules(){try{await p(this.editedPreobfuscate),await K(this.editedPreobfuscate.language,this.reobfuscate),this.$snack.info("Preobfuscation started in the background. This will take a few minutes.")}catch(s){this.$snack.error(`${s}`)}this.preobfuscateDialog=!1},async deletePreobfuscatedModules(s){if(await this.$root.$confirm("","Are you sure? This will delete all preobfuscated modules.",{color:"red",width:500}))try{await $(s.language),this.$snack.success("Preobfuscated modules deleted.")}catch(e){this.$snack.error(`${e}`)}}}};var A=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mr-6"},[t(g,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!0,"show-delete":!1},on:{refresh:e.refresh}}),t(_,{attrs:{"max-width":"500px"},model:{value:e.keywordDialog,callback:function(a){e.keywordDialog=a},expression:"keywordDialog"}},[t(i,[t(l,[t("span",{staticClass:"text-h5"},[e._v(e._s(e.keywordDialogTitle))])]),t(d,[t(y,[t(m,{ref:"form",nativeOn:{submit:function(a){return a.preventDefault(),e.saveKeyword.apply(null,arguments)}},model:{value:e.valid,callback:function(a){e.valid=a},expression:"valid"}},[t(u,{attrs:{rules:e.rules.keyword,dense:"",outlined:"",required:"",label:"Keyword"},model:{value:e.editedKeyword.keyword,callback:function(a){e.$set(e.editedKeyword,"keyword",a)},expression:"editedKeyword.keyword"}}),t(u,{attrs:{rules:e.rules.replacement,dense:"",outlined:"",required:"",label:"Replacement"},model:{value:e.editedKeyword.replacement,callback:function(a){e.$set(e.editedKeyword,"replacement",a)},expression:"editedKeyword.replacement"}}),t(r,{on:{click:e.generateRandom}},[e._v(" Random ")])],1)],1)],1),t(f,[t(b),t(r,{attrs:{color:"blue darken-1",text:""},on:{click:function(a){e.keywordDialog=!1}}},[e._v(" Cancel ")]),t(r,{attrs:{color:"blue darken-1",text:""},on:{click:e.saveKeyword}},[e._v(" Save ")])],1)],1)],1),t(_,{attrs:{"max-width":"500px"},model:{value:e.preobfuscateDialog,callback:function(a){e.preobfuscateDialog=a},expression:"preobfuscateDialog"}},[t(i,[t(l,[t("span",{staticClass:"text-h5"})]),t(d,[t("p",[e._v(' Are you sure? This will preobfuscate every module and will take a few minutes. Check "reobfuscate" if you need to force all modules to be reobfuscated after changing the global obfuscation configuration. ')]),t(y,[t(D,{attrs:{label:"Reobfuscate"},model:{value:e.reobfuscate,callback:function(a){e.reobfuscate=a},expression:"reobfuscate"}})],1)],1),t(f,[t(b),t(r,{attrs:{color:"blue darken-1",text:""},on:{click:function(a){e.preobfuscateDialog=!1}}},[e._v(" Cancel ")]),t(r,{attrs:{color:"blue darken-1",text:""},on:{click:e.preobfuscateModules}},[e._v(" Save ")])],1)],1)],1),t("div",{staticStyle:{display:"flex","flex-direction":"row","align-items":"flex-start"}},[t(i,{staticClass:"ma-2 pa-2",staticStyle:{flex:"1 0 50%"}},[t(l,[t("span",{staticStyle:{display:"flex","justify-content":"space-between",width:"100%"}},[t("span",{staticClass:"headline"},[e._v("Keyword Obfuscation")]),t(r,{attrs:{color:"primary"},on:{click:e.createKeyword}},[e._v(" Create "),t(c,{attrs:{right:""}},[e._v(" fa-plus-square ")])],1)],1)]),t(M,{attrs:{headers:e.headers,items:e.keywords},scopedSlots:e._u([{key:"item.actions",fn:function({item:a}){return[t(P,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:n,attrs:o}){return[t(r,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",o,!1),n),[t(c,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(S,{staticClass:"ml-2 mr-2"},[t(T,{staticClass:"pb-4"}),t(w,{key:"edit",attrs:{link:""},on:{click:function(n){return e.editKeyword(a)}}},[t(h,[t(c,[e._v("fa-edit")]),e._v(" Edit ")],1)],1),t(w,{key:"delete",attrs:{link:""},on:{click:function(n){return e.deleteKeyword(a)}}},[t(h,[t(c,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}])})],1),t(i,{staticClass:"ma-2 pa-2",staticStyle:{flex:"1 0 50%"}},[t(l,[t("span",[t("span",{staticClass:"headline"},[e._v("Global Obfuscation")])])]),t(d,e._l(e.configs,function(a,n){return t(i,{key:n,staticClass:"ma-2 pa-2",attrs:{outlined:""}},[t(R,[e._v(e._s(a.language))]),t(d,[t(m,[t(O,{attrs:{label:"Enabled",readonly:e.readonly},model:{value:a.enabled,callback:function(o){e.$set(a,"enabled",o)},expression:"config.enabled"}}),t(u,{attrs:{label:"Command",rules:a.language!=="csharp"?[o=>!!o||"Command is required"]:[],dense:"",outlined:"",readonly:e.readonly},model:{value:a.command,callback:function(o){e.$set(a,"command",o)},expression:"config.command"}})],1)],1),t(f,[t(r,{attrs:{color:"primary"},on:{click:function(o){return e.editConfig(a)}}},[e._v(" Save ")]),t(r,{attrs:{disabled:!a.preobfuscatable,text:"",color:"primary"},on:{click:function(o){return e.openPreobfuscateDialog(a)}}},[e._v(" Preobfuscate ")]),t(r,{attrs:{disabled:!a.preobfuscatable,text:"",color:"error"},on:{click:function(o){return e.deletePreobfuscatedModules(a)}}},[e._v(" Remove preobfuscated modules ")])],1)],1)}),1)],1)],1)],1)},V=[],E=C(q,A,V,!1,null,null,null,null);const G=E.exports;export{G as default}; diff --git a/dist/assets/Obfuscation.c3a0c7ab.js b/dist/assets/Obfuscation.c3a0c7ab.js deleted file mode 100644 index db09141..0000000 --- a/dist/assets/Obfuscation.c3a0c7ab.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as g}from"./ListPageTop.dad49f81.js";import{i as k,b_ as v,b$ as x,c0 as p,c1 as K,c2 as $,n as C,aR as _,r as i,aS as l,aF as d,aT as m,aE as y,j as u,b as r,aG as f,a as b,ad as D,c,k as P,o as S,l as w,V as h,c3 as T}from"./index.154e9cc6.js";import{_ as R}from"./VDataTable.71ce8bb9.js";import{_ as M}from"./VSelect.27a57f2b.js";import{_ as O}from"./VSwitch.4adac3f4.js";import"./VBreadcrumbs.a2278375.js";import"./index.27090f0f.js";const q={components:{ListPageTop:g},data(){return{valid:!0,keywordDialog:!1,keywordDialogTitle:"",editedKeyword:{},preobfuscateDialog:!1,editedPreobfuscate:{},reobfuscate:!1,breads:[{text:"Obfuscation",disabled:!0,href:"/obfuscation"}],command:"",readonly:!1,headers:[{text:"Keyword",value:"keyword"},{text:"Replacement",value:"replacement"},{text:"Actions",value:"actions",sortable:!1,width:15}],rules:{keyword:[s=>!!s||"Keyword is required"],replacement:[s=>!!s||"Replacement is required"]}}},computed:{...k({keywords:s=>s.obfuscation.keywords,configs:s=>s.obfuscation.configs})},mounted(){this.refresh()},methods:{refresh(){this.refreshKeywords(),this.refreshConfigs()},refreshKeywords(){this.$store.dispatch("obfuscation/getKeywords")},refreshConfigs(){this.$store.dispatch("obfuscation/getConfigs")},toggleEditing(s){console.log("editing"),this.$set(s,"editing",!s.editing)},editKeyword(s){this.editedKeyword={...s},this.keywordDialogTitle="Edit Keyword",this.keywordDialog=!0},createKeyword(){this.editedKeyword={keyword:"",replacement:""},this.keywordDialogTitle="New Keyword",this.keywordDialog=!0},generateRandom(){this.editedKeyword.replacement=Math.random().toString(36).substring(2,8)},async saveKeyword(){if(!!this.$refs.form.validate())try{this.editedKeyword.id?await x(this.editedKeyword):await v(this.editedKeyword),this.refreshKeywords(),this.keywordDialog=!1}catch(s){this.$snack.error(`${s}`)}},async deleteKeyword(s){await this.$root.$confirm("Delete",`Are you sure you want to delete keyword ${s.keyword}?`,{color:"red"})&&this.$store.dispatch("obfuscation/deleteKeyword",s.id)},async editConfig(s){try{await p(s),s.preobfuscatable?this.$snack.success('Updated config. Use "preobfuscate" to re-apply obfuscation.'):this.$snack.success("Updated config.")}catch(e){this.$snack.error(`${e}`)}},openPreobfuscateDialog(s){this.editedPreobfuscate={...s},this.reobfuscate=!1,this.preobfuscateDialog=!0},async preobfuscateModules(){try{await p(this.editedPreobfuscate),await K(this.editedPreobfuscate.language,this.reobfuscate),this.$snack.info("Preobfuscation started in the background. This will take a few minutes.")}catch(s){this.$snack.error(`${s}`)}this.preobfuscateDialog=!1},async deletePreobfuscatedModules(s){if(await this.$root.$confirm("","Are you sure? This will delete all preobfuscated modules.",{color:"red",width:500}))try{await $(s.language),this.$snack.success("Preobfuscated modules deleted.")}catch(e){this.$snack.error(`${e}`)}}}};var V=function(){var e=this,t=e._self._c;return t("div",{staticClass:"mr-6"},[t(g,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!0,"show-delete":!1},on:{refresh:e.refresh}}),t(_,{attrs:{"max-width":"500px"},model:{value:e.keywordDialog,callback:function(a){e.keywordDialog=a},expression:"keywordDialog"}},[t(i,[t(l,[t("span",{staticClass:"text-h5"},[e._v(e._s(e.keywordDialogTitle))])]),t(d,[t(m,[t(y,{ref:"form",nativeOn:{submit:function(a){return a.preventDefault(),e.saveKeyword.apply(null,arguments)}},model:{value:e.valid,callback:function(a){e.valid=a},expression:"valid"}},[t(u,{attrs:{rules:e.rules.keyword,dense:"",outlined:"",required:"",label:"Keyword"},model:{value:e.editedKeyword.keyword,callback:function(a){e.$set(e.editedKeyword,"keyword",a)},expression:"editedKeyword.keyword"}}),t(u,{attrs:{rules:e.rules.replacement,dense:"",outlined:"",required:"",label:"Replacement"},model:{value:e.editedKeyword.replacement,callback:function(a){e.$set(e.editedKeyword,"replacement",a)},expression:"editedKeyword.replacement"}}),t(r,{on:{click:e.generateRandom}},[e._v(" Random ")])],1)],1)],1),t(f,[t(b),t(r,{attrs:{color:"blue darken-1",text:""},on:{click:function(a){e.keywordDialog=!1}}},[e._v(" Cancel ")]),t(r,{attrs:{color:"blue darken-1",text:""},on:{click:e.saveKeyword}},[e._v(" Save ")])],1)],1)],1),t(_,{attrs:{"max-width":"500px"},model:{value:e.preobfuscateDialog,callback:function(a){e.preobfuscateDialog=a},expression:"preobfuscateDialog"}},[t(i,[t(l,[t("span",{staticClass:"text-h5"})]),t(d,[t("p",[e._v(' Are you sure? This will preobfuscate every module and will take a few minutes. Check "reobfuscate" if you need to force all modules to be reobfuscated after changing the global obfuscation configuration. ')]),t(m,[t(D,{attrs:{label:"Reobfuscate"},model:{value:e.reobfuscate,callback:function(a){e.reobfuscate=a},expression:"reobfuscate"}})],1)],1),t(f,[t(b),t(r,{attrs:{color:"blue darken-1",text:""},on:{click:function(a){e.preobfuscateDialog=!1}}},[e._v(" Cancel ")]),t(r,{attrs:{color:"blue darken-1",text:""},on:{click:e.preobfuscateModules}},[e._v(" Save ")])],1)],1)],1),t("div",{staticStyle:{display:"flex","flex-direction":"row","align-items":"flex-start"}},[t(i,{staticClass:"ma-2 pa-2",staticStyle:{flex:"1 0 50%"}},[t(l,[t("span",{staticStyle:{display:"flex","justify-content":"space-between",width:"100%"}},[t("span",{staticClass:"headline"},[e._v("Keyword Obfuscation")]),t(r,{attrs:{color:"primary"},on:{click:e.createKeyword}},[e._v(" Create "),t(c,{attrs:{right:""}},[e._v(" fa-plus-square ")])],1)],1)]),t(R,{attrs:{headers:e.headers,items:e.keywords},scopedSlots:e._u([{key:"item.actions",fn:function({item:a}){return[t(M,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:n,attrs:o}){return[t(r,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",o,!1),n),[t(c,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[t(P,{staticClass:"ml-2 mr-2"},[t(S,{staticClass:"pb-4"}),t(w,{key:"edit",attrs:{link:""},on:{click:function(n){return e.editKeyword(a)}}},[t(h,[t(c,[e._v("fa-edit")]),e._v(" Edit ")],1)],1),t(w,{key:"delete",attrs:{link:""},on:{click:function(n){return e.deleteKeyword(a)}}},[t(h,[t(c,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}])})],1),t(i,{staticClass:"ma-2 pa-2",staticStyle:{flex:"1 0 50%"}},[t(l,[t("span",[t("span",{staticClass:"headline"},[e._v("Global Obfuscation")])])]),t(d,e._l(e.configs,function(a,n){return t(i,{key:n,staticClass:"ma-2 pa-2",attrs:{outlined:""}},[t(T,[e._v(e._s(a.language))]),t(d,[t(y,[t(O,{attrs:{label:"Enabled",readonly:e.readonly},model:{value:a.enabled,callback:function(o){e.$set(a,"enabled",o)},expression:"config.enabled"}}),t(u,{attrs:{label:"Command",rules:a.language!=="csharp"?[o=>!!o||"Command is required"]:[],dense:"",outlined:"",readonly:e.readonly},model:{value:a.command,callback:function(o){e.$set(a,"command",o)},expression:"config.command"}})],1)],1),t(f,[t(r,{attrs:{color:"primary"},on:{click:function(o){return e.editConfig(a)}}},[e._v(" Save ")]),t(r,{attrs:{disabled:!a.preobfuscatable,text:"",color:"primary"},on:{click:function(o){return e.openPreobfuscateDialog(a)}}},[e._v(" Preobfuscate ")]),t(r,{attrs:{disabled:!a.preobfuscatable,text:"",color:"error"},on:{click:function(o){return e.deletePreobfuscatedModules(a)}}},[e._v(" Remove preobfuscated modules ")])],1)],1)}),1)],1)],1)],1)},A=[],E=C(q,V,A,!1,null,null,null,null);const N=E.exports;export{N as default}; diff --git a/dist/assets/Obfuscation.e3b0c442.css b/dist/assets/Obfuscation.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/PluginEdit.0971c1ca.js b/dist/assets/PluginEdit.0971c1ca.js deleted file mode 100644 index 1d549d7..0000000 --- a/dist/assets/PluginEdit.0971c1ca.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as l}from"./PluginTasksList.fdbea558.js";import{_ as u}from"./GeneralForm.6b452c3e.js";import{_ as p}from"./TechniqueChips.5e972795.js";import{_ as m}from"./InfoViewer.ad34ab3b.js";import{_}from"./ErrorStateAlert.3518d55f.js";import{_ as c}from"./TooltipButtonToggle.63686f71.js";import{_ as f}from"./EditPageTop.0db28cea.js";import{n as g,bQ as h,bR as d,c as r,r as n,b}from"./index.154e9cc6.js";import{_ as k,a,b as v,c as o}from"./VTabItem.9e30abd4.js";import"./TagViewer.b07ca85a.js";import"./VSelect.27a57f2b.js";import"./index.27090f0f.js";import"./DateTimeDisplay.97700a4a.js";import"./moment.9709ab41.js";import"./VTooltip.b258437e.js";import"./TooltipButton.6022e185.js";import"./index.e9f2ede5.js";import"./ansi_up.bcd3942b.js";import"./download-stager.85a6b476.js";import"./download-api.dfe5301b.js";import"./VPagination.90d5be16.js";import"./VDataTable.71ce8bb9.js";import"./VSwitch.4adac3f4.js";import"./ExpansionPanelFilter.5838fe52.js";import"./VExpansionPanelHeader.d8fbc23c.js";import"./ExpansionPanelSearch.7dcac59a.js";import"./AdvancedTable.65916e9e.js";import"./VExpansionPanels.1f915cd7.js";import"./ListPageTop.dad49f81.js";import"./VBreadcrumbs.a2278375.js";import"./tag-api.5e19879c.js";import"./index.41ea8dd2.js";const x={name:"PluginEdit",components:{InfoViewer:m,GeneralForm:u,TechniqueChips:p,EditPageTop:f,PluginTasksList:l,TooltipButtonToggle:c,ErrorStateAlert:_},data(){return{reset:!0,loading:!1,isRefreshTasks:!1,form:{},plugin:{options:{}},errorState:!1}},computed:{breads(){return[{text:"Plugins",disabled:!1,to:"/plugins",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/plugins/edit"}]},breadcrumbName(){return this.plugin.name?this.plugin.name:this.id?this.id:""},pluginInfo(){return Object.keys(this.plugin).length<1?{}:{authors:this.plugin.authors,description:this.plugin.description,comments:this.plugin.comments}},pluginOptions(){const{options:e}=this.plugin;return e||{}},id(){return this.$route.params.id},tab:{set(e){this.$router.replace({query:{...this.$route.query,tab:e}})},get(){return this.$route.query.tab||"interact"}}},mounted(){this.getPlugin(this.id)},methods:{async submit(){if(!(this.loading||!this.$refs.generalform.$refs.form.validate())){this.loading=!0;try{const e=await h(this.plugin.name,this.form);this.$snack.success(`${e.detail}`)}catch(e){this.$snack.error(`Error: ${e}`)}this.loading=!1}},getPlugin(e){d(e).then(t=>{this.reset=!1,this.plugin=t,setTimeout(()=>{this.reset=!0},500)}).catch(()=>{this.errorState=!0})}}};var y=function(){var t=this,s=t._self._c;return s("div",{staticClass:"p4"},[s("portal",{attrs:{to:"app-bar-extension"}},[s("div",{staticStyle:{display:"flex","flex-direction":"row",width:"100%"}},[s(k,{attrs:{"align-with-title":""},model:{value:t.tab,callback:function(i){t.tab=i},expression:"tab"}},[s(a,{key:"interact",attrs:{href:"#interact"}},[t._v(" Interact "),s(r,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-terminal ")])],1),s(a,{key:"tasks",attrs:{href:"#tasks"}},[t._v(" Tasks "),s(r,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-sticky-note ")])],1)],1)],1)]),s(f,{attrs:{breads:t.breads,"show-submit":!1,"show-copy":!1,"show-delete":!1,"submit-loading":t.loading},on:{submit:t.submit}},[s("template",{slot:"extra-stuff"},[s(c,{attrs:{icon:"fa-redo","button-text":t.isRefreshTasks?"On":"Off",text:"Auto-refresh tasks"},model:{value:t.isRefreshTasks,callback:function(i){t.isRefreshTasks=i},expression:"isRefreshTasks"}})],1)],2),t.errorState?s(_,{attrs:{"resource-id":t.id,"resource-type":"plugin"}}):s(v,{staticClass:"scrollable-pane",model:{value:t.tab,callback:function(i){t.tab=i},expression:"tab"}},[s(o,{key:"interact",attrs:{value:"interact",transition:!1,"reverse-transition":!1}},[s("h4",{staticClass:"pl-4 pb-4"},[t._v(" Execute Plugin ")]),s(n,{staticStyle:{padding:"10px"}},[s(m,{staticClass:"info-viewer",attrs:{info:t.pluginInfo}}),s(p,{attrs:{techniques:t.plugin.TechniqueChips}}),t.reset?s(u,{ref:"generalform",attrs:{options:t.plugin.options},model:{value:t.form,callback:function(i){t.form=i},expression:"form"}}):t._e(),s(b,{attrs:{loading:t.loading,color:"primary"},on:{click:t.submit}},[t._v(" Submit ")])],1)],1),s(o,{key:"tasks",attrs:{value:"tasks",transition:!1,"reverse-transition":!1}},[s(n,{attrs:{flat:""}},[s(l,{attrs:{plugin:t.plugin,"refresh-tasks":t.isRefreshTasks}})],1)],1)],1)],1)},T=[],P=g(x,y,T,!1,null,null,null,null);const it=P.exports;export{it as default}; diff --git a/dist/assets/PluginEdit.b8a3bc77.js b/dist/assets/PluginEdit.b8a3bc77.js new file mode 100644 index 0000000..6e30bac --- /dev/null +++ b/dist/assets/PluginEdit.b8a3bc77.js @@ -0,0 +1 @@ +import{_ as l}from"./PluginTasksList.a825df81.js";import{_ as u}from"./GeneralForm.fe5154ff.js";import{_ as p}from"./TechniqueChips.6a91dd2f.js";import{_ as m}from"./InfoViewer.448169ad.js";import{_}from"./ErrorStateAlert.5e9140da.js";import{_ as c}from"./TooltipButtonToggle.3ddc5ac1.js";import{_ as f}from"./EditPageTop.30f77a9c.js";import{n as g,bX as h,bY as d,c as r,f as n,b}from"./index.85262dd3.js";import{_ as k,a,b as v,c as o}from"./VTabItem.35a0348a.js";import"./TagViewer.a3da6a20.js";import"./VSelect.8543571f.js";import"./DateTimeDisplay.c35d52fb.js";import"./moment.9709ab41.js";import"./VTooltip.0c849a74.js";import"./TooltipButton.6f10f736.js";import"./index.c62fa657.js";import"./ansi_up.de92b8a0.js";import"./download-stager.cac59e06.js";import"./VPagination.873af1be.js";import"./VDataTable.125536b6.js";import"./VSwitch.8a27782c.js";import"./ExpansionPanelFilter.8ec031fa.js";import"./VExpansionPanelHeader.1232ca65.js";import"./ExpansionPanelSearch.252e89f2.js";import"./AdvancedTable.8f5cf108.js";import"./VExpansionPanels.d99facd5.js";import"./ListPageTop.2a204a11.js";import"./VBreadcrumbs.32f4f2d0.js";import"./tag-api.d2d18349.js";const x={name:"PluginEdit",components:{InfoViewer:m,GeneralForm:u,TechniqueChips:p,EditPageTop:f,PluginTasksList:l,TooltipButtonToggle:c,ErrorStateAlert:_},data(){return{reset:!0,loading:!1,isRefreshTasks:!1,form:{},plugin:{options:{}},errorState:!1}},computed:{breads(){return[{text:"Plugins",disabled:!1,to:"/plugins",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/plugins/edit"}]},breadcrumbName(){return this.plugin.name?this.plugin.name:this.id?this.id:""},pluginInfo(){return Object.keys(this.plugin).length<1?{}:{authors:this.plugin.authors,description:this.plugin.description,comments:this.plugin.comments}},pluginOptions(){const{options:e}=this.plugin;return e||{}},id(){return this.$route.params.id},tab:{set(e){this.$router.replace({query:{...this.$route.query,tab:e}})},get(){return this.$route.query.tab||"interact"}}},mounted(){this.getPlugin(this.id)},methods:{async submit(){if(!(this.loading||!this.$refs.generalform.$refs.form.validate())){this.loading=!0;try{const e=await h(this.plugin.name,this.form);this.$snack.success(`${e.detail}`)}catch(e){this.$snack.error(`Error: ${e}`)}this.loading=!1}},getPlugin(e){d(e).then(t=>{this.reset=!1,this.plugin=t,setTimeout(()=>{this.reset=!0},500)}).catch(()=>{this.errorState=!0})}}};var y=function(){var t=this,s=t._self._c;return s("div",{staticClass:"p4"},[s("portal",{attrs:{to:"app-bar-extension"}},[s("div",{staticStyle:{display:"flex","flex-direction":"row",width:"100%"}},[s(k,{attrs:{"align-with-title":""},model:{value:t.tab,callback:function(i){t.tab=i},expression:"tab"}},[s(a,{key:"interact",attrs:{href:"#interact"}},[t._v(" Interact "),s(r,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-terminal ")])],1),s(a,{key:"tasks",attrs:{href:"#tasks"}},[t._v(" Tasks "),s(r,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-sticky-note ")])],1)],1)],1)]),s(f,{attrs:{breads:t.breads,"show-submit":!1,"show-copy":!1,"show-delete":!1,"submit-loading":t.loading},on:{submit:t.submit}},[s("template",{slot:"extra-stuff"},[s(c,{attrs:{icon:"fa-redo","button-text":t.isRefreshTasks?"On":"Off",text:"Auto-refresh tasks"},model:{value:t.isRefreshTasks,callback:function(i){t.isRefreshTasks=i},expression:"isRefreshTasks"}})],1)],2),t.errorState?s(_,{attrs:{"resource-id":t.id,"resource-type":"plugin"}}):s(v,{staticClass:"scrollable-pane",model:{value:t.tab,callback:function(i){t.tab=i},expression:"tab"}},[s(o,{key:"interact",attrs:{value:"interact",transition:!1,"reverse-transition":!1}},[s("h4",{staticClass:"pl-4 pb-4"},[t._v("Execute Plugin")]),s(n,{staticStyle:{padding:"10px"}},[s(m,{staticClass:"info-viewer",attrs:{info:t.pluginInfo}}),s(p,{attrs:{techniques:t.plugin.TechniqueChips}}),t.reset?s(u,{ref:"generalform",attrs:{options:t.plugin.options},model:{value:t.form,callback:function(i){t.form=i},expression:"form"}}):t._e(),s(b,{attrs:{loading:t.loading,color:"primary"},on:{click:t.submit}},[t._v(" Submit ")])],1)],1),s(o,{key:"tasks",attrs:{value:"tasks",transition:!1,"reverse-transition":!1}},[s(n,{attrs:{flat:""}},[s(l,{attrs:{plugin:t.plugin,"refresh-tasks":t.isRefreshTasks}})],1)],1)],1)],1)},T=[],P=g(x,y,T,!1,null,null,null,null);const tt=P.exports;export{tt as default}; diff --git a/dist/assets/PluginTasksList.a825df81.js b/dist/assets/PluginTasksList.a825df81.js new file mode 100644 index 0000000..50e411a --- /dev/null +++ b/dist/assets/PluginTasksList.a825df81.js @@ -0,0 +1 @@ +import{_ as g}from"./TagViewer.a3da6a20.js";import{_ as h}from"./DateTimeDisplay.c35d52fb.js";import{_}from"./TooltipButton.6f10f736.js";import{n as f,bS as I,bT as w,bU as P,D as p,a_ as $,bV as l,ba as q,bW as C,b as c,bc as D,p as O,c as u,g as S,h as o,i as r,a as U,e as B}from"./index.85262dd3.js";import{h as m}from"./moment.9709ab41.js";import{l as T}from"./index.c62fa657.js";import{A}from"./ansi_up.de92b8a0.js";import{D as b}from"./download-stager.cac59e06.js";import{_ as G}from"./VPagination.873af1be.js";import{_ as F}from"./VDataTable.125536b6.js";import{_ as j}from"./VSwitch.8a27782c.js";import{_ as d}from"./ExpansionPanelFilter.8ec031fa.js";import{_ as k}from"./ExpansionPanelSearch.252e89f2.js";import{_ as x}from"./AdvancedTable.8f5cf108.js";import{_ as v}from"./ListPageTop.2a204a11.js";import{g as E}from"./tag-api.d2d18349.js";const H={name:"PluginTasksTable",components:{DateTimeDisplay:h,TagViewer:g,TooltipButton:_},mixins:[b],props:{plugin:{type:Object,required:!1,default:null},refreshTasks:{type:Boolean,default:!1},hideColumns:{type:Array,default:()=>[]},selectedPlugins:{type:Array,default:()=>[]},selectedUsers:{type:Array,default:()=>[]},selectedTags:{type:Array,default:()=>[]},search:{type:String,default:""},noFilters:{type:Boolean,default:!1}},data(){return{tasks:[],currentPage:1,totalPages:1,totalItems:0,itemsPerPage:10,loading:!1,moment:m,sortBy:"updated_at",sortDesc:!0,refreshInterval:null,expandedTasks:{},debouncedGetTasks:T(this.getTasks,500)}},computed:{headers(){return[{text:"Task ID",value:"id",sortable:!0},{text:"Status",value:"status",sortable:!0},{text:"Plugin",value:"plugin_id",sortable:!0},{text:"Task Input",value:"input",sortable:!1},{text:"Task Name",value:"task_name",sortable:!1},{text:"User",value:"username",sortable:!1},{text:"Updated At",value:"updated_at",sortable:!0},{text:"Tags",value:"tags",sortable:!1,width:400},{text:"Actions",value:"actions",sortable:!1}].filter(t=>!this.hideColumns.includes(t.value))}},watch:{refreshTasks:{handler(t){t?(this.debouncedGetTasks?this.debouncedGetTasks():this.getTasks(),this.refreshInterval=setInterval(()=>{this.debouncedGetTasks()},8e3)):clearInterval(this.refreshInterval)},immediate:!0},currentPage(){this.debouncedGetTasks()},plugin(){this.debouncedGetTasks()},selectedPlugins(){this.debouncedGetTasks()},selectedUsers(){this.debouncedGetTasks()},selectedTags(){this.debouncedGetTasks()},search(){this.debouncedGetTasks()}},async mounted(){this.debouncedGetTasks()},beforeDestroy(){clearInterval(this.refreshInterval)},methods:{stripAnsi(t){return t.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g,"")},isAnsi(t){return this.stripAnsi(t)!==t},ansiToHtml(t){return new A().ansi_to_html(t)},deleteTag(t,e){I(t.plugin_id,t.id,e.id).then(()=>{this.$set(t,"tags",t.tags.filter(s=>s.id!==e.id)),this.$emit("refresh-tags")}).catch(s=>this.$snack.error(`Error: ${s}`))},updateTag(t,e){w(t.plugin_id,t.id,e).then(s=>{const n=t.tags.findIndex(a=>a.id===s.id);t.tags.splice(n,1,s),this.$emit("refresh-tags"),this.$snack.success("Tag updated")}).catch(s=>this.$snack.error(`Error: ${s}`))},addTag(t,e){P(t.plugin_id,t.id,e).then(s=>{this.$set(t,"tags",[...t.tags,s]),this.$emit("refresh-tags")}).catch(s=>this.$snack.error(`Error: ${s}`))},truncateMessage(t){return t?t.length>30?`${t.substr(0,30)}...`:t:""},updateTaskBackgroundColor(t){t.backgroundColor==="black"?t.backgroundColor="white":t.backgroundColor="black",this.expandedTasks[t.uniqueId].backgroundColor=t.backgroundColor,p.set(this.tasks,this.tasks.indexOf(t),t)},isDownload(t){return t.downloads&&t.downloads.length>0},downloadFile(t){$(t.id)},hasOutput(t){return!!t.output},async downloadInput(t){if(t.input){if(!this.expandedTasks[t.uniqueId]){const e=await l(t.agent_id,t.id);this.expandedTasks[t.uniqueId]=e}this.downloadText(this.expandedTasks[t.uniqueId].full_input,`${t.uniqueId}-input.txt`)}},downloadOutput(t){t.output&&this.downloadText(t.output,`${t.uniqueId}-output.txt`)},async copyInput(t){if(t.input){if(!this.expandedTasks[t.uniqueId]){const e=await l(t.plugin_id,t.id);this.expandedTasks[t.uniqueId]=e}try{navigator.clipboard.writeText(this.expandedTasks[t.uniqueId].full_input)}catch{this.$snack.warn("Failed to copy to clipboard. You must be on HTTPS or localhost.")}}},copyOutput(t){if(t.output)try{navigator.clipboard.writeText(t.output)}catch{this.$snack.warn("Failed to copy to clipboard. You must be on HTTPS or localhost.")}},imageData(t,e){var n;const s=(n=this.expandedTasks[t.uniqueId])==null?void 0:n.downloads;if(s){const a=s.find(i=>i.id===e.id);if(a)return a.image}return null},async getImagesForTask(t){var e;if(!this.expandedTasks[t.uniqueId]){const s=await l(t.plugin_id,t.id);this.expandedTasks[t.uniqueId]={...this.expandedTasks[t.uniqueId],...s}}for(let s=0;s0?(this.sortBy=t.sortBy[0],this.sortDesc=t.sortDesc[0]):(this.sortBy="id",this.sortDesc=!0),this.debouncedGetTasks()},async getTasks(){if(!this.noFilters&&(this.selectedPlugins.length===0||this.selectedUsers.length===0)){this.tasks=[],this.currentPage=1,this.totalPages=1,this.totalItems=0;return}this.loading=!0;let t=null;this.selectedPlugins.length>0&&(t=this.selectedPlugins);const e=await C(t,{page:this.currentPage,limit:this.itemsPerPage,sortBy:this.sortBy,sortOrder:this.sortDesc?"desc":"asc",users:this.selectedUsers,tags:this.selectedTags,search:this.search});this.currentPage=e.page,this.totalPages=e.total_pages,this.totalItems=e.total,this.tasks=e.records.map(s=>(s.uniqueId=`${s.plugin_id}-${s.id}`,this.expandedTasks[s.uniqueId]||(this.expandedTasks[s.uniqueId]={}),this.expandedTasks[s.uniqueId].expandedInput&&(s.expandedInput=!0),this.expandedTasks[s.uniqueId].backgroundColor=this.expandedTasks[s.uniqueId].backgroundColor||"black",s.backgroundColor=this.expandedTasks[s.uniqueId].backgroundColor,this.isAnsi(s.output||"")&&(this.expandedTasks[s.uniqueId].htmlOutput=this.ansiToHtml(s.output)),s)),this.tasks=e.records,this.loading=!1}}};var L=function(){var e=this,s=e._self._c;return s("div",[s(G,{attrs:{length:e.totalPages,"total-visible":10},on:{input:e.handlePageChange},model:{value:e.currentPage,callback:function(n){e.currentPage=n},expression:"currentPage"}}),s(F,{attrs:{headers:e.headers,items:e.tasks,"item-key":"uniqueId","sort-by":e.sortBy,"sort-desc":e.sortDesc,"server-items-length":e.totalItems,"footer-props":{"items-per-page-options":[10,25,50,100]},"items-per-page":e.itemsPerPage,loading:e.loading,page:e.currentPage,"show-expand":""},on:{"update:itemsPerPage":function(n){e.itemsPerPage=n},"update:items-per-page":function(n){e.itemsPerPage=n},"update:options":e.handleOptionsChange},scopedSlots:e._u([{key:"expanded-item",fn:function({headers:n,item:a}){return[s("td",{attrs:{colspan:n.length}},[s("div",[s("div",{staticStyle:{display:"flex","justify-content":"space-between","align-items":"center"}},[s("div",[s(_,{attrs:{icon:a.expandedInput?"fa-minus":"fa-plus",text:"See Full Input","x-small":""},on:{click:function(i){return e.toggleSeeFullInput(a)}}}),a.expandedInput?s("span",[e._v("Showing full input")]):e._e()],1),s(j,{attrs:{"false-value":"white","true-value":"black",label:"Dark Background"},on:{change:function(i){return e.updateTaskBackgroundColor(a)}},model:{value:e.expandedTasks[a.uniqueId].backgroundColor,callback:function(i){e.$set(e.expandedTasks[a.uniqueId],"backgroundColor",i)},expression:"expandedTasks[item.uniqueId].backgroundColor"}})],1),s("p",[s("b",[e._v("Task Input:")])]),s("p",{class:"mono "+(e.expandedTasks[a.uniqueId].backgroundColor==="white"?"font-black":"font-white"),style:"background-color: "+e.expandedTasks[a.uniqueId].backgroundColor+";"},[e._v(" "+e._s(a.expandedInput?e.expandedTasks[a.uniqueId].full_input:a.input)+" ")]),s("p",[s("b",[e._v("Task Output:")])]),a.downloads.length>0&&a.downloads.some(i=>i.filename.match(/[^/]+(jpg|jpeg|png|gif)$/))?s("div",[s(c,{attrs:{text:"","x-small":""},on:{click:function(i){return e.getImagesForTask(a)}}},[e._v(" View Images ")]),s("div",e._l(a.downloads,function(i){return s(D,{key:i.id,attrs:{src:e.imageData(a,i),alt:i.filename,"max-width":700,contain:""}})}),1)],1):e._e(),s("div",{class:"mono "+(e.expandedTasks[a.uniqueId].backgroundColor==="white"?"font-black":"font-white"),style:"background-color: "+e.expandedTasks[a.uniqueId].backgroundColor+";"},[e.expandedTasks[a.uniqueId].htmlOutput?s("div",{domProps:{innerHTML:e._s(e.expandedTasks[a.uniqueId].htmlOutput)}}):s("div",[e._v(" "+e._s(a.output)+" ")])])])])]}},{key:"item.status",fn:function({item:n}){return[e._v(" "+e._s(n.status)+" ")]}},{key:"item.input",fn:function({item:n}){return[s("span",[e._v(e._s(e.truncateMessage(n.input)))])]}},{key:"item.task_name",fn:function({item:n}){return[s("span",[e._v(e._s(n.module_name==null?n.task_name:n.module_name))])]}},{key:"item.updated_at",fn:function({item:n}){return[s(h,{attrs:{timestamp:n.updated_at}})]}},{key:"item.tags",fn:function({item:n}){return[s(g,{attrs:{tags:n.tags},on:{"update-tag":function(a){return e.updateTag(n,...arguments)},"delete-tag":function(a){return e.deleteTag(n,...arguments)},"new-tag":function(a){return e.addTag(n,...arguments)}}})]}},{key:"item.actions",fn:function({item:n}){return[s(O,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:a,attrs:i}){return[s(c,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",i,!1),a),[s(u,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[s(S,{staticClass:"ml-2 mr-2"},[s(o,{key:"downloadInput",attrs:{link:""},on:{click:function(a){return e.downloadInput(n)}}},[s(r,[s(u,[e._v("fa-download")]),e._v(" Download Input ")],1)],1),e.hasOutput(n)?s(o,{key:"downloadOutput",attrs:{link:""},on:{click:function(a){return e.downloadOutput(n)}}},[s(r,[s(u,[e._v("fa-download")]),e._v(" Download Output ")],1)],1):e._e(),s(o,{key:"clipboardInput",attrs:{link:""},on:{click:function(a){return e.copyInput(n)}}},[s(r,[s(u,[e._v("fa-paperclip")]),e._v(" Copy Input to Clipboard ")],1)],1),e.hasOutput(n)?s(o,{key:"clipboardOutput",attrs:{link:""},on:{click:function(a){return e.copyOutput(n)}}},[s(r,[s(u,[e._v("fa-paperclip")]),e._v(" Copy Output to Clipboard ")],1)],1):e._e(),s(U),e._l(n.downloads,function(a){return s(o,{key:"download-"+a.id,attrs:{link:""},on:{click:function(i){return e.downloadFile(a)}}},[s(r,[s(u,[e._v("fa-download")]),e._v(" Download "+e._s(a.filename)+" ")],1)],1)})],2)],1)]}}])})],1)},V=[],M=f(H,L,V,!1,null,null,null,null);const y=M.exports;const R={name:"PluginTasksList",components:{AdvancedTable:x,ExpansionPanelFilter:d,ExpansionPanelSearch:k,PluginTasksTable:y,ListPageTop:v},mixins:[b],props:{plugin:{type:Object,required:!1,default:null},refreshTasks:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},data(){return{breads:[{text:"Plugins",disabled:!0,href:"/plugins"},{text:"Tasks",disabled:!0,href:"/plugins?tab=tasks"}],tasks:[],search:"",loading:!1,moment:m,selectedPlugins:[],selectedUsers:[],selectedTags:[],tags:[],debouncedGetTasks:T(this.getTasks,500)}},computed:{...B({plugins:t=>t.plugin.plugins,users:t=>{const e=t.user.users;return e.push({id:0,username:"Non-User"}),e}})},watch:{plugin:{handler(t){t&&(this.selectedPlugins=[t.session_id])},immediate:!0}},async mounted(){await Promise.all([this.$store.dispatch("plugin/getPlugins"),this.$store.dispatch("user/getUsers"),this.getTags()])},methods:{async getTags(){const t=await E({page:1,limit:-1,sources:"plugin_task"}),e=[];t.records.forEach(s=>{e.find(a=>a.name===s.name&&a.value===s.value)||e.push(s)}),this.tags=e},getTasks(){this.$refs.pluginTaskTable.debouncedGetTasks()}}};var N=function(){var e=this,s=e._self._c;return s("div",[e.active?s(v,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!0,"show-delete":!1},on:{refresh:e.getTasks}}):e._e(),s(x,{scopedSlots:e._u([{key:"filters",fn:function(){return[s(k,{attrs:{title:"Search",label:"Search"},model:{value:e.search,callback:function(n){e.search=n},expression:"search"}}),e.plugin?e._e():s(d,{attrs:{title:"Plugins",label:"name","item-key":"id","item-value":"id",items:e.plugins},model:{value:e.selectedPlugins,callback:function(n){e.selectedPlugins=n},expression:"selectedPlugins"}}),s(d,{attrs:{title:"Users",label:"username","item-key":"id","item-value":"id",items:e.users},model:{value:e.selectedUsers,callback:function(n){e.selectedUsers=n},expression:"selectedUsers"}}),s(d,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(n){e.selectedTags=n},expression:"selectedTags"}})]},proxy:!0},{key:"table",fn:function(){return[s(y,{ref:"pluginTaskTable",attrs:{plugin:e.plugin,"refresh-tasks":e.refreshTasks,"hide-columns":["id","task_name"],"selected-plugins":e.selectedPlugins,"selected-users":e.selectedUsers,"selected-tags":e.selectedTags,search:e.search},on:{"refresh-tags":e.getTags}})]},proxy:!0}])})],1)},Y=[],z=f(R,N,Y,!1,null,null,null,null);const de=z.exports;export{de as _}; diff --git a/dist/assets/PluginTasksList.fdbea558.js b/dist/assets/PluginTasksList.fdbea558.js deleted file mode 100644 index 5fb9d09..0000000 --- a/dist/assets/PluginTasksList.fdbea558.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as g}from"./TagViewer.b07ca85a.js";import{_ as h}from"./DateTimeDisplay.97700a4a.js";import{_}from"./TooltipButton.6022e185.js";import{n as f,bL as I,bM as w,bN as P,z as p,bO as l,bP as $,b as c,b9 as q,c as u,k as C,l as o,V as r,a as O,i as D}from"./index.154e9cc6.js";import{h as m}from"./moment.9709ab41.js";import{l as T}from"./index.e9f2ede5.js";import{A as B}from"./ansi_up.bcd3942b.js";import{D as b}from"./download-stager.85a6b476.js";import{b as S,d as U}from"./download-api.dfe5301b.js";import{_ as A}from"./VPagination.90d5be16.js";import{_ as G}from"./VDataTable.71ce8bb9.js";import{_ as F}from"./VSwitch.4adac3f4.js";import{_ as j}from"./VSelect.27a57f2b.js";import{_ as d}from"./ExpansionPanelFilter.5838fe52.js";import{_ as k}from"./ExpansionPanelSearch.7dcac59a.js";import{_ as x}from"./AdvancedTable.65916e9e.js";import{_ as v}from"./ListPageTop.dad49f81.js";import{g as E}from"./tag-api.5e19879c.js";const L={name:"PluginTasksTable",components:{DateTimeDisplay:h,TagViewer:g,TooltipButton:_},mixins:[b],props:{plugin:{type:Object,required:!1,default:null},refreshTasks:{type:Boolean,default:!1},hideColumns:{type:Array,default:()=>[]},selectedPlugins:{type:Array,default:()=>[]},selectedUsers:{type:Array,default:()=>[]},selectedTags:{type:Array,default:()=>[]},search:{type:String,default:""},noFilters:{type:Boolean,default:!1}},data(){return{tasks:[],currentPage:1,totalPages:1,totalItems:0,itemsPerPage:10,loading:!1,moment:m,sortBy:"updated_at",sortDesc:!0,refreshInterval:null,expandedTasks:{},debouncedGetTasks:T(this.getTasks,500)}},computed:{headers(){return[{text:"Task ID",value:"id",sortable:!0},{text:"Status",value:"status",sortable:!0},{text:"Plugin",value:"plugin_id",sortable:!0},{text:"Task Input",value:"input",sortable:!1},{text:"Task Name",value:"task_name",sortable:!1},{text:"User",value:"username",sortable:!1},{text:"Updated At",value:"updated_at",sortable:!0},{text:"Tags",value:"tags",sortable:!1,width:400},{text:"Actions",value:"actions",sortable:!1}].filter(t=>!this.hideColumns.includes(t.value))}},watch:{refreshTasks:{handler(t){t?(this.debouncedGetTasks?this.debouncedGetTasks():this.getTasks(),this.refreshInterval=setInterval(()=>{this.debouncedGetTasks()},8e3)):clearInterval(this.refreshInterval)},immediate:!0},currentPage(){this.debouncedGetTasks()},plugin(){this.debouncedGetTasks()},selectedPlugins(){this.debouncedGetTasks()},selectedUsers(){this.debouncedGetTasks()},selectedTags(){this.debouncedGetTasks()},search(){this.debouncedGetTasks()}},async mounted(){this.debouncedGetTasks()},beforeDestroy(){clearInterval(this.refreshInterval)},methods:{stripAnsi(t){return t.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g,"")},isAnsi(t){return this.stripAnsi(t)!==t},ansiToHtml(t){return new B().ansi_to_html(t)},deleteTag(t,e){I(t.plugin_id,t.id,e.id).then(()=>{this.$set(t,"tags",t.tags.filter(s=>s.id!==e.id)),this.$emit("refresh-tags")}).catch(s=>this.$snack.error(`Error: ${s}`))},updateTag(t,e){w(t.plugin_id,t.id,e).then(s=>{const n=t.tags.findIndex(a=>a.id===s.id);t.tags.splice(n,1,s),this.$emit("refresh-tags"),this.$snack.success("Tag updated")}).catch(s=>this.$snack.error(`Error: ${s}`))},addTag(t,e){P(t.plugin_id,t.id,e).then(s=>{this.$set(t,"tags",[...t.tags,s]),this.$emit("refresh-tags")}).catch(s=>this.$snack.error(`Error: ${s}`))},truncateMessage(t){return t?t.length>30?`${t.substr(0,30)}...`:t:""},updateTaskBackgroundColor(t){t.backgroundColor==="black"?t.backgroundColor="white":t.backgroundColor="black",this.expandedTasks[t.uniqueId].backgroundColor=t.backgroundColor,p.set(this.tasks,this.tasks.indexOf(t),t)},isDownload(t){return t.downloads&&t.downloads.length>0},downloadFile(t){S(t.id)},hasOutput(t){return!!t.output},async downloadInput(t){if(t.input){if(!this.expandedTasks[t.uniqueId]){const e=await l(t.agent_id,t.id);this.expandedTasks[t.uniqueId]=e}this.downloadText(this.expandedTasks[t.uniqueId].full_input,`${t.uniqueId}-input.txt`)}},downloadOutput(t){t.output&&this.downloadText(t.output,`${t.uniqueId}-output.txt`)},async copyInput(t){if(t.input){if(!this.expandedTasks[t.uniqueId]){const e=await l(t.plugin_id,t.id);this.expandedTasks[t.uniqueId]=e}try{navigator.clipboard.writeText(this.expandedTasks[t.uniqueId].full_input)}catch{this.$snack.warn("Failed to copy to clipboard. You must be on HTTPS or localhost.")}}},copyOutput(t){if(t.output)try{navigator.clipboard.writeText(t.output)}catch{this.$snack.warn("Failed to copy to clipboard. You must be on HTTPS or localhost.")}},imageData(t,e){var n;const s=(n=this.expandedTasks[t.uniqueId])==null?void 0:n.downloads;if(s){const a=s.find(i=>i.id===e.id);if(a)return a.image}return null},async getImagesForTask(t){var e;if(!this.expandedTasks[t.uniqueId]){const s=await l(t.plugin_id,t.id);this.expandedTasks[t.uniqueId]={...this.expandedTasks[t.uniqueId],...s}}for(let s=0;s0?(this.sortBy=t.sortBy[0],this.sortDesc=t.sortDesc[0]):(this.sortBy="id",this.sortDesc=!0),this.debouncedGetTasks()},async getTasks(){if(!this.noFilters&&(this.selectedPlugins.length===0||this.selectedUsers.length===0)){this.tasks=[],this.currentPage=1,this.totalPages=1,this.totalItems=0;return}this.loading=!0;let t=null;this.selectedPlugins.length>0&&(t=this.selectedPlugins);const e=await $(t,{page:this.currentPage,limit:this.itemsPerPage,sortBy:this.sortBy,sortOrder:this.sortDesc?"desc":"asc",users:this.selectedUsers,tags:this.selectedTags,search:this.search});this.currentPage=e.page,this.totalPages=e.total_pages,this.totalItems=e.total,this.tasks=e.records.map(s=>(s.uniqueId=`${s.plugin_id}-${s.id}`,this.expandedTasks[s.uniqueId]||(this.expandedTasks[s.uniqueId]={}),this.expandedTasks[s.uniqueId].expandedInput&&(s.expandedInput=!0),this.expandedTasks[s.uniqueId].backgroundColor=this.expandedTasks[s.uniqueId].backgroundColor||"black",s.backgroundColor=this.expandedTasks[s.uniqueId].backgroundColor,this.isAnsi(s.output||"")&&(this.expandedTasks[s.uniqueId].htmlOutput=this.ansiToHtml(s.output)),s)),this.tasks=e.records,this.loading=!1}}};var H=function(){var e=this,s=e._self._c;return s("div",[s(A,{attrs:{length:e.totalPages,"total-visible":10},on:{input:e.handlePageChange},model:{value:e.currentPage,callback:function(n){e.currentPage=n},expression:"currentPage"}}),s(G,{attrs:{headers:e.headers,items:e.tasks,"item-key":"uniqueId","sort-by":e.sortBy,"sort-desc":e.sortDesc,"server-items-length":e.totalItems,"footer-props":{"items-per-page-options":[10,25,50,100]},"items-per-page":e.itemsPerPage,loading:e.loading,page:e.currentPage,"show-expand":""},on:{"update:itemsPerPage":function(n){e.itemsPerPage=n},"update:items-per-page":function(n){e.itemsPerPage=n},"update:options":e.handleOptionsChange},scopedSlots:e._u([{key:"expanded-item",fn:function({headers:n,item:a}){return[s("td",{attrs:{colspan:n.length}},[s("div",[s("div",{staticStyle:{display:"flex","justify-content":"space-between","align-items":"center"}},[s("div",[s(_,{attrs:{icon:a.expandedInput?"fa-minus":"fa-plus",text:"See Full Input","x-small":""},on:{click:function(i){return e.toggleSeeFullInput(a)}}}),a.expandedInput?s("span",[e._v("Showing full input")]):e._e()],1),s(F,{attrs:{"false-value":"white","true-value":"black",label:"Dark Background"},on:{change:function(i){return e.updateTaskBackgroundColor(a)}},model:{value:e.expandedTasks[a.uniqueId].backgroundColor,callback:function(i){e.$set(e.expandedTasks[a.uniqueId],"backgroundColor",i)},expression:"expandedTasks[item.uniqueId].backgroundColor"}})],1),s("p",[s("b",[e._v("Task Input:")])]),s("p",{class:"mono "+(e.expandedTasks[a.uniqueId].backgroundColor==="white"?"font-black":"font-white"),style:"background-color: "+e.expandedTasks[a.uniqueId].backgroundColor+";"},[e._v(" "+e._s(a.expandedInput?e.expandedTasks[a.uniqueId].full_input:a.input)+" ")]),s("p",[s("b",[e._v("Task Output:")])]),a.downloads.length>0&&a.downloads.some(i=>i.filename.match(/[^/]+(jpg|jpeg|png|gif)$/))?s("div",[s(c,{attrs:{text:"","x-small":""},on:{click:function(i){return e.getImagesForTask(a)}}},[e._v(" View Images ")]),s("div",e._l(a.downloads,function(i){return s(q,{key:i.id,attrs:{src:e.imageData(a,i),alt:i.filename,"max-width":700,contain:""}})}),1)],1):e._e(),s("div",{class:"mono "+(e.expandedTasks[a.uniqueId].backgroundColor==="white"?"font-black":"font-white"),style:"background-color: "+e.expandedTasks[a.uniqueId].backgroundColor+";"},[e.expandedTasks[a.uniqueId].htmlOutput?s("div",{domProps:{innerHTML:e._s(e.expandedTasks[a.uniqueId].htmlOutput)}}):s("div",[e._v(" "+e._s(a.output)+" ")])])])])]}},{key:"item.status",fn:function({item:n}){return[e._v(" "+e._s(n.status)+" ")]}},{key:"item.input",fn:function({item:n}){return[s("span",[e._v(e._s(e.truncateMessage(n.input)))])]}},{key:"item.task_name",fn:function({item:n}){return[s("span",[e._v(e._s(n.module_name==null?n.task_name:n.module_name))])]}},{key:"item.updated_at",fn:function({item:n}){return[s(h,{attrs:{timestamp:n.updated_at}})]}},{key:"item.tags",fn:function({item:n}){return[s(g,{attrs:{tags:n.tags},on:{"update-tag":function(a){return e.updateTag(n,...arguments)},"delete-tag":function(a){return e.deleteTag(n,...arguments)},"new-tag":function(a){return e.addTag(n,...arguments)}}})]}},{key:"item.actions",fn:function({item:n}){return[s(j,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:a,attrs:i}){return[s(c,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",i,!1),a),[s(u,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[s(C,{staticClass:"ml-2 mr-2"},[s(o,{key:"downloadInput",attrs:{link:""},on:{click:function(a){return e.downloadInput(n)}}},[s(r,[s(u,[e._v("fa-download")]),e._v(" Download Input ")],1)],1),e.hasOutput(n)?s(o,{key:"downloadOutput",attrs:{link:""},on:{click:function(a){return e.downloadOutput(n)}}},[s(r,[s(u,[e._v("fa-download")]),e._v(" Download Output ")],1)],1):e._e(),s(o,{key:"clipboardInput",attrs:{link:""},on:{click:function(a){return e.copyInput(n)}}},[s(r,[s(u,[e._v("fa-paperclip")]),e._v(" Copy Input to Clipboard ")],1)],1),e.hasOutput(n)?s(o,{key:"clipboardOutput",attrs:{link:""},on:{click:function(a){return e.copyOutput(n)}}},[s(r,[s(u,[e._v("fa-paperclip")]),e._v(" Copy Output to Clipboard ")],1)],1):e._e(),s(O),e._l(n.downloads,function(a){return s(o,{key:"download-"+a.id,attrs:{link:""},on:{click:function(i){return e.downloadFile(a)}}},[s(r,[s(u,[e._v("fa-download")]),e._v(" Download "+e._s(a.filename)+" ")],1)],1)})],2)],1)]}}])})],1)},M=[],V=f(L,H,M,!1,null,null,null,null);const y=V.exports;const N={name:"PluginTasksList",components:{AdvancedTable:x,ExpansionPanelFilter:d,ExpansionPanelSearch:k,PluginTasksTable:y,ListPageTop:v},mixins:[b],props:{plugin:{type:Object,required:!1,default:null},refreshTasks:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},data(){return{breads:[{text:"Plugins",disabled:!0,href:"/plugins"},{text:"Tasks",disabled:!0,href:"/plugins?tab=tasks"}],tasks:[],search:"",loading:!1,moment:m,selectedPlugins:[],selectedUsers:[],selectedTags:[],tags:[],debouncedGetTasks:T(this.getTasks,500)}},computed:{...D({plugins:t=>t.plugin.plugins,users:t=>{const e=t.user.users;return e.push({id:0,username:"Non-User"}),e}})},watch:{plugin:{handler(t){t&&(this.selectedPlugins=[t.session_id])},immediate:!0}},async mounted(){await Promise.all([this.$store.dispatch("plugin/getPlugins"),this.$store.dispatch("user/getUsers"),this.getTags()])},methods:{async getTags(){const t=await E({page:1,limit:-1,sources:"plugin_task"}),e=[];t.records.forEach(s=>{e.find(a=>a.name===s.name&&a.value===s.value)||e.push(s)}),this.tags=e},getTasks(){this.$refs.pluginTaskTable.debouncedGetTasks()}}};var R=function(){var e=this,s=e._self._c;return s("div",[e.active?s(v,{attrs:{breads:e.breads,"show-create":!1,"show-refresh":!0,"show-delete":!1},on:{refresh:e.getTasks}}):e._e(),s(x,{scopedSlots:e._u([{key:"filters",fn:function(){return[s(k,{attrs:{title:"Search",label:"Search"},model:{value:e.search,callback:function(n){e.search=n},expression:"search"}}),e.plugin?e._e():s(d,{attrs:{title:"Plugins",label:"name","item-key":"id","item-value":"id",items:e.plugins},model:{value:e.selectedPlugins,callback:function(n){e.selectedPlugins=n},expression:"selectedPlugins"}}),s(d,{attrs:{title:"Users",label:"username","item-key":"id","item-value":"id",items:e.users},model:{value:e.selectedUsers,callback:function(n){e.selectedUsers=n},expression:"selectedUsers"}}),s(d,{attrs:{title:"Tags",label:"label","item-key":"id","item-value":"label",items:e.tags,"empty-default":!0},model:{value:e.selectedTags,callback:function(n){e.selectedTags=n},expression:"selectedTags"}})]},proxy:!0},{key:"table",fn:function(){return[s(y,{ref:"pluginTaskTable",attrs:{plugin:e.plugin,"refresh-tasks":e.refreshTasks,"hide-columns":["id","task_name"],"selected-plugins":e.selectedPlugins,"selected-users":e.selectedUsers,"selected-tags":e.selectedTags,search:e.search},on:{"refresh-tags":e.getTags}})]},proxy:!0}])})],1)},z=[],Y=f(N,R,z,!1,null,null,null,null);const ce=Y.exports;export{ce as _}; diff --git a/dist/assets/Plugins.48e15fee.js b/dist/assets/Plugins.48e15fee.js deleted file mode 100644 index 6b99f3e..0000000 --- a/dist/assets/Plugins.48e15fee.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o}from"./PluginTasksList.fdbea558.js";import{_}from"./ListPageTop.dad49f81.js";import{i as m,n as u,c as i,r as a}from"./index.154e9cc6.js";import{_ as c}from"./VDataTable.71ce8bb9.js";import{_ as d,a as r,b as f,c as l}from"./VTabItem.9e30abd4.js";import"./TagViewer.b07ca85a.js";import"./VSelect.27a57f2b.js";import"./index.27090f0f.js";import"./DateTimeDisplay.97700a4a.js";import"./moment.9709ab41.js";import"./VTooltip.b258437e.js";import"./TooltipButton.6022e185.js";import"./index.e9f2ede5.js";import"./ansi_up.bcd3942b.js";import"./download-stager.85a6b476.js";import"./download-api.dfe5301b.js";import"./VPagination.90d5be16.js";import"./VSwitch.4adac3f4.js";import"./ExpansionPanelFilter.5838fe52.js";import"./VExpansionPanelHeader.d8fbc23c.js";import"./ExpansionPanelSearch.7dcac59a.js";import"./AdvancedTable.65916e9e.js";import"./VExpansionPanels.1f915cd7.js";import"./tag-api.5e19879c.js";import"./VBreadcrumbs.a2278375.js";const v={name:"PluginsList",components:{ListPageTop:_},props:{active:{type:Boolean,default:!1}},data(){return{breads:[{text:"Plugins",disabled:!0,href:"/plugins"},{text:"List",disabled:!0,href:"/plugins?tab=list-view"}],headers:[{text:"Name",value:"name"},{text:"Description",value:"description"}]}},computed:{...m({plugins:n=>n.plugin.plugins})},mounted(){this.getPlugins()},methods:{getPlugins(){this.$store.dispatch("plugin/getPlugins")}}};var g=function(){var t=this,e=t._self._c;return e("div",[t.active?e(_,{attrs:{breads:t.breads,"show-create":!1,"show-delete":!1,"show-refresh":!0},on:{refresh:t.getPlugins}}):t._e(),e(c,{attrs:{headers:t.headers,items:t.plugins,dense:""},scopedSlots:t._u([{key:"item.name",fn:function({item:s}){return[e("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"pluginEdit",params:{id:s.id}}}},[t._v(" "+t._s(s.name)+" ")])]}}])})],1)},h=[],b=u(v,g,h,!1,null,null,null,null);const p=b.exports;const x={name:"Plugins",components:{PluginsList:p,PluginTasksList:o},data(){return{breads:[{text:"Plugins",disabled:!0,href:"/plugins"}],headers:[{text:"Name",value:"name"},{text:"Description",value:"description"}]}},computed:{tab:{set(n){this.$router.replace({query:{...this.$route.query,tab:n}})},get(){return this.$route.query.tab||"list-view"}}}};var y=function(){var t=this,e=t._self._c;return e("div",[e("portal",{attrs:{to:"app-bar-extension"}},[e("div",{staticStyle:{display:"flex","flex-direction":"row",width:"100%"}},[e(d,{attrs:{"align-with-title":""},model:{value:t.tab,callback:function(s){t.tab=s},expression:"tab"}},[e(r,{key:"list-view",attrs:{href:"#list-view"}},[t._v(" List "),e(i,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-list ")])],1),e(r,{key:"tasks",attrs:{href:"#tasks"}},[t._v(" Tasks "),e(i,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-sticky-note ")])],1)],1)],1)]),e(f,{model:{value:t.tab,callback:function(s){t.tab=s},expression:"tab"}},[e(l,{key:"list-view",attrs:{value:"list-view",transition:!1,"reverse-transition":!1}},[e(a,{attrs:{flat:""}},[e(p,{attrs:{active:t.tab==="list-view"}})],1)],1),e(l,{key:"tasks",attrs:{value:"tasks",transition:!1,"reverse-transition":!1}},[e(a,{attrs:{flat:""}},[e(o,{attrs:{active:t.tab==="tasks"}})],1)],1)],1)],1)},k=[],P=u(x,y,k,!1,null,null,null,null);const V=P.exports;export{V as default}; diff --git a/dist/assets/Plugins.7cf57c75.js b/dist/assets/Plugins.7cf57c75.js new file mode 100644 index 0000000..252c923 --- /dev/null +++ b/dist/assets/Plugins.7cf57c75.js @@ -0,0 +1 @@ +import{_ as o}from"./PluginTasksList.a825df81.js";import{_}from"./ListPageTop.2a204a11.js";import{e as m,n as u,c as i,f as a}from"./index.85262dd3.js";import{_ as c}from"./VDataTable.125536b6.js";import{_ as d,a as r,b as f,c as l}from"./VTabItem.35a0348a.js";import"./TagViewer.a3da6a20.js";import"./VSelect.8543571f.js";import"./DateTimeDisplay.c35d52fb.js";import"./moment.9709ab41.js";import"./VTooltip.0c849a74.js";import"./TooltipButton.6f10f736.js";import"./index.c62fa657.js";import"./ansi_up.de92b8a0.js";import"./download-stager.cac59e06.js";import"./VPagination.873af1be.js";import"./VSwitch.8a27782c.js";import"./ExpansionPanelFilter.8ec031fa.js";import"./VExpansionPanelHeader.1232ca65.js";import"./ExpansionPanelSearch.252e89f2.js";import"./AdvancedTable.8f5cf108.js";import"./VExpansionPanels.d99facd5.js";import"./tag-api.d2d18349.js";import"./VBreadcrumbs.32f4f2d0.js";const v={name:"PluginsList",components:{ListPageTop:_},props:{active:{type:Boolean,default:!1}},data(){return{breads:[{text:"Plugins",disabled:!0,href:"/plugins"},{text:"List",disabled:!0,href:"/plugins?tab=list-view"}],headers:[{text:"Name",value:"name"},{text:"Description",value:"description"}]}},computed:{...m({plugins:n=>n.plugin.plugins})},mounted(){this.getPlugins()},methods:{getPlugins(){this.$store.dispatch("plugin/getPlugins")}}};var g=function(){var t=this,e=t._self._c;return e("div",[t.active?e(_,{attrs:{breads:t.breads,"show-create":!1,"show-delete":!1,"show-refresh":!0},on:{refresh:t.getPlugins}}):t._e(),e(c,{attrs:{headers:t.headers,items:t.plugins,dense:""},scopedSlots:t._u([{key:"item.name",fn:function({item:s}){return[e("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"pluginEdit",params:{id:s.id}}}},[t._v(" "+t._s(s.name)+" ")])]}}])})],1)},h=[],b=u(v,g,h,!1,null,null,null,null);const p=b.exports;const x={name:"Plugins",components:{PluginsList:p,PluginTasksList:o},data(){return{breads:[{text:"Plugins",disabled:!0,href:"/plugins"}],headers:[{text:"Name",value:"name"},{text:"Description",value:"description"}]}},computed:{tab:{set(n){this.$router.replace({query:{...this.$route.query,tab:n}})},get(){return this.$route.query.tab||"list-view"}}}};var y=function(){var t=this,e=t._self._c;return e("div",[e("portal",{attrs:{to:"app-bar-extension"}},[e("div",{staticStyle:{display:"flex","flex-direction":"row",width:"100%"}},[e(d,{attrs:{"align-with-title":""},model:{value:t.tab,callback:function(s){t.tab=s},expression:"tab"}},[e(r,{key:"list-view",attrs:{href:"#list-view"}},[t._v(" List "),e(i,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-list ")])],1),e(r,{key:"tasks",attrs:{href:"#tasks"}},[t._v(" Tasks "),e(i,{staticClass:"ml-1",attrs:{"x-small":""}},[t._v(" fa-sticky-note ")])],1)],1)],1)]),e(f,{model:{value:t.tab,callback:function(s){t.tab=s},expression:"tab"}},[e(l,{key:"list-view",attrs:{value:"list-view",transition:!1,"reverse-transition":!1}},[e(a,{attrs:{flat:""}},[e(p,{attrs:{active:t.tab==="list-view"}})],1)],1),e(l,{key:"tasks",attrs:{value:"tasks",transition:!1,"reverse-transition":!1}},[e(a,{attrs:{flat:""}},[e(o,{attrs:{active:t.tab==="tasks"}})],1)],1)],1)],1)},k=[],P=u(x,y,k,!1,null,null,null,null);const Q=P.exports;export{Q as default}; diff --git a/dist/assets/Settings.213099ad.js b/dist/assets/Settings.213099ad.js new file mode 100644 index 0000000..6ddf960 --- /dev/null +++ b/dist/assets/Settings.213099ad.js @@ -0,0 +1 @@ +import{_ as c}from"./ListPageTop.2a204a11.js";import{e as d,ba as u,bZ as p,b_ as h,b$ as f,c0 as m,c1 as _,c2 as g,c3 as v,c4 as w,c5 as b,n as y,c6 as k,bc as l,a as $,b as r,l as o,aB as C,o as n}from"./index.85262dd3.js";import{_ as i}from"./VSwitch.8a27782c.js";import"./VBreadcrumbs.32f4f2d0.js";const P={components:{ListPageTop:c},data(){return{password:{form:{},loading:!1},rules:{password:[a=>!!a||"Password is required",a=>!!a&&a.length>5||"Password must be larger than 5 characters"],confirmPassword:[a=>!!a||"Confirmation is required",a=>a===this.password.form.password||"Password must match"]},modules:{loading:!1},bypasses:{loading:!1},profiles:{loading:!1},plugins:{loading:!1},showPassword:!1,showConfirm:!1,valid:!1,breads:[{text:"Settings",disabled:!0,href:"/settings"}],avatarUrl:""}},computed:{...d({user:a=>a.application.user,darkMode:a=>a.application.darkMode,chatWidget:a=>a.application.chatWidget,autoSubscribeAgents:a=>a.application.autoSubscribeAgents}),userId(){return this.user.id},darkModeSwitch:{set(a){this.$store.dispatch("application/darkMode",a)},get(){return this.darkMode}},chatWidgetSwitch:{set(a){this.$store.dispatch("application/chatWidget",a)},get(){return this.chatWidget}},autoSubscribeSwitch:{set(a){this.$store.dispatch("application/autoSubscribeAgents",a)},get(){return this.autoSubscribeAgents}}},watch:{"user.avatar":{async handler(){!this.user.avatar||(this.avatarUrl=await this.getDownloadUrl(this.user.avatar))},immediate:!0}},methods:{async getDownloadUrl(a){return await u(a.id)},handleFileImport(){this.isSelecting=!0,window.addEventListener("focus",()=>{this.isSelecting=!1},{once:!0}),this.$refs.uploader.click()},async onFileChanged(a){const s=a.target.files[0],e=new FormData;e.append("file",s),await p(this.userId,e),await this.$store.dispatch("application/refreshMe"),this.$snack.success("Upload complete")},async logout(){await this.$root.$confirm("","Are you sure you want to logout?",{color:"green"})&&this.$store.dispatch("application/logout")},clearState(){this.$store.dispatch("application/clear"),this.$store.dispatch("agent/clear")},submit(){this.password.loading||!this.$refs.form.validate()||(this.password.loading=!0,h(this.user.id,this.password.form.password).then(()=>{this.$snack.success("Password updated"),this.password.form={},this.$refs.form.resetValidation()}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.password.loading=!1}))},resetProfiles(){this.profiles.loading=!0,f().then(()=>{this.$snack.success("Profiles reset successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.profiles.loading=!1})},reloadProfiles(){this.profiles.loading=!0,m().then(()=>{this.$snack.success("Profiles reload successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.profiles.loading=!1})},reloadModules(){this.modules.loading=!0,_().then(()=>{this.$snack.success("Module reload successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.modules.loading=!1})},resetModules(){this.modules.loading=!0,g().then(()=>{this.$snack.success("Module reset successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.modules.loading=!1})},reloadBypasses(){this.bypasses.loading=!0,v().then(()=>{this.$snack.success("Bypass reload successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.bypasses.loading=!1})},resetBypasses(){this.bypasses.loading=!0,w().then(()=>{this.$snack.success("Bypass reset successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.bypasses.loading=!1})},reloadPlugins(){this.plugins.loading=!0,b().then(()=>{this.$snack.success("Plugin reload successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.plugins.loading=!1})}}};var S=function(){var s=this,e=s._self._c;return e("div",[e(c,{attrs:{breads:s.breads}}),e("div",{staticClass:"page"},[e("div",{staticClass:"first-part point",staticStyle:{display:"flex","flex-direction":"row","align-items":"center"}},[e(k,{staticClass:"ma-2",on:{click:s.handleFileImport}},[s.user.avatar?e(l,{attrs:{src:s.avatarUrl}}):e(l,{attrs:{src:`https://ui-avatars.com/api/?background=random&name=${s.user.username}`}})],1),e("input",{ref:"uploader",staticClass:"d-none",attrs:{type:"file","aria-label":"uploader"},on:{change:s.onFileChanged}}),e("span",{staticClass:"ma-2"},[s._v(s._s(s.user.username))]),e($),e(r,{attrs:{color:"primary",text:""},on:{click:s.logout}},[s._v(" Logout ")])],1),e(o),e("div",{staticStyle:{display:"flex","flex-direction":"row"}},[e(i,{attrs:{label:"Dark Mode"},model:{value:s.darkModeSwitch,callback:function(t){s.darkModeSwitch=t},expression:"darkModeSwitch"}}),e(i,{staticClass:"pl-8",attrs:{label:"Chat Widget"},model:{value:s.chatWidgetSwitch,callback:function(t){s.chatWidgetSwitch=t},expression:"chatWidgetSwitch"}})],1),e(o),s._m(0),e(C,{ref:"form",staticStyle:{"max-width":"500px"},nativeOn:{submit:function(t){return t.preventDefault(),s.submit.apply(null,arguments)}},model:{value:s.valid,callback:function(t){s.valid=t},expression:"valid"}},[e(n,{attrs:{type:s.showPassword?"text":"password","append-icon":s.showPassword?"fa-eye":"fa-eye-slash",rules:s.rules.password,label:"Password",autocomplete:"off",outlined:"",dense:"",required:""},on:{"click:append":function(t){s.showPassword=!s.showPassword}},model:{value:s.password.form.password,callback:function(t){s.$set(s.password.form,"password",t)},expression:"password.form.password"}}),e(n,{attrs:{type:s.showConfirm?"text":"password","append-icon":s.showConfirm?"fa-eye":"fa-eye-slash",rules:s.rules.confirmPassword,label:"Confirm Password",autocomplete:"off",outlined:"",dense:"",required:""},on:{"click:append":function(t){s.showConfirm=!s.showConfirm}},model:{value:s.password.form.confirmPassword,callback:function(t){s.$set(s.password.form,"confirmPassword",t)},expression:"password.form.confirmPassword"}}),e(r,{staticClass:"mt-4 mb-4 primary",attrs:{type:"submit",loading:s.password.loading}},[s._v(" submit ")])],1),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(1),e(i,{attrs:{color:"primary"},model:{value:s.autoSubscribeSwitch,callback:function(t){s.autoSubscribeSwitch=t},expression:"autoSubscribeSwitch"}})],1),e(o),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(2),e(r,{attrs:{color:"error"},on:{click:s.clearState}},[s._v(" Clear ")])],1),e(o),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(3),e("div",{staticClass:"d-flex justify-end"},[e(r,{staticClass:"ml-2 mr-2",attrs:{loading:s.profiles.loading,color:"primary"},on:{click:s.reloadProfiles}},[s._v(" Reload ")]),e(r,{staticClass:"ml-2",attrs:{loading:s.profiles.loading,color:"error"},on:{click:s.resetProfiles}},[s._v(" Reset to Defaults ")])],1)]),e(o),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(4),e("div",{staticClass:"d-flex justify-end"},[e(r,{staticClass:"ml-2 mr-2",attrs:{loading:s.modules.loading,color:"primary"},on:{click:s.reloadModules}},[s._v(" Reload ")]),e(r,{staticClass:"ml-2",attrs:{loading:s.modules.loading,color:"error"},on:{click:s.resetModules}},[s._v(" Reset to Defaults ")])],1)]),e(o),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(5),e("div",{staticClass:"d-flex justify-end"},[e(r,{staticClass:"ml-2 mr-2",attrs:{loading:s.bypasses.loading,color:"primary"},on:{click:s.reloadBypasses}},[s._v(" Reload ")]),e(r,{staticClass:"ml-2",attrs:{loading:s.bypasses.loading,color:"error"},on:{click:s.resetBypasses}},[s._v(" Reset to Defaults ")])],1)]),e(o),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(6),e(r,{attrs:{loading:s.plugins.loading,color:"error"},on:{click:s.reloadPlugins}},[s._v(" Reload ")])],1)],1)],1)},x=[function(){var a=this,s=a._self._c;return s("div",{staticClass:"headers pl-0 mt-2"},[s("h4",[a._v("Update Password")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Auto-Subscribe to Agents")]),s("span",[a._v(" This will automatically subscribe to agent notifications."),s("br"),a._v(" Turning this off will require you to manually subscribe to agents. ")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Clear Application State")]),s("span",[a._v(" This will clear UI preferences and other localstorage data.")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Reload Malleable Profiles")]),s("span",[a._v(" Reload will check for and load new profile configurations."),s("br"),a._v(" Reset will do the same but also reset all database records to defaults. ")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Reload Modules")]),s("span",[a._v(" Reload will check for and load new module configurations."),s("br"),a._v(" Reset will do the same but also reset all database records to defaults. ")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Reload Bypasses")]),s("span",[a._v(" Reload will check for and load new bypass configurations."),s("br"),a._v(" Reset will do the same but also reset all database records to defaults. ")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Reload Plugins")]),s("span",[a._v("Reload will check for and load new plugins.")])])}],M=y(P,S,x,!1,null,null,null,null);const E=M.exports;export{E as default}; diff --git a/dist/assets/Settings.74625c62.js b/dist/assets/Settings.74625c62.js deleted file mode 100644 index 76f41dd..0000000 --- a/dist/assets/Settings.74625c62.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as n}from"./ListPageTop.dad49f81.js";import{i as d,bS as c,bT as u,bU as p,bV as f,bW as h,bX as m,bY as _,bZ as g,n as v,b as o,o as r,aE as w,j as l}from"./index.154e9cc6.js";import{_ as i}from"./VSwitch.4adac3f4.js";import"./VBreadcrumbs.a2278375.js";const y={components:{ListPageTop:n},data(){return{password:{form:{},loading:!1},rules:{password:[a=>!!a||"Password is required",a=>!!a&&a.length>5||"Password must be larger than 5 characters"],confirmPassword:[a=>!!a||"Confirmation is required",a=>a===this.password.form.password||"Password must match"]},modules:{loading:!1},bypasses:{loading:!1},profiles:{loading:!1},plugins:{loading:!1},showPassword:!1,showConfirm:!1,valid:!1,breads:[{text:"Settings",disabled:!0,href:"/settings"}]}},computed:{...d({user:a=>a.application.user,darkMode:a=>a.application.darkMode,chatWidget:a=>a.application.chatWidget}),userId(){return this.user.id},darkModeSwitch:{set(a){this.$store.dispatch("application/darkMode",a)},get(){return this.darkMode}},chatWidgetSwitch:{set(a){this.$store.dispatch("application/chatWidget",a)},get(){return this.chatWidget}}},methods:{async logout(){await this.$root.$confirm("","Are you sure you want to logout?",{color:"green"})&&this.$store.dispatch("application/logout")},clearState(){this.$store.dispatch("application/clear")},submit(){this.password.loading||!this.$refs.form.validate()||(this.password.loading=!0,c(this.user.id,this.password.form.password).then(()=>{this.$snack.success("Password updated"),this.password.form={},this.$refs.form.resetValidation()}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.password.loading=!1}))},resetProfiles(){this.profiles.loading=!0,u().then(()=>{this.$snack.success("Profiles reset successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.profiles.loading=!1})},reloadProfiles(){this.profiles.loading=!0,p().then(()=>{this.$snack.success("Profiles reload successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.profiles.loading=!1})},reloadModules(){this.modules.loading=!0,f().then(()=>{this.$snack.success("Module reload successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.modules.loading=!1})},resetModules(){this.modules.loading=!0,h().then(()=>{this.$snack.success("Module reset successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.modules.loading=!1})},reloadBypasses(){this.bypasses.loading=!0,m().then(()=>{this.$snack.success("Bypass reload successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.bypasses.loading=!1})},resetBypasses(){this.bypasses.loading=!0,_().then(()=>{this.$snack.success("Bypass reset successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.bypasses.loading=!1})},reloadPlugins(){this.plugins.loading=!0,g().then(()=>{this.$snack.success("Plugin reload successful")}).catch(a=>{this.$snack.error(`Error: ${a}`)}).finally(()=>{this.plugins.loading=!1})}}};var b=function(){var s=this,e=s._self._c;return e("div",[e(n,{attrs:{breads:s.breads}}),e("div",{staticClass:"page"},[e("div",{staticClass:"first-part"},[e("span",[s._v(s._s(s.user.username))]),e(o,{attrs:{color:"primary",text:""},on:{click:s.logout}},[s._v(" Logout ")])],1),e(r),e("div",{staticStyle:{display:"flex","flex-direction":"row"}},[e(i,{attrs:{label:"Dark Mode"},model:{value:s.darkModeSwitch,callback:function(t){s.darkModeSwitch=t},expression:"darkModeSwitch"}}),e(i,{staticClass:"pl-8",attrs:{label:"Chat Widget"},model:{value:s.chatWidgetSwitch,callback:function(t){s.chatWidgetSwitch=t},expression:"chatWidgetSwitch"}})],1),e(r),s._m(0),e(w,{ref:"form",staticStyle:{"max-width":"500px"},nativeOn:{submit:function(t){return t.preventDefault(),s.submit.apply(null,arguments)}},model:{value:s.valid,callback:function(t){s.valid=t},expression:"valid"}},[e(l,{attrs:{type:s.showPassword?"text":"password","append-icon":s.showPassword?"fa-eye":"fa-eye-slash",rules:s.rules.password,label:"Password",autocomplete:"off",outlined:"",dense:"",required:""},on:{"click:append":function(t){s.showPassword=!s.showPassword}},model:{value:s.password.form.password,callback:function(t){s.$set(s.password.form,"password",t)},expression:"password.form.password"}}),e(l,{attrs:{type:s.showConfirm?"text":"password","append-icon":s.showConfirm?"fa-eye":"fa-eye-slash",rules:s.rules.confirmPassword,label:"Confirm Password",autocomplete:"off",outlined:"",dense:"",required:""},on:{"click:append":function(t){s.showConfirm=!s.showConfirm}},model:{value:s.password.form.confirmPassword,callback:function(t){s.$set(s.password.form,"confirmPassword",t)},expression:"password.form.confirmPassword"}}),e(o,{staticClass:"mt-4 mb-4 primary",attrs:{type:"submit",loading:s.password.loading}},[s._v(" submit ")])],1),e(r),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(1),e(o,{attrs:{color:"error"},on:{click:s.clearState}},[s._v(" Clear ")])],1),e(r),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(2),e("div",{staticClass:"d-flex justify-end"},[e(o,{staticClass:"ml-2 mr-2",attrs:{loading:s.profiles.loading,color:"primary"},on:{click:s.reloadProfiles}},[s._v(" Reload ")]),e(o,{staticClass:"ml-2",attrs:{loading:s.profiles.loading,color:"error"},on:{click:s.resetProfiles}},[s._v(" Reset to Defaults ")])],1)]),e(r),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(3),e("div",{staticClass:"d-flex justify-end"},[e(o,{staticClass:"ml-2 mr-2",attrs:{loading:s.modules.loading,color:"primary"},on:{click:s.reloadModules}},[s._v(" Reload ")]),e(o,{staticClass:"ml-2",attrs:{loading:s.modules.loading,color:"error"},on:{click:s.resetModules}},[s._v(" Reset to Defaults ")])],1)]),e(r),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(4),e("div",{staticClass:"d-flex justify-end"},[e(o,{staticClass:"ml-2 mr-2",attrs:{loading:s.bypasses.loading,color:"primary"},on:{click:s.reloadBypasses}},[s._v(" Reload ")]),e(o,{staticClass:"ml-2",attrs:{loading:s.bypasses.loading,color:"error"},on:{click:s.resetBypasses}},[s._v(" Reset to Defaults ")])],1)]),e(r),e("div",{staticClass:"headers pl-0 mt-2"},[s._m(5),e(o,{attrs:{loading:s.plugins.loading,color:"error"},on:{click:s.reloadPlugins}},[s._v(" Reload ")])],1)],1)],1)},k=[function(){var a=this,s=a._self._c;return s("div",{staticClass:"headers pl-0 mt-2"},[s("h4",[a._v("Update Password")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v(" Clear Application State ")]),s("span",[a._v(" This will clear UI preferences and other localstorage data.")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Reload Malleable Profiles")]),s("span",[a._v(" Reload will check for and load new profile configurations."),s("br"),a._v(" Reset will do the same but also reset all database records to defaults. ")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Reload Modules")]),s("span",[a._v(" Reload will check for and load new module configurations."),s("br"),a._v(" Reset will do the same but also reset all database records to defaults. ")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Reload Bypasses")]),s("span",[a._v(" Reload will check for and load new bypass configurations."),s("br"),a._v(" Reset will do the same but also reset all database records to defaults. ")])])},function(){var a=this,s=a._self._c;return s("div",[s("h4",[a._v("Reload Plugins")]),s("span",[a._v("Reload will check for and load new plugins.")])])}],$=v(y,b,k,!1,null,null,null,null);const R=$.exports;export{R as default}; diff --git a/dist/assets/StagerEdit.2d71078a.js b/dist/assets/StagerEdit.2d71078a.js deleted file mode 100644 index 678917b..0000000 --- a/dist/assets/StagerEdit.2d71078a.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as o,a as m}from"./GeneralForm.6b452c3e.js";import{_ as n}from"./InfoViewer.ad34ab3b.js";import{_ as l,b as c,c as i}from"./ErrorStateAlert.3518d55f.js";import{_ as a}from"./TooltipButton.6022e185.js";import{_ as d}from"./EditPageTop.0db28cea.js";import{aK as p,aZ as u,a_ as h,a$ as g,b0 as _,n as f,r as y,j as w}from"./index.154e9cc6.js";import{a as $,b}from"./download-api.dfe5301b.js";import{C as S}from"./copy-stager.b5a59d8f.js";import{c as T}from"./VSelect.27a57f2b.js";import"./VSwitch.4adac3f4.js";import"./VExpansionPanels.1f915cd7.js";import"./VExpansionPanelHeader.d8fbc23c.js";import"./index.41ea8dd2.js";import"./VTooltip.b258437e.js";import"./index.27090f0f.js";import"./VBreadcrumbs.a2278375.js";const v={name:"StagerEdit",components:{InfoViewer:n,GeneralForm:o,ErrorStateAlert:l,EditPageTop:d,TooltipButton:a},mixins:[S],data(){return{stager:{options:{}},stagerTemplate:{options:{}},selectedTemplate:"",form:{},reset:!0,loading:!1,formPriorities:["Listener","Language"],errorState:!1,initialLoad:!1}},computed:{...p({stagerTemplateIds:"stager/templateIds"}),isNew(){return this.$route.name==="stagerNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"View"},canEdit(){return!0},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"stagerNew",params:{copy:!0,id:this.id}}:{}},stagerInfo(){if(!this.stagerTemplate)return{};const t=this.stagerTemplate;return{authors:t.authors,description:t.description,comments:t.comments}},stagerOptions(){if(!this.isNew||this.isCopy){const e={};return Object.keys(this.stager.options).forEach(s=>{e[s]={...this.stagerTemplate.options[s]},e[s].value=this.stager.options[s]}),e}const{options:t}=this.stagerTemplate;return t?(this.$route.query.listener&&(t.Listener.value=this.$route.query.listener),t):{}},breads(){return[{text:"Stagers",disabled:!1,to:"/stagers",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/stagers-edit"}]},breadcrumbName(){return this.isCopy?"New":this.stager.name?this.stager.name:this.id?this.id:"New"}},watch:{selectedTemplate:{async handler(t){const e=await u(t).catch(s=>this.$snack.error(`Error: ${s}`));e&&(this.reset=!1,this.stagerTemplate=e,await this.$nextTick(),this.reset=!0,this.initialLoad=!0)}},id(t){t&&this.getStager(t)}},mounted(){this.$store.dispatch("stager/getStagerTemplates"),(!this.isNew||this.isCopy)&&this.getStager(this.$route.params.id),this.$route.query.template&&(this.selectedTemplate=this.$route.query.template)},methods:{submit(){this.loading||!this.$refs.generalform.$refs.form.validate()||(this.loading=!0,this.id>0?h(this.id,{name:this.stager.name,options:this.form}).then(()=>{this.$snack.success("Stager updated"),this.loading=!1}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}):g(this.selectedTemplate,this.stager.name||this.randomName(),this.form).then(({id:t})=>{this.$snack.success("Stager created"),this.loading=!1,this.$router.push({name:"stagerEdit",params:{id:t}})}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}))},async deleteStager(){if(await this.$root.$confirm("Delete",`Are you sure you want to delete stager ${this.form.StarkillerName}?`,{color:"red"}))try{await this.$store.dispatch("stager/deleteStager",this.id),this.$router.push({name:"stagers"})}catch(t){this.$snack.error(`Error: ${t}`)}},getStager(t){_(t).then(e=>{this.stager=e,this.selectedTemplate=e.template}).catch(()=>{this.errorState=!0})},randomName(){return(Math.random()+1).toString(36).substring(7)},isDownload(t){return t.downloads&&t.downloads.length>0},isOneLiner(t){return t.one_liner},async copy(t){const e=t.downloads.length-1;return this.copyStager(await $(t.downloads[e].id))},async download(t){const e=t.downloads.length-1;return b(t.downloads[e].id)}}};var x=function(){var e=this,s=e._self._c;return s("div",[s(d,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"disable-submit":!e.canEdit&&e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading&&e.initialLoad,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.deleteStager}},[s("template",{slot:"extra-stuff"},[e.id>0&&e.initialLoad&&e.isDownload(e.stager)?s(a,{attrs:{color:"success",icon:"fa-download",text:"Download"},on:{click:function(r){return e.download(e.stager)}}}):e._e(),e.id>0&&e.initialLoad&&e.isOneLiner(e.stager)?s(a,{attrs:{color:"success",icon:"fa-paperclip",text:"Copy To Clipboard"},on:{click:function(r){return e.copy(e.stager)}}}):e._e()],1)],2),s("div",{staticClass:"headers"},[s("h3",[e._v(e._s(e.mode)+" Stager")])]),e.errorState?s(l,{attrs:{"resource-id":e.id,"resource-type":"stager"}}):s(y,{staticStyle:{padding:"10px"}},[s(n,{staticClass:"info-viewer",attrs:{info:e.stagerInfo}}),s(m,{attrs:{items:e.stagerTemplateIds,loading:!e.reset,dense:"",outlined:"",label:"Type",readonly:!e.canEdit},model:{value:e.selectedTemplate,callback:function(r){e.selectedTemplate=r},expression:"selectedTemplate"}}),e.selectedTemplate?s(c,[s(i,{attrs:{cols:"6"}},[s(w,{attrs:{outlined:"",dense:"",label:"Name",readonly:!e.canEdit},model:{value:e.stager.name,callback:function(r){e.$set(e.stager,"name",r)},expression:"stager.name"}})],1),s(i,{attrs:{cols:"6"}},[s(T,[e._v(" A name for the stager. Leave blank for an autogenerated name. ")])],1)],1):e._e(),e.reset?s(o,{ref:"generalform",attrs:{options:e.stagerOptions,priority:e.formPriorities,readonly:!e.canEdit},model:{value:e.form,callback:function(r){e.form=r},expression:"form"}}):e._e()],1)],1)},L=[],E=f(v,x,L,!1,null,null,null,null);const K=E.exports;export{K as default}; diff --git a/dist/assets/StagerEdit.343acc35.js b/dist/assets/StagerEdit.343acc35.js new file mode 100644 index 0000000..103e85b --- /dev/null +++ b/dist/assets/StagerEdit.343acc35.js @@ -0,0 +1 @@ +import{_ as o,a as u}from"./GeneralForm.fe5154ff.js";import{_ as n}from"./InfoViewer.448169ad.js";import{_ as l,b as c,c as i}from"./ErrorStateAlert.5e9140da.js";import{_ as a}from"./TooltipButton.6f10f736.js";import{_ as d}from"./EditPageTop.30f77a9c.js";import{aH as m,a$ as p,b0 as h,b1 as g,b2 as _,aZ as f,a_ as y,n as w,f as $,o as b}from"./index.85262dd3.js";import{C as S}from"./copy-stager.0103f297.js";import{b as T}from"./VSelect.8543571f.js";import"./VSwitch.8a27782c.js";import"./VExpansionPanels.d99facd5.js";import"./VExpansionPanelHeader.1232ca65.js";import"./VTooltip.0c849a74.js";import"./VBreadcrumbs.32f4f2d0.js";const v={name:"StagerEdit",components:{InfoViewer:n,GeneralForm:o,ErrorStateAlert:l,EditPageTop:d,TooltipButton:a},mixins:[S],data(){return{stager:{options:{}},stagerTemplate:{options:{}},selectedTemplate:"",form:{},reset:!0,loading:!1,formPriorities:["Listener","Language"],errorState:!1,initialLoad:!1}},computed:{...m({stagerTemplateIds:"stager/templateIds"}),isNew(){return this.$route.name==="stagerNew"},isCopy(){return this.$route.params.copy===!0},mode(){return this.isCopy?"Copy":this.isNew?"New":"View"},canEdit(){return!0},id(){return this.isCopy?0:this.$route.params.id},copyLink(){return this.id>0?{name:"stagerNew",params:{copy:!0,id:this.id}}:{}},stagerInfo(){if(!this.stagerTemplate)return{};const t=this.stagerTemplate;return{authors:t.authors,description:t.description,comments:t.comments}},stagerOptions(){if(!this.isNew||this.isCopy){const e={};return Object.keys(this.stager.options).forEach(s=>{e[s]={...this.stagerTemplate.options[s]},e[s].value=this.stager.options[s]}),e}const{options:t}=this.stagerTemplate;return t?(this.$route.query.listener&&(t.Listener.value=this.$route.query.listener),t):{}},breads(){return[{text:"Stagers",disabled:!1,to:"/stagers",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/stagers-edit"}]},breadcrumbName(){return this.isCopy?"New":this.stager.name?this.stager.name:this.id?this.id:"New"}},watch:{selectedTemplate:{async handler(t){const e=await p(t).catch(s=>this.$snack.error(`Error: ${s}`));e&&(this.reset=!1,this.stagerTemplate=e,await this.$nextTick(),this.reset=!0,this.initialLoad=!0)}},id(t){t&&this.getStager(t)}},mounted(){this.$store.dispatch("stager/getStagerTemplates"),(!this.isNew||this.isCopy)&&this.getStager(this.$route.params.id),this.$route.query.template&&(this.selectedTemplate=this.$route.query.template)},methods:{submit(){this.loading||!this.$refs.generalform.$refs.form.validate()||(this.loading=!0,this.id>0?h(this.id,{name:this.stager.name,options:this.form}).then(()=>{this.$snack.success("Stager updated"),this.loading=!1}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}):g(this.selectedTemplate,this.stager.name||this.randomName(),this.form).then(({id:t})=>{this.$snack.success("Stager created"),this.loading=!1,this.$router.push({name:"stagerEdit",params:{id:t}})}).catch(t=>{this.$snack.error(`Error: ${t}`),this.loading=!1}))},async deleteStager(){if(await this.$root.$confirm("Delete",`Are you sure you want to delete stager ${this.form.StarkillerName}?`,{color:"red"}))try{await this.$store.dispatch("stager/deleteStager",this.id),this.$router.push({name:"stagers"})}catch(t){this.$snack.error(`Error: ${t}`)}},getStager(t){_(t).then(e=>{this.stager=e,this.selectedTemplate=e.template}).catch(()=>{this.errorState=!0})},randomName(){return(Math.random()+1).toString(36).substring(7)},isDownload(t){return t.downloads&&t.downloads.length>0},isOneLiner(t){return t.one_liner},async copy(t){const e=t.downloads.length-1;return this.copyStager(await f(t.downloads[e].id))},async download(t){const e=t.downloads.length-1;return y(t.downloads[e].id)}}};var x=function(){var e=this,s=e._self._c;return s("div",[s(d,{attrs:{breads:e.breads,"show-submit":e.initialLoad,"disable-submit":!e.canEdit&&e.initialLoad,"show-copy":e.id>0&&e.initialLoad,"show-delete":e.id>0&&e.initialLoad,"submit-loading":e.loading&&e.initialLoad,"copy-link":e.copyLink,"small-copy":!0,"small-delete":!0},on:{submit:e.submit,delete:e.deleteStager},scopedSlots:e._u([{key:"extra-stuff",fn:function(){return[e.id>0&&e.initialLoad&&e.isDownload(e.stager)?s(a,{attrs:{color:"success",icon:"fa-download",text:"Download"},on:{click:function(r){return e.download(e.stager)}}}):e._e(),e.id>0&&e.initialLoad&&e.isOneLiner(e.stager)?s(a,{attrs:{color:"success",icon:"fa-paperclip",text:"Copy To Clipboard"},on:{click:function(r){return e.copy(e.stager)}}}):e._e()]},proxy:!0}])}),s("div",{staticClass:"headers"},[s("h3",[e._v(e._s(e.mode)+" Stager")])]),e.errorState?s(l,{attrs:{"resource-id":e.id,"resource-type":"stager"}}):s($,{staticStyle:{padding:"10px"}},[s(n,{staticClass:"info-viewer",attrs:{info:e.stagerInfo}}),s(u,{attrs:{items:e.stagerTemplateIds,loading:!e.reset,dense:"",outlined:"",label:"Type",readonly:!e.canEdit},model:{value:e.selectedTemplate,callback:function(r){e.selectedTemplate=r},expression:"selectedTemplate"}}),e.selectedTemplate?s(c,[s(i,{attrs:{cols:"6"}},[s(b,{attrs:{outlined:"",dense:"",label:"Name",readonly:!e.canEdit},model:{value:e.stager.name,callback:function(r){e.$set(e.stager,"name",r)},expression:"stager.name"}})],1),s(i,{attrs:{cols:"6"}},[s(T,[e._v(" A name for the stager. Leave blank for an autogenerated name. ")])],1)],1):e._e(),e.reset?s(o,{ref:"generalform",attrs:{options:e.stagerOptions,priority:e.formPriorities,readonly:!e.canEdit},model:{value:e.form,callback:function(r){e.form=r},expression:"form"}}):e._e()],1)],1)},L=[],k=w(v,x,L,!1,null,null,null,null);const j=k.exports;export{j as default}; diff --git a/dist/assets/StagerEdit.e3b0c442.css b/dist/assets/StagerEdit.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/Stagers.4c32053f.js b/dist/assets/Stagers.4c32053f.js deleted file mode 100644 index fc1a6b2..0000000 --- a/dist/assets/Stagers.4c32053f.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i}from"./DateTimeDisplay.97700a4a.js";import{i as c,n as d,b as h,c as r,k as S,l as o,V as l,o as v}from"./index.154e9cc6.js";import{h as _}from"./moment.9709ab41.js";import{D as u}from"./download-stager.85a6b476.js";import{C as p}from"./copy-stager.b5a59d8f.js";import{a as k,b as x}from"./download-api.dfe5301b.js";import{_ as w}from"./VDataTable.71ce8bb9.js";import{_ as b}from"./VSelect.27a57f2b.js";import{_ as g}from"./AdvancedTable.65916e9e.js";import{_ as m}from"./ListPageTop.dad49f81.js";import{_ as $}from"./VSwitch.4adac3f4.js";import"./VTooltip.b258437e.js";import"./index.27090f0f.js";import"./VExpansionPanels.1f915cd7.js";import"./VBreadcrumbs.a2278375.js";const C={name:"StagersTable",components:{DateTimeDisplay:i},mixins:[u,p],props:{onlyMyStagers:{type:Boolean,default:!1},input:{type:Array,default:()=>[]}},data(){return{moment:_,headers:[{text:"Name",value:"name"},{text:"Listener",value:"options.Listener"},{text:"Type",value:"template"},{text:"Language",value:"options.Language"},{text:"Created At",value:"created_at"},{text:"Actions",value:"actions",sortable:!1}],selected:[]}},computed:{...c({stagers:t=>t.stager.stagers,stagersStatus:t=>t.stager.status}),filteredStagers(){return this.stagers.filter(t=>this.onlyMyStagers?t.user_id===this.user.id:!0)}},watch:{selected(t){this.$emit("input",t)}},mounted(){this.getStagers()},methods:{isDownload(t){return t.downloads&&t.downloads.length>0},isOneLiner(t){return t.one_liner},async copy(t){const e=t.downloads.length-1;return this.copyStager(await k(t.downloads[e].id))},async download(t){const e=t.downloads.length-1;return x(t.downloads[e].id)},async deleteStager(t){this.$emit("delete-stager",t)},getStagers(){this.$store.dispatch("stager/getStagers")}}};var D=function(){var e=this,s=e._self._c;return s("div",[s(w,{attrs:{headers:e.headers,items:e.filteredStagers,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,loading:e.stagersStatus==="loading","item-key":"id",dense:"","show-select":""},scopedSlots:e._u([{key:"item.name",fn:function({item:n}){return[s("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"stagerEdit",params:{id:n.id}}}},[e._v(" "+e._s(n.name)+" ")])]}},{key:"item.options.Listener",fn:function({item:n}){return[s("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"listenerEdit",params:{id:n.id}}}},[e._v(" "+e._s(n.options.Listener)+" ")])]}},{key:"item.created_at",fn:function({item:n}){return[s(i,{attrs:{timestamp:n.created_at}})]}},{key:"item.actions",fn:function({item:n}){return[s(b,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:a,attrs:y}){return[s(h,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",y,!1),a),[s(r,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[s(S,{staticClass:"ml-2 mr-2"},[e.isDownload(n)?s(o,{key:"download",attrs:{link:""},on:{click:function(a){return e.download(n)}}},[s(l,[s(r,[e._v("fa-download")]),e._v(" Download ")],1)],1):e._e(),e.isOneLiner(n)?s(o,{key:"clipboard",attrs:{link:""},on:{click:function(a){return e.copy(n)}}},[s(l,[s(r,[e._v("fa-paperclip")]),e._v(" Copy to Clipboard ")],1)],1):e._e(),s(o,{key:"copy",attrs:{to:{name:"stagerNew",params:{copy:!0,id:n.id}},link:""}},[s(l,[s(r,[e._v("fa-clone")]),e._v(" Copy ")],1)],1),s(v,{staticClass:"pb-4"}),s(o,{key:"delete",attrs:{link:""},on:{click:function(a){return e.deleteStager(n)}}},[s(l,[s(r,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(n){e.selected=n},expression:"selected"}})],1)},M=[],O=d(C,D,M,!1,null,null,null,null);const f=O.exports;const T={name:"Stagers",components:{AdvancedTable:g,ListPageTop:m,StagersTable:f},mixins:[u,p],data(){return{moment:_,breads:[{text:"Stagers",disabled:!0,href:"/stagers"}],selected:[]}},computed:{...c({filterOnlyMyStagersCheckbox:t=>t.application.filterOnlyMyStagers}),showDelete(){return this.selected.length>0},filterOnlyMyStagersCheckbox:{set(t){this.$store.dispatch("application/filterOnlyMyStagers",t)},get(){return this.filterOnlyMyStagers}}},methods:{create(){this.$router.push({name:"stagerNew"})},async deleteStager(t){await this.$root.$confirm("Delete","Are you sure you want to delete this stager?",{color:"red"})&&this.$store.dispatch("stager/deleteStager",t.id)},async deleteStagers(){await this.$root.$confirm("Delete",`Are you sure you want to delete ${this.selected.length} stagers?`,{color:"red"})&&(this.selected.forEach(t=>{this.$store.dispatch("stager/deleteStager",t.id)}),this.selected=[])},getStagers(){this.$refs.stagersTable.getStagers()}}};var L=function(){var e=this,s=e._self._c;return s("div",[s(m,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"show-delete":e.showDelete},on:{create:e.create,refresh:e.getStagers,delete:e.deleteStagers}}),s(g,{scopedSlots:e._u([{key:"filters",fn:function(){return[s($,{attrs:{label:"Only My Stagers"},model:{value:e.filterOnlyMyStagersCheckbox,callback:function(n){e.filterOnlyMyStagersCheckbox=n},expression:"filterOnlyMyStagersCheckbox"}})]},proxy:!0},{key:"table",fn:function(){return[s(f,{ref:"stagersTable",attrs:{"only-my-stagers":e.filterOnlyMyStagersCheckbox},on:{"delete-stager":e.deleteStager},model:{value:e.selected,callback:function(n){e.selected=n},expression:"selected"}})]},proxy:!0}])})],1)},A=[],E=d(T,L,A,!1,null,null,null,null);const U=E.exports;export{U as default}; diff --git a/dist/assets/Stagers.c15d9636.js b/dist/assets/Stagers.c15d9636.js new file mode 100644 index 0000000..43ea875 --- /dev/null +++ b/dist/assets/Stagers.c15d9636.js @@ -0,0 +1 @@ +import{_ as i}from"./DateTimeDisplay.c35d52fb.js";import{e as c,aZ as h,a_ as S,n as d,p as v,b as x,c as r,g as k,h as o,i as l,l as w}from"./index.85262dd3.js";import{h as _}from"./moment.9709ab41.js";import{D as u}from"./download-stager.cac59e06.js";import{C as p}from"./copy-stager.0103f297.js";import{_ as b}from"./VDataTable.125536b6.js";import{_ as g}from"./AdvancedTable.8f5cf108.js";import{_ as m}from"./ListPageTop.2a204a11.js";import{_ as $}from"./VSwitch.8a27782c.js";import"./VTooltip.0c849a74.js";import"./VSelect.8543571f.js";import"./VExpansionPanels.d99facd5.js";import"./VBreadcrumbs.32f4f2d0.js";const C={name:"StagersTable",components:{DateTimeDisplay:i},mixins:[u,p],props:{onlyMyStagers:{type:Boolean,default:!1},input:{type:Array,default:()=>[]}},data(){return{moment:_,headers:[{text:"Name",value:"name"},{text:"Listener",value:"options.Listener"},{text:"Type",value:"template"},{text:"Language",value:"options.Language"},{text:"Created At",value:"created_at"},{text:"Actions",value:"actions",sortable:!1}],selected:[]}},computed:{...c({stagers:t=>t.stager.stagers,stagersStatus:t=>t.stager.status}),filteredStagers(){return this.stagers.filter(t=>this.onlyMyStagers?t.user_id===this.user.id:!0)}},watch:{selected(t){this.$emit("input",t)}},mounted(){this.getStagers()},methods:{isDownload(t){return t.downloads&&t.downloads.length>0},isOneLiner(t){return t.one_liner},async copy(t){const e=t.downloads.length-1;return this.copyStager(await h(t.downloads[e].id))},async download(t){const e=t.downloads.length-1;return S(t.downloads[e].id)},async deleteStager(t){this.$emit("delete-stager",t)},getStagers(){this.$store.dispatch("stager/getStagers")}}};var D=function(){var e=this,s=e._self._c;return s("div",[s(b,{attrs:{headers:e.headers,items:e.filteredStagers,"footer-props":{itemsPerPageOptions:[5,10,15,20,50,100]},"items-per-page":15,loading:e.stagersStatus==="loading","item-key":"id",dense:"","show-select":""},scopedSlots:e._u([{key:"item.name",fn:function({item:n}){return[s("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"stagerEdit",params:{id:n.id}}}},[e._v(" "+e._s(n.name)+" ")])]}},{key:"item.options.Listener",fn:function({item:n}){return[s("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"listenerEdit",params:{id:n.id}}}},[e._v(" "+e._s(n.options.Listener)+" ")])]}},{key:"item.created_at",fn:function({item:n}){return[s(i,{attrs:{timestamp:n.created_at}})]}},{key:"item.actions",fn:function({item:n}){return[s(v,{attrs:{"offset-y":""},scopedSlots:e._u([{key:"activator",fn:function({on:a,attrs:y}){return[s(x,e._g(e._b({attrs:{text:"",icon:"","x-small":""}},"v-btn",y,!1),a),[s(r,[e._v("fa-ellipsis-v")])],1)]}}],null,!0)},[s(k,{staticClass:"ml-2 mr-2"},[e.isDownload(n)?s(o,{key:"download",attrs:{link:""},on:{click:function(a){return e.download(n)}}},[s(l,[s(r,[e._v("fa-download")]),e._v(" Download ")],1)],1):e._e(),e.isOneLiner(n)?s(o,{key:"clipboard",attrs:{link:""},on:{click:function(a){return e.copy(n)}}},[s(l,[s(r,[e._v("fa-paperclip")]),e._v(" Copy to Clipboard ")],1)],1):e._e(),s(o,{key:"copy",attrs:{to:{name:"stagerNew",params:{copy:!0,id:n.id}},link:""}},[s(l,[s(r,[e._v("fa-clone")]),e._v(" Copy ")],1)],1),s(w,{staticClass:"pb-4"}),s(o,{key:"delete",attrs:{link:""},on:{click:function(a){return e.deleteStager(n)}}},[s(l,[s(r,[e._v("fa-trash-alt")]),e._v(" Delete ")],1)],1)],1)],1)]}}]),model:{value:e.selected,callback:function(n){e.selected=n},expression:"selected"}})],1)},M=[],O=d(C,D,M,!1,null,null,null,null);const f=O.exports;const T={name:"Stagers",components:{AdvancedTable:g,ListPageTop:m,StagersTable:f},mixins:[u,p],data(){return{moment:_,breads:[{text:"Stagers",disabled:!0,href:"/stagers"}],selected:[]}},computed:{...c({filterOnlyMyStagersCheckbox:t=>t.application.filterOnlyMyStagers}),showDelete(){return this.selected.length>0},filterOnlyMyStagersCheckbox:{set(t){this.$store.dispatch("application/filterOnlyMyStagers",t)},get(){return this.filterOnlyMyStagers}}},methods:{create(){this.$router.push({name:"stagerNew"})},async deleteStager(t){await this.$root.$confirm("Delete","Are you sure you want to delete this stager?",{color:"red"})&&this.$store.dispatch("stager/deleteStager",t.id)},async deleteStagers(){await this.$root.$confirm("Delete",`Are you sure you want to delete ${this.selected.length} stagers?`,{color:"red"})&&(this.selected.forEach(t=>{this.$store.dispatch("stager/deleteStager",t.id)}),this.selected=[])},getStagers(){this.$refs.stagersTable.getStagers()}}};var L=function(){var e=this,s=e._self._c;return s("div",[s(m,{attrs:{breads:e.breads,"show-create":!0,"show-refresh":!0,"show-delete":e.showDelete},on:{create:e.create,refresh:e.getStagers,delete:e.deleteStagers}}),s(g,{scopedSlots:e._u([{key:"filters",fn:function(){return[s($,{attrs:{label:"Only My Stagers"},model:{value:e.filterOnlyMyStagersCheckbox,callback:function(n){e.filterOnlyMyStagersCheckbox=n},expression:"filterOnlyMyStagersCheckbox"}})]},proxy:!0},{key:"table",fn:function(){return[s(f,{ref:"stagersTable",attrs:{"only-my-stagers":e.filterOnlyMyStagersCheckbox},on:{"delete-stager":e.deleteStager},model:{value:e.selected,callback:function(n){e.selected=n},expression:"selected"}})]},proxy:!0}])})],1)},A=[],E=d(T,L,A,!1,null,null,null,null);const J=E.exports;export{J as default}; diff --git a/dist/assets/Stagers.e3b0c442.css b/dist/assets/Stagers.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/TagViewer.b07ca85a.js b/dist/assets/TagViewer.a3da6a20.js similarity index 95% rename from dist/assets/TagViewer.b07ca85a.js rename to dist/assets/TagViewer.a3da6a20.js index 3f13e90..07f72fa 100644 --- a/dist/assets/TagViewer.b07ca85a.js +++ b/dist/assets/TagViewer.a3da6a20.js @@ -1 +1 @@ -import{m as w,U as A,ab as F,a1 as j,ah as W,al as G,g as o,am as U,an as Y,H as $,ao as f,y as q,ap as N,aq as y,ar as S,as as K,at as X,au as x,av as J,aw as Q,z as V,ax as Z,ay as tt,az as B,b as _,c as p,T as H,aA as D,aB as et,aC as it,aD as st,n as O,r as at,aE as nt,aF as rt,j as L,aG as lt,a as ot}from"./index.154e9cc6.js";import{_ as ht,b as ct}from"./VSelect.27a57f2b.js";const ut=w(F,A).extend({name:"v-slider",directives:{ClickOutside:j},mixins:[A],props:{disabled:Boolean,inverseLabel:Boolean,max:{type:[Number,String],default:100},min:{type:[Number,String],default:0},step:{type:[Number,String],default:1},thumbColor:String,thumbLabel:{type:[Boolean,String],default:void 0,validator:t=>typeof t=="boolean"||t==="always"},thumbSize:{type:[Number,String],default:32},tickLabels:{type:Array,default:()=>[]},ticks:{type:[Boolean,String],default:!1,validator:t=>typeof t=="boolean"||t==="always"},tickSize:{type:[Number,String],default:2},trackColor:String,trackFillColor:String,value:[Number,String],vertical:Boolean},data:()=>({app:null,oldValue:null,thumbPressed:!1,mouseTimeout:-1,isFocused:!1,isActive:!1,noClick:!1,startOffset:0}),computed:{classes(){return{...F.options.computed.classes.call(this),"v-input__slider":!0,"v-input__slider--vertical":this.vertical,"v-input__slider--inverse-label":this.inverseLabel}},internalValue:{get(){return this.lazyValue},set(t){t=isNaN(t)?this.minValue:t;const e=this.roundValue(Math.min(Math.max(t,this.minValue),this.maxValue));e!==this.lazyValue&&(this.lazyValue=e,this.$emit("input",e))}},trackTransition(){return this.thumbPressed?this.showTicks||this.stepNumeric?"0.1s cubic-bezier(0.25, 0.8, 0.5, 1)":"none":""},minValue(){return parseFloat(this.min)},maxValue(){return parseFloat(this.max)},stepNumeric(){return this.step>0?parseFloat(this.step):0},inputWidth(){const t=(this.roundValue(this.internalValue)-this.minValue)/(this.maxValue-this.minValue)*100;return isNaN(t)?0:t},trackFillStyles(){const t=this.vertical?"bottom":"left",e=this.vertical?"top":"right",i=this.vertical?"height":"width",s=this.$vuetify.rtl?"auto":"0",n=this.$vuetify.rtl?"0":"auto",a=this.isDisabled?`calc(${this.inputWidth}% - 10px)`:`${this.inputWidth}%`;return{transition:this.trackTransition,[t]:s,[e]:n,[i]:a}},trackStyles(){const t=this.vertical?this.$vuetify.rtl?"bottom":"top":this.$vuetify.rtl?"left":"right",e=this.vertical?"height":"width",i="0px",s=this.isDisabled?`calc(${100-this.inputWidth}% - 10px)`:`calc(${100-this.inputWidth}%)`;return{transition:this.trackTransition,[t]:i,[e]:s}},showTicks(){return this.tickLabels.length>0||!!(!this.isDisabled&&this.stepNumeric&&this.ticks)},numTicks(){return Math.ceil((this.maxValue-this.minValue)/this.stepNumeric)},showThumbLabel(){return!this.isDisabled&&!!(this.thumbLabel||this.$scopedSlots["thumb-label"])},computedTrackColor(){if(!this.isDisabled)return this.trackColor?this.trackColor:this.isDark?this.validationState:this.validationState||"primary lighten-3"},computedTrackFillColor(){if(!this.isDisabled)return this.trackFillColor?this.trackFillColor:this.validationState||this.computedColor},computedThumbColor(){return this.thumbColor?this.thumbColor:this.validationState||this.computedColor}},watch:{min(t){const e=parseFloat(t);e>this.internalValue&&this.$emit("input",e)},max(t){const e=parseFloat(t);e{const l=[];this.tickLabels[a]&&l.push(this.$createElement("div",{staticClass:"v-slider__tick-label"},this.tickLabels[a]));const r=a*(100/this.numTicks),c=this.$vuetify.rtl?100-this.inputWidth0}},n)},genThumbContainer(t,e,i,s,n,a,l="thumb"){const r=[this.genThumb()],c=this.genThumbLabelContent(t);return this.showThumbLabel&&r.push(this.genThumbLabel(c)),this.$createElement("div",this.setTextColor(this.computedThumbColor,{ref:l,key:l,staticClass:"v-slider__thumb-container",class:{"v-slider__thumb-container--active":i,"v-slider__thumb-container--focused":s,"v-slider__thumb-container--show-label":this.showThumbLabel},style:this.getThumbContainerStyles(e),attrs:{role:"slider",tabindex:this.isDisabled?-1:this.$attrs.tabindex?this.$attrs.tabindex:0,"aria-label":this.$attrs["aria-label"]||this.label,"aria-valuemin":this.min,"aria-valuemax":this.max,"aria-valuenow":this.internalValue,"aria-readonly":String(this.isReadonly),"aria-orientation":this.vertical?"vertical":"horizontal"},on:{focus:n,blur:a,keydown:this.onKeyDown}}),r)},genThumbLabelContent(t){return this.$scopedSlots["thumb-label"]?this.$scopedSlots["thumb-label"]({value:t}):[this.$createElement("span",[String(t)])]},genThumbLabel(t){const e=o(this.thumbSize),i=this.vertical?`translateY(20%) translateY(${Number(this.thumbSize)/3-1}px) translateX(55%) rotate(135deg)`:"translateY(-20%) translateY(-12px) translateX(-50%) rotate(45deg)";return this.$createElement(U,{props:{origin:"bottom center"}},[this.$createElement("div",{staticClass:"v-slider__thumb-label-container",directives:[{name:"show",value:this.isFocused||this.isActive||this.thumbLabel==="always"}]},[this.$createElement("div",this.setBackgroundColor(this.computedThumbColor,{staticClass:"v-slider__thumb-label",style:{height:e,width:e,transform:i}}),[this.$createElement("div",t)])])])},genThumb(){return this.$createElement("div",this.setBackgroundColor(this.computedThumbColor,{staticClass:"v-slider__thumb"}))},getThumbContainerStyles(t){const e=this.vertical?"top":"left";let i=this.$vuetify.rtl?100-t:t;return i=this.vertical?100-i:i,{transition:this.trackTransition,[e]:`${i}%`}},onSliderMouseDown(t){var e;if(t.preventDefault(),this.oldValue=this.internalValue,this.isActive=!0,!((e=t.target)===null||e===void 0)&&e.matches(".v-slider__thumb-container, .v-slider__thumb-container *")){this.thumbPressed=!0;const a=t.target.getBoundingClientRect(),l="touches"in t?t.touches[0]:t;this.startOffset=this.vertical?l.clientY-(a.top+a.height/2):l.clientX-(a.left+a.width/2)}else this.startOffset=0,window.clearTimeout(this.mouseTimeout),this.mouseTimeout=window.setTimeout(()=>{this.thumbPressed=!0},300);const i=f?{passive:!0,capture:!0}:!0,s=f?{passive:!0}:!1,n="touches"in t;this.onMouseMove(t),this.app.addEventListener(n?"touchmove":"mousemove",this.onMouseMove,s),Y(this.app,n?"touchend":"mouseup",this.onSliderMouseUp,i),this.$emit("start",this.internalValue)},onSliderMouseUp(t){t.stopPropagation(),window.clearTimeout(this.mouseTimeout),this.thumbPressed=!1;const e=f?{passive:!0}:!1;this.app.removeEventListener("touchmove",this.onMouseMove,e),this.app.removeEventListener("mousemove",this.onMouseMove,e),this.$emit("mouseup",t),this.$emit("end",this.internalValue),$(this.oldValue,this.internalValue)||(this.$emit("change",this.internalValue),this.noClick=!0),this.isActive=!1},onMouseMove(t){t.type==="mousemove"&&(this.thumbPressed=!0),this.internalValue=this.parseMouseMove(t)},onKeyDown(t){if(!this.isInteractive)return;const e=this.parseKeyDown(t,this.internalValue);e==null||ethis.maxValue||(this.internalValue=e,this.$emit("change",e))},onSliderClick(t){if(this.noClick){this.noClick=!1;return}this.$refs.thumb.focus(),this.onMouseMove(t),this.$emit("change",this.internalValue)},onBlur(t){this.isFocused=!1,this.$emit("blur",t)},onFocus(t){this.isFocused=!0,this.$emit("focus",t)},parseMouseMove(t){const e=this.vertical?"top":"left",i=this.vertical?"height":"width",s=this.vertical?"clientY":"clientX",{[e]:n,[i]:a}=this.$refs.track.getBoundingClientRect(),l="touches"in t?t.touches[0][s]:t[s];let r=Math.min(Math.max((l-n-this.startOffset)/a,0),1)||0;return this.vertical&&(r=1-r),this.$vuetify.rtl&&(r=1-r),parseFloat(this.min)+r*(this.maxValue-this.minValue)},parseKeyDown(t,e){if(!this.isInteractive)return;const{pageup:i,pagedown:s,end:n,home:a,left:l,right:r,down:c,up:d}=q;if(![i,s,n,a,l,r,c,d].includes(t.keyCode))return;t.preventDefault();const v=this.stepNumeric||1,M=(this.maxValue-this.minValue)/v;if([l,r,c,d].includes(t.keyCode)){const R=(this.$vuetify.rtl?[l,d]:[r,d]).includes(t.keyCode)?1:-1,I=t.shiftKey?3:t.ctrlKey?2:1;e=e+R*v*I}else if(t.keyCode===a)e=this.minValue;else if(t.keyCode===n)e=this.maxValue;else{const E=t.keyCode===s?1:-1;e=e-E*v*(M>100?M/10:10)}return e},roundValue(t){if(!this.stepNumeric)return t;const e=this.step.toString().trim(),i=e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0,s=this.minValue%this.stepNumeric,n=Math.round((t-s)/this.stepNumeric)*this.stepNumeric+s;return parseFloat(Math.min(n,this.maxValue).toFixed(i))}}});function m(t){t={...t};const e=N(t),i=y(t),s=S(t);return{alpha:t.a,hex:e.substr(0,7),hexa:e,hsla:i,hsva:t,hue:t.h,rgba:s}}function P(t){const e=J(t),i=N(e),s=S(e);return{alpha:e.a,hex:i.substr(0,7),hexa:i,hsla:t,hsva:e,hue:e.h,rgba:s}}function u(t){const e=K(t),i=X(t),s=y(e);return{alpha:e.a,hex:i.substr(0,7),hexa:i,hsla:s,hsva:e,hue:e.h,rgba:t}}function g(t){const e=Q(t),i=y(e),s=S(e);return{alpha:e.a,hex:t.substr(0,7),hexa:t,hsla:i,hsva:e,hue:e.h,rgba:s}}function T(t){return g(x(t))}function h(t,e){return e.every(i=>t.hasOwnProperty(i))}function z(t,e){if(!t)return u({r:255,g:0,b:0,a:1});if(typeof t=="string"){if(t==="transparent")return g("#00000000");const i=x(t);return e&&i===e.hexa?e:g(i)}if(typeof t=="object"){if(t.hasOwnProperty("alpha"))return t;const i=t.hasOwnProperty("a")?parseFloat(t.a):1;if(h(t,["r","g","b"]))return e&&t===e.rgba?e:u({...t,a:i});if(h(t,["h","s","l"]))return e&&t===e.hsla?e:P({...t,a:i});if(h(t,["h","s","v"]))return e&&t===e.hsva?e:m({...t,a:i})}return u({r:255,g:0,b:0,a:1})}function b(t,e){if(e){const{a:i,...s}=t;return s}return t}function dt(t,e){if(e==null)return t;if(typeof e=="string")return e.length===7?t.hex:t.hexa;if(typeof e=="object"){const i=typeof e.a=="number"&&e.a===0?!!e.a:!e.a;if(h(e,["r","g","b"]))return b(t.rgba,i);if(h(e,["h","s","l"]))return b(t.hsla,i);if(h(e,["h","s","v"]))return b(t.hsva,i)}return t}function pt(t){return t?typeof t=="string"?t.length>7:typeof t=="object"?h(t,["a"])||h(t,["alpha"]):!1:!1}const mt=V.extend({name:"v-color-picker-preview",props:{color:Object,disabled:Boolean,hideAlpha:Boolean},methods:{genAlpha(){return this.genTrack({staticClass:"v-color-picker__alpha",props:{thumbColor:"grey lighten-2",hideDetails:!0,value:this.color.alpha,step:0,min:0,max:1},style:{backgroundImage:this.disabled?void 0:`linear-gradient(to ${this.$vuetify.rtl?"left":"right"}, transparent, ${Z(this.color.rgba)})`},on:{input:t=>this.color.alpha!==t&&this.$emit("update:color",m({...this.color.hsva,a:t}))}})},genSliders(){return this.$createElement("div",{staticClass:"v-color-picker__sliders"},[this.genHue(),!this.hideAlpha&&this.genAlpha()])},genDot(){return this.$createElement("div",{staticClass:"v-color-picker__dot"},[this.$createElement("div",{style:{background:tt(this.color.rgba)}})])},genHue(){return this.genTrack({staticClass:"v-color-picker__hue",props:{thumbColor:"grey lighten-2",hideDetails:!0,value:this.color.hue,step:0,min:0,max:360},on:{input:t=>this.color.hue!==t&&this.$emit("update:color",m({...this.color.hsva,h:t}))}})},genTrack(t){return this.$createElement(ut,{class:"v-color-picker__track",...t,props:{disabled:this.disabled,...t.props}})}},render(t){return t("div",{staticClass:"v-color-picker__preview",class:{"v-color-picker__preview--hide-alpha":this.hideAlpha}},[this.genDot(),this.genSliders()])}});const gt=V.extend({name:"v-color-picker-canvas",props:{color:{type:Object,default:()=>u({r:255,g:0,b:0,a:1})},disabled:Boolean,dotSize:{type:[Number,String],default:10},height:{type:[Number,String],default:150},width:{type:[Number,String],default:300}},data(){return{boundingRect:{width:0,height:0,left:0,top:0}}},computed:{dot(){return this.color?{x:this.color.hsva.s*parseInt(this.width,10),y:(1-this.color.hsva.v)*parseInt(this.height,10)}:{x:0,y:0}}},watch:{"color.hue":"updateCanvas"},mounted(){this.updateCanvas()},methods:{emitColor(t,e){const{left:i,top:s,width:n,height:a}=this.boundingRect;this.$emit("update:color",m({h:this.color.hue,s:B(t-i,0,n)/n,v:1-B(e-s,0,a)/a,a:this.color.alpha}))},updateCanvas(){if(!this.color)return;const t=this.$refs.canvas,e=t.getContext("2d");if(!e)return;const i=e.createLinearGradient(0,0,t.width,0);i.addColorStop(0,"hsla(0, 0%, 100%, 1)"),i.addColorStop(1,`hsla(${this.color.hue}, 100%, 50%, 1)`),e.fillStyle=i,e.fillRect(0,0,t.width,t.height);const s=e.createLinearGradient(0,0,0,t.height);s.addColorStop(0,"hsla(0, 0%, 100%, 0)"),s.addColorStop(1,"hsla(0, 0%, 0%, 1)"),e.fillStyle=s,e.fillRect(0,0,t.width,t.height)},handleClick(t){this.disabled||(this.boundingRect=this.$el.getBoundingClientRect(),this.emitColor(t.clientX,t.clientY))},handleMouseDown(t){t.preventDefault(),!this.disabled&&(this.boundingRect=this.$el.getBoundingClientRect(),window.addEventListener("mousemove",this.handleMouseMove),window.addEventListener("mouseup",this.handleMouseUp))},handleMouseMove(t){this.disabled||this.emitColor(t.clientX,t.clientY)},handleMouseUp(){window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("mouseup",this.handleMouseUp)},genCanvas(){return this.$createElement("canvas",{ref:"canvas",attrs:{width:this.width,height:this.height}})},genDot(){const t=parseInt(this.dotSize,10)/2,e=o(this.dot.x-t),i=o(this.dot.y-t);return this.$createElement("div",{staticClass:"v-color-picker__canvas-dot",class:{"v-color-picker__canvas-dot--disabled":this.disabled},style:{width:o(this.dotSize),height:o(this.dotSize),transform:`translate(${e}, ${i})`}})}},render(t){return t("div",{staticClass:"v-color-picker__canvas",style:{width:o(this.width),height:o(this.height)},on:{click:this.handleClick,mousedown:this.handleMouseDown}},[this.genCanvas(),this.genDot()])}});const k={rgba:{inputs:[["r",255,"int"],["g",255,"int"],["b",255,"int"],["a",1,"float"]],from:u},hsla:{inputs:[["h",360,"int"],["s",1,"float"],["l",1,"float"],["a",1,"float"]],from:P},hexa:{from:g}},vt=V.extend({name:"v-color-picker-edit",props:{color:Object,disabled:Boolean,hideAlpha:Boolean,hideModeSwitch:Boolean,mode:{type:String,default:"rgba",validator:t=>Object.keys(k).includes(t)}},data(){return{modes:k,internalMode:this.mode}},computed:{currentMode(){return this.modes[this.internalMode]}},watch:{mode(t){this.internalMode=t}},created(){this.internalMode=this.mode},methods:{getValue(t,e){return e==="float"?Math.round(t*100)/100:e==="int"?Math.round(t):0},parseValue(t,e){return e==="float"?parseFloat(t):e==="int"&&parseInt(t,10)||0},changeMode(){const t=Object.keys(this.modes),e=t.indexOf(this.internalMode),i=t[(e+1)%t.length];this.internalMode=i,this.$emit("update:mode",i)},genInput(t,e,i,s){return this.$createElement("div",{staticClass:"v-color-picker__input"},[this.$createElement("input",{key:t,attrs:e,domProps:{value:i},on:s}),this.$createElement("span",t.toUpperCase())])},genInputs(){if(this.internalMode==="hexa"){const t=this.color.hexa,e=this.hideAlpha&&t.endsWith("FF")?t.substr(0,7):t;return this.genInput("hex",{maxlength:this.hideAlpha?7:9,disabled:this.disabled},e,{change:i=>{const s=i.target;this.$emit("update:color",this.currentMode.from(x(s.value)))}})}else return(this.hideAlpha?this.currentMode.inputs.slice(0,-1):this.currentMode.inputs).map(([e,i,s])=>{const n=this.color[this.internalMode];return this.genInput(e,{type:"number",min:0,max:i,step:s==="float"?"0.01":s==="int"?"1":void 0,disabled:this.disabled},this.getValue(n[e],s),{input:a=>{const l=a.target,r=this.parseValue(l.value||"0",s);this.$emit("update:color",this.currentMode.from(Object.assign({},n,{[e]:r}),this.color.alpha))}})})},genSwitch(){return this.$createElement(_,{props:{small:!0,icon:!0,disabled:this.disabled},on:{click:this.changeMode}},[this.$createElement(p,"$unfold")])}},render(t){return t("div",{staticClass:"v-color-picker__edit"},[this.genInputs(),!this.hideModeSwitch&&this.genSwitch()])}});function ft(t){return Object.keys(t).map(e=>{const i=t[e];return i.base?[i.base,i.darken4,i.darken3,i.darken2,i.darken1,i.lighten1,i.lighten2,i.lighten3,i.lighten4,i.lighten5]:[i.black,i.white,i.transparent]})}const bt=T("#FFFFFF").rgba,_t=T("#000000").rgba,kt=w(H).extend({name:"v-color-picker-swatches",props:{swatches:{type:Array,default:()=>ft(et)},disabled:Boolean,color:Object,maxWidth:[Number,String],maxHeight:[Number,String]},methods:{genColor(t){const e=this.$createElement("div",{style:{background:t}},[$(this.color,z(t,null))&&this.$createElement(p,{props:{small:!0,dark:D(this.color.rgba,bt)>2&&this.color.alpha>.5,light:D(this.color.rgba,_t)>2&&this.color.alpha>.5}},"$success")]);return this.$createElement("div",{staticClass:"v-color-picker__color",on:{click:()=>this.disabled||this.$emit("update:color",T(t==="transparent"?"#00000000":t))}},[e])},genSwatches(){return this.swatches.map(t=>{const e=t.map(this.genColor);return this.$createElement("div",{staticClass:"v-color-picker__swatch"},e)})}},render(t){return t("div",{staticClass:"v-color-picker__swatches",style:{maxWidth:o(this.maxWidth),maxHeight:o(this.maxHeight)}},[this.$createElement("div",this.genSwatches())])}}),Ct=w(it,H).extend({name:"v-color-picker",props:{canvasHeight:{type:[String,Number],default:150},disabled:Boolean,dotSize:{type:[Number,String],default:10},flat:Boolean,hideCanvas:Boolean,hideSliders:Boolean,hideInputs:Boolean,hideModeSwitch:Boolean,mode:{type:String,default:"rgba",validator:t=>Object.keys(k).includes(t)},showSwatches:Boolean,swatches:Array,swatchesMaxHeight:{type:[Number,String],default:150},value:{type:[Object,String]},width:{type:[Number,String],default:300}},data:()=>({internalValue:u({r:255,g:0,b:0,a:1})}),computed:{hideAlpha(){return this.value?!pt(this.value):!1}},watch:{value:{handler(t){this.updateColor(z(t,this.internalValue))},immediate:!0}},methods:{updateColor(t){this.internalValue=t;const e=dt(this.internalValue,this.value);$(e,this.value)||(this.$emit("input",e),this.$emit("update:color",this.internalValue))},genCanvas(){return this.$createElement(gt,{props:{color:this.internalValue,disabled:this.disabled,dotSize:this.dotSize,width:this.width,height:this.canvasHeight},on:{"update:color":this.updateColor}})},genControls(){return this.$createElement("div",{staticClass:"v-color-picker__controls"},[!this.hideSliders&&this.genPreview(),!this.hideInputs&&this.genEdit()])},genEdit(){return this.$createElement(vt,{props:{color:this.internalValue,disabled:this.disabled,hideAlpha:this.hideAlpha,hideModeSwitch:this.hideModeSwitch,mode:this.mode},on:{"update:color":this.updateColor,"update:mode":t=>this.$emit("update:mode",t)}})},genPreview(){return this.$createElement(mt,{props:{color:this.internalValue,disabled:this.disabled,hideAlpha:this.hideAlpha},on:{"update:color":this.updateColor}})},genSwatches(){return this.$createElement(kt,{props:{dark:this.dark,light:this.light,disabled:this.disabled,swatches:this.swatches,color:this.internalValue,maxHeight:this.swatchesMaxHeight},on:{"update:color":this.updateColor}})}},render(t){return t(st,{staticClass:"v-color-picker",class:{"v-color-picker--flat":this.flat,...this.themeClasses,...this.elevationClasses},props:{maxWidth:this.width}},[!this.hideCanvas&&this.genCanvas(),(!this.hideSliders||!this.hideInputs)&&this.genControls(),this.showSwatches&&this.genSwatches()])}});const wt={name:"TagChip",props:{isNew:{type:Boolean,default:!1},tag:{type:Object,default:()=>({name:"New Tag",value:"",color:"#2196F3"})},close:{type:Boolean,default:!0},customIcon:{type:String,default:null}},data(){return{menu:!1,internalTag:this.tag,rules:{noColon:[t=>!!t||"Required.",t=>!t.includes(":")||"Cannot contain a colon."]}}},watch:{menu(t){t?(this.isNew&&(this.internalTag={name:"",value:"",color:"#2196F3"}),this.$nextTick(()=>{this.$refs.form.resetValidation(),setTimeout(()=>{this.$refs.nameField.focus()},500)})):this.internalTag=this.tag}},methods:{deleteTag(t){this.$emit("delete-tag",t)},updateTag(t){!this.$refs.form.validate()||(this.$emit("update-tag",t),this.menu=!1,this.$refs.form.resetValidation())}}};var $t=function(){var e=this,i=e._self._c;return i(ht,{attrs:{"close-on-content-click":!1,"close-on-click":!1,bottom:"",right:"",transition:"scale-transition",origin:"top left"},scopedSlots:e._u([{key:"activator",fn:function({on:s}){return[i(ct,e._g({staticClass:"mt-4 mr-1 ml-1 mb-4",attrs:{color:e.internalTag.color,"text-color":"white",close:e.close},on:{"click:close":function(n){return e.deleteTag(e.internalTag)}}},s),[e._v(" "+e._s(`${e.tag.name}:${e.tag.value}`)+" "),e.customIcon?i(p,{attrs:{right:""}},[e._v(" "+e._s(e.customIcon)+" ")]):e._e()],1)]}}]),model:{value:e.menu,callback:function(s){e.menu=s},expression:"menu"}},[i(at,{staticStyle:{display:"flex","flex-direction":"row-reverse"},attrs:{width:"400"}},[i(_,{staticClass:"mt-2 mr-2",attrs:{icon:""},on:{click:function(s){e.menu=!1}}},[i(p,[e._v("mdi-close-circle")])],1),i(nt,{ref:"form"},[i(rt,[i(L,{ref:"nameField",attrs:{outlined:"",dense:"",label:"Name",rules:e.rules.noColon,required:""},model:{value:e.internalTag.name,callback:function(s){e.$set(e.internalTag,"name",s)},expression:"internalTag.name"}}),i(L,{attrs:{outlined:"",dense:"",label:"Value",rules:e.rules.noColon,required:""},model:{value:e.internalTag.value,callback:function(s){e.$set(e.internalTag,"value",s)},expression:"internalTag.value"}}),i(Ct,{attrs:{"hide-inputs":"","dot-size":"16",mode:"hexa","swatches-max-height":"100"},model:{value:e.internalTag.color,callback:function(s){e.$set(e.internalTag,"color",s)},expression:"internalTag.color"}})],1),i(lt,[i(ot),i(_,{attrs:{color:"green",text:""},on:{click:function(s){return e.updateTag(e.internalTag)}}},[e._v(" Update ")])],1)],1)],1)],1)},yt=[],St=O(wt,$t,yt,!1,null,null,null,null);const C=St.exports;const xt={name:"TagViewer",components:{TagChip:C},props:{tags:{type:Array,default:()=>[]}},data(){return{menu:{}}},methods:{deleteTag(t){this.$emit("delete-tag",t)},updateTag(t){this.$emit("update-tag",t)},newTag(t){this.$emit("new-tag",t)}}};var Vt=function(){var e=this,i=e._self._c;return i("div",{staticStyle:{display:"flex","flex-direction":"row-reverse"}},[i("div",e._l(e.tags,function(s){return i(C,{key:s.id,attrs:{tag:s},on:{"delete-tag":e.deleteTag,"update-tag":e.updateTag}})}),1),i("div",[i(C,{attrs:{"is-new":!0,close:!1,"custom-icon":"mdi-plus-circle"},on:{"update-tag":e.newTag}})],1)])},Tt=[],Mt=O(xt,Vt,Tt,!1,null,null,null,null);const Ft=Mt.exports;export{Ft as _}; +import{m as w,Y as A,ah as F,ag as j,a6 as W,ai as G,v as o,aj as U,ak as Y,J as $,al as f,A as q,am as N,an as y,ao as S,ap as K,aq as X,ar as x,as as J,at as Q,D as V,au as Z,av as tt,aw as B,b as _,c as p,T as O,ax as D,ay as et,az as it,aA as st,n as H,p as at,f as nt,aB as rt,aC as lt,o as L,aD as ot,a as ht}from"./index.85262dd3.js";import{a as ct}from"./VSelect.8543571f.js";const ut=w(F,A).extend({name:"v-slider",directives:{ClickOutside:j},mixins:[A],props:{disabled:Boolean,inverseLabel:Boolean,max:{type:[Number,String],default:100},min:{type:[Number,String],default:0},step:{type:[Number,String],default:1},thumbColor:String,thumbLabel:{type:[Boolean,String],default:void 0,validator:t=>typeof t=="boolean"||t==="always"},thumbSize:{type:[Number,String],default:32},tickLabels:{type:Array,default:()=>[]},ticks:{type:[Boolean,String],default:!1,validator:t=>typeof t=="boolean"||t==="always"},tickSize:{type:[Number,String],default:2},trackColor:String,trackFillColor:String,value:[Number,String],vertical:Boolean},data:()=>({app:null,oldValue:null,thumbPressed:!1,mouseTimeout:-1,isFocused:!1,isActive:!1,noClick:!1,startOffset:0}),computed:{classes(){return{...F.options.computed.classes.call(this),"v-input__slider":!0,"v-input__slider--vertical":this.vertical,"v-input__slider--inverse-label":this.inverseLabel}},internalValue:{get(){return this.lazyValue},set(t){t=isNaN(t)?this.minValue:t;const e=this.roundValue(Math.min(Math.max(t,this.minValue),this.maxValue));e!==this.lazyValue&&(this.lazyValue=e,this.$emit("input",e))}},trackTransition(){return this.thumbPressed?this.showTicks||this.stepNumeric?"0.1s cubic-bezier(0.25, 0.8, 0.5, 1)":"none":""},minValue(){return parseFloat(this.min)},maxValue(){return parseFloat(this.max)},stepNumeric(){return this.step>0?parseFloat(this.step):0},inputWidth(){const t=(this.roundValue(this.internalValue)-this.minValue)/(this.maxValue-this.minValue)*100;return isNaN(t)?0:t},trackFillStyles(){const t=this.vertical?"bottom":"left",e=this.vertical?"top":"right",i=this.vertical?"height":"width",s=this.$vuetify.rtl?"auto":"0",n=this.$vuetify.rtl?"0":"auto",a=this.isDisabled?`calc(${this.inputWidth}% - 10px)`:`${this.inputWidth}%`;return{transition:this.trackTransition,[t]:s,[e]:n,[i]:a}},trackStyles(){const t=this.vertical?this.$vuetify.rtl?"bottom":"top":this.$vuetify.rtl?"left":"right",e=this.vertical?"height":"width",i="0px",s=this.isDisabled?`calc(${100-this.inputWidth}% - 10px)`:`calc(${100-this.inputWidth}%)`;return{transition:this.trackTransition,[t]:i,[e]:s}},showTicks(){return this.tickLabels.length>0||!!(!this.isDisabled&&this.stepNumeric&&this.ticks)},numTicks(){return Math.ceil((this.maxValue-this.minValue)/this.stepNumeric)},showThumbLabel(){return!this.isDisabled&&!!(this.thumbLabel||this.$scopedSlots["thumb-label"])},computedTrackColor(){if(!this.isDisabled)return this.trackColor?this.trackColor:this.isDark?this.validationState:this.validationState||"primary lighten-3"},computedTrackFillColor(){if(!this.isDisabled)return this.trackFillColor?this.trackFillColor:this.validationState||this.computedColor},computedThumbColor(){return this.thumbColor?this.thumbColor:this.validationState||this.computedColor}},watch:{min(t){const e=parseFloat(t);e>this.internalValue&&this.$emit("input",e)},max(t){const e=parseFloat(t);e{const l=[];this.tickLabels[a]&&l.push(this.$createElement("div",{staticClass:"v-slider__tick-label"},this.tickLabels[a]));const r=a*(100/this.numTicks),c=this.$vuetify.rtl?100-this.inputWidth0}},n)},genThumbContainer(t,e,i,s,n,a,l="thumb"){const r=[this.genThumb()],c=this.genThumbLabelContent(t);return this.showThumbLabel&&r.push(this.genThumbLabel(c)),this.$createElement("div",this.setTextColor(this.computedThumbColor,{ref:l,key:l,staticClass:"v-slider__thumb-container",class:{"v-slider__thumb-container--active":i,"v-slider__thumb-container--focused":s,"v-slider__thumb-container--show-label":this.showThumbLabel},style:this.getThumbContainerStyles(e),attrs:{role:"slider",tabindex:this.isDisabled?-1:this.$attrs.tabindex?this.$attrs.tabindex:0,"aria-label":this.$attrs["aria-label"]||this.label,"aria-valuemin":this.min,"aria-valuemax":this.max,"aria-valuenow":this.internalValue,"aria-readonly":String(this.isReadonly),"aria-orientation":this.vertical?"vertical":"horizontal"},on:{focus:n,blur:a,keydown:this.onKeyDown}}),r)},genThumbLabelContent(t){return this.$scopedSlots["thumb-label"]?this.$scopedSlots["thumb-label"]({value:t}):[this.$createElement("span",[String(t)])]},genThumbLabel(t){const e=o(this.thumbSize),i=this.vertical?`translateY(20%) translateY(${Number(this.thumbSize)/3-1}px) translateX(55%) rotate(135deg)`:"translateY(-20%) translateY(-12px) translateX(-50%) rotate(45deg)";return this.$createElement(U,{props:{origin:"bottom center"}},[this.$createElement("div",{staticClass:"v-slider__thumb-label-container",directives:[{name:"show",value:this.isFocused||this.isActive||this.thumbLabel==="always"}]},[this.$createElement("div",this.setBackgroundColor(this.computedThumbColor,{staticClass:"v-slider__thumb-label",style:{height:e,width:e,transform:i}}),[this.$createElement("div",t)])])])},genThumb(){return this.$createElement("div",this.setBackgroundColor(this.computedThumbColor,{staticClass:"v-slider__thumb"}))},getThumbContainerStyles(t){const e=this.vertical?"top":"left";let i=this.$vuetify.rtl?100-t:t;return i=this.vertical?100-i:i,{transition:this.trackTransition,[e]:`${i}%`}},onSliderMouseDown(t){var e;if(t.preventDefault(),this.oldValue=this.internalValue,this.isActive=!0,!((e=t.target)===null||e===void 0)&&e.matches(".v-slider__thumb-container, .v-slider__thumb-container *")){this.thumbPressed=!0;const a=t.target.getBoundingClientRect(),l="touches"in t?t.touches[0]:t;this.startOffset=this.vertical?l.clientY-(a.top+a.height/2):l.clientX-(a.left+a.width/2)}else this.startOffset=0,window.clearTimeout(this.mouseTimeout),this.mouseTimeout=window.setTimeout(()=>{this.thumbPressed=!0},300);const i=f?{passive:!0,capture:!0}:!0,s=f?{passive:!0}:!1,n="touches"in t;this.onMouseMove(t),this.app.addEventListener(n?"touchmove":"mousemove",this.onMouseMove,s),Y(this.app,n?"touchend":"mouseup",this.onSliderMouseUp,i),this.$emit("start",this.internalValue)},onSliderMouseUp(t){t.stopPropagation(),window.clearTimeout(this.mouseTimeout),this.thumbPressed=!1;const e=f?{passive:!0}:!1;this.app.removeEventListener("touchmove",this.onMouseMove,e),this.app.removeEventListener("mousemove",this.onMouseMove,e),this.$emit("mouseup",t),this.$emit("end",this.internalValue),$(this.oldValue,this.internalValue)||(this.$emit("change",this.internalValue),this.noClick=!0),this.isActive=!1},onMouseMove(t){t.type==="mousemove"&&(this.thumbPressed=!0),this.internalValue=this.parseMouseMove(t)},onKeyDown(t){if(!this.isInteractive)return;const e=this.parseKeyDown(t,this.internalValue);e==null||ethis.maxValue||(this.internalValue=e,this.$emit("change",e))},onSliderClick(t){if(this.noClick){this.noClick=!1;return}this.$refs.thumb.focus(),this.onMouseMove(t),this.$emit("change",this.internalValue)},onBlur(t){this.isFocused=!1,this.$emit("blur",t)},onFocus(t){this.isFocused=!0,this.$emit("focus",t)},parseMouseMove(t){const e=this.vertical?"top":"left",i=this.vertical?"height":"width",s=this.vertical?"clientY":"clientX",{[e]:n,[i]:a}=this.$refs.track.getBoundingClientRect(),l="touches"in t?t.touches[0][s]:t[s];let r=Math.min(Math.max((l-n-this.startOffset)/a,0),1)||0;return this.vertical&&(r=1-r),this.$vuetify.rtl&&(r=1-r),parseFloat(this.min)+r*(this.maxValue-this.minValue)},parseKeyDown(t,e){if(!this.isInteractive)return;const{pageup:i,pagedown:s,end:n,home:a,left:l,right:r,down:c,up:d}=q;if(![i,s,n,a,l,r,c,d].includes(t.keyCode))return;t.preventDefault();const v=this.stepNumeric||1,M=(this.maxValue-this.minValue)/v;if([l,r,c,d].includes(t.keyCode)){const z=(this.$vuetify.rtl?[l,d]:[r,d]).includes(t.keyCode)?1:-1,I=t.shiftKey?3:t.ctrlKey?2:1;e=e+z*v*I}else if(t.keyCode===a)e=this.minValue;else if(t.keyCode===n)e=this.maxValue;else{const E=t.keyCode===s?1:-1;e=e-E*v*(M>100?M/10:10)}return e},roundValue(t){if(!this.stepNumeric)return t;const e=this.step.toString().trim(),i=e.indexOf(".")>-1?e.length-e.indexOf(".")-1:0,s=this.minValue%this.stepNumeric,n=Math.round((t-s)/this.stepNumeric)*this.stepNumeric+s;return parseFloat(Math.min(n,this.maxValue).toFixed(i))}}});function m(t){t={...t};const e=N(t),i=y(t),s=S(t);return{alpha:t.a,hex:e.substr(0,7),hexa:e,hsla:i,hsva:t,hue:t.h,rgba:s}}function P(t){const e=J(t),i=N(e),s=S(e);return{alpha:e.a,hex:i.substr(0,7),hexa:i,hsla:t,hsva:e,hue:e.h,rgba:s}}function u(t){const e=K(t),i=X(t),s=y(e);return{alpha:e.a,hex:i.substr(0,7),hexa:i,hsla:s,hsva:e,hue:e.h,rgba:t}}function g(t){const e=Q(t),i=y(e),s=S(e);return{alpha:e.a,hex:t.substr(0,7),hexa:t,hsla:i,hsva:e,hue:e.h,rgba:s}}function T(t){return g(x(t))}function h(t,e){return e.every(i=>t.hasOwnProperty(i))}function R(t,e){if(!t)return u({r:255,g:0,b:0,a:1});if(typeof t=="string"){if(t==="transparent")return g("#00000000");const i=x(t);return e&&i===e.hexa?e:g(i)}if(typeof t=="object"){if(t.hasOwnProperty("alpha"))return t;const i=t.hasOwnProperty("a")?parseFloat(t.a):1;if(h(t,["r","g","b"]))return e&&t===e.rgba?e:u({...t,a:i});if(h(t,["h","s","l"]))return e&&t===e.hsla?e:P({...t,a:i});if(h(t,["h","s","v"]))return e&&t===e.hsva?e:m({...t,a:i})}return u({r:255,g:0,b:0,a:1})}function b(t,e){if(e){const{a:i,...s}=t;return s}return t}function dt(t,e){if(e==null)return t;if(typeof e=="string")return e.length===7?t.hex:t.hexa;if(typeof e=="object"){const i=typeof e.a=="number"&&e.a===0?!!e.a:!e.a;if(h(e,["r","g","b"]))return b(t.rgba,i);if(h(e,["h","s","l"]))return b(t.hsla,i);if(h(e,["h","s","v"]))return b(t.hsva,i)}return t}function pt(t){return t?typeof t=="string"?t.length>7:typeof t=="object"?h(t,["a"])||h(t,["alpha"]):!1:!1}const mt=V.extend({name:"v-color-picker-preview",props:{color:Object,disabled:Boolean,hideAlpha:Boolean},methods:{genAlpha(){return this.genTrack({staticClass:"v-color-picker__alpha",props:{thumbColor:"grey lighten-2",hideDetails:!0,value:this.color.alpha,step:0,min:0,max:1},style:{backgroundImage:this.disabled?void 0:`linear-gradient(to ${this.$vuetify.rtl?"left":"right"}, transparent, ${Z(this.color.rgba)})`},on:{input:t=>this.color.alpha!==t&&this.$emit("update:color",m({...this.color.hsva,a:t}))}})},genSliders(){return this.$createElement("div",{staticClass:"v-color-picker__sliders"},[this.genHue(),!this.hideAlpha&&this.genAlpha()])},genDot(){return this.$createElement("div",{staticClass:"v-color-picker__dot"},[this.$createElement("div",{style:{background:tt(this.color.rgba)}})])},genHue(){return this.genTrack({staticClass:"v-color-picker__hue",props:{thumbColor:"grey lighten-2",hideDetails:!0,value:this.color.hue,step:0,min:0,max:360},on:{input:t=>this.color.hue!==t&&this.$emit("update:color",m({...this.color.hsva,h:t}))}})},genTrack(t){return this.$createElement(ut,{class:"v-color-picker__track",...t,props:{disabled:this.disabled,...t.props}})}},render(t){return t("div",{staticClass:"v-color-picker__preview",class:{"v-color-picker__preview--hide-alpha":this.hideAlpha}},[this.genDot(),this.genSliders()])}});const gt=V.extend({name:"v-color-picker-canvas",props:{color:{type:Object,default:()=>u({r:255,g:0,b:0,a:1})},disabled:Boolean,dotSize:{type:[Number,String],default:10},height:{type:[Number,String],default:150},width:{type:[Number,String],default:300}},data(){return{boundingRect:{width:0,height:0,left:0,top:0}}},computed:{dot(){return this.color?{x:this.color.hsva.s*parseInt(this.width,10),y:(1-this.color.hsva.v)*parseInt(this.height,10)}:{x:0,y:0}}},watch:{"color.hue":"updateCanvas"},mounted(){this.updateCanvas()},methods:{emitColor(t,e){const{left:i,top:s,width:n,height:a}=this.boundingRect;this.$emit("update:color",m({h:this.color.hue,s:B(t-i,0,n)/n,v:1-B(e-s,0,a)/a,a:this.color.alpha}))},updateCanvas(){if(!this.color)return;const t=this.$refs.canvas,e=t.getContext("2d");if(!e)return;const i=e.createLinearGradient(0,0,t.width,0);i.addColorStop(0,"hsla(0, 0%, 100%, 1)"),i.addColorStop(1,`hsla(${this.color.hue}, 100%, 50%, 1)`),e.fillStyle=i,e.fillRect(0,0,t.width,t.height);const s=e.createLinearGradient(0,0,0,t.height);s.addColorStop(0,"hsla(0, 0%, 100%, 0)"),s.addColorStop(1,"hsla(0, 0%, 0%, 1)"),e.fillStyle=s,e.fillRect(0,0,t.width,t.height)},handleClick(t){this.disabled||(this.boundingRect=this.$el.getBoundingClientRect(),this.emitColor(t.clientX,t.clientY))},handleMouseDown(t){t.preventDefault(),!this.disabled&&(this.boundingRect=this.$el.getBoundingClientRect(),window.addEventListener("mousemove",this.handleMouseMove),window.addEventListener("mouseup",this.handleMouseUp))},handleMouseMove(t){this.disabled||this.emitColor(t.clientX,t.clientY)},handleMouseUp(){window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("mouseup",this.handleMouseUp)},genCanvas(){return this.$createElement("canvas",{ref:"canvas",attrs:{width:this.width,height:this.height}})},genDot(){const t=parseInt(this.dotSize,10)/2,e=o(this.dot.x-t),i=o(this.dot.y-t);return this.$createElement("div",{staticClass:"v-color-picker__canvas-dot",class:{"v-color-picker__canvas-dot--disabled":this.disabled},style:{width:o(this.dotSize),height:o(this.dotSize),transform:`translate(${e}, ${i})`}})}},render(t){return t("div",{staticClass:"v-color-picker__canvas",style:{width:o(this.width),height:o(this.height)},on:{click:this.handleClick,mousedown:this.handleMouseDown}},[this.genCanvas(),this.genDot()])}});const k={rgba:{inputs:[["r",255,"int"],["g",255,"int"],["b",255,"int"],["a",1,"float"]],from:u},hsla:{inputs:[["h",360,"int"],["s",1,"float"],["l",1,"float"],["a",1,"float"]],from:P},hexa:{from:g}},vt=V.extend({name:"v-color-picker-edit",props:{color:Object,disabled:Boolean,hideAlpha:Boolean,hideModeSwitch:Boolean,mode:{type:String,default:"rgba",validator:t=>Object.keys(k).includes(t)}},data(){return{modes:k,internalMode:this.mode}},computed:{currentMode(){return this.modes[this.internalMode]}},watch:{mode(t){this.internalMode=t}},created(){this.internalMode=this.mode},methods:{getValue(t,e){return e==="float"?Math.round(t*100)/100:e==="int"?Math.round(t):0},parseValue(t,e){return e==="float"?parseFloat(t):e==="int"&&parseInt(t,10)||0},changeMode(){const t=Object.keys(this.modes),e=t.indexOf(this.internalMode),i=t[(e+1)%t.length];this.internalMode=i,this.$emit("update:mode",i)},genInput(t,e,i,s){return this.$createElement("div",{staticClass:"v-color-picker__input"},[this.$createElement("input",{key:t,attrs:e,domProps:{value:i},on:s}),this.$createElement("span",t.toUpperCase())])},genInputs(){if(this.internalMode==="hexa"){const t=this.color.hexa,e=this.hideAlpha&&t.endsWith("FF")?t.substr(0,7):t;return this.genInput("hex",{maxlength:this.hideAlpha?7:9,disabled:this.disabled},e,{change:i=>{const s=i.target;this.$emit("update:color",this.currentMode.from(x(s.value)))}})}else return(this.hideAlpha?this.currentMode.inputs.slice(0,-1):this.currentMode.inputs).map(([e,i,s])=>{const n=this.color[this.internalMode];return this.genInput(e,{type:"number",min:0,max:i,step:s==="float"?"0.01":s==="int"?"1":void 0,disabled:this.disabled},this.getValue(n[e],s),{input:a=>{const l=a.target,r=this.parseValue(l.value||"0",s);this.$emit("update:color",this.currentMode.from(Object.assign({},n,{[e]:r}),this.color.alpha))}})})},genSwitch(){return this.$createElement(_,{props:{small:!0,icon:!0,disabled:this.disabled},on:{click:this.changeMode}},[this.$createElement(p,"$unfold")])}},render(t){return t("div",{staticClass:"v-color-picker__edit"},[this.genInputs(),!this.hideModeSwitch&&this.genSwitch()])}});function ft(t){return Object.keys(t).map(e=>{const i=t[e];return i.base?[i.base,i.darken4,i.darken3,i.darken2,i.darken1,i.lighten1,i.lighten2,i.lighten3,i.lighten4,i.lighten5]:[i.black,i.white,i.transparent]})}const bt=T("#FFFFFF").rgba,_t=T("#000000").rgba,kt=w(O).extend({name:"v-color-picker-swatches",props:{swatches:{type:Array,default:()=>ft(et)},disabled:Boolean,color:Object,maxWidth:[Number,String],maxHeight:[Number,String]},methods:{genColor(t){const e=this.$createElement("div",{style:{background:t}},[$(this.color,R(t,null))&&this.$createElement(p,{props:{small:!0,dark:D(this.color.rgba,bt)>2&&this.color.alpha>.5,light:D(this.color.rgba,_t)>2&&this.color.alpha>.5}},"$success")]);return this.$createElement("div",{staticClass:"v-color-picker__color",on:{click:()=>this.disabled||this.$emit("update:color",T(t==="transparent"?"#00000000":t))}},[e])},genSwatches(){return this.swatches.map(t=>{const e=t.map(this.genColor);return this.$createElement("div",{staticClass:"v-color-picker__swatch"},e)})}},render(t){return t("div",{staticClass:"v-color-picker__swatches",style:{maxWidth:o(this.maxWidth),maxHeight:o(this.maxHeight)}},[this.$createElement("div",this.genSwatches())])}}),Ct=w(it,O).extend({name:"v-color-picker",props:{canvasHeight:{type:[String,Number],default:150},disabled:Boolean,dotSize:{type:[Number,String],default:10},flat:Boolean,hideCanvas:Boolean,hideSliders:Boolean,hideInputs:Boolean,hideModeSwitch:Boolean,mode:{type:String,default:"rgba",validator:t=>Object.keys(k).includes(t)},showSwatches:Boolean,swatches:Array,swatchesMaxHeight:{type:[Number,String],default:150},value:{type:[Object,String]},width:{type:[Number,String],default:300}},data:()=>({internalValue:u({r:255,g:0,b:0,a:1})}),computed:{hideAlpha(){return this.value?!pt(this.value):!1}},watch:{value:{handler(t){this.updateColor(R(t,this.internalValue))},immediate:!0}},methods:{updateColor(t){this.internalValue=t;const e=dt(this.internalValue,this.value);$(e,this.value)||(this.$emit("input",e),this.$emit("update:color",this.internalValue))},genCanvas(){return this.$createElement(gt,{props:{color:this.internalValue,disabled:this.disabled,dotSize:this.dotSize,width:this.width,height:this.canvasHeight},on:{"update:color":this.updateColor}})},genControls(){return this.$createElement("div",{staticClass:"v-color-picker__controls"},[!this.hideSliders&&this.genPreview(),!this.hideInputs&&this.genEdit()])},genEdit(){return this.$createElement(vt,{props:{color:this.internalValue,disabled:this.disabled,hideAlpha:this.hideAlpha,hideModeSwitch:this.hideModeSwitch,mode:this.mode},on:{"update:color":this.updateColor,"update:mode":t=>this.$emit("update:mode",t)}})},genPreview(){return this.$createElement(mt,{props:{color:this.internalValue,disabled:this.disabled,hideAlpha:this.hideAlpha},on:{"update:color":this.updateColor}})},genSwatches(){return this.$createElement(kt,{props:{dark:this.dark,light:this.light,disabled:this.disabled,swatches:this.swatches,color:this.internalValue,maxHeight:this.swatchesMaxHeight},on:{"update:color":this.updateColor}})}},render(t){return t(st,{staticClass:"v-color-picker",class:{"v-color-picker--flat":this.flat,...this.themeClasses,...this.elevationClasses},props:{maxWidth:this.width}},[!this.hideCanvas&&this.genCanvas(),(!this.hideSliders||!this.hideInputs)&&this.genControls(),this.showSwatches&&this.genSwatches()])}});const wt={name:"TagChip",props:{isNew:{type:Boolean,default:!1},tag:{type:Object,default:()=>({name:"New Tag",value:"",color:"#2196F3"})},close:{type:Boolean,default:!0},customIcon:{type:String,default:null}},data(){return{menu:!1,internalTag:this.tag,rules:{noColon:[t=>!!t||"Required.",t=>!t.includes(":")||"Cannot contain a colon."]}}},watch:{menu(t){t?(this.isNew&&(this.internalTag={name:"",value:"",color:"#2196F3"}),this.$nextTick(()=>{this.$refs.form.resetValidation(),setTimeout(()=>{this.$refs.nameField.focus()},500)})):this.internalTag=this.tag}},methods:{deleteTag(t){this.$emit("delete-tag",t)},updateTag(t){!this.$refs.form.validate()||(this.$emit("update-tag",t),this.menu=!1,this.$refs.form.resetValidation())}}};var $t=function(){var e=this,i=e._self._c;return i(at,{attrs:{"close-on-content-click":!1,"close-on-click":!1,bottom:"",right:"",transition:"scale-transition",origin:"top left"},scopedSlots:e._u([{key:"activator",fn:function({on:s}){return[i(ct,e._g({staticClass:"mt-4 mr-1 ml-1 mb-4",attrs:{color:e.internalTag.color,"text-color":"white",close:e.close},on:{"click:close":function(n){return e.deleteTag(e.internalTag)}}},s),[e._v(" "+e._s(`${e.tag.name}:${e.tag.value}`)+" "),e.customIcon?i(p,{attrs:{right:""}},[e._v(" "+e._s(e.customIcon)+" ")]):e._e()],1)]}}]),model:{value:e.menu,callback:function(s){e.menu=s},expression:"menu"}},[i(nt,{staticStyle:{display:"flex","flex-direction":"row-reverse"},attrs:{width:"400"}},[i(_,{staticClass:"mt-2 mr-2",attrs:{icon:""},on:{click:function(s){e.menu=!1}}},[i(p,[e._v("mdi-close-circle")])],1),i(rt,{ref:"form"},[i(lt,[i(L,{ref:"nameField",attrs:{outlined:"",dense:"",label:"Name",rules:e.rules.noColon,required:""},model:{value:e.internalTag.name,callback:function(s){e.$set(e.internalTag,"name",s)},expression:"internalTag.name"}}),i(L,{attrs:{outlined:"",dense:"",label:"Value",rules:e.rules.noColon,required:""},model:{value:e.internalTag.value,callback:function(s){e.$set(e.internalTag,"value",s)},expression:"internalTag.value"}}),i(Ct,{attrs:{"hide-inputs":"","dot-size":"16",mode:"hexa","swatches-max-height":"100"},model:{value:e.internalTag.color,callback:function(s){e.$set(e.internalTag,"color",s)},expression:"internalTag.color"}})],1),i(ot,[i(ht),i(_,{attrs:{color:"green",text:""},on:{click:function(s){return e.updateTag(e.internalTag)}}},[e._v(" Update ")])],1)],1)],1)],1)},yt=[],St=H(wt,$t,yt,!1,null,null,null,null);const C=St.exports;const xt={name:"TagViewer",components:{TagChip:C},props:{tags:{type:Array,default:()=>[]}},data(){return{menu:{}}},methods:{deleteTag(t){this.$emit("delete-tag",t)},updateTag(t){this.$emit("update-tag",t)},newTag(t){this.$emit("new-tag",t)}}};var Vt=function(){var e=this,i=e._self._c;return i("div",{staticStyle:{display:"flex","flex-direction":"row-reverse"}},[i("div",e._l(e.tags,function(s){return i(C,{key:s.id,attrs:{tag:s},on:{"delete-tag":e.deleteTag,"update-tag":e.updateTag}})}),1),i("div",[i(C,{attrs:{"is-new":!0,close:!1,"custom-icon":"mdi-plus-circle"},on:{"update-tag":e.newTag}})],1)])},Tt=[],Mt=H(xt,Vt,Tt,!1,null,null,null,null);const Ft=Mt.exports;export{Ft as _}; diff --git a/dist/assets/TechniqueChips.5e972795.js b/dist/assets/TechniqueChips.6a91dd2f.js similarity index 73% rename from dist/assets/TechniqueChips.5e972795.js rename to dist/assets/TechniqueChips.6a91dd2f.js index 8e0da19..be4ad9f 100644 --- a/dist/assets/TechniqueChips.5e972795.js +++ b/dist/assets/TechniqueChips.6a91dd2f.js @@ -1 +1 @@ -import{n as s}from"./index.154e9cc6.js";import{b as l}from"./VSelect.27a57f2b.js";const _={name:"TechniqueChips",props:{techniques:{type:Array,default:()=>[]},showTitle:{type:Boolean,default:!0}},methods:{getTechniqueUrl(r){if(r.includes(".")){const[e,n]=r.split(".");return`https://attack.mitre.org/techniques/${e}/${n}`}return`https://attack.mitre.org/techniques/${r}`}}};var i=function(){var e=this,n=e._self._c;return e.techniques.length>0?n("div",{staticClass:"flex flex-row flex-wrap mb-2"},[e.showTitle?n("span",{staticClass:"mr-2"},[e._v("Techniques:")]):e._e(),e._l(e.techniques.filter(t=>t!==""),function(t){return n(l,{key:t,staticClass:"mr-1 mb-1",attrs:{small:"",href:e.getTechniqueUrl(t),target:"_blank",rel:"noopener noreferrer",color:"green"}},[e._v(" "+e._s(t)+" ")])})],2):e._e()},o=[],a=s(_,i,o,!1,null,null,null,null);const p=a.exports;export{p as _}; +import{n as s}from"./index.85262dd3.js";import{a as l}from"./VSelect.8543571f.js";const _={name:"TechniqueChips",props:{techniques:{type:Array,default:()=>[]},showTitle:{type:Boolean,default:!0}},methods:{getTechniqueUrl(r){if(r.includes(".")){const[e,n]=r.split(".");return`https://attack.mitre.org/techniques/${e}/${n}`}return`https://attack.mitre.org/techniques/${r}`}}};var i=function(){var e=this,n=e._self._c;return e.techniques.length>0?n("div",{staticClass:"flex flex-row flex-wrap mb-2"},[e.showTitle?n("span",{staticClass:"mr-2"},[e._v("Techniques:")]):e._e(),e._l(e.techniques.filter(t=>t!==""),function(t){return n(l,{key:t,staticClass:"mr-1 mb-1",attrs:{small:"",href:e.getTechniqueUrl(t),target:"_blank",rel:"noopener noreferrer",color:"green"}},[e._v(" "+e._s(t)+" ")])})],2):e._e()},a=[],o=s(_,i,a,!1,null,null,null,null);const p=o.exports;export{p as _}; diff --git a/dist/assets/TechniqueChips.e3b0c442.css b/dist/assets/TechniqueChips.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/TooltipButton.6022e185.js b/dist/assets/TooltipButton.6f10f736.js similarity index 85% rename from dist/assets/TooltipButton.6022e185.js rename to dist/assets/TooltipButton.6f10f736.js index 388e420..3d50a16 100644 --- a/dist/assets/TooltipButton.6022e185.js +++ b/dist/assets/TooltipButton.6f10f736.js @@ -1 +1 @@ -import{n as o,b as l,c as _}from"./index.154e9cc6.js";import{_ as a}from"./VTooltip.b258437e.js";const r={name:"TooltipButton",props:{icon:{type:String,required:!0},text:{type:String,required:!0},padLeft:{type:Number,default:0},color:{type:String,default:""},flat:{type:Boolean,default:!1},to:{type:Object,default:null},xSmall:{type:Boolean,default:!1}}};var s=function(){var t=this,e=t._self._c;return e(a,{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function({on:n}){return[e(l,t._g({staticClass:"mr-5",attrs:{color:t.flat?"":t.color,to:t.to,icon:"",small:!t.xSmall,"x-small":t.xSmall},on:{click:function(i){return t.$emit("click")}}},n),[e(_,{style:t.padLeft!==0?`padding-left: ${t.padLeft}px`:""},[t._v(" "+t._s(t.icon)+" ")])],1)]}}])},[e("span",[t._v(t._s(t.text))])])},u=[],p=o(r,s,u,!1,null,null,null,null);const d=p.exports;export{d as _}; +import{n as o,b as l,c as _}from"./index.85262dd3.js";import{_ as a}from"./VTooltip.0c849a74.js";const r={name:"TooltipButton",props:{icon:{type:String,required:!0},text:{type:String,required:!0},padLeft:{type:Number,default:0},color:{type:String,default:""},flat:{type:Boolean,default:!1},to:{type:Object,default:null},xSmall:{type:Boolean,default:!1}}};var s=function(){var t=this,e=t._self._c;return e(a,{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function({on:n}){return[e(l,t._g({staticClass:"mr-5",attrs:{color:t.flat?"":t.color,to:t.to,icon:"",small:!t.xSmall,"x-small":t.xSmall},on:{click:function(i){return t.$emit("click")}}},n),[e(_,{style:t.padLeft!==0?`padding-left: ${t.padLeft}px`:""},[t._v(" "+t._s(t.icon)+" ")])],1)]}}])},[e("span",[t._v(t._s(t.text))])])},u=[],p=o(r,s,u,!1,null,null,null,null);const d=p.exports;export{d as _}; diff --git a/dist/assets/TooltipButton.e3b0c442.css b/dist/assets/TooltipButton.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/TooltipButtonToggle.63686f71.js b/dist/assets/TooltipButtonToggle.3ddc5ac1.js similarity index 89% rename from dist/assets/TooltipButtonToggle.63686f71.js rename to dist/assets/TooltipButtonToggle.3ddc5ac1.js index f77fd01..f4c667e 100644 --- a/dist/assets/TooltipButtonToggle.63686f71.js +++ b/dist/assets/TooltipButtonToggle.3ddc5ac1.js @@ -1 +1 @@ -import{m as r,C as u,n as i,b as p,c as _}from"./index.154e9cc6.js";import{B as o}from"./VExpansionPanels.1f915cd7.js";import{_ as g}from"./VTooltip.b258437e.js";const s=o.extend({name:"button-group",provide(){return{btnToggle:this}},computed:{classes(){return o.options.computed.classes.call(this)}},methods:{genData:o.options.methods.genData}});const c=r(s,u).extend({name:"v-btn-toggle",props:{backgroundColor:String,borderless:Boolean,dense:Boolean,group:Boolean,rounded:Boolean,shaped:Boolean,tile:Boolean},computed:{classes(){return{...s.options.computed.classes.call(this),"v-btn-toggle":!0,"v-btn-toggle--borderless":this.borderless,"v-btn-toggle--dense":this.dense,"v-btn-toggle--group":this.group,"v-btn-toggle--rounded":this.rounded,"v-btn-toggle--shaped":this.shaped,"v-btn-toggle--tile":this.tile,...this.themeClasses}}},methods:{genData(){const e=this.setTextColor(this.color,{...s.options.methods.genData.call(this)});return this.group?e:this.setBackgroundColor(this.backgroundColor,e)}}});const d={name:"TooltipButtonToggle",props:{value:{type:Boolean,default:!1},icon:{type:String,required:!0},buttonText:{type:String,default:""},text:{type:String,required:!0}},data(){return{internalValue:!1}},watch:{value:{immediate:!0,handler(e){this.internalValue=e}},internalValue:{handler(e){this.$emit("input",e)}}}};var m=function(){var t=this,n=t._self._c;return n(g,{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function({on:l}){return[n(c,{staticClass:"mr-5",model:{value:t.internalValue,callback:function(a){t.internalValue=a},expression:"internalValue"}},[n(p,t._g({attrs:{value:!0}},l),[n(_,{attrs:{left:""}},[t._v(" "+t._s(t.icon)+" ")]),n("span",[t._v(t._s(t.buttonText))])],1)],1)]}}])},[n("span",[t._v(t._s(t.text))])])},h=[],v=i(d,m,h,!1,null,null,null,null);const x=v.exports;export{x as _}; +import{m as r,C as u,n as i,b as p,c as _}from"./index.85262dd3.js";import{B as o}from"./VExpansionPanels.d99facd5.js";import{_ as g}from"./VTooltip.0c849a74.js";const s=o.extend({name:"button-group",provide(){return{btnToggle:this}},computed:{classes(){return o.options.computed.classes.call(this)}},methods:{genData:o.options.methods.genData}});const c=r(s,u).extend({name:"v-btn-toggle",props:{backgroundColor:String,borderless:Boolean,dense:Boolean,group:Boolean,rounded:Boolean,shaped:Boolean,tile:Boolean},computed:{classes(){return{...s.options.computed.classes.call(this),"v-btn-toggle":!0,"v-btn-toggle--borderless":this.borderless,"v-btn-toggle--dense":this.dense,"v-btn-toggle--group":this.group,"v-btn-toggle--rounded":this.rounded,"v-btn-toggle--shaped":this.shaped,"v-btn-toggle--tile":this.tile,...this.themeClasses}}},methods:{genData(){const e=this.setTextColor(this.color,{...s.options.methods.genData.call(this)});return this.group?e:this.setBackgroundColor(this.backgroundColor,e)}}});const d={name:"TooltipButtonToggle",props:{value:{type:Boolean,default:!1},icon:{type:String,required:!0},buttonText:{type:String,default:""},text:{type:String,required:!0}},data(){return{internalValue:!1}},watch:{value:{immediate:!0,handler(e){this.internalValue=e}},internalValue:{handler(e){this.$emit("input",e)}}}};var m=function(){var t=this,n=t._self._c;return n(g,{attrs:{bottom:""},scopedSlots:t._u([{key:"activator",fn:function({on:l}){return[n(c,{staticClass:"mr-5",model:{value:t.internalValue,callback:function(a){t.internalValue=a},expression:"internalValue"}},[n(p,t._g({attrs:{value:!0}},l),[n(_,{attrs:{left:""}},[t._v(" "+t._s(t.icon)+" ")]),n("span",[t._v(t._s(t.buttonText))])],1)],1)]}}])},[n("span",[t._v(t._s(t.text))])])},h=[],v=i(d,m,h,!1,null,null,null,null);const x=v.exports;export{x as _}; diff --git a/dist/assets/UserEdit.30fed1a1.js b/dist/assets/UserEdit.30fed1a1.js new file mode 100644 index 0000000..7543fe1 --- /dev/null +++ b/dist/assets/UserEdit.30fed1a1.js @@ -0,0 +1 @@ +import{_ as i}from"./ErrorStateAlert.5e9140da.js";import{_ as n}from"./EditPageTop.30f77a9c.js";import{aH as d,bz as l,bA as m,bB as u,n as c,f,aB as p,o as a}from"./index.85262dd3.js";import{_ as o}from"./VSwitch.8a27782c.js";import"./TooltipButton.6f10f736.js";import"./VTooltip.0c849a74.js";import"./VBreadcrumbs.32f4f2d0.js";const h={name:"UserEdit",components:{ErrorStateAlert:i,EditPageTop:n},data(){return{form:{username:"",password:"",confirm_password:"",is_admin:!1},rules:{name:[s=>!!s||"Name is required",s=>!!s&&s.length>3||"Name must be larger than 3 characters"],password:[s=>!!s||"Password is required",s=>!!s&&s.length>5||"Password must be larger than 5 characters"],confirmPassword:[s=>!!s||"Confirmation is required",s=>s===this.form.password||"Password must match"]},user:{},valid:!0,loading:!1,showPassword:!1,showConfirm:!1,errorState:!1}},computed:{...d({isAdmin:"application/isAdmin"}),breads(){return[{text:"Users",disabled:!1,to:"/users",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/users-edit"}]},breadcrumbName(){return this.user.username?this.user.username:this.id?this.id:"New"},isNew(){return this.$route.name==="userNew"},id(){return this.$route.params.id}},mounted(){this.isNew||this.getUser(this.id)},methods:{submit(){this.loading||!this.$refs.form.validate()||(this.loading=!0,this.id>0?l(this.form).then(()=>{this.$snack.success("User updated"),this.loading=!1}).catch(s=>{this.$snack.error(`Error: ${s}`),this.loading=!1}):m(this.form).then(({id:s})=>{this.$snack.success("User created"),this.loading=!1,this.$router.push({name:"userEdit",params:{id:s}})}).catch(s=>{this.$snack.error(`Error: ${s}`),this.loading=!1}))},getUser(s){u(s).then(e=>{this.user=e,this.form=e}).catch(()=>{this.errorState=!0})}}};var _=function(){var e=this,t=e._self._c;return t("div",[t(n,{attrs:{breads:e.breads,"show-submit":!0,"show-copy":!1,"show-delete":!1,"submit-loading":e.loading},on:{submit:e.submit}}),t("h3",[e._v(e._s(e.id?"Edit":"New")+" User")]),e.errorState?t(i,{attrs:{"resource-id":e.id,"resource-type":"user"}}):t(f,{staticStyle:{padding:"10px"}},[t(p,{ref:"form",staticStyle:{"max-width":"500px"},nativeOn:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}},model:{value:e.valid,callback:function(r){e.valid=r},expression:"valid"}},[t(a,{attrs:{rules:e.rules.name,label:"Username",outlined:"",dense:"",required:"",disabled:!e.isNew},model:{value:e.form.username,callback:function(r){e.$set(e.form,"username",r)},expression:"form.username"}}),e.isNew?t(a,{attrs:{type:e.showPassword?"text":"password","append-icon":e.showPassword?"fa-eye":"fa-eye-slash",rules:e.rules.password,label:"Password",autocomplete:"off",outlined:"",dense:"",required:""},on:{"click:append":function(r){e.showPassword=!e.showPassword}},model:{value:e.form.password,callback:function(r){e.$set(e.form,"password",r)},expression:"form.password"}}):e._e(),e.isNew?t(a,{attrs:{type:e.showConfirm?"text":"password","append-icon":e.showConfirm?"fa-eye":"fa-eye-slash",rules:e.rules.confirmPassword,label:"Confirm Password",autocomplete:"off",outlined:"",dense:"",required:""},on:{"click:append":function(r){e.showConfirm=!e.showConfirm}},model:{value:e.form.confirm_password,callback:function(r){e.$set(e.form,"confirm_password",r)},expression:"form.confirm_password"}}):e._e(),e.isAdmin?t(o,{attrs:{label:"Admin"},model:{value:e.form.is_admin,callback:function(r){e.$set(e.form,"is_admin",r)},expression:"form.is_admin"}}):e._e(),e.isNew?e._e():t(o,{attrs:{label:"Enabled"},model:{value:e.form.enabled,callback:function(r){e.$set(e.form,"enabled",r)},expression:"form.enabled"}})],1)],1)],1)},w=[],b=c(h,_,w,!1,null,null,null,null);const U=b.exports;export{U as default}; diff --git a/dist/assets/UserEdit.a6c4b750.js b/dist/assets/UserEdit.a6c4b750.js deleted file mode 100644 index ad58604..0000000 --- a/dist/assets/UserEdit.a6c4b750.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i}from"./ErrorStateAlert.3518d55f.js";import{_ as n}from"./EditPageTop.0db28cea.js";import{aK as d,bv as l,bw as m,bx as u,n as c,r as f,aE as p,j as a}from"./index.154e9cc6.js";import{_ as o}from"./VSwitch.4adac3f4.js";import"./index.41ea8dd2.js";import"./TooltipButton.6022e185.js";import"./VTooltip.b258437e.js";import"./index.27090f0f.js";import"./VBreadcrumbs.a2278375.js";const h={name:"UserEdit",components:{ErrorStateAlert:i,EditPageTop:n},data(){return{form:{username:"",password:"",confirm_password:"",is_admin:!1},rules:{name:[s=>!!s||"Name is required",s=>!!s&&s.length>3||"Name must be larger than 3 characters"],password:[s=>!!s||"Password is required",s=>!!s&&s.length>5||"Password must be larger than 5 characters"],confirmPassword:[s=>!!s||"Confirmation is required",s=>s===this.form.password||"Password must match"]},user:{},valid:!0,loading:!1,showPassword:!1,showConfirm:!1,errorState:!1}},computed:{...d({isAdmin:"application/isAdmin"}),breads(){return[{text:"Users",disabled:!1,to:"/users",exact:!0},{text:this.breadcrumbName,disabled:!0,to:"/users-edit"}]},breadcrumbName(){return this.user.username?this.user.username:this.id?this.id:"New"},isNew(){return this.$route.name==="userNew"},id(){return this.$route.params.id}},mounted(){this.isNew||this.getUser(this.id)},methods:{submit(){this.loading||!this.$refs.form.validate()||(this.loading=!0,this.id>0?l(this.form).then(()=>{this.$snack.success("User updated"),this.loading=!1}).catch(s=>{this.$snack.error(`Error: ${s}`),this.loading=!1}):m(this.form).then(({id:s})=>{this.$snack.success("User created"),this.loading=!1,this.$router.push({name:"userEdit",params:{id:s}})}).catch(s=>{this.$snack.error(`Error: ${s}`),this.loading=!1}))},getUser(s){u(s).then(e=>{this.user=e,this.form=e}).catch(()=>{this.errorState=!0})}}};var _=function(){var e=this,t=e._self._c;return t("div",[t(n,{attrs:{breads:e.breads,"show-submit":!0,"show-copy":!1,"show-delete":!1,"submit-loading":e.loading},on:{submit:e.submit}}),t("h3",[e._v(e._s(e.id?"Edit":"New")+" User")]),e.errorState?t(i,{attrs:{"resource-id":e.id,"resource-type":"user"}}):t(f,{staticStyle:{padding:"10px"}},[t(p,{ref:"form",staticStyle:{"max-width":"500px"},nativeOn:{submit:function(r){return r.preventDefault(),e.submit.apply(null,arguments)}},model:{value:e.valid,callback:function(r){e.valid=r},expression:"valid"}},[t(a,{attrs:{rules:e.rules.name,label:"Username",outlined:"",dense:"",required:"",disabled:!e.isNew},model:{value:e.form.username,callback:function(r){e.$set(e.form,"username",r)},expression:"form.username"}}),e.isNew?t(a,{attrs:{type:e.showPassword?"text":"password","append-icon":e.showPassword?"fa-eye":"fa-eye-slash",rules:e.rules.password,label:"Password",autocomplete:"off",outlined:"",dense:"",required:""},on:{"click:append":function(r){e.showPassword=!e.showPassword}},model:{value:e.form.password,callback:function(r){e.$set(e.form,"password",r)},expression:"form.password"}}):e._e(),e.isNew?t(a,{attrs:{type:e.showConfirm?"text":"password","append-icon":e.showConfirm?"fa-eye":"fa-eye-slash",rules:e.rules.confirmPassword,label:"Confirm Password",autocomplete:"off",outlined:"",dense:"",required:""},on:{"click:append":function(r){e.showConfirm=!e.showConfirm}},model:{value:e.form.confirm_password,callback:function(r){e.$set(e.form,"confirm_password",r)},expression:"form.confirm_password"}}):e._e(),e.isAdmin?t(o,{attrs:{label:"Admin"},model:{value:e.form.is_admin,callback:function(r){e.$set(e.form,"is_admin",r)},expression:"form.is_admin"}}):e._e(),e.isNew?e._e():t(o,{attrs:{label:"Enabled"},model:{value:e.form.enabled,callback:function(r){e.$set(e.form,"enabled",r)},expression:"form.enabled"}})],1)],1)],1)},w=[],b=c(h,_,w,!1,null,null,null,null);const E=b.exports;export{E as default}; diff --git a/dist/assets/UserEdit.e3b0c442.css b/dist/assets/UserEdit.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/Users.d056f2cf.js b/dist/assets/Users.d056f2cf.js new file mode 100644 index 0000000..f81cccc --- /dev/null +++ b/dist/assets/Users.d056f2cf.js @@ -0,0 +1 @@ +import{_ as o}from"./ListPageTop.2a204a11.js";import{e as i,aH as u,bz as _,n as d}from"./index.85262dd3.js";import{h as l}from"./moment.9709ab41.js";import{_ as m}from"./VDataTable.125536b6.js";import{_ as c}from"./VSelect.8543571f.js";import{_ as p}from"./VTooltip.0c849a74.js";import{_ as f}from"./VSwitch.8a27782c.js";import"./VBreadcrumbs.32f4f2d0.js";const h={name:"Users",components:{ListPageTop:o},data(){return{moment:l,breads:[{text:"Users",disabled:!0,href:"/users"}],headers:[{text:"Name",value:"username"},{text:"Is Admin",value:"is_admin"},{text:"Actions",value:"actions",sortable:!1}]}},computed:{...i({users:t=>t.user.users}),...u({isAdmin:"application/isAdmin"})},mounted(){this.getUsers()},methods:{create(){this.$router.push({name:"userNew"})},async disableUser(t){_(t).catch(e=>{this.$snack.error(`Error: ${e}`),t.enabled=!t.enabled})},getUsers(){this.$store.dispatch("user/getUsers")}}};var b=function(){var e=this,n=e._self._c;return n("div",[n(o,{attrs:{breads:e.breads,"show-create":e.isAdmin,"show-refresh":!0,"show-delete":!1},on:{create:e.create,refresh:e.getUsers}}),n(m,{attrs:{headers:e.headers,items:e.users,dense:""},scopedSlots:e._u([{key:"item.username",fn:function({item:s}){return[e.isAdmin?n("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"userEdit",params:{id:s.id}}}},[e._v(" "+e._s(s.username)+" ")]):n("span",[e._v(e._s(s.username))])]}},{key:"item.is_admin",fn:function({item:s}){return[n(c,{attrs:{disabled:""},model:{value:s.is_admin,callback:function(r){e.$set(s,"is_admin",r)},expression:"item.is_admin"}})]}},{key:"item.actions",fn:function({item:s}){return[e.isAdmin?n(p,{attrs:{disabled:!s.admin,top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r}){return[n("div",e._g({staticStyle:{"max-width":"120px"}},r),[n(f,e._g({attrs:{disabled:s.admin,label:"Enabled"},on:{change:function(a){return e.disableUser(s)}},model:{value:s.enabled,callback:function(a){e.$set(s,"enabled",a)},expression:"item.enabled"}},r))],1)]}}],null,!0)},[n("span",[e._v("Cannot disable admin user")])]):e._e()]}}])})],1)},v=[],g=d(h,b,v,!1,null,null,null,null);const E=g.exports;export{E as default}; diff --git a/dist/assets/Users.e3b0c442.css b/dist/assets/Users.e3b0c442.css deleted file mode 100644 index e69de29..0000000 diff --git a/dist/assets/Users.e4702495.js b/dist/assets/Users.e4702495.js deleted file mode 100644 index 1eafe62..0000000 --- a/dist/assets/Users.e4702495.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as i}from"./ListPageTop.dad49f81.js";import{i as o,aK as u,bv as d,n as _}from"./index.154e9cc6.js";import{h as l}from"./moment.9709ab41.js";import{_ as m}from"./VDataTable.71ce8bb9.js";import{a as c}from"./VSelect.27a57f2b.js";import{_ as p}from"./VTooltip.b258437e.js";import{_ as f}from"./VSwitch.4adac3f4.js";import"./VBreadcrumbs.a2278375.js";import"./index.27090f0f.js";const h={name:"Users",components:{ListPageTop:i},data(){return{moment:l,breads:[{text:"Users",disabled:!0,href:"/users"}],headers:[{text:"Name",value:"username"},{text:"Is Admin",value:"is_admin"},{text:"Actions",value:"actions",sortable:!1}]}},computed:{...o({users:t=>t.user.users}),...u({isAdmin:"application/isAdmin"})},mounted(){this.getUsers()},methods:{create(){this.$router.push({name:"userNew"})},async disableUser(t){d(t).catch(e=>{this.$snack.error(`Error: ${e}`),t.enabled=!t.enabled})},getUsers(){this.$store.dispatch("user/getUsers")}}};var b=function(){var e=this,n=e._self._c;return n("div",[n(i,{attrs:{breads:e.breads,"show-create":e.isAdmin,"show-refresh":!0,"show-delete":!1},on:{create:e.create,refresh:e.getUsers}}),n(m,{attrs:{headers:e.headers,items:e.users,dense:""},scopedSlots:e._u([{key:"item.username",fn:function({item:s}){return[e.isAdmin?n("router-link",{staticStyle:{color:"inherit"},attrs:{to:{name:"userEdit",params:{id:s.id}}}},[e._v(" "+e._s(s.username)+" ")]):n("span",[e._v(e._s(s.username))])]}},{key:"item.is_admin",fn:function({item:s}){return[n(c,{attrs:{disabled:""},model:{value:s.is_admin,callback:function(r){e.$set(s,"is_admin",r)},expression:"item.is_admin"}})]}},{key:"item.actions",fn:function({item:s}){return[e.isAdmin?n(p,{attrs:{disabled:!s.admin,top:""},scopedSlots:e._u([{key:"activator",fn:function({on:r}){return[n("div",e._g({staticStyle:{"max-width":"120px"}},r),[n(f,e._g({attrs:{disabled:s.admin,label:"Enabled"},on:{change:function(a){return e.disableUser(s)}},model:{value:s.enabled,callback:function(a){e.$set(s,"enabled",a)},expression:"item.enabled"}},r))],1)]}}],null,!0)},[n("span",[e._v("Cannot disable admin user")])]):e._e()]}}])})],1)},v=[],g=_(h,b,v,!1,null,null,null,null);const C=g.exports;export{C as default}; diff --git a/dist/assets/VBreadcrumbs.a2278375.js b/dist/assets/VBreadcrumbs.32f4f2d0.js similarity index 94% rename from dist/assets/VBreadcrumbs.a2278375.js rename to dist/assets/VBreadcrumbs.32f4f2d0.js index f7b8bda..fede420 100644 --- a/dist/assets/VBreadcrumbs.a2278375.js +++ b/dist/assets/VBreadcrumbs.32f4f2d0.js @@ -1 +1 @@ -import{m as a,R as n,d,T as l}from"./index.154e9cc6.js";const c=a(n).extend({name:"v-breadcrumbs-item",props:{activeClass:{type:String,default:"v-breadcrumbs__item--disabled"},ripple:{type:[Boolean,Object],default:!1}},computed:{classes(){return{"v-breadcrumbs__item":!0,[this.activeClass]:this.disabled}}},render(e){const{tag:t,data:s}=this.generateRouteLink();return e("li",[e(t,{...s,attrs:{...s.attrs,"aria-current":this.isActive&&this.isLink?"page":void 0}},this.$slots.default)])}}),m=d("v-breadcrumbs__divider","li"),u=a(l).extend({name:"v-breadcrumbs",props:{divider:{type:String,default:"/"},items:{type:Array,default:()=>[]},large:Boolean},computed:{classes(){return{"v-breadcrumbs--large":this.large,...this.themeClasses}}},methods:{genDivider(){return this.$createElement(m,this.$slots.divider?this.$slots.divider:this.divider)},genItems(){const e=[],t=!!this.$scopedSlots.item,s=[];for(let i=0;i[]},large:Boolean},computed:{classes(){return{"v-breadcrumbs--large":this.large,...this.themeClasses}}},methods:{genDivider(){return this.$createElement(m,this.$slots.divider?this.$slots.divider:this.divider)},genItems(){const e=[],t=!!this.$scopedSlots.item,s=[];for(let i=0;i[]},options:{type:Object,default:()=>({})},sortBy:{type:[String,Array]},sortDesc:{type:[Boolean,Array]},customSort:{type:Function,default:j},mustSort:Boolean,multiSort:Boolean,page:{type:Number,default:1},itemsPerPage:{type:Number,default:10},groupBy:{type:[String,Array],default:()=>[]},groupDesc:{type:[Boolean,Array],default:()=>[]},customGroup:{type:Function,default:R},locale:{type:String,default:"en-US"},disableSort:Boolean,disablePagination:Boolean,disableFiltering:Boolean,search:String,customFilter:{type:Function,default:W},serverItemsLength:{type:Number,default:-1}},data(){let t={page:this.page,itemsPerPage:this.itemsPerPage,sortBy:c(this.sortBy),sortDesc:c(this.sortDesc),groupBy:c(this.groupBy),groupDesc:c(this.groupDesc),mustSort:this.mustSort,multiSort:this.multiSort};this.options&&(t=Object.assign(t,this.options));const{sortBy:e,sortDesc:s,groupBy:i,groupDesc:a}=t,n=e.length-s.length,o=i.length-a.length;return n>0&&t.sortDesc.push(...w(n,!1)),o>0&&t.groupDesc.push(...w(o,!1)),{internalOptions:t}},computed:{itemsLength(){return this.serverItemsLength>=0?this.serverItemsLength:this.filteredItems.length},pageCount(){return this.internalOptions.itemsPerPage<=0?1:Math.ceil(this.itemsLength/this.internalOptions.itemsPerPage)},pageStart(){return this.internalOptions.itemsPerPage===-1||!this.items.length?0:(this.internalOptions.page-1)*this.internalOptions.itemsPerPage},pageStop(){return this.internalOptions.itemsPerPage===-1?this.itemsLength:this.items.length?Math.min(this.itemsLength,this.internalOptions.page*this.internalOptions.itemsPerPage):0},isGrouped(){return!!this.internalOptions.groupBy.length},pagination(){return{page:this.internalOptions.page,itemsPerPage:this.internalOptions.itemsPerPage,pageStart:this.pageStart,pageStop:this.pageStop,pageCount:this.pageCount,itemsLength:this.itemsLength}},filteredItems(){let t=this.items.slice();return!this.disableFiltering&&this.serverItemsLength<=0&&(t=this.customFilter(t,this.search)),t},computedItems(){let t=this.filteredItems.slice();return(!this.disableSort||this.internalOptions.groupBy.length)&&this.serverItemsLength<=0&&(t=this.sortItems(t)),!this.disablePagination&&this.serverItemsLength<=0&&(t=this.paginateItems(t)),t},groupedItems(){return this.isGrouped?this.groupItems(this.computedItems):null},scopedProps(){return{sort:this.sort,sortArray:this.sortArray,group:this.group,items:this.computedItems,options:this.internalOptions,updateOptions:this.updateOptions,pagination:this.pagination,groupedItems:this.groupedItems,originalItemsLength:this.items.length}},computedOptions(){return{...this.options}}},watch:{computedOptions:{handler(t,e){p(t,e)||this.updateOptions(t)},deep:!0,immediate:!0},internalOptions:{handler(t,e){p(t,e)||this.$emit("update:options",t)},deep:!0,immediate:!0},page(t){this.updateOptions({page:t})},"internalOptions.page"(t){this.$emit("update:page",t)},itemsPerPage(t){this.updateOptions({itemsPerPage:t})},"internalOptions.itemsPerPage"(t){this.$emit("update:items-per-page",t)},sortBy(t){this.updateOptions({sortBy:c(t)})},"internalOptions.sortBy"(t,e){!p(t,e)&&this.$emit("update:sort-by",Array.isArray(this.sortBy)?t:t[0])},sortDesc(t){this.updateOptions({sortDesc:c(t)})},"internalOptions.sortDesc"(t,e){!p(t,e)&&this.$emit("update:sort-desc",Array.isArray(this.sortDesc)?t:t[0])},groupBy(t){this.updateOptions({groupBy:c(t)})},"internalOptions.groupBy"(t,e){!p(t,e)&&this.$emit("update:group-by",Array.isArray(this.groupBy)?t:t[0])},groupDesc(t){this.updateOptions({groupDesc:c(t)})},"internalOptions.groupDesc"(t,e){!p(t,e)&&this.$emit("update:group-desc",Array.isArray(this.groupDesc)?t:t[0])},multiSort(t){this.updateOptions({multiSort:t})},"internalOptions.multiSort"(t){this.$emit("update:multi-sort",t)},mustSort(t){this.updateOptions({mustSort:t})},"internalOptions.mustSort"(t){this.$emit("update:must-sort",t)},pageCount:{handler(t){this.$emit("page-count",t)},immediate:!0},computedItems:{handler(t){this.$emit("current-items",t)},immediate:!0},pagination:{handler(t,e){p(t,e)||this.$emit("pagination",this.pagination)},immediate:!0}},methods:{toggle(t,e,s,i,a,n){let o=e.slice(),r=s.slice();const l=o.findIndex(d=>d===t);return l<0?(n||(o=[],r=[]),o.push(t),r.push(!1)):l>=0&&!r[l]?r[l]=!0:a?r[l]=!1:(o.splice(l,1),r.splice(l,1)),(!p(o,e)||!p(r,s))&&(i=1),{by:o,desc:r,page:i}},group(t){const{by:e,desc:s,page:i}=this.toggle(t,this.internalOptions.groupBy,this.internalOptions.groupDesc,this.internalOptions.page,!0,!1);this.updateOptions({groupBy:e,groupDesc:s,page:i})},sort(t){if(Array.isArray(t))return this.sortArray(t);const{by:e,desc:s,page:i}=this.toggle(t,this.internalOptions.sortBy,this.internalOptions.sortDesc,this.internalOptions.page,this.internalOptions.mustSort,this.internalOptions.multiSort);this.updateOptions({sortBy:e,sortDesc:s,page:i})},sortArray(t){const e=t.map(s=>{const i=this.internalOptions.sortBy.findIndex(a=>a===s);return i>-1?this.internalOptions.sortDesc[i]:!1});this.updateOptions({sortBy:t,sortDesc:e})},updateOptions(t){this.internalOptions={...this.internalOptions,...t,page:this.serverItemsLength<0?Math.max(1,Math.min(t.page||this.internalOptions.page,this.pageCount)):t.page||this.internalOptions.page}},sortItems(t){let e=[],s=[];return this.disableSort||(e=this.internalOptions.sortBy,s=this.internalOptions.sortDesc),this.internalOptions.groupBy.length&&(e=[...this.internalOptions.groupBy,...e],s=[...this.internalOptions.groupDesc,...s]),this.customSort(t,e,s,this.locale)},groupItems(t){return this.customGroup(t,this.internalOptions.groupBy,this.internalOptions.groupDesc)},paginateItems(t){return this.serverItemsLength===-1&&t.length<=this.pageStart&&(this.internalOptions.page=Math.max(1,Math.ceil(t.length/this.internalOptions.itemsPerPage))||1),t.slice(this.pageStart,this.pageStop)}},render(){return this.$scopedSlots.default&&this.$scopedSlots.default(this.scopedProps)}});const K=g.extend({name:"v-data-footer",props:{options:{type:Object,required:!0},pagination:{type:Object,required:!0},itemsPerPageOptions:{type:Array,default:()=>[5,10,15,-1]},prevIcon:{type:String,default:"$prev"},nextIcon:{type:String,default:"$next"},firstIcon:{type:String,default:"$first"},lastIcon:{type:String,default:"$last"},itemsPerPageText:{type:String,default:"$vuetify.dataFooter.itemsPerPageText"},itemsPerPageAllText:{type:String,default:"$vuetify.dataFooter.itemsPerPageAll"},showFirstLastPage:Boolean,showCurrentPage:Boolean,disablePagination:Boolean,disableItemsPerPage:Boolean,pageText:{type:String,default:"$vuetify.dataFooter.pageText"}},computed:{disableNextPageIcon(){return this.options.itemsPerPage<=0||this.options.page*this.options.itemsPerPage>=this.pagination.itemsLength||this.pagination.pageStop<0},computedDataItemsPerPageOptions(){return this.itemsPerPageOptions.map(t=>typeof t=="object"?t:this.genDataItemsPerPageOption(t))}},methods:{updateOptions(t){this.$emit("update:options",Object.assign({},this.options,t))},onFirstPage(){this.updateOptions({page:1})},onPreviousPage(){this.updateOptions({page:this.options.page-1})},onNextPage(){this.updateOptions({page:this.options.page+1})},onLastPage(){this.updateOptions({page:this.pagination.pageCount})},onChangeItemsPerPage(t){this.updateOptions({itemsPerPage:t,page:1})},genDataItemsPerPageOption(t){return{text:t===-1?this.$vuetify.lang.t(this.itemsPerPageAllText):String(t),value:t}},genItemsPerPageSelect(){let t=this.options.itemsPerPage;const e=this.computedDataItemsPerPageOptions;return e.length<=1?null:(e.find(s=>s.value===t)||(t=e[0]),this.$createElement("div",{staticClass:"v-data-footer__select"},[this.$vuetify.lang.t(this.itemsPerPageText),this.$createElement(H,{attrs:{"aria-label":this.$vuetify.lang.t(this.itemsPerPageText)},props:{disabled:this.disableItemsPerPage,items:e,value:t,hideDetails:!0,auto:!0,minWidth:"75px"},on:{input:this.onChangeItemsPerPage}})]))},genPaginationInfo(){let t=["\u2013"];const e=this.pagination.itemsLength;let s=this.pagination.pageStart,i=this.pagination.pageStop;return this.pagination.itemsLength&&this.pagination.itemsPerPage?(s=this.pagination.pageStart+1,i=e=this.pagination.pageCount||this.options.itemsPerPage===-1,this.$vuetify.lang.t("$vuetify.dataFooter.lastPage"),this.$vuetify.rtl?this.firstIcon:this.lastIcon))),[this.$createElement("div",{staticClass:"v-data-footer__icons-before"},t),this.showCurrentPage&&this.$createElement("span",[this.options.page.toString()]),this.$createElement("div",{staticClass:"v-data-footer__icons-after"},e)]}},render(){return this.$createElement("div",{staticClass:"v-data-footer"},[u(this,"prepend"),this.genItemsPerPageSelect(),this.genPaginationInfo(),this.genIcons()])}}),B=f(E,A).extend({name:"v-data-iterator",props:{...x.options.props,itemKey:{type:String,default:"id"},value:{type:Array,default:()=>[]},singleSelect:Boolean,expanded:{type:Array,default:()=>[]},mobileBreakpoint:{...E.options.props.mobileBreakpoint,default:600},singleExpand:Boolean,loading:[Boolean,String],noResultsText:{type:String,default:"$vuetify.dataIterator.noResultsText"},noDataText:{type:String,default:"$vuetify.noDataText"},loadingText:{type:String,default:"$vuetify.dataIterator.loadingText"},hideDefaultFooter:Boolean,footerProps:Object,selectableKey:{type:String,default:"isSelectable"}},data:()=>({selection:{},expansion:{},internalCurrentItems:[],shiftKeyDown:!1,lastEntry:-1}),computed:{everyItem(){return!!this.selectableItems.length&&this.selectableItems.every(t=>this.isSelected(t))},someItems(){return this.selectableItems.some(t=>this.isSelected(t))},sanitizedFooterProps(){return F(this.footerProps)},selectableItems(){return this.internalCurrentItems.filter(t=>this.isSelectable(t))}},watch:{value:{handler(t){this.selection=t.reduce((e,s)=>(e[h(s,this.itemKey)]=s,e),{})},immediate:!0},selection(t,e){p(Object.keys(t),Object.keys(e))||this.$emit("input",Object.values(t))},expanded:{handler(t){this.expansion=t.reduce((e,s)=>(e[h(s,this.itemKey)]=!0,e),{})},immediate:!0},expansion(t,e){if(p(t,e))return;const s=Object.keys(t).filter(a=>t[a]),i=s.length?this.items.filter(a=>s.includes(String(h(a,this.itemKey)))):[];this.$emit("update:expanded",i)}},created(){[["disable-initial-sort","sort-by"],["filter","custom-filter"],["pagination","options"],["total-items","server-items-length"],["hide-actions","hide-default-footer"],["rows-per-page-items","footer-props.items-per-page-options"],["rows-per-page-text","footer-props.items-per-page-text"],["prev-icon","footer-props.prev-icon"],["next-icon","footer-props.next-icon"]].forEach(([s,i])=>{this.$attrs.hasOwnProperty(s)&&k(s,i,this)}),["expand","content-class","content-props","content-tag"].forEach(s=>{this.$attrs.hasOwnProperty(s)&&G(s)})},mounted(){window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp)},beforeDestroy(){window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp)},methods:{onKeyDown(t){this.shiftKeyDown=t.keyCode===_.shift||t.shiftKey},onKeyUp(t){(t.keyCode===_.shift||!t.shiftKey)&&(this.shiftKeyDown=!1)},toggleSelectAll(t){const e=Object.assign({},this.selection);for(let s=0;sh(o,this.itemKey)===a);if(this.lastEntry===-1)this.lastEntry=n;else if(this.shiftKeyDown&&!this.singleSelect&&s){const o=h(this.selectableItems[this.lastEntry],this.itemKey),r=Object.keys(this.selection).includes(String(o));this.multipleSelect(r,s,i,n)}if(this.lastEntry=n,this.singleSelect&&s){const o=Object.keys(this.selection),r=o.length&&h(this.selection[o[0]],this.itemKey);r&&r!==a&&this.$emit("item-selected",{item:this.selection[r],value:!1})}this.selection=i,s&&this.$emit("item-selected",{item:t,value:e})},multipleSelect(t=!0,e=!0,s,i){const a=ithis.select(t,s),isSelected:this.isSelected(t),expand:s=>this.expand(t,s),isExpanded:this.isExpanded(t),isMobile:this.isMobile}},genEmptyWrapper(t){return this.$createElement("div",t)},genEmpty(t,e){if(t===0&&this.loading){const s=this.$slots.loading||this.$vuetify.lang.t(this.loadingText);return this.genEmptyWrapper(s)}else if(t===0){const s=this.$slots["no-data"]||this.$vuetify.lang.t(this.noDataText);return this.genEmptyWrapper(s)}else if(e===0){const s=this.$slots["no-results"]||this.$vuetify.lang.t(this.noResultsText);return this.genEmptyWrapper(s)}return null},genItems(t){const e=this.genEmpty(t.originalItemsLength,t.pagination.itemsLength);return e?[e]:this.$scopedSlots.default?this.$scopedSlots.default({...t,isSelected:this.isSelected,select:this.select,isExpanded:this.isExpanded,isMobile:this.isMobile,expand:this.expand}):this.$scopedSlots.item?t.items.map((s,i)=>this.$scopedSlots.item(this.createItemProps(s,i))):[]},genFooter(t){if(this.hideDefaultFooter)return null;const e={props:{...this.sanitizedFooterProps,options:t.options,pagination:t.pagination},on:{"update:options":i=>t.updateOptions(i)}},s=$("footer.",this.$scopedSlots);return this.$createElement(K,{scopedSlots:s,...e})},genDefaultScopedSlot(t){const e={...t,someItems:this.someItems,everyItem:this.everyItem,toggleSelectAll:this.toggleSelectAll};return this.$createElement("div",{staticClass:"v-data-iterator"},[u(this,"header",e,!0),this.genItems(t),this.genFooter(t),u(this,"footer",e,!0)])}},render(){return this.$createElement(x,{props:this.$props,on:{"update:options":(t,e)=>!p(t,e)&&this.$emit("update:options",t),"update:page":t=>this.$emit("update:page",t),"update:items-per-page":t=>this.$emit("update:items-per-page",t),"update:sort-by":t=>this.$emit("update:sort-by",t),"update:sort-desc":t=>this.$emit("update:sort-desc",t),"update:group-by":t=>this.$emit("update:group-by",t),"update:group-desc":t=>this.$emit("update:group-desc",t),pagination:(t,e)=>!p(t,e)&&this.$emit("pagination",t),"current-items":t=>{this.internalCurrentItems=t,this.$emit("current-items",t)},"page-count":t=>this.$emit("page-count",t)},scopedSlots:{default:this.genDefaultScopedSlot}})}});const I=f().extend({directives:{ripple:L},props:{headers:{type:Array,default:()=>[]},options:{type:Object,default:()=>({page:1,itemsPerPage:10,sortBy:[],sortDesc:[],groupBy:[],groupDesc:[],multiSort:!1,mustSort:!1})},checkboxColor:String,sortIcon:{type:String,default:"$sort"},everyItem:Boolean,someItems:Boolean,showGroupBy:Boolean,singleSelect:Boolean,disableSort:Boolean},methods:{genSelectAll(){var t;const e={props:{value:this.everyItem,indeterminate:!this.everyItem&&this.someItems,color:(t=this.checkboxColor)!==null&&t!==void 0?t:""},on:{input:s=>this.$emit("toggle-select-all",s)}};return this.$scopedSlots["data-table-select"]?this.$scopedSlots["data-table-select"](e):this.$createElement(M,{staticClass:"v-data-table__checkbox",...e})},genSortIcon(){return this.$createElement(b,{staticClass:"v-data-table-header__icon",props:{size:18}},[this.sortIcon])}}}),J=f(I).extend({name:"v-data-table-header-mobile",props:{sortByText:{type:String,default:"$vuetify.dataTable.sortBy"}},methods:{genSortChip(t){const e=[t.item.text],s=this.options.sortBy.findIndex(n=>n===t.item.value),i=s>=0,a=this.options.sortDesc[s];return e.push(this.$createElement("div",{staticClass:"v-chip__close",class:{sortable:!0,active:i,asc:i&&!a,desc:i&&a}},[this.genSortIcon()])),this.$createElement(q,{staticClass:"sortable",on:{click:n=>{n.stopPropagation(),this.$emit("sort",t.item.value)}}},e)},genSortSelect(t){return this.$createElement(H,{props:{label:this.$vuetify.lang.t(this.sortByText),items:t,hideDetails:!0,multiple:this.options.multiSort,value:this.options.multiSort?this.options.sortBy:this.options.sortBy[0],menuProps:{closeOnContentClick:!0}},on:{change:e=>this.$emit("sort",e)},scopedSlots:{selection:e=>this.genSortChip(e)}})}},render(t){const e=[],s=this.headers.find(o=>o.value==="data-table-select");s&&!this.singleSelect&&e.push(this.$createElement("div",{class:["v-data-table-header-mobile__select",...c(s.class)],attrs:{width:s.width}},[this.genSelectAll()]));const i=this.headers.filter(o=>o.sortable!==!1&&o.value!=="data-table-select").map(o=>({text:o.text,value:o.value}));!this.disableSort&&i.length&&e.push(this.genSortSelect(i));const a=e.length?t("th",[t("div",{staticClass:"v-data-table-header-mobile__wrapper"},e)]):void 0,n=t("tr",[a]);return t("thead",{staticClass:"v-data-table-header v-data-table-header-mobile"},[n])}}),Q=f(I).extend({name:"v-data-table-header-desktop",methods:{genGroupByToggle(t){return this.$createElement("span",{on:{click:e=>{e.stopPropagation(),this.$emit("group",t.value)}}},["group"])},getAria(t,e){const s=n=>this.$vuetify.lang.t(`$vuetify.dataTable.ariaLabel.${n}`);let i="none",a=[s("sortNone"),s("activateAscending")];return t?(e?(i="descending",a=[s("sortDescending"),s(this.options.mustSort?"activateAscending":"activateNone")]):(i="ascending",a=[s("sortAscending"),s("activateDescending")]),{ariaSort:i,ariaLabel:a.join(" ")}):{ariaSort:i,ariaLabel:a.join(" ")}},genHeader(t){const e={attrs:{role:"columnheader",scope:"col","aria-label":t.text||""},style:{width:P(t.width),minWidth:P(t.width)},class:[`text-${t.align||"start"}`,...c(t.class),t.divider&&"v-data-table__divider"],on:{}},s=[];if(t.value==="data-table-select"&&!this.singleSelect)return this.$createElement("th",e,[this.genSelectAll()]);if(s.push(this.$scopedSlots.hasOwnProperty(t.value)?this.$scopedSlots[t.value]({header:t}):this.$createElement("span",[t.text])),!this.disableSort&&(t.sortable||!t.hasOwnProperty("sortable"))){e.on.click=()=>this.$emit("sort",t.value);const i=this.options.sortBy.findIndex(l=>l===t.value),a=i>=0,n=this.options.sortDesc[i];e.class.push("sortable");const{ariaLabel:o,ariaSort:r}=this.getAria(a,n);e.attrs["aria-label"]+=`${t.text?": ":""}${o}`,e.attrs["aria-sort"]=r,a&&(e.class.push("active"),e.class.push(n?"desc":"asc")),t.align==="end"?s.unshift(this.genSortIcon()):s.push(this.genSortIcon()),this.options.multiSort&&a&&s.push(this.$createElement("span",{class:"v-data-table-header__sort-badge"},[String(i+1)]))}return this.showGroupBy&&t.groupable!==!1&&s.push(this.genGroupByToggle(t)),this.$createElement("th",e,s)}},render(){return this.$createElement("thead",{staticClass:"v-data-table-header"},[this.$createElement("tr",this.headers.map(t=>this.genHeader(t)))])}});function X(t){if(t.model&&t.on&&t.on.input)if(Array.isArray(t.on.input)){const e=t.on.input.indexOf(t.model.callback);e>-1&&t.on.input.splice(e,1)}else delete t.on.input}function Y(t,e){const s=[];for(const i in t)t.hasOwnProperty(i)&&s.push(e("template",{slot:i},t[i]));return s}const Z=g.extend({name:"v-data-table-header",functional:!0,props:{...I.options.props,mobile:Boolean},render(t,{props:e,data:s,slots:i}){X(s);const a=Y(i(),t);return s=N(s,{props:e}),e.mobile?t(J,s,a):t(Q,s,a)}});function tt(t){var e;return t.length!==1||!["td","th"].includes((e=t[0])===null||e===void 0?void 0:e.tag)}const et=g.extend({name:"row",functional:!0,props:{headers:Array,index:Number,item:Object,rtl:Boolean},render(t,{props:e,slots:s,data:i}){const a=s(),n=e.headers.map(o=>{const r=[],l=h(e.item,o.value),d=o.value,m=i.scopedSlots&&i.scopedSlots.hasOwnProperty(d)&&i.scopedSlots[d],y=a.hasOwnProperty(d)&&a[d];m?r.push(...c(m({item:e.item,isMobile:!1,header:o,index:e.index,value:l}))):y?r.push(...c(y)):r.push(l==null?l:String(l));const S=`text-${o.align||"start"}`;return tt(r)?t("td",{class:[S,o.cellClass,{"v-data-table__divider":o.divider}]},r):r});return t("tr",i,n)}}),D=g.extend({name:"row-group",functional:!0,props:{value:{type:Boolean,default:!0},headerClass:{type:String,default:"v-row-group__header"},contentClass:String,summaryClass:{type:String,default:"v-row-group__summary"}},render(t,{slots:e,props:s}){const i=e(),a=[];return i["column.header"]?a.push(t("tr",{staticClass:s.headerClass},i["column.header"])):i["row.header"]&&a.push(...i["row.header"]),i["row.content"]&&s.value&&a.push(...i["row.content"]),i["column.summary"]?a.push(t("tr",{staticClass:s.summaryClass},i["column.summary"])):i["row.summary"]&&a.push(...i["row.summary"]),a}});const st=f(A).extend({name:"v-simple-table",props:{dense:Boolean,fixedHeader:Boolean,height:[Number,String]},computed:{classes(){return{"v-data-table--dense":this.dense,"v-data-table--fixed-height":!!this.height&&!this.fixedHeader,"v-data-table--fixed-header":this.fixedHeader,"v-data-table--has-top":!!this.$slots.top,"v-data-table--has-bottom":!!this.$slots.bottom,...this.themeClasses}}},methods:{genWrapper(){return this.$slots.wrapper||this.$createElement("div",{staticClass:"v-data-table__wrapper",style:{height:P(this.height)}},[this.$createElement("table",this.$slots.default)])}},render(t){return t("div",{staticClass:"v-data-table",class:this.classes},[this.$slots.top,this.genWrapper(),this.$slots.bottom])}}),it=g.extend({name:"row",functional:!0,props:{headers:Array,hideDefaultHeader:Boolean,index:Number,item:Object,rtl:Boolean},render(t,{props:e,slots:s,data:i}){const a=s(),n=e.headers.map(o=>{const r={"v-data-table__mobile-row":!0},l=[],d=h(e.item,o.value),m=o.value,y=i.scopedSlots&&i.scopedSlots.hasOwnProperty(m)&&i.scopedSlots[m],S=a.hasOwnProperty(m)&&a[m];y?l.push(y({item:e.item,isMobile:!0,header:o,index:e.index,value:d})):S?l.push(S):l.push(d==null?d:String(d));const O=[t("div",{staticClass:"v-data-table__mobile-row__cell"},l)];return o.value!=="dataTableSelect"&&!e.hideDefaultHeader&&O.unshift(t("div",{staticClass:"v-data-table__mobile-row__header"},[o.text])),t("td",{class:r},O)});return t("tr",{...i,staticClass:"v-data-table__mobile-table-row"},n)}});function C(t,e,s){return i=>{const a=h(t,i.value);return i.filter?i.filter(a,e,t):s(a,e,t)}}function at(t,e,s,i,a){return e=typeof e=="string"?e.trim():null,t.filter(n=>{const o=s.every(C(n,e,T)),r=!e||i.some(C(n,e,a));return o&&r})}const rt=f(B,V).extend({name:"v-data-table",directives:{ripple:L},props:{headers:{type:Array,default:()=>[]},showSelect:Boolean,checkboxColor:String,showExpand:Boolean,showGroupBy:Boolean,height:[Number,String],hideDefaultHeader:Boolean,caption:String,dense:Boolean,headerProps:Object,calculateWidths:Boolean,fixedHeader:Boolean,headersLength:Number,expandIcon:{type:String,default:"$expand"},customFilter:{type:Function,default:T},itemClass:{type:[String,Function],default:()=>""},loaderHeight:{type:[Number,String],default:4}},data(){return{internalGroupBy:[],openCache:{},widths:[]}},computed:{computedHeaders(){if(!this.headers)return[];const t=this.headers.filter(s=>s.value===void 0||!this.internalGroupBy.find(i=>i===s.value)),e={text:"",sortable:!1,width:"1px"};if(this.showSelect){const s=t.findIndex(i=>i.value==="data-table-select");s<0?t.unshift({...e,value:"data-table-select"}):t.splice(s,1,{...e,...t[s]})}if(this.showExpand){const s=t.findIndex(i=>i.value==="data-table-expand");s<0?t.unshift({...e,value:"data-table-expand"}):t.splice(s,1,{...e,...t[s]})}return t},colspanAttrs(){return this.isMobile?void 0:{colspan:this.headersLength||this.computedHeaders.length}},columnSorters(){return this.computedHeaders.reduce((t,e)=>(e.sort&&(t[e.value]=e.sort),t),{})},headersWithCustomFilters(){return this.headers.filter(t=>t.filter&&(!t.hasOwnProperty("filterable")||t.filterable===!0))},headersWithoutCustomFilters(){return this.headers.filter(t=>!t.filter&&(!t.hasOwnProperty("filterable")||t.filterable===!0))},sanitizedHeaderProps(){return F(this.headerProps)},computedItemsPerPage(){const t=this.options&&this.options.itemsPerPage?this.options.itemsPerPage:this.itemsPerPage,e=this.sanitizedFooterProps.itemsPerPageOptions;if(e&&!e.find(s=>typeof s=="number"?s===t:s.value===t)){const s=e[0];return typeof s=="object"?s.value:s}return t},groupByText(){var t,e,s;return(s=(e=(t=this.headers)===null||t===void 0?void 0:t.find(i=>{var a;return i.value===((a=this.internalGroupBy)===null||a===void 0?void 0:a[0])}))===null||e===void 0?void 0:e.text)!==null&&s!==void 0?s:""}},created(){[["sort-icon","header-props.sort-icon"],["hide-headers","hide-default-header"],["select-all","show-select"]].forEach(([e,s])=>{this.$attrs.hasOwnProperty(e)&&k(e,s,this)})},mounted(){this.calculateWidths&&(window.addEventListener("resize",this.calcWidths),this.calcWidths())},beforeDestroy(){this.calculateWidths&&window.removeEventListener("resize",this.calcWidths)},methods:{calcWidths(){this.widths=Array.from(this.$el.querySelectorAll("th")).map(t=>t.clientWidth)},customFilterWithColumns(t,e){return at(t,e,this.headersWithCustomFilters,this.headersWithoutCustomFilters,this.customFilter)},customSortWithHeaders(t,e,s,i){return this.customSort(t,e,s,i,this.columnSorters)},createItemProps(t,e){const s=B.options.methods.createItemProps.call(this,t,e);return Object.assign(s,{headers:this.computedHeaders})},genCaption(t){return this.caption?[this.$createElement("caption",[this.caption])]:u(this,"caption",t,!0)},genColgroup(t){return this.$createElement("colgroup",this.computedHeaders.map(e=>this.$createElement("col",{class:{divider:e.divider}})))},genLoading(){const t=this.$createElement("th",{staticClass:"column",attrs:this.colspanAttrs},[this.genProgress()]),e=this.$createElement("tr",{staticClass:"v-data-table__progress"},[t]);return this.$createElement("thead",[e])},genHeaders(t){const e={props:{...this.sanitizedHeaderProps,headers:this.computedHeaders,options:t.options,mobile:this.isMobile,showGroupBy:this.showGroupBy,checkboxColor:this.checkboxColor,someItems:this.someItems,everyItem:this.everyItem,singleSelect:this.singleSelect,disableSort:this.disableSort},on:{sort:t.sort,group:t.group,"toggle-select-all":this.toggleSelectAll}},s=[u(this,"header",{...e,isMobile:this.isMobile})];if(!this.hideDefaultHeader){const i=$("header.",this.$scopedSlots);s.push(this.$createElement(Z,{...e,scopedSlots:i}))}return this.loading&&s.push(this.genLoading()),s},genEmptyWrapper(t){return this.$createElement("tr",{staticClass:"v-data-table__empty-wrapper"},[this.$createElement("td",{attrs:this.colspanAttrs},t)])},genItems(t,e){const s=this.genEmpty(e.originalItemsLength,e.pagination.itemsLength);return s?[s]:e.groupedItems?this.genGroupedRows(e.groupedItems,e):this.genRows(t,e)},genGroupedRows(t,e){return t.map(s=>(this.openCache.hasOwnProperty(s.name)||this.$set(this.openCache,s.name,!0),this.$scopedSlots.group?this.$scopedSlots.group({group:s.name,options:e.options,isMobile:this.isMobile,items:s.items,headers:this.computedHeaders}):this.genDefaultGroupedRow(s.name,s.items,e)))},genDefaultGroupedRow(t,e,s){const i=!!this.openCache[t],a=[this.$createElement("template",{slot:"row.content"},this.genRows(e,s))],n=()=>this.$set(this.openCache,t,!this.openCache[t]),o=()=>s.updateOptions({groupBy:[],groupDesc:[]});if(this.$scopedSlots["group.header"])a.unshift(this.$createElement("template",{slot:"column.header"},[this.$scopedSlots["group.header"]({group:t,groupBy:s.options.groupBy,isMobile:this.isMobile,items:e,headers:this.computedHeaders,isOpen:i,toggle:n,remove:o})]));else{const r=this.$createElement(v,{staticClass:"ma-0",props:{icon:!0,small:!0},on:{click:n}},[this.$createElement(b,[i?"$minus":"$plus"])]),l=this.$createElement(v,{staticClass:"ma-0",props:{icon:!0,small:!0},on:{click:o}},[this.$createElement(b,["$close"])]),d=this.$createElement("td",{staticClass:"text-start",attrs:this.colspanAttrs},[r,`${this.groupByText}: ${t}`,l]);a.unshift(this.$createElement("template",{slot:"column.header"},[d]))}return this.$scopedSlots["group.summary"]&&a.push(this.$createElement("template",{slot:"column.summary"},[this.$scopedSlots["group.summary"]({group:t,groupBy:s.options.groupBy,isMobile:this.isMobile,items:e,headers:this.computedHeaders,isOpen:i,toggle:n})])),this.$createElement(D,{key:t,props:{value:i}},a)},genRows(t,e){return this.$scopedSlots.item?this.genScopedRows(t,e):this.genDefaultRows(t,e)},genScopedRows(t,e){const s=[];for(let i=0;ithis.genDefaultExpandedRow(s,i)):t.map((s,i)=>this.genDefaultSimpleRow(s,i))},genDefaultExpandedRow(t,e){const s=this.isExpanded(t),i={"v-data-table__expanded v-data-table__expanded__row":s},a=this.genDefaultSimpleRow(t,e,i),n=this.$createElement("tr",{staticClass:"v-data-table__expanded v-data-table__expanded__content"},[this.$scopedSlots["expanded-item"]({headers:this.computedHeaders,isMobile:this.isMobile,item:t})]);return this.$createElement(D,{props:{value:s}},[this.$createElement("template",{slot:"row.header"},[a]),this.$createElement("template",{slot:"row.content"},[n])])},genDefaultSimpleRow(t,e,s={}){const i=$("item.",this.$scopedSlots),a=this.createItemProps(t,e);if(this.showSelect){const n=i["data-table-select"];i["data-table-select"]=n?()=>n({...a,isMobile:this.isMobile}):()=>{var o;return this.$createElement(M,{staticClass:"v-data-table__checkbox",props:{value:a.isSelected,disabled:!this.isSelectable(t),color:(o=this.checkboxColor)!==null&&o!==void 0?o:""},on:{input:r=>a.select(r)}})}}if(this.showExpand){const n=i["data-table-expand"];i["data-table-expand"]=n?()=>n(a):()=>this.$createElement(b,{staticClass:"v-data-table__expand-icon",class:{"v-data-table__expand-icon--active":a.isExpanded},on:{click:o=>{o.stopPropagation(),a.expand(!a.isExpanded)}}},[this.expandIcon])}return this.$createElement(this.isMobile?it:et,{key:h(t,this.itemKey),class:z({...s,"v-data-table__selected":a.isSelected},U(t,this.itemClass)),props:{headers:this.computedHeaders,hideDefaultHeader:this.hideDefaultHeader,index:e,item:t,rtl:this.$vuetify.rtl},scopedSlots:i,on:{click:n=>this.$emit("click:row",t,a,n),contextmenu:n=>this.$emit("contextmenu:row",n,a),dblclick:n=>this.$emit("dblclick:row",n,a)}})},genBody(t){const e={...t,expand:this.expand,headers:this.computedHeaders,isExpanded:this.isExpanded,isMobile:this.isMobile,isSelected:this.isSelected,select:this.select};return this.$scopedSlots.body?this.$scopedSlots.body(e):this.$createElement("tbody",[u(this,"body.prepend",e,!0),this.genItems(t.items,t),u(this,"body.append",e,!0)])},genFoot(t){var e,s;return(s=(e=this.$scopedSlots).foot)===null||s===void 0?void 0:s.call(e,t)},genFooters(t){const e={props:{options:t.options,pagination:t.pagination,itemsPerPageText:"$vuetify.dataTable.itemsPerPageText",...this.sanitizedFooterProps},on:{"update:options":i=>t.updateOptions(i)},widths:this.widths,headers:this.computedHeaders},s=[u(this,"footer",e,!0)];return this.hideDefaultFooter||s.push(this.$createElement(K,{...e,scopedSlots:$("footer.",this.$scopedSlots)})),s},genDefaultScopedSlot(t){const e={height:this.height,fixedHeader:this.fixedHeader,dense:this.dense};return this.$createElement(st,{props:e,class:{"v-data-table--mobile":this.isMobile}},[this.proxySlot("top",u(this,"top",{...t,isMobile:this.isMobile},!0)),this.genCaption(t),this.genColgroup(t),this.genHeaders(t),this.genBody(t),this.genFoot(t),this.proxySlot("bottom",this.genFooters(t))])},proxySlot(t,e){return this.$createElement("template",{slot:t},e)}},render(){return this.$createElement(x,{props:{...this.$props,customFilter:this.customFilterWithColumns,customSort:this.customSortWithHeaders,itemsPerPage:this.computedItemsPerPage},on:{"update:options":(t,e)=>{this.internalGroupBy=t.groupBy||[],!p(t,e)&&this.$emit("update:options",t)},"update:page":t=>this.$emit("update:page",t),"update:items-per-page":t=>this.$emit("update:items-per-page",t),"update:sort-by":t=>this.$emit("update:sort-by",t),"update:sort-desc":t=>this.$emit("update:sort-desc",t),"update:group-by":t=>this.$emit("update:group-by",t),"update:group-desc":t=>this.$emit("update:group-desc",t),pagination:(t,e)=>!p(t,e)&&this.$emit("pagination",t),"current-items":t=>{this.internalCurrentItems=t,this.$emit("current-items",t)},"page-count":t=>this.$emit("page-count",t)},scopedSlots:{default:this.genDefaultScopedSlot}})}});export{rt as _}; diff --git a/dist/assets/VDataTable.71ce8bb9.js b/dist/assets/VDataTable.71ce8bb9.js deleted file mode 100644 index 0dd5795..0000000 --- a/dist/assets/VDataTable.71ce8bb9.js +++ /dev/null @@ -1 +0,0 @@ -import{z as g,A as j,D as R,E as W,F as c,G as w,H as p,b as v,c as b,h as u,m as f,T as A,M as E,I as F,J as h,K as k,L as G,y as _,N as $,O as L,g as P,Q as N,U as V,W as T,X as z,Y as U}from"./index.154e9cc6.js";import{V as H,a as M,b as q}from"./VSelect.27a57f2b.js";const x=g.extend({name:"v-data",inheritAttrs:!1,props:{items:{type:Array,default:()=>[]},options:{type:Object,default:()=>({})},sortBy:{type:[String,Array]},sortDesc:{type:[Boolean,Array]},customSort:{type:Function,default:j},mustSort:Boolean,multiSort:Boolean,page:{type:Number,default:1},itemsPerPage:{type:Number,default:10},groupBy:{type:[String,Array],default:()=>[]},groupDesc:{type:[Boolean,Array],default:()=>[]},customGroup:{type:Function,default:R},locale:{type:String,default:"en-US"},disableSort:Boolean,disablePagination:Boolean,disableFiltering:Boolean,search:String,customFilter:{type:Function,default:W},serverItemsLength:{type:Number,default:-1}},data(){let t={page:this.page,itemsPerPage:this.itemsPerPage,sortBy:c(this.sortBy),sortDesc:c(this.sortDesc),groupBy:c(this.groupBy),groupDesc:c(this.groupDesc),mustSort:this.mustSort,multiSort:this.multiSort};this.options&&(t=Object.assign(t,this.options));const{sortBy:e,sortDesc:s,groupBy:i,groupDesc:a}=t,n=e.length-s.length,o=i.length-a.length;return n>0&&t.sortDesc.push(...w(n,!1)),o>0&&t.groupDesc.push(...w(o,!1)),{internalOptions:t}},computed:{itemsLength(){return this.serverItemsLength>=0?this.serverItemsLength:this.filteredItems.length},pageCount(){return this.internalOptions.itemsPerPage<=0?1:Math.ceil(this.itemsLength/this.internalOptions.itemsPerPage)},pageStart(){return this.internalOptions.itemsPerPage===-1||!this.items.length?0:(this.internalOptions.page-1)*this.internalOptions.itemsPerPage},pageStop(){return this.internalOptions.itemsPerPage===-1?this.itemsLength:this.items.length?Math.min(this.itemsLength,this.internalOptions.page*this.internalOptions.itemsPerPage):0},isGrouped(){return!!this.internalOptions.groupBy.length},pagination(){return{page:this.internalOptions.page,itemsPerPage:this.internalOptions.itemsPerPage,pageStart:this.pageStart,pageStop:this.pageStop,pageCount:this.pageCount,itemsLength:this.itemsLength}},filteredItems(){let t=this.items.slice();return!this.disableFiltering&&this.serverItemsLength<=0&&(t=this.customFilter(t,this.search)),t},computedItems(){let t=this.filteredItems.slice();return(!this.disableSort||this.internalOptions.groupBy.length)&&this.serverItemsLength<=0&&(t=this.sortItems(t)),!this.disablePagination&&this.serverItemsLength<=0&&(t=this.paginateItems(t)),t},groupedItems(){return this.isGrouped?this.groupItems(this.computedItems):null},scopedProps(){return{sort:this.sort,sortArray:this.sortArray,group:this.group,items:this.computedItems,options:this.internalOptions,updateOptions:this.updateOptions,pagination:this.pagination,groupedItems:this.groupedItems,originalItemsLength:this.items.length}},computedOptions(){return{...this.options}}},watch:{computedOptions:{handler(t,e){p(t,e)||this.updateOptions(t)},deep:!0,immediate:!0},internalOptions:{handler(t,e){p(t,e)||this.$emit("update:options",t)},deep:!0,immediate:!0},page(t){this.updateOptions({page:t})},"internalOptions.page"(t){this.$emit("update:page",t)},itemsPerPage(t){this.updateOptions({itemsPerPage:t})},"internalOptions.itemsPerPage"(t){this.$emit("update:items-per-page",t)},sortBy(t){this.updateOptions({sortBy:c(t)})},"internalOptions.sortBy"(t,e){!p(t,e)&&this.$emit("update:sort-by",Array.isArray(this.sortBy)?t:t[0])},sortDesc(t){this.updateOptions({sortDesc:c(t)})},"internalOptions.sortDesc"(t,e){!p(t,e)&&this.$emit("update:sort-desc",Array.isArray(this.sortDesc)?t:t[0])},groupBy(t){this.updateOptions({groupBy:c(t)})},"internalOptions.groupBy"(t,e){!p(t,e)&&this.$emit("update:group-by",Array.isArray(this.groupBy)?t:t[0])},groupDesc(t){this.updateOptions({groupDesc:c(t)})},"internalOptions.groupDesc"(t,e){!p(t,e)&&this.$emit("update:group-desc",Array.isArray(this.groupDesc)?t:t[0])},multiSort(t){this.updateOptions({multiSort:t})},"internalOptions.multiSort"(t){this.$emit("update:multi-sort",t)},mustSort(t){this.updateOptions({mustSort:t})},"internalOptions.mustSort"(t){this.$emit("update:must-sort",t)},pageCount:{handler(t){this.$emit("page-count",t)},immediate:!0},computedItems:{handler(t){this.$emit("current-items",t)},immediate:!0},pagination:{handler(t,e){p(t,e)||this.$emit("pagination",this.pagination)},immediate:!0}},methods:{toggle(t,e,s,i,a,n){let o=e.slice(),r=s.slice();const l=o.findIndex(d=>d===t);return l<0?(n||(o=[],r=[]),o.push(t),r.push(!1)):l>=0&&!r[l]?r[l]=!0:a?r[l]=!1:(o.splice(l,1),r.splice(l,1)),(!p(o,e)||!p(r,s))&&(i=1),{by:o,desc:r,page:i}},group(t){const{by:e,desc:s,page:i}=this.toggle(t,this.internalOptions.groupBy,this.internalOptions.groupDesc,this.internalOptions.page,!0,!1);this.updateOptions({groupBy:e,groupDesc:s,page:i})},sort(t){if(Array.isArray(t))return this.sortArray(t);const{by:e,desc:s,page:i}=this.toggle(t,this.internalOptions.sortBy,this.internalOptions.sortDesc,this.internalOptions.page,this.internalOptions.mustSort,this.internalOptions.multiSort);this.updateOptions({sortBy:e,sortDesc:s,page:i})},sortArray(t){const e=t.map(s=>{const i=this.internalOptions.sortBy.findIndex(a=>a===s);return i>-1?this.internalOptions.sortDesc[i]:!1});this.updateOptions({sortBy:t,sortDesc:e})},updateOptions(t){this.internalOptions={...this.internalOptions,...t,page:this.serverItemsLength<0?Math.max(1,Math.min(t.page||this.internalOptions.page,this.pageCount)):t.page||this.internalOptions.page}},sortItems(t){let e=[],s=[];return this.disableSort||(e=this.internalOptions.sortBy,s=this.internalOptions.sortDesc),this.internalOptions.groupBy.length&&(e=[...this.internalOptions.groupBy,...e],s=[...this.internalOptions.groupDesc,...s]),this.customSort(t,e,s,this.locale)},groupItems(t){return this.customGroup(t,this.internalOptions.groupBy,this.internalOptions.groupDesc)},paginateItems(t){return this.serverItemsLength===-1&&t.length<=this.pageStart&&(this.internalOptions.page=Math.max(1,Math.ceil(t.length/this.internalOptions.itemsPerPage))||1),t.slice(this.pageStart,this.pageStop)}},render(){return this.$scopedSlots.default&&this.$scopedSlots.default(this.scopedProps)}});const K=g.extend({name:"v-data-footer",props:{options:{type:Object,required:!0},pagination:{type:Object,required:!0},itemsPerPageOptions:{type:Array,default:()=>[5,10,15,-1]},prevIcon:{type:String,default:"$prev"},nextIcon:{type:String,default:"$next"},firstIcon:{type:String,default:"$first"},lastIcon:{type:String,default:"$last"},itemsPerPageText:{type:String,default:"$vuetify.dataFooter.itemsPerPageText"},itemsPerPageAllText:{type:String,default:"$vuetify.dataFooter.itemsPerPageAll"},showFirstLastPage:Boolean,showCurrentPage:Boolean,disablePagination:Boolean,disableItemsPerPage:Boolean,pageText:{type:String,default:"$vuetify.dataFooter.pageText"}},computed:{disableNextPageIcon(){return this.options.itemsPerPage<=0||this.options.page*this.options.itemsPerPage>=this.pagination.itemsLength||this.pagination.pageStop<0},computedDataItemsPerPageOptions(){return this.itemsPerPageOptions.map(t=>typeof t=="object"?t:this.genDataItemsPerPageOption(t))}},methods:{updateOptions(t){this.$emit("update:options",Object.assign({},this.options,t))},onFirstPage(){this.updateOptions({page:1})},onPreviousPage(){this.updateOptions({page:this.options.page-1})},onNextPage(){this.updateOptions({page:this.options.page+1})},onLastPage(){this.updateOptions({page:this.pagination.pageCount})},onChangeItemsPerPage(t){this.updateOptions({itemsPerPage:t,page:1})},genDataItemsPerPageOption(t){return{text:t===-1?this.$vuetify.lang.t(this.itemsPerPageAllText):String(t),value:t}},genItemsPerPageSelect(){let t=this.options.itemsPerPage;const e=this.computedDataItemsPerPageOptions;return e.length<=1?null:(e.find(s=>s.value===t)||(t=e[0]),this.$createElement("div",{staticClass:"v-data-footer__select"},[this.$vuetify.lang.t(this.itemsPerPageText),this.$createElement(H,{attrs:{"aria-label":this.$vuetify.lang.t(this.itemsPerPageText)},props:{disabled:this.disableItemsPerPage,items:e,value:t,hideDetails:!0,auto:!0,minWidth:"75px"},on:{input:this.onChangeItemsPerPage}})]))},genPaginationInfo(){let t=["\u2013"];const e=this.pagination.itemsLength;let s=this.pagination.pageStart,i=this.pagination.pageStop;return this.pagination.itemsLength&&this.pagination.itemsPerPage?(s=this.pagination.pageStart+1,i=e=this.pagination.pageCount||this.options.itemsPerPage===-1,this.$vuetify.lang.t("$vuetify.dataFooter.lastPage"),this.$vuetify.rtl?this.firstIcon:this.lastIcon))),[this.$createElement("div",{staticClass:"v-data-footer__icons-before"},t),this.showCurrentPage&&this.$createElement("span",[this.options.page.toString()]),this.$createElement("div",{staticClass:"v-data-footer__icons-after"},e)]}},render(){return this.$createElement("div",{staticClass:"v-data-footer"},[u(this,"prepend"),this.genItemsPerPageSelect(),this.genPaginationInfo(),this.genIcons()])}}),B=f(E,A).extend({name:"v-data-iterator",props:{...x.options.props,itemKey:{type:String,default:"id"},value:{type:Array,default:()=>[]},singleSelect:Boolean,expanded:{type:Array,default:()=>[]},mobileBreakpoint:{...E.options.props.mobileBreakpoint,default:600},singleExpand:Boolean,loading:[Boolean,String],noResultsText:{type:String,default:"$vuetify.dataIterator.noResultsText"},noDataText:{type:String,default:"$vuetify.noDataText"},loadingText:{type:String,default:"$vuetify.dataIterator.loadingText"},hideDefaultFooter:Boolean,footerProps:Object,selectableKey:{type:String,default:"isSelectable"}},data:()=>({selection:{},expansion:{},internalCurrentItems:[],shiftKeyDown:!1,lastEntry:-1}),computed:{everyItem(){return!!this.selectableItems.length&&this.selectableItems.every(t=>this.isSelected(t))},someItems(){return this.selectableItems.some(t=>this.isSelected(t))},sanitizedFooterProps(){return F(this.footerProps)},selectableItems(){return this.internalCurrentItems.filter(t=>this.isSelectable(t))}},watch:{value:{handler(t){this.selection=t.reduce((e,s)=>(e[h(s,this.itemKey)]=s,e),{})},immediate:!0},selection(t,e){p(Object.keys(t),Object.keys(e))||this.$emit("input",Object.values(t))},expanded:{handler(t){this.expansion=t.reduce((e,s)=>(e[h(s,this.itemKey)]=!0,e),{})},immediate:!0},expansion(t,e){if(p(t,e))return;const s=Object.keys(t).filter(a=>t[a]),i=s.length?this.items.filter(a=>s.includes(String(h(a,this.itemKey)))):[];this.$emit("update:expanded",i)}},created(){[["disable-initial-sort","sort-by"],["filter","custom-filter"],["pagination","options"],["total-items","server-items-length"],["hide-actions","hide-default-footer"],["rows-per-page-items","footer-props.items-per-page-options"],["rows-per-page-text","footer-props.items-per-page-text"],["prev-icon","footer-props.prev-icon"],["next-icon","footer-props.next-icon"]].forEach(([s,i])=>{this.$attrs.hasOwnProperty(s)&&k(s,i,this)}),["expand","content-class","content-props","content-tag"].forEach(s=>{this.$attrs.hasOwnProperty(s)&&G(s)})},mounted(){window.addEventListener("keydown",this.onKeyDown),window.addEventListener("keyup",this.onKeyUp)},beforeDestroy(){window.removeEventListener("keydown",this.onKeyDown),window.removeEventListener("keyup",this.onKeyUp)},methods:{onKeyDown(t){this.shiftKeyDown=t.keyCode===_.shift||t.shiftKey},onKeyUp(t){(t.keyCode===_.shift||!t.shiftKey)&&(this.shiftKeyDown=!1)},toggleSelectAll(t){const e=Object.assign({},this.selection);for(let s=0;sh(o,this.itemKey)===a);if(this.lastEntry===-1)this.lastEntry=n;else if(this.shiftKeyDown&&!this.singleSelect&&s){const o=h(this.selectableItems[this.lastEntry],this.itemKey),r=Object.keys(this.selection).includes(String(o));this.multipleSelect(r,s,i,n)}if(this.lastEntry=n,this.singleSelect&&s){const o=Object.keys(this.selection),r=o.length&&h(this.selection[o[0]],this.itemKey);r&&r!==a&&this.$emit("item-selected",{item:this.selection[r],value:!1})}this.selection=i,s&&this.$emit("item-selected",{item:t,value:e})},multipleSelect(t=!0,e=!0,s,i){const a=ithis.select(t,s),isSelected:this.isSelected(t),expand:s=>this.expand(t,s),isExpanded:this.isExpanded(t),isMobile:this.isMobile}},genEmptyWrapper(t){return this.$createElement("div",t)},genEmpty(t,e){if(t===0&&this.loading){const s=this.$slots.loading||this.$vuetify.lang.t(this.loadingText);return this.genEmptyWrapper(s)}else if(t===0){const s=this.$slots["no-data"]||this.$vuetify.lang.t(this.noDataText);return this.genEmptyWrapper(s)}else if(e===0){const s=this.$slots["no-results"]||this.$vuetify.lang.t(this.noResultsText);return this.genEmptyWrapper(s)}return null},genItems(t){const e=this.genEmpty(t.originalItemsLength,t.pagination.itemsLength);return e?[e]:this.$scopedSlots.default?this.$scopedSlots.default({...t,isSelected:this.isSelected,select:this.select,isExpanded:this.isExpanded,isMobile:this.isMobile,expand:this.expand}):this.$scopedSlots.item?t.items.map((s,i)=>this.$scopedSlots.item(this.createItemProps(s,i))):[]},genFooter(t){if(this.hideDefaultFooter)return null;const e={props:{...this.sanitizedFooterProps,options:t.options,pagination:t.pagination},on:{"update:options":i=>t.updateOptions(i)}},s=$("footer.",this.$scopedSlots);return this.$createElement(K,{scopedSlots:s,...e})},genDefaultScopedSlot(t){const e={...t,someItems:this.someItems,everyItem:this.everyItem,toggleSelectAll:this.toggleSelectAll};return this.$createElement("div",{staticClass:"v-data-iterator"},[u(this,"header",e,!0),this.genItems(t),this.genFooter(t),u(this,"footer",e,!0)])}},render(){return this.$createElement(x,{props:this.$props,on:{"update:options":(t,e)=>!p(t,e)&&this.$emit("update:options",t),"update:page":t=>this.$emit("update:page",t),"update:items-per-page":t=>this.$emit("update:items-per-page",t),"update:sort-by":t=>this.$emit("update:sort-by",t),"update:sort-desc":t=>this.$emit("update:sort-desc",t),"update:group-by":t=>this.$emit("update:group-by",t),"update:group-desc":t=>this.$emit("update:group-desc",t),pagination:(t,e)=>!p(t,e)&&this.$emit("pagination",t),"current-items":t=>{this.internalCurrentItems=t,this.$emit("current-items",t)},"page-count":t=>this.$emit("page-count",t)},scopedSlots:{default:this.genDefaultScopedSlot}})}});const I=f().extend({directives:{ripple:L},props:{headers:{type:Array,default:()=>[]},options:{type:Object,default:()=>({page:1,itemsPerPage:10,sortBy:[],sortDesc:[],groupBy:[],groupDesc:[],multiSort:!1,mustSort:!1})},checkboxColor:String,sortIcon:{type:String,default:"$sort"},everyItem:Boolean,someItems:Boolean,showGroupBy:Boolean,singleSelect:Boolean,disableSort:Boolean},methods:{genSelectAll(){var t;const e={props:{value:this.everyItem,indeterminate:!this.everyItem&&this.someItems,color:(t=this.checkboxColor)!==null&&t!==void 0?t:""},on:{input:s=>this.$emit("toggle-select-all",s)}};return this.$scopedSlots["data-table-select"]?this.$scopedSlots["data-table-select"](e):this.$createElement(M,{staticClass:"v-data-table__checkbox",...e})},genSortIcon(){return this.$createElement(b,{staticClass:"v-data-table-header__icon",props:{size:18}},[this.sortIcon])}}}),J=f(I).extend({name:"v-data-table-header-mobile",props:{sortByText:{type:String,default:"$vuetify.dataTable.sortBy"}},methods:{genSortChip(t){const e=[t.item.text],s=this.options.sortBy.findIndex(n=>n===t.item.value),i=s>=0,a=this.options.sortDesc[s];return e.push(this.$createElement("div",{staticClass:"v-chip__close",class:{sortable:!0,active:i,asc:i&&!a,desc:i&&a}},[this.genSortIcon()])),this.$createElement(q,{staticClass:"sortable",on:{click:n=>{n.stopPropagation(),this.$emit("sort",t.item.value)}}},e)},genSortSelect(t){return this.$createElement(H,{props:{label:this.$vuetify.lang.t(this.sortByText),items:t,hideDetails:!0,multiple:this.options.multiSort,value:this.options.multiSort?this.options.sortBy:this.options.sortBy[0],menuProps:{closeOnContentClick:!0}},on:{change:e=>this.$emit("sort",e)},scopedSlots:{selection:e=>this.genSortChip(e)}})}},render(t){const e=[],s=this.headers.find(o=>o.value==="data-table-select");s&&!this.singleSelect&&e.push(this.$createElement("div",{class:["v-data-table-header-mobile__select",...c(s.class)],attrs:{width:s.width}},[this.genSelectAll()]));const i=this.headers.filter(o=>o.sortable!==!1&&o.value!=="data-table-select").map(o=>({text:o.text,value:o.value}));!this.disableSort&&i.length&&e.push(this.genSortSelect(i));const a=e.length?t("th",[t("div",{staticClass:"v-data-table-header-mobile__wrapper"},e)]):void 0,n=t("tr",[a]);return t("thead",{staticClass:"v-data-table-header v-data-table-header-mobile"},[n])}}),Q=f(I).extend({name:"v-data-table-header-desktop",methods:{genGroupByToggle(t){return this.$createElement("span",{on:{click:e=>{e.stopPropagation(),this.$emit("group",t.value)}}},["group"])},getAria(t,e){const s=n=>this.$vuetify.lang.t(`$vuetify.dataTable.ariaLabel.${n}`);let i="none",a=[s("sortNone"),s("activateAscending")];return t?(e?(i="descending",a=[s("sortDescending"),s(this.options.mustSort?"activateAscending":"activateNone")]):(i="ascending",a=[s("sortAscending"),s("activateDescending")]),{ariaSort:i,ariaLabel:a.join(" ")}):{ariaSort:i,ariaLabel:a.join(" ")}},genHeader(t){const e={attrs:{role:"columnheader",scope:"col","aria-label":t.text||""},style:{width:P(t.width),minWidth:P(t.width)},class:[`text-${t.align||"start"}`,...c(t.class),t.divider&&"v-data-table__divider"],on:{}},s=[];if(t.value==="data-table-select"&&!this.singleSelect)return this.$createElement("th",e,[this.genSelectAll()]);if(s.push(this.$scopedSlots.hasOwnProperty(t.value)?this.$scopedSlots[t.value]({header:t}):this.$createElement("span",[t.text])),!this.disableSort&&(t.sortable||!t.hasOwnProperty("sortable"))){e.on.click=()=>this.$emit("sort",t.value);const i=this.options.sortBy.findIndex(l=>l===t.value),a=i>=0,n=this.options.sortDesc[i];e.class.push("sortable");const{ariaLabel:o,ariaSort:r}=this.getAria(a,n);e.attrs["aria-label"]+=`${t.text?": ":""}${o}`,e.attrs["aria-sort"]=r,a&&(e.class.push("active"),e.class.push(n?"desc":"asc")),t.align==="end"?s.unshift(this.genSortIcon()):s.push(this.genSortIcon()),this.options.multiSort&&a&&s.push(this.$createElement("span",{class:"v-data-table-header__sort-badge"},[String(i+1)]))}return this.showGroupBy&&t.groupable!==!1&&s.push(this.genGroupByToggle(t)),this.$createElement("th",e,s)}},render(){return this.$createElement("thead",{staticClass:"v-data-table-header"},[this.$createElement("tr",this.headers.map(t=>this.genHeader(t)))])}});function X(t){if(t.model&&t.on&&t.on.input)if(Array.isArray(t.on.input)){const e=t.on.input.indexOf(t.model.callback);e>-1&&t.on.input.splice(e,1)}else delete t.on.input}function Y(t,e){const s=[];for(const i in t)t.hasOwnProperty(i)&&s.push(e("template",{slot:i},t[i]));return s}const Z=g.extend({name:"v-data-table-header",functional:!0,props:{...I.options.props,mobile:Boolean},render(t,{props:e,data:s,slots:i}){X(s);const a=Y(i(),t);return s=N(s,{props:e}),e.mobile?t(J,s,a):t(Q,s,a)}});function tt(t){var e;return t.length!==1||!["td","th"].includes((e=t[0])===null||e===void 0?void 0:e.tag)}const et=g.extend({name:"row",functional:!0,props:{headers:Array,index:Number,item:Object,rtl:Boolean},render(t,{props:e,slots:s,data:i}){const a=s(),n=e.headers.map(o=>{const r=[],l=h(e.item,o.value),d=o.value,m=i.scopedSlots&&i.scopedSlots.hasOwnProperty(d)&&i.scopedSlots[d],y=a.hasOwnProperty(d)&&a[d];m?r.push(...c(m({item:e.item,isMobile:!1,header:o,index:e.index,value:l}))):y?r.push(...c(y)):r.push(l==null?l:String(l));const S=`text-${o.align||"start"}`;return tt(r)?t("td",{class:[S,o.cellClass,{"v-data-table__divider":o.divider}]},r):r});return t("tr",i,n)}}),D=g.extend({name:"row-group",functional:!0,props:{value:{type:Boolean,default:!0},headerClass:{type:String,default:"v-row-group__header"},contentClass:String,summaryClass:{type:String,default:"v-row-group__summary"}},render(t,{slots:e,props:s}){const i=e(),a=[];return i["column.header"]?a.push(t("tr",{staticClass:s.headerClass},i["column.header"])):i["row.header"]&&a.push(...i["row.header"]),i["row.content"]&&s.value&&a.push(...i["row.content"]),i["column.summary"]?a.push(t("tr",{staticClass:s.summaryClass},i["column.summary"])):i["row.summary"]&&a.push(...i["row.summary"]),a}});const st=f(A).extend({name:"v-simple-table",props:{dense:Boolean,fixedHeader:Boolean,height:[Number,String]},computed:{classes(){return{"v-data-table--dense":this.dense,"v-data-table--fixed-height":!!this.height&&!this.fixedHeader,"v-data-table--fixed-header":this.fixedHeader,"v-data-table--has-top":!!this.$slots.top,"v-data-table--has-bottom":!!this.$slots.bottom,...this.themeClasses}}},methods:{genWrapper(){return this.$slots.wrapper||this.$createElement("div",{staticClass:"v-data-table__wrapper",style:{height:P(this.height)}},[this.$createElement("table",this.$slots.default)])}},render(t){return t("div",{staticClass:"v-data-table",class:this.classes},[this.$slots.top,this.genWrapper(),this.$slots.bottom])}}),it=g.extend({name:"row",functional:!0,props:{headers:Array,hideDefaultHeader:Boolean,index:Number,item:Object,rtl:Boolean},render(t,{props:e,slots:s,data:i}){const a=s(),n=e.headers.map(o=>{const r={"v-data-table__mobile-row":!0},l=[],d=h(e.item,o.value),m=o.value,y=i.scopedSlots&&i.scopedSlots.hasOwnProperty(m)&&i.scopedSlots[m],S=a.hasOwnProperty(m)&&a[m];y?l.push(y({item:e.item,isMobile:!0,header:o,index:e.index,value:d})):S?l.push(S):l.push(d==null?d:String(d));const O=[t("div",{staticClass:"v-data-table__mobile-row__cell"},l)];return o.value!=="dataTableSelect"&&!e.hideDefaultHeader&&O.unshift(t("div",{staticClass:"v-data-table__mobile-row__header"},[o.text])),t("td",{class:r},O)});return t("tr",{...i,staticClass:"v-data-table__mobile-table-row"},n)}});function C(t,e,s){return i=>{const a=h(t,i.value);return i.filter?i.filter(a,e,t):s(a,e,t)}}function at(t,e,s,i,a){return e=typeof e=="string"?e.trim():null,t.filter(n=>{const o=s.every(C(n,e,T)),r=!e||i.some(C(n,e,a));return o&&r})}const rt=f(B,V).extend({name:"v-data-table",directives:{ripple:L},props:{headers:{type:Array,default:()=>[]},showSelect:Boolean,checkboxColor:String,showExpand:Boolean,showGroupBy:Boolean,height:[Number,String],hideDefaultHeader:Boolean,caption:String,dense:Boolean,headerProps:Object,calculateWidths:Boolean,fixedHeader:Boolean,headersLength:Number,expandIcon:{type:String,default:"$expand"},customFilter:{type:Function,default:T},itemClass:{type:[String,Function],default:()=>""},loaderHeight:{type:[Number,String],default:4}},data(){return{internalGroupBy:[],openCache:{},widths:[]}},computed:{computedHeaders(){if(!this.headers)return[];const t=this.headers.filter(s=>s.value===void 0||!this.internalGroupBy.find(i=>i===s.value)),e={text:"",sortable:!1,width:"1px"};if(this.showSelect){const s=t.findIndex(i=>i.value==="data-table-select");s<0?t.unshift({...e,value:"data-table-select"}):t.splice(s,1,{...e,...t[s]})}if(this.showExpand){const s=t.findIndex(i=>i.value==="data-table-expand");s<0?t.unshift({...e,value:"data-table-expand"}):t.splice(s,1,{...e,...t[s]})}return t},colspanAttrs(){return this.isMobile?void 0:{colspan:this.headersLength||this.computedHeaders.length}},columnSorters(){return this.computedHeaders.reduce((t,e)=>(e.sort&&(t[e.value]=e.sort),t),{})},headersWithCustomFilters(){return this.headers.filter(t=>t.filter&&(!t.hasOwnProperty("filterable")||t.filterable===!0))},headersWithoutCustomFilters(){return this.headers.filter(t=>!t.filter&&(!t.hasOwnProperty("filterable")||t.filterable===!0))},sanitizedHeaderProps(){return F(this.headerProps)},computedItemsPerPage(){const t=this.options&&this.options.itemsPerPage?this.options.itemsPerPage:this.itemsPerPage,e=this.sanitizedFooterProps.itemsPerPageOptions;if(e&&!e.find(s=>typeof s=="number"?s===t:s.value===t)){const s=e[0];return typeof s=="object"?s.value:s}return t},groupByText(){var t,e,s;return(s=(e=(t=this.headers)===null||t===void 0?void 0:t.find(i=>{var a;return i.value===((a=this.internalGroupBy)===null||a===void 0?void 0:a[0])}))===null||e===void 0?void 0:e.text)!==null&&s!==void 0?s:""}},created(){[["sort-icon","header-props.sort-icon"],["hide-headers","hide-default-header"],["select-all","show-select"]].forEach(([e,s])=>{this.$attrs.hasOwnProperty(e)&&k(e,s,this)})},mounted(){this.calculateWidths&&(window.addEventListener("resize",this.calcWidths),this.calcWidths())},beforeDestroy(){this.calculateWidths&&window.removeEventListener("resize",this.calcWidths)},methods:{calcWidths(){this.widths=Array.from(this.$el.querySelectorAll("th")).map(t=>t.clientWidth)},customFilterWithColumns(t,e){return at(t,e,this.headersWithCustomFilters,this.headersWithoutCustomFilters,this.customFilter)},customSortWithHeaders(t,e,s,i){return this.customSort(t,e,s,i,this.columnSorters)},createItemProps(t,e){const s=B.options.methods.createItemProps.call(this,t,e);return Object.assign(s,{headers:this.computedHeaders})},genCaption(t){return this.caption?[this.$createElement("caption",[this.caption])]:u(this,"caption",t,!0)},genColgroup(t){return this.$createElement("colgroup",this.computedHeaders.map(e=>this.$createElement("col",{class:{divider:e.divider}})))},genLoading(){const t=this.$createElement("th",{staticClass:"column",attrs:this.colspanAttrs},[this.genProgress()]),e=this.$createElement("tr",{staticClass:"v-data-table__progress"},[t]);return this.$createElement("thead",[e])},genHeaders(t){const e={props:{...this.sanitizedHeaderProps,headers:this.computedHeaders,options:t.options,mobile:this.isMobile,showGroupBy:this.showGroupBy,checkboxColor:this.checkboxColor,someItems:this.someItems,everyItem:this.everyItem,singleSelect:this.singleSelect,disableSort:this.disableSort},on:{sort:t.sort,group:t.group,"toggle-select-all":this.toggleSelectAll}},s=[u(this,"header",{...e,isMobile:this.isMobile})];if(!this.hideDefaultHeader){const i=$("header.",this.$scopedSlots);s.push(this.$createElement(Z,{...e,scopedSlots:i}))}return this.loading&&s.push(this.genLoading()),s},genEmptyWrapper(t){return this.$createElement("tr",{staticClass:"v-data-table__empty-wrapper"},[this.$createElement("td",{attrs:this.colspanAttrs},t)])},genItems(t,e){const s=this.genEmpty(e.originalItemsLength,e.pagination.itemsLength);return s?[s]:e.groupedItems?this.genGroupedRows(e.groupedItems,e):this.genRows(t,e)},genGroupedRows(t,e){return t.map(s=>(this.openCache.hasOwnProperty(s.name)||this.$set(this.openCache,s.name,!0),this.$scopedSlots.group?this.$scopedSlots.group({group:s.name,options:e.options,isMobile:this.isMobile,items:s.items,headers:this.computedHeaders}):this.genDefaultGroupedRow(s.name,s.items,e)))},genDefaultGroupedRow(t,e,s){const i=!!this.openCache[t],a=[this.$createElement("template",{slot:"row.content"},this.genRows(e,s))],n=()=>this.$set(this.openCache,t,!this.openCache[t]),o=()=>s.updateOptions({groupBy:[],groupDesc:[]});if(this.$scopedSlots["group.header"])a.unshift(this.$createElement("template",{slot:"column.header"},[this.$scopedSlots["group.header"]({group:t,groupBy:s.options.groupBy,isMobile:this.isMobile,items:e,headers:this.computedHeaders,isOpen:i,toggle:n,remove:o})]));else{const r=this.$createElement(v,{staticClass:"ma-0",props:{icon:!0,small:!0},on:{click:n}},[this.$createElement(b,[i?"$minus":"$plus"])]),l=this.$createElement(v,{staticClass:"ma-0",props:{icon:!0,small:!0},on:{click:o}},[this.$createElement(b,["$close"])]),d=this.$createElement("td",{staticClass:"text-start",attrs:this.colspanAttrs},[r,`${this.groupByText}: ${t}`,l]);a.unshift(this.$createElement("template",{slot:"column.header"},[d]))}return this.$scopedSlots["group.summary"]&&a.push(this.$createElement("template",{slot:"column.summary"},[this.$scopedSlots["group.summary"]({group:t,groupBy:s.options.groupBy,isMobile:this.isMobile,items:e,headers:this.computedHeaders,isOpen:i,toggle:n})])),this.$createElement(D,{key:t,props:{value:i}},a)},genRows(t,e){return this.$scopedSlots.item?this.genScopedRows(t,e):this.genDefaultRows(t,e)},genScopedRows(t,e){const s=[];for(let i=0;ithis.genDefaultExpandedRow(s,i)):t.map((s,i)=>this.genDefaultSimpleRow(s,i))},genDefaultExpandedRow(t,e){const s=this.isExpanded(t),i={"v-data-table__expanded v-data-table__expanded__row":s},a=this.genDefaultSimpleRow(t,e,i),n=this.$createElement("tr",{staticClass:"v-data-table__expanded v-data-table__expanded__content"},[this.$scopedSlots["expanded-item"]({headers:this.computedHeaders,isMobile:this.isMobile,item:t})]);return this.$createElement(D,{props:{value:s}},[this.$createElement("template",{slot:"row.header"},[a]),this.$createElement("template",{slot:"row.content"},[n])])},genDefaultSimpleRow(t,e,s={}){const i=$("item.",this.$scopedSlots),a=this.createItemProps(t,e);if(this.showSelect){const n=i["data-table-select"];i["data-table-select"]=n?()=>n({...a,isMobile:this.isMobile}):()=>{var o;return this.$createElement(M,{staticClass:"v-data-table__checkbox",props:{value:a.isSelected,disabled:!this.isSelectable(t),color:(o=this.checkboxColor)!==null&&o!==void 0?o:""},on:{input:r=>a.select(r)}})}}if(this.showExpand){const n=i["data-table-expand"];i["data-table-expand"]=n?()=>n(a):()=>this.$createElement(b,{staticClass:"v-data-table__expand-icon",class:{"v-data-table__expand-icon--active":a.isExpanded},on:{click:o=>{o.stopPropagation(),a.expand(!a.isExpanded)}}},[this.expandIcon])}return this.$createElement(this.isMobile?it:et,{key:h(t,this.itemKey),class:z({...s,"v-data-table__selected":a.isSelected},U(t,this.itemClass)),props:{headers:this.computedHeaders,hideDefaultHeader:this.hideDefaultHeader,index:e,item:t,rtl:this.$vuetify.rtl},scopedSlots:i,on:{click:n=>this.$emit("click:row",t,a,n),contextmenu:n=>this.$emit("contextmenu:row",n,a),dblclick:n=>this.$emit("dblclick:row",n,a)}})},genBody(t){const e={...t,expand:this.expand,headers:this.computedHeaders,isExpanded:this.isExpanded,isMobile:this.isMobile,isSelected:this.isSelected,select:this.select};return this.$scopedSlots.body?this.$scopedSlots.body(e):this.$createElement("tbody",[u(this,"body.prepend",e,!0),this.genItems(t.items,t),u(this,"body.append",e,!0)])},genFoot(t){var e,s;return(s=(e=this.$scopedSlots).foot)===null||s===void 0?void 0:s.call(e,t)},genFooters(t){const e={props:{options:t.options,pagination:t.pagination,itemsPerPageText:"$vuetify.dataTable.itemsPerPageText",...this.sanitizedFooterProps},on:{"update:options":i=>t.updateOptions(i)},widths:this.widths,headers:this.computedHeaders},s=[u(this,"footer",e,!0)];return this.hideDefaultFooter||s.push(this.$createElement(K,{...e,scopedSlots:$("footer.",this.$scopedSlots)})),s},genDefaultScopedSlot(t){const e={height:this.height,fixedHeader:this.fixedHeader,dense:this.dense};return this.$createElement(st,{props:e,class:{"v-data-table--mobile":this.isMobile}},[this.proxySlot("top",u(this,"top",{...t,isMobile:this.isMobile},!0)),this.genCaption(t),this.genColgroup(t),this.genHeaders(t),this.genBody(t),this.genFoot(t),this.proxySlot("bottom",this.genFooters(t))])},proxySlot(t,e){return this.$createElement("template",{slot:t},e)}},render(){return this.$createElement(x,{props:{...this.$props,customFilter:this.customFilterWithColumns,customSort:this.customSortWithHeaders,itemsPerPage:this.computedItemsPerPage},on:{"update:options":(t,e)=>{this.internalGroupBy=t.groupBy||[],!p(t,e)&&this.$emit("update:options",t)},"update:page":t=>this.$emit("update:page",t),"update:items-per-page":t=>this.$emit("update:items-per-page",t),"update:sort-by":t=>this.$emit("update:sort-by",t),"update:sort-desc":t=>this.$emit("update:sort-desc",t),"update:group-by":t=>this.$emit("update:group-by",t),"update:group-desc":t=>this.$emit("update:group-desc",t),pagination:(t,e)=>!p(t,e)&&this.$emit("pagination",t),"current-items":t=>{this.internalCurrentItems=t,this.$emit("current-items",t)},"page-count":t=>this.$emit("page-count",t)},scopedSlots:{default:this.genDefaultScopedSlot}})}});export{rt as _}; diff --git a/dist/assets/VExpansionPanelHeader.d8fbc23c.js b/dist/assets/VExpansionPanelHeader.1232ca65.js similarity index 92% rename from dist/assets/VExpansionPanelHeader.d8fbc23c.js rename to dist/assets/VExpansionPanelHeader.1232ca65.js index a8eab6e..00b4791 100644 --- a/dist/assets/VExpansionPanelHeader.d8fbc23c.js +++ b/dist/assets/VExpansionPanelHeader.1232ca65.js @@ -1 +1 @@ -import{m as n,aH as o,t as l,h as s,aI as r,aJ as t,C as i,B as c,O as p,c as d,x as h}from"./index.154e9cc6.js";const m=n(l("expansionPanels","v-expansion-panel","v-expansion-panels"),o("expansionPanel",!0)).extend({name:"v-expansion-panel",props:{disabled:Boolean,readonly:Boolean},data(){return{content:null,header:null,nextIsActive:!1}},computed:{classes(){return{"v-expansion-panel--active":this.isActive,"v-expansion-panel--next-active":this.nextIsActive,"v-expansion-panel--disabled":this.isDisabled,...this.groupClasses}},isDisabled(){return this.expansionPanels.disabled||this.disabled},isReadonly(){return this.expansionPanels.readonly||this.readonly}},methods:{registerContent(e){this.content=e},unregisterContent(){this.content=null},registerHeader(e){this.header=e,e.$on("click",this.onClick)},unregisterHeader(){this.header=null},onClick(e){e.detail&&this.header.$el.blur(),this.$emit("click",e),this.isReadonly||this.isDisabled||this.toggle()},toggle(){this.$nextTick(()=>this.$emit("change"))}},render(e){return e("div",{staticClass:"v-expansion-panel",class:this.classes,attrs:{"aria-expanded":String(this.isActive)}},s(this))}}),u=n(c,i,t("expansionPanel","v-expansion-panel-content","v-expansion-panel")),b=u.extend().extend({name:"v-expansion-panel-content",data:()=>({isActive:!1}),computed:{parentIsActive(){return this.expansionPanel.isActive}},watch:{parentIsActive:{immediate:!0,handler(e,a){e&&(this.isBooted=!0),a==null?this.isActive=e:this.$nextTick(()=>this.isActive=e)}}},created(){this.expansionPanel.registerContent(this)},beforeDestroy(){this.expansionPanel.unregisterContent()},render(e){return e(r,this.showLazyContent(()=>[e("div",this.setBackgroundColor(this.color,{staticClass:"v-expansion-panel-content",directives:[{name:"show",value:this.isActive}]}),[e("div",{class:"v-expansion-panel-content__wrap"},s(this))])]))}}),x=n(i,t("expansionPanel","v-expansion-panel-header","v-expansion-panel")),g=x.extend().extend({name:"v-expansion-panel-header",directives:{ripple:p},props:{disableIconRotate:Boolean,expandIcon:{type:String,default:"$expand"},hideActions:Boolean,ripple:{type:[Boolean,Object],default:!1}},data:()=>({hasMousedown:!1}),computed:{classes(){return{"v-expansion-panel-header--active":this.isActive,"v-expansion-panel-header--mousedown":this.hasMousedown}},isActive(){return this.expansionPanel.isActive},isDisabled(){return this.expansionPanel.isDisabled},isReadonly(){return this.expansionPanel.isReadonly}},created(){this.expansionPanel.registerHeader(this)},beforeDestroy(){this.expansionPanel.unregisterHeader()},methods:{onClick(e){this.$emit("click",e)},genIcon(){const e=s(this,"actions")||[this.$createElement(d,this.expandIcon)];return this.$createElement(h,[this.$createElement("div",{staticClass:"v-expansion-panel-header__icon",class:{"v-expansion-panel-header__icon--disable-rotate":this.disableIconRotate},directives:[{name:"show",value:!this.isDisabled}]},e)])}},render(e){return e("button",this.setBackgroundColor(this.color,{staticClass:"v-expansion-panel-header",class:this.classes,attrs:{tabindex:this.isDisabled?-1:null,type:"button","aria-expanded":this.isActive},directives:[{name:"ripple",value:this.ripple}],on:{...this.$listeners,click:this.onClick,mousedown:()=>this.hasMousedown=!0,mouseup:()=>this.hasMousedown=!1}}),[s(this,"default",{open:this.isActive},!0),this.hideActions||this.genIcon()])}});export{m as _,g as a,b}; +import{m as n,aE as o,w as l,K as s,aF as r,aG as i,C as t,B as c,W as p,c as d,z as h}from"./index.85262dd3.js";const m=n(l("expansionPanels","v-expansion-panel","v-expansion-panels"),o("expansionPanel",!0)).extend({name:"v-expansion-panel",props:{disabled:Boolean,readonly:Boolean},data(){return{content:null,header:null,nextIsActive:!1}},computed:{classes(){return{"v-expansion-panel--active":this.isActive,"v-expansion-panel--next-active":this.nextIsActive,"v-expansion-panel--disabled":this.isDisabled,...this.groupClasses}},isDisabled(){return this.expansionPanels.disabled||this.disabled},isReadonly(){return this.expansionPanels.readonly||this.readonly}},methods:{registerContent(e){this.content=e},unregisterContent(){this.content=null},registerHeader(e){this.header=e,e.$on("click",this.onClick)},unregisterHeader(){this.header=null},onClick(e){e.detail&&this.header.$el.blur(),this.$emit("click",e),this.isReadonly||this.isDisabled||this.toggle()},toggle(){this.$nextTick(()=>this.$emit("change"))}},render(e){return e("div",{staticClass:"v-expansion-panel",class:this.classes,attrs:{"aria-expanded":String(this.isActive)}},s(this))}}),u=n(c,t,i("expansionPanel","v-expansion-panel-content","v-expansion-panel")),b=u.extend().extend({name:"v-expansion-panel-content",data:()=>({isActive:!1}),computed:{parentIsActive(){return this.expansionPanel.isActive}},watch:{parentIsActive:{immediate:!0,handler(e,a){e&&(this.isBooted=!0),a==null?this.isActive=e:this.$nextTick(()=>this.isActive=e)}}},created(){this.expansionPanel.registerContent(this)},beforeDestroy(){this.expansionPanel.unregisterContent()},render(e){return e(r,this.showLazyContent(()=>[e("div",this.setBackgroundColor(this.color,{staticClass:"v-expansion-panel-content",directives:[{name:"show",value:this.isActive}]}),[e("div",{class:"v-expansion-panel-content__wrap"},s(this))])]))}}),x=n(t,i("expansionPanel","v-expansion-panel-header","v-expansion-panel")),g=x.extend().extend({name:"v-expansion-panel-header",directives:{ripple:p},props:{disableIconRotate:Boolean,expandIcon:{type:String,default:"$expand"},hideActions:Boolean,ripple:{type:[Boolean,Object],default:!1}},data:()=>({hasMousedown:!1}),computed:{classes(){return{"v-expansion-panel-header--active":this.isActive,"v-expansion-panel-header--mousedown":this.hasMousedown}},isActive(){return this.expansionPanel.isActive},isDisabled(){return this.expansionPanel.isDisabled},isReadonly(){return this.expansionPanel.isReadonly}},created(){this.expansionPanel.registerHeader(this)},beforeDestroy(){this.expansionPanel.unregisterHeader()},methods:{onClick(e){this.$emit("click",e)},genIcon(){const e=s(this,"actions")||[this.$createElement(d,this.expandIcon)];return this.$createElement(h,[this.$createElement("div",{staticClass:"v-expansion-panel-header__icon",class:{"v-expansion-panel-header__icon--disable-rotate":this.disableIconRotate},directives:[{name:"show",value:!this.isDisabled}]},e)])}},render(e){return e("button",this.setBackgroundColor(this.color,{staticClass:"v-expansion-panel-header",class:this.classes,attrs:{tabindex:this.isDisabled?-1:null,type:"button","aria-expanded":this.isActive},directives:[{name:"ripple",value:this.ripple}],on:{...this.$listeners,click:this.onClick,mousedown:()=>this.hasMousedown=!0,mouseup:()=>this.hasMousedown=!1}}),[s(this,"default",{open:this.isActive},!0),this.hideActions||this.genIcon()])}});export{m as _,g as a,b}; diff --git a/dist/assets/VExpansionPanels.1f915cd7.js b/dist/assets/VExpansionPanels.d99facd5.js similarity index 96% rename from dist/assets/VExpansionPanels.1f915cd7.js rename to dist/assets/VExpansionPanels.d99facd5.js index 5140b60..9e99018 100644 --- a/dist/assets/VExpansionPanels.1f915cd7.js +++ b/dist/assets/VExpansionPanels.d99facd5.js @@ -1 +1 @@ -import{m as r,T as u,P as o,ac as h,ah as d,K as l}from"./index.154e9cc6.js";const n=r(h,o,u).extend({name:"base-item-group",props:{activeClass:{type:String,default:"v-item--active"},mandatory:Boolean,max:{type:[Number,String],default:null},multiple:Boolean,tag:{type:String,default:"div"}},data(){return{internalLazyValue:this.value!==void 0?this.value:this.multiple?[]:void 0,items:[]}},computed:{classes(){return{"v-item-group":!0,...this.themeClasses}},selectedIndex(){return this.selectedItem&&this.items.indexOf(this.selectedItem)||-1},selectedItem(){if(!this.multiple)return this.selectedItems[0]},selectedItems(){return this.items.filter((e,t)=>this.toggleMethod(this.getValue(e,t)))},selectedValues(){return this.internalValue==null?[]:Array.isArray(this.internalValue)?this.internalValue:[this.internalValue]},toggleMethod(){if(!this.multiple)return t=>this.valueComparator(this.internalValue,t);const e=this.internalValue;return Array.isArray(e)?t=>e.some(a=>this.valueComparator(a,t)):()=>!1}},watch:{internalValue:"updateItemsState",items:"updateItemsState"},created(){this.multiple&&!Array.isArray(this.internalValue)&&d("Model must be bound to an array if the multiple property is true.",this)},methods:{genData(){return{class:this.classes}},getValue(e,t){return e.value===void 0?t:e.value},onClick(e){this.updateInternalValue(this.getValue(e,this.items.indexOf(e)))},register(e){const t=this.items.push(e)-1;e.$on("change",()=>this.onClick(e)),this.mandatory&&!this.selectedValues.length&&this.updateMandatory(),this.updateItem(e,t)},unregister(e){if(this._isDestroyed)return;const t=this.items.indexOf(e),a=this.getValue(e,t);if(this.items.splice(t,1),!(this.selectedValues.indexOf(a)<0)){if(!this.mandatory)return this.updateInternalValue(a);this.multiple&&Array.isArray(this.internalValue)?this.internalValue=this.internalValue.filter(i=>i!==a):this.internalValue=void 0,this.selectedItems.length||this.updateMandatory(!0)}},updateItem(e,t){const a=this.getValue(e,t);e.isActive=this.toggleMethod(a)},updateItemsState(){this.$nextTick(()=>{if(this.mandatory&&!this.selectedItems.length)return this.updateMandatory();this.items.forEach(this.updateItem)})},updateInternalValue(e){this.multiple?this.updateMultiple(e):this.updateSingle(e)},updateMandatory(e){if(!this.items.length)return;const t=this.items.slice();e&&t.reverse();const a=t.find(i=>!i.disabled);if(!a)return;const s=this.items.indexOf(a);this.updateInternalValue(this.getValue(a,s))},updateMultiple(e){const a=(Array.isArray(this.internalValue)?this.internalValue:[]).slice(),s=a.findIndex(i=>this.valueComparator(i,e));this.mandatory&&s>-1&&a.length-1<1||this.max!=null&&s<0&&a.length+1>this.max||(s>-1?a.splice(s,1):a.push(e),this.internalValue=a)},updateSingle(e){const t=this.valueComparator(this.internalValue,e);this.mandatory&&t||(this.internalValue=t?void 0:e)}},render(e){return e(this.tag,this.genData(),this.$slots.default)}});n.extend({name:"v-item-group",provide(){return{itemGroup:this}}});const c=n.extend({name:"v-expansion-panels",provide(){return{expansionPanels:this}},props:{accordion:Boolean,disabled:Boolean,flat:Boolean,hover:Boolean,focusable:Boolean,inset:Boolean,popout:Boolean,readonly:Boolean,tile:Boolean},computed:{classes(){return{...n.options.computed.classes.call(this),"v-expansion-panels":!0,"v-expansion-panels--accordion":this.accordion,"v-expansion-panels--flat":this.flat,"v-expansion-panels--hover":this.hover,"v-expansion-panels--focusable":this.focusable,"v-expansion-panels--inset":this.inset,"v-expansion-panels--popout":this.popout,"v-expansion-panels--tile":this.tile}}},created(){this.$attrs.hasOwnProperty("expand")&&l("expand","multiple",this),Array.isArray(this.value)&&this.value.length>0&&typeof this.value[0]=="boolean"&&l(':value="[true, false, true]"',':value="[0, 2]"',this)},methods:{updateItem(e,t){const a=this.getValue(e,t),s=this.getValue(e,t+1);e.isActive=this.toggleMethod(a),e.nextIsActive=this.toggleMethod(s)}}});export{n as B,c as _}; +import{m as r,T as u,P as o,a5 as h,a6 as d,O as l}from"./index.85262dd3.js";const n=r(h,o,u).extend({name:"base-item-group",props:{activeClass:{type:String,default:"v-item--active"},mandatory:Boolean,max:{type:[Number,String],default:null},multiple:Boolean,tag:{type:String,default:"div"}},data(){return{internalLazyValue:this.value!==void 0?this.value:this.multiple?[]:void 0,items:[]}},computed:{classes(){return{"v-item-group":!0,...this.themeClasses}},selectedIndex(){return this.selectedItem&&this.items.indexOf(this.selectedItem)||-1},selectedItem(){if(!this.multiple)return this.selectedItems[0]},selectedItems(){return this.items.filter((e,t)=>this.toggleMethod(this.getValue(e,t)))},selectedValues(){return this.internalValue==null?[]:Array.isArray(this.internalValue)?this.internalValue:[this.internalValue]},toggleMethod(){if(!this.multiple)return t=>this.valueComparator(this.internalValue,t);const e=this.internalValue;return Array.isArray(e)?t=>e.some(a=>this.valueComparator(a,t)):()=>!1}},watch:{internalValue:"updateItemsState",items:"updateItemsState"},created(){this.multiple&&!Array.isArray(this.internalValue)&&d("Model must be bound to an array if the multiple property is true.",this)},methods:{genData(){return{class:this.classes}},getValue(e,t){return e.value===void 0?t:e.value},onClick(e){this.updateInternalValue(this.getValue(e,this.items.indexOf(e)))},register(e){const t=this.items.push(e)-1;e.$on("change",()=>this.onClick(e)),this.mandatory&&!this.selectedValues.length&&this.updateMandatory(),this.updateItem(e,t)},unregister(e){if(this._isDestroyed)return;const t=this.items.indexOf(e),a=this.getValue(e,t);if(this.items.splice(t,1),!(this.selectedValues.indexOf(a)<0)){if(!this.mandatory)return this.updateInternalValue(a);this.multiple&&Array.isArray(this.internalValue)?this.internalValue=this.internalValue.filter(i=>i!==a):this.internalValue=void 0,this.selectedItems.length||this.updateMandatory(!0)}},updateItem(e,t){const a=this.getValue(e,t);e.isActive=this.toggleMethod(a)},updateItemsState(){this.$nextTick(()=>{if(this.mandatory&&!this.selectedItems.length)return this.updateMandatory();this.items.forEach(this.updateItem)})},updateInternalValue(e){this.multiple?this.updateMultiple(e):this.updateSingle(e)},updateMandatory(e){if(!this.items.length)return;const t=this.items.slice();e&&t.reverse();const a=t.find(i=>!i.disabled);if(!a)return;const s=this.items.indexOf(a);this.updateInternalValue(this.getValue(a,s))},updateMultiple(e){const a=(Array.isArray(this.internalValue)?this.internalValue:[]).slice(),s=a.findIndex(i=>this.valueComparator(i,e));this.mandatory&&s>-1&&a.length-1<1||this.max!=null&&s<0&&a.length+1>this.max||(s>-1?a.splice(s,1):a.push(e),this.internalValue=a)},updateSingle(e){const t=this.valueComparator(this.internalValue,e);this.mandatory&&t||(this.internalValue=t?void 0:e)}},render(e){return e(this.tag,this.genData(),this.$slots.default)}});n.extend({name:"v-item-group",provide(){return{itemGroup:this}}});const c=n.extend({name:"v-expansion-panels",provide(){return{expansionPanels:this}},props:{accordion:Boolean,disabled:Boolean,flat:Boolean,hover:Boolean,focusable:Boolean,inset:Boolean,popout:Boolean,readonly:Boolean,tile:Boolean},computed:{classes(){return{...n.options.computed.classes.call(this),"v-expansion-panels":!0,"v-expansion-panels--accordion":this.accordion,"v-expansion-panels--flat":this.flat,"v-expansion-panels--hover":this.hover,"v-expansion-panels--focusable":this.focusable,"v-expansion-panels--inset":this.inset,"v-expansion-panels--popout":this.popout,"v-expansion-panels--tile":this.tile}}},created(){this.$attrs.hasOwnProperty("expand")&&l("expand","multiple",this),Array.isArray(this.value)&&this.value.length>0&&typeof this.value[0]=="boolean"&&l(':value="[true, false, true]"',':value="[0, 2]"',this)},methods:{updateItem(e,t){const a=this.getValue(e,t),s=this.getValue(e,t+1);e.isActive=this.toggleMethod(a),e.nextIsActive=this.toggleMethod(s)}}});export{n as B,c as _}; diff --git a/dist/assets/VPagination.90d5be16.js b/dist/assets/VPagination.873af1be.js similarity index 95% rename from dist/assets/VPagination.90d5be16.js rename to dist/assets/VPagination.873af1be.js index 4d064e0..f52857e 100644 --- a/dist/assets/VPagination.90d5be16.js +++ b/dist/assets/VPagination.873af1be.js @@ -1 +1 @@ -import{m as g,T as c,bc as p,C as v,v as m,c as b}from"./index.154e9cc6.js";const f=g(v,p({onVisible:["init"]}),c).extend({name:"v-pagination",directives:{Resize:m},props:{circle:Boolean,disabled:Boolean,length:{type:Number,default:0,validator:t=>t%1===0},nextIcon:{type:String,default:"$next"},prevIcon:{type:String,default:"$prev"},totalVisible:[Number,String],value:{type:Number,default:0},pageAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.page"},currentPageAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.currentPage"},previousAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.previous"},nextAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.next"},wrapperAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.wrapper"}},data(){return{maxButtons:0,selected:null}},computed:{classes(){return{"v-pagination":!0,"v-pagination--circle":this.circle,"v-pagination--disabled":this.disabled,...this.themeClasses}},items(){const t=parseInt(this.totalVisible,10);if(t===0||isNaN(this.length)||this.length>Number.MAX_SAFE_INTEGER)return[];const e=Math.min(Math.max(0,t)||this.length,Math.max(0,this.maxButtons)||this.length,this.length);if(this.length<=e)return this.range(1,this.length);const n=e%2===0?1:0,i=Math.floor(e/2),a=this.length-i+1+n;if(this.value>i&&this.valuethis.selected=this.value,100)},onResize(){const t=this.$el&&this.$el.parentElement?this.$el.parentElement.clientWidth:window.innerWidth;this.maxButtons=Math.floor((t-96)/42)},next(t){t.preventDefault(),this.$emit("input",this.value+1),this.$emit("next")},previous(t){t.preventDefault(),this.$emit("input",this.value-1),this.$emit("previous")},range(t,e){const n=[];t=t>0?t:1;for(let i=t;i<=e;i++)n.push(i);return n},genIcon(t,e,n,i,a){return t("li",[t("button",{staticClass:"v-pagination__navigation",class:{"v-pagination__navigation--disabled":n},attrs:{disabled:n,type:"button","aria-label":a},on:n?{}:{click:i}},[t(b,[e])])])},genItem(t,e){const n=e===this.value&&(this.color||"primary"),i=e===this.value,a=i?this.currentPageAriaLabel:this.pageAriaLabel;return t("button",this.setBackgroundColor(n,{staticClass:"v-pagination__item",class:{"v-pagination__item--active":e===this.value},attrs:{type:"button","aria-current":i,"aria-label":this.$vuetify.lang.t(a,e)},on:{click:()=>this.$emit("input",e)}}),[e.toString()])},genItems(t){return this.items.map((e,n)=>t("li",{key:n},[isNaN(Number(e))?t("span",{class:"v-pagination__more"},[e.toString()]):this.genItem(t,e)]))},genList(t,e){return t("ul",{directives:[{modifiers:{quiet:!0},name:"resize",value:this.onResize}],class:this.classes},e)}},render(t){const e=[this.genIcon(t,this.$vuetify.rtl?this.nextIcon:this.prevIcon,this.value<=1,this.previous,this.$vuetify.lang.t(this.previousAriaLabel)),this.genItems(t),this.genIcon(t,this.$vuetify.rtl?this.prevIcon:this.nextIcon,this.value>=this.length,this.next,this.$vuetify.lang.t(this.nextAriaLabel))];return t("nav",{attrs:{role:"navigation","aria-label":this.$vuetify.lang.t(this.wrapperAriaLabel)}},[this.genList(t,e)])}});export{f as _}; +import{m as g,T as c,bf as p,C as v,x as m,c as b}from"./index.85262dd3.js";const d=g(v,p({onVisible:["init"]}),c).extend({name:"v-pagination",directives:{Resize:m},props:{circle:Boolean,disabled:Boolean,length:{type:Number,default:0,validator:t=>t%1===0},nextIcon:{type:String,default:"$next"},prevIcon:{type:String,default:"$prev"},totalVisible:[Number,String],value:{type:Number,default:0},pageAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.page"},currentPageAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.currentPage"},previousAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.previous"},nextAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.next"},wrapperAriaLabel:{type:String,default:"$vuetify.pagination.ariaLabel.wrapper"}},data(){return{maxButtons:0,selected:null}},computed:{classes(){return{"v-pagination":!0,"v-pagination--circle":this.circle,"v-pagination--disabled":this.disabled,...this.themeClasses}},items(){const t=parseInt(this.totalVisible,10);if(t===0||isNaN(this.length)||this.length>Number.MAX_SAFE_INTEGER)return[];const e=Math.min(Math.max(0,t)||this.length,Math.max(0,this.maxButtons)||this.length,this.length);if(this.length<=e)return this.range(1,this.length);const n=e%2===0?1:0,i=Math.floor(e/2),a=this.length-i+1+n;if(this.value>i&&this.valuethis.selected=this.value,100)},onResize(){const t=this.$el&&this.$el.parentElement?this.$el.parentElement.clientWidth:window.innerWidth;this.maxButtons=Math.floor((t-96)/42)},next(t){t.preventDefault(),this.$emit("input",this.value+1),this.$emit("next")},previous(t){t.preventDefault(),this.$emit("input",this.value-1),this.$emit("previous")},range(t,e){const n=[];t=t>0?t:1;for(let i=t;i<=e;i++)n.push(i);return n},genIcon(t,e,n,i,a){return t("li",[t("button",{staticClass:"v-pagination__navigation",class:{"v-pagination__navigation--disabled":n},attrs:{disabled:n,type:"button","aria-label":a},on:n?{}:{click:i}},[t(b,[e])])])},genItem(t,e){const n=e===this.value&&(this.color||"primary"),i=e===this.value,a=i?this.currentPageAriaLabel:this.pageAriaLabel;return t("button",this.setBackgroundColor(n,{staticClass:"v-pagination__item",class:{"v-pagination__item--active":e===this.value},attrs:{type:"button","aria-current":i,"aria-label":this.$vuetify.lang.t(a,e)},on:{click:()=>this.$emit("input",e)}}),[e.toString()])},genItems(t){return this.items.map((e,n)=>t("li",{key:n},[isNaN(Number(e))?t("span",{class:"v-pagination__more"},[e.toString()]):this.genItem(t,e)]))},genList(t,e){return t("ul",{directives:[{modifiers:{quiet:!0},name:"resize",value:this.onResize}],class:this.classes},e)}},render(t){const e=[this.genIcon(t,this.$vuetify.rtl?this.nextIcon:this.prevIcon,this.value<=1,this.previous,this.$vuetify.lang.t(this.previousAriaLabel)),this.genItems(t),this.genIcon(t,this.$vuetify.rtl?this.prevIcon:this.nextIcon,this.value>=this.length,this.next,this.$vuetify.lang.t(this.nextAriaLabel))];return t("nav",{attrs:{role:"navigation","aria-label":this.$vuetify.lang.t(this.wrapperAriaLabel)}},[this.genList(t,e)])}});export{d as _}; diff --git a/dist/assets/VSelect.27a57f2b.js b/dist/assets/VSelect.27a57f2b.js deleted file mode 100644 index 4f52f0d..0000000 --- a/dist/assets/VSelect.27a57f2b.js +++ /dev/null @@ -1 +0,0 @@ -import{m as d,Z as _,t as D,T as p,R as f,$ as M,C as u,K as w,c as v,a0 as V,a1 as k,v as L,g as r,a2 as b,L as O,y as l,a3 as B,a4 as E,a5 as P,a6 as H,a7 as F,a8 as A,z as C,O as x,Q as I,F as W,l as g,o as z,a9 as K,V as R,Y as c,k as j,j as h,aa as q,ab as J,J as $,ac as G}from"./index.154e9cc6.js";import{M as S}from"./index.27090f0f.js";const N=d(u,M,f,p,D("chipGroup"),_("inputValue")).extend({name:"v-chip",props:{active:{type:Boolean,default:!0},activeClass:{type:String,default(){return this.chipGroup?this.chipGroup.activeClass:""}},close:Boolean,closeIcon:{type:String,default:"$delete"},closeLabel:{type:String,default:"$vuetify.close"},disabled:Boolean,draggable:Boolean,filter:Boolean,filterIcon:{type:String,default:"$complete"},label:Boolean,link:Boolean,outlined:Boolean,pill:Boolean,tag:{type:String,default:"span"},textColor:String,value:null},data:()=>({proxyClass:"v-chip--active"}),computed:{classes(){return{"v-chip":!0,...f.options.computed.classes.call(this),"v-chip--clickable":this.isClickable,"v-chip--disabled":this.disabled,"v-chip--draggable":this.draggable,"v-chip--label":this.label,"v-chip--link":this.isLink,"v-chip--no-color":!this.color,"v-chip--outlined":this.outlined,"v-chip--pill":this.pill,"v-chip--removable":this.hasClose,...this.themeClasses,...this.sizeableClasses,...this.groupClasses}},hasClose(){return Boolean(this.close)},isClickable(){return Boolean(f.options.computed.isClickable.call(this)||this.chipGroup)}},created(){[["outline","outlined"],["selected","input-value"],["value","active"],["@input","@active.sync"]].forEach(([e,s])=>{this.$attrs.hasOwnProperty(e)&&w(e,s,this)})},methods:{click(t){this.$emit("click",t),this.chipGroup&&this.toggle()},genFilter(){const t=[];return this.isActive&&t.push(this.$createElement(v,{staticClass:"v-chip__filter",props:{left:!0}},this.filterIcon)),this.$createElement(V,t)},genClose(){return this.$createElement(v,{staticClass:"v-chip__close",props:{right:!0,size:18},attrs:{"aria-label":this.$vuetify.lang.t(this.closeLabel)},on:{click:t=>{t.stopPropagation(),t.preventDefault(),this.$emit("click:close"),this.$emit("update:active",!1)}}},this.closeIcon)},genContent(){return this.$createElement("span",{staticClass:"v-chip__content"},[this.filter&&this.genFilter(),this.$slots.default,this.hasClose&&this.genClose()])}},render(t){const e=[this.genContent()];let{tag:s,data:i}=this.generateRouteLink();i.attrs={...i.attrs,draggable:this.draggable?"true":void 0,tabindex:this.chipGroup&&!this.disabled?0:i.attrs.tabindex},i.directives.push({name:"show",value:this.active}),i=this.setBackgroundColor(this.color,i);const n=this.textColor||this.outlined&&this.color;return t(s,this.setTextColor(n,i),e)}});const U=d(A,F,H,P,p,S),Y=U.extend({name:"v-menu",directives:{ClickOutside:k,Resize:L},provide(){return{isInMenu:!0,theme:this.theme}},props:{auto:Boolean,closeOnClick:{type:Boolean,default:!0},closeOnContentClick:{type:Boolean,default:!0},disabled:Boolean,disableKeys:Boolean,maxHeight:{type:[Number,String],default:"auto"},offsetX:Boolean,offsetY:Boolean,openOnHover:Boolean,origin:{type:String,default:"top left"},transition:{type:[Boolean,String],default:"v-menu-transition"}},data(){return{calculatedTopAuto:0,defaultOffset:8,hasJustFocused:!1,listIndex:-1,resizeTimeout:0,selectedIndex:null,tiles:[]}},computed:{activeTile(){return this.tiles[this.listIndex]},calculatedLeft(){const t=Math.max(this.dimensions.content.width,parseFloat(this.calculatedMinWidth));return this.auto?r(this.calcXOverflow(this.calcLeftAuto(),t))||"0":this.calcLeft(t)||"0"},calculatedMaxHeight(){return(this.auto?"200px":r(this.maxHeight))||"0"},calculatedMaxWidth(){return r(this.maxWidth)||"0"},calculatedMinWidth(){if(this.minWidth)return r(this.minWidth)||"0";const t=Math.min(this.dimensions.activator.width+Number(this.nudgeWidth)+(this.auto?16:0),Math.max(this.pageWidth-24,0)),e=isNaN(parseInt(this.calculatedMaxWidth))?t:parseInt(this.calculatedMaxWidth);return r(Math.min(e,t))||"0"},calculatedTop(){return(this.auto?r(this.calcYOverflow(this.calculatedTopAuto)):this.calcTop())||"0"},hasClickableTiles(){return Boolean(this.tiles.find(t=>t.tabIndex>-1))},styles(){return{maxHeight:this.calculatedMaxHeight,minWidth:this.calculatedMinWidth,maxWidth:this.calculatedMaxWidth,top:this.calculatedTop,left:this.calculatedLeft,transformOrigin:this.origin,zIndex:this.zIndex||this.activeZIndex}}},watch:{isActive(t){t||(this.listIndex=-1)},isContentActive(t){this.hasJustFocused=t},listIndex(t,e){if(t in this.tiles){const s=this.tiles[t];s.classList.add("v-list-item--highlighted");const i=this.$refs.content.scrollTop,n=this.$refs.content.clientHeight;i>s.offsetTop-8?b(s.offsetTop-s.clientHeight,{appOffset:!1,duration:300,container:this.$refs.content}):i+n{this.startTransition().then(()=>{this.$refs.content&&(this.calculatedTopAuto=this.calcTopAuto(),this.auto&&(this.$refs.content.scrollTop=this.calcScrollPosition()))})})},calcScrollPosition(){const t=this.$refs.content,e=t.querySelector(".v-list-item--active"),s=t.scrollHeight-t.offsetHeight;return e?Math.min(s,Math.max(0,e.offsetTop-t.offsetHeight/2+e.offsetHeight/2)):t.scrollTop},calcLeftAuto(){return parseInt(this.dimensions.activator.left-this.defaultOffset*2)},calcTopAuto(){const t=this.$refs.content,e=t.querySelector(".v-list-item--active");if(e||(this.selectedIndex=null),this.offsetY||!e)return this.computedTop;this.selectedIndex=Array.from(this.tiles).indexOf(e);const s=e.offsetTop-this.calcScrollPosition(),i=t.querySelector(".v-list-item").offsetTop;return this.computedTop-s-i-1},changeListIndex(t){if(this.getTiles(),!(!this.isActive||!this.hasClickableTiles)){if(t.keyCode===l.tab){this.isActive=!1;return}else if(t.keyCode===l.down)this.nextTile();else if(t.keyCode===l.up)this.prevTile();else if(t.keyCode===l.end)this.lastTile();else if(t.keyCode===l.home)this.firstTile();else if(t.keyCode===l.enter&&this.listIndex!==-1)this.tiles[this.listIndex].click();else return;t.preventDefault()}},closeConditional(t){const e=t.target;return this.isActive&&!this._isDestroyed&&this.closeOnClick&&!this.$refs.content.contains(e)},genActivatorAttributes(){const t=B.options.methods.genActivatorAttributes.call(this);return this.activeTile&&this.activeTile.id?{...t,"aria-activedescendant":this.activeTile.id}:t},genActivatorListeners(){const t=S.options.methods.genActivatorListeners.call(this);return this.disableKeys||(t.keydown=this.onKeyDown),t},genTransition(){const t=this.genContent();return this.transition?this.$createElement("transition",{props:{name:this.transition}},[t]):t},genDirectives(){const t=[{name:"show",value:this.isContentActive}];return!this.openOnHover&&this.closeOnClick&&t.push({name:"click-outside",value:{handler:()=>{this.isActive=!1},closeConditional:this.closeConditional,include:()=>[this.$el,...this.getOpenDependentElements()]}}),t},genContent(){const t={attrs:{...this.getScopeIdAttrs(),role:"role"in this.$attrs?this.$attrs.role:"menu"},staticClass:"v-menu__content",class:{...this.rootThemeClasses,...this.roundedClasses,"v-menu__content--auto":this.auto,"v-menu__content--fixed":this.activatorFixed,menuable__content__active:this.isActive,[this.contentClass.trim()]:!0},style:this.styles,directives:this.genDirectives(),ref:"content",on:{click:e=>{e.target.getAttribute("disabled")||this.closeOnContentClick&&(this.isActive=!1)},keydown:this.onKeyDown}};return this.$listeners.scroll&&(t.on=t.on||{},t.on.scroll=this.$listeners.scroll),!this.disabled&&this.openOnHover&&(t.on=t.on||{},t.on.mouseenter=this.mouseEnterHandler),this.openOnHover&&(t.on=t.on||{},t.on.mouseleave=this.mouseLeaveHandler),this.$createElement("div",t,this.getContentSlot())},getTiles(){!this.$refs.content||(this.tiles=Array.from(this.$refs.content.querySelectorAll(".v-list-item, .v-divider, .v-subheader")))},mouseEnterHandler(){this.runDelay("open",()=>{this.hasJustFocused||(this.hasJustFocused=!0)})},mouseLeaveHandler(t){this.runDelay("close",()=>{var e;!((e=this.$refs.content)===null||e===void 0)&&e.contains(t.relatedTarget)||requestAnimationFrame(()=>{this.isActive=!1,this.callDeactivate()})})},nextTile(){const t=this.tiles[this.listIndex+1];if(!t){if(!this.tiles.length)return;this.listIndex=-1,this.nextTile();return}this.listIndex++,t.tabIndex===-1&&this.nextTile()},prevTile(){const t=this.tiles[this.listIndex-1];if(!t){if(!this.tiles.length)return;this.listIndex=this.tiles.length,this.prevTile();return}this.listIndex--,t.tabIndex===-1&&this.prevTile()},lastTile(){const t=this.tiles[this.tiles.length-1];!t||(this.listIndex=this.tiles.length-1,t.tabIndex===-1&&this.prevTile())},firstTile(){const t=this.tiles[0];!t||(this.listIndex=0,t.tabIndex===-1&&this.nextTile())},onKeyDown(t){if(t.keyCode===l.esc){setTimeout(()=>{this.isActive=!1});const e=this.getActivator();this.$nextTick(()=>e&&e.focus())}else!this.isActive&&[l.up,l.down].includes(t.keyCode)&&(this.isActive=!0);this.$nextTick(()=>this.changeListIndex(t))},onResize(){!this.isActive||(this.$refs.content.offsetWidth,this.updateDimensions(),clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(this.updateDimensions,100))}},render(t){const e={staticClass:"v-menu",class:{"v-menu--attached":this.attach===""||this.attach===!0||this.attach==="attach"},directives:[{arg:"500",name:"resize",value:this.onResize}]};return t("div",e,[!this.activator&&this.genActivator(),this.showLazyContent(()=>[this.$createElement(E,{props:{root:!0,light:this.light,dark:this.dark}},[this.genTransition()])])])}});const X=C.extend({name:"v-simple-checkbox",functional:!0,directives:{Ripple:x},props:{...u.options.props,...p.options.props,disabled:Boolean,ripple:{type:Boolean,default:!0},value:Boolean,indeterminate:Boolean,indeterminateIcon:{type:String,default:"$checkboxIndeterminate"},onIcon:{type:String,default:"$checkboxOn"},offIcon:{type:String,default:"$checkboxOff"}},render(t,{props:e,data:s,listeners:i}){const n=[];let o=e.offIcon;if(e.indeterminate?o=e.indeterminateIcon:e.value&&(o=e.onIcon),n.push(t(v,u.options.methods.setTextColor(e.value&&e.color,{props:{disabled:e.disabled,dark:e.dark,light:e.light}}),o)),e.ripple&&!e.disabled){const a=t("div",u.options.methods.setTextColor(e.color,{staticClass:"v-input--selection-controls__ripple",directives:[{def:x,name:"ripple",value:{center:!0}}]}));n.push(a)}return t("div",I(s,{class:{"v-simple-checkbox":!0,"v-simple-checkbox--disabled":e.disabled},on:{click:a=>{a.stopPropagation(),s.on&&s.on.input&&!e.disabled&&W(s.on.input).forEach(m=>m(!e.value))}}}),[t("div",{staticClass:"v-input--selection-controls__input"},n)])}});const Z=d(p).extend({name:"v-subheader",props:{inset:Boolean},render(t){return t("div",{staticClass:"v-subheader",class:{"v-subheader--inset":this.inset,...this.themeClasses},attrs:this.$attrs,on:this.$listeners},this.$slots.default)}}),Q=C.extend({name:"v-list-item-action",functional:!0,render(t,{data:e,children:s=[]}){return e.staticClass=e.staticClass?`v-list-item__action ${e.staticClass}`:"v-list-item__action",s.filter(n=>n.isComment===!1&&n.text!==" ").length>1&&(e.staticClass+=" v-list-item__action--stack"),t("div",e,s)}}),T=d(u,p).extend({name:"v-select-list",directives:{ripple:x},props:{action:Boolean,dense:Boolean,hideSelected:Boolean,items:{type:Array,default:()=>[]},itemDisabled:{type:[String,Array,Function],default:"disabled"},itemText:{type:[String,Array,Function],default:"text"},itemValue:{type:[String,Array,Function],default:"value"},noDataText:String,noFilter:Boolean,searchInput:null,selectedItems:{type:Array,default:()=>[]}},computed:{parsedItems(){return this.selectedItems.map(t=>this.getValue(t))},tileActiveClass(){return Object.keys(this.setTextColor(this.color).class||{}).join(" ")},staticNoDataTile(){const t={attrs:{role:void 0},on:{mousedown:e=>e.preventDefault()}};return this.$createElement(g,t,[this.genTileContent(this.noDataText)])}},methods:{genAction(t,e){return this.$createElement(Q,[this.$createElement(X,{props:{color:this.color,value:e,ripple:!1},on:{input:()=>this.$emit("select",t)}})])},genDivider(t){return this.$createElement(z,{props:t})},genFilteredText(t){if(t=t||"",!this.searchInput||this.noFilter)return t;const{start:e,middle:s,end:i}=this.getMaskedCharacters(t);return[e,this.genHighlight(s),i]},genHeader(t){return this.$createElement(Z,{props:t},t.header)},genHighlight(t){return this.$createElement("span",{staticClass:"v-list-item__mask"},t)},getMaskedCharacters(t){const e=(this.searchInput||"").toString().toLocaleLowerCase(),s=t.toLocaleLowerCase().indexOf(e);if(s<0)return{start:t,middle:"",end:""};const i=t.slice(0,s),n=t.slice(s,s+e.length),o=t.slice(s+e.length);return{start:i,middle:n,end:o}},genTile({item:t,index:e,disabled:s=null,value:i=!1}){i||(i=this.hasItem(t)),t===Object(t)&&(s=s!==null?s:this.getDisabled(t));const n={attrs:{"aria-selected":String(i),id:`list-item-${this._uid}-${e}`,role:"option"},on:{mousedown:m=>{m.preventDefault()},click:()=>s||this.$emit("select",t)},props:{activeClass:this.tileActiveClass,disabled:s,ripple:!0,inputValue:i}};if(!this.$scopedSlots.item)return this.$createElement(g,n,[this.action&&!this.hideSelected&&this.items.length>0?this.genAction(t,i):null,this.genTileContent(t,e)]);const o=this,a=this.$scopedSlots.item({parent:o,item:t,attrs:{...n.attrs,...n.props},on:n.on});return this.needsTile(a)?this.$createElement(g,n,a):a},genTileContent(t,e=0){return this.$createElement(K,[this.$createElement(R,[this.genFilteredText(this.getText(t))])])},hasItem(t){return this.parsedItems.indexOf(this.getValue(t))>-1},needsTile(t){return t.length!==1||t[0].componentOptions==null||t[0].componentOptions.Ctor.options.name!=="v-list-item"},getDisabled(t){return Boolean(c(t,this.itemDisabled,!1))},getText(t){return String(c(t,this.itemText,t))},getValue(t){return c(t,this.itemValue,this.getText(t))}},render(){const t=[],e=this.items.length;for(let s=0;s[]},itemColor:{type:String,default:"primary"},itemDisabled:{type:[String,Array,Function],default:"disabled"},itemText:{type:[String,Array,Function],default:"text"},itemValue:{type:[String,Array,Function],default:"value"},menuProps:{type:[String,Array,Object],default:()=>y},multiple:Boolean,openOnClear:Boolean,returnObject:Boolean,smallChips:Boolean},data(){return{cachedItems:this.cacheItems?this.items:[],menuIsBooted:!1,isMenuActive:!1,lastItem:20,lazyValue:this.value!==void 0?this.value:this.multiple?[]:void 0,selectedIndex:-1,selectedItems:[],keyboardLookupPrefix:"",keyboardLookupLastTime:0}},computed:{allItems(){return this.filterDuplicates(this.cachedItems.concat(this.items))},classes(){return{...h.options.computed.classes.call(this),"v-select":!0,"v-select--chips":this.hasChips,"v-select--chips--small":this.smallChips,"v-select--is-menu-active":this.isMenuActive,"v-select--is-multi":this.multiple}},computedItems(){return this.allItems},computedOwns(){return`list-${this._uid}`},computedCounterValue(){var t;const e=this.multiple?this.selectedItems:((t=this.getText(this.selectedItems[0]))!==null&&t!==void 0?t:"").toString();return typeof this.counterValue=="function"?this.counterValue(e):e.length},directives(){return this.isFocused?[{name:"click-outside",value:{handler:this.blur,closeConditional:this.closeConditional,include:()=>this.getOpenDependentElements()}}]:void 0},dynamicHeight(){return"auto"},hasChips(){return this.chips||this.smallChips},hasSlot(){return Boolean(this.hasChips||this.$scopedSlots.selection)},isDirty(){return this.selectedItems.length>0},listData(){const t=this.$vnode&&this.$vnode.context.$options._scopeId;return{attrs:{...t?{[t]:!0}:{},id:this.computedOwns},props:{action:this.multiple,color:this.itemColor,dense:this.dense,hideSelected:this.hideSelected,items:this.virtualizedItems,itemDisabled:this.itemDisabled,itemText:this.itemText,itemValue:this.itemValue,noDataText:this.$vuetify.lang.t(this.noDataText),selectedItems:this.selectedItems},on:{select:this.selectItem},scopedSlots:{item:this.$scopedSlots.item}}},staticList(){return(this.$slots["no-data"]||this.$slots["prepend-item"]||this.$slots["append-item"])&&q("assert: staticList should not be called if slots are used"),this.$createElement(T,this.listData)},virtualizedItems(){return this.$_menuProps.auto?this.computedItems:this.computedItems.slice(0,this.lastItem)},menuCanShow:()=>!0,$_menuProps(){let t=typeof this.menuProps=="string"?this.menuProps.split(","):this.menuProps;return Array.isArray(t)&&(t=t.reduce((e,s)=>(e[s.trim()]=!0,e),{})),{...y,eager:this.eager,value:this.menuCanShow&&this.isMenuActive,nudgeBottom:t.offsetY?1:0,...t}}},watch:{internalValue(t){this.initialValue=t,this.setSelectedItems(),this.multiple&&this.$nextTick(()=>{var e;(e=this.$refs.menu)===null||e===void 0||e.updateDimensions()})},isMenuActive(t){window.setTimeout(()=>this.onMenuActiveChange(t))},items:{immediate:!0,handler(t){this.cacheItems&&this.$nextTick(()=>{this.cachedItems=this.filterDuplicates(this.cachedItems.concat(t))}),this.setSelectedItems()}}},methods:{blur(t){h.options.methods.blur.call(this,t),this.isMenuActive=!1,this.isFocused=!1,this.selectedIndex=-1,this.setMenuIndex(-1)},activateMenu(){!this.isInteractive||this.isMenuActive||(this.isMenuActive=!0)},clearableCallback(){this.setValue(this.multiple?[]:null),this.setMenuIndex(-1),this.$nextTick(()=>this.$refs.input&&this.$refs.input.focus()),this.openOnClear&&(this.isMenuActive=!0)},closeConditional(t){return this.isMenuActive?!this._isDestroyed&&(!this.getContent()||!this.getContent().contains(t.target))&&this.$el&&!this.$el.contains(t.target)&&t.target!==this.$el:!0},filterDuplicates(t){const e=new Map;for(let s=0;sthis.valueComparator(this.getValue(s),e))},getContent(){return this.$refs.menu&&this.$refs.menu.$refs.content},genChipSelection(t,e){const s=this.isDisabled||this.getDisabled(t),i=!s&&this.isInteractive;return this.$createElement(N,{staticClass:"v-chip--select",attrs:{tabindex:-1},props:{close:this.deletableChips&&i,disabled:s,inputValue:e===this.selectedIndex,small:this.smallChips},on:{click:n=>{!i||(n.stopPropagation(),this.selectedIndex=e)},"click:close":()=>this.onChipInput(t)},key:JSON.stringify(this.getValue(t))},this.getText(t))},genCommaSelection(t,e,s){const i=e===this.selectedIndex&&this.computedColor,n=this.isDisabled||this.getDisabled(t);return this.$createElement("div",this.setTextColor(i,{staticClass:"v-select__selection v-select__selection--comma",class:{"v-select__selection--disabled":n},key:JSON.stringify(this.getValue(t))}),`${this.getText(t)}${s?"":", "}`)},genDefaultSlot(){const t=this.genSelections(),e=this.genInput();return Array.isArray(t)?t.push(e):(t.children=t.children||[],t.children.push(e)),[this.genFieldset(),this.$createElement("div",{staticClass:"v-select__slot",directives:this.directives},[this.genLabel(),this.prefix?this.genAffix("prefix"):null,t,this.suffix?this.genAffix("suffix"):null,this.genClearIcon(),this.genIconSlot(),this.genHiddenInput()]),this.genMenu(),this.genProgress()]},genIcon(t,e,s){const i=J.options.methods.genIcon.call(this,t,e,s);return t==="append"&&(i.children[0].data=I(i.children[0].data,{attrs:{tabindex:i.children[0].componentOptions.listeners&&"-1","aria-hidden":"true","aria-label":void 0}})),i},genInput(){const t=h.options.methods.genInput.call(this);return delete t.data.attrs.name,t.data=I(t.data,{domProps:{value:null},attrs:{readonly:!0,type:"text","aria-readonly":String(this.isReadonly),"aria-activedescendant":$(this.$refs.menu,"activeTile.id"),autocomplete:$(t.data,"attrs.autocomplete","off"),placeholder:!this.isDirty&&(this.persistentPlaceholder||this.isFocused||!this.hasLabel)?this.placeholder:void 0},on:{keypress:this.onKeyPress}}),t},genHiddenInput(){return this.$createElement("input",{domProps:{value:this.lazyValue},attrs:{type:"hidden",name:this.attrs$.name}})},genInputSlot(){const t=h.options.methods.genInputSlot.call(this);return t.data.attrs={...t.data.attrs,role:"button","aria-haspopup":"listbox","aria-expanded":String(this.isMenuActive),"aria-owns":this.computedOwns},t},genList(){return this.$slots["no-data"]||this.$slots["prepend-item"]||this.$slots["append-item"]?this.genListWithSlot():this.staticList},genListWithSlot(){const t=["prepend-item","no-data","append-item"].filter(e=>this.$slots[e]).map(e=>this.$createElement("template",{slot:e},this.$slots[e]));return this.$createElement(T,{...this.listData},t)},genMenu(){const t=this.$_menuProps;return t.activator=this.$refs["input-slot"],this.attach===""||this.attach===!0||this.attach==="attach"?t.attach=this.$el:t.attach=this.attach,this.$createElement(Y,{attrs:{role:void 0},props:t,on:{input:e=>{this.isMenuActive=e,this.isFocused=e},scroll:this.onScroll},ref:"menu"},[this.genList()])},genSelections(){let t=this.selectedItems.length;const e=new Array(t);let s;for(this.$scopedSlots.selection?s=this.genSlotSelection:this.hasChips?s=this.genChipSelection:s=this.genCommaSelection;t--;)e[t]=s(this.selectedItems[t],t,t===e.length-1);return this.$createElement("div",{staticClass:"v-select__selections"},e)},genSlotSelection(t,e){return this.$scopedSlots.selection({attrs:{class:"v-chip--select"},parent:this,item:t,index:e,select:s=>{s.stopPropagation(),this.selectedIndex=e},selected:e===this.selectedIndex,disabled:!this.isInteractive})},getMenuIndex(){return this.$refs.menu?this.$refs.menu.listIndex:-1},getDisabled(t){return c(t,this.itemDisabled,!1)},getText(t){return c(t,this.itemText,t)},getValue(t){return c(t,this.itemValue,this.getText(t))},onBlur(t){t&&this.$emit("blur",t)},onChipInput(t){this.multiple?this.selectItem(t):this.setValue(null),this.selectedItems.length===0?this.isMenuActive=!0:this.isMenuActive=!1,this.selectedIndex=-1},onClick(t){!this.isInteractive||(this.isAppendInner(t.target)||(this.isMenuActive=!0),this.isFocused||(this.isFocused=!0,this.$emit("focus")),this.$emit("click",t))},onEscDown(t){t.preventDefault(),this.isMenuActive&&(t.stopPropagation(),this.isMenuActive=!1)},onKeyPress(t){if(this.multiple||!this.isInteractive||this.disableLookup||t.key.length>1||t.ctrlKey||t.metaKey||t.altKey)return;const e=1e3,s=performance.now();s-this.keyboardLookupLastTime>e&&(this.keyboardLookupPrefix=""),this.keyboardLookupPrefix+=t.key.toLowerCase(),this.keyboardLookupLastTime=s;const i=this.allItems.findIndex(o=>{var a;return((a=this.getText(o))!==null&&a!==void 0?a:"").toString().toLowerCase().startsWith(this.keyboardLookupPrefix)}),n=this.allItems[i];i!==-1&&(this.lastItem=Math.max(this.lastItem,i+5),this.setValue(this.returnObject?n:this.getValue(n)),this.$nextTick(()=>this.$refs.menu.getTiles()),setTimeout(()=>this.setMenuIndex(i)))},onKeyDown(t){if(this.isReadonly&&t.keyCode!==l.tab)return;const e=t.keyCode,s=this.$refs.menu;if(this.$emit("keydown",t),!!s){if(this.isMenuActive&&[l.up,l.down,l.home,l.end,l.enter].includes(e)&&this.$nextTick(()=>{s.changeListIndex(t),this.$emit("update:list-index",s.listIndex)}),[l.enter,l.space].includes(e)&&this.activateMenu(),!this.isMenuActive&&[l.up,l.down,l.home,l.end].includes(e))return this.onUpDown(t);if(e===l.esc)return this.onEscDown(t);if(e===l.tab)return this.onTabDown(t);if(e===l.space)return this.onSpaceDown(t)}},onMenuActiveChange(t){if(this.multiple&&!t||this.getMenuIndex()>-1)return;const e=this.$refs.menu;if(!(!e||!this.isDirty)){this.$refs.menu.getTiles();for(let s=0;sthis.isMenuActive=!this.isMenuActive),h.options.methods.onMouseUp.call(this,t)},onScroll(){if(!this.isMenuActive)requestAnimationFrame(()=>this.getContent().scrollTop=0);else{if(this.lastItem>this.computedItems.length)return;this.getContent().scrollHeight-(this.getContent().scrollTop+this.getContent().clientHeight)<200&&(this.lastItem+=20)}},onSpaceDown(t){t.preventDefault()},onTabDown(t){const e=this.$refs.menu;if(!e)return;const s=e.activeTile;!this.multiple&&s&&this.isMenuActive?(t.preventDefault(),t.stopPropagation(),s.click()):this.blur(t)},onUpDown(t){const e=this.$refs.menu;if(!e)return;if(t.preventDefault(),this.multiple)return this.activateMenu();const s=t.keyCode;e.isBooted=!0,window.requestAnimationFrame(()=>{if(e.getTiles(),!e.hasClickableTiles)return this.activateMenu();switch(s){case l.up:e.prevTile();break;case l.down:e.nextTile();break;case l.home:e.firstTile();break;case l.end:e.lastTile();break}this.selectItem(this.allItems[this.getMenuIndex()])})},selectItem(t){if(!this.multiple)this.setValue(this.returnObject?t:this.getValue(t)),this.isMenuActive=!1;else{const e=(this.internalValue||[]).slice(),s=this.findExistingIndex(t);if(s!==-1?e.splice(s,1):e.push(t),this.setValue(e.map(i=>this.returnObject?i:this.getValue(i))),this.hideSelected)this.setMenuIndex(-1);else{const i=this.allItems.indexOf(t);~i&&(this.$nextTick(()=>this.$refs.menu.getTiles()),setTimeout(()=>this.setMenuIndex(i)))}}},setMenuIndex(t){this.$refs.menu&&(this.$refs.menu.listIndex=t)},setSelectedItems(){const t=[],e=!this.multiple||!Array.isArray(this.internalValue)?[this.internalValue]:this.internalValue;for(const s of e){const i=this.allItems.findIndex(n=>this.valueComparator(this.getValue(n),this.getValue(s)));i>-1&&t.push(this.allItems[i])}this.selectedItems=t},setValue(t){this.valueComparator(t,this.internalValue)||(this.internalValue=t,this.$emit("change",t))},isAppendInner(t){const e=this.$refs["append-inner"];return e&&(e===t||e.contains(t))}}});export{nt as V,Y as _,X as a,N as b,Z as c,y as d}; diff --git a/dist/assets/VSelect.8543571f.js b/dist/assets/VSelect.8543571f.js new file mode 100644 index 0000000..92bafc7 --- /dev/null +++ b/dist/assets/VSelect.8543571f.js @@ -0,0 +1 @@ +import{m as d,ad as y,w as k,T as p,R as m,ae as S,C as c,O as _,c as g,af as T,D as C,W as v,X as I,H as D,h as f,k as V,l as A,V as M,i as w,a0 as h,g as B,ag as L,o as r,ab as E,ah as O,N as b,p as P,A as l,a8 as F,a5 as H}from"./index.85262dd3.js";const j=d(c,S,m,p,k("chipGroup"),y("inputValue")).extend({name:"v-chip",props:{active:{type:Boolean,default:!0},activeClass:{type:String,default(){return this.chipGroup?this.chipGroup.activeClass:""}},close:Boolean,closeIcon:{type:String,default:"$delete"},closeLabel:{type:String,default:"$vuetify.close"},disabled:Boolean,draggable:Boolean,filter:Boolean,filterIcon:{type:String,default:"$complete"},label:Boolean,link:Boolean,outlined:Boolean,pill:Boolean,tag:{type:String,default:"span"},textColor:String,value:null},data:()=>({proxyClass:"v-chip--active"}),computed:{classes(){return{"v-chip":!0,...m.options.computed.classes.call(this),"v-chip--clickable":this.isClickable,"v-chip--disabled":this.disabled,"v-chip--draggable":this.draggable,"v-chip--label":this.label,"v-chip--link":this.isLink,"v-chip--no-color":!this.color,"v-chip--outlined":this.outlined,"v-chip--pill":this.pill,"v-chip--removable":this.hasClose,...this.themeClasses,...this.sizeableClasses,...this.groupClasses}},hasClose(){return Boolean(this.close)},isClickable(){return Boolean(m.options.computed.isClickable.call(this)||this.chipGroup)}},created(){[["outline","outlined"],["selected","input-value"],["value","active"],["@input","@active.sync"]].forEach(([t,s])=>{this.$attrs.hasOwnProperty(t)&&_(t,s,this)})},methods:{click(e){this.$emit("click",e),this.chipGroup&&this.toggle()},genFilter(){const e=[];return this.isActive&&e.push(this.$createElement(g,{staticClass:"v-chip__filter",props:{left:!0}},this.filterIcon)),this.$createElement(T,e)},genClose(){return this.$createElement(g,{staticClass:"v-chip__close",props:{right:!0,size:18},attrs:{"aria-label":this.$vuetify.lang.t(this.closeLabel)},on:{click:e=>{e.stopPropagation(),e.preventDefault(),this.$emit("click:close"),this.$emit("update:active",!1)}}},this.closeIcon)},genContent(){return this.$createElement("span",{staticClass:"v-chip__content"},[this.filter&&this.genFilter(),this.$slots.default,this.hasClose&&this.genClose()])}},render(e){const t=[this.genContent()];let{tag:s,data:i}=this.generateRouteLink();i.attrs={...i.attrs,draggable:this.draggable?"true":void 0,tabindex:this.chipGroup&&!this.disabled?0:i.attrs.tabindex},i.directives.push({name:"show",value:this.active}),i=this.setBackgroundColor(this.color,i);const n=this.textColor||this.outlined&&this.color;return e(s,this.setTextColor(n,i),t)}});const K=C.extend({name:"v-simple-checkbox",functional:!0,directives:{Ripple:v},props:{...c.options.props,...p.options.props,disabled:Boolean,ripple:{type:Boolean,default:!0},value:Boolean,indeterminate:Boolean,indeterminateIcon:{type:String,default:"$checkboxIndeterminate"},onIcon:{type:String,default:"$checkboxOn"},offIcon:{type:String,default:"$checkboxOff"}},render(e,{props:t,data:s,listeners:i}){const n=[];let o=t.offIcon;if(t.indeterminate?o=t.indeterminateIcon:t.value&&(o=t.onIcon),n.push(e(g,c.options.methods.setTextColor(t.value&&t.color,{props:{disabled:t.disabled,dark:t.dark,light:t.light}}),o)),t.ripple&&!t.disabled){const a=e("div",c.options.methods.setTextColor(t.color,{staticClass:"v-input--selection-controls__ripple",directives:[{def:v,name:"ripple",value:{center:!0}}]}));n.push(a)}return e("div",I(s,{class:{"v-simple-checkbox":!0,"v-simple-checkbox--disabled":t.disabled},on:{click:a=>{a.stopPropagation(),s.on&&s.on.input&&!t.disabled&&D(s.on.input).forEach(u=>u(!t.value))}}}),[e("div",{staticClass:"v-input--selection-controls__input"},n)])}});const R=d(p).extend({name:"v-subheader",props:{inset:Boolean},render(e){return e("div",{staticClass:"v-subheader",class:{"v-subheader--inset":this.inset,...this.themeClasses},attrs:this.$attrs,on:this.$listeners},this.$slots.default)}}),$=d(c,p).extend({name:"v-select-list",directives:{ripple:v},props:{action:Boolean,dense:Boolean,hideSelected:Boolean,items:{type:Array,default:()=>[]},itemDisabled:{type:[String,Array,Function],default:"disabled"},itemText:{type:[String,Array,Function],default:"text"},itemValue:{type:[String,Array,Function],default:"value"},noDataText:String,noFilter:Boolean,searchInput:null,selectedItems:{type:Array,default:()=>[]}},computed:{parsedItems(){return this.selectedItems.map(e=>this.getValue(e))},tileActiveClass(){return Object.keys(this.setTextColor(this.color).class||{}).join(" ")},staticNoDataTile(){const e={attrs:{role:void 0},on:{mousedown:t=>t.preventDefault()}};return this.$createElement(f,e,[this.genTileContent(this.noDataText)])}},methods:{genAction(e,t){return this.$createElement(V,[this.$createElement(K,{props:{color:this.color,value:t,ripple:!1},on:{input:()=>this.$emit("select",e)}})])},genDivider(e){return this.$createElement(A,{props:e})},genFilteredText(e){if(e=e||"",!this.searchInput||this.noFilter)return e;const{start:t,middle:s,end:i}=this.getMaskedCharacters(e);return[t,this.genHighlight(s),i]},genHeader(e){return this.$createElement(R,{props:e},e.header)},genHighlight(e){return this.$createElement("span",{staticClass:"v-list-item__mask"},e)},getMaskedCharacters(e){const t=(this.searchInput||"").toString().toLocaleLowerCase(),s=e.toLocaleLowerCase().indexOf(t);if(s<0)return{start:e,middle:"",end:""};const i=e.slice(0,s),n=e.slice(s,s+t.length),o=e.slice(s+t.length);return{start:i,middle:n,end:o}},genTile({item:e,index:t,disabled:s=null,value:i=!1}){i||(i=this.hasItem(e)),e===Object(e)&&(s=s!==null?s:this.getDisabled(e));const n={attrs:{"aria-selected":String(i),id:`list-item-${this._uid}-${t}`,role:"option"},on:{mousedown:u=>{u.preventDefault()},click:()=>s||this.$emit("select",e)},props:{activeClass:this.tileActiveClass,disabled:s,ripple:!0,inputValue:i}};if(!this.$scopedSlots.item)return this.$createElement(f,n,[this.action&&!this.hideSelected&&this.items.length>0?this.genAction(e,i):null,this.genTileContent(e,t)]);const o=this,a=this.$scopedSlots.item({parent:o,item:e,attrs:{...n.attrs,...n.props},on:n.on});return this.needsTile(a)?this.$createElement(f,n,a):a},genTileContent(e,t=0){return this.$createElement(M,[this.$createElement(w,[this.genFilteredText(this.getText(e))])])},hasItem(e){return this.parsedItems.indexOf(this.getValue(e))>-1},needsTile(e){return e.length!==1||e[0].componentOptions==null||e[0].componentOptions.Ctor.options.name!=="v-list-item"},getDisabled(e){return Boolean(h(e,this.itemDisabled,!1))},getText(e){return String(h(e,this.itemText,e))},getValue(e){return h(e,this.itemValue,this.getText(e))}},render(){const e=[],t=this.items.length;for(let s=0;s[]},itemColor:{type:String,default:"primary"},itemDisabled:{type:[String,Array,Function],default:"disabled"},itemText:{type:[String,Array,Function],default:"text"},itemValue:{type:[String,Array,Function],default:"value"},menuProps:{type:[String,Array,Object],default:()=>x},multiple:Boolean,openOnClear:Boolean,returnObject:Boolean,smallChips:Boolean},data(){return{cachedItems:this.cacheItems?this.items:[],menuIsBooted:!1,isMenuActive:!1,lastItem:20,lazyValue:this.value!==void 0?this.value:this.multiple?[]:void 0,selectedIndex:-1,selectedItems:[],keyboardLookupPrefix:"",keyboardLookupLastTime:0}},computed:{allItems(){return this.filterDuplicates(this.cachedItems.concat(this.items))},classes(){return{...r.options.computed.classes.call(this),"v-select":!0,"v-select--chips":this.hasChips,"v-select--chips--small":this.smallChips,"v-select--is-menu-active":this.isMenuActive,"v-select--is-multi":this.multiple}},computedItems(){return this.allItems},computedOwns(){return`list-${this._uid}`},computedCounterValue(){var e;const t=this.multiple?this.selectedItems:((e=this.getText(this.selectedItems[0]))!==null&&e!==void 0?e:"").toString();return typeof this.counterValue=="function"?this.counterValue(t):t.length},directives(){return this.isFocused?[{name:"click-outside",value:{handler:this.blur,closeConditional:this.closeConditional,include:()=>this.getOpenDependentElements()}}]:void 0},dynamicHeight(){return"auto"},hasChips(){return this.chips||this.smallChips},hasSlot(){return Boolean(this.hasChips||this.$scopedSlots.selection)},isDirty(){return this.selectedItems.length>0},listData(){const e=this.$vnode&&this.$vnode.context.$options._scopeId;return{attrs:{...e?{[e]:!0}:{},id:this.computedOwns},props:{action:this.multiple,color:this.itemColor,dense:this.dense,hideSelected:this.hideSelected,items:this.virtualizedItems,itemDisabled:this.itemDisabled,itemText:this.itemText,itemValue:this.itemValue,noDataText:this.$vuetify.lang.t(this.noDataText),selectedItems:this.selectedItems},on:{select:this.selectItem},scopedSlots:{item:this.$scopedSlots.item}}},staticList(){return(this.$slots["no-data"]||this.$slots["prepend-item"]||this.$slots["append-item"])&&E("assert: staticList should not be called if slots are used"),this.$createElement($,this.listData)},virtualizedItems(){return this.$_menuProps.auto?this.computedItems:this.computedItems.slice(0,this.lastItem)},menuCanShow:()=>!0,$_menuProps(){let e=typeof this.menuProps=="string"?this.menuProps.split(","):this.menuProps;return Array.isArray(e)&&(e=e.reduce((t,s)=>(t[s.trim()]=!0,t),{})),{...x,eager:this.eager,value:this.menuCanShow&&this.isMenuActive,nudgeBottom:e.offsetY?1:0,...e}}},watch:{internalValue(e){this.initialValue=e,this.setSelectedItems(),this.multiple&&this.$nextTick(()=>{var t;(t=this.$refs.menu)===null||t===void 0||t.updateDimensions()})},isMenuActive(e){window.setTimeout(()=>this.onMenuActiveChange(e))},items:{immediate:!0,handler(e){this.cacheItems&&this.$nextTick(()=>{this.cachedItems=this.filterDuplicates(this.cachedItems.concat(e))}),this.setSelectedItems()}}},methods:{blur(e){r.options.methods.blur.call(this,e),this.isMenuActive=!1,this.isFocused=!1,this.selectedIndex=-1,this.setMenuIndex(-1)},activateMenu(){!this.isInteractive||this.isMenuActive||(this.isMenuActive=!0)},clearableCallback(){this.setValue(this.multiple?[]:null),this.setMenuIndex(-1),this.$nextTick(()=>this.$refs.input&&this.$refs.input.focus()),this.openOnClear&&(this.isMenuActive=!0)},closeConditional(e){return this.isMenuActive?!this._isDestroyed&&(!this.getContent()||!this.getContent().contains(e.target))&&this.$el&&!this.$el.contains(e.target)&&e.target!==this.$el:!0},filterDuplicates(e){const t=new Map;for(let s=0;sthis.valueComparator(this.getValue(s),t))},getContent(){return this.$refs.menu&&this.$refs.menu.$refs.content},genChipSelection(e,t){const s=this.isDisabled||this.getDisabled(e),i=!s&&this.isInteractive;return this.$createElement(j,{staticClass:"v-chip--select",attrs:{tabindex:-1},props:{close:this.deletableChips&&i,disabled:s,inputValue:t===this.selectedIndex,small:this.smallChips},on:{click:n=>{!i||(n.stopPropagation(),this.selectedIndex=t)},"click:close":()=>this.onChipInput(e)},key:JSON.stringify(this.getValue(e))},this.getText(e))},genCommaSelection(e,t,s){const i=t===this.selectedIndex&&this.computedColor,n=this.isDisabled||this.getDisabled(e);return this.$createElement("div",this.setTextColor(i,{staticClass:"v-select__selection v-select__selection--comma",class:{"v-select__selection--disabled":n},key:JSON.stringify(this.getValue(e))}),`${this.getText(e)}${s?"":", "}`)},genDefaultSlot(){const e=this.genSelections(),t=this.genInput();return Array.isArray(e)?e.push(t):(e.children=e.children||[],e.children.push(t)),[this.genFieldset(),this.$createElement("div",{staticClass:"v-select__slot",directives:this.directives},[this.genLabel(),this.prefix?this.genAffix("prefix"):null,e,this.suffix?this.genAffix("suffix"):null,this.genClearIcon(),this.genIconSlot(),this.genHiddenInput()]),this.genMenu(),this.genProgress()]},genIcon(e,t,s){const i=O.options.methods.genIcon.call(this,e,t,s);return e==="append"&&(i.children[0].data=I(i.children[0].data,{attrs:{tabindex:i.children[0].componentOptions.listeners&&"-1","aria-hidden":"true","aria-label":void 0}})),i},genInput(){const e=r.options.methods.genInput.call(this);return delete e.data.attrs.name,e.data=I(e.data,{domProps:{value:null},attrs:{readonly:!0,type:"text","aria-readonly":String(this.isReadonly),"aria-activedescendant":b(this.$refs.menu,"activeTile.id"),autocomplete:b(e.data,"attrs.autocomplete","off"),placeholder:!this.isDirty&&(this.persistentPlaceholder||this.isFocused||!this.hasLabel)?this.placeholder:void 0},on:{keypress:this.onKeyPress}}),e},genHiddenInput(){return this.$createElement("input",{domProps:{value:this.lazyValue},attrs:{type:"hidden",name:this.attrs$.name}})},genInputSlot(){const e=r.options.methods.genInputSlot.call(this);return e.data.attrs={...e.data.attrs,role:"button","aria-haspopup":"listbox","aria-expanded":String(this.isMenuActive),"aria-owns":this.computedOwns},e},genList(){return this.$slots["no-data"]||this.$slots["prepend-item"]||this.$slots["append-item"]?this.genListWithSlot():this.staticList},genListWithSlot(){const e=["prepend-item","no-data","append-item"].filter(t=>this.$slots[t]).map(t=>this.$createElement("template",{slot:t},this.$slots[t]));return this.$createElement($,{...this.listData},e)},genMenu(){const e=this.$_menuProps;return e.activator=this.$refs["input-slot"],this.attach===""||this.attach===!0||this.attach==="attach"?e.attach=this.$el:e.attach=this.attach,this.$createElement(P,{attrs:{role:void 0},props:e,on:{input:t=>{this.isMenuActive=t,this.isFocused=t},scroll:this.onScroll},ref:"menu"},[this.genList()])},genSelections(){let e=this.selectedItems.length;const t=new Array(e);let s;for(this.$scopedSlots.selection?s=this.genSlotSelection:this.hasChips?s=this.genChipSelection:s=this.genCommaSelection;e--;)t[e]=s(this.selectedItems[e],e,e===t.length-1);return this.$createElement("div",{staticClass:"v-select__selections"},t)},genSlotSelection(e,t){return this.$scopedSlots.selection({attrs:{class:"v-chip--select"},parent:this,item:e,index:t,select:s=>{s.stopPropagation(),this.selectedIndex=t},selected:t===this.selectedIndex,disabled:!this.isInteractive})},getMenuIndex(){return this.$refs.menu?this.$refs.menu.listIndex:-1},getDisabled(e){return h(e,this.itemDisabled,!1)},getText(e){return h(e,this.itemText,e)},getValue(e){return h(e,this.itemValue,this.getText(e))},onBlur(e){e&&this.$emit("blur",e)},onChipInput(e){this.multiple?this.selectItem(e):this.setValue(null),this.selectedItems.length===0?this.isMenuActive=!0:this.isMenuActive=!1,this.selectedIndex=-1},onClick(e){!this.isInteractive||(this.isAppendInner(e.target)||(this.isMenuActive=!0),this.isFocused||(this.isFocused=!0,this.$emit("focus")),this.$emit("click",e))},onEscDown(e){e.preventDefault(),this.isMenuActive&&(e.stopPropagation(),this.isMenuActive=!1)},onKeyPress(e){if(this.multiple||!this.isInteractive||this.disableLookup||e.key.length>1||e.ctrlKey||e.metaKey||e.altKey)return;const t=1e3,s=performance.now();s-this.keyboardLookupLastTime>t&&(this.keyboardLookupPrefix=""),this.keyboardLookupPrefix+=e.key.toLowerCase(),this.keyboardLookupLastTime=s;const i=this.allItems.findIndex(o=>{var a;return((a=this.getText(o))!==null&&a!==void 0?a:"").toString().toLowerCase().startsWith(this.keyboardLookupPrefix)}),n=this.allItems[i];i!==-1&&(this.lastItem=Math.max(this.lastItem,i+5),this.setValue(this.returnObject?n:this.getValue(n)),this.$nextTick(()=>this.$refs.menu.getTiles()),setTimeout(()=>this.setMenuIndex(i)))},onKeyDown(e){if(this.isReadonly&&e.keyCode!==l.tab)return;const t=e.keyCode,s=this.$refs.menu;if(this.$emit("keydown",e),!!s){if(this.isMenuActive&&[l.up,l.down,l.home,l.end,l.enter].includes(t)&&this.$nextTick(()=>{s.changeListIndex(e),this.$emit("update:list-index",s.listIndex)}),[l.enter,l.space].includes(t)&&this.activateMenu(),!this.isMenuActive&&[l.up,l.down,l.home,l.end].includes(t))return this.onUpDown(e);if(t===l.esc)return this.onEscDown(e);if(t===l.tab)return this.onTabDown(e);if(t===l.space)return this.onSpaceDown(e)}},onMenuActiveChange(e){if(this.multiple&&!e||this.getMenuIndex()>-1)return;const t=this.$refs.menu;if(!(!t||!this.isDirty)){this.$refs.menu.getTiles();for(let s=0;sthis.isMenuActive=!this.isMenuActive),r.options.methods.onMouseUp.call(this,e)},onScroll(){if(!this.isMenuActive)requestAnimationFrame(()=>this.getContent().scrollTop=0);else{if(this.lastItem>this.computedItems.length)return;this.getContent().scrollHeight-(this.getContent().scrollTop+this.getContent().clientHeight)<200&&(this.lastItem+=20)}},onSpaceDown(e){e.preventDefault()},onTabDown(e){const t=this.$refs.menu;if(!t)return;const s=t.activeTile;!this.multiple&&s&&this.isMenuActive?(e.preventDefault(),e.stopPropagation(),s.click()):this.blur(e)},onUpDown(e){const t=this.$refs.menu;if(!t)return;if(e.preventDefault(),this.multiple)return this.activateMenu();const s=e.keyCode;t.isBooted=!0,window.requestAnimationFrame(()=>{if(t.getTiles(),!t.hasClickableTiles)return this.activateMenu();switch(s){case l.up:t.prevTile();break;case l.down:t.nextTile();break;case l.home:t.firstTile();break;case l.end:t.lastTile();break}this.selectItem(this.allItems[this.getMenuIndex()])})},selectItem(e){if(!this.multiple)this.setValue(this.returnObject?e:this.getValue(e)),this.isMenuActive=!1;else{const t=(this.internalValue||[]).slice(),s=this.findExistingIndex(e);if(s!==-1?t.splice(s,1):t.push(e),this.setValue(t.map(i=>this.returnObject?i:this.getValue(i))),this.hideSelected)this.setMenuIndex(-1);else{const i=this.allItems.indexOf(e);~i&&(this.$nextTick(()=>this.$refs.menu.getTiles()),setTimeout(()=>this.setMenuIndex(i)))}}},setMenuIndex(e){this.$refs.menu&&(this.$refs.menu.listIndex=e)},setSelectedItems(){const e=[],t=!this.multiple||!Array.isArray(this.internalValue)?[this.internalValue]:this.internalValue;for(const s of t){const i=this.allItems.findIndex(n=>this.valueComparator(this.getValue(n),this.getValue(s)));i>-1&&e.push(this.allItems[i])}this.selectedItems=e},setValue(e){this.valueComparator(e,this.internalValue)||(this.internalValue=e,this.$emit("change",e))},isAppendInner(e){const t=this.$refs["append-inner"];return t&&(t===e||t.contains(e))}}});export{N as V,K as _,j as a,R as b,x as d}; diff --git a/dist/assets/VSelect.0dddf8ac.css b/dist/assets/VSelect.f9fce4e7.css similarity index 82% rename from dist/assets/VSelect.0dddf8ac.css rename to dist/assets/VSelect.f9fce4e7.css index 46c0bfc..d078dd0 100644 --- a/dist/assets/VSelect.0dddf8ac.css +++ b/dist/assets/VSelect.f9fce4e7.css @@ -1 +1 @@ -.theme--light.v-select .v-select__selections{color:#000000de}.theme--light.v-select.v-input--is-disabled .v-select__selections,.theme--light.v-select .v-select__selection--disabled{color:#00000061}.theme--light.v-select.v-text-field--solo-inverted.v-input--is-focused .v-select__selections,.theme--dark.v-select .v-select__selections{color:#fff}.theme--dark.v-select.v-input--is-disabled .v-select__selections,.theme--dark.v-select .v-select__selection--disabled{color:#ffffff80}.theme--dark.v-select.v-text-field--solo-inverted.v-input--is-focused .v-select__selections{color:#000000de}.v-select{position:relative}.v-select:not(.v-select--is-multi).v-text-field--single-line .v-select__selections{flex-wrap:nowrap}.v-select>.v-input__control>.v-input__slot{cursor:pointer}.v-select .v-chip{flex:0 1 auto;margin:4px}.v-select .v-chip--selected:after{opacity:.22}.v-select .fade-transition-leave-active{position:absolute;left:0}.v-select.v-input--is-dirty ::placeholder{color:transparent!important}.v-select:not(.v-input--is-dirty):not(.v-input--is-focused) .v-text-field__prefix{line-height:20px;top:7px;transition:.3s cubic-bezier(.25,.8,.5,1)}.v-select.v-text-field--enclosed:not(.v-text-field--single-line):not(.v-text-field--outlined) .v-select__selections{padding-top:20px}.v-select.v-text-field--outlined:not(.v-text-field--single-line) .v-select__selections{padding:8px 0}.v-select.v-text-field--outlined:not(.v-text-field--single-line).v-input--dense .v-select__selections{padding:4px 0}.v-select.v-text-field input{flex:1 1;min-width:0;position:relative}.v-select.v-text-field:not(.v-text-field--single-line) input{margin-top:0}.v-select.v-select--is-menu-active .v-input__icon--append .v-icon{transform:rotate(180deg)}.v-select.v-select--chips input{margin:0}.v-select.v-select--chips .v-select__selections{min-height:42px}.v-select.v-select--chips.v-input--dense .v-select__selections{min-height:40px}.v-select.v-select--chips .v-chip--select.v-chip--active:before{opacity:.2}.v-select.v-select--chips.v-select--chips--small .v-select__selections{min-height:26px}.v-select.v-select--chips:not(.v-text-field--single-line).v-text-field--box .v-select__selections,.v-select.v-select--chips:not(.v-text-field--single-line).v-text-field--enclosed .v-select__selections{min-height:68px}.v-select.v-select--chips:not(.v-text-field--single-line).v-text-field--box.v-input--dense .v-select__selections,.v-select.v-select--chips:not(.v-text-field--single-line).v-text-field--enclosed.v-input--dense .v-select__selections{min-height:40px}.v-select.v-select--chips:not(.v-text-field--single-line).v-text-field--box.v-select--chips--small .v-select__selections,.v-select.v-select--chips:not(.v-text-field--single-line).v-text-field--enclosed.v-select--chips--small .v-select__selections{min-height:26px}.v-select.v-select--chips:not(.v-text-field--single-line).v-text-field--box.v-select--chips--small.v-input--dense .v-select__selections,.v-select.v-select--chips:not(.v-text-field--single-line).v-text-field--enclosed.v-select--chips--small.v-input--dense .v-select__selections{min-height:38px}.v-select.v-text-field--reverse .v-select__slot,.v-select.v-text-field--reverse .v-select__selections{flex-direction:row-reverse}.v-select.v-input--is-disabled:not(.v-input--is-readonly):not(.v-autocomplete){pointer-events:none}.v-select__selections{align-items:center;display:flex;flex:1 1;flex-wrap:wrap;line-height:18px;max-width:100%;min-width:0}.v-select__selection{max-width:90%}.v-select__selection--comma{margin:7px 4px 7px 0;min-height:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.v-select.v-input--dense .v-select__selection--comma{margin:5px 4px 3px 0}.v-select.v-input--dense .v-chip{margin:0 4px}.v-select__slot{position:relative;align-items:center;display:flex;max-width:100%;min-width:0;width:100%}.v-select:not(.v-text-field--single-line):not(.v-text-field--outlined) .v-select__slot>input{align-self:flex-end}.v-chip:not(.v-chip--outlined).primary,.v-chip:not(.v-chip--outlined).secondary,.v-chip:not(.v-chip--outlined).accent,.v-chip:not(.v-chip--outlined).success,.v-chip:not(.v-chip--outlined).error,.v-chip:not(.v-chip--outlined).warning,.v-chip:not(.v-chip--outlined).info{color:#fff}.theme--light.v-chip{border-color:#0000001f;color:#000000de}.theme--light.v-chip:not(.v-chip--active){background:#e0e0e0}.theme--light.v-chip:hover:before{opacity:.04}.theme--light.v-chip:focus:before{opacity:.12}.theme--light.v-chip--active:hover:before,.theme--light.v-chip--active:before{opacity:.12}.theme--light.v-chip--active:focus:before{opacity:.16}.theme--dark.v-chip{border-color:#ffffff1f;color:#fff}.theme--dark.v-chip:not(.v-chip--active){background:#555}.theme--dark.v-chip:hover:before{opacity:.08}.theme--dark.v-chip:focus:before{opacity:.24}.theme--dark.v-chip--active:hover:before,.theme--dark.v-chip--active:before{opacity:.24}.theme--dark.v-chip--active:focus:before{opacity:.32}.v-chip{align-items:center;cursor:default;display:inline-flex;line-height:20px;max-width:100%;outline:none;overflow:hidden;padding:0 12px;position:relative;text-decoration:none;transition-duration:.28s;transition-property:box-shadow,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);vertical-align:middle;white-space:nowrap}.v-chip:before{background-color:currentColor;bottom:0;border-radius:inherit;content:"";left:0;opacity:0;position:absolute;pointer-events:none;right:0;top:0}.v-chip .v-avatar{height:24px!important;min-width:24px!important;width:24px!important}.v-chip .v-icon{font-size:24px}.v-application--is-ltr .v-chip .v-avatar--left,.v-application--is-ltr .v-chip .v-icon--left{margin-left:-6px;margin-right:6px}.v-application--is-ltr .v-chip .v-avatar--right,.v-application--is-ltr .v-chip .v-icon--right,.v-application--is-rtl .v-chip .v-avatar--left,.v-application--is-rtl .v-chip .v-icon--left{margin-left:6px;margin-right:-6px}.v-application--is-rtl .v-chip .v-avatar--right,.v-application--is-rtl .v-chip .v-icon--right{margin-left:-6px;margin-right:6px}.v-chip:not(.v-chip--no-color) .v-icon{color:inherit}.v-chip .v-chip__close.v-icon{font-size:18px;max-height:18px;max-width:18px;user-select:none}.v-application--is-ltr .v-chip .v-chip__close.v-icon.v-icon--right{margin-right:-4px}.v-application--is-rtl .v-chip .v-chip__close.v-icon.v-icon--right{margin-left:-4px}.v-chip .v-chip__close.v-icon:hover,.v-chip .v-chip__close.v-icon:focus,.v-chip .v-chip__close.v-icon:active{opacity:.72}.v-chip .v-chip__content{align-items:center;display:inline-flex;height:100%;max-width:100%}.v-chip--active .v-icon{color:inherit}.v-chip--link:before{transition:opacity .3s cubic-bezier(.25,.8,.5,1)}.v-chip--link:focus:before{opacity:.32}.v-chip--clickable{cursor:pointer;user-select:none}.v-chip--clickable:active{box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.v-chip--disabled{opacity:.4;pointer-events:none;user-select:none}.v-chip__filter{max-width:24px}.v-chip__filter.v-icon{color:inherit}.v-chip__filter.expand-x-transition-leave-active,.v-chip__filter.expand-x-transition-enter{margin:0}.v-chip--pill .v-chip__filter{margin:0 16px 0 0}.v-chip--pill .v-avatar{height:32px!important;width:32px!important}.v-application--is-ltr .v-chip--pill .v-avatar--left{margin-left:-12px}.v-application--is-ltr .v-chip--pill .v-avatar--right,.v-application--is-rtl .v-chip--pill .v-avatar--left{margin-right:-12px}.v-application--is-rtl .v-chip--pill .v-avatar--right{margin-left:-12px}.v-chip--label{border-radius:4px!important}.v-chip.v-chip--outlined{border-width:thin;border-style:solid}.v-chip.v-chip--outlined.v-chip--active:before{opacity:.08}.v-chip.v-chip--outlined .v-icon{color:inherit}.v-chip.v-chip--outlined.v-chip.v-chip{background-color:transparent!important}.v-chip.v-chip--selected{background:transparent}.v-chip.v-chip--selected:after{opacity:.28}.v-chip.v-size--x-small{border-radius:8px;font-size:10px;height:16px}.v-chip.v-size--small{border-radius:12px;font-size:12px;height:24px}.v-chip.v-size--default{border-radius:16px;font-size:14px;height:32px}.v-chip.v-size--large{border-radius:27px;font-size:16px;height:54px}.v-chip.v-size--x-large{border-radius:33px;font-size:18px;height:66px}.v-menu{display:none}.v-menu--attached{display:inline}.v-menu__content{position:absolute;display:inline-block;max-width:80%;overflow-y:auto;overflow-x:hidden;contain:content;box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f;border-radius:4px}.v-menu__content--active{pointer-events:none}.v-menu__content--auto .v-list-item{transition-property:transform,opacity;transition-duration:.3s;transition-timing-function:cubic-bezier(.25,.8,.25,1)}.v-menu__content--fixed{position:fixed}.v-menu__content>.card{contain:content;backface-visibility:hidden}.v-menu>.v-menu__content{max-width:none}.v-menu-transition-enter .v-list-item{min-width:0;pointer-events:none}.v-menu-transition-enter-to .v-list-item{transition-delay:.1s}.v-menu-transition-leave-active,.v-menu-transition-leave-to{pointer-events:none}.v-menu-transition-enter,.v-menu-transition-leave-to{opacity:0}.v-menu-transition-enter-active,.v-menu-transition-leave-active{transition:all .3s cubic-bezier(.25,.8,.25,1)}.v-menu-transition-enter.v-menu__content--auto{transition:none!important}.v-menu-transition-enter.v-menu__content--auto .v-list-item{opacity:0;transform:translateY(-15px)}.v-menu-transition-enter.v-menu__content--auto .v-list-item--active{opacity:1;transform:none!important;pointer-events:auto}.v-simple-checkbox{align-self:center;line-height:normal;position:relative;user-select:none}.v-simple-checkbox .v-icon{cursor:pointer}.v-simple-checkbox--disabled{cursor:default}.theme--light.v-subheader{color:#0009}.theme--dark.v-subheader{color:#ffffffb3}.v-subheader{align-items:center;display:flex;height:48px;font-size:.875rem;font-weight:400;padding:0 16px}.v-subheader--inset{margin-left:56px} +.theme--light.v-select .v-select__selections{color:#000000de}.theme--light.v-select.v-input--is-disabled .v-select__selections,.theme--light.v-select .v-select__selection--disabled{color:#00000061}.theme--light.v-select.v-text-field--solo-inverted.v-input--is-focused .v-select__selections,.theme--dark.v-select .v-select__selections{color:#fff}.theme--dark.v-select.v-input--is-disabled .v-select__selections,.theme--dark.v-select .v-select__selection--disabled{color:#ffffff80}.theme--dark.v-select.v-text-field--solo-inverted.v-input--is-focused .v-select__selections{color:#000000de}.v-select{position:relative}.v-select:not(.v-select--is-multi).v-text-field--single-line .v-select__selections{flex-wrap:nowrap}.v-select>.v-input__control>.v-input__slot{cursor:pointer}.v-select .v-chip{flex:0 1 auto;margin:4px}.v-select .v-chip--selected:after{opacity:.22}.v-select .fade-transition-leave-active{position:absolute;left:0}.v-select.v-input--is-dirty ::placeholder{color:transparent!important}.v-select:not(.v-input--is-dirty):not(.v-input--is-focused) .v-text-field__prefix{line-height:20px;top:7px;transition:.3s cubic-bezier(.25,.8,.5,1)}.v-select.v-text-field--enclosed:not(.v-text-field--single-line):not(.v-text-field--outlined) .v-select__selections{padding-top:20px}.v-select.v-text-field--outlined:not(.v-text-field--single-line) .v-select__selections{padding:8px 0}.v-select.v-text-field--outlined:not(.v-text-field--single-line).v-input--dense .v-select__selections{padding:4px 0}.v-select.v-text-field input{flex:1 1;min-width:0;position:relative}.v-select.v-text-field:not(.v-text-field--single-line) input{margin-top:0}.v-select.v-select--is-menu-active .v-input__icon--append .v-icon{transform:rotate(180deg)}.v-select.v-select--chips input{margin:0}.v-select.v-select--chips .v-select__selections{min-height:42px}.v-select.v-select--chips.v-input--dense .v-select__selections{min-height:40px}.v-select.v-select--chips .v-chip--select.v-chip--active:before{opacity:.2}.v-select.v-select--chips.v-select--chips--small .v-select__selections{min-height:26px}.v-select.v-select--chips:not(.v-text-field--single-line).v-text-field--box .v-select__selections,.v-select.v-select--chips:not(.v-text-field--single-line).v-text-field--enclosed .v-select__selections{min-height:68px}.v-select.v-select--chips:not(.v-text-field--single-line).v-text-field--box.v-input--dense .v-select__selections,.v-select.v-select--chips:not(.v-text-field--single-line).v-text-field--enclosed.v-input--dense .v-select__selections{min-height:40px}.v-select.v-select--chips:not(.v-text-field--single-line).v-text-field--box.v-select--chips--small .v-select__selections,.v-select.v-select--chips:not(.v-text-field--single-line).v-text-field--enclosed.v-select--chips--small .v-select__selections{min-height:26px}.v-select.v-select--chips:not(.v-text-field--single-line).v-text-field--box.v-select--chips--small.v-input--dense .v-select__selections,.v-select.v-select--chips:not(.v-text-field--single-line).v-text-field--enclosed.v-select--chips--small.v-input--dense .v-select__selections{min-height:38px}.v-select.v-text-field--reverse .v-select__slot,.v-select.v-text-field--reverse .v-select__selections{flex-direction:row-reverse}.v-select.v-input--is-disabled:not(.v-input--is-readonly):not(.v-autocomplete){pointer-events:none}.v-select__selections{align-items:center;display:flex;flex:1 1;flex-wrap:wrap;line-height:18px;max-width:100%;min-width:0}.v-select__selection{max-width:90%}.v-select__selection--comma{margin:7px 4px 7px 0;min-height:10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.v-select.v-input--dense .v-select__selection--comma{margin:5px 4px 3px 0}.v-select.v-input--dense .v-chip{margin:0 4px}.v-select__slot{position:relative;align-items:center;display:flex;max-width:100%;min-width:0;width:100%}.v-select:not(.v-text-field--single-line):not(.v-text-field--outlined) .v-select__slot>input{align-self:flex-end}.v-chip:not(.v-chip--outlined).primary,.v-chip:not(.v-chip--outlined).secondary,.v-chip:not(.v-chip--outlined).accent,.v-chip:not(.v-chip--outlined).success,.v-chip:not(.v-chip--outlined).error,.v-chip:not(.v-chip--outlined).warning,.v-chip:not(.v-chip--outlined).info{color:#fff}.theme--light.v-chip{border-color:#0000001f;color:#000000de}.theme--light.v-chip:not(.v-chip--active){background:#e0e0e0}.theme--light.v-chip:hover:before{opacity:.04}.theme--light.v-chip:focus:before{opacity:.12}.theme--light.v-chip--active:hover:before,.theme--light.v-chip--active:before{opacity:.12}.theme--light.v-chip--active:focus:before{opacity:.16}.theme--dark.v-chip{border-color:#ffffff1f;color:#fff}.theme--dark.v-chip:not(.v-chip--active){background:#555}.theme--dark.v-chip:hover:before{opacity:.08}.theme--dark.v-chip:focus:before{opacity:.24}.theme--dark.v-chip--active:hover:before,.theme--dark.v-chip--active:before{opacity:.24}.theme--dark.v-chip--active:focus:before{opacity:.32}.v-chip{align-items:center;cursor:default;display:inline-flex;line-height:20px;max-width:100%;outline:none;overflow:hidden;padding:0 12px;position:relative;text-decoration:none;transition-duration:.28s;transition-property:box-shadow,opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);vertical-align:middle;white-space:nowrap}.v-chip:before{background-color:currentColor;bottom:0;border-radius:inherit;content:"";left:0;opacity:0;position:absolute;pointer-events:none;right:0;top:0}.v-chip .v-avatar{height:24px!important;min-width:24px!important;width:24px!important}.v-chip .v-icon{font-size:24px}.v-application--is-ltr .v-chip .v-avatar--left,.v-application--is-ltr .v-chip .v-icon--left{margin-left:-6px;margin-right:6px}.v-application--is-ltr .v-chip .v-avatar--right,.v-application--is-ltr .v-chip .v-icon--right,.v-application--is-rtl .v-chip .v-avatar--left,.v-application--is-rtl .v-chip .v-icon--left{margin-left:6px;margin-right:-6px}.v-application--is-rtl .v-chip .v-avatar--right,.v-application--is-rtl .v-chip .v-icon--right{margin-left:-6px;margin-right:6px}.v-chip:not(.v-chip--no-color) .v-icon{color:inherit}.v-chip .v-chip__close.v-icon{font-size:18px;max-height:18px;max-width:18px;user-select:none}.v-application--is-ltr .v-chip .v-chip__close.v-icon.v-icon--right{margin-right:-4px}.v-application--is-rtl .v-chip .v-chip__close.v-icon.v-icon--right{margin-left:-4px}.v-chip .v-chip__close.v-icon:hover,.v-chip .v-chip__close.v-icon:focus,.v-chip .v-chip__close.v-icon:active{opacity:.72}.v-chip .v-chip__content{align-items:center;display:inline-flex;height:100%;max-width:100%}.v-chip--active .v-icon{color:inherit}.v-chip--link:before{transition:opacity .3s cubic-bezier(.25,.8,.5,1)}.v-chip--link:focus:before{opacity:.32}.v-chip--clickable{cursor:pointer;user-select:none}.v-chip--clickable:active{box-shadow:0 3px 1px -2px #0003,0 2px 2px #00000024,0 1px 5px #0000001f}.v-chip--disabled{opacity:.4;pointer-events:none;user-select:none}.v-chip__filter{max-width:24px}.v-chip__filter.v-icon{color:inherit}.v-chip__filter.expand-x-transition-leave-active,.v-chip__filter.expand-x-transition-enter{margin:0}.v-chip--pill .v-chip__filter{margin:0 16px 0 0}.v-chip--pill .v-avatar{height:32px!important;width:32px!important}.v-application--is-ltr .v-chip--pill .v-avatar--left{margin-left:-12px}.v-application--is-ltr .v-chip--pill .v-avatar--right,.v-application--is-rtl .v-chip--pill .v-avatar--left{margin-right:-12px}.v-application--is-rtl .v-chip--pill .v-avatar--right{margin-left:-12px}.v-chip--label{border-radius:4px!important}.v-chip.v-chip--outlined{border-width:thin;border-style:solid}.v-chip.v-chip--outlined.v-chip--active:before{opacity:.08}.v-chip.v-chip--outlined .v-icon{color:inherit}.v-chip.v-chip--outlined.v-chip.v-chip{background-color:transparent!important}.v-chip.v-chip--selected{background:transparent}.v-chip.v-chip--selected:after{opacity:.28}.v-chip.v-size--x-small{border-radius:8px;font-size:10px;height:16px}.v-chip.v-size--small{border-radius:12px;font-size:12px;height:24px}.v-chip.v-size--default{border-radius:16px;font-size:14px;height:32px}.v-chip.v-size--large{border-radius:27px;font-size:16px;height:54px}.v-chip.v-size--x-large{border-radius:33px;font-size:18px;height:66px}.v-simple-checkbox{align-self:center;line-height:normal;position:relative;user-select:none}.v-simple-checkbox .v-icon{cursor:pointer}.v-simple-checkbox--disabled{cursor:default}.theme--light.v-subheader{color:#0009}.theme--dark.v-subheader{color:#ffffffb3}.v-subheader{align-items:center;display:flex;height:48px;font-size:.875rem;font-weight:400;padding:0 16px}.v-subheader--inset{margin-left:56px} diff --git a/dist/assets/VSwitch.4adac3f4.js b/dist/assets/VSwitch.8a27782c.js similarity index 92% rename from dist/assets/VSwitch.4adac3f4.js rename to dist/assets/VSwitch.8a27782c.js index 30bb1b5..d89de4e 100644 --- a/dist/assets/VSwitch.4adac3f4.js +++ b/dist/assets/VSwitch.8a27782c.js @@ -1 +1 @@ -import{aW as e,s as a,ab as n,aX as h,aY as r,y as i}from"./index.154e9cc6.js";const l=e.extend({name:"v-switch",directives:{Touch:a},props:{inset:Boolean,loading:{type:[Boolean,String],default:!1},flat:{type:Boolean,default:!1}},computed:{classes(){return{...n.options.computed.classes.call(this),"v-input--selection-controls v-input--switch":!0,"v-input--switch--flat":this.flat,"v-input--switch--inset":this.inset}},attrs(){return{"aria-checked":String(this.isActive),"aria-disabled":String(this.isDisabled),role:"switch"}},validationState(){if(this.hasError&&this.shouldValidate)return"error";if(this.hasSuccess)return"success";if(this.hasColor!==null)return this.computedColor},switchData(){return this.setTextColor(this.loading?void 0:this.validationState,{class:this.themeClasses})}},methods:{genDefaultSlot(){return[this.genSwitch(),this.genLabel()]},genSwitch(){const{title:t,...s}=this.attrs$;return this.$createElement("div",{staticClass:"v-input--selection-controls__input"},[this.genInput("checkbox",{...this.attrs,...s}),this.genRipple(this.setTextColor(this.validationState,{directives:[{name:"touch",value:{left:this.onSwipeLeft,right:this.onSwipeRight}}]})),this.$createElement("div",{staticClass:"v-input--switch__track",...this.switchData}),this.$createElement("div",{staticClass:"v-input--switch__thumb",...this.switchData},[this.genProgress()])])},genProgress(){return this.$createElement(h,{},[this.loading===!1?null:this.$slots.progress||this.$createElement(r,{props:{color:this.loading===!0||this.loading===""?this.color||"primary":this.loading,size:16,width:2,indeterminate:!0}})])},onSwipeLeft(){this.isActive&&this.onChange()},onSwipeRight(){this.isActive||this.onChange()},onKeydown(t){(t.keyCode===i.left&&this.isActive||t.keyCode===i.right&&!this.isActive)&&this.onChange()}}});export{l as _}; +import{aW as e,t as a,ah as n,aX as h,aY as r,A as i}from"./index.85262dd3.js";const l=e.extend({name:"v-switch",directives:{Touch:a},props:{inset:Boolean,loading:{type:[Boolean,String],default:!1},flat:{type:Boolean,default:!1}},computed:{classes(){return{...n.options.computed.classes.call(this),"v-input--selection-controls v-input--switch":!0,"v-input--switch--flat":this.flat,"v-input--switch--inset":this.inset}},attrs(){return{"aria-checked":String(this.isActive),"aria-disabled":String(this.isDisabled),role:"switch"}},validationState(){if(this.hasError&&this.shouldValidate)return"error";if(this.hasSuccess)return"success";if(this.hasColor!==null)return this.computedColor},switchData(){return this.setTextColor(this.loading?void 0:this.validationState,{class:this.themeClasses})}},methods:{genDefaultSlot(){return[this.genSwitch(),this.genLabel()]},genSwitch(){const{title:t,...s}=this.attrs$;return this.$createElement("div",{staticClass:"v-input--selection-controls__input"},[this.genInput("checkbox",{...this.attrs,...s}),this.genRipple(this.setTextColor(this.validationState,{directives:[{name:"touch",value:{left:this.onSwipeLeft,right:this.onSwipeRight}}]})),this.$createElement("div",{staticClass:"v-input--switch__track",...this.switchData}),this.$createElement("div",{staticClass:"v-input--switch__thumb",...this.switchData},[this.genProgress()])])},genProgress(){return this.$createElement(h,{},[this.loading===!1?null:this.$slots.progress||this.$createElement(r,{props:{color:this.loading===!0||this.loading===""?this.color||"primary":this.loading,size:16,width:2,indeterminate:!0}})])},onSwipeLeft(){this.isActive&&this.onChange()},onSwipeRight(){this.isActive||this.onChange()},onKeydown(t){(t.keyCode===i.left&&this.isActive||t.keyCode===i.right&&!this.isActive)&&this.onChange()}}});export{l as _}; diff --git a/dist/assets/VTabItem.9e30abd4.js b/dist/assets/VTabItem.35a0348a.js similarity index 98% rename from dist/assets/VTabItem.9e30abd4.js rename to dist/assets/VTabItem.35a0348a.js index f0897db..008c3da 100644 --- a/dist/assets/VTabItem.9e30abd4.js +++ b/dist/assets/VTabItem.35a0348a.js @@ -1 +1 @@ -import{s as f,b as I,c as b,g as l,m as h,t as x,B as S,M as _,v as $,w as B,x as O,T as p,S as k,C as y,P as A,R as C,y as R}from"./index.154e9cc6.js";import{B as d}from"./VExpansionPanels.1f915cd7.js";const v=d.extend({name:"v-window",directives:{Touch:f},provide(){return{windowGroup:this}},props:{activeClass:{type:String,default:"v-window-item--active"},continuous:Boolean,mandatory:{type:Boolean,default:!0},nextIcon:{type:[Boolean,String],default:"$next"},prevIcon:{type:[Boolean,String],default:"$prev"},reverse:Boolean,showArrows:Boolean,showArrowsOnHover:Boolean,touch:Object,touchless:Boolean,value:{required:!1},vertical:Boolean},data(){return{changedByDelimiters:!1,internalHeight:void 0,transitionHeight:void 0,transitionCount:0,isBooted:!1,isReverse:!1}},computed:{isActive(){return this.transitionCount>0},classes(){return{...d.options.computed.classes.call(this),"v-window--show-arrows-on-hover":this.showArrowsOnHover}},computedTransition(){if(!this.isBooted)return"";const t=this.vertical?"y":"x",s=(this.internalReverse?!this.isReverse:this.isReverse)?"-reverse":"";return`v-window-${t}${s}-transition`},hasActiveItems(){return Boolean(this.items.find(t=>!t.disabled))},hasNext(){return this.continuous||this.internalIndex0},internalIndex(){return this.items.findIndex((t,e)=>this.internalValue===this.getValue(t,e))},internalReverse(){return this.$vuetify.rtl?!this.reverse:this.reverse}},watch:{internalIndex(t,e){this.isReverse=this.updateReverse(t,e)}},mounted(){window.requestAnimationFrame(()=>this.isBooted=!0)},methods:{genDefaultSlot(){return this.$slots.default},genContainer(){const t=[this.genDefaultSlot()];return this.showArrows&&t.push(this.genControlIcons()),this.$createElement("div",{staticClass:"v-window__container",class:{"v-window__container--is-active":this.isActive},style:{height:this.internalHeight||this.transitionHeight}},t)},genIcon(t,e,s){var i,n,r;const a={click:T=>{T.stopPropagation(),this.changedByDelimiters=!0,s()}},o={"aria-label":this.$vuetify.lang.t(`$vuetify.carousel.${t}`)},u=(r=(n=(i=this.$scopedSlots)[t])===null||n===void 0?void 0:n.call(i,{on:a,attrs:o}))!==null&&r!==void 0?r:[this.$createElement(I,{props:{icon:!0},attrs:o,on:a},[this.$createElement(b,{props:{large:!0}},e)])];return this.$createElement("div",{staticClass:`v-window__${t}`},u)},genControlIcons(){const t=[],e=this.$vuetify.rtl?this.nextIcon:this.prevIcon;if(this.hasPrev&&e&&typeof e=="string"){const i=this.genIcon("prev",e,this.prev);i&&t.push(i)}const s=this.$vuetify.rtl?this.prevIcon:this.nextIcon;if(this.hasNext&&s&&typeof s=="string"){const i=this.genIcon("next",s,this.next);i&&t.push(i)}return t},getNextIndex(t){const e=(t+1)%this.items.length;return this.items[e].disabled?this.getNextIndex(e):e},getPrevIndex(t){const e=(t+this.items.length-1)%this.items.length;return this.items[e].disabled?this.getPrevIndex(e):e},next(){if(!this.hasActiveItems||!this.hasNext)return;const t=this.getNextIndex(this.internalIndex),e=this.items[t];this.internalValue=this.getValue(e,t)},prev(){if(!this.hasActiveItems||!this.hasPrev)return;const t=this.getPrevIndex(this.internalIndex),e=this.items[t];this.internalValue=this.getValue(e,t)},updateReverse(t,e){const s=this.items.length,i=s-1;return s<=2?t{this.$vuetify.rtl?this.prev():this.next()},right:()=>{this.$vuetify.rtl?this.next():this.prev()},end:i=>{i.stopPropagation()},start:i=>{i.stopPropagation()}};e.directives.push({name:"touch",value:s})}return t("div",e,[this.genContainer()])}}),P=h(S,x("windowGroup","v-window-item","v-window")),m=P.extend().extend().extend({name:"v-window-item",directives:{Touch:f},props:{disabled:Boolean,reverseTransition:{type:[Boolean,String],default:void 0},transition:{type:[Boolean,String],default:void 0},value:{required:!1}},data(){return{isActive:!1,inTransition:!1}},computed:{classes(){return this.groupClasses},computedTransition(){return this.windowGroup.internalReverse?typeof this.reverseTransition<"u"?this.reverseTransition||"":this.windowGroup.computedTransition:typeof this.transition<"u"?this.transition||"":this.windowGroup.computedTransition}},methods:{genDefaultSlot(){return this.$slots.default},genWindowItem(){return this.$createElement("div",{staticClass:"v-window-item",class:this.classes,directives:[{name:"show",value:this.isActive}],on:this.$listeners},this.genDefaultSlot())},onAfterTransition(){!this.inTransition||(this.inTransition=!1,this.windowGroup.transitionCount>0&&(this.windowGroup.transitionCount--,this.windowGroup.transitionCount===0&&(this.windowGroup.transitionHeight=void 0)))},onBeforeTransition(){this.inTransition||(this.inTransition=!0,this.windowGroup.transitionCount===0&&(this.windowGroup.transitionHeight=l(this.windowGroup.$el.clientHeight)),this.windowGroup.transitionCount++)},onTransitionCancelled(){this.onAfterTransition()},onEnter(t){!this.inTransition||this.$nextTick(()=>{!this.computedTransition||!this.inTransition||(this.windowGroup.transitionHeight=l(t.clientHeight))})}},render(t){return t("transition",{props:{name:this.computedTransition},on:{beforeEnter:this.onBeforeTransition,afterEnter:this.onAfterTransition,enterCancelled:this.onTransitionCancelled,beforeLeave:this.onBeforeTransition,afterLeave:this.onAfterTransition,leaveCancelled:this.onTransitionCancelled,enter:this.onEnter}},this.showLazyContent(()=>[this.genWindowItem()]))}});function g(t){const s=Math.abs(t);return Math.sign(t)*(s/((1/.501-2)*(1-s)+1))}function w(t,e,s,i){const n=t.clientWidth,r=s?e.content-t.offsetLeft-n:t.offsetLeft;s&&(i=-i);const a=e.wrapper+i,o=n+r,u=n*.4;return r<=i?i=Math.max(r-u,0):a<=o&&(i=Math.min(i-(a-o-u),e.content-e.wrapper)),s?-i:i}function W(t,e,s){const{offsetLeft:i,clientWidth:n}=t;if(s){const r=e.content-i-n/2-e.wrapper/2;return-Math.min(e.content-e.wrapper,Math.max(0,r))}else{const r=i+n/2-e.wrapper/2;return Math.min(e.content-e.wrapper,Math.max(0,r))}}const c=h(d,_).extend({name:"base-slide-group",directives:{Resize:$,Touch:f},props:{activeClass:{type:String,default:"v-slide-item--active"},centerActive:Boolean,nextIcon:{type:String,default:"$next"},prevIcon:{type:String,default:"$prev"},showArrows:{type:[Boolean,String],validator:t=>typeof t=="boolean"||["always","desktop","mobile"].includes(t)}},data:()=>({isOverflowing:!1,resizeTimeout:0,startX:0,isSwipingHorizontal:!1,isSwiping:!1,scrollOffset:0,widths:{content:0,wrapper:0}}),computed:{canTouch(){return typeof window<"u"},__cachedNext(){return this.genTransition("next")},__cachedPrev(){return this.genTransition("prev")},classes(){return{...d.options.computed.classes.call(this),"v-slide-group":!0,"v-slide-group--has-affixes":this.hasAffixes,"v-slide-group--is-overflowing":this.isOverflowing}},hasAffixes(){switch(this.showArrows){case"always":return!0;case"desktop":return!this.isMobile;case!0:return this.isOverflowing||Math.abs(this.scrollOffset)>0;case"mobile":return this.isMobile||this.isOverflowing||Math.abs(this.scrollOffset)>0;default:return!this.isMobile&&(this.isOverflowing||Math.abs(this.scrollOffset)>0)}},hasNext(){if(!this.hasAffixes)return!1;const{content:t,wrapper:e}=this.widths;return t>Math.abs(this.scrollOffset)+e},hasPrev(){return this.hasAffixes&&this.scrollOffset!==0}},watch:{internalValue:"setWidths",isOverflowing:"setWidths",scrollOffset(t){this.$vuetify.rtl&&(t=-t);let e=t<=0?g(-t):t>this.widths.content-this.widths.wrapper?-(this.widths.content-this.widths.wrapper)+g(this.widths.content-this.widths.wrapper-t):-t;this.$vuetify.rtl&&(e=-e),this.$refs.content.style.transform=`translateX(${e}px)`}},mounted(){if(typeof ResizeObserver<"u"){const t=new ResizeObserver(()=>{this.onResize()});t.observe(this.$el),t.observe(this.$refs.content),this.$on("hook:destroyed",()=>{t.disconnect()})}else{let t=0;this.$on("hook:beforeUpdate",()=>{var e;t=(((e=this.$refs.content)===null||e===void 0?void 0:e.children)||[]).length}),this.$on("hook:updated",()=>{var e;t!==(((e=this.$refs.content)===null||e===void 0?void 0:e.children)||[]).length&&this.setWidths()})}},methods:{onScroll(){this.$refs.wrapper.scrollLeft=0},onFocusin(t){if(!!this.isOverflowing){for(const e of B(t))for(const s of this.items)if(s.$el===e){this.scrollOffset=w(s.$el,this.widths,this.$vuetify.rtl,this.scrollOffset);return}}},genNext(){const t=this.$scopedSlots.next?this.$scopedSlots.next({}):this.$slots.next||this.__cachedNext;return this.$createElement("div",{staticClass:"v-slide-group__next",class:{"v-slide-group__next--disabled":!this.hasNext},on:{click:()=>this.onAffixClick("next")},key:"next"},[t])},genContent(){return this.$createElement("div",{staticClass:"v-slide-group__content",ref:"content",on:{focusin:this.onFocusin}},this.$slots.default)},genData(){return{class:this.classes,directives:[{name:"resize",value:this.onResize}]}},genIcon(t){let e=t;this.$vuetify.rtl&&t==="prev"?e="next":this.$vuetify.rtl&&t==="next"&&(e="prev");const s=`${t[0].toUpperCase()}${t.slice(1)}`,i=this[`has${s}`];return!this.showArrows&&!i?null:this.$createElement(b,{props:{disabled:!i}},this[`${e}Icon`])},genPrev(){const t=this.$scopedSlots.prev?this.$scopedSlots.prev({}):this.$slots.prev||this.__cachedPrev;return this.$createElement("div",{staticClass:"v-slide-group__prev",class:{"v-slide-group__prev--disabled":!this.hasPrev},on:{click:()=>this.onAffixClick("prev")},key:"prev"},[t])},genTransition(t){return this.$createElement(O,[this.genIcon(t)])},genWrapper(){return this.$createElement("div",{staticClass:"v-slide-group__wrapper",directives:[{name:"touch",value:{start:t=>this.overflowCheck(t,this.onTouchStart),move:t=>this.overflowCheck(t,this.onTouchMove),end:t=>this.overflowCheck(t,this.onTouchEnd)}}],ref:"wrapper",on:{scroll:this.onScroll}},[this.genContent()])},calculateNewOffset(t,e,s,i){const n=s?-1:1,r=n*i+(t==="prev"?-1:1)*e.wrapper;return n*Math.max(Math.min(r,e.content-e.wrapper),0)},onAffixClick(t){this.$emit(`click:${t}`),this.scrollTo(t)},onResize(){this._isDestroyed||this.setWidths()},onTouchStart(t){const{content:e}=this.$refs;this.startX=this.scrollOffset+t.touchstartX,e.style.setProperty("transition","none"),e.style.setProperty("willChange","transform")},onTouchMove(t){if(!!this.canTouch){if(!this.isSwiping){const e=t.touchmoveX-t.touchstartX,s=t.touchmoveY-t.touchstartY;this.isSwipingHorizontal=Math.abs(e)>Math.abs(s),this.isSwiping=!0}this.isSwipingHorizontal&&(this.scrollOffset=this.startX-t.touchmoveX,document.documentElement.style.overflowY="hidden")}},onTouchEnd(){if(!this.canTouch)return;const{content:t,wrapper:e}=this.$refs,s=t.clientWidth-e.clientWidth;t.style.setProperty("transition",null),t.style.setProperty("willChange",null),this.$vuetify.rtl?this.scrollOffset>0||!this.isOverflowing?this.scrollOffset=0:this.scrollOffset<=-s&&(this.scrollOffset=-s):this.scrollOffset<0||!this.isOverflowing?this.scrollOffset=0:this.scrollOffset>=s&&(this.scrollOffset=s),this.isSwiping=!1,document.documentElement.style.removeProperty("overflow-y")},overflowCheck(t,e){t.stopPropagation(),this.isOverflowing&&e(t)},scrollIntoView(){if(!this.selectedItem&&this.items.length){const t=this.items[this.items.length-1].$el.getBoundingClientRect(),e=this.$refs.wrapper.getBoundingClientRect();(this.$vuetify.rtl&&e.rightt.left)&&this.scrollTo("prev")}!this.selectedItem||(this.selectedIndex===0||!this.centerActive&&!this.isOverflowing?this.scrollOffset=0:this.centerActive?this.scrollOffset=W(this.selectedItem.$el,this.widths,this.$vuetify.rtl):this.isOverflowing&&(this.scrollOffset=w(this.selectedItem.$el,this.widths,this.$vuetify.rtl,this.scrollOffset)))},scrollTo(t){this.scrollOffset=this.calculateNewOffset(t,{content:this.$refs.content?this.$refs.content.clientWidth:0,wrapper:this.$refs.wrapper?this.$refs.wrapper.clientWidth:0},this.$vuetify.rtl,this.scrollOffset)},setWidths(){window.requestAnimationFrame(()=>{if(this._isDestroyed)return;const{content:t,wrapper:e}=this.$refs;this.widths={content:t?t.clientWidth:0,wrapper:e?e.clientWidth:0},this.isOverflowing=this.widths.wrapper+1{this.onResize()});t.observe(this.$el),this.$on("hook:destroyed",()=>{t.disconnect()})}this.$nextTick(()=>{window.setTimeout(this.callSlider,30)})},methods:{callSlider(){return this.hideSlider||!this.$refs.items||!this.$refs.items.selectedItems.length?(this.slider.width=0,!1):(this.$nextTick(()=>{const t=this.$refs.items.selectedItems[0];if(!t||!t.$el){this.slider.width=0,this.slider.left=0;return}const e=t.$el;this.slider={height:this.vertical?e.scrollHeight:Number(this.sliderSize),left:this.vertical?0:e.offsetLeft,right:this.vertical?0:e.offsetLeft+e.offsetWidth,top:e.offsetTop,width:this.vertical?Number(this.sliderSize):e.scrollWidth}}),!0)},genBar(t,e){const s={style:{height:l(this.height)},props:{activeClass:this.activeClass,centerActive:this.centerActive,dark:this.dark,light:this.light,mandatory:!this.optional,mobileBreakpoint:this.mobileBreakpoint,nextIcon:this.nextIcon,prevIcon:this.prevIcon,showArrows:this.showArrows,value:this.internalValue},on:{"call:slider":this.callSlider,change:i=>{this.internalValue=i}},ref:"items"};return this.setTextColor(this.computedColor,s),this.setBackgroundColor(this.backgroundColor,s),this.$createElement(z,s,[this.genSlider(e),t])},genItems(t,e){return t||(e.length?this.$createElement(M,{props:{value:this.internalValue},on:{change:s=>{this.internalValue=s}}},e):null)},genSlider(t){return this.hideSlider?null:(t||(t=this.$createElement(N,{props:{color:this.sliderColor}})),this.$createElement("div",{staticClass:"v-tabs-slider-wrapper",style:this.sliderStyles},[t]))},onResize(){this._isDestroyed||(clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(this.callSlider,0))},parseNodes(){let t=null,e=null;const s=[],i=[],n=this.$slots.default||[],r=n.length;for(let a=0;a({proxyClass:"v-tab--active"}),computed:{classes(){return{"v-tab":!0,...C.options.computed.classes.call(this),"v-tab--disabled":this.disabled,...this.groupClasses}},value(){let t=this.to||this.href;return t==null?t:(this.$router&&this.to===Object(this.to)&&(t=this.$router.resolve(this.to,this.$route,this.append).href),t.replace("#",""))}},methods:{click(t){if(this.disabled){t.preventDefault();return}this.href&&this.href.indexOf("#")>-1&&t.preventDefault(),t.detail&&this.$el.blur(),this.$emit("click",t),this.to||this.toggle()},toggle(){(!this.isActive||!this.tabsBar.mandatory&&!this.to)&&this.$emit("change")}},render(t){const{tag:e,data:s}=this.generateRouteLink();return s.attrs={...s.attrs,"aria-selected":String(this.isActive),role:"tab",tabindex:this.disabled?-1:0},s.on={...s.on,keydown:i=>{i.keyCode===R.enter&&this.click(i),this.$emit("keydown",i)}},t(e,s,this.$slots.default)}}),X=m.extend({name:"v-tab-item",props:{id:String},methods:{genWindowItem(){const t=m.options.methods.genWindowItem.call(this);return t.data.domProps=t.data.domProps||{},t.data.domProps.id=this.id||this.value,t}}});export{H as _,L as a,M as b,X as c}; +import{t as f,b as I,c as b,v as l,m as h,w as x,B as S,M as _,x as $,y as B,z as O,T as p,S as k,C as y,P as A,R as C,A as R}from"./index.85262dd3.js";import{B as d}from"./VExpansionPanels.d99facd5.js";const v=d.extend({name:"v-window",directives:{Touch:f},provide(){return{windowGroup:this}},props:{activeClass:{type:String,default:"v-window-item--active"},continuous:Boolean,mandatory:{type:Boolean,default:!0},nextIcon:{type:[Boolean,String],default:"$next"},prevIcon:{type:[Boolean,String],default:"$prev"},reverse:Boolean,showArrows:Boolean,showArrowsOnHover:Boolean,touch:Object,touchless:Boolean,value:{required:!1},vertical:Boolean},data(){return{changedByDelimiters:!1,internalHeight:void 0,transitionHeight:void 0,transitionCount:0,isBooted:!1,isReverse:!1}},computed:{isActive(){return this.transitionCount>0},classes(){return{...d.options.computed.classes.call(this),"v-window--show-arrows-on-hover":this.showArrowsOnHover}},computedTransition(){if(!this.isBooted)return"";const t=this.vertical?"y":"x",s=(this.internalReverse?!this.isReverse:this.isReverse)?"-reverse":"";return`v-window-${t}${s}-transition`},hasActiveItems(){return Boolean(this.items.find(t=>!t.disabled))},hasNext(){return this.continuous||this.internalIndex0},internalIndex(){return this.items.findIndex((t,e)=>this.internalValue===this.getValue(t,e))},internalReverse(){return this.$vuetify.rtl?!this.reverse:this.reverse}},watch:{internalIndex(t,e){this.isReverse=this.updateReverse(t,e)}},mounted(){window.requestAnimationFrame(()=>this.isBooted=!0)},methods:{genDefaultSlot(){return this.$slots.default},genContainer(){const t=[this.genDefaultSlot()];return this.showArrows&&t.push(this.genControlIcons()),this.$createElement("div",{staticClass:"v-window__container",class:{"v-window__container--is-active":this.isActive},style:{height:this.internalHeight||this.transitionHeight}},t)},genIcon(t,e,s){var i,n,r;const a={click:T=>{T.stopPropagation(),this.changedByDelimiters=!0,s()}},o={"aria-label":this.$vuetify.lang.t(`$vuetify.carousel.${t}`)},u=(r=(n=(i=this.$scopedSlots)[t])===null||n===void 0?void 0:n.call(i,{on:a,attrs:o}))!==null&&r!==void 0?r:[this.$createElement(I,{props:{icon:!0},attrs:o,on:a},[this.$createElement(b,{props:{large:!0}},e)])];return this.$createElement("div",{staticClass:`v-window__${t}`},u)},genControlIcons(){const t=[],e=this.$vuetify.rtl?this.nextIcon:this.prevIcon;if(this.hasPrev&&e&&typeof e=="string"){const i=this.genIcon("prev",e,this.prev);i&&t.push(i)}const s=this.$vuetify.rtl?this.prevIcon:this.nextIcon;if(this.hasNext&&s&&typeof s=="string"){const i=this.genIcon("next",s,this.next);i&&t.push(i)}return t},getNextIndex(t){const e=(t+1)%this.items.length;return this.items[e].disabled?this.getNextIndex(e):e},getPrevIndex(t){const e=(t+this.items.length-1)%this.items.length;return this.items[e].disabled?this.getPrevIndex(e):e},next(){if(!this.hasActiveItems||!this.hasNext)return;const t=this.getNextIndex(this.internalIndex),e=this.items[t];this.internalValue=this.getValue(e,t)},prev(){if(!this.hasActiveItems||!this.hasPrev)return;const t=this.getPrevIndex(this.internalIndex),e=this.items[t];this.internalValue=this.getValue(e,t)},updateReverse(t,e){const s=this.items.length,i=s-1;return s<=2?t{this.$vuetify.rtl?this.prev():this.next()},right:()=>{this.$vuetify.rtl?this.next():this.prev()},end:i=>{i.stopPropagation()},start:i=>{i.stopPropagation()}};e.directives.push({name:"touch",value:s})}return t("div",e,[this.genContainer()])}}),P=h(S,x("windowGroup","v-window-item","v-window")),m=P.extend().extend().extend({name:"v-window-item",directives:{Touch:f},props:{disabled:Boolean,reverseTransition:{type:[Boolean,String],default:void 0},transition:{type:[Boolean,String],default:void 0},value:{required:!1}},data(){return{isActive:!1,inTransition:!1}},computed:{classes(){return this.groupClasses},computedTransition(){return this.windowGroup.internalReverse?typeof this.reverseTransition<"u"?this.reverseTransition||"":this.windowGroup.computedTransition:typeof this.transition<"u"?this.transition||"":this.windowGroup.computedTransition}},methods:{genDefaultSlot(){return this.$slots.default},genWindowItem(){return this.$createElement("div",{staticClass:"v-window-item",class:this.classes,directives:[{name:"show",value:this.isActive}],on:this.$listeners},this.genDefaultSlot())},onAfterTransition(){!this.inTransition||(this.inTransition=!1,this.windowGroup.transitionCount>0&&(this.windowGroup.transitionCount--,this.windowGroup.transitionCount===0&&(this.windowGroup.transitionHeight=void 0)))},onBeforeTransition(){this.inTransition||(this.inTransition=!0,this.windowGroup.transitionCount===0&&(this.windowGroup.transitionHeight=l(this.windowGroup.$el.clientHeight)),this.windowGroup.transitionCount++)},onTransitionCancelled(){this.onAfterTransition()},onEnter(t){!this.inTransition||this.$nextTick(()=>{!this.computedTransition||!this.inTransition||(this.windowGroup.transitionHeight=l(t.clientHeight))})}},render(t){return t("transition",{props:{name:this.computedTransition},on:{beforeEnter:this.onBeforeTransition,afterEnter:this.onAfterTransition,enterCancelled:this.onTransitionCancelled,beforeLeave:this.onBeforeTransition,afterLeave:this.onAfterTransition,leaveCancelled:this.onTransitionCancelled,enter:this.onEnter}},this.showLazyContent(()=>[this.genWindowItem()]))}});function g(t){const s=Math.abs(t);return Math.sign(t)*(s/((1/.501-2)*(1-s)+1))}function w(t,e,s,i){const n=t.clientWidth,r=s?e.content-t.offsetLeft-n:t.offsetLeft;s&&(i=-i);const a=e.wrapper+i,o=n+r,u=n*.4;return r<=i?i=Math.max(r-u,0):a<=o&&(i=Math.min(i-(a-o-u),e.content-e.wrapper)),s?-i:i}function W(t,e,s){const{offsetLeft:i,clientWidth:n}=t;if(s){const r=e.content-i-n/2-e.wrapper/2;return-Math.min(e.content-e.wrapper,Math.max(0,r))}else{const r=i+n/2-e.wrapper/2;return Math.min(e.content-e.wrapper,Math.max(0,r))}}const c=h(d,_).extend({name:"base-slide-group",directives:{Resize:$,Touch:f},props:{activeClass:{type:String,default:"v-slide-item--active"},centerActive:Boolean,nextIcon:{type:String,default:"$next"},prevIcon:{type:String,default:"$prev"},showArrows:{type:[Boolean,String],validator:t=>typeof t=="boolean"||["always","desktop","mobile"].includes(t)}},data:()=>({isOverflowing:!1,resizeTimeout:0,startX:0,isSwipingHorizontal:!1,isSwiping:!1,scrollOffset:0,widths:{content:0,wrapper:0}}),computed:{canTouch(){return typeof window<"u"},__cachedNext(){return this.genTransition("next")},__cachedPrev(){return this.genTransition("prev")},classes(){return{...d.options.computed.classes.call(this),"v-slide-group":!0,"v-slide-group--has-affixes":this.hasAffixes,"v-slide-group--is-overflowing":this.isOverflowing}},hasAffixes(){switch(this.showArrows){case"always":return!0;case"desktop":return!this.isMobile;case!0:return this.isOverflowing||Math.abs(this.scrollOffset)>0;case"mobile":return this.isMobile||this.isOverflowing||Math.abs(this.scrollOffset)>0;default:return!this.isMobile&&(this.isOverflowing||Math.abs(this.scrollOffset)>0)}},hasNext(){if(!this.hasAffixes)return!1;const{content:t,wrapper:e}=this.widths;return t>Math.abs(this.scrollOffset)+e},hasPrev(){return this.hasAffixes&&this.scrollOffset!==0}},watch:{internalValue:"setWidths",isOverflowing:"setWidths",scrollOffset(t){this.$vuetify.rtl&&(t=-t);let e=t<=0?g(-t):t>this.widths.content-this.widths.wrapper?-(this.widths.content-this.widths.wrapper)+g(this.widths.content-this.widths.wrapper-t):-t;this.$vuetify.rtl&&(e=-e),this.$refs.content.style.transform=`translateX(${e}px)`}},mounted(){if(typeof ResizeObserver<"u"){const t=new ResizeObserver(()=>{this.onResize()});t.observe(this.$el),t.observe(this.$refs.content),this.$on("hook:destroyed",()=>{t.disconnect()})}else{let t=0;this.$on("hook:beforeUpdate",()=>{var e;t=(((e=this.$refs.content)===null||e===void 0?void 0:e.children)||[]).length}),this.$on("hook:updated",()=>{var e;t!==(((e=this.$refs.content)===null||e===void 0?void 0:e.children)||[]).length&&this.setWidths()})}},methods:{onScroll(){this.$refs.wrapper.scrollLeft=0},onFocusin(t){if(!!this.isOverflowing){for(const e of B(t))for(const s of this.items)if(s.$el===e){this.scrollOffset=w(s.$el,this.widths,this.$vuetify.rtl,this.scrollOffset);return}}},genNext(){const t=this.$scopedSlots.next?this.$scopedSlots.next({}):this.$slots.next||this.__cachedNext;return this.$createElement("div",{staticClass:"v-slide-group__next",class:{"v-slide-group__next--disabled":!this.hasNext},on:{click:()=>this.onAffixClick("next")},key:"next"},[t])},genContent(){return this.$createElement("div",{staticClass:"v-slide-group__content",ref:"content",on:{focusin:this.onFocusin}},this.$slots.default)},genData(){return{class:this.classes,directives:[{name:"resize",value:this.onResize}]}},genIcon(t){let e=t;this.$vuetify.rtl&&t==="prev"?e="next":this.$vuetify.rtl&&t==="next"&&(e="prev");const s=`${t[0].toUpperCase()}${t.slice(1)}`,i=this[`has${s}`];return!this.showArrows&&!i?null:this.$createElement(b,{props:{disabled:!i}},this[`${e}Icon`])},genPrev(){const t=this.$scopedSlots.prev?this.$scopedSlots.prev({}):this.$slots.prev||this.__cachedPrev;return this.$createElement("div",{staticClass:"v-slide-group__prev",class:{"v-slide-group__prev--disabled":!this.hasPrev},on:{click:()=>this.onAffixClick("prev")},key:"prev"},[t])},genTransition(t){return this.$createElement(O,[this.genIcon(t)])},genWrapper(){return this.$createElement("div",{staticClass:"v-slide-group__wrapper",directives:[{name:"touch",value:{start:t=>this.overflowCheck(t,this.onTouchStart),move:t=>this.overflowCheck(t,this.onTouchMove),end:t=>this.overflowCheck(t,this.onTouchEnd)}}],ref:"wrapper",on:{scroll:this.onScroll}},[this.genContent()])},calculateNewOffset(t,e,s,i){const n=s?-1:1,r=n*i+(t==="prev"?-1:1)*e.wrapper;return n*Math.max(Math.min(r,e.content-e.wrapper),0)},onAffixClick(t){this.$emit(`click:${t}`),this.scrollTo(t)},onResize(){this._isDestroyed||this.setWidths()},onTouchStart(t){const{content:e}=this.$refs;this.startX=this.scrollOffset+t.touchstartX,e.style.setProperty("transition","none"),e.style.setProperty("willChange","transform")},onTouchMove(t){if(!!this.canTouch){if(!this.isSwiping){const e=t.touchmoveX-t.touchstartX,s=t.touchmoveY-t.touchstartY;this.isSwipingHorizontal=Math.abs(e)>Math.abs(s),this.isSwiping=!0}this.isSwipingHorizontal&&(this.scrollOffset=this.startX-t.touchmoveX,document.documentElement.style.overflowY="hidden")}},onTouchEnd(){if(!this.canTouch)return;const{content:t,wrapper:e}=this.$refs,s=t.clientWidth-e.clientWidth;t.style.setProperty("transition",null),t.style.setProperty("willChange",null),this.$vuetify.rtl?this.scrollOffset>0||!this.isOverflowing?this.scrollOffset=0:this.scrollOffset<=-s&&(this.scrollOffset=-s):this.scrollOffset<0||!this.isOverflowing?this.scrollOffset=0:this.scrollOffset>=s&&(this.scrollOffset=s),this.isSwiping=!1,document.documentElement.style.removeProperty("overflow-y")},overflowCheck(t,e){t.stopPropagation(),this.isOverflowing&&e(t)},scrollIntoView(){if(!this.selectedItem&&this.items.length){const t=this.items[this.items.length-1].$el.getBoundingClientRect(),e=this.$refs.wrapper.getBoundingClientRect();(this.$vuetify.rtl&&e.rightt.left)&&this.scrollTo("prev")}!this.selectedItem||(this.selectedIndex===0||!this.centerActive&&!this.isOverflowing?this.scrollOffset=0:this.centerActive?this.scrollOffset=W(this.selectedItem.$el,this.widths,this.$vuetify.rtl):this.isOverflowing&&(this.scrollOffset=w(this.selectedItem.$el,this.widths,this.$vuetify.rtl,this.scrollOffset)))},scrollTo(t){this.scrollOffset=this.calculateNewOffset(t,{content:this.$refs.content?this.$refs.content.clientWidth:0,wrapper:this.$refs.wrapper?this.$refs.wrapper.clientWidth:0},this.$vuetify.rtl,this.scrollOffset)},setWidths(){window.requestAnimationFrame(()=>{if(this._isDestroyed)return;const{content:t,wrapper:e}=this.$refs;this.widths={content:t?t.clientWidth:0,wrapper:e?e.clientWidth:0},this.isOverflowing=this.widths.wrapper+1{this.onResize()});t.observe(this.$el),this.$on("hook:destroyed",()=>{t.disconnect()})}this.$nextTick(()=>{window.setTimeout(this.callSlider,30)})},methods:{callSlider(){return this.hideSlider||!this.$refs.items||!this.$refs.items.selectedItems.length?(this.slider.width=0,!1):(this.$nextTick(()=>{const t=this.$refs.items.selectedItems[0];if(!t||!t.$el){this.slider.width=0,this.slider.left=0;return}const e=t.$el;this.slider={height:this.vertical?e.scrollHeight:Number(this.sliderSize),left:this.vertical?0:e.offsetLeft,right:this.vertical?0:e.offsetLeft+e.offsetWidth,top:e.offsetTop,width:this.vertical?Number(this.sliderSize):e.scrollWidth}}),!0)},genBar(t,e){const s={style:{height:l(this.height)},props:{activeClass:this.activeClass,centerActive:this.centerActive,dark:this.dark,light:this.light,mandatory:!this.optional,mobileBreakpoint:this.mobileBreakpoint,nextIcon:this.nextIcon,prevIcon:this.prevIcon,showArrows:this.showArrows,value:this.internalValue},on:{"call:slider":this.callSlider,change:i=>{this.internalValue=i}},ref:"items"};return this.setTextColor(this.computedColor,s),this.setBackgroundColor(this.backgroundColor,s),this.$createElement(z,s,[this.genSlider(e),t])},genItems(t,e){return t||(e.length?this.$createElement(M,{props:{value:this.internalValue},on:{change:s=>{this.internalValue=s}}},e):null)},genSlider(t){return this.hideSlider?null:(t||(t=this.$createElement(N,{props:{color:this.sliderColor}})),this.$createElement("div",{staticClass:"v-tabs-slider-wrapper",style:this.sliderStyles},[t]))},onResize(){this._isDestroyed||(clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(this.callSlider,0))},parseNodes(){let t=null,e=null;const s=[],i=[],n=this.$slots.default||[],r=n.length;for(let a=0;a({proxyClass:"v-tab--active"}),computed:{classes(){return{"v-tab":!0,...C.options.computed.classes.call(this),"v-tab--disabled":this.disabled,...this.groupClasses}},value(){let t=this.to||this.href;return t==null?t:(this.$router&&this.to===Object(this.to)&&(t=this.$router.resolve(this.to,this.$route,this.append).href),t.replace("#",""))}},methods:{click(t){if(this.disabled){t.preventDefault();return}this.href&&this.href.indexOf("#")>-1&&t.preventDefault(),t.detail&&this.$el.blur(),this.$emit("click",t),this.to||this.toggle()},toggle(){(!this.isActive||!this.tabsBar.mandatory&&!this.to)&&this.$emit("change")}},render(t){const{tag:e,data:s}=this.generateRouteLink();return s.attrs={...s.attrs,"aria-selected":String(this.isActive),role:"tab",tabindex:this.disabled?-1:0},s.on={...s.on,keydown:i=>{i.keyCode===R.enter&&this.click(i),this.$emit("keydown",i)}},t(e,s,this.$slots.default)}}),X=m.extend({name:"v-tab-item",props:{id:String},methods:{genWindowItem(){const t=m.options.methods.genWindowItem.call(this);return t.data.domProps=t.data.domProps||{},t.data.domProps.id=this.id||this.value,t}}});export{H as _,L as a,M as b,X as c}; diff --git a/dist/assets/VTextarea.7a9da2ee.js b/dist/assets/VTextarea.7a9da2ee.js deleted file mode 100644 index a2639fe..0000000 --- a/dist/assets/VTextarea.7a9da2ee.js +++ /dev/null @@ -1 +0,0 @@ -import{j as o,m as i}from"./index.154e9cc6.js";const a=i(o),r=a.extend({name:"v-textarea",props:{autoGrow:Boolean,noResize:Boolean,rowHeight:{type:[Number,String],default:24,validator:t=>!isNaN(parseFloat(t))},rows:{type:[Number,String],default:5,validator:t=>!isNaN(parseInt(t,10))}},computed:{classes(){return{"v-textarea":!0,"v-textarea--auto-grow":this.autoGrow,"v-textarea--no-resize":this.noResizeHandle,...o.options.computed.classes.call(this)}},noResizeHandle(){return this.noResize||this.autoGrow}},watch:{autoGrow(t){this.$nextTick(()=>{var e;t?this.calculateInputHeight():(e=this.$refs.input)===null||e===void 0||e.style.removeProperty("height")})},lazyValue(){this.autoGrow&&this.$nextTick(this.calculateInputHeight)},rowHeight(){this.autoGrow&&this.$nextTick(this.calculateInputHeight)}},mounted(){setTimeout(()=>{this.autoGrow&&this.calculateInputHeight()},0)},methods:{calculateInputHeight(){const t=this.$refs.input;if(!t)return;t.style.height="0";const e=t.scrollHeight,s=parseInt(this.rows,10)*parseFloat(this.rowHeight);t.style.height=Math.max(s,e)+"px"},genInput(){const t=o.options.methods.genInput.call(this);return t.tag="textarea",delete t.data.attrs.type,t.data.attrs.rows=this.rows,t},onInput(t){o.options.methods.onInput.call(this,t),this.autoGrow&&this.calculateInputHeight()},onKeyDown(t){this.isFocused&&t.keyCode===13&&t.stopPropagation(),this.$emit("keydown",t)}}});export{r as _}; diff --git a/dist/assets/VTextarea.aac91b1e.js b/dist/assets/VTextarea.aac91b1e.js new file mode 100644 index 0000000..6c27963 --- /dev/null +++ b/dist/assets/VTextarea.aac91b1e.js @@ -0,0 +1 @@ +import{o,m as i}from"./index.85262dd3.js";const a=i(o),r=a.extend({name:"v-textarea",props:{autoGrow:Boolean,noResize:Boolean,rowHeight:{type:[Number,String],default:24,validator:t=>!isNaN(parseFloat(t))},rows:{type:[Number,String],default:5,validator:t=>!isNaN(parseInt(t,10))}},computed:{classes(){return{"v-textarea":!0,"v-textarea--auto-grow":this.autoGrow,"v-textarea--no-resize":this.noResizeHandle,...o.options.computed.classes.call(this)}},noResizeHandle(){return this.noResize||this.autoGrow}},watch:{autoGrow(t){this.$nextTick(()=>{var e;t?this.calculateInputHeight():(e=this.$refs.input)===null||e===void 0||e.style.removeProperty("height")})},lazyValue(){this.autoGrow&&this.$nextTick(this.calculateInputHeight)},rowHeight(){this.autoGrow&&this.$nextTick(this.calculateInputHeight)}},mounted(){setTimeout(()=>{this.autoGrow&&this.calculateInputHeight()},0)},methods:{calculateInputHeight(){const t=this.$refs.input;if(!t)return;t.style.height="0";const e=t.scrollHeight,s=parseInt(this.rows,10)*parseFloat(this.rowHeight);t.style.height=Math.max(s,e)+"px"},genInput(){const t=o.options.methods.genInput.call(this);return t.tag="textarea",delete t.data.attrs.type,t.data.attrs.rows=this.rows,t},onInput(t){o.options.methods.onInput.call(this,t),this.autoGrow&&this.calculateInputHeight()},onKeyDown(t){this.isFocused&&t.keyCode===13&&t.stopPropagation(),this.$emit("keydown",t)}}});export{r as _}; diff --git a/dist/assets/VTooltip.0c849a74.js b/dist/assets/VTooltip.0c849a74.js new file mode 100644 index 0000000..00ef8de --- /dev/null +++ b/dist/assets/VTooltip.0c849a74.js @@ -0,0 +1 @@ +import{m as a,a7 as h,a8 as r,a9 as l,C as c,v as n,aa as u,ab as p,ac as d,A as f}from"./index.85262dd3.js";const g=a(c,l,r,h).extend({name:"v-tooltip",props:{closeDelay:{type:[Number,String],default:0},disabled:Boolean,openDelay:{type:[Number,String],default:0},openOnHover:{type:Boolean,default:!0},openOnFocus:{type:Boolean,default:!0},tag:{type:String,default:"span"},transition:String},data:()=>({calculatedMinWidth:0,closeDependents:!1}),computed:{calculatedLeft(){const{activator:t,content:e}=this.dimensions,o=!this.bottom&&!this.left&&!this.top&&!this.right,i=this.attach!==!1?t.offsetLeft:t.left;let s=0;return this.top||this.bottom||o?s=i+t.width/2-e.width/2:(this.left||this.right)&&(s=i+(this.right?t.width:-e.width)+(this.right?10:-10)),this.nudgeLeft&&(s-=parseInt(this.nudgeLeft)),this.nudgeRight&&(s+=parseInt(this.nudgeRight)),`${this.calcXOverflow(s,this.dimensions.content.width)}px`},calculatedTop(){const{activator:t,content:e}=this.dimensions,o=this.attach!==!1?t.offsetTop:t.top;let i=0;return this.top||this.bottom?i=o+(this.bottom?t.height:-e.height)+(this.bottom?10:-10):(this.left||this.right)&&(i=o+t.height/2-e.height/2),this.nudgeTop&&(i-=parseInt(this.nudgeTop)),this.nudgeBottom&&(i+=parseInt(this.nudgeBottom)),this.attach===!1&&(i+=this.pageYOffset),`${this.calcYOverflow(i)}px`},classes(){return{"v-tooltip--top":this.top,"v-tooltip--right":this.right,"v-tooltip--bottom":this.bottom,"v-tooltip--left":this.left,"v-tooltip--attached":this.attach===""||this.attach===!0||this.attach==="attach"}},computedTransition(){return this.transition?this.transition:this.isActive?"scale-transition":"fade-transition"},offsetY(){return this.top||this.bottom},offsetX(){return this.left||this.right},styles(){return{left:this.calculatedLeft,maxWidth:n(this.maxWidth),minWidth:n(this.minWidth),top:this.calculatedTop,zIndex:this.zIndex||this.activeZIndex}}},beforeMount(){this.$nextTick(()=>{this.value&&this.callActivate()})},mounted(){u(this,"activator",!0)==="v-slot"&&p(`v-tooltip's activator slot must be bound, try '