import{An as e,E as t,Nn as n,On as r,Ut as i,W as a,_n as o,a as s,c,d as l,en as u,l as d,mn as f,nn as p,o as m,on as h,rn as g,s as _,tn as v,u as y,wn as b,xn as x}from"./app-4kCgdoJR.js";var S={key:0,class:`relative h-64`},C={key:0,class:`col-span-full -mb-3 px-6 pt-6`},w=[`href`],T={class:`flex`},E={class:`ms-3`},D={class:`text-sm font-medium text-yellow-800 dark:text-yellow-200`},O={key:2,class:`flex min-h-64 items-center justify-center p-6 text-lg font-thin`},k={__name:`QuickView`,props:[`current`,`custom_fields`,`editRow`,`xfetch`,`force`],setup(k){let A=i(),j=k,M=r(!0),N=r(null),P={One:c,Two:s,Three:m,Four:y,Five:l,Six:_,Minimal:d};return f(async()=>{j.xfetch?(N.value=j.current,M.value=!1):await a.get(j.force?route(`purchases.report.show`,{id:j.current.id}):route(`purchases.show`,{purchase:j.current.id,json:!0})).then(e=>{N.value=e.data,M.value=!1}).catch(()=>M.value=!1)}),(r,i)=>M.value?(o(),g(`div`,S,[h(e(t))])):N.value?(o(),v(x(P[e(A).props.settings?.sale_template||`One`]),{key:1,type:`purchase`,xfetch:k.xfetch,record:N.value,editRow:k.editRow,custom_fields:k.custom_fields,qrUrl:r.route(`purchase.url`,{id:N.value.id,hash:N.value.hash||`hash`})},{alerts:b(()=>[N.value.return_orders_count>0?(o(),g(`div`,C,[u(`a`,{href:r.route(`return_orders.index`,{purchase_id:N.value.id}),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`},[u(`div`,T,[i[0]||=u(`div`,{class:`shrink-0`},[u(`svg`,{class:`h-5 w-5 text-yellow-400`,viewBox:`0 0 20 20`,fill:`currentColor`,"aria-hidden":`true`},[u(`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),u(`div`,E,[u(`h3`,D,n(r.$t(`This purchase has attached to return orders.`)),1)])])],8,w)])):p(``,!0)]),_:1},8,[`xfetch`,`record`,`editRow`,`custom_fields`,`qrUrl`])):(o(),g(`div`,O,n(r.$t(`No data found, the record might not belong to the selected store.`)),1))}};export{k as default};