1import{u as j,r as l,j as e,L as w}from"./app-DNe5vFRE.js";import v from"./FindWorkLayout-CyPm-Fy8.js";import{b,e as k,g as N,Q as c}from"./Utilities-D6wiwRoK.js";import{d as h}from"./index-DsEY6823.js";import{F}from"./MagnifyingGlassIcon-DilhG4_x.js";import{F as $}from"./ArrowRightIcon-DxjvOGNa.js";import{F as C}from"./CreditCardIcon-C2nMh7cl.js";import{F as R}from"./ClockIcon-Bmlh4tsX.js";import{F as O}from"./LockClosedIcon-CTioTI2I.js";import{F as _}from"./XCircleIcon-Cqn-Oh78.js";import{F as u}from"./CheckBadgeIcon-CVl2IYtg.js";import{F as T}from"./ExclamationTriangleIcon-DXCS9fY_.js";import{q as p}from"./transition-BCwysbg9.js";import{_ as g}from"./dialog-CWbWQCHj.js";import"./AppLayout-CBtsvTla.js";import"./HeroIcon-DRjY_EHY.js";import"./ChevronDownIcon-Drh1sngx.js";import"./menu-D3orKPBK.js";import"./use-resolve-button-type-CWYT3wNy.js";import"./calculate-active-index-B4Ujw_fi.js";import"./PieIcon-DeqLXKdq.js";import"./ThemeClipLoader-Cyil_Bll.js";import"./MagnifyingGlassIcon-CgeroQUf.js";import"./UsersIcon-BL-64hYO.js";import"./ChevronRightIcon-D0MMUyn8.js";import"./DarkModeSwitch-BOu0dI_y.js";import"./CheckIcon-BikM7syj.js";import"./DashboardAlerts-DBgmoDoN.js";import"./moment-B-YVwB4U.js";import"./CurrencyDollarIcon-Di6uxUXb.js";import"./PieSocket-BlsPKwHB.js";import"./v4-SoommWqA.js";import"./PieAssistWidget-BF3SpWib.js";import"./index.modern-DBXofvGP.js";import"./LifebuoyIcon-CqkBCkno.js";import"./InformationCircleIcon-Be--LP6j.js";import"./XMarkIcon-QcyYx_g9.js";import"./ChevronUpIcon-iyMOWmJL.js";import"./ChevronDownIcon-Bldz-nWn.js";import"./PowerIcon-Q7BerMUv.js";import"./Bars3BottomLeftIcon-ESaxE1AW.js";import"./ChevronRightIcon-4vsiV2s3.js";import"./ResourceMenu-C2V0y6DE.js";const P={fixed:b,hourly:R,monthly:C},f={fixed:"bg-violet-50 text-violet-700 ring-violet-200 dark:bg-violet-500/10 dark:text-violet-400 dark:ring-violet-500/20",hourly:"bg-blue-50 text-blue-700 ring-blue-200 dark:bg-blue-500/10 dark:text-blue-400 dark:ring-blue-500/20",monthly:"bg-emerald-50 text-emerald-700 ring-emerald-200 dark:bg-emerald-500/10 dark:text-emerald-400 dark:ring-emerald-500/20"};function Y({pending:t,onConfirm:m,onCancel:a,busy:i}){const s=t?.action==="accept";return e.jsx(p,{appear:!0,show:t!==null,as:l.Fragment,children:e.jsxs(g,{as:"div",className:"relative z-50",onClose:a,children:[e.jsx(p.Child,{as:l.Fragment,enter:"ease-out duration-200",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-150",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e.jsx("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-sm"})}),e.jsx("div",{className:"fixed inset-0 overflow-y-auto",children:e.jsx("div",{className:"flex min-h-full items-center justify-center p-4",children:e.jsx(p.Child,{as:l.Fragment,enter:"ease-out duration-200",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-150",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:e.jsxs(g.Panel,{className:"w-full max-w-md rounded-2xl bg-white dark:bg-gray-900 shadow-xl ring-1 ring-gray-900/5 dark:ring-white/10 p-6",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:`h-10 w-10 rounded-full flex items-center justify-center shrink-0 ${s?"bg-violet-50 dark:bg-violet-500/10":"bg-red-50 dark:bg-red-500/10"}`,children:s?e.jsx(u,{className:"h-5 w-5 text-violet-600 dark:text-violet-400"}):e.jsx(T,{className:"h-5 w-5 text-red-600 dark:text-red-400"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx(g.Title,{className:"font-semibold text-gray-900 dark:text-white",children:s?"Accept this offer?":"Decline this offer?"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:s?e.jsxs(e.Fragment,{children:["You're accepting"," ",e.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:t?.offer?.job?.title}),". You'll be taken to the job dashboard to begin work."]}):e.jsxs(e.Fragment,{children:["You're declining"," ",e.jsx("span",{className:"font-medium text-gray-700 dark:text-gray-300",children:t?.offer?.job?.title}),". This action cannot be undone."]})})]})]}),e.jsxs("div",{className:"mt-6 flex items-center justify-end gap-3",children:[e.jsx("button",{type:"button",onClick:a,disabled:i,className:"rounded-lg border border-gray-200 dark:border-white/10 px-4 py-2 text-sm font-medium text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-white/5 transition-colors disabled:opacity-50",children:"Cancel"}),e.jsx("button",{type:"button",onClick:m,disabled:i,className:`flex items-center gap-1.5 rounded-lg px-4 py-2 text-sm font-medium text-white transition-colors shadow-sm disabled:opacity-50 ${s?"bg-violet-600 hover:bg-violet-700":"bg-red-600 hover:bg-red-700"}`,children:i?"Please waitâ¦":s?"Yes, accept":"Yes, decline"})]})]})})})})]})})}function A({offers:t}){const{auth:m}=j().props,[a,i]=l.useState(!1),[s,d]=l.useState(null);function y(){const{offer:r,action:o}=s;i(!0);const n=N(m.user).post(`/pielancer/offers/${r.id}/${o}`,{});c.promise(n,{pending:"Please waitâ¦"}),n.then(x=>{x.data.success&&(d(null),o==="decline"?(c.success("Offer declined"),h.Inertia.reload()):(c.success("Offer accepted!"),h.Inertia.visit(`/app/v4/pielancer/jobs/${r.job.slug}/dashboard`)))}).catch(x=>{c.error(x.response?.data?.message??"Something went wrong")}).finally(()=>i(!1))}return t.length===0?e.jsx("div",{className:"rounded-2xl border border-gray-100 dark:border-white/10 bg-white dark:bg-gray-900 shadow-sm",children:e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center px-6",children:[e.jsx("div",{className:"h-14 w-14 roun
1ded-full bg-gray-100 dark:bg-white/5 flex items-center justify-center mb-4",children:e.jsx(F,{className:"h-7 w-7 text-gray-400"})}),e.jsx("p",{className:"font-semibold text-gray-800 dark:text-white",children:"No offers yet"}),e.jsx("p",{className:"text-gray-400 text-sm mt-1 max-w-xs",children:"Submit more proposals to start receiving job offers from clients."}),e.jsx(w,{href:"/app/v4/partnership/jobs",children:e.jsxs("button",{type:"button",className:"mt-5 flex items-center gap-2 rounded-lg bg-violet-600 px-4 py-2 text-sm font-medium text-white hover:bg-violet-700 transition-colors",children:["Browse Jobs",e.jsx($,{className:"h-4 w-4"})]})})]})}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"space-y-4",children:t.map(r=>{const o=P[r.budget_type]??b,n=f[r.budget_type]??f.fixed;return e.jsxs("div",{className:"rounded-2xl border border-gray-100 dark:border-white/10 bg-white dark:bg-gray-900 shadow-sm overflow-hidden",children:[e.jsx("div",{className:"px-6 pt-5 pb-4",children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-semibold text-gray-900 dark:text-white truncate",children:r.job?.title??"Untitled Job"}),e.jsx("p",{className:"text-gray-500 dark:text-gray-400 text-sm mt-1",children:"The client has offered this job to you. Accept to begin work and submit for payment."})]}),e.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium ring-1 ring-inset shrink-0 ${n}`,children:[e.jsx(o,{className:"h-3.5 w-3.5"}),k(r.budget_type)]})]})}),e.jsxs("div",{className:"px-6 pb-4 flex flex-wrap items-center gap-5",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400",children:[e.jsx(O,{className:"h-4 w-4 text-gray-400"}),e.jsxs("span",{children:["Escrow:"," ",e.jsxs("span",{className:"font-semibold text-gray-900 dark:text-white",children:["$",r.job?.escrow_amount]})]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600 dark:text-gray-400",children:[e.jsx(o,{className:"h-4 w-4 text-gray-400"}),e.jsxs("span",{children:["Budget:"," ",e.jsxs("span",{className:"font-semibold text-gray-900 dark:text-white",children:["$",r.budget_amount]})]})]})]}),e.jsxs("div",{className:"px-6 py-4 border-t border-gray-100 dark:border-white/5 flex items-center justify-end gap-3",children:[e.jsxs("button",{disabled:a,onClick:()=>d({offer:r,action:"decline"}),type:"button",className:"flex items-center gap-1.5 rounded-lg border border-gray-200 dark:border-white/10 px-4 py-2 text-sm font-medium text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-white/5 transition-colors disabled:opacity-50",children:[e.jsx(_,{className:"h-4 w-4"}),"Decline"]}),e.jsxs("button",{disabled:a,onClick:()=>d({offer:r,action:"accept"}),type:"button",className:"flex items-center gap-1.5 rounded-lg bg-violet-600 px-4 py-2 text-sm font-medium text-white hover:bg-violet-700 transition-colors shadow-sm disabled:opacity-50",children:[e.jsx(u,{className:"h-4 w-4"}),"Accept Offer"]})]})]},r.id)})}),e.jsx(Y,{pending:s,onConfirm:y,onCancel:()=>d(null),busy:a})]})}function Ne({offers:t}){return e.jsx(v,{title:"Offers",section:"offers",children:e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-semibold text-gray-900 dark:text-white",children:"Job Offers"}),e.jsx("p",{className:"mt-0.5 text-gray-500 dark:text-gray-400 text-sm",children:t.data.length>0?`You have ${t.data.length} pending offer${t.data.length!==1?"s":""}.`:"Clients can send you offers directly after reviewing your profile."})]}),e.jsx(A,{offers:t.data})]})})}export{Ne 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.