1import{r as m,z as N,a as D,o as i,f as b,w as x,d as n,u as t,e,h as g,k as L,v as V,y as $,g as j,b as u,F as z,j as A,t as a,i as B,N as k}from"./app-f7d7947b.js";import{_ as M}from"./Authenticated-6c246e91.js";import{L as E}from"./LoaderComponent-4fe0e37d.js";import{u as F}from"./index-d0df4235.js";import{_ as O}from"./ConfirmModal-c493d08b.js";import{d as U}from"./debounce-8f484039.js";import{r as W}from"./CurrencyDollarIcon-8d0cc6d3.js";import{r as H}from"./PlusIcon-c4cacd61.js";import{r as I}from"./PencilIcon-07783609.js";import{r as Z}from"./TrashIcon-00184812.js";/* empty css */import"./AppIcon-c8695400.js";import"./HeadComponent-3f1c3149.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./dayjs.min-a78aa7a4.js";import"./transition-66c17495.js";import"./keyboard-588ac1bc.js";import"./hidden-0cb61dbb.js";import"./active-element-history-6f4df4be.js";const q={class:"mx-auto max-w-7xl py-2 sm:px-6 lg:px-8"},G={class:"overflow-hidden p-6 border-b border-main-dark bg-white shadow-sm sm:rounded-sm"},J={class:"sm:flex sm:items-center"},K={class:"sm:flex-auto"},P={class:"flex items-center text-2xl font-semibold text-main-dark"},Q={class:"relative flex items-center"},X={class:"mt-4 sm:mt-0 sm:ml-16 sm:flex-none"},Y={class:"mt-4 inline-block w-full py-2 align-middle"},ee={class:"overflow-hidden shadow md:rounded-sm"},te={key:0,class:"min-w-full divide-y divide-gray-300","aria-label":"Rates Table"},se={class:"divide-y divide-gray-200 bg-white"},oe={class:"whitespace-nowrap py-2 pl-4 pr-3 text-sm text-gray-500 sm:pl-6"},ae={class:"whitespace-nowrap px-2 py-2 text-sm font-medium text-gray-900"},re={class:"whitespace-nowrap px-2 py-2 text-center text-sm text-gray-900"},ne={class:"whitespace-nowrap px-2 py-2 text-center text-sm text-gray-900"},ie={class:"whitespace-nowrap px-2 py-2 text-center text-sm text-gray-900"},le={class:"whitespace-nowrap px-2 py-2 text-center text-sm text-gray-900"},de={class:"whitespace-nowrap px-2 py-2 text-center text-sm text-gray-900"},pe={class:"relative flex justify-center whitespace-nowrap py-2 pl-3 pr-4 text-right text-sm font-medium sm:pr-6"},ce={class:"flex justify-center space-x-2"},me=["onClick"],ue={key:1},Ae={__name:"Index",props:{rates:{type:Array,default:[]},search:String}
1,setup(f){const{simpleStatus:C,formatAmount:d}=F();let l=m(f.search),p=m(!1),h=m(null),c=m(!1),S=r=>{h.value=r,c.value=!0},T=r=>{h.value=null,c.value=!1},R=()=>{p.value=!0,k.visit(route("admin.special-rates.destroy",h.value),{method:"delete",preserveScroll:!0}),c.value=!1};return N(l,U(function(r){p.value=!0,k.get(route("admin.special-rates"),{search:r},{preserveState:!1,replace:!0,onSuccess:()=>{p.value=!1}})},800)),(r,o)=>{const w=D("Link");return i(),b(M,null,{default:x(()=>[n(O,{"should-open":t(c),title:"Confirm Deleting Element",onCanceled:t(T),onConfirmed:t(R)},null,8,["should-open","onCanceled","onConfirmed"]),e("div",q,[e("div",G,[e("div",J,[e("div",K,[e("h1",P,[n(t(W),{class:"mr-3 h-8 w-8"}),o[1]||(o[1]=g(" Special Rates "))]),o[2]||(o[2]=e("p",{class:"mt-2 text-sm text-main"}," A list of all Special Rates. ",-1))]),e("div",Q,[L(e("input",{"onUpdate:modelValue":o[0]||(o[0]=s=>$(l)?l.value=s:l=s),class:"border-wine rounded-sm px-2 outline-none focus:border-main-dark focus:ring-main-dark",placeholder:"Search...",type:"search"},null,512),[[V,t(l)]]),t(p)?(i(),b(E,{key:0,class:"absolute right-0 ml-5 text-main"})):j("",!0)]),e("div",X,[n(w,{href:r.route("admin.special-rates.create"),class:"inline-flex items-center justify-center rounded border border-transparent bg-main px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-opacity-80 focus:outline-none focus:ring-0 sm:w-auto"},{default:x(()=>[n(t(H),{class:"mr-2 h-4 w-4"}),o[3]||(o[3]=g(" New Special Rate "))]),_:1,__:[3]},8,["href"])])]),e("div",Y,[e("div",ee,[f.rates?(i(),u("table",te,[o[4]||(o[4]=e("thead",{class:"bg-main text-white"},[e("tr",null,[e("th",{class:"whitespace-nowrap py-3.5 pl-4 pr-3 text-sm font-semibold sm:pl-6",scope:"col"}," Zone "),e("th",{class:"whitespace-nowrap px-2 py-3.5 text-sm font-semibold",scope:"col"}," Unit "),e("th",{class:"whitespace-nowrap px-2 py-3.5 text-sm font-semibold",scope:"col"}," One Way "),e("th",{class:"whitespace-nowrap px-2 py-3.5 text-sm font-semibold",scope:"col"}," Round Trip "),e("th",{class:"whitespace-nowrap px-2 py-3.5 text-sm font-semibold",scope:"col"}," One Way Transfer "),e("th",{class:"whitespace-nowrap px-2 py-3.5 text-sm font-semibold",scope:"col"}," Round Trip Transfer "),e("th",{class:"whitespace-nowrap px-2 py-3.5 text-sm font-semibold",scope:"col"}," Status "),e("th",{class:"relative whitespace-nowrap py-3.5 pl-3 pr-4 sm:pr-6",scope:"col"}," Actions ")])],-1)),e("tbody",se,[(i(!0),u(z,null,A(f.rates.data,s=>{var y,_,v;return i(),u("tr",{key:s.id},[e("td",oe," ("+a((y=s.zone)==null?void 0:y.zone)+") - "+a((_=s.zone)==null?void 0:_.name),1),e("td",ae,a(((v=s.unit)==null?void 0:v.name)||"-"),1),e("td",re,a(t(d)(s.oneway)),1),e("td",ne,a(t(d)(s.roundTrip)),1),e("td",ie,a(t(d)(s.onewayTransfer)),1),e("td",le,a(t(d)(s.transfer)),1),e("td",de,a(t(C)(s.status)),1),e("td",pe,[e("div",ce,[n(w,{href:r.route("admin.special-rates.edit",s.uuid),class:"text-main-dark hover:text-main"},{default:x(()=>[n(t(I),{class:"h-4 w-4"})]),_:2},1032,["href"]),e("button",{class:"block",onClick:B(he=>t(S)(s.uuid),["prevent"])},[n(t(Z),{class:"h-4 w-4 text-red-600"})],8,me)])])])}),128))])])):(i(),u("div",ue,o[5]||(o[5]=[e("div",{class:"text-center"}," There are no Rates registered ",-1)])))])])])])]),_:1})}}};export{Ae as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.