import{p as b,J as g,c as i,a as k,g as h,e as w,w as m,b as t,d as _,t as s,o as a,i as l,O as x,j as f,s as $}from"./app-CYVHboi-.js";import{_ as j}from"./Loading-C17YK6G3.js";import{_ as O,a as B,b as C}from"./TemplateTwo-D1yIj8Ou.js";import{_ as M}from"./TemplateOne-CqNNof5p.js";import"./browser-BwNzv7vE.js";import"./Modal-oUJ1UwGv.js";import"./Attachments-CeMFdFu2.js";import"./DialogModal-BGpz32gV.js";import"./SecondaryButton-CHQvCfls.js";import"./DangerButton-dMO1Xwz1.js";import"./ViewCustomFields-CiekLLjv.js";const N={key:0,class:"relative h-64"},T={key:0,class:"col-span-full px-6 pb-4"},V={class:"block rounded-md border border-yellow-700 bg-yellow-50 px-4 py-2.5 dark:bg-yellow-800 print:border print:border-yellow-700"},z={class:"flex"},R={class:"ms-3"},A={class:"text-sm font-medium text-yellow-800 dark:text-yellow-200"},D={key:0,class:"pb-4"},E={class:"mb-1 text-xs font-bold"},P={class:"text-lg font-semibold"},S={class:"text-sm"},H={key:0,class:"text-sm"},J={key:1,class:"text-sm"},L={class:"mx-4 rounded-md border border-gray-200 bg-gray-50 px-5 py-4 dark:border-gray-700 dark:bg-gray-950"},Q={class:"flex items-center justify-between text-lg font-bold"},q={key:0,class:"mt-3 flex items-center justify-start gap-1"},F={class:"font-bold"},G={key:1,class:"mt-2 flex items-center justify-start gap-1"},I={class:"capitalize"},K={key:2,class:"flex min-h-64 items-center justify-center p-6 text-lg font-thin"},le={__name:"QuickView",props:["current","custom_fields","editRow","xfetch","force"],setup(r){const y=$(),n=r,c=f(!0),d=f(null),v={One:M,Two:C,Three:B,Minimal:O};return b(async()=>{n.xfetch?(d.value=n.current,c.value=!1):await g.get(n.force?route("payments.report.show",{id:n.current.id}):route("payments.show",{payment:n.current.id,json:!0})).then(o=>{d.value=o.data,c.value=!1}).catch(()=>c.value=!1)}),(o,p)=>c.value?(a(),i("div",N,[k(h(j))])):d.value?(a(),w(x(v[h(y).props.settings?.sale_template||"One"]),{key:1,type:"payment",record:d.value,xfetch:r.xfetch,editRow:r.editRow,custom_fields:r.custom_fields},{alerts:m(()=>[d.value.received!=1?(a(),i("div",T,[t("div",V,[t("div",z,[p[0]||(p[0]=t("div",{class:"shrink-0"},[t("svg",{class:"h-5 w-5 text-yellow-400",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},[t("path",{"fill-rule":"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495zM10 5a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 5zm0 9a1 1 0 100-2 1 1 0 000 2z","clip-rule":"evenodd"})])],-1)),t("div",R,[t("h3",A,s(o.$t("This payment is not yet received")),1)])])])])):l("",!0)]),content:m(({record:e})=>[e.payment_for=="Supplier"&&e.supplier?(a(),i("div",D,[t("h2",E,s(o.$t("To")),1),t("div",P,s(e.supplier.company||e.supplier.name),1),t("div",S,s(o.$address(e.supplier)),1),e.supplier.phone?(a(),i("div",H,s(o.$t("Phone"))+": "+s(e.supplier.phone),1)):l("",!0),e.supplier.email?(a(),i("div",J,s(o.$t("Email"))+": "+s(e.supplier.email),1)):l("",!0)])):l("",!0)]),amount:m(({record:e})=>[t("div",L,[t("div",Q,[_(s(o.$t("Amount"))+": ",1),t("span",null,s(o.$currency(e.amount)),1)]),e.method?(a(),i("div",q,[_(s(o.$t("Method"))+": ",1),t("div",F,s(o.$t(e.method)),1)])):l("",!0),e.method_data&&Object.keys(e.method_data).length?(a(),i("div",G,[t("div",I,s(e.method_data&&Object.keys(e.method_data)?Object.keys(e.method_data).map(u=>o.$t(u.replaceAll("_"," "))+": "+e.method_data[u]).join(", "):""),1)])):l("",!0)])]),_:1},8,["record","xfetch","editRow","custom_fields"])):(a(),i("div",K,s(o.$t("No data found, the record might not belong to the selected store.")),1))}};export{le as default};
