"+o(i).meta_content+""},null,8,gA)]),_:1},8,["visible"])],64)):(_(),O(ne,{key:7},[o(i).isHidden(k)?A("",!0):(_(),$(at,{key:0,label:k,value:I},null,8,["label","value"]))],64))],64))),256))])])])])):A("",!0)]),_:1})):A("",!0),x(m,{header:"Bio",visible:o(i).display_bio_modal,"onUpdate:visible":c[5]||(c[5]=I=>o(i).display_bio_modal=I),breakpoints:{"960px":"75vw","640px":"90vw"},style:{width:"50vw"},modal:!0},{default:T(()=>[f("p",{class:"m-3",innerHTML:o(i).bio_modal_data},null,8,vA)]),_:1},8,["visible"])])}}},_A={class:"col-5"},bA={class:"flex flex-row"},wA={class:"font-semibold text-sm"},CA={class:"p-inputgroup"},SA={class:"grid p-fluid mt-1 mb-2"},kA={class:"col-12"},xA={key:0,class:"p-inputgroup"},IA={class:"p-input-icon-left"},LA=f("i",{class:"pi pi-search"},null,-1),PA={class:"p-datatable p-component p-datatable-responsive-scroll p-datatable-striped p-datatable-sm"},OA={key:0},EA={__name:"ViewRole",setup(n){const t=je(),i=fi(),r=B(),a=Ge();Te(async()=>{if(a.params&&!a.params.id)return i.toList(),!1;a.params&&a.params.id&&await i.getItem(a.params.id),i.item&&!i.user_roles&&await i.getUserRoles(),await i.getUserRolesMenuItems()});const s=Ae(),u=l=>{s.value.toggle(l)};return(l,c)=>{const d=R("Button"),p=R("Menu"),v=R("InputText"),h=R("Column"),m=R("DataTable"),b=R("Paginator"),I=R("Panel"),k=R("Divider"),y=Ke("tooltip");return _(),O("div",_A,[o(i).item?(_(),$(I,{key:0,class:"is-small"},{header:T(()=>[f("div",bA,[f("div",wA,Q(o(i).item.name),1)])]),icons:T(()=>[f("div",CA,[x(d,{class:"p-button-sm",label:"#"+o(i).item.id,onClick:c[0]||(c[0]=g=>o(r).copy(o(i).item.id)),"data-testid":"user-role_id"},null,8,["label"]),o(i).hasPermission("can-update-users")||o(i).hasPermission("can-manage-users")?(_(),$(d,{key:0,class:"p-button-sm",icon:"pi pi-angle-down","aria-haspopup":"true",onClick:u,"data-testid":"user-role_menu"})):A("",!0),x(p,{ref_key:"user_roles_menu_state",ref:s,model:o(i).user_roles_menu,popup:!0},null,8,["model"]),x(d,{class:"p-button-sm",icon:"pi pi-times","data-testid":"user-role_view",onClick:c[1]||(c[1]=g=>o(i).toList())})])]),default:T(()=>[f("div",SA,[f("div",kA,[o(i).assets&&o(i).assets.language_string&&o(i).assets.language_string.users?(_(),O("div",xA,[f("span",IA,[LA,x(v,{class:"w-full p-inputtext-sm",placeholder:o(i).assets.language_string.users.view_role_placeholder_search,type:"text",modelValue:o(i).user_roles_query.q,"onUpdate:modelValue":c[2]||(c[2]=g=>o(i).user_roles_query.q=g),onKeyup:[c[3]||(c[3]=Ie(g=>o(i).delayedUserRolesSearch(),["enter"])),c[4]||(c[4]=Ie(g=>o(i).delayedUserRolesSearch(),["enter","native"])),c[5]||(c[5]=Ie(g=>o(i).delayedUserRolesSearch(),["13"]))]},null,8,["placeholder","modelValue"])]),x(d,{class:"p-button-sm",label:o(i).assets.language_string.users.view_role_reset_button,"data-testid":"user-role_reset",onClick:c[6]||(c[6]=g=>o(i).resetUserRolesFilters())},null,8,["label"])])):A("",!0)])]),f("div",null,[f("div",PA,[o(i).user_roles&&o(t).assets&&o(t).assets.language_string&&o(t).assets.language_string.crud_actions?(_(),O("div",OA,[x(m,{value:o(i).user_roles.list.data,dataKey:"id",class:"p-datatable-sm",stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[x(h,{field:"role",header:"Roles",class:"flex align-items-center"},{body:T(g=>[ue(Q(g.data.name)+" ",1),ce(x(d,{class:"p-button-tiny p-button-text","data-testid":"taxonomies-table-to-edit",onClick:C=>o(r).copy(g.data.slug),icon:"pi pi-copy"},null,8,["onClick"]),[[y,o(t).assets.language_string.crud_actions.toolkit_text_copy_slug,void 0,{top:!0}]])]),_:1}),o(i).assets&&o(i).assets.language_string&&o(i).assets.language_string.users?(_(),$(h,{key:0,field:"role",header:"Has Role"},Mt({_:2},[o(i).hasPermission("can-update-users")||o(i).hasPermission("can-manage-users")?{name:"body",fn:T(g=>[g.data.pivot.is_active===1?(_(),$(d,{key:0,class:"p-button-success p-button-sm p-button-rounded",label:o(i).assets.language_string.users.view_role_yes,"data-testid":"user-role_status_yes",onClick:C=>o(i).changeUserRole(g.data,o(a).params.id)},null,8,["label","onClick"])):(_(),$(d,{key:1,class:"p-button-danger p-button-sm p-button-rounded",label:o(i).assets.language_string.users.view_role_no,"data-testid":"user-role_status_no",onClick:C=>o(i).changeUserRole(g.data,o(a).params.id)},null,8,["label","onClick"]))]),key:"0"}:{name:"body",fn:T(g=>[g.data.pivot.is_active===1?(_(),$(d,{key:0,class:"p-button-success p-button-sm p-button-rounded",label:o(i).assets.language_string.users.view_role_yes,disabled:""},null,8,["label"])):(_(),$(d,{key:1,class:"p-button-danger p-button-sm p-button-rounded",label:o(i).assets.language_string.users.view_role_no,disabled:""},null,8,["label"]))]),key:"1"}]),1024)):A("",!0),x(h,{field:"view",header:"View"},{body:T(g=>[ce(x(d,{class:"p-button-sm p-button-rounded p-button-outlined",onClick:C=>o(i).showModal(g.data),"data-testid":"user-role_details_view",icon:"pi pi-eye",label:o(i).assets.language_string.users.view_role_text_view},null,8,["onClick","label"]),[[y,o(t).assets.language_string.crud_actions.toolkit_text_view,void 0,{top:!0}]])]),_:1})]),_:1},8,["value"]),x(b,{first:o(i).rolesFirstElement,"onUpdate:first":c[7]||(c[7]=g=>o(i).rolesFirstElement=g),rows:o(i).user_roles_query.rows,totalRecords:o(i).user_roles.list.total,onPage:c[8]||(c[8]=g=>o(i).userRolesPaginate(g)),rowsPerPageOptions:o(i).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["first","rows","totalRecords","rowsPerPageOptions"])])):A("",!0)])])]),_:1})):A("",!0),x(o(ru),{header:"Details",visible:o(i).displayModal,"onUpdate:visible":c[9]||(c[9]=g=>o(i).displayModal=g),breakpoints:{"960px":"75vw","640px":"90vw"},style:{width:"50vw"},modal:!0},{default:T(()=>[(_(!0),O(ne,null,xe(o(i).modalData,(g,C)=>(_(),O("div",{key:C},[f("span",null,Q(C),1),ue(" : "+Q(g)+" ",1),x(k)]))),128))]),_:1},8,["visible"])])}}};let hf=[],ff=[];ff={path:"/vaah/users/",component:yn,props:!0,children:[{path:"",name:"users.index",component:AE,props:!0,children:[{path:"form/:id?",name:"users.form",component:YE,props:!0},{path:"view/:id?",name:"users.view",component:yA,props:!0},{path:"role/:id",name:"users.role",component:EA,props:!0}]}]};hf.push(ff);let AA="WebReinvent\\VaahCms\\Models\\Role",mf=document.getElementsByTagName("base")[0].getAttribute("href"),fd=mf+"/vaah/roles",Ki={query:{page:1,rows:20,filter:{q:null,is_active:null,trashed:null,sort:null},recount:null},role_permissions_query:{q:null,module:null,section:null,page:null,rows:null},role_users_query:{q:null,page:null,rows:null},action:{type:null,items:[]}};const jn=Ot({id:"roles",state:()=>({title:"Roles",base_url:mf,ajax_url:fd,model:AA,assets_is_fetching:!0,app:null,assets:null,rows_per_page:[10,20,30,50,100,500],list:null,item:{name:null,slug:null},fillable:null,empty_query:Ki.query,empty_action:Ki.action,query:B().clone(Ki.query),action:B().clone(Ki.action),search:{delay_time:600,delay_timer:0},route:null,watch_stopper:null,route_prefix:"roles.",view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],item_menu_list:[],item_menu_state:null,form_menu_list:[],total_permissions:null,total_users:null,permission_menu_items:null,role_permissions:null,role_user_menu_items:null,role_users:null,search_item:null,active_role_permission:null,active_role_user:null,module_section_list:null,role_permissions_query:B().clone(Ki.role_permissions_query),role_users_query:B().clone(Ki.role_users_query),is_btn_loading:!1,firstElement:null}),getters:{},actions:{async onLoad(n){this.route=n,this.setViewAndWidth(n.name),this.firstElement=(this.query.page-1)*this.query.rows,this.updateQueryFromUrl(n)},setViewAndWidth(n){switch(n){case"roles.index":this.view="large",this.list_view_width=12;break;default:this.view="small",this.list_view_width=6;break}},async updateQueryFromUrl(n){if(n.query&&Object.keys(n.query).length>0){for(let t in n.query)this.query[t]=n.query[t];this.countFilters(n.query)}},watchRoutes(n){this.watch_stopper=We(n,(t,i)=>{if(this.watch_stopper&&!t.name.includes(this.route_prefix))return this.watch_stopper(),!1;this.route=t,t.params.id&&this.getItem(t.params.id),this.setViewAndWidth(t.name)},{deep:!0})},watchItem(n){n&&n!==""&&(this.item.name=B().capitalising(n),this.item.slug=B().strToSlug(n))},watchStates(){We(this.query.filter,(n,t)=>{this.delayedSearch()},{deep:!0}),We(this.role_permissions_query,(n,t)=>{this.delayedRolePermissionSearch()},{deep:!0}),We(this.role_users_query,(n,t)=>{this.delayedRoleUsersSearch()},{deep:!0})},async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,B().ajax(this.ajax_url+"/assets",this.afterGetAssets))},afterGetAssets(n,t){n&&(this.assets=n,n.rows&&(this.query.rows?this.query.rows=parseInt(this.query.rows):this.query.rows=n.rows,this.role_permissions_query.rows=n.rows,this.role_users_query.rows=n.rows,this.firstElement=this.query.rows*(this.query.page-1)),this.route.params&&!this.route.params.id&&(this.item=B().clone(n.empty_item)))},async getList(){let n={query:B().clone(this.query)};await this.updateUrlQueryString(this.query),await B().ajax(this.ajax_url,this.afterGetList,n)},afterGetList:function(n,t){this.is_btn_loading=!1,this.query.recount=null,n&&(this.list=n,this.total_permissions=t.data.totalPermissions,this.total_users=t.data.totalUsers)},async getItem(n){n&&await B().ajax(fd+"/"+n,this.getItemAfter)},async getItemAfter(n,t){n?this.item=n:this.$router.push({name:"roles.index"}),this.getItemMenu(),await this.getFormMenu()},isListActionValid(){return this.action.type?this.action.items.length<1?(B().toastErrors(["Select records"]),!1):!0:(B().toastErrors(["Select an action type"]),!1)},async updateList(n=null){if(!n&&this.action.type?n=this.action.type:this.action.type=n,!this.isListActionValid())return!1;let t="PUT";switch(n){case"delete":t="DELETE";break}let i={params:this.action,method:t,show_success:!1};await B().ajax(this.ajax_url,this.updateListAfter,i)},async updateListAfter(n,t){n&&(this.action=B().clone(this.empty_action),await this.getList())},async listAction(n=null){!n&&this.action.type?n=this.action.type:this.action.type=n;let t=this.ajax_url+"/action/"+n,i="PUT";switch(n){case"delete":t=this.ajax_url,i="DELETE";break;case"delete-all":i="DELETE";break}let r={params:this.action,method:i,show_success:!1};await B().ajax(t,this.updateListAfter,r)},itemAction(n,t=null){t||(t=this.item),this.form.action=n;let i=this.ajax_url,r={method:"post"};switch(n){case"create-and-new":case"create-and-close":case"create-and-clone":r.method="POST",r.params=t;break;case"save":case"save-and-close":case"save-and-clone":r.method="PUT",r.params=t,i+="/"+t.id;break;case"save-and-new":r.method="PUT",r.params=t,i+="/"+t.id;break;case"delete":r.method="DELETE",i+="/"+t.id;break;default:r.method="PATCH",i+="/"+t.id+"/action/"+n;break}B().ajax(i,this.itemActionAfter,r)},async itemActionAfter(n,t){n&&(this.item=n,await this.getList(),await this.formActionAfter(),this.getItemMenu(),this.route.params&&this.route.params.id&&await this.getItem(this.route.params.id))},async formActionAfter(){switch(this.form.action){case"create-and-new":case"save-and-new":this.setActiveItemAsEmpty(),this.route.params.id=null,this.$router.push({name:"roles.form"});break;case"create-and-close":case"save-and-close":this.setActiveItemAsEmpty(),this.$router.push({name:"roles.index"});break;case"create-and-clone":this.item.id=null;break;case"save-and-clone":this.item.id=null,this.route.params.id=null,this.$router.push({name:"roles.form"});break;case"trash":this.item=null;break;case"delete":this.item=null,this.toList();break}},async toggleIsActive(n){n.is_active?await this.itemAction("activate",n):await this.itemAction("deactivate",n)},async paginate(n){this.query.page=n.page+1,this.query.rows=n.rows,await this.getList()},async reload(){await this.getAssets(),await this.getList()},async getFaker(){let n={model_namespace:this.model,except:this.assets.fillable.except},t=this.base_url+"/faker",i={params:n,method:"post"};B().ajax(t,this.getFakerAfter,i)},getFakerAfter:function(n,t){if(n){let i=this;Object.keys(n.fill).forEach(function(r){i.item[r]=n.fill[r]})}},async sync(){this.is_btn_loading=!0,this.query.recount=!0,await this.getList()},onItemSelection(n){this.action.items=n},setActiveItemAsEmpty(){this.item=B().clone(this.assets.empty_item)},confirmDelete(){if(this.action.items.length<1)return B().toastErrors(["Select a record"]),!1;this.action.type="delete",B().confirmDialogDelete(this.listAction)},confirmDeleteAll(){this.action.type="delete-all",B().confirmDialogDelete(this.listAction)},async delayedSearch(){let n=this;this.query.page=1,this.action.items=[],clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.updateUrlQueryString(n.query),await n.getList()},this.search.delay_time)},async updateUrlQueryString(n){n=B().clone(n);let t=ct.stringify(n,{skipNulls:!0}),i=ct.parse(t);i.filter&&(i.filter=B().cleanObject(i.filter)),await this.$router.replace({query:null}),await this.$router.replace({query:i}),this.countFilters(i)},countFilters:function(n){if(this.count_filters=0,n&&n.filter){let t=B().cleanObject(n.filter);this.count_filters=Object.keys(t).length}},async clearSearch(){this.query.filter.q=null,await this.updateUrlQueryString(this.query),await this.getList()},async resetQuery(){await this.resetQueryString(),await this.getList()},async resetQueryString(){for(let n in this.query.filter)this.query.filter[n]=null;await this.updateUrlQueryString(this.query)},async getItemPermissions(){this.showProgress();let n={query:this.role_permissions_query,method:"post"};B().ajax(this.ajax_url+"/item/"+this.item.id+"/permissions",this.afterGetItemPermissions,n)},afterGetItemPermissions(n,t){this.hideProgress(),n&&(this.role_permissions=n)},async delayedRolePermissionSearch(){let n=this;n.item&&n.item.id&&(clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.getItemPermissions()},this.search.delay_time))},async permissionPaginate(n){this.role_permissions_query.page=n.page+1,await this.getItemPermissions()},async getItemUsers(){this.showProgress();let n={query:this.role_users_query,method:"get"};B().ajax(this.ajax_url+"/item/"+this.item.id+"/users",this.afterGetItemUsers,n)},afterGetItemUsers(n,t){this.hideProgress(),n&&(this.role_users=n)},async userPaginate(n){this.role_users_query.page=n.page+1,await this.getItemUsers()},async delayedRoleUsersSearch(){let n=this;n.item&&n.item.id&&(clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.getItemUsers()},this.search.delay_time))},changeRoleStatus(n){let t={inputs:[n]},i={};this.actions(!1,"change-role-permission-status",t,i)},afterChangeRoleStatus(n,t){this.hideProgress(),this.getItemPermissions(this.filter.page),this.$store.dispatch("root/reloadPermissions")},changeRolePermission(n){let t={id:this.item.id,permission_id:n.id},i={};n.pivot.is_active?i.is_active=0:i.is_active=1,this.actions(!1,"toggle-permission-active-status",t,i)},changeUserRole:function(n){let t={id:this.item.id,user_id:n.id},i={};n.pivot.is_active?i.is_active=0:i.is_active=1,this.actions(!1,"toggle-user-active-status",t,i)},bulkActions(n,t){let i={id:this.item.id,permission_id:null,user_id:null},r={is_active:n};this.actions(!1,t,i,r)},actions(n,t,i,r){this.showProgress(),n&&n.preventDefault();let a={params:{inputs:i,data:r},method:"post"};B().ajax(this.ajax_url+"/actions/"+t,this.afterActions,a)},async afterActions(n,t){await this.hideProgress(),await this.getItemPermissions(this.item.id),await this.getItemUsers(),await this.getList()},resetRolePermissionFilters(){this.role_permissions_query.q=null,this.role_permissions_query.module=null,this.role_permissions_query.section=null,this.role_permissions_query.rows=this.assets.rows},getModuleSection(){let n={params:{module:this.role_permissions_query.module},method:"post"};B().ajax(this.ajax_url+"/module/"+this.role_permissions_query.module+"/sections",this.afterAetModuleSection,n)},afterAetModuleSection(n,t){n&&(this.module_section_list=n)},resetRoleUserFilters(){this.role_users_query.q=null,this.role_users_query.rows=this.assets.rows},closeForm(){this.$router.push({name:"roles.index"})},toList(){this.item=null,this.$router.push({name:"roles.index"})},toForm(){this.item=B().clone(this.assets.empty_item),this.getFormMenu(),this.$router.push({name:"roles.form"})},toView(n){this.item=B().clone(n),this.$router.push({name:"roles.view",params:{id:n.id}})},toEdit(n){this.item=n,this.$router.push({name:"roles.form",params:{id:n.id}})},async toPermission(n){this.item=n,await this.getItemPermissions(),this.$router.push({name:"roles.permissions",params:{id:n.id}})},toUser(n){this.item=n,this.getItemUsers(),this.$router.push({name:"roles.users",params:{id:n.id}})},isViewLarge(){return this.view==="large"},getIdWidth(){let n=50;if(this.list&&this.list.total){let t=this.list.total.toString();t=t.length,n=t*40}return n+"px"},getActionWidth(){let n=100;return this.isViewLarge()||(n=80),n+"px"},getActionLabel(){let n=null;return this.isViewLarge()&&(n="Actions"),n},async getListSelectedMenu(){this.list_selected_menu=[{label:"Activate",command:async()=>{await this.updateList("activate")}},{label:"Deactivate",command:async()=>{await this.updateList("deactivate")}},{separator:!0},{label:"Trash",icon:"pi pi-times",command:async()=>{await this.updateList("trash")}},{label:"Restore",icon:"pi pi-replay",command:async()=>{await this.updateList("restore")}},{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDelete()}}]},getListBulkMenu(){this.list_bulk_menu=[{label:"Mark all as active",command:async()=>{await this.listAction("activate-all")}},{label:"Mark all as inactive",command:async()=>{await this.listAction("deactivate-all")}},{separator:!0},{label:"Trash All",icon:"pi pi-times",command:async()=>{await this.listAction("trash-all")}},{label:"Restore All",icon:"pi pi-replay",command:async()=>{await this.listAction("restore-all")}},{label:"Delete All",icon:"pi pi-trash",command:async()=>{this.confirmDeleteAll()}}]},getItemMenu(){let n=[];this.item&&this.item.deleted_at&&n.push({label:"Restore",icon:"pi pi-refresh",command:()=>{this.itemAction("restore")}}),this.item&&this.item.id&&!this.item.deleted_at&&n.push({label:"Trash",icon:"pi pi-times",command:()=>{this.itemAction("trash")}}),n.push({label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDeleteItem("delete")}}),this.item_menu_list=n},confirmDeleteItem(){this.form.type="delete",B().confirmDialogDelete(this.confirmDeleteItemAfter)},confirmDeleteItemAfter(){this.itemAction("delete",this.item)},async getFormMenu(){let n=[];this.item&&this.item.id?n=[{label:"Save & Close",icon:"pi pi-check",command:()=>{this.itemAction("save-and-close")}},{label:"Save & Clone",icon:"pi pi-copy",command:()=>{this.itemAction("save-and-clone")}},{label:"Save & New",icon:"pi pi-plus",command:()=>{this.itemAction("save-and-new")}},{label:"Trash",icon:"pi pi-times",command:()=>{this.itemAction("trash")}},{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDeleteItem("delete")}}]:n=[{label:"Create & Close",icon:"pi pi-check",command:()=>{this.itemAction("create-and-close")}},{label:"Create & Clone",icon:"pi pi-copy",command:()=>{this.itemAction("create-and-clone")}},{label:"Reset",icon:"pi pi-refresh",command:()=>{this.setActiveItemAsEmpty()}}],n.push({label:"Fill",icon:"pi pi-pencil",command:()=>{this.getFaker()}}),this.form_menu_list=n},getMenuItems(){this.list_bulk_menu=[{label:"Active All Permissions",command:async()=>{await this.listAction("activate-all")}},{label:"Inactive All Permissions",command:async()=>{await this.listAction("deactivate-all")}}]},async getPermissionMenuItems(){this.permission_menu_items=[{label:"Active All Permissions",command:()=>{this.bulkActions(1,"toggle-permission-active-status")}},{label:"Inactive All Permissions",command:()=>{this.bulkActions(0,"toggle-permission-active-status")}}]},async getRoleUserMenuItems(){this.role_user_menu_items=[{label:"Attach To All Users",command:()=>{this.bulkActions(1,"toggle-user-active-status")}},{label:"Detach To All Users",command:()=>{this.bulkActions(0,"toggle-user-active-status")}}]},hasPermission(n){const t=je();return B().hasPermission(t.permissions,n)},showProgress(){this.show_progress_bar=!0},hideProgress(){this.show_progress_bar=!1},strToSlug(n){return B().strToSlug(n)},setPageTitle(){this.title&&(document.title=this.title)}}}),TA=f("b",null,"Sort By:",-1),RA={class:"field-radiobutton"},DA=f("label",{for:"sort-none"},"None",-1),MA={class:"field-radiobutton"},$A=f("label",{for:"sort-ascending"},"Updated (Ascending)",-1),VA={class:"field-radiobutton"},BA=f("label",{for:"sort-descending"},"Updated (Descending)",-1),qA=f("b",null,"Is Active:",-1),FA={class:"field-radiobutton"},jA=f("label",{for:"active-all"},"All",-1),UA={class:"field-radiobutton"},NA=f("label",{for:"active-true"},"Only Active",-1),HA={class:"field-radiobutton"},KA=f("label",{for:"active-false"},"Only Inactive",-1),zA=f("b",null,"Trashed:",-1),WA={class:"field-radiobutton"},GA=f("label",{for:"trashed-exclude"},"Exclude Trashed",-1),YA={class:"field-radiobutton"},QA=f("label",{for:"trashed-include"},"Include Trashed",-1),XA={class:"field-radiobutton"},ZA=f("label",{for:"trashed-only"},"Only Trashed",-1),JA={__name:"Filters",setup(n){const t=jn();return(i,r)=>{const a=R("RadioButton"),s=R("Divider"),u=R("Sidebar");return _(),O("div",null,[x(u,{visible:o(t).show_filters,"onUpdate:visible":r[9]||(r[9]=l=>o(t).show_filters=l),style:{"z-index":"1101"},position:"right"},{default:T(()=>[x(mt,null,{label:T(()=>[TA]),default:T(()=>[f("div",RA,[x(a,{name:"sort-none",value:"","data-testid":"role-filter_sort_none",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[0]||(r[0]=l=>o(t).query.filter.sort=l)},null,8,["modelValue"]),DA]),f("div",MA,[x(a,{name:"sort-ascending",value:"updated_at","data-testid":"role-filter_sort_asc",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[1]||(r[1]=l=>o(t).query.filter.sort=l)},null,8,["modelValue"]),$A]),f("div",VA,[x(a,{name:"sort-descending",value:"updated_at:desc","data-testid":"role-filter_sort_desc",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[2]||(r[2]=l=>o(t).query.filter.sort=l)},null,8,["modelValue"]),BA])]),_:1}),x(s),x(mt,null,{label:T(()=>[qA]),default:T(()=>[f("div",FA,[x(a,{name:"active-all",value:"null","data-testid":"role-filter_status_all",modelValue:o(t).query.filter.is_active,"onUpdate:modelValue":r[3]||(r[3]=l=>o(t).query.filter.is_active=l)},null,8,["modelValue"]),jA]),f("div",UA,[x(a,{name:"active-true",value:"true","data-testid":"role-filter_status_active_only",modelValue:o(t).query.filter.is_active,"onUpdate:modelValue":r[4]||(r[4]=l=>o(t).query.filter.is_active=l)},null,8,["modelValue"]),NA]),f("div",HA,[x(a,{name:"active-false",value:"false","data-testid":"role-filter_status_inactive_only",modelValue:o(t).query.filter.is_active,"onUpdate:modelValue":r[5]||(r[5]=l=>o(t).query.filter.is_active=l)},null,8,["modelValue"]),KA])]),_:1}),x(mt,null,{label:T(()=>[zA]),default:T(()=>[f("div",WA,[x(a,{name:"trashed-exclude",value:"","data-testid":"role-filter_trashed_exclude",modelValue:o(t).query.filter.trashed,"onUpdate:modelValue":r[6]||(r[6]=l=>o(t).query.filter.trashed=l)},null,8,["modelValue"]),GA]),f("div",YA,[x(a,{name:"trashed-include",value:"include","data-testid":"role-filter_trashed_include",modelValue:o(t).query.filter.trashed,"onUpdate:modelValue":r[7]||(r[7]=l=>o(t).query.filter.trashed=l)},null,8,["modelValue"]),QA]),f("div",XA,[x(a,{name:"trashed-only",value:"only","data-testid":"role-filter_trashed_only",modelValue:o(t).query.filter.trashed,"onUpdate:modelValue":r[8]||(r[8]=l=>o(t).query.filter.trashed=l)},null,8,["modelValue"]),ZA])]),_:1})]),_:1},8,["visible"])])}}},e7={key:0},t7=f("i",{class:"pi pi-angle-down"},null,-1),n7={class:"grid p-fluid"},i7={class:"col-12"},s7={class:"p-inputgroup"},r7={__name:"Actions",setup(n){const t=jn();Te(async()=>{t.getListSelectedMenu(),t.getListBulkMenu()});const i=Ae(),r=u=>{i.value.toggle(u)},a=Ae(),s=u=>{a.value.toggle(u)};return(u,l)=>{const c=R("Badge"),d=R("Button"),p=R("Menu"),v=R("InputText");return _(),O("div",null,[f("div",{class:he([{"flex justify-content-between":o(t).isViewLarge()},"mt-2 mb-2"])},[o(t).view==="large"?(_(),O("div",e7,[o(t).hasPermission("can-manage-role")||o(t).hasPermission("can-update-role")?(_(),$(d,{key:0,class:"p-button-sm",type:"button","aria-haspopup":"true","aria-controls":"overlay_menu",onClick:r},{default:T(()=>[t7,o(t).action.items.length>0?(_(),$(c,{key:0,value:o(t).action.items.length},null,8,["value"])):A("",!0)]),_:1})):A("",!0),x(p,{ref_key:"selected_menu_state",ref:i,model:o(t).list_selected_menu,popup:!0},null,8,["model"]),o(t).hasPermission("can-manage-role")||o(t).hasPermission("can-update-role")?(_(),$(d,{key:1,class:"ml-1 p-button-sm",icon:"pi pi-ellipsis-h",type:"button","aria-haspopup":"true","aria-controls":"bulk_menu_state",onClick:s})):A("",!0),x(p,{ref_key:"bulk_menu_state",ref:a,model:o(t).list_bulk_menu,popup:!0},null,8,["model"])])):A("",!0),f("div",null,[f("div",n7,[f("div",i7,[f("div",s7,[x(v,{class:"p-inputtext-sm",modelValue:o(t).query.filter.q,"onUpdate:modelValue":l[0]||(l[0]=h=>o(t).query.filter.q=h),onKeyup:[l[1]||(l[1]=Ie(h=>o(t).delayedSearch(),["enter"])),l[2]||(l[2]=Ie(h=>o(t).delayedSearch(),["enter","native"])),l[3]||(l[3]=Ie(h=>o(t).delayedSearch(),["13"]))],placeholder:"Search","data-testid":"role-action_search_input"},null,8,["modelValue"]),x(d,{class:"p-button-sm",icon:"pi pi-search","data-testid":"role-action_search",onClick:l[4]||(l[4]=h=>o(t).delayedSearch())}),x(d,{class:"p-button-sm",type:"button",onClick:l[5]||(l[5]=h=>o(t).show_filters=!0),"data-testid":"role-action_filter"},{default:T(()=>[ue(" Filters "),o(t).count_filters>0?(_(),$(c,{key:0,value:o(t).count_filters},null,8,["value"])):A("",!0)]),_:1}),x(d,{class:"p-button-sm",label:"Reset",icon:"pi pi-filter-slash",type:"button",onClick:l[6]||(l[6]=h=>o(t).resetQuery()),"data-testid":"role-action_filter_reset"})])]),x(JA)])])],2)])}}},o7={key:0},a7={class:"p-inputgroup"},l7={__name:"Table",setup(n){const t=jn(),i=B();return(r,a)=>{const s=R("Column"),u=R("Badge"),l=R("Button"),c=R("InputSwitch"),d=R("DataTable"),p=R("Paginator"),v=Ke("tooltip");return o(t).list?(_(),O("div",o7,[x(d,{value:o(t).list.data,dataKey:"id",class:"p-datatable-sm p-datatable-hoverable-rows",selection:o(t).action.items,"onUpdate:selection":a[0]||(a[0]=h=>o(t).action.items=h),stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[o(t).isViewLarge()?(_(),$(s,{key:0,selectionMode:"multiple",headerStyle:"width: 3em"})):A("",!0),x(s,{field:"id",header:"ID",style:St({width:o(t).getIdWidth()}),sortable:!0},null,8,["style"]),x(s,{field:"name",header:"Name",sortable:!0},{body:T(h=>[h.data.deleted_at?(_(),$(u,{key:0,value:"Trashed",severity:"danger"})):A("",!0),ue(" "+Q(h.data.name),1)]),_:1}),o(t).isViewLarge()?(_(),$(s,{key:1,field:"slug",header:"Slug",sortable:!0},{body:T(h=>[ce(x(l,{class:"p-button-tiny p-button-text p-0 mr-2","data-testid":"role-list_slug_copy",onClick:m=>o(i).copy(h.data.slug),icon:"pi pi-copy",label:h.data.slug},null,8,["onClick","label"]),[[v,"Copy Slug",void 0,{top:!0}]])]),_:1})):A("",!0),x(s,{field:"permissions",header:"Permissions"},{body:T(h=>[o(t).hasPermission("can-read-roles")?ce((_(),$(l,{key:0,class:"p-button-sm p-button-rounded white-space-nowrap",onClick:m=>o(t).toPermission(h.data),"data-testid":"role-list_permission_view"},{default:T(()=>[ue(Q(h.data.count_permissions)+" / "+Q(o(t).total_permissions),1)]),_:2},1032,["onClick"])),[[v,"View Permissions",void 0,{top:!0}]]):A("",!0)]),_:1}),x(s,{field:"users",header:"Users"},{body:T(h=>[o(t).hasPermission("can-read-roles")?ce((_(),$(l,{key:0,class:"p-button-sm p-button-rounded white-space-nowrap",onClick:m=>o(t).toUser(h.data),"data-testid":"role-list_user_view"},{default:T(()=>[ue(Q(h.data.count_users)+" / "+Q(o(t).total_users),1)]),_:2},1032,["onClick"])),[[v,"View Users",void 0,{top:!0}]]):A("",!0)]),_:1}),o(t).isViewLarge()?(_(),$(s,{key:2,field:"updated_at",header:"Updated",style:{width:"150px"},sortable:!0},{body:T(h=>[ue(Q(o(i).ago(h.data.updated_at)),1)]),_:1})):A("",!0),o(t).isViewLarge()?(_(),$(s,{key:3,field:"is_active",sortable:!1,style:{width:"100px"},header:"Is Active"},{body:T(h=>[x(c,{modelValue:h.data.is_active,"onUpdate:modelValue":m=>h.data.is_active=m,modelModifiers:{bool:!0},"false-value":0,"true-value":1,class:"p-inputswitch-sm","data-testid":"role-list_status",onInput:m=>o(t).toggleIsActive(h.data)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1})):A("",!0),x(s,{field:"actions",style:St([{width:"150px"},{width:o(t).getActionWidth()}]),header:o(t).getActionLabel()},{body:T(h=>[f("div",a7,[o(t).hasPermission("can-read-roles")?ce((_(),$(l,{key:0,class:"p-button-tiny p-button-text",onClick:m=>o(t).toView(h.data),icon:"pi pi-eye","data-testid":"role-item_view"},null,8,["onClick"])),[[v,"View",void 0,{top:!0}]]):A("",!0),o(t).hasPermission("can-update-roles")?ce((_(),$(l,{key:1,class:"p-button-tiny p-button-text",onClick:m=>o(t).toEdit(h.data),icon:"pi pi-pencil","data-testid":"role-item_edit"},null,8,["onClick"])),[[v,"Update",void 0,{top:!0}]]):A("",!0),o(t).isViewLarge()&&!h.data.deleted_at&&o(t).hasPermission("can-update-roles")?ce((_(),$(l,{key:2,class:"p-button-tiny p-button-danger p-button-text",onClick:m=>o(t).itemAction("trash",h.data),icon:"pi pi-trash","data-testid":"role-item_trash"},null,8,["onClick"])),[[v,"Trash",void 0,{top:!0}]]):A("",!0),o(t).isViewLarge()&&h.data.deleted_at?ce((_(),$(l,{key:3,class:"p-button-tiny p-button-success p-button-text",onClick:m=>o(t).itemAction("restore",h.data),icon:"pi pi-replay","data-testid":"role-item_restore"},null,8,["onClick"])),[[v,"Restore",void 0,{top:!0}]]):A("",!0)])]),_:1},8,["style","header"])]),_:1},8,["value","selection"]),x(p,{first:o(t).firstElement,"onUpdate:first":a[1]||(a[1]=h=>o(t).firstElement=h),rows:o(t).query.rows,totalRecords:o(t).list.total,onPage:a[2]||(a[2]=h=>o(t).paginate(h)),rowsPerPageOptions:o(t).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["first","rows","totalRecords","rowsPerPageOptions"])])):A("",!0)}}},u7={class:"grid"},c7={class:"flex flex-row"},d7=f("b",{class:"mr-1"},"Roles",-1),p7={class:"p-inputgroup"},h7={__name:"List",setup(n){const t=jn(),i=Ge();return _t(),Te(async()=>{await t.onLoad(i),await t.setPageTitle(),await t.watchRoutes(i),await t.watchStates(),await t.getAssets(),await t.getList()}),(r,a)=>{const s=R("Badge"),u=R("Button"),l=R("Panel"),c=R("RouterView");return _(),O("div",u7,[f("div",{class:he("col-"+o(t).list_view_width)},[x(l,{class:"is-small"},{header:T(()=>[f("div",c7,[f("div",null,[d7,o(t).list&&o(t).list.total>0?(_(),$(s,{key:0,value:o(t).list.total},null,8,["value"])):A("",!0)])])]),icons:T(()=>[f("div",p7,[o(t).hasPermission("can-create-roles")?(_(),$(u,{key:0,class:"p-button-sm",label:"Create",icon:"pi pi-plus",onClick:a[0]||(a[0]=d=>o(t).toForm()),"data-testid":"role-create"})):A("",!0),x(u,{class:"p-button-sm",icon:"pi pi-refresh",loading:o(t).is_btn_loading,onClick:a[1]||(a[1]=d=>o(t).sync()),"data-testid":"role-list_refresh"},null,8,["loading"])])]),default:T(()=>[x(r7),x(l7)]),_:1})],2),x(c)])}}},f7={class:"col-6"},m7={class:"flex flex-row"},g7={class:"font-semibold text-sm"},v7={key:0},y7={key:1},_7={class:"p-inputgroup"},b7={key:0,class:"mt-2"},w7={__name:"Form",setup(n){const t=jn(),i=je(),r=Ge(),a=B();Te(async()=>{r.params&&r.params.id&&await t.getItem(r.params.id),t.getFormMenu(),await i.getIsActiveStatusOptions()}),We(t.item,async(l,c)=>{t.item.slug=t.strToSlug(l.name)});const s=Ae(),u=l=>{s.value.toggle(l)};return(l,c)=>{const d=R("Button"),p=R("Menu"),v=R("InputText"),h=R("Textarea"),m=R("SelectButton"),b=R("Panel"),I=Ke("tooltip");return _(),O("div",f7,[x(b,{class:"is-small"},{header:T(()=>[f("div",m7,[f("div",g7,[o(t).item&&o(t).item.id?(_(),O("span",v7,Q(o(t).item.name),1)):(_(),O("span",y7," Create "))])])]),icons:T(()=>[f("div",_7,[o(t).item&&o(t).item.id?(_(),$(d,{key:0,class:"p-button-sm",label:"#"+o(t).item.id,onClick:c[0]||(c[0]=k=>o(a).copy(o(t).item.id)),"data-testid":"role-form_id"},null,8,["label"])):A("",!0),o(t).item&&o(t).item.id?(_(),$(d,{key:1,class:"p-button-sm",label:"Save",icon:"pi pi-save","data-testid":"role-edit_save",onClick:c[1]||(c[1]=k=>o(t).itemAction("save"))})):(_(),$(d,{key:2,class:"p-button-sm",label:"Create & New",icon:"pi pi-save","data-testid":"role-new_save",onClick:c[2]||(c[2]=k=>o(t).itemAction("create-and-new"))})),o(t).hasPermission("can-update-roles")||o(t).hasPermission("can-manage-roles")?(_(),$(d,{key:3,class:"p-button-sm",icon:"pi pi-angle-down",type:"button","aria-haspopup":"true",onClick:u,"data-testid":"role-form_menu"})):A("",!0),x(p,{ref_key:"form_menu",ref:s,model:o(t).form_menu_list,popup:!0},null,8,["model"]),o(t).item&&o(t).item.id||o(t).hasPermission("can-read-roles")?ce((_(),$(d,{key:4,class:"p-button-sm",icon:"pi pi-eye","data-testid":"role-item_view",onClick:c[3]||(c[3]=k=>o(t).toView(o(t).item))},null,512)),[[I,"View",void 0,{top:!0}]]):A("",!0),x(d,{class:"p-button-sm",icon:"pi pi-times","data-testid":"role-list_view",onClick:c[4]||(c[4]=k=>o(t).toList())})])]),default:T(()=>[o(t).item?(_(),O("div",b7,[x($e,{label:"Name"},{default:T(()=>[x(v,{class:"w-full",modelValue:o(t).item.name,"onUpdate:modelValue":[c[5]||(c[5]=k=>o(t).item.name=k),o(t).watchItem],"data-testid":"role-item_name"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),x($e,{label:"Slug"},{default:T(()=>[x(v,{class:"w-full",modelValue:o(t).item.slug,"onUpdate:modelValue":c[6]||(c[6]=k=>o(t).item.slug=k),"data-testid":"role-item_slug"},null,8,["modelValue"])]),_:1}),x($e,{label:"Details"},{default:T(()=>[x(h,{class:"w-full",modelValue:o(t).item.details,"onUpdate:modelValue":c[7]||(c[7]=k=>o(t).item.details=k),"data-testid":"role-item_details"},null,8,["modelValue"])]),_:1}),x($e,{label:"Is Active"},{default:T(()=>[o(i)&&o(i).is_active_status_options?(_(),$(m,{key:0,modelValue:o(t).item.is_active,"onUpdate:modelValue":c[8]||(c[8]=k=>o(t).item.is_active=k),"data-testid":"role-item_status",options:o(i).is_active_status_options,"option-label":"label","option-value":"value"},null,8,["modelValue","options"])):A("",!0)]),_:1})])):A("",!0)]),_:1})])}}},C7={class:"col-6"},S7={class:"flex flex-row"},k7={class:"font-semibold text-sm"},x7={class:"p-inputgroup"},I7={key:0,class:"mt-1"},L7={class:"flex align-items-center justify-content-between"},P7={class:""},O7={class:"ml-3"},E7={class:"p-datatable p-component p-datatable-responsive-scroll p-datatable-striped p-datatable-sm"},A7={class:"p-datatable-table"},T7={class:"p-datatable-tbody"},R7={__name:"Item",setup(n){const t=jn(),i=Ge(),r=B();Te(async()=>{if(i.params&&!i.params.id)return t.toList(),!1;i.params&&i.params.id&&await t.getItem(i.params.id)});const a=Ae(),s=u=>{a.value.toggle(u)};return(u,l)=>{const c=R("Button"),d=R("Menu"),p=R("Message"),v=R("Panel");return _(),O("div",C7,[o(t)&&o(t).item?(_(),$(v,{key:0,class:"is-small"},{header:T(()=>[f("div",S7,[f("div",k7,Q(o(t).item.name),1)])]),icons:T(()=>[f("div",x7,[x(c,{class:"p-button-sm",label:"#"+o(t).item.id,onClick:l[0]||(l[0]=h=>o(r).copy(o(t).item.id)),"data-testid":"role-item_id"},null,8,["label"]),o(t).hasPermission("can-update-roles")?(_(),$(c,{key:0,class:"p-button-sm",label:"Edit",icon:"pi pi-pencil",onClick:l[1]||(l[1]=h=>o(t).toEdit(o(t).item)),"data-testid":"role-item_edit"})):A("",!0),o(t).hasPermission("can-update-roles")||o(t).hasPermission("can-manage-roles")?(_(),$(c,{key:1,class:"p-button-sm",icon:"pi pi-angle-down",type:"button","aria-haspopup":"true","data-testid":"role-item_menu",onClick:s})):A("",!0),x(d,{ref_key:"item_menu_state",ref:a,model:o(t).item_menu_list,popup:!0},null,8,["model"]),x(c,{class:"p-button-sm",icon:"pi pi-times",onClick:l[2]||(l[2]=h=>o(t).toList()),"data-testid":"role-item_list"})])]),default:T(()=>[o(t).item?(_(),O("div",I7,[o(t).item.deleted_at?(_(),$(p,{key:0,severity:"error",class:"p-container-message",closable:!1,icon:"pi pi-trash"},{default:T(()=>[f("div",L7,[f("div",P7," Deleted "+Q(o(t).item.deleted_at),1),f("div",O7,[x(c,{label:"Restore",class:"p-button-sm",onClick:l[3]||(l[3]=h=>o(t).itemAction("restore")),"data-testid":"role-item_restore"})])])]),_:1})):A("",!0),f("div",E7,[f("table",A7,[f("tbody",T7,[(_(!0),O(ne,null,xe(o(t).item,(h,m)=>(_(),O(ne,null,[m==="created_by"||m==="updated_by"?(_(),O(ne,{key:0},[],64)):m==="id"||m==="uuid"||m==="slug"?(_(),$(at,{key:1,label:m,value:h,can_copy:!0},null,8,["label","value"])):(m==="created_by_user"||m==="updated_by_user"||m==="deleted_by_user")&&typeof h=="object"&&h!==null?(_(),$(at,{key:2,label:m,value:h,type:"user"},null,8,["label","value"])):m==="is_active"?(_(),$(at,{key:3,label:m,value:h,type:"yes-no"},null,8,["label","value"])):(_(),$(at,{key:4,label:m,value:h},null,8,["label","value"]))],64))),256))])])])])):A("",!0)]),_:1})):A("",!0)])}}},D7={key:0},M7={__name:"PermissionDetailsView",setup(n){const t=jn();return Te(async()=>{t.item||await t.getItem(route.params.id)}),(i,r)=>{const a=R("Divider");return _(),O("div",null,[o(t)&&o(t).active_role_permission?(_(),O("div",D7,[f("p",null,[ue("Created By : "),f("span",null,Q(o(t).active_role_permission.json.created_by),1)]),x(a,{class:"is-small"}),f("p",null,[ue("Updated By : "),f("span",null,Q(o(t).active_role_permission.json.updated_by),1)]),x(a,{class:"is-small"}),f("p",null,[ue("Created At : "),f("span",null,Q(o(t).active_role_permission.json.created_at),1)]),x(a,{class:"is-small"}),f("p",null,[ue("Updated At : "),f("span",null,Q(o(t).active_role_permission.json.updated_at),1)])])):A("",!0)])}}},$7={class:"col-6"},V7={class:"flex flex-row"},B7={class:"font-semibold text-sm"},q7={class:"p-inputgroup"},F7={class:"flex justify-content-between mt-3 mb-1"},j7={key:0},U7={key:1,class:"mx-1"},N7={class:"grid p-fluid"},H7={class:"col-12"},K7={class:"p-inputgroup"},z7={class:"p-input-icon-left"},W7=f("i",{class:"pi pi-search"},null,-1),G7={class:"flex"},Y7={class:"pl-2"},Q7={__name:"ViewPermission",setup(n){const t=B(),i=jn(),r=Ge(),a=je();Te(async()=>{if(r.params&&!r.params.id)return i.toList(),!1;r.params&&r.params.id&&await i.getItem(r.params.id),i.item&&!i.role_permissions&&await i.getItemPermissions(),await i.getPermissionMenuItems(),await a.getPermission()});const s=Ae(),u=v=>{s.value.toggle(v)},l=Rr(),c=()=>{l.open(M7,{props:{header:"Details",style:{width:"50vw"},breakpoints:{"960px":"75vw","640px":"90vw"},modal:!0}})},d=_t(),p=(v,h)=>{d.require({group:"templating",message:"Are you sure you want to change the status? This action will impact all roles that assign to this permission.",header:"Changing Status",icon:"pi pi-exclamation-circle text-red-600",acceptClass:"p-button p-button-danger is-small",acceptLabel:"Change",rejectLabel:"Cancel",rejectClass:" is-small btn-dark",accept:()=>{i.changeRoleStatus(h)}})};return(v,h)=>{const m=R("Button"),b=R("Menu"),I=R("Dropdown"),k=R("InputText"),y=R("Column"),g=R("DataTable"),C=R("Paginator"),w=R("Panel"),S=R("ConfirmDialog"),L=R("DynamicDialog"),P=Ke("tooltip");return _(),O("div",$7,[o(i)&&o(i).item?(_(),$(w,{key:0,class:"is-small"},{header:T(()=>[f("div",V7,[f("div",B7,Q(o(i).item.name),1)])]),icons:T(()=>[f("div",q7,[x(m,{class:"p-button-sm",label:"#"+o(i).item.id,onClick:h[0]||(h[0]=E=>o(t).copy(o(i).item.id)),"data-testid":"role-permission_id"},null,8,["label"]),o(i).hasPermission("can-update-roles")||o(i).hasPermission("can-manage-roles")?(_(),O(ne,{key:0},[x(m,{class:"p-button-sm",icon:"pi pi-angle-down",type:"button","aria-haspopup":"true",onClick:u,"data-testid":"role-permission_menu"}),x(b,{ref_key:"permission_menu",ref:s,model:o(i).permission_menu_items,popup:!0},null,8,["model"])],64)):A("",!0),x(m,{class:"p-button-sm",icon:"pi pi-times",onClick:h[1]||(h[1]=E=>o(i).toList()),"data-testid":"role-permission_list"})])]),default:T(()=>[f("div",F7,[o(i)&&o(i).assets?(_(),O("div",j7,[x(I,{modelValue:o(i).role_permissions_query.module,"onUpdate:modelValue":h[2]||(h[2]=E=>o(i).role_permissions_query.module=E),options:o(i).assets.modules,placeholder:"Select a Module","data-testid":"role-permission_module",onChange:h[3]||(h[3]=E=>o(i).getModuleSection()),class:"is-small"},{option:T(E=>[f("div",null,Q(E.option.charAt(0).toUpperCase()+E.option.slice(1)),1)]),_:1},8,["modelValue","options"])])):A("",!0),o(i).role_permissions_query.module&&o(i).module_section_list?(_(),O("div",U7,[x(I,{modelValue:o(i).role_permissions_query.section,"onUpdate:modelValue":h[4]||(h[4]=E=>o(i).role_permissions_query.section=E),options:o(i).module_section_list,placeholder:"Select a Section",onClick:h[5]||(h[5]=E=>o(i).getItemPermissions()),"data-testid":"role-permission_section",class:"is-small"},{option:T(E=>[f("div",null,Q(E.option.charAt(0).toUpperCase()+E.option.slice(1)),1)]),_:1},8,["modelValue","options"])])):A("",!0),f("div",N7,[f("div",H7,[f("div",K7,[f("span",z7,[W7,x(k,{modelValue:o(i).role_permissions_query.q,"onUpdate:modelValue":h[6]||(h[6]=E=>o(i).role_permissions_query.q=E),onKeyup:[h[7]||(h[7]=Ie(E=>o(i).delayedRolePermissionSearch(),["enter"])),h[8]||(h[8]=Ie(E=>o(i).delayedRolePermissionSearch(),["enter","native"])),h[9]||(h[9]=Ie(E=>o(i).delayedRolePermissionSearch(),["13"]))],placeholder:"Search",type:"text",class:"w-full","data-testid":"role-permission_search"},null,8,["modelValue"])]),x(m,{label:"Reset",onClick:h[10]||(h[10]=E=>o(i).resetRolePermissionFilters()),"data-testid":"role-permission_search_reset"})])])])]),o(i)&&o(i).role_permissions?(_(),$(g,{key:0,value:o(i).role_permissions.list.data,dataKey:"id",class:"p-datatable-sm",stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[x(y,{field:"name",header:"Name",class:"flex align-items-center"},{body:T(E=>[ce(x(m,{class:"p-button-tiny p-button-text p-0 mr-2","data-testid":"role-permission_name_copy",onClick:M=>o(t).copy(E.data.slug),icon:"pi pi-copy",label:E.data.name},null,8,["onClick","label"]),[[P,"Copy Slug",void 0,{top:!0}]])]),_:1}),x(y,{field:"has-permission",header:"Has Permission"},Mt({_:2},[o(i).hasPermission("can-update-roles")||o(i).hasPermission("can-manage-roles")?{name:"body",fn:T(E=>[E.data.pivot.is_active===1?(_(),$(m,{key:0,label:"Yes",class:"p-button-sm p-button-success p-button-rounded",onClick:M=>o(i).changeRolePermission(E.data),"data-testid":"role-permission_status_yes"},null,8,["onClick"])):(_(),$(m,{key:1,label:"No",class:"p-button-sm p-button-danger p-button-rounded","data-testid":"role-permission_status_no",onClick:M=>o(i).changeRolePermission(E.data)},null,8,["onClick"]))]),key:"0"}:{name:"body",fn:T(E=>[E.data.pivot.is_active===1?(_(),$(m,{key:0,label:"Yes",class:"p-button-sm p-button-success p-button-rounded",disabled:""})):(_(),$(m,{key:1,label:"No",class:"p-button-sm p-button-danger p-button-rounded",disabled:""}))]),key:"1"}]),1024),x(y,{field:"is-active",header:"Permission Status"},Mt({_:2},[(o(i).hasPermission("can-update-permissions")||o(i).hasPermission("can-manage-permissions"))&&(o(i).hasPermission("can-update-roles")||o(i).hasPermission("can-manage-roles"))?{name:"body",fn:T(E=>[E.data.is_active===1?(_(),$(m,{key:0,label:"Active",class:"p-button-sm p-button-rounded p-button-success",onClick:M=>p(v.event,E.data.id),"data-testid":"role-permission_status_active"},null,8,["onClick"])):(_(),$(m,{key:1,label:"Inactive","data-testid":"role-permission_status_inactive",class:"p-button-sm p-button-danger p-button-rounded",onClick:M=>p(v.event,E.data.id)},null,8,["onClick"]))]),key:"0"}:{name:"body",fn:T(E=>[E.data.is_active===1?(_(),$(m,{key:0,label:"Active",class:"p-button-sm p-button-rounded p-button-success",disabled:""})):(_(),$(m,{key:1,label:"Inactive",class:"p-button-sm p-button-danger p-button-rounded",disabled:""}))]),key:"1"}]),1024),x(y,null,{body:T(E=>[x(m,{class:"p-button-sm p-button-rounded p-button-outlined",onClick:M=>(c(),o(i).active_role_permission=E.data),icon:"pi pi-eye",label:"View","data-testid":"role-permission_view_modal"},null,8,["onClick"])]),_:1})]),_:1},8,["value"])):A("",!0),o(i)&&o(i).role_permissions?(_(),$(C,{key:1,rows:o(i).role_permissions_query.rows,"onUpdate:rows":h[11]||(h[11]=E=>o(i).role_permissions_query.rows=E),totalRecords:o(i).role_permissions.list.total,onPage:h[12]||(h[12]=E=>o(i).permissionPaginate(E)),rowsPerPageOptions:o(i).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["rows","totalRecords","rowsPerPageOptions"])):A("",!0)]),_:1})):A("",!0),x(S,{group:"templating",class:"is-small",style:{width:"400px"},breakpoints:{"600px":"100vw"}},{message:T(E=>[f("div",G7,[f("i",{class:he(E.message.icon),style:{"font-size":"1.5rem"}},null,2),f("p",Y7,Q(E.message.message),1)])]),_:1}),x(L)])}}},X7={key:0},Z7={__name:"RoleUserDetailsView",setup(n){const t=jn();return Te(async()=>{t.item||await t.getItem(route.params.id)}),(i,r)=>{const a=R("Divider");return _(),O("div",null,[o(t)&&o(t).active_role_user?(_(),O("div",X7,[f("p",null,[ue("Created By : "),f("span",null,Q(o(t).active_role_user.json.created_by),1)]),x(a,{class:"is-small"}),f("p",null,[ue("Updated By : "),f("span",null,Q(o(t).active_role_user.json.updated_by),1)]),x(a,{class:"is-small"}),f("p",null,[ue("Created At : "),f("span",null,Q(o(t).active_role_user.json.created_at),1)]),x(a,{class:"is-small"}),f("p",null,[ue("Updated At : "),f("span",null,Q(o(t).active_role_user.json.updated_at),1)])])):A("",!0)])}}},J7={class:"col-6"},eT={class:"flex flex-row"},tT={class:"font-semibold text-sm"},nT={class:"p-inputgroup"},iT={class:"grid p-fluid mt-1 mb-2"},sT={class:"col-12"},rT={class:"p-inputgroup"},oT={class:"p-input-icon-left"},aT=f("i",{class:"pi pi-search"},null,-1),lT={__name:"ViewUser",setup(n){const t=jn(),i=Ge(),r=B();Te(async()=>{if(i.params&&!i.params.id)return t.toList(),!1;i.params&&i.params.id&&await t.getItem(i.params.id),t.item&&!t.role_users&&await t.getItemUsers(),await t.getRoleUserMenuItems()});const a=Ae(),s=c=>{a.value.toggle(c)},u=Rr(),l=()=>{u.open(Z7,{props:{header:"Details",style:{width:"50vw"},breakpoints:{"960px":"75vw","640px":"90vw"},modal:!0}})};return(c,d)=>{const p=R("Button"),v=R("Menu"),h=R("InputText"),m=R("Column"),b=R("DataTable"),I=R("Paginator"),k=R("Panel"),y=R("DynamicDialog");return _(),O("div",J7,[o(t)&&o(t).item?(_(),$(k,{key:0,class:"is-small"},{header:T(()=>[f("div",eT,[f("div",tT,Q(o(t).item.name),1)])]),icons:T(()=>[f("div",nT,[x(p,{class:"p-button-sm",label:"#"+o(t).item.id,onClick:d[0]||(d[0]=g=>o(r).copy(o(t).item.id)),"data-testid":"role-user_id"},null,8,["label"]),o(t).hasPermission("can-update-roles")||o(t).hasPermission("can-manage-roles")?(_(),O(ne,{key:0},[x(p,{class:"p-button-sm",icon:"pi pi-angle-down",type:"button","aria-haspopup":"true","data-testid":"role-user_menu",onClick:s}),x(v,{ref_key:"uer_items_menu",ref:a,model:o(t).role_user_menu_items,popup:!0},null,8,["model"])],64)):A("",!0),x(p,{class:"p-button-sm",icon:"pi pi-times","data-testid":"role-user_list",onClick:d[1]||(d[1]=g=>o(t).toList())})])]),default:T(()=>[f("div",iT,[f("div",sT,[f("div",rT,[f("span",oT,[aT,x(h,{modelValue:o(t).role_users_query.q,"onUpdate:modelValue":d[2]||(d[2]=g=>o(t).role_users_query.q=g),onKeyup:[d[3]||(d[3]=Ie(g=>o(t).delayedRoleUsersSearch(),["enter"])),d[4]||(d[4]=Ie(g=>o(t).delayedRoleUsersSearch(),["enter","native"])),d[5]||(d[5]=Ie(g=>o(t).delayedRoleUsersSearch(),["13"]))],placeholder:"Search",type:"text","data-testid":"role-user_search",class:"w-full p-inputtext-sm"},null,8,["modelValue"])]),x(p,{class:"p-button-sm","data-testid":"role-user_search_reset",label:"Reset",onClick:d[6]||(d[6]=g=>o(t).resetRoleUserFilters())})])])]),o(t)&&o(t).role_users?(_(),$(b,{key:0,value:o(t).role_users.list.data,dataKey:"id",class:"p-datatable-sm",stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[x(m,{field:"name",header:"Name"},{body:T(g=>[ue(Q(g.data.name),1)]),_:1}),x(m,{field:"email",header:"Email"},{body:T(g=>[ue(Q(g.data.email),1)]),_:1}),x(m,{field:"has-role",header:"Has Role"},Mt({_:2},[o(t).hasPermission("can-update-roles")||o(t).hasPermission("can-manage-roles")?{name:"body",fn:T(g=>[g.data.pivot.is_active===1?(_(),$(p,{key:0,label:"Yes",class:"p-button-sm p-button-success p-button-rounded",onClick:C=>o(t).changeUserRole(g.data),"data-testid":"role-user_status_yes"},null,8,["onClick"])):(_(),$(p,{key:1,label:"No",class:"p-button-sm p-button-danger p-button-rounded","data-testid":"role-user_status_no",onClick:C=>o(t).changeUserRole(g.data)},null,8,["onClick"]))]),key:"0"}:{name:"body",fn:T(g=>[g.data.pivot.is_active===1?(_(),$(p,{key:0,label:"Yes",class:"p-button-sm p-button-success p-button-rounded",disabled:""})):(_(),$(p,{key:1,label:"No",class:"p-button-sm p-button-danger p-button-rounded",disabled:""}))]),key:"1"}]),1024),x(m,null,{body:T(g=>[x(p,{class:"p-button-sm p-button-rounded p-button-outlined",onClick:C=>(l(),o(t).active_role_user=g.data),icon:"pi pi-eye",label:"View","data-testid":"role-user_view_details"},null,8,["onClick"])]),_:1})]),_:1},8,["value"])):A("",!0),o(t)&&o(t).role_users?(_(),$(I,{key:1,rows:o(t).role_users_query.rows,"onUpdate:rows":d[7]||(d[7]=g=>o(t).role_users_query.rows=g),totalRecords:o(t).role_users.list.total,onPage:d[8]||(d[8]=g=>o(t).userPaginate(g)),rowsPerPageOptions:o(t).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["rows","totalRecords","rowsPerPageOptions"])):A("",!0)]),_:1})):A("",!0),x(y)])}}};let gf=[],vf=[];vf={path:"/vaah/roles/",component:yn,props:!0,children:[{path:"",name:"roles.index",component:h7,props:!0,children:[{path:"form/:id?",name:"roles.form",component:w7,props:!0},{path:"view/:id?",name:"roles.view",component:R7,props:!0},{path:"permissions/:id?",name:"roles.permissions",component:Q7,props:!0},{path:"users/:id?",name:"roles.users",component:lT,props:!0}]}]};gf.push(vf);const uT={class:"grid justify-content-center"},cT={class:"col-fixed"},dT={class:"col"},pT={__name:"AdvancedLayout",setup(n){const t=Ge(),i=Ae([{label:"ADVANCED",items:[{label:"Logs",icon:"pi pi-book",to:{path:"/vaah/advanced/logs"}},{label:"Jobs",icon:"pi pi-align-justify",to:{path:"/vaah/advanced/jobs"}},{label:"Failed Jobs",icon:"pi pi-times-circle",to:{path:"/vaah/advanced/failedjobs"}},{label:"Batches",icon:"pi pi-server",to:{path:"/vaah/advanced/batches"}}]}]),r=Ae({menuitem:({props:a})=>({class:t.matched&&t.matched[3]&&t.matched[3].path===a.item.to.path?"p-focus":""})});return Te(async()=>{}),(a,s)=>{const u=R("Menu"),l=R("router-view");return _(),O("div",uT,[f("div",cT,[x(u,{model:i.value,pt:r.value},null,8,["model","pt"])]),f("div",dT,[x(l)])])}}};let hT="WebReinvent\\VaahCms\\Models\\Job",yf=document.getElementsByTagName("base")[0].getAttribute("href"),fT=yf+"/vaah/jobs",To={query:{page:1,rows:20,filter:{q:null,is_active:null,trashed:null,sort:null,queue:null}},action:{type:null,items:[]}};const Ca=Ot({id:"jobs",state:()=>({title:"Jobs - Advanced",page:1,rows:20,base_url:yf,ajax_url:fT,model:hT,assets_is_fetching:!0,app:null,assets:null,rows_per_page:[10,20,30,50,100,500],list:null,item:null,fillable:null,empty_query:To.query,empty_action:To.action,query:B().clone(To.query),action:B().clone(To.action),search:{delay_time:600,delay_timer:0},route:null,watch_stopper:null,route_prefix:"jobs.",view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],item_menu_list:[],item_menu_state:null,form_menu_list:[],payload_modal:!1,payload_content:null,first_element:null}),actions:{async onLoad(n){this.route=n,this.first_element=(this.query.page-1)*this.query.rows,this.updateQueryFromUrl(n)},async updateQueryFromUrl(n){if(n.query&&Object.keys(n.query).length>0){for(let t in n.query)this.query[t]=n.query[t];this.countFilters(n.query)}},watchRoutes(n){this.watch_stopper=We(n,(t,i)=>{if(this.watch_stopper&&!t.name.includes(this.route_prefix))return this.watch_stopper(),!1;this.route=t,t.params.id&&this.getItem(t.params.id)},{deep:!0})},watchStates(){We(this.query.filter,(n,t)=>{this.delayedSearch()},{deep:!0})},async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,B().ajax(this.ajax_url+"/assets",this.afterGetAssets))},afterGetAssets(n,t){n&&(this.assets=n,n.rows&&(this.query.rows?this.query.rows=parseInt(this.query.rows):this.query.rows=n.rows))},async getList(){let n={query:B().clone(this.query)};await this.updateUrlQueryString(this.query),await B().ajax(this.ajax_url,await this.getListAfter,n)},async getListAfter(n,t){this.is_btn_loading=!1,n&&(this.list=n,this.first_element=(this.query.page-1)*this.query.rows)},isListActionValid(){return this.action.type?this.action.items.length<1?(B().toastErrors(["Select records"]),!1):!0:(B().toastErrors(["Select an action type"]),!1)},async updateListAfter(n,t){n&&(this.action=B().clone(this.empty_action),await this.getList())},async listAction(n=null){!n&&this.action.type?n=this.action.type:this.action.type=n;let t=this.ajax_url+"/action/"+n,i="PUT";switch(n){case"delete":t=this.ajax_url,i="DELETE";break;case"delete-all":i="DELETE";break}let r={params:this.action,method:i,show_success:!1};await B().ajax(t,this.updateListAfter,r)},itemAction(n,t=null){t||(t=this.item),this.form.action=n;let i=this.ajax_url,r={method:"post"};switch(n){case"delete":r.method="DELETE",i+="/"+t.id;break;default:r.method="PATCH",i+="/"+t.id+"/action/"+n;break}B().ajax(i,this.itemActionAfter,r)},async itemActionAfter(n,t){n&&(this.item=n,await this.getList())},async paginate(n){this.query.page=n.page+1,this.query.rows=n.rows,this.first_element=this.query.rows*(this.query.page-1),await this.getList()},async reload(){await this.getAssets(),await this.getList()},onItemSelection(n){this.action.items=n},confirmDelete(){if(this.action.items.length<1)return B().toastErrors(["Select a record"]),!1;this.action.type="delete",B().confirmDialogDelete(this.listAction)},confirmDeleteAll(){this.action.type="delete-all",B().confirmDialogDelete(this.listAction)},async delayedSearch(){let n=this;this.query.page=1,this.action.items=[],clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.updateUrlQueryString(n.query),await n.getList()},this.search.delay_time)},async updateUrlQueryString(n){n=B().clone(n);let t=ct.stringify(n,{skipNulls:!0}),i=ct.parse(t);i.filter&&(i.filter=B().cleanObject(i.filter)),await this.$router.replace({query:null}),await this.$router.replace({query:i}),this.countFilters(i)},countFilters:function(n){if(this.count_filters=0,n&&n.filter){let t=B().cleanObject(n.filter);this.count_filters=Object.keys(t).length}},async clearSearch(){this.query.filter.q=null,await this.updateUrlQueryString(this.query),await this.getList()},async resetQuery(){await this.resetQueryString(),await this.getList()},async resetQueryString(){for(let n in this.query.filter)this.query.filter[n]=null;this.query.page=this.page,this.query.rows=this.rows,await this.updateUrlQueryString(this.query)},toList(){this.$router.push({name:"jobs.index"})},isViewLarge(){return this.view==="large"},getIdWidth(){let n=50;if(this.list&&this.list.total){let t=this.list.total.toString();t=t.length,n=t*40}return n+"px"},getActionWidth(){let n=100;return this.isViewLarge()||(n=80),n+"px"},getActionLabel(){let n=null;return this.isViewLarge()&&(n="Actions"),n},async getListSelectedMenu(){this.list_selected_menu=[{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDelete()}}]},getListBulkMenu(){this.list_bulk_menu=[{label:"Delete All",icon:"pi pi-trash",command:async()=>{this.confirmDeleteAll()}}]},confirmDeleteItem(){this.form.type="delete",B().confirmDialogDelete(this.confirmDeleteItemAfter)},confirmDeleteItemAfter(){this.itemAction("delete",this.item)},viewPayloads(n){this.payload_content=''+JSON.stringify(n,null,2)+"",this.payload_modal=!0},async sync(){this.is_btn_loading=!0,await this.getList()},hasPermission(n){const t=je();return B().hasPermission(t.permissions,n)},setPageTitle(){this.title&&(document.title=this.title)},displayJobName(n){let t=n.split(/\\/g);return t[t.length-1]}}}),mT=f("b",null,"Sort By:",-1),gT={class:"field-radiobutton"},vT=f("label",{for:"sort-none"},"None",-1),yT={class:"field-radiobutton"},_T=f("label",{for:"sort-ascending"},"Created (Ascending)",-1),bT={class:"field-radiobutton"},wT=f("label",{for:"sort-descending"},"Created (Descending)",-1),CT=f("b",null,"Queue:",-1),ST={class:"field-radiobutton"},kT=f("label",{for:"default"},"Default",-1),xT={class:"field-radiobutton"},IT=f("label",{for:"high"},"High",-1),LT={class:"field-radiobutton"},PT=f("label",{for:"medium"},"Medium",-1),OT={class:"field-radiobutton"},ET=f("label",{for:"low"},"Low",-1),AT={__name:"Filters",setup(n){const t=Ca();return(i,r)=>{const a=R("RadioButton"),s=R("Divider"),u=R("Sidebar");return _(),O("div",null,[x(u,{visible:o(t).show_filters,"onUpdate:visible":r[7]||(r[7]=l=>o(t).show_filters=l),position:"right",style:{"z-index":"1101"}},{default:T(()=>[x(mt,null,{label:T(()=>[mT]),default:T(()=>[f("div",gT,[x(a,{name:"sort-none","data-testid":"jobs-filters-sort-none",value:"",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[0]||(r[0]=l=>o(t).query.filter.sort=l)},null,8,["modelValue"]),vT]),f("div",yT,[x(a,{name:"sort-ascending","data-testid":"jobs-filters-sort-ascending",value:"created_at",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[1]||(r[1]=l=>o(t).query.filter.sort=l)},null,8,["modelValue"]),_T]),f("div",bT,[x(a,{name:"sort-descending","data-testid":"jobs-filters-sort-descending",value:"created_at:desc",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[2]||(r[2]=l=>o(t).query.filter.sort=l)},null,8,["modelValue"]),wT])]),_:1}),x(s),x(mt,null,{label:T(()=>[CT]),default:T(()=>[f("div",ST,[x(a,{name:"default","data-testid":"jobs-queue_defaut",value:"default",modelValue:o(t).query.filter.queue,"onUpdate:modelValue":r[3]||(r[3]=l=>o(t).query.filter.queue=l)},null,8,["modelValue"]),kT]),f("div",xT,[x(a,{name:"high","data-testid":"jobs-queue_high",value:"high",modelValue:o(t).query.filter.queue,"onUpdate:modelValue":r[4]||(r[4]=l=>o(t).query.filter.queue=l)},null,8,["modelValue"]),IT]),f("div",LT,[x(a,{name:"medium","data-testid":"jobs-queue_medium",value:"medium",modelValue:o(t).query.filter.queue,"onUpdate:modelValue":r[5]||(r[5]=l=>o(t).query.filter.queue=l)},null,8,["modelValue"]),PT]),f("div",OT,[x(a,{name:"low","data-testid":"jobs-queue_low",value:"low",modelValue:o(t).query.filter.queue,"onUpdate:modelValue":r[6]||(r[6]=l=>o(t).query.filter.queue=l)},null,8,["modelValue"]),ET])]),_:1})]),_:1},8,["visible"])])}}},TT={key:0},RT=f("i",{class:"pi pi-angle-down"},null,-1),DT={class:"grid p-fluid"},MT={class:"col-12"},$T={class:"p-inputgroup"},VT={__name:"Actions",setup(n){const t=Ca();Te(async()=>{t.getListSelectedMenu(),t.getListBulkMenu()});const i=Ae(),r=u=>{i.value.toggle(u)},a=Ae(),s=u=>{a.value.toggle(u)};return(u,l)=>{const c=R("Badge"),d=R("Button"),p=R("Menu"),v=R("InputText");return _(),O("div",null,[f("div",{class:he([{"flex justify-content-between":o(t).isViewLarge()},"mt-2 mb-2"])},[o(t).view==="large"?(_(),O("div",TT,[x(d,{class:"p-button-sm",onClick:r,"data-testid":"jobs-actions-menu","aria-haspopup":"true","aria-controls":"overlay_menu"},{default:T(()=>[RT,o(t).action.items.length>0?(_(),$(c,{key:0,value:o(t).action.items.length},null,8,["value"])):A("",!0)]),_:1}),x(p,{ref_key:"selected_menu_state",ref:i,model:o(t).list_selected_menu,popup:!0},null,8,["model"]),x(d,{class:"p-button-sm ml-1",icon:"pi pi-ellipsis-h",onClick:s,"data-testid":"jobs-actions-bulk-menu","aria-haspopup":"true","aria-controls":"bulk_menu_state"}),x(p,{ref_key:"bulk_menu_state",ref:a,model:o(t).list_bulk_menu,popup:!0},null,8,["model"])])):A("",!0),f("div",null,[f("div",DT,[f("div",MT,[f("div",$T,[x(v,{modelValue:o(t).query.filter.q,"onUpdate:modelValue":l[0]||(l[0]=h=>o(t).query.filter.q=h),onKeyup:[l[1]||(l[1]=Ie(h=>o(t).delayedSearch(),["enter"])),l[2]||(l[2]=Ie(h=>o(t).delayedSearch(),["enter","native"])),l[3]||(l[3]=Ie(h=>o(t).delayedSearch(),["13"]))],"data-testid":"jobs-actions-search",placeholder:"Search",class:"p-inputtext-sm"},null,8,["modelValue"]),x(d,{onClick:l[4]||(l[4]=h=>o(t).delayedSearch()),"data-testid":"jobs-actions-search-button",icon:"pi pi-search",class:"p-button-sm"}),x(d,{class:"p-button-sm",label:"Filters","data-testid":"jobs-actions-show-filters",onClick:l[5]||(l[5]=h=>o(t).show_filters=!0)},{default:T(()=>[o(t).count_filters>0?(_(),$(c,{key:0,value:o(t).count_filters},null,8,["value"])):A("",!0)]),_:1}),x(d,{class:"p-button-sm",label:"Reset",icon:"pi pi-filter-slash","data-testid":"jobs-actions-reset-filters",onClick:l[6]||(l[6]=h=>o(t).resetQuery())})])]),x(AT)])])],2)])}}},BT={key:0},qT={class:"p-inputgroup"},FT=["innerHTML"],jT={__name:"Table",setup(n){const t=Ca(),i=B();return(r,a)=>{const s=R("Column"),u=R("Button"),l=R("DataTable"),c=R("Paginator"),d=R("Card"),p=R("Dialog"),v=Ke("tooltip");return _(),O(ne,null,[o(t).list?(_(),O("div",BT,[x(l,{value:o(t).list.data,dataKey:"id",class:"p-datatable-sm p-datatable-hoverable-rows",selection:o(t).action.items,"onUpdate:selection":a[0]||(a[0]=h=>o(t).action.items=h),stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[o(t).isViewLarge()?(_(),$(s,{key:0,selectionMode:"multiple",headerStyle:"width: 3em"})):A("",!0),x(s,{field:"id",header:"ID",style:St({width:o(t).getIdWidth()}),sortable:!0},null,8,["style"]),x(s,{field:"queue",header:"Queue"},{body:T(h=>[ue(Q(h.data.queue),1)]),_:1}),x(s,{field:"queue",header:"Name"},{body:T(h=>[ce((_(),O("p",null,[ue(Q(o(t).displayJobName(h.data.payload.displayName)),1)])),[[v,h.data.payload.displayName,void 0,{top:!0}]])]),_:1}),x(s,{field:"payload",header:"Payload"},{body:T(h=>[o(t).hasPermission("can-read-jobs-payload")?ce((_(),$(u,{key:0,class:"p-button-tiny p-button-text","data-testid":"jobs-view_payload",onClick:m=>o(t).viewPayloads(h.data.payload),icon:"pi pi-eye"},null,8,["onClick"])),[[v,"View",void 0,{top:!0}]]):A("",!0)]),_:1}),x(s,{field:"attempts",header:"Attempts"},{body:T(h=>[ue(Q(h.data.attempts),1)]),_:1}),o(t).isViewLarge()?(_(),$(s,{key:1,field:"reserved_at",header:"Reserved At",style:{width:"150px"}},{body:T(h=>[ue(Q(h.data.reserved_at),1)]),_:1})):A("",!0),o(t).isViewLarge()?(_(),$(s,{key:2,field:"available_at",header:"Available At",style:{width:"150px"}},{body:T(h=>[ue(Q(o(i).ago(h.data.available_at)),1)]),_:1})):A("",!0),o(t).isViewLarge()?(_(),$(s,{key:3,field:"created_at",header:"Created At",style:{width:"150px"},sortable:!0},{body:T(h=>[ue(Q(o(i).ago(h.data.created_at)),1)]),_:1})):A("",!0),x(s,{field:"actions",style:St([{width:"150px"},{width:o(t).getActionWidth()}]),header:o(t).getActionLabel()},{body:T(h=>[f("div",qT,[o(t).isViewLarge()&&!h.data.deleted_at&&o(t).hasPermission("can-delete-jobs")?ce((_(),$(u,{key:0,class:"p-button-tiny p-button-danger p-button-text",onClick:m=>o(t).itemAction("delete",h.data),"data-testid":"jobs-trash",icon:"pi pi-trash"},null,8,["onClick"])),[[v,"Delete",void 0,{top:!0}]]):A("",!0)])]),_:1},8,["style","header"])]),_:1},8,["value","selection"]),x(c,{first:o(t).first_element,"onUpdate:first":a[1]||(a[1]=h=>o(t).first_element=h),rows:o(t).query.rows,totalRecords:o(t).list.total,onPage:a[2]||(a[2]=h=>o(t).paginate(h)),rowsPerPageOptions:o(t).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["first","rows","totalRecords","rowsPerPageOptions"])])):A("",!0),x(p,{header:"Payload",visible:o(t).payload_modal,"onUpdate:visible":a[3]||(a[3]=h=>o(t).payload_modal=h),style:{width:"40%"}},{default:T(()=>[x(d,{class:"w-max"},{content:T(()=>[f("span",{innerHTML:o(t).payload_content},null,8,FT)]),_:1})]),_:1},8,["visible"])],64)}}},UT={key:0,class:"grid"},NT={class:"flex flex-row"},HT=f("b",{class:"mr-1"},"Jobs",-1),KT={class:"p-inputgroup"},zT={__name:"List",setup(n){const t=Ca(),i=Ge();return _t(),Te(async()=>{await t.onLoad(i),await t.setPageTitle(),await t.watchRoutes(i),await t.watchStates(),await t.getAssets(),await t.getList()}),(r,a)=>{const s=R("Badge"),u=R("Button"),l=R("Message"),c=R("Panel"),d=R("RouterView");return o(t).assets?(_(),O("div",UT,[f("div",{class:he("col-"+o(t).list_view_width)},[x(c,{class:"is-small"},{header:T(()=>[f("div",NT,[f("div",null,[HT,o(t).list&&o(t).list.total>0?(_(),$(s,{key:0,value:o(t).list.total},null,8,["value"])):A("",!0)])])]),icons:T(()=>[f("div",KT,[x(u,{class:"p-button-sm","data-testid":"jobs-content-refresh",icon:"pi pi-refresh",loading:o(t).is_btn_loading,onClick:o(t).sync},null,8,["loading","onClick"])])]),default:T(()=>[x(l,{closable:!1},{default:T(()=>[ue(" This list consist of only queued/pending jobs. Completed jobs gets deleted automatically . ")]),_:1}),x(VT),x(jT)]),_:1})],2),x(d)])):A("",!0)}}};let WT="WebReinvent\\VaahCms\\Models\\Log",_f=document.getElementsByTagName("base")[0].getAttribute("href"),Ro=_f+"/vaah/logs",Do={query:{page:null,rows:null,filter:{q:null,is_active:null,trashed:null,sort:null,file_type:[]}},action:{type:null,items:[]}};const Sa=Ot({id:"logs",state:()=>({title:"Logs - Advanced",page:1,rows:20,base_url:_f,ajax_url:Ro,model:WT,assets_is_fetching:!0,app:null,assets:null,rows_per_page:[10,20,30,50,100,500],list:null,item:null,fillable:null,empty_query:Do.query,empty_action:Do.action,query:B().clone(Do.query),action:B().clone(Do.action),search:{delay_time:600,delay_timer:0},route:null,watch_stopper:null,route_prefix:"logs.",view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],item_menu_list:[],item_menu_state:null,form_menu_list:[],payload_modal:!1,payload_content:null,is_btn_loading:!1,first_element:null,listTotal:null}),getters:{},actions:{async onLoad(n){this.route=n,this.updateQueryFromUrl(n)},setViewAndWidth(n){switch(n){case"logs.index":this.view="large",this.list_view_width=12;break;default:this.view="small",this.list_view_width=6;break}},async updateQueryFromUrl(n){if(n.query&&Object.keys(n.query).length>0){for(let t in n.query)this.query[t]=n.query[t];this.countFilters(n.query)}},watchRoutes(n){this.watch_stopper=We(n,(t,i)=>{if(this.watch_stopper&&!t.name.includes(this.route_prefix))return this.watch_stopper(),!1;this.route=t,t.params.name&&this.getItem(t.params.name),this.setViewAndWidth(t.name)},{deep:!0})},watchStates(){We(this.query.filter,async(n,t)=>{await this.delayedSearch()},{deep:!0})},watchItem(){this.item&&We(()=>this.item.name,(n,t)=>{n&&n!==""&&(this.item.name=B().capitalising(n),this.item.slug=B().strToSlug(n))},{deep:!0})},async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,B().ajax(this.ajax_url+"/assets",this.afterGetAssets))},afterGetAssets(n){n&&(this.assets=n,n.rows&&(this.query.page=this.page,this.query.rows?this.query.rows=parseInt(this.query.rows):this.query.rows=n.rows))},async getList(){let n={query:B().clone(this.query)};await this.updateUrlQueryString(this.query),await B().ajax(this.ajax_url,this.afterGetList,n)},afterGetList(n,t){n&&n.list&&(this.list=n.list,this.list_total=n.list.length,this.first_element=(this.query.page-1)*this.query.rows)},async getItem(n){n&&await B().ajax(Ro+"/"+n,this.getItemAfter)},async getItemAfter(n,t){n?this.item=n:(this.item=null,this.$router.push({name:"logs.index"})),await this.getItemMenu()},confirmClearFile(n){this.item=n,B().confirmDialogDelete(this.clearFile)},clearFile(){let n={params:this.item,method:"POST"};B().ajax(Ro+"/actions/clear-file",this.clearFileAfter,n)},clearFileAfter(n,t){n&&n.message==="success"&&this.getItem(this.item.name)},async deleteItem(){let n={params:this.item,method:"POST"};B().ajax(Ro+"/actions/delete",await this.deleteItemAfter,n)},async deleteItemAfter(n,t){n&&n.message==="success"&&await this.getList()},async downloadFile(n){window.location.href=this.ajax_url+"/download-file/"+n.name},isListActionValid(){return this.action.type?this.action.items.length<1?(B().toastErrors(["Select records"]),!1):!0:(B().toastErrors(["Select an action type"]),!1)},async updateListAfter(n,t){n&&(this.action=B().clone(this.empty_action),await this.getList())},async listAction(n=null){!n&&this.action.type?n=this.action.type:this.action.type=n;let t=this.ajax_url+"/action/"+n,i="PUT";switch(n){case"delete":t=this.ajax_url,i="DELETE";break;case"delete-all":i="POST",t=this.ajax_url+"/actions/bulk-delete-all";break}let r={params:this.action,method:i,show_success:!1};await B().ajax(t,this.updateListAfter,r)},itemAction(n,t=null){t||(t=this.item),this.form.action=n;let i=this.ajax_url,r={method:"post"};switch(n){case"create-and-new":case"create-and-close":case"create-and-clone":r.method="POST",r.params=t;break;case"save":case"save-and-close":case"save-and-clone":r.method="PUT",r.params=t,i+="/"+t.id;break;case"delete":r.method="DELETE",i+="/"+t.id;break;default:r.method="PATCH",i+="/"+t.id+"/action/"+n;break}B().ajax(i,this.itemActionAfter,r)},async itemActionAfter(n,t){n&&(this.item=n,await this.getList(),await this.formActionAfter(),this.getItemMenu())},async formActionAfter(){switch(this.form.action){case"create-and-new":case"save-and-new":this.setActiveItemAsEmpty();break;case"create-and-close":case"save-and-close":this.setActiveItemAsEmpty(),this.$router.push({name:"logs.index"});break;case"save-and-clone":this.item.id=null;break;case"trash":this.item=null;break;case"delete":this.item=null,this.toList();break}},async paginate(n){this.query.page=n.page+1,this.query.rows=n.rows,this.first_element=(this.query.page-1)*this.query.rows,await this.getList()},async reload(){this.is_btn_loading=!0,await this.getAssets(),await this.getList(),this.item&&await this.getItem(this.item.name),this.is_btn_loading=!1},async getFaker(){let n={model_namespace:this.model,except:this.assets.fillable.except},t=this.base_url+"/faker",i={params:n,method:"post"};B().ajax(t,this.getFakerAfter,i)},getFakerAfter:function(n,t){if(n){let i=this;Object.keys(n.fill).forEach(function(r){i.item[r]=n.fill[r]})}},onItemSelection(n){this.action.items=n},setActiveItemAsEmpty(){this.item=B().clone(this.assets.empty_item)},confirmDelete(n){this.item=n,B().confirmDialogDelete(this.deleteItem)},async confirmDeleteAll(){this.action.type="delete-all",B().confirmDialogDelete(this.listAction)},async delayedSearch(){let n=this;this.query.page=1,this.action.items=[],clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.updateUrlQueryString(n.query),await n.getList()},this.search.delay_time)},async resetSearch(){this.query.filter.q=null,await this.getList()},async updateUrlQueryString(n){n=B().clone(n);let t=ct.stringify(n,{skipNulls:!0}),i=ct.parse(t);i.filter&&(i.filter=B().cleanObject(i.filter)),await this.$router.replace({query:null}),await this.$router.replace({query:i}),this.countFilters(i)},countFilters:function(n){if(this.count_filters=0,n&&n.filter){let t=B().cleanObject(n.filter);this.count_filters=Object.keys(t).length}},async clearSearch(){this.query.filter.q=null,await this.updateUrlQueryString(this.query),await this.getList()},async resetQuery(){await this.resetQueryString(),await this.getList()},async resetQueryString(){for(let n in this.query.filter)this.query.filter[n]=null;this.query.page=this.page,this.query.rows=this.rows,await this.updateUrlQueryString(this.query)},toList(){this.item=null,this.$router.push({name:"logs.index"})},toView(n){this.getItem(n.name),this.$router.push({name:"logs.view",params:{name:n.name}})},isViewLarge(){return this.view==="large"},getIdWidth(){let n=50;if(this.list&&this.list.total){let t=this.list.total.toString();t=t.length,n=t*40}return n+"px"},getActionWidth(){let n=100;return this.isViewLarge()||(n=80),n+"px"},getActionLabel(){let n=null;return this.isViewLarge()&&(n="Actions"),n},async getListSelectedMenu(){this.list_selected_menu=[{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDelete()}}]},getListBulkMenu(){this.list_bulk_menu=[{label:"Delete All",icon:"pi pi-trash",command:async()=>{this.confirmDeleteAll()}}]},getItemMenu(){let n=[];this.item&&this.item.deleted_at&&n.push({label:"Restore",icon:"pi pi-refresh",command:()=>{this.itemAction("restore")}}),this.item&&this.item.id&&!this.item.deleted_at&&n.push({label:"Trash",icon:"pi pi-times",command:()=>{this.itemAction("trash")}}),n.push({label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDeleteItem("delete")}}),this.item_menu_list=n},confirmDeleteItem(){this.form.type="delete",B().confirmDialogDelete(this.confirmDeleteItemAfter)},confirmDeleteItemAfter(){this.itemAction("delete",this.item)},viewPayloads(n){this.payload_content=''+JSON.stringify(n,null,2)+"",this.payload_modal=!0},async getMenuItems(){this.menu_items=[{label:"Delete All",command:async()=>{this.confirmDeleteAll()}}]},async getLogsFileTypes(){return this.logs_file_types=[{name:".csv",value:".csv"},{name:".log",value:".log"},{name:".pdf",value:".pdf"},{name:".xlsx",value:".xlsx"},{name:".xml",value:".xml"}]},hasPermission(n){const t=je();return B().hasPermission(t.permissions,n)},setPageTitle(){this.title&&(document.title=this.title)}}}),GT={class:"mt-2 mb-2"},YT={class:"p-inputgroup"},QT={__name:"Actions",setup(n){const t=Sa();return Te(async()=>{t.getListSelectedMenu(),t.getListBulkMenu(),await t.getLogsFileTypes()}),Ae(),Ae(),(i,r)=>{const a=R("InputText"),s=R("Button"),u=R("MultiSelect");return _(),O("div",null,[f("div",GT,[f("div",YT,[x(a,{class:"p-inputtext-sm",inputClass:"w-full",modelValue:o(t).query.filter.q,"onUpdate:modelValue":r[0]||(r[0]=l=>o(t).query.filter.q=l),onKeyup:[r[1]||(r[1]=Ie(l=>o(t).delayedSearch(),["enter"])),r[2]||(r[2]=Ie(l=>o(t).delayedSearch(),["enter","native"])),r[3]||(r[3]=Ie(l=>o(t).delayedSearch(),["13"]))],placeholder:"Search","data-testid":"logs-action_search_input"},null,8,["modelValue"]),x(s,{label:"Reset",class:"p-button-sm","data-testid":"logs-action_search",onClick:o(t).resetSearch},null,8,["onClick"])]),x(u,{modelValue:o(t).query.filter.file_type,"onUpdate:modelValue":r[4]||(r[4]=l=>o(t).query.filter.file_type=l),options:o(t).logs_file_types,optionLabel:"name",placeholder:"Filter By Extension",display:"chip",class:"w-full my-2 p-inputtext-sm",optionValue:"value","data-testid":"logs-action_filter",onChange:r[5]||(r[5]=l=>o(t).getList())},null,8,["modelValue","options"])])])}}},XT={key:0},ZT={class:"p-inputgroup"},JT=["innerHTML"],e9={__name:"Table",setup(n){const t=Sa();B();const i=Ge();return(r,a)=>{const s=R("Column"),u=R("Button"),l=R("DataTable"),c=R("Paginator"),d=R("Card"),p=R("Dialog"),v=Ke("tooltip");return _(),O(ne,null,[o(t).list?(_(),O("div",XT,[x(l,{value:o(t).list,dataKey:"id",class:"p-datatable-sm p-datatable-hoverable-rows",selection:o(t).action.items,"onUpdate:selection":a[0]||(a[0]=h=>o(t).action.items=h),stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[x(s,{field:"id",header:"ID",style:St({width:o(t).getIdWidth()}),sortable:!0},null,8,["style"]),x(s,{field:"name",header:"Name"}),x(s,{field:"actions",style:St([{width:"150px"},{width:o(t).getActionWidth()}]),header:o(t).getActionLabel()},{body:T(h=>[f("div",ZT,[o(t).hasPermission("can-read-log")?ce((_(),$(u,{key:0,class:"p-button-tiny p-button-text",disabled:o(i).params.name===h.data.name,onClick:m=>o(t).toView(h.data),"data-testid":"logs-item_view",icon:"pi pi-eye"},null,8,["disabled","onClick"])),[[v,"View",void 0,{top:!0}]]):A("",!0),o(t).hasPermission("can-delete-log")?ce((_(),$(u,{key:1,class:"p-button-tiny p-button-danger p-button-text",onClick:m=>o(t).confirmDelete(h.data),"data-testid":"logs-item_trash",icon:"pi pi-trash"},null,8,["onClick"])),[[v,"Delete",void 0,{top:!0}]]):A("",!0)])]),_:1},8,["style","header"])]),_:1},8,["value","selection"]),x(c,{first:o(t).first_element,"onUpdate:first":a[1]||(a[1]=h=>o(t).first_element=h),rows:o(t).query.rows,totalRecords:o(t).list_total,template:"PrevPageLink PageLinks NextPageLink RowsPerPageDropdown",onPage:a[2]||(a[2]=h=>o(t).paginate(h)),rowsPerPageOptions:o(t).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["first","rows","totalRecords","rowsPerPageOptions"])])):A("",!0),x(p,{header:"Payload",visible:o(t).payload_modal,"onUpdate:visible":a[3]||(a[3]=h=>o(t).payload_modal=h),style:{width:"40%"}},{default:T(()=>[x(d,{class:"w-max"},{content:T(()=>[f("span",{innerHTML:o(t).payload_content},null,8,JT)]),_:1})]),_:1},8,["visible"])],64)}}},t9={key:0,class:"grid"},n9={class:"col-4"},i9={class:"flex flex-row"},s9=f("b",{class:"mr-1"},"Logs",-1),r9={class:"p-inputgroup"},o9={__name:"List",setup(n){const t=Sa(),i=Ge();_t(),Te(async()=>{await t.onLoad(i),await t.setPageTitle(),await t.watchRoutes(i),await t.watchStates(),await t.getAssets(),await t.getList(),await t.getMenuItems()});const r=Ae(),a=s=>{r.value.toggle(s)};return(s,u)=>{const l=R("Badge"),c=R("Button"),d=R("Menu"),p=R("Panel"),v=R("RouterView");return o(t).assets?(_(),O("div",t9,[f("div",n9,[x(p,{class:"is-small"},{header:T(()=>[f("div",i9,[f("div",null,[s9,o(t).list&&o(t).list.length>0?(_(),$(l,{key:0,class:"is-small",value:o(t).list.length},null,8,["value"])):A("",!0)])])]),icons:T(()=>[f("div",r9,[x(c,{icon:"pi pi-refresh",onClick:u[0]||(u[0]=h=>o(t).reload()),class:"p-button-sm","data-testid":"logs-list_refresh",loading:o(t).is_btn_loading},null,8,["loading"]),x(c,{icon:"pi pi-ellipsis-v",class:"p-button-sm",onClick:a,"aria-controls":"menu_items_state","data-testid":"logs-toggle_menu_items"}),x(d,{ref_key:"menu_items",ref:r,model:o(t).menu_items,popup:!0},null,8,["model"])])]),default:T(()=>[x(QT),x(e9)]),_:1})]),x(v)])):A("",!0)}}},a9={class:"col-8"},l9={class:"flex flex-row"},u9={class:"p-panel-title"},c9={key:0},d9={class:"card overflow-hidden"},p9={key:0,class:"p-datatable"},h9={class:"level is-marginless"},f9={class:"level-left"},m9={class:"level-item"},g9={class:"level-item"},v9={class:"level-item"},y9=["innerHTML"],_9={__name:"Item",setup(n){const t=Sa(),i=Ge();return Te(async()=>{if(i.params&&!i.params.name)return t.toList(),!1;(!t.item||Object.keys(t.item).length<1)&&await t.getItem(i.params.name)}),Ae(),(r,a)=>{const s=R("Button"),u=R("Tag"),l=R("TabPanel"),c=R("TabView"),d=R("Panel"),p=Ke("tooltip");return _(),O("div",a9,[o(t)&&o(t).item?(_(),$(d,{key:0,class:"is-small"},{header:T(()=>[f("div",l9,[f("div",u9,[ue(" Log "),o(t).item.name?(_(),O("span",c9," : "+Q(o(t).item.name),1)):A("",!0)])])]),icons:T(()=>[ce(x(s,{icon:"pi pi-trash",onClick:a[0]||(a[0]=v=>o(t).confirmClearFile(o(t).item)),"data-testid":"logs-item_clear_file",class:"p-button-sm p-button-rounded p-button-text"},null,512),[[p,"Clear File",void 0,{top:!0}]]),ce(x(s,{icon:"pi pi-download",onClick:a[1]||(a[1]=v=>o(t).downloadFile(o(t).item)),"data-testid":"logs-item_download_file",class:"p-button-sm p-button-rounded p-button-text"},null,512),[[p,"Download File",void 0,{top:!0}]]),ce(x(s,{icon:"pi pi-refresh",onClick:a[2]||(a[2]=v=>o(t).getItem(o(t).item.name)),"data-testid":"logs-item_refresh",class:"p-button-sm p-button-rounded p-button-text"},null,512),[[p,"Reload",void 0,{top:!0}]]),ce(x(s,{icon:"pi pi-times",onClick:a[3]||(a[3]=v=>o(t).toList()),"data-testid":"logs-item_close",class:"p-button-sm p-button-rounded p-button-text"},null,512),[[p,"Close",void 0,{top:!0}]])]),default:T(()=>[f("div",d9,[x(c,{class:"is-small tab-panel-has-no-padding"},{default:T(()=>[x(l,{header:"Logs"},{default:T(()=>[o(t).item.logs?(_(),O("table",p9,[(_(!0),O(ne,null,xe(o(t).item.logs,v=>(_(),O("tr",null,[f("td",null,[f("div",h9,[f("div",f9,[f("div",m9,[x(u,{class:"mb-2 bg-black-alpha-90 border-noround text-xs line-height-3"},{default:T(()=>[ue("TYPE")]),_:1}),x(u,{class:"mr-2 mb-2 border-noround",value:v.type},null,8,["value"])]),f("div",g9,[x(u,{class:"mb-2 bg-black-alpha-90 border-noround line-height-3"},{default:T(()=>[ue("TIME")]),_:1}),x(u,{class:"mr-2 mb-2 border-noround",severity:"danger",value:v.timestamp+"/"+v.ago},null,8,["value"])]),f("div",v9,[x(u,{class:"mb-2 bg-black-alpha-90 border-noround",value:"ENV"}),x(u,{class:"mr-2 mb-2 border-noround",value:v.env},null,8,["value"])])])]),f("small",null,Q(v.message),1)])]))),256))])):A("",!0)]),_:1}),x(l,{header:"Raw"},{default:T(()=>[o(t).item.content?(_(),O("small",{key:0,style:{"max-height":"768px",overflow:"auto"},innerHTML:o(t).item.content},null,8,y9)):A("",!0)]),_:1})]),_:1})])]),_:1})):A("",!0)])}}};let b9="WebReinvent\\VaahCms\\Models\\FailedJob",bf=document.getElementsByTagName("base")[0].getAttribute("href"),w9=bf+"/vaah/failedjobs",Mo={query:{page:1,rows:20,filter:{q:null,is_active:null,trashed:null,sort:null},from:null,to:null},action:{type:null,items:[]}};const ka=Ot({id:"failedjobs",state:()=>({title:"Failed Jobs - Advanced",page:1,rows:20,base_url:bf,ajax_url:w9,model:b9,assets_is_fetching:!0,app:null,assets:null,rows_per_page:[10,20,30,50,100,500],list:null,item:null,fillable:null,empty_query:Mo.query,empty_action:Mo.action,query:B().clone(Mo.query),action:B().clone(Mo.action),search:{delay_time:600,delay_timer:0},route:null,watch_stopper:null,route_prefix:"failedjobs.",view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],item_menu_list:[],item_menu_state:null,form_menu_list:[],failed_job_modal:!1,failed_job_content:null,failed_job_content_heading:null,dates:[],first_element:null}),actions:{async onLoad(n){this.route=n,this.first_element=(this.query.page-1)*this.query.rows,this.updateQueryFromUrl(n)},async updateQueryFromUrl(n){if(n.query&&Object.keys(n.query).length>0){for(let t in n.query)this.query[t]=n.query[t];this.countFilters(n.query)}},watchRoutes(n){this.watch_stopper=We(n,(t,i)=>{if(this.watch_stopper&&!t.name.includes(this.route_prefix))return this.watch_stopper(),!1;this.route=t,t.params.id&&this.getItem(t.params.id)},{deep:!0})},watchStates(){We(this.query.filter,(n,t)=>{this.delayedSearch()},{deep:!0})},watchItem(){this.item&&We(()=>this.item.name,(n,t)=>{n&&n!==""&&(this.item.name=B().capitalising(n),this.item.slug=B().strToSlug(n))},{deep:!0})},async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,B().ajax(this.ajax_url+"/assets",this.afterGetAssets))},afterGetAssets(n,t){n&&(this.assets=n,n.rows&&(this.query.rows?this.query.rows=parseInt(this.query.rows):this.query.rows=n.rows))},async getList(){let n={query:B().clone(this.query)};await this.updateUrlQueryString(this.query),await B().ajax(this.ajax_url,await this.getListAfter,n)},async getListAfter(n,t){this.is_btn_loading=!1,n&&(this.list=n.list,this.first_element=this.query.rows*(this.query.page-1))},isListActionValid(){return this.action.type?this.action.items.length<1?(B().toastErrors(["Select records"]),!1):!0:(B().toastErrors(["Select an action type"]),!1)},async listAction(n=null){!n&&this.action.type?n=this.action.type:this.action.type=n;let t=this.ajax_url+"/action/"+n,i="PUT";switch(n){case"delete":t=this.ajax_url,i="DELETE";break;case"delete-all":i="DELETE";break}let r={params:this.action,method:i,show_success:!1};await B().ajax(t,this.updateListAfter,r)},async updateListAfter(n){n&&(this.action=B().clone(this.empty_action),await this.getList())},itemAction(n,t=null){t||(t=this.item),this.form.action=n;let i=this.ajax_url,r={method:"post"};switch(n){case"delete":r.method="DELETE",i+="/"+t.id;break;default:r.method="PATCH",i+="/"+t.id+"/action/"+n;break}B().ajax(i,this.itemActionAfter,r)},async itemActionAfter(n){n&&(this.item=n,await this.getList())},async paginate(n){this.query.page=n.page+1,this.query.rows=n.rows,this.first_element=this.query.rows*(this.query.page-1),await this.getList()},async reload(){await this.getAssets(),await this.getList()},onItemSelection(n){this.action.items=n},confirmDelete(){if(this.action.items.length<1)return B().toastErrors(["Select a record"]),!1;this.action.type="delete",B().confirmDialogDelete(this.listAction)},confirmDeleteAll(){this.action.type="delete-all",B().confirmDialogDelete(this.listAction)},async delayedSearch(){let n=this;this.query.page=1,this.action.items=[],clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.updateUrlQueryString(n.query),await n.getList()},this.search.delay_time)},async updateUrlQueryString(n){n=B().clone(n);let t=ct.stringify(n,{skipNulls:!0}),i=ct.parse(t);i.filter&&(i.filter=B().cleanObject(i.filter)),await this.$router.replace({query:null}),await this.$router.replace({query:i}),this.countFilters(i)},countFilters:function(n){if(this.count_filters=0,n&&n.filter){let t=B().cleanObject(n.filter);this.count_filters=Object.keys(t).length}},async clearSearch(){this.query.filter.q=null,await this.updateUrlQueryString(this.query),await this.getList()},async resetQuery(){await this.resetQueryString(),await this.getList()},async resetQueryString(){for(let n in this.query.filter)this.query.filter[n]=null;for(let n in this.query)n!=="filter"&&(this.query[n]=null);this.query.page=this.page,this.query.rows=this.rows,await this.updateUrlQueryString(this.query)},toList(){this.$router.push({name:"failedjobs.index"})},isViewLarge(){return this.view==="large"},getIdWidth(){let n=50;if(this.list&&this.list.total){let t=this.list.total.toString();t=t.length,n=t*40}return n+"px"},getActionWidth(){let n=100;return this.isViewLarge()||(n=80),n+"px"},getActionLabel(){let n=null;return this.isViewLarge()&&(n="Actions"),n},async getListSelectedMenu(){this.list_selected_menu=[{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDelete()}}]},getListBulkMenu(){this.list_bulk_menu=[{label:"Delete All",icon:"pi pi-trash",command:async()=>{this.confirmDeleteAll()}}]},confirmDeleteItem(){this.form.type="delete",B().confirmDialogDelete(this.confirmDeleteItemAfter)},confirmDeleteItemAfter(){this.itemAction("delete",this.item)},viewFailedJobsContent(n,t){this.failed_job_content_heading=t,this.failed_job_content=''+JSON.stringify(n,null,2)+"",this.failed_job_modal=!0},setDateRange(){if(this.dates2.length>0){let n=new Date(this.dates2[0]);this.query.from=n.getFullYear()+"-"+(n.getMonth()+1)+"-"+n.getDate(),n=new Date(this.dates2[1]),this.query.to=n.getFullYear()+"-"+(n.getMonth()+1)+"-"+n.getDate(),this.getList()}},async sync(){this.is_btn_loading=!0,await this.getList()},hasPermission(n){const t=je();return B().hasPermission(t.permissions,n)},setPageTitle(){this.title&&(document.title=this.title)}}}),C9=f("b",null,"Sort By:",-1),S9={class:"field-radiobutton"},k9=f("label",{for:"sort-none"},"None",-1),x9={class:"field-radiobutton"},I9=f("label",{for:"sort-ascending"},"Updated (Ascending)",-1),L9={class:"field-radiobutton"},P9=f("label",{for:"sort-descending"},"Updated (Descending)",-1),O9=f("label",{for:"range"},"Range",-1),E9={__name:"Filters",setup(n){const t=ka();return(i,r)=>{const a=R("RadioButton"),s=R("Divider"),u=R("Calendar"),l=R("Sidebar");return _(),O("div",null,[x(l,{visible:o(t).show_filters,"onUpdate:visible":r[4]||(r[4]=c=>o(t).show_filters=c),position:"right",style:{"z-index":"1102"}},{default:T(()=>[x(mt,null,{label:T(()=>[C9]),default:T(()=>[f("div",S9,[x(a,{name:"sort-none","data-testid":"failedjobs-filters-sort-none",value:"",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[0]||(r[0]=c=>o(t).query.filter.sort=c)},null,8,["modelValue"]),k9]),f("div",x9,[x(a,{name:"sort-ascending","data-testid":"failedjobs-filters-sort-ascending",value:"failed_at",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[1]||(r[1]=c=>o(t).query.filter.sort=c)},null,8,["modelValue"]),I9]),f("div",L9,[x(a,{name:"sort-descending","data-testid":"failedjobs-filters-sort-descending",value:"failed_at:desc",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[2]||(r[2]=c=>o(t).query.filter.sort=c)},null,8,["modelValue"]),P9])]),_:1}),x(s),x(mt,null,{default:T(()=>[O9,x(u,{inputId:"range","data-testid":"failedjobs-filters-range",modelValue:o(t).dates2,"onUpdate:modelValue":r[3]||(r[3]=c=>o(t).dates2=c),onDateSelect:o(t).setDateRange,selectionMode:"range",dateFormat:"yy-mm-dd",manualInput:!1},null,8,["modelValue","onDateSelect"])]),_:1})]),_:1},8,["visible"])])}}},A9={key:0},T9=f("i",{class:"pi pi-angle-down"},null,-1),R9={class:"grid p-fluid"},D9={class:"col-12"},M9={class:"p-inputgroup"},$9={__name:"Actions",setup(n){const t=ka();Te(async()=>{t.getListSelectedMenu(),t.getListBulkMenu()});const i=Ae(),r=u=>{i.value.toggle(u)},a=Ae(),s=u=>{a.value.toggle(u)};return(u,l)=>{const c=R("Badge"),d=R("Button"),p=R("Menu"),v=R("InputText");return _(),O("div",null,[f("div",{class:he([{"flex justify-content-between":o(t).isViewLarge()},"mt-2 mb-2"])},[o(t).view==="large"?(_(),O("div",A9,[x(d,{class:"p-button-sm",onClick:r,"data-testid":"failedjobs-actions-menu","aria-haspopup":"true","aria-controls":"overlay_menu"},{default:T(()=>[T9,o(t).action.items.length>0?(_(),$(c,{key:0,value:o(t).action.items.length},null,8,["value"])):A("",!0)]),_:1}),x(p,{ref_key:"selected_menu_state",ref:i,model:o(t).list_selected_menu,popup:!0},null,8,["model"]),x(d,{class:"p-button-sm ml-1",icon:"pi pi-ellipsis-h",onClick:s,"data-testid":"failedjobs-actions-bulk-menu","aria-haspopup":"true","aria-controls":"bulk_menu_state"}),x(p,{ref_key:"bulk_menu_state",ref:a,model:o(t).list_bulk_menu,popup:!0},null,8,["model"])])):A("",!0),f("div",null,[f("div",R9,[f("div",D9,[f("div",M9,[x(v,{modelValue:o(t).query.filter.q,"onUpdate:modelValue":l[0]||(l[0]=h=>o(t).query.filter.q=h),onKeyup:[l[1]||(l[1]=Ie(h=>o(t).delayedSearch(),["enter"])),l[2]||(l[2]=Ie(h=>o(t).delayedSearch(),["enter","native"])),l[3]||(l[3]=Ie(h=>o(t).delayedSearch(),["13"]))],"data-testid":"failedjobs-actions-search",placeholder:"Search",class:"p-inputtext-sm"},null,8,["modelValue"]),x(d,{onClick:l[4]||(l[4]=h=>o(t).delayedSearch()),"data-testid":"failedjobs-actions-search-button",icon:"pi pi-search",class:"p-button-sm"}),x(d,{label:"Filters",class:"p-button-sm","data-testid":"failedjobs-actions-show-filters",onClick:l[5]||(l[5]=h=>o(t).show_filters=!0)},{default:T(()=>[o(t).count_filters>0?(_(),$(c,{key:0,value:o(t).count_filters},null,8,["value"])):A("",!0)]),_:1}),x(d,{class:"p-button-sm",icon:"pi pi-filter-slash","data-testid":"failedjobs-actions-reset-filters",label:"Reset",onClick:l[6]||(l[6]=h=>o(t).resetQuery())})])]),x(E9)])])],2)])}}},V9={key:0},B9={class:"p-inputgroup"},q9=["innerHTML"],F9={__name:"Table",setup(n){const t=ka();return B(),(i,r)=>{const a=R("Column"),s=R("Button"),u=R("DataTable"),l=R("Paginator"),c=R("Card"),d=R("Dialog"),p=Ke("tooltip");return _(),O(ne,null,[o(t).list?(_(),O("div",V9,[x(u,{value:o(t).list.data,dataKey:"id",class:"p-datatable-sm p-datatable-hoverable-rows",selection:o(t).action.items,"onUpdate:selection":r[0]||(r[0]=v=>o(t).action.items=v),stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[o(t).isViewLarge()?(_(),$(a,{key:0,selectionMode:"multiple",headerStyle:"width: 3em"})):A("",!0),x(a,{field:"id",header:"ID",style:St({width:o(t).getIdWidth()}),sortable:!0},null,8,["style"]),x(a,{field:"queue",header:"Queue"},{body:T(v=>[ue(Q(v.data.queue),1)]),_:1}),x(a,{field:"connection",header:"Connection"},{body:T(v=>[ue(Q(v.data.connection),1)]),_:1}),x(a,{field:"payload",header:"Payload"},{body:T(v=>[o(t).hasPermission("can-read-payload-failed-jobs")?ce((_(),$(s,{key:0,class:"p-button-tiny p-button-text","data-testid":"failedjobs-view_payload",onClick:h=>o(t).viewFailedJobsContent(v.data.payload,"Payload"),icon:"pi pi-eye"},null,8,["onClick"])),[[p,"View",void 0,{top:!0}]]):A("",!0)]),_:1}),x(a,{field:"exception",header:"Exception"},{body:T(v=>[o(t).hasPermission("can-read-failed-jobs-exception")?ce((_(),$(s,{key:0,class:"p-button-tiny p-button-text","data-testid":"failedjobs-view_exception",onClick:h=>o(t).viewFailedJobsContent(v.data.exception,"Exception"),icon:"pi pi-eye"},null,8,["onClick"])),[[p,"View",void 0,{top:!0}]]):A("",!0)]),_:1}),o(t).isViewLarge()?(_(),$(a,{key:1,field:"failed_at",header:"Failed At",sortable:!0,style:{width:"150px"}},{body:T(v=>[ue(Q(v.data.failed_at),1)]),_:1})):A("",!0),x(a,{field:"actions",style:St([{width:"150px"},{width:o(t).getActionWidth()}]),header:o(t).getActionLabel()},{body:T(v=>[f("div",B9,[o(t).isViewLarge()&&!v.data.deleted_at&&o(t).hasPermission("can-delete-failed-jobs")?ce((_(),$(s,{key:0,class:"p-button-tiny p-button-danger p-button-text",onClick:h=>o(t).itemAction("delete",v.data),icon:"pi pi-trash","data-testid":"failedjobs-trash"},null,8,["onClick"])),[[p,"Delete",void 0,{top:!0}]]):A("",!0)])]),_:1},8,["style","header"])]),_:1},8,["value","selection"]),x(l,{first:o(t).first_element,"onUpdate:first":r[1]||(r[1]=v=>o(t).first_element=v),rows:o(t).query.rows,totalRecords:o(t).list.total,onPage:r[2]||(r[2]=v=>o(t).paginate(v)),rowsPerPageOptions:o(t).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["first","rows","totalRecords","rowsPerPageOptions"])])):A("",!0),x(d,{header:o(t).failed_job_content_heading,visible:o(t).failed_job_modal,"onUpdate:visible":r[3]||(r[3]=v=>o(t).failed_job_modal=v),style:{width:"40%"}},{default:T(()=>[x(c,{class:"w-max"},{content:T(()=>[f("span",{innerHTML:o(t).failed_job_content},null,8,q9)]),_:1})]),_:1},8,["header","visible"])],64)}}},j9={key:0,class:"grid"},U9={class:"flex flex-row"},N9=f("b",{class:"mr-1"},"Failed Jobs",-1),H9={class:"p-inputgroup"},K9={__name:"List",setup(n){const t=ka(),i=Ge();return _t(),Te(async()=>{await t.onLoad(i),await t.setPageTitle(),await t.watchRoutes(i),await t.watchStates(),await t.getAssets(),await t.getList()}),(r,a)=>{const s=R("Badge"),u=R("Button"),l=R("Panel"),c=R("RouterView");return o(t).assets?(_(),O("div",j9,[f("div",{class:he("col-"+o(t).list_view_width)},[x(l,{class:"is-small"},{header:T(()=>[f("div",U9,[f("div",null,[N9,o(t).list&&o(t).list.total>0?(_(),$(s,{key:0,value:o(t).list.total},null,8,["value"])):A("",!0)])])]),icons:T(()=>[f("div",H9,[x(u,{class:"p-button-sm","data-testid":"failedjobs-content-refresh",icon:"pi pi-refresh",loading:o(t).is_btn_loading,onClick:o(t).sync},null,8,["loading","onClick"])])]),default:T(()=>[x($9),x(F9)]),_:1})],2),x(c)])):A("",!0)}}};let z9="WebReinvent\\VaahCms\\Models\\Batch",wf=document.getElementsByTagName("base")[0].getAttribute("href"),W9=wf+"/vaah/batches",$o={query:{page:1,rows:20,filter:{q:null,is_active:null,trashed:null,sort:null,from:null,to:null,date_filter_by:null}},action:{type:null,items:[]}};const xa=Ot({id:"batches",state:()=>({title:"Batches - Advanced",page:1,rows:20,dialog_content:null,display_detail:!1,display_failed_ids:!1,base_url:wf,ajax_url:W9,model:z9,assets_is_fetching:!0,app:null,assets:null,rows_per_page:[10,20,30,50,100,500],list:null,item:null,fillable:null,empty_query:$o.query,empty_action:$o.action,query:B().clone($o.query),action:B().clone($o.action),search:{delay_time:600,delay_timer:0},route:null,watch_stopper:null,route_prefix:"batches.",view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],dates:[],first_element:null}),actions:{async onLoad(n){this.route=n,this.first_element=(this.query.page-1)*this.query.rows,this.updateQueryFromUrl(n)},async updateQueryFromUrl(n){if(n.query&&Object.keys(n.query).length>0){for(let t in n.query)this.query[t]=n.query[t];this.countFilters(n.query)}},watchRoutes(n){this.watch_stopper=We(n,(t,i)=>{if(this.watch_stopper&&!t.name.includes(this.route_prefix))return this.watch_stopper(),!1;this.route=t,t.params.id&&this.getItem(t.params.id)},{deep:!0})},watchStates(){We(this.query.filter,(n,t)=>{this.delayedSearch()},{deep:!0})},watchItem(){this.item&&We(()=>this.item.name,(n,t)=>{n&&n!==""&&(this.item.name=B().capitalising(n),this.item.slug=B().strToSlug(n))},{deep:!0})},async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,B().ajax(this.ajax_url+"/assets",this.afterGetAssets))},afterGetAssets(n,t){n&&(this.assets=n,n.rows&&(this.query.rows?this.query.rows=parseInt(this.query.rows):this.query.rows=n.rows))},async getList(){let n={query:B().clone(this.query)};await this.updateUrlQueryString(this.query),await B().ajax(this.ajax_url,await this.getListAfter,n)},async getListAfter(n){this.is_btn_loading=!1,n&&(this.list=n.list,this.first_element=(this.query.page-1)*this.query.rows)},isListActionValid(){return this.action.type?this.action.items.length<1?(B().toastErrors(["Select records"]),!1):!0:(B().toastErrors(["Select an action type"]),!1)},async updateListAfter(n,t){n&&(this.action=B().clone(this.empty_action),await this.getList())},async listAction(n=null){!n&&this.action.type?n=this.action.type:this.action.type=n;let t=this.ajax_url+"/action/"+n,i="PUT";switch(n){case"delete":t=this.ajax_url,i="DELETE";break;case"delete-all":i="DELETE";break}let r={params:this.action,method:i,data:{},show_success:!1};await B().ajax(t,this.updateListAfter,r)},async itemActionAfter(n,t){n&&(this.item=n,await this.getList())},async paginate(n){this.query.page=n.page+1,this.query.rows=n.rows,this.first_element=(this.query.page-1)*this.query.rows,await this.getList()},async reload(){await this.getAssets(),await this.getList()},async getFaker(){let n={model_namespace:this.model,except:this.assets.fillable.except},t=this.base_url+"/faker",i={params:n,method:"post"};B().ajax(t,this.getFakerAfter,i)},getFakerAfter:function(n,t){if(n){let i=this;Object.keys(n.fill).forEach(function(r){i.item[r]=n.fill[r]})}},onItemSelection(n){this.action.items=n},setActiveItemAsEmpty(){this.item=B().clone(this.assets.empty_item)},confirmDelete(){if(this.action.items.length<1)return B().toastErrors(["Select a record"]),!1;this.action.type="delete",B().confirmDialogDelete(this.listAction)},confirmDeleteAll(){this.action.type="delete-all",B().confirmDialogDelete(this.listAction)},async delayedSearch(){let n=this;this.query.page=1,this.action.items=[],clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.updateUrlQueryString(n.query),await n.getList()},this.search.delay_time)},async updateUrlQueryString(n){n=B().clone(n);let t=ct.stringify(n,{skipNulls:!0}),i=ct.parse(t);i.filter&&(i.filter=B().cleanObject(i.filter)),await this.$router.replace({query:null}),await this.$router.replace({query:i}),this.countFilters(i)},countFilters:function(n){if(this.count_filters=0,n&&n.filter){let t=B().cleanObject(n.filter);this.count_filters=Object.keys(t).length}},async clearSearch(){this.query.filter.q=null,await this.updateUrlQueryString(this.query),await this.getList()},async resetQuery(){await this.resetQueryString(),await this.getList()},async resetQueryString(){for(let n in this.query.filter)this.query.filter[n]=null;for(let n in this.query)n!=="filter"&&(this.query[n]=null);this.dates2=null,this.query.page=this.page,this.query.rows=this.rows,await this.updateUrlQueryString(this.query)},toList(){this.$router.push({name:"batches.index"})},isViewLarge(){return this.view==="large"},getIdWidth(){let n=50;if(this.list&&this.list.total){let t=this.list.total.toString();t=t.length,n=t*40}return n+"px"},getActionWidth(){let n=100;return this.isViewLarge()||(n=80),n+"px"},async getListSelectedMenu(){this.list_selected_menu=[{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDelete()}}]},getListBulkMenu(){this.list_bulk_menu=[{label:"Delete All",icon:"pi pi-trash",command:async()=>{this.confirmDeleteAll()}}]},confirmDeleteItem(){this.form.type="delete",B().confirmDialogDelete(this.confirmDeleteItemAfter)},confirmDeleteItemAfter(){this.itemAction("delete",this.item)},getJobProgress(n,t,i=null,r=!1){let a=n,s=0,u=0;return t===1?u=a.total_jobs-a.pending_jobs-a.failed_jobs:t===2?u=a.failed_jobs:t===3&&(u=a.pending_jobs),r?u:(s=u*100/a.total_jobs,i?s.toFixed(2):s)},displayBatchDetails(n){this.dialog_content=''+n+"",this.display_detail=!0},displayFailedIdDetails(n){this.dialog_content=''+JSON.stringify(n)+"",this.display_failed_ids=!0},deleteItem(n){this.item=n,this.form.action="delete",B().confirmDialogDelete(this.itemAction)},setDateRange(){if(this.dates2.length>0){let n=new Date(this.dates2[0]);this.query.filter.from=n.getFullYear()+"-"+(n.getMonth()+1)+"-"+n.getDate(),n=new Date(this.dates2[1]),this.query.filter.to=n.getFullYear()+"-"+(n.getMonth()+1)+"-"+n.getDate(),this.getList()}},itemAction(n,t=null){t||(t=this.item),n||(n=this.form.action),this.form.action=n;let i=this.ajax_url,r={method:"post"};switch(n){case"create-and-new":case"create-and-close":case"create-and-clone":r.method="POST",r.params=t;break;case"save":case"save-and-close":case"save-and-clone":r.method="PUT",r.params=t,i+="/"+t.id;break;case"delete":r.method="DELETE",r.params={data:{}},i+="/"+t.id;break;default:r.method="PATCH",i+="/"+t.id+"/action/"+n;break}B().ajax(i,this.itemActionAfter,r)},async sync(){this.is_btn_loading=!0,await this.getList()},hasPermission(n){const t=je();return B().hasPermission(t.permissions,n)},setPageTitle(){this.title&&(document.title=this.title)}}}),G9=f("b",null,"Column:",-1),Y9={class:"field-radiobutton"},Q9=f("label",{for:"sort-descending"},"Created",-1),X9={class:"field-radiobutton"},Z9=f("label",{for:"sort-descending"},"Cancelled",-1),J9={class:"field-radiobutton"},eR=f("label",{for:"sort-descending"},"Finished",-1),tR=f("b",null,"Date Between:",-1),nR={__name:"Filters",setup(n){const t=xa();return(i,r)=>{const a=R("RadioButton"),s=R("Calendar"),u=R("Sidebar");return _(),O("div",null,[x(u,{visible:o(t).show_filters,"onUpdate:visible":r[4]||(r[4]=l=>o(t).show_filters=l),position:"right",style:{"z-index":"1102"}},{default:T(()=>[x(mt,null,{label:T(()=>[G9]),default:T(()=>[f("div",Y9,[x(a,{name:"sort-descending","data-testid":"batches-filters-created_at",value:"created_at",modelValue:o(t).query.filter.date_filter_by,"onUpdate:modelValue":r[0]||(r[0]=l=>o(t).query.filter.date_filter_by=l)},null,8,["modelValue"]),Q9]),f("div",X9,[x(a,{name:"sort-descending","data-testid":"batches-filters-cancelled_at",value:"cancelled_at",modelValue:o(t).query.filter.date_filter_by,"onUpdate:modelValue":r[1]||(r[1]=l=>o(t).query.filter.date_filter_by=l)},null,8,["modelValue"]),Z9]),f("div",J9,[x(a,{name:"sort-descending","data-testid":"batches-filters-finished_at",value:"finished_at",modelValue:o(t).query.filter.date_filter_by,"onUpdate:modelValue":r[2]||(r[2]=l=>o(t).query.filter.date_filter_by=l)},null,8,["modelValue"]),eR])]),_:1}),x(mt,null,{label:T(()=>[tR]),default:T(()=>[x(s,{inputId:"range","data-testid":"batch",modelValue:o(t).dates2,"onUpdate:modelValue":r[3]||(r[3]=l=>o(t).dates2=l),onDateSelect:o(t).setDateRange,selectionMode:"range",manualInput:!1},null,8,["modelValue","onDateSelect"])]),_:1})]),_:1},8,["visible"])])}}},iR={key:0},sR=f("i",{class:"pi pi-angle-down"},null,-1),rR={class:"grid p-fluid"},oR={class:"col-12"},aR={class:"p-inputgroup"},lR={__name:"Actions",setup(n){const t=xa();Te(async()=>{t.getListSelectedMenu(),t.getListBulkMenu()});const i=Ae(),r=u=>{i.value.toggle(u)},a=Ae(),s=u=>{a.value.toggle(u)};return(u,l)=>{const c=R("Badge"),d=R("Button"),p=R("Menu"),v=R("InputText");return _(),O("div",null,[f("div",{class:he([{"flex justify-content-between":o(t).isViewLarge()},"mt-2 mb-2"])},[o(t).view==="large"?(_(),O("div",iR,[x(d,{class:"p-button-sm",onClick:r,"data-testid":"batches-actions-menu","aria-haspopup":"true","aria-controls":"overlay_menu"},{default:T(()=>[sR,o(t).action.items.length>0?(_(),$(c,{key:0,value:o(t).action.items.length},null,8,["value"])):A("",!0)]),_:1}),x(p,{ref_key:"selected_menu_state",ref:i,model:o(t).list_selected_menu,popup:!0},null,8,["model"]),x(d,{class:"p-button-sm ml-1",icon:"pi pi-ellipsis-h",onClick:s,"data-testid":"batches-actions-bulk-menu","aria-haspopup":"true","aria-controls":"bulk_menu_state"}),x(p,{ref_key:"bulk_menu_state",ref:a,model:o(t).list_bulk_menu,popup:!0},null,8,["model"])])):A("",!0),f("div",null,[f("div",rR,[f("div",oR,[f("div",aR,[x(v,{modelValue:o(t).query.filter.q,"onUpdate:modelValue":l[0]||(l[0]=h=>o(t).query.filter.q=h),onKeyup:[l[1]||(l[1]=Ie(h=>o(t).delayedSearch(),["enter"])),l[2]||(l[2]=Ie(h=>o(t).delayedSearch(),["enter","native"])),l[3]||(l[3]=Ie(h=>o(t).delayedSearch(),["13"]))],"data-testid":"batches-actions-search",placeholder:"Search",class:"p-inputtext-sm"},null,8,["modelValue"]),x(d,{onClick:l[4]||(l[4]=h=>o(t).delayedSearch()),"data-testid":"batches-actions-search-button",icon:"pi pi-search",class:"p-button-sm"}),x(d,{class:"p-button-sm",label:"Filters","data-testid":"batches-actions-show-filters",onClick:l[5]||(l[5]=h=>o(t).show_filters=!0)},{default:T(()=>[o(t).count_filters>0?(_(),$(c,{key:0,value:o(t).count_filters},null,8,["value"])):A("",!0)]),_:1}),x(d,{class:"p-button-sm",icon:"pi pi-filter-slash","data-testid":"batches-actions-reset-filters",label:"Reset",onClick:l[6]||(l[6]=h=>o(t).resetQuery())})])]),x(nR)])])],2)])}}},uR={key:0},cR={role:"progressbar",class:"p-progressbar p-component p-progressbar-determinate batch-progress-bar"},dR={class:"p-progressbar-label","data-pc-section":"label"},pR={class:"p-progressbar-label","data-pc-section":"label"},hR={class:"p-progressbar-label","data-pc-section":"label"},fR=f("span",{class:"pi pi-eye mr-1"},null,-1),mR=f("span",null,"View",-1),gR=f("span",{class:"pi pi-eye mr-1"},null,-1),vR={key:0},yR={key:1},_R=f("span",{class:"pi pi-trash"},null,-1),bR=["innerHTML"],wR=["innerHTML"],CR={__name:"Table",setup(n){const t=xa(),i=B();return(r,a)=>{const s=R("Column"),u=R("Button"),l=R("DataTable"),c=R("Card"),d=R("Dialog"),p=R("Paginator"),v=Ke("tooltip");return o(t).list?(_(),O("div",uR,[x(l,{value:o(t).list.data,dataKey:"id",class:"p-datatable-sm p-datatable-hoverable-rows",selection:o(t).action.items,"onUpdate:selection":a[0]||(a[0]=h=>o(t).action.items=h),"data-testid":"batches-table-checkbox",stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[o(t).isViewLarge()?(_(),$(s,{key:0,selectionMode:"multiple",headerStyle:"width: 3em"})):A("",!0),x(s,{field:"id",header:"ID",style:St({width:o(t).getIdWidth()}),sortable:!0},null,8,["style"]),x(s,{field:"name",header:"",style:{width:"30%"}},{body:T(h=>[f("span",null,[f("div",cR,[o(t).getJobProgress(h.data,1,null,!0)?ce((_(),O("div",{key:0,class:"p-progressbar-value p-progressbar-value-animate progress-bar-success",style:St("width: "+o(t).getJobProgress(h.data,1)+"%;")},[f("div",dR,Q(o(t).getJobProgress(h.data,1,2))+"% ",1)],4)),[[v,{value:"Passed ("+o(t).getJobProgress(h.data,1,null,!0)+")"},void 0,{top:!0}]]):A("",!0),o(t).getJobProgress(h.data,2,null,!0)?ce((_(),O("div",{key:1,class:"p-progressbar-value p-progressbar-value-animate progress-bar-danger",style:St("width: "+o(t).getJobProgress(h.data,2)+"%; left: "+o(t).getJobProgress(h.data,1)+"%;")},[f("div",pR,Q(o(t).getJobProgress(h.data,2,2))+"% ",1)],4)),[[v,{value:"Failed ("+o(t).getJobProgress(h.data,2,null,!0)+")"},void 0,{top:!0}]]):A("",!0),o(t).getJobProgress(h.data,3,null,!0)?ce((_(),O("div",{key:2,class:"p-progressbar-value p-progressbar-value-animate progress-bar-warning",style:St("width: "+o(t).getJobProgress(h.data,3)+"%; left: "+(o(t).getJobProgress(h.data,1)+o(t).getJobProgress(h.data,2))+"%;")},[f("div",hR,Q(o(t).getJobProgress(h.data,3,2))+"% ",1)],4)),[[v,{value:"Pending ("+o(t).getJobProgress(h.data,3,null,!0)+")"},void 0,{top:!0}]]):A("",!0)])])]),_:1}),x(s,{field:"actions",style:St([{width:"150px"},{width:o(t).getActionWidth()}]),header:"Detail"},{body:T(h=>[o(t).hasPermission("can-read-batch-details")?(_(),$(u,{key:0,class:"p-button-rounded p-button-sm p-button-outlined","data-testid":"batches-table-options",onClick:m=>o(t).displayBatchDetails(h.data.options)},{default:T(()=>[fR,mR]),_:2},1032,["onClick"])):A("",!0)]),_:1},8,["style"]),o(t).isViewLarge()?(_(),$(s,{key:1,field:"failed_job_ids",header:"Failed Job Ids",style:{width:"150px"}},{body:T(h=>[o(t).hasPermission("can-read-batch-failed-ids")?(_(),$(u,{key:0,class:"p-button-sm p-button-outlined p-button-rounded","data-testid":"batches-table-failed-ids",onClick:m=>o(t).displayFailedIdDetails(h.data.failed_job_ids)},{default:T(()=>[gR,h.data.failed_job_ids&&(typeof h.data.failed_job_ids=="array"||typeof h.data.failed_job_ids=="object")?(_(),O("span",vR,Q(h.data.failed_job_ids.length),1)):(_(),O("span",yR," 0 "))]),_:2},1032,["onClick"])):A("",!0)]),_:1})):A("",!0),o(t).isViewLarge()?(_(),$(s,{key:2,field:"cancelled_at",header:"Cancelled At",sortable:!0,style:{width:"150px"}},{body:T(h=>[ue(Q(o(i).ago(h.data.cancelled_at)),1)]),_:1})):A("",!0),o(t).isViewLarge()?(_(),$(s,{key:3,field:"created_at",header:"Created At",style:{width:"150px"},sortable:!0},{body:T(h=>[ue(Q(o(i).ago(h.data.created_at)),1)]),_:1})):A("",!0),o(t).isViewLarge()?(_(),$(s,{key:4,field:"finished_at",header:"Finished At",style:{width:"150px"},sortable:!0},{body:T(h=>[ue(Q(o(i).ago(h.data.finished_at)),1)]),_:1})):A("",!0),o(t).isViewLarge()?(_(),$(s,{key:5,style:{width:"150px"}},{body:T(h=>[o(t).hasPermission("can-delete-batch")?(_(),$(u,{key:0,class:"p-button-rounded p-button-text",onClick:m=>o(t).deleteItem(h.data),"data-testid":"batches-table-to-trash"},{default:T(()=>[_R]),_:2},1032,["onClick"])):A("",!0)]),_:1})):A("",!0)]),_:1},8,["value","selection"]),x(d,{header:"Options",visible:o(t).display_detail,"onUpdate:visible":a[1]||(a[1]=h=>o(t).display_detail=h),"data-testid":"batch-table-detail_dialog",breakpoints:{"960px":"75vw","640px":"90vw"},style:{width:"50vw"}},{default:T(()=>[x(c,{class:"w-max"},{content:T(()=>[f("span",{innerHTML:o(t).dialog_content},null,8,bR)]),_:1})]),_:1},8,["visible"]),x(d,{header:"Failed Ids",visible:o(t).display_failed_ids,"onUpdate:visible":a[2]||(a[2]=h=>o(t).display_failed_ids=h),"data-testid":"batch-table-failed_ids_dialog",breakpoints:{"960px":"75vw","640px":"90vw"},style:{width:"50vw"}},{default:T(()=>[x(c,{class:"w-max"},{content:T(()=>[f("span",{innerHTML:o(t).dialog_content},null,8,wR)]),_:1})]),_:1},8,["visible"]),x(p,{first:o(t).first_element,"onUpdate:first":a[3]||(a[3]=h=>o(t).first_element=h),rows:o(t).query.rows,"data-testid":"batch-table-paginator",totalRecords:o(t).list.total,onPage:a[4]||(a[4]=h=>o(t).paginate(h)),rowsPerPageOptions:o(t).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["first","rows","totalRecords","rowsPerPageOptions"])])):A("",!0)}}},SR={key:0,class:"grid"},kR={class:"flex flex-row align-items-center w-full"},xR={class:"w-full"},IR=f("b",{class:"mr-1"},"Batches",-1),LR={__name:"List",setup(n){const t=xa(),i=Ge();return _t(),Te(async()=>{await t.onLoad(i),await t.setPageTitle(),await t.watchRoutes(i),await t.watchStates(),await t.getAssets(),await t.getList()}),(r,a)=>{const s=R("Badge"),u=R("Button"),l=R("Panel"),c=R("RouterView");return o(t).assets?(_(),O("div",SR,[f("div",{class:he("col-"+o(t).list_view_width)},[x(l,{class:"is-small"},{header:T(()=>[f("div",kR,[f("div",xR,[IR,o(t).list&&o(t).list.total>0?(_(),$(s,{key:0,value:o(t).list.total},null,8,["value"])):A("",!0)]),f("div",null,[x(u,{class:"p-button-sm",icon:"pi pi-refresh",onClick:o(t).sync,"data-testid":"batches-list-refresh",loading:o(t).is_btn_loading},null,8,["onClick","loading"])])])]),default:T(()=>[x(lR),x(CR)]),_:1})],2),x(c)])):A("",!0)}}};let Cf=[],Sf=[];Sf={path:"/vaah/advanced/",component:yn,props:!0,children:[{path:"",component:pT,props:!0,children:[{path:"logs",name:"logs.index",component:o9,props:!0,children:[{path:"view/:name?",name:"logs.view",component:_9,props:!0}]},{path:"jobs",name:"jobs.index",component:zT,props:!0},{path:"failedjobs",name:"failedjobs.index",component:K9,props:!0},{path:"batches",name:"batches.index",component:LR,props:!0}]}]};Cf.push(Sf);let PR="WebReinvent\\VaahCms\\Models\\Permission",kf=document.getElementsByTagName("base")[0].getAttribute("href"),md=kf+"/vaah/permissions",Cs={query:{page:1,rows:20,filter:{q:null,is_active:null,trashed:null,sort:null},recount:null},action:{type:null,items:[]},permission_roles_query:{q:null,page:1,rows:20}};const mi=Ot({id:"permissions",state:()=>({title:"Permissions",page:1,rows:20,base_url:kf,ajax_url:md,model:PR,assets_is_fetching:!0,app:null,assets:null,rows_per_page:[10,20,30,50,100,500],list:null,item:null,fillable:null,empty_query:Cs.query,empty_action:Cs.action,query:B().clone(Cs.query),action:B().clone(Cs.action),search:{delay_time:600,delay_timer:0},route:null,watch_stopper:null,route_prefix:"permissions.",view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],item_menu_list:[],item_menu_state:null,form_menu_list:[],total_roles:null,total_users:null,permission_roles:null,roles_menu_items:null,active_permission_role:null,permission_roles_query:B().clone(Cs.permission_roles_query),is_btn_loading:!1,firstElement:null,rolesFirstElement:null}),getters:{},actions:{async onLoad(n){this.route=n,this.setViewAndWidth(n.name),this.firstElement=(this.query.page-1)*this.query.rows,this.rolesFirstElement=(this.permission_roles_query.page-1)*this.permission_roles_query.rows,this.updateQueryFromUrl(n)},setViewAndWidth(n){switch(n){case"permissions.index":this.view="large",this.list_view_width=12;break;default:this.view="small",this.list_view_width=7;break}},async updateQueryFromUrl(n){if(n.query&&Object.keys(n.query).length>0){for(let t in n.query)this.query[t]=n.query[t];this.countFilters(n.query)}},watchRoutes(n){this.watch_stopper=We(n,(t,i)=>{if(this.watch_stopper&&!t.name.includes(this.route_prefix))return this.watch_stopper(),!1;this.route=t,t.params.id&&this.getItem(t.params.id),this.setViewAndWidth(t.name)},{deep:!0})},watchStates(){We(this.query.filter,(n,t)=>{this.delayedSearch()},{deep:!0}),We(this.permission_roles_query,(n,t)=>{this.delayedItemUsersSearch()},{deep:!0})},async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,B().ajax(this.ajax_url+"/assets",this.afterGetAssets))},afterGetAssets(n,t){n&&(this.assets=n,n.rows&&(this.urlContains("role")&&(this.permission_roles_query.rows=this.permission_roles_query.rows?parseInt(this.permission_roles_query.rows):n.rows),this.query.rows?this.query.rows=parseInt(this.query.rows):this.query.rows=n.rows),this.route.params&&!this.route.params.id&&(this.item=B().clone(n.empty_item)))},async getList(){let n={query:B().clone(this.query)};await this.updateUrlQueryString(this.query),await B().ajax(this.ajax_url,this.afterGetList,n)},afterGetList:function(n,t){this.is_btn_loading=!1,this.query.recount=null,n&&(this.list=n,this.total_roles=t.data.total_roles,this.total_users=t.data.total_users,this.firstElement=this.query.rows*(this.query.page-1))},async getItem(n){n&&await B().ajax(md+"/"+n,this.getItemAfter)},async getItemAfter(n,t){n?this.item=n:this.$router.push({name:"permissions.index"}),this.getItemMenu(),await this.getFormMenu()},async getItemRoles(){this.showProgress();let n={query:this.permission_roles_query};B().ajax(this.ajax_url+"/item/"+this.item.id+"/roles",this.afterGetItemRoles,n)},afterGetItemRoles(n,t){this.hideProgress(),n&&(this.permission_roles=n)},async changePermission(n){let t={id:this.item.id,role_id:n.id};var i={};n.pivot.is_active?i.is_active=0:i.is_active=1,await this.actions(!1,"toggle-role-active-status",t,i)},async bulkActions(n,t){let i={id:this.item.id,role_id:null},r={is_active:n};await this.actions(!1,t,i,r)},async actions(n,t,i,r){this.showProgress(),n&&n.preventDefault();let a={params:{inputs:i,data:r},method:"post"};B().ajax(this.ajax_url+"/actions/"+t,this.afterActions,a)},async afterActions(n,t){this.hideProgress(),await this.getItemRoles(),await this.getList()},async delayedItemUsersSearch(){let n=this;this.item&&this.item.id&&(clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.getItemRoles()},this.search.delay_time))},isListActionValid(){return this.action.type?this.action.items.length<1?(B().toastErrors(["Select records"]),!1):!0:(B().toastErrors(["Select an action type"]),!1)},async updateList(n=null){if(!n&&this.action.type?n=this.action.type:this.action.type=n,!this.isListActionValid())return!1;let t="PUT";switch(n){case"delete":t="DELETE";break}let i={params:this.action,method:t,show_success:!1};await B().ajax(this.ajax_url,this.updateListAfter,i)},async updateListAfter(n,t){n&&(this.action=B().clone(this.empty_action),await this.getList())},async listAction(n=null){!n&&this.action.type?n=this.action.type:this.action.type=n;let t=this.ajax_url+"/actions/"+n,i="PUT";switch(n){case"delete":t=this.ajax_url,i="DELETE";break;case"delete-all":i="DELETE";break}let r={params:this.action,method:i,show_success:!1};await B().ajax(t,this.updateListAfter,r)},itemAction(n,t=null){t||(t=this.item),this.form.action=n;let i=this.ajax_url,r={method:"post"};switch(n){case"save":case"save-and-close":case"save-and-clone":r.method="PUT",r.params=t,i+="/"+t.id;break;case"delete":r.method="DELETE",i+="/"+t.id;break;default:r.method="PATCH",i+="/"+t.id+"/action/"+n;break}B().ajax(i,this.itemActionAfter,r)},async itemActionAfter(n,t){n&&(this.item=n,await this.getList(),await this.formActionAfter(),this.getItemMenu(),this.route.params&&this.route.params.id&&await this.getItem(this.route.params.id))},async formActionAfter(){switch(this.form.action){case"create-and-new":case"save-and-new":this.setActiveItemAsEmpty();break;case"create-and-close":case"save-and-close":this.setActiveItemAsEmpty(),this.$router.push({name:"permissions.index"});break;case"save-and-clone":this.item.id=null;break;case"trash":this.item=null;break;case"delete":this.item=null,this.toList();break}},async toggleIsActive(n){n.is_active?await this.itemAction("activate",n):await this.itemAction("deactivate",n)},async paginate(n){this.query.page=n.page+1,this.query.rows=n.rows,this.firstElement=this.query.rows*(this.query.page-1),await this.getList()},async rolePaginate(n){this.permission_roles_query.page=n.page+1,this.permission_roles_query.rows=n.rows,await this.getItemRoles()},async reload(){await this.getAssets(),await this.getList()},async getFaker(){let n={model_namespace:this.model,except:this.assets.fillable.except},t=this.base_url+"/faker",i={params:n,method:"post"};B().ajax(t,this.getFakerAfter,i)},getFakerAfter:function(n,t){if(n){let i=this;Object.keys(n.fill).forEach(function(r){i.item[r]=n.fill[r]})}},async sync(){this.is_btn_loading=!0,this.query.recount=!0,await this.getList()},onItemSelection(n){this.action.items=n},setActiveItemAsEmpty(){this.item=B().clone(this.assets.empty_item)},confirmDelete(){if(this.action.items.length<1)return B().toastErrors(["Select a record"]),!1;this.action.type="delete",B().confirmDialogDelete(this.listAction)},confirmDeleteAll(){this.action.type="delete-all",B().confirmDialogDelete(this.listAction)},async delayedSearch(){let n=this;this.query.page=1,this.action.items=[],clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.updateUrlQueryString(n.query),await n.getList()},this.search.delay_time)},async updateUrlQueryString(n){n=B().clone(n);let t=ct.stringify(n,{skipNulls:!0}),i=ct.parse(t);i.filter&&(i.filter=B().cleanObject(i.filter)),await this.$router.replace({query:null}),await this.$router.replace({query:i}),this.countFilters(i)},countFilters:function(n){if(this.count_filters=0,n&&n.filter){let t=B().cleanObject(n.filter);this.count_filters=Object.keys(t).length}},async clearSearch(){this.query.filter.q=null,await this.updateUrlQueryString(this.query),await this.getList()},async resetQuery(){await this.resetQueryString(),await this.getList()},async resetQueryString(){for(let n in this.query.filter)this.query.filter[n]=null;this.query.page=this.page,this.query.rows=this.rows,await this.updateUrlQueryString(this.query)},resetPermissionRolesQuery(){this.permission_roles_query.q=null,this.permission_roles_query.rows=this.assets.rows},closeForm(){this.$router.push({name:"permissions.index"})},toList(){this.item=null,this.$router.push({name:"permissions.index"})},toForm(){this.item=B().clone(this.assets.empty_item),this.getFormMenu(),this.$router.push({name:"permissions.form"})},toView(n){this.item=B().clone(n),this.$router.push({name:"permissions.view",params:{id:n.id}})},toEdit(n){this.item=n,this.$router.push({name:"permissions.form",params:{id:n.id}})},toRole(n){this.item=n,this.getItemRoles(),this.$router.push({name:"permissions.view-role",params:{id:n.id}})},isViewLarge(){return this.view==="large"},getIdWidth(){let n=50;if(this.list&&this.list.total){let t=this.list.total.toString();t=t.length,n=t*40}return n+"px"},getActionWidth(){let n=100;return this.isViewLarge()||(n=80),n+"px"},getActionLabel(){let n=null;return this.isViewLarge()&&(n="Actions"),n},async getListSelectedMenu(){this.list_selected_menu=[{label:"Activate",command:async()=>{await this.updateList("activate")}},{label:"Deactivate",command:async()=>{await this.updateList("deactivate")}},{separator:!0},{label:"Trash",icon:"pi pi-times",command:async()=>{await this.updateList("trash")}},{label:"Restore",icon:"pi pi-replay",command:async()=>{await this.updateList("restore")}},{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDelete()}}]},getListBulkMenu(){this.list_bulk_menu=[{label:"Mark all as active",command:async()=>{await this.listAction("activate-all")}},{label:"Mark all as inactive",command:async()=>{await this.listAction("deactivate-all")}},{separator:!0},{label:"Trash All",icon:"pi pi-times",command:async()=>{await this.listAction("trash-all")}},{label:"Restore All",icon:"pi pi-replay",command:async()=>{await this.listAction("restore-all")}},{label:"Delete All",icon:"pi pi-trash",command:async()=>{this.confirmDeleteAll()}}]},getItemMenu(){let n=[];this.item&&this.item.deleted_at&&n.push({label:"Restore",icon:"pi pi-refresh",command:()=>{this.itemAction("restore")}}),this.item&&this.item.id&&!this.item.deleted_at&&n.push({label:"Trash",icon:"pi pi-times",command:()=>{this.itemAction("trash")}}),n.push({label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDeleteItem("delete")}}),this.item_menu_list=n},confirmDeleteItem(){this.form.type="delete",B().confirmDialogDelete(this.confirmDeleteItemAfter)},confirmDeleteItemAfter(){this.itemAction("delete",this.item)},async getFormMenu(){let n=[];this.item&&this.item.id?n=[{label:"Save & Close",icon:"pi pi-check",command:()=>{this.itemAction("save-and-close")}},{label:"Save & Clone",icon:"pi pi-copy",command:()=>{this.itemAction("save-and-clone")}},{label:"Trash",icon:"pi pi-times",command:()=>{this.itemAction("trash")}},{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDeleteItem("delete")}}]:n=[{label:"Create & Close",icon:"pi pi-check",command:()=>{this.itemAction("create-and-close")}},{label:"Create & Clone",icon:"pi pi-copy",command:()=>{this.itemAction("create-and-clone")}},{label:"Reset",icon:"pi pi-refresh",command:()=>{this.setActiveItemAsEmpty()}}],n.push({label:"Fill",icon:"pi pi-pencil",command:()=>{this.getFaker()}}),this.form_menu_list=n},async getRoleMenu(){return this.roles_menu_items=[{label:"Active All Roles",command:async()=>{await this.bulkActions(1,"toggle-role-active-status")}},{label:"Inactive All Roles",command:async()=>{await this.bulkActions(0,"toggle-role-active-status")}}]},hasPermission(n){const t=je();return B().hasPermission(t.permissions,n)},showProgress(){this.show_progress_bar=!0},hideProgress(){this.show_progress_bar=!1},urlContains(n){return this.route.path.includes(n)},setPageTitle(){this.title&&(document.title=this.title)}}}),OR=f("b",null,"Sort By:",-1),ER={class:"field-radiobutton"},AR=f("label",{for:"sort-none"},"None",-1),TR={class:"field-radiobutton"},RR=f("label",{for:"sort-ascending"},"Updated (Ascending)",-1),DR={class:"field-radiobutton"},MR=f("label",{for:"sort-descending"},"Updated (Descending)",-1),$R=f("b",null,"Is Active:",-1),VR={class:"field-radiobutton"},BR=f("label",{for:"active-all"},"All",-1),qR={class:"field-radiobutton"},FR=f("label",{for:"active-true"},"Only Active",-1),jR={class:"field-radiobutton"},UR=f("label",{for:"active-false"},"Only Inactive",-1),NR=f("b",null,"Trashed:",-1),HR={class:"field-radiobutton"},KR=f("label",{for:"trashed-exclude"},"Exclude Trashed",-1),zR={class:"field-radiobutton"},WR=f("label",{for:"trashed-include"},"Include Trashed",-1),GR={class:"field-radiobutton"},YR=f("label",{for:"trashed-only"},"Only Trashed",-1),QR={__name:"Filters",setup(n){const t=mi();return(i,r)=>{const a=R("RadioButton"),s=R("Divider"),u=R("Sidebar");return _(),O("div",null,[x(u,{visible:o(t).show_filters,"onUpdate:visible":r[9]||(r[9]=l=>o(t).show_filters=l),style:{"z-index":"1001"},position:"right"},{default:T(()=>[x(mt,null,{label:T(()=>[OR]),default:T(()=>[f("div",ER,[x(a,{name:"sort-none",value:"",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[0]||(r[0]=l=>o(t).query.filter.sort=l)},null,8,["modelValue"]),AR]),f("div",TR,[x(a,{name:"sort-ascending",value:"updated_at",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[1]||(r[1]=l=>o(t).query.filter.sort=l)},null,8,["modelValue"]),RR]),f("div",DR,[x(a,{name:"sort-descending",value:"updated_at:desc",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[2]||(r[2]=l=>o(t).query.filter.sort=l)},null,8,["modelValue"]),MR])]),_:1}),x(s),x(mt,null,{label:T(()=>[$R]),default:T(()=>[f("div",VR,[x(a,{name:"active-all",value:"null","data-testid":"permission-filter_active_all",modelValue:o(t).query.filter.is_active,"onUpdate:modelValue":r[3]||(r[3]=l=>o(t).query.filter.is_active=l)},null,8,["modelValue"]),BR]),f("div",qR,[x(a,{name:"active-true",value:"true","data-testid":"permission-filter_active_only",modelValue:o(t).query.filter.is_active,"onUpdate:modelValue":r[4]||(r[4]=l=>o(t).query.filter.is_active=l)},null,8,["modelValue"]),FR]),f("div",jR,[x(a,{name:"active-false",value:"false","data-testid":"permission-filter_inactive_only",modelValue:o(t).query.filter.is_active,"onUpdate:modelValue":r[5]||(r[5]=l=>o(t).query.filter.is_active=l)},null,8,["modelValue"]),UR])]),_:1}),x(mt,null,{label:T(()=>[NR]),default:T(()=>[f("div",HR,[x(a,{name:"trashed-exclude",value:"","data-testid":"permission-filter_trashed_exclude",modelValue:o(t).query.filter.trashed,"onUpdate:modelValue":r[6]||(r[6]=l=>o(t).query.filter.trashed=l)},null,8,["modelValue"]),KR]),f("div",zR,[x(a,{name:"trashed-include",value:"include","data-testid":"permission-filter_trashed_include",modelValue:o(t).query.filter.trashed,"onUpdate:modelValue":r[7]||(r[7]=l=>o(t).query.filter.trashed=l)},null,8,["modelValue"]),WR]),f("div",GR,[x(a,{name:"trashed-only",value:"only","data-testid":"permission-filter_trashed_only",modelValue:o(t).query.filter.trashed,"onUpdate:modelValue":r[8]||(r[8]=l=>o(t).query.filter.trashed=l)},null,8,["modelValue"]),YR])]),_:1})]),_:1},8,["visible"])])}}},XR={key:0},ZR=f("i",{class:"pi pi-angle-down"},null,-1),JR={class:"grid p-fluid"},eD={class:"col-12"},tD={class:"p-inputgroup"},nD={__name:"Actions",setup(n){const t=mi();Te(async()=>{t.getListSelectedMenu(),t.getListBulkMenu()});const i=Ae(),r=u=>{i.value.toggle(u)},a=Ae(),s=u=>{a.value.toggle(u)};return(u,l)=>{const c=R("Badge"),d=R("Button"),p=R("Menu"),v=R("InputText");return _(),O("div",null,[f("div",{class:he([{"flex justify-content-between":o(t).isViewLarge()},"mt-2 mb-2"])},[o(t).view==="large"?(_(),O("div",XR,[o(t).hasPermission("can-manage-permissions")||o(t).hasPermission("can-update-permissions")?(_(),$(d,{key:0,class:"p-button-sm",type:"button","aria-haspopup":"true","aria-controls":"overlay_menu",onClick:r},{default:T(()=>[ZR,o(t).action.items.length>0?(_(),$(c,{key:0,value:o(t).action.items.length},null,8,["value"])):A("",!0)]),_:1})):A("",!0),x(p,{ref_key:"selected_menu_state",ref:i,model:o(t).list_selected_menu,popup:!0},null,8,["model"]),o(t).hasPermission("can-manage-permissions")||o(t).hasPermission("can-update-permissions")?(_(),$(d,{key:1,class:"p-button-sm ml-1",icon:"pi pi-ellipsis-h",type:"button",onClick:s,"aria-haspopup":"true","aria-controls":"bulk_menu_state"})):A("",!0),x(p,{ref_key:"bulk_menu_state",ref:a,model:o(t).list_bulk_menu,popup:!0},null,8,["model"])])):A("",!0),f("div",null,[f("div",JR,[f("div",eD,[f("div",tD,[x(v,{class:"p-inputtext-sm",modelValue:o(t).query.filter.q,"onUpdate:modelValue":l[0]||(l[0]=h=>o(t).query.filter.q=h),onKeyup:[l[1]||(l[1]=Ie(h=>o(t).delayedSearch(),["enter"])),l[2]||(l[2]=Ie(h=>o(t).delayedSearch(),["enter","native"])),l[3]||(l[3]=Ie(h=>o(t).delayedSearch(),["13"]))],placeholder:"Search","data-testid":"permission-action_search_input"},null,8,["modelValue"]),x(d,{onClick:l[4]||(l[4]=h=>o(t).delayedSearch()),icon:"pi pi-search",class:"p-button-sm","data-testid":"permission-action_search"}),x(d,{class:"p-button-sm",type:"button",onClick:l[5]||(l[5]=h=>o(t).show_filters=!0),"data-testid":"permission-action_filter"},{default:T(()=>[ue(" Filters "),o(t).count_filters>0?(_(),$(c,{key:0,value:o(t).count_filters},null,8,["value"])):A("",!0)]),_:1}),x(d,{class:"p-button-sm",type:"button",icon:"pi pi-filter-slash",label:"Reset","data-testid":"permission-action_filter_reset",onClick:l[6]||(l[6]=h=>o(t).resetQuery())})])]),x(QR)])])],2)])}}},iD={key:0},sD={class:"p-inputgroup has-shadowless"},rD={__name:"Table",setup(n){const t=mi(),i=B();return(r,a)=>{const s=R("Column"),u=R("Badge"),l=R("Button"),c=R("InputSwitch"),d=R("DataTable"),p=R("Paginator"),v=Ke("tooltip");return o(t).list?(_(),O("div",iD,[x(d,{value:o(t).list.data,dataKey:"id",class:"p-datatable-sm p-datatable-hoverable-rows",selection:o(t).action.items,"onUpdate:selection":a[0]||(a[0]=h=>o(t).action.items=h),stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[o(t).isViewLarge()?(_(),$(s,{key:0,selectionMode:"multiple",headerStyle:"width: 3em"})):A("",!0),x(s,{field:"id",header:"ID",class:"text-sm",style:St({width:o(t).getIdWidth()}),sortable:!0},null,8,["style"]),x(s,{field:"name",header:"Name",sortable:!0},{body:T(h=>[h.data.deleted_at?(_(),$(u,{key:0,value:"Trashed",severity:"danger"})):A("",!0),ue(" "+Q(h.data.name),1)]),_:1}),o(t).isViewLarge()?(_(),$(s,{key:1,field:"slug",header:"Slug",sortable:!0},{body:T(h=>[ce(x(l,{class:"p-button-tiny p-button-text p-0","data-testid":"permission-list_slug_copy",onClick:m=>o(i).copy(h.data.slug),icon:"pi pi-copy",label:h.data.slug},null,8,["onClick","label"]),[[v,"Copy Slug",void 0,{top:!0}]])]),_:1})):A("",!0),x(s,{field:"total_roles",header:"Roles"},{body:T(h=>[o(t).hasPermission("can-read-permissions")?ce((_(),$(l,{key:0,class:"p-button p-button-rounded p-button-sm white-space-nowrap",onClick:m=>o(t).toRole(h.data),"data-testid":"permission-role_view"},{default:T(()=>[ue(Q(h.data.count_roles)+" / "+Q(o(t).total_roles),1)]),_:2},1032,["onClick"])),[[v,"View Role",void 0,{top:!0}]]):A("",!0)]),_:1}),x(s,{field:"total_users",header:"Users"},{body:T(h=>[ce((_(),$(l,{class:"p-button p-button-rounded p-button-sm white-space-nowrap",disabled:""},{default:T(()=>[ue(Q(h.data.count_users)+" / "+Q(o(t).total_users),1)]),_:2},1024)),[[v,"User",void 0,{top:!0}]])]),_:1}),o(t).isViewLarge()?(_(),$(s,{key:2,field:"updated_at",header:"Updated",style:{width:"150px"},sortable:!0},{body:T(h=>[ue(Q(o(i).ago(h.data.updated_at)),1)]),_:1})):A("",!0),o(t).isViewLarge()?(_(),$(s,{key:3,field:"is_active",sortable:!1,style:{width:"100px"},header:"Is Active"},{body:T(h=>[x(c,{modelValue:h.data.is_active,"onUpdate:modelValue":m=>h.data.is_active=m,modelModifiers:{bool:!0},"false-value":0,"true-value":1,class:"p-inputswitch-sm",onInput:m=>o(t).toggleIsActive(h.data),"data-testid":"permission-list_status"},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1})):A("",!0),x(s,{field:"actions",style:St([{width:"150px"},{width:o(t).getActionWidth()}]),header:o(t).getActionLabel()},{body:T(h=>[f("div",sD,[o(t).hasPermission("can-read-permissions")?ce((_(),$(l,{key:0,class:"p-button-tiny p-button-text",onClick:m=>o(t).toView(h.data),icon:"pi pi-eye","data-testid":"permission-list_view"},null,8,["onClick"])),[[v,"View",void 0,{top:!0}]]):A("",!0),o(t).hasPermission("can-update-permissions")?ce((_(),$(l,{key:1,class:"p-button-tiny p-button-text",onClick:m=>o(t).toEdit(h.data),icon:"pi pi-pencil","data-testid":"permission-list_edit"},null,8,["onClick"])),[[v,"Update",void 0,{top:!0}]]):A("",!0),o(t).isViewLarge()&&!h.data.deleted_at||o(t).hasPermission("can-update-permissions")?ce((_(),$(l,{key:2,class:"p-button-tiny p-button-danger p-button-text",onClick:m=>o(t).itemAction("trash",h.data),icon:"pi pi-trash","data-testid":"permission-list_trash"},null,8,["onClick"])),[[v,"Trash",void 0,{top:!0}]]):A("",!0),o(t).isViewLarge()&&h.data.deleted_at?ce((_(),$(l,{key:3,class:"p-button-tiny p-button-success p-button-text",onClick:m=>o(t).itemAction("restore",h.data),icon:"pi pi-replay","data-testid":"permission-list_restore"},null,8,["onClick"])),[[v,"Restore",void 0,{top:!0}]]):A("",!0)])]),_:1},8,["style","header"])]),_:1},8,["value","selection"]),x(p,{first:o(t).firstElement,"onUpdate:first":a[1]||(a[1]=h=>o(t).firstElement=h),rows:o(t).query.rows,totalRecords:o(t).list.total,onPage:a[2]||(a[2]=h=>o(t).paginate(h)),rowsPerPageOptions:o(t).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["first","rows","totalRecords","rowsPerPageOptions"])])):A("",!0)}}},oD={class:"grid"},aD={class:"flex flex-row"},lD=f("b",{class:"mr-1"},"Permission",-1),uD={class:"p-inputgroup"},cD={__name:"List",setup(n){const t=mi(),i=Ge();return _t(),Te(async()=>{await t.onLoad(i),await t.setPageTitle(),await t.watchRoutes(i),await t.watchStates(),await t.getAssets(),await t.getList()}),(r,a)=>{const s=R("Badge"),u=R("Button"),l=R("Panel"),c=R("RouterView");return _(),O("div",oD,[f("div",{class:he("col-"+o(t).list_view_width)},[x(l,{class:"is-small"},{header:T(()=>[f("div",aD,[f("div",null,[lD,o(t).list&&o(t).list.total>0?(_(),$(s,{key:0,value:o(t).list.total},null,8,["value"])):A("",!0)])])]),icons:T(()=>[f("div",uD,[x(u,{class:"p-button-sm",icon:"pi pi-refresh",loading:o(t).is_btn_loading,onClick:a[0]||(a[0]=d=>o(t).sync()),"data-testid":"permission-list_refresh"},null,8,["loading"])])]),default:T(()=>[x(nD),x(rD)]),_:1})],2),x(c)])}}},dD={class:"col-5"},pD={class:"flex flex-row"},hD={class:"font-semibold text-sm"},fD={key:0},mD={key:0,class:"p-inputgroup"},gD={key:0,class:"pt-2"},vD={__name:"Form",setup(n){const t=mi(),i=Ge(),r=B(),a=je();Te(async()=>{i.params&&i.params.id&&await t.getItem(i.params.id),t.getFormMenu(),await a.getIsActiveStatusOptions()});const s=Ae(),u=l=>{s.value.toggle(l)};return(l,c)=>{const d=R("Button"),p=R("Menu"),v=R("InputText"),h=R("Textarea"),m=R("SelectButton"),b=R("Panel"),I=Ke("tooltip");return _(),O("div",dD,[x(b,{class:"is-small"},{header:T(()=>[f("div",pD,[f("div",hD,[o(t).item&&o(t).item.id?(_(),O("span",fD,Q(o(t).item.name),1)):A("",!0)])])]),icons:T(()=>[o(t).item&&o(t).item.id?(_(),O("div",mD,[x(d,{class:"p-button-sm",label:"#"+o(t).item.id,onClick:c[0]||(c[0]=k=>o(r).copy(o(t).item.id)),"data-testid":"permission-form_id"},null,8,["label"]),x(d,{class:"p-button-sm",label:"Save",icon:"pi pi-save","data-testid":"permission-form_save",onClick:c[1]||(c[1]=k=>o(t).itemAction("save"))}),o(t).hasPermission("can-update-permissions")||o(t).hasPermission("can-manage-permissions")?(_(),$(d,{key:0,class:"p-button-sm",icon:"pi pi-angle-down","aria-haspopup":"true",type:"button","data-testid":"permission-form_menu",onClick:u})):A("",!0),x(p,{ref_key:"form_menu",ref:s,model:o(t).form_menu_list,popup:!0},null,8,["model"]),o(t).hasPermission("can-read-permissions")?ce((_(),$(d,{key:1,class:"p-button-sm",icon:"pi pi-eye","data-testid":"permission-item_view",onClick:c[2]||(c[2]=k=>o(t).toView(o(t).item))},null,512)),[[I,"View",void 0,{top:!0}]]):A("",!0),x(d,{class:"p-button-sm",icon:"pi pi-times","data-testid":"permission-list_view",onClick:c[3]||(c[3]=k=>o(t).toList())})])):A("",!0)]),default:T(()=>[o(t).item?(_(),O("div",gD,[x($e,{label:"Name"},{default:T(()=>[x(v,{class:"w-full",modelValue:o(t).item.name,"onUpdate:modelValue":c[4]||(c[4]=k=>o(t).item.name=k),"data-testid":"permission-item_name"},null,8,["modelValue"])]),_:1}),x($e,{label:"Slug"},{default:T(()=>[x(v,{class:"w-full",modelValue:o(t).item.slug,"onUpdate:modelValue":c[5]||(c[5]=k=>o(t).item.slug=k),"data-testid":"permission-item_slug"},null,8,["modelValue"])]),_:1}),x($e,{label:"Details"},{default:T(()=>[x(h,{class:"w-full",modelValue:o(t).item.details,"onUpdate:modelValue":c[6]||(c[6]=k=>o(t).item.details=k),"data-testid":"permission-item_details"},null,8,["modelValue"])]),_:1}),x($e,{label:"Is Active"},{default:T(()=>[o(a)&&o(a).is_active_status_options?(_(),$(m,{key:0,modelValue:o(t).item.is_active,"onUpdate:modelValue":c[7]||(c[7]=k=>o(t).item.is_active=k),options:o(a).is_active_status_options,"option-label":"label","option-value":"value","data-testid":"permission-item_status",class:"has-shadowless"},null,8,["modelValue","options"])):A("",!0)]),_:1})])):A("",!0)]),_:1})])}}},yD={class:"col-5"},_D={class:"flex flex-row"},bD={class:"font-semibold text-sm"},wD={class:"p-inputgroup"},CD={key:0},SD={class:"flex align-items-center justify-content-between"},kD={class:""},xD={class:"ml-3"},ID={class:"p-datatable p-component p-datatable-responsive-scroll p-datatable-striped p-datatable-sm"},LD={class:"p-datatable-table"},PD={class:"p-datatable-tbody"},OD={__name:"Item",setup(n){const t=mi(),i=Ge(),r=B();Te(async()=>{if(i.params&&!i.params.id)return t.toList(),!1;t.item||await t.getItem(i.params.id)});const a=Ae(),s=u=>{a.value.toggle(u)};return(u,l)=>{const c=R("Button"),d=R("Menu"),p=R("Message"),v=R("Panel");return _(),O("div",yD,[o(t)&&o(t).item?(_(),$(v,{key:0,class:"is-small"},{header:T(()=>[f("div",_D,[f("div",bD,Q(o(t).item.name),1)])]),icons:T(()=>[f("div",wD,[x(c,{class:"p-button-sm",label:"#"+o(t).item.id,onClick:l[0]||(l[0]=h=>o(r).copy(o(t).item.id)),"data-testid":"permission-item_id"},null,8,["label"]),o(t).hasPermission("can-update-permissions")?(_(),$(c,{key:0,class:"p-button-sm",label:"Edit",icon:"pi pi-pencil","data-testid":"permission-item_edit",onClick:l[1]||(l[1]=h=>o(t).toEdit(o(t).item))})):A("",!0),o(t).hasPermission("can-update-permissions")||o(t).hasPermission("can-manage-permissions")?(_(),$(c,{key:1,class:"p-button-sm",icon:"pi pi-angle-down",type:"button","aria-haspopup":"true","data-testid":"permission-item_menu",onClick:s})):A("",!0),x(d,{ref_key:"item_menu_state",ref:a,model:o(t).item_menu_list,popup:!0},null,8,["model"]),x(c,{class:"p-button-sm",icon:"pi pi-times","data-testid":"permission-item_list",onClick:l[2]||(l[2]=h=>o(t).toList())})])]),default:T(()=>[o(t).item?(_(),O("div",CD,[o(t).item.deleted_at?(_(),$(p,{key:0,severity:"error",class:"p-container-message",closable:!1,icon:"pi pi-trash"},{default:T(()=>[f("div",SD,[f("div",kD," Deleted "+Q(o(t).item.deleted_at),1),f("div",xD,[x(c,{label:"Restore",class:"p-button-sm",onClick:l[3]||(l[3]=h=>o(t).itemAction("restore"))})])])]),_:1})):A("",!0),f("div",ID,[f("table",LD,[f("tbody",PD,[(_(!0),O(ne,null,xe(o(t).item,(h,m)=>(_(),O(ne,null,[m==="created_by"||m==="updated_by"?(_(),O(ne,{key:0},[],64)):m==="id"||m==="uuid"||m==="slug"?(_(),$(at,{key:1,label:m,value:h,can_copy:!0},null,8,["label","value"])):(m==="created_by_user"||m==="updated_by_user"||m==="deleted_by_user")&&typeof h=="object"&&h!==null?(_(),$(at,{key:2,label:m,value:h,type:"user"},null,8,["label","value"])):m==="count_users"||m==="count_roles"?(_(),$(at,{key:3,label:m,value:h,type:"tag"},null,8,["label","value"])):m==="is_active"?(_(),$(at,{key:4,label:m,value:h,type:"yes-no"},null,8,["label","value"])):(_(),$(at,{key:5,label:m,value:h},null,8,["label","value"]))],64))),256))])])])])):A("",!0)]),_:1})):A("",!0)])}}},ED={key:0},AD={__name:"RoleDetasilsView",setup(n){const t=mi();return(i,r)=>{const a=R("Divider");return _(),O("div",null,[o(t)&&o(t).active_permission_role?(_(),O("div",ED,[f("p",null,[ue("Created By : "),f("span",null,Q(o(t).active_permission_role.json.created_by),1)]),x(a,{class:"is-small"}),f("p",null,[ue("Updated By : "),f("span",null,Q(o(t).active_permission_role.json.updated_by),1)]),x(a,{class:"is-small"}),f("p",null,[ue("Created At : "),f("span",null,Q(o(t).active_permission_role.json.created_at),1)]),x(a,{class:"is-small"}),f("p",null,[ue("Updated At : "),f("span",null,Q(o(t).active_permission_role.json.updated_at),1)])])):A("",!0)])}}},TD={class:"col-5"},RD={class:"flex flex-row"},DD={class:"font-semibold text-sm"},MD={class:"p-inputgroup"},$D={class:"grid p-fluid mt-1 mb-2"},VD={class:"col-12"},BD={class:"p-inputgroup"},qD={class:"p-input-icon-left"},FD=f("i",{class:"pi pi-search"},null,-1),jD={__name:"ViewRole",setup(n){const t=mi(),i=je(),r=Ge(),a=B();Te(async()=>{if(r.params&&!r.params.id)return t.toList(),!1;r.params&&r.params.id&&await t.getItem(r.params.id),t.item&&!t.permission_roles&&await t.getItemRoles(),await i.getPermission(),await t.getRoleMenu()});const s=Ae(),u=d=>{s.value.toggle(d)},l=Rr(),c=()=>{l.open(AD,{props:{header:"Details",style:{width:"50vw"},breakpoints:{"960px":"75vw","640px":"90vw"},modal:!0}})};return(d,p)=>{const v=R("Button"),h=R("Menu"),m=R("InputText"),b=R("Column"),I=R("DataTable"),k=R("Paginator"),y=R("Panel"),g=R("DynamicDialog"),C=Ke("tooltip");return _(),O("div",TD,[o(t)&&o(t).item?(_(),$(y,{key:0,class:"is-small"},{header:T(()=>[f("div",RD,[f("div",DD,Q(o(t).item.name),1)])]),icons:T(()=>[f("div",MD,[x(v,{class:"p-button-sm",label:"#"+o(t).item.id,"data-testid":"permission-role_id",onClick:p[0]||(p[0]=w=>o(a).copy(o(t).item.id))},null,8,["label"]),o(t).hasPermission("can-update-permissions")||o(t).hasPermission("can-manage-permissions")?(_(),O(ne,{key:0},[x(v,{class:"p-button-sm",icon:"pi pi-angle-down",type:"button","aria-haspopup":"true","data-testid":"permission-role_menu",onClick:u}),x(h,{ref_key:"role_menu_items",ref:s,model:o(t).roles_menu_items,popup:!0},null,8,["model"])],64)):A("",!0),x(v,{class:"p-button-sm",icon:"pi pi-times","data-testid":"permission-role_list",onClick:p[1]||(p[1]=w=>o(t).toList())})])]),default:T(()=>[f("div",$D,[f("div",VD,[f("div",BD,[f("span",qD,[FD,x(m,{class:"w-full p-inputtext-sm",placeholder:"Search","data-testid":"permission-role_search",modelValue:o(t).permission_roles_query.q,"onUpdate:modelValue":p[2]||(p[2]=w=>o(t).permission_roles_query.q=w),onKeyup:[p[3]||(p[3]=Ie(w=>o(t).delayedItemUsersSearch(),["enter"])),p[4]||(p[4]=Ie(w=>o(t).delayedItemUsersSearch(),["enter","native"])),p[5]||(p[5]=Ie(w=>o(t).delayedItemUsersSearch(),["13"]))]},null,8,["modelValue"])]),x(v,{class:"p-button-sm",label:"Reset","data-testid":"permission-role_reset",onClick:p[6]||(p[6]=w=>o(t).resetPermissionRolesQuery())})])])]),o(t)&&o(t).permission_roles?(_(),$(I,{key:0,value:o(t).permission_roles.list.data,dataKey:"id",class:"p-datatable-sm",stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[x(b,{field:"role",header:"Role",class:"flex align-items-center"},{body:T(w=>[ue(Q(w.data.name)+" ",1),ce(x(v,{class:"p-button-tiny p-button-text","data-testid":"permissions-role_id",onClick:S=>o(a).copy(w.data.slug),icon:"pi pi-copy"},null,8,["onClick"]),[[C,"Copy Slug",void 0,{top:!0}]])]),_:1}),x(b,{field:"has-permission",header:"Has Permission"},Mt({_:2},[o(t).hasPermission("can-update-permissions")||o(t).hasPermission("can-manage-permissions")?{name:"body",fn:T(w=>[w.data.pivot.is_active===1?(_(),$(v,{key:0,label:"Yes",class:"p-button-sm p-button-success p-button-rounded","data-testid":"permission-role_status_yes",onClick:S=>o(t).changePermission(w.data)},null,8,["onClick"])):(_(),$(v,{key:1,label:"No",class:"p-button-sm p-button-danger p-button-rounded",onClick:S=>o(t).changePermission(w.data),"data-testid":"permission-role_status_no"},null,8,["onClick"]))]),key:"0"}:{name:"body",fn:T(w=>[w.data.pivot.is_active===1?(_(),$(v,{key:0,label:"Yes",class:"p-button-sm p-button-success p-button-rounded",disabled:""})):(_(),$(v,{key:1,label:"No",class:"p-button-sm p-button-danger p-button-rounded",disabled:""}))]),key:"1"}]),1024),x(b,null,{body:T(w=>[x(v,{class:"p-button-sm p-button-rounded",onClick:S=>(c(),o(t).active_permission_role=w.data),icon:"pi pi-eye","data-testid":"permission-role_view_details",label:"View"},null,8,["onClick"])]),_:1})]),_:1},8,["value"])):A("",!0),o(t)&&o(t).permission_roles?(_(),$(k,{key:1,first:o(t).rolesFirstElement,"onUpdate:first":p[7]||(p[7]=w=>o(t).rolesFirstElement=w),rows:o(t).permission_roles_query.rows,totalRecords:o(t).permission_roles.list.total,onPage:p[8]||(p[8]=w=>o(t).rolePaginate(w)),rowsPerPageOptions:o(t).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["first","rows","totalRecords","rowsPerPageOptions"])):A("",!0)]),_:1})):A("",!0),x(g)])}}};let xf=[],If=[];If={path:"/vaah/permissions/",component:yn,props:!0,children:[{path:"",name:"permissions.index",component:cD,props:!0,children:[{path:"form/:id?",name:"permissions.form",component:vD,props:!0},{path:"view/:id?",name:"permissions.view",component:OD,props:!0},{path:"role/:id?",name:"permissions.view-role",component:jD,props:!0}]}]};xf.push(If);let UD="WebReinvent\\VaahCms\\Models\\Setting",Lf=document.getElementsByTagName("base")[0].getAttribute("href"),gd=Lf+"/vaah/settings",zi={query:{page:null,rows:null,filter:{q:null,is_active:null,trashed:null,sort:null},recount:null},sidebar_menu_items:[],list:null,settings:{list:null,links:[],scripts:null,meta_tags:[]},role_permissions_query:{q:null,module:null,section:null,page:null,rows:null},role_users_query:{q:null,page:null,rows:null},action:{type:null,items:[]}};const ND=Ot({id:"settings",state:()=>({title:"Settings",base_url:Lf,ajax_url:gd,model:UD,assets_is_fetching:!0,app:null,assets:null,general_assets:null,rows_per_page:[10,20,30,50,100,500],list:null,item:{name:null,slug:null},fillable:null,empty_query:zi.query,empty_action:zi.action,query:B().clone(zi.query),action:B().clone(zi.action),search:{delay_time:600,delay_timer:0},route:null,watch_stopper:null,route_prefix:"settings.",view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],item_menu_list:[],item_menu_state:null,form_menu_list:[],total_permissions:null,total_users:null,permission_menu_items:null,role_permissions:null,role_user_menu_items:null,role_users:null,search_item:null,active_role_permission:null,active_role_user:null,module_section_list:null,role_permissions_query:B().clone(zi.role_permissions_query),role_users_query:B().clone(zi.role_users_query),is_btn_loading:!1}),getters:{},actions:{async onLoad(n){this.route=n,this.setViewAndWidth(n.name),this.updateQueryFromUrl(n)},setViewAndWidth(n){switch(n){case"roles.index":this.view="large",this.list_view_width=12;break;default:this.view="small",this.list_view_width=6;break}},async updateQueryFromUrl(n){if(n.query&&Object.keys(n.query).length>0){for(let t in n.query)this.query[t]=n.query[t];this.countFilters(n.query)}},watchRoutes(n){this.watch_stopper=We(n,(t,i)=>{if(this.watch_stopper&&!t.name.includes(this.route_prefix))return this.watch_stopper(),!1;this.route=t,t.params.id&&this.getItem(t.params.id),this.setViewAndWidth(t.name)},{deep:!0})},watchStates(){We(this.query.filter,(n,t)=>{this.delayedSearch()},{deep:!0}),We(this.role_permissions_query,(n,t)=>{this.delayedRolePermissionSearch()},{deep:!0}),We(this.role_users_query,(n,t)=>{this.delayedRoleUsersSearch()},{deep:!0})},async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,B().ajax(this.ajax_url+"/general/assets",this.afterGetAssets))},afterGetAssets(n,t){n&&(this.general_assets=n)},async getList(){let n={query:B().clone(this.query)};await B().ajax(this.ajax_url,this.afterGetList,n)},afterGetList:function(n,t){this.is_btn_loading=!1,this.query.recount=null,n&&(this.list=n,this.total_permissions=t.data.totalPermissions,this.total_users=t.data.totalUsers)},async getItem(n){n&&await B().ajax(gd+"/"+n,this.getItemAfter)},async getItemAfter(n,t){n?this.item=n:this.$router.push({name:"roles.index"}),this.getItemMenu(),await this.getFormMenu()},isListActionValid(){return this.action.type?this.action.items.length<1?(B().toastErrors(["Select records"]),!1):!0:(B().toastErrors(["Select an action type"]),!1)},async updateList(n=null){if(!n&&this.action.type?n=this.action.type:this.action.type=n,!this.isListActionValid())return!1;let t="PUT";switch(n){case"delete":t="DELETE";break}let i={params:this.action,method:t,show_success:!1};await B().ajax(this.ajax_url,this.updateListAfter,i)},async updateListAfter(n,t){n&&(this.action=B().clone(this.empty_action),await this.getList())},async listAction(n=null){!n&&this.action.type?n=this.action.type:this.action.type=n;let t=this.ajax_url+"/action/"+n,i="PUT";switch(n){case"delete":t=this.ajax_url,i="DELETE";break;case"delete-all":i="DELETE";break}let r={params:this.action,method:i,show_success:!1};await B().ajax(t,this.updateListAfter,r)},itemAction(n,t=null){t||(t=this.item),this.form.action=n;let i=this.ajax_url,r={method:"post"};switch(n){case"create-and-new":case"create-and-close":case"create-and-clone":r.method="POST",r.params=t;break;case"save":case"save-and-close":case"save-and-clone":r.method="PUT",r.params=t,i+="/"+t.id;break;case"delete":r.method="DELETE",i+="/"+t.id;break;default:r.method="PATCH",i+="/"+t.id+"/action/"+n;break}B().ajax(i,this.itemActionAfter,r)},async itemActionAfter(n,t){n&&(this.item=n,await this.getList(),await this.formActionAfter(),this.getItemMenu(),this.route.params&&this.route.params.id&&await this.getItem(this.route.params.id))},async formActionAfter(){switch(this.form.action){case"create-and-new":case"save-and-new":this.setActiveItemAsEmpty();break;case"create-and-close":case"save-and-close":this.setActiveItemAsEmpty(),this.$router.push({name:"roles.index"});break;case"save-and-clone":this.item.id=null;break;case"trash":this.item=null;break;case"delete":this.item=null,this.toList();break}},async toggleIsActive(n){n.is_active?await this.itemAction("activate",n):await this.itemAction("deactivate",n)},async paginate(n){this.query.page=n.page+1,await this.getList()},async reload(){await this.getAssets(),await this.getList()},async getFaker(){let n={model_namespace:this.model,except:this.assets.fillable.except},t=this.base_url+"/faker",i={params:n,method:"post"};B().ajax(t,this.getFakerAfter,i)},getFakerAfter:function(n,t){if(n){let i=this;Object.keys(n.fill).forEach(function(r){i.item[r]=n.fill[r]})}},async sync(){this.is_btn_loading=!0,this.query.recount=!0,await this.getList()},onItemSelection(n){this.action.items=n},setActiveItemAsEmpty(){this.item=B().clone(this.assets.empty_item)},confirmDelete(){if(this.action.items.length<1)return B().toastErrors(["Select a record"]),!1;this.action.type="delete",B().confirmDialogDelete(this.listAction)},confirmDeleteAll(){this.action.type="delete-all",B().confirmDialogDelete(this.listAction)},async delayedSearch(){let n=this;this.query.page=1,this.action.items=[],clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.updateUrlQueryString(n.query),await n.getList()},this.search.delay_time)},async updateUrlQueryString(n){n=B().clone(n);let t=ct.stringify(n,{skipNulls:!0}),i=ct.parse(t);i.filter&&(i.filter=B().cleanObject(i.filter)),await this.$router.replace({query:null}),await this.$router.replace({query:i}),this.countFilters(i)},countFilters:function(n){if(this.count_filters=0,n&&n.filter){let t=B().cleanObject(n.filter);this.count_filters=Object.keys(t).length}},async clearSearch(){this.query.filter.q=null,await this.updateUrlQueryString(this.query),await this.getList()},async resetQuery(){await this.resetQueryString(),await this.getList()},async resetQueryString(){for(let n in this.query.filter)this.query.filter[n]=null;await this.updateUrlQueryString(this.query)},async getItemPermissions(){this.showProgress();let n={query:this.role_permissions_query,method:"post"};B().ajax(this.ajax_url+"/item/"+this.item.id+"/permissions",this.afterGetItemPermissions,n)},afterGetItemPermissions(n,t){this.hideProgress(),n&&(this.role_permissions=n)},async delayedRolePermissionSearch(){let n=this;n.item&&n.item.id&&(clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.getItemPermissions()},this.search.delay_time))},async permissionPaginate(n){this.role_permissions_query.page=n.page+1,await this.getItemPermissions()},async getItemUsers(){this.showProgress();let n={query:this.role_users_query,method:"get"};B().ajax(this.ajax_url+"/item/"+this.item.id+"/users",this.afterGetItemUsers,n)},afterGetItemUsers(n,t){this.hideProgress(),n&&(this.role_users=n)},async userPaginate(n){this.role_users_query.page=n.page+1,await this.getItemUsers()},async delayedRoleUsersSearch(){let n=this;n.item&&n.item.id&&(clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.getItemUsers()},this.search.delay_time))},changeRoleStatus(n){let t={inputs:[n]},i={};this.actions(!1,"change-role-permission-status",t,i)},afterChangeRoleStatus(n,t){this.hideProgress(),this.getItemPermissions(this.filter.page),this.$store.dispatch("root/reloadPermissions")},changeRolePermission(n){let t={id:this.item.id,permission_id:n.id},i={};n.pivot.is_active?i.is_active=0:i.is_active=1,this.actions(!1,"toggle-permission-active-status",t,i)},changeUserRole:function(n){let t={id:this.item.id,user_id:n.id},i={};n.pivot.is_active?i.is_active=0:i.is_active=1,this.actions(!1,"toggle-user-active-status",t,i)},bulkActions(n,t){let i={id:this.item.id,permission_id:null,user_id:null},r={is_active:n};this.actions(!1,t,i,r)},actions(n,t,i,r){this.showProgress(),n&&n.preventDefault();let a={params:{inputs:i,data:r},method:"post"};B().ajax(this.ajax_url+"/actions/"+t,this.afterActions,a)},async afterActions(n,t){await this.hideProgress(),await this.getItemPermissions(this.item.id),await this.getItemUsers(),await this.getList()},resetRolePermissionFilters(){this.role_permissions_query.q=null,this.role_permissions_query.module=null,this.role_permissions_query.section=null,this.role_permissions_query.rows=this.assets.rows},getModuleSection(){let n={params:{module:this.role_permissions_query.module},method:"post"};B().ajax(this.ajax_url+"/module/"+this.role_permissions_query.module+"/sections",this.afterAetModuleSection,n)},afterAetModuleSection(n,t){n&&(this.module_section_list=n)},resetRoleUserFilters(){this.role_users_query.q=null,this.role_users_query.rows=this.assets.rows},closeForm(){this.$router.push({name:"roles.index"})},toList(){this.item=null,this.$router.push({name:"roles.index"})},toForm(){this.item=B().clone(this.assets.empty_item),this.getFormMenu(),this.$router.push({name:"roles.form"})},toView(n){this.item=B().clone(n),this.$router.push({name:"roles.view",params:{id:n.id}})},toEdit(n){this.item=n,this.$router.push({name:"roles.form",params:{id:n.id}})},async toPermission(n){this.item=n,await this.getItemPermissions(),this.$router.push({name:"roles.permissions",params:{id:n.id}})},toUser(n){this.item=n,this.getItemUsers(),this.$router.push({name:"roles.users",params:{id:n.id}})},isViewLarge(){return this.view==="large"},getIdWidth(){let n=50;if(this.list&&this.list.total){let t=this.list.total.toString();t=t.length,n=t*40}return n+"px"},getActionWidth(){let n=100;return this.isViewLarge()||(n=80),n+"px"},getActionLabel(){let n=null;return this.isViewLarge()&&(n="Actions"),n},async getListSelectedMenu(){this.list_selected_menu=[{label:"Activate",command:async()=>{await this.updateList("activate")}},{label:"Deactivate",command:async()=>{await this.updateList("deactivate")}},{separator:!0},{label:"Trash",icon:"pi pi-times",command:async()=>{await this.updateList("trash")}},{label:"Restore",icon:"pi pi-replay",command:async()=>{await this.updateList("restore")}},{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDelete()}}]},getListBulkMenu(){this.list_bulk_menu=[{label:"Mark all as active",command:async()=>{await this.listAction("activate-all")}},{label:"Mark all as inactive",command:async()=>{await this.listAction("deactivate-all")}},{separator:!0},{label:"Trash All",icon:"pi pi-times",command:async()=>{await this.listAction("trash-all")}},{label:"Restore All",icon:"pi pi-replay",command:async()=>{await this.listAction("restore-all")}},{label:"Delete All",icon:"pi pi-trash",command:async()=>{this.confirmDeleteAll()}}]},getItemMenu(){let n=[];this.item&&this.item.deleted_at&&n.push({label:"Restore",icon:"pi pi-refresh",command:()=>{this.itemAction("restore")}}),this.item&&this.item.id&&!this.item.deleted_at&&n.push({label:"Trash",icon:"pi pi-times",command:()=>{this.itemAction("trash")}}),n.push({label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDeleteItem("delete")}}),this.item_menu_list=n},confirmDeleteItem(){this.form.type="delete",B().confirmDialogDelete(this.confirmDeleteItemAfter)},confirmDeleteItemAfter(){this.itemAction("delete",this.item)},async getFormMenu(){let n=[];this.item&&this.item.id?n=[{label:"Save & Close",icon:"pi pi-check",command:()=>{this.itemAction("save-and-close")}},{label:"Save & Clone",icon:"pi pi-copy",command:()=>{this.itemAction("save-and-clone")}},{label:"Trash",icon:"pi pi-times",command:()=>{this.itemAction("trash")}},{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDeleteItem("delete")}}]:n=[{label:"Create & Close",icon:"pi pi-check",command:()=>{this.itemAction("create-and-close")}},{label:"Create & Clone",icon:"pi pi-copy",command:()=>{this.itemAction("create-and-clone")}},{label:"Reset",icon:"pi pi-refresh",command:()=>{this.setActiveItemAsEmpty()}}],n.push({label:"Fill",icon:"pi pi-pencil",command:()=>{this.getFaker()}}),this.form_menu_list=n},getMenuItems(){this.list_bulk_menu=[{label:"Active All Permissions",command:async()=>{await this.listAction("activate-all")}},{label:"Inactive All Permissions",command:async()=>{await this.listAction("deactivate-all")}}]},async getPermissionMenuItems(){this.permission_menu_items=[{label:"Active All Permissions",command:()=>{this.bulkActions(1,"toggle-permission-active-status")}},{label:"Inactive All Permissions",command:()=>{this.bulkActions(0,"toggle-permission-active-status")}}]},async getRoleUserMenuItems(){this.role_user_menu_items=[{label:"Attach To All Users",command:()=>{this.bulkActions(1,"toggle-user-active-status")}},{label:"Detach To All Users",command:()=>{this.bulkActions(0,"toggle-user-active-status")}}]},hasPermission(n){const t=je();return B().hasPermission(t.permissions,n)},showProgress(){this.show_progress_bar=!0},hideProgress(){this.show_progress_bar=!1},strToSlug(n){return B().strToSlug(n)},setPageTitle(){this.title&&(document.title=this.title)}}}),HD={class:"grid justify-content-center"},KD={class:"col-fixed"},zD={class:"col"},WD={__name:"SettingsLayout",setup(n){const t=ND(),i=Ge();B();const r=Ae([{label:"Settings",items:[{label:"General",icon:"pi pi-cog",to:{path:"/vaah/settings/general"}},{label:"User Settings",icon:"pi pi-user",to:{path:"/vaah/settings/user-settings"}},{label:"Env Variables",icon:"pi pi-cog",to:{path:"/vaah/settings/env-variables"}},{label:"Localizations",icon:"pi pi-code",to:{path:"/vaah/settings/localization"}},{label:"Notifications",icon:"pi pi-bell",to:{path:"/vaah/settings/notifications"}},{label:"Update",icon:"pi pi-download",to:{path:"/vaah/settings/update"}},{label:"Reset",icon:"pi pi-refresh",to:{path:"/setup"}}]}]);return Te(async()=>{t.getAssets()}),(a,s)=>{const u=R("Menu"),l=R("router-view");return _(),O("div",HD,[f("div",KD,[x(u,{model:r.value,pt:{menuitem:({props:c})=>({class:o(i).path===c.item.to.path?"p-focus":""})}},null,8,["model","pt"])]),f("div",zD,[x(l)])])}}};let GD="WebReinvent\\VaahCms\\Models\\Setting",Pf=document.getElementsByTagName("base")[0].getAttribute("href"),YD=Pf+"/vaah/settings/general",Vo={query:[],list:null,action:[]};const $i=Ot({id:"general",state:()=>({title:"General - Settings",base_url:Pf,ajax_url:YD,model:GD,assets_is_fetching:!0,app:null,assets:null,rows_per_page:[10,20,30,50,100,500],list:null,item:null,fillable:null,empty_query:Vo.query,empty_action:Vo.action,query:B().clone(Vo.query),action:B().clone(Vo.action),search:{delay_time:600,delay_timer:0},route:null,view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],item_menu_list:[],item_menu_state:null,form_menu_list:[],field:{name:null,type:null},field_type:null,custom_field_list:null,active_index:[],languages:null,visibitlity_options:[{name:"Enable",value:"1"},{name:"Disable",value:"0"}],maintenanceModeOptions:[{name:"Enable",value:"1"},{name:"Disable",value:"0"}],compressedLogoOptions:[{name:"True",value:"1"},{name:"False",value:"0"}],redirect_after_logout_options:[{name:"Backend",value:"backend"},{name:"Frontend",value:"frontend"},{name:"Custom",value:"custom"}],password_protection_options:[{name:"Enable",value:"1"},{name:"Disable",value:"0"}],copyright_text_options:[{name:"Use App Name",value:"app_name"},{name:"Custom",value:"custom"}],copyright_link_options:[{name:"Use App Url",value:"app_url"},{name:"Custom",value:"custom"}],copyright_year_options:[{name:"Use Current year",value:"use_current_year"},{name:"Custom",value:"custom"}],laravel_queues_options:[{name:"Enable",value:"1"},{name:"Disable",value:"0"}],sign_up_options:[{name:"Enable",value:"1"},{name:"Disable",value:"0"}],social_media_links:null,add_link:null,show_link_input:!0,date_format_options:["Y-m-d","y/m/d","y.m.d","custom"],time_format_options:["H:i:s","h:i A","h:i:s A","custom"],date_time_format_options:["Y-m-d H:i:s","Y-m-d h:i A","d-M-Y H:i","custom"],meta_tag:null,script_tag:{script_after_body_start:null,script_after_head_start:null,script_before_body_close:null,script_before_head_close:null},allowed_files:null,tag_type:null,filtered_registration_roles:null,filtered_allowed_files:null,is_smtp_configured:null}),getters:{},actions:{async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,await B().ajax(this.ajax_url+"/assets",this.afterGetAssets))},afterGetAssets(n,t){n&&(this.assets=n,this.languages=n.languages,this.allowed_files=n.file_types)},async getList(){let n={query:B().clone(this.query)};await B().ajax(this.ajax_url+"/list",this.afterGetList,n)},afterGetList(n,t){n&&(this.list=n.list,this.social_media_links=n.links,this.script_tag=n.scripts,this.meta_tag=n.meta_tags,this.list.maximum_number_of_forgot_password_attempts_per_session=parseInt(this.list.maximum_number_of_forgot_password_attempts_per_session),this.list.maximum_number_of_login_attempts_per_session=parseInt(this.list.maximum_number_of_login_attempts_per_session),this.is_smtp_configured=n.is_smtp_configured)},getCopy(n){let t="{!! config('settings.global."+n+"'); !!}";navigator.clipboard.writeText(t),B().toastSuccess(["Copied"])},removeVariable(n){n.id?this.social_media_links=B().removeInArrayByKey(this.social_media_links,n,"id"):this.social_media_links=B().removeInArrayByKey(this.social_media_links,n,"count"),B().toastErrors(["Removed"])},async storeSiteSettings(){let n={method:"post",params:{list:this.list}},t=this.ajax_url+"/store/site/settings";await B().ajax(t,this.storeSiteSettingsAfter,n)},storeSiteSettingsAfter(){this.getList(),this.clearCache()},async storeLinks(){let n={method:"post"};n.params={links:this.social_media_links};let t=this.ajax_url+"/store/links";await B().ajax(t,this.storeLinksAfter,n)},storeLinksAfter(){this.getList()},async storeScript(){let n={method:"post"};n.params={list:this.script_tag};let t=this.ajax_url+"/store/site/settings";await B().ajax(t,this.storeScriptAfter,n)},storeScriptAfter(){this.getList()},async storeSecuritySettings(){let n={method:"post"};n.params={list:this.list};let t=this.ajax_url+"/store/site/settings";await B().ajax(t,null,n)},expandAll(){let n=document.getElementById("accordionTabContainer").children.length;for(let t=0;t<=n;t++)this.active_index.push(t)},collapseAll(){this.active_index=[]},addLinkHandler(){if(this.show_link_input){if(this.show_link_input&&this.add_link!==""&&this.add_link!==null){let n=this.social_media_links.length,t={id:null,count:n,category:"global",label:this.add_link,excerpt:null,type:"link",key:"link_"+n,value:null,created_at:null,updated_at:null};return this.social_media_links.push(t),this.add_link=null,this.show_link_input=!0}}else return this.show_link_input=!0},addMetaTags(){let n=this.meta_tag.length,t={id:null,uid:n,category:"global",label:"Meta Tag",excerpt:null,type:"meta_tags",key:"meta_tags_"+n,value:{attribute:"name",attribute_value:"",content:""},created_at:null,updated_at:null};this.meta_tag.push(t)},async storeTags(){let n={method:"post",params:{tags:this.meta_tag}},t=this.ajax_url+"/store/meta/tags";await B().ajax(t,this.storeTagsAfter,n)},storeTagsAfter(n,t){this.getList()},async clearCache(){let n={method:"get"},t=this.base_url+"/clear/cache";await B().ajax(t,this.clearCacheAfter,n)},clearCacheAfter(n,t){window.location.reload(!0)},async removeMetaTags(n){if(n.id){this.meta_tag=B().removeInArrayByKey(this.meta_tag,n,"id");let t={method:"POST",params:n};await B().ajax(this.ajax_url+"/delete/meta/tag",null,t)}else this.meta_tag=B().removeInArrayByKey(this.meta_tag,n,"uid")},generateTags(){this.tag_type=="open-graph"&&this.generateOpenGraph(),this.tag_type=="google-webmaster"&&this.generateWebmaster()},generateOpenGraph(){let n=[{id:null,uid:"meta_tags_og_title",category:"global",label:"Open Graph Title",type:"meta_tags",key:"meta_tags_og_title",value:{attribute:"property",attribute_value:"og:title",content:""}},{id:null,uid:"meta_tags_og_site_name",category:"global",label:"Open Graph Site Name",type:"meta_tags",key:"meta_tags_og_site_name",value:{attribute:"property",attribute_value:"og:site_name",content:""}},{id:null,uid:"meta_tags_og_url",category:"global",label:"Open Graph Site Url",type:"meta_tags",key:"meta_tags_og_url",value:{attribute:"property",attribute_value:"og:url",content:""}},{id:null,uid:"meta_tags_og_description",category:"global",label:"Open Graph Description",type:"meta_tags",key:"meta_tags_og_description",value:{attribute:"property",attribute_value:"og:description",content:""}},{id:null,uid:"meta_tags_og_type",category:"global",label:"Open Graph Type",type:"meta_tags",key:"meta_tags_og_type",value:{attribute:"property",attribute_value:"og:type",content:""}},{id:null,uid:"meta_tags_og_image",category:"global",label:"Open Graph Image",type:"meta_tags",key:"meta_tags_og_image",value:{attribute:"property",attribute_value:"og:image",content:""}}];this.meta_tag=this.meta_tag.concat(n)},generateWebmaster(){let n=[{id:null,uid:"meta_tags_google_webmaster",category:"global",label:"Google Webmaster",type:"meta_tags",key:"meta_tags_google_webmaster",value:{attribute:"name",attribute_value:"google-site-verification",content:""}}];this.meta_tag=this.meta_tag.concat(n)},searchRegistrationRoles(n){n.query.trim().length?this.filtered_registration_roles=this.assets.roles.filter(t=>t.toLowerCase().startsWith(n.query.toLowerCase())):this.filtered_registration_roles=this.assets.roles},searchAllowedFiles(n){n.query.trim().length?this.filtered_allowed_files=this.assets.file_types.filter(t=>t.toLowerCase().includes(n.query.toLowerCase())&&!this.list.upload_allowed_files.includes(t)):this.filtered_allowed_files=this.assets.file_types},setPageTitle(){this.title&&(document.title=this.title)}}}),QD={key:0,class:"grid justify-content-evenly"},XD={class:"col-12 md:col-6 pr-4"},ZD={class:"grid p-fluid"},JD={class:"col-12"},eM=f("h5",{class:"p-1 text-xs mb-1"},"Site Title",-1),tM={class:"p-inputgroup"},nM={class:"col-6"},iM=f("h5",{class:"p-1 text-xs mb-1"},"Default Site Language",-1),sM={class:"col-6"},rM=f("h5",{class:"p-1 text-xs mb-1"},"Redirect after Frontend Login",-1),oM={class:"p-inputgroup"},aM={class:"col-12"},lM=f("h5",{class:"p-1 text-xs mb-1"},"Meta Description",-1),uM={class:"p-inputgroup"},cM={class:"col-12"},dM=f("h5",{class:"p-1 text-xs mb-1"},"Search Engine Visibility",-1),pM={class:"p-inputgroup"},hM={class:"col-12 p-fluid"},fM=f("h5",{class:"p-1 text-xs mb-1"},"Assign Role(s) on Registration",-1),mM={class:"col-12 p-fluid"},gM=f("h5",{class:"p-1 text-xs mb-1"},"Allowed file types for upload",-1),vM={class:"col-12 p-fluid"},yM=f("h5",{class:"p-1 text-xs mb-1"},"Allowed file size for upload( in MB)",-1),_M={class:"p-inputgroup col-6 p-0"},bM={class:"col-6 p-fluid"},wM=f("h5",{class:"p-1 text-xs mb-1"},"Is Logo compressed with Sidebar",-1),CM={class:"p-inputgroup"},SM={class:"col-12 md:col-6 pl-4"},kM={class:"grid"},xM={class:"col-12"},IM=f("h5",{class:"p-1 text-xs mb-1"},"Copyright Text",-1),LM={class:"p-inputgroup"},PM={class:"col-12"},OM=f("h5",{class:"p-1 text-xs mb-1"},"Copyright Link",-1),EM={class:"p-inputgroup"},AM={class:"col-12"},TM=f("h5",{class:"p-1 text-xs mb-1"},"Copyright Year",-1),RM={class:"p-inputgroup"},DM={class:"col-12"},MM=f("h5",{class:"p-1 text-xs mb-1"}," Max number of forgot password attempts ",-1),$M={class:"p-inputgroup"},VM={class:"col-12"},BM=f("h5",{class:"p-1 text-xs mb-1"},"Maximum number of login attempts",-1),qM={class:"p-inputgroup"},FM={class:"col-6 p-fluid"},jM=f("h5",{class:"p-1 text-xs mb-1"},"Password Protection",-1),UM={class:"p-inputgroup"},NM={class:"col-6 p-fluid"},HM=f("h5",{class:"p-1 text-xs mb-1"},"Laravel Queues",-1),KM={class:"p-inputgroup"},zM={class:"col-6 p-fluid"},WM=f("h5",{class:"p-1 text-xs mb-1"},"Maintenance Mode",-1),GM={class:"p-inputgroup"},YM={class:"col-6 p-fluid"},QM=f("h5",{class:"p-1 text-xs mb-1"},"Signup Page",-1),XM={class:"p-inputgroup"},ZM={class:"col-12"},JM=f("h5",{class:"p-1 text-xs mb-1"},"Redirect after Backend Logout",-1),e$={class:"p-inputgroup"},t$={class:"col-12"},n$=f("h5",{class:"p-1 text-xs mb-1"},"Backend Home Page Link",-1),i$={class:"p-inputgroup"},s$={class:"col-12"},r$={class:"col-12"},o$={__name:"SiteSettings",setup(n){const t=$i();return(i,r)=>{const a=R("InputText"),s=R("Button"),u=R("Dropdown"),l=R("Textarea"),c=R("SelectButton"),d=R("AutoComplete"),p=R("InputNumber"),v=R("Divider");return o(t).list?(_(),O("div",QD,[f("div",XD,[f("div",ZD,[f("div",JD,[eM,f("div",tM,[x(a,{modelValue:o(t).list.site_title,"onUpdate:modelValue":r[0]||(r[0]=h=>o(t).list.site_title=h),"data-testid":"general-site_title",class:"p-inputtext-sm",id:"site-title"},null,8,["modelValue"]),x(s,{icon:"pi pi-copy","data-testid":"general-site_title_copy",onClick:r[1]||(r[1]=h=>o(t).getCopy("site_title")),class:"p-button-sm"})])]),f("div",nM,[iM,x(u,{modelValue:o(t).list.language,"onUpdate:modelValue":r[2]||(r[2]=h=>o(t).list.language=h),options:o(t).languages,optionLabel:"name","data-testid":"general-site_language",optionValue:"locale_code_iso_639",placeholder:"Select a Language",inputClass:"p-inputtext-sm",class:"is-small"},null,8,["modelValue","options"])]),f("div",sM,[rM,f("div",oM,[x(a,{modelValue:o(t).list.redirect_after_frontend_login,"onUpdate:modelValue":r[3]||(r[3]=h=>o(t).list.redirect_after_frontend_login=h),"data-testid":"general-login_redirection",class:"p-inputtext-sm"},null,8,["modelValue"]),x(s,{icon:"pi pi-copy","data-testid":"general-login_redirection_copy",onClick:r[4]||(r[4]=h=>o(t).getCopy("redirect_after_frontend_login")),class:"p-button-sm"})])]),f("div",aM,[lM,f("div",uM,[x(l,{modelValue:o(t).list.site_description,"onUpdate:modelValue":r[5]||(r[5]=h=>o(t).list.site_description=h),autoResize:!0,class:"w-full"},null,8,["modelValue"]),x(s,{icon:"pi pi-copy","data-testid":"general-site_description_copy",onClick:r[6]||(r[6]=h=>o(t).getCopy("site_description"))})])]),f("div",cM,[dM,f("div",pM,[x(c,{modelValue:o(t).list.search_engine_visibility,"onUpdate:modelValue":r[7]||(r[7]=h=>o(t).list.search_engine_visibility=h),options:o(t).visibitlity_options,optionLabel:"name",optionValue:"value","data-testid":"general-visibility","aria-labelledby":"single",class:"p-button-sm"},null,8,["modelValue","options"]),x(s,{icon:"pi pi-copy","data-testid":"general-visibility_copy",onClick:r[8]||(r[8]=h=>o(t).getCopy("vh_search_engine_visibility")),class:"p-button-sm"})])]),f("div",hM,[fM,x(d,{multiple:!0,modelValue:o(t).list.registration_roles,"onUpdate:modelValue":r[9]||(r[9]=h=>o(t).list.registration_roles=h),suggestions:o(t).filtered_registration_roles,onComplete:r[10]||(r[10]=h=>o(t).searchRegistrationRoles(h)),"data-testid":"general-registration_roles",placeholder:"Search",class:"p-inputtext-sm"},null,8,["modelValue","suggestions"])]),f("div",mM,[gM,x(d,{multiple:!0,modelValue:o(t).list.upload_allowed_files,"onUpdate:modelValue":r[11]||(r[11]=h=>o(t).list.upload_allowed_files=h),suggestions:o(t).filtered_allowed_files,onComplete:r[12]||(r[12]=h=>o(t).searchAllowedFiles(h)),class:"p-inputtext-sm","data-testid":"general-allowed_files",placeholder:"Search"},null,8,["modelValue","suggestions"])]),f("div",vM,[yM,f("div",_M,[x(p,{modelValue:o(t).list.upload_allowed_file_size,"onUpdate:modelValue":r[13]||(r[13]=h=>o(t).list.upload_allowed_file_size=h),class:"p-inputtext-sm h-2rem",showButtons:"",mode:"decimal","data-testid":"general-allowed_file_size",min:"1"},null,8,["modelValue"])])]),f("div",bM,[wM,f("div",CM,[x(c,{modelValue:o(t).list.is_logo_compressed,"onUpdate:modelValue":r[14]||(r[14]=h=>o(t).list.is_logo_compressed=h),optionLabel:"name",optionValue:"value",options:o(t).compressedLogoOptions,"data-testid":"general-is_logo_compressed",class:"p-button-sm","aria-labelledby":"single"},null,8,["modelValue","options"]),x(s,{class:"p-button-sm",icon:"pi pi-copy","data-testid":"general-copyright_custom_year_filed_copy",onClick:r[15]||(r[15]=h=>o(t).getCopy("is_logo_compressed"))})])])])]),f("div",SM,[f("div",kM,[f("div",xM,[IM,f("div",LM,[x(c,{modelValue:o(t).list.copyright_text,"onUpdate:modelValue":r[16]||(r[16]=h=>o(t).list.copyright_text=h),optionLabel:"name",optionValue:"value",options:o(t).copyright_text_options,class:"p-button-sm","data-testid":"general-password_protection","aria-labelledby":"single"},null,8,["modelValue","options"]),x(s,{class:"p-button-sm",icon:"pi pi-copy","data-testid":"general-copyright_custom_filed_copy",onClick:r[17]||(r[17]=h=>o(t).getCopy("copyright_text"))})]),o(t).list.copyright_text==="custom"?(_(),$(a,{key:0,class:"w-full p-inputtext-sm mt-2","data-testid":"general-copyright_custom_filed",modelValue:o(t).list.copyright_text_custom,"onUpdate:modelValue":r[18]||(r[18]=h=>o(t).list.copyright_text_custom=h),placeholder:"Enter Custom Text"},null,8,["modelValue"])):A("",!0)]),f("div",PM,[OM,f("div",EM,[x(c,{modelValue:o(t).list.copyright_link,"onUpdate:modelValue":r[19]||(r[19]=h=>o(t).list.copyright_link=h),optionLabel:"name",optionValue:"value",options:o(t).copyright_link_options,class:"p-button-sm","data-testid":"general-password_protection","aria-labelledby":"single"},null,8,["modelValue","options"]),x(s,{class:"p-button-sm",icon:"pi pi-copy","data-testid":"general-copyright_custom_link_filed_copy",onClick:r[20]||(r[20]=h=>o(t).getCopy("copyright_link"))})]),o(t).list.copyright_link==="custom"?(_(),$(a,{key:0,class:"w-full p-inputtext-sm mt-2","data-testid":"general-copyright_custom_link_field",modelValue:o(t).list.copyright_link_custom,"onUpdate:modelValue":r[21]||(r[21]=h=>o(t).list.copyright_link_custom=h),placeholder:"Enter Custom Link"},null,8,["modelValue"])):A("",!0)]),f("div",AM,[TM,f("div",RM,[x(c,{modelValue:o(t).list.copyright_year,"onUpdate:modelValue":r[22]||(r[22]=h=>o(t).list.copyright_year=h),optionLabel:"name",optionValue:"value",options:o(t).copyright_year_options,class:"p-button-sm","data-testid":"general-password_protection","aria-labelledby":"single"},null,8,["modelValue","options"]),x(s,{class:"p-button-sm",icon:"pi pi-copy","data-testid":"general-copyright_custom_year_filed_copy",onClick:r[23]||(r[23]=h=>o(t).getCopy("copyright_year"))})]),x(p,{modelValue:o(t).list.copyright_year_custom,"onUpdate:modelValue":r[24]||(r[24]=h=>o(t).list.copyright_year_custom=h),name:"config-db_port",placeholder:"Copyright Year",class:"w-full p-inputtext-sm mt-2",inputId:"withoutgrouping",useGrouping:!1,pt:{input:{"data-testid":"general-copyright_year"}}},null,8,["modelValue"])]),f("div",DM,[MM,f("div",$M,[x(p,{inputId:"withoutgrouping",modelValue:o(t).list.maximum_number_of_forgot_password_attempts_per_session,"onUpdate:modelValue":r[25]||(r[25]=h=>o(t).list.maximum_number_of_forgot_password_attempts_per_session=h),"data-testid":"general-forgotpassword_attempts",useGrouping:!1,class:"p-inputtext-sm"},null,8,["modelValue"]),x(s,{icon:"pi pi-copy","data-testid":"general-forgotpassword_attempts_copy",onClick:r[26]||(r[26]=h=>o(t).getCopy("maximum_number_of_forgot_password_attempts_per_session")),class:"p-button-sm"})])]),f("div",VM,[BM,f("div",qM,[x(p,{inputId:"withoutgrouping","data-testid":"general-login_attempts",modelValue:o(t).list.maximum_number_of_login_attempts_per_session,"onUpdate:modelValue":r[27]||(r[27]=h=>o(t).list.maximum_number_of_login_attempts_per_session=h),useGrouping:!1,class:"p-inputtext-sm"},null,8,["modelValue"]),x(s,{icon:"pi pi-copy","data-testid":"general-login_attempts_copy",onClick:r[28]||(r[28]=h=>o(t).getCopy("maximum_number_of_login_attempts_per_session")),class:"p-button-sm"})])]),f("div",FM,[jM,f("div",UM,[x(c,{modelValue:o(t).list.password_protection,"onUpdate:modelValue":r[29]||(r[29]=h=>o(t).list.password_protection=h),optionLabel:"name",optionValue:"value",options:o(t).password_protection_options,class:"p-button-sm","data-testid":"general-password_protection","aria-labelledby":"single"},null,8,["modelValue","options"]),x(s,{class:"p-button-sm",icon:"pi pi-copy","data-testid":"general-copyright_custom_year_filed_copy",onClick:r[30]||(r[30]=h=>o(t).getCopy("password_protection"))})])]),f("div",NM,[HM,f("div",KM,[x(c,{modelValue:o(t).list.laravel_queues,"onUpdate:modelValue":r[31]||(r[31]=h=>o(t).list.laravel_queues=h),optionLabel:"name",optionValue:"value",options:o(t).laravel_queues_options,"data-testid":"general-laravel_queues",class:"p-button-sm","aria-labelledby":"single"},null,8,["modelValue","options"]),x(s,{class:"p-button-sm",icon:"pi pi-copy","data-testid":"general-copyright_custom_year_filed_copy",onClick:r[32]||(r[32]=h=>o(t).getCopy("laravel_queues"))})])]),f("div",zM,[WM,f("div",GM,[x(c,{modelValue:o(t).list.maintenance_mode,"onUpdate:modelValue":r[33]||(r[33]=h=>o(t).list.maintenance_mode=h),optionLabel:"name",optionValue:"value",options:o(t).maintenanceModeOptions,"data-testid":"general-maintenance_mode",class:"p-button-sm","aria-labelledby":"single"},null,8,["modelValue","options"]),x(s,{class:"p-button-sm",icon:"pi pi-copy","data-testid":"general-copyright_custom_year_filed_copy",onClick:r[34]||(r[34]=h=>o(t).getCopy("maintenance_mode"))})])]),f("div",YM,[QM,f("div",XM,[x(c,{modelValue:o(t).list.signup_page_visibility,"onUpdate:modelValue":r[35]||(r[35]=h=>o(t).list.signup_page_visibility=h),optionLabel:"name",optionValue:"value",options:o(t).sign_up_options,"data-testid":"general-signup",class:"p-button-sm","aria-labelledby":"single"},null,8,["modelValue","options"]),x(s,{class:"p-button-sm",icon:"pi pi-copy","data-testid":"general-copyright_custom_year_filed_copy",onClick:r[36]||(r[36]=h=>o(t).getCopy("signup_page_visibility"))})])]),f("div",ZM,[JM,f("div",e$,[x(c,{modelValue:o(t).list.redirect_after_backend_logout,"onUpdate:modelValue":r[37]||(r[37]=h=>o(t).list.redirect_after_backend_logout=h),optionLabel:"name",optionValue:"value",options:o(t).redirect_after_logout_options,"data-testid":"general-redirect_logout","aria-labelledby":"single",class:"p-button-sm"},null,8,["modelValue","options"]),x(a,{placeholder:"Enter Redirection Link",modelValue:o(t).list.redirect_after_backend_logout_url,"onUpdate:modelValue":r[38]||(r[38]=h=>o(t).list.redirect_after_backend_logout_url=h),"data-testid":"general-redirect_logout_custom",disabled:o(t).list.redirect_after_backend_logout!=="custom",class:"p-inputtext-sm"},null,8,["modelValue","disabled"]),x(s,{icon:"pi pi-copy","data-testid":"general-backend_logout_copy",onClick:r[39]||(r[39]=h=>o(t).getCopy("redirect_after_backend_logout")),class:"p-button-sm"})])]),f("div",t$,[n$,f("div",i$,[x(c,{modelValue:o(t).list.backend_homepage_link,"onUpdate:modelValue":r[40]||(r[40]=h=>o(t).list.backend_homepage_link=h),optionLabel:"name",optionValue:"value",options:o(t).redirect_after_logout_options,"data-testid":"general-backend_homepage_link","aria-labelledby":"single",class:"p-button-sm"},null,8,["modelValue","options"]),x(a,{placeholder:"Enter Redirection Link",modelValue:o(t).list.backend_homepage_link_url,"onUpdate:modelValue":r[41]||(r[41]=h=>o(t).list.backend_homepage_link_url=h),"data-testid":"general-backend_homepage_link_custom",disabled:o(t).list.backend_homepage_link!=="custom",class:"p-inputtext-sm"},null,8,["modelValue","disabled"]),x(s,{icon:"pi pi-copy","data-testid":"general-backend_homepage_link_copy",onClick:r[42]||(r[42]=h=>o(t).getCopy("backend_homepage_link")),class:"p-button-sm"})])])])]),f("div",s$,[x(v,{class:"m-0"})]),f("div",r$,[x(s,{label:"Save Settings",icon:"pi pi-save","data-testid":"general-save_site",onClick:o(t).storeSiteSettings,class:"mr-2 p-button-sm"},null,8,["onClick"]),x(s,{label:"Clear Cache",icon:"pi pi-trash","data-testid":"general-clear_cache",onClick:o(t).clearCache,class:"p-button-danger p-button-sm"},null,8,["onClick"])])])):A("",!0)}}},a$={key:0},l$={class:"grid"},u$={class:"col-12"},c$=f("h4",{class:"font-semibold text-sm"},"Multi-Factor Authentication",-1),d$=f("p",{class:"text-color-secondary text-xs font-semibold"},"Require a email OTP, sms OTP or authenticator app verification when you login with password.",-1),p$=f("div",{class:"flex"},[ue(" You haven't configured SMTP. Please configured SMTP to enable "),f("strong",null,"\xA0 Email OTP Verification \xA0"),ue(" method. ")],-1),h$={class:"col-12 pt-0"},f$={class:"field"},m$={class:"field-radiobutton"},g$=f("label",{for:"mfa-option-1"},"Disable",-1),v$={class:"field-radiobutton"},y$=f("label",{for:"mfa-option-2"},"Enable for all users",-1),_$={class:"field-radiobutton"},b$=f("label",{for:"mfa-option-3"},"Users will have option to enable it",-1),w$={class:"field"},C$=f("h5",{class:"font-semibold text-sm mb-2"},"MFA Methods",-1),S$={class:"field-checkbox"},k$=f("label",{for:"binary1"},"Email OTP Verification",-1),x$={class:"field-checkbox align-items-start"},I$=f("label",{for:"binary3"},[ue(" Authenticator App (only user can enable this) "),f("small",{class:"block text-red-500 mt-1"},"Authenticator App is temporarily unavailable.")],-1),L$={class:"field flex align-items-center"},P$=f("label",{for:"switch1",class:"m-0"},"We will prompt for additional verification when you log in from a new device or browser.",-1),O$={class:"col-12 pb-0"},E$={__name:"Securities",setup(n){const t=$i();return(i,r)=>{const a=R("Message"),s=R("RadioButton"),u=R("Checkbox"),l=R("InputSwitch"),c=R("Divider"),d=R("Button");return o(t)&&o(t).list?(_(),O("div",a$,[f("div",l$,[f("div",u$,[c$,d$,o(t).is_smtp_configured?A("",!0):(_(),$(a,{key:0,severity:"error",class:"p-container-message",closable:!1,icon:"pi pi-exclamation-triangle"},{default:T(()=>[p$]),_:1}))]),f("div",h$,[f("div",f$,[f("div",m$,[x(s,{inputId:"mfa-option-1",name:"mfa","data-testid":"general-securities_status_"+o(t).list.mfa_status,value:"disable",modelValue:o(t).list.mfa_status,"onUpdate:modelValue":r[0]||(r[0]=p=>o(t).list.mfa_status=p)},null,8,["data-testid","modelValue"]),g$]),f("div",v$,[x(s,{inputId:"mfa-option-2",name:"mfa","data-testid":"general-securities_status_"+o(t).list.mfa_status,value:"all-users",modelValue:o(t).list.mfa_status,"onUpdate:modelValue":r[1]||(r[1]=p=>o(t).list.mfa_status=p)},null,8,["data-testid","modelValue"]),y$]),f("div",_$,[x(s,{inputId:"mfa-option-3",name:"mfa","data-testid":"general-securities_status_"+o(t).list.mfa_status,value:"user-will-have-option",modelValue:o(t).list.mfa_status,"onUpdate:modelValue":r[2]||(r[2]=p=>o(t).list.mfa_status=p)},null,8,["data-testid","modelValue"]),b$])]),f("div",w$,[C$,f("div",S$,[x(u,{disabled:o(t).list.mfa_status==="disable"||!o(t).is_smtp_configured,"data-testid":"general-securities_status_"+o(t).list.mfa_methods,inputId:"binary1",class:"is-small",modelValue:o(t).list.mfa_methods,"onUpdate:modelValue":r[3]||(r[3]=p=>o(t).list.mfa_methods=p),value:"email-otp-verification"},null,8,["disabled","data-testid","modelValue"]),k$]),f("div",x$,[x(u,{disabled:"",inputId:"binary3","data-testid":"general-securities_status_"+o(t).list.mfa_methods,class:"is-small",modelValue:o(t).list.mfa_methods,"onUpdate:modelValue":r[4]||(r[4]=p=>o(t).list.mfa_methods=p),value:"authenticator-app"},null,8,["data-testid","modelValue"]),I$])]),f("div",L$,[x(l,{inputId:"switch1","data-testid":"general-securities_status_is_new_device",class:"p-inputswitch-sm mr-2",modelValue:o(t).list.is_new_device_verification_enabled,"onUpdate:modelValue":r[5]||(r[5]=p=>o(t).list.is_new_device_verification_enabled=p)},null,8,["modelValue"]),P$]),f("div",O$,[x(c,{class:"mt-0 mb-3"}),x(d,{label:"Save",icon:"pi pi-save","data-testid":"general-securities_save",onClick:r[6]||(r[6]=p=>o(t).storeSecuritySettings()),class:"p-button-sm"})])])])])):A("",!0)}}},A$={key:0,class:"grid"},T$={class:"col-4"},R$=f("h5",{class:"p-1 text-xs mb-1"},"Date Format",-1),D$={class:"p-inputgroup"},M$={class:"col-4"},$$=f("h5",{class:"p-1 text-xs mb-1"},"Time Format",-1),V$={class:"p-inputgroup"},B$={class:"col-4"},q$=f("h5",{class:"p-1 text-xs mb-1"},"Date Time Format",-1),F$={class:"p-inputgroup"},j$={class:"col-12"},U$={__name:"DateTime",setup(n){const t=$i();return(i,r)=>{const a=R("Dropdown"),s=R("InputText"),u=R("Button"),l=R("Divider");return o(t).list?(_(),O("div",A$,[f("div",T$,[R$,f("div",D$,[x(a,{modelValue:o(t).list.date_format,"onUpdate:modelValue":r[0]||(r[0]=c=>o(t).list.date_format=c),"data-testid":"general-date_format",options:o(t).date_format_options,inputClass:"p-inputtext-sm",class:"is-small"},null,8,["modelValue","options"]),o(t).list.date_format==="custom"?(_(),$(s,{key:0,placeholder:"Enter Custom date format",modelValue:o(t).list.date_format_custom,"onUpdate:modelValue":r[1]||(r[1]=c=>o(t).list.date_format_custom=c),"data-testid":"general-date_format_custom",class:"p-inputtext-sm"},null,8,["modelValue"])):A("",!0),x(u,{icon:"pi pi-copy","data-testid":"general-date_format_copy",onClick:r[2]||(r[2]=c=>o(t).getCopy("date_format")),class:"p-button-sm"})])]),f("div",M$,[$$,f("div",V$,[x(a,{modelValue:o(t).list.time_format,"onUpdate:modelValue":r[3]||(r[3]=c=>o(t).list.time_format=c),"data-testid":"general-time_format",options:o(t).time_format_options,inputClass:"p-inputtext-sm",class:"is-small"},null,8,["modelValue","options"]),o(t).list.time_format==="custom"?(_(),$(s,{key:0,placeholder:"Enter Custom time format",modelValue:o(t).list.time_format_custom,"onUpdate:modelValue":r[4]||(r[4]=c=>o(t).list.time_format_custom=c),"data-testid":"general-time_format_custom",class:"p-inputtext-sm"},null,8,["modelValue"])):A("",!0),x(u,{icon:"pi pi-copy","data-testid":"general-time_format_copy",onClick:r[5]||(r[5]=c=>o(t).getCopy("time_format")),class:"p-button-sm"})])]),f("div",B$,[q$,f("div",F$,[x(a,{modelValue:o(t).list.datetime_format,"onUpdate:modelValue":r[6]||(r[6]=c=>o(t).list.datetime_format=c),"data-testid":"general-datetime_format",options:o(t).date_time_format_options,inputClass:"p-inputtext-sm",class:"is-small"},null,8,["modelValue","options"]),o(t).list.datetime_format==="custom"?(_(),$(s,{key:0,placeholder:"Enter Custom date-time format",modelValue:o(t).list.datetime_format_custom,"onUpdate:modelValue":r[7]||(r[7]=c=>o(t).list.datetime_format_custom=c),"data-testid":"general-datetime_format_custom",class:"p-inputtext-sm"},null,8,["modelValue"])):A("",!0),x(u,{icon:"pi pi-copy","data-testid":"general-datetime_format_copy",onClick:r[8]||(r[8]=c=>o(t).getCopy("datetime_format")),class:"p-button-sm"})])]),f("div",j$,[x(l,{class:"mt-0 mb-3"}),x(u,{label:"Save",onClick:r[9]||(r[9]=c=>o(t).storeSiteSettings()),"data-testid":"general-date_format_save",icon:"pi pi-save",class:"p-button-sm"})])])):A("",!0)}}},N$={key:0},H$={class:"grid"},K$={class:"col-12 md:col-4"},z$={class:"p-1 text-xs mb-1"},W$={class:"p-inputgroup p-fluid"},G$={class:"p-input-icon-left"},Y$={class:"grid"},Q$={class:"col-12 md:col-4"},X$=f("h5",{class:"p-1 text-xs mb-1"},"Add Link",-1),Z$={class:"p-inputgroup"},J$={class:"col-12"},eV={class:"p-inputgroup justify-content-end"},tV={__name:"SocialMediaLink",setup(n){const t=$i(),i=B();return(r,a)=>{const s=R("InputText"),u=R("Button"),l=R("Divider");return o(t)?(_(),O("div",N$,[f("div",H$,[(_(!0),O(ne,null,xe(o(t).social_media_links,(c,d)=>(_(),O("div",K$,[f("h5",z$,Q(o(i).toLabel(c.label)),1),f("div",W$,[f("span",G$,[f("i",{class:he(c.icon?"pi z-5 "+c.icon:"pi z-5 pi-link")},null,2),x(s,{type:"text","data-testid":"general-"+c.label+"field",modelValue:c.value,"onUpdate:modelValue":p=>c.value=p,placeholder:"Enter "+c.label+" Link",class:"w-full p-inputtext-sm"},null,8,["data-testid","modelValue","onUpdate:modelValue","placeholder"])]),x(u,{icon:"pi pi-copy","data-testid":"general-link_copy",disabled:!c.id,onClick:p=>o(t).getCopy(c.key),class:"p-button-sm"},null,8,["disabled","onClick"]),x(u,{icon:"pi pi-trash","data-testid":"general-link_remove",onClick:p=>o(t).removeVariable(c),class:"p-button-danger p-button-sm"},null,8,["onClick"])])]))),256))]),f("div",Y$,[f("div",Q$,[X$,f("div",Z$,[o(t).show_link_input?(_(),$(s,{key:0,modelValue:o(t).add_link,"onUpdate:modelValue":a[0]||(a[0]=c=>o(t).add_link=c),"data-testid":"general-add_link_field",icon:"pi pi-link",class:"p-inputtext-sm"},null,8,["modelValue"])):A("",!0),x(u,{label:"Add Link",icon:"pi pi-plus",class:"p-button-sm","data-testid":"general-add_link_btn",disabled:!o(t).add_link,onClick:o(t).addLinkHandler},null,8,["disabled","onClick"])])]),f("div",J$,[x(l,{class:"mt-0 mb-3"}),f("div",eV,[x(u,{label:"Save",icon:"pi pi-save","data-testid":"general-link_save",onClick:a[1]||(a[1]=c=>o(t).storeLinks()),class:"p-button-sm"})])])])])):A("",!0)}}},nV={key:0},iV={class:"grid"},sV={class:"col-12 md:col-6 pr-3"},rV=f("h5",{class:"p-1 text-xs mb-1"},"After head tag start ()",-1),oV={class:"p-inputgroup"},aV={class:"col-12 md:col-6 pl-3"},lV=f("h5",{class:"p-1 text-xs mb-1"},"Before head tag close ()",-1),uV={class:"p-inputgroup"},cV={class:"col-12 md:col-6 pr-3"},dV=f("h5",{class:"p-1 text-xs mb-1"},"After body tag start ()",-1),pV={class:"p-inputgroup"},hV={class:"col-12 md:col-6 pl-3"},fV=f("h5",{class:"p-1 text-xs mb-1"},"Before body tag close ()",-1),mV={class:"p-inputgroup"},gV={class:"grid"},vV={class:"col-12"},yV={class:"p-inputgroup justify-content-end"},_V={__name:"Scripts",setup(n){const t=$i();return(i,r)=>{const a=R("Textarea"),s=R("Button"),u=R("Divider");return o(t)?(_(),O("div",nV,[f("div",iV,[f("div",sV,[rV,f("div",oV,[x(a,{modelValue:o(t).script_tag.script_after_head_start,"onUpdate:modelValue":r[0]||(r[0]=l=>o(t).script_tag.script_after_head_start=l),autoResize:!0,"data-testid":"general-script_head_start",class:"w-full"},null,8,["modelValue"]),x(s,{icon:"pi pi-copy","data-testid":"general-script_head_start_copy",onClick:r[1]||(r[1]=l=>o(t).getCopy("script_after_head_start"))})])]),f("div",aV,[lV,f("div",uV,[x(a,{modelValue:o(t).script_tag.script_before_head_close,"onUpdate:modelValue":r[2]||(r[2]=l=>o(t).script_tag.script_before_head_close=l),autoResize:!0,"data-testid":"general-script_head_close",class:"w-full"},null,8,["modelValue"]),x(s,{icon:"pi pi-copy","data-testid":"general-script_head_close_copy",onClick:r[3]||(r[3]=l=>o(t).getCopy("script_before_head_close"))})])]),f("div",cV,[dV,f("div",pV,[x(a,{modelValue:o(t).script_tag.script_after_body_start,"onUpdate:modelValue":r[4]||(r[4]=l=>o(t).script_tag.script_after_body_start=l),autoResize:!0,"data-testid":"general-script_body_start",class:"w-full"},null,8,["modelValue"]),x(s,{icon:"pi pi-copy","data-testid":"general-script_body_start_copy",onClick:r[5]||(r[5]=l=>o(t).getCopy("script_after_body_start"))})])]),f("div",hV,[fV,f("div",mV,[x(a,{modelValue:o(t).script_tag.script_before_body_close,"onUpdate:modelValue":r[6]||(r[6]=l=>o(t).script_tag.script_before_body_close=l),autoResize:!0,"data-testid":"general-script_body_close",class:"w-full"},null,8,["modelValue"]),x(s,{icon:"pi pi-copy","data-testid":"general-script_body_close_copy",onClick:r[7]||(r[7]=l=>o(t).getCopy("script_before_body_close"))})])])]),f("div",gV,[f("div",vV,[x(u,{class:"my-3"}),f("div",yV,[x(s,{label:"Save",icon:"pi pi-save","data-testid":"general-script_save",onClick:r[8]||(r[8]=l=>o(t).storeScript()),class:"p-button-sm"})])])])])):A("",!0)}}},bV={key:0},wV={class:"grid"},CV={class:"col-12"},SV={class:"p-1 text-xs mb-1"},kV={class:"p-inputgroup"},xV={class:"col-12 md:col-8"},IV={class:"p-inputgroup"},LV={class:"col-12 md:col-4"},PV={class:"p-inputgroup"},OV={__name:"MetaTags",setup(n){const t=$i();return(i,r)=>{const a=R("Dropdown"),s=R("InputText"),u=R("Button");return o(t)?(_(),O("div",bV,[f("div",wV,[o(t).meta_tag?(_(!0),O(ne,{key:0},xe(o(t).meta_tag,(l,c)=>(_(),O("div",CV,[f("h5",SV,Q(l.label),1),f("div",kV,[x(a,{modelValue:l.value.attribute,"onUpdate:modelValue":d=>l.value.attribute=d,options:o(t).assets.vh_meta_attributes,optionLabel:"name",optionValue:"slug","data-testid":"general-metatags_attributes",placeholder:"Select any",inputClass:"p-inputtext-sm",class:"is-small"},null,8,["modelValue","onUpdate:modelValue","options"]),x(s,{modelValue:l.value.attribute_value,"onUpdate:modelValue":d=>l.value.attribute_value=d,"data-testid":"general-metatags_attributes_value",class:"p-inputtext-sm"},null,8,["modelValue","onUpdate:modelValue"]),x(u,{label:"Content",disabled:""}),x(s,{modelValue:l.value.content,"onUpdate:modelValue":d=>l.value.content=d,"data-testid":"general-metatags_attributes_content",class:"p-inputtext-sm"},null,8,["modelValue","onUpdate:modelValue"]),x(u,{icon:"pi pi-trash","data-testid":"general-remove_tag",onClick:d=>o(t).removeMetaTags(l),class:"p-button-sm"},null,8,["onClick"])])]))),256)):A("",!0),f("div",xV,[f("div",IV,[x(u,{icon:"pi pi-plus","data-testid":"general-add_newtag",onClick:o(t).addMetaTags,label:"Add Meta Tag",class:"p-button-sm"},null,8,["onClick"]),x(u,{label:"Save",onClick:o(t).storeTags,"data-testid":"general-meta_tag-save",class:"p-button-sm"},null,8,["onClick"]),x(u,{icon:"pi pi-copy","data-testid":"general-meta_tag_copy",onClick:r[0]||(r[0]=l=>o(t).getCopy("meta_tags")),class:"p-button-sm"})])]),f("div",LV,[f("div",PV,[x(a,{modelValue:o(t).tag_type,"onUpdate:modelValue":r[1]||(r[1]=l=>o(t).tag_type=l),options:[{name:"Google Webmaster",value:"google-webmaster"},{name:"Open Graph (Facebook)",value:"open-graph"}],"data-testid":"general-gegnerate_tag",optionLabel:"name",optionValue:"value",placeholder:"Select a type",inputClass:"p-inputtext-sm",class:"is-small"},null,8,["modelValue","options"]),x(u,{label:"Generate",onClick:o(t).generateTags,class:"p-button-sm"},null,8,["onClick"])])])])])):A("",!0)}}},EV=f("div",{class:"flex flex-row"},[f("div",null,[f("b",{class:"mr-1"},"General Settings")])],-1),AV={class:"buttons"},TV=f("div",{class:"w-full"},[f("div",null,[f("h5",{class:"font-semibold text-sm"},"Site Settings"),f("p",{class:"text-color-secondary text-xs"},"After a successful password update, you will be redirected to the login page where you can log in with your new password.")])],-1),RV=f("div",{class:"w-full"},[f("h5",{class:"font-semibold text-sm"},"Securities"),f("p",{class:"text-color-secondary text-xs"},"Enable and choose multiple methods of authentication")],-1),DV=f("div",{class:"w-full"},[f("h5",{class:"font-semibold text-sm"},"Date & Time"),f("p",{class:"text-color-secondary text-xs"},"Global date and time settings.")],-1),MV=f("div",{class:"w-full"},[f("h5",{class:"font-semibold text-sm"},"Social Media & Links"),f("p",{class:"text-color-secondary text-xs"},"Static links management.")],-1),$V=f("div",{class:"w-full"},[f("h5",{class:"font-semibold text-sm"},"Scripts"),f("p",{class:"text-color-secondary text-xs"},"Add scripts of Google Analytics and other tracking scripts.")],-1),VV=f("div",{class:"w-full"},[f("h5",{class:"font-semibold text-sm"},"Meta Tags"),f("p",{class:"text-color-secondary text-xs"},"Global meta tags.")],-1),BV={__name:"Index",setup(n){const t=$i();return Ge(),_t(),Te(async()=>{await t.setPageTitle(),await t.getAssets(),await t.getList()}),(i,r)=>{const a=R("Button"),s=R("AccordionTab"),u=R("Accordion"),l=R("Panel");return _(),O("div",null,[x(l,{class:"is-small"},{header:T(()=>[EV]),icons:T(()=>[f("div",AV,[x(a,{label:"Expand all",icon:"pi pi-angle-double-down",class:"p-button-sm mr-2",onClick:o(t).expandAll},null,8,["onClick"]),x(a,{label:"Collapse all",icon:"pi pi-angle-double-up",class:"p-button-sm",onClick:o(t).collapseAll},null,8,["onClick"])])]),default:T(()=>[x(u,{multiple:!0,activeIndex:o(t).active_index,id:"accordionTabContainer",class:"my-2"},{default:T(()=>[x(s,null,{header:T(()=>[TV]),default:T(()=>[x(o$)]),_:1}),x(s,null,{header:T(()=>[RV]),default:T(()=>[x(E$)]),_:1}),x(s,null,{header:T(()=>[DV]),default:T(()=>[x(U$)]),_:1}),x(s,null,{header:T(()=>[MV]),default:T(()=>[x(tV)]),_:1}),x(s,null,{header:T(()=>[$V]),default:T(()=>[x(_V)]),_:1}),x(s,null,{header:T(()=>[VV]),default:T(()=>[x(OV)]),_:1})]),_:1},8,["activeIndex"])]),_:1})])}}};let qV="WebReinvent\\VaahCms\\Models\\Setting",Of=document.getElementsByTagName("base")[0].getAttribute("href"),FV=Of+"/vaah/settings/env",Bo={query:[],list:null,action:[]};const jV=Ot({id:"env",state:()=>({title:"Env Variables - Settings",base_url:Of,ajax_url:FV,model:qV,assets_is_fetching:!0,app:null,assets:null,rows_per_page:[10,20,30,50,100,500],list:null,item:null,fillable:null,empty_query:Bo.query,empty_action:Bo.action,query:B().clone(Bo.query),action:B().clone(Bo.action),search:{delay_time:600,delay_timer:0},route:null,view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],item_menu_list:[],item_menu_state:null,form_menu_list:[],env_file:null,new_variable:null,is_btn_loading:!1}),getters:{},actions:{watchItem(){We(()=>this.new_variable,(n,t)=>{n&&n!==""&&(this.new_variable=this.new_variable.toUpperCase(),this.new_variable=this.new_variable.split(" ").join("_"))},{deep:!0})},async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,B().ajax(this.ajax_url+"/assets",this.afterGetAssets))},afterGetAssets(n,t){n&&(this.assets=n)},async getList(){let n={query:B().clone(this.query)};await B().ajax(this.ajax_url+"/list",this.getListAfter,n)},getListAfter:function(n,t){this.is_btn_loading=!1,this.query.recount=null,n&&(this.list=n.list,this.env_file=n.env_file)},isSecrete(n){return!!(n.key=="APP_KEY"||n.key.includes("SECRET")||n.key.includes("API_KEY")||n.key.includes("API")||n.key.includes("AUTH_KEY")||n.key.includes("PRIVATE_KEY")||n.key.includes("MERCHANT_KEY")||n.key.includes("SALT")||n.key.includes("AUTH_TOKEN")||n.key.includes("API_TOKEN"))},inputType(n){return n.key.includes("PASSWORD")||this.isSecrete(n)?"password":"text"},isDisable(n){if(n.key=="APP_KEY"||n.key=="APP_ENV"||n.key=="APP_URL")return!0},showRevealButton(n){return!!(n.key.includes("PASSWORD")||this.isSecrete(n))},getCopy(n){let t='env("'+n.key+'")';navigator.clipboard.writeText(t),B().toastSuccess(["Copied"])},removeVariable(n){n.uid?this.list=B().removeInArrayByKey(this.list,n,"uid"):this.list=B().removeInArrayByKey(this.list,n,"key"),B().toastErrors(["Removed"])},addVariable(){let t={uid:this.list.length,key:this.new_variable,value:null};this.list.push(t),this.new_variable=null},confirmChanges(){B().confirm.require({message:"Invalid value(s) can break the application, are you sure to proceed?. You will be logout and redirected to login page.",header:"Updating environment variables",acceptClass:"yellow",rejectLabel:"Cancel",icon:"pi pi-exclamation-triangle",accept:()=>{this.store()}})},store(){let n=this.validate(),t={method:"post"};if(!n)return!1;t.params=this.list;let i=this.ajax_url+"/store";B().ajax(i,this.storeAfter,t)},storeAfter(n,t){n&&(window.location.href=n.redirect_url)},validate(){let n=this.generateKeyPair(),t=!1,i=[];return n.APP_KEY||(i.push("APP_KEY is required"),t=!0),n.APP_ENV||(i.push("APP_ENV is required"),t=!0),n.APP_URL||(i.push("APP_URL is required"),t=!0),t?(this.$vaah.toastErrors(i),!1):!0},generateKeyPair(){let n=[];return this.list.forEach(function(t){n[t.key]=t.value}),n},downloadFile(n){window.location.href=this.ajax_url+"/download-file/"+n},async sync(){this.is_btn_loading=!0,await this.getList()},setPageTitle(){this.title&&(document.title=this.title)}}}),UV=f("div",{class:"flex flex-row"},[f("div",null,[f("b",{class:"mr-1"},"Environment Variables")])],-1),NV={class:"buttons"},HV={class:"grid justify-content-start"},KV={class:"col-12 md:col-6"},zV={class:"p-1 text-xs mb-1"},WV={class:"p-inputgroup"},GV={class:"grid justify-content-start mt-1"},YV={class:"col-12 md:col-6"},QV={class:"p-inputgroup"},XV={class:"col-12"},ZV={class:"p-inputgroup justify-content-end"},JV={__name:"Index",setup(n){const t=jV();return Ge(),_t(),Te(async()=>{await t.setPageTitle(),await t.getAssets(),await t.getList(),await t.watchItem()}),(i,r)=>{const a=R("Button"),s=R("password"),u=R("Textarea"),l=R("InputText"),c=R("Divider"),d=R("Panel");return _(),$(d,{class:"is-small"},{header:T(()=>[UV]),icons:T(()=>[f("div",NV,[x(a,{label:"Download",icon:"pi pi-download",class:"p-button-sm mr-2","data-testid":"env-download_file",onClick:r[0]||(r[0]=p=>o(t).downloadFile(o(t).env_file))}),x(a,{icon:"pi pi-refresh",label:"Refresh",class:"p-button-sm","data-testid":"env_refresh",onClick:o(t).sync,loading:o(t).is_btn_loading},null,8,["onClick","loading"])])]),default:T(()=>[f("div",HV,[(_(!0),O(ne,null,xe(o(t).list,(p,v)=>(_(),O("div",KV,[f("h5",zV,Q(p.key),1),f("form",null,[f("div",WV,[o(t).inputType(p)=="password"?(_(),$(s,{key:0,modelValue:p.value,"onUpdate:modelValue":h=>p.value=h,class:"w-full",disabled:o(t).isDisable(p),toggleMask:"","auto-resize":!0,"data-testid":"env-"+p.key},null,8,["modelValue","onUpdate:modelValue","disabled","data-testid"])):(_(),$(u,{key:1,modelValue:p.value,"onUpdate:modelValue":h=>p.value=h,rows:"1",class:"is-small",disabled:o(t).isDisable(p),"auto-resize":!0,"data-testid":"env-"+p.key},null,8,["modelValue","onUpdate:modelValue","disabled","data-testid"])),x(a,{icon:"pi pi-copy","data-testid":"env-copy_"+p.key,onClick:h=>o(t).getCopy(p)},null,8,["data-testid","onClick"]),x(a,{icon:"pi pi-trash",class:"p-button-danger p-button-sm","data-testid":"env-remove_"+p.key,onClick:h=>o(t).removeVariable(p)},null,8,["data-testid","onClick"])])])]))),256))]),f("div",GV,[f("div",YV,[f("div",QV,[x(l,{autoResize:!0,modelValue:o(t).new_variable,"onUpdate:modelValue":r[1]||(r[1]=p=>o(t).new_variable=p),class:"p-inputtext-sm","data-testid":"env-add_variable_field"},null,8,["modelValue"]),x(a,{label:"Add Env Variable","data-testid":"env-add_variable",icon:"pi pi-plus",onClick:o(t).addVariable,disabled:!o(t).new_variable,class:"p-button-sm"},null,8,["onClick","disabled"])])]),f("div",XV,[x(c,{class:"mb-3 mt-0"}),f("div",ZV,[x(a,{label:"Save",icon:"pi pi-save",onClick:o(t).confirmChanges,"data-testid":"env-save_variable",class:"p-button-sm"},null,8,["onClick"])])])])]),_:1})}}};var Ef={exports:{}};const eB=_p(Yv);/**! + */const Zi=typeof window<"u";function d5(n){return n.__esModule||n[Symbol.toStringTag]==="Module"}const ft=Object.assign;function il(n,t){const i={};for(const r in t){const a=t[r];i[r]=In(a)?a.map(n):n(a)}return i}const $s=()=>{},In=Array.isArray,p5=/\/$/,h5=n=>n.replace(p5,"");function sl(n,t,i="/"){let r,a={},s="",u="";const l=t.indexOf("#");let c=t.indexOf("?");return l=0&&(c=-1),c>-1&&(r=t.slice(0,c),s=t.slice(c+1,l>-1?l:t.length),a=n(s)),l>-1&&(r=r||t.slice(0,l),u=t.slice(l,t.length)),r=v5(r??t,i),{fullPath:r+(s&&"?")+s+u,path:r,query:a,hash:u}}function f5(n,t){const i=t.query?n(t.query):"";return t.path+(i&&"?")+i+(t.hash||"")}function Zc(n,t){return!t||!n.toLowerCase().startsWith(t.toLowerCase())?n:n.slice(t.length)||"/"}function m5(n,t,i){const r=t.matched.length-1,a=i.matched.length-1;return r>-1&&r===a&&is(t.matched[r],i.matched[a])&&Hh(t.params,i.params)&&n(t.query)===n(i.query)&&t.hash===i.hash}function is(n,t){return(n.aliasOf||n)===(t.aliasOf||t)}function Hh(n,t){if(Object.keys(n).length!==Object.keys(t).length)return!1;for(const i in n)if(!g5(n[i],t[i]))return!1;return!0}function g5(n,t){return In(n)?Jc(n,t):In(t)?Jc(t,n):n===t}function Jc(n,t){return In(t)?n.length===t.length&&n.every((i,r)=>i===t[r]):n.length===1&&n[0]===t}function v5(n,t){if(n.startsWith("/"))return n;if(!n)return t;const i=t.split("/"),r=n.split("/"),a=r[r.length-1];(a===".."||a===".")&&r.push("");let s=i.length-1,u,l;for(u=0;u 1&&s--;else break;return i.slice(0,s).join("/")+"/"+r.slice(u-(u===r.length?1:0)).join("/")}var Er;(function(n){n.pop="pop",n.push="push"})(Er||(Er={}));var Vs;(function(n){n.back="back",n.forward="forward",n.unknown=""})(Vs||(Vs={}));function y5(n){if(!n)if(Zi){const t=document.querySelector("base");n=t&&t.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),h5(n)}const _5=/^[^#]+#/;function b5(n,t){return n.replace(_5,"#")+t}function w5(n,t){const i=document.documentElement.getBoundingClientRect(),r=n.getBoundingClientRect();return{behavior:t.behavior,left:r.left-i.left-(t.left||0),top:r.top-i.top-(t.top||0)}}const ba=()=>({left:window.pageXOffset,top:window.pageYOffset});function C5(n){let t;if("el"in n){const i=n.el,r=typeof i=="string"&&i.startsWith("#"),a=typeof i=="string"?r?document.getElementById(i.slice(1)):document.querySelector(i):i;if(!a)return;t=w5(a,n)}else t=n;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function ed(n,t){return(history.state?history.state.position-t:-1)+n}const Wl=new Map;function S5(n,t){Wl.set(n,t)}function k5(n){const t=Wl.get(n);return Wl.delete(n),t}let x5=()=>location.protocol+"//"+location.host;function Kh(n,t){const{pathname:i,search:r,hash:a}=t,s=n.indexOf("#");if(s>-1){let l=a.includes(n.slice(s))?n.slice(s).length:1,c=a.slice(l);return c[0]!=="/"&&(c="/"+c),Zc(c,"")}return Zc(i,n)+r+a}function I5(n,t,i,r){let a=[],s=[],u=null;const l=({state:h})=>{const m=Kh(n,location),b=i.value,I=t.value;let k=0;if(h){if(i.value=m,t.value=h,u&&u===b){u=null;return}k=I?h.position-I.position:0}else r(m);a.forEach(y=>{y(i.value,b,{delta:k,type:Er.pop,direction:k?k>0?Vs.forward:Vs.back:Vs.unknown})})};function c(){u=i.value}function d(h){a.push(h);const m=()=>{const b=a.indexOf(h);b>-1&&a.splice(b,1)};return s.push(m),m}function p(){const{history:h}=window;!h.state||h.replaceState(ft({},h.state,{scroll:ba()}),"")}function v(){for(const h of s)h();s=[],window.removeEventListener("popstate",l),window.removeEventListener("beforeunload",p)}return window.addEventListener("popstate",l),window.addEventListener("beforeunload",p,{passive:!0}),{pauseListeners:c,listen:d,destroy:v}}function td(n,t,i,r=!1,a=!1){return{back:n,current:t,forward:i,replaced:r,position:window.history.length,scroll:a?ba():null}}function L5(n){const{history:t,location:i}=window,r={value:Kh(n,i)},a={value:t.state};a.value||s(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function s(c,d,p){const v=n.indexOf("#"),h=v>-1?(i.host&&document.querySelector("base")?n:n.slice(v))+c:x5()+n+c;try{t[p?"replaceState":"pushState"](d,"",h),a.value=d}catch(m){console.error(m),i[p?"replace":"assign"](h)}}function u(c,d){const p=ft({},t.state,td(a.value.back,c,a.value.forward,!0),d,{position:a.value.position});s(c,p,!0),r.value=c}function l(c,d){const p=ft({},a.value,t.state,{forward:c,scroll:ba()});s(p.current,p,!0);const v=ft({},td(r.value,c,null),{position:p.position+1},d);s(c,v,!1),r.value=c}return{location:r,state:a,push:l,replace:u}}function P5(n){n=y5(n);const t=L5(n),i=I5(n,t.state,t.location,t.replace);function r(s,u=!0){u||i.pauseListeners(),history.go(s)}const a=ft({location:"",base:n,go:r,createHref:b5.bind(null,n)},t,i);return Object.defineProperty(a,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(a,"state",{enumerable:!0,get:()=>t.state.value}),a}function O5(n){return n=location.host?n||location.pathname+location.search:"",n.includes("#")||(n+="#"),P5(n)}function E5(n){return typeof n=="string"||n&&typeof n=="object"}function zh(n){return typeof n=="string"||typeof n=="symbol"}const ai={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0},Wh=Symbol("");var nd;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(nd||(nd={}));function ss(n,t){return ft(new Error,{type:n,[Wh]:!0},t)}function Kn(n,t){return n instanceof Error&&Wh in n&&(t==null||!!(n.type&t))}const id="[^/]+?",A5={sensitive:!1,strict:!1,start:!0,end:!0},T5=/[.+*?^${}()[\]/\\]/g;function R5(n,t){const i=ft({},A5,t),r=[];let a=i.start?"^":"";const s=[];for(const d of n){const p=d.length?[]:[90];i.strict&&!d.length&&(a+="/");for(let v=0;v t.length?t.length===1&&t[0]===40+40?1:-1:0}function M5(n,t){let i=0;const r=n.score,a=t.score;for(;i 0&&t[t.length-1]<0}const $5={type:0,value:""},V5=/[a-zA-Z0-9_]/;function B5(n){if(!n)return[[]];if(n==="/")return[[$5]];if(!n.startsWith("/"))throw new Error(`Invalid path "${n}"`);function t(m){throw new Error(`ERR (${i})/"${d}": ${m}`)}let i=0,r=i;const a=[];let s;function u(){s&&a.push(s),s=[]}let l=0,c,d="",p="";function v(){!d||(i===0?s.push({type:0,value:d}):i===1||i===2||i===3?(s.length>1&&(c==="*"||c==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),s.push({type:1,value:d,regexp:p,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):t("Invalid state to consume buffer"),d="")}function h(){d+=c}for(;l {u(g)}:$s}function u(p){if(zh(p)){const v=r.get(p);v&&(r.delete(p),i.splice(i.indexOf(v),1),v.children.forEach(u),v.alias.forEach(u))}else{const v=i.indexOf(p);v>-1&&(i.splice(v,1),p.record.name&&r.delete(p.record.name),p.children.forEach(u),p.alias.forEach(u))}}function l(){return i}function c(p){let v=0;for(;v =0&&(p.record.path!==i[v].record.path||!Gh(p,i[v]));)v++;i.splice(v,0,p),p.record.name&&!od(p)&&r.set(p.record.name,p)}function d(p,v){let h,m={},b,I;if("name"in p&&p.name){if(h=r.get(p.name),!h)throw ss(1,{location:p});I=h.record.name,m=ft(rd(v.params,h.keys.filter(g=>!g.optional).map(g=>g.name)),p.params&&rd(p.params,h.keys.map(g=>g.name))),b=h.stringify(m)}else if("path"in p)b=p.path,h=i.find(g=>g.re.test(b)),h&&(m=h.parse(b),I=h.record.name);else{if(h=v.name?r.get(v.name):i.find(g=>g.re.test(v.path)),!h)throw ss(1,{location:p,currentLocation:v});I=h.record.name,m=ft({},v.params,p.params),b=h.stringify(m)}const k=[];let y=h;for(;y;)k.unshift(y.record),y=y.parent;return{name:I,path:b,params:m,matched:k,meta:N5(k)}}return n.forEach(p=>s(p)),{addRoute:s,resolve:d,removeRoute:u,getRoutes:l,getRecordMatcher:a}}function rd(n,t){const i={};for(const r of t)r in n&&(i[r]=n[r]);return i}function j5(n){return{path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:void 0,beforeEnter:n.beforeEnter,props:U5(n),children:n.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in n?n.components||null:n.component&&{default:n.component}}}function U5(n){const t={},i=n.props||!1;if("component"in n)t.default=i;else for(const r in n.components)t[r]=typeof i=="object"?i[r]:i;return t}function od(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function N5(n){return n.reduce((t,i)=>ft(t,i.meta),{})}function ad(n,t){const i={};for(const r in n)i[r]=r in t?t[r]:n[r];return i}function Gh(n,t){return t.children.some(i=>i===n||Gh(n,i))}const Yh=/#/g,H5=/&/g,K5=/\//g,z5=/=/g,W5=/\?/g,Qh=/\+/g,G5=/%5B/g,Y5=/%5D/g,Xh=/%5E/g,Q5=/%60/g,Zh=/%7B/g,X5=/%7C/g,Jh=/%7D/g,Z5=/%20/g;function yu(n){return encodeURI(""+n).replace(X5,"|").replace(G5,"[").replace(Y5,"]")}function J5(n){return yu(n).replace(Zh,"{").replace(Jh,"}").replace(Xh,"^")}function Gl(n){return yu(n).replace(Qh,"%2B").replace(Z5,"+").replace(Yh,"%23").replace(H5,"%26").replace(Q5,"`").replace(Zh,"{").replace(Jh,"}").replace(Xh,"^")}function e6(n){return Gl(n).replace(z5,"%3D")}function t6(n){return yu(n).replace(Yh,"%23").replace(W5,"%3F")}function n6(n){return n==null?"":t6(n).replace(K5,"%2F")}function ua(n){try{return decodeURIComponent(""+n)}catch{}return""+n}function i6(n){const t={};if(n===""||n==="?")return t;const r=(n[0]==="?"?n.slice(1):n).split("&");for(let a=0;a s&&Gl(s)):[r&&Gl(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+i,s!=null&&(t+="="+s))})}return t}function s6(n){const t={};for(const i in n){const r=n[i];r!==void 0&&(t[i]=In(r)?r.map(a=>a==null?null:""+a):r==null?r:""+r)}return t}const r6=Symbol(""),ud=Symbol(""),_u=Symbol(""),bu=Symbol(""),Yl=Symbol("");function bs(){let n=[];function t(r){return n.push(r),()=>{const a=n.indexOf(r);a>-1&&n.splice(a,1)}}function i(){n=[]}return{add:t,list:()=>n.slice(),reset:i}}function li(n,t,i,r,a){const s=r&&(r.enterCallbacks[a]=r.enterCallbacks[a]||[]);return()=>new Promise((u,l)=>{const c=v=>{v===!1?l(ss(4,{from:i,to:t})):v instanceof Error?l(v):E5(v)?l(ss(2,{from:t,to:v})):(s&&r.enterCallbacks[a]===s&&typeof v=="function"&&s.push(v),u())},d=n.call(r&&r.instances[a],t,i,c);let p=Promise.resolve(d);n.length<3&&(p=p.then(c)),p.catch(v=>l(v))})}function rl(n,t,i,r){const a=[];for(const s of n)for(const u in s.components){let l=s.components[u];if(!(t!=="beforeRouteEnter"&&!s.instances[u]))if(o6(l)){const d=(l.__vccOpts||l)[t];d&&a.push(li(d,i,r,s,u))}else{let c=l();a.push(()=>c.then(d=>{if(!d)return Promise.reject(new Error(`Couldn't resolve component "${u}" at "${s.path}"`));const p=d5(d)?d.default:d;s.components[u]=p;const h=(p.__vccOpts||p)[t];return h&&li(h,i,r,s,u)()}))}}return a}function o6(n){return typeof n=="object"||"displayName"in n||"props"in n||"__vccOpts"in n}function cd(n){const t=pi(_u),i=pi(bu),r=Je(()=>t.resolve(o(n.to))),a=Je(()=>{const{matched:c}=r.value,{length:d}=c,p=c[d-1],v=i.matched;if(!p||!v.length)return-1;const h=v.findIndex(is.bind(null,p));if(h>-1)return h;const m=dd(c[d-2]);return d>1&&dd(p)===m&&v[v.length-1].path!==m?v.findIndex(is.bind(null,c[d-2])):h}),s=Je(()=>a.value>-1&&c6(i.params,r.value.params)),u=Je(()=>a.value>-1&&a.value===i.matched.length-1&&Hh(i.params,r.value.params));function l(c={}){return u6(c)?t[o(n.replace)?"replace":"push"](o(n.to)).catch($s):Promise.resolve()}return{route:r,href:Je(()=>r.value.href),isActive:s,isExactActive:u,navigate:l}}const a6=nu({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:cd,setup(n,{slots:t}){const i=Ar(cd(n)),{options:r}=pi(_u),a=Je(()=>({[pd(n.activeClass,r.linkActiveClass,"router-link-active")]:i.isActive,[pd(n.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:i.isExactActive}));return()=>{const s=t.default&&t.default(i);return n.custom?s:iu("a",{"aria-current":i.isExactActive?n.ariaCurrentValue:null,href:i.href,onClick:i.navigate,class:a.value},s)}}}),l6=a6;function u6(n){if(!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)&&!n.defaultPrevented&&!(n.button!==void 0&&n.button!==0)){if(n.currentTarget&&n.currentTarget.getAttribute){const t=n.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return n.preventDefault&&n.preventDefault(),!0}}function c6(n,t){for(const i in t){const r=t[i],a=n[i];if(typeof r=="string"){if(r!==a)return!1}else if(!In(a)||a.length!==r.length||r.some((s,u)=>s!==a[u]))return!1}return!0}function dd(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const pd=(n,t,i)=>n??t??i,d6=nu({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:t,slots:i}){const r=pi(Yl),a=Je(()=>n.route||r.value),s=pi(ud,0),u=Je(()=>{let d=o(s);const{matched:p}=a.value;let v;for(;(v=p[d])&&!v.components;)d++;return d}),l=Je(()=>a.value.matched[u.value]);Ms(ud,Je(()=>u.value+1)),Ms(r6,l),Ms(Yl,a);const c=Ae();return We(()=>[c.value,l.value,n.name],([d,p,v],[h,m,b])=>{p&&(p.instances[v]=d,m&&m!==p&&d&&d===h&&(p.leaveGuards.size||(p.leaveGuards=m.leaveGuards),p.updateGuards.size||(p.updateGuards=m.updateGuards))),d&&p&&(!m||!is(p,m)||!h)&&(p.enterCallbacks[v]||[]).forEach(I=>I(d))},{flush:"post"}),()=>{const d=a.value,p=n.name,v=l.value,h=v&&v.components[p];if(!h)return hd(i.default,{Component:h,route:d});const m=v.props[p],b=m?m===!0?d.params:typeof m=="function"?m(d):m:null,k=iu(h,ft({},b,t,{onVnodeUnmounted:y=>{y.component.isUnmounted&&(v.instances[p]=null)},ref:c}));return hd(i.default,{Component:k,route:d})||k}}});function hd(n,t){if(!n)return null;const i=n(t);return i.length===1?i[0]:i}const p6=d6;function h6(n){const t=F5(n.routes,n),i=n.parseQuery||i6,r=n.stringifyQuery||ld,a=n.history,s=bs(),u=bs(),l=bs(),c=cp(ai);let d=ai;Zi&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const p=il.bind(null,ee=>""+ee),v=il.bind(null,n6),h=il.bind(null,ua);function m(ee,Ce){let X,ve;return zh(ee)?(X=t.getRecordMatcher(ee),ve=Ce):ve=ee,t.addRoute(ve,X)}function b(ee){const Ce=t.getRecordMatcher(ee);Ce&&t.removeRoute(Ce)}function I(){return t.getRoutes().map(ee=>ee.record)}function k(ee){return!!t.getRecordMatcher(ee)}function y(ee,Ce){if(Ce=ft({},Ce||c.value),typeof ee=="string"){const G=sl(i,ee,Ce.path),ae=t.resolve({path:G.path},Ce),De=a.createHref(G.fullPath);return ft(G,ae,{params:h(ae.params),hash:ua(G.hash),redirectedFrom:void 0,href:De})}let X;if("path"in ee)X=ft({},ee,{path:sl(i,ee.path,Ce.path).path});else{const G=ft({},ee.params);for(const ae in G)G[ae]==null&&delete G[ae];X=ft({},ee,{params:v(G)}),Ce.params=v(Ce.params)}const ve=t.resolve(X,Ce),we=ee.hash||"";ve.params=p(h(ve.params));const le=f5(r,ft({},ee,{hash:J5(we),path:ve.path})),Y=a.createHref(le);return ft({fullPath:le,hash:we,query:r===ld?s6(ee.query):ee.query||{}},ve,{redirectedFrom:void 0,href:Y})}function g(ee){return typeof ee=="string"?sl(i,ee,c.value.path):ft({},ee)}function C(ee,Ce){if(d!==ee)return ss(8,{from:Ce,to:ee})}function w(ee){return P(ee)}function S(ee){return w(ft(g(ee),{replace:!0}))}function L(ee){const Ce=ee.matched[ee.matched.length-1];if(Ce&&Ce.redirect){const{redirect:X}=Ce;let ve=typeof X=="function"?X(ee):X;return typeof ve=="string"&&(ve=ve.includes("?")||ve.includes("#")?ve=g(ve):{path:ve},ve.params={}),ft({query:ee.query,hash:ee.hash,params:"path"in ve?{}:ee.params},ve)}}function P(ee,Ce){const X=d=y(ee),ve=c.value,we=ee.state,le=ee.force,Y=ee.replace===!0,G=L(X);if(G)return P(ft(g(G),{state:typeof G=="object"?ft({},we,G.state):we,force:le,replace:Y}),Ce||X);const ae=X;ae.redirectedFrom=Ce;let De;return!le&&m5(r,ve,X)&&(De=ss(16,{to:ae,from:ve}),me(ve,ve,!0,!1)),(De?Promise.resolve(De):D(ae,ve)).catch(Pe=>Kn(Pe)?Kn(Pe,2)?Pe:oe(Pe):z(Pe,ae,ve)).then(Pe=>{if(Pe){if(Kn(Pe,2))return P(ft({replace:Y},g(Pe.to),{state:typeof Pe.to=="object"?ft({},we,Pe.to.state):we,force:le}),Ce||ae)}else Pe=j(ae,ve,!0,Y,we);return V(ae,ve,Pe),Pe})}function E(ee,Ce){const X=C(ee,Ce);return X?Promise.reject(X):Promise.resolve()}function M(ee){const Ce=ye.values().next().value;return Ce&&typeof Ce.runWithContext=="function"?Ce.runWithContext(ee):ee()}function D(ee,Ce){let X;const[ve,we,le]=f6(ee,Ce);X=rl(ve.reverse(),"beforeRouteLeave",ee,Ce);for(const G of ve)G.leaveGuards.forEach(ae=>{X.push(li(ae,ee,Ce))});const Y=E.bind(null,ee,Ce);return X.push(Y),_e(X).then(()=>{X=[];for(const G of s.list())X.push(li(G,ee,Ce));return X.push(Y),_e(X)}).then(()=>{X=rl(we,"beforeRouteUpdate",ee,Ce);for(const G of we)G.updateGuards.forEach(ae=>{X.push(li(ae,ee,Ce))});return X.push(Y),_e(X)}).then(()=>{X=[];for(const G of le)if(G.beforeEnter)if(In(G.beforeEnter))for(const ae of G.beforeEnter)X.push(li(ae,ee,Ce));else X.push(li(G.beforeEnter,ee,Ce));return X.push(Y),_e(X)}).then(()=>(ee.matched.forEach(G=>G.enterCallbacks={}),X=rl(le,"beforeRouteEnter",ee,Ce),X.push(Y),_e(X))).then(()=>{X=[];for(const G of u.list())X.push(li(G,ee,Ce));return X.push(Y),_e(X)}).catch(G=>Kn(G,8)?G:Promise.reject(G))}function V(ee,Ce,X){l.list().forEach(ve=>M(()=>ve(ee,Ce,X)))}function j(ee,Ce,X,ve,we){const le=C(ee,Ce);if(le)return le;const Y=Ce===ai,G=Zi?history.state:{};X&&(ve||Y?a.replace(ee.fullPath,ft({scroll:Y&&G&&G.scroll},we)):a.push(ee.fullPath,we)),c.value=ee,me(ee,Ce,X,Y),oe()}let H;function F(){H||(H=a.listen((ee,Ce,X)=>{if(!W.listening)return;const ve=y(ee),we=L(ve);if(we){P(ft(we,{replace:!0}),ve).catch($s);return}d=ve;const le=c.value;Zi&&S5(ed(le.fullPath,X.delta),ba()),D(ve,le).catch(Y=>Kn(Y,12)?Y:Kn(Y,2)?(P(Y.to,ve).then(G=>{Kn(G,20)&&!X.delta&&X.type===Er.pop&&a.go(-1,!1)}).catch($s),Promise.reject()):(X.delta&&a.go(-X.delta,!1),z(Y,ve,le))).then(Y=>{Y=Y||j(ve,le,!1),Y&&(X.delta&&!Kn(Y,8)?a.go(-X.delta,!1):X.type===Er.pop&&Kn(Y,20)&&a.go(-1,!1)),V(ve,le,Y)}).catch($s)}))}let K=bs(),U=bs(),N;function z(ee,Ce,X){oe(ee);const ve=U.list();return ve.length?ve.forEach(we=>we(ee,Ce,X)):console.error(ee),Promise.reject(ee)}function Z(){return N&&c.value!==ai?Promise.resolve():new Promise((ee,Ce)=>{K.add([ee,Ce])})}function oe(ee){return N||(N=!ee,F(),K.list().forEach(([Ce,X])=>ee?X(ee):Ce()),K.reset()),ee}function me(ee,Ce,X,ve){const{scrollBehavior:we}=n;if(!Zi||!we)return Promise.resolve();const le=!X&&k5(ed(ee.fullPath,0))||(ve||!X)&&history.state&&history.state.scroll||null;return ga().then(()=>we(ee,Ce,le)).then(Y=>Y&&C5(Y)).catch(Y=>z(Y,ee,Ce))}const se=ee=>a.go(ee);let be;const ye=new Set,W={currentRoute:c,listening:!0,addRoute:m,removeRoute:b,hasRoute:k,getRoutes:I,resolve:y,options:n,push:w,replace:S,go:se,back:()=>se(-1),forward:()=>se(1),beforeEach:s.add,beforeResolve:u.add,afterEach:l.add,onError:U.add,isReady:Z,install(ee){const Ce=this;ee.component("RouterLink",l6),ee.component("RouterView",p6),ee.config.globalProperties.$router=Ce,Object.defineProperty(ee.config.globalProperties,"$route",{enumerable:!0,get:()=>o(c)}),Zi&&!be&&c.value===ai&&(be=!0,w(a.location).catch(we=>{}));const X={};for(const we in ai)Object.defineProperty(X,we,{get:()=>c.value[we],enumerable:!0});ee.provide(_u,Ce),ee.provide(bu,up(X)),ee.provide(Yl,c);const ve=ee.unmount;ye.add(ee),ee.unmount=function(){ye.delete(ee),ye.size<1&&(d=ai,H&&H(),H=null,c.value=ai,be=!1,N=!1),ve()}}};function _e(ee){return ee.reduce((Ce,X)=>Ce.then(()=>M(X)),Promise.resolve())}return W}function f6(n,t){const i=[],r=[],a=[],s=Math.max(t.matched.length,n.matched.length);for(let u=0;u is(d,l))?r.push(l):i.push(l));const c=n.matched[u];c&&(t.matched.find(d=>is(d,c))||a.push(c))}return[i,r,a]}function Ge(){return pi(bu)}const m6={class:"public-pages"},g6={class:"grid"},v6={class:"col-8 mt-6 mx-auto"},y6={class:"col"},_6={__name:"Public",setup(n){const t=je();return Te(async()=>{await t.getAssets()}),(i,r)=>{const a=R("RouterView");return _(),O("div",m6,[f("div",g6,[f("div",v6,[f("div",y6,[x(a)])])])])}}},b6={__name:"404",setup(n){const t=je();return Te(async()=>{t.toSignIn()}),(i,r)=>null}},w6={key:0,class:"text-xs text-center"},C6={key:0},S6=["href"],k6=["href"],x6={key:1},I6={__name:"Copyright",setup(n){const t=je();return(i,r)=>o(t).assets?(_(),O("div",w6,[o(t).assets.server?(_(),O("p",C6,[ue(" \xA9 "+Q(o(t).assets.server.current_year)+". ",1),f("a",{href:o(t).assets.vaahcms.website,class:"text-blue-400",name:"copyright-vaahcms_name","data-testid":"signin-vaahcms_name",target:"_blank"},Q(o(t).assets.vaahcms.name),9,S6),ue(" v"+Q(o(t).assets.versions.vaahcms_version)+" | ",1),f("a",{href:o(t).assets.vaahcms.docs,class:"text-blue-400",name:"copyright-vaahcms_documentation","data-testid":"signin-vaahcms_documentation",target:"_blank"},"Documentation",8,k6)])):A("",!0),o(t).assets.versions?(_(),O("p",x6," Laravel v"+Q(o(t).assets.versions.laravel_version)+" | PHP v"+Q(o(t).assets.versions.php_version),1)):A("",!0)])):A("",!0)}},L6={class:"copyright-text"},Di={__name:"Footer",setup(n){return(t,i)=>(_(),O("div",L6,[x(I6)]))}},P6={key:0},O6=["src"],$r={__name:"Logo",setup(n){const t=je();return(i,r)=>o(t)&&o(t).assets?(_(),O("div",P6,[f("img",{src:o(t).assets.backend_logo_url,alt:"",class:"w-5 mb-2"},null,8,O6)])):A("",!0)}};let ef=document.getElementsByTagName("base")[0].getAttribute("href"),tf=ef,E6=tf+"/json";const wa=Ot({id:"auth",state:()=>({base_url:ef,ajax_url:tf,json_url:E6,gutter:20,show_progress_bar:!1,is_resend_disabled:!1,is_installation_verified:!1,is_forgot_password_btn_loading:!1,forgot_password_items:{email:null},title:{heading:"Welcome Back",description:"Please Sign in to continue"},is_mfa_visible:!1,is_reset_password_btn_loading:!1,verification_otp:null,reset_password_items:{reset_password_code:null,password:null,password_confirmation:null},security_timer:0,is_btn_loading:!1,no_of_login_attempt:null,max_attempts_of_login:5,sign_in_items:{type:"password",email:null,password:null,attempts:0,login_otp:null,max_attempts:5,is_password_disabled:null,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone},sign_up_items:{first_name:null,last_name:null,username:null,email:null,password:null,confirm_password:null},is_otp_btn_loading:!1}),getters:{},actions:{sendCode(){this.is_forgot_password_btn_loading=!0;let n={params:this.forgot_password_items,method:"post"};B().ajax(this.ajax_url+"/auth/sendResetCode/post",this.sendCodeAfter,n)},sendCodeAfter(n,t){this.is_forgot_password_btn_loading=!1,n&&this.$router.push({name:"sign.in"})},resetPassword(){this.is_reset_password_btn_loading=!0;let n={params:this.reset_password_items,method:"post"};B().ajax(this.ajax_url+"/auth/resetPassword/post",this.resetPasswordAfter,n)},resetPasswordAfter(n,t){this.is_reset_password_btn_loading=!1,n&&this.$router.push({name:"sign.in"})},signIn(){this.no_of_login_attempt++,this.is_btn_loading=!0;let n={params:this.sign_in_items,method:"post"};B().ajax(this.ajax_url+"/signin/post",this.signInAfter,n)},signInAfter(n,t){this.is_btn_loading=!1,console.log(n.redirect_url),n&&(n.verification_response&&n.verification_response.success?(this.is_mfa_visible=!0,this.security_timer=30,this.title.heading="Multi-Factor Authentication",this.title.description="You have received an email which contains two factor code.",this.resendCountdown()):window.location=n.redirect_url+"#/vaah")},signUp(){this.is_btn_loading=!0;let n={params:this.sign_up_items,method:"post"};B().ajax(this.ajax_url+"/signup/post",this.signUpAfter,n)},signUpAfter(n){this.is_btn_loading=!1,n&&setTimeout(()=>{window.location=n.redirect_url},2e3)},async verifyInstallStatus(){let n={};B().ajax(this.base_url+"/setup/json/status",this.afterVerifyInstallStatus,n)},afterVerifyInstallStatus(n,t){n&&(n.stage!=="installed"&&this.$router.push({name:"setup.index"}),this.is_installation_verified=!0)},generateOTP:function(){this.is_otp_btn_loading=!0;let n={params:this.sign_in_items,method:"post"};B().ajax(this.ajax_url+"/signin/generate/otp",this.generateOTPAfter,n)},generateOTPAfter:function(n,t){this.is_otp_btn_loading=!1},verifySecurityOtp(){this.is_btn_loading=!0;let n={params:{verification_otp:this.verification_otp},method:"post"};B().ajax(this.ajax_url+"/verify/security/otp",this.verifySecurityOtpAfter,n)},verifySecurityOtpAfter(n,t){this.is_btn_loading=!1,n&&n.redirect_url&&(window.location=n.redirect_url)},resendSecurityOtp(){let n={params:{},method:"post"};B().ajax(this.ajax_url+"/resend/security/otp",null,n),this.is_resend_disabled=!0,this.security_timer=30,this.resendCountdown()},resendCountdown(){this.security_timer>0?(this.is_resend_disabled=!0,setTimeout(()=>{this.security_timer--,this.resendCountdown()},1e3)):this.is_resend_disabled=!1},async to(n){this.$router.push({path:n})},showProgress(){this.show_progress_bar=!0},hideProgress(){this.show_progress_bar=!1}}}),A6={key:0},T6={class:"col-12 mt-6 mx-auto"},R6={class:"grid flex justify-content-center flex-wrap"},D6={key:0,class:"w-full"},M6={class:"content text-center"},$6={class:"text-xl font-semibold mb-1","data-testid":"signin-heading_text"},V6={class:"text-xs text-gray-600 font-normal","data-testid":"signin-description_text"},B6={class:"flex flex-column align-items-center gap-3"},q6={key:0,class:"w-full"},F6={class:"mt-5"},j6={class:"field flex justify-content-between align-items-center"},U6={key:1,class:"w-full"},N6={class:"field mb-3"},H6={class:"field-radiobutton cursor-pointer"},K6=f("label",{for:"password",class:"text-sm"},"Login Via Password",-1),z6={class:"field-radiobutton cursor-pointer"},W6=f("label",{for:"otp",class:"text-sm"},"Login Via OTP",-1),G6={class:"flex flex-column align-items-center gap-3"},Y6={key:0,class:"w-full gap-3 flex flex-column"},Q6={class:"p-inputgroup"},X6=f("div",{class:"required-field hidden"},null,-1),Z6={class:"p-inputgroup w-full"},J6=f("div",{class:"required-field hidden"},null,-1),e8={key:1,class:"w-full"},t8={class:"flex flex-column align-items-center gap-3"},n8={class:"p-inputgroup flex-1"},i8={class:"p-inputgroup"},s8=f("div",{class:"required-field hidden"},null,-1),r8={class:"p-inputgroup"},o8=f("div",{class:"required-field hidden"},null,-1),a8={class:"w-full flex justify-content-between align-items-center"},l8={__name:"Signin",setup(n){const t=je(),i=wa(),r=Ge();return Te(async()=>{document.title="Sign In",t.showResponse(r.query),i.verifyInstallStatus(),await t.getAssets()}),(a,s)=>{const u=R("InputText"),l=R("Button"),c=R("RadioButton"),d=R("Password"),p=R("router-link"),v=R("Card"),h=Ke("tooltip");return o(t).assets&&o(i).is_installation_verified?(_(),O("div",A6,[f("div",T6,[f("div",R6,[o(t).assets?(_(),O("div",D6,[x(v,{class:"m-auto border-round-xl w-full max-w-24rem"},{title:T(()=>[f("div",M6,[x($r,{class:"mt-3"}),f("h4",$6,Q(o(i).title.heading),1),f("p",V6,Q(o(i).title.description),1)])]),content:T(()=>[f("div",B6,[o(i).is_mfa_visible?(_(),O("div",q6,[f("div",F6,[x(u,{id:"code",modelValue:o(i).verification_otp,"onUpdate:modelValue":s[0]||(s[0]=m=>o(i).verification_otp=m),placeholder:"Enter Code","data-testid":"signin-otp_field",class:"w-full"},null,8,["modelValue"]),f("div",j6,[x(l,{label:"Submit OTP",class:"p-button-sm",onClick:o(i).verifySecurityOtp,loading:o(i).is_btn_loading,"data-testid":"signin-check_verification"},null,8,["onClick","loading"]),o(i).is_resend_disabled?(_(),$(l,{key:0,label:"Resend OTP in "+o(i).security_timer+" secs..",disabled:"",class:"p-button-sm"},null,8,["label"])):(_(),$(l,{key:1,label:"Resend OTP","data-testid":"signin-resend_verification",onClick:o(i).resendSecurityOtp,class:"p-button-sm"},null,8,["onClick"]))])])])):(_(),O("div",U6,[f("div",N6,[f("div",H6,[x(c,{name:"signin-login_with_password","data-testid":"signin-login_with_password",value:"password",modelValue:o(i).sign_in_items.type,"onUpdate:modelValue":s[1]||(s[1]=m=>o(i).sign_in_items.type=m),inputId:"password"},null,8,["modelValue"]),K6]),f("div",z6,[x(c,{name:"signin-login_with_otp","data-testid":"signin-login_with_otp",value:"otp",modelValue:o(i).sign_in_items.type,"onUpdate:modelValue":s[2]||(s[2]=m=>o(i).sign_in_items.type=m),inputId:"otp"},null,8,["modelValue"]),W6])]),f("div",G6,[o(i).sign_in_items.type==="password"?(_(),O("div",Y6,[f("div",Q6,[x(u,{name:"signin-email",placeholder:"Enter Username or Email","data-testid":"signin-email",id:"email",class:"w-full",type:"text",modelValue:o(i).sign_in_items.email,"onUpdate:modelValue":s[3]||(s[3]=m=>o(i).sign_in_items.email=m),required:""},null,8,["modelValue"]),X6]),f("div",Z6,[x(d,{name:"signin-password",placeholder:"Enter Password","data-testid":"signin-password",modelValue:o(i).sign_in_items.password,"onUpdate:modelValue":s[4]||(s[4]=m=>o(i).sign_in_items.password=m),class:"w-full",inputClass:"w-full",feedback:!1,toggleMask:"",id:"password",pt:{root:{required:""},showicon:{"data-testid":"signin-password_eye"}}},null,8,["modelValue"]),J6])])):A("",!0),o(i).sign_in_items.type==="otp"?(_(),O("div",e8,[f("div",t8,[f("div",n8,[f("div",i8,[x(u,{name:"signin-email",placeholder:"Enter Username or Email","data-testid":"signin-email",id:"email",type:"text",modelValue:o(i).sign_in_items.email,"onUpdate:modelValue":s[5]||(s[5]=m=>o(i).sign_in_items.email=m),required:""},null,8,["modelValue"]),s8]),x(l,{name:"signin-generate_otp_btn","data-testid":"signin-generate_otp_btn",label:"Generate OTP",class:"p-button-sm",loading:o(i).is_otp_btn_loading,onClick:s[6]||(s[6]=m=>o(i).generateOTP())},null,8,["loading"])]),f("div",r8,[x(u,{name:"signin-otp",placeholder:"Enter OTP","data-testid":"signin-otp",type:"number",class:"w-full",id:"otp",modelValue:o(i).sign_in_items.login_otp,"onUpdate:modelValue":s[7]||(s[7]=m=>o(i).sign_in_items.login_otp=m),required:""},null,8,["modelValue"]),o8])])])):A("",!0),f("div",a8,[f("div",null,[o(i)&&o(i).no_of_login_attempt===o(i).max_attempts_of_login?ce((_(),$(l,{key:0,name:"signin-sign_in_btn","data-testid":"signin-sign_in_btn",label:"Sign In",class:"p-button-sm p-button-danger"},null,512)),[[h,"You have tried maximum attempts",void 0,{top:!0}]]):(_(),$(l,{key:1,name:"signin-sign_in_btn","data-testid":"signin-sign_in_btn",label:"Sign In",class:"p-button-sm",loading:o(i).is_btn_loading,onClick:s[8]||(s[8]=m=>o(i).signIn())},null,8,["loading"]))]),x(p,{to:"/forgot-password"},{default:T(()=>[x(l,{name:"signin-forgot_password_btn","data-testid":"signin-forgot_password_btn",label:"Forgot Password?",class:"p-button-text p-button-sm"})]),_:1})])])]))])]),footer:T(()=>[x(Di)]),_:1})])):A("",!0)])])])):A("",!0)}}},u8={key:0},c8={class:"grid flex justify-content-center flex-wrap"},d8={class:"col-5 flex align-items-center justify-content-center"},p8={key:0},h8={class:"content text-center"},f8=f("h4",{class:"text-xl font-semibold line-height-2 mb-2"},"Welcome",-1),m8=f("p",{class:"text-sm text-gray-600 font-semibold"},"Please Sign up to continue",-1),g8={class:"flex flex-column align-items-center gap-3"},v8={class:"p-inputgroup w-full gap-3 flex flex-column"},y8=f("div",{class:"required-field hidden"},null,-1),_8={class:"w-full gap-3 flex flex-column"},b8={class:"p-inputgroup w-full gap-3 flex flex-column"},w8=f("div",{class:"required-field hidden"},null,-1),C8={class:"p-inputgroup w-full gap-3 flex flex-column"},S8=f("div",{class:"required-field hidden"},null,-1),k8={class:"p-inputgroup w-full gap-3 flex flex-column"},x8=f("div",{class:"required-field hidden"},null,-1),I8={class:"p-inputgroup w-full gap-3 flex flex-column"},L8=f("div",{class:"required-field hidden"},null,-1),P8={class:"w-full flex justify-content-between align-items-center"},O8={__name:"Signup",setup(n){const t=je(),i=wa(),r=Ge();return Te(async()=>{document.title="Sign Up",t.showResponse(r.query),i.verifyInstallStatus(),await t.getAssets(),await t.checkSignupPageVisible()}),(a,s)=>{const u=R("InputText"),l=R("Password"),c=R("Button"),d=R("router-link"),p=R("Card");return o(t).assets&&o(i).is_installation_verified?(_(),O("div",u8,[f("div",c8,[f("div",d8,[o(t).assets?(_(),O("div",p8,[x(p,{style:{width:"28rem","max-width":"100vw","margin-bottom":"2em"},class:"m-auto"},{title:T(()=>[f("div",h8,[x($r),f8,m8])]),content:T(()=>[f("div",g8,[f("div",v8,[x(u,{name:"signup-name",placeholder:"Enter First Name","data-testid":"signup-name",id:"name",class:"w-full",type:"text",modelValue:o(i).sign_up_items.first_name,"onUpdate:modelValue":s[0]||(s[0]=v=>o(i).sign_up_items.first_name=v),required:""},null,8,["modelValue"]),y8]),f("div",_8,[x(u,{name:"signup-last_name",placeholder:"Enter Last Name","data-testid":"signup-last_name",id:"last_name",class:"w-full",type:"text",modelValue:o(i).sign_up_items.last_name,"onUpdate:modelValue":s[1]||(s[1]=v=>o(i).sign_up_items.last_name=v)},null,8,["modelValue"])]),f("div",b8,[x(u,{name:"signup-username",placeholder:"Enter Username","data-testid":"signup-username",id:"username",class:"w-full",type:"text",modelValue:o(i).sign_up_items.username,"onUpdate:modelValue":s[2]||(s[2]=v=>o(i).sign_up_items.username=v),required:""},null,8,["modelValue"]),w8]),f("div",C8,[x(u,{name:"signup-email",placeholder:"Enter Email","data-testid":"signup-email",id:"email",class:"w-full",type:"email",modelValue:o(i).sign_up_items.email,"onUpdate:modelValue":s[3]||(s[3]=v=>o(i).sign_up_items.email=v),required:""},null,8,["modelValue"]),S8]),f("div",k8,[x(l,{name:"signup-password",placeholder:"Enter Password","data-testid":"signup-password",id:"password",class:"w-full",inputClass:"w-full",feedback:!1,toggleMask:"",modelValue:o(i).sign_up_items.password,"onUpdate:modelValue":s[4]||(s[4]=v=>o(i).sign_up_items.password=v),pt:{root:{required:""}}},null,8,["modelValue"]),x8]),f("div",I8,[x(l,{name:"signup-confirm_password",placeholder:"Enter Confirm Password","data-testid":"signup-confirm_password",id:"confirm_password",class:"w-full",inputClass:"w-full",feedback:!1,toggleMask:"",modelValue:o(i).sign_up_items.confirm_password,"onUpdate:modelValue":s[5]||(s[5]=v=>o(i).sign_up_items.confirm_password=v),pt:{root:{required:""}}},null,8,["modelValue"]),L8]),f("div",P8,[x(d,{to:"/signup"},{default:T(()=>[x(c,{name:"signup","data-testid":"signup",label:"Submit",class:"p-button-sm",loading:o(i).is_btn_loading,onClick:s[6]||(s[6]=v=>o(i).signUp())},null,8,["loading"])]),_:1}),x(d,{to:"/"},{default:T(()=>[x(c,{class:"p-button-text p-button-sm",name:"signin","data-testid":"signin",label:"Sign In"})]),_:1})])])]),footer:T(()=>[x(Di)]),_:1})])):A("",!0)])])])):A("",!0)}}};let nf=document.getElementsByTagName("base")[0].getAttribute("href"),sf=nf+"/setup",E8=sf+"/json";const ls=Ot({id:"setup",state:()=>({assets:null,assets_is_fetching:!0,base_url:nf,ajax_url:sf,json_url:E8,filtered_country_codes:[],advanced_option_menu_list:[],is_btn_loading_mail_config:!1,is_btn_loading_db_connection:!1,is_modal_test_mail_active:!1,is_btn_loading_config:!1,is_btn_loading_dependency:!1,btn_is_migration:!1,status:null,route:null,gutter:20,active_dependency:null,debug_option:[{name:"True",slug:"true"},{name:"False",slug:"false"}],config:{active_step:0,is_migrated:!1,dependencies:null,count_total_dependencies:0,count_installed_dependencies:0,count_installed_progress:0,is_account_created:!1,btn_is_account_creating:!1,account:{email:null,username:null,password:null,first_name:null,middle_name:null,last_name:null,country_calling_code:null,country_calling_code_object:null,phone:null},env:{app_name:"VaahCMS",app_key:null,app_debug:"true",app_env:null,app_env_custom:null,app_url:null,app_timezone:null,db_connection:"mysql",db_host:"127.0.0.1",db_port:3306,db_database:null,db_username:null,db_password:null,db_is_valid:!1,mail_provider:null,mail_driver:null,mail_host:null,mail_port:null,mail_username:null,mail_password:null,mail_encryption:null,mail_from_address:null,mail_from_name:null,mail_is_valid:!1,test_email_to:null},data_testid_app_env:{"data-testid":"configuration-env"},data_testid_debug:{"data-testid":"configuration-debug"},data_testid_timezone:{"data-testid":"configuration-timezone"},data_testid_db_type:{"data-testid":"configuration-db_type"},data_testid_db_password:{"data-testid":"configuration-db_password",autocomplete:"new-password"},data_testid_mail_provider:{"data-testid":"configuration-mail_provider"},data_testid_mail_password:{"data-testid":"configuration-mail_password"},data_testid_mail_encryption:{"data-testid":"configuration-mail_encryption"}},install_items:[{label:"Configuration",icon:"pi pi-fw pi-cog",to:"/setup/install/configuration"},{label:"Migrate",icon:"pi pi-fw pi-database",to:"/setup/install/migrate"},{label:"Dependencies",icon:"pi pi-fw pi-server",to:"/setup/install/dependencies"},{label:"Account",icon:"pi pi-fw pi-user-plus",to:"/setup/install/account"}],show_progress_bar:!1,show_reset_modal:!1,reset_inputs:{confirm:null,delete_dependencies:null,delete_media:null},reset_confirm:null,autocomplete_on_focus:!0}),getters:{},actions:{async getAssets(n=null){if(n&&(this.route=n,this.assets_is_fetching=!0),this.assets_is_fetching===!0){this.assets_is_fetching=!1;let t={};B().ajax(this.json_url+"/assets",this.afterGetAssets,t)}},afterGetAssets(n,t){n&&(this.assets=n,this.route&&this.route.name==="setup.install.migrate"&&!this.assets.env_file&&(this.assets_is_fetching=!0,this.getAssets()),this.config.env.app_url=this.assets.app_url)},async getStatus(){let n={};B().ajax(this.json_url+"/status",this.afterGetStatus,n)},afterGetStatus(n,t){n&&(this.status=n)},async getRequiredConfigurations(){let n={method:"post"};B().ajax(this.ajax_url+"/required/configurations",this.getRequiredConfigurationsAfter,n)},getRequiredConfigurationsAfter(n,t){n&&(this.config.env.app_key=n.app_key,this.config.env.vaahcms_vue_app=n.vaahcms_vue_app)},publishAssets(){this.showProgress();let n={};B().ajax(this.ajax_url+"/publish/assets",this.afterPublishAssets,n)},afterPublishAssets(n,t){this.hideProgress()},clearCache:function(){this.showProgress();let n={};B().ajax(this.ajax_url+"/clear/cache",this.afterClearCache,n)},afterClearCache:function(n,t){this.hideProgress()},confirmReset:function(){this.reset_confirm=!0,this.showProgress();let n={params:this.reset_inputs,method:"post"};B().ajax(this.ajax_url+"/reset/confirm",this.afterConfirmReset,n)},async afterConfirmReset(n,t){this.reset_confirm=!1,n&&location.reload(!0)},loadConfigurations:function(){if(this.config.env.app_env!=="custom"){this.config.env.app_env_custom="";let n={params:this.config.env,method:"post"};B().ajax(this.ajax_url+"/get/configurations",this.afterLoadConfigurations,n)}},afterLoadConfigurations:function(n,t){if(n){this.config.env.db_password=null;for(let i in this.config.env)n[i]&&(this.config.env[i]=n[i])}},testDatabaseConnection(){this.is_btn_loading_db_connection=!0,this.config.env.db_is_valid=!1,this.showProgress();let n={params:this.config.env,method:"post"};B().ajax(this.ajax_url+"/test/database/connection",this.afterTestDatabaseConnection,n)},afterTestDatabaseConnection(n,t){this.is_btn_loading_db_connection=!1,n&&!t.data.errors&&(this.config.env.db_is_valid=!0)},testMailConfiguration:function(){this.is_btn_loading_mail_config=!0,this.config.env.mail_is_valid=!1,this.showProgress();let n={params:this.config.env,method:"post"};B().ajax(this.ajax_url+"/test/mail/configuration",this.afterTestMailConfiguration,n)},afterTestMailConfiguration:function(n,t){this.is_btn_loading_mail_config=!1,n&&!t.data.errors&&(this.config.env.mail_is_valid=!0)},setMailConfigurations:function(){if(console.log(222,this.config.env.mail_provider),this.config.env.mail_provider!="other"){let n=B().findInArrayByKey(this.assets.mail_sample_settings,"slug",this.config.env.mail_provider);if(n)for(let t in n.settings)this.config.env[t]=n.settings[t]}else this.config.env.mail_driver=null,this.config.env.mail_host=null,this.config.env.mail_port=null,this.config.env.mail_encryption=null},validateConfigurations:function(){this.is_btn_loading_config=!0;let n={params:this.config.env,method:"post"};B().ajax(this.ajax_url+"/test/configurations",this.afterValidateConfigurations,n)},afterValidateConfigurations:function(n,t){n&&(this.config.active_step=1,this.$router.push({name:"setup.install.migrate"})),this.is_btn_loading_config=!1},runMigrations:function(){this.btn_is_migration=!0,this.config.is_migrated=!1;let n={method:"post"};B().ajax(this.ajax_url+"/run/migrations",this.afterRunMigrations,n)},afterRunMigrations:function(n,t){this.btn_is_migration=!1,n&&(this.config.is_migrated=!0,this.getStatus())},validateMigration:function(){if(this.status&&!this.status.is_db_migrated)return B().toastErrors(["Click on Migrate & Run Seeds button"]),!1;this.$router.push({name:"setup.install.dependencies"})},getDependencies:function(){let n={};B().ajax(this.ajax_url+"/get/dependencies",this.afterGetDependencies,n)},afterGetDependencies:function(n,t){n&&(this.config.dependencies=n.list,this.config.count_total_dependencies=n.list.length)},generateUsername(){let n=this.config.account.email.split("@");n[0]&&(this.config.account.username=n[0])},createAccount:function(){this.config.btn_is_account_creating=!0,this.config.env.db_is_valid=!1;let n={params:this.config.account,method:"post"};B().ajax(this.ajax_url+"/store/admin",this.createAccountAfter,n)},createAccountAfter:function(n,t){this.config.btn_is_account_creating=!1,n&&(this.config.is_account_created=!0,this.config.env.db_is_valid=!0)},validateAccountCreation:function(){this.config.is_account_created?(this.resetConfig(),this.$router.push({name:"sign.in"})):B().toastErrors(["Create the Super Administrator Account"])},getAdvancedOptionMenu:function(){this.advanced_option_menu_list=[{label:"Publish assets",command:()=>{this.publishAssets()}},{label:"Clear Cache",command:()=>{this.clearCache()}}]},resetConfig(){this.config={active_step:0,is_migrated:!1,dependencies:null,count_total_dependencies:0,count_installed_dependencies:0,count_installed_progress:0,is_account_created:!1,account:{email:null,username:null,password:null,first_name:null,middle_name:null,last_name:null,country_calling_code:null,country_calling_code_object:null,phone:null},env:{app_name:"VaahCMS",app_key:null,app_debug:"true",app_env:null,app_url:null,app_timezone:null,db_connection:"mysql",db_host:"127.0.0.1",db_port:3306,db_database:null,db_username:null,db_password:null,db_is_valid:!1,mail_provider:null,mail_driver:null,mail_host:null,mail_port:null,mail_username:null,mail_password:null,mail_encryption:null,mail_from_address:null,mail_from_name:null,mail_is_valid:!1,test_email_to:null}}},searchCountryCode:function(n){this.autocomplete_on_focus=!0,this.country_calling_code_object=null,this.country_calling_code=null,setTimeout(()=>{n.query.trim().length?this.filtered_country_codes=this.assets.country_calling_codes.filter(t=>t.name.toLowerCase().startsWith(n.query.toLowerCase())):this.filtered_country_codes=this.assets.country_calling_codes},250)},onSelectCountryCode:function(n){this.config.account.country_calling_code=n.value.slug},validateDependencies:function(n){if(this.config.count_installed_progress!=100)return B().toastErrors(["Dependencies are not installed."]),!1;this.$router.push({name:"setup.install.account"})},skipDependencies:function(){this.config.count_installed_progress=100},async installDependencies(){let n,t;if(this.config.count_installed_dependencies=0,this.config.count_installed_progress=0,this.config.dependencies){this.is_btn_loading_dependency=!0;let i=this.config.dependencies;for(n in i)t=i[n],await this.installDependency(t);this.is_btn_loading_dependency=!1}},async installDependency(n){this.active_dependency=n;let t={params:{name:this.active_dependency.name,slug:this.active_dependency.slug,type:this.active_dependency.type,source:this.active_dependency.source,download_link:this.active_dependency.download_link,import_sample_data:this.active_dependency.import_sample_data},method:"post"};await B().ajax(this.ajax_url+"/install/dependencies",this.afterInstallDependency,t)},afterInstallDependency:function(n,t){if(n&&(console.log("--->this.active_dependency",this.active_dependency),this.active_dependency)){this.active_dependency.installed=!0,B().updateArray(this.config.dependencies,this.active_dependency),this.config.count_installed_dependencies=this.config.count_installed_dependencies+1;let i=this.config.count_installed_dependencies/this.config.count_total_dependencies;i=Math.round(i*100),this.config.count_installed_progress=i,this.active_dependency=null}},routeAction(n){this.$router.push({name:n})},async to(n){this.$router.push({path:n})},showProgress(){this.show_progress_bar=!0},hideProgress(){this.show_progress_bar=!1},showCallingCodes(n){this.autocomplete_on_focus=!0},setFocusDropDownToTrue(){this.autocomplete_on_focus=!0}}}),A8={key:0,class:"setup text-center"},T8={class:"grid justify-content-center"},R8={key:0,class:"col-12"},D8={class:"col-6"},M8={class:"flex justify-content-between align-items-center"},$8=f("h4",{class:"text-xl font-semi-bold"},"Install",-1),V8={class:"icons flex"},B8={key:0,class:"m-1"},q8={key:1,class:"m-1"},F8={class:"m-1"},j8={href:"https://docs.vaah.dev/vaahcms/installation.html",target:"_blank"},U8=f("p",{class:"text-left"},[f("a",{href:"https://vaah.dev/cms",target:"_blank"},"VaahCMS "),ue(" is a web application development platform shipped with headless content management system ")],-1),N8={key:0,class:"flex justify-content-between align-items-center"},H8={class:"col-6"},K8={class:"flex justify-content-between align-items-center"},z8=f("h4",{class:"text-xl font-semi-bold"},"Reset",-1),W8={class:"icons flex"},G8={class:"m-1"},Y8=f("p",{class:"text-left"},` You can reset/re-install the application if you're logged in from "Administrator" account. `,-1),Q8={key:0,class:"flex justify-content-between align-items-center"},X8=f("p",null,[ue("You are going to "),f("b",null,"RESET"),ue(" the application. This will remove all the data of the application.")],-1),Z8=f("p",null,[ue("After reset you "),f("b",null,"CANNOT"),ue(" be restored data! Are you "),f("b",null,"ABSOLUTELY"),ue(" sure?")],-1),J8=f("div",null,[f("p",null,"This action can lead to data loss. To prevent accidental actions we ask you to confirm your intention."),f("p",{class:"has-margin-bottom-5"},[ue(" Please type "),f("b",null,"RESET"),ue(" to proceed and click Confirm button or close this modal to cancel. ")])],-1),e4={key:0,class:"mt-2"},t4={class:"field-checkbox"},n4=f("label",null," Delete Files From Storage (storage/app/public) ",-1),i4={class:"field-checkbox"},s4=f("label",null," Delete Dependencies (Modules & Themes) ",-1),r4={__name:"Index",setup(n){const t=ls(),i=je();return Te(async()=>{document.title="Setup",await t.getAssets(),await t.getStatus(),await t.getAdvancedOptionMenu()}),(r,a)=>{const s=R("Message"),u=R("Button"),l=R("SplitButton"),c=R("Card"),d=R("InputText"),p=R("Checkbox"),v=R("Dialog"),h=Ke("tooltip");return o(t)&&o(t).assets&&o(i)&&o(i).assets?(_(),O("div",A8,[x($r,{class:"w-6 mx-auto"}),f("div",T8,[o(t).assets.is_installed?(_(),O("div",R8,[x(s,{severity:"success"},{default:T(()=>[ue("VaahCMS is successfully setup")]),_:1})])):A("",!0),f("div",D8,[x(c,{class:"border-round-xl"},{title:T(()=>[f("div",M8,[$8,f("div",V8,[o(i).assets.auth_user?(_(),O("div",B8,[f("a",{onClick:a[0]||(a[0]=m=>r.$router.push({name:"dashboard"}))},[ce(x(u,{class:"bg-gray-200 active:text-black p-2 p-button-rounded p-button-outlined","data-testid":"setup-dashboard_button",icon:" pi pi-server"},null,512),[[h,"Dashboard",void 0,{top:!0}]])])])):o(t).assets.is_installed?(_(),O("div",q8,[f("a",{onClick:a[1]||(a[1]=m=>r.$router.push({name:"sign.in"}))},[ce(x(u,{class:"bg-gray-200 active:text-black p-2 p-button-rounded p-button-outlined","data-testid":"setup-signin_button",icon:"pi pi-sign-in"},null,512),[[h,"Sign In",void 0,{top:!0}]])])])):A("",!0),f("div",F8,[f("a",j8,[ce(x(u,{class:"bg-gray-200 active:text-black p-2 p-button-rounded p-button-outlined","data-testid":"setup-documentation_button",icon:" pi pi-book"},null,512),[[h,"Documentation",void 0,{top:!0}]])])])])])]),content:T(()=>[U8]),footer:T(()=>[o(t).status?(_(),O("div",N8,[o(t).status.stage&&o(t).status.stage==="installed"?(_(),$(u,{key:0,disabled:"",label:"Install",icon:"pi pi-server",class:"p-button p-button-sm bg-white border-gray-800 text-black-alpha-80"})):(_(),$(u,{key:1,label:"Install",icon:"pi pi-server",onClick:a[2]||(a[2]=m=>o(t).routeAction("setup.install.configuration")),class:"p-button bg-white border-gray-800 text-black-alpha-80","data-testid":"setup-install_vaahcms"})),x(l,{label:"Advanced Options",model:o(t).advanced_option_menu_list,class:"p-button-sm"},null,8,["model"])])):A("",!0)]),_:1})]),f("div",H8,[x(c,{class:"h-full border-round-xl"},{title:T(()=>[f("div",K8,[z8,f("div",W8,[f("div",G8,[ce(x(u,{class:"bg-gray-200 p-2 p-button-rounded p-button-outlined",icon:"pi pi-refresh",onClick:a[3]||(a[3]=m=>o(t).getStatus())},null,512),[[h,"Refresh",void 0,{top:!0}]])])])])]),content:T(()=>[Y8]),footer:T(()=>[o(t).status?(_(),O("div",Q8,[o(t).status.is_user_administrator?(_(),$(u,{key:0,onClick:a[4]||(a[4]=m=>o(t).show_reset_modal=!0),label:"Reset",icon:"pi pi-refresh",class:"p-button-danger"})):(_(),$(u,{key:1,label:"Reset",icon:"pi pi-refresh",class:"p-button-danger",disabled:""}))])):A("",!0)]),_:1})])]),x(Di,{class:"mt-3"}),x(v,{header:"Reset",visible:o(t).show_reset_modal,"onUpdate:visible":a[10]||(a[10]=m=>o(t).show_reset_modal=m),breakpoints:{"960px":"75vw","640px":"90vw"},style:{width:"50vw"}},{footer:T(()=>[x(u,{label:"No",icon:"pi pi-times",onClick:a[8]||(a[8]=m=>o(t).show_reset_modal=!1),class:"p-button-text"}),x(u,{class:"p-button-danger",label:"Confirm",icon:"pi pi-check",loading:o(t).reset_confirm,onClick:a[9]||(a[9]=m=>o(t).confirmReset()),autofocus:""},null,8,["loading"])]),default:T(()=>[x(s,{severity:"error",icon:"null",closable:!1},{default:T(()=>[X8,Z8]),_:1}),J8,x(d,{modelValue:o(t).reset_inputs.confirm,"onUpdate:modelValue":a[5]||(a[5]=m=>o(t).reset_inputs.confirm=m),placeholder:"Type RESET to Confirm",class:"p-inputtext-md",required:""},null,8,["modelValue"]),o(t).reset_inputs.confirm==="RESET"?(_(),O("div",e4,[f("div",t4,[x(p,{inputId:"delete_media",modelValue:o(t).reset_inputs.delete_media,"onUpdate:modelValue":a[6]||(a[6]=m=>o(t).reset_inputs.delete_media=m),value:"true"},null,8,["modelValue"]),n4]),f("div",i4,[x(p,{inputId:"delete_dependencies",modelValue:o(t).reset_inputs.delete_dependencies,"onUpdate:modelValue":a[7]||(a[7]=m=>o(t).reset_inputs.delete_dependencies=m),value:"true"},null,8,["modelValue"]),s4])])):A("",!0)]),_:1},8,["visible"])])):A("",!0)}}},o4={key:0,class:""},a4={class:"text-center mb-4"},l4=["src"],u4=f("h4",{class:"text-xl font-semibold"},"Install VaahCMS",-1),c4={class:"container vh-step relative"},d4={class:"step-label"},p4=f("span",{class:"font-medium"},"ACTIVE ENV FILE: ",-1),h4={class:"ml-1"},f4={__name:"Index",setup(n){const t=ls(),i=je();return Ge(),Te(async()=>{await t.getAssets(),await t.getStatus()}),(r,a)=>{const s=R("router-link"),u=R("Steps"),l=R("Tag"),c=R("router-view");return o(t)&&o(t).assets&&o(i)&&o(i).assets?(_(),O("div",o4,[f("div",a4,[o(i).assets.backend_logo_url?(_(),O("img",{key:0,src:o(i).assets.backend_logo_url,alt:"",class:"mb-2 mx-auto h-3rem"},null,8,l4)):A("",!0),u4]),f("div",c4,[x(u,{model:o(t).install_items,class:"my-4"},{item:T(({item:d,index:p})=>[x(s,{to:d.to,class:"flex align-items-center font-medium"},{default:T(()=>[f("i",{class:he([d.icon,"step-icon"])},null,2),f("span",d4,"\xA0"+Q(p+1)+". "+Q(d.label),1)]),_:2},1032,["to"])]),_:1},8,["model"]),o(t).assets.env_file?(_(),$(l,{key:0,class:"vh-env-tag bg-black-alpha-70 m-auto is-small absolute",pt:{root:{"data-testid":"setup-use_env"}}},{default:T(()=>[p4,f("b",h4,Q(o(t).assets.env_file),1)]),_:1})):A("",!0),x(c),x(Di,{class:"mt-3"})])])):A("",!0)}}},m4={key:0,class:"container"},g4={class:"p-card"},v4={class:"p-card-content p-4 border-round-xl"},y4=f("h5",{class:"text-left p-1 title is-6"},"App URL",-1),_4={class:"grid p-fluid"},b4={class:"col-12"},w4={class:"p-input"},C4=f("div",{class:"required-field hidden"},null,-1),S4={class:"grid p-fluid"},k4={class:"col-12 md:col-4"},x4=f("h5",{class:"text-left p-1 title is-6"},"ENV",-1),I4={class:"p-inputgroup"},L4=f("div",{class:"required-field hidden"},null,-1),P4=f("div",{class:"required-field hidden"},null,-1),O4={class:"col-12 md:col-4"},E4=f("h5",{class:"text-left p-1 title is-6"},"Debug",-1),A4={class:"p-inputgroup"},T4=f("div",{class:"required-field hidden"},null,-1),R4={class:"col-12 md:col-4"},D4=f("h5",{class:"text-left p-1 title is-6"},"Timezone",-1),M4={class:"p-inputgroup"},$4=f("div",{class:"required-field hidden"},null,-1),V4={class:"grid p-fluid"},B4={class:"col-12"},q4=f("h5",{class:"text-left p-1 title is-6"},"App/Website Name",-1),F4={class:"p-input"},j4=f("div",{class:"required-field hidden"},null,-1),U4={class:"grid p-fluid"},N4={class:"col-12 md:col-4"},H4=f("h5",{class:"text-left p-1 title is-6"},"Database Type",-1),K4={class:"p-inputgroup"},z4=f("div",{class:"required-field hidden"},null,-1),W4={class:"col-12 md:col-4"},G4=f("h5",{class:"text-left p-1 title is-6"},"Database Host",-1),Y4={class:"p-inputgroup"},Q4=f("div",{class:"required-field hidden"},null,-1),X4={class:"col-12 md:col-4"},Z4=f("h5",{class:"text-left p-1 title is-6"},"Database Port",-1),J4={class:"p-inputgroup"},eI=f("div",{class:"required-field hidden"},null,-1),tI={class:"grid p-fluid"},nI={class:"col-12 md:col-4"},iI=f("h5",{class:"text-left p-1 title is-6"},"Database Name",-1),sI={class:"p-inputgroup"},rI=f("div",{class:"required-field hidden"},null,-1),oI={class:"col-12 md:col-4"},aI=f("h5",{class:"text-left p-1 title is-6"},"Database Username",-1),lI={class:"p-inputgroup"},uI=f("div",{class:"required-field hidden"},null,-1),cI={class:"col-12 md:col-4"},dI=f("h5",{class:"text-left p-1 title is-6"},"Database Password",-1),pI={class:"p-inputgroup"},hI={class:"grid p-fluid"},fI={class:"col-12 md:col-4"},mI=f("h5",{class:"text-left p-1 title is-6"},"Mail Provider",-1),gI={class:"p-inputgroup"},vI={class:"col-12 md:col-4"},yI=f("h5",{class:"text-left p-1 title is-6"},"Mail Driver",-1),_I={class:"p-inputgroup"},bI={class:"col-12 md:col-4"},wI=f("h5",{class:"text-left p-1 title is-6"},"Mail Host",-1),CI={class:"p-inputgroup"},SI={class:"grid p-fluid"},kI={class:"col-12 md:col-4"},xI=f("h5",{class:"text-left p-1 title is-6"},"Mail Port",-1),II={class:"p-inputgroup"},LI={class:"col-12 md:col-4"},PI=f("h5",{class:"text-left p-1 title is-6"},"Mail Username",-1),OI={class:"p-inputgroup"},EI={class:"col-12 md:col-4"},AI=f("h5",{class:"text-left p-1 title is-6"},"Mail Password",-1),TI={class:"p-inputgroup"},RI={class:"grid p-fluid"},DI={class:"col-12 md:col-4"},MI=f("h5",{class:"text-left p-1 title is-6"},"Mail Encryption",-1),$I={class:"p-inputgroup"},VI={class:"col-12 md:col-4"},BI=f("h5",{class:"text-left p-1 title is-6"},"From Name",-1),qI={class:"p-inputgroup"},FI=f("div",{class:"required-field hidden"},null,-1),jI={class:"col-12 md:col-4"},UI=f("h5",{class:"text-left p-1 title is-6"},"From Email",-1),NI={class:"p-inputgroup"},HI=f("div",{class:"required-field hidden"},null,-1),KI={class:""},zI={class:"col-12"},WI=f("h5",{class:"text-left p-1 pt-0 title is-6"},"Mail Username",-1),GI={class:"p-inputgroup flex-1"},YI={class:"grid p-fluid"},QI={class:"col-12"},XI={class:"flex justify-content-end gap-2"},ZI=f("p",{class:"text-xs"},"Test Database connection for next step",-1),JI={__name:"Configuration",setup(n){const t=ls(),i=je();return Te(async()=>{document.title="Configuration - Setup",t.config.env.app_timezone=i.assets.timezone,await t.getAssets(),await t.getRequiredConfigurations()}),(r,a)=>{const s=R("InputText"),u=R("Dropdown"),l=R("Password"),c=R("Button"),d=R("OverlayPanel");return o(t).assets?(_(),O("div",m4,[f("div",g4,[f("div",v4,[y4,f("div",_4,[f("div",b4,[f("div",w4,[x(s,{modelValue:o(t).config.env.app_url,"onUpdate:modelValue":a[0]||(a[0]=p=>o(t).config.env.app_url=p),disabled:"",placeholder:"App URL",class:"p-inputtext-sm",id:"app-url","data-testid":"configuration-app_url",required:""},null,8,["modelValue"]),C4])])]),f("div",S4,[f("div",k4,[x4,f("div",I4,[x(u,{modelValue:o(t).config.env.app_env,"onUpdate:modelValue":a[1]||(a[1]=p=>o(t).config.env.app_env=p),options:o(t).assets.environments,onChange:a[2]||(a[2]=p=>o(t).loadConfigurations()),optionLabel:"name",optionValue:"slug",placeholder:"Select Env",class:"is-small",inputProps:o(t).config.data_testid_app_env,required:""},null,8,["modelValue","options","inputProps"]),L4]),o(t).config.env.app_env=="custom"?(_(),$(s,{key:0,modelValue:o(t).config.env.app_env_custom,"onUpdate:modelValue":a[3]||(a[3]=p=>o(t).config.env.app_env_custom=p),placeholder:"Env File Name",class:"is-small",id:"app-env-custom","data-testid":"configuration-custom_evn",required:""},null,8,["modelValue"])):A("",!0),P4]),f("div",O4,[E4,f("div",A4,[x(u,{modelValue:o(t).config.env.app_debug,"onUpdate:modelValue":a[4]||(a[4]=p=>o(t).config.env.app_debug=p),name:"config-db_connection",options:o(t).debug_option,optionLabel:"name",optionValue:"slug",placeholder:"Select Debug",class:"is-small",inputProps:o(t).config.data_testid_debug,required:""},null,8,["modelValue","options","inputProps"]),T4])]),f("div",R4,[D4,f("div",M4,[x(u,{modelValue:o(t).config.env.app_timezone,"onUpdate:modelValue":a[5]||(a[5]=p=>o(t).config.env.app_timezone=p),options:o(t).assets.timezones,optionLabel:"name",optionValue:"slug",filter:!0,placeholder:"Select Timezone",class:"is-small",inputProps:o(t).config.data_testid_timezone,required:""},null,8,["modelValue","options","inputProps"]),$4])])]),f("div",V4,[f("div",B4,[q4,f("div",F4,[x(s,{modelValue:o(t).config.env.app_name,"onUpdate:modelValue":a[6]||(a[6]=p=>o(t).config.env.app_name=p),placeholder:"App/Website Name",name:"config-app_name",class:"p-inputtext-sm",id:"app-name","data-testid":"configuration-app_name",required:""},null,8,["modelValue"]),j4])])]),f("div",U4,[f("div",N4,[H4,f("div",K4,[x(u,{modelValue:o(t).config.env.db_connection,"onUpdate:modelValue":a[7]||(a[7]=p=>o(t).config.env.db_connection=p),options:o(t).assets.database_types,name:"config-db_connection",optionLabel:"name",optionValue:"slug",placeholder:"Database Type",class:"is-small",inputProps:o(t).config.data_testid_db_type,required:""},null,8,["modelValue","options","inputProps"]),z4])]),f("div",W4,[G4,f("div",Y4,[x(s,{modelValue:o(t).config.env.db_host,"onUpdate:modelValue":a[8]||(a[8]=p=>o(t).config.env.db_host=p),name:"config-db_host",placeholder:"Database Host",class:"p-inputtext-sm","data-testid":"configuration-db_host",required:""},null,8,["modelValue"]),Q4])]),f("div",X4,[Z4,f("div",J4,[x(s,{modelValue:o(t).config.env.db_port,"onUpdate:modelValue":a[9]||(a[9]=p=>o(t).config.env.db_port=p),name:"config-db_port",placeholder:"Database Port",class:"p-inputtext-sm","data-testid":"configuration-db_port",required:""},null,8,["modelValue"]),eI])])]),f("div",tI,[f("div",nI,[iI,f("div",sI,[x(s,{modelValue:o(t).config.env.db_database,"onUpdate:modelValue":a[10]||(a[10]=p=>o(t).config.env.db_database=p),placeholder:"Database Name",name:"config-db_database",class:"p-inputtext-sm","data-testid":"configuration-db_name",required:""},null,8,["modelValue"]),rI])]),f("div",oI,[aI,f("div",lI,[x(s,{modelValue:o(t).config.env.db_username,"onUpdate:modelValue":a[11]||(a[11]=p=>o(t).config.env.db_username=p),placeholder:"Database Username",name:"config-db_username",class:"p-inputtext-sm","data-testid":"configuration-db_username",required:""},null,8,["modelValue"]),uI])]),f("div",cI,[dI,f("div",pI,[x(l,{modelValue:o(t).config.env.db_password,"onUpdate:modelValue":a[12]||(a[12]=p=>o(t).config.env.db_password=p),feedback:!1,toggleMask:"",inputProps:o(t).config.data_testid_db_password,name:"config-db_password","input-class":"w-full p-inputtext-sm",placeholder:"Database Password",pt:{showicon:{"data-testid":"configuration-db_password_eye"}}},null,8,["modelValue","inputProps"])])])]),o(t).config.env.db_is_valid?(_(),$(c,{key:0,onClick:a[13]||(a[13]=p=>o(t).testDatabaseConnection()),label:"Test Database connection",loading:o(t).is_btn_loading_db_connection,icon:"pi pi-check",class:"p-button-sm mt-2 mb-3",severity:"success","data-testid":"configuration-test_db_connection",pt:{label:{"data-testid":"configuration-test_db_connection_btn_text"}}},null,8,["loading"])):(_(),$(c,{key:1,onClick:a[14]||(a[14]=p=>o(t).testDatabaseConnection()),label:"Test Database connection",loading:o(t).is_btn_loading_db_connection,icon:"pi pi-database",class:"p-button-sm mt-2 mb-3",outlined:"","data-testid":"configuration-test_db_connection",pt:{label:{"data-testid":"configuration-test_db_connection_btn_text"}}},null,8,["loading"])),f("div",hI,[f("div",fI,[mI,f("div",gI,[x(u,{modelValue:o(t).config.env.mail_provider,"onUpdate:modelValue":a[15]||(a[15]=p=>o(t).config.env.mail_provider=p),options:o(t).assets.mail_sample_settings,onChange:a[16]||(a[16]=p=>o(t).setMailConfigurations()),optionLabel:"name",optionValue:"slug",placeholder:"Select Mail Provider",class:"is-small",inputProps:o(t).config.data_testid_mail_provider},null,8,["modelValue","options","inputProps"])])]),f("div",vI,[yI,f("div",_I,[x(s,{modelValue:o(t).config.env.mail_driver,"onUpdate:modelValue":a[17]||(a[17]=p=>o(t).config.env.mail_driver=p),placeholder:"Mail Driver",class:"p-inputtext-sm","data-testid":"configuration-mail_driver"},null,8,["modelValue"])])]),f("div",bI,[wI,f("div",CI,[x(s,{modelValue:o(t).config.env.mail_host,"onUpdate:modelValue":a[18]||(a[18]=p=>o(t).config.env.mail_host=p),placeholder:"Mail Host",class:"p-inputtext-sm","data-testid":"configuration-mail_host"},null,8,["modelValue"])])])]),f("div",SI,[f("div",kI,[xI,f("div",II,[x(s,{modelValue:o(t).config.env.mail_port,"onUpdate:modelValue":a[19]||(a[19]=p=>o(t).config.env.mail_port=p),placeholder:"Mail Port",class:"p-inputtext-sm","data-testid":"configuration-mail_port"},null,8,["modelValue"])])]),f("div",LI,[PI,f("div",OI,[x(s,{modelValue:o(t).config.env.mail_username,"onUpdate:modelValue":a[20]||(a[20]=p=>o(t).config.env.mail_username=p),placeholder:"Mail Username",class:"p-inputtext-sm","data-testid":"configuration-mail_username"},null,8,["modelValue"])])]),f("div",EI,[AI,f("div",TI,[x(l,{modelValue:o(t).config.env.mail_password,"onUpdate:modelValue":a[21]||(a[21]=p=>o(t).config.env.mail_password=p),feedback:!1,toggleMask:"","input-class":"w-full p-inputtext-sm",placeholder:"Mail Password",inputProps:o(t).config.data_testid_mail_password,pt:{showicon:{"data-testid":"configuration-mail_password_eye"}}},null,8,["modelValue","inputProps"])])])]),f("div",RI,[f("div",DI,[MI,f("div",$I,[x(u,{modelValue:o(t).config.env.mail_encryption,"onUpdate:modelValue":a[22]||(a[22]=p=>o(t).config.env.mail_encryption=p),options:o(t).assets.mail_encryption_types,optionLabel:"name",optionValue:"slug",placeholder:"Select Mail Encryption",class:"is-small",inputProps:o(t).config.data_testid_mail_encryption},null,8,["modelValue","options","inputProps"])])]),f("div",VI,[BI,f("div",qI,[x(s,{modelValue:o(t).config.env.mail_from_name,"onUpdate:modelValue":a[23]||(a[23]=p=>o(t).config.env.mail_from_name=p),placeholder:"From Name",class:"p-inputtext-sm","data-testid":"configuration-mail_from_name",required:""},null,8,["modelValue"]),FI])]),f("div",jI,[UI,f("div",NI,[x(s,{modelValue:o(t).config.env.mail_from_address,"onUpdate:modelValue":a[24]||(a[24]=p=>o(t).config.env.mail_from_address=p),type:"email",placeholder:"From Email",class:"p-inputtext-sm","data-testid":"configuration-mail_from_address",required:""},null,8,["modelValue"]),HI])])]),f("div",KI,[o(t).config.env.mail_is_valid?(_(),$(c,{key:0,onClick:a[25]||(a[25]=p=>r.$refs.op.toggle(p)),label:"Test Mail Configuration",icon:"pi pi-check",class:"p-button-sm mt-2 mb-3",severity:"success","data-testid":"configuration-test_mail",pt:{label:{"data-testid":"configuration-test_mail_btn_text"}}})):(_(),$(c,{key:1,onClick:a[26]||(a[26]=p=>r.$refs.op.toggle(p)),label:"Test Mail Configuration",icon:"pi pi-envelope",class:"p-button-sm mt-2 mb-3",outlined:"","data-testid":"configuration-test_mail",pt:{label:{"data-testid":"configuration-test_mail_btn_text"}}})),x(d,{ref:"op",appendTo:"body",showCloseIcon:!0,id:"overlay_panel",style:{width:"400px"},breakpoints:{"960px":"75vw"},pt:{root:{class:"shadow-1 mt-2"},closebutton:{"data-testid":"configuration-test_mail_close",style:{width:"1.5rem",height:"1.5rem",top:"-0.5rem",right:"-0.5rem"}},closeicon:{class:"w-5"},content:{class:"p-2"}}},{default:T(()=>[f("div",zI,[WI,f("div",GI,[x(s,{type:"email",modelValue:o(t).config.env.test_email_to,"onUpdate:modelValue":a[27]||(a[27]=p=>o(t).config.env.test_email_to=p),placeholder:"Your email",class:"","data-testid":"configuration-test_email_to"},null,8,["modelValue"]),x(c,{loading:o(t).is_btn_loading_mail_config,onClick:o(t).testMailConfiguration,label:"Send Email",class:"p-button-sm is-small","data-testid":"configuration-send_mail",pt:{label:{"data-testid":"configuration-send_mail_btn_text"}}},null,8,["loading","onClick"])])])]),_:1},512)]),f("div",YI,[f("div",QI,[f("div",XI,[ZI,x(c,{label:"Save & Next",loading:o(t).is_btn_loading_config,disabled:!o(t).config.env.db_is_valid,class:"p-button-sm w-auto",onClick:o(t).validateConfigurations,"data-testid":"configuration-save_btn",pt:{label:{"data-testid":"configuration-save_btn_text"}}},null,8,["loading","disabled","onClick"])])])])])])])):A("",!0)}}};const us=(n,t)=>{const i=n.__vccOpts||n;for(const[r,a]of t)i[r]=a;return i},eL=n=>(ya("data-v-8565f480"),n=n(),va(),n),tL={key:0,class:"pt-4"},nL={key:0,class:"grid"},iL={class:"col-12 md:col-6"},sL={class:"flex align-items-center justify-content-between"},rL={class:"font-semibold","data-testid":"dependencies-module_title"},oL={key:0,class:"pi pi-check bg-green-500 p-2 border-round-3xl",style:{"font-size":"12px"}},aL={key:1,class:"pi pi-download bg-gray-200 p-2 border-round-3xl",style:{"font-size":"12px"}},lL={class:"mb-3"},uL={class:"text-xs"},cL={class:"text-xs mb-3"},dL=["href"],pL={class:"field-checkbox mb-0"},hL=eL(()=>f("label",{for:"binary",class:"text-xs"},"Import Sample data",-1)),fL={class:"col-12"},mL={class:"my-3"},gL={class:"col-12"},vL={class:"flex justify-content-between"},yL={__name:"Dependencies",setup(n){const t=ls();return je(),Te(async()=>{document.title="Dependencies - Setup",await t.getAssets(),t.getDependencies()}),(i,r)=>{const a=R("Message"),s=R("Tag"),u=R("ProgressBar"),l=R("Checkbox"),c=R("Card"),d=R("Button");return o(t).assets?(_(),O("div",tL,[x(a,{severity:"info",class:"is-small",pt:{root:{class:"mt-0"},text:{"data-testid":"dependencies-message_text"},closebutton:{"data-testid":"dependencies-message_close_btn"}}},{default:T(()=>[ue(" This step will install dependencies. ")]),_:1}),o(t).config.dependencies?(_(),O("div",nL,[(_(!0),O(ne,null,xe(o(t).config.dependencies,p=>(_(),O("div",iL,[x(c,{pt:{content:{class:"pt-3 pb-0"}}},{title:T(()=>[f("div",sL,[f("h5",rL,Q(p.name),1),p.installed?(_(),O("i",oL)):(_(),O("i",aL))])]),content:T(()=>[f("div",lL,[x(s,{value:p.type,class:"mr-2 bg-gray-200 text-black-alpha-80"},null,8,["value"]),x(s,{value:p.slug,class:"mr-2 bg-gray-200 text-black-alpha-80"},null,8,["value"]),x(s,{value:p.version,class:"mr-2 bg-gray-200 text-black-alpha-80"},null,8,["value"])]),f("p",uL,Q(p.title),1),f("p",cL,[ue(" Developed by: "),f("a",{target:"_blank",href:p.author_website},Q(p.author_name),9,dL)]),o(t).active_dependency&&p.slug===o(t).active_dependency.slug?(_(),$(u,{key:0,mode:"indeterminate",class:"mb-3","data-testid":"dependencies-module_install_progressbar"})):(_(),$(u,{key:1,value:0,class:"mb-3","data-testid":"dependencies-module_install_progressbar"})),f("div",pL,[x(l,{inputId:"binary",modelValue:p.import_sample_data,"onUpdate:modelValue":v=>p.import_sample_data=v,binary:!0,class:"is-small",pt:{hiddeninput:{"data-testid":"dependencies-select_module"}}},null,8,["modelValue","onUpdate:modelValue"]),hL])]),_:2},1024)]))),256)),f("div",fL,[x(u,{value:o(t).config.count_installed_progress,class:"mt-2","data-testid":"dependencies-install_progressbar"},null,8,["value"]),f("div",mL,[o(t).config.count_installed_progress===100?(_(),$(d,{key:0,icon:"pi pi-check",onClick:r[0]||(r[0]=p=>o(t).installDependencies()),loading:o(t).is_btn_loading_dependency,label:"Download & install Dependencies",class:"p-button-success p-button-sm mr-2 is-small","data-testid":"dependencies-install_dependencies",pt:{label:{"data-testid":"dependencies-install_dependencies_btn_text"}}},null,8,["loading"])):(_(),$(d,{key:1,icon:"pi pi-download",onClick:r[1]||(r[1]=p=>o(t).installDependencies()),loading:o(t).is_btn_loading_dependency,label:"Download & install Dependencies",class:"p-button-sm mr-2 is-small","data-testid":"dependencies-install_dependencies",pt:{label:{"data-testid":"dependencies-install_dependencies_btn_text"}}},null,8,["loading"])),x(d,{label:"Skip",onClick:r[2]||(r[2]=p=>o(t).skipDependencies()),class:"btn-dark p-button-sm is-small","data-testid":"dependencies-skip",pt:{label:{"data-testid":"dependencies-skip_btn_text"}}})])]),f("div",gL,[f("div",vL,[x(d,{label:"Back",class:"p-button-sm",onClick:r[3]||(r[3]=p=>i.$router.push({name:"setup.install.migrate"})),"data-testid":"dependencies-back_btn",pt:{label:{"data-testid":"dependencies-back_btn_text"}}}),x(d,{label:"Save & Next",class:"p-button-sm",onClick:o(t).validateDependencies,"data-testid":"dependencies-save_btn",pt:{label:{"data-testid":"dependencies-save_btn_text"}}},null,8,["onClick"])])])])):A("",!0)])):A("",!0)}}},_L=us(yL,[["__scopeId","data-v-8565f480"]]),bL={key:0},wL={class:"p-card"},CL={class:"p-card-content p-4 border-round-xl"},SL={class:"flex justify-content-between mt-5"},kL={class:"flex align-items-center gap-2"},xL=f("p",{class:"text-xs"},"Migrate & Run Seeds for next step",-1),IL={class:"flex"},LL={class:"pl-2 text-xs","data-testid":"migrate-confirmation_message"},PL={__name:"Migrate",setup(n){const t=_t(),i=ls();je();const r=Ge();Te(async()=>{document.title="Migrate - Setup",await i.getAssets(r)});const a=s=>{t.require({group:"templating",header:"Deleting existing migrations",message:"This will delete all existing migration from database/migrations folder.",icon:"pi pi-exclamation-circle text-red-600",acceptClass:"p-button p-button-danger is-small",acceptLabel:"Proceed",rejectLabel:"Cancel",rejectClass:" is-small btn-dark",accept:()=>{i.runMigrations()}})};return(s,u)=>{const l=R("Message"),c=R("Button"),d=R("ConfirmDialog");return o(i).assets?(_(),O("div",bL,[f("div",wL,[f("div",CL,[x(l,{severity:"info",closable:!0,class:"is-small",pt:{text:{"data-testid":"migrate-message_text"},closebutton:{"data-testid":"migrate-message_close_btn"}}},{default:T(()=>[ue(" This step will run database migrations and seeds.")]),_:1}),o(i).status&&o(i).status.is_db_migrated?(_(),$(c,{key:0,label:"Migrate & Run Seeds",icon:"pi pi-check",iconPos:"left",loading:o(i).btn_is_migration,onClick:a,class:"is-small",pt:{label:{"data-testid":"migrate-run_migration_btn_text"}},severity:"success","data-testid":"migrate-run_migration"},null,8,["loading"])):(_(),$(c,{key:1,label:"Migrate & Run Seeds",icon:"pi pi-database",iconPos:"left",loading:o(i).btn_is_migration,onClick:a,class:"is-small",outlined:"","data-testid":"migrate-run_migration",pt:{label:{"data-testid":"migrate-run_migration_btn_text"}}},null,8,["loading"])),f("div",SL,[x(c,{label:"Back",class:"p-button-sm",severity:"secondary",onClick:u[0]||(u[0]=p=>s.$router.push("/setup/install/configuration")),"data-testid":"migrate-back_btn",pt:{label:{"data-testid":"migrate-back_btn_text"}}}),f("div",kL,[xL,x(c,{label:"Save & Next",class:"p-button-sm",onClick:o(i).validateMigration,"data-testid":"migrate-save_btn",pt:{label:{"data-testid":"migrate-save_btn_text"}}},null,8,["onClick"])])]),x(d,{group:"templating",class:"is-small",style:{width:"400px"},breakpoints:{"600px":"100vw"},pt:{acceptbutton:{root:{"data-testid":"migrate-confirmation_proceed_btn"}},rejectbutton:{root:{"data-testid":"migrate-confirmation_cancel_btn"}},closeButton:{"data-testid":"migrate-confirmation_close_btn"}}},{message:T(p=>[f("div",IL,[f("i",{class:he(p.message.icon),style:{"font-size":"1.5rem"}},null,2),f("p",LL,Q(p.message.message),1)])]),_:1})])])])):A("",!0)}}},OL={key:0},EL={class:"p-card"},AL={class:"p-card-content p-4 border-round-xl"},TL={class:"grid p-fluid"},RL={class:"col-12 md:col-3"},DL=f("h5",{class:"text-left p-1 title is-6"},"First name",-1),ML={class:"p-inputgroup"},$L=f("div",{class:"required-field hidden"},null,-1),VL={class:"col-12 md:col-3"},BL=f("h5",{class:"text-left p-1 title is-6"},"Middle name",-1),qL={class:"p-inputgroup"},FL={class:"col-12 md:col-3"},jL=f("h5",{class:"text-left p-1 title is-6"},"Last name",-1),UL={class:"p-inputgroup"},NL=f("div",{class:"required-field hidden"},null,-1),HL={class:"col-12 md:col-3"},KL=f("h5",{class:"text-left p-1 title is-6"},"Email",-1),zL={class:"p-inputgroup"},WL=f("div",{class:"required-field hidden"},null,-1),GL={class:"grid p-fluid"},YL={class:"col-12 md:col-3"},QL=f("h5",{class:"text-left p-1 title is-6"},"Username",-1),XL={class:"p-inputgroup"},ZL=f("div",{class:"required-field hidden"},null,-1),JL={class:"col-12 md:col-3"},eP=f("h5",{class:"text-left p-1 title is-6"},"Password",-1),tP={class:"p-inputgroup"},nP=f("div",{class:"required-field hidden"},null,-1),iP={class:"col-12 md:col-3"},sP=f("h5",{class:"text-left p-1 title is-6"},"Search Country",-1),rP={class:"p-inputgroup"},oP=f("div",{class:"required-field hidden"},null,-1),aP={class:"col-12 md:col-3"},lP=f("h5",{class:"text-left p-1 title is-6"},"Phone",-1),uP={class:"p-inputgroup"},cP=f("div",{class:"required-field hidden"},null,-1),dP={class:"grid p-fluid"},pP={class:"col-12 mt-3"},hP={class:"col-12"},fP={class:"flex justify-content-between mt-3"},mP={__name:"Account",setup(n){const t=ls();return je(),Te(async()=>{document.title="Account - Setup"}),(i,r)=>{const a=R("Message"),s=R("InputText"),u=R("Password"),l=R("AutoComplete"),c=R("Button");return o(t)&&o(t).assets?(_(),O("div",OL,[f("div",EL,[f("div",AL,[x(a,{severity:"info",closable:!0,class:"is-small",pt:{text:{"data-testid":"account-message_text"},closebutton:{"data-testid":"account-message_close_btn"}}},{default:T(()=>[ue(" Create first account, this account will have super administrator role and will have all the permissions. ")]),_:1}),f("div",TL,[f("div",RL,[DL,f("div",ML,[x(s,{modelValue:o(t).config.account.first_name,"onUpdate:modelValue":r[0]||(r[0]=d=>o(t).config.account.first_name=d),name:"account-first_name","data-testid":"account-first_name",placeholder:"Enter first name",class:"p-inputtext-sm",required:""},null,8,["modelValue"]),$L])]),f("div",VL,[BL,f("div",qL,[x(s,{modelValue:o(t).config.account.middle_name,"onUpdate:modelValue":r[1]||(r[1]=d=>o(t).config.account.middle_name=d),name:"account-middle_name","data-testid":"account-middle_name",placeholder:"Enter middle name",class:"p-inputtext-sm"},null,8,["modelValue"])])]),f("div",FL,[jL,f("div",UL,[x(s,{modelValue:o(t).config.account.last_name,"onUpdate:modelValue":r[2]||(r[2]=d=>o(t).config.account.last_name=d),name:"account-last_name","data-testid":"account-last_name",placeholder:"Enter last name",class:"p-inputtext-sm",required:""},null,8,["modelValue"]),NL])]),f("div",HL,[KL,f("div",zL,[x(s,{modelValue:o(t).config.account.email,"onUpdate:modelValue":r[3]||(r[3]=d=>o(t).config.account.email=d),name:"account-email","data-testid":"account-email",onBlur:r[4]||(r[4]=d=>o(t).generateUsername()),placeholder:"Enter email",class:"p-inputtext-sm",required:""},null,8,["modelValue"]),WL])])]),f("div",GL,[f("div",YL,[QL,f("div",XL,[x(s,{modelValue:o(t).config.account.username,"onUpdate:modelValue":r[5]||(r[5]=d=>o(t).config.account.username=d),name:"account-username","data-testid":"account-username",placeholder:"Enter Username",class:"p-inputtext-sm",required:""},null,8,["modelValue"]),ZL])]),f("div",JL,[eP,f("div",tP,[x(u,{modelValue:o(t).config.account.password,"onUpdate:modelValue":r[6]||(r[6]=d=>o(t).config.account.password=d),name:"account-password","data-testid":"account-password",feedback:!1,toggleMask:"","input-class":"w-full p-inputtext-sm",placeholder:"Enter password",pt:{root:{required:""},showicon:{"data-testid":"account-password_eye"}}},null,8,["modelValue"]),nP])]),f("div",iP,[sP,f("div",rP,[x(l,{modelValue:o(t).config.account.country_calling_code_object,"onUpdate:modelValue":r[7]||(r[7]=d=>o(t).config.account.country_calling_code_object=d),suggestions:o(t).filtered_country_codes,completeOnFocus:o(t).autocomplete_on_focus,onComplete:o(t).searchCountryCode,onBlur:o(t).setFocusDropDownToTrue,onItemSelect:o(t).onSelectCountryCode,placeholder:"Enter Your Country",optionLabel:"name",name:"account-country_calling_code","data-testid":"account-country_calling_code","input-class":"p-inputtext-sm",required:""},null,8,["modelValue","suggestions","completeOnFocus","onComplete","onBlur","onItemSelect"]),oP])]),f("div",aP,[lP,f("div",uP,[x(s,{modelValue:o(t).config.account.phone,"onUpdate:modelValue":r[8]||(r[8]=d=>o(t).config.account.phone=d),name:"account-phone","data-testid":"account-phone",placeholder:"Enter phone",class:"p-inputtext-sm",required:""},null,8,["modelValue"]),cP])])]),f("div",dP,[f("div",pP,[o(t).config.is_account_created?(_(),$(c,{key:0,name:"account-create_account_btn","data-testid":"account-create_account_btn",icon:"pi pi-check",label:"Create Account",class:"p-button-success p-button-sm w-auto is-small",loading:o(t).config.btn_is_account_creating,pt:{label:{"data-testid":"account-create_account_btn_text"}}},null,8,["loading"])):(_(),$(c,{key:1,name:"account-create_account_btn","data-testid":"account-create_account_btn",icon:"pi pi-check",label:"Create Account",class:"p-button-sm w-auto is-small",loading:o(t).config.btn_is_account_creating,onClick:r[9]||(r[9]=d=>o(t).createAccount()),pt:{label:{"data-testid":"account-create_account_btn_text"}}},null,8,["loading"]))]),f("div",hP,[f("div",fP,[x(c,{label:"Back",name:"account-back_btn","data-testid":"account-back_btn",class:"p-button-sm w-auto",onClick:r[10]||(r[10]=d=>i.$router.push("/setup/install/dependencies")),pt:{label:{"data-testid":"account-back_btn_text"}}}),o(t).config.is_account_created?(_(),$(c,{key:0,name:"account-back_to_sign_in_btn","data-testid":"account-back_to_sign_in_btn",icon:"pi pi-external-link",label:"Go to Backend Sign in",class:"p-button-success p-button-sm w-auto",onClick:r[11]||(r[11]=d=>o(t).validateAccountCreation()),pt:{label:{"data-testid":"account-back_to_sign_in_btn_text"}}})):(_(),$(c,{key:1,name:"account-back_to_sign_in_btn","data-testid":"account-back_to_sign_in_btn",icon:"pi pi-external-link",label:"Go to Backend Sign in",class:"p-button-sm w-auto",onClick:r[12]||(r[12]=d=>o(t).validateAccountCreation()),pt:{label:{"data-testid":"account-back_to_sign_in_btn_text"}}}))])])])])])])):A("",!0)}}},gP={class:"col-12 mt-6 mx-auto"},vP={class:"grid flex justify-content-center flex-wrap"},yP={key:0,class:"w-full"},_P={class:"content text-center"},bP=f("h4",{class:"text-xl font-semibold mb-1","data-testid":"forgot_password-heading_text"},"Forgot password?",-1),wP=f("p",{class:"text-xs text-gray-600 font-normal","data-testid":"forgot_password-description_text"},"You can recover your password from here.",-1),CP={class:"flex flex-column align-items-center gap-3"},SP={class:"p-inputgroup"},kP=f("div",{class:"required-field hidden"},null,-1),xP={class:"w-full flex justify-content-between align-items-center"},IP={__name:"ForgotPassword",setup(n){const t=je(),i=wa();return Te(async()=>{document.title="Forgot Password",await t.getAssets()}),(r,a)=>{const s=R("InputText"),u=R("Button"),l=R("router-link"),c=R("Card");return _(),O("div",gP,[f("div",vP,[o(t).assets?(_(),O("div",yP,[x(c,{class:"m-auto border-round-xl w-full max-w-24rem"},{title:T(()=>[f("div",_P,[x($r,{class:"mt-3"}),bP,wP])]),content:T(()=>[f("div",CP,[f("div",SP,[x(s,{modelValue:o(i).forgot_password_items.email,"onUpdate:modelValue":a[0]||(a[0]=d=>o(i).forgot_password_items.email=d),placeholder:"Enter Email Address",name:"forgot_password-email","data-testid":"forgot_password-email",id:"email",class:"w-full",type:"text",required:""},null,8,["modelValue"]),kP]),f("div",xP,[x(u,{label:"Send Code",name:"forgot_password-send_code_btn","data-testid":"forgot_password-send_code_btn",class:"p-button-sm","native-type":"submit",onClick:a[1]||(a[1]=d=>o(i).sendCode()),loading:o(i).is_forgot_password_btn_loading,pt:{label:{"data-testid":"forgot_password-send_code_btn_text"}}},null,8,["loading"]),x(l,{to:{name:"sign.in"}},{default:T(()=>[x(u,{label:"Sign In",class:"p-button-text p-button-sm"})]),_:1},8,["to"])])])]),footer:T(()=>[x(Di)]),_:1})])):A("",!0)])])}}},LP={class:"col-12 mt-6 mx-auto"},PP={class:"grid flex justify-content-center flex-wrap"},OP={key:0,class:"w-full"},EP={class:"content text-center"},AP=f("h4",{class:"text-xl font-semibold mb-1"},"Reset password?",-1),TP=f("p",{class:"text-xs text-gray-600 font-normal"}," You can recover your password from here.",-1),RP={class:"flex flex-column align-items-center gap-3"},DP={class:"p-inputgroup"},MP=f("div",{class:"required-field hidden"},null,-1),$P={class:"p-inputgroup"},VP=f("div",{class:"required-field hidden"},null,-1),BP={class:"p-inputgroup"},qP=f("div",{class:"required-field hidden"},null,-1),FP={class:"w-full flex justify-content-between align-items-center"},jP={__name:"ResetPassword",setup(n){const t=je(),i=wa(),r=Ge();return Te(async()=>{document.title="Reset Password",await t.getAssets(),r.params&&r.params.code&&(i.reset_password_items.reset_password_code=r.params.code)}),(a,s)=>{const u=R("InputText"),l=R("Password"),c=R("Button"),d=R("router-link"),p=R("Card");return _(),O("div",LP,[f("div",PP,[o(t).assets?(_(),O("div",OP,[x(p,{class:"m-auto border-round-xl w-full max-w-24rem"},{title:T(()=>[f("div",EP,[x($r,{class:"mt-3"}),AP,TP])]),content:T(()=>[f("div",RP,[f("div",DP,[x(u,{modelValue:o(i).reset_password_items.reset_password_code,"onUpdate:modelValue":s[0]||(s[0]=v=>o(i).reset_password_items.reset_password_code=v),placeholder:"Enter Code to reset the password",name:"reset_password-reset_password_code","data-testid":"reset_password-reset_password_code",id:"code",class:"w-full",type:"text",required:""},null,8,["modelValue"]),MP]),f("div",$P,[x(l,{modelValue:o(i).reset_password_items.password,"onUpdate:modelValue":s[1]||(s[1]=v=>o(i).reset_password_items.password=v),placeholder:"New Password",name:"reset_password-password",inputProps:{autocomplete:"new-password"},"data-testid":"reset_password-password",class:"w-full",inputClass:"w-full",toggleMask:"",id:"new-password",pt:{root:{required:""}}},null,8,["modelValue"]),VP]),f("div",BP,[x(l,{modelValue:o(i).reset_password_items.password_confirmation,"onUpdate:modelValue":s[2]||(s[2]=v=>o(i).reset_password_items.password_confirmation=v),placeholder:"Confirm Password",name:"reset_password-password_confirmation","data-testid":"reset_password-password_confirmation",class:"w-full",inputClass:"w-full",toggleMask:"",id:"confirm-password",pt:{root:{required:""}}},null,8,["modelValue"]),qP]),f("div",FP,[x(c,{label:"Recover",name:"reset_password-reset_password_btn","data-testid":"reset_password-reset_password_btn",class:"p-button-sm",onClick:s[3]||(s[3]=v=>o(i).resetPassword()),loading:o(i).is_reset_password_btn_loading},null,8,["loading"]),x(d,{to:{name:"sign.in"}},{default:T(()=>[x(c,{label:"Sign In",class:"p-button-text p-button-sm"})]),_:1},8,["to"])])])]),footer:T(()=>[x(Di)]),_:1})])):A("",!0)])])}}};let rf=[],of=[];of=[{path:"/",component:_6,props:!0,children:[{path:"/:pathMatch(.*)",name:"not-found",component:b6},{path:"/",name:"sign.in",component:l8,props:!0},{path:"/forgot-password",name:"forgot.password",component:IP,props:!0},{path:"/signup",name:"signup",component:O8,props:!0},{path:"/reset-password/:code?",name:"reset.password_without_code",component:jP,props:!0},{path:"/setup",name:"setup.index",component:r4,props:!0},{path:"/setup/install",name:"setup.install",component:f4,props:!0,children:[{path:"configuration",name:"setup.install.configuration",component:JI},{path:"migrate",name:"setup.install.migrate",component:PL},{path:"dependencies",name:"setup.install.dependencies",component:_L},{path:"account",name:"setup.install.account",component:mP}]}]}];rf.push(...of);let UP=document.getElementsByTagName("base")[0].getAttribute("href"),af=UP,NP=af+"/json";const HP=Ot({id:"dashboard",state:()=>({title:"Dashboard",active_index:[0,1],ajax_url:af,assets_is_fetching:!0,dashboard_items:null,json_url:NP}),getters:{},actions:{async getItem(){if(this.assets_is_fetching===!0){this.assets_is_fetching=!1;let n={};B().ajax(this.ajax_url+"/dashboard/getItem",this.afterGetItem,n)}},afterGetItem(n,t){n&&(this.dashboard_items=n.item)},goToLink(n,t=!1){if(!n)return!1;t?window.open(n,"_blank"):window.location.href=n},async to(n){this.$router.push({path:n})},showProgress(){this.show_progress_bar=!0},hideProgress(){this.show_progress_bar=!1},hasPermission(n){const t=je();return B().hasPermission(t.permissions,n)},setTitle(){this.title&&(document.title=this.title)}}});const Mi=n=>(ya("data-v-d0278b59"),n=n(),va(),n),KP={key:0,class:"grid dashboard"},zP={class:"col-12 md:col-8"},WP=Mi(()=>f("h5",{class:"text-xl font-semibold mb-1"},[ue("Welcome to Vaah"),f("b",null,"Cms")],-1)),GP=Mi(()=>f("p",null,"We've assembled some links to get you started:",-1)),YP={class:"grid mt-4"},QP={class:"col-12 md:col-4"},XP=Mi(()=>f("h6",{class:"font-semibold mb-2 text-sm"},"Get Started",-1)),ZP={key:0},JP={key:1},eO=Mi(()=>f("p",{class:"text-sm mt-1"},[ue(" or, "),f("a",{href:"https://docs.vaah.dev/vaahcms/theme/introduction.html","data-testid":"dashboard-create_theme",target:"_blank"}," create your own theme")],-1)),tO={class:"col-12 md:col-4"},nO=Mi(()=>f("h6",{class:"font-semibold mb-2 text-sm"},"Next Steps",-1)),iO={class:"links-list"},sO=["onClick"],rO={class:"col-12 md:col-4"},oO=Mi(()=>f("h6",{class:"font-semibold mb-2 text-sm"},"More Actions",-1)),aO={class:"links-list"},lO=["data-testid","onClick"],uO={key:0,class:"col-12"},cO={class:"text-lg font-semibold mb-4"},dO={class:"grid m-0"},pO={class:"col"},hO={class:"p-3 border-circle bg-blue-50"},fO={class:"text-sm font-semibold mt-3"},mO={class:"text-xl font-semibold my-1"},gO=["data-testid","onClick"],vO={class:"col-12 md:col-4 mt-3"},yO={key:0},_O=Mi(()=>f("b",null,"Laravel Queues",-1)),bO={class:"text-sm"},wO={class:"flex justify-content-evenly align-items-center align-items-center"},CO=["onClick","data-testid"],SO={class:"flex justify-content-between"},kO=["onClick","data-testid"],xO=["onClick","data-testid"],IO={key:1,class:"text-sm"},LO=["onClick","data-testid"],PO={__name:"Dashboard",setup(n){const t=je(),i=HP();return Te(async()=>{await i.setTitle(),await i.getItem(),t.verifyInstallStatus(),await t.reloadAssets()}),Ae(),(r,a)=>{const s=R("Button"),u=R("Divider"),l=R("Card"),c=R("Message"),d=R("AccordionTab"),p=R("Accordion");return o(t).assets&&o(i).hasPermission("has-access-of-dashboard")?(_(),O("div",KP,[f("div",zP,[x(l,null,{content:T(()=>[WP,GP,f("div",YP,[f("div",QP,[XP,x(s,{onClick:a[0]||(a[0]=v=>o(i).goToLink(o(t).base_url+"#/vaah/themes/")),"data-testid":"dashboard-goto_theme",class:"p-button-sm is-light"},{default:T(()=>[o(i).dashboard_items&&o(i).dashboard_items.success&&o(i).dashboard_items.success.vaahcms&&o(i).dashboard_items.success.vaahcms.has_activated_theme?(_(),O("span",ZP," Go To Theme ")):(_(),O("span",JP," Activate Theme "))]),_:1}),eO]),f("div",tO,[nO,f("ul",iO,[o(i)&&o(i).dashboard_items&&o(i).dashboard_items.success?(_(!0),O(ne,{key:0},xe(o(i).dashboard_items.success,v=>(_(),O(ne,null,[(_(!0),O(ne,null,xe(v.next_steps,h=>(_(),O("li",null,[f("a",{href:"javascript:void(0)","data-testid":"dashboard-goto_theme",onClick:m=>o(i).goToLink(h.link,h.open_in_new_tab??null)},[f("i",{class:he(["pi",h.icon])},null,2),ue(" "+Q(h.name),1)],8,sO)]))),256))],64))),256)):A("",!0)])]),f("div",rO,[oO,f("ul",aO,[o(i)&&o(i).dashboard_items&&o(i).dashboard_items.success?(_(!0),O(ne,{key:0},xe(o(i).dashboard_items.success,v=>(_(),O(ne,null,[(_(!0),O(ne,null,xe(v.actions,h=>(_(),O("li",null,[f("a",{href:"javascript:void(0)","data-testid":"dashboard-"+h.name,onClick:m=>o(i).goToLink(h.link,h.open_in_new_tab??null)},[f("i",{class:he(["pi",h.icon])},null,2),ue(" "+Q(h.name),1)],8,lO)]))),256))],64))),256)):A("",!0)])]),x(u),o(i)&&o(i).dashboard_items&&o(i).dashboard_items.success?(_(!0),O(ne,{key:0},xe(o(i).dashboard_items.success,v=>(_(),O(ne,null,[v.card?(_(),O("div",uO,[f("h5",cO,Q(v.card.title),1),f("div",dO,[(_(!0),O(ne,null,xe(v.card.list,(h,m)=>(_(),O(ne,null,[f("div",pO,[f("span",hO,[f("i",{class:he(["text-blue-400 pi",h.icon])},null,2)]),f("p",fO,Q(h.label),1),f("h6",mO,Q(h.count),1),f("a",{href:"javascript:void(0)","data-testid":"dashboard-view_"+h.label,onClick:b=>o(i).goToLink(h.link,h.open_in_new_tab??null),class:"text-sm"}," View Details ",8,gO)]),x(u,{layout:"vertical",class:"hidden md:block"}),x(u,{class:"md:hidden"})],64))),256))])])):A("",!0)],64))),256)):A("",!0)])]),_:1})]),f("div",vO,[o(i)&&o(i).dashboard_items&&o(i).dashboard_items.success?(_(!0),O(ne,{key:0},xe(o(i).dashboard_items.success,v=>(_(),O(ne,null,[v.expanded_header_links?(_(!0),O(ne,{key:0},xe(v.expanded_header_links,h=>(_(),$(s,{label:h.name,icon:h.icon,"data-testid":"dashboard-"+h.name,class:"p-button-sm p-button-outlined mr-2 mb-3 pi",onClick:m=>o(i).goToLink(h.link,h.open_in_new_tab?h.open_in_new_tab:null)},null,8,["label","icon","data-testid","onClick"]))),256)):A("",!0)],64))),256)):A("",!0),o(i)&&o(i).dashboard_items&&o(i).dashboard_items.success?(_(!0),O(ne,{key:1},xe(o(i).dashboard_items.success,(v,h)=>(_(),O(ne,{key:h},[v.expanded_item?(_(!0),O(ne,{key:0},xe(v.expanded_item,(m,b)=>(_(),$(p,{key:b,multiple:!0,activeIndex:o(i).active_index},{default:T(()=>[(_(),$(d,{header:m.title,key:m.title},{default:T(()=>[m.type==="content"?(_(),O(ne,{key:0},[m.is_job_enabled?A("",!0):(_(),O("div",yO,[x(c,{severity:"error",closable:!1,icon:"null"},{default:T(()=>[ue(" Enable "),_O,ue(" to run your jobs "),f("a",{onClick:a[1]||(a[1]=I=>o(i).goToLink(o(t).base_url+"#/vaah/settings/general")),href:"javascript:void(0)","data-testid":"dashboard-view_setting"}," View Setting ")]),_:1})])),f("p",bO,Q(m.description),1),x(u),f("div",wO,[(_(!0),O(ne,null,xe(m.footer,I=>(_(),O(ne,null,[f("a",{href:"javascript:void(0)",class:"text-center",onClick:k=>o(i).goToLink(I.link),"data-testid":"dashboard-view_"+I.name},[f("i",{class:he(["mr-2 pi pi-",I.icon])},null,2),ue(" "+Q(I.count)+" "+Q(I.name),1)],8,CO),x(u,{layout:"vertical"})],64))),256))]),x(u)],64)):A("",!0),m.type==="list"?(_(),O(ne,{key:1},[m.list.length&&b(_(),O(ne,null,[f("div",SO,[f("a",{href:"javascript:void(0)",onClick:y=>o(i).goToLink(m.link+"view/"+I.name),class:"text-sm text-red-500","data-testid":"dashboard-view_"+I.name},Q(I.name),9,kO),f("a",{href:"javascript:void(0)",onClick:y=>o(i).goToLink(m.link+"view/"+I.name),class:"text-sm","data-testid":"dashboard-"+I.name+"_view"}," View ",8,xO)]),x(u)],64))),256)):A("",!0),m.list.length===0?(_(),O("p",IO,Q(m.empty_response_note),1)):A("",!0),m.list.length>m.list_limit?(_(),O("a",{key:2,href:"javascript:void(0)",onClick:I=>o(i).goToLink(m.link),class:"flex justify-content-center","data-testid":"dashboard-"+m.link_text},Q(m.link_text),9,LO)):A("",!0)],64)):A("",!0)]),_:2},1032,["header"]))]),_:2},1032,["activeIndex"]))),128)):A("",!0)],64))),128)):A("",!0)])])):A("",!0)}}},OO=us(PO,[["__scopeId","data-v-d0278b59"]]),EO=["src"],AO=["href","target","data-testid"],TO={key:0},RO={class:"p-inputgroup flex-1"},DO={key:1,class:"flex align-items-center"},MO=f("i",{class:"pi pi-chevron-down text-sm mt-1 ml-1"},null,-1),$O={__name:"Topnav",setup(n){const t=je(),i=Ae();Te(async()=>{await t.getTopRightUserMenu()});const r=a=>{i.value.toggle(a)};return(a,s)=>{const u=R("Button"),l=R("InputText"),c=R("Avatar"),d=R("TieredMenu"),p=R("Menubar"),v=Ke("tooltip");return o(t).assets&&o(t).top_menu_items?(_(),$(p,{key:0,model:o(t).top_menu_items,class:"top-nav-fixed py-2 align-items-center"},{start:T(()=>[f("div",{class:he([{"w-225":!o(t).assets.is_logo_compressed_with_sidebar},"navbar-logo"])},[f("img",{src:o(t).assets.backend_logo_url,alt:"VaahCMS"},null,8,EO)],2)]),item:T(({item:h})=>[ce((_(),O("a",{href:h.url,target:h.target,"data-testid":"Topnav-"+h.icon.split("-")[1],class:"px-2"},[f("i",{class:he(["pi",h.icon])},null,2)],8,AO)),[[v,h.tooltip,void 0,{bottom:!0}]])]),end:T(()=>[o(t).assets.is_impersonating?(_(),O("div",TO,[f("div",RO,[x(u,{size:"small",label:"Impersonating",outlined:""}),x(l,{class:"p-inputtext-sm",disabled:"",placeholder:o(t).assets.auth_user.name,value:o(t).assets.auth_user.name},null,8,["placeholder","value"]),x(u,{size:"small",onClick:s[0]||(s[0]=h=>o(t).impersonateLogout()),severity:"danger",label:"Leave"})])])):A("",!0),o(t).assets.auth_user&&!o(t).assets.is_impersonating?(_(),O("div",DO,[f("a",{onClick:r,"data-testid":"Topnav-Avatar",class:"cursor-pointer flex align-items-center"},[x(c,{image:o(t).assets.auth_user.avatar,class:"mr-2",shape:"circle"},null,8,["image"]),f("span",null,Q(o(t).assets.auth_user.name),1),MO])])):A("",!0),o(t)&&o(t).top_right_user_menu?(_(),$(d,{key:2,model:o(t).top_right_user_menu,ref_key:"menu",ref:i,popup:!0},null,8,["model"])):A("",!0)]),_:1},8,["model"])):A("",!0)}}},VO={class:"bg-blue-700 text-gray-100 flex justify-content-between mb-5 p-3"},BO={class:"col-9 align-items-center hidden lg:flex"},qO=f("span",{class:"line-height-3 mr-2"},[f("i",{class:"pi pi-info-circle"})],-1),FO={class:"line-height-3"},jO={class:""},UO={__name:"Notices",setup(n){const t=je();return(i,r)=>{const a=R("Button");return o(t)&&o(t).assets&&o(t).assets.vue_notices&&o(t).assets.vue_notices.length>0?(_(!0),O(ne,{key:0},xe(o(t).assets.vue_notices,s=>(_(),O("div",null,[(_(!0),O(ne,null,xe(o(t).assets.vue_notices,u=>(_(),O("div",null,[f("div",VO,[f("div",BO,[qO,f("span",FO,Q(u.meta.message),1)]),f("div",jO,[x(a,{label:u.meta.action.label,"data-testid":"notice-goto_update",onClick:l=>o(t).markAsRead(u),class:"p-button-raised p-button-primary mr-2"},null,8,["label","onClick"]),x(a,{icon:"pi pi-times-circle",onClick:l=>o(t).markAsRead(u,!0),"data-testid":"notice-mark_as_read",class:"p-button-rounded p-button-text p-button-info"},null,8,["onClick"])])])]))),256))]))),256)):A("",!0)}}},NO={key:0,class:"grid"},HO={class:"grid main-container"},KO={class:"col-12"},yn={__name:"Backend",setup(n){const t=je();return Te(async()=>{await t.checkLoggedIn(),await t.getAssets(),await t.getPermission()}),(i,r)=>{const a=R("RouterView");return _(),O("div",null,[o(t).is_logged_in?(_(),O("div",NO,[x($O),x(Av),f("div",HO,[f("div",KO,[x(UO),x(a)])])])):A("",!0),x(Di)])}}};let lf=[],uf=[];uf={path:"/vaah/",component:yn,props:!0,children:[{path:"",name:"dashboard",component:OO,props:!0}]};lf.push(uf);let zO="WebReinvent\\VaahCms\\Models\\Setting",cf=document.getElementsByTagName("base")[0].getAttribute("href"),WO=cf+"/vaah/settings/user-setting",Eo={query:[],list:null,action:[]};const df=Ot({id:"user-settings",state:()=>({title:"User Settings - Settings",base_url:cf,ajax_url:WO,model:zO,assets_is_fetching:!0,app:null,assets:null,rows_per_page:[10,20,30,50,100,500],list:null,item:null,fillable:null,empty_query:Eo.query,empty_action:Eo.action,query:B().clone(Eo.query),action:B().clone(Eo.action),search:{delay_time:600,delay_timer:0},route:null,view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],item_menu_list:[],item_menu_state:null,form_menu_list:[],field:{name:null,type:null},field_type:null,custom_field_list:null,active_index:[],selected_field_type:null,content_settings_status:!0,field_types:[{name:"Text",value:"text"},{name:"Email",value:"email"},{name:"TextArea",value:"textarea"},{name:"Number",value:"number"},{name:"Password",value:"password"}]}),getters:{},actions:{async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,B().ajax(this.ajax_url+"/assets",this.afterGetAssets))},afterGetAssets(n,t){n&&(this.assets=n)},async getList(){let n={query:B().clone(this.query)};await B().ajax(this.ajax_url+"/list",this.afterGetList,n)},afterGetList(n,t){this.is_btn_loading=!1,this.query.recount=null,n&&(this.field_list=n.list.fields,n.list.custom_fields?this.custom_field_list=n.list.custom_fields:this.custom_field_list=this.getNewItem())},getNewItem(){return{id:null,key:null,category:"user_setting",label:"custom_fields",excerpt:null,type:"json",value:[]}},addCustomField(){if(!this.selected_field_type)return B().toastErrors(["Select field Type first."]),!1;let n={name:null,slug:null,type:this.selected_field_type,excerpt:null,is_hidden:!1,to_registration:!1};(this.selected_field_type==="textarea"||this.selected_field_type==="text"||this.selected_field_type==="email")&&(n.maxlength=null,n.minlength=null),this.selected_field_type==="password"&&(n.is_password_reveal=null),this.selected_field_type==="number"&&(n.min=null,n.max=null),this.custom_field_list.value.push(n)},deleteGroupField(n){this.custom_field_list.value.splice(n,1)},toggleFieldOptions(n){let t=n.target;t.closest(".content-div").children[1].classList.length==0?t.closest(".content-div").children[1].classList.add("inactive"):t.closest(".content-div").children[1].classList.remove("inactive")},onInputFieldName(n){n.slug=B().strToSlug(n.name,"_")},storeField(n){let t={method:"post"};t.params={item:n};let i=this.ajax_url+"/field/store";B().ajax(i,this.storeCustomFieldAfter,t)},storeFieldAfter(n,t){this.getList()},storeCustomField(){let n={method:"post"};n.params={item:this.custom_field_list};let t=this.ajax_url+"/custom-field/store";B().ajax(t,this.storeCustomFieldAfter,n)},storeCustomFieldAfter(n,t){t.data.status==="success"&&this.getList()},expandAll(){this.active_index=[0,1]},collapseAll(){this.active_index=[]},setPageTitle(){this.title&&(document.title=this.title)}}});let GO="WebReinvent\\VaahCms\\Models\\User",pf=document.getElementsByTagName("base")[0].getAttribute("href"),Ao=pf+"/users",ws={query:{page:1,rows:20,filter:{q:null,is_active:null,trashed:null,sort:null},recount:null},action:{type:null,items:[]},user_roles_query:{q:null,page:null,rows:null}};const fi=Ot({id:"users",state:()=>({title:"Users",base_url:pf,ajax_url:Ao,model:GO,assets_is_fetching:!0,app:null,assets:null,user_roles:null,displayModal:!1,modalData:null,rows_per_page:[10,20,30,50,100,500],list:null,item:null,fillable:null,empty_query:ws.query,empty_action:ws.action,query:B().clone(ws.query),action:B().clone(ws.action),search:{delay_time:600,delay_timer:0},route:null,watch_stopper:null,route_prefix:"users.",view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],item_menu_list:[],item_menu_state:null,filtered_timezone_codes:[],filtered_country_codes:[],form_menu_list:[],gender_options:[{label:"Male",value:"male"},{label:"Female",value:"female"},{label:"Others",value:"others"}],status_options:[{label:"Active",value:"active"},{label:"Inactive",value:"inactive"},{label:"Blocked",value:"blocked"},{label:"Banned",value:"banned"}],user_roles_menu:null,meta_content:null,user_roles_query:B().clone(ws.user_roles_query),is_btn_loading:!1,display_meta_modal:!1,custom_fields_data:[],display_bio_modal:null,bio_modal_data:null,firstElement:null,rolesFirstElement:null,email_error:{class:"",msg:""}}),getters:{},actions:{async onLoad(n){this.route=n,this.setViewAndWidth(n.name),this.firstElement=(this.query.page-1)*this.query.rows,this.rolesFirstElement=(this.user_roles_query.page-1)*this.user_roles_query.rows,this.updateQueryFromUrl(n)},setViewAndWidth(n){switch(n){case"users.index":this.view="large",this.list_view_width=12;break;default:this.view="small",this.list_view_width=7;break}},async updateQueryFromUrl(n){if(n.query&&Object.keys(n.query).length>0){for(let t in n.query)this.query[t]=n.query[t];this.countFilters(n.query)}},watchRoutes(n){this.watch_stopper=We(n,(t,i)=>{if(this.watch_stopper&&!t.name.includes(this.route_prefix))return this.watch_stopper(),!1;this.route=t,t.params.id&&this.getItem(t.params.id),this.setViewAndWidth(t.name)},{deep:!0})},watchStates(){We(this.query.filter,(n,t)=>{this.delayedSearch()},{deep:!0}),We(this.user_roles_query,async(n,t)=>{await this.delayedUserRolesSearch()},{deep:!0})},async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,B().ajax(this.ajax_url+"/assets",this.afterGetAssets))},afterGetAssets(n,t){n&&(this.assets=n,n.rows&&(this.query.rows?this.query.rows=parseInt(this.query.rows):this.query.rows=n.rows,this.user_roles_query.rows=n.rows),this.route.params&&!this.route.params.id&&(this.item=B().clone(n.empty_item)))},searchTimezoneCode:function(n){this.timezone_name_object=null,this.timezone=null,setTimeout(()=>{n.query.trim().length?this.filtered_timezone_codes=this.assets.timezones.filter(t=>t.name.toLowerCase().startsWith(n.query.toLowerCase())):this.filtered_timezone_codes=this.assets.timezones},250)},onSelectTimezoneCode:function(n){this.item.timezone=n.value.slug},searchCountryCode:function(n){this.country_name_object=null,this.country=null,setTimeout(()=>{n.query.trim().length?this.filtered_country_codes=this.assets.countries.filter(t=>t.name.toLowerCase().startsWith(n.query.toLowerCase())):this.filtered_country_codes=this.assets.countries},250)},onSelectCountryCode:function(n){this.item.country=n.value.name},async getList(){let n={query:B().clone(this.query)};await this.updateUrlQueryString(this.query),await B().ajax(this.ajax_url,await this.afterGetList,n)},async afterGetList(n,t){this.is_btn_loading=!1,this.query.recount=null,n&&(this.list=n,this.firstElement=this.query.rows*(this.query.page-1))},async getItem(n){n&&await B().ajax(Ao+"/"+n,this.getItemAfter)},async getItemAfter(n,t){n?this.item=n:this.$router.push({name:"users.index"}),this.getItemMenu(),await this.getFormMenu()},storeAvatar(n){n.user_id=this.item.id;let t={params:n,method:"post"},i=Ao+"/avatar/store";B().ajax(i,this.storeAvatarAfter,t)},storeAvatarAfter(n,t){n&&(this.item.avatar=n.avatar,this.item.avatar_url=n.avatar_url)},removeAvatar(){let n={params:{user_id:this.item.id},method:"post"},t=Ao+"/avatar/remove";B().ajax(t,this.removeAvatarAfter,n)},removeAvatarAfter(n,t){n&&(this.item.avatar=n.avatar,this.item.avatar_url=n.avatar_url)},isListActionValid(){const n=je();return this.action.type?this.action.items.length<1?(B().toastErrors([n.assets.language_string.general.select_records]),!1):!0:(B().toastErrors([n.assets.language_string.general.select_an_action_type]),!1)},async updateList(n=null){if(!n&&this.action.type?n=this.action.type:this.action.type=n,!this.isListActionValid())return!1;let t="PUT";switch(n){case"delete":t="DELETE";break}let i={params:this.action,method:t,show_success:!1};await B().ajax(this.ajax_url,this.updateListAfter,i)},async updateListAfter(n,t){n&&(this.action=B().clone(this.empty_action),await this.getList())},async getUserRoles(){this.showProgress();let n=this.ajax_url+"/item/"+this.item.id+"/roles",t={query:this.user_roles_query,method:"get"};B().ajax(n,await this.afterGetUserRoles,t)},async afterGetUserRoles(n,t){this.hideProgress(),n&&(this.user_roles=n)},async delayedUserRolesSearch(){let n=this;n.item&&n.item.id&&(clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.getUserRoles()},this.search.delay_time))},async userRolesPaginate(n){this.user_roles_query.page=n.page+1,this.user_roles_query.rows=n.rows,await this.getUserRoles()},async changeUserRole(n,t){let i={id:t,role_id:n.id},r={};n.pivot.is_active?r.is_active=0:r.is_active=1,await this.actions(!1,"toggle-role-active-status",i,r)},async bulkActions(n,t){let i={id:this.item.id,query:this.user_roles_query,role_id:null},r={is_active:n};await this.actions(!1,t,i,r)},async actions(n,t,i,r){n&&n.preventDefault();let a=this.ajax_url+"/actions/"+t,u={params:{inputs:i,data:r},method:"post"};B().ajax(a,await this.afterActions,u)},async afterActions(n,t){await this.getList(),await this.getUserRoles()},showModal(n){this.displayModal=!0,this.modalData=n.json},async listAction(n=null){!n&&this.action.type?n=this.action.type:this.action.type=n;let t=this.ajax_url+"/action/"+n,i="PUT";switch(n){case"delete":t=this.ajax_url,i="DELETE";break;case"delete-all":i="DELETE";break}let r={params:this.action,method:i,show_success:!1};r.params.query=B().clone(this.query),await B().ajax(t,this.updateListAfter,r)},itemAction(n,t=null){t||(t=this.item),this.form.action=n;let i=this.ajax_url,r={method:"post"};switch(n){case"create-and-new":case"create-and-close":case"create-and-clone":r.method="POST",r.params=t;break;case"save":case"save-and-close":case"save-and-clone":r.method="PUT",r.params=t,i+="/"+t.id;break;case"save-and-new":r.method="PUT",r.params=t,i+="/"+t.id;break;case"delete":r.method="DELETE",i+="/"+t.id;break;default:r.method="PATCH",i+="/"+t.id+"/action/"+n;break}B().ajax(i,this.itemActionAfter,r)},async itemActionAfter(n,t){n&&(this.item=n,await this.getList(),await this.formActionAfter(),this.getItemMenu(),this.route.params&&this.route.params.id&&await this.getItem(this.route.params.id))},async formActionAfter(){switch(this.form.action){case"create-and-new":case"save-and-new":this.setActiveItemAsEmpty(),this.route.params.id=null,this.$router.push({name:"users.form"});break;case"create-and-close":case"save-and-close":this.setActiveItemAsEmpty(),this.$router.push({name:"users.index"});break;case"save-and-clone":this.item.id=null,this.route.params.id=null,this.$router.push({name:"users.form"});break;case"trash":this.item=null;break;case"delete":this.item=null,this.toList();break}},async toggleIsActive(n){n.is_active?await this.itemAction("activate",n):await this.itemAction("deactivate",n)},async paginate(n){this.query.page=n.page+1,this.query.rows=n.rows,this.firstElement=this.query.rows*(this.query.page-1),await this.getList()},async reload(){await this.getAssets(),await this.getList()},async getFaker(){let n={model_namespace:this.model,except:this.assets.fillable.except},t=this.base_url+"/faker",i={params:n,method:"post"};B().ajax(t,this.getFakerAfter,i)},getFakerAfter:function(n,t){if(n){let i=this;Object.keys(n.fill).forEach(function(r){i.item[r]=n.fill[r]})}},async sync(){this.is_btn_loading=!0,this.query.recount=!0,await this.getList()},onItemSelection(n){this.action.items=n},setActiveItemAsEmpty(){this.item=B().clone(this.assets.empty_item)},confirmDelete(){const n=je();if(this.action.items.length<1)return B().toastErrors([n.assets.language_string.general.select_a_record]),!1;this.action.type="delete",B().confirmDialogDelete(this.listAction)},confirmDeleteAll(){this.action.type="delete-all",B().confirmDialogDelete(this.listAction)},async delayedSearch(){let n=this;this.query.page=1,this.action.items=[],clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.updateUrlQueryString(n.query),await n.getList()},this.search.delay_time)},async updateUrlQueryString(n){n=B().clone(n);let t=ct.stringify(n,{skipNulls:!0}),i=ct.parse(t);i.filter&&(i.filter=B().cleanObject(i.filter)),await this.$router.replace({query:null}),await this.$router.replace({query:i}),this.countFilters(i)},countFilters:function(n){if(this.count_filters=0,n&&n.filter){let t=B().cleanObject(n.filter);this.count_filters=Object.keys(t).length}},async clearSearch(){this.query.filter.q=null,await this.updateUrlQueryString(this.query),await this.getList()},async resetQuery(){await this.resetQueryString(),await this.getList()},async resetQueryString(){for(let n in this.query.filter)this.query.filter[n]=null;await this.updateUrlQueryString(this.query)},async resetUserRolesFilters(){this.user_roles_query.q=null,this.user_roles_query.rows=this.assets.rows},closeForm(){this.$router.push({name:"users.index"})},toList(){this.item=null,this.$router.push({name:"users.index"})},toForm(){this.item=B().clone(this.assets.empty_item),this.getFormMenu(),this.$router.push({name:"users.form"})},impersonate(n){let t={method:"post"};B().ajax(this.ajax_url+"/impersonate/"+n.uuid,this.afterImpersonate,t)},afterImpersonate(n,t){t&&t.data&&t.data.redirect_url&&(window.location.href=t.data.redirect_url,location.reload(!0))},toView(n){this.item=B().clone(n),this.$router.push({name:"users.view",params:{id:n.id}})},toEdit(n){this.item=n,this.$router.push({name:"users.form",params:{id:n.id}})},async toRole(n){this.item=n,await this.getUserRoles(),this.$router.push({name:"users.role",params:{id:n.id}})},isViewLarge(){return this.view==="large"},getIdWidth(){let n=50;if(this.list&&this.list.total){let t=this.list.total.toString();t=t.length,n=t*40}return n+"px"},getActionWidth(){let n=100;return this.isViewLarge()||(n=80),n+"px"},getActionLabel(){let n=null;return this.isViewLarge()&&(n="Actions"),n},async getListSelectedMenu(){const n=je();this.list_selected_menu=[{label:n.assets.language_string.crud_actions.bulk_activate,command:async()=>{await this.updateList("activate")}},{label:n.assets.language_string.crud_actions.bulk_deactivate,command:async()=>{await this.updateList("deactivate")}},{separator:!0},{label:n.assets.language_string.crud_actions.bulk_trash,icon:"pi pi-times",command:async()=>{await this.updateList("trash")}},{label:n.assets.language_string.crud_actions.bulk_restore,icon:"pi pi-replay",command:async()=>{await this.updateList("restore")}},{label:n.assets.language_string.crud_actions.bulk_delete,icon:"pi pi-trash",command:()=>{this.confirmDelete()}}]},getListBulkMenu(){const n=je();this.list_bulk_menu=[{label:n.assets.language_string.crud_actions.mark_all_as_active,command:async()=>{await this.listAction("activate-all")}},{label:n.assets.language_string.crud_actions.mark_all_as_inactive,command:async()=>{await this.listAction("deactivate-all")}},{separator:!0},{label:n.assets.language_string.crud_actions.trash_all,icon:"pi pi-times",command:async()=>{await this.listAction("trash-all")}},{label:n.assets.language_string.crud_actions.restore_all,icon:"pi pi-replay",command:async()=>{await this.listAction("restore-all")}},{label:n.assets.language_string.crud_actions.delete_all,icon:"pi pi-trash",command:async()=>{this.confirmDeleteAll()}}]},async getItemMenu(){const n=je();let t=[];this.item&&this.item.deleted_at&&t.push({label:n.assets.language_string.crud_actions.view_restore,icon:"pi pi-refresh",command:()=>{this.itemAction("restore")}}),this.item&&this.item.id&&!this.item.deleted_at&&t.push({label:n.assets.language_string.crud_actions.view_trash,icon:"pi pi-times",command:()=>{this.itemAction("trash")}}),t.push({label:n.assets.language_string.crud_actions.view_delete,icon:"pi pi-trash",command:()=>{this.confirmDeleteItem("delete")}}),t.push({label:this.assets.language_string.users.view_generate_new_api_token,icon:"pi pi-key",command:()=>{this.itemAction("generate-new-token")}}),this.item_menu_list=t},async getUserRolesMenuItems(){return this.user_roles_menu=[{label:this.assets.language_string.users.view_role_active_all_roles,command:async()=>{await this.bulkActions(1,"toggle-role-active-status")}},{label:this.assets.language_string.users.view_role_inactive_all_roles,command:async()=>{await this.bulkActions(0,"toggle-role-active-status")}}]},confirmDeleteItem(){this.form.type="delete",B().confirmDialogDelete(this.confirmDeleteItemAfter)},confirmDeleteItemAfter(){this.itemAction("delete",this.item)},onUpload(){this.user_avatar=e.files[0];let n=new FormData;n.append("file",this.user_avatar),n.append("folder_path","public/media"),B().ajax(this.ajax_url+"/upload",this.uploadAfter,{headers:{"Content-Type":"multipart/form-data"},method:"post",params:n})},async getFormMenu(){const n=df(),t=je();let i=[];this.item&&this.item.id?i=[{label:t.assets.language_string.crud_actions.form_save_and_close,icon:"pi pi-check",command:()=>{this.itemAction("save-and-close")}},{label:t.assets.language_string.crud_actions.form_save_and_clone,icon:"pi pi-copy",command:()=>{this.itemAction("save-and-clone")}},{label:t.assets.language_string.crud_actions.form_save_and_new,icon:"pi pi-plus",command:()=>{this.itemAction("save-and-new")}},{label:t.assets.language_string.crud_actions.form_trash,icon:"pi pi-times",command:()=>{this.itemAction("trash")}},{label:t.assets.language_string.crud_actions.form_delete,icon:"pi pi-trash",command:()=>{this.confirmDeleteItem("delete")}}]:i=[{label:t.assets.language_string.crud_actions.form_create_and_close,icon:"pi pi-check",command:()=>{this.itemAction("create-and-close")}},{label:t.assets.language_string.crud_actions.form_create_and_clone,icon:"pi pi-copy",command:()=>{this.itemAction("create-and-clone")}},{label:t.assets.language_string.crud_actions.form_reset,icon:"pi pi-refresh",command:()=>{this.setActiveItemAsEmpty()}}],i.push({label:t.assets.language_string.crud_actions.form_fill,icon:"pi pi-pencil",command:()=>{this.getFaker()}},{label:t.assets.language_string.crud_actions.form_add_custom_field,icon:"pi pi-plus",command:()=>{n.active_index=[1],this.goToLink(t.base_url+"#/vaah/settings/user-settings")}}),this.form_menu_list=i},hasPermission(n){const t=je();return B().hasPermission(t.permissions,n)},isHidden(n){return this.assets&&this.assets.fields&&this.assets.fields[n]?this.assets.fields[n].is_hidden:!1},showProgress(){this.show_progress_bar=!0},hideProgress(){this.show_progress_bar=!1},checkHidden(n){return this.assets&&this.assets.custom_fields?B().findInArrayByKey(this.assets.custom_fields.value,"slug",n).is_hidden:!1},openModal(n){this.meta_content=JSON.stringify(n,null,2),this.display_meta_modal=!0},setIsActiveStatus(){this.item.status==="active"?this.item.is_active=1:this.item.is_active=0},async displayBioModal(n){this.display_bio_modal=!0,this.bio_modal_data=n},validateEmail(){/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(this.item.email)?this.email_error={class:"",msg:""}:this.email_error={class:"p-invalid",msg:"Please enter a valid email address"}},setPageTitle(){this.title&&(document.title=this.title)},goToLink(n,t=!1){if(!n)return!1;t?window.open(n,"_blank"):window.location.href=n}}}),YO={class:"field grid"},QO={class:"col-12"},XO={class:"col-12"},mt={__name:"VhFieldVertical",props:["label"],setup(n){const t=n;return(i,r)=>(_(),O("div",YO,[f("label",QO,[ue(Q(t.label)+" ",1),ie(i.$slots,"label")]),f("div",XO,[ie(i.$slots,"default")])]))}},ZO={class:"field-radiobutton"},JO={for:"sort-none"},eE={class:"field-radiobutton"},tE={for:"sort-ascending"},nE={class:"field-radiobutton"},iE={for:"sort-descending"},sE={class:"field-radiobutton"},rE={for:"active-all"},oE={class:"field-radiobutton"},aE={for:"active-true"},lE={class:"field-radiobutton"},uE={for:"active-false"},cE={class:"field-radiobutton"},dE={for:"trashed-exclude"},pE={class:"field-radiobutton"},hE={for:"trashed-include"},fE={class:"field-radiobutton"},mE={for:"trashed-only"},gE={__name:"Filters",setup(n){const t=je(),i=fi();return(r,a)=>{const s=R("RadioButton"),u=R("Divider"),l=R("Sidebar");return _(),O("div",null,[x(l,{visible:o(i).show_filters,"onUpdate:visible":a[9]||(a[9]=c=>o(i).show_filters=c),position:"right",style:{"z-index":"1101"}},{default:T(()=>[x(mt,null,{label:T(()=>[f("b",null,Q(o(t).assets.language_string.crud_actions.filter_sort_by)+":",1)]),default:T(()=>[f("div",ZO,[x(s,{name:"sort-none",value:"","data-testid":"user-filter_sort_none",modelValue:o(i).query.filter.sort,"onUpdate:modelValue":a[0]||(a[0]=c=>o(i).query.filter.sort=c)},null,8,["modelValue"]),f("label",JO,Q(o(t).assets.language_string.crud_actions.sort_by_none),1)]),f("div",eE,[x(s,{name:"sort-ascending",value:"updated_at","data-testid":"user-filter_sort_asc",modelValue:o(i).query.filter.sort,"onUpdate:modelValue":a[1]||(a[1]=c=>o(i).query.filter.sort=c)},null,8,["modelValue"]),f("label",tE,Q(o(t).assets.language_string.crud_actions.sort_by_updated_ascending),1)]),f("div",nE,[x(s,{name:"sort-descending",value:"updated_at:desc","data-testid":"user-filter_sort_desc",modelValue:o(i).query.filter.sort,"onUpdate:modelValue":a[2]||(a[2]=c=>o(i).query.filter.sort=c)},null,8,["modelValue"]),f("label",iE,Q(o(t).assets.language_string.crud_actions.sort_by_updated_descending),1)])]),_:1}),x(u),x(mt,null,{label:T(()=>[f("b",null,Q(o(t).assets.language_string.crud_actions.filter_is_active)+":",1)]),default:T(()=>[f("div",sE,[x(s,{name:"active-all",value:"null","data-testid":"user-filter_active_all",modelValue:o(i).query.filter.is_active,"onUpdate:modelValue":a[3]||(a[3]=c=>o(i).query.filter.is_active=c)},null,8,["modelValue"]),f("label",rE,Q(o(t).assets.language_string.crud_actions.filter_is_active_all),1)]),f("div",oE,[x(s,{name:"active-true",value:"true","data-testid":"user-filter_active_only",modelValue:o(i).query.filter.is_active,"onUpdate:modelValue":a[4]||(a[4]=c=>o(i).query.filter.is_active=c)},null,8,["modelValue"]),f("label",aE,Q(o(t).assets.language_string.crud_actions.filter_only_active),1)]),f("div",lE,[x(s,{name:"active-false",value:"false","data-testid":"user-filter_inactive_only",modelValue:o(i).query.filter.is_active,"onUpdate:modelValue":a[5]||(a[5]=c=>o(i).query.filter.is_active=c)},null,8,["modelValue"]),f("label",uE,Q(o(t).assets.language_string.crud_actions.filter_only_inactive),1)])]),_:1}),x(mt,null,{label:T(()=>[f("b",null,Q(o(t).assets.language_string.crud_actions.filter_trashed)+":",1)]),default:T(()=>[f("div",cE,[x(s,{name:"trashed-exclude",value:"","data-testid":"user-filter_trash_exclude",modelValue:o(i).query.filter.trashed,"onUpdate:modelValue":a[6]||(a[6]=c=>o(i).query.filter.trashed=c)},null,8,["modelValue"]),f("label",dE,Q(o(t).assets.language_string.crud_actions.filter_exclude_trashed),1)]),f("div",pE,[x(s,{name:"trashed-include",value:"include","data-testid":"user-filter_trash_include",modelValue:o(i).query.filter.trashed,"onUpdate:modelValue":a[7]||(a[7]=c=>o(i).query.filter.trashed=c)},null,8,["modelValue"]),f("label",hE,Q(o(t).assets.language_string.crud_actions.filter_include_trashed),1)]),f("div",fE,[x(s,{name:"trashed-only",value:"only","data-testid":"user-filter_trash_only",modelValue:o(i).query.filter.trashed,"onUpdate:modelValue":a[8]||(a[8]=c=>o(i).query.filter.trashed=c)},null,8,["modelValue"]),f("label",mE,Q(o(t).assets.language_string.crud_actions.filter_only_trashed),1)])]),_:1})]),_:1},8,["visible"])])}}},vE={key:0},yE=f("i",{class:"pi pi-angle-down"},null,-1),_E={class:"grid p-fluid"},bE={class:"col-12"},wE={class:"p-inputgroup"},CE={__name:"Actions",setup(n){const t=je(),i=fi();Te(async()=>{i.getListSelectedMenu(),i.getListBulkMenu()});const r=Ae(),a=l=>{r.value.toggle(l)},s=Ae(),u=l=>{s.value.toggle(l)};return(l,c)=>{const d=R("Badge"),p=R("Button"),v=R("Menu"),h=R("InputText");return _(),O("div",null,[f("div",{class:he([{"flex justify-content-between":o(i).isViewLarge()},"mt-2 mb-2"])},[o(i).view==="large"?(_(),O("div",vE,[o(i).hasPermission("can-update-users")||o(i).hasPermission("can-manage-users")?(_(),$(p,{key:0,class:"p-button-sm","aria-haspopup":"true","aria-controls":"overlay_menu","data-testid":"user-action_menu",onClick:a},{default:T(()=>[yE,o(i).action.items.length>0?(_(),$(d,{key:0,value:o(i).action.items.length},null,8,["value"])):A("",!0)]),_:1})):A("",!0),x(v,{ref_key:"selected_menu_state",ref:r,model:o(i).list_selected_menu,popup:!0},null,8,["model"]),o(i).hasPermission("can-update-users")||o(i).hasPermission("can-manage-users")?(_(),$(p,{key:1,class:"p-button-sm ml-1",icon:"pi pi-ellipsis-h","aria-haspopup":"true","aria-controls":"bulk_menu_state","data-testid":"user-action_bulk_menu",onClick:u})):A("",!0),x(v,{ref_key:"bulk_menu_state",ref:s,model:o(i).list_bulk_menu,popup:!0},null,8,["model"])])):A("",!0),f("div",null,[f("div",_E,[f("div",bE,[f("div",wE,[x(h,{class:"p-inputtext-sm",type:"text",modelValue:o(i).query.filter.q,"onUpdate:modelValue":c[0]||(c[0]=m=>o(i).query.filter.q=m),onKeyup:[c[1]||(c[1]=Ie(m=>o(i).delayedSearch(),["enter"])),c[2]||(c[2]=Ie(m=>o(i).delayedSearch(),["enter","native"])),c[3]||(c[3]=Ie(m=>o(i).delayedSearch(),["13"]))],placeholder:o(t).assets.language_string.crud_actions.placeholder_search,"data-testid":"user-action_search_input"},null,8,["modelValue","placeholder"]),x(p,{class:"p-button-sm",icon:"pi pi-search","data-testid":"user-action_search",onClick:c[4]||(c[4]=m=>o(i).delayedSearch())}),x(p,{class:"p-button-sm",label:o(t).assets.language_string.crud_actions.filters_button,"data-testid":"user-action_filter",onClick:c[5]||(c[5]=m=>o(i).show_filters=!0)},{default:T(()=>[o(i).count_filters>0?(_(),$(d,{key:0,value:o(i).count_filters},null,8,["value"])):A("",!0)]),_:1},8,["label"]),x(p,{class:"p-button-sm",label:o(t).assets.language_string.crud_actions.reset_button,icon:"pi pi-filter-slash","data-testid":"user-action_reset",onClick:c[6]||(c[6]=m=>o(i).resetQuery())},null,8,["label"])])]),x(gE)])])],2)])}}},SE={key:0},kE={class:"p-inputgroup"},xE={__name:"Table",setup(n){const t=je(),i=fi();return B(),(r,a)=>{const s=R("Column"),u=R("Badge"),l=R("Button"),c=R("InputSwitch"),d=R("DataTable"),p=R("Paginator"),v=Ke("tooltip");return o(i).list&&o(i).assets?(_(),O("div",SE,[x(d,{value:o(i).list.data,dataKey:"id",class:"p-datatable-sm p-datatable-hoverable-rows",selection:o(i).action.items,"onUpdate:selection":a[0]||(a[0]=h=>o(i).action.items=h),stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[o(i).isViewLarge()||o(i).hasPermission("can-update-users")||o(i).hasPermission("can-manage-users")?(_(),$(s,{key:0,selectionMode:"multiple",headerStyle:"width: 3em"})):A("",!0),x(s,{field:"id",header:"ID",style:St({width:o(i).getIdWidth()}),sortable:!0},null,8,["style"]),x(s,{field:"name",header:"Name",sortable:!0},{body:T(h=>[h.data.deleted_at?(_(),$(u,{key:0,value:"Trashed",severity:"danger"})):A("",!0),ue(" "+Q(h.data.name),1)]),_:1}),x(s,{field:"email",header:"Email",sortable:!0},{body:T(h=>[ue(Q(h.data.email),1)]),_:1}),o(i).isViewLarge()?(_(),$(s,{key:1,field:"last_login_at",header:"Last Login At"},{body:T(h=>[ue(Q(h.data.last_login_at),1)]),_:1})):A("",!0),o(i).hasPermission("can-read-users")?(_(),$(s,{key:2,field:"roles",header:"Roles"},{body:T(h=>[x(l,{rounded:"","data-testid":"user-list_data_role",onClick:m=>o(i).toRole(h.data),size:"small",class:"white-space-nowrap",label:h.data.active_roles_count+" / "+o(i).assets.totalRole},null,8,["onClick","label"])]),_:1})):A("",!0),o(i).isViewLarge()||o(i).hasPermission("can-manage-users")&&o(i).hasPermission("can-update-users")?(_(),$(s,{key:3,field:"is_active",header:"Is Active",sortable:!1,style:{width:"100px"}},{body:T(h=>[x(c,{modelValue:h.data.is_active,"onUpdate:modelValue":m=>h.data.is_active=m,modelModifiers:{bool:!0},"false-value":0,"true-value":1,class:"p-inputswitch-sm","data-testid":"user-list_data_active",onInput:m=>o(i).toggleIsActive(h.data)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1})):A("",!0),o(t).assets&&o(t).assets.language_string&&o(t).assets.language_string.crud_actions?(_(),$(s,{key:4,field:"actions",style:St([{width:"150px"},{width:o(i).getActionWidth()}]),header:o(i).getActionLabel()},{body:T(h=>[f("div",kE,[o(i).hasPermission("can-impersonate-users")&&o(i).assets.language_string&&o(i).assets.language_string.users?ce((_(),$(l,{key:0,class:"p-button-tiny p-button-text",onClick:m=>o(i).impersonate(h.data),icon:"pi pi-user",disabled:!h.data.is_active,"data-testid":"users-list_data_impersonate"},null,8,["onClick","disabled"])),[[v,o(i).assets.language_string.users.toolkit_text_impersonate,void 0,{top:!0}]]):A("",!0),o(i).hasPermission("can-read-users")?ce((_(),$(l,{key:1,class:"p-button-tiny p-button-text",onClick:m=>o(i).toView(h.data),icon:"pi pi-eye","data-testid":"user-list_data_view"},null,8,["onClick"])),[[v,o(t).assets.language_string.crud_actions.toolkit_text_view,void 0,{top:!0}]]):A("",!0),o(i).hasPermission("can-update-users")?ce((_(),$(l,{key:2,class:"p-button-tiny p-button-text",onClick:m=>o(i).toEdit(h.data),icon:"pi pi-pencil","data-testid":"user-list_data_edit"},null,8,["onClick"])),[[v,o(t).assets.language_string.crud_actions.toolkit_text_update,void 0,{top:!0}]]):A("",!0),o(i).isViewLarge()&&!h.data.deleted_at||o(i).hasPermission("can-delete-users")?ce((_(),$(l,{key:3,class:"p-button-tiny p-button-danger p-button-text",onClick:m=>o(i).itemAction("trash",h.data),icon:"pi pi-trash","data-testid":"user-list_data_trash"},null,8,["onClick"])),[[v,o(t).assets.language_string.crud_actions.toolkit_text_trash,void 0,{top:!0}]]):A("",!0),o(i).isViewLarge()&&h.data.deleted_at?ce((_(),$(l,{key:4,class:"p-button-tiny p-button-success p-button-text",onClick:m=>o(i).itemAction("restore",h.data),icon:"pi pi-replay","data-testid":"user-list_data_restore"},null,8,["onClick"])),[[v,o(t).assets.language_string.crud_actions.toolkit_text_restore,void 0,{top:!0}]]):A("",!0)])]),_:1},8,["style","header"])):A("",!0)]),_:1},8,["value","selection"]),x(p,{first:o(i).firstElement,"onUpdate:first":a[1]||(a[1]=h=>o(i).firstElement=h),rows:o(i).query.rows,totalRecords:o(i).list.total,onPage:a[2]||(a[2]=h=>o(i).paginate(h)),rowsPerPageOptions:o(i).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["first","rows","totalRecords","rowsPerPageOptions"])])):A("",!0)}}},IE={class:"grid"},LE={class:"flex flex-row"},PE={key:0},OE={class:"mr-1"},EE={key:0,class:"p-inputgroup"},AE={__name:"List",setup(n){const t=je(),i=fi(),r=Ge();return _t(),Te(async()=>{await i.onLoad(r),await i.setPageTitle(),await i.watchRoutes(r),await i.watchStates(),await i.getAssets(),await i.getList()}),(a,s)=>{const u=R("Badge"),l=R("Button"),c=R("Panel"),d=R("RouterView");return _(),O("div",IE,[f("div",{class:he("col-"+o(i).list_view_width)},[x(c,{class:"is-small"},{header:T(()=>[f("div",LE,[o(i).assets&&o(i).assets.language_string&&o(i).assets.language_string.users?(_(),O("div",PE,[f("b",OE,Q(o(i).assets.language_string.users.users_title),1),o(i).list&&o(i).list.total>0?(_(),$(u,{key:0,value:o(i).list.total},null,8,["value"])):A("",!0)])):A("",!0)])]),icons:T(()=>[o(t).assets&&o(t).assets.language_string&&o(t).assets.language_string.crud_actions?(_(),O("div",EE,[o(i).hasPermission("can-create-users")?(_(),$(l,{key:0,class:"p-button-sm",label:o(t).assets.language_string.crud_actions.create_button,icon:"pi pi-plus",onClick:s[0]||(s[0]=p=>o(i).toForm()),"data-testid":"user-create"},null,8,["label"])):A("",!0),x(l,{class:"p-button-sm",icon:"pi pi-refresh",loading:o(i).is_btn_loading,"data-testid":"user-list_refresh",onClick:s[1]||(s[1]=p=>o(i).sync())},null,8,["loading"])])):A("",!0)]),default:T(()=>[o(t).assets&&o(t).assets.language_string&&o(t).assets.language_string.crud_actions?(_(),$(CE,{key:0})):A("",!0),x(xE)]),_:1})],2),x(d)])}}},TE={class:"flex align-items-center justify-content-center flex-column"},RE={__name:"FileUploader",props:{uploadUrl:{type:String,required:!0},folderPath:{type:String,default:"public/media"},fileName:{type:String,default:null},maxFileSize:{type:Number,default:1e6},file_limit:{type:Number,default:5},can_select_multiple:{type:Boolean,default:!1},is_basic:{type:Boolean,default:!1},auto_upload:{type:Boolean,default:!1},max_file_size:{type:Number,default:1e6},file_type_accept:{type:String,default:"image/*"},placeholder:{type:String,default:"Upload Image"},store_label:{type:String,default:"avatar"}},setup(n,{emit:t}){const i=Ae([]),r=fi();Ae(r.reset_uploader);const a=n;Ar([]);function s(c){let d=i.value.files;i.value.files=[],d.forEach(async p=>{let v=new FormData;v.append("file",p),v.append("folder_path",a.folderPath),v.append("file_name",a.fileName),ou.post(a.uploadUrl,v,{headers:{"Content-Type":"multipart/form-data"}}).then(h=>{i.value.uploadedFiles[0]=p,r.storeAvatar(h.data.data)})})}function u(c){}function l(c){let d=i.value.files[i.value.files.length-1];i.value.files=[],i.value.uploadedFiles=[],i.value.files[0]=d}return(c,d)=>{const p=R("FileUpload");return _(),$(p,{name:"file",auto:n.auto_upload,accept:n.file_type_accept,ref_key:"upload_refs",ref:i,mode:n.is_basic?"basic":"advanced",multiple:n.can_select_multiple,customUpload:!0,onSelect:l,onUploader:s,onRemoveUploadedFile:u,onClear:u,showUploadButton:!n.auto_upload,showCancelButton:!n.auto_upload,maxFileSize:n.max_file_size},{empty:T(()=>[f("div",TE,[f("p",null,Q(n.placeholder),1)])]),_:1},8,["auto","accept","mode","multiple","showUploadButton","showCancelButton","maxFileSize"])}}},DE={class:"field grid"},ME={class:"col-12 mb-2 md:col-2 md:mb-0"},$E={class:"col-12 md:col-10"},$e={__name:"VhField",props:["label"],setup(n){const t=n;return(i,r)=>(_(),O("div",DE,[f("label",ME,[ue(Q(t.label)+" ",1),ie(i.$slots,"label")]),f("div",$E,[ie(i.$slots,"default")])]))}},VE={class:"col-5"},BE={class:"flex flex-row"},qE={class:"p-panel-title"},FE={key:0},jE={key:1},UE={key:0,class:"p-inputgroup"},NE={key:0,class:"pt-2"},HE={key:0,class:"field mb-4 flex justify-content-between align-items-center"},KE=["src"],zE={key:1},WE={class:"w-max"},GE={id:"email-error",class:"p-error"},YE={__name:"Form",setup(n){const t=fi(),i=je(),r=Ge(),a=B();Te(async()=>{r.params&&r.params.id&&await t.getItem(r.params.id),We(i,async(l,c)=>{l.assets&&await t.getFormMenu()}),i.getIsActiveStatusOptions()}),Ae();const s=Ae(),u=l=>{s.value.toggle(l)};return(l,c)=>{const d=R("Button"),p=R("Menu"),v=R("InputText"),h=R("Password"),m=R("Dropdown"),b=R("SelectButton"),I=R("AutoComplete"),k=R("Editor"),y=R("Calendar"),g=R("Textarea"),C=R("Panel"),w=Ke("tooltip");return _(),O("div",VE,[x(C,{class:"is-small"},{header:T(()=>[f("div",BE,[f("div",qE,[o(t).item&&o(t).item.id?(_(),O("span",FE,Q(o(t).item.name),1)):o(i).assets&&o(i).assets.language_string&&o(i).assets.language_string.crud_actions?(_(),O("span",jE,Q(o(i).assets.language_string.crud_actions.form_text_create),1)):A("",!0)])])]),icons:T(()=>[o(i).assets&&o(i).assets.language_string&&o(i).assets.language_string.crud_actions?(_(),O("div",UE,[o(t).item&&o(t).item.id?(_(),$(d,{key:0,class:"p-button-sm",label:"#"+o(t).item.id,"data-testid":"user-form_id",onClick:c[0]||(c[0]=S=>o(a).copy(o(t).item.id))},null,8,["label"])):A("",!0),o(t).item&&o(t).item.id&&o(t).hasPermission("can-update-users")?(_(),$(d,{key:1,label:o(i).assets.language_string.crud_actions.save_button,class:"p-button-sm",onClick:c[1]||(c[1]=S=>o(t).itemAction("save")),"data-testid":"user-edit_save",icon:"pi pi-save"},null,8,["label"])):(_(),O(ne,{key:2},[o(t).hasPermission("can-create-users")?(_(),$(d,{key:0,label:o(i).assets.language_string.crud_actions.form_create_and_new,class:"p-button-sm",onClick:c[2]||(c[2]=S=>o(t).itemAction("create-and-new")),"data-testid":"user-new_save",icon:"pi pi-save"},null,8,["label"])):A("",!0)],64)),o(t).item&&o(t).item.id?ce((_(),$(d,{key:3,class:"p-button-sm",icon:"pi pi-eye","data-testid":"user-form_view",onClick:c[3]||(c[3]=S=>o(t).toView(o(t).item))},null,512)),[[w,o(i).assets.language_string.crud_actions.toolkit_text_view,void 0,{top:!0}]]):A("",!0),o(t).hasPermission("can-update-users")||o(t).hasPermission("can-manage-users")?(_(),$(d,{key:4,class:"p-button-sm",onClick:u,icon:"pi pi-angle-down","aria-haspopup":"true","data-testid":"user-form_menu"})):A("",!0),x(p,{ref_key:"form_menu",ref:s,model:o(t).form_menu_list,popup:!0},null,8,["model"]),x(d,{class:"p-button-sm",icon:"pi pi-times","data-testid":"user-list_view",onClick:c[4]||(c[4]=S=>o(t).toList())})])):A("",!0)]),default:T(()=>[o(t).item?(_(),O("div",NE,[o(t).item.id?(_(),O("div",HE,[o(t).item.avatar?(_(),O("img",{key:0,src:o(t).item.avatar,alt:"",width:"64",height:"64",style:{"border-radius":"50%"}},null,8,KE)):A("",!0),o(t).item.avatar_url?(_(),O("div",zE,[x(d,{class:"p-button-sm w-max","data-testid":"profile-save",onClick:o(t).removeAvatar,label:"Remove"},null,8,["onClick"])])):A("",!0),f("div",WE,[x(RE,{placeholder:"Upload Avatar",is_basic:!0,"data-testid":"user-form_upload_avatar",auto_upload:!0,uploadUrl:o(i).assets.urls.upload},null,8,["uploadUrl"])])])):A("",!0),x($e,{label:"Email"},{default:T(()=>[x(v,{class:he("w-full "+o(t).email_error.class),modelValue:o(t).item.email,"onUpdate:modelValue":c[5]||(c[5]=S=>o(t).item.email=S),onInput:o(t).validateEmail,name:"account-email","data-testid":"account-email",type:"email","aria-describedby":"email-error"},null,8,["class","modelValue","onInput"]),f("small",GE,Q(o(t).email_error.msg),1)]),_:1}),x($e,{label:"Username"},{default:T(()=>[x(v,{class:"w-full",modelValue:o(t).item.username,"onUpdate:modelValue":c[6]||(c[6]=S=>o(t).item.username=S),name:"account-username","data-testid":"account-username"},null,8,["modelValue"])]),_:1}),x($e,{label:"Password"},{default:T(()=>[x(h,{class:"w-full",modelValue:o(t).item.password,"onUpdate:modelValue":c[7]||(c[7]=S=>o(t).item.password=S),feedback:!1,id:"password",name:"account-password","data-testid":"account-password",inputClass:"w-full",toggleMask:""},null,8,["modelValue"])]),_:1}),o(t).isHidden("display_name")?A("",!0):(_(),$($e,{key:1,label:"Display Name"},{default:T(()=>[x(v,{class:"w-full",modelValue:o(t).item.display_name,"onUpdate:modelValue":c[8]||(c[8]=S=>o(t).item.display_name=S),name:"account-display_name","data-testid":"account-display_name"},null,8,["modelValue"])]),_:1})),o(t).isHidden("title")?A("",!0):(_(),$($e,{key:2,label:"Title"},{default:T(()=>[x(m,{class:"w-full",modelValue:o(t).item.title,"onUpdate:modelValue":c[9]||(c[9]=S=>o(t).item.title=S),options:o(t).assets.name_titles,optionLabel:"name",optionValue:"slug",id:"Title",name:"account-title","data-testid":"account-title"},null,8,["modelValue","options"])]),_:1})),o(t).isHidden("designation")?A("",!0):(_(),$($e,{key:3,label:"Designation"},{default:T(()=>[x(v,{class:"w-full",modelValue:o(t).item.designation,"onUpdate:modelValue":c[10]||(c[10]=S=>o(t).item.designation=S),name:"account-designation","data-testid":"account-designation"},null,8,["modelValue"])]),_:1})),x($e,{label:"First Name"},{default:T(()=>[x(v,{class:"w-full",modelValue:o(t).item.first_name,"onUpdate:modelValue":c[11]||(c[11]=S=>o(t).item.first_name=S),name:"account-first_name","data-testid":"account-first_name"},null,8,["modelValue"])]),_:1}),o(t).isHidden("middle_name")?A("",!0):(_(),$($e,{key:4,label:"Middle Name"},{default:T(()=>[x(v,{class:"w-full",modelValue:o(t).item.middle_name,"onUpdate:modelValue":c[12]||(c[12]=S=>o(t).item.middle_name=S),name:"account-middle_name","data-testid":"account-middle_name"},null,8,["modelValue"])]),_:1})),o(t).isHidden("last_name")?A("",!0):(_(),$($e,{key:5,label:"Last Name"},{default:T(()=>[x(v,{class:"w-full",modelValue:o(t).item.last_name,"onUpdate:modelValue":c[13]||(c[13]=S=>o(t).item.last_name=S),name:"account-last_name","data-testid":"account-last_name"},null,8,["modelValue"])]),_:1})),o(t).isHidden("gender")?A("",!0):(_(),$($e,{key:6,label:"Gender"},{default:T(()=>[x(b,{modelValue:o(t).item.gender,"onUpdate:modelValue":c[14]||(c[14]=S=>o(t).item.gender=S),options:o(t).gender_options,optionLabel:"label",optionValue:"value","aria-labelledby":"custom",name:"account-gender","data-testid":"account-gender"},{option:T(S=>[f("p",null,Q(S.option.label),1)]),_:1},8,["modelValue","options"])]),_:1})),o(t).isHidden("country")?A("",!0):(_(),$($e,{key:7,label:"Country"},{default:T(()=>[x(I,{class:"w-full",modelValue:o(t).item.country,"onUpdate:modelValue":c[15]||(c[15]=S=>o(t).item.country=S),suggestions:o(t).filtered_country_codes,onComplete:o(t).searchCountryCode,onItemSelect:o(t).onSelectCountryCode,placeholder:"Enter Your Country",optionLabel:"name",name:"account-country","data-testid":"account-country",inputClass:"w-full"},null,8,["modelValue","suggestions","onComplete","onItemSelect"])]),_:1})),o(t).isHidden("country_calling_code")?A("",!0):(_(),$($e,{key:8,label:"Country Code"},{default:T(()=>[x(m,{class:"w-full",modelValue:o(t).item.country_calling_code,"onUpdate:modelValue":c[16]||(c[16]=S=>o(t).item.country_calling_code=S),options:o(t).assets.countries,editable:!0,optionLabel:"calling_code",optionValue:"calling_code",id:"calling_code",name:"account-country_calling_code","data-testid":"account-country_calling_code"},null,8,["modelValue","options"])]),_:1})),o(t).isHidden("phone")?A("",!0):(_(),$($e,{key:9,label:"Phone"},{default:T(()=>[x(v,{class:"w-full",modelValue:o(t).item.phone,"onUpdate:modelValue":c[17]||(c[17]=S=>o(t).item.phone=S),name:"account-phone","data-testid":"account-phone"},null,8,["modelValue"])]),_:1})),o(t).isHidden("bio")?A("",!0):(_(),$($e,{key:10,label:"bio"},{default:T(()=>[x(k,{modelValue:o(t).item.bio,"onUpdate:modelValue":c[18]||(c[18]=S=>o(t).item.bio=S),editorStyle:"height: 320px",name:"account-bio","data-testid":"account-bio"},null,8,["modelValue"])]),_:1})),o(t).isHidden("website")?A("",!0):(_(),$($e,{key:11,label:"Website"},{default:T(()=>[x(v,{class:"w-full",modelValue:o(t).item.website,"onUpdate:modelValue":c[19]||(c[19]=S=>o(t).item.website=S),name:"account-website","data-testid":"account-website"},null,8,["modelValue"])]),_:1})),o(t).isHidden("timezone")?A("",!0):(_(),$($e,{key:12,label:"Timezone"},{default:T(()=>[x(m,{modelValue:o(t).item.timezone,"onUpdate:modelValue":c[20]||(c[20]=S=>o(t).item.timezone=S),options:o(t).assets.timezones,optionLabel:"name",optionValue:"slug",filter:!0,placeholder:"Enter Your Timezone",showClear:!0,"data-testid":"account-timezone",class:"w-full"},null,8,["modelValue","options"])]),_:1})),o(t).isHidden("alternate_email")?A("",!0):(_(),$($e,{key:13,label:"Alternate Email"},{default:T(()=>[x(v,{class:"w-full",modelValue:o(t).item.alternate_email,"onUpdate:modelValue":c[21]||(c[21]=S=>o(t).item.alternate_email=S),name:"account-alternate_email","data-testid":"account-alternate_email"},null,8,["modelValue"])]),_:1})),o(t).isHidden("birth")?A("",!0):(_(),$($e,{key:14,label:"Date of Birth"},{default:T(()=>[x(y,{class:"w-full",id:"dob",inputId:"basic",modelValue:o(t).item.birth,"onUpdate:modelValue":c[22]||(c[22]=S=>o(t).item.birth=S),autocomplete:"off",name:"account-birth","data-testid":"account-birth",dateFormat:"yy-mm-dd",showTime:!1},null,8,["modelValue"])]),_:1})),o(t).isHidden("foreign_user_id")?A("",!0):(_(),$($e,{key:15,label:"Foreign User Id"},{default:T(()=>[x(v,{class:"w-full",type:"number",modelValue:o(t).item.foreign_user_id,"onUpdate:modelValue":c[23]||(c[23]=S=>o(t).item.foreign_user_id=S),name:"account-foreign_user_id","data-testid":"account-foreign_user_id"},null,8,["modelValue"])]),_:1})),x($e,{label:"Status"},{default:T(()=>[x(m,{class:"w-full",modelValue:o(t).item.status,"onUpdate:modelValue":c[24]||(c[24]=S=>o(t).item.status=S),options:o(t).status_options,optionLabel:"label",optionValue:"value",id:"account-status",name:"account-status","data-testid":"account-status",onChange:o(t).setIsActiveStatus},null,8,["modelValue","options","onChange"])]),_:1}),x($e,{label:"Is Active"},{default:T(()=>[o(i).is_active_status_options?(_(),$(b,{key:0,modelValue:o(t).item.is_active,"onUpdate:modelValue":c[25]||(c[25]=S=>o(t).item.is_active=S),options:o(i).is_active_status_options,"option-label":"label","option-value":"value"},null,8,["modelValue","options"])):A("",!0)]),_:1}),o(t).assets.custom_fields?(_(!0),O(ne,{key:16},xe(o(t).assets.custom_fields.value,(S,L)=>(_(),O(ne,{key:L},[S.is_hidden?A("",!0):(_(),$($e,{key:0,label:o(a).toLabel(S.name)},{default:T(()=>[S.type==="textarea"?(_(),$(g,{key:0,class:"w-full",rows:"5",cols:"30",name:"account-meta_"+S.slug,"data-testid":"account-meta_"+S.slug,min:S.min,max:S.max,minlength:S.minlength,maxlength:S.maxlength,modelValue:o(t).item.meta.custom_fields[S.slug],"onUpdate:modelValue":P=>o(t).item.meta.custom_fields[S.slug]=P},null,8,["name","data-testid","min","max","minlength","maxlength","modelValue","onUpdate:modelValue"])):S.type==="password"?(_(),$(h,{key:1,name:"account-meta_"+S.slug,"data-testid":"account-meta_"+S.slug,min:S.min,max:S.max,minlength:S.minlength,maxlength:S.maxlength,modelValue:o(t).item.meta.custom_fields[S.slug],"onUpdate:modelValue":P=>o(t).item.meta.custom_fields[S.slug]=P,toggleMask:"",class:"w-full",inputClass:"w-full"},null,8,["name","data-testid","min","max","minlength","maxlength","modelValue","onUpdate:modelValue"])):(_(),$(v,{key:2,class:"w-full",name:"account-meta_"+S.slug,"data-testid":"account-meta_"+S.slug,type:S.type,min:S.min,max:S.max,minlength:S.minlength,maxlength:S.maxlength,modelValue:o(t).item.meta.custom_fields[S.slug],"onUpdate:modelValue":P=>o(t).item.meta.custom_fields[S.slug]=P},null,8,["name","data-testid","type","min","max","minlength","maxlength","modelValue","onUpdate:modelValue"]))]),_:2},1032,["label"]))],64))),128)):A("",!0)])):A("",!0)]),_:1})])}}},QE={style:{width:"40px"}},XE={key:1,colspan:"2"},ZE={key:2,colspan:"2"},JE={key:3,colspan:"2"},eA={key:4,colspan:"2"},at={__name:"VhViewRow",props:{label:{type:String,default:null},label_width:{type:String,default:"150px"},value:{default:null},type:{type:String,default:"text"},can_copy:{type:Boolean,default:!1}},setup(n){return(t,i)=>{const r=R("Button"),a=R("Tag");return _(),O("tr",null,[f("td",{style:St({width:n.label_width})},[f("b",null,Q(o(B)().toLabel(n.label)),1)],4),n.can_copy?(_(),O(ne,{key:0},[f("td",null,Q(n.value),1),f("td",QE,[x(r,{icon:"pi pi-copy",onClick:i[0]||(i[0]=s=>o(B)().copy(n.value)),class:"p-button-text"})])],64)):n.type==="user"?(_(),O("td",XE,[typeof n.value=="object"&&n.value!==null?(_(),$(r,{key:0,onClick:i[1]||(i[1]=s=>o(B)().copy(n.value.id)),class:"p-button-outlined p-button-secondary p-button-sm"},{default:T(()=>[ue(Q(n.value.name),1)]),_:1})):A("",!0)])):n.type==="yes-no"?(_(),O("td",ZE,[n.value===1?(_(),$(a,{key:0,value:"Yes",severity:"success"})):(_(),$(a,{key:1,value:"No",severity:"danger"}))])):n.type==="tag"?(_(),O("td",JE,[x(r,{label:n.value,outlined:""},null,8,["label"])])):(_(),O("td",eA,Q(n.value),1))])}}},tA={class:"col-5"},nA={class:"flex flex-row"},iA={class:"font-semibold text-sm"},sA={key:0,class:"p-inputgroup"},rA={key:0,class:"mt-2"},oA={key:0,class:"flex align-items-center justify-content-between"},aA={class:""},lA={class:"ml-3"},uA={class:"p-datatable p-component p-datatable-responsive-scroll p-datatable-striped p-datatable-sm"},cA={class:"p-datatable-table"},dA={class:"p-datatable-tbody"},pA={key:5},hA={style:{"font-weight":"bold"}},fA=f("td",null,[f("b",null,"Meta")],-1),mA={key:0},gA=["innerHTML"],vA=["innerHTML"],yA={__name:"Item",setup(n){const t=je(),i=fi(),r=Ge(),a=B();Te(async()=>{if(r.params&&!r.params.id)return i.toList(),!1;i.item||await i.getItem(r.params.id),await i.getItemMenu()});const s=Ae(),u=l=>{s.value.toggle(l)};return(l,c)=>{const d=R("Button"),p=R("Menu"),v=R("Message"),h=R("Avatar"),m=R("Dialog"),b=R("Panel");return _(),O("div",tA,[o(i).item?(_(),$(b,{key:0,class:"is-small"},{header:T(()=>[f("div",nA,[f("div",iA,Q(o(i).item.name),1)])]),icons:T(()=>[o(t).assets&&o(t).assets.language_string&&o(t).assets.language_string.crud_actions?(_(),O("div",sA,[x(d,{class:"p-button-sm",label:"#"+o(i).item.id,onClick:c[0]||(c[0]=I=>o(a).copy(o(i).item.id)),"data-testid":"user-item_id"},null,8,["label"]),o(i).hasPermission("can-update-users")||o(i).hasPermission("can-manage-users")?(_(),$(d,{key:0,label:o(t).assets.language_string.crud_actions.view_edit,onClick:c[1]||(c[1]=I=>o(i).toEdit(o(i).item)),icon:"pi pi-pencil",class:"p-button-sm","data-testid":"user-item_edit"},null,8,["label"])):A("",!0),o(i).hasPermission("can-update-users")||o(i).hasPermission("can-manage-users")?(_(),$(d,{key:1,class:"p-button-sm",onClick:u,icon:"pi pi-angle-down","aria-haspopup":"true","data-testid":"user-item_menu"})):A("",!0),x(p,{ref_key:"item_menu_state",ref:s,model:o(i).item_menu_list,popup:!0},null,8,["model"]),x(d,{class:"p-button-sm",icon:"pi pi-times","data-testid":"user-list_view",onClick:c[2]||(c[2]=I=>o(i).toList())})])):A("",!0)]),default:T(()=>[o(i).item?(_(),O("div",rA,[o(i).item.deleted_at?(_(),$(v,{key:0,severity:"error",class:"p-container-message",closable:!1,icon:"pi pi-trash"},{default:T(()=>[o(t).assets&&o(t).assets.language_string&&o(t).assets.language_string.crud_actions?(_(),O("div",oA,[f("div",aA,Q(o(t).assets.language_string.crud_actions.view_deleted)+" "+Q(o(i).item.deleted_at),1),f("div",lA,[x(d,{label:o(t).assets.language_string.crud_actions.view_restore,class:"p-button-sm","data-testid":"user-item_restore",onClick:c[3]||(c[3]=I=>o(i).itemAction("restore"))},null,8,["label"])])])):A("",!0)]),_:1})):A("",!0),f("div",uA,[f("table",cA,[f("tbody",dA,[o(i).item.avatar?(_(),$(h,{key:0,size:"xlarge",shape:"circle",image:o(i).item.avatar,alt:"Avatar"},null,8,["image"])):A("",!0),(_(!0),O(ne,null,xe(o(i).item,(I,k)=>(_(),O(ne,null,[k==="avatar_url"||k==="avatar"||k==="country_code"?(_(),O(ne,{key:0},[],64)):k==="created_by"||k==="updated_by"?(_(),O(ne,{key:1},[],64)):k==="id"||k==="uuid"||k==="email"||k==="username"||k==="phone"||k==="alternate_email"||k==="registration_id"?(_(),$(at,{key:2,label:k,value:I,"data-testid":"user-item_copy_"+k,can_copy:!0},null,8,["label","value","data-testid"])):(k==="created_by_user"||k==="updated_by_user"||k==="deleted_by_user")&&typeof I=="object"&&I!==null&&!o(i).isHidden(k)?(_(),$(at,{key:3,label:k,value:I,type:"user"},null,8,["label","value"])):k==="is_active"?(_(),$(at,{key:4,label:k,value:I,type:"yes-no"},null,8,["label","value"])):k==="bio"&&!o(i).isHidden("bio")?(_(),O("tr",pA,[f("td",hA,Q(o(B)().toLabel(k)),1),f("td",null,[I?(_(),$(d,{key:0,class:"p-button-secondary p-button-outlined p-button-rounded p-button-sm",label:"View",icon:"pi pi-eye","data-testid":"user-item_bio_modal",onClick:y=>o(i).displayBioModal(I)},null,8,["onClick"])):A("",!0)])])):k==="meta"?(_(),O(ne,{key:6},[f("tr",null,[fA,I?(_(),O("td",mA,[x(d,{icon:"pi pi-eye",label:"view",class:"p-button-outlined p-button-secondary p-button-rounded p-button-sm",onClick:y=>o(i).openModal(I),"data-testid":"register-open_meta_modal"},null,8,["onClick"])])):A("",!0)]),x(m,{header:"Meta",visible:o(i).display_meta_modal,"onUpdate:visible":c[4]||(c[4]=y=>o(i).display_meta_modal=y),breakpoints:{"960px":"75vw","640px":"90vw"},style:{width:"50vw"},modal:!0},{default:T(()=>[f("p",{class:"m-0",innerHTML:" "+o(i).meta_content+""},null,8,gA)]),_:1},8,["visible"])],64)):(_(),O(ne,{key:7},[o(i).isHidden(k)?A("",!0):(_(),$(at,{key:0,label:k,value:I},null,8,["label","value"]))],64))],64))),256))])])])])):A("",!0)]),_:1})):A("",!0),x(m,{header:"Bio",visible:o(i).display_bio_modal,"onUpdate:visible":c[5]||(c[5]=I=>o(i).display_bio_modal=I),breakpoints:{"960px":"75vw","640px":"90vw"},style:{width:"50vw"},modal:!0},{default:T(()=>[f("p",{class:"m-3",innerHTML:o(i).bio_modal_data},null,8,vA)]),_:1},8,["visible"])])}}},_A={class:"col-5"},bA={class:"flex flex-row"},wA={class:"font-semibold text-sm"},CA={class:"p-inputgroup"},SA={class:"grid p-fluid mt-1 mb-2"},kA={class:"col-12"},xA={key:0,class:"p-inputgroup"},IA={class:"p-input-icon-left"},LA=f("i",{class:"pi pi-search"},null,-1),PA={class:"p-datatable p-component p-datatable-responsive-scroll p-datatable-striped p-datatable-sm"},OA={key:0},EA={__name:"ViewRole",setup(n){const t=je(),i=fi(),r=B(),a=Ge();Te(async()=>{if(a.params&&!a.params.id)return i.toList(),!1;a.params&&a.params.id&&await i.getItem(a.params.id),i.item&&!i.user_roles&&await i.getUserRoles(),await i.getUserRolesMenuItems()});const s=Ae(),u=l=>{s.value.toggle(l)};return(l,c)=>{const d=R("Button"),p=R("Menu"),v=R("InputText"),h=R("Column"),m=R("DataTable"),b=R("Paginator"),I=R("Panel"),k=R("Divider"),y=Ke("tooltip");return _(),O("div",_A,[o(i).item?(_(),$(I,{key:0,class:"is-small"},{header:T(()=>[f("div",bA,[f("div",wA,Q(o(i).item.name),1)])]),icons:T(()=>[f("div",CA,[x(d,{class:"p-button-sm",label:"#"+o(i).item.id,onClick:c[0]||(c[0]=g=>o(r).copy(o(i).item.id)),"data-testid":"user-role_id"},null,8,["label"]),o(i).hasPermission("can-update-users")||o(i).hasPermission("can-manage-users")?(_(),$(d,{key:0,class:"p-button-sm",icon:"pi pi-angle-down","aria-haspopup":"true",onClick:u,"data-testid":"user-role_menu"})):A("",!0),x(p,{ref_key:"user_roles_menu_state",ref:s,model:o(i).user_roles_menu,popup:!0},null,8,["model"]),x(d,{class:"p-button-sm",icon:"pi pi-times","data-testid":"user-role_view",onClick:c[1]||(c[1]=g=>o(i).toList())})])]),default:T(()=>[f("div",SA,[f("div",kA,[o(i).assets&&o(i).assets.language_string&&o(i).assets.language_string.users?(_(),O("div",xA,[f("span",IA,[LA,x(v,{class:"w-full p-inputtext-sm",placeholder:o(i).assets.language_string.users.view_role_placeholder_search,type:"text",modelValue:o(i).user_roles_query.q,"onUpdate:modelValue":c[2]||(c[2]=g=>o(i).user_roles_query.q=g),onKeyup:[c[3]||(c[3]=Ie(g=>o(i).delayedUserRolesSearch(),["enter"])),c[4]||(c[4]=Ie(g=>o(i).delayedUserRolesSearch(),["enter","native"])),c[5]||(c[5]=Ie(g=>o(i).delayedUserRolesSearch(),["13"]))]},null,8,["placeholder","modelValue"])]),x(d,{class:"p-button-sm",label:o(i).assets.language_string.users.view_role_reset_button,"data-testid":"user-role_reset",onClick:c[6]||(c[6]=g=>o(i).resetUserRolesFilters())},null,8,["label"])])):A("",!0)])]),f("div",null,[f("div",PA,[o(i).user_roles&&o(t).assets&&o(t).assets.language_string&&o(t).assets.language_string.crud_actions?(_(),O("div",OA,[x(m,{value:o(i).user_roles.list.data,dataKey:"id",class:"p-datatable-sm",stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[x(h,{field:"role",header:"Roles",class:"flex align-items-center"},{body:T(g=>[ue(Q(g.data.name)+" ",1),ce(x(d,{class:"p-button-tiny p-button-text","data-testid":"taxonomies-table-to-edit",onClick:C=>o(r).copy(g.data.slug),icon:"pi pi-copy"},null,8,["onClick"]),[[y,o(t).assets.language_string.crud_actions.toolkit_text_copy_slug,void 0,{top:!0}]])]),_:1}),o(i).assets&&o(i).assets.language_string&&o(i).assets.language_string.users?(_(),$(h,{key:0,field:"role",header:"Has Role"},Mt({_:2},[o(i).hasPermission("can-update-users")||o(i).hasPermission("can-manage-users")?{name:"body",fn:T(g=>[g.data.pivot.is_active===1?(_(),$(d,{key:0,class:"p-button-success p-button-sm p-button-rounded",label:o(i).assets.language_string.users.view_role_yes,"data-testid":"user-role_status_yes",onClick:C=>o(i).changeUserRole(g.data,o(a).params.id)},null,8,["label","onClick"])):(_(),$(d,{key:1,class:"p-button-danger p-button-sm p-button-rounded",label:o(i).assets.language_string.users.view_role_no,"data-testid":"user-role_status_no",onClick:C=>o(i).changeUserRole(g.data,o(a).params.id)},null,8,["label","onClick"]))]),key:"0"}:{name:"body",fn:T(g=>[g.data.pivot.is_active===1?(_(),$(d,{key:0,class:"p-button-success p-button-sm p-button-rounded",label:o(i).assets.language_string.users.view_role_yes,disabled:""},null,8,["label"])):(_(),$(d,{key:1,class:"p-button-danger p-button-sm p-button-rounded",label:o(i).assets.language_string.users.view_role_no,disabled:""},null,8,["label"]))]),key:"1"}]),1024)):A("",!0),x(h,{field:"view",header:"View"},{body:T(g=>[ce(x(d,{class:"p-button-sm p-button-rounded p-button-outlined",onClick:C=>o(i).showModal(g.data),"data-testid":"user-role_details_view",icon:"pi pi-eye",label:o(i).assets.language_string.users.view_role_text_view},null,8,["onClick","label"]),[[y,o(t).assets.language_string.crud_actions.toolkit_text_view,void 0,{top:!0}]])]),_:1})]),_:1},8,["value"]),x(b,{first:o(i).rolesFirstElement,"onUpdate:first":c[7]||(c[7]=g=>o(i).rolesFirstElement=g),rows:o(i).user_roles_query.rows,totalRecords:o(i).user_roles.list.total,onPage:c[8]||(c[8]=g=>o(i).userRolesPaginate(g)),rowsPerPageOptions:o(i).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["first","rows","totalRecords","rowsPerPageOptions"])])):A("",!0)])])]),_:1})):A("",!0),x(o(ru),{header:"Details",visible:o(i).displayModal,"onUpdate:visible":c[9]||(c[9]=g=>o(i).displayModal=g),breakpoints:{"960px":"75vw","640px":"90vw"},style:{width:"50vw"},modal:!0},{default:T(()=>[(_(!0),O(ne,null,xe(o(i).modalData,(g,C)=>(_(),O("div",{key:C},[f("span",null,Q(C),1),ue(" : "+Q(g)+" ",1),x(k)]))),128))]),_:1},8,["visible"])])}}};let hf=[],ff=[];ff={path:"/vaah/users/",component:yn,props:!0,children:[{path:"",name:"users.index",component:AE,props:!0,children:[{path:"form/:id?",name:"users.form",component:YE,props:!0},{path:"view/:id?",name:"users.view",component:yA,props:!0},{path:"role/:id",name:"users.role",component:EA,props:!0}]}]};hf.push(ff);let AA="WebReinvent\\VaahCms\\Models\\Role",mf=document.getElementsByTagName("base")[0].getAttribute("href"),fd=mf+"/vaah/roles",Ki={query:{page:1,rows:20,filter:{q:null,is_active:null,trashed:null,sort:null},recount:null},role_permissions_query:{q:null,module:null,section:null,page:null,rows:null},role_users_query:{q:null,page:null,rows:null},action:{type:null,items:[]}};const jn=Ot({id:"roles",state:()=>({title:"Roles",base_url:mf,ajax_url:fd,model:AA,assets_is_fetching:!0,app:null,assets:null,rows_per_page:[10,20,30,50,100,500],list:null,item:{name:null,slug:null},fillable:null,empty_query:Ki.query,empty_action:Ki.action,query:B().clone(Ki.query),action:B().clone(Ki.action),search:{delay_time:600,delay_timer:0},route:null,watch_stopper:null,route_prefix:"roles.",view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],item_menu_list:[],item_menu_state:null,form_menu_list:[],total_permissions:null,total_users:null,permission_menu_items:null,role_permissions:null,role_user_menu_items:null,role_users:null,search_item:null,active_role_permission:null,active_role_user:null,module_section_list:null,role_permissions_query:B().clone(Ki.role_permissions_query),role_users_query:B().clone(Ki.role_users_query),is_btn_loading:!1,firstElement:null}),getters:{},actions:{async onLoad(n){this.route=n,this.setViewAndWidth(n.name),this.firstElement=(this.query.page-1)*this.query.rows,this.updateQueryFromUrl(n)},setViewAndWidth(n){switch(n){case"roles.index":this.view="large",this.list_view_width=12;break;default:this.view="small",this.list_view_width=6;break}},async updateQueryFromUrl(n){if(n.query&&Object.keys(n.query).length>0){for(let t in n.query)this.query[t]=n.query[t];this.countFilters(n.query)}},watchRoutes(n){this.watch_stopper=We(n,(t,i)=>{if(this.watch_stopper&&!t.name.includes(this.route_prefix))return this.watch_stopper(),!1;this.route=t,t.params.id&&this.getItem(t.params.id),this.setViewAndWidth(t.name)},{deep:!0})},watchItem(n){n&&n!==""&&(this.item.name=B().capitalising(n),this.item.slug=B().strToSlug(n))},watchStates(){We(this.query.filter,(n,t)=>{this.delayedSearch()},{deep:!0}),We(this.role_permissions_query,(n,t)=>{this.delayedRolePermissionSearch()},{deep:!0}),We(this.role_users_query,(n,t)=>{this.delayedRoleUsersSearch()},{deep:!0})},async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,B().ajax(this.ajax_url+"/assets",this.afterGetAssets))},afterGetAssets(n,t){n&&(this.assets=n,n.rows&&(this.query.rows?this.query.rows=parseInt(this.query.rows):this.query.rows=n.rows,this.role_permissions_query.rows=n.rows,this.role_users_query.rows=n.rows,this.firstElement=this.query.rows*(this.query.page-1)),this.route.params&&!this.route.params.id&&(this.item=B().clone(n.empty_item)))},async getList(){let n={query:B().clone(this.query)};await this.updateUrlQueryString(this.query),await B().ajax(this.ajax_url,this.afterGetList,n)},afterGetList:function(n,t){this.is_btn_loading=!1,this.query.recount=null,n&&(this.list=n,this.total_permissions=t.data.totalPermissions,this.total_users=t.data.totalUsers)},async getItem(n){n&&await B().ajax(fd+"/"+n,this.getItemAfter)},async getItemAfter(n,t){n?this.item=n:this.$router.push({name:"roles.index"}),this.getItemMenu(),await this.getFormMenu()},isListActionValid(){return this.action.type?this.action.items.length<1?(B().toastErrors(["Select records"]),!1):!0:(B().toastErrors(["Select an action type"]),!1)},async updateList(n=null){if(!n&&this.action.type?n=this.action.type:this.action.type=n,!this.isListActionValid())return!1;let t="PUT";switch(n){case"delete":t="DELETE";break}let i={params:this.action,method:t,show_success:!1};await B().ajax(this.ajax_url,this.updateListAfter,i)},async updateListAfter(n,t){n&&(this.action=B().clone(this.empty_action),await this.getList())},async listAction(n=null){!n&&this.action.type?n=this.action.type:this.action.type=n;let t=this.ajax_url+"/action/"+n,i="PUT";switch(n){case"delete":t=this.ajax_url,i="DELETE";break;case"delete-all":i="DELETE";break}let r={params:this.action,method:i,show_success:!1};r.params.query=B().clone(this.role_permissions_query),await B().ajax(t,this.updateListAfter,r)},itemAction(n,t=null){t||(t=this.item),this.form.action=n;let i=this.ajax_url,r={method:"post"};switch(n){case"create-and-new":case"create-and-close":case"create-and-clone":r.method="POST",r.params=t;break;case"save":case"save-and-close":case"save-and-clone":r.method="PUT",r.params=t,i+="/"+t.id;break;case"save-and-new":r.method="PUT",r.params=t,i+="/"+t.id;break;case"delete":r.method="DELETE",i+="/"+t.id;break;default:r.method="PATCH",i+="/"+t.id+"/action/"+n;break}B().ajax(i,this.itemActionAfter,r)},async itemActionAfter(n,t){n&&(this.item=n,await this.getList(),await this.formActionAfter(),this.getItemMenu(),this.route.params&&this.route.params.id&&await this.getItem(this.route.params.id))},async formActionAfter(){switch(this.form.action){case"create-and-new":case"save-and-new":this.setActiveItemAsEmpty(),this.route.params.id=null,this.$router.push({name:"roles.form"});break;case"create-and-close":case"save-and-close":this.setActiveItemAsEmpty(),this.$router.push({name:"roles.index"});break;case"create-and-clone":this.item.id=null;break;case"save-and-clone":this.item.id=null,this.route.params.id=null,this.$router.push({name:"roles.form"});break;case"trash":this.item=null;break;case"delete":this.item=null,this.toList();break}},async toggleIsActive(n){n.is_active?await this.itemAction("activate",n):await this.itemAction("deactivate",n)},async paginate(n){this.query.page=n.page+1,this.query.rows=n.rows,await this.getList()},async reload(){await this.getAssets(),await this.getList()},async getFaker(){let n={model_namespace:this.model,except:this.assets.fillable.except},t=this.base_url+"/faker",i={params:n,method:"post"};B().ajax(t,this.getFakerAfter,i)},getFakerAfter:function(n,t){if(n){let i=this;Object.keys(n.fill).forEach(function(r){i.item[r]=n.fill[r]})}},async sync(){this.is_btn_loading=!0,this.query.recount=!0,await this.getList()},onItemSelection(n){this.action.items=n},setActiveItemAsEmpty(){this.item=B().clone(this.assets.empty_item)},confirmDelete(){if(this.action.items.length<1)return B().toastErrors(["Select a record"]),!1;this.action.type="delete",B().confirmDialogDelete(this.listAction)},confirmDeleteAll(){this.action.type="delete-all",B().confirmDialogDelete(this.listAction)},async delayedSearch(){let n=this;this.query.page=1,this.action.items=[],clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.updateUrlQueryString(n.query),await n.getList()},this.search.delay_time)},async updateUrlQueryString(n){n=B().clone(n);let t=ct.stringify(n,{skipNulls:!0}),i=ct.parse(t);i.filter&&(i.filter=B().cleanObject(i.filter)),await this.$router.replace({query:null}),await this.$router.replace({query:i}),this.countFilters(i)},countFilters:function(n){if(this.count_filters=0,n&&n.filter){let t=B().cleanObject(n.filter);this.count_filters=Object.keys(t).length}},async clearSearch(){this.query.filter.q=null,await this.updateUrlQueryString(this.query),await this.getList()},async resetQuery(){await this.resetQueryString(),await this.getList()},async resetQueryString(){for(let n in this.query.filter)this.query.filter[n]=null;await this.updateUrlQueryString(this.query)},async getItemPermissions(){this.showProgress();let n={query:this.role_permissions_query,method:"post"};B().ajax(this.ajax_url+"/item/"+this.item.id+"/permissions",this.afterGetItemPermissions,n)},afterGetItemPermissions(n,t){this.hideProgress(),n&&(this.role_permissions=n)},async delayedRolePermissionSearch(){let n=this;n.item&&n.item.id&&(clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.getItemPermissions()},this.search.delay_time))},async permissionPaginate(n){this.role_permissions_query.page=n.page+1,await this.getItemPermissions()},async getItemUsers(){this.showProgress();let n={query:this.role_users_query,method:"get"};B().ajax(this.ajax_url+"/item/"+this.item.id+"/users",this.afterGetItemUsers,n)},afterGetItemUsers(n,t){this.hideProgress(),n&&(this.role_users=n)},async userPaginate(n){this.role_users_query.page=n.page+1,await this.getItemUsers()},async delayedRoleUsersSearch(){let n=this;n.item&&n.item.id&&(clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.getItemUsers()},this.search.delay_time))},changeRoleStatus(n){let t={inputs:[n]},i={};this.actions(!1,"change-role-permission-status",t,i)},afterChangeRoleStatus(n,t){this.hideProgress(),this.getItemPermissions(this.filter.page),this.$store.dispatch("root/reloadPermissions")},changeRolePermission(n){let t={id:this.item.id,permission_id:n.id},i={};n.pivot.is_active?i.is_active=0:i.is_active=1,this.actions(!1,"toggle-permission-active-status",t,i)},changeUserRole:function(n){let t={id:this.item.id,user_id:n.id},i={};n.pivot.is_active?i.is_active=0:i.is_active=1,this.actions(!1,"toggle-user-active-status",t,i)},bulkActions(n,t,i=this.role_permissions_query){let r={id:this.item.id,query:i,permission_id:null,user_id:null},a={is_active:n};this.actions(!1,t,r,a)},actions(n,t,i,r){this.showProgress(),n&&n.preventDefault();let a={params:{inputs:i,data:r},method:"post"};B().ajax(this.ajax_url+"/actions/"+t,this.afterActions,a)},async afterActions(n,t){await this.hideProgress(),await this.getItemPermissions(this.item.id),await this.getItemUsers(),await this.getList()},resetRolePermissionFilters(){this.role_permissions_query.q=null,this.role_permissions_query.module=null,this.role_permissions_query.section=null,this.role_permissions_query.rows=this.assets.rows},getModuleSection(){let n={params:{module:this.role_permissions_query.module},method:"post"};B().ajax(this.ajax_url+"/module/"+this.role_permissions_query.module+"/sections",this.afterAetModuleSection,n)},afterAetModuleSection(n,t){n&&(this.module_section_list=n)},resetRoleUserFilters(){this.role_users_query.q=null,this.role_users_query.rows=this.assets.rows},closeForm(){this.$router.push({name:"roles.index"})},toList(){this.item=null,this.$router.push({name:"roles.index"})},toForm(){this.item=B().clone(this.assets.empty_item),this.getFormMenu(),this.$router.push({name:"roles.form"})},toView(n){this.item=B().clone(n),this.$router.push({name:"roles.view",params:{id:n.id}})},toEdit(n){this.item=n,this.$router.push({name:"roles.form",params:{id:n.id}})},async toPermission(n){this.item=n,await this.getItemPermissions(),this.$router.push({name:"roles.permissions",params:{id:n.id}})},toUser(n){this.item=n,this.getItemUsers(),this.$router.push({name:"roles.users",params:{id:n.id}})},isViewLarge(){return this.view==="large"},getIdWidth(){let n=50;if(this.list&&this.list.total){let t=this.list.total.toString();t=t.length,n=t*40}return n+"px"},getActionWidth(){let n=100;return this.isViewLarge()||(n=80),n+"px"},getActionLabel(){let n=null;return this.isViewLarge()&&(n="Actions"),n},async getListSelectedMenu(){this.list_selected_menu=[{label:"Activate",command:async()=>{await this.updateList("activate")}},{label:"Deactivate",command:async()=>{await this.updateList("deactivate")}},{separator:!0},{label:"Trash",icon:"pi pi-times",command:async()=>{await this.updateList("trash")}},{label:"Restore",icon:"pi pi-replay",command:async()=>{await this.updateList("restore")}},{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDelete()}}]},getListBulkMenu(){this.list_bulk_menu=[{label:"Mark all as active",command:async()=>{await this.listAction("activate-all")}},{label:"Mark all as inactive",command:async()=>{await this.listAction("deactivate-all")}},{separator:!0},{label:"Trash All",icon:"pi pi-times",command:async()=>{await this.listAction("trash-all")}},{label:"Restore All",icon:"pi pi-replay",command:async()=>{await this.listAction("restore-all")}},{label:"Delete All",icon:"pi pi-trash",command:async()=>{this.confirmDeleteAll()}}]},getItemMenu(){let n=[];this.item&&this.item.deleted_at&&n.push({label:"Restore",icon:"pi pi-refresh",command:()=>{this.itemAction("restore")}}),this.item&&this.item.id&&!this.item.deleted_at&&n.push({label:"Trash",icon:"pi pi-times",command:()=>{this.itemAction("trash")}}),n.push({label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDeleteItem("delete")}}),this.item_menu_list=n},confirmDeleteItem(){this.form.type="delete",B().confirmDialogDelete(this.confirmDeleteItemAfter)},confirmDeleteItemAfter(){this.itemAction("delete",this.item)},async getFormMenu(){let n=[];this.item&&this.item.id?n=[{label:"Save & Close",icon:"pi pi-check",command:()=>{this.itemAction("save-and-close")}},{label:"Save & Clone",icon:"pi pi-copy",command:()=>{this.itemAction("save-and-clone")}},{label:"Save & New",icon:"pi pi-plus",command:()=>{this.itemAction("save-and-new")}},{label:"Trash",icon:"pi pi-times",command:()=>{this.itemAction("trash")}},{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDeleteItem("delete")}}]:n=[{label:"Create & Close",icon:"pi pi-check",command:()=>{this.itemAction("create-and-close")}},{label:"Create & Clone",icon:"pi pi-copy",command:()=>{this.itemAction("create-and-clone")}},{label:"Reset",icon:"pi pi-refresh",command:()=>{this.setActiveItemAsEmpty()}}],n.push({label:"Fill",icon:"pi pi-pencil",command:()=>{this.getFaker()}}),this.form_menu_list=n},getMenuItems(){this.list_bulk_menu=[{label:"Active All Permissions",command:async()=>{await this.listAction("activate-all")}},{label:"Inactive All Permissions",command:async()=>{await this.listAction("deactivate-all")}}]},async getPermissionMenuItems(){this.permission_menu_items=[{label:"Active All Permissions",command:()=>{this.bulkActions(1,"toggle-permission-active-status")}},{label:"Inactive All Permissions",command:()=>{this.bulkActions(0,"toggle-permission-active-status")}}]},async getRoleUserMenuItems(){this.role_user_menu_items=[{label:"Attach To All Users",command:()=>{this.bulkActions(1,"toggle-user-active-status",this.role_users_query)}},{label:"Detach To All Users",command:()=>{this.bulkActions(0,"toggle-user-active-status",this.role_users_query)}}]},hasPermission(n){const t=je();return B().hasPermission(t.permissions,n)},showProgress(){this.show_progress_bar=!0},hideProgress(){this.show_progress_bar=!1},strToSlug(n){return B().strToSlug(n)},setPageTitle(){this.title&&(document.title=this.title)}}}),TA=f("b",null,"Sort By:",-1),RA={class:"field-radiobutton"},DA=f("label",{for:"sort-none"},"None",-1),MA={class:"field-radiobutton"},$A=f("label",{for:"sort-ascending"},"Updated (Ascending)",-1),VA={class:"field-radiobutton"},BA=f("label",{for:"sort-descending"},"Updated (Descending)",-1),qA=f("b",null,"Is Active:",-1),FA={class:"field-radiobutton"},jA=f("label",{for:"active-all"},"All",-1),UA={class:"field-radiobutton"},NA=f("label",{for:"active-true"},"Only Active",-1),HA={class:"field-radiobutton"},KA=f("label",{for:"active-false"},"Only Inactive",-1),zA=f("b",null,"Trashed:",-1),WA={class:"field-radiobutton"},GA=f("label",{for:"trashed-exclude"},"Exclude Trashed",-1),YA={class:"field-radiobutton"},QA=f("label",{for:"trashed-include"},"Include Trashed",-1),XA={class:"field-radiobutton"},ZA=f("label",{for:"trashed-only"},"Only Trashed",-1),JA={__name:"Filters",setup(n){const t=jn();return(i,r)=>{const a=R("RadioButton"),s=R("Divider"),u=R("Sidebar");return _(),O("div",null,[x(u,{visible:o(t).show_filters,"onUpdate:visible":r[9]||(r[9]=l=>o(t).show_filters=l),style:{"z-index":"1101"},position:"right"},{default:T(()=>[x(mt,null,{label:T(()=>[TA]),default:T(()=>[f("div",RA,[x(a,{name:"sort-none",value:"","data-testid":"role-filter_sort_none",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[0]||(r[0]=l=>o(t).query.filter.sort=l)},null,8,["modelValue"]),DA]),f("div",MA,[x(a,{name:"sort-ascending",value:"updated_at","data-testid":"role-filter_sort_asc",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[1]||(r[1]=l=>o(t).query.filter.sort=l)},null,8,["modelValue"]),$A]),f("div",VA,[x(a,{name:"sort-descending",value:"updated_at:desc","data-testid":"role-filter_sort_desc",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[2]||(r[2]=l=>o(t).query.filter.sort=l)},null,8,["modelValue"]),BA])]),_:1}),x(s),x(mt,null,{label:T(()=>[qA]),default:T(()=>[f("div",FA,[x(a,{name:"active-all",value:"null","data-testid":"role-filter_status_all",modelValue:o(t).query.filter.is_active,"onUpdate:modelValue":r[3]||(r[3]=l=>o(t).query.filter.is_active=l)},null,8,["modelValue"]),jA]),f("div",UA,[x(a,{name:"active-true",value:"true","data-testid":"role-filter_status_active_only",modelValue:o(t).query.filter.is_active,"onUpdate:modelValue":r[4]||(r[4]=l=>o(t).query.filter.is_active=l)},null,8,["modelValue"]),NA]),f("div",HA,[x(a,{name:"active-false",value:"false","data-testid":"role-filter_status_inactive_only",modelValue:o(t).query.filter.is_active,"onUpdate:modelValue":r[5]||(r[5]=l=>o(t).query.filter.is_active=l)},null,8,["modelValue"]),KA])]),_:1}),x(mt,null,{label:T(()=>[zA]),default:T(()=>[f("div",WA,[x(a,{name:"trashed-exclude",value:"","data-testid":"role-filter_trashed_exclude",modelValue:o(t).query.filter.trashed,"onUpdate:modelValue":r[6]||(r[6]=l=>o(t).query.filter.trashed=l)},null,8,["modelValue"]),GA]),f("div",YA,[x(a,{name:"trashed-include",value:"include","data-testid":"role-filter_trashed_include",modelValue:o(t).query.filter.trashed,"onUpdate:modelValue":r[7]||(r[7]=l=>o(t).query.filter.trashed=l)},null,8,["modelValue"]),QA]),f("div",XA,[x(a,{name:"trashed-only",value:"only","data-testid":"role-filter_trashed_only",modelValue:o(t).query.filter.trashed,"onUpdate:modelValue":r[8]||(r[8]=l=>o(t).query.filter.trashed=l)},null,8,["modelValue"]),ZA])]),_:1})]),_:1},8,["visible"])])}}},e7={key:0},t7=f("i",{class:"pi pi-angle-down"},null,-1),n7={class:"grid p-fluid"},i7={class:"col-12"},s7={class:"p-inputgroup"},r7={__name:"Actions",setup(n){const t=jn();Te(async()=>{t.getListSelectedMenu(),t.getListBulkMenu()});const i=Ae(),r=u=>{i.value.toggle(u)},a=Ae(),s=u=>{a.value.toggle(u)};return(u,l)=>{const c=R("Badge"),d=R("Button"),p=R("Menu"),v=R("InputText");return _(),O("div",null,[f("div",{class:he([{"flex justify-content-between":o(t).isViewLarge()},"mt-2 mb-2"])},[o(t).view==="large"?(_(),O("div",e7,[o(t).hasPermission("can-manage-role")||o(t).hasPermission("can-update-role")?(_(),$(d,{key:0,class:"p-button-sm",type:"button","aria-haspopup":"true","aria-controls":"overlay_menu",onClick:r},{default:T(()=>[t7,o(t).action.items.length>0?(_(),$(c,{key:0,value:o(t).action.items.length},null,8,["value"])):A("",!0)]),_:1})):A("",!0),x(p,{ref_key:"selected_menu_state",ref:i,model:o(t).list_selected_menu,popup:!0},null,8,["model"]),o(t).hasPermission("can-manage-role")||o(t).hasPermission("can-update-role")?(_(),$(d,{key:1,class:"ml-1 p-button-sm",icon:"pi pi-ellipsis-h",type:"button","aria-haspopup":"true","aria-controls":"bulk_menu_state",onClick:s})):A("",!0),x(p,{ref_key:"bulk_menu_state",ref:a,model:o(t).list_bulk_menu,popup:!0},null,8,["model"])])):A("",!0),f("div",null,[f("div",n7,[f("div",i7,[f("div",s7,[x(v,{class:"p-inputtext-sm",modelValue:o(t).query.filter.q,"onUpdate:modelValue":l[0]||(l[0]=h=>o(t).query.filter.q=h),onKeyup:[l[1]||(l[1]=Ie(h=>o(t).delayedSearch(),["enter"])),l[2]||(l[2]=Ie(h=>o(t).delayedSearch(),["enter","native"])),l[3]||(l[3]=Ie(h=>o(t).delayedSearch(),["13"]))],placeholder:"Search","data-testid":"role-action_search_input"},null,8,["modelValue"]),x(d,{class:"p-button-sm",icon:"pi pi-search","data-testid":"role-action_search",onClick:l[4]||(l[4]=h=>o(t).delayedSearch())}),x(d,{class:"p-button-sm",type:"button",onClick:l[5]||(l[5]=h=>o(t).show_filters=!0),"data-testid":"role-action_filter"},{default:T(()=>[ue(" Filters "),o(t).count_filters>0?(_(),$(c,{key:0,value:o(t).count_filters},null,8,["value"])):A("",!0)]),_:1}),x(d,{class:"p-button-sm",label:"Reset",icon:"pi pi-filter-slash",type:"button",onClick:l[6]||(l[6]=h=>o(t).resetQuery()),"data-testid":"role-action_filter_reset"})])]),x(JA)])])],2)])}}},o7={key:0},a7={class:"p-inputgroup"},l7={__name:"Table",setup(n){const t=jn(),i=B();return(r,a)=>{const s=R("Column"),u=R("Badge"),l=R("Button"),c=R("InputSwitch"),d=R("DataTable"),p=R("Paginator"),v=Ke("tooltip");return o(t).list?(_(),O("div",o7,[x(d,{value:o(t).list.data,dataKey:"id",class:"p-datatable-sm p-datatable-hoverable-rows",selection:o(t).action.items,"onUpdate:selection":a[0]||(a[0]=h=>o(t).action.items=h),stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[o(t).isViewLarge()?(_(),$(s,{key:0,selectionMode:"multiple",headerStyle:"width: 3em"})):A("",!0),x(s,{field:"id",header:"ID",style:St({width:o(t).getIdWidth()}),sortable:!0},null,8,["style"]),x(s,{field:"name",header:"Name",sortable:!0},{body:T(h=>[h.data.deleted_at?(_(),$(u,{key:0,value:"Trashed",severity:"danger"})):A("",!0),ue(" "+Q(h.data.name),1)]),_:1}),o(t).isViewLarge()?(_(),$(s,{key:1,field:"slug",header:"Slug",sortable:!0},{body:T(h=>[ce(x(l,{class:"p-button-tiny p-button-text p-0 mr-2","data-testid":"role-list_slug_copy",onClick:m=>o(i).copy(h.data.slug),icon:"pi pi-copy",label:h.data.slug},null,8,["onClick","label"]),[[v,"Copy Slug",void 0,{top:!0}]])]),_:1})):A("",!0),x(s,{field:"permissions",header:"Permissions"},{body:T(h=>[o(t).hasPermission("can-read-roles")?ce((_(),$(l,{key:0,class:"p-button-sm p-button-rounded white-space-nowrap",onClick:m=>o(t).toPermission(h.data),"data-testid":"role-list_permission_view"},{default:T(()=>[ue(Q(h.data.count_permissions)+" / "+Q(o(t).total_permissions),1)]),_:2},1032,["onClick"])),[[v,"View Permissions",void 0,{top:!0}]]):A("",!0)]),_:1}),x(s,{field:"users",header:"Users"},{body:T(h=>[o(t).hasPermission("can-read-roles")?ce((_(),$(l,{key:0,class:"p-button-sm p-button-rounded white-space-nowrap",onClick:m=>o(t).toUser(h.data),"data-testid":"role-list_user_view"},{default:T(()=>[ue(Q(h.data.count_users)+" / "+Q(o(t).total_users),1)]),_:2},1032,["onClick"])),[[v,"View Users",void 0,{top:!0}]]):A("",!0)]),_:1}),o(t).isViewLarge()?(_(),$(s,{key:2,field:"updated_at",header:"Updated",style:{width:"150px"},sortable:!0},{body:T(h=>[ue(Q(o(i).ago(h.data.updated_at)),1)]),_:1})):A("",!0),o(t).isViewLarge()?(_(),$(s,{key:3,field:"is_active",sortable:!1,style:{width:"100px"},header:"Is Active"},{body:T(h=>[x(c,{modelValue:h.data.is_active,"onUpdate:modelValue":m=>h.data.is_active=m,modelModifiers:{bool:!0},"false-value":0,"true-value":1,class:"p-inputswitch-sm","data-testid":"role-list_status",onInput:m=>o(t).toggleIsActive(h.data)},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1})):A("",!0),x(s,{field:"actions",style:St([{width:"150px"},{width:o(t).getActionWidth()}]),header:o(t).getActionLabel()},{body:T(h=>[f("div",a7,[o(t).hasPermission("can-read-roles")?ce((_(),$(l,{key:0,class:"p-button-tiny p-button-text",onClick:m=>o(t).toView(h.data),icon:"pi pi-eye","data-testid":"role-item_view"},null,8,["onClick"])),[[v,"View",void 0,{top:!0}]]):A("",!0),o(t).hasPermission("can-update-roles")?ce((_(),$(l,{key:1,class:"p-button-tiny p-button-text",onClick:m=>o(t).toEdit(h.data),icon:"pi pi-pencil","data-testid":"role-item_edit"},null,8,["onClick"])),[[v,"Update",void 0,{top:!0}]]):A("",!0),o(t).isViewLarge()&&!h.data.deleted_at&&o(t).hasPermission("can-update-roles")?ce((_(),$(l,{key:2,class:"p-button-tiny p-button-danger p-button-text",onClick:m=>o(t).itemAction("trash",h.data),icon:"pi pi-trash","data-testid":"role-item_trash"},null,8,["onClick"])),[[v,"Trash",void 0,{top:!0}]]):A("",!0),o(t).isViewLarge()&&h.data.deleted_at?ce((_(),$(l,{key:3,class:"p-button-tiny p-button-success p-button-text",onClick:m=>o(t).itemAction("restore",h.data),icon:"pi pi-replay","data-testid":"role-item_restore"},null,8,["onClick"])),[[v,"Restore",void 0,{top:!0}]]):A("",!0)])]),_:1},8,["style","header"])]),_:1},8,["value","selection"]),x(p,{first:o(t).firstElement,"onUpdate:first":a[1]||(a[1]=h=>o(t).firstElement=h),rows:o(t).query.rows,totalRecords:o(t).list.total,onPage:a[2]||(a[2]=h=>o(t).paginate(h)),rowsPerPageOptions:o(t).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["first","rows","totalRecords","rowsPerPageOptions"])])):A("",!0)}}},u7={class:"grid"},c7={class:"flex flex-row"},d7=f("b",{class:"mr-1"},"Roles",-1),p7={class:"p-inputgroup"},h7={__name:"List",setup(n){const t=jn(),i=Ge();return _t(),Te(async()=>{await t.onLoad(i),await t.setPageTitle(),await t.watchRoutes(i),await t.watchStates(),await t.getAssets(),await t.getList()}),(r,a)=>{const s=R("Badge"),u=R("Button"),l=R("Panel"),c=R("RouterView");return _(),O("div",u7,[f("div",{class:he("col-"+o(t).list_view_width)},[x(l,{class:"is-small"},{header:T(()=>[f("div",c7,[f("div",null,[d7,o(t).list&&o(t).list.total>0?(_(),$(s,{key:0,value:o(t).list.total},null,8,["value"])):A("",!0)])])]),icons:T(()=>[f("div",p7,[o(t).hasPermission("can-create-roles")?(_(),$(u,{key:0,class:"p-button-sm",label:"Create",icon:"pi pi-plus",onClick:a[0]||(a[0]=d=>o(t).toForm()),"data-testid":"role-create"})):A("",!0),x(u,{class:"p-button-sm",icon:"pi pi-refresh",loading:o(t).is_btn_loading,onClick:a[1]||(a[1]=d=>o(t).sync()),"data-testid":"role-list_refresh"},null,8,["loading"])])]),default:T(()=>[x(r7),x(l7)]),_:1})],2),x(c)])}}},f7={class:"col-6"},m7={class:"flex flex-row"},g7={class:"font-semibold text-sm"},v7={key:0},y7={key:1},_7={class:"p-inputgroup"},b7={key:0,class:"mt-2"},w7={__name:"Form",setup(n){const t=jn(),i=je(),r=Ge(),a=B();Te(async()=>{r.params&&r.params.id&&await t.getItem(r.params.id),t.getFormMenu(),await i.getIsActiveStatusOptions()}),We(t.item,async(l,c)=>{t.item.slug=t.strToSlug(l.name)});const s=Ae(),u=l=>{s.value.toggle(l)};return(l,c)=>{const d=R("Button"),p=R("Menu"),v=R("InputText"),h=R("Textarea"),m=R("SelectButton"),b=R("Panel"),I=Ke("tooltip");return _(),O("div",f7,[x(b,{class:"is-small"},{header:T(()=>[f("div",m7,[f("div",g7,[o(t).item&&o(t).item.id?(_(),O("span",v7,Q(o(t).item.name),1)):(_(),O("span",y7," Create "))])])]),icons:T(()=>[f("div",_7,[o(t).item&&o(t).item.id?(_(),$(d,{key:0,class:"p-button-sm",label:"#"+o(t).item.id,onClick:c[0]||(c[0]=k=>o(a).copy(o(t).item.id)),"data-testid":"role-form_id"},null,8,["label"])):A("",!0),o(t).item&&o(t).item.id?(_(),$(d,{key:1,class:"p-button-sm",label:"Save",icon:"pi pi-save","data-testid":"role-edit_save",onClick:c[1]||(c[1]=k=>o(t).itemAction("save"))})):(_(),$(d,{key:2,class:"p-button-sm",label:"Create & New",icon:"pi pi-save","data-testid":"role-new_save",onClick:c[2]||(c[2]=k=>o(t).itemAction("create-and-new"))})),o(t).hasPermission("can-update-roles")||o(t).hasPermission("can-manage-roles")?(_(),$(d,{key:3,class:"p-button-sm",icon:"pi pi-angle-down",type:"button","aria-haspopup":"true",onClick:u,"data-testid":"role-form_menu"})):A("",!0),x(p,{ref_key:"form_menu",ref:s,model:o(t).form_menu_list,popup:!0},null,8,["model"]),o(t).item&&o(t).item.id||o(t).hasPermission("can-read-roles")?ce((_(),$(d,{key:4,class:"p-button-sm",icon:"pi pi-eye","data-testid":"role-item_view",onClick:c[3]||(c[3]=k=>o(t).toView(o(t).item))},null,512)),[[I,"View",void 0,{top:!0}]]):A("",!0),x(d,{class:"p-button-sm",icon:"pi pi-times","data-testid":"role-list_view",onClick:c[4]||(c[4]=k=>o(t).toList())})])]),default:T(()=>[o(t).item?(_(),O("div",b7,[x($e,{label:"Name"},{default:T(()=>[x(v,{class:"w-full",modelValue:o(t).item.name,"onUpdate:modelValue":[c[5]||(c[5]=k=>o(t).item.name=k),o(t).watchItem],"data-testid":"role-item_name"},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),x($e,{label:"Slug"},{default:T(()=>[x(v,{class:"w-full",modelValue:o(t).item.slug,"onUpdate:modelValue":c[6]||(c[6]=k=>o(t).item.slug=k),"data-testid":"role-item_slug"},null,8,["modelValue"])]),_:1}),x($e,{label:"Details"},{default:T(()=>[x(h,{class:"w-full",modelValue:o(t).item.details,"onUpdate:modelValue":c[7]||(c[7]=k=>o(t).item.details=k),"data-testid":"role-item_details"},null,8,["modelValue"])]),_:1}),x($e,{label:"Is Active"},{default:T(()=>[o(i)&&o(i).is_active_status_options?(_(),$(m,{key:0,modelValue:o(t).item.is_active,"onUpdate:modelValue":c[8]||(c[8]=k=>o(t).item.is_active=k),"data-testid":"role-item_status",options:o(i).is_active_status_options,"option-label":"label","option-value":"value"},null,8,["modelValue","options"])):A("",!0)]),_:1})])):A("",!0)]),_:1})])}}},C7={class:"col-6"},S7={class:"flex flex-row"},k7={class:"font-semibold text-sm"},x7={class:"p-inputgroup"},I7={key:0,class:"mt-1"},L7={class:"flex align-items-center justify-content-between"},P7={class:""},O7={class:"ml-3"},E7={class:"p-datatable p-component p-datatable-responsive-scroll p-datatable-striped p-datatable-sm"},A7={class:"p-datatable-table"},T7={class:"p-datatable-tbody"},R7={__name:"Item",setup(n){const t=jn(),i=Ge(),r=B();Te(async()=>{if(i.params&&!i.params.id)return t.toList(),!1;i.params&&i.params.id&&await t.getItem(i.params.id)});const a=Ae(),s=u=>{a.value.toggle(u)};return(u,l)=>{const c=R("Button"),d=R("Menu"),p=R("Message"),v=R("Panel");return _(),O("div",C7,[o(t)&&o(t).item?(_(),$(v,{key:0,class:"is-small"},{header:T(()=>[f("div",S7,[f("div",k7,Q(o(t).item.name),1)])]),icons:T(()=>[f("div",x7,[x(c,{class:"p-button-sm",label:"#"+o(t).item.id,onClick:l[0]||(l[0]=h=>o(r).copy(o(t).item.id)),"data-testid":"role-item_id"},null,8,["label"]),o(t).hasPermission("can-update-roles")?(_(),$(c,{key:0,class:"p-button-sm",label:"Edit",icon:"pi pi-pencil",onClick:l[1]||(l[1]=h=>o(t).toEdit(o(t).item)),"data-testid":"role-item_edit"})):A("",!0),o(t).hasPermission("can-update-roles")||o(t).hasPermission("can-manage-roles")?(_(),$(c,{key:1,class:"p-button-sm",icon:"pi pi-angle-down",type:"button","aria-haspopup":"true","data-testid":"role-item_menu",onClick:s})):A("",!0),x(d,{ref_key:"item_menu_state",ref:a,model:o(t).item_menu_list,popup:!0},null,8,["model"]),x(c,{class:"p-button-sm",icon:"pi pi-times",onClick:l[2]||(l[2]=h=>o(t).toList()),"data-testid":"role-item_list"})])]),default:T(()=>[o(t).item?(_(),O("div",I7,[o(t).item.deleted_at?(_(),$(p,{key:0,severity:"error",class:"p-container-message",closable:!1,icon:"pi pi-trash"},{default:T(()=>[f("div",L7,[f("div",P7," Deleted "+Q(o(t).item.deleted_at),1),f("div",O7,[x(c,{label:"Restore",class:"p-button-sm",onClick:l[3]||(l[3]=h=>o(t).itemAction("restore")),"data-testid":"role-item_restore"})])])]),_:1})):A("",!0),f("div",E7,[f("table",A7,[f("tbody",T7,[(_(!0),O(ne,null,xe(o(t).item,(h,m)=>(_(),O(ne,null,[m==="created_by"||m==="updated_by"?(_(),O(ne,{key:0},[],64)):m==="id"||m==="uuid"||m==="slug"?(_(),$(at,{key:1,label:m,value:h,can_copy:!0},null,8,["label","value"])):(m==="created_by_user"||m==="updated_by_user"||m==="deleted_by_user")&&typeof h=="object"&&h!==null?(_(),$(at,{key:2,label:m,value:h,type:"user"},null,8,["label","value"])):m==="is_active"?(_(),$(at,{key:3,label:m,value:h,type:"yes-no"},null,8,["label","value"])):(_(),$(at,{key:4,label:m,value:h},null,8,["label","value"]))],64))),256))])])])])):A("",!0)]),_:1})):A("",!0)])}}},D7={key:0},M7={__name:"PermissionDetailsView",setup(n){const t=jn();return Te(async()=>{t.item||await t.getItem(route.params.id)}),(i,r)=>{const a=R("Divider");return _(),O("div",null,[o(t)&&o(t).active_role_permission?(_(),O("div",D7,[f("p",null,[ue("Created By : "),f("span",null,Q(o(t).active_role_permission.json.created_by),1)]),x(a,{class:"is-small"}),f("p",null,[ue("Updated By : "),f("span",null,Q(o(t).active_role_permission.json.updated_by),1)]),x(a,{class:"is-small"}),f("p",null,[ue("Created At : "),f("span",null,Q(o(t).active_role_permission.json.created_at),1)]),x(a,{class:"is-small"}),f("p",null,[ue("Updated At : "),f("span",null,Q(o(t).active_role_permission.json.updated_at),1)])])):A("",!0)])}}},$7={class:"col-6"},V7={class:"flex flex-row"},B7={class:"font-semibold text-sm"},q7={class:"p-inputgroup"},F7={class:"flex justify-content-between mt-3 mb-1"},j7={key:0},U7={key:1,class:"mx-1"},N7={class:"grid p-fluid"},H7={class:"col-12"},K7={class:"p-inputgroup"},z7={class:"p-input-icon-left"},W7=f("i",{class:"pi pi-search"},null,-1),G7={class:"flex"},Y7={class:"pl-2"},Q7={__name:"ViewPermission",setup(n){const t=B(),i=jn(),r=Ge(),a=je();Te(async()=>{if(r.params&&!r.params.id)return i.toList(),!1;r.params&&r.params.id&&await i.getItem(r.params.id),i.item&&!i.role_permissions&&await i.getItemPermissions(),await i.getPermissionMenuItems(),await a.getPermission()});const s=Ae(),u=v=>{s.value.toggle(v)},l=Rr(),c=()=>{l.open(M7,{props:{header:"Details",style:{width:"50vw"},breakpoints:{"960px":"75vw","640px":"90vw"},modal:!0}})},d=_t(),p=(v,h)=>{d.require({group:"templating",message:"Are you sure you want to change the status? This action will impact all roles that assign to this permission.",header:"Changing Status",icon:"pi pi-exclamation-circle text-red-600",acceptClass:"p-button p-button-danger is-small",acceptLabel:"Change",rejectLabel:"Cancel",rejectClass:" is-small btn-dark",accept:()=>{i.changeRoleStatus(h)}})};return(v,h)=>{const m=R("Button"),b=R("Menu"),I=R("Dropdown"),k=R("InputText"),y=R("Column"),g=R("DataTable"),C=R("Paginator"),w=R("Panel"),S=R("ConfirmDialog"),L=R("DynamicDialog"),P=Ke("tooltip");return _(),O("div",$7,[o(i)&&o(i).item?(_(),$(w,{key:0,class:"is-small"},{header:T(()=>[f("div",V7,[f("div",B7,Q(o(i).item.name),1)])]),icons:T(()=>[f("div",q7,[x(m,{class:"p-button-sm",label:"#"+o(i).item.id,onClick:h[0]||(h[0]=E=>o(t).copy(o(i).item.id)),"data-testid":"role-permission_id"},null,8,["label"]),o(i).hasPermission("can-update-roles")||o(i).hasPermission("can-manage-roles")?(_(),O(ne,{key:0},[x(m,{class:"p-button-sm",icon:"pi pi-angle-down",type:"button","aria-haspopup":"true",onClick:u,"data-testid":"role-permission_menu"}),x(b,{ref_key:"permission_menu",ref:s,model:o(i).permission_menu_items,popup:!0},null,8,["model"])],64)):A("",!0),x(m,{class:"p-button-sm",icon:"pi pi-times",onClick:h[1]||(h[1]=E=>o(i).toList()),"data-testid":"role-permission_list"})])]),default:T(()=>[f("div",F7,[o(i)&&o(i).assets?(_(),O("div",j7,[x(I,{modelValue:o(i).role_permissions_query.module,"onUpdate:modelValue":h[2]||(h[2]=E=>o(i).role_permissions_query.module=E),options:o(i).assets.modules,placeholder:"Select a Module","data-testid":"role-permission_module",onChange:h[3]||(h[3]=E=>o(i).getModuleSection()),class:"is-small"},{option:T(E=>[f("div",null,Q(E.option.charAt(0).toUpperCase()+E.option.slice(1)),1)]),_:1},8,["modelValue","options"])])):A("",!0),o(i).role_permissions_query.module&&o(i).module_section_list?(_(),O("div",U7,[x(I,{modelValue:o(i).role_permissions_query.section,"onUpdate:modelValue":h[4]||(h[4]=E=>o(i).role_permissions_query.section=E),options:o(i).module_section_list,placeholder:"Select a Section",onClick:h[5]||(h[5]=E=>o(i).getItemPermissions()),"data-testid":"role-permission_section",class:"is-small"},{option:T(E=>[f("div",null,Q(E.option.charAt(0).toUpperCase()+E.option.slice(1)),1)]),_:1},8,["modelValue","options"])])):A("",!0),f("div",N7,[f("div",H7,[f("div",K7,[f("span",z7,[W7,x(k,{modelValue:o(i).role_permissions_query.q,"onUpdate:modelValue":h[6]||(h[6]=E=>o(i).role_permissions_query.q=E),onKeyup:[h[7]||(h[7]=Ie(E=>o(i).delayedRolePermissionSearch(),["enter"])),h[8]||(h[8]=Ie(E=>o(i).delayedRolePermissionSearch(),["enter","native"])),h[9]||(h[9]=Ie(E=>o(i).delayedRolePermissionSearch(),["13"]))],placeholder:"Search",type:"text",class:"w-full","data-testid":"role-permission_search"},null,8,["modelValue"])]),x(m,{label:"Reset",onClick:h[10]||(h[10]=E=>o(i).resetRolePermissionFilters()),"data-testid":"role-permission_search_reset"})])])])]),o(i)&&o(i).role_permissions?(_(),$(g,{key:0,value:o(i).role_permissions.list.data,dataKey:"id",class:"p-datatable-sm",stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[x(y,{field:"name",header:"Name",class:"flex align-items-center"},{body:T(E=>[ce(x(m,{class:"p-button-tiny p-button-text p-0 mr-2","data-testid":"role-permission_name_copy",onClick:M=>o(t).copy(E.data.slug),icon:"pi pi-copy",label:E.data.name},null,8,["onClick","label"]),[[P,"Copy Slug",void 0,{top:!0}]])]),_:1}),x(y,{field:"has-permission",header:"Has Permission"},Mt({_:2},[o(i).hasPermission("can-update-roles")||o(i).hasPermission("can-manage-roles")?{name:"body",fn:T(E=>[E.data.pivot.is_active===1?(_(),$(m,{key:0,label:"Yes",class:"p-button-sm p-button-success p-button-rounded",onClick:M=>o(i).changeRolePermission(E.data),"data-testid":"role-permission_status_yes"},null,8,["onClick"])):(_(),$(m,{key:1,label:"No",class:"p-button-sm p-button-danger p-button-rounded","data-testid":"role-permission_status_no",onClick:M=>o(i).changeRolePermission(E.data)},null,8,["onClick"]))]),key:"0"}:{name:"body",fn:T(E=>[E.data.pivot.is_active===1?(_(),$(m,{key:0,label:"Yes",class:"p-button-sm p-button-success p-button-rounded",disabled:""})):(_(),$(m,{key:1,label:"No",class:"p-button-sm p-button-danger p-button-rounded",disabled:""}))]),key:"1"}]),1024),x(y,{field:"is-active",header:"Permission Status"},Mt({_:2},[(o(i).hasPermission("can-update-permissions")||o(i).hasPermission("can-manage-permissions"))&&(o(i).hasPermission("can-update-roles")||o(i).hasPermission("can-manage-roles"))?{name:"body",fn:T(E=>[E.data.is_active===1?(_(),$(m,{key:0,label:"Active",class:"p-button-sm p-button-rounded p-button-success",onClick:M=>p(v.event,E.data.id),"data-testid":"role-permission_status_active"},null,8,["onClick"])):(_(),$(m,{key:1,label:"Inactive","data-testid":"role-permission_status_inactive",class:"p-button-sm p-button-danger p-button-rounded",onClick:M=>p(v.event,E.data.id)},null,8,["onClick"]))]),key:"0"}:{name:"body",fn:T(E=>[E.data.is_active===1?(_(),$(m,{key:0,label:"Active",class:"p-button-sm p-button-rounded p-button-success",disabled:""})):(_(),$(m,{key:1,label:"Inactive",class:"p-button-sm p-button-danger p-button-rounded",disabled:""}))]),key:"1"}]),1024),x(y,null,{body:T(E=>[x(m,{class:"p-button-sm p-button-rounded p-button-outlined",onClick:M=>(c(),o(i).active_role_permission=E.data),icon:"pi pi-eye",label:"View","data-testid":"role-permission_view_modal"},null,8,["onClick"])]),_:1})]),_:1},8,["value"])):A("",!0),o(i)&&o(i).role_permissions?(_(),$(C,{key:1,rows:o(i).role_permissions_query.rows,"onUpdate:rows":h[11]||(h[11]=E=>o(i).role_permissions_query.rows=E),totalRecords:o(i).role_permissions.list.total,onPage:h[12]||(h[12]=E=>o(i).permissionPaginate(E)),rowsPerPageOptions:o(i).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["rows","totalRecords","rowsPerPageOptions"])):A("",!0)]),_:1})):A("",!0),x(S,{group:"templating",class:"is-small",style:{width:"400px"},breakpoints:{"600px":"100vw"}},{message:T(E=>[f("div",G7,[f("i",{class:he(E.message.icon),style:{"font-size":"1.5rem"}},null,2),f("p",Y7,Q(E.message.message),1)])]),_:1}),x(L)])}}},X7={key:0},Z7={__name:"RoleUserDetailsView",setup(n){const t=jn();return Te(async()=>{t.item||await t.getItem(route.params.id)}),(i,r)=>{const a=R("Divider");return _(),O("div",null,[o(t)&&o(t).active_role_user?(_(),O("div",X7,[f("p",null,[ue("Created By : "),f("span",null,Q(o(t).active_role_user.json.created_by),1)]),x(a,{class:"is-small"}),f("p",null,[ue("Updated By : "),f("span",null,Q(o(t).active_role_user.json.updated_by),1)]),x(a,{class:"is-small"}),f("p",null,[ue("Created At : "),f("span",null,Q(o(t).active_role_user.json.created_at),1)]),x(a,{class:"is-small"}),f("p",null,[ue("Updated At : "),f("span",null,Q(o(t).active_role_user.json.updated_at),1)])])):A("",!0)])}}},J7={class:"col-6"},eT={class:"flex flex-row"},tT={class:"font-semibold text-sm"},nT={class:"p-inputgroup"},iT={class:"grid p-fluid mt-1 mb-2"},sT={class:"col-12"},rT={class:"p-inputgroup"},oT={class:"p-input-icon-left"},aT=f("i",{class:"pi pi-search"},null,-1),lT={__name:"ViewUser",setup(n){const t=jn(),i=Ge(),r=B();Te(async()=>{if(i.params&&!i.params.id)return t.toList(),!1;i.params&&i.params.id&&await t.getItem(i.params.id),t.item&&!t.role_users&&await t.getItemUsers(),await t.getRoleUserMenuItems()});const a=Ae(),s=c=>{a.value.toggle(c)},u=Rr(),l=()=>{u.open(Z7,{props:{header:"Details",style:{width:"50vw"},breakpoints:{"960px":"75vw","640px":"90vw"},modal:!0}})};return(c,d)=>{const p=R("Button"),v=R("Menu"),h=R("InputText"),m=R("Column"),b=R("DataTable"),I=R("Paginator"),k=R("Panel"),y=R("DynamicDialog");return _(),O("div",J7,[o(t)&&o(t).item?(_(),$(k,{key:0,class:"is-small"},{header:T(()=>[f("div",eT,[f("div",tT,Q(o(t).item.name),1)])]),icons:T(()=>[f("div",nT,[x(p,{class:"p-button-sm",label:"#"+o(t).item.id,onClick:d[0]||(d[0]=g=>o(r).copy(o(t).item.id)),"data-testid":"role-user_id"},null,8,["label"]),o(t).hasPermission("can-update-roles")||o(t).hasPermission("can-manage-roles")?(_(),O(ne,{key:0},[x(p,{class:"p-button-sm",icon:"pi pi-angle-down",type:"button","aria-haspopup":"true","data-testid":"role-user_menu",onClick:s}),x(v,{ref_key:"uer_items_menu",ref:a,model:o(t).role_user_menu_items,popup:!0},null,8,["model"])],64)):A("",!0),x(p,{class:"p-button-sm",icon:"pi pi-times","data-testid":"role-user_list",onClick:d[1]||(d[1]=g=>o(t).toList())})])]),default:T(()=>[f("div",iT,[f("div",sT,[f("div",rT,[f("span",oT,[aT,x(h,{modelValue:o(t).role_users_query.q,"onUpdate:modelValue":d[2]||(d[2]=g=>o(t).role_users_query.q=g),onKeyup:[d[3]||(d[3]=Ie(g=>o(t).delayedRoleUsersSearch(),["enter"])),d[4]||(d[4]=Ie(g=>o(t).delayedRoleUsersSearch(),["enter","native"])),d[5]||(d[5]=Ie(g=>o(t).delayedRoleUsersSearch(),["13"]))],placeholder:"Search",type:"text","data-testid":"role-user_search",class:"w-full p-inputtext-sm"},null,8,["modelValue"])]),x(p,{class:"p-button-sm","data-testid":"role-user_search_reset",label:"Reset",onClick:d[6]||(d[6]=g=>o(t).resetRoleUserFilters())})])])]),o(t)&&o(t).role_users?(_(),$(b,{key:0,value:o(t).role_users.list.data,dataKey:"id",class:"p-datatable-sm",stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[x(m,{field:"name",header:"Name"},{body:T(g=>[ue(Q(g.data.name),1)]),_:1}),x(m,{field:"email",header:"Email"},{body:T(g=>[ue(Q(g.data.email),1)]),_:1}),x(m,{field:"has-role",header:"Has Role"},Mt({_:2},[o(t).hasPermission("can-update-roles")||o(t).hasPermission("can-manage-roles")?{name:"body",fn:T(g=>[g.data.pivot.is_active===1?(_(),$(p,{key:0,label:"Yes",class:"p-button-sm p-button-success p-button-rounded",onClick:C=>o(t).changeUserRole(g.data),"data-testid":"role-user_status_yes"},null,8,["onClick"])):(_(),$(p,{key:1,label:"No",class:"p-button-sm p-button-danger p-button-rounded","data-testid":"role-user_status_no",onClick:C=>o(t).changeUserRole(g.data)},null,8,["onClick"]))]),key:"0"}:{name:"body",fn:T(g=>[g.data.pivot.is_active===1?(_(),$(p,{key:0,label:"Yes",class:"p-button-sm p-button-success p-button-rounded",disabled:""})):(_(),$(p,{key:1,label:"No",class:"p-button-sm p-button-danger p-button-rounded",disabled:""}))]),key:"1"}]),1024),x(m,null,{body:T(g=>[x(p,{class:"p-button-sm p-button-rounded p-button-outlined",onClick:C=>(l(),o(t).active_role_user=g.data),icon:"pi pi-eye",label:"View","data-testid":"role-user_view_details"},null,8,["onClick"])]),_:1})]),_:1},8,["value"])):A("",!0),o(t)&&o(t).role_users?(_(),$(I,{key:1,rows:o(t).role_users_query.rows,"onUpdate:rows":d[7]||(d[7]=g=>o(t).role_users_query.rows=g),totalRecords:o(t).role_users.list.total,onPage:d[8]||(d[8]=g=>o(t).userPaginate(g)),rowsPerPageOptions:o(t).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["rows","totalRecords","rowsPerPageOptions"])):A("",!0)]),_:1})):A("",!0),x(y)])}}};let gf=[],vf=[];vf={path:"/vaah/roles/",component:yn,props:!0,children:[{path:"",name:"roles.index",component:h7,props:!0,children:[{path:"form/:id?",name:"roles.form",component:w7,props:!0},{path:"view/:id?",name:"roles.view",component:R7,props:!0},{path:"permissions/:id?",name:"roles.permissions",component:Q7,props:!0},{path:"users/:id?",name:"roles.users",component:lT,props:!0}]}]};gf.push(vf);const uT={class:"grid justify-content-center"},cT={class:"col-fixed"},dT={class:"col"},pT={__name:"AdvancedLayout",setup(n){const t=Ge(),i=Ae([{label:"ADVANCED",items:[{label:"Logs",icon:"pi pi-book",to:{path:"/vaah/advanced/logs"}},{label:"Jobs",icon:"pi pi-align-justify",to:{path:"/vaah/advanced/jobs"}},{label:"Failed Jobs",icon:"pi pi-times-circle",to:{path:"/vaah/advanced/failedjobs"}},{label:"Batches",icon:"pi pi-server",to:{path:"/vaah/advanced/batches"}}]}]),r=Ae({menuitem:({props:a})=>({class:t.matched&&t.matched[3]&&t.matched[3].path===a.item.to.path?"p-focus":""})});return Te(async()=>{}),(a,s)=>{const u=R("Menu"),l=R("router-view");return _(),O("div",uT,[f("div",cT,[x(u,{model:i.value,pt:r.value},null,8,["model","pt"])]),f("div",dT,[x(l)])])}}};let hT="WebReinvent\\VaahCms\\Models\\Job",yf=document.getElementsByTagName("base")[0].getAttribute("href"),fT=yf+"/vaah/jobs",To={query:{page:1,rows:20,filter:{q:null,is_active:null,trashed:null,sort:null,queue:null}},action:{type:null,items:[]}};const Ca=Ot({id:"jobs",state:()=>({title:"Jobs - Advanced",page:1,rows:20,base_url:yf,ajax_url:fT,model:hT,assets_is_fetching:!0,app:null,assets:null,rows_per_page:[10,20,30,50,100,500],list:null,item:null,fillable:null,empty_query:To.query,empty_action:To.action,query:B().clone(To.query),action:B().clone(To.action),search:{delay_time:600,delay_timer:0},route:null,watch_stopper:null,route_prefix:"jobs.",view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],item_menu_list:[],item_menu_state:null,form_menu_list:[],payload_modal:!1,payload_content:null,first_element:null}),actions:{async onLoad(n){this.route=n,this.first_element=(this.query.page-1)*this.query.rows,this.updateQueryFromUrl(n)},async updateQueryFromUrl(n){if(n.query&&Object.keys(n.query).length>0){for(let t in n.query)this.query[t]=n.query[t];this.countFilters(n.query)}},watchRoutes(n){this.watch_stopper=We(n,(t,i)=>{if(this.watch_stopper&&!t.name.includes(this.route_prefix))return this.watch_stopper(),!1;this.route=t,t.params.id&&this.getItem(t.params.id)},{deep:!0})},watchStates(){We(this.query.filter,(n,t)=>{this.delayedSearch()},{deep:!0})},async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,B().ajax(this.ajax_url+"/assets",this.afterGetAssets))},afterGetAssets(n,t){n&&(this.assets=n,n.rows&&(this.query.rows?this.query.rows=parseInt(this.query.rows):this.query.rows=n.rows))},async getList(){let n={query:B().clone(this.query)};await this.updateUrlQueryString(this.query),await B().ajax(this.ajax_url,await this.getListAfter,n)},async getListAfter(n,t){this.is_btn_loading=!1,n&&(this.list=n,this.first_element=(this.query.page-1)*this.query.rows)},isListActionValid(){return this.action.type?this.action.items.length<1?(B().toastErrors(["Select records"]),!1):!0:(B().toastErrors(["Select an action type"]),!1)},async updateListAfter(n,t){n&&(this.action=B().clone(this.empty_action),await this.getList())},async listAction(n=null){!n&&this.action.type?n=this.action.type:this.action.type=n;let t=this.ajax_url+"/action/"+n,i="PUT";switch(n){case"delete":t=this.ajax_url,i="DELETE";break;case"delete-all":i="DELETE";break}let r={params:this.action,method:i,show_success:!1};await B().ajax(t,this.updateListAfter,r)},itemAction(n,t=null){t||(t=this.item),this.form.action=n;let i=this.ajax_url,r={method:"post"};switch(n){case"delete":r.method="DELETE",i+="/"+t.id;break;default:r.method="PATCH",i+="/"+t.id+"/action/"+n;break}B().ajax(i,this.itemActionAfter,r)},async itemActionAfter(n,t){n&&(this.item=n,await this.getList())},async paginate(n){this.query.page=n.page+1,this.query.rows=n.rows,this.first_element=this.query.rows*(this.query.page-1),await this.getList()},async reload(){await this.getAssets(),await this.getList()},onItemSelection(n){this.action.items=n},confirmDelete(){if(this.action.items.length<1)return B().toastErrors(["Select a record"]),!1;this.action.type="delete",B().confirmDialogDelete(this.listAction)},confirmDeleteAll(){this.action.type="delete-all",B().confirmDialogDelete(this.listAction)},async delayedSearch(){let n=this;this.query.page=1,this.action.items=[],clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.updateUrlQueryString(n.query),await n.getList()},this.search.delay_time)},async updateUrlQueryString(n){n=B().clone(n);let t=ct.stringify(n,{skipNulls:!0}),i=ct.parse(t);i.filter&&(i.filter=B().cleanObject(i.filter)),await this.$router.replace({query:null}),await this.$router.replace({query:i}),this.countFilters(i)},countFilters:function(n){if(this.count_filters=0,n&&n.filter){let t=B().cleanObject(n.filter);this.count_filters=Object.keys(t).length}},async clearSearch(){this.query.filter.q=null,await this.updateUrlQueryString(this.query),await this.getList()},async resetQuery(){await this.resetQueryString(),await this.getList()},async resetQueryString(){for(let n in this.query.filter)this.query.filter[n]=null;this.query.page=this.page,this.query.rows=this.rows,await this.updateUrlQueryString(this.query)},toList(){this.$router.push({name:"jobs.index"})},isViewLarge(){return this.view==="large"},getIdWidth(){let n=50;if(this.list&&this.list.total){let t=this.list.total.toString();t=t.length,n=t*40}return n+"px"},getActionWidth(){let n=100;return this.isViewLarge()||(n=80),n+"px"},getActionLabel(){let n=null;return this.isViewLarge()&&(n="Actions"),n},async getListSelectedMenu(){this.list_selected_menu=[{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDelete()}}]},getListBulkMenu(){this.list_bulk_menu=[{label:"Delete All",icon:"pi pi-trash",command:async()=>{this.confirmDeleteAll()}}]},confirmDeleteItem(){this.form.type="delete",B().confirmDialogDelete(this.confirmDeleteItemAfter)},confirmDeleteItemAfter(){this.itemAction("delete",this.item)},viewPayloads(n){this.payload_content=''+JSON.stringify(n,null,2)+"",this.payload_modal=!0},async sync(){this.is_btn_loading=!0,await this.getList()},hasPermission(n){const t=je();return B().hasPermission(t.permissions,n)},setPageTitle(){this.title&&(document.title=this.title)},displayJobName(n){let t=n.split(/\\/g);return t[t.length-1]}}}),mT=f("b",null,"Sort By:",-1),gT={class:"field-radiobutton"},vT=f("label",{for:"sort-none"},"None",-1),yT={class:"field-radiobutton"},_T=f("label",{for:"sort-ascending"},"Created (Ascending)",-1),bT={class:"field-radiobutton"},wT=f("label",{for:"sort-descending"},"Created (Descending)",-1),CT=f("b",null,"Queue:",-1),ST={class:"field-radiobutton"},kT=f("label",{for:"default"},"Default",-1),xT={class:"field-radiobutton"},IT=f("label",{for:"high"},"High",-1),LT={class:"field-radiobutton"},PT=f("label",{for:"medium"},"Medium",-1),OT={class:"field-radiobutton"},ET=f("label",{for:"low"},"Low",-1),AT={__name:"Filters",setup(n){const t=Ca();return(i,r)=>{const a=R("RadioButton"),s=R("Divider"),u=R("Sidebar");return _(),O("div",null,[x(u,{visible:o(t).show_filters,"onUpdate:visible":r[7]||(r[7]=l=>o(t).show_filters=l),position:"right",style:{"z-index":"1101"}},{default:T(()=>[x(mt,null,{label:T(()=>[mT]),default:T(()=>[f("div",gT,[x(a,{name:"sort-none","data-testid":"jobs-filters-sort-none",value:"",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[0]||(r[0]=l=>o(t).query.filter.sort=l)},null,8,["modelValue"]),vT]),f("div",yT,[x(a,{name:"sort-ascending","data-testid":"jobs-filters-sort-ascending",value:"created_at",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[1]||(r[1]=l=>o(t).query.filter.sort=l)},null,8,["modelValue"]),_T]),f("div",bT,[x(a,{name:"sort-descending","data-testid":"jobs-filters-sort-descending",value:"created_at:desc",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[2]||(r[2]=l=>o(t).query.filter.sort=l)},null,8,["modelValue"]),wT])]),_:1}),x(s),x(mt,null,{label:T(()=>[CT]),default:T(()=>[f("div",ST,[x(a,{name:"default","data-testid":"jobs-queue_defaut",value:"default",modelValue:o(t).query.filter.queue,"onUpdate:modelValue":r[3]||(r[3]=l=>o(t).query.filter.queue=l)},null,8,["modelValue"]),kT]),f("div",xT,[x(a,{name:"high","data-testid":"jobs-queue_high",value:"high",modelValue:o(t).query.filter.queue,"onUpdate:modelValue":r[4]||(r[4]=l=>o(t).query.filter.queue=l)},null,8,["modelValue"]),IT]),f("div",LT,[x(a,{name:"medium","data-testid":"jobs-queue_medium",value:"medium",modelValue:o(t).query.filter.queue,"onUpdate:modelValue":r[5]||(r[5]=l=>o(t).query.filter.queue=l)},null,8,["modelValue"]),PT]),f("div",OT,[x(a,{name:"low","data-testid":"jobs-queue_low",value:"low",modelValue:o(t).query.filter.queue,"onUpdate:modelValue":r[6]||(r[6]=l=>o(t).query.filter.queue=l)},null,8,["modelValue"]),ET])]),_:1})]),_:1},8,["visible"])])}}},TT={key:0},RT=f("i",{class:"pi pi-angle-down"},null,-1),DT={class:"grid p-fluid"},MT={class:"col-12"},$T={class:"p-inputgroup"},VT={__name:"Actions",setup(n){const t=Ca();Te(async()=>{t.getListSelectedMenu(),t.getListBulkMenu()});const i=Ae(),r=u=>{i.value.toggle(u)},a=Ae(),s=u=>{a.value.toggle(u)};return(u,l)=>{const c=R("Badge"),d=R("Button"),p=R("Menu"),v=R("InputText");return _(),O("div",null,[f("div",{class:he([{"flex justify-content-between":o(t).isViewLarge()},"mt-2 mb-2"])},[o(t).view==="large"?(_(),O("div",TT,[x(d,{class:"p-button-sm",onClick:r,"data-testid":"jobs-actions-menu","aria-haspopup":"true","aria-controls":"overlay_menu"},{default:T(()=>[RT,o(t).action.items.length>0?(_(),$(c,{key:0,value:o(t).action.items.length},null,8,["value"])):A("",!0)]),_:1}),x(p,{ref_key:"selected_menu_state",ref:i,model:o(t).list_selected_menu,popup:!0},null,8,["model"]),x(d,{class:"p-button-sm ml-1",icon:"pi pi-ellipsis-h",onClick:s,"data-testid":"jobs-actions-bulk-menu","aria-haspopup":"true","aria-controls":"bulk_menu_state"}),x(p,{ref_key:"bulk_menu_state",ref:a,model:o(t).list_bulk_menu,popup:!0},null,8,["model"])])):A("",!0),f("div",null,[f("div",DT,[f("div",MT,[f("div",$T,[x(v,{modelValue:o(t).query.filter.q,"onUpdate:modelValue":l[0]||(l[0]=h=>o(t).query.filter.q=h),onKeyup:[l[1]||(l[1]=Ie(h=>o(t).delayedSearch(),["enter"])),l[2]||(l[2]=Ie(h=>o(t).delayedSearch(),["enter","native"])),l[3]||(l[3]=Ie(h=>o(t).delayedSearch(),["13"]))],"data-testid":"jobs-actions-search",placeholder:"Search",class:"p-inputtext-sm"},null,8,["modelValue"]),x(d,{onClick:l[4]||(l[4]=h=>o(t).delayedSearch()),"data-testid":"jobs-actions-search-button",icon:"pi pi-search",class:"p-button-sm"}),x(d,{class:"p-button-sm",label:"Filters","data-testid":"jobs-actions-show-filters",onClick:l[5]||(l[5]=h=>o(t).show_filters=!0)},{default:T(()=>[o(t).count_filters>0?(_(),$(c,{key:0,value:o(t).count_filters},null,8,["value"])):A("",!0)]),_:1}),x(d,{class:"p-button-sm",label:"Reset",icon:"pi pi-filter-slash","data-testid":"jobs-actions-reset-filters",onClick:l[6]||(l[6]=h=>o(t).resetQuery())})])]),x(AT)])])],2)])}}},BT={key:0},qT={class:"p-inputgroup"},FT=["innerHTML"],jT={__name:"Table",setup(n){const t=Ca(),i=B();return(r,a)=>{const s=R("Column"),u=R("Button"),l=R("DataTable"),c=R("Paginator"),d=R("Card"),p=R("Dialog"),v=Ke("tooltip");return _(),O(ne,null,[o(t).list?(_(),O("div",BT,[x(l,{value:o(t).list.data,dataKey:"id",class:"p-datatable-sm p-datatable-hoverable-rows",selection:o(t).action.items,"onUpdate:selection":a[0]||(a[0]=h=>o(t).action.items=h),stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[o(t).isViewLarge()?(_(),$(s,{key:0,selectionMode:"multiple",headerStyle:"width: 3em"})):A("",!0),x(s,{field:"id",header:"ID",style:St({width:o(t).getIdWidth()}),sortable:!0},null,8,["style"]),x(s,{field:"queue",header:"Queue"},{body:T(h=>[ue(Q(h.data.queue),1)]),_:1}),x(s,{field:"queue",header:"Name"},{body:T(h=>[ce((_(),O("p",null,[ue(Q(o(t).displayJobName(h.data.payload.displayName)),1)])),[[v,h.data.payload.displayName,void 0,{top:!0}]])]),_:1}),x(s,{field:"payload",header:"Payload"},{body:T(h=>[o(t).hasPermission("can-read-jobs-payload")?ce((_(),$(u,{key:0,class:"p-button-tiny p-button-text","data-testid":"jobs-view_payload",onClick:m=>o(t).viewPayloads(h.data.payload),icon:"pi pi-eye"},null,8,["onClick"])),[[v,"View",void 0,{top:!0}]]):A("",!0)]),_:1}),x(s,{field:"attempts",header:"Attempts"},{body:T(h=>[ue(Q(h.data.attempts),1)]),_:1}),o(t).isViewLarge()?(_(),$(s,{key:1,field:"reserved_at",header:"Reserved At",style:{width:"150px"}},{body:T(h=>[ue(Q(h.data.reserved_at),1)]),_:1})):A("",!0),o(t).isViewLarge()?(_(),$(s,{key:2,field:"available_at",header:"Available At",style:{width:"150px"}},{body:T(h=>[ue(Q(o(i).ago(h.data.available_at)),1)]),_:1})):A("",!0),o(t).isViewLarge()?(_(),$(s,{key:3,field:"created_at",header:"Created At",style:{width:"150px"},sortable:!0},{body:T(h=>[ue(Q(o(i).ago(h.data.created_at)),1)]),_:1})):A("",!0),x(s,{field:"actions",style:St([{width:"150px"},{width:o(t).getActionWidth()}]),header:o(t).getActionLabel()},{body:T(h=>[f("div",qT,[o(t).isViewLarge()&&!h.data.deleted_at&&o(t).hasPermission("can-delete-jobs")?ce((_(),$(u,{key:0,class:"p-button-tiny p-button-danger p-button-text",onClick:m=>o(t).itemAction("delete",h.data),"data-testid":"jobs-trash",icon:"pi pi-trash"},null,8,["onClick"])),[[v,"Delete",void 0,{top:!0}]]):A("",!0)])]),_:1},8,["style","header"])]),_:1},8,["value","selection"]),x(c,{first:o(t).first_element,"onUpdate:first":a[1]||(a[1]=h=>o(t).first_element=h),rows:o(t).query.rows,totalRecords:o(t).list.total,onPage:a[2]||(a[2]=h=>o(t).paginate(h)),rowsPerPageOptions:o(t).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["first","rows","totalRecords","rowsPerPageOptions"])])):A("",!0),x(p,{header:"Payload",visible:o(t).payload_modal,"onUpdate:visible":a[3]||(a[3]=h=>o(t).payload_modal=h),style:{width:"40%"}},{default:T(()=>[x(d,{class:"w-max"},{content:T(()=>[f("span",{innerHTML:o(t).payload_content},null,8,FT)]),_:1})]),_:1},8,["visible"])],64)}}},UT={key:0,class:"grid"},NT={class:"flex flex-row"},HT=f("b",{class:"mr-1"},"Jobs",-1),KT={class:"p-inputgroup"},zT={__name:"List",setup(n){const t=Ca(),i=Ge();return _t(),Te(async()=>{await t.onLoad(i),await t.setPageTitle(),await t.watchRoutes(i),await t.watchStates(),await t.getAssets(),await t.getList()}),(r,a)=>{const s=R("Badge"),u=R("Button"),l=R("Message"),c=R("Panel"),d=R("RouterView");return o(t).assets?(_(),O("div",UT,[f("div",{class:he("col-"+o(t).list_view_width)},[x(c,{class:"is-small"},{header:T(()=>[f("div",NT,[f("div",null,[HT,o(t).list&&o(t).list.total>0?(_(),$(s,{key:0,value:o(t).list.total},null,8,["value"])):A("",!0)])])]),icons:T(()=>[f("div",KT,[x(u,{class:"p-button-sm","data-testid":"jobs-content-refresh",icon:"pi pi-refresh",loading:o(t).is_btn_loading,onClick:o(t).sync},null,8,["loading","onClick"])])]),default:T(()=>[x(l,{closable:!1},{default:T(()=>[ue(" This list consist of only queued/pending jobs. Completed jobs gets deleted automatically . ")]),_:1}),x(VT),x(jT)]),_:1})],2),x(d)])):A("",!0)}}};let WT="WebReinvent\\VaahCms\\Models\\Log",_f=document.getElementsByTagName("base")[0].getAttribute("href"),Ro=_f+"/vaah/logs",Do={query:{page:null,rows:null,filter:{q:null,is_active:null,trashed:null,sort:null,file_type:[]}},action:{type:null,items:[]}};const Sa=Ot({id:"logs",state:()=>({title:"Logs - Advanced",page:1,rows:20,base_url:_f,ajax_url:Ro,model:WT,assets_is_fetching:!0,app:null,assets:null,rows_per_page:[10,20,30,50,100,500],list:null,item:null,fillable:null,empty_query:Do.query,empty_action:Do.action,query:B().clone(Do.query),action:B().clone(Do.action),search:{delay_time:600,delay_timer:0},route:null,watch_stopper:null,route_prefix:"logs.",view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],item_menu_list:[],item_menu_state:null,form_menu_list:[],payload_modal:!1,payload_content:null,is_btn_loading:!1,first_element:null,listTotal:null}),getters:{},actions:{async onLoad(n){this.route=n,this.updateQueryFromUrl(n)},setViewAndWidth(n){switch(n){case"logs.index":this.view="large",this.list_view_width=12;break;default:this.view="small",this.list_view_width=6;break}},async updateQueryFromUrl(n){if(n.query&&Object.keys(n.query).length>0){for(let t in n.query)this.query[t]=n.query[t];this.countFilters(n.query)}},watchRoutes(n){this.watch_stopper=We(n,(t,i)=>{if(this.watch_stopper&&!t.name.includes(this.route_prefix))return this.watch_stopper(),!1;this.route=t,t.params.name&&this.getItem(t.params.name),this.setViewAndWidth(t.name)},{deep:!0})},watchStates(){We(this.query.filter,async(n,t)=>{await this.delayedSearch()},{deep:!0})},watchItem(){this.item&&We(()=>this.item.name,(n,t)=>{n&&n!==""&&(this.item.name=B().capitalising(n),this.item.slug=B().strToSlug(n))},{deep:!0})},async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,B().ajax(this.ajax_url+"/assets",this.afterGetAssets))},afterGetAssets(n){n&&(this.assets=n,n.rows&&(this.query.page=this.page,this.query.rows?this.query.rows=parseInt(this.query.rows):this.query.rows=n.rows))},async getList(){let n={query:B().clone(this.query)};await this.updateUrlQueryString(this.query),await B().ajax(this.ajax_url,this.afterGetList,n)},afterGetList(n,t){n&&n.list&&(this.list=n.list,this.list_total=n.list.length,this.first_element=(this.query.page-1)*this.query.rows)},async getItem(n){n&&await B().ajax(Ro+"/"+n,this.getItemAfter)},async getItemAfter(n,t){n?this.item=n:(this.item=null,this.$router.push({name:"logs.index"})),await this.getItemMenu()},confirmClearFile(n){this.item=n,B().confirmDialogDelete(this.clearFile)},clearFile(){let n={params:this.item,method:"POST"};B().ajax(Ro+"/actions/clear-file",this.clearFileAfter,n)},clearFileAfter(n,t){n&&n.message==="success"&&this.getItem(this.item.name)},async deleteItem(){let n={params:this.item,method:"POST"};B().ajax(Ro+"/actions/delete",await this.deleteItemAfter,n)},async deleteItemAfter(n,t){n&&n.message==="success"&&await this.getList()},async downloadFile(n){window.location.href=this.ajax_url+"/download-file/"+n.name},isListActionValid(){return this.action.type?this.action.items.length<1?(B().toastErrors(["Select records"]),!1):!0:(B().toastErrors(["Select an action type"]),!1)},async updateListAfter(n,t){n&&(this.action=B().clone(this.empty_action),await this.getList())},async listAction(n=null){!n&&this.action.type?n=this.action.type:this.action.type=n;let t=this.ajax_url+"/action/"+n,i="PUT";switch(n){case"delete":t=this.ajax_url,i="DELETE";break;case"delete-all":i="POST",t=this.ajax_url+"/actions/bulk-delete-all";break}let r={params:this.action,method:i,show_success:!1};await B().ajax(t,this.updateListAfter,r)},itemAction(n,t=null){t||(t=this.item),this.form.action=n;let i=this.ajax_url,r={method:"post"};switch(n){case"create-and-new":case"create-and-close":case"create-and-clone":r.method="POST",r.params=t;break;case"save":case"save-and-close":case"save-and-clone":r.method="PUT",r.params=t,i+="/"+t.id;break;case"delete":r.method="DELETE",i+="/"+t.id;break;default:r.method="PATCH",i+="/"+t.id+"/action/"+n;break}B().ajax(i,this.itemActionAfter,r)},async itemActionAfter(n,t){n&&(this.item=n,await this.getList(),await this.formActionAfter(),this.getItemMenu())},async formActionAfter(){switch(this.form.action){case"create-and-new":case"save-and-new":this.setActiveItemAsEmpty();break;case"create-and-close":case"save-and-close":this.setActiveItemAsEmpty(),this.$router.push({name:"logs.index"});break;case"save-and-clone":this.item.id=null;break;case"trash":this.item=null;break;case"delete":this.item=null,this.toList();break}},async paginate(n){this.query.page=n.page+1,this.query.rows=n.rows,this.first_element=(this.query.page-1)*this.query.rows,await this.getList()},async reload(){this.is_btn_loading=!0,await this.getAssets(),await this.getList(),this.item&&await this.getItem(this.item.name),this.is_btn_loading=!1},async getFaker(){let n={model_namespace:this.model,except:this.assets.fillable.except},t=this.base_url+"/faker",i={params:n,method:"post"};B().ajax(t,this.getFakerAfter,i)},getFakerAfter:function(n,t){if(n){let i=this;Object.keys(n.fill).forEach(function(r){i.item[r]=n.fill[r]})}},onItemSelection(n){this.action.items=n},setActiveItemAsEmpty(){this.item=B().clone(this.assets.empty_item)},confirmDelete(n){this.item=n,B().confirmDialogDelete(this.deleteItem)},async confirmDeleteAll(){this.action.type="delete-all",B().confirmDialogDelete(this.listAction)},async delayedSearch(){let n=this;this.query.page=1,this.action.items=[],clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.updateUrlQueryString(n.query),await n.getList()},this.search.delay_time)},async resetSearch(){this.query.filter.q=null,await this.getList()},async updateUrlQueryString(n){n=B().clone(n);let t=ct.stringify(n,{skipNulls:!0}),i=ct.parse(t);i.filter&&(i.filter=B().cleanObject(i.filter)),await this.$router.replace({query:null}),await this.$router.replace({query:i}),this.countFilters(i)},countFilters:function(n){if(this.count_filters=0,n&&n.filter){let t=B().cleanObject(n.filter);this.count_filters=Object.keys(t).length}},async clearSearch(){this.query.filter.q=null,await this.updateUrlQueryString(this.query),await this.getList()},async resetQuery(){await this.resetQueryString(),await this.getList()},async resetQueryString(){for(let n in this.query.filter)this.query.filter[n]=null;this.query.page=this.page,this.query.rows=this.rows,await this.updateUrlQueryString(this.query)},toList(){this.item=null,this.$router.push({name:"logs.index"})},toView(n){this.getItem(n.name),this.$router.push({name:"logs.view",params:{name:n.name}})},isViewLarge(){return this.view==="large"},getIdWidth(){let n=50;if(this.list&&this.list.total){let t=this.list.total.toString();t=t.length,n=t*40}return n+"px"},getActionWidth(){let n=100;return this.isViewLarge()||(n=80),n+"px"},getActionLabel(){let n=null;return this.isViewLarge()&&(n="Actions"),n},async getListSelectedMenu(){this.list_selected_menu=[{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDelete()}}]},getListBulkMenu(){this.list_bulk_menu=[{label:"Delete All",icon:"pi pi-trash",command:async()=>{this.confirmDeleteAll()}}]},getItemMenu(){let n=[];this.item&&this.item.deleted_at&&n.push({label:"Restore",icon:"pi pi-refresh",command:()=>{this.itemAction("restore")}}),this.item&&this.item.id&&!this.item.deleted_at&&n.push({label:"Trash",icon:"pi pi-times",command:()=>{this.itemAction("trash")}}),n.push({label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDeleteItem("delete")}}),this.item_menu_list=n},confirmDeleteItem(){this.form.type="delete",B().confirmDialogDelete(this.confirmDeleteItemAfter)},confirmDeleteItemAfter(){this.itemAction("delete",this.item)},viewPayloads(n){this.payload_content=''+JSON.stringify(n,null,2)+"",this.payload_modal=!0},async getMenuItems(){this.menu_items=[{label:"Delete All",command:async()=>{this.confirmDeleteAll()}}]},async getLogsFileTypes(){return this.logs_file_types=[{name:".csv",value:".csv"},{name:".log",value:".log"},{name:".pdf",value:".pdf"},{name:".xlsx",value:".xlsx"},{name:".xml",value:".xml"}]},hasPermission(n){const t=je();return B().hasPermission(t.permissions,n)},setPageTitle(){this.title&&(document.title=this.title)}}}),GT={class:"mt-2 mb-2"},YT={class:"p-inputgroup"},QT={__name:"Actions",setup(n){const t=Sa();return Te(async()=>{t.getListSelectedMenu(),t.getListBulkMenu(),await t.getLogsFileTypes()}),Ae(),Ae(),(i,r)=>{const a=R("InputText"),s=R("Button"),u=R("MultiSelect");return _(),O("div",null,[f("div",GT,[f("div",YT,[x(a,{class:"p-inputtext-sm",inputClass:"w-full",modelValue:o(t).query.filter.q,"onUpdate:modelValue":r[0]||(r[0]=l=>o(t).query.filter.q=l),onKeyup:[r[1]||(r[1]=Ie(l=>o(t).delayedSearch(),["enter"])),r[2]||(r[2]=Ie(l=>o(t).delayedSearch(),["enter","native"])),r[3]||(r[3]=Ie(l=>o(t).delayedSearch(),["13"]))],placeholder:"Search","data-testid":"logs-action_search_input"},null,8,["modelValue"]),x(s,{label:"Reset",class:"p-button-sm","data-testid":"logs-action_search",onClick:o(t).resetSearch},null,8,["onClick"])]),x(u,{modelValue:o(t).query.filter.file_type,"onUpdate:modelValue":r[4]||(r[4]=l=>o(t).query.filter.file_type=l),options:o(t).logs_file_types,optionLabel:"name",placeholder:"Filter By Extension",display:"chip",class:"w-full my-2 p-inputtext-sm",optionValue:"value","data-testid":"logs-action_filter",onChange:r[5]||(r[5]=l=>o(t).getList())},null,8,["modelValue","options"])])])}}},XT={key:0},ZT={class:"p-inputgroup"},JT=["innerHTML"],e9={__name:"Table",setup(n){const t=Sa();B();const i=Ge();return(r,a)=>{const s=R("Column"),u=R("Button"),l=R("DataTable"),c=R("Paginator"),d=R("Card"),p=R("Dialog"),v=Ke("tooltip");return _(),O(ne,null,[o(t).list?(_(),O("div",XT,[x(l,{value:o(t).list,dataKey:"id",class:"p-datatable-sm p-datatable-hoverable-rows",selection:o(t).action.items,"onUpdate:selection":a[0]||(a[0]=h=>o(t).action.items=h),stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[x(s,{field:"id",header:"ID",style:St({width:o(t).getIdWidth()}),sortable:!0},null,8,["style"]),x(s,{field:"name",header:"Name"}),x(s,{field:"actions",style:St([{width:"150px"},{width:o(t).getActionWidth()}]),header:o(t).getActionLabel()},{body:T(h=>[f("div",ZT,[o(t).hasPermission("can-read-log")?ce((_(),$(u,{key:0,class:"p-button-tiny p-button-text",disabled:o(i).params.name===h.data.name,onClick:m=>o(t).toView(h.data),"data-testid":"logs-item_view",icon:"pi pi-eye"},null,8,["disabled","onClick"])),[[v,"View",void 0,{top:!0}]]):A("",!0),o(t).hasPermission("can-delete-log")?ce((_(),$(u,{key:1,class:"p-button-tiny p-button-danger p-button-text",onClick:m=>o(t).confirmDelete(h.data),"data-testid":"logs-item_trash",icon:"pi pi-trash"},null,8,["onClick"])),[[v,"Delete",void 0,{top:!0}]]):A("",!0)])]),_:1},8,["style","header"])]),_:1},8,["value","selection"]),x(c,{first:o(t).first_element,"onUpdate:first":a[1]||(a[1]=h=>o(t).first_element=h),rows:o(t).query.rows,totalRecords:o(t).list_total,template:"PrevPageLink PageLinks NextPageLink RowsPerPageDropdown",onPage:a[2]||(a[2]=h=>o(t).paginate(h)),rowsPerPageOptions:o(t).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["first","rows","totalRecords","rowsPerPageOptions"])])):A("",!0),x(p,{header:"Payload",visible:o(t).payload_modal,"onUpdate:visible":a[3]||(a[3]=h=>o(t).payload_modal=h),style:{width:"40%"}},{default:T(()=>[x(d,{class:"w-max"},{content:T(()=>[f("span",{innerHTML:o(t).payload_content},null,8,JT)]),_:1})]),_:1},8,["visible"])],64)}}},t9={key:0,class:"grid"},n9={class:"col-4"},i9={class:"flex flex-row"},s9=f("b",{class:"mr-1"},"Logs",-1),r9={class:"p-inputgroup"},o9={__name:"List",setup(n){const t=Sa(),i=Ge();_t(),Te(async()=>{await t.onLoad(i),await t.setPageTitle(),await t.watchRoutes(i),await t.watchStates(),await t.getAssets(),await t.getList(),await t.getMenuItems()});const r=Ae(),a=s=>{r.value.toggle(s)};return(s,u)=>{const l=R("Badge"),c=R("Button"),d=R("Menu"),p=R("Panel"),v=R("RouterView");return o(t).assets?(_(),O("div",t9,[f("div",n9,[x(p,{class:"is-small"},{header:T(()=>[f("div",i9,[f("div",null,[s9,o(t).list&&o(t).list.length>0?(_(),$(l,{key:0,class:"is-small",value:o(t).list.length},null,8,["value"])):A("",!0)])])]),icons:T(()=>[f("div",r9,[x(c,{icon:"pi pi-refresh",onClick:u[0]||(u[0]=h=>o(t).reload()),class:"p-button-sm","data-testid":"logs-list_refresh",loading:o(t).is_btn_loading},null,8,["loading"]),x(c,{icon:"pi pi-ellipsis-v",class:"p-button-sm",onClick:a,"aria-controls":"menu_items_state","data-testid":"logs-toggle_menu_items"}),x(d,{ref_key:"menu_items",ref:r,model:o(t).menu_items,popup:!0},null,8,["model"])])]),default:T(()=>[x(QT),x(e9)]),_:1})]),x(v)])):A("",!0)}}},a9={class:"col-8"},l9={class:"flex flex-row"},u9={class:"p-panel-title"},c9={key:0},d9={class:"card overflow-hidden"},p9={key:0,class:"p-datatable"},h9={class:"level is-marginless"},f9={class:"level-left"},m9={class:"level-item"},g9={class:"level-item"},v9={class:"level-item"},y9=["innerHTML"],_9={__name:"Item",setup(n){const t=Sa(),i=Ge();return Te(async()=>{if(i.params&&!i.params.name)return t.toList(),!1;(!t.item||Object.keys(t.item).length<1)&&await t.getItem(i.params.name)}),Ae(),(r,a)=>{const s=R("Button"),u=R("Tag"),l=R("TabPanel"),c=R("TabView"),d=R("Panel"),p=Ke("tooltip");return _(),O("div",a9,[o(t)&&o(t).item?(_(),$(d,{key:0,class:"is-small"},{header:T(()=>[f("div",l9,[f("div",u9,[ue(" Log "),o(t).item.name?(_(),O("span",c9," : "+Q(o(t).item.name),1)):A("",!0)])])]),icons:T(()=>[ce(x(s,{icon:"pi pi-trash",onClick:a[0]||(a[0]=v=>o(t).confirmClearFile(o(t).item)),"data-testid":"logs-item_clear_file",class:"p-button-sm p-button-rounded p-button-text"},null,512),[[p,"Clear File",void 0,{top:!0}]]),ce(x(s,{icon:"pi pi-download",onClick:a[1]||(a[1]=v=>o(t).downloadFile(o(t).item)),"data-testid":"logs-item_download_file",class:"p-button-sm p-button-rounded p-button-text"},null,512),[[p,"Download File",void 0,{top:!0}]]),ce(x(s,{icon:"pi pi-refresh",onClick:a[2]||(a[2]=v=>o(t).getItem(o(t).item.name)),"data-testid":"logs-item_refresh",class:"p-button-sm p-button-rounded p-button-text"},null,512),[[p,"Reload",void 0,{top:!0}]]),ce(x(s,{icon:"pi pi-times",onClick:a[3]||(a[3]=v=>o(t).toList()),"data-testid":"logs-item_close",class:"p-button-sm p-button-rounded p-button-text"},null,512),[[p,"Close",void 0,{top:!0}]])]),default:T(()=>[f("div",d9,[x(c,{class:"is-small tab-panel-has-no-padding"},{default:T(()=>[x(l,{header:"Logs"},{default:T(()=>[o(t).item.logs?(_(),O("table",p9,[(_(!0),O(ne,null,xe(o(t).item.logs,v=>(_(),O("tr",null,[f("td",null,[f("div",h9,[f("div",f9,[f("div",m9,[x(u,{class:"mb-2 bg-black-alpha-90 border-noround text-xs line-height-3"},{default:T(()=>[ue("TYPE")]),_:1}),x(u,{class:"mr-2 mb-2 border-noround",value:v.type},null,8,["value"])]),f("div",g9,[x(u,{class:"mb-2 bg-black-alpha-90 border-noround line-height-3"},{default:T(()=>[ue("TIME")]),_:1}),x(u,{class:"mr-2 mb-2 border-noround",severity:"danger",value:v.timestamp+"/"+v.ago},null,8,["value"])]),f("div",v9,[x(u,{class:"mb-2 bg-black-alpha-90 border-noround",value:"ENV"}),x(u,{class:"mr-2 mb-2 border-noround",value:v.env},null,8,["value"])])])]),f("small",null,Q(v.message),1)])]))),256))])):A("",!0)]),_:1}),x(l,{header:"Raw"},{default:T(()=>[o(t).item.content?(_(),O("small",{key:0,style:{"max-height":"768px",overflow:"auto"},innerHTML:o(t).item.content},null,8,y9)):A("",!0)]),_:1})]),_:1})])]),_:1})):A("",!0)])}}};let b9="WebReinvent\\VaahCms\\Models\\FailedJob",bf=document.getElementsByTagName("base")[0].getAttribute("href"),w9=bf+"/vaah/failedjobs",Mo={query:{page:1,rows:20,filter:{q:null,is_active:null,trashed:null,sort:null},from:null,to:null},action:{type:null,items:[]}};const ka=Ot({id:"failedjobs",state:()=>({title:"Failed Jobs - Advanced",page:1,rows:20,base_url:bf,ajax_url:w9,model:b9,assets_is_fetching:!0,app:null,assets:null,rows_per_page:[10,20,30,50,100,500],list:null,item:null,fillable:null,empty_query:Mo.query,empty_action:Mo.action,query:B().clone(Mo.query),action:B().clone(Mo.action),search:{delay_time:600,delay_timer:0},route:null,watch_stopper:null,route_prefix:"failedjobs.",view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],item_menu_list:[],item_menu_state:null,form_menu_list:[],failed_job_modal:!1,failed_job_content:null,failed_job_content_heading:null,dates:[],first_element:null}),actions:{async onLoad(n){this.route=n,this.first_element=(this.query.page-1)*this.query.rows,this.updateQueryFromUrl(n)},async updateQueryFromUrl(n){if(n.query&&Object.keys(n.query).length>0){for(let t in n.query)this.query[t]=n.query[t];this.countFilters(n.query)}},watchRoutes(n){this.watch_stopper=We(n,(t,i)=>{if(this.watch_stopper&&!t.name.includes(this.route_prefix))return this.watch_stopper(),!1;this.route=t,t.params.id&&this.getItem(t.params.id)},{deep:!0})},watchStates(){We(this.query.filter,(n,t)=>{this.delayedSearch()},{deep:!0})},watchItem(){this.item&&We(()=>this.item.name,(n,t)=>{n&&n!==""&&(this.item.name=B().capitalising(n),this.item.slug=B().strToSlug(n))},{deep:!0})},async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,B().ajax(this.ajax_url+"/assets",this.afterGetAssets))},afterGetAssets(n,t){n&&(this.assets=n,n.rows&&(this.query.rows?this.query.rows=parseInt(this.query.rows):this.query.rows=n.rows))},async getList(){let n={query:B().clone(this.query)};await this.updateUrlQueryString(this.query),await B().ajax(this.ajax_url,await this.getListAfter,n)},async getListAfter(n,t){this.is_btn_loading=!1,n&&(this.list=n.list,this.first_element=this.query.rows*(this.query.page-1))},isListActionValid(){return this.action.type?this.action.items.length<1?(B().toastErrors(["Select records"]),!1):!0:(B().toastErrors(["Select an action type"]),!1)},async listAction(n=null){!n&&this.action.type?n=this.action.type:this.action.type=n;let t=this.ajax_url+"/action/"+n,i="PUT";switch(n){case"delete":t=this.ajax_url,i="DELETE";break;case"delete-all":i="DELETE";break}let r={params:this.action,method:i,show_success:!1};await B().ajax(t,this.updateListAfter,r)},async updateListAfter(n){n&&(this.action=B().clone(this.empty_action),await this.getList())},itemAction(n,t=null){t||(t=this.item),this.form.action=n;let i=this.ajax_url,r={method:"post"};switch(n){case"delete":r.method="DELETE",i+="/"+t.id;break;default:r.method="PATCH",i+="/"+t.id+"/action/"+n;break}B().ajax(i,this.itemActionAfter,r)},async itemActionAfter(n){n&&(this.item=n,await this.getList())},async paginate(n){this.query.page=n.page+1,this.query.rows=n.rows,this.first_element=this.query.rows*(this.query.page-1),await this.getList()},async reload(){await this.getAssets(),await this.getList()},onItemSelection(n){this.action.items=n},confirmDelete(){if(this.action.items.length<1)return B().toastErrors(["Select a record"]),!1;this.action.type="delete",B().confirmDialogDelete(this.listAction)},confirmDeleteAll(){this.action.type="delete-all",B().confirmDialogDelete(this.listAction)},async delayedSearch(){let n=this;this.query.page=1,this.action.items=[],clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.updateUrlQueryString(n.query),await n.getList()},this.search.delay_time)},async updateUrlQueryString(n){n=B().clone(n);let t=ct.stringify(n,{skipNulls:!0}),i=ct.parse(t);i.filter&&(i.filter=B().cleanObject(i.filter)),await this.$router.replace({query:null}),await this.$router.replace({query:i}),this.countFilters(i)},countFilters:function(n){if(this.count_filters=0,n&&n.filter){let t=B().cleanObject(n.filter);this.count_filters=Object.keys(t).length}},async clearSearch(){this.query.filter.q=null,await this.updateUrlQueryString(this.query),await this.getList()},async resetQuery(){await this.resetQueryString(),await this.getList()},async resetQueryString(){for(let n in this.query.filter)this.query.filter[n]=null;for(let n in this.query)n!=="filter"&&(this.query[n]=null);this.query.page=this.page,this.query.rows=this.rows,await this.updateUrlQueryString(this.query)},toList(){this.$router.push({name:"failedjobs.index"})},isViewLarge(){return this.view==="large"},getIdWidth(){let n=50;if(this.list&&this.list.total){let t=this.list.total.toString();t=t.length,n=t*40}return n+"px"},getActionWidth(){let n=100;return this.isViewLarge()||(n=80),n+"px"},getActionLabel(){let n=null;return this.isViewLarge()&&(n="Actions"),n},async getListSelectedMenu(){this.list_selected_menu=[{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDelete()}}]},getListBulkMenu(){this.list_bulk_menu=[{label:"Delete All",icon:"pi pi-trash",command:async()=>{this.confirmDeleteAll()}}]},confirmDeleteItem(){this.form.type="delete",B().confirmDialogDelete(this.confirmDeleteItemAfter)},confirmDeleteItemAfter(){this.itemAction("delete",this.item)},viewFailedJobsContent(n,t){this.failed_job_content_heading=t,this.failed_job_content=''+JSON.stringify(n,null,2)+"",this.failed_job_modal=!0},setDateRange(){if(this.dates2.length>0){let n=new Date(this.dates2[0]);this.query.from=n.getFullYear()+"-"+(n.getMonth()+1)+"-"+n.getDate(),n=new Date(this.dates2[1]),this.query.to=n.getFullYear()+"-"+(n.getMonth()+1)+"-"+n.getDate(),this.getList()}},async sync(){this.is_btn_loading=!0,await this.getList()},hasPermission(n){const t=je();return B().hasPermission(t.permissions,n)},setPageTitle(){this.title&&(document.title=this.title)}}}),C9=f("b",null,"Sort By:",-1),S9={class:"field-radiobutton"},k9=f("label",{for:"sort-none"},"None",-1),x9={class:"field-radiobutton"},I9=f("label",{for:"sort-ascending"},"Updated (Ascending)",-1),L9={class:"field-radiobutton"},P9=f("label",{for:"sort-descending"},"Updated (Descending)",-1),O9=f("label",{for:"range"},"Range",-1),E9={__name:"Filters",setup(n){const t=ka();return(i,r)=>{const a=R("RadioButton"),s=R("Divider"),u=R("Calendar"),l=R("Sidebar");return _(),O("div",null,[x(l,{visible:o(t).show_filters,"onUpdate:visible":r[4]||(r[4]=c=>o(t).show_filters=c),position:"right",style:{"z-index":"1102"}},{default:T(()=>[x(mt,null,{label:T(()=>[C9]),default:T(()=>[f("div",S9,[x(a,{name:"sort-none","data-testid":"failedjobs-filters-sort-none",value:"",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[0]||(r[0]=c=>o(t).query.filter.sort=c)},null,8,["modelValue"]),k9]),f("div",x9,[x(a,{name:"sort-ascending","data-testid":"failedjobs-filters-sort-ascending",value:"failed_at",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[1]||(r[1]=c=>o(t).query.filter.sort=c)},null,8,["modelValue"]),I9]),f("div",L9,[x(a,{name:"sort-descending","data-testid":"failedjobs-filters-sort-descending",value:"failed_at:desc",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[2]||(r[2]=c=>o(t).query.filter.sort=c)},null,8,["modelValue"]),P9])]),_:1}),x(s),x(mt,null,{default:T(()=>[O9,x(u,{inputId:"range","data-testid":"failedjobs-filters-range",modelValue:o(t).dates2,"onUpdate:modelValue":r[3]||(r[3]=c=>o(t).dates2=c),onDateSelect:o(t).setDateRange,selectionMode:"range",dateFormat:"yy-mm-dd",manualInput:!1},null,8,["modelValue","onDateSelect"])]),_:1})]),_:1},8,["visible"])])}}},A9={key:0},T9=f("i",{class:"pi pi-angle-down"},null,-1),R9={class:"grid p-fluid"},D9={class:"col-12"},M9={class:"p-inputgroup"},$9={__name:"Actions",setup(n){const t=ka();Te(async()=>{t.getListSelectedMenu(),t.getListBulkMenu()});const i=Ae(),r=u=>{i.value.toggle(u)},a=Ae(),s=u=>{a.value.toggle(u)};return(u,l)=>{const c=R("Badge"),d=R("Button"),p=R("Menu"),v=R("InputText");return _(),O("div",null,[f("div",{class:he([{"flex justify-content-between":o(t).isViewLarge()},"mt-2 mb-2"])},[o(t).view==="large"?(_(),O("div",A9,[x(d,{class:"p-button-sm",onClick:r,"data-testid":"failedjobs-actions-menu","aria-haspopup":"true","aria-controls":"overlay_menu"},{default:T(()=>[T9,o(t).action.items.length>0?(_(),$(c,{key:0,value:o(t).action.items.length},null,8,["value"])):A("",!0)]),_:1}),x(p,{ref_key:"selected_menu_state",ref:i,model:o(t).list_selected_menu,popup:!0},null,8,["model"]),x(d,{class:"p-button-sm ml-1",icon:"pi pi-ellipsis-h",onClick:s,"data-testid":"failedjobs-actions-bulk-menu","aria-haspopup":"true","aria-controls":"bulk_menu_state"}),x(p,{ref_key:"bulk_menu_state",ref:a,model:o(t).list_bulk_menu,popup:!0},null,8,["model"])])):A("",!0),f("div",null,[f("div",R9,[f("div",D9,[f("div",M9,[x(v,{modelValue:o(t).query.filter.q,"onUpdate:modelValue":l[0]||(l[0]=h=>o(t).query.filter.q=h),onKeyup:[l[1]||(l[1]=Ie(h=>o(t).delayedSearch(),["enter"])),l[2]||(l[2]=Ie(h=>o(t).delayedSearch(),["enter","native"])),l[3]||(l[3]=Ie(h=>o(t).delayedSearch(),["13"]))],"data-testid":"failedjobs-actions-search",placeholder:"Search",class:"p-inputtext-sm"},null,8,["modelValue"]),x(d,{onClick:l[4]||(l[4]=h=>o(t).delayedSearch()),"data-testid":"failedjobs-actions-search-button",icon:"pi pi-search",class:"p-button-sm"}),x(d,{label:"Filters",class:"p-button-sm","data-testid":"failedjobs-actions-show-filters",onClick:l[5]||(l[5]=h=>o(t).show_filters=!0)},{default:T(()=>[o(t).count_filters>0?(_(),$(c,{key:0,value:o(t).count_filters},null,8,["value"])):A("",!0)]),_:1}),x(d,{class:"p-button-sm",icon:"pi pi-filter-slash","data-testid":"failedjobs-actions-reset-filters",label:"Reset",onClick:l[6]||(l[6]=h=>o(t).resetQuery())})])]),x(E9)])])],2)])}}},V9={key:0},B9={class:"p-inputgroup"},q9=["innerHTML"],F9={__name:"Table",setup(n){const t=ka();return B(),(i,r)=>{const a=R("Column"),s=R("Button"),u=R("DataTable"),l=R("Paginator"),c=R("Card"),d=R("Dialog"),p=Ke("tooltip");return _(),O(ne,null,[o(t).list?(_(),O("div",V9,[x(u,{value:o(t).list.data,dataKey:"id",class:"p-datatable-sm p-datatable-hoverable-rows",selection:o(t).action.items,"onUpdate:selection":r[0]||(r[0]=v=>o(t).action.items=v),stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[o(t).isViewLarge()?(_(),$(a,{key:0,selectionMode:"multiple",headerStyle:"width: 3em"})):A("",!0),x(a,{field:"id",header:"ID",style:St({width:o(t).getIdWidth()}),sortable:!0},null,8,["style"]),x(a,{field:"queue",header:"Queue"},{body:T(v=>[ue(Q(v.data.queue),1)]),_:1}),x(a,{field:"connection",header:"Connection"},{body:T(v=>[ue(Q(v.data.connection),1)]),_:1}),x(a,{field:"payload",header:"Payload"},{body:T(v=>[o(t).hasPermission("can-read-payload-failed-jobs")?ce((_(),$(s,{key:0,class:"p-button-tiny p-button-text","data-testid":"failedjobs-view_payload",onClick:h=>o(t).viewFailedJobsContent(v.data.payload,"Payload"),icon:"pi pi-eye"},null,8,["onClick"])),[[p,"View",void 0,{top:!0}]]):A("",!0)]),_:1}),x(a,{field:"exception",header:"Exception"},{body:T(v=>[o(t).hasPermission("can-read-failed-jobs-exception")?ce((_(),$(s,{key:0,class:"p-button-tiny p-button-text","data-testid":"failedjobs-view_exception",onClick:h=>o(t).viewFailedJobsContent(v.data.exception,"Exception"),icon:"pi pi-eye"},null,8,["onClick"])),[[p,"View",void 0,{top:!0}]]):A("",!0)]),_:1}),o(t).isViewLarge()?(_(),$(a,{key:1,field:"failed_at",header:"Failed At",sortable:!0,style:{width:"150px"}},{body:T(v=>[ue(Q(v.data.failed_at),1)]),_:1})):A("",!0),x(a,{field:"actions",style:St([{width:"150px"},{width:o(t).getActionWidth()}]),header:o(t).getActionLabel()},{body:T(v=>[f("div",B9,[o(t).isViewLarge()&&!v.data.deleted_at&&o(t).hasPermission("can-delete-failed-jobs")?ce((_(),$(s,{key:0,class:"p-button-tiny p-button-danger p-button-text",onClick:h=>o(t).itemAction("delete",v.data),icon:"pi pi-trash","data-testid":"failedjobs-trash"},null,8,["onClick"])),[[p,"Delete",void 0,{top:!0}]]):A("",!0)])]),_:1},8,["style","header"])]),_:1},8,["value","selection"]),x(l,{first:o(t).first_element,"onUpdate:first":r[1]||(r[1]=v=>o(t).first_element=v),rows:o(t).query.rows,totalRecords:o(t).list.total,onPage:r[2]||(r[2]=v=>o(t).paginate(v)),rowsPerPageOptions:o(t).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["first","rows","totalRecords","rowsPerPageOptions"])])):A("",!0),x(d,{header:o(t).failed_job_content_heading,visible:o(t).failed_job_modal,"onUpdate:visible":r[3]||(r[3]=v=>o(t).failed_job_modal=v),style:{width:"40%"}},{default:T(()=>[x(c,{class:"w-max"},{content:T(()=>[f("span",{innerHTML:o(t).failed_job_content},null,8,q9)]),_:1})]),_:1},8,["header","visible"])],64)}}},j9={key:0,class:"grid"},U9={class:"flex flex-row"},N9=f("b",{class:"mr-1"},"Failed Jobs",-1),H9={class:"p-inputgroup"},K9={__name:"List",setup(n){const t=ka(),i=Ge();return _t(),Te(async()=>{await t.onLoad(i),await t.setPageTitle(),await t.watchRoutes(i),await t.watchStates(),await t.getAssets(),await t.getList()}),(r,a)=>{const s=R("Badge"),u=R("Button"),l=R("Panel"),c=R("RouterView");return o(t).assets?(_(),O("div",j9,[f("div",{class:he("col-"+o(t).list_view_width)},[x(l,{class:"is-small"},{header:T(()=>[f("div",U9,[f("div",null,[N9,o(t).list&&o(t).list.total>0?(_(),$(s,{key:0,value:o(t).list.total},null,8,["value"])):A("",!0)])])]),icons:T(()=>[f("div",H9,[x(u,{class:"p-button-sm","data-testid":"failedjobs-content-refresh",icon:"pi pi-refresh",loading:o(t).is_btn_loading,onClick:o(t).sync},null,8,["loading","onClick"])])]),default:T(()=>[x($9),x(F9)]),_:1})],2),x(c)])):A("",!0)}}};let z9="WebReinvent\\VaahCms\\Models\\Batch",wf=document.getElementsByTagName("base")[0].getAttribute("href"),W9=wf+"/vaah/batches",$o={query:{page:1,rows:20,filter:{q:null,is_active:null,trashed:null,sort:null,from:null,to:null,date_filter_by:null}},action:{type:null,items:[]}};const xa=Ot({id:"batches",state:()=>({title:"Batches - Advanced",page:1,rows:20,dialog_content:null,display_detail:!1,display_failed_ids:!1,base_url:wf,ajax_url:W9,model:z9,assets_is_fetching:!0,app:null,assets:null,rows_per_page:[10,20,30,50,100,500],list:null,item:null,fillable:null,empty_query:$o.query,empty_action:$o.action,query:B().clone($o.query),action:B().clone($o.action),search:{delay_time:600,delay_timer:0},route:null,watch_stopper:null,route_prefix:"batches.",view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],dates:[],first_element:null}),actions:{async onLoad(n){this.route=n,this.first_element=(this.query.page-1)*this.query.rows,this.updateQueryFromUrl(n)},async updateQueryFromUrl(n){if(n.query&&Object.keys(n.query).length>0){for(let t in n.query)this.query[t]=n.query[t];this.countFilters(n.query)}},watchRoutes(n){this.watch_stopper=We(n,(t,i)=>{if(this.watch_stopper&&!t.name.includes(this.route_prefix))return this.watch_stopper(),!1;this.route=t,t.params.id&&this.getItem(t.params.id)},{deep:!0})},watchStates(){We(this.query.filter,(n,t)=>{this.delayedSearch()},{deep:!0})},watchItem(){this.item&&We(()=>this.item.name,(n,t)=>{n&&n!==""&&(this.item.name=B().capitalising(n),this.item.slug=B().strToSlug(n))},{deep:!0})},async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,B().ajax(this.ajax_url+"/assets",this.afterGetAssets))},afterGetAssets(n,t){n&&(this.assets=n,n.rows&&(this.query.rows?this.query.rows=parseInt(this.query.rows):this.query.rows=n.rows))},async getList(){let n={query:B().clone(this.query)};await this.updateUrlQueryString(this.query),await B().ajax(this.ajax_url,await this.getListAfter,n)},async getListAfter(n){this.is_btn_loading=!1,n&&(this.list=n.list,this.first_element=(this.query.page-1)*this.query.rows)},isListActionValid(){return this.action.type?this.action.items.length<1?(B().toastErrors(["Select records"]),!1):!0:(B().toastErrors(["Select an action type"]),!1)},async updateListAfter(n,t){n&&(this.action=B().clone(this.empty_action),await this.getList())},async listAction(n=null){!n&&this.action.type?n=this.action.type:this.action.type=n;let t=this.ajax_url+"/action/"+n,i="PUT";switch(n){case"delete":t=this.ajax_url,i="DELETE";break;case"delete-all":i="DELETE";break}let r={params:this.action,method:i,data:{},show_success:!1};await B().ajax(t,this.updateListAfter,r)},async itemActionAfter(n,t){n&&(this.item=n,await this.getList())},async paginate(n){this.query.page=n.page+1,this.query.rows=n.rows,this.first_element=(this.query.page-1)*this.query.rows,await this.getList()},async reload(){await this.getAssets(),await this.getList()},async getFaker(){let n={model_namespace:this.model,except:this.assets.fillable.except},t=this.base_url+"/faker",i={params:n,method:"post"};B().ajax(t,this.getFakerAfter,i)},getFakerAfter:function(n,t){if(n){let i=this;Object.keys(n.fill).forEach(function(r){i.item[r]=n.fill[r]})}},onItemSelection(n){this.action.items=n},setActiveItemAsEmpty(){this.item=B().clone(this.assets.empty_item)},confirmDelete(){if(this.action.items.length<1)return B().toastErrors(["Select a record"]),!1;this.action.type="delete",B().confirmDialogDelete(this.listAction)},confirmDeleteAll(){this.action.type="delete-all",B().confirmDialogDelete(this.listAction)},async delayedSearch(){let n=this;this.query.page=1,this.action.items=[],clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.updateUrlQueryString(n.query),await n.getList()},this.search.delay_time)},async updateUrlQueryString(n){n=B().clone(n);let t=ct.stringify(n,{skipNulls:!0}),i=ct.parse(t);i.filter&&(i.filter=B().cleanObject(i.filter)),await this.$router.replace({query:null}),await this.$router.replace({query:i}),this.countFilters(i)},countFilters:function(n){if(this.count_filters=0,n&&n.filter){let t=B().cleanObject(n.filter);this.count_filters=Object.keys(t).length}},async clearSearch(){this.query.filter.q=null,await this.updateUrlQueryString(this.query),await this.getList()},async resetQuery(){await this.resetQueryString(),await this.getList()},async resetQueryString(){for(let n in this.query.filter)this.query.filter[n]=null;for(let n in this.query)n!=="filter"&&(this.query[n]=null);this.dates2=null,this.query.page=this.page,this.query.rows=this.rows,await this.updateUrlQueryString(this.query)},toList(){this.$router.push({name:"batches.index"})},isViewLarge(){return this.view==="large"},getIdWidth(){let n=50;if(this.list&&this.list.total){let t=this.list.total.toString();t=t.length,n=t*40}return n+"px"},getActionWidth(){let n=100;return this.isViewLarge()||(n=80),n+"px"},async getListSelectedMenu(){this.list_selected_menu=[{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDelete()}}]},getListBulkMenu(){this.list_bulk_menu=[{label:"Delete All",icon:"pi pi-trash",command:async()=>{this.confirmDeleteAll()}}]},confirmDeleteItem(){this.form.type="delete",B().confirmDialogDelete(this.confirmDeleteItemAfter)},confirmDeleteItemAfter(){this.itemAction("delete",this.item)},getJobProgress(n,t,i=null,r=!1){let a=n,s=0,u=0;return t===1?u=a.total_jobs-a.pending_jobs-a.failed_jobs:t===2?u=a.failed_jobs:t===3&&(u=a.pending_jobs),r?u:(s=u*100/a.total_jobs,i?s.toFixed(2):s)},displayBatchDetails(n){this.dialog_content=''+n+"",this.display_detail=!0},displayFailedIdDetails(n){this.dialog_content=''+JSON.stringify(n)+"",this.display_failed_ids=!0},deleteItem(n){this.item=n,this.form.action="delete",B().confirmDialogDelete(this.itemAction)},setDateRange(){if(this.dates2.length>0){let n=new Date(this.dates2[0]);this.query.filter.from=n.getFullYear()+"-"+(n.getMonth()+1)+"-"+n.getDate(),n=new Date(this.dates2[1]),this.query.filter.to=n.getFullYear()+"-"+(n.getMonth()+1)+"-"+n.getDate(),this.getList()}},itemAction(n,t=null){t||(t=this.item),n||(n=this.form.action),this.form.action=n;let i=this.ajax_url,r={method:"post"};switch(n){case"create-and-new":case"create-and-close":case"create-and-clone":r.method="POST",r.params=t;break;case"save":case"save-and-close":case"save-and-clone":r.method="PUT",r.params=t,i+="/"+t.id;break;case"delete":r.method="DELETE",r.params={data:{}},i+="/"+t.id;break;default:r.method="PATCH",i+="/"+t.id+"/action/"+n;break}B().ajax(i,this.itemActionAfter,r)},async sync(){this.is_btn_loading=!0,await this.getList()},hasPermission(n){const t=je();return B().hasPermission(t.permissions,n)},setPageTitle(){this.title&&(document.title=this.title)}}}),G9=f("b",null,"Column:",-1),Y9={class:"field-radiobutton"},Q9=f("label",{for:"sort-descending"},"Created",-1),X9={class:"field-radiobutton"},Z9=f("label",{for:"sort-descending"},"Cancelled",-1),J9={class:"field-radiobutton"},eR=f("label",{for:"sort-descending"},"Finished",-1),tR=f("b",null,"Date Between:",-1),nR={__name:"Filters",setup(n){const t=xa();return(i,r)=>{const a=R("RadioButton"),s=R("Calendar"),u=R("Sidebar");return _(),O("div",null,[x(u,{visible:o(t).show_filters,"onUpdate:visible":r[4]||(r[4]=l=>o(t).show_filters=l),position:"right",style:{"z-index":"1102"}},{default:T(()=>[x(mt,null,{label:T(()=>[G9]),default:T(()=>[f("div",Y9,[x(a,{name:"sort-descending","data-testid":"batches-filters-created_at",value:"created_at",modelValue:o(t).query.filter.date_filter_by,"onUpdate:modelValue":r[0]||(r[0]=l=>o(t).query.filter.date_filter_by=l)},null,8,["modelValue"]),Q9]),f("div",X9,[x(a,{name:"sort-descending","data-testid":"batches-filters-cancelled_at",value:"cancelled_at",modelValue:o(t).query.filter.date_filter_by,"onUpdate:modelValue":r[1]||(r[1]=l=>o(t).query.filter.date_filter_by=l)},null,8,["modelValue"]),Z9]),f("div",J9,[x(a,{name:"sort-descending","data-testid":"batches-filters-finished_at",value:"finished_at",modelValue:o(t).query.filter.date_filter_by,"onUpdate:modelValue":r[2]||(r[2]=l=>o(t).query.filter.date_filter_by=l)},null,8,["modelValue"]),eR])]),_:1}),x(mt,null,{label:T(()=>[tR]),default:T(()=>[x(s,{inputId:"range","data-testid":"batch",modelValue:o(t).dates2,"onUpdate:modelValue":r[3]||(r[3]=l=>o(t).dates2=l),onDateSelect:o(t).setDateRange,selectionMode:"range",manualInput:!1},null,8,["modelValue","onDateSelect"])]),_:1})]),_:1},8,["visible"])])}}},iR={key:0},sR=f("i",{class:"pi pi-angle-down"},null,-1),rR={class:"grid p-fluid"},oR={class:"col-12"},aR={class:"p-inputgroup"},lR={__name:"Actions",setup(n){const t=xa();Te(async()=>{t.getListSelectedMenu(),t.getListBulkMenu()});const i=Ae(),r=u=>{i.value.toggle(u)},a=Ae(),s=u=>{a.value.toggle(u)};return(u,l)=>{const c=R("Badge"),d=R("Button"),p=R("Menu"),v=R("InputText");return _(),O("div",null,[f("div",{class:he([{"flex justify-content-between":o(t).isViewLarge()},"mt-2 mb-2"])},[o(t).view==="large"?(_(),O("div",iR,[x(d,{class:"p-button-sm",onClick:r,"data-testid":"batches-actions-menu","aria-haspopup":"true","aria-controls":"overlay_menu"},{default:T(()=>[sR,o(t).action.items.length>0?(_(),$(c,{key:0,value:o(t).action.items.length},null,8,["value"])):A("",!0)]),_:1}),x(p,{ref_key:"selected_menu_state",ref:i,model:o(t).list_selected_menu,popup:!0},null,8,["model"]),x(d,{class:"p-button-sm ml-1",icon:"pi pi-ellipsis-h",onClick:s,"data-testid":"batches-actions-bulk-menu","aria-haspopup":"true","aria-controls":"bulk_menu_state"}),x(p,{ref_key:"bulk_menu_state",ref:a,model:o(t).list_bulk_menu,popup:!0},null,8,["model"])])):A("",!0),f("div",null,[f("div",rR,[f("div",oR,[f("div",aR,[x(v,{modelValue:o(t).query.filter.q,"onUpdate:modelValue":l[0]||(l[0]=h=>o(t).query.filter.q=h),onKeyup:[l[1]||(l[1]=Ie(h=>o(t).delayedSearch(),["enter"])),l[2]||(l[2]=Ie(h=>o(t).delayedSearch(),["enter","native"])),l[3]||(l[3]=Ie(h=>o(t).delayedSearch(),["13"]))],"data-testid":"batches-actions-search",placeholder:"Search",class:"p-inputtext-sm"},null,8,["modelValue"]),x(d,{onClick:l[4]||(l[4]=h=>o(t).delayedSearch()),"data-testid":"batches-actions-search-button",icon:"pi pi-search",class:"p-button-sm"}),x(d,{class:"p-button-sm",label:"Filters","data-testid":"batches-actions-show-filters",onClick:l[5]||(l[5]=h=>o(t).show_filters=!0)},{default:T(()=>[o(t).count_filters>0?(_(),$(c,{key:0,value:o(t).count_filters},null,8,["value"])):A("",!0)]),_:1}),x(d,{class:"p-button-sm",icon:"pi pi-filter-slash","data-testid":"batches-actions-reset-filters",label:"Reset",onClick:l[6]||(l[6]=h=>o(t).resetQuery())})])]),x(nR)])])],2)])}}},uR={key:0},cR={role:"progressbar",class:"p-progressbar p-component p-progressbar-determinate batch-progress-bar"},dR={class:"p-progressbar-label","data-pc-section":"label"},pR={class:"p-progressbar-label","data-pc-section":"label"},hR={class:"p-progressbar-label","data-pc-section":"label"},fR=f("span",{class:"pi pi-eye mr-1"},null,-1),mR=f("span",null,"View",-1),gR=f("span",{class:"pi pi-eye mr-1"},null,-1),vR={key:0},yR={key:1},_R=f("span",{class:"pi pi-trash"},null,-1),bR=["innerHTML"],wR=["innerHTML"],CR={__name:"Table",setup(n){const t=xa(),i=B();return(r,a)=>{const s=R("Column"),u=R("Button"),l=R("DataTable"),c=R("Card"),d=R("Dialog"),p=R("Paginator"),v=Ke("tooltip");return o(t).list?(_(),O("div",uR,[x(l,{value:o(t).list.data,dataKey:"id",class:"p-datatable-sm p-datatable-hoverable-rows",selection:o(t).action.items,"onUpdate:selection":a[0]||(a[0]=h=>o(t).action.items=h),"data-testid":"batches-table-checkbox",stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[o(t).isViewLarge()?(_(),$(s,{key:0,selectionMode:"multiple",headerStyle:"width: 3em"})):A("",!0),x(s,{field:"id",header:"ID",style:St({width:o(t).getIdWidth()}),sortable:!0},null,8,["style"]),x(s,{field:"name",header:"",style:{width:"30%"}},{body:T(h=>[f("span",null,[f("div",cR,[o(t).getJobProgress(h.data,1,null,!0)?ce((_(),O("div",{key:0,class:"p-progressbar-value p-progressbar-value-animate progress-bar-success",style:St("width: "+o(t).getJobProgress(h.data,1)+"%;")},[f("div",dR,Q(o(t).getJobProgress(h.data,1,2))+"% ",1)],4)),[[v,{value:"Passed ("+o(t).getJobProgress(h.data,1,null,!0)+")"},void 0,{top:!0}]]):A("",!0),o(t).getJobProgress(h.data,2,null,!0)?ce((_(),O("div",{key:1,class:"p-progressbar-value p-progressbar-value-animate progress-bar-danger",style:St("width: "+o(t).getJobProgress(h.data,2)+"%; left: "+o(t).getJobProgress(h.data,1)+"%;")},[f("div",pR,Q(o(t).getJobProgress(h.data,2,2))+"% ",1)],4)),[[v,{value:"Failed ("+o(t).getJobProgress(h.data,2,null,!0)+")"},void 0,{top:!0}]]):A("",!0),o(t).getJobProgress(h.data,3,null,!0)?ce((_(),O("div",{key:2,class:"p-progressbar-value p-progressbar-value-animate progress-bar-warning",style:St("width: "+o(t).getJobProgress(h.data,3)+"%; left: "+(o(t).getJobProgress(h.data,1)+o(t).getJobProgress(h.data,2))+"%;")},[f("div",hR,Q(o(t).getJobProgress(h.data,3,2))+"% ",1)],4)),[[v,{value:"Pending ("+o(t).getJobProgress(h.data,3,null,!0)+")"},void 0,{top:!0}]]):A("",!0)])])]),_:1}),x(s,{field:"actions",style:St([{width:"150px"},{width:o(t).getActionWidth()}]),header:"Detail"},{body:T(h=>[o(t).hasPermission("can-read-batch-details")?(_(),$(u,{key:0,class:"p-button-rounded p-button-sm p-button-outlined","data-testid":"batches-table-options",onClick:m=>o(t).displayBatchDetails(h.data.options)},{default:T(()=>[fR,mR]),_:2},1032,["onClick"])):A("",!0)]),_:1},8,["style"]),o(t).isViewLarge()?(_(),$(s,{key:1,field:"failed_job_ids",header:"Failed Job Ids",style:{width:"150px"}},{body:T(h=>[o(t).hasPermission("can-read-batch-failed-ids")?(_(),$(u,{key:0,class:"p-button-sm p-button-outlined p-button-rounded","data-testid":"batches-table-failed-ids",onClick:m=>o(t).displayFailedIdDetails(h.data.failed_job_ids)},{default:T(()=>[gR,h.data.failed_job_ids&&(typeof h.data.failed_job_ids=="array"||typeof h.data.failed_job_ids=="object")?(_(),O("span",vR,Q(h.data.failed_job_ids.length),1)):(_(),O("span",yR," 0 "))]),_:2},1032,["onClick"])):A("",!0)]),_:1})):A("",!0),o(t).isViewLarge()?(_(),$(s,{key:2,field:"cancelled_at",header:"Cancelled At",sortable:!0,style:{width:"150px"}},{body:T(h=>[ue(Q(o(i).ago(h.data.cancelled_at)),1)]),_:1})):A("",!0),o(t).isViewLarge()?(_(),$(s,{key:3,field:"created_at",header:"Created At",style:{width:"150px"},sortable:!0},{body:T(h=>[ue(Q(o(i).ago(h.data.created_at)),1)]),_:1})):A("",!0),o(t).isViewLarge()?(_(),$(s,{key:4,field:"finished_at",header:"Finished At",style:{width:"150px"},sortable:!0},{body:T(h=>[ue(Q(o(i).ago(h.data.finished_at)),1)]),_:1})):A("",!0),o(t).isViewLarge()?(_(),$(s,{key:5,style:{width:"150px"}},{body:T(h=>[o(t).hasPermission("can-delete-batch")?(_(),$(u,{key:0,class:"p-button-rounded p-button-text",onClick:m=>o(t).deleteItem(h.data),"data-testid":"batches-table-to-trash"},{default:T(()=>[_R]),_:2},1032,["onClick"])):A("",!0)]),_:1})):A("",!0)]),_:1},8,["value","selection"]),x(d,{header:"Options",visible:o(t).display_detail,"onUpdate:visible":a[1]||(a[1]=h=>o(t).display_detail=h),"data-testid":"batch-table-detail_dialog",breakpoints:{"960px":"75vw","640px":"90vw"},style:{width:"50vw"}},{default:T(()=>[x(c,{class:"w-max"},{content:T(()=>[f("span",{innerHTML:o(t).dialog_content},null,8,bR)]),_:1})]),_:1},8,["visible"]),x(d,{header:"Failed Ids",visible:o(t).display_failed_ids,"onUpdate:visible":a[2]||(a[2]=h=>o(t).display_failed_ids=h),"data-testid":"batch-table-failed_ids_dialog",breakpoints:{"960px":"75vw","640px":"90vw"},style:{width:"50vw"}},{default:T(()=>[x(c,{class:"w-max"},{content:T(()=>[f("span",{innerHTML:o(t).dialog_content},null,8,wR)]),_:1})]),_:1},8,["visible"]),x(p,{first:o(t).first_element,"onUpdate:first":a[3]||(a[3]=h=>o(t).first_element=h),rows:o(t).query.rows,"data-testid":"batch-table-paginator",totalRecords:o(t).list.total,onPage:a[4]||(a[4]=h=>o(t).paginate(h)),rowsPerPageOptions:o(t).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["first","rows","totalRecords","rowsPerPageOptions"])])):A("",!0)}}},SR={key:0,class:"grid"},kR={class:"flex flex-row align-items-center w-full"},xR={class:"w-full"},IR=f("b",{class:"mr-1"},"Batches",-1),LR={__name:"List",setup(n){const t=xa(),i=Ge();return _t(),Te(async()=>{await t.onLoad(i),await t.setPageTitle(),await t.watchRoutes(i),await t.watchStates(),await t.getAssets(),await t.getList()}),(r,a)=>{const s=R("Badge"),u=R("Button"),l=R("Panel"),c=R("RouterView");return o(t).assets?(_(),O("div",SR,[f("div",{class:he("col-"+o(t).list_view_width)},[x(l,{class:"is-small"},{header:T(()=>[f("div",kR,[f("div",xR,[IR,o(t).list&&o(t).list.total>0?(_(),$(s,{key:0,value:o(t).list.total},null,8,["value"])):A("",!0)]),f("div",null,[x(u,{class:"p-button-sm",icon:"pi pi-refresh",onClick:o(t).sync,"data-testid":"batches-list-refresh",loading:o(t).is_btn_loading},null,8,["onClick","loading"])])])]),default:T(()=>[x(lR),x(CR)]),_:1})],2),x(c)])):A("",!0)}}};let Cf=[],Sf=[];Sf={path:"/vaah/advanced/",component:yn,props:!0,children:[{path:"",component:pT,props:!0,children:[{path:"logs",name:"logs.index",component:o9,props:!0,children:[{path:"view/:name?",name:"logs.view",component:_9,props:!0}]},{path:"jobs",name:"jobs.index",component:zT,props:!0},{path:"failedjobs",name:"failedjobs.index",component:K9,props:!0},{path:"batches",name:"batches.index",component:LR,props:!0}]}]};Cf.push(Sf);let PR="WebReinvent\\VaahCms\\Models\\Permission",kf=document.getElementsByTagName("base")[0].getAttribute("href"),md=kf+"/vaah/permissions",Cs={query:{page:1,rows:20,filter:{q:null,is_active:null,trashed:null,sort:null},recount:null},action:{type:null,items:[]},permission_roles_query:{q:null,page:1,rows:20}};const mi=Ot({id:"permissions",state:()=>({title:"Permissions",page:1,rows:20,base_url:kf,ajax_url:md,model:PR,assets_is_fetching:!0,app:null,assets:null,rows_per_page:[10,20,30,50,100,500],list:null,item:null,fillable:null,empty_query:Cs.query,empty_action:Cs.action,query:B().clone(Cs.query),action:B().clone(Cs.action),search:{delay_time:600,delay_timer:0},route:null,watch_stopper:null,route_prefix:"permissions.",view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],item_menu_list:[],item_menu_state:null,form_menu_list:[],total_roles:null,total_users:null,permission_roles:null,roles_menu_items:null,active_permission_role:null,permission_roles_query:B().clone(Cs.permission_roles_query),is_btn_loading:!1,firstElement:null,rolesFirstElement:null}),getters:{},actions:{async onLoad(n){this.route=n,this.setViewAndWidth(n.name),this.firstElement=(this.query.page-1)*this.query.rows,this.rolesFirstElement=(this.permission_roles_query.page-1)*this.permission_roles_query.rows,this.updateQueryFromUrl(n)},setViewAndWidth(n){switch(n){case"permissions.index":this.view="large",this.list_view_width=12;break;default:this.view="small",this.list_view_width=7;break}},async updateQueryFromUrl(n){if(n.query&&Object.keys(n.query).length>0){for(let t in n.query)this.query[t]=n.query[t];this.countFilters(n.query)}},watchRoutes(n){this.watch_stopper=We(n,(t,i)=>{if(this.watch_stopper&&!t.name.includes(this.route_prefix))return this.watch_stopper(),!1;this.route=t,t.params.id&&this.getItem(t.params.id),this.setViewAndWidth(t.name)},{deep:!0})},watchStates(){We(this.query.filter,(n,t)=>{this.delayedSearch()},{deep:!0}),We(this.permission_roles_query,(n,t)=>{this.delayedItemUsersSearch()},{deep:!0})},async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,B().ajax(this.ajax_url+"/assets",this.afterGetAssets))},afterGetAssets(n,t){n&&(this.assets=n,n.rows&&(this.urlContains("role")&&(this.permission_roles_query.rows=this.permission_roles_query.rows?parseInt(this.permission_roles_query.rows):n.rows),this.query.rows?this.query.rows=parseInt(this.query.rows):this.query.rows=n.rows),this.route.params&&!this.route.params.id&&(this.item=B().clone(n.empty_item)))},async getList(){let n={query:B().clone(this.query)};await this.updateUrlQueryString(this.query),await B().ajax(this.ajax_url,this.afterGetList,n)},afterGetList:function(n,t){this.is_btn_loading=!1,this.query.recount=null,n&&(this.list=n,this.total_roles=t.data.total_roles,this.total_users=t.data.total_users,this.firstElement=this.query.rows*(this.query.page-1))},async getItem(n){n&&await B().ajax(md+"/"+n,this.getItemAfter)},async getItemAfter(n,t){n?this.item=n:this.$router.push({name:"permissions.index"}),this.getItemMenu(),await this.getFormMenu()},async getItemRoles(){this.showProgress();let n={query:this.permission_roles_query};B().ajax(this.ajax_url+"/item/"+this.item.id+"/roles",this.afterGetItemRoles,n)},afterGetItemRoles(n,t){this.hideProgress(),n&&(this.permission_roles=n)},async changePermission(n){let t={id:this.item.id,role_id:n.id};var i={};n.pivot.is_active?i.is_active=0:i.is_active=1,await this.actions(!1,"toggle-role-active-status",t,i)},async bulkActions(n,t){let i={id:this.item.id,query:this.permission_roles_query,role_id:null},r={is_active:n};await this.actions(!1,t,i,r)},async actions(n,t,i,r){this.showProgress(),n&&n.preventDefault();let a={params:{inputs:i,data:r},method:"post"};B().ajax(this.ajax_url+"/actions/"+t,this.afterActions,a)},async afterActions(n,t){this.hideProgress(),await this.getItemRoles(),await this.getList()},async delayedItemUsersSearch(){let n=this;this.item&&this.item.id&&(clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.getItemRoles()},this.search.delay_time))},isListActionValid(){return this.action.type?this.action.items.length<1?(B().toastErrors(["Select records"]),!1):!0:(B().toastErrors(["Select an action type"]),!1)},async updateList(n=null){if(!n&&this.action.type?n=this.action.type:this.action.type=n,!this.isListActionValid())return!1;let t="PUT";switch(n){case"delete":t="DELETE";break}let i={params:this.action,method:t,show_success:!1};await B().ajax(this.ajax_url,this.updateListAfter,i)},async updateListAfter(n,t){n&&(this.action=B().clone(this.empty_action),await this.getList())},async listAction(n=null){!n&&this.action.type?n=this.action.type:this.action.type=n;let t=this.ajax_url+"/actions/"+n,i="PUT";switch(n){case"delete":t=this.ajax_url,i="DELETE";break;case"delete-all":i="DELETE";break}let r={params:this.action,method:i,show_success:!1};r.params.query=B().clone(this.query),await B().ajax(t,this.updateListAfter,r)},itemAction(n,t=null){t||(t=this.item),this.form.action=n;let i=this.ajax_url,r={method:"post"};switch(n){case"save":case"save-and-close":case"save-and-clone":r.method="PUT",r.params=t,i+="/"+t.id;break;case"delete":r.method="DELETE",i+="/"+t.id;break;default:r.method="PATCH",i+="/"+t.id+"/action/"+n;break}B().ajax(i,this.itemActionAfter,r)},async itemActionAfter(n,t){n&&(this.item=n,await this.getList(),await this.formActionAfter(),this.getItemMenu(),this.route.params&&this.route.params.id&&await this.getItem(this.route.params.id))},async formActionAfter(){switch(this.form.action){case"create-and-new":case"save-and-new":this.setActiveItemAsEmpty();break;case"create-and-close":case"save-and-close":this.setActiveItemAsEmpty(),this.$router.push({name:"permissions.index"});break;case"save-and-clone":this.item.id=null;break;case"trash":this.item=null;break;case"delete":this.item=null,this.toList();break}},async toggleIsActive(n){n.is_active?await this.itemAction("activate",n):await this.itemAction("deactivate",n)},async paginate(n){this.query.page=n.page+1,this.query.rows=n.rows,this.firstElement=this.query.rows*(this.query.page-1),await this.getList()},async rolePaginate(n){this.permission_roles_query.page=n.page+1,this.permission_roles_query.rows=n.rows,await this.getItemRoles()},async reload(){await this.getAssets(),await this.getList()},async getFaker(){let n={model_namespace:this.model,except:this.assets.fillable.except},t=this.base_url+"/faker",i={params:n,method:"post"};B().ajax(t,this.getFakerAfter,i)},getFakerAfter:function(n,t){if(n){let i=this;Object.keys(n.fill).forEach(function(r){i.item[r]=n.fill[r]})}},async sync(){this.is_btn_loading=!0,this.query.recount=!0,await this.getList()},onItemSelection(n){this.action.items=n},setActiveItemAsEmpty(){this.item=B().clone(this.assets.empty_item)},confirmDelete(){if(this.action.items.length<1)return B().toastErrors(["Select a record"]),!1;this.action.type="delete",B().confirmDialogDelete(this.listAction)},confirmDeleteAll(){this.action.type="delete-all",B().confirmDialogDelete(this.listAction)},async delayedSearch(){let n=this;this.query.page=1,this.action.items=[],clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.updateUrlQueryString(n.query),await n.getList()},this.search.delay_time)},async updateUrlQueryString(n){n=B().clone(n);let t=ct.stringify(n,{skipNulls:!0}),i=ct.parse(t);i.filter&&(i.filter=B().cleanObject(i.filter)),await this.$router.replace({query:null}),await this.$router.replace({query:i}),this.countFilters(i)},countFilters:function(n){if(this.count_filters=0,n&&n.filter){let t=B().cleanObject(n.filter);this.count_filters=Object.keys(t).length}},async clearSearch(){this.query.filter.q=null,await this.updateUrlQueryString(this.query),await this.getList()},async resetQuery(){await this.resetQueryString(),await this.getList()},async resetQueryString(){for(let n in this.query.filter)this.query.filter[n]=null;this.query.page=this.page,this.query.rows=this.rows,await this.updateUrlQueryString(this.query)},resetPermissionRolesQuery(){this.permission_roles_query.q=null,this.permission_roles_query.rows=this.assets.rows},closeForm(){this.$router.push({name:"permissions.index"})},toList(){this.item=null,this.$router.push({name:"permissions.index"})},toForm(){this.item=B().clone(this.assets.empty_item),this.getFormMenu(),this.$router.push({name:"permissions.form"})},toView(n){this.item=B().clone(n),this.$router.push({name:"permissions.view",params:{id:n.id}})},toEdit(n){this.item=n,this.$router.push({name:"permissions.form",params:{id:n.id}})},toRole(n){this.item=n,this.getItemRoles(),this.$router.push({name:"permissions.view-role",params:{id:n.id}})},isViewLarge(){return this.view==="large"},getIdWidth(){let n=50;if(this.list&&this.list.total){let t=this.list.total.toString();t=t.length,n=t*40}return n+"px"},getActionWidth(){let n=100;return this.isViewLarge()||(n=80),n+"px"},getActionLabel(){let n=null;return this.isViewLarge()&&(n="Actions"),n},async getListSelectedMenu(){this.list_selected_menu=[{label:"Activate",command:async()=>{await this.updateList("activate")}},{label:"Deactivate",command:async()=>{await this.updateList("deactivate")}},{separator:!0},{label:"Trash",icon:"pi pi-times",command:async()=>{await this.updateList("trash")}},{label:"Restore",icon:"pi pi-replay",command:async()=>{await this.updateList("restore")}},{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDelete()}}]},getListBulkMenu(){this.list_bulk_menu=[{label:"Mark all as active",command:async()=>{await this.listAction("activate-all")}},{label:"Mark all as inactive",command:async()=>{await this.listAction("deactivate-all")}},{separator:!0},{label:"Trash All",icon:"pi pi-times",command:async()=>{await this.listAction("trash-all")}},{label:"Restore All",icon:"pi pi-replay",command:async()=>{await this.listAction("restore-all")}},{label:"Delete All",icon:"pi pi-trash",command:async()=>{this.confirmDeleteAll()}}]},getItemMenu(){let n=[];this.item&&this.item.deleted_at&&n.push({label:"Restore",icon:"pi pi-refresh",command:()=>{this.itemAction("restore")}}),this.item&&this.item.id&&!this.item.deleted_at&&n.push({label:"Trash",icon:"pi pi-times",command:()=>{this.itemAction("trash")}}),n.push({label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDeleteItem("delete")}}),this.item_menu_list=n},confirmDeleteItem(){this.form.type="delete",B().confirmDialogDelete(this.confirmDeleteItemAfter)},confirmDeleteItemAfter(){this.itemAction("delete",this.item)},async getFormMenu(){let n=[];this.item&&this.item.id?n=[{label:"Save & Close",icon:"pi pi-check",command:()=>{this.itemAction("save-and-close")}},{label:"Save & Clone",icon:"pi pi-copy",command:()=>{this.itemAction("save-and-clone")}},{label:"Trash",icon:"pi pi-times",command:()=>{this.itemAction("trash")}},{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDeleteItem("delete")}}]:n=[{label:"Create & Close",icon:"pi pi-check",command:()=>{this.itemAction("create-and-close")}},{label:"Create & Clone",icon:"pi pi-copy",command:()=>{this.itemAction("create-and-clone")}},{label:"Reset",icon:"pi pi-refresh",command:()=>{this.setActiveItemAsEmpty()}}],n.push({label:"Fill",icon:"pi pi-pencil",command:()=>{this.getFaker()}}),this.form_menu_list=n},async getRoleMenu(){return this.roles_menu_items=[{label:"Active All Roles",command:async()=>{await this.bulkActions(1,"toggle-role-active-status")}},{label:"Inactive All Roles",command:async()=>{await this.bulkActions(0,"toggle-role-active-status")}}]},hasPermission(n){const t=je();return B().hasPermission(t.permissions,n)},showProgress(){this.show_progress_bar=!0},hideProgress(){this.show_progress_bar=!1},urlContains(n){return this.route.path.includes(n)},setPageTitle(){this.title&&(document.title=this.title)}}}),OR=f("b",null,"Sort By:",-1),ER={class:"field-radiobutton"},AR=f("label",{for:"sort-none"},"None",-1),TR={class:"field-radiobutton"},RR=f("label",{for:"sort-ascending"},"Updated (Ascending)",-1),DR={class:"field-radiobutton"},MR=f("label",{for:"sort-descending"},"Updated (Descending)",-1),$R=f("b",null,"Is Active:",-1),VR={class:"field-radiobutton"},BR=f("label",{for:"active-all"},"All",-1),qR={class:"field-radiobutton"},FR=f("label",{for:"active-true"},"Only Active",-1),jR={class:"field-radiobutton"},UR=f("label",{for:"active-false"},"Only Inactive",-1),NR=f("b",null,"Trashed:",-1),HR={class:"field-radiobutton"},KR=f("label",{for:"trashed-exclude"},"Exclude Trashed",-1),zR={class:"field-radiobutton"},WR=f("label",{for:"trashed-include"},"Include Trashed",-1),GR={class:"field-radiobutton"},YR=f("label",{for:"trashed-only"},"Only Trashed",-1),QR={__name:"Filters",setup(n){const t=mi();return(i,r)=>{const a=R("RadioButton"),s=R("Divider"),u=R("Sidebar");return _(),O("div",null,[x(u,{visible:o(t).show_filters,"onUpdate:visible":r[9]||(r[9]=l=>o(t).show_filters=l),style:{"z-index":"1001"},position:"right"},{default:T(()=>[x(mt,null,{label:T(()=>[OR]),default:T(()=>[f("div",ER,[x(a,{name:"sort-none",value:"",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[0]||(r[0]=l=>o(t).query.filter.sort=l)},null,8,["modelValue"]),AR]),f("div",TR,[x(a,{name:"sort-ascending",value:"updated_at",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[1]||(r[1]=l=>o(t).query.filter.sort=l)},null,8,["modelValue"]),RR]),f("div",DR,[x(a,{name:"sort-descending",value:"updated_at:desc",modelValue:o(t).query.filter.sort,"onUpdate:modelValue":r[2]||(r[2]=l=>o(t).query.filter.sort=l)},null,8,["modelValue"]),MR])]),_:1}),x(s),x(mt,null,{label:T(()=>[$R]),default:T(()=>[f("div",VR,[x(a,{name:"active-all",value:"null","data-testid":"permission-filter_active_all",modelValue:o(t).query.filter.is_active,"onUpdate:modelValue":r[3]||(r[3]=l=>o(t).query.filter.is_active=l)},null,8,["modelValue"]),BR]),f("div",qR,[x(a,{name:"active-true",value:"true","data-testid":"permission-filter_active_only",modelValue:o(t).query.filter.is_active,"onUpdate:modelValue":r[4]||(r[4]=l=>o(t).query.filter.is_active=l)},null,8,["modelValue"]),FR]),f("div",jR,[x(a,{name:"active-false",value:"false","data-testid":"permission-filter_inactive_only",modelValue:o(t).query.filter.is_active,"onUpdate:modelValue":r[5]||(r[5]=l=>o(t).query.filter.is_active=l)},null,8,["modelValue"]),UR])]),_:1}),x(mt,null,{label:T(()=>[NR]),default:T(()=>[f("div",HR,[x(a,{name:"trashed-exclude",value:"","data-testid":"permission-filter_trashed_exclude",modelValue:o(t).query.filter.trashed,"onUpdate:modelValue":r[6]||(r[6]=l=>o(t).query.filter.trashed=l)},null,8,["modelValue"]),KR]),f("div",zR,[x(a,{name:"trashed-include",value:"include","data-testid":"permission-filter_trashed_include",modelValue:o(t).query.filter.trashed,"onUpdate:modelValue":r[7]||(r[7]=l=>o(t).query.filter.trashed=l)},null,8,["modelValue"]),WR]),f("div",GR,[x(a,{name:"trashed-only",value:"only","data-testid":"permission-filter_trashed_only",modelValue:o(t).query.filter.trashed,"onUpdate:modelValue":r[8]||(r[8]=l=>o(t).query.filter.trashed=l)},null,8,["modelValue"]),YR])]),_:1})]),_:1},8,["visible"])])}}},XR={key:0},ZR=f("i",{class:"pi pi-angle-down"},null,-1),JR={class:"grid p-fluid"},eD={class:"col-12"},tD={class:"p-inputgroup"},nD={__name:"Actions",setup(n){const t=mi();Te(async()=>{t.getListSelectedMenu(),t.getListBulkMenu()});const i=Ae(),r=u=>{i.value.toggle(u)},a=Ae(),s=u=>{a.value.toggle(u)};return(u,l)=>{const c=R("Badge"),d=R("Button"),p=R("Menu"),v=R("InputText");return _(),O("div",null,[f("div",{class:he([{"flex justify-content-between":o(t).isViewLarge()},"mt-2 mb-2"])},[o(t).view==="large"?(_(),O("div",XR,[o(t).hasPermission("can-manage-permissions")||o(t).hasPermission("can-update-permissions")?(_(),$(d,{key:0,class:"p-button-sm",type:"button","aria-haspopup":"true","aria-controls":"overlay_menu",onClick:r},{default:T(()=>[ZR,o(t).action.items.length>0?(_(),$(c,{key:0,value:o(t).action.items.length},null,8,["value"])):A("",!0)]),_:1})):A("",!0),x(p,{ref_key:"selected_menu_state",ref:i,model:o(t).list_selected_menu,popup:!0},null,8,["model"]),o(t).hasPermission("can-manage-permissions")||o(t).hasPermission("can-update-permissions")?(_(),$(d,{key:1,class:"p-button-sm ml-1",icon:"pi pi-ellipsis-h",type:"button",onClick:s,"aria-haspopup":"true","aria-controls":"bulk_menu_state"})):A("",!0),x(p,{ref_key:"bulk_menu_state",ref:a,model:o(t).list_bulk_menu,popup:!0},null,8,["model"])])):A("",!0),f("div",null,[f("div",JR,[f("div",eD,[f("div",tD,[x(v,{class:"p-inputtext-sm",modelValue:o(t).query.filter.q,"onUpdate:modelValue":l[0]||(l[0]=h=>o(t).query.filter.q=h),onKeyup:[l[1]||(l[1]=Ie(h=>o(t).delayedSearch(),["enter"])),l[2]||(l[2]=Ie(h=>o(t).delayedSearch(),["enter","native"])),l[3]||(l[3]=Ie(h=>o(t).delayedSearch(),["13"]))],placeholder:"Search","data-testid":"permission-action_search_input"},null,8,["modelValue"]),x(d,{onClick:l[4]||(l[4]=h=>o(t).delayedSearch()),icon:"pi pi-search",class:"p-button-sm","data-testid":"permission-action_search"}),x(d,{class:"p-button-sm",type:"button",onClick:l[5]||(l[5]=h=>o(t).show_filters=!0),"data-testid":"permission-action_filter"},{default:T(()=>[ue(" Filters "),o(t).count_filters>0?(_(),$(c,{key:0,value:o(t).count_filters},null,8,["value"])):A("",!0)]),_:1}),x(d,{class:"p-button-sm",type:"button",icon:"pi pi-filter-slash",label:"Reset","data-testid":"permission-action_filter_reset",onClick:l[6]||(l[6]=h=>o(t).resetQuery())})])]),x(QR)])])],2)])}}},iD={key:0},sD={class:"p-inputgroup has-shadowless"},rD={__name:"Table",setup(n){const t=mi(),i=B();return(r,a)=>{const s=R("Column"),u=R("Badge"),l=R("Button"),c=R("InputSwitch"),d=R("DataTable"),p=R("Paginator"),v=Ke("tooltip");return o(t).list?(_(),O("div",iD,[x(d,{value:o(t).list.data,dataKey:"id",class:"p-datatable-sm p-datatable-hoverable-rows",selection:o(t).action.items,"onUpdate:selection":a[0]||(a[0]=h=>o(t).action.items=h),stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[o(t).isViewLarge()?(_(),$(s,{key:0,selectionMode:"multiple",headerStyle:"width: 3em"})):A("",!0),x(s,{field:"id",header:"ID",class:"text-sm",style:St({width:o(t).getIdWidth()}),sortable:!0},null,8,["style"]),x(s,{field:"name",header:"Name",sortable:!0},{body:T(h=>[h.data.deleted_at?(_(),$(u,{key:0,value:"Trashed",severity:"danger"})):A("",!0),ue(" "+Q(h.data.name),1)]),_:1}),o(t).isViewLarge()?(_(),$(s,{key:1,field:"slug",header:"Slug",sortable:!0},{body:T(h=>[ce(x(l,{class:"p-button-tiny p-button-text p-0","data-testid":"permission-list_slug_copy",onClick:m=>o(i).copy(h.data.slug),icon:"pi pi-copy",label:h.data.slug},null,8,["onClick","label"]),[[v,"Copy Slug",void 0,{top:!0}]])]),_:1})):A("",!0),x(s,{field:"total_roles",header:"Roles"},{body:T(h=>[o(t).hasPermission("can-read-permissions")?ce((_(),$(l,{key:0,class:"p-button p-button-rounded p-button-sm white-space-nowrap",onClick:m=>o(t).toRole(h.data),"data-testid":"permission-role_view"},{default:T(()=>[ue(Q(h.data.count_roles)+" / "+Q(o(t).total_roles),1)]),_:2},1032,["onClick"])),[[v,"View Role",void 0,{top:!0}]]):A("",!0)]),_:1}),x(s,{field:"total_users",header:"Users"},{body:T(h=>[ce((_(),$(l,{class:"p-button p-button-rounded p-button-sm white-space-nowrap",disabled:""},{default:T(()=>[ue(Q(h.data.count_users)+" / "+Q(o(t).total_users),1)]),_:2},1024)),[[v,"User",void 0,{top:!0}]])]),_:1}),o(t).isViewLarge()?(_(),$(s,{key:2,field:"updated_at",header:"Updated",style:{width:"150px"},sortable:!0},{body:T(h=>[ue(Q(o(i).ago(h.data.updated_at)),1)]),_:1})):A("",!0),o(t).isViewLarge()?(_(),$(s,{key:3,field:"is_active",sortable:!1,style:{width:"100px"},header:"Is Active"},{body:T(h=>[x(c,{modelValue:h.data.is_active,"onUpdate:modelValue":m=>h.data.is_active=m,modelModifiers:{bool:!0},"false-value":0,"true-value":1,class:"p-inputswitch-sm",onInput:m=>o(t).toggleIsActive(h.data),"data-testid":"permission-list_status"},null,8,["modelValue","onUpdate:modelValue","onInput"])]),_:1})):A("",!0),x(s,{field:"actions",style:St([{width:"150px"},{width:o(t).getActionWidth()}]),header:o(t).getActionLabel()},{body:T(h=>[f("div",sD,[o(t).hasPermission("can-read-permissions")?ce((_(),$(l,{key:0,class:"p-button-tiny p-button-text",onClick:m=>o(t).toView(h.data),icon:"pi pi-eye","data-testid":"permission-list_view"},null,8,["onClick"])),[[v,"View",void 0,{top:!0}]]):A("",!0),o(t).hasPermission("can-update-permissions")?ce((_(),$(l,{key:1,class:"p-button-tiny p-button-text",onClick:m=>o(t).toEdit(h.data),icon:"pi pi-pencil","data-testid":"permission-list_edit"},null,8,["onClick"])),[[v,"Update",void 0,{top:!0}]]):A("",!0),o(t).isViewLarge()&&!h.data.deleted_at||o(t).hasPermission("can-update-permissions")?ce((_(),$(l,{key:2,class:"p-button-tiny p-button-danger p-button-text",onClick:m=>o(t).itemAction("trash",h.data),icon:"pi pi-trash","data-testid":"permission-list_trash"},null,8,["onClick"])),[[v,"Trash",void 0,{top:!0}]]):A("",!0),o(t).isViewLarge()&&h.data.deleted_at?ce((_(),$(l,{key:3,class:"p-button-tiny p-button-success p-button-text",onClick:m=>o(t).itemAction("restore",h.data),icon:"pi pi-replay","data-testid":"permission-list_restore"},null,8,["onClick"])),[[v,"Restore",void 0,{top:!0}]]):A("",!0)])]),_:1},8,["style","header"])]),_:1},8,["value","selection"]),x(p,{first:o(t).firstElement,"onUpdate:first":a[1]||(a[1]=h=>o(t).firstElement=h),rows:o(t).query.rows,totalRecords:o(t).list.total,onPage:a[2]||(a[2]=h=>o(t).paginate(h)),rowsPerPageOptions:o(t).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["first","rows","totalRecords","rowsPerPageOptions"])])):A("",!0)}}},oD={class:"grid"},aD={class:"flex flex-row"},lD=f("b",{class:"mr-1"},"Permission",-1),uD={class:"p-inputgroup"},cD={__name:"List",setup(n){const t=mi(),i=Ge();return _t(),Te(async()=>{await t.onLoad(i),await t.setPageTitle(),await t.watchRoutes(i),await t.watchStates(),await t.getAssets(),await t.getList()}),(r,a)=>{const s=R("Badge"),u=R("Button"),l=R("Panel"),c=R("RouterView");return _(),O("div",oD,[f("div",{class:he("col-"+o(t).list_view_width)},[x(l,{class:"is-small"},{header:T(()=>[f("div",aD,[f("div",null,[lD,o(t).list&&o(t).list.total>0?(_(),$(s,{key:0,value:o(t).list.total},null,8,["value"])):A("",!0)])])]),icons:T(()=>[f("div",uD,[x(u,{class:"p-button-sm",icon:"pi pi-refresh",loading:o(t).is_btn_loading,onClick:a[0]||(a[0]=d=>o(t).sync()),"data-testid":"permission-list_refresh"},null,8,["loading"])])]),default:T(()=>[x(nD),x(rD)]),_:1})],2),x(c)])}}},dD={class:"col-5"},pD={class:"flex flex-row"},hD={class:"font-semibold text-sm"},fD={key:0},mD={key:0,class:"p-inputgroup"},gD={key:0,class:"pt-2"},vD={__name:"Form",setup(n){const t=mi(),i=Ge(),r=B(),a=je();Te(async()=>{i.params&&i.params.id&&await t.getItem(i.params.id),t.getFormMenu(),await a.getIsActiveStatusOptions()});const s=Ae(),u=l=>{s.value.toggle(l)};return(l,c)=>{const d=R("Button"),p=R("Menu"),v=R("InputText"),h=R("Textarea"),m=R("SelectButton"),b=R("Panel"),I=Ke("tooltip");return _(),O("div",dD,[x(b,{class:"is-small"},{header:T(()=>[f("div",pD,[f("div",hD,[o(t).item&&o(t).item.id?(_(),O("span",fD,Q(o(t).item.name),1)):A("",!0)])])]),icons:T(()=>[o(t).item&&o(t).item.id?(_(),O("div",mD,[x(d,{class:"p-button-sm",label:"#"+o(t).item.id,onClick:c[0]||(c[0]=k=>o(r).copy(o(t).item.id)),"data-testid":"permission-form_id"},null,8,["label"]),x(d,{class:"p-button-sm",label:"Save",icon:"pi pi-save","data-testid":"permission-form_save",onClick:c[1]||(c[1]=k=>o(t).itemAction("save"))}),o(t).hasPermission("can-update-permissions")||o(t).hasPermission("can-manage-permissions")?(_(),$(d,{key:0,class:"p-button-sm",icon:"pi pi-angle-down","aria-haspopup":"true",type:"button","data-testid":"permission-form_menu",onClick:u})):A("",!0),x(p,{ref_key:"form_menu",ref:s,model:o(t).form_menu_list,popup:!0},null,8,["model"]),o(t).hasPermission("can-read-permissions")?ce((_(),$(d,{key:1,class:"p-button-sm",icon:"pi pi-eye","data-testid":"permission-item_view",onClick:c[2]||(c[2]=k=>o(t).toView(o(t).item))},null,512)),[[I,"View",void 0,{top:!0}]]):A("",!0),x(d,{class:"p-button-sm",icon:"pi pi-times","data-testid":"permission-list_view",onClick:c[3]||(c[3]=k=>o(t).toList())})])):A("",!0)]),default:T(()=>[o(t).item?(_(),O("div",gD,[x($e,{label:"Name"},{default:T(()=>[x(v,{class:"w-full",modelValue:o(t).item.name,"onUpdate:modelValue":c[4]||(c[4]=k=>o(t).item.name=k),"data-testid":"permission-item_name"},null,8,["modelValue"])]),_:1}),x($e,{label:"Slug"},{default:T(()=>[x(v,{class:"w-full",modelValue:o(t).item.slug,"onUpdate:modelValue":c[5]||(c[5]=k=>o(t).item.slug=k),"data-testid":"permission-item_slug"},null,8,["modelValue"])]),_:1}),x($e,{label:"Details"},{default:T(()=>[x(h,{class:"w-full",modelValue:o(t).item.details,"onUpdate:modelValue":c[6]||(c[6]=k=>o(t).item.details=k),"data-testid":"permission-item_details"},null,8,["modelValue"])]),_:1}),x($e,{label:"Is Active"},{default:T(()=>[o(a)&&o(a).is_active_status_options?(_(),$(m,{key:0,modelValue:o(t).item.is_active,"onUpdate:modelValue":c[7]||(c[7]=k=>o(t).item.is_active=k),options:o(a).is_active_status_options,"option-label":"label","option-value":"value","data-testid":"permission-item_status",class:"has-shadowless"},null,8,["modelValue","options"])):A("",!0)]),_:1})])):A("",!0)]),_:1})])}}},yD={class:"col-5"},_D={class:"flex flex-row"},bD={class:"font-semibold text-sm"},wD={class:"p-inputgroup"},CD={key:0},SD={class:"flex align-items-center justify-content-between"},kD={class:""},xD={class:"ml-3"},ID={class:"p-datatable p-component p-datatable-responsive-scroll p-datatable-striped p-datatable-sm"},LD={class:"p-datatable-table"},PD={class:"p-datatable-tbody"},OD={__name:"Item",setup(n){const t=mi(),i=Ge(),r=B();Te(async()=>{if(i.params&&!i.params.id)return t.toList(),!1;t.item||await t.getItem(i.params.id)});const a=Ae(),s=u=>{a.value.toggle(u)};return(u,l)=>{const c=R("Button"),d=R("Menu"),p=R("Message"),v=R("Panel");return _(),O("div",yD,[o(t)&&o(t).item?(_(),$(v,{key:0,class:"is-small"},{header:T(()=>[f("div",_D,[f("div",bD,Q(o(t).item.name),1)])]),icons:T(()=>[f("div",wD,[x(c,{class:"p-button-sm",label:"#"+o(t).item.id,onClick:l[0]||(l[0]=h=>o(r).copy(o(t).item.id)),"data-testid":"permission-item_id"},null,8,["label"]),o(t).hasPermission("can-update-permissions")?(_(),$(c,{key:0,class:"p-button-sm",label:"Edit",icon:"pi pi-pencil","data-testid":"permission-item_edit",onClick:l[1]||(l[1]=h=>o(t).toEdit(o(t).item))})):A("",!0),o(t).hasPermission("can-update-permissions")||o(t).hasPermission("can-manage-permissions")?(_(),$(c,{key:1,class:"p-button-sm",icon:"pi pi-angle-down",type:"button","aria-haspopup":"true","data-testid":"permission-item_menu",onClick:s})):A("",!0),x(d,{ref_key:"item_menu_state",ref:a,model:o(t).item_menu_list,popup:!0},null,8,["model"]),x(c,{class:"p-button-sm",icon:"pi pi-times","data-testid":"permission-item_list",onClick:l[2]||(l[2]=h=>o(t).toList())})])]),default:T(()=>[o(t).item?(_(),O("div",CD,[o(t).item.deleted_at?(_(),$(p,{key:0,severity:"error",class:"p-container-message",closable:!1,icon:"pi pi-trash"},{default:T(()=>[f("div",SD,[f("div",kD," Deleted "+Q(o(t).item.deleted_at),1),f("div",xD,[x(c,{label:"Restore",class:"p-button-sm",onClick:l[3]||(l[3]=h=>o(t).itemAction("restore"))})])])]),_:1})):A("",!0),f("div",ID,[f("table",LD,[f("tbody",PD,[(_(!0),O(ne,null,xe(o(t).item,(h,m)=>(_(),O(ne,null,[m==="created_by"||m==="updated_by"?(_(),O(ne,{key:0},[],64)):m==="id"||m==="uuid"||m==="slug"?(_(),$(at,{key:1,label:m,value:h,can_copy:!0},null,8,["label","value"])):(m==="created_by_user"||m==="updated_by_user"||m==="deleted_by_user")&&typeof h=="object"&&h!==null?(_(),$(at,{key:2,label:m,value:h,type:"user"},null,8,["label","value"])):m==="count_users"||m==="count_roles"?(_(),$(at,{key:3,label:m,value:h,type:"tag"},null,8,["label","value"])):m==="is_active"?(_(),$(at,{key:4,label:m,value:h,type:"yes-no"},null,8,["label","value"])):(_(),$(at,{key:5,label:m,value:h},null,8,["label","value"]))],64))),256))])])])])):A("",!0)]),_:1})):A("",!0)])}}},ED={key:0},AD={__name:"RoleDetasilsView",setup(n){const t=mi();return(i,r)=>{const a=R("Divider");return _(),O("div",null,[o(t)&&o(t).active_permission_role?(_(),O("div",ED,[f("p",null,[ue("Created By : "),f("span",null,Q(o(t).active_permission_role.json.created_by),1)]),x(a,{class:"is-small"}),f("p",null,[ue("Updated By : "),f("span",null,Q(o(t).active_permission_role.json.updated_by),1)]),x(a,{class:"is-small"}),f("p",null,[ue("Created At : "),f("span",null,Q(o(t).active_permission_role.json.created_at),1)]),x(a,{class:"is-small"}),f("p",null,[ue("Updated At : "),f("span",null,Q(o(t).active_permission_role.json.updated_at),1)])])):A("",!0)])}}},TD={class:"col-5"},RD={class:"flex flex-row"},DD={class:"font-semibold text-sm"},MD={class:"p-inputgroup"},$D={class:"grid p-fluid mt-1 mb-2"},VD={class:"col-12"},BD={class:"p-inputgroup"},qD={class:"p-input-icon-left"},FD=f("i",{class:"pi pi-search"},null,-1),jD={__name:"ViewRole",setup(n){const t=mi(),i=je(),r=Ge(),a=B();Te(async()=>{if(r.params&&!r.params.id)return t.toList(),!1;r.params&&r.params.id&&await t.getItem(r.params.id),t.item&&!t.permission_roles&&await t.getItemRoles(),await i.getPermission(),await t.getRoleMenu()});const s=Ae(),u=d=>{s.value.toggle(d)},l=Rr(),c=()=>{l.open(AD,{props:{header:"Details",style:{width:"50vw"},breakpoints:{"960px":"75vw","640px":"90vw"},modal:!0}})};return(d,p)=>{const v=R("Button"),h=R("Menu"),m=R("InputText"),b=R("Column"),I=R("DataTable"),k=R("Paginator"),y=R("Panel"),g=R("DynamicDialog"),C=Ke("tooltip");return _(),O("div",TD,[o(t)&&o(t).item?(_(),$(y,{key:0,class:"is-small"},{header:T(()=>[f("div",RD,[f("div",DD,Q(o(t).item.name),1)])]),icons:T(()=>[f("div",MD,[x(v,{class:"p-button-sm",label:"#"+o(t).item.id,"data-testid":"permission-role_id",onClick:p[0]||(p[0]=w=>o(a).copy(o(t).item.id))},null,8,["label"]),o(t).hasPermission("can-update-permissions")||o(t).hasPermission("can-manage-permissions")?(_(),O(ne,{key:0},[x(v,{class:"p-button-sm",icon:"pi pi-angle-down",type:"button","aria-haspopup":"true","data-testid":"permission-role_menu",onClick:u}),x(h,{ref_key:"role_menu_items",ref:s,model:o(t).roles_menu_items,popup:!0},null,8,["model"])],64)):A("",!0),x(v,{class:"p-button-sm",icon:"pi pi-times","data-testid":"permission-role_list",onClick:p[1]||(p[1]=w=>o(t).toList())})])]),default:T(()=>[f("div",$D,[f("div",VD,[f("div",BD,[f("span",qD,[FD,x(m,{class:"w-full p-inputtext-sm",placeholder:"Search","data-testid":"permission-role_search",modelValue:o(t).permission_roles_query.q,"onUpdate:modelValue":p[2]||(p[2]=w=>o(t).permission_roles_query.q=w),onKeyup:[p[3]||(p[3]=Ie(w=>o(t).delayedItemUsersSearch(),["enter"])),p[4]||(p[4]=Ie(w=>o(t).delayedItemUsersSearch(),["enter","native"])),p[5]||(p[5]=Ie(w=>o(t).delayedItemUsersSearch(),["13"]))]},null,8,["modelValue"])]),x(v,{class:"p-button-sm",label:"Reset","data-testid":"permission-role_reset",onClick:p[6]||(p[6]=w=>o(t).resetPermissionRolesQuery())})])])]),o(t)&&o(t).permission_roles?(_(),$(I,{key:0,value:o(t).permission_roles.list.data,dataKey:"id",class:"p-datatable-sm",stripedRows:"",responsiveLayout:"scroll"},{default:T(()=>[x(b,{field:"role",header:"Role",class:"flex align-items-center"},{body:T(w=>[ue(Q(w.data.name)+" ",1),ce(x(v,{class:"p-button-tiny p-button-text","data-testid":"permissions-role_id",onClick:S=>o(a).copy(w.data.slug),icon:"pi pi-copy"},null,8,["onClick"]),[[C,"Copy Slug",void 0,{top:!0}]])]),_:1}),x(b,{field:"has-permission",header:"Has Permission"},Mt({_:2},[o(t).hasPermission("can-update-permissions")||o(t).hasPermission("can-manage-permissions")?{name:"body",fn:T(w=>[w.data.pivot.is_active===1?(_(),$(v,{key:0,label:"Yes",class:"p-button-sm p-button-success p-button-rounded","data-testid":"permission-role_status_yes",onClick:S=>o(t).changePermission(w.data)},null,8,["onClick"])):(_(),$(v,{key:1,label:"No",class:"p-button-sm p-button-danger p-button-rounded",onClick:S=>o(t).changePermission(w.data),"data-testid":"permission-role_status_no"},null,8,["onClick"]))]),key:"0"}:{name:"body",fn:T(w=>[w.data.pivot.is_active===1?(_(),$(v,{key:0,label:"Yes",class:"p-button-sm p-button-success p-button-rounded",disabled:""})):(_(),$(v,{key:1,label:"No",class:"p-button-sm p-button-danger p-button-rounded",disabled:""}))]),key:"1"}]),1024),x(b,null,{body:T(w=>[x(v,{class:"p-button-sm p-button-rounded",onClick:S=>(c(),o(t).active_permission_role=w.data),icon:"pi pi-eye","data-testid":"permission-role_view_details",label:"View"},null,8,["onClick"])]),_:1})]),_:1},8,["value"])):A("",!0),o(t)&&o(t).permission_roles?(_(),$(k,{key:1,first:o(t).rolesFirstElement,"onUpdate:first":p[7]||(p[7]=w=>o(t).rolesFirstElement=w),rows:o(t).permission_roles_query.rows,totalRecords:o(t).permission_roles.list.total,onPage:p[8]||(p[8]=w=>o(t).rolePaginate(w)),rowsPerPageOptions:o(t).rows_per_page,class:"bg-white-alpha-0 pt-2"},null,8,["first","rows","totalRecords","rowsPerPageOptions"])):A("",!0)]),_:1})):A("",!0),x(g)])}}};let xf=[],If=[];If={path:"/vaah/permissions/",component:yn,props:!0,children:[{path:"",name:"permissions.index",component:cD,props:!0,children:[{path:"form/:id?",name:"permissions.form",component:vD,props:!0},{path:"view/:id?",name:"permissions.view",component:OD,props:!0},{path:"role/:id?",name:"permissions.view-role",component:jD,props:!0}]}]};xf.push(If);let UD="WebReinvent\\VaahCms\\Models\\Setting",Lf=document.getElementsByTagName("base")[0].getAttribute("href"),gd=Lf+"/vaah/settings",zi={query:{page:null,rows:null,filter:{q:null,is_active:null,trashed:null,sort:null},recount:null},sidebar_menu_items:[],list:null,settings:{list:null,links:[],scripts:null,meta_tags:[]},role_permissions_query:{q:null,module:null,section:null,page:null,rows:null},role_users_query:{q:null,page:null,rows:null},action:{type:null,items:[]}};const ND=Ot({id:"settings",state:()=>({title:"Settings",base_url:Lf,ajax_url:gd,model:UD,assets_is_fetching:!0,app:null,assets:null,general_assets:null,rows_per_page:[10,20,30,50,100,500],list:null,item:{name:null,slug:null},fillable:null,empty_query:zi.query,empty_action:zi.action,query:B().clone(zi.query),action:B().clone(zi.action),search:{delay_time:600,delay_timer:0},route:null,watch_stopper:null,route_prefix:"settings.",view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],item_menu_list:[],item_menu_state:null,form_menu_list:[],total_permissions:null,total_users:null,permission_menu_items:null,role_permissions:null,role_user_menu_items:null,role_users:null,search_item:null,active_role_permission:null,active_role_user:null,module_section_list:null,role_permissions_query:B().clone(zi.role_permissions_query),role_users_query:B().clone(zi.role_users_query),is_btn_loading:!1}),getters:{},actions:{async onLoad(n){this.route=n,this.setViewAndWidth(n.name),this.updateQueryFromUrl(n)},setViewAndWidth(n){switch(n){case"roles.index":this.view="large",this.list_view_width=12;break;default:this.view="small",this.list_view_width=6;break}},async updateQueryFromUrl(n){if(n.query&&Object.keys(n.query).length>0){for(let t in n.query)this.query[t]=n.query[t];this.countFilters(n.query)}},watchRoutes(n){this.watch_stopper=We(n,(t,i)=>{if(this.watch_stopper&&!t.name.includes(this.route_prefix))return this.watch_stopper(),!1;this.route=t,t.params.id&&this.getItem(t.params.id),this.setViewAndWidth(t.name)},{deep:!0})},watchStates(){We(this.query.filter,(n,t)=>{this.delayedSearch()},{deep:!0}),We(this.role_permissions_query,(n,t)=>{this.delayedRolePermissionSearch()},{deep:!0}),We(this.role_users_query,(n,t)=>{this.delayedRoleUsersSearch()},{deep:!0})},async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,B().ajax(this.ajax_url+"/general/assets",this.afterGetAssets))},afterGetAssets(n,t){n&&(this.general_assets=n)},async getList(){let n={query:B().clone(this.query)};await B().ajax(this.ajax_url,this.afterGetList,n)},afterGetList:function(n,t){this.is_btn_loading=!1,this.query.recount=null,n&&(this.list=n,this.total_permissions=t.data.totalPermissions,this.total_users=t.data.totalUsers)},async getItem(n){n&&await B().ajax(gd+"/"+n,this.getItemAfter)},async getItemAfter(n,t){n?this.item=n:this.$router.push({name:"roles.index"}),this.getItemMenu(),await this.getFormMenu()},isListActionValid(){return this.action.type?this.action.items.length<1?(B().toastErrors(["Select records"]),!1):!0:(B().toastErrors(["Select an action type"]),!1)},async updateList(n=null){if(!n&&this.action.type?n=this.action.type:this.action.type=n,!this.isListActionValid())return!1;let t="PUT";switch(n){case"delete":t="DELETE";break}let i={params:this.action,method:t,show_success:!1};await B().ajax(this.ajax_url,this.updateListAfter,i)},async updateListAfter(n,t){n&&(this.action=B().clone(this.empty_action),await this.getList())},async listAction(n=null){!n&&this.action.type?n=this.action.type:this.action.type=n;let t=this.ajax_url+"/action/"+n,i="PUT";switch(n){case"delete":t=this.ajax_url,i="DELETE";break;case"delete-all":i="DELETE";break}let r={params:this.action,method:i,show_success:!1};await B().ajax(t,this.updateListAfter,r)},itemAction(n,t=null){t||(t=this.item),this.form.action=n;let i=this.ajax_url,r={method:"post"};switch(n){case"create-and-new":case"create-and-close":case"create-and-clone":r.method="POST",r.params=t;break;case"save":case"save-and-close":case"save-and-clone":r.method="PUT",r.params=t,i+="/"+t.id;break;case"delete":r.method="DELETE",i+="/"+t.id;break;default:r.method="PATCH",i+="/"+t.id+"/action/"+n;break}B().ajax(i,this.itemActionAfter,r)},async itemActionAfter(n,t){n&&(this.item=n,await this.getList(),await this.formActionAfter(),this.getItemMenu(),this.route.params&&this.route.params.id&&await this.getItem(this.route.params.id))},async formActionAfter(){switch(this.form.action){case"create-and-new":case"save-and-new":this.setActiveItemAsEmpty();break;case"create-and-close":case"save-and-close":this.setActiveItemAsEmpty(),this.$router.push({name:"roles.index"});break;case"save-and-clone":this.item.id=null;break;case"trash":this.item=null;break;case"delete":this.item=null,this.toList();break}},async toggleIsActive(n){n.is_active?await this.itemAction("activate",n):await this.itemAction("deactivate",n)},async paginate(n){this.query.page=n.page+1,await this.getList()},async reload(){await this.getAssets(),await this.getList()},async getFaker(){let n={model_namespace:this.model,except:this.assets.fillable.except},t=this.base_url+"/faker",i={params:n,method:"post"};B().ajax(t,this.getFakerAfter,i)},getFakerAfter:function(n,t){if(n){let i=this;Object.keys(n.fill).forEach(function(r){i.item[r]=n.fill[r]})}},async sync(){this.is_btn_loading=!0,this.query.recount=!0,await this.getList()},onItemSelection(n){this.action.items=n},setActiveItemAsEmpty(){this.item=B().clone(this.assets.empty_item)},confirmDelete(){if(this.action.items.length<1)return B().toastErrors(["Select a record"]),!1;this.action.type="delete",B().confirmDialogDelete(this.listAction)},confirmDeleteAll(){this.action.type="delete-all",B().confirmDialogDelete(this.listAction)},async delayedSearch(){let n=this;this.query.page=1,this.action.items=[],clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.updateUrlQueryString(n.query),await n.getList()},this.search.delay_time)},async updateUrlQueryString(n){n=B().clone(n);let t=ct.stringify(n,{skipNulls:!0}),i=ct.parse(t);i.filter&&(i.filter=B().cleanObject(i.filter)),await this.$router.replace({query:null}),await this.$router.replace({query:i}),this.countFilters(i)},countFilters:function(n){if(this.count_filters=0,n&&n.filter){let t=B().cleanObject(n.filter);this.count_filters=Object.keys(t).length}},async clearSearch(){this.query.filter.q=null,await this.updateUrlQueryString(this.query),await this.getList()},async resetQuery(){await this.resetQueryString(),await this.getList()},async resetQueryString(){for(let n in this.query.filter)this.query.filter[n]=null;await this.updateUrlQueryString(this.query)},async getItemPermissions(){this.showProgress();let n={query:this.role_permissions_query,method:"post"};B().ajax(this.ajax_url+"/item/"+this.item.id+"/permissions",this.afterGetItemPermissions,n)},afterGetItemPermissions(n,t){this.hideProgress(),n&&(this.role_permissions=n)},async delayedRolePermissionSearch(){let n=this;n.item&&n.item.id&&(clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.getItemPermissions()},this.search.delay_time))},async permissionPaginate(n){this.role_permissions_query.page=n.page+1,await this.getItemPermissions()},async getItemUsers(){this.showProgress();let n={query:this.role_users_query,method:"get"};B().ajax(this.ajax_url+"/item/"+this.item.id+"/users",this.afterGetItemUsers,n)},afterGetItemUsers(n,t){this.hideProgress(),n&&(this.role_users=n)},async userPaginate(n){this.role_users_query.page=n.page+1,await this.getItemUsers()},async delayedRoleUsersSearch(){let n=this;n.item&&n.item.id&&(clearTimeout(this.search.delay_timer),this.search.delay_timer=setTimeout(async function(){await n.getItemUsers()},this.search.delay_time))},changeRoleStatus(n){let t={inputs:[n]},i={};this.actions(!1,"change-role-permission-status",t,i)},afterChangeRoleStatus(n,t){this.hideProgress(),this.getItemPermissions(this.filter.page),this.$store.dispatch("root/reloadPermissions")},changeRolePermission(n){let t={id:this.item.id,permission_id:n.id},i={};n.pivot.is_active?i.is_active=0:i.is_active=1,this.actions(!1,"toggle-permission-active-status",t,i)},changeUserRole:function(n){let t={id:this.item.id,user_id:n.id},i={};n.pivot.is_active?i.is_active=0:i.is_active=1,this.actions(!1,"toggle-user-active-status",t,i)},bulkActions(n,t){let i={id:this.item.id,permission_id:null,user_id:null},r={is_active:n};this.actions(!1,t,i,r)},actions(n,t,i,r){this.showProgress(),n&&n.preventDefault();let a={params:{inputs:i,data:r},method:"post"};B().ajax(this.ajax_url+"/actions/"+t,this.afterActions,a)},async afterActions(n,t){await this.hideProgress(),await this.getItemPermissions(this.item.id),await this.getItemUsers(),await this.getList()},resetRolePermissionFilters(){this.role_permissions_query.q=null,this.role_permissions_query.module=null,this.role_permissions_query.section=null,this.role_permissions_query.rows=this.assets.rows},getModuleSection(){let n={params:{module:this.role_permissions_query.module},method:"post"};B().ajax(this.ajax_url+"/module/"+this.role_permissions_query.module+"/sections",this.afterAetModuleSection,n)},afterAetModuleSection(n,t){n&&(this.module_section_list=n)},resetRoleUserFilters(){this.role_users_query.q=null,this.role_users_query.rows=this.assets.rows},closeForm(){this.$router.push({name:"roles.index"})},toList(){this.item=null,this.$router.push({name:"roles.index"})},toForm(){this.item=B().clone(this.assets.empty_item),this.getFormMenu(),this.$router.push({name:"roles.form"})},toView(n){this.item=B().clone(n),this.$router.push({name:"roles.view",params:{id:n.id}})},toEdit(n){this.item=n,this.$router.push({name:"roles.form",params:{id:n.id}})},async toPermission(n){this.item=n,await this.getItemPermissions(),this.$router.push({name:"roles.permissions",params:{id:n.id}})},toUser(n){this.item=n,this.getItemUsers(),this.$router.push({name:"roles.users",params:{id:n.id}})},isViewLarge(){return this.view==="large"},getIdWidth(){let n=50;if(this.list&&this.list.total){let t=this.list.total.toString();t=t.length,n=t*40}return n+"px"},getActionWidth(){let n=100;return this.isViewLarge()||(n=80),n+"px"},getActionLabel(){let n=null;return this.isViewLarge()&&(n="Actions"),n},async getListSelectedMenu(){this.list_selected_menu=[{label:"Activate",command:async()=>{await this.updateList("activate")}},{label:"Deactivate",command:async()=>{await this.updateList("deactivate")}},{separator:!0},{label:"Trash",icon:"pi pi-times",command:async()=>{await this.updateList("trash")}},{label:"Restore",icon:"pi pi-replay",command:async()=>{await this.updateList("restore")}},{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDelete()}}]},getListBulkMenu(){this.list_bulk_menu=[{label:"Mark all as active",command:async()=>{await this.listAction("activate-all")}},{label:"Mark all as inactive",command:async()=>{await this.listAction("deactivate-all")}},{separator:!0},{label:"Trash All",icon:"pi pi-times",command:async()=>{await this.listAction("trash-all")}},{label:"Restore All",icon:"pi pi-replay",command:async()=>{await this.listAction("restore-all")}},{label:"Delete All",icon:"pi pi-trash",command:async()=>{this.confirmDeleteAll()}}]},getItemMenu(){let n=[];this.item&&this.item.deleted_at&&n.push({label:"Restore",icon:"pi pi-refresh",command:()=>{this.itemAction("restore")}}),this.item&&this.item.id&&!this.item.deleted_at&&n.push({label:"Trash",icon:"pi pi-times",command:()=>{this.itemAction("trash")}}),n.push({label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDeleteItem("delete")}}),this.item_menu_list=n},confirmDeleteItem(){this.form.type="delete",B().confirmDialogDelete(this.confirmDeleteItemAfter)},confirmDeleteItemAfter(){this.itemAction("delete",this.item)},async getFormMenu(){let n=[];this.item&&this.item.id?n=[{label:"Save & Close",icon:"pi pi-check",command:()=>{this.itemAction("save-and-close")}},{label:"Save & Clone",icon:"pi pi-copy",command:()=>{this.itemAction("save-and-clone")}},{label:"Trash",icon:"pi pi-times",command:()=>{this.itemAction("trash")}},{label:"Delete",icon:"pi pi-trash",command:()=>{this.confirmDeleteItem("delete")}}]:n=[{label:"Create & Close",icon:"pi pi-check",command:()=>{this.itemAction("create-and-close")}},{label:"Create & Clone",icon:"pi pi-copy",command:()=>{this.itemAction("create-and-clone")}},{label:"Reset",icon:"pi pi-refresh",command:()=>{this.setActiveItemAsEmpty()}}],n.push({label:"Fill",icon:"pi pi-pencil",command:()=>{this.getFaker()}}),this.form_menu_list=n},getMenuItems(){this.list_bulk_menu=[{label:"Active All Permissions",command:async()=>{await this.listAction("activate-all")}},{label:"Inactive All Permissions",command:async()=>{await this.listAction("deactivate-all")}}]},async getPermissionMenuItems(){this.permission_menu_items=[{label:"Active All Permissions",command:()=>{this.bulkActions(1,"toggle-permission-active-status")}},{label:"Inactive All Permissions",command:()=>{this.bulkActions(0,"toggle-permission-active-status")}}]},async getRoleUserMenuItems(){this.role_user_menu_items=[{label:"Attach To All Users",command:()=>{this.bulkActions(1,"toggle-user-active-status")}},{label:"Detach To All Users",command:()=>{this.bulkActions(0,"toggle-user-active-status")}}]},hasPermission(n){const t=je();return B().hasPermission(t.permissions,n)},showProgress(){this.show_progress_bar=!0},hideProgress(){this.show_progress_bar=!1},strToSlug(n){return B().strToSlug(n)},setPageTitle(){this.title&&(document.title=this.title)}}}),HD={class:"grid justify-content-center"},KD={class:"col-fixed"},zD={class:"col"},WD={__name:"SettingsLayout",setup(n){const t=ND(),i=Ge();B();const r=Ae([{label:"Settings",items:[{label:"General",icon:"pi pi-cog",to:{path:"/vaah/settings/general"}},{label:"User Settings",icon:"pi pi-user",to:{path:"/vaah/settings/user-settings"}},{label:"Env Variables",icon:"pi pi-cog",to:{path:"/vaah/settings/env-variables"}},{label:"Localizations",icon:"pi pi-code",to:{path:"/vaah/settings/localization"}},{label:"Notifications",icon:"pi pi-bell",to:{path:"/vaah/settings/notifications"}},{label:"Update",icon:"pi pi-download",to:{path:"/vaah/settings/update"}},{label:"Reset",icon:"pi pi-refresh",to:{path:"/setup"}}]}]);return Te(async()=>{t.getAssets()}),(a,s)=>{const u=R("Menu"),l=R("router-view");return _(),O("div",HD,[f("div",KD,[x(u,{model:r.value,pt:{menuitem:({props:c})=>({class:o(i).path===c.item.to.path?"p-focus":""})}},null,8,["model","pt"])]),f("div",zD,[x(l)])])}}};let GD="WebReinvent\\VaahCms\\Models\\Setting",Pf=document.getElementsByTagName("base")[0].getAttribute("href"),YD=Pf+"/vaah/settings/general",Vo={query:[],list:null,action:[]};const $i=Ot({id:"general",state:()=>({title:"General - Settings",base_url:Pf,ajax_url:YD,model:GD,assets_is_fetching:!0,app:null,assets:null,rows_per_page:[10,20,30,50,100,500],list:null,item:null,fillable:null,empty_query:Vo.query,empty_action:Vo.action,query:B().clone(Vo.query),action:B().clone(Vo.action),search:{delay_time:600,delay_timer:0},route:null,view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],item_menu_list:[],item_menu_state:null,form_menu_list:[],field:{name:null,type:null},field_type:null,custom_field_list:null,active_index:[],languages:null,visibitlity_options:[{name:"Enable",value:"1"},{name:"Disable",value:"0"}],maintenanceModeOptions:[{name:"Enable",value:"1"},{name:"Disable",value:"0"}],compressedLogoOptions:[{name:"True",value:"1"},{name:"False",value:"0"}],redirect_after_logout_options:[{name:"Backend",value:"backend"},{name:"Frontend",value:"frontend"},{name:"Custom",value:"custom"}],password_protection_options:[{name:"Enable",value:"1"},{name:"Disable",value:"0"}],copyright_text_options:[{name:"Use App Name",value:"app_name"},{name:"Custom",value:"custom"}],copyright_link_options:[{name:"Use App Url",value:"app_url"},{name:"Custom",value:"custom"}],copyright_year_options:[{name:"Use Current year",value:"use_current_year"},{name:"Custom",value:"custom"}],laravel_queues_options:[{name:"Enable",value:"1"},{name:"Disable",value:"0"}],sign_up_options:[{name:"Enable",value:"1"},{name:"Disable",value:"0"}],social_media_links:null,add_link:null,show_link_input:!0,date_format_options:["Y-m-d","y/m/d","y.m.d","custom"],time_format_options:["H:i:s","h:i A","h:i:s A","custom"],date_time_format_options:["Y-m-d H:i:s","Y-m-d h:i A","d-M-Y H:i","custom"],meta_tag:null,script_tag:{script_after_body_start:null,script_after_head_start:null,script_before_body_close:null,script_before_head_close:null},allowed_files:null,tag_type:null,filtered_registration_roles:null,filtered_allowed_files:null,is_smtp_configured:null}),getters:{},actions:{async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,await B().ajax(this.ajax_url+"/assets",this.afterGetAssets))},afterGetAssets(n,t){n&&(this.assets=n,this.languages=n.languages,this.allowed_files=n.file_types)},async getList(){let n={query:B().clone(this.query)};await B().ajax(this.ajax_url+"/list",this.afterGetList,n)},afterGetList(n,t){n&&(this.list=n.list,this.social_media_links=n.links,this.script_tag=n.scripts,this.meta_tag=n.meta_tags,this.list.maximum_number_of_forgot_password_attempts_per_session=parseInt(this.list.maximum_number_of_forgot_password_attempts_per_session),this.list.maximum_number_of_login_attempts_per_session=parseInt(this.list.maximum_number_of_login_attempts_per_session),this.is_smtp_configured=n.is_smtp_configured)},getCopy(n){let t="{!! config('settings.global."+n+"'); !!}";navigator.clipboard.writeText(t),B().toastSuccess(["Copied"])},removeVariable(n){n.id?this.social_media_links=B().removeInArrayByKey(this.social_media_links,n,"id"):this.social_media_links=B().removeInArrayByKey(this.social_media_links,n,"count"),B().toastErrors(["Removed"])},async storeSiteSettings(){let n={method:"post",params:{list:this.list}},t=this.ajax_url+"/store/site/settings";await B().ajax(t,this.storeSiteSettingsAfter,n)},storeSiteSettingsAfter(){this.getList(),this.clearCache()},async storeLinks(){let n={method:"post"};n.params={links:this.social_media_links};let t=this.ajax_url+"/store/links";await B().ajax(t,this.storeLinksAfter,n)},storeLinksAfter(){this.getList()},async storeScript(){let n={method:"post"};n.params={list:this.script_tag};let t=this.ajax_url+"/store/site/settings";await B().ajax(t,this.storeScriptAfter,n)},storeScriptAfter(){this.getList()},async storeSecuritySettings(){let n={method:"post"};n.params={list:this.list};let t=this.ajax_url+"/store/site/settings";await B().ajax(t,null,n)},expandAll(){let n=document.getElementById("accordionTabContainer").children.length;for(let t=0;t<=n;t++)this.active_index.push(t)},collapseAll(){this.active_index=[]},addLinkHandler(){if(this.show_link_input){if(this.show_link_input&&this.add_link!==""&&this.add_link!==null){let n=this.social_media_links.length,t={id:null,count:n,category:"global",label:this.add_link,excerpt:null,type:"link",key:"link_"+n,value:null,created_at:null,updated_at:null};return this.social_media_links.push(t),this.add_link=null,this.show_link_input=!0}}else return this.show_link_input=!0},addMetaTags(){let n=this.meta_tag.length,t={id:null,uid:n,category:"global",label:"Meta Tag",excerpt:null,type:"meta_tags",key:"meta_tags_"+n,value:{attribute:"name",attribute_value:"",content:""},created_at:null,updated_at:null};this.meta_tag.push(t)},async storeTags(){let n={method:"post",params:{tags:this.meta_tag}},t=this.ajax_url+"/store/meta/tags";await B().ajax(t,this.storeTagsAfter,n)},storeTagsAfter(n,t){this.getList()},async clearCache(){let n={method:"get"},t=this.base_url+"/clear/cache";await B().ajax(t,this.clearCacheAfter,n)},clearCacheAfter(n,t){window.location.reload(!0)},async removeMetaTags(n){if(n.id){this.meta_tag=B().removeInArrayByKey(this.meta_tag,n,"id");let t={method:"POST",params:n};await B().ajax(this.ajax_url+"/delete/meta/tag",null,t)}else this.meta_tag=B().removeInArrayByKey(this.meta_tag,n,"uid")},generateTags(){this.tag_type=="open-graph"&&this.generateOpenGraph(),this.tag_type=="google-webmaster"&&this.generateWebmaster()},generateOpenGraph(){let n=[{id:null,uid:"meta_tags_og_title",category:"global",label:"Open Graph Title",type:"meta_tags",key:"meta_tags_og_title",value:{attribute:"property",attribute_value:"og:title",content:""}},{id:null,uid:"meta_tags_og_site_name",category:"global",label:"Open Graph Site Name",type:"meta_tags",key:"meta_tags_og_site_name",value:{attribute:"property",attribute_value:"og:site_name",content:""}},{id:null,uid:"meta_tags_og_url",category:"global",label:"Open Graph Site Url",type:"meta_tags",key:"meta_tags_og_url",value:{attribute:"property",attribute_value:"og:url",content:""}},{id:null,uid:"meta_tags_og_description",category:"global",label:"Open Graph Description",type:"meta_tags",key:"meta_tags_og_description",value:{attribute:"property",attribute_value:"og:description",content:""}},{id:null,uid:"meta_tags_og_type",category:"global",label:"Open Graph Type",type:"meta_tags",key:"meta_tags_og_type",value:{attribute:"property",attribute_value:"og:type",content:""}},{id:null,uid:"meta_tags_og_image",category:"global",label:"Open Graph Image",type:"meta_tags",key:"meta_tags_og_image",value:{attribute:"property",attribute_value:"og:image",content:""}}];this.meta_tag=this.meta_tag.concat(n)},generateWebmaster(){let n=[{id:null,uid:"meta_tags_google_webmaster",category:"global",label:"Google Webmaster",type:"meta_tags",key:"meta_tags_google_webmaster",value:{attribute:"name",attribute_value:"google-site-verification",content:""}}];this.meta_tag=this.meta_tag.concat(n)},searchRegistrationRoles(n){n.query.trim().length?this.filtered_registration_roles=this.assets.roles.filter(t=>t.toLowerCase().startsWith(n.query.toLowerCase())):this.filtered_registration_roles=this.assets.roles},searchAllowedFiles(n){n.query.trim().length?this.filtered_allowed_files=this.assets.file_types.filter(t=>t.toLowerCase().includes(n.query.toLowerCase())&&!this.list.upload_allowed_files.includes(t)):this.filtered_allowed_files=this.assets.file_types},setPageTitle(){this.title&&(document.title=this.title)}}}),QD={key:0,class:"grid justify-content-evenly"},XD={class:"col-12 md:col-6 pr-4"},ZD={class:"grid p-fluid"},JD={class:"col-12"},eM=f("h5",{class:"p-1 text-xs mb-1"},"Site Title",-1),tM={class:"p-inputgroup"},nM={class:"col-6"},iM=f("h5",{class:"p-1 text-xs mb-1"},"Default Site Language",-1),sM={class:"col-6"},rM=f("h5",{class:"p-1 text-xs mb-1"},"Redirect after Frontend Login",-1),oM={class:"p-inputgroup"},aM={class:"col-12"},lM=f("h5",{class:"p-1 text-xs mb-1"},"Meta Description",-1),uM={class:"p-inputgroup"},cM={class:"col-12"},dM=f("h5",{class:"p-1 text-xs mb-1"},"Search Engine Visibility",-1),pM={class:"p-inputgroup"},hM={class:"col-12 p-fluid"},fM=f("h5",{class:"p-1 text-xs mb-1"},"Assign Role(s) on Registration",-1),mM={class:"col-12 p-fluid"},gM=f("h5",{class:"p-1 text-xs mb-1"},"Allowed file types for upload",-1),vM={class:"col-12 p-fluid"},yM=f("h5",{class:"p-1 text-xs mb-1"},"Allowed file size for upload( in MB)",-1),_M={class:"p-inputgroup col-6 p-0"},bM={class:"col-6 p-fluid"},wM=f("h5",{class:"p-1 text-xs mb-1"},"Is Logo compressed with Sidebar",-1),CM={class:"p-inputgroup"},SM={class:"col-12 md:col-6 pl-4"},kM={class:"grid"},xM={class:"col-12"},IM=f("h5",{class:"p-1 text-xs mb-1"},"Copyright Text",-1),LM={class:"p-inputgroup"},PM={class:"col-12"},OM=f("h5",{class:"p-1 text-xs mb-1"},"Copyright Link",-1),EM={class:"p-inputgroup"},AM={class:"col-12"},TM=f("h5",{class:"p-1 text-xs mb-1"},"Copyright Year",-1),RM={class:"p-inputgroup"},DM={class:"col-12"},MM=f("h5",{class:"p-1 text-xs mb-1"}," Max number of forgot password attempts ",-1),$M={class:"p-inputgroup"},VM={class:"col-12"},BM=f("h5",{class:"p-1 text-xs mb-1"},"Maximum number of login attempts",-1),qM={class:"p-inputgroup"},FM={class:"col-6 p-fluid"},jM=f("h5",{class:"p-1 text-xs mb-1"},"Password Protection",-1),UM={class:"p-inputgroup"},NM={class:"col-6 p-fluid"},HM=f("h5",{class:"p-1 text-xs mb-1"},"Laravel Queues",-1),KM={class:"p-inputgroup"},zM={class:"col-6 p-fluid"},WM=f("h5",{class:"p-1 text-xs mb-1"},"Maintenance Mode",-1),GM={class:"p-inputgroup"},YM={class:"col-6 p-fluid"},QM=f("h5",{class:"p-1 text-xs mb-1"},"Signup Page",-1),XM={class:"p-inputgroup"},ZM={class:"col-12"},JM=f("h5",{class:"p-1 text-xs mb-1"},"Redirect after Backend Logout",-1),e$={class:"p-inputgroup"},t$={class:"col-12"},n$=f("h5",{class:"p-1 text-xs mb-1"},"Backend Home Page Link",-1),i$={class:"p-inputgroup"},s$={class:"col-12"},r$={class:"col-12"},o$={__name:"SiteSettings",setup(n){const t=$i();return(i,r)=>{const a=R("InputText"),s=R("Button"),u=R("Dropdown"),l=R("Textarea"),c=R("SelectButton"),d=R("AutoComplete"),p=R("InputNumber"),v=R("Divider");return o(t).list?(_(),O("div",QD,[f("div",XD,[f("div",ZD,[f("div",JD,[eM,f("div",tM,[x(a,{modelValue:o(t).list.site_title,"onUpdate:modelValue":r[0]||(r[0]=h=>o(t).list.site_title=h),"data-testid":"general-site_title",class:"p-inputtext-sm",id:"site-title"},null,8,["modelValue"]),x(s,{icon:"pi pi-copy","data-testid":"general-site_title_copy",onClick:r[1]||(r[1]=h=>o(t).getCopy("site_title")),class:"p-button-sm"})])]),f("div",nM,[iM,x(u,{modelValue:o(t).list.language,"onUpdate:modelValue":r[2]||(r[2]=h=>o(t).list.language=h),options:o(t).languages,optionLabel:"name","data-testid":"general-site_language",optionValue:"locale_code_iso_639",placeholder:"Select a Language",inputClass:"p-inputtext-sm",class:"is-small"},null,8,["modelValue","options"])]),f("div",sM,[rM,f("div",oM,[x(a,{modelValue:o(t).list.redirect_after_frontend_login,"onUpdate:modelValue":r[3]||(r[3]=h=>o(t).list.redirect_after_frontend_login=h),"data-testid":"general-login_redirection",class:"p-inputtext-sm"},null,8,["modelValue"]),x(s,{icon:"pi pi-copy","data-testid":"general-login_redirection_copy",onClick:r[4]||(r[4]=h=>o(t).getCopy("redirect_after_frontend_login")),class:"p-button-sm"})])]),f("div",aM,[lM,f("div",uM,[x(l,{modelValue:o(t).list.site_description,"onUpdate:modelValue":r[5]||(r[5]=h=>o(t).list.site_description=h),autoResize:!0,class:"w-full"},null,8,["modelValue"]),x(s,{icon:"pi pi-copy","data-testid":"general-site_description_copy",onClick:r[6]||(r[6]=h=>o(t).getCopy("site_description"))})])]),f("div",cM,[dM,f("div",pM,[x(c,{modelValue:o(t).list.search_engine_visibility,"onUpdate:modelValue":r[7]||(r[7]=h=>o(t).list.search_engine_visibility=h),options:o(t).visibitlity_options,optionLabel:"name",optionValue:"value","data-testid":"general-visibility","aria-labelledby":"single",class:"p-button-sm"},null,8,["modelValue","options"]),x(s,{icon:"pi pi-copy","data-testid":"general-visibility_copy",onClick:r[8]||(r[8]=h=>o(t).getCopy("vh_search_engine_visibility")),class:"p-button-sm"})])]),f("div",hM,[fM,x(d,{multiple:!0,modelValue:o(t).list.registration_roles,"onUpdate:modelValue":r[9]||(r[9]=h=>o(t).list.registration_roles=h),suggestions:o(t).filtered_registration_roles,onComplete:r[10]||(r[10]=h=>o(t).searchRegistrationRoles(h)),"data-testid":"general-registration_roles",placeholder:"Search",class:"p-inputtext-sm"},null,8,["modelValue","suggestions"])]),f("div",mM,[gM,x(d,{multiple:!0,modelValue:o(t).list.upload_allowed_files,"onUpdate:modelValue":r[11]||(r[11]=h=>o(t).list.upload_allowed_files=h),suggestions:o(t).filtered_allowed_files,onComplete:r[12]||(r[12]=h=>o(t).searchAllowedFiles(h)),class:"p-inputtext-sm","data-testid":"general-allowed_files",placeholder:"Search"},null,8,["modelValue","suggestions"])]),f("div",vM,[yM,f("div",_M,[x(p,{modelValue:o(t).list.upload_allowed_file_size,"onUpdate:modelValue":r[13]||(r[13]=h=>o(t).list.upload_allowed_file_size=h),class:"p-inputtext-sm h-2rem",showButtons:"",mode:"decimal","data-testid":"general-allowed_file_size",min:"1"},null,8,["modelValue"])])]),f("div",bM,[wM,f("div",CM,[x(c,{modelValue:o(t).list.is_logo_compressed,"onUpdate:modelValue":r[14]||(r[14]=h=>o(t).list.is_logo_compressed=h),optionLabel:"name",optionValue:"value",options:o(t).compressedLogoOptions,"data-testid":"general-is_logo_compressed",class:"p-button-sm","aria-labelledby":"single"},null,8,["modelValue","options"]),x(s,{class:"p-button-sm",icon:"pi pi-copy","data-testid":"general-copyright_custom_year_filed_copy",onClick:r[15]||(r[15]=h=>o(t).getCopy("is_logo_compressed"))})])])])]),f("div",SM,[f("div",kM,[f("div",xM,[IM,f("div",LM,[x(c,{modelValue:o(t).list.copyright_text,"onUpdate:modelValue":r[16]||(r[16]=h=>o(t).list.copyright_text=h),optionLabel:"name",optionValue:"value",options:o(t).copyright_text_options,class:"p-button-sm","data-testid":"general-password_protection","aria-labelledby":"single"},null,8,["modelValue","options"]),x(s,{class:"p-button-sm",icon:"pi pi-copy","data-testid":"general-copyright_custom_filed_copy",onClick:r[17]||(r[17]=h=>o(t).getCopy("copyright_text"))})]),o(t).list.copyright_text==="custom"?(_(),$(a,{key:0,class:"w-full p-inputtext-sm mt-2","data-testid":"general-copyright_custom_filed",modelValue:o(t).list.copyright_text_custom,"onUpdate:modelValue":r[18]||(r[18]=h=>o(t).list.copyright_text_custom=h),placeholder:"Enter Custom Text"},null,8,["modelValue"])):A("",!0)]),f("div",PM,[OM,f("div",EM,[x(c,{modelValue:o(t).list.copyright_link,"onUpdate:modelValue":r[19]||(r[19]=h=>o(t).list.copyright_link=h),optionLabel:"name",optionValue:"value",options:o(t).copyright_link_options,class:"p-button-sm","data-testid":"general-password_protection","aria-labelledby":"single"},null,8,["modelValue","options"]),x(s,{class:"p-button-sm",icon:"pi pi-copy","data-testid":"general-copyright_custom_link_filed_copy",onClick:r[20]||(r[20]=h=>o(t).getCopy("copyright_link"))})]),o(t).list.copyright_link==="custom"?(_(),$(a,{key:0,class:"w-full p-inputtext-sm mt-2","data-testid":"general-copyright_custom_link_field",modelValue:o(t).list.copyright_link_custom,"onUpdate:modelValue":r[21]||(r[21]=h=>o(t).list.copyright_link_custom=h),placeholder:"Enter Custom Link"},null,8,["modelValue"])):A("",!0)]),f("div",AM,[TM,f("div",RM,[x(c,{modelValue:o(t).list.copyright_year,"onUpdate:modelValue":r[22]||(r[22]=h=>o(t).list.copyright_year=h),optionLabel:"name",optionValue:"value",options:o(t).copyright_year_options,class:"p-button-sm","data-testid":"general-password_protection","aria-labelledby":"single"},null,8,["modelValue","options"]),x(s,{class:"p-button-sm",icon:"pi pi-copy","data-testid":"general-copyright_custom_year_filed_copy",onClick:r[23]||(r[23]=h=>o(t).getCopy("copyright_year"))})]),x(p,{modelValue:o(t).list.copyright_year_custom,"onUpdate:modelValue":r[24]||(r[24]=h=>o(t).list.copyright_year_custom=h),name:"config-db_port",placeholder:"Copyright Year",class:"w-full p-inputtext-sm mt-2",inputId:"withoutgrouping",useGrouping:!1,pt:{input:{"data-testid":"general-copyright_year"}}},null,8,["modelValue"])]),f("div",DM,[MM,f("div",$M,[x(p,{inputId:"withoutgrouping",modelValue:o(t).list.maximum_number_of_forgot_password_attempts_per_session,"onUpdate:modelValue":r[25]||(r[25]=h=>o(t).list.maximum_number_of_forgot_password_attempts_per_session=h),"data-testid":"general-forgotpassword_attempts",useGrouping:!1,class:"p-inputtext-sm"},null,8,["modelValue"]),x(s,{icon:"pi pi-copy","data-testid":"general-forgotpassword_attempts_copy",onClick:r[26]||(r[26]=h=>o(t).getCopy("maximum_number_of_forgot_password_attempts_per_session")),class:"p-button-sm"})])]),f("div",VM,[BM,f("div",qM,[x(p,{inputId:"withoutgrouping","data-testid":"general-login_attempts",modelValue:o(t).list.maximum_number_of_login_attempts_per_session,"onUpdate:modelValue":r[27]||(r[27]=h=>o(t).list.maximum_number_of_login_attempts_per_session=h),useGrouping:!1,class:"p-inputtext-sm"},null,8,["modelValue"]),x(s,{icon:"pi pi-copy","data-testid":"general-login_attempts_copy",onClick:r[28]||(r[28]=h=>o(t).getCopy("maximum_number_of_login_attempts_per_session")),class:"p-button-sm"})])]),f("div",FM,[jM,f("div",UM,[x(c,{modelValue:o(t).list.password_protection,"onUpdate:modelValue":r[29]||(r[29]=h=>o(t).list.password_protection=h),optionLabel:"name",optionValue:"value",options:o(t).password_protection_options,class:"p-button-sm","data-testid":"general-password_protection","aria-labelledby":"single"},null,8,["modelValue","options"]),x(s,{class:"p-button-sm",icon:"pi pi-copy","data-testid":"general-copyright_custom_year_filed_copy",onClick:r[30]||(r[30]=h=>o(t).getCopy("password_protection"))})])]),f("div",NM,[HM,f("div",KM,[x(c,{modelValue:o(t).list.laravel_queues,"onUpdate:modelValue":r[31]||(r[31]=h=>o(t).list.laravel_queues=h),optionLabel:"name",optionValue:"value",options:o(t).laravel_queues_options,"data-testid":"general-laravel_queues",class:"p-button-sm","aria-labelledby":"single"},null,8,["modelValue","options"]),x(s,{class:"p-button-sm",icon:"pi pi-copy","data-testid":"general-copyright_custom_year_filed_copy",onClick:r[32]||(r[32]=h=>o(t).getCopy("laravel_queues"))})])]),f("div",zM,[WM,f("div",GM,[x(c,{modelValue:o(t).list.maintenance_mode,"onUpdate:modelValue":r[33]||(r[33]=h=>o(t).list.maintenance_mode=h),optionLabel:"name",optionValue:"value",options:o(t).maintenanceModeOptions,"data-testid":"general-maintenance_mode",class:"p-button-sm","aria-labelledby":"single"},null,8,["modelValue","options"]),x(s,{class:"p-button-sm",icon:"pi pi-copy","data-testid":"general-copyright_custom_year_filed_copy",onClick:r[34]||(r[34]=h=>o(t).getCopy("maintenance_mode"))})])]),f("div",YM,[QM,f("div",XM,[x(c,{modelValue:o(t).list.signup_page_visibility,"onUpdate:modelValue":r[35]||(r[35]=h=>o(t).list.signup_page_visibility=h),optionLabel:"name",optionValue:"value",options:o(t).sign_up_options,"data-testid":"general-signup",class:"p-button-sm","aria-labelledby":"single"},null,8,["modelValue","options"]),x(s,{class:"p-button-sm",icon:"pi pi-copy","data-testid":"general-copyright_custom_year_filed_copy",onClick:r[36]||(r[36]=h=>o(t).getCopy("signup_page_visibility"))})])]),f("div",ZM,[JM,f("div",e$,[x(c,{modelValue:o(t).list.redirect_after_backend_logout,"onUpdate:modelValue":r[37]||(r[37]=h=>o(t).list.redirect_after_backend_logout=h),optionLabel:"name",optionValue:"value",options:o(t).redirect_after_logout_options,"data-testid":"general-redirect_logout","aria-labelledby":"single",class:"p-button-sm"},null,8,["modelValue","options"]),x(a,{placeholder:"Enter Redirection Link",modelValue:o(t).list.redirect_after_backend_logout_url,"onUpdate:modelValue":r[38]||(r[38]=h=>o(t).list.redirect_after_backend_logout_url=h),"data-testid":"general-redirect_logout_custom",disabled:o(t).list.redirect_after_backend_logout!=="custom",class:"p-inputtext-sm"},null,8,["modelValue","disabled"]),x(s,{icon:"pi pi-copy","data-testid":"general-backend_logout_copy",onClick:r[39]||(r[39]=h=>o(t).getCopy("redirect_after_backend_logout")),class:"p-button-sm"})])]),f("div",t$,[n$,f("div",i$,[x(c,{modelValue:o(t).list.backend_homepage_link,"onUpdate:modelValue":r[40]||(r[40]=h=>o(t).list.backend_homepage_link=h),optionLabel:"name",optionValue:"value",options:o(t).redirect_after_logout_options,"data-testid":"general-backend_homepage_link","aria-labelledby":"single",class:"p-button-sm"},null,8,["modelValue","options"]),x(a,{placeholder:"Enter Redirection Link",modelValue:o(t).list.backend_homepage_link_url,"onUpdate:modelValue":r[41]||(r[41]=h=>o(t).list.backend_homepage_link_url=h),"data-testid":"general-backend_homepage_link_custom",disabled:o(t).list.backend_homepage_link!=="custom",class:"p-inputtext-sm"},null,8,["modelValue","disabled"]),x(s,{icon:"pi pi-copy","data-testid":"general-backend_homepage_link_copy",onClick:r[42]||(r[42]=h=>o(t).getCopy("backend_homepage_link")),class:"p-button-sm"})])])])]),f("div",s$,[x(v,{class:"m-0"})]),f("div",r$,[x(s,{label:"Save Settings",icon:"pi pi-save","data-testid":"general-save_site",onClick:o(t).storeSiteSettings,class:"mr-2 p-button-sm"},null,8,["onClick"]),x(s,{label:"Clear Cache",icon:"pi pi-trash","data-testid":"general-clear_cache",onClick:o(t).clearCache,class:"p-button-danger p-button-sm"},null,8,["onClick"])])])):A("",!0)}}},a$={key:0},l$={class:"grid"},u$={class:"col-12"},c$=f("h4",{class:"font-semibold text-sm"},"Multi-Factor Authentication",-1),d$=f("p",{class:"text-color-secondary text-xs font-semibold"},"Require a email OTP, sms OTP or authenticator app verification when you login with password.",-1),p$=f("div",{class:"flex"},[ue(" You haven't configured SMTP. Please configured SMTP to enable "),f("strong",null,"\xA0 Email OTP Verification \xA0"),ue(" method. ")],-1),h$={class:"col-12 pt-0"},f$={class:"field"},m$={class:"field-radiobutton"},g$=f("label",{for:"mfa-option-1"},"Disable",-1),v$={class:"field-radiobutton"},y$=f("label",{for:"mfa-option-2"},"Enable for all users",-1),_$={class:"field-radiobutton"},b$=f("label",{for:"mfa-option-3"},"Users will have option to enable it",-1),w$={class:"field"},C$=f("h5",{class:"font-semibold text-sm mb-2"},"MFA Methods",-1),S$={class:"field-checkbox"},k$=f("label",{for:"binary1"},"Email OTP Verification",-1),x$={class:"field-checkbox align-items-start"},I$=f("label",{for:"binary3"},[ue(" Authenticator App (only user can enable this) "),f("small",{class:"block text-red-500 mt-1"},"Authenticator App is temporarily unavailable.")],-1),L$={class:"field flex align-items-center"},P$=f("label",{for:"switch1",class:"m-0"},"We will prompt for additional verification when you log in from a new device or browser.",-1),O$={class:"col-12 pb-0"},E$={__name:"Securities",setup(n){const t=$i();return(i,r)=>{const a=R("Message"),s=R("RadioButton"),u=R("Checkbox"),l=R("InputSwitch"),c=R("Divider"),d=R("Button");return o(t)&&o(t).list?(_(),O("div",a$,[f("div",l$,[f("div",u$,[c$,d$,o(t).is_smtp_configured?A("",!0):(_(),$(a,{key:0,severity:"error",class:"p-container-message",closable:!1,icon:"pi pi-exclamation-triangle"},{default:T(()=>[p$]),_:1}))]),f("div",h$,[f("div",f$,[f("div",m$,[x(s,{inputId:"mfa-option-1",name:"mfa","data-testid":"general-securities_status_"+o(t).list.mfa_status,value:"disable",modelValue:o(t).list.mfa_status,"onUpdate:modelValue":r[0]||(r[0]=p=>o(t).list.mfa_status=p)},null,8,["data-testid","modelValue"]),g$]),f("div",v$,[x(s,{inputId:"mfa-option-2",name:"mfa","data-testid":"general-securities_status_"+o(t).list.mfa_status,value:"all-users",modelValue:o(t).list.mfa_status,"onUpdate:modelValue":r[1]||(r[1]=p=>o(t).list.mfa_status=p)},null,8,["data-testid","modelValue"]),y$]),f("div",_$,[x(s,{inputId:"mfa-option-3",name:"mfa","data-testid":"general-securities_status_"+o(t).list.mfa_status,value:"user-will-have-option",modelValue:o(t).list.mfa_status,"onUpdate:modelValue":r[2]||(r[2]=p=>o(t).list.mfa_status=p)},null,8,["data-testid","modelValue"]),b$])]),f("div",w$,[C$,f("div",S$,[x(u,{disabled:o(t).list.mfa_status==="disable"||!o(t).is_smtp_configured,"data-testid":"general-securities_status_"+o(t).list.mfa_methods,inputId:"binary1",class:"is-small",modelValue:o(t).list.mfa_methods,"onUpdate:modelValue":r[3]||(r[3]=p=>o(t).list.mfa_methods=p),value:"email-otp-verification"},null,8,["disabled","data-testid","modelValue"]),k$]),f("div",x$,[x(u,{disabled:"",inputId:"binary3","data-testid":"general-securities_status_"+o(t).list.mfa_methods,class:"is-small",modelValue:o(t).list.mfa_methods,"onUpdate:modelValue":r[4]||(r[4]=p=>o(t).list.mfa_methods=p),value:"authenticator-app"},null,8,["data-testid","modelValue"]),I$])]),f("div",L$,[x(l,{inputId:"switch1","data-testid":"general-securities_status_is_new_device",class:"p-inputswitch-sm mr-2",modelValue:o(t).list.is_new_device_verification_enabled,"onUpdate:modelValue":r[5]||(r[5]=p=>o(t).list.is_new_device_verification_enabled=p)},null,8,["modelValue"]),P$]),f("div",O$,[x(c,{class:"mt-0 mb-3"}),x(d,{label:"Save",icon:"pi pi-save","data-testid":"general-securities_save",onClick:r[6]||(r[6]=p=>o(t).storeSecuritySettings()),class:"p-button-sm"})])])])])):A("",!0)}}},A$={key:0,class:"grid"},T$={class:"col-4"},R$=f("h5",{class:"p-1 text-xs mb-1"},"Date Format",-1),D$={class:"p-inputgroup"},M$={class:"col-4"},$$=f("h5",{class:"p-1 text-xs mb-1"},"Time Format",-1),V$={class:"p-inputgroup"},B$={class:"col-4"},q$=f("h5",{class:"p-1 text-xs mb-1"},"Date Time Format",-1),F$={class:"p-inputgroup"},j$={class:"col-12"},U$={__name:"DateTime",setup(n){const t=$i();return(i,r)=>{const a=R("Dropdown"),s=R("InputText"),u=R("Button"),l=R("Divider");return o(t).list?(_(),O("div",A$,[f("div",T$,[R$,f("div",D$,[x(a,{modelValue:o(t).list.date_format,"onUpdate:modelValue":r[0]||(r[0]=c=>o(t).list.date_format=c),"data-testid":"general-date_format",options:o(t).date_format_options,inputClass:"p-inputtext-sm",class:"is-small"},null,8,["modelValue","options"]),o(t).list.date_format==="custom"?(_(),$(s,{key:0,placeholder:"Enter Custom date format",modelValue:o(t).list.date_format_custom,"onUpdate:modelValue":r[1]||(r[1]=c=>o(t).list.date_format_custom=c),"data-testid":"general-date_format_custom",class:"p-inputtext-sm"},null,8,["modelValue"])):A("",!0),x(u,{icon:"pi pi-copy","data-testid":"general-date_format_copy",onClick:r[2]||(r[2]=c=>o(t).getCopy("date_format")),class:"p-button-sm"})])]),f("div",M$,[$$,f("div",V$,[x(a,{modelValue:o(t).list.time_format,"onUpdate:modelValue":r[3]||(r[3]=c=>o(t).list.time_format=c),"data-testid":"general-time_format",options:o(t).time_format_options,inputClass:"p-inputtext-sm",class:"is-small"},null,8,["modelValue","options"]),o(t).list.time_format==="custom"?(_(),$(s,{key:0,placeholder:"Enter Custom time format",modelValue:o(t).list.time_format_custom,"onUpdate:modelValue":r[4]||(r[4]=c=>o(t).list.time_format_custom=c),"data-testid":"general-time_format_custom",class:"p-inputtext-sm"},null,8,["modelValue"])):A("",!0),x(u,{icon:"pi pi-copy","data-testid":"general-time_format_copy",onClick:r[5]||(r[5]=c=>o(t).getCopy("time_format")),class:"p-button-sm"})])]),f("div",B$,[q$,f("div",F$,[x(a,{modelValue:o(t).list.datetime_format,"onUpdate:modelValue":r[6]||(r[6]=c=>o(t).list.datetime_format=c),"data-testid":"general-datetime_format",options:o(t).date_time_format_options,inputClass:"p-inputtext-sm",class:"is-small"},null,8,["modelValue","options"]),o(t).list.datetime_format==="custom"?(_(),$(s,{key:0,placeholder:"Enter Custom date-time format",modelValue:o(t).list.datetime_format_custom,"onUpdate:modelValue":r[7]||(r[7]=c=>o(t).list.datetime_format_custom=c),"data-testid":"general-datetime_format_custom",class:"p-inputtext-sm"},null,8,["modelValue"])):A("",!0),x(u,{icon:"pi pi-copy","data-testid":"general-datetime_format_copy",onClick:r[8]||(r[8]=c=>o(t).getCopy("datetime_format")),class:"p-button-sm"})])]),f("div",j$,[x(l,{class:"mt-0 mb-3"}),x(u,{label:"Save",onClick:r[9]||(r[9]=c=>o(t).storeSiteSettings()),"data-testid":"general-date_format_save",icon:"pi pi-save",class:"p-button-sm"})])])):A("",!0)}}},N$={key:0},H$={class:"grid"},K$={class:"col-12 md:col-4"},z$={class:"p-1 text-xs mb-1"},W$={class:"p-inputgroup p-fluid"},G$={class:"p-input-icon-left"},Y$={class:"grid"},Q$={class:"col-12 md:col-4"},X$=f("h5",{class:"p-1 text-xs mb-1"},"Add Link",-1),Z$={class:"p-inputgroup"},J$={class:"col-12"},eV={class:"p-inputgroup justify-content-end"},tV={__name:"SocialMediaLink",setup(n){const t=$i(),i=B();return(r,a)=>{const s=R("InputText"),u=R("Button"),l=R("Divider");return o(t)?(_(),O("div",N$,[f("div",H$,[(_(!0),O(ne,null,xe(o(t).social_media_links,(c,d)=>(_(),O("div",K$,[f("h5",z$,Q(o(i).toLabel(c.label)),1),f("div",W$,[f("span",G$,[f("i",{class:he(c.icon?"pi z-5 "+c.icon:"pi z-5 pi-link")},null,2),x(s,{type:"text","data-testid":"general-"+c.label+"field",modelValue:c.value,"onUpdate:modelValue":p=>c.value=p,placeholder:"Enter "+c.label+" Link",class:"w-full p-inputtext-sm"},null,8,["data-testid","modelValue","onUpdate:modelValue","placeholder"])]),x(u,{icon:"pi pi-copy","data-testid":"general-link_copy",disabled:!c.id,onClick:p=>o(t).getCopy(c.key),class:"p-button-sm"},null,8,["disabled","onClick"]),x(u,{icon:"pi pi-trash","data-testid":"general-link_remove",onClick:p=>o(t).removeVariable(c),class:"p-button-danger p-button-sm"},null,8,["onClick"])])]))),256))]),f("div",Y$,[f("div",Q$,[X$,f("div",Z$,[o(t).show_link_input?(_(),$(s,{key:0,modelValue:o(t).add_link,"onUpdate:modelValue":a[0]||(a[0]=c=>o(t).add_link=c),"data-testid":"general-add_link_field",icon:"pi pi-link",class:"p-inputtext-sm"},null,8,["modelValue"])):A("",!0),x(u,{label:"Add Link",icon:"pi pi-plus",class:"p-button-sm","data-testid":"general-add_link_btn",disabled:!o(t).add_link,onClick:o(t).addLinkHandler},null,8,["disabled","onClick"])])]),f("div",J$,[x(l,{class:"mt-0 mb-3"}),f("div",eV,[x(u,{label:"Save",icon:"pi pi-save","data-testid":"general-link_save",onClick:a[1]||(a[1]=c=>o(t).storeLinks()),class:"p-button-sm"})])])])])):A("",!0)}}},nV={key:0},iV={class:"grid"},sV={class:"col-12 md:col-6 pr-3"},rV=f("h5",{class:"p-1 text-xs mb-1"},"After head tag start ()",-1),oV={class:"p-inputgroup"},aV={class:"col-12 md:col-6 pl-3"},lV=f("h5",{class:"p-1 text-xs mb-1"},"Before head tag close ()",-1),uV={class:"p-inputgroup"},cV={class:"col-12 md:col-6 pr-3"},dV=f("h5",{class:"p-1 text-xs mb-1"},"After body tag start ()",-1),pV={class:"p-inputgroup"},hV={class:"col-12 md:col-6 pl-3"},fV=f("h5",{class:"p-1 text-xs mb-1"},"Before body tag close ()",-1),mV={class:"p-inputgroup"},gV={class:"grid"},vV={class:"col-12"},yV={class:"p-inputgroup justify-content-end"},_V={__name:"Scripts",setup(n){const t=$i();return(i,r)=>{const a=R("Textarea"),s=R("Button"),u=R("Divider");return o(t)?(_(),O("div",nV,[f("div",iV,[f("div",sV,[rV,f("div",oV,[x(a,{modelValue:o(t).script_tag.script_after_head_start,"onUpdate:modelValue":r[0]||(r[0]=l=>o(t).script_tag.script_after_head_start=l),autoResize:!0,"data-testid":"general-script_head_start",class:"w-full"},null,8,["modelValue"]),x(s,{icon:"pi pi-copy","data-testid":"general-script_head_start_copy",onClick:r[1]||(r[1]=l=>o(t).getCopy("script_after_head_start"))})])]),f("div",aV,[lV,f("div",uV,[x(a,{modelValue:o(t).script_tag.script_before_head_close,"onUpdate:modelValue":r[2]||(r[2]=l=>o(t).script_tag.script_before_head_close=l),autoResize:!0,"data-testid":"general-script_head_close",class:"w-full"},null,8,["modelValue"]),x(s,{icon:"pi pi-copy","data-testid":"general-script_head_close_copy",onClick:r[3]||(r[3]=l=>o(t).getCopy("script_before_head_close"))})])]),f("div",cV,[dV,f("div",pV,[x(a,{modelValue:o(t).script_tag.script_after_body_start,"onUpdate:modelValue":r[4]||(r[4]=l=>o(t).script_tag.script_after_body_start=l),autoResize:!0,"data-testid":"general-script_body_start",class:"w-full"},null,8,["modelValue"]),x(s,{icon:"pi pi-copy","data-testid":"general-script_body_start_copy",onClick:r[5]||(r[5]=l=>o(t).getCopy("script_after_body_start"))})])]),f("div",hV,[fV,f("div",mV,[x(a,{modelValue:o(t).script_tag.script_before_body_close,"onUpdate:modelValue":r[6]||(r[6]=l=>o(t).script_tag.script_before_body_close=l),autoResize:!0,"data-testid":"general-script_body_close",class:"w-full"},null,8,["modelValue"]),x(s,{icon:"pi pi-copy","data-testid":"general-script_body_close_copy",onClick:r[7]||(r[7]=l=>o(t).getCopy("script_before_body_close"))})])])]),f("div",gV,[f("div",vV,[x(u,{class:"my-3"}),f("div",yV,[x(s,{label:"Save",icon:"pi pi-save","data-testid":"general-script_save",onClick:r[8]||(r[8]=l=>o(t).storeScript()),class:"p-button-sm"})])])])])):A("",!0)}}},bV={key:0},wV={class:"grid"},CV={class:"col-12"},SV={class:"p-1 text-xs mb-1"},kV={class:"p-inputgroup"},xV={class:"col-12 md:col-8"},IV={class:"p-inputgroup"},LV={class:"col-12 md:col-4"},PV={class:"p-inputgroup"},OV={__name:"MetaTags",setup(n){const t=$i();return(i,r)=>{const a=R("Dropdown"),s=R("InputText"),u=R("Button");return o(t)?(_(),O("div",bV,[f("div",wV,[o(t).meta_tag?(_(!0),O(ne,{key:0},xe(o(t).meta_tag,(l,c)=>(_(),O("div",CV,[f("h5",SV,Q(l.label),1),f("div",kV,[x(a,{modelValue:l.value.attribute,"onUpdate:modelValue":d=>l.value.attribute=d,options:o(t).assets.vh_meta_attributes,optionLabel:"name",optionValue:"slug","data-testid":"general-metatags_attributes",placeholder:"Select any",inputClass:"p-inputtext-sm",class:"is-small"},null,8,["modelValue","onUpdate:modelValue","options"]),x(s,{modelValue:l.value.attribute_value,"onUpdate:modelValue":d=>l.value.attribute_value=d,"data-testid":"general-metatags_attributes_value",class:"p-inputtext-sm"},null,8,["modelValue","onUpdate:modelValue"]),x(u,{label:"Content",disabled:""}),x(s,{modelValue:l.value.content,"onUpdate:modelValue":d=>l.value.content=d,"data-testid":"general-metatags_attributes_content",class:"p-inputtext-sm"},null,8,["modelValue","onUpdate:modelValue"]),x(u,{icon:"pi pi-trash","data-testid":"general-remove_tag",onClick:d=>o(t).removeMetaTags(l),class:"p-button-sm"},null,8,["onClick"])])]))),256)):A("",!0),f("div",xV,[f("div",IV,[x(u,{icon:"pi pi-plus","data-testid":"general-add_newtag",onClick:o(t).addMetaTags,label:"Add Meta Tag",class:"p-button-sm"},null,8,["onClick"]),x(u,{label:"Save",onClick:o(t).storeTags,"data-testid":"general-meta_tag-save",class:"p-button-sm"},null,8,["onClick"]),x(u,{icon:"pi pi-copy","data-testid":"general-meta_tag_copy",onClick:r[0]||(r[0]=l=>o(t).getCopy("meta_tags")),class:"p-button-sm"})])]),f("div",LV,[f("div",PV,[x(a,{modelValue:o(t).tag_type,"onUpdate:modelValue":r[1]||(r[1]=l=>o(t).tag_type=l),options:[{name:"Google Webmaster",value:"google-webmaster"},{name:"Open Graph (Facebook)",value:"open-graph"}],"data-testid":"general-gegnerate_tag",optionLabel:"name",optionValue:"value",placeholder:"Select a type",inputClass:"p-inputtext-sm",class:"is-small"},null,8,["modelValue","options"]),x(u,{label:"Generate",onClick:o(t).generateTags,class:"p-button-sm"},null,8,["onClick"])])])])])):A("",!0)}}},EV=f("div",{class:"flex flex-row"},[f("div",null,[f("b",{class:"mr-1"},"General Settings")])],-1),AV={class:"buttons"},TV=f("div",{class:"w-full"},[f("div",null,[f("h5",{class:"font-semibold text-sm"},"Site Settings"),f("p",{class:"text-color-secondary text-xs"},"After a successful password update, you will be redirected to the login page where you can log in with your new password.")])],-1),RV=f("div",{class:"w-full"},[f("h5",{class:"font-semibold text-sm"},"Securities"),f("p",{class:"text-color-secondary text-xs"},"Enable and choose multiple methods of authentication")],-1),DV=f("div",{class:"w-full"},[f("h5",{class:"font-semibold text-sm"},"Date & Time"),f("p",{class:"text-color-secondary text-xs"},"Global date and time settings.")],-1),MV=f("div",{class:"w-full"},[f("h5",{class:"font-semibold text-sm"},"Social Media & Links"),f("p",{class:"text-color-secondary text-xs"},"Static links management.")],-1),$V=f("div",{class:"w-full"},[f("h5",{class:"font-semibold text-sm"},"Scripts"),f("p",{class:"text-color-secondary text-xs"},"Add scripts of Google Analytics and other tracking scripts.")],-1),VV=f("div",{class:"w-full"},[f("h5",{class:"font-semibold text-sm"},"Meta Tags"),f("p",{class:"text-color-secondary text-xs"},"Global meta tags.")],-1),BV={__name:"Index",setup(n){const t=$i();return Ge(),_t(),Te(async()=>{await t.setPageTitle(),await t.getAssets(),await t.getList()}),(i,r)=>{const a=R("Button"),s=R("AccordionTab"),u=R("Accordion"),l=R("Panel");return _(),O("div",null,[x(l,{class:"is-small"},{header:T(()=>[EV]),icons:T(()=>[f("div",AV,[x(a,{label:"Expand all",icon:"pi pi-angle-double-down",class:"p-button-sm mr-2",onClick:o(t).expandAll},null,8,["onClick"]),x(a,{label:"Collapse all",icon:"pi pi-angle-double-up",class:"p-button-sm",onClick:o(t).collapseAll},null,8,["onClick"])])]),default:T(()=>[x(u,{multiple:!0,activeIndex:o(t).active_index,id:"accordionTabContainer",class:"my-2"},{default:T(()=>[x(s,null,{header:T(()=>[TV]),default:T(()=>[x(o$)]),_:1}),x(s,null,{header:T(()=>[RV]),default:T(()=>[x(E$)]),_:1}),x(s,null,{header:T(()=>[DV]),default:T(()=>[x(U$)]),_:1}),x(s,null,{header:T(()=>[MV]),default:T(()=>[x(tV)]),_:1}),x(s,null,{header:T(()=>[$V]),default:T(()=>[x(_V)]),_:1}),x(s,null,{header:T(()=>[VV]),default:T(()=>[x(OV)]),_:1})]),_:1},8,["activeIndex"])]),_:1})])}}};let qV="WebReinvent\\VaahCms\\Models\\Setting",Of=document.getElementsByTagName("base")[0].getAttribute("href"),FV=Of+"/vaah/settings/env",Bo={query:[],list:null,action:[]};const jV=Ot({id:"env",state:()=>({title:"Env Variables - Settings",base_url:Of,ajax_url:FV,model:qV,assets_is_fetching:!0,app:null,assets:null,rows_per_page:[10,20,30,50,100,500],list:null,item:null,fillable:null,empty_query:Bo.query,empty_action:Bo.action,query:B().clone(Bo.query),action:B().clone(Bo.action),search:{delay_time:600,delay_timer:0},route:null,view:"large",show_filters:!1,list_view_width:12,form:{type:"Create",action:null,is_button_loading:null},is_list_loading:null,count_filters:0,list_selected_menu:[],list_bulk_menu:[],item_menu_list:[],item_menu_state:null,form_menu_list:[],env_file:null,new_variable:null,is_btn_loading:!1}),getters:{},actions:{watchItem(){We(()=>this.new_variable,(n,t)=>{n&&n!==""&&(this.new_variable=this.new_variable.toUpperCase(),this.new_variable=this.new_variable.split(" ").join("_"))},{deep:!0})},async getAssets(){this.assets_is_fetching===!0&&(this.assets_is_fetching=!1,B().ajax(this.ajax_url+"/assets",this.afterGetAssets))},afterGetAssets(n,t){n&&(this.assets=n)},async getList(){let n={query:B().clone(this.query)};await B().ajax(this.ajax_url+"/list",this.getListAfter,n)},getListAfter:function(n,t){this.is_btn_loading=!1,this.query.recount=null,n&&(this.list=n.list,this.env_file=n.env_file)},isSecrete(n){return!!(n.key=="APP_KEY"||n.key.includes("SECRET")||n.key.includes("API_KEY")||n.key.includes("API")||n.key.includes("AUTH_KEY")||n.key.includes("PRIVATE_KEY")||n.key.includes("MERCHANT_KEY")||n.key.includes("SALT")||n.key.includes("AUTH_TOKEN")||n.key.includes("API_TOKEN"))},inputType(n){return n.key.includes("PASSWORD")||this.isSecrete(n)?"password":"text"},isDisable(n){if(n.key=="APP_KEY"||n.key=="APP_ENV"||n.key=="APP_URL")return!0},showRevealButton(n){return!!(n.key.includes("PASSWORD")||this.isSecrete(n))},getCopy(n){let t='env("'+n.key+'")';navigator.clipboard.writeText(t),B().toastSuccess(["Copied"])},removeVariable(n){n.uid?this.list=B().removeInArrayByKey(this.list,n,"uid"):this.list=B().removeInArrayByKey(this.list,n,"key"),B().toastErrors(["Removed"])},addVariable(){let t={uid:this.list.length,key:this.new_variable,value:null};this.list.push(t),this.new_variable=null},confirmChanges(){B().confirm.require({message:"Invalid value(s) can break the application, are you sure to proceed?. You will be logout and redirected to login page.",header:"Updating environment variables",acceptClass:"yellow",rejectLabel:"Cancel",icon:"pi pi-exclamation-triangle",accept:()=>{this.store()}})},store(){let n=this.validate(),t={method:"post"};if(!n)return!1;t.params=this.list;let i=this.ajax_url+"/store";B().ajax(i,this.storeAfter,t)},storeAfter(n,t){n&&(window.location.href=n.redirect_url)},validate(){let n=this.generateKeyPair(),t=!1,i=[];return n.APP_KEY||(i.push("APP_KEY is required"),t=!0),n.APP_ENV||(i.push("APP_ENV is required"),t=!0),n.APP_URL||(i.push("APP_URL is required"),t=!0),t?(this.$vaah.toastErrors(i),!1):!0},generateKeyPair(){let n=[];return this.list.forEach(function(t){n[t.key]=t.value}),n},downloadFile(n){window.location.href=this.ajax_url+"/download-file/"+n},async sync(){this.is_btn_loading=!0,await this.getList()},setPageTitle(){this.title&&(document.title=this.title)}}}),UV=f("div",{class:"flex flex-row"},[f("div",null,[f("b",{class:"mr-1"},"Environment Variables")])],-1),NV={class:"buttons"},HV={class:"grid justify-content-start"},KV={class:"col-12 md:col-6"},zV={class:"p-1 text-xs mb-1"},WV={class:"p-inputgroup"},GV={class:"grid justify-content-start mt-1"},YV={class:"col-12 md:col-6"},QV={class:"p-inputgroup"},XV={class:"col-12"},ZV={class:"p-inputgroup justify-content-end"},JV={__name:"Index",setup(n){const t=jV();return Ge(),_t(),Te(async()=>{await t.setPageTitle(),await t.getAssets(),await t.getList(),await t.watchItem()}),(i,r)=>{const a=R("Button"),s=R("password"),u=R("Textarea"),l=R("InputText"),c=R("Divider"),d=R("Panel");return _(),$(d,{class:"is-small"},{header:T(()=>[UV]),icons:T(()=>[f("div",NV,[x(a,{label:"Download",icon:"pi pi-download",class:"p-button-sm mr-2","data-testid":"env-download_file",onClick:r[0]||(r[0]=p=>o(t).downloadFile(o(t).env_file))}),x(a,{icon:"pi pi-refresh",label:"Refresh",class:"p-button-sm","data-testid":"env_refresh",onClick:o(t).sync,loading:o(t).is_btn_loading},null,8,["onClick","loading"])])]),default:T(()=>[f("div",HV,[(_(!0),O(ne,null,xe(o(t).list,(p,v)=>(_(),O("div",KV,[f("h5",zV,Q(p.key),1),f("form",null,[f("div",WV,[o(t).inputType(p)=="password"?(_(),$(s,{key:0,modelValue:p.value,"onUpdate:modelValue":h=>p.value=h,class:"w-full",disabled:o(t).isDisable(p),toggleMask:"","auto-resize":!0,"data-testid":"env-"+p.key},null,8,["modelValue","onUpdate:modelValue","disabled","data-testid"])):(_(),$(u,{key:1,modelValue:p.value,"onUpdate:modelValue":h=>p.value=h,rows:"1",class:"is-small",disabled:o(t).isDisable(p),"auto-resize":!0,"data-testid":"env-"+p.key},null,8,["modelValue","onUpdate:modelValue","disabled","data-testid"])),x(a,{icon:"pi pi-copy","data-testid":"env-copy_"+p.key,onClick:h=>o(t).getCopy(p)},null,8,["data-testid","onClick"]),x(a,{icon:"pi pi-trash",class:"p-button-danger p-button-sm","data-testid":"env-remove_"+p.key,onClick:h=>o(t).removeVariable(p)},null,8,["data-testid","onClick"])])])]))),256))]),f("div",GV,[f("div",YV,[f("div",QV,[x(l,{autoResize:!0,modelValue:o(t).new_variable,"onUpdate:modelValue":r[1]||(r[1]=p=>o(t).new_variable=p),class:"p-inputtext-sm","data-testid":"env-add_variable_field"},null,8,["modelValue"]),x(a,{label:"Add Env Variable","data-testid":"env-add_variable",icon:"pi pi-plus",onClick:o(t).addVariable,disabled:!o(t).new_variable,class:"p-button-sm"},null,8,["onClick","disabled"])])]),f("div",XV,[x(c,{class:"mb-3 mt-0"}),f("div",ZV,[x(a,{label:"Save",icon:"pi pi-save",onClick:o(t).confirmChanges,"data-testid":"env-save_variable",class:"p-button-sm"},null,8,["onClick"])])])])]),_:1})}}};var Ef={exports:{}};const eB=_p(Yv);/**! * Sortable 1.14.0 * @author RubaXa* @author owenm diff --git a/Resources/assets/backend/vaahtwo/scss/style/style.scss b/Resources/assets/backend/vaahtwo/scss/style/style.scss index 7aefe489b..b594233d5 100644 --- a/Resources/assets/backend/vaahtwo/scss/style/style.scss +++ b/Resources/assets/backend/vaahtwo/scss/style/style.scss @@ -1712,3 +1712,8 @@ textarea.p-inputtextarea { background: #22C55E; } } + + +.overflow-wrap-anywhere{ + overflow-wrap: anywhere; +} diff --git a/Routes/backend/settings.php b/Routes/backend/settings.php index 31c972ef2..d0d691fda 100644 --- a/Routes/backend/settings.php +++ b/Routes/backend/settings.php @@ -122,6 +122,9 @@ function () { //--------------------------------------------------------- Route::post('/actions/{action_name}', 'LocalizationController@postActions'); //--------------------------------------------------------- + Route::post('/run-seeds', 'LocalizationController@runSeeds') + ->name('backend.vaah.localization.run_seeds'); + //--------------------------------------------------------- }); diff --git a/Routes/backend/setup.php b/Routes/backend/setup.php index eff03f60b..62ae23fb9 100644 --- a/Routes/backend/setup.php +++ b/Routes/backend/setup.php @@ -112,6 +112,12 @@ function () { Route::any( '/publish/assets', 'SetupController@publishAssets' ) ->name( 'vh.setup.publish.assets' ); //------------------------------------------------ + Route::post( '/run/artisan-seeds', 'SetupController@runArtisanSeeds' ) + ->name( 'vh.setup.run.artisan_seeds' ); + //------------------------------------------------ + Route::post( '/run/artisan-migrate', 'SetupController@runArtisanMigrate' ) + ->name( 'vh.setup.run.artisan_migrate' ); + //------------------------------------------------ //------------------------------------------------ }); diff --git a/Vue/vaahtwo/pages/dashboard/Dashboard.vue b/Vue/vaahtwo/pages/dashboard/Dashboard.vue index f6b87d5c1..ea7785126 100644 --- a/Vue/vaahtwo/pages/dashboard/Dashboard.vue +++ b/Vue/vaahtwo/pages/dashboard/Dashboard.vue @@ -19,15 +19,15 @@ const key = ref(); - +-+ - Welcome to VaahCms
-We've assembled some links to get you started:
+ +{{store.language_strings.message}}
@@ -247,5 +248,3 @@ ul { list-style-type: none; } - - diff --git a/Vue/vaahtwo/pages/permissions/ViewRole.vue b/Vue/vaahtwo/pages/permissions/ViewRole.vue index 5d2be3623..6b9477f0f 100644 --- a/Vue/vaahtwo/pages/permissions/ViewRole.vue +++ b/Vue/vaahtwo/pages/permissions/ViewRole.vue @@ -85,7 +85,6 @@ const openViewModal = () => {-Get Started
+{{store.language_strings.get_started}}
- or, - create your own theme + {{store.language_strings.or}}, + + {{store.language_strings.create_your_own_theme}}
-@@ -210,7 +211,7 @@ const key = ref(); class="text-sm" :data-testid="'dashboard-'+log.name+'_view'" > - View + {{item.view_log}}Next Steps
+{{store.language_strings.next_steps}}
-@@ -159,12 +160,12 @@ const key = ref(); :closable="false" icon="null" > - Enable Laravel Queues to run your jobs + - View Setting + {{ item.view_settings }}More Actions
+{{store.language_strings.more_actions}}
- View Details + {{ module.card.link_text }}
-@@ -65,8 +76,8 @@ const toggleFormMenu = (event) => {{{ store.item.name }}diff --git a/Vue/vaahtwo/pages/settings/localization/Index.vue b/Vue/vaahtwo/pages/settings/localization/Index.vue index 213cc7f54..61b1e7248 100644 --- a/Vue/vaahtwo/pages/settings/localization/Index.vue +++ b/Vue/vaahtwo/pages/settings/localization/Index.vue @@ -17,10 +17,17 @@ onMounted(async () => { */ await store.setPageTitle(); await store.getAssets(); + store.getItemMenuList() /** * Change to upper case */ }); + +const item_menu_list = ref(); +const toggleItemMenuList = (event) => { + item_menu_list.value.toggle(event); +}; + @@ -49,6 +56,19 @@ onMounted(async () => { class="p-button-sm mr-2" /> + + + +-+{ /> - + - { /> + - { /> + - diff --git a/Vue/vaahtwo/pages/users/Item.vue b/Vue/vaahtwo/pages/users/Item.vue index ff508e88e..6f9a943bf 100644 --- a/Vue/vaahtwo/pages/users/Item.vue +++ b/Vue/vaahtwo/pages/users/Item.vue @@ -22,14 +22,15 @@ onMounted(async () => { return false; } - /** - * Fetch the record from the database - */ if (!store.item) { await store.getItem(route.params.id); } - await store.getItemMenu(); + if (root.assets && root.assets.language_strings && root.assets.language_strings.crud_actions + && store.assets && store.assets.language_strings) + { + await store.getItemMenu(); + } }); @@ -40,6 +41,17 @@ const toggleItemMenu = (event) => { }; //--------/toggle item menu +watch( + () => root.assets && store.assets, + async () => { + if (root.assets && root.assets.language_strings && root.assets.language_strings.crud_actions + && store.assets && store.assets.language_strings) + { + await store.getItemMenu(); + } + } +) + { /> @@ -55,8 +67,8 @@ const toggleItemMenu = (event) => {{ data-testid="user-item_id" /> - { - {{root.assets.language_string.crud_actions.view_deleted}} {{store.item.deleted_at}} + {{root.assets.language_strings.crud_actions.view_deleted}} {{store.item.deleted_at}}-{ -- {{store.assets.language_string.users.users_title}} ++ {{store.assets.language_strings.page_title}}@@ -70,11 +67,11 @@ onMounted(async () => { { diff --git a/Vue/vaahtwo/pages/users/ViewRole.vue b/Vue/vaahtwo/pages/users/ViewRole.vue index c09a2f50b..a5744d3ca 100644 --- a/Vue/vaahtwo/pages/users/ViewRole.vue +++ b/Vue/vaahtwo/pages/users/ViewRole.vue @@ -3,7 +3,7 @@ import { vaah } from '../../vaahvue/pinia/vaah' import { useUserStore } from '../../stores/store-users' import { useRootStore } from "../../stores/root"; import VhField from './../../vaahvue/vue-three/primeflex/VhField.vue' -import {onMounted, ref} from "vue"; +import {onMounted, ref, watch} from "vue"; import {useRoute} from "vue-router"; import Dialog from 'primevue/dialog'; @@ -38,9 +38,14 @@ onMounted(async () => { } /** - * Fetch user roles menu items - */ - await store.getUserRolesMenuItems(); + * Fetch user roles menu items + */ + + if (store.assets && store.assets.language_strings) + { + await store.getUserRolesMenuItems(); + } + }); //--------toggle item menu--------// @@ -51,6 +56,18 @@ const toggleItemMenu = (event) => { }; //--------toggle item menu--------// +watch( + () => store.assets, + async () => { + if ( store.assets.language_strings) + { + await store.getUserRolesMenuItems(); + } + + } +) + +
@@ -97,13 +114,11 @@ const toggleItemMenu = (event) => {+ v-if="store.assets && store.assets.language_strings">@@ -125,8 +140,8 @@ const toggleItemMenu = (event) => { { @@ -152,21 +167,18 @@ const toggleItemMenu = (event) => { + v-if="store.assets && store.assets.language_strings"> @@ -175,28 +187,29 @@ const toggleItemMenu = (event) => { diff --git a/Vue/vaahtwo/pages/users/components/Actions.vue b/Vue/vaahtwo/pages/users/components/Actions.vue index 189153ae3..5040e83d3 100644 --- a/Vue/vaahtwo/pages/users/components/Actions.vue +++ b/Vue/vaahtwo/pages/users/components/Actions.vue @@ -35,7 +35,7 @@ const toggleBulkMenuState = (event) => { -+{ @keyup.enter="store.delayedSearch()" @keyup.enter.native="store.delayedSearch()" @keyup.13="store.delayedSearch()" - :placeholder="root.assets.language_string.crud_actions.placeholder_search" + :placeholder="root.assets.language_strings.crud_actions.placeholder_search" data-testid="user-action_search_input" /> @@ -97,7 +97,7 @@ const toggleBulkMenuState = (event) => { /> @@ -108,7 +108,7 @@ const toggleBulkMenuState = (event) => { - {{root.assets.language_string.crud_actions.filter_sort_by}}: + {{root.assets.language_strings.crud_actions.filter_sort_by}}: @@ -49,7 +49,7 @@ const store = useUserStore();- {{root.assets.language_string.crud_actions.filter_is_active}}: + {{root.assets.language_strings.crud_actions.filter_is_active}}: - {{root.assets.language_string.crud_actions.filter_trashed}}: + {{root.assets.language_strings.crud_actions.filter_trashed}}: diff --git a/Vue/vaahtwo/pages/users/components/Table.vue b/Vue/vaahtwo/pages/users/components/Table.vue index 30b031be4..671ac3c86 100644 --- a/Vue/vaahtwo/pages/users/components/Table.vue +++ b/Vue/vaahtwo/pages/users/components/Table.vue @@ -87,8 +87,8 @@ const useVaah = vaah();@@ -134,7 +133,7 @@ const useVaah = vaah(); diff --git a/Vue/vaahtwo/stores/dashboard.js b/Vue/vaahtwo/stores/dashboard.js index 1c82af41e..a76e21d52 100644 --- a/Vue/vaahtwo/stores/dashboard.js +++ b/Vue/vaahtwo/stores/dashboard.js @@ -11,6 +11,7 @@ export const useDashboardStore = defineStore({ id: 'dashboard', state: () => ({ title: 'Dashboard', + language_strings: null, active_index: [0,1], ajax_url: ajax_url, assets_is_fetching: true, @@ -38,6 +39,7 @@ export const useDashboardStore = defineStore({ afterGetItem(data, res) { if (data) { this.dashboard_items = data.item; + this.language_strings = data.language_strings; } }, //----------------------------------------------------------------------- diff --git a/Vue/vaahtwo/stores/settings/store-localization.js b/Vue/vaahtwo/stores/settings/store-localization.js index 84319a357..99406b5b0 100644 --- a/Vue/vaahtwo/stores/settings/store-localization.js +++ b/Vue/vaahtwo/stores/settings/store-localization.js @@ -435,7 +435,6 @@ export const useLocalizationStore = defineStore({ //--------------------------------------------------------------------- generateLanguage() { - let url = this.ajax_url+'/generateLanguage'; let options = { method:'post' }; @@ -445,10 +444,42 @@ export const useLocalizationStore = defineStore({ }, //--------------------------------------------------------------------- + runSeeds() { + + let options = { + method:'post' + }; + + let ajax_url = this.ajax_url+'/run-seeds'; + vaah().ajax(ajax_url, this.afterRunSeeds, options); + + }, + //--------------------------------------------------------------------- + afterRunSeeds() { + this.assets_is_fetching = true; + this.getAssets(); + }, + //--------------------------------------------------------------------- async paginate(event) { await this.getList(event.page+1); }, //--------------------------------------------------------------------- + getItemMenuList: function (){ + this.item_menu_list = [ + { + label: 'Run Seeds', + command: () => { + this.runSeeds(); + } + }, + { + label: 'Generate Language Files', + command: () => { + this.generateLanguage() + } + } + ]; + }, //--------------------------------------------------------------------- setPageTitle() { if (this.title) { diff --git a/Vue/vaahtwo/stores/setup.js b/Vue/vaahtwo/stores/setup.js index eb21df78c..3b1acbc4d 100644 --- a/Vue/vaahtwo/stores/setup.js +++ b/Vue/vaahtwo/stores/setup.js @@ -469,6 +469,32 @@ export const useSetupStore = defineStore({ }, + //--------------------------------------------------------------------- + runArtisanMigrate: function () { + + let params = { + method: 'post', + }; + + vaah().ajax( + this.ajax_url+'/run/artisan-migrate', + null, + params + ); + }, + //--------------------------------------------------------------------- + runArtisanSeeds: function () { + + let params = { + method: 'post', + }; + + vaah().ajax( + this.ajax_url+'/run/artisan-seeds', + null, + params + ); + }, //--------------------------------------------------------------------- validateMigration: function () { if(this.status && !this.status.is_db_migrated) @@ -558,6 +584,18 @@ export const useSetupStore = defineStore({ this.clearCache() } }, + { + label: 'Run Migrations', + command: () => { + this.runArtisanMigrate() + } + }, + { + label: 'Run Seeds', + command: () => { + this.runArtisanSeeds(); + } + }, ]; }, //--------------------------------------------------------------------- diff --git a/Vue/vaahtwo/stores/store-permissions.js b/Vue/vaahtwo/stores/store-permissions.js index d4cfee8d8..6743421df 100644 --- a/Vue/vaahtwo/stores/store-permissions.js +++ b/Vue/vaahtwo/stores/store-permissions.js @@ -308,6 +308,7 @@ export const usePermissionStore = defineStore({ async bulkActions (input, action) { let params = { id: this.item.id, + query: this.permission_roles_query, role_id: null }; @@ -449,6 +450,9 @@ export const usePermissionStore = defineStore({ method: method, show_success: false }; + + options.params.query = vaah().clone(this.query); + await vaah().ajax( url, this.updateListAfter, diff --git a/Vue/vaahtwo/stores/store-roles.js b/Vue/vaahtwo/stores/store-roles.js index 3d4bbc3a1..e96efbfe9 100644 --- a/Vue/vaahtwo/stores/store-roles.js +++ b/Vue/vaahtwo/stores/store-roles.js @@ -376,6 +376,9 @@ export const useRoleStore = defineStore({ method: method, show_success: false }; + + options.params.query = vaah().clone(this.role_permissions_query); + await vaah().ajax( url, this.updateListAfter, @@ -768,7 +771,7 @@ export const useRoleStore = defineStore({ let inputs = { id : this.item.id, - permission_id : item.id, + permission_id : item.id }; let data = {}; @@ -804,9 +807,10 @@ export const useRoleStore = defineStore({ }, //--------------------------------------------------------------------- - bulkActions (input, action) { + bulkActions (input, action, query = this.role_permissions_query) { let params = { id: this.item.id, + query : query, permission_id: null, user_id: null }; @@ -1227,13 +1231,13 @@ export const useRoleStore = defineStore({ { label: 'Attach To All Users', command: () => { - this.bulkActions(1, 'toggle-user-active-status'); + this.bulkActions(1, 'toggle-user-active-status',this.role_users_query); } }, { label: 'Detach To All Users', command: () => { - this.bulkActions(0, 'toggle-user-active-status'); + this.bulkActions(0, 'toggle-user-active-status',this.role_users_query); } } ] diff --git a/Vue/vaahtwo/stores/store-users.js b/Vue/vaahtwo/stores/store-users.js index 62c9a10e6..10c0015cf 100644 --- a/Vue/vaahtwo/stores/store-users.js +++ b/Vue/vaahtwo/stores/store-users.js @@ -197,9 +197,7 @@ export const useUserStore = defineStore({ } this.route = newVal; - if (newVal.params.id) { - this.getItem(newVal.params.id); - } + this.setViewAndWidth(newVal.name); }, { deep: true } ) @@ -334,8 +332,6 @@ export const useUserStore = defineStore({ }else{ this.$router.push({name: 'users.index'}); } - this.getItemMenu(); - await this.getFormMenu(); }, //--------------------------------------------------------------------- storeAvatar(data) { @@ -397,13 +393,13 @@ export const useUserStore = defineStore({ const root = useRootStore(); if(!this.action.type) { - vaah().toastErrors([root.assets.language_string.general.select_an_action_type]); + vaah().toastErrors([root.assets.language_strings.general.select_an_action_type]); return false; } if(this.action.items.length < 1) { - vaah().toastErrors([root.assets.language_string.general.select_records]); + vaah().toastErrors([root.assets.language_strings.general.select_records]); return false; } @@ -518,6 +514,7 @@ export const useUserStore = defineStore({ let params = { id: this.item.id, + query: this.user_roles_query, role_id: null }; @@ -591,6 +588,9 @@ export const useUserStore = defineStore({ method: method, show_success: false }; + + options.params.query = vaah().clone(this.query); + await vaah().ajax( url, this.updateListAfter, @@ -678,11 +678,16 @@ export const useUserStore = defineStore({ this.item = data; await this.getList(); await this.formActionAfter(); - this.getItemMenu(); if (this.route.params && this.route.params.id) { await this.getItem(this.route.params.id); } + + if(this.assets && this.assets.language_strings) { + await this.getItemMenu(); + } + + await this.getFormMenu(); } }, //--------------------------------------------------------------------- @@ -792,7 +797,7 @@ export const useUserStore = defineStore({ const root = useRootStore(); if(this.action.items.length < 1) { - vaah().toastErrors([root.assets.language_string.general.select_a_record]); + vaah().toastErrors([root.assets.language_strings.general.select_a_record]); return false; } this.action.type = 'delete'; @@ -924,12 +929,16 @@ export const useUserStore = defineStore({ toView(item) { this.item = vaah().clone(item); + if(this.assets && this.assets.language_strings) { + this.getItemMenu(); + } this.$router.push({name: 'users.view', params:{id:item.id}}) }, //--------------------------------------------------------------------- toEdit(item) { this.item = item; + this.getFormMenu(); this.$router.push({name: 'users.form', params:{id:item.id}}) }, //--------------------------------------------------------------------- @@ -984,13 +993,13 @@ export const useUserStore = defineStore({ const root = useRootStore(); this.list_selected_menu = [ { - label: root.assets.language_string.crud_actions.bulk_activate, + label: root.assets.language_strings.crud_actions.bulk_activate, command: async () => { await this.updateList('activate') } }, { - label: root.assets.language_string.crud_actions.bulk_deactivate, + label: root.assets.language_strings.crud_actions.bulk_deactivate, command: async () => { await this.updateList('deactivate') } @@ -999,21 +1008,21 @@ export const useUserStore = defineStore({ separator: true }, { - label: root.assets.language_string.crud_actions.bulk_trash, + label: root.assets.language_strings.crud_actions.bulk_trash, icon: 'pi pi-times', command: async () => { await this.updateList('trash') } }, { - label: root.assets.language_string.crud_actions.bulk_restore, + label: root.assets.language_strings.crud_actions.bulk_restore, icon: 'pi pi-replay', command: async () => { await this.updateList('restore') } }, { - label: root.assets.language_string.crud_actions.bulk_delete, + label: root.assets.language_strings.crud_actions.bulk_delete, icon: 'pi pi-trash', command: () => { this.confirmDelete() @@ -1028,13 +1037,13 @@ export const useUserStore = defineStore({ const root = useRootStore(); this.list_bulk_menu = [ { - label: root.assets.language_string.crud_actions.mark_all_as_active, + label: root.assets.language_strings.crud_actions.mark_all_as_active, command: async () => { await this.listAction('activate-all') } }, { - label: root.assets.language_string.crud_actions.mark_all_as_inactive, + label: root.assets.language_strings.crud_actions.mark_all_as_inactive, command: async () => { await this.listAction('deactivate-all') } @@ -1043,21 +1052,21 @@ export const useUserStore = defineStore({ separator: true }, { - label: root.assets.language_string.crud_actions.trash_all, + label: root.assets.language_strings.crud_actions.trash_all, icon: 'pi pi-times', command: async () => { await this.listAction('trash-all') } }, { - label: root.assets.language_string.crud_actions.restore_all, + label: root.assets.language_strings.crud_actions.restore_all, icon: 'pi pi-replay', command: async () => { await this.listAction('restore-all') } }, { - label: root.assets.language_string.crud_actions.delete_all, + label: root.assets.language_strings.crud_actions.delete_all, icon: 'pi pi-trash', command: async () => { this.confirmDeleteAll(); @@ -1075,7 +1084,7 @@ export const useUserStore = defineStore({ { item_menu.push({ - label: root.assets.language_string.crud_actions.view_restore, + label: root.assets.language_strings.crud_actions.view_restore, icon: 'pi pi-refresh', command: () => { this.itemAction('restore'); @@ -1086,7 +1095,7 @@ export const useUserStore = defineStore({ if(this.item && this.item.id && !this.item.deleted_at) { item_menu.push({ - label: root.assets.language_string.crud_actions.view_trash, + label: root.assets.language_strings.crud_actions.view_trash, icon: 'pi pi-times', command: () => { this.itemAction('trash'); @@ -1095,7 +1104,7 @@ export const useUserStore = defineStore({ } item_menu.push({ - label: root.assets.language_string.crud_actions.view_delete, + label: root.assets.language_strings.crud_actions.view_delete, icon: 'pi pi-trash', command: () => { this.confirmDeleteItem('delete'); @@ -1103,7 +1112,7 @@ export const useUserStore = defineStore({ }); item_menu.push({ - label: this.assets.language_string.users.view_generate_new_api_token, + label: this.assets.language_strings.view_generate_new_api_token, icon: 'pi pi-key', command: () => { this.itemAction('generate-new-token'); @@ -1116,13 +1125,13 @@ export const useUserStore = defineStore({ async getUserRolesMenuItems() { return this.user_roles_menu = [ { - label: this.assets.language_string.users.view_role_active_all_roles, + label: this.assets.language_strings.view_role_active_all_roles, command: async () => { await this.bulkActions(1, 'toggle-role-active-status') } }, { - label: this.assets.language_string.users.view_role_inactive_all_roles, + label: this.assets.language_strings.view_role_inactive_all_roles, command: async () => { await this.bulkActions(0, 'toggle-role-active-status') } @@ -1170,17 +1179,16 @@ export const useUserStore = defineStore({ if(this.item && this.item.id ) { - form_menu = [ { - label: root.assets.language_string.crud_actions.form_save_and_close, + label: root.assets.language_strings.crud_actions.form_save_and_close, icon: 'pi pi-check', command: () => { this.itemAction('save-and-close'); } }, { - label: root.assets.language_string.crud_actions.form_save_and_clone, + label: root.assets.language_strings.crud_actions.form_save_and_clone, icon: 'pi pi-copy', command: () => { @@ -1189,7 +1197,7 @@ export const useUserStore = defineStore({ } }, { - label: root.assets.language_string.crud_actions.form_save_and_new, + label: root.assets.language_strings.crud_actions.form_save_and_new, icon: 'pi pi-plus', command: () => { @@ -1198,14 +1206,7 @@ export const useUserStore = defineStore({ } }, { - label: root.assets.language_string.crud_actions.form_trash, - icon: 'pi pi-times', - command: () => { - this.itemAction('trash'); - } - }, - { - label: root.assets.language_string.crud_actions.form_delete, + label: root.assets.language_strings.crud_actions.form_delete, icon: 'pi pi-trash', command: () => { this.confirmDeleteItem('delete'); @@ -1213,18 +1214,40 @@ export const useUserStore = defineStore({ }, ]; + if(this.item && this.item.id && !this.item.deleted_at) + { + form_menu.push({ + label: root.assets.language_strings.crud_actions.view_trash, + icon: 'pi pi-times', + command: () => { + this.itemAction('trash'); + } + }); + } + + if(this.item && this.item.deleted_at) + { + + form_menu.push({ + label: root.assets.language_strings.crud_actions.view_restore, + icon: 'pi pi-refresh', + command: () => { + this.itemAction('restore'); + } + }); + } } else{ form_menu = [ { - label: root.assets.language_string.crud_actions.form_create_and_close, + label: root.assets.language_strings.crud_actions.form_create_and_close, icon: 'pi pi-check', command: () => { this.itemAction('create-and-close'); } }, { - label: root.assets.language_string.crud_actions.form_create_and_clone, + label: root.assets.language_strings.crud_actions.form_create_and_clone, icon: 'pi pi-copy', command: () => { @@ -1233,7 +1256,7 @@ export const useUserStore = defineStore({ } }, { - label: root.assets.language_string.crud_actions.form_reset, + label: root.assets.language_strings.crud_actions.form_reset, icon: 'pi pi-refresh', command: () => { this.setActiveItemAsEmpty(); @@ -1243,14 +1266,14 @@ export const useUserStore = defineStore({ } form_menu.push({ - label: root.assets.language_string.crud_actions.form_fill, + label: root.assets.language_strings.crud_actions.form_fill, icon: 'pi pi-pencil', command: () => { this.getFaker(); } }, { - label: root.assets.language_string.crud_actions.form_add_custom_field, + label: root.assets.language_strings.crud_actions.form_add_custom_field, icon: 'pi pi-plus', command: () => { store_setting.active_index = [1]; diff --git a/Vue/vaahtwo/vaahvue/pinia/vaah.js b/Vue/vaahtwo/vaahvue/pinia/vaah.js index 93dbb3bd2..25220262c 100644 --- a/Vue/vaahtwo/vaahvue/pinia/vaah.js +++ b/Vue/vaahtwo/vaahvue/pinia/vaah.js @@ -128,6 +128,13 @@ export const vaah = defineStore({ //---------------------------------------------------------- processResponse: function(response) { + + + if(response.data.errors || response.data.messages) + { + this.toast.removeAllGroups(); + } + if(response.data.errors) { this.toastErrors(response.data.errors); @@ -203,7 +210,6 @@ export const vaah = defineStore({ }, //---------------------------------------------------------- toastSuccess(messages){ - this.toast.removeAllGroups(); let data = this.getMessageAndDuration(messages); if(data && data.html !== "") @@ -218,7 +224,6 @@ export const vaah = defineStore({ //---------------------------------------------------------- toastErrors(messages){ - this.toast.removeAllGroups(); let data = this.getMessageAndDuration(messages); if(data && data.html !== "")