import{_ as w,ax as y,M as g,c as u,a as t,w as o,Z as f,R as b,H as _,ay as v,r as k,o as p,$ as n,K as l,I as $,a3 as C,aj as L,N as m,a1 as Q,Q as E}from"./app-DzAYC6xy.js";import{Q as S,a as d}from"./QTable-98FMMxUQ.js";import{Q as I}from"./QTr-BZRxhYsi.js";import{d as N}from"./utils-wZ-HUk39.js";import"./externalHosting.js";import"./QList-ClLOsgaS.js";import"./QMarkupTable-z27wCkH-.js";import"./QSelect-CKpWbBmC.js";import"./QChip-BlQVc6fr.js";import"./QItemLabel-DrLwH6Mx.js";import"./position-engine-BoHh6ymb.js";import"./selection-vu7NfHfB.js";import"./rtl-DFPa-2ov.js";import"./use-fullscreen-Bv2HJD5x.js";const R={name:"WaypointMap",data(){return{ACTION:_,RESOURCE:b,columns:[{name:"name",align:"left",label:this.$i18n.t("components.waypointList.headers.name"),field:a=>a.name,format:a=>`${a}`,sortable:!0},{name:"label",align:"left",label:this.$i18n.t("components.waypointList.headers.label"),field:a=>a.label,format:a=>`${a}`,sortable:!0},{name:"coords",align:"left",label:this.$i18n.t("components.waypointList.headers.coords"),field:a=>a.coords,format:a=>`${a}`}],waypoints:[],pagination:{sortBy:"desc",descending:!1,page:1,rowsPerPage:0},loading:!0}},methods:{can:N,onRowClick(a){this.$router.push({name:"game-waypoint-detail",params:{waypointId:a.name}})},getPaginationLabel(a,s,c){return this.$i18n.t("components.waypointList.paginationLabel",{from:a,to:s,total:c})},updatePagination(a){this.loading||(this.paginationSave=a,this.pagination=a)}},computed:{...y(v,["searchFilter","paginationSave"])},mounted(){this.$route.name==="game-waypoint-list"&&this.$axios.get("/api/waypoints").then(a=>{this.waypoints=a.data.waypoints,this.loading=!1,this.pagination={...this.paginationSave}})}},T={key:0,class:"row q-pa-sm"},V={class:"row"},q={class:"col-12"},x={class:"q-mx-md q-my-sm row flex-center"},A={class:"text-caption text-sub"},B={class:"q-ml-auto"};function P(a,s,c,O,i,r){const h=k("router-view");return a.$route.name==="game-waypoint-list"?(p(),g("div",T,[t(f,{class:"waypoint-list-card full-width"},{default:o(()=>[n("div",V,[n("div",q,[n("div",x,[n("div",A,l(a.$t("components.waypointList.subheader")),1),n("div",B,[r.can(i.ACTION.GAME.WAYPOINT.CREATE,i.RESOURCE.GAME)?(p(),u(C,{key:0,"text-color":"main",color:"primary",onClick:s[0]||(s[0]=e=>a.$router.push({name:"game-waypoint-create"})),label:a.$t("components.waypointList.createWaypoint"),class:"q-ma-sm"},null,8,["label"])):$("",!0)])]),t(L),t(S,{color:"primary","card-class":"waypoint-list-card text-main","table-class":"waypoint-list-table","table-header-class":"waypoint-list-table-header text-main",flat:"",style:{"max-height":"70vh"},rows:i.waypoints,columns:i.columns,"row-key":"name",pagination:i.pagination,"no-results-label":a.$t("components.waypointList.noData"),"loading-label":a.$t("components.waypointList.loadData"),loading:i.loading,filter:a.searchFilter,"onUpdate:pagination":r.updatePagination},{"top-right":o(()=>[t(Q,{"input-style":{color:"var(--q-main)"},borderless:"",dense:"",debounce:"300",modelValue:a.searchFilter,"onUpdate:modelValue":s[1]||(s[1]=e=>a.searchFilter=e),placeholder:a.$t("general.search")},{append:o(()=>[t(E,{class:"text-white search-icon",name:"search"})]),_:1},8,["modelValue","placeholder"])]),body:o(e=>[t(I,{props:e,onClick:U=>r.onRowClick(e.row),class:"cursor-pointer"},{default:o(()=>[t(d,{key:"name",props:e},{default:o(()=>[m(l(e.row.name),1)]),_:2},1032,["props"]),t(d,{key:"label",props:e},{default:o(()=>[m(l(e.row.label),1)]),_:2},1032,["props"]),t(d,{key:"coords",props:e},{default:o(()=>[m(l(e.row.coords),1)]),_:2},1032,["props"])]),_:2},1032,["props","onClick"])]),_:1},8,["rows","columns","pagination","no-results-label","loading-label","loading","filter","onUpdate:pagination"])])])]),_:1})])):(p(),u(h,{key:1}))}const ea=w(R,[["render",P],["__scopeId","data-v-82bffcb7"]]);export{ea as default};
