PageSourceSearch

https://yarda.ai/_next/static/chunks/pages/partner/profile-28ba10a0b739078a.js

js yarda.ai collected 2026-10-05 15:29:07 UTC 145,824 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="71ca9259-a04a-4fa4-8060-f56667d9cdeb",e._sentryDebugIdIdentifier="sentry-dbid-71ca9259-a04a-4fa4-8060-f56667d9cdeb")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8496],{27545:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>e2});var a=s(78488),r=s(68373),l=s.n(r),i=s(81204),n=s(45205),o=s.n(n),c=s(55483),d=s.n(c),m=s(72140),x=s.n(m),u=s(72094),h=s(50178),p=s(15269),f=s(57204),b=s(81641),g=s(48227),j=s(44468),v=s(39948),N=s(59782);let w=e=>{let{size:t=18,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),(0,a.jsx)("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})},y=e=>{let{size:t=18,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,a.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,a.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,a.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})},k=e=>{let{size:t=20,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("circle",{cx:"9",cy:"12",r:"1"}),(0,a.jsx)("circle",{cx:"9",cy:"5",r:"1"}),(0,a.jsx)("circle",{cx:"9",cy:"19",r:"1"}),(0,a.jsx)("circle",{cx:"15",cy:"12",r:"1"}),(0,a.jsx)("circle",{cx:"15",cy:"5",r:"1"}),(0,a.jsx)("circle",{cx:"15",cy:"19",r:"1"})]})},_=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),(0,a.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,a.jsx)("polyline",{points:"21 15 16 10 5 21"})]})};function P(e){var t,s;return{...e,before_image_url:null==(t=e.before_images)?void 0:t[0],after_image_url:null==(s=e.after_images)?void 0:s[0]}}function C(e){let{project:t,onEdit:s,onDelete:r,onClick:l,isDragging:n=!1,dragHandleProps:o,className:c=""}=e,{t:d}=(0,j.ok)(),[m,u]=(0,i.useState)(!1),[h,p]=(0,i.useState)(!1),[f,b]=(0,i.useState)(null),g=(0,i.useCallback)(e=>{e.stopPropagation(),null==s||s(t)},[s,t]),v=(0,i.useCallback)(e=>{e.stopPropagation(),p(!0)},[]),N=(0,i.useCallback)(e=>{e.stopPropagation(),null==r||r(t.id),p(!1)},[r,t.id]),P=(0,i.useCallback)(e=>{e.stopPropagation(),p(!1)},[]),C=(0,i.useCallback)(()=>{h||null==l||l(t)},[l,t,h]);return(0,a.jsxs)("div",{className:"\n        relative bg-white rounded-xl border border-slate-200 overflow-hidden\n        transition-all duration-200\n        ".concat(n?"shadow-2xl ring-2 ring-emerald-500 scale-105":"hover:shadow-lg","\n        ").concat(l?"cursor-pointer":"","\n        ").concat(c,"\n      "),onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onClick:C,children:[(0,a.jsxs)("div",{className:"relative aspect-[4/3] bg-slate-100",children:[(()=>{var e,s;let r=[];t.after_image_url?r.push(t.after_image_url):(null==(e=t.after_images)?void 0:e[0])&&r.push(t.after_images[0]),t.before_image_url?r.push(t.before_image_url):(null==(s=t.before_images)?void 0:s[0])&&r.push(t.before_images[0]);let l=r[0],i=r.length;return(0,a.jsx)("div",{className:"absolute inset-0",children:"after"!==f&&l?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(x(),{src:l,alt:t.title,fill:!0,className:"object-cover",onError:()=>b("after")}),i>1&&(0,a.jsxs)("div",{className:"absolute bottom-2 right-2 px-2 py-1 bg-black/70 text-white text-xs font-medium rounded-lg flex items-center gap-1",children:[(0,a.jsx)(_,{size:12}),i]})]}):(0,a.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-slate-200",children:(0,a.jsx)(_,{size:48,className:"text-slate-400"})})})})(),(m||h)&&(s||r)&&(0,a.jsx)("div",{className:"absolute inset-0 bg-black/40 flex items-center justify-center gap-2 transition-opacity",children:h?(0,a.jsxs)("div",{className:"bg-white rounded-xl p-4 text-center max-w-[200px]",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-slate-900 mb-3",children:d("portfolio.deleteConfirm")}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:P,className:"flex-1 px-3 py-2 text-sm font-medium text-slate-600 bg-slate-100 rounded-lg hover:bg-slate-200 transition-colors",children:d("common.cancel")}),(0,a.jsx)("button",{type:"button",onClick:N,className:"flex-1 px-3 py-2 text-sm font-medium text-white bg-red-500 rounded-lg hover:bg-red-600 transition-colors",children:d("common.delete")})]})]}):(0,a.jsxs)(a.Fragment,{children:[s&&(0,a.jsx)("button",{type:"button",onClick:g,className:"p-3 bg-white rounded-full shadow-lg hover:bg-slate-50 transition-colors",title:d("portfolio.editProject"),children:(0,a.jsx)(w,{size:20,className:"text-slate-700"})}),r&&(0,a.jsx)("button",{type:"button",onClick:v,className:"p-3 bg-white rounded-full shadow-lg hover:bg-red-50 transition-colors",title:d("portfolio.deleteProject"),children:(0,a.jsx)(y,{size:20,className:"text-red-600"})})]})}),o&&(0,a.jsx)("div",{...o,className:"absolute top-2 left-2 p-1.5 bg-white/90 rounded-lg cursor-grab active:cursor-grabbing shadow-sm hover:bg-white transition-colors",onClick:e=>e.stopPropagation(),children:(0,a.jsx)(k,{size:16,className:"text-slate-500"})})]}),(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)("h4",{className:"font-semibold text-slate-900 truncate",children:t.title}),t.description&&(0,a.jsx)("p",{className:"mt-1 text-sm text-slate-500 line-clamp-2",children:t.description})]})]})}var z=s(97016);let S=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,a.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})},L=e=>{let{size:t=16,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})};function A(e){let{value:t=[],onChange:s,uploadFn:r,maxImages:l=5,label:n,helpText:o,disabled:c=!1,className:d=""}=e,{t:m}=(0,j.ok)(),[x,u]=(0,i.useState)(!1),h=t.length<l&&!c,p=(0,i.useCallback)(async e=>
1{if(!h)return{url:""};u(!0);try{let a=await r(e);return s([...t,a.url]),a}finally{u(!1)}},[h,s,r,t]),f=(0,i.useCallback)(e=>{s(t.filter((t,s)=>s!==e))},[s,t]);return(0,a.jsxs)("div",{className:d,children:[n&&(0,a.jsx)("label",{className:"block text-sm font-medium text-slate-700 mb-2",children:n}),(0,a.jsxs)("div",{className:"grid grid-cols-3 sm:grid-cols-5 gap-3",children:[t.map((e,t)=>(0,a.jsxs)("div",{className:"relative aspect-square rounded-lg overflow-hidden border-2 border-slate-200 group",children:[(0,a.jsx)("img",{src:e,alt:m("upload.photoAlt",{n:t+1}),className:"w-full h-full object-cover"}),!c&&(0,a.jsx)("button",{type:"button",onClick:()=>f(t),className:"absolute top-1 right-1 p-1.5 bg-red-500 text-white rounded-full opacity-0 group-hover:opacity-100 transition-opacity hover:bg-red-600",title:m("upload.remove"),children:(0,a.jsx)(L,{size:14})}),(0,a.jsx)("span",{className:"absolute bottom-1 left-1 px-1.5 py-0.5 bg-black/50 text-white text-xs rounded",children:t+1})]},"".concat(e,"-").concat(t))),h&&(0,a.jsxs)("div",{className:"aspect-square",children:[(0,a.jsx)(z.GA,{value:null,onUpload:e=>{s([...t,e])},uploadFn:p,placeholder:"",aspectRatio:"1/1",shape:"square",disabled:c||x,className:"h-full"}),0===t.length&&(0,a.jsx)("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)(S,{size:24,className:"mx-auto text-slate-400 mb-1"}),(0,a.jsx)("span",{className:"text-xs text-slate-500",children:m("upload.addPhoto")})]})})]}),t.length>0&&h&&(0,a.jsx)("div",{className:"col-span-full text-xs text-slate-400 mt-1",children:m("upload.photoCount",{current:t.length,max:l})})]}),o&&(0,a.jsx)("p",{className:"mt-2 text-xs text-slate-500",children:o})]})}let M=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})},T=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),(0,a.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,a.jsx)("polyline",{points:"21 15 16 10 5 21"})]})},E=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsx)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"})})};function B(e){let{initialData:t,onSubmit:s,onCancel:r,uploadFn:l,isSubmitting:n=!1,title:o,className:c=""}=e,{t:d}=(0,j.ok)(),[m,x]=(0,i.useState)({title:(null==t?void 0:t.title)||"",description:(null==t?void 0:t.description)||"",before_image_url:(null==t?void 0:t.before_image_url)||"",after_image_url:(null==t?void 0:t.after_image_url)||"",additional_images:(null==t?void 0:t.additional_images)||[]}),[u,h]=(0,i.useState)({}),[p,f]=(0,i.useState)(!1),[b,g]=(0,i.useState)(!1),v=o===d("portfolio.form.editTitle"),N=o||(v?d("portfolio.form.editTitle"):d("portfolio.form.addTitle")),w=(0,i.useCallback)(()=>{let e={},t=m.title.trim();return t?t.length<5?e.title=d("portfolio.form.titleMin"):t.length>100&&(e.title=d("portfolio.form.titleMax")):e.title=d("portfolio.form.titleRequired"),m.description&&m.description.length>500&&(e.description=d("portfolio.form.descMax")),m.after_image_url||(e.after_image_url=d("portfolio.form.afterRequired")),h(e),0===Object.keys(e).length},[m,d]),y=(0,i.useCallback)(async e=>{e.preventDefault(),w()&&await s(m)},[m,s,w]),k=(0,i.useCallback)(async e=>{f(!0);try{return await l(e)}finally{f(!1)}},[l]),_=(0,i.useCallback)(async e=>{g(!0);try{return await l(e)}finally{g(!1)}},[l]),P=p||b;return(0,a.jsxs)("form",{onSubmit:y,className:"space-y-6 ".concat(c),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-slate-900",children:N}),r&&(0,a.jsx)("button",{type:"button",onClick:r,className:"p-2 text-slate-400 hover:text-slate-600 rounded-lg hover:bg-slate-100 transition-colors",children:(0,a.jsx)(M,{size:20})})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"project-title",className:"block text-sm font-medium text-slate-700 mb-2",children:[d("portfolio.form.projectTitle")," ",(0,a.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,a.jsx)("input",{id:"project-title",type:"text",value:m.title,onChange:e=>{x(t=>({...t,title:e.target.value})),h(e=>({...e,title:""}))}
1,placeholder:d("portfolio.form.titlePlaceholder"),className:"\n            w-full px-4 py-3 rounded-xl border-2 transition-all\n            focus:outline-none focus:ring-2 focus:ring-emerald-500/20\n            ".concat(u.title?"border-red-300 focus:border-red-500":"border-slate-200 focus:border-emerald-500","\n          "),maxLength:100}),u.title&&(0,a.jsx)("p",{className:"mt-1 text-sm text-red-600",children:u.title}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-slate-500",children:[m.title.length,"/100"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{htmlFor:"project-description",className:"block text-sm font-medium text-slate-700 mb-2",children:[d("portfolio.form.description")," ",(0,a.jsx)("span",{className:"text-slate-400",children:d("common.optional")})]}),(0,a.jsx)("textarea",{id:"project-description",value:m.description||"",onChange:e=>{x(t=>({...t,description:e.target.value})),h(e=>({...e,description:""}))},placeholder:d("portfolio.form.descPlaceholder"),rows:3,className:"\n            w-full px-4 py-3 rounded-xl border-2 transition-all resize-none\n            focus:outline-none focus:ring-2 focus:ring-emerald-500/20\n            ".concat(u.description?"border-red-300 focus:border-red-500":"border-slate-200 focus:border-emerald-500","\n          "),maxLength:500}),u.description&&(0,a.jsx)("p",{className:"mt-1 text-sm text-red-600",children:u.description}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-slate-500",children:[(m.description||"").length,"/500"]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(T,{size:20,className:"text-slate-500"}),(0,a.jsx)("span",{className:"text-sm font-medium text-slate-700",children:d("portfolio.form.photos")})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,a.jsx)("div",{children:(0,a.jsx)(z.GA,{value:m.before_image_url||null,onUpload:e=>x(t=>({...t,before_image_url:e})),onRemove:()=>x(e=>({...e,before_image_url:""})),uploadFn:k,label:d("portfolio.form.before"),placeholder:d("portfolio.form.beforePlaceholder"),aspectRatio:"4/3",shape:"rectangle",helpText:d("portfolio.form.beforeHelp")})}),(0,a.jsxs)("div",{children:[(0,a.jsx)(z.GA,{value:m.after_image_url||null,onUpload:e=>{x(t=>({...t,after_image_url:e})),h(e=>({...e,after_image_url:""}))},onRemove:()=>x(e=>({...e,after_image_url:""})),uploadFn:_,label:(0,a.jsxs)(a.Fragment,{children:[d("portfolio.form.after")," ",(0,a.jsx)("span",{className:"text-red-500",children:"*"})]}),placeholder:d("portfolio.form.afterPlaceholder"),aspectRatio:"4/3",shape:"rectangle",helpText:d("portfolio.form.afterHelp")}),u.after_image_url&&(0,a.jsx)("p",{className:"mt-1 text-sm text-red-600",children:u.after_image_url})]})]}),(0,a.jsxs)("div",{className:"flex items-start gap-3 p-4 bg-amber-50 rounded-xl border border-amber-100",children:[(0,a.jsx)(E,{size:20,className:"text-amber-500 shrink-0 mt-0.5"}),(0,a.jsxs)("div",{className:"text-sm text-amber-800",children:[(0,a.jsx)("strong",{children:d("portfolio.form.tipLabel")})," ",d("portfolio.form.tipBody")]})]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(T,{size:20,className:"text-slate-500"}),(0,a.jsxs)("span",{className:"text-sm font-medium text-slate-700",children:[d("portfolio.form.additionalPhotos")," ",(0,a.jsx)("span",{className:"text-slate-400",children:d("common.optional")})]})]}),(0,a.jsx)(A,{value:m.additional_images||[],onChange:e=>x(t=>({...t,additional_images:e})),uploadFn:l,maxImages:5,helpText:d("portfolio.form.additionalHelp")})]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-3 pt-4 border-t border-slate-100",children:[r&&(0,a.jsx)("button",{type:"button",onClick:r,disabled:n||P,className:"px-5 py-2.5 text-slate-600 font-medium rounded-xl hover:bg-slate-100 transition-colors disabled:opacity-50",children:d("common.cancel")}),(0,a.jsx)("button",{type:"submit",disabled:n||P||!m.after_image_url,className:"\n            px-6 py-2.5 rounded-xl font-medium transition-all flex items-center gap-2\n            ".concat(n||P||!m.after_image_url?"bg-slate-200 text-slate-400 cursor-not-allowed":"bg-emerald-500 text-white hover:bg-emerald-600","\n          "),children:n?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),d("wizard.saving")]}):P?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),d("upload.uploading")]}):(0,a.jsx)(a.Fragment,{children:v?d("common.saveChanges"):d("portfolio.form.addTitle")})})]})]})}let F=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsx)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("polyline",{points:"15 18 9 12 15 6"})})},R=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsx)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("polyline",{points:"9 18 15 12 9 6"})})},D=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})};function W(e){let{images:t,initialIndex:s=0,onClose:r,className:l=""}=e,{t:n}=(0,j.ok)(),o=function(e){let t=[];for(let s of e)s.after_image_url&&t.push({url:s.after_image_url,projectId:s.id,projectTitle:s.title}),s.before_image_url&&t.push({url:s.before_image_url,projectId:s.id,projectTitle:s.title});return t}(t),[c,d]=(0,i.useState)(()=>{let e=0;for(let a=0;a<s&&a<t.length;a++)t[a].after_image_url&&e++,t[a].before_image_url&&e++;return e}),m=(0,i.useRef)(null),u=o[c],h=(0,i.useCallback)(()=>{d(e=>e>0?e-1:o.length-1)},[o.length]),p=(0,i.useCallback)(()=>{d(e=>e<o.length-1?e+1:0)},[o.length]);(0,i.useEffect)(()=>{let e=e=>{switch(e.key){case"ArrowLeft":h();break;case"ArrowRight":p();break;case"Escape":null==r||r()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[h,p,r]);let f=(0,i.useRef)(0),b=(0,i.useCallback)(e=>{f.current=e.touches[0].clientX},[]),g=(0,i.useCallback)(e=>{let t=e.changedTouches[0].clientX-f.current;Math.abs(t)>50&&(t>0?h():p())},[h,p]);return u?(0,a.jsxs)("div",{ref:m,className:"relative bg-black ".concat(l),onTouchStart:b,onTouchEnd:g,children:[r&&(0,a.jsx)("button",{type:"button",onClick:r,className:"absolute top-4 right-4 z-20 p-2 bg-black/50 rounded-full text-white hover:bg-black/70 transition-colors","aria-label":n("portfolio.closeGallery"),children:(0,a.jsx)(D,{size:24})}),(0,a.jsx)("div",{className:"relative w-full h-full flex items-center justify-center",children:(0,a.jsx)(x(),{src:u.url,alt:u.projectTitle,fill:!0,className:"object-contain",priority:!0})}),o.length>1&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",onClick:h,className:"absolute left-4 top-1/2 -translate-y-1/2 z-10 p-3 bg-black/50 rounded-full text-white hover:bg-black/70 transition-colors","aria-label":n("portfolio.prevImage"),children:(0,a.jsx)(F,{size:24})}),(0,a.jsx)("button",{type:"button",onClick:p,className:"absolute right-4 top-1/2 -translate-y-1/2 z-10 p-3 bg-black/50 rounded-full text-white hover:bg-black/70 transition-colors","aria-label":n("portfolio.nextImage"),children:(0,a.jsx)(R,{size:24})})]}),(0,a.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent p-6",children:[(0,a.jsx)("h3",{className:"text-white text-lg font-semibold",children:u.projectTitle}),o.length>1&&(0,a.jsx)("p",{className:"text-white/70 text-sm mt-1",children:n("portfolio.imageCount",{current:c+1,total:o.length})})]}),o.length>1&&o.length<=12&&(0,a.jsx)("div",{className:"absolute bottom-20 left-1/2 -translate-x-1/2 flex z-10 flex-wrap justify-center max-w-xs",children:o.map((e,t)=>(0,a.jsx)("button",{type:"button",onClick:()=>d(t),"aria-label":n("portfolio.goToImage",{n:t+1}),"aria-current":t===c||void 0,className:"group flex h-11 w-11 items-center justify-center",children:(0,a.jsx)("span",{className:"block w-3 h-3 rounded-full transition-all ".concat(t===c?"bg-white scale-125":"bg-white/50 group-hover:bg-white/75")})},t))})]}):(0,a.jsx)("div",{className:"relative w-full h-full flex items-center justify-center bg-slate-100",children:(0,a.jsx)("span",{className:"text-slate-400",children:n("portfolio.noImages")})})}function I(e){let{isOpen:t,onClose:s,...r}=e;return((0,i.useEffect)(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[t]),t)?(0,a.jsx)("div",{className:"fixed inset-0 z-50 bg-black/95",onClick:e=>{e.target===e.currentTarget&&(null==s||s())},children:(0,a.jsx)(W,{...r,onClose:s,className:"w-full h-full"})}):null}var H=s(17365),q=s(74221);let O=e=>{let{size:t=20,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,a.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})},V=e=>{let{size:t=48,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),(0,a.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,a.jsx)("polyline",{points:"21 15 16 10 5 21"})]})},K=e=>{let{size:t=20,className:s=""}=e;return(0,a.jsxs)("svg",{className:"animate-spin ".concat(s),width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})};function Z(e){let{projects:t=[],onProjectsChange:s,maxProjects:r=20,className:l=""}=e,{t:n}=(0,j.ok)(),[o,c]=(0,i.useState)(t),[d]=(0,i.useState)(!1),[m,x]=(0,i.useState)(null),[u,h]=(0,i.useState)(!1),[p,f]=(0,i.useState)(null),[b,g]=(0,i.useState)(!1),[v,N]=(0,i.useState)(!1),[w,y]=(0,i.useState)(0),[k,_]=(0,i.useState)(null),z=(0,i.useRef)(!1),S=(0,i.useRef)(t.length);(0,i.useEffect)(()=>{let e=t.length>S.current;(!z.current||e)&&(c(t),z.current=!1),S.current=t.length},[t]),(0,i.useEffect)(()=>{null==s||s(o)},[o,s]);let L=(0,i.useCallback)(async e=>{let t=new FormData;t.append("file",e),t.append("upload_type","portfolio");let s=(0,q.iD)(),a=await fetch("".concat(q.H$,"/api/upload"),{method:"POST",body:t,headers:{...s&&{Authorization:"Bearer ".concat(s)}}});if(!a.ok)throw Error(n("portfolio.uploadFailed"));return a.json()},[n]),A=(0,i.useCallback)(async e=>{g(!0),x(null);
1try{let t=await H.W7.addPortfolioProject({title:e.title,description:e.description,before_image_url:e.before_image_url,after_image_url:e.after_image_url||""}),s=P(t);z.current=!0,c(e=>[...e,s]),h(!1)}catch(e){console.error("Failed to add project:",e),x(e instanceof Error?e.message:n("portfolio.addFailed"))}finally{g(!1)}},[n]),M=(0,i.useCallback)(async e=>{if(p){g(!0),x(null);try{let t=await H.W7.updatePortfolioProject(p.id,{title:e.title,description:e.description,before_image_url:e.before_image_url,after_image_url:e.after_image_url}),s=P(t);z.current=!0,c(e=>e.map(e=>e.id===p.id?s:e)),f(null),h(!1)}catch(e){console.error("Failed to update project:",e),x(e instanceof Error?e.message:n("portfolio.updateFailed"))}finally{g(!1)}}},[p,n]),T=(0,i.useCallback)(async e=>{try{await H.W7.deletePortfolioProject(e),z.current=!0,c(t=>t.filter(t=>t.id!==e))}catch(e){console.error("Failed to delete project:",e),x(e instanceof Error?e.message:n("portfolio.deleteFailed"))}},[n]),E=(0,i.useCallback)(e=>{f(e),h(!0)},[]),F=(0,i.useCallback)(e=>{let t=o.findIndex(t=>t.id===e.id);t>=0&&(y(t),N(!0))},[o]),R=(0,i.useCallback)(()=>{h(!1),f(null),x(null)},[]),D=(0,i.useCallback)(e=>{_(e)},[]),W=(0,i.useCallback)((e,t)=>{if(e.preventDefault(),null===k||k===t)return;let s=[...o],[a]=s.splice(k,1);s.splice(t,0,a),z.current=!0,c(s),_(t)},[k,o]),Z=(0,i.useCallback)(async()=>{if(null!==k){try{let e=o.map((e,t)=>({id:e.id,display_order:t}));await H.W7.reorderPortfolioProjects(e)}catch(e){console.error("Failed to save order:",e),z.current=!1,c(t)}_(null)}},[k,o,t]),U=o.length<r;return(0,a.jsxs)("div",{className:l,children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-slate-900",children:n("portfolio.title")}),(0,a.jsx)("p",{className:"text-sm text-slate-500",children:n("portfolio.projectCount",{current:o.length,max:r})})]}),U&&!u&&(0,a.jsxs)("button",{type:"button",onClick:()=>h(!0),className:"flex items-center gap-2 px-4 py-2 bg-emerald-500 text-white rounded-xl font-medium hover:bg-emerald-600 transition-colors",children:[(0,a.jsx)(O,{size:18}),n("portfolio.form.addTitle")]})]}),m&&(0,a.jsxs)("div",{className:"mb-4 p-4 bg-red-50 border border-red-100 rounded-xl text-red-700 text-sm",children:[m,(0,a.jsx)("button",{type:"button",onClick:()=>x(null),className:"ml-2 underline hover:no-underline",children:n("common.dismiss")})]}),u&&(0,a.jsx)("div",{className:"mb-6 p-6 bg-slate-50 rounded-xl border border-slate-200",children:(0,a.jsx)(B,{initialData:p?{title:p.title,description:p.description,before_image_url:p.before_image_url,after_image_url:p.after_image_url}:void 0,onSubmit:p?M:A,onCancel:R,uploadFn:L,isSubmitting:b,title:p?n("portfolio.form.editTitle"):n("portfolio.form.addTitle")})}),d?(0,a.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,a.jsx)(K,{size:32,className:"text-emerald-500"})}):o.length>0?(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:o.map((e,t)=>(0,a.jsx)("div",{draggable:!0,onDragStart:()=>D(t),onDragOver:e=>W(e,t),onDragEnd:Z,className:"\n                transition-transform duration-200\n                ".concat(k===t?"opacity-50":"","\n              "),children:(0,a.jsx)(C,{project:e,onEdit:E,onDelete:T,onClick:F,isDragging:k===t,dragHandleProps:{onMouseDown:()=>{}}})},e.id))}):(0,a.jsxs)("div",{className:"text-center py-12 px-6 bg-slate-50 rounded-xl border-2 border-dashed border-slate-200",children:[(0,a.jsx)(V,{size:64,className:"mx-auto text-slate-300 mb-4"}),(0,a.jsx)("h4",{className:"text-lg font-medium text-slate-700 mb-2",children:n("portfolio.emptyTitle")}),(0,a.jsx)("p",{className:"text-slate-500 mb-6 max-w-md mx-auto",children:n("portfolio.emptyBody")}),U&&!u&&(0,a.jsxs)("button",{type:"button",onClick:()=>h(!0),className:"inline-flex items-center gap-2 px-6 py-3 bg-emerald-500 text-white rounded-xl font-medium hover:bg-emerald-600 transition-colors",children:[(0,a.jsx)(O,{size:20}),n("portfolio.addFirst")]})]}),(0,a.jsx)(I,{isOpen:v,onClose:()=>N(!1),images:o.map(e=>({id:e.id,title:e.title,before_image_url:e.before_image_url,after_image_url:e.after_image_url})),initialIndex:w})]})}var U=s(49381);let G={google:"\uD83D\uDD0D",yelp:"\uD83D\uDCCD",manual:"✍️"};var Y=s(40170);let X="/api/v1/marketplace/reviews",$={importGoogleReviews:async e=>(await q.Ay.post("".concat(X,"/import/google"),e)).data,getMyReviews:async e=>{let t={};return(null==e?void 0:e.source)&&"all"!==e.source&&(t.source=e.source),(null==e?void 0:e.min_rating)&&(t.min_rating=e.min_rating),(null==e?void 0:e.visible_only)!==void 0&&(t.visible_only=e.visible_only),(await q.Ay.get(X,{params:t})).data},getReviewStats:async()=>(await q.Ay.get("".concat(X,"/stats"))).data,updateReview:async(e,t)=>(await q.Ay.patch("".concat(X,"/").concat(e),t)).data,hideReview:async e=>$.updateReview(e,{is_visible:!1}),showReview:async e=>$.updateReview(e,{is_visible:!0}),respondToReview:async(e,t)=>$.updateReview(e,{response_text:t}),getPublicReviews:async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;return(await q.Ay.get("/api/v1/marketplace/contractors/".concat(e,"/reviews"),{params:{limit:t}})).data},createManualReview:async e=>(await q.Ay.post(X,{...e,source_platform:"manual"})).data,deleteReview:async e=>{await q.Ay.delete("".concat(X,"/").concat(e))},syncGoogleReviews:async(e,t)=>(await q.Ay.post("".concat(X,"/sync/google"),{google_access_token:t,location_id:e})).data};function J(e){return e.toFixed(1)}let Q=e=>{let{size:t=16,className:s="",filled:r=!1}=e;return(0,a.jsx)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:r?"currentColor":"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})})},ee=e=>{let{size:t=16,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),(0,a.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})},et=e=>{let{size:t=16,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),(0,a.jsx)("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]})},es=e=>{let{size:t=16,className:s=""}=e;return(0,a.jsx)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})},ea=e=>{let{size:t=16,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,a.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})};function er(e){let{rating:t,size:s=16}=e;return(0,a.jsx)("div",{className:"flex items-center gap-0.5",children:[1,2,3,4,5].map(e=>(0,a.jsx)(Q,{size:s,filled:e<=t,className:e<=t?"text-amber-400":"text-slate-200"},e))})}function el(e){let{source:t}=e,{t:s}=(0,j.ok)();return(0,a.jsxs)("span",{className:"\n        inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border\n        ".concat({google:"bg-blue-50 text-blue-700 border-blue-200",yelp:"bg-red-50 text-red-700 border-red-200",manual:"bg-slate-50 text-slate-700 border-slate-200"}[t],"\n      "),children:[(0,a.jsx)("span",{children:G[t]}),(0,a.jsx)("span",{children:s("reviews.sources.".concat(t))})]})}function ei(e){var t;let{review:s,onToggleVisibility:r,onRespond:l,onDelete:n,isLoading:o=!1,compact:c=!1,className:d=""}=e,{t:m,locale:x}=(0,j.ok)(),[u,h]=(0,i.useState)(!1),p=(0,i.useCallback)(async()=>
1{if(r&&!u){h(!0);try{await r(s.id,!s.is_visible)}finally{h(!1)}}},[r,s.id,s.is_visible,u]),f="manual"===s.source_platform;return(0,a.jsx)("div",{className:"\n        bg-white rounded-xl border transition-all\n        ".concat(s.is_visible?"border-slate-200":"border-slate-200 bg-slate-50 opacity-75","\n        ").concat(d,"\n      "),children:(0,a.jsxs)("div",{className:"p-4 ".concat(c?"space-y-2":"space-y-3"),children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[s.reviewer_photo_url?(0,a.jsx)("img",{src:s.reviewer_photo_url,alt:s.reviewer_name,className:"w-10 h-10 rounded-full object-cover shrink-0"}):(0,a.jsx)("div",{className:"w-10 h-10 rounded-full bg-slate-100 flex items-center justify-center shrink-0",children:(0,a.jsx)("span",{className:"text-lg font-medium text-slate-500",children:s.reviewer_name.charAt(0).toUpperCase()})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h4",{className:"font-medium text-slate-900 truncate",children:s.reviewer_name}),(0,a.jsxs)("div",{className:"flex items-center gap-2 text-xs text-slate-500",children:[(0,a.jsx)("span",{title:(t=s.review_date,new Date(t).toLocaleDateString(x?(0,Y.gA)(x):"en-US",{month:"short",day:"numeric",year:"numeric"})),children:function(e,t){let s=new Date(e),a=Math.floor((new Date().getTime()-s.getTime())/864e5),r=(e,s,a)=>t?t(e,{count:a}):s.replace("{count}",String(a));return 0===a?t?t("reviews.rel.today"):"today":1===a?t?t("reviews.rel.yesterday"):"yesterday":a<7?r("reviews.rel.daysAgo","{count} days ago",a):a<30?r("reviews.rel.weeksAgo","{count} weeks ago",Math.floor(a/7)):a<365?r("reviews.rel.monthsAgo","{count} months ago",Math.floor(a/30)):r("reviews.rel.yearsAgo","{count} years ago",Math.floor(a/365))}(s.review_date,m)}),(0,a.jsx)(el,{source:s.source_platform})]})]})]}),(0,a.jsx)(er,{rating:s.rating,size:c?14:16})]}),s.review_text&&(0,a.jsx)("p",{className:"text-slate-600 ".concat(c?"text-sm line-clamp-2":"text-sm"),children:s.review_text}),s.response_text&&(0,a.jsxs)("div",{className:"bg-slate-50 rounded-lg p-3 border-l-2 border-emerald-500",children:[(0,a.jsx)("p",{className:"text-xs text-slate-500 mb-1 font-medium",children:m("reviews.yourResponse")}),(0,a.jsx)("p",{className:"text-sm text-slate-700",children:s.response_text})]}),!s.is_visible&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-slate-500",children:[(0,a.jsx)(et,{size:14}),(0,a.jsx)("span",{children:m("reviews.hiddenFromProfile")})]}),(r||l||n)&&(0,a.jsxs)("div",{className:"flex items-center gap-2 pt-2 border-t border-slate-100",children:[r&&(0,a.jsx)("button",{type:"button",onClick:p,disabled:o||u,className:"\n                  flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium\n                  transition-colors disabled:opacity-50\n                  ".concat(s.is_visible?"text-slate-600 hover:bg-slate-100":"text-emerald-600 hover:bg-emerald-50","\n                "),children:s.is_visible?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(et,{size:14}),m("reviews.hide")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ee,{size:14}),m("reviews.show")]})}),l&&!s.response_text&&(0,a.jsxs)("button",{type:"button",onClick:()=>l(s.id),disabled:o,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium text-slate-600 hover:bg-slate-100 transition-colors disabled:opacity-50",children:[(0,a.jsx)(es,{size:14}),m("reviews.respond")]}),n&&f&&(0,a.jsxs)("button",{type:"button",onClick:()=>n(s.id),disabled:o,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium text-red-600 hover:bg-red-50 transition-colors disabled:opacity-50 ml-auto",children:[(0,a.jsx)(ea,{size:14}),m("common.delete")]})]})]})})}let en=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsx)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",strokeWidth:"1",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})})};function eo(e){let{rating:t,count:s,total:r}=e,l=r>0?s/r*100:0;return(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,a.jsx)("span",{className:"w-3 text-slate-600 text-right",children:t}),(0,a.jsx)(en,{size:14,className:"text-amber-400 shrink-0"}),(0,a.jsx)("div",{className:"flex-1 h-2 bg-slate-100 rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-amber-400 rounded-full transition-all duration-500",style:{width:"".concat(l,"%")}})}),(0,a.jsx)("span",{className:"w-8 text-slate-500 text-right",children:s})]})}function ec(e){let{source:t,count:s}=e,{t:r}=(0,j.ok)();return(0,a.jsxs)("div",{className:"\n        flex items-center gap-2 px-3 py-2 rounded-xl\n        ".concat({google:"bg-blue-50 text-blue-700",yelp:"bg-red-50 text-red-700",manual:"bg-slate-100 text-slate-700"}[t],"\n      "),children:[(0,a.jsx)("span",{className:"text-lg",children:G[t]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-semibold",children:s}),(0,a.jsx)("p",{className:"text-xs opacity-75",children:r("reviews.sources.".concat(t))})]})]})}function ed(e){let{stats:t,compact:s=!1,className:r=""}=e,{t:l}=(0,j.ok)(),{average_rating:i,total_reviews:n,visible_reviews:o,rating_distribution:c,sources:d}=t,m=[5,4,3,2,1].map(e=>({rating:e,count:(null==c?void 0:c[e.toString()])||0}));return 0===n?(0,a.jsxs)("div",{className:"text-center py-8 ".concat(r),children:[(0,a.jsx)("div",{className:"w-16 h-16 mx-auto mb-4 rounded-full bg-slate-100 flex items-center justify-center",children:(0,a.jsx)(en,{size:32,className:"text-slate-300"})}),(0,a.jsx)("h3",{className:"text-lg font-medium text-slate-700 mb-1",children:l("reviews.statsEmptyTitle")}),(0,a.jsx)("p",{className:"text-sm text-slate-500",children:l("reviews.statsEmptyBody")})]}):s?(0,a.jsxs)("div",{className:"flex items-center gap-4 ".concat(r),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(en,{size:24,className:"text-amber-400"}),(0,a.jsx)("span",{className:"text-2xl font-bold text-slate-900",children:J(i)})]}),(0,a.jsx)("div",{className:"text-sm text-slate-500",children:l(1===o?"reviews.reviewCountOne":"reviews.reviewCount",{count:o})})]}):(0,a.jsx)("div",{className:"bg-white rounded-xl border border-slate-200 p-6 ".concat(r),children:(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[(0,a.jsxs)("div",{className:"text-center md:text-left",children:[(0,a.jsxs)("div",{className:"flex items-center justify-center md:justify-start gap-3 mb-2",children:[(0,a.jsx)("span",{className:"text-5xl font-bold text-slate-900",children:J(i)}),(0,a.jsx)(en,{size:40,className:"text-amber-400"})]}),(0,a.jsx)("p",{className:"text-slate-500",children:l(1===o?"reviews.basedOnOne":"reviews.basedOn",{count:o})}),o!==n&&(0,a.jsx)("p",{className:"text-xs text-slate-400 mt-1",children:l("reviews.hiddenCount",{count:n-o})})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-sm font-medium text-slate-700 mb-3",children:l("reviews.ratingDistribution")}),m.map(e=>{let{rating:t,count:s}=e;return(0,a.jsx)(eo,{rating:t,count:s,total:o},t)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"text-sm font-medium text-slate-700 mb-3",children:l("reviews.reviewSources")}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:Object.entries(d).map(e=>{let[t,s]=e;return(0,a.jsx)(ec,{source:t,count:s},t)}
1)})]})]})})}let em=e=>{let{size:t=20,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,a.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})},ex=e=>{let{size:t=20,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("polyline",{points:"23 4 23 10 17 10"}),(0,a.jsx)("polyline",{points:"1 20 1 14 7 14"}),(0,a.jsx)("path",{d:"M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"})]})},eu=e=>{let{size:t=20,className:s=""}=e;return(0,a.jsx)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})})},eh=e=>{let{size:t=20,className:s=""}=e;return(0,a.jsxs)("svg",{className:"animate-spin ".concat(s),width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})},ep=e=>{let{size:t=20,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})};function ef(e){let{initialReviews:t=[],initialStats:s,className:r=""}=e,{t:l}=(0,j.ok)(),[n,o]=(0,i.useState)(t),[c,d]=(0,i.useState)(s||null),[m,x]=(0,i.useState)(!t.length),[u,h]=(0,i.useState)(null),[p,f]=(0,i.useState)(null),[b,g]=(0,i.useState)(""),[v,N]=(0,i.useState)({status:"idle"}),[w,y]=(0,i.useState)("all"),[k,_]=(0,i.useState)(!0),[P,C]=(0,i.useState)(!1),[z,S]=(0,i.useState)({reviewer_name:"",rating:5,review_text:""});(0,i.useEffect)(()=>{t.length||L()},[t.length]);let L=(0,i.useCallback)(async()=>{x(!0),h(null);try{let e=await $.getMyReviews();o(e.reviews),d(e.stats)}catch(e){console.error("Failed to load reviews:",e),h(e instanceof Error?e.message:l("reviews.loadFailed"))}finally{x(!1)}},[l]),A=(0,i.useCallback)(e=>{f(e),N({status:"idle",message:l("reviews.googleConnected")})},[l]),M=(0,i.useCallback)(async()=>{if(p&&b){N({status:"importing",message:l("reviews.importing"),progress:0});try{let e=await $.importGoogleReviews({google_access_token:p.accessToken,location_id:b});N({status:"complete",message:l("reviews.importedCount",{count:e.imported_count}),importedReviews:e.imported_count}),await L()}catch(e){console.error("Failed to import reviews:",e),N({status:"error",error:e instanceof Error?e.message:l("reviews.importFailed")})}}},[p,b,L,l]),T=(0,i.useCallback)(async(e,t)=>{try{let s=await $.updateReview(e,{is_visible:t});o(t=>t.map(t=>t.id===e?s:t));let a=await $.getReviewStats();d(a)}catch(e){throw console.error("Failed to update review:",e),e}},[]),E=(0,i.useCallback)(async e=>{if(confirm(l("reviews.deleteConfirm")))try{await $.deleteReview(e),o(t=>t.filter(t=>t.id!==e));let t=await $.getReviewStats();d(t)}catch(e){console.error("Failed to delete review:",e),h(e instanceof Error?e.message:l("reviews.deleteFailed"))}},[l]),B=(0,i.useCallback)(async()=>{if(z.reviewer_name.trim())try{let e=await $.createManualReview({reviewer_name:z.reviewer_name,rating:z.rating,review_text:z.review_text||void 0,review_date:new Date().toISOString()});o(t=>[e,...t]),C(!1),S({reviewer_name:"",rating:5,review_text:""});let t=await $.getReviewStats();d(t)}catch(e){console.error("Failed to add manual review:",e),h(e instanceof Error?e.message:l("reviews.addFailed"))}},[z,l]),F=n.filter(e=>("all"===w||e.source_platform===w)&&(!!k||!!e.is_visible));return(0,a.jsxs)("div",{className:r,children:[c&&(0,a.jsx)(ed,{stats:c,className:"mb-6"}),(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-slate-200 p-6 mb-6",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-slate-900 mb-4",children:l("reviews.importTitle")}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,a.jsx)(U.L,{onSuccess:A,onError:e=>h(e),isConnected:!!p}),p&&(0,a.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-[200px]",children:[(0,a.jsx)("input",{type:"text",value:b,onChange:e=>g(e.target.value),placeholder:l("reviews.placeIdPlaceholder"),className:"flex-1 px-4 py-2 rounded-lg border border-slate-300 focus:border-emerald-500 focus:ring-2 focus:ring-emerald-500/20 outline-none"}),(0,a.jsx)("button",{type:"button",onClick:M,disabled:!b||"importing"===v.status,className:"px-4 py-2 bg-emerald-500 text-white rounded-lg font-medium hover:bg-emerald-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"importing"===v.status?(0,a.jsx)(eh,{size:20}):l("reviews.import")})]})]}),"idle"!==v.status&&(0,a.jsx)("div",{className:"\n                p-4 rounded-lg text-sm\n                ".concat("complete"===v.status?"bg-emerald-50 text-emerald-700":"","\n                ").concat("error"===v.status?"bg-red-50 text-red-700":"","\n                ").concat("importing"===v.status?"bg-blue-50 text-blue-700":"","\n              "),children:v.message||v.error})]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(eu,{size:16,className:"text-slate-400"}),(0,a.jsxs)("select",{value:w,onChange:e=>y(e.target.value),className:"text-sm border border-slate-200 rounded-lg px-3 py-1.5 focus:border-emerald-500 outline-none",children:[(0,a.jsx)("option",{value:"all",children:l("reviews.allSources")}),(0,a.jsx)("option",{value:"google",children:"Google"}),(0,a.jsx)("option",{value:"yelp",children:"Yelp"}),(0,a.jsx)("option",{value:"manual",children:"Manual"})]})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 text-sm text-slate-600 cursor-pointer",children:[(0,a.jsx)("input",{type:"checkbox",checked:k,onChange:e=>_(e.target.checked),className:"rounded border-slate-300 text-emerald-500 focus:ring-emerald-500"}),l("reviews.showHidden")]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)("button",{type:"button",onClick:L,disabled:m,className:"flex items-center gap-2 px-3 py-2 text-sm text-slate-600 hover:bg-slate-100 rounded-lg transition-colors disabled:opacity-50",children:[(0,a.jsx)(ex,{size:16,className:m?"animate-spin":""}),l("reviews.refresh")]}),(0,a.jsxs)("button",{type:"button",onClick:()=>C(!0),className:"flex items-center gap-2 px-4 py-2 bg-emerald-500 text-white rounded-lg font-medium hover:bg-emerald-600 transition-colors",children:[(0,a.jsx)(em,{size:16}),l("reviews.addReview")]})]})]}),u&&(0,a.jsxs)("div",{className:"mb-4 p-4 bg-red-50 border border-red-100 rounded-xl text-red-700 text-sm",children:[u,(0,a.jsx)("button",{type:"button",onClick:()=>h(null),className:"ml-2 underline hover:no-underline",children:l("common.dismiss")})]}),P&&(0,a.jsxs)("div",{className:"mb-4 p-4 bg-slate-50 rounded-xl border border-slate-200",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h4",{className:"font-medium text-slate-900",children:l("reviews.addManualTitle")}),(0,a.jsx)("button",{type:"button",onClick:()=>C(!1),className:"p-1 text-slate-400 hover:text-slate-600 rounded",children:(0,a.jsx)(ep,{size:20})})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:[l("reviews.reviewerName")," *"]}),(0,a.jsx)("input",{type:"text",value:z.reviewer_name,onChange:e=>S(t=>({...t,reviewer_name:e.target.value})),className:"w-full px-4 py-2 rounded-lg border border-slate-300 focus:border-emerald-500 focus:ring-2 focus:ring-emerald-500/20 outline-none",placeholder:l("reviews.reviewerPlaceholder")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:l("reviews.rating")}),(0,a.jsx)("div",{className:"flex gap-1",children:[1,2,3,4,5].map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>S(t=>({...t,rating:e})),className:"p-1 ".concat(e<=z.rating?"text-amber-400":"text-slate-200"),children:(0,a.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"
1currentColor",children:(0,a.jsx)("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})})},e))})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:l("reviews.reviewText")}),(0,a.jsx)("textarea",{value:z.review_text,onChange:e=>S(t=>({...t,review_text:e.target.value})),rows:3,className:"w-full px-4 py-2 rounded-lg border border-slate-300 focus:border-emerald-500 focus:ring-2 focus:ring-emerald-500/20 outline-none resize-none",placeholder:l("reviews.reviewTextPlaceholder")})]}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>C(!1),className:"px-4 py-2 text-slate-600 hover:bg-slate-100 rounded-lg transition-colors",children:l("common.cancel")}),(0,a.jsx)("button",{type:"button",onClick:B,disabled:!z.reviewer_name.trim(),className:"px-4 py-2 bg-emerald-500 text-white rounded-lg font-medium hover:bg-emerald-600 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:l("reviews.addReview")})]})]})]}),m?(0,a.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,a.jsx)(eh,{size:32,className:"text-emerald-500"})}):F.length>0?(0,a.jsx)("div",{className:"space-y-4",children:F.map(e=>(0,a.jsx)(ei,{review:e,onToggleVisibility:T,onDelete:E},e.id))}):(0,a.jsx)("div",{className:"text-center py-12 bg-slate-50 rounded-xl border-2 border-dashed border-slate-200",children:(0,a.jsx)("p",{className:"text-slate-500",children:0===n.length?l("reviews.emptyNone"):l("reviews.emptyFiltered")})})]})}let eb=e=>{let{size:t=20,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"}),(0,a.jsx)("circle",{cx:"12",cy:"10",r:"3"})]})},eg=e=>{let{size:t=20,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("line",{x1:"12",x2:"12",y1:"5",y2:"19"}),(0,a.jsx)("line",{x1:"5",x2:"19",y1:"12",y2:"12"})]})},ej=e=>{let{size:t=16,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,a.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})},ev=e=>{let{size:t=16,className:s=""}=e;return(0,a.jsxs)("svg",{className:"animate-spin ".concat(s),width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})},eN=["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"];function ew(e){let{area:t,onRemove:s,disabled:r,isRemoving:l}=e,{t:i}=(0,j.ok)();return(0,a.jsxs)("div",{className:"\n        inline-flex items-center gap-2 px-3 py-1.5 rounded-full\n        bg-emerald-50 text-emerald-800 border border-emerald-200\n        ".concat(r?"opacity-50":"","\n      "),children:[(0,a.jsx)("span",{className:"text-xs font-medium uppercase text-emerald-600",children:(()=>{switch(t.area_type){case"zip_code":return i("serviceAreas.typeZip");case"city":return i("serviceAreas.typeCity");case"radius":return i("serviceAreas.typeRadius");default:return t.area_type}})()}),(0,a.jsx)("span",{className:"font-medium",children:(()=>{switch(t.area_type){case"zip_code":default:return t.area_value;case"city":return"".concat(t.area_value,", ").concat(t.state_code);case"radius":return i("serviceAreas.miRadius",{miles:t.travel_radius_miles||25})}})()}),!r&&(0,a.jsx)("button",{type:"button",onClick:s,disabled:l,className:"p-1.5 -mr-1 hover:bg-emerald-200 active:bg-emerald-300 rounded-full transition-colors touch-manipulation min-w-[32px] min-h-[32px] flex items-center justify-center",title:i("serviceAreas.removeArea"),children:l?(0,a.jsx)(ev,{size:14,className:"text-emerald-600"}):(0,a.jsx)(ej,{size:14,className:"text-emerald-600"})})]})}function ey(e){let{serviceAreas:t,onAdd:s,onRemove:r,businessLocation:l,disabled:n=!1,className:o=""}=e,{t:c}=(0,j.ok)(),[d,m]=(0,i.useState)("zip_code"),[x,u]=(0,i.useState)(""),[h,p]=(0,i.useState)("CA"),[f,b]=(0,i.useState)(""),[g,v]=(0,i.useState)(""),[N,w]=(0,i.useState)(25),[y,k]=(0,i.useState)(!1),[_,P]=(0,i.useState)(null),[C,z]=(0,i.useState)(null),S=(0,i.useRef)(null);(0,i.useEffect)(()=>{S.current&&S.current.focus()},[d]);let L=(0,i.useCallback)(async()=>
1{if(z(null),"zip_code"===d){if(!/^\d{5}(-\d{4})?$/.test(x.trim()))return void z(c("serviceAreas.zipInvalid"));if(t.some(e=>"zip_code"===e.area_type&&e.area_value===x.trim()))return void z(c("serviceAreas.zipDuplicate"))}else if("city"===d){if(!f.trim())return void z(c("serviceAreas.cityRequired"));if(!g)return void z(c("serviceAreas.stateRequired"))}else if("radius"===d&&!(null==l?void 0:l.zip_code))return void z(c("serviceAreas.locationRequired"));k(!0);try{let e={area_type:d,area_value:"zip_code"===d?x.trim():"city"===d?f.trim():(null==l?void 0:l.zip_code)||"",state_code:"zip_code"===d?h:"city"===d?g:"radius"===d&&(null==l?void 0:l.state)?l.state:"CA",travel_radius_miles:"radius"===d?N:void 0,is_include:!0};await s(e),u(""),b(""),v(""),w(25)}catch(e){console.error("Failed to add service area:",e),z(e instanceof Error?e.message:c("serviceAreas.addFailed"))}finally{k(!1)}},[d,x,f,g,N,l,t,s,c]),A=(0,i.useCallback)(async e=>{P(e);try{await r(e)}catch(e){console.error("Failed to remove service area:",e),z(e instanceof Error?e.message:c("serviceAreas.removeFailed"))}finally{P(null)}},[r,c]),M=(0,i.useCallback)(e=>{"Enter"===e.key&&(e.preventDefault(),L())},[L]);return(0,a.jsxs)("div",{className:"space-y-4 ".concat(o),children:[(0,a.jsxs)("h3",{className:"text-lg font-semibold text-slate-900 flex items-center gap-2",children:[(0,a.jsx)(eb,{size:20,className:"text-emerald-600"}),c("serviceAreas.title")]}),(0,a.jsx)("p",{className:"text-sm text-slate-500",children:c("serviceAreas.subtitle")}),t.length>0&&(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:t.map(e=>(0,a.jsx)(ew,{area:e,onRemove:()=>A(e.id),disabled:n,isRemoving:_===e.id},e.id))}),!n&&(0,a.jsxs)("div",{className:"bg-slate-50 rounded-xl p-4 space-y-4",children:[(0,a.jsx)("div",{className:"flex gap-2",children:["zip_code","city","radius"].map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>{m(e),z(null)},className:"\n                  px-4 py-3 sm:py-2 rounded-lg text-sm font-medium transition-colors touch-manipulation\n                  min-h-[44px] sm:min-h-0\n                  ".concat(d===e?"bg-emerald-600 text-white":"bg-white border border-slate-200 text-slate-700 hover:bg-slate-100 active:bg-slate-200","\n                "),children:"zip_code"===e?c("serviceAreas.typeZipCode"):"city"===e?c("serviceAreas.typeCity"):c("serviceAreas.typeRadius")},e))}),(0,a.jsxs)("div",{className:"space-y-3",children:["zip_code"===d&&(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,a.jsx)("input",{ref:S,type:"text",value:x,onChange:e=>u(e.target.value),onKeyDown:M,placeholder:c("serviceAreas.zipPlaceholder"),maxLength:10,className:"\n                    flex-1 px-4 py-2 rounded-lg border transition-colors\n                    focus:outline-none focus:ring-2 focus:ring-emerald-500/20\n                    ".concat(C?"border-red-300":"border-slate-200 focus:border-emerald-500","\n                  ")}),(0,a.jsx)("select",{value:h,onChange:e=>p(e.target.value),className:"px-4 py-2 rounded-lg border border-slate-200 focus:outline-none focus:ring-2 focus:ring-emerald-500/20 focus:border-emerald-500",children:eN.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}),(0,a.jsxs)("button",{type:"button",onClick:L,disabled:y,className:"px-4 py-3 sm:py-2 bg-emerald-600 text-white rounded-lg font-medium hover:bg-emerald-700 active:bg-emerald-800 disabled:opacity-50 transition-colors flex items-center gap-2 touch-manipulation min-h-[44px] sm:min-h-0",children:[y?(0,a.jsx)(ev,{size:16}):(0,a.jsx)(eg,{size:16}),c("common.add")]})]}),"city"===d&&(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,a.jsx)("input",{ref:S,type:"text",value:f,onChange:e=>b(e.target.value),onKeyDown:M,placeholder:c("serviceAreas.cityPlaceholder"),className:"\n                    flex-1 px-4 py-2 rounded-lg border transition-colors\n                    focus:outline-none focus:ring-2 focus:ring-emerald-500/20\n                    ".concat(C?"border-red-300":"border-slate-200 focus:border-emerald-500","\n                  ")}),(0,a.jsxs)("select",{value:g,onChange:e=>v(e.target.value),className:"px-4 py-2 rounded-lg border border-slate-200 focus:outline-none focus:ring-2 focus:ring-emerald-500/20 focus:border-emerald-500",children:[(0,a.jsx)("option",{value:"",children:c("serviceAreas.state")}),eN.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]}),(0,a.jsxs)("button",{type:"button",onClick:L,disabled:y,className:"px-4 py-3 sm:py-2 bg-emerald-600 text-white rounded-lg font-medium hover:bg-emerald-700 active:bg-emerald-800 disabled:opacity-50 transition-colors flex items-center gap-2 touch-manipulation min-h-[44px] sm:min-h-0",children:[y?(0,a.jsx)(ev,{size:16}):(0,a.jsx)(eg,{size:16}),c("common.add")]})]}),"radius"===d&&(0,a.jsx)("div",{className:"space-y-4",children:(null==l?void 0:l.zip_code)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-slate-600",children:[(0,a.jsx)(eb,{size:16}),(0,a.jsxs)("span",{children:[c("serviceAreas.basedOn")," ",l.city||""," ",l.state||""," ",l.zip_code]})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex justify-between text-sm",children:[(0,a.jsx)("span",{className:"text-slate-600",children:c("serviceAreas.travelRadius")}),(0,a.jsx)("span",{className:"font-medium text-emerald-600",children:c("serviceAreas.miles",{count:N})})]}),(0,a.jsx)("input",{type:"range",min:5,max:100,step:5,value:N,onChange:e=>w(parseInt(e.target.value)),className:"w-full accent-emerald-600"}),(0,a.jsxs)("div",{className:"flex justify-between text-xs text-slate-400",children:[(0,a.jsx)("span",{children:"5mi"}),(0,a.jsx)("span",{children:"50mi"}),(0,a.jsx)("span",{children:"100mi"})]})]}),(0,a.jsxs)("button",{type:"button",onClick:L,disabled:y,className:"w-full px-4 py-3 sm:py-2 bg-emerald-600 text-white rounded-lg font-medium hover:bg-emerald-700 active:bg-emerald-800 disabled:opacity-50 transition-colors flex items-center justify-center gap-2 touch-manipulation min-h-[44px] sm:min-h-0",children:[y?(0,a.jsx)(ev,{size:16}):(0,a.jsx)(eg,{size:16}),c("serviceAreas.setRadius",{miles:N})]})]}):(0,a.jsxs)("div",{className:"text-center py-4 text-slate-500",children:[(0,a.jsx)(eb,{size:32,className:"mx-auto mb-2 text-slate-300"}),(0,a.jsx)("p",{className:"text-sm",children:c("serviceAreas.locationHint")})]})})]}),C&&(0,a.jsx)("p",{className:"text-sm text-red-600",children:C})]}),0===t.length&&n&&(0,a.jsxs)("div",{className:"text-center py-8 text-slate-500",children:[(0,a.jsx)(eb,{size:32,className:"mx-auto mb-2 text-slate-300"}),(0,a.jsx)("p",{className:"text-sm",children:c("serviceAreas.empty")})]})]})}var ek=s(74599);let e_=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z"}),(0,a.jsx)("path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2"}),(0,a.jsx)("path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2"}),(0,a.jsx)("path",{d:"M10 6h4"}),(0,a.jsx)("path",{d:"M10 10h4"}),(0,a.jsx)("path",{d:"M10 14h4"}),(0,a.jsx)("path",{d:"M10 18h4"})]})},eP=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,a.jsx)("path",{d:"M9 12l2 2 4-4"})]})},eC=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z"}),(0,a.jsx)("path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12"})]})},ez=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"}),(0,a.jsx)("path",{d:"M12 9v4"}),(0,a.jsx)("path",{d:"M12 17h.01"})]})},eS=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("rect",{width:"20",height:"16",x:"2",y:"4",rx:"2"}),(0,a.jsx)("path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7"})]})},eL=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),(0,a.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,a.jsx)("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]})},eA=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z"}),(0,a.jsx)("circle",{cx:"12",cy:"10",r:"3"})]})},eM=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("rect",{width:"20",height:"14",x:"2",y:"7",rx:"2",ry:"2"}),(0,a.jsx)("path",{d:"M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16"})]})},eT=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M5 12h14"}),(0,a.jsx)("path",{d:"m12 5 7 7-7 7"})]})},eE=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M19 12H5"}),(0,a.jsx)("path",{d:"m12 19-7-7 7-7"})]})},eB=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),(0,a.jsx)("polyline",{points:"17 8 12 3 7 8"}),(0,a.jsx)("line",{x1:"12",x2:"12",y1:"3",y2:"15"})]})},eF=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z"}),(0,a.jsx)("path",{d:"M5 3v4"}),(0,a.jsx)("path",{d:"M19 17v4"}),(0,a.jsx)("path",{d:"M3 5h4"}),(0,a.jsx)("path",{d:"M17 19h4"})]})},eR=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M15 4V2"}),(0,a.jsx)("path",{d:"M15 16v-2"}),(0,a.jsx)("path",{d:"M8 9h2"}),(0,a.jsx)("path",{d:"M20 9h2"}),(0,a.jsx)("path",{d:"M17.8 11.8 19 13"}),(0,a.jsx)("path",{d:"M15 9h0"}),(0,a.jsx)("path",{d:"M17.8 6.2 19 5"}),(0,a.jsx)("path",{d:"m3 21 9-9"}),(0,a.jsx)("path",{d:"M12.2 6.2 11 5"})]})},eD=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,a.jsx)("path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}),(0,a.jsx)("path",{d:"M2 12h20"})]})},eW=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"}),(0,a.jsx)("path",{d:"m15 5 4 4"})]})},eI=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"}),(0,a.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})},eH=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}),(0,a.jsx)("polyline",{points:"15 3 21 3 21 9"}),(0,a.jsx)("line",{x1:"10",x2:"21",y1:"14",y2:"3"})]})},eq=e=>{let{size:t=20,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("rect",{x:"3",y:"3",width:"7",height:"7"}),(0,a.jsx)("rect",{x:"14",y:"3",width:"7",height:"7"}),(0,a.jsx)("rect",{x:"14",y:"14",width:"7",height:"7"}),(0,a.jsx)("rect",{x:"3",y:"14",width:"7",height:"7"})]})}
1,eO=e=>{let{size:t=20,className:s=""}=e;return(0,a.jsx)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})},eV=e=>{let{size:t=20,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"}),(0,a.jsx)("path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0"})]})},eK=e=>{let{size:t=20,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),(0,a.jsx)("circle",{cx:"12",cy:"7",r:"4"})]})},eZ=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M18 6 6 18"}),(0,a.jsx)("path",{d:"m6 6 12 12"})]})},eU=e=>{let{size:t=24,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M5 12h14"}),(0,a.jsx)("path",{d:"M12 5v14"})]})},eG=["hardscaping","softscaping","irrigation","lighting","maintenance","treeSurgery","poolInstallation","fencing","decksPatios"],eY={hardscaping:"hardscape",softscaping:"softscape",irrigation:"irrigation",lighting:"lighting",poolInstallation:"pools",fencing:"fencing",decksPatios:"outdoor_living",maintenance:"lawn_care",treeSurgery:"tree_service"},eX=["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"],e$=[{id:"intro",titleKey:"partnerProfile.steps.intro",icon:eF},{id:"business",titleKey:"partnerProfile.steps.business",icon:e_},{id:"branding",titleKey:"partnerProfile.steps.branding",icon:eL},{id:"services",titleKey:"partnerProfile.steps.services",icon:eM},{id:"confirm",titleKey:"partnerProfile.steps.confirm",icon:eP}];function eJ(e){let{label:t,description:s,value:r,onChange:l,shape:n="square",maxSizeMB:o=5}=e,{t:c}=(0,j.ok)(),d=(0,i.useRef)(null),[m,u]=(0,i.useState)(!1),[h,p]=(0,i.useState)(null),f=e=>{if(p(null),!e.type.startsWith("image/"))return void p(c("partnerProfile.imageOnly"));if(e.size>1024*o*1024)return void p(c("partnerProfile.imageTooLarge",{max:o}));let t=new FileReader;t.onload=t=>{var s;l(e,null==(s=t.target)?void 0:s.result)},t.readAsDataURL(e)};return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-slate-700",children:t}),(0,a.jsx)("p",{className:"text-xs text-slate-500",children:s}),(0,a.jsx)("div",{onClick:()=>{var e;
1return!r&&(null==(e=d.current)?void 0:e.click())},onDragOver:e=>{e.preventDefault(),u(!0)},onDragLeave:()=>u(!1),onDrop:e=>{e.preventDefault(),u(!1);let t=e.dataTransfer.files[0];t&&f(t)},className:"\n          relative cursor-pointer transition-all duration-300\n          ".concat("circle"===n?"w-32 h-32 rounded-full mx-auto":"w-full h-40 rounded-xl","\n          ").concat(r?"":"border-2 border-dashed hover:border-emerald-400","\n          ").concat(m?"border-emerald-500 bg-emerald-50":"border-slate-300 bg-slate-50","\n          flex items-center justify-center overflow-hidden\n        "),children:r?(0,a.jsxs)("div",{className:"relative w-full h-full group",children:[(0,a.jsx)(x(),{src:r,alt:t,fill:!0,className:"object-cover ".concat("circle"===n?"rounded-full":"rounded-xl")}),(0,a.jsx)("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center ".concat("circle"===n?"rounded-full":"rounded-xl"),children:(0,a.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),l(null,null),d.current&&(d.current.value="")},className:"px-4 py-2 bg-white/90 text-slate-800 text-sm font-medium rounded-lg hover:bg-white transition-colors",children:c("common.remove")})})]}):(0,a.jsxs)("div",{className:"text-center p-4",children:[(0,a.jsx)(eB,{size:32,className:"mx-auto text-slate-400 mb-2"}),(0,a.jsx)("p",{className:"text-sm text-slate-600 font-medium",children:c("partnerProfile.dropImage")}),(0,a.jsx)("p",{className:"text-xs text-slate-400 mt-1",children:c("partnerProfile.orClickBrowse")})]})}),h&&(0,a.jsx)("p",{className:"text-xs text-red-500 mt-1",children:h}),(0,a.jsx)("input",{ref:d,type:"file",accept:"image/*",onChange:e=>{var t;let s=null==(t=e.target.files)?void 0:t[0];s&&f(s)},className:"hidden"})]})}let eQ=[{value:"hardscape",labelKey:"partnerProfile.specializations.hardscape"},{value:"softscape",labelKey:"partnerProfile.specializations.softscape"},{value:"irrigation",labelKey:"partnerProfile.specializations.irrigation"},{value:"lighting",labelKey:"partnerProfile.specializations.lighting"},{value:"pools",labelKey:"partnerProfile.specializations.pools"},{value:"fencing",labelKey:"partnerProfile.specializations.fencing"},{value:"outdoor_living",labelKey:"partnerProfile.specializations.outdoor_living"},{value:"lawn_care",labelKey:"partnerProfile.specializations.lawn_care"},{value:"tree_service",labelKey:"partnerProfile.specializations.tree_service"}];function e0(e){var t;let{section:s,onClose:r,onSave:l,profile:n,serviceAreas:o=[],onAddServiceArea:c,onRemoveServiceArea:d,onPhotoUpload:m,onPhotoRemove:x,businessLocation:u}=e,{t:f}=(0,j.ok)(),[b,g]=(0,i.useState)(!1),[v,N]=(0,i.useState)(null),[w,y]=(0,i.useState)(n.business_name),[k,_]=(0,i.useState)(n.contact_name||""),[P,C]=(0,i.useState)(n.contact_email||""),[S,L]=(0,i.useState)(n.website_url||""),[A,M]=(0,i.useState)((null==(t=n.years_in_business)?void 0:t.toString())||""),[T,E]=(0,i.useState)(n.business_license||""),[B,F]=(0,i.useState)(n.license_state||""),[R,D]=(0,i.useState)(n.bio||""),[W,I]=(0,i.useState)(n.specializations||[]),H=async()=>{g(!0),N(null);try{switch(s){case"header":await l({business_name:w,contact_name:k||void 0,contact_email:P||void 0,website_url:S||void 0,years_in_business:A?parseInt(A,10):void 0,business_license:T||void 0,license_state:B||void 0});break;case"about":await l({bio:R||void 0});break;case"specializations":await l({specializations:W});break;case"serviceAreas":r();return}r()}catch(e){N(e.message||f("partnerProfile.saveFailed"))}finally{g(!1)}};if(!s)return null;let q={header:f("partnerProfile.editProfileInfo"),about:f("partnerProfile.editAbout"),specializations:f("partnerProfile.editSpecializations"),serviceAreas:f("partnerProfile.manageServiceAreas"),photo:f("partnerProfile.updatePhoto")}[s];return(0,a.jsx)(h.N,{children:s&&(0,a.jsx)(p.P.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-50 flex items-center justify-center p-4",onClick:r,children:(0,a.jsxs)(p.P.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.2,ease:"easeOut"},className:"bg-white rounded-2xl shadow-2xl w-full max-w-lg max-h-[85vh] overflow-hidden",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-b border-slate-200",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold text-slate-900",children:q}),(0,a.jsx)("button",{onClick:r,className:"p-2 hover:bg-slate-100 rounded-lg transition-colors",children:(0,a.jsx)(eZ,{size:20,className:"text-slate-500"})})]}),(0,a.jsxs)("div",{className:"px-6 py-4 overflow-y-auto max-h-[60vh]",children:[v&&(0,a.jsx)("div",{className:"mb-4 p-3 bg-red-50 border border-red-200 rounded-lg text-sm text-red-700",children:v}),"header"===s&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:[f("partner.businessName")," ",(0,a.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,a.jsx)("input",{type:"text",value:w,onChange:e=>y(e.target.value),className:"w-full px-4 py-2.5 border border-slate-300 rounded-lg focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500",placeholder:f("partnerProfile.businessNamePlaceholder")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:f("partner.contactName")}),(0,a.jsx)("input",{type:"text",value:k,onChange:e=>_(e.target.value),className:"w-full px-4 py-2.5 border border-slate-300 rounded-lg focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500",placeholder:f("partnerProfile.contactNamePlaceholder")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:f("partnerProfile.contactEmail")}),(0,a.jsx)("input",{type:"email",value:P,onChange:e=>C(e.target.value),className:"w-full px-4 py-2.5 border border-slate-300 rounded-lg focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500",placeholder:f("partnerProfile.emailPlaceholder")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:f("partnerProfile.websiteUrl")}),(0,a.jsx)("input",{type:"url",value:S,onChange:e=>L(e.target.value),className:"w-full px-4 py-2.5 border border-slate-300 rounded-lg focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500",placeholder:f("partnerProfile.websitePlaceholder")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:f("profile.business.years")}),(0,a.jsx)("input",{type:"number",value:A,onChange:e=>M(e.target.value),className:"w-full px-4 py-2.5 border border-slate-300 rounded-lg focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500",placeholder:"5",min:"0",max:"100"})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:f("partnerProfile.businessLicense")}),(0,a.jsx)("input",{type:"text",value:T,onChange:e=>E(e.target.value),className:"w-full px-4 py-2.5 border border-slate-300 rounded-lg focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500",placeholder:f("partnerProfile.licensePlaceholder")})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:f("profile.business.licenseState")}),(0,a.jsxs)("select",{value:B,onChange:e=>F(e.target.value),className:"w-full px-4 py-2.5 border border-slate-300 rounded-lg focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500",children:[(0,a.jsx)("option",{value:"",children:f("profile.business.selectState")}),eX.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]})]})]})]}),"about"===s&&(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:f("profile.about.title")}),(0,a.jsx)("textarea",{value:R,onChange:e=>D(e.target.value),rows:6,className:"w-full px-4 py-2.5 border border-slate-300 rounded-lg focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500 resize-none",placeholder:f("partnerProfile.aboutPlaceholder")}),(0,a.jsx)("p",{className:"text-xs text-slate-500 mt-1",children:f("partnerProfile.charCount",{count:R.length})})]}),"specializations"===s&&(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm text-slate-600 mb-4",children:f("partnerProfile.selectAllServices")}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:eQ.map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>{var t;return t=e.value,void I(e=>e.includes(t)?e.filter(e=>e!==t):[...e,t])},className:"px-4 py-2.5 rounded-lg text-sm font-medium transition-all ".concat(W.includes(e.value)?"bg-emerald-100 text-emerald-700 border-2 border-emerald-500":"bg-slate-50 text-slate-600 border-2 border-transparent hover:bg-slate-100"),children:f(e.labelKey)},e.value))})]}),"serviceAreas"===s&&c&&d&&(0,a.jsx)(ey,{serviceAreas:o.map(e=>({...e,is_include:!0})),onAdd:async e=>{await c({area_type:e.area_type,area_value:e.area_value,state_code:e.state_code,travel_radius_miles:e.travel_radius_miles})},onRemove:async e=>d(e),businessLocation:u}
1),"photo"===s&&m&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("p",{className:"text-sm text-slate-500",children:f("partnerProfile.photoUploadDesc")}),(0,a.jsx)("div",{className:"max-w-xs mx-auto",children:(0,a.jsx)(z.Gm,{value:n.profile_photo_url,onUpload:async e=>{r()},onRemove:x,uploadFn:m})}),(0,a.jsx)("p",{className:"text-xs text-slate-400 text-center",children:f("partnerProfile.photoHint")})]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-3 px-6 py-4 border-t border-slate-200 bg-slate-50",children:[(0,a.jsx)("button",{type:"button",onClick:r,className:"px-4 py-2 text-sm font-medium text-slate-600 hover:text-slate-800 hover:bg-slate-100 rounded-lg transition-colors",children:"photo"===s?f("partnerProfile.done"):f("common.cancel")}),"serviceAreas"!==s&&"photo"!==s&&(0,a.jsx)("button",{type:"button",onClick:H,disabled:b||"header"===s&&!w.trim(),className:"px-6 py-2 bg-emerald-600 text-white text-sm font-medium rounded-lg hover:bg-emerald-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center gap-2",children:b?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),f("wizard.saving")]}):f("common.saveChanges")})]})]})})})}function e2(){let{t:e}=(0,j.ok)(),t=(0,u.useRouter)(),{profile:s,isLoading:r,hasProfile:n,fetchProfile:c,updateProfile:m,addServiceArea:h,removeServiceArea:w,deactivate:y,reactivate:k}=(0,f.Zb)(),{isAuthenticated:_,_hasHydrated:P}=(0,g.useUserStore)(),C=(0,v.x)(),z=(0,N.d)(),S=(0,i.useRef)(null),[L,A]=(0,i.useState)(0),[M,T]=(0,i.useState)(null),[E,B]=(0,i.useState)("profile"),[F,R]=(0,i.useState)([]),[D,W]=(0,i.useState)("immediate"),[I,H]=(0,i.useState)(!1),[q,O]=(0,i.useState)({email_notifications_enabled:!0,marketing_emails:!1}),[V,K]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let{tab:e}=t.query;e&&"string"==typeof e&&["profile","portfolio","reviews","settings"].includes(e)&&B(e)},[t.query]),(0,i.useEffect)(()=>{"portfolio"===E&&_&&n&&f.W7.getMyPortfolioProjects().then(e=>{R(e)}).catch(e=>{console.error("Failed to load portfolio projects:",e)})},[E,_,n]),(0,i.useEffect)(()=>{_&&n&&f.fU.getNotificationPreference().then(e=>W(e.preference)).catch(()=>{})},[_,n]);let U=async t=>{H(!0);try{let s="none"===t?"daily":t;await f.fU.updateNotificationPreference(s),W(t),z.success(e("partnerProfile.notifUpdated"))}catch(t){z.error(e("partnerProfile.notifUpdateFailed"))}finally{H(!1)}},G=async()=>{if(s&&!V){K(!0);try{s.is_active?(await y(),z.success(e("dashboard.pausedToast"))):(await k(),z.success(e("dashboard.activeToast")))}catch(t){z.error(t.message||e("dashboard.statusFailed"))}finally{K(!1)}}},Y=[{id:"profile",label:e("partnerProfile.tabProfile"),icon:(0,a.jsx)(eK,{size:18})},{id:"portfolio",label:e("partnerProfile.tabPortfolio"),icon:(0,a.jsx)(eq,{size:18})},{id:"reviews",label:e("partnerProfile.tabReviews"),icon:(0,a.jsx)(eO,{size:18})},{id:"settings",label:e("partnerProfile.tabSettings"),icon:(0,a.jsx)(eV,{size:18})}],[X,$]=(0,i.useState)(!1),[J,Q]=(0,i.useState)(!1),[ee,et]=(0,i.useState)(!1),[es,ea]=(0,i.useState)(null),[er,el]=(0,i.useState)(null),[ei,en]=(0,i.useState)({isChecking:!1,hasExistingProfile:!1,hasOAuth:!1,checkedEmail:""}),[eo,ec]=(0,i.useState)({isChecking:!1,hasExistingProfile:!1,existingEmail:"",checkedPhone:""}),[ed,em]=(0,i.useState)({businessName:"",contactName:"",email:"",phone:"",services:[],headquartersZip:"",headquartersState:"",agreeToTerms:!1,agreeToDisclaimers:!1,logoFile:null,logoPreview:null,salespersonPhotoFile:null,salespersonPhotoPreview:null,salespersonName:"",salespersonTitle:""}),[ex,eu]=(0,i.useState)(""),[eh,ep]=(0,i.useState)(!1),[eb,eg]=(0,i.useState)(null),[ej,ev]=(0,i.useState)(!1),eN=(0,i.useCallback)(async e=>{if(!e.trim()||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))return void en({isChecking:!1,hasExistingProfile:!1,hasOAuth:!1,checkedEmail:""});if(e!==ei.checkedEmail){en(e=>({...e,isChecking:!0}));try{let t=await f.lN.checkAuthMethod(e);t.has_contractor_profile?en({isChecking:!1,hasExistingProfile:!0,hasOAuth:t.has_google_oauth,checkedEmail:e}):en({isChecking:!1,hasExistingProfile:!1,hasOAuth:!1,checkedEmail:e})}catch(t){console.error("Email check failed:",t),en({isChecking:!1,hasExistingProfile:!1,hasOAuth:!1,checkedEmail:e})}}},[ei.checkedEmail]),ew=(0,i.useCallback)(async e=>{let t=e.replace(/\D/g,"");if(!t||t.length<10)return void ec({isChecking:!1,hasExistingProfile:!1,existingEmail:"",checkedPhone:""});if(t!==eo.checkedPhone){ec(e=>({...e,isChecking:!0}));try{let e=await f.lN.checkPhoneExists(t);e.exists?ec({isChecking:!1,hasExistingProfile:!0,existingEmail:e.email_hint||"",checkedPhone:t}):ec({isChecking:!1,hasExistingProfile:!1,existingEmail:"",checkedPhone:t})}catch(e){console.error("Phone check failed:",e),ec({isChecking:!1,hasExistingProfile:!1,existingEmail:"",checkedPhone:t})}}},[eo.checkedPhone]),eB=(0,i.useCallback)((e,t)=>{el({email:e,hasOAuth:t})},[]),eZ=async()=>
1{if(!ex.trim())return void eg(e("partnerProfile.enterUrl"));ep(!0),eg(null),ev(!1);try{let t=await f.lN.extractBusinessInfo(ex);if(!t.success)return void eg(t.error||e("partnerProfile.extractFailed"));em(e=>({...e,businessName:t.business_name||e.businessName,phone:t.phone||e.phone,email:t.email||e.email,logoPreview:t.logo_url||e.logoPreview})),ev(!0),S.current&&S.current.querySelectorAll("input").forEach(e=>{e.style.transition="background-color 1.5s ease-out",e.style.backgroundColor="rgba(16, 185, 129, 0.1)",setTimeout(()=>{e.style.backgroundColor="transparent"},50)}),setTimeout(()=>ev(!1),3e3)}catch(t){eg(t.message||e("partnerProfile.fetchFailed"))}finally{ep(!1)}};(0,i.useEffect)(()=>{P&&c()},[P,c]);let eQ=(0,i.useRef)(!1);(0,i.useEffect)(()=>{if(n&&s&&!eQ.current&&!J){eQ.current=!0;let e=s.specializations.map(e=>{let t=Object.entries(eY).find(t=>{let[,s]=t;return s===e});return t?t[0]:null}).filter(Boolean);em(t=>{var a,r,l,i;return{...t,businessName:s.business_name,contactName:s.contact_name,email:s.contact_email,phone:s.contact_phone||"",services:e,headquartersZip:(null==(r=s.service_areas)||null==(a=r[0])?void 0:a.area_value)||"",headquartersState:(null==(i=s.service_areas)||null==(l=i[0])?void 0:l.state_code)||"",agreeToTerms:!0,agreeToDisclaimers:!0}}),A(1)}},[n,s,J]);let e2=(0,i.useCallback)(e=>{switch(e){case 0:case 2:return!0;case 1:return ed.businessName.trim().length>0&&ed.contactName.trim().length>0&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(ed.email)&&ed.phone.trim().length>=10&&ed.headquartersZip.trim().length>0&&ed.headquartersState.length>0;case 3:return ed.services.length>0;case 4:return ed.agreeToTerms&&ed.agreeToDisclaimers;default:return!1}},[ed]),e1=()=>{L<e$.length-1&&e2(L)&&A(e=>e+1)},e4=async()=>{if(e2(L)){$(!0),ea(null);try{let e=ed.services.map(e=>eY[e]).filter(Boolean);if(n){let t={business_name:ed.businessName,contact_name:ed.contactName,contact_email:ed.email,contact_phone:ed.phone||void 0,bio:"",specializations:e,email_notifications_enabled:!0};if(await m(t),ed.headquartersZip&&ed.headquartersState){let e=/^\d{5}(-\d{4})?$/.test(ed.headquartersZip.trim());await h({area_type:e?"zip_code":"city",area_value:ed.headquartersZip.trim(),state_code:ed.headquartersState})}Q(!0)}else if(_&&P){let t=await f.W7.createProfile({business_name:ed.businessName,contact_name:ed.contactName,contact_email:ed.email,contact_phone:ed.phone||void 0,bio:"",specializations:e});if(console.log("[Partner Signup] Profile created:",t.id),ed.headquartersZip&&ed.headquartersState){let e=/^\d{5}(-\d{4})?$/.test(ed.headquartersZip.trim());await f.W7.addServiceArea({area_type:e?"zip_code":"city",area_value:ed.headquartersZip.trim(),state_code:ed.headquartersState})}await c(),Q(!0)}else{let t=await f.lN.checkAuthMethod(ed.email);if(t.has_contractor_profile){el({email:ed.email,hasOAuth:t.has_google_oauth}),$(!1);return}if(await f.lN.initiateSignup({email:ed.email,business_name:ed.businessName,contact_name:ed.contactName,contact_phone:ed.phone||void 0,specializations:e,headquarters_zip:ed.headquartersZip||void 0,headquarters_state:ed.headquartersState||void 0,agreed_to_disclaimers:ed.agreeToDisclaimers,agreed_to_terms:ed.agreeToTerms}),localStorage.setItem("partner_signup_pending","true"),t.use_oauth)await (0,b.G6)("/auth/callback?redirect=/partner/dashboard");else{let e="".concat(window.location.origin,"/auth/callback?redirect=/partner/dashboard");await (0,b.Kt)(ed.email,e),et(!0)}}}catch(a){var t,s;ea((null==(s=a.response)||null==(t=s.data)?void 0:t.detail)||a.message||e("wizard.saveFailed"))}finally{$(!1)}}};if(!P||r&&null===n)return(0,a.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-emerald-50 via-white to-teal-50 flex items-center justify-center",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"w-16 h-16 border-4 border-emerald-200 rounded-full animate-spin border-t-emerald-600"}),(0,a.jsx)(eC,{size:24,className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-emerald-600"})]}),(0,a.jsx)("p",{className:"mt-4 text-slate-600 font-medium",children:e("common.loading")})]})});if(er){let t=async()=>
1{if(er.hasOAuth)await (0,b.G6)("/partner/dashboard");else{let e="".concat(window.location.origin,"/auth/callback?redirect=/partner/dashboard");await (0,b.Kt)(er.email,e),et(!0),el(null)}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o(),{children:(0,a.jsx)("title",{children:e("partnerProfile.metaWelcomeBack")})}),(0,a.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-emerald-50 via-white to-teal-50 p-8 flex flex-col items-center justify-center",children:(0,a.jsxs)("div",{className:"max-w-md w-full text-center",children:[(0,a.jsx)("div",{className:"w-24 h-24 bg-gradient-to-br from-emerald-400 to-teal-500 rounded-full flex items-center justify-center mb-6 mx-auto shadow-lg shadow-emerald-500/30",children:(0,a.jsx)(eP,{size:48,className:"text-white"})}),(0,a.jsx)("h2",{className:"text-3xl font-bold text-slate-900 mb-4",children:e("partnerProfile.welcomeBack")}),(0,a.jsxs)("p",{className:"text-slate-500 mb-6 text-lg",children:[e("partnerProfile.alreadyHaveAccount")," ",(0,a.jsx)("span",{className:"font-medium text-slate-900",children:er.email})]}),(0,a.jsx)("button",{onClick:t,className:"w-full flex items-center justify-center gap-2 px-6 py-4 bg-gradient-to-r from-emerald-500 to-teal-500 text-white font-semibold rounded-xl hover:from-emerald-600 hover:to-teal-600 transition-all shadow-lg shadow-emerald-500/25",children:er.hasOAuth?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{fill:"currentColor",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),(0,a.jsx)("path",{fill:"currentColor",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),(0,a.jsx)("path",{fill:"currentColor",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),(0,a.jsx)("path",{fill:"currentColor",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),e("partnerProfile.signInWithGoogle")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eS,{size:20}),e("partnerProfile.sendLoginLink")]})}),(0,a.jsx)("button",{onClick:()=>el(null),className:"mt-4 text-emerald-600 hover:text-emerald-700 text-sm font-medium",children:e("auth.modal.useDifferentEmail")})]})})]})}if(ee)return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o(),{children:(0,a.jsx)("title",{children:e("partnerProfile.metaCheckEmail")})}),(0,a.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-emerald-50 via-white to-teal-50 p-8 flex flex-col items-center justify-center",children:(0,a.jsxs)("div",{className:"max-w-md w-full text-center",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"w-24 h-24 bg-gradient-to-br from-emerald-400 to-teal-500 rounded-full flex items-center justify-center mb-6 mx-auto shadow-lg shadow-emerald-500/30",children:(0,a.jsx)(eS,{size:48,className:"text-white"})}),(0,a.jsx)("div",{className:"absolute -top-2 -right-2 w-8 h-8 bg-amber-400 rounded-full flex items-center justify-center animate-bounce shadow-lg",children:(0,a.jsx)("span",{className:"text-white text-lg",children:"!"})})]}),(0,a.jsx)("h2",{className:"text-3xl font-bold text-slate-900 mb-4",children:e("partnerProfile.checkEmailTitle")}),(0,a.jsxs)("p",{className:"text-slate-500 mb-6 text-lg",children:[e("partnerProfile.sentVerificationTo"),(0,a.jsx)("br",{}),(0,a.jsx)("span",{className:"font-semibold text-slate-900",children:ed.email})]}),(0,a.jsxs)("div",{className:"bg-white/80 backdrop-blur-sm p-6 rounded-2xl border border-slate-200 text-left mb-6 shadow-xl",children:[(0,a.jsxs)("h3",{className:"font-semibold text-slate-800 mb-3 flex items-center gap-2",children:[(0,a.jsx)(eF,{size:18,className:"text-emerald-500"}),e("partnerProfile.nextSteps")]}),(0,a.jsxs)("ol",{className:"space-y-3 text-sm text-slate-600",children:[(0,a.jsxs)("li",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"w-6 h-6 rounded-full bg-emerald-100 text-emerald-600 flex items-center justify-center text-xs font-bold flex-shrink-0",children:"1"}),(0,a.jsx)("span",{children:e("partnerProfile.nextStep1")})]}),(0,a.jsxs)("li",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"w-6 h-6 rounded-full bg-emerald-100 text-emerald-600 flex items-center justify-center text-xs font-bold flex-shrink-0",children:"2"}),(0,a.jsx)("span",{children:e("partnerProfile.nextStep2")})]}),(0,a.jsxs)("li",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"w-6 h-6 rounded-full bg-emerald-100 text-emerald-600 flex items-center justify-center text-xs font-bold flex-shrink-0",children:"3"}),(0,a.jsx)("span",{children:e("partnerProfile.nextStep3")})]})]})]}),(0,a.jsx)("p",{className:"text-sm text-slate-400 mb-4",children:e("partnerProfile.linkExpires")}),(0,a.jsx)("button",{onClick:()=>et(!1),className:"text-emerald-600 hover:text-emerald-700 text-sm font-medium",children:e("auth.modal.useDifferentEmail")})]})})]});if(J)return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o(),{children:(0,a.jsx)("title",{children:e("partnerProfile.metaWelcome")})}),(0,a.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-emerald-50 via-white to-teal-50 p-8 flex flex-col items-center justify-center",children:(0,a.jsxs)("div",{className:"max-w-lg w-full text-center",children:[(0,a.jsxs)("div",{className:"relative inline-block mb-6",children:[(0,a.jsx)("div",{className:"w-24 h-24 bg-gradient-to-br from-emerald-400 to-teal-500 rounded-full flex items-center justify-center shadow-xl shadow-emerald-500/30",children:(0,a.jsx)(eP,{size:48,className:"text-white"})}),(0,a.jsx)("div",{className:"absolute -bottom-2 -right-2 text-4xl",children:"\uD83C\uDF89"})]}),(0,a.jsx)("h2",{className:"text-4xl font-bold text-slate-900 mb-4",children:e("partnerProfile.allSet")}),(0,a.jsx)("p",{className:"text-slate-500 mb-8 text-lg",children:e("partnerProfile.welcomeMessage")}),(0,a.jsxs)("div",{className:"bg-white/80 backdrop-blur-sm p-6 rounded-2xl border border-slate-200 text-left mb-8 shadow-xl",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4 mb-4 pb-4 border-b border-slate-100",children:[ed.logoPreview?(0,a.jsx)("div",{className:"w-16 h-16 rounded-xl overflow-hidden relative",children:(0,a.jsx)(x(),{src:ed.logoPreview,alt:e("partnerProfile.logoAlt"),fill:!0,className:"object-cover"})}):(0,a.jsx)("div",{className:"w-16 h-16 rounded-xl bg-emerald-100 flex items-center justify-center",children:(0,a.jsx)(e_,{size:32,className:"text-emerald-600"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-bold text-lg text-slate-900",children:ed.businessName}),(0,a.jsxs)("p",{className:"text-sm text-slate-500",children:[ed.headquartersZip,", ",ed.headquartersState]})]})]}),(0,a.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)("span",{className:"text-slate-500",children:e("partnerProfile.servicesLabel")}),(0,a.jsx)("span",{className:"font-medium text-slate-900",children:e("partnerProfile.servicesCount",{count:ed.services.length})})]}),(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)("span",{className:"text-slate-500",children:e("partnerProfile.statusLabel")}),(0,a.jsxs)("span",{className:"font-medium text-emerald-600 flex items-center gap-1",children:[(0,a.jsx)("span",{className:"w-2 h-2 bg-emerald-500 rounded-full animate-pulse"}),e("partnerProfile.activeReceiving")]})]})]})]}),(0,a.jsxs)(d(),{href:"/partner/dashboard",className:"inline-flex items-center gap-2 px-8 py-4 bg-gradient-to-r from-emerald-500 to-teal-500 text-white font-semibold rounded-xl hover:from-emerald-600 hover:to-teal-600 transition-all shadow-lg shadow-emerald-500/25",children:[e("partnerProfile.goToDashboard"),(0,a.jsx)(eT,{size:20})]})]})})]});if(n&&s&&_){var e5,e3,e6,e8;let r=s.completed_jobs_count>0,l=async t=>{try{await m(t),z.success(e("partnerProfile.profileUpdated")),await c()}catch(t){throw z.error(t.message||e("partnerProfile.saveFailed")),t}},i=async t=>{try{await h(t),z.success(e("partnerProfile.areaAdded",{area:t.area_value,state:t.state_code})),await c()}catch(t){var s,a,r;throw(null==(r=t.response)||null==(a=r.data)||null==(s=a.detail)?void 0:s.includes("already exists"))?z.warning(e("partnerProfile.areaDuplicate")):z.error(t.message||e("partnerProfile.areaAddFailed")),t}},n=async t=>{try{await w(t),z.success(e("partnerProfile.areaRemoved")),await c()}catch(t){throw z.error(t.message||e("partnerProfile.areaRemoveFailed")),t}};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o(),{children:(0,a.jsx)("title",{children:e("partnerProfile.metaEditProfile")})}),(0,a.jsx)(e0,{section:M,onClose:()=>T(null),onSave:l,profile:{business_name:s.business_name,contact_name:s.contact_name||"",contact_email:s.contact_email||"",website_url:null!=(e3=s.website_url)?e3:null,bio:null!=(e6=s.bio)?e6:null,years_in_business:null!=(e8=s.years_in_business)?e8:null,specializations:s.specializations||[],profile_photo_url:s.profile_photo_url,business_license:s.business_license,license_state:s.license_state},serviceAreas:s.service_areas||[],businessLocation:s.business_location?{zip_code:s.business_location.zip_code||void 0,city:s.business_location.city||void 0,state:s.business_location.state||void 0,lat:s.business_location.lat||void 0,lng:s.business_location.lng||void 0}:void 0,onAddServiceArea:i,onRemoveServiceArea:n,onPhotoUpload:async e=>{let t=await ek._F.uploadProfilePhoto(e);return await c(),t},onPhotoRemove:async()=>{await f.W7.updateMyProfile({profile_photo_url:""}),await c()}}),(0,a.jsxs)("div",{className:"min-h-screen bg-gradient-to-b from-slate-50 to-white",children:[(0,a.jsx)("div",{className:"bg-white border-b border-slate-200 sticky top-0 app-shell-sticky z-10",children:(0,a.jsxs)("div",{className:"max-w-6xl mx-auto px-6 py-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)(d(),{href:"/partner/dashboard",className:"p-2 hover:bg-slate-100 rounded-lg transition-colors",children:(0,a.jsx)(eE,{size:20,className:"text-slate-600"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-xl font-bold text-slate-900",children:e("partnerProfile.hubTitle")}),(0,a.jsx)("p",{className:"text-sm text-slate-500",children:e("partnerProfile.hubSubtitle")})]})]}),(0,a.jsx)("div",{className:"flex items-center gap-3",children:(0,a.jsxs)(d(),{href:"/contractors/".concat(s.id),target:"_blank",className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-emerald-600 hover:bg-emerald-700 rounded-lg transition-colors shadow-sm",children:[(0,a.jsx)(eI,{size:16}),e("dashboard.publicProfile"),(0,a.jsx)(eH,{size:14})]})})]}),(0,a.jsx)("div",{className:"mt-4 -mb-4 flex gap-1",role:"tablist","aria-label":e("partnerProfile.tabsAria"),children:Y.map(e=>(0,a.jsxs)("button",{role:"tab","aria-selected":E===e.id,"aria-controls":"".concat(e.id,"-panel"),onClick:()=>{var s;B(s=e.id),t.push("/partner/profile?tab=".concat(s),void 0,{shallow:!0})},className:"\n                      relative px-5 py-3 rounded-t-lg text-sm font-medium transition-all flex items-center gap-2\n                      ".concat(E===e.id?"text-emerald-700 bg-slate-50":"text-slate-500 hover:text-slate-700 hover:bg-slate-50/50","\n                    "),children:[e.icon,e.label,E===e.id&&(0,a.jsx)(p.P.div,{layoutId:"activeTabIndicator",className:"absolute bottom-0 left-0 right-0 h-0.5 bg-emerald-600",transition:{type:"spring",stiffness:500,damping:30}})]},e.id))})]})}),(0,a.jsxs)("div",{className:"max-w-6xl mx-auto px-6 py-8",children:["profile"===E&&(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8",children:[(0,a.jsx)("div",{className:"lg:col-span-1",children:(0,a.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg border border-slate-200 p-6 sticky top-24 relative",children:[(0,a.jsx)("button",{onClick:()=>T("photo"),className:"absolute top-4 right-4 p-2 bg-emerald-100 hover:bg-emerald-200 text-emerald-700 rounded-lg transition-colors shadow-sm",title:e("partnerProfile.updatePhotoTitle"),children:(0,a.jsx)(eW,{size:16})}),(0,a.jsx)("div",{className:"flex justify-center mb-5",children:s.profile_photo_url?(0,a.jsx)("img",{src:s.profile_photo_url,alt:s.business_name,className:"w-28 h-28 rounded-full object-cover ring-4 ring-white shadow-xl"}):(0,a.jsx)("div",{className:"w-28 h-28 rounded-full bg-gradient-to-br from-emerald-400 to-teal-600 flex items-center justify-center ring-4 ring-white shadow-xl",children:(0,a.jsx)("span",{className:"text-4xl font-bold text-white",children:(null==(e5=s.business_name)?void 0:e5.charAt(0).toUpperCase())||"Y"})})}),(0,a.jsx)("h2",{className:"text-xl font-bold text-slate-900 text-center mb-1",children:s.business_name}),s.contact_name&&(0,a.jsx)("p",{className:"text-center text-slate-500 text-sm mb-4",children:e("partnerProfile.ownedBy",{name:s.contact_name})}),(0,a.jsxs)("div",{className:"flex flex-wrap justify-center gap-2 mb-5",children:["verified"===s.verification_status&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 bg-emerald-50 text-emerald-700 rounded-full text-xs font-medium",children:[(0,a.jsx)(eP,{size:14}),e("partnerProfile.verified")]}),s.business_license&&(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 bg-purple-50 text-purple-700 rounded-full text-xs font-medium",children:[(0,a.jsx)(eM,{size:14}),e("partnerProfile.licPrefix")," ",s.business_license," ",s.license_state?"(".concat(s.license_state,")"):""]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3 mb-5",children:[r&&(0,a.jsxs)("div",{className:"bg-slate-50 rounded-xl p-3 text-center",children:[(0,a.jsxs)("div",{className:"flex items-center justify-center gap-1 mb-1",children:[(0,a.jsx)(eP,{size:16,className:"text-emerald-500"}),(0,a.jsx)("span",{className:"text-lg font-bold text-slate-900",children:s.completed_jobs_count})]}),(0,a.jsx)("p",{className:"text-xs text-slate-500",children:e("partnerProfile.jobsDone")})]}),s.years_in_business&&(0,a.jsxs)("div",{className:"bg-slate-50 rounded-xl p-3 text-center",children:[(0,a.jsx)("span",{className:"text-lg font-bold text-slate-900",children:s.years_in_business}),(0,a.jsx)("p",{className:"text-xs text-slate-500",children:e("partnerProfile.yearsExp")})]})]}),(0,a.jsxs)("div",{className:"border-t border-slate-100 pt-5 space-y-3",children:[(0,a.jsx)("h3",{className:"text-xs font-semibold text-slate-400 uppercase tracking-wide mb-3",children:e("partnerProfile.contactHeading")}),s.contact_email&&(0,a.jsxs)("div",{className:"flex items-center gap-3 text-sm text-slate-600",children:[(0,a.jsx)("span",{className:"w-8 h-8 rounded-full bg-slate-100 flex items-center justify-center",children:(0,a.jsx)(eS,{size:14})}),(0,a.jsx)("span",{className:"truncate",children:s.contact_email})]}),s.website_url&&(0,a.jsxs)("div",{className:"flex items-center gap-3 text-sm text-slate-600",children:[(0,a.jsx)("span",{className:"w-8 h-8 rounded-full bg-slate-100 flex items-center justify-center",children:(0,a.jsx)(eD,{size:14})}),(0,a.jsx)("span",{className:"truncate",children:s.website_url})]})]})]})}),(0,a.jsxs)("div",{className:"lg:col-span-2 space-y-6",children:[(0,a.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg border border-slate-200 p-6 relative",children:[(0,a.jsx)("button",{onClick:()=>T("about"),className:"absolute top-4 right-4 p-2 bg-emerald-100 hover:bg-emerald-200 text-emerald-700 rounded-lg transition-colors shadow-sm",title:e("partnerProfile.editAboutTitle"),children:(0,a.jsx)(eW,{size:16})}),(0,a.jsx)("h3",{className:"text-lg font-semibold text-slate-900 mb-4",children:e("partnerProfile.aboutHeading")}),s.bio?(0,a.jsx)("p",{className:"text-slate-600 leading-relaxed whitespace-pre-wrap",children:s.bio}):(0,a.jsxs)("div",{className:"bg-amber-50 border border-amber-200 rounded-xl p-4",children:[(0,a.jsxs)("p",{className:"text-sm text-amber-800",children:[(0,a.jsx)("span",{className:"font-medium",children:e("partnerProfile.addBioBold")})," ",e("partnerProfile.addBioBody")]}),(0,a.jsxs)("button",{onClick:()=>T("about"),className:"inline-flex items-center gap-2 mt
1-3 text-sm font-medium text-amber-700 hover:text-amber-800",children:[(0,a.jsx)(eU,{size:14}),e("partnerProfile.addBio")]})]})]}),(0,a.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg border border-slate-200 p-6 relative",children:[(0,a.jsx)("button",{onClick:()=>T("specializations"),className:"absolute top-4 right-4 p-2 bg-emerald-100 hover:bg-emerald-200 text-emerald-700 rounded-lg transition-colors shadow-sm",title:e("partnerProfile.editSpecializationsTitle"),children:(0,a.jsx)(eW,{size:16})}),(0,a.jsx)("h3",{className:"text-lg font-semibold text-slate-900 mb-4",children:e("partnerProfile.specializationsHeading")}),s.specializations&&s.specializations.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-3",children:s.specializations.map((t,s)=>(0,a.jsx)("span",{className:"inline-flex items-center gap-2 px-4 py-2.5 bg-gradient-to-r from-emerald-50 to-teal-50 text-emerald-700 rounded-full text-sm font-medium border border-emerald-100",children:(0,a.jsx)("span",{className:"capitalize",children:e("partnerProfile.specializations.".concat(t),t.replace(/_/g," "))})},s))}):(0,a.jsxs)("div",{className:"bg-amber-50 border border-amber-200 rounded-xl p-4",children:[(0,a.jsxs)("p",{className:"text-sm text-amber-800",children:[(0,a.jsx)("span",{className:"font-medium",children:e("partnerProfile.addSpecsBold")})," ",e("partnerProfile.addSpecsBody")]}),(0,a.jsxs)("button",{onClick:()=>T("specializations"),className:"inline-flex items-center gap-2 mt-3 text-sm font-medium text-amber-700 hover:text-amber-800",children:[(0,a.jsx)(eU,{size:14}),e("partnerProfile.addServices")]})]})]}),(0,a.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg border border-slate-200 p-6 relative",children:[(0,a.jsx)("button",{onClick:()=>T("serviceAreas"),className:"absolute top-4 right-4 p-2 bg-emerald-100 hover:bg-emerald-200 text-emerald-700 rounded-lg transition-colors shadow-sm",title:e("partnerProfile.editServiceAreasTitle"),children:(0,a.jsx)(eW,{size:16})}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,a.jsx)(eA,{size:20,className:"text-emerald-600"}),(0,a.jsx)("h3",{className:"text-lg font-semibold text-slate-900",children:e("serviceAreas.title")})]}),s.service_areas&&s.service_areas.length>0?(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.service_areas.map((e,t)=>(0,a.jsxs)("span",{className:"px-3 py-1.5 bg-slate-100 text-slate-700 rounded-full text-sm",children:[e.area_value,", ",e.state_code]},e.id||t))}):(0,a.jsxs)("div",{className:"bg-amber-50 border border-amber-200 rounded-xl p-4",children:[(0,a.jsxs)("p",{className:"text-sm text-amber-800",children:[(0,a.jsx)("span",{className:"font-medium",children:e("partnerProfile.addAreasBold")})," ",e("partnerProfile.addAreasBody")]}),(0,a.jsxs)("button",{onClick:()=>T("serviceAreas"),className:"inline-flex items-center gap-2 mt-3 text-sm font-medium text-amber-700 hover:text-amber-800",children:[(0,a.jsx)(eU,{size:14}),e("dashboard.addAreas")]})]})]}),(0,a.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg border border-slate-200 p-6 relative",children:[(0,a.jsx)(d(),{href:"/partner/settings?tab=portfolio",className:"absolute top-4 right-4 p-2 bg-emerald-100 hover:bg-emerald-200 text-emerald-700 rounded-lg transition-colors shadow-sm",title:e("partnerProfile.managePortfolioTitle"),children:(0,a.jsx)(eW,{size:16})}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,a.jsx)(eL,{size:20,className:"text-emerald-600"}),(0,a.jsx)("h3",{className:"text-lg font-semibold text-slate-900",children:e("portfolio.title")})]}),(0,a.jsxs)("div",{className:"bg-slate-50 border border-slate-200 rounded-xl p-4 text-center",children:[(0,a.jsx)("p",{className:"text-sm text-slate-600 mb-3",children:e("partnerProfile.portfolioPrompt")}),(0,a.jsxs)(d(),{href:"/partner/settings?tab=portfolio",className:"inline-flex items-center gap-2 px-4 py-2 bg-emerald-600 text-white text-sm font-medium rounded-lg hover:bg-emerald-700 transition-colors",children:[(0,a.jsx)(eL,{size:14}),e("partnerProfile.managePortfolio")]})]})]}),(0,a.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg border border-slate-200 p-6 relative",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-slate-900",children:e("partnerProfile.reviewsHeading")}),r&&(0,a.jsxs)("div",{className:"flex items-center gap-2 bg-emerald-50 px-3 py-1.5 rounded-full",children:[(0,a.jsx)(eP,{size:16,className:"text-emerald-500"}),(0,a.jsx)("span",{className:"font-bold text-slate-900",children:s.completed_jobs_count}),(0,a.jsx)("span",{className:"text-slate-500 text-sm",children:e("partnerProfile.jobsCompleted")})]})]}),(0,a.jsx)("div",{className:"bg-slate-50 border border-slate-200 rounded-xl p-4 text-center",children:(0,a.jsx)("p",{className:"text-sm text-slate-500",children:e("partnerProfile.noReviews")})})]})]})]}),"portfolio"===E&&(0,a.jsx)(Z,{projects:F,onProjectsChange:R,maxProjects:12,className:"w-full"}),"reviews"===E&&(0,a.jsx)(ef,{initialReviews:[],className:"w-full"}),"settings"===E&&(0,a.jsxs)("div",{className:"max-w-2xl mx-auto 
1space-y-8",children:[(0,a.jsx)("div",{className:"bg-white rounded-2xl shadow-lg border border-slate-200 p-6",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-slate-900 mb-1",children:e("dashboard.receiving")}),(0,a.jsx)("p",{className:"text-sm text-slate-500",children:(null==s?void 0:s.is_active)?e("partnerProfile.receivingActiveDesc"):e("partnerProfile.receivingPausedDesc")})]}),(0,a.jsxs)("button",{onClick:G,disabled:V,className:"relative inline-flex items-center gap-3 px-4 py-2.5 text-sm font-medium rounded-xl border-2 transition-all ".concat((null==s?void 0:s.is_active)?"text-emerald-700 bg-emerald-50 border-emerald-200 hover:bg-emerald-100":"text-slate-500 bg-slate-50 border-slate-200 hover:bg-slate-100"," ").concat(V?"opacity-60 cursor-wait":""),"aria-label":(null==s?void 0:s.is_active)?e("dashboard.pauseAria"):e("dashboard.startAria"),children:[(0,a.jsx)("span",{className:"relative inline-flex h-6 w-11 flex-shrink-0 rounded-full transition-colors duration-200 ".concat((null==s?void 0:s.is_active)?"bg-emerald-500":"bg-slate-300"),children:(0,a.jsx)("span",{className:"inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition-transform duration-200 mt-0.5 ".concat((null==s?void 0:s.is_active)?"translate-x-5 ml-0.5":"translate-x-0.5")})}),(0,a.jsx)("span",{children:V?e("dashboard.updating"):(null==s?void 0:s.is_active)?e("partnerProfile.statusActive"):e("dashboard.paused")})]})]})}),(0,a.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg border border-slate-200 p-6",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-slate-900 mb-2",children:e("partnerProfile.leadNotifTitle")}),(0,a.jsx)("p",{className:"text-sm text-slate-500 mb-6",children:e("partnerProfile.leadNotifDesc")}),(0,a.jsx)("div",{className:"space-y-3",children:[{value:"immediate",label:e("partnerProfile.prefImmediate"),description:e("partnerProfile.prefImmediateDesc")},{value:"hourly",label:e("partnerProfile.prefHourly"),description:e("partnerProfile.prefHourlyDesc")},{value:"daily",label:e("partnerProfile.prefDaily"),description:e("partnerProfile.prefDailyDesc")},{value:"none",label:e("partnerProfile.prefNone"),description:e("partnerProfile.prefNoneDesc")}].map(e=>(0,a.jsxs)("label",{className:"flex items-start gap-4 p-4 rounded-xl border-2 cursor-pointer transition-all ".concat(D===e.value?"border-emerald-500 bg-emerald-50":"border-slate-200 hover:border-slate-300"),children:[(0,a.jsx)("input",{type:"radio",name:"leadNotificationPref",value:e.value,checked:D===e.value,onChange:e=>U(e.target.value),disabled:I,className:"mt-1 w-4 h-4 text-emerald-600 border-slate-300 focus:ring-emerald-500"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-slate-900",children:e.label}),(0,a.jsx)("p",{className:"text-sm text-slate-500",children:e.description})]})]},e.value))})]}),(0,a.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg border border-slate-200 p-6",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-slate-900 mb-2",children:e("partnerProfile.emailPrefsTitle")}),(0,a.jsx)("p",{className:"text-sm text-slate-500 mb-6",children:e("partnerProfile.emailPrefsDesc")}),(0,a.jsx)("div",{className:"space-y-4",children:[{key:"email_notifications_enabled",label:e("partnerProfile.emailNotifLabel"),description:e("partnerProfile.emailNotifDesc")},{key:"marketing_emails",label:e("partnerProfile.marketingEmailsLabel"),description:e("partnerProfile.marketingEmailsDesc")}].map(e=>(0,a.jsxs)("div",{className:"flex items-center justify-between py-3 border-b border-slate-100 last:border-0",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium text-slate-900",children:e.label}),(0,a.jsx)("p",{className:"text-sm text-slate-500",children:e.description})]}),(0,a.jsx)("button",{onClick:()=>{O(t=>({...t,[e.key]:!t[e.key]}))},className:"relative w-12 h-6 rounded-full transition-colors ".concat(q[e.key]?"bg-emerald-500":"bg-slate-300"),children:(0,a.jsx)("span",{className:"absolute top-0.5 left-0.5 w-
15 h-5 bg-white rounded-full shadow transition-transform ".concat(q[e.key]?"translate-x-6":"translate-x-0")})})]},e.key))})]}),(0,a.jsxs)("div",{className:"bg-white rounded-2xl shadow-lg border border-slate-200 p-6",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-slate-900 mb-2",children:e("serviceAreas.title")}),(0,a.jsx)("p",{className:"text-sm text-slate-500 mb-6",children:e("partnerProfile.serviceAreasSettingsDesc")}),(0,a.jsx)(ey,{serviceAreas:((null==s?void 0:s.service_areas)||[]).map(e=>({...e,is_include:!0})),onAdd:async t=>{await h({area_type:t.area_type,area_value:t.area_value,state_code:t.state_code,travel_radius_miles:t.travel_radius_miles}),z.success(e("partnerProfile.areaAddedSuccess")),await c()},onRemove:async t=>{await w(t),z.success(e("partnerProfile.areaRemoved"))},businessLocation:(null==s?void 0:s.business_location)?{zip_code:s.business_location.zip_code||void 0,city:s.business_location.city||void 0,state:s.business_location.state||void 0,lat:s.business_location.lat||void 0,lng:s.business_location.lng||void 0}:void 0})]})]})]})]})]})}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(o(),{children:[(0,a.jsx)("title",{children:e("partnerProfile.metaJoinTitle")}),(0,a.jsx)("meta",{name:"description",content:e("partnerProfile.metaJoinDesc")})]}),(0,a.jsxs)("div",{className:"min-h-screen bg-gradient-to-br from-emerald-50 via-white to-teal-50",children:[0===L&&(0,a.jsxs)("div",{className:"jsx-cdf0d34f6e8cfa9b min-h-screen relative overflow-hidden",children:[(0,a.jsx)("div",{className:"jsx-cdf0d34f6e8cfa9b absolute top-20 left-10 w-72 h-72 bg-emerald-200/30 rounded-full blur-3xl animate-float-slow"}),(0,a.jsx)("div",{className:"jsx-cdf0d34f6e8cfa9b absolute bottom-20 right-10 w-96 h-96 bg-teal-200/30 rounded-full blur-3xl animate-float-medium"}),(0,a.jsx)("div",{className:"jsx-cdf0d34f6e8cfa9b absolute top-1/2 left-1/2 w-64 h-64 bg-amber-200/20 rounded-full blur-3xl animate-float-fast"}),(0,a.jsx)(l(),{id:"cdf0d34f6e8cfa9b",children:"@keyframes float-slow{0%,100%{transform:translatey(0)translatex(0)}50%{transform:translatey(-20px)translatex(10px)}}@keyframes float-medium{0%,100%{transform:translatey(0)translatex(0)}50%{transform:translatey(-15px)translatex(-8px)}}@keyframes float-fast{0%,100%{transform:translatey(0)translatex(0)}50%{transform:translatey(-10px)translatex(5px)}}.animate-float-slow.jsx-cdf0d34f6e8cfa9b{animation:float-slow 8s ease-in-out infinite}.animate-float-medium.jsx-cdf0d34f6e8cfa9b{animation:float-medium 6s ease-in-out infinite}.animate-float-fast.jsx-cdf0d34f6e8cfa9b{animation:float-fast 4s ease-in-out infinite}"}),(0,a.jsxs)("div",{className:"jsx-cdf0d34f6e8cfa9b relative z-10 max-w-7xl mx-auto px-4 py-8 md:py-16",children:[(0,a.jsxs)("div",{className:"jsx-cdf0d34f6e8cfa9b flex items-center justify-between mb-12",children:[(0,a.jsxs)("div",{className:"jsx-cdf0d34f6e8cfa9b flex items-center gap-3",children:[(0,a.jsx)("div",{className:"jsx-cdf0d34f6e8cfa9b bg-gradient-to-br from-emerald-500 to-teal-500 p-2.5 rounded-xl shadow-lg shadow-emerald-500/30",children:(0,a.jsx)(eC,{size:28,className:"text-white"})}),(0,a.jsxs)("div",{className:"jsx-cdf0d34f6e8cfa9b",children:[(0,a.jsx)("h1",{className:"jsx-cdf0d34f6e8cfa9b text-xl font-bold text-slate-900",children:"YardaPartners"}),(0,a.jsx)("span",{className:"jsx-cdf0d34f6e8cfa9b text-xs text-slate-500 uppercase tracking-wider",children:e("partner.partnerNetwork")})]})]}),(0,a.jsxs)(d(),{href:"/",className:"text-sm text-slate-600 hover:text-slate-900 transition-colors",children:["← ",e("partnerProfile.backToYarda")]})]}),(0,a.jsx)(p.P.div,{variants:{hidden:{opacity:1},visible:{opacity:1,transition:{staggerChildren:.1*!C,delayChildren:0}}},initial:"hidden",animate:"visible",className:"max-w-2xl",children:(0,a.jsxs)("div",{className:"jsx-cdf0d34f6e8cfa9b",children:[(0,a.jsxs)(p.P.div,{variants:{hidden:{opacity:+!!C,y:C?0:-30},visible:{opacity:1,y:0,transition:{duration:.6*!C,type:"spring",stiffness:400,damping:15}}},className:"inline-flex items-center gap-2 px-4 py-2 bg-emerald-100 text-emerald-700 rounded-full text-sm font-medium mb-6",children:[(0,a.jsx)(eF,{size:16}),e("partnerProfile.heroBadge")]}),(0,a.jsxs)(p.P.h2,{variants:{hidden:{opacity:+!!C,y:50*!C},visible:{opacity:1,y:0,transition:{duration:.8*!C,ease:[.215,.61,.355,1]}}},className:"text-4xl md:text-5xl lg:text-6xl font-bold text-slate-900 mb-6 leading-tight",children:[e("partnerProfile.heroTitlePrefix")," ",(0,a.jsx)("span",{className:"jsx-cdf0d34f6e8cfa9b text-transparent bg-clip-text bg-gradient-to-r from-emerald-500 to-teal-500",children:e("partnerProfile.heroTitleHighlight")})]}),(0,a.jsx)(p.P.p,{variants:{hidden:{opacity:+!!C,y:30*!C},visible:{opacity:1,y:0,transition:{duration:.6*!C,ease:[.4,0,.2,1]}}},className:"text-xl text-slate-600 mb-8 leading-relaxed",children:e("partnerProfile.heroSubtitle")}),(0,a.jsxs)(p.P.button,{variants:{hidden:{opacity:+!!C,scale:C?1:.9},visible:{opacity:1,scale:1,transition:{duration:.5*!C,type:"spring",stiffness:400,damping:15}}},onClick:e1,type:"button",whileHover:C?{}:{scale:1.02},whileTap:C?{}:{scale:.98},className:"mb-4 inline-flex items-center justify-center gap-3 px-10 py-5 bg-emerald-600 text-white text-xl font-bold rounded-2xl hover:bg-emerald-700 transition-all shadow-2xl hover:shadow-emerald-500/50 border-4 border-emerald-400",style:{minWidth:"300px",minHeight:"70px"},children:[(0,a.jsx)("span",{className:"jsx-cdf0d34f6e8cfa9b",children:"\uD83D\uDCBC"}),(0,a.jsx)("span",{className:"jsx-cdf0d34f6e8cfa9b",children:e("partnerProfile.heroCta")}),(0,a.jsx)("span",{className:"jsx-cdf0d34f6e8cfa9b",children:"→"})]}),(0,a.jsxs)("div",{className:"jsx-cdf0d34f6e8cfa9b mb-10 space-y-2",children:[(0,a.jsxs)("p",{className:"jsx-cdf0d34f6e8cfa9b text-sm text-slate-600 flex items-center gap-2",children:[(0,a.jsx)(eP,{size:16,className:"text-emerald-500"}),e("partnerProfile.heroPoint1")]}),(0,a.jsxs)("p",{className:"jsx-cdf0d34f6e8cfa9b text-sm text-emerald-700 flex items-center gap-2 font-medium",children:[(0,a.jsx)(eR,{size:16,className:"text-emerald-600"}),e("partnerProfile.heroPoint2")]})]})]})})]})]}),L>0&&(0,a.jsx)("div",{className:"min-h-screen py-8 px-4",children:(0,a.jsxs)("div",{className:"max-w-2xl mx-auto",children:[(0,a.jsxs)("div",{className:"mb-8",children:[(0,a.jsx)("div",{className:"flex items-center justify-between mb-4",children:e$.slice(1).map((e,t)=>{let s=t+1,r=L===s,l=L>s,i=e.icon;return(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("div",{className:"\n                            w-10 h-10 rounded-full flex items-center justify-center transition-all duration-300\n                            ".concat(r?"bg-gradient-to-br from-emerald-500 to-teal-500 text-white shadow-lg shadow-emerald-500/30":"","\n                            ").concat(l?"bg-emerald-100 text-emerald-600":"","\n                            ").concat(r||l?"":"bg-slate-100 text-slate-400","\n                          "),children:l?(0,a.jsx)(eP,{size:20}):(0,a.jsx)(i,{size:20})}),t<e$.length-2&&(0,a.jsx)("div",{className:"w-full h-1 mx-2 rounded transition-colors ".concat(l?"bg-emerald-500":"bg-slate-200"),style:{width:"60px"}})]},e.id)})}),(0,a.jsx)("p",{className:"text-center text-sm text-slate-500",children:e("partnerProfile.stepIndicator",{current:L,total:e$.length-1,title:e(e$[L].titleKey)})})]}),(0,a.jsxs)("div",{ref:S,className:"bg-white/80 backdrop-blur-sm rounded-2xl shadow-xl border border-slate-200 overflow-hidden",children:[(0,a.jsxs)("div",{className:"p-6 md:p-8",children:[1===L&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"text-center mb-8",children:[(0,a.jsx)("div",{className:"w-16 h-16 bg-gradient-to-br from-emerald-400 to-teal-500 rounded-2xl flex items-center justify-center mx-auto mb-4 shadow-lg shadow-emerald-500/20",children:(0,a.jsx)(e_,{size:32,className:"text-white"})}),(0,a.jsx)("h3",{className:"text-2xl font-bold text-slate-900",children:e("partnerProfile.businessTitle")}),(0,a.jsx)("p",{className:"text-slate-500 mt-2",children:e("partnerProfile.businessSubtitle")})]}),(0,a.jsxs)("div",{className:"bg-gradient-to-r from-blue-50 to-indigo-50 border border-blue-200 rounded-xl p-5 mb-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,a.jsx)("div",{className:"p-2 bg-blue-100 rounded-lg",children:(0,a.jsx)(eR,{size:18,className:"text-blue-600"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-semibold text-slate-800 text-sm",children:e("partnerProfile.quickFillTitle")}),(0,a.jsx)("p",{className:"text-xs text-slate-500",children:e("partnerProfile.quickFillDesc")})]})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsxs)("div",{className:"relative flex-1",children:[(0,a.jsx)(eD,{size:18,className:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400"}),(0,a.jsx)("input",{type:"url",className:"w-full pl-10 pr-4 py-3 bg-white border border-blue-200 rounded-lg focus:ring-2 focus:ring-blue-400 focus:border-blue-400 outline-none text-sm transition-all",placeholder:e("partnerProfile.quickFillPlaceholder"),value:ex,onChange:e=>{eu(e.target.value),eg(null)},onKeyDown:e=>"Enter"===e.key&&eZ()})]}),(0,a.jsx)("button",{type:"button",onClick:eZ,disabled:eh||!ex.trim(),className:"\n                              flex items-center gap-2 px-4 py-3 rounded-lg font-medium text-sm transition-all whitespace-nowrap\n                              ".concat(eh||!ex.trim()?"bg-slate-200 text-slate-400 cursor-not-allowed":"bg-gradient-to-r from-blue-500 to-indigo-500 text-white hover:from-blue-600 hover:to-indigo-600 shadow-md shadow-blue-500/25","\n                            "),children:eh?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),e("partnerProfile.fetching")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eR,{size:16}),e("partnerProfile.autoFill")]})})]}),eb&&(0,a.jsxs)("div",{className:"mt-3 flex items-center gap-2 text-red-600 text-sm",children:[(0,a.jsx)(ez,{size:14}),eb]}),ej&&(0,a.jsxs)("div",{className:"mt-3 flex items-center gap-2 text-emerald-600 text-sm",children:[(0,a.jsx)(eP,{size:14}),e("partnerProfile.quickFillSuccess")]})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"absolute inset-0 flex items-center",children:(0,a.jsx)("div",{className:"w-full border-t border-slate-200"})}),(0,a.jsx)("div",{className:"relative flex justify-center text-xs uppercase",children:(0,a.jsx)("span",{className:"bg-white px-3 text-slate-400",children:e("partnerProfile.orFillManually")})})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:[e("partner.businessName")," *"]}),(0,a.jsx)("input",{type:"text",className:"w-full p-4 bg-slate-50 border border-slate-200 rounded-xl focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500 outline-none transition-all",placeholder:e("partner.businessNamePlaceholder"),value:ed.businessName,onChange:e=>em({...ed,businessName:e.target.value})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:[e("partnerProfile.yourName")," *"]}),(0,a.jsx)("input",{type:"text",className:"w-full p-4 bg-slate-50 border border-slate-200 rounded-xl focus:ring-2 focus:ring-emerald-500 outline-none transition-all",placeholder:e("partner.contactNamePlaceholder"),value:ed.contactName,onChange:e=>em({...ed,contactName:e.target.value})})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:[e("partner.email")," *"]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:"email",className:"w-full p-4 bg-slate-50 border rounded-xl focus:ring-2 focus:ring-emerald-500 outline-none transition-all ".concat(ei.hasExistingProfile?"border-amber-400 bg-amber-50":"border-slate-200"),placeholder:e("partner.emailPlaceholder"),value:ed.email,onChange:e=>{em({...ed,email:e.target.value}),e.target.value!==ei.checkedEmail&&en(e=>({...e,hasExistingProfile:!1}))},onBlur:e=>eN(e.target.value)}),ei.isChecking&&(0,a.jsx)("div",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:(0,a.jsx)("div",{className:"w-5 h-5 border-2 border-emerald-500 border-t-transparent roun
1ded-full animate-spin"})})]}),ei.hasExistingProfile&&(0,a.jsx)(p.P.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.3},className:"mt-2 p-3 bg-amber-50 border border-amber-200 rounded-lg",children:(0,a.jsxs)("p",{className:"text-sm text-amber-800",children:[(0,a.jsx)("span",{className:"font-semibold",children:e("partnerProfile.welcomeBackInline")})," ",e("partnerProfile.alreadyHaveEmail")," ",(0,a.jsx)("button",{type:"button",onClick:()=>eB(ei.checkedEmail,ei.hasOAuth),className:"text-amber-700 underline font-medium hover:text-amber-900",children:e("partnerProfile.signInInstead")})]})})]})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:[e("partner.phone")," *"]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("input",{type:"tel",className:"w-full p-4 bg-slate-50 border rounded-xl focus:ring-2 focus:ring-emerald-500 outline-none transition-all ".concat(eo.hasExistingProfile?"border-amber-400 bg-amber-50":"border-slate-200"),placeholder:e("partner.phonePlaceholder"),value:ed.phone,onChange:e=>{em({...ed,phone:e.target.value}),e.target.value.replace(/\D/g,"")!==eo.checkedPhone&&ec(e=>({...e,hasExistingProfile:!1}))},onBlur:e=>ew(e.target.value)}),eo.isChecking&&(0,a.jsx)("div",{className:"absolute right-3 top-1/2 -translate-y-1/2",children:(0,a.jsx)("div",{className:"w-5 h-5 border-2 border-emerald-500 border-t-transparent rounded-full animate-spin"})})]}),eo.hasExistingProfile&&(0,a.jsx)(p.P.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.3},className:"mt-2 p-3 bg-amber-50 border border-amber-200 rounded-lg",children:(0,a.jsxs)("p",{className:"text-sm text-amber-800",children:[(0,a.jsx)("span",{className:"font-semibold",children:e("partnerProfile.welcomeBackInline")})," ",eo.existingEmail?(0,a.jsxs)(a.Fragment,{children:[e("partnerProfile.phoneLinkedTo")," ",(0,a.jsx)("span",{className:"font-medium",children:eo.existingEmail}),"."]}):e("partnerProfile.phoneAlreadyRegistered")," ",(0,a.jsx)("button",{type:"button",onClick:()=>t.push("/auth?redirect=/partner/dashboard"),className:"text-amber-700 underline font-medium hover:text-amber-900",children:e("partnerProfile.signInInstead")})]})})]}),(0,a.jsxs)("div",{className:"pt-4 border-t border-slate-100",children:[(0,a.jsxs)("h4",{className:"text-sm font-semibold text-slate-700 flex items-center gap-2 mb-4",children:[(0,a.jsx)(eA,{size:18,className:"text-emerald-600"}),e("partner.serviceArea")]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:[e("partner.zipCode")," *"]}),(0,a.jsx)("input",{type:"text",className:"w-full p-4 bg-slate-50 border border-slate-200 rounded-xl focus:ring-2 focus:ring-emerald-500 outline-none transition-all",placeholder:e("partner.zipCodePlaceholder"),value:ed.headquartersZip,onChange:e=>em({...ed,headquartersZip:e.target.value})})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:[e("partner.state")," *"]}),(0,a.jsxs)("select",{className:"w-full p-4 bg-slate-50 border border-slate-200 rounded-xl focus:ring-2 focus:ring-emerald-500 outline-none transition-all",value:ed.headquartersState,onChange:e=>em({...ed,headquartersState:e.target.value}),children:[(0,a.jsx)("option",{value:"",children:e("partner.selectState")}),eX.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]})]})]})]})]})]}),2===L&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"text-center mb-8",children:[(0,a.jsx)("div",{className:"w-16 h-16 bg-gradient-to-br from-emerald-400 to-teal-500 rounded-2xl flex items-center justify-center mx-auto mb-4 shadow-lg shadow-emerald-500/20",children:(0,a.jsx)(eL,{size:32,className:"text-white"})}),(0,a.jsx)("h3",{className:"text-2xl font-bold text-slate-900",children:e("partnerProfile.brandingTitle")}),(0,a.jsx)("p",{className:"text-slate-500 mt-2",children:e("partnerProfile.brandingSubtitle")})]}),(0,a.jsxs)("div",{className:"grid md:grid-cols-2 gap-8",children:[(0,a.jsx)(eJ,{label:e("partner.companyLogo"),description:e("partner.companyLogoDesc"),value:ed.logoPreview,onChange:(e,t)=>
1em({...ed,logoFile:e,logoPreview:t}),shape:"square"}),(0,a.jsx)(eJ,{label:e("partner.salesRepPhoto"),description:e("partner.salesRepPhotoDesc"),value:ed.salespersonPhotoPreview,onChange:(e,t)=>em({...ed,salespersonPhotoFile:e,salespersonPhotoPreview:t}),shape:"circle"})]}),ed.salespersonPhotoPreview&&(0,a.jsxs)("div",{className:"grid md:grid-cols-2 gap-4 mt-4 p-4 bg-slate-50 rounded-xl",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:e("partner.salesRepName")}),(0,a.jsx)("input",{type:"text",className:"w-full p-3 bg-white border border-slate-200 rounded-lg focus:ring-2 focus:ring-emerald-500 outline-none transition-all",placeholder:e("partner.salesRepNamePlaceholder"),value:ed.salespersonName,onChange:e=>em({...ed,salespersonName:e.target.value})})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:e("partner.salesRepTitle")}),(0,a.jsx)("input",{type:"text",className:"w-full p-3 bg-white border border-slate-200 rounded-lg focus:ring-2 focus:ring-emerald-500 outline-none transition-all",placeholder:e("partner.salesRepTitlePlaceholder"),value:ed.salespersonTitle,onChange:e=>em({...ed,salespersonTitle:e.target.value})})]})]}),(0,a.jsxs)("div",{className:"bg-amber-50 border border-amber-200 rounded-xl p-4 flex items-start gap-3",children:[(0,a.jsx)(eF,{size:20,className:"text-amber-600 flex-shrink-0 mt-0.5"}),(0,a.jsxs)("div",{className:"text-sm text-amber-800",children:[(0,a.jsx)("p",{className:"font-medium",children:e("partnerProfile.proTip")}),(0,a.jsx)("p",{className:"mt-1",children:e("partner.brandingTip")})]})]})]}),3===L&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"text-center mb-8",children:[(0,a.jsx)("div",{className:"w-16 h-16 bg-gradient-to-br from-emerald-400 to-teal-500 rounded-2xl flex items-center justify-center mx-auto mb-4 shadow-lg shadow-emerald-500/20",children:(0,a.jsx)(eM,{size:32,className:"text-white"})}),(0,a.jsx)("h3",{className:"text-2xl font-bold text-slate-900",children:e("partnerProfile.servicesTitle")}),(0,a.jsx)("p",{className:"text-slate-500 mt-2",children:e("partnerProfile.servicesSubtitle")})]}),(0,a.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:eG.map(t=>(0,a.jsx)("button",{type:"button",onClick:()=>{em(e=>({...e,services:e.services.includes(t)?e.services.filter(e=>e!==t):[...e.services,t]}))},className:"\n                              p-4 rounded-xl border-2 transition-all duration-200 text-left\n                              ".concat(ed.services.includes(t)?"bg-emerald-50 border-emerald-500 shadow-lg shadow-emerald-500/10":"bg-white border-slate-200 hover:border-emerald-300 hover:shadow-md","\n                            "),children:(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"\n                                w-6 h-6 rounded-full border-2 flex items-center justify-center flex-shrink-0 transition-colors\n                                ".concat(ed.services.includes(t)?"bg-emerald-500 border-emerald-500":"border-slate-300","\n                              "),children:ed.services.includes(t)&&(0,a.jsx)("svg",{className:"w-4 h-4 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:3,d:"M5 13l4 4L19 7"})})}),(0,a.jsx)("span",{className:"font-medium ".concat(ed.services.includes(t)?"text-emerald-700":"text-slate-700"),children:e("partner.services.".concat(t))})]})},t))}),ed.services.length>0&&(0,a.jsx)("div",{className:"mt-4 p-4 bg-emerald-50 rounded-xl border border-emerald-200",children:(0,a.jsx)("p",{className:"text-sm text-emerald-700",children:e(1===ed.services.length?"partnerProfile.servicesSelectedOne":"partnerProfile.servicesSelectedOther",{count:ed.services.length})})})]}),4===L&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"text-center mb-8",children:[(0,a.jsx)("div",{className:"w-16 h-16 bg-gradient-to-br from-emerald-400 to-teal-500 rounded-2xl flex items-center justify-center mx-auto mb-4 shadow-lg shadow-emerald-500/20",children:(0,a.jsx)(eP,{size:32,className:"text-white"})}),(0,a.jsx)("h3",{className:"text-2xl font-bold text-slate-900",children:e("partnerProfile.confirmTitle")}),(0,a.jsx)("p",{className:"text-slate-500 mt-2",children:e("partnerProfile.confirmSubtitle")})]}),(0,a.jsxs)("div",{className:"bg-slate-50 rounded-xl p-6 space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[ed.logoPreview?(0,a.jsx)("div",{className:"w-16 h-16 rounded-xl overflow-hidden relative flex-shrink-0",children:(0,a.jsx)(x(),{src:ed.logoPreview,alt:e("partnerProfile.logoAlt"),fill:!0,className:"object-cover"})}):(0,a.jsx)("div",{className:"w-16 h-16 rounded-xl bg-emerald-100 flex items-center justify-center flex-shrink-0",children:(0,a.jsx)(e_,{size:32,className:"text-emerald-600"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-bold text-lg text-slate-900",children:ed.businessName}),(0,a.jsxs)("p",{className:"text-slate-500 text-sm",children:[ed.contactName," • ",ed.email]}),(0,a.jsxs)("p",{className:"text-slate-500 text-sm",children:[ed.headquartersZip,","," ",ed.headquartersState]})]})]}),(0,a.jsxs)("div",{className:"pt-4 border-t border-slate-200",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-slate-700 mb-2",children:e("partnerProfile.servicesColon")}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:ed.services.map(t=>(0,a.jsx)("span",{className:"px-3 py-1 bg-emerald-100 text-emerald-700 rounded-full text-sm font-medium",children:e("partner.services.".concat(t))},t))})]})]}),(0,a.jsx)("div",{className:"p-4 bg-amber-50 border border-amber-200 rounded-xl",children:(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)(ez,{className:"shrink-0 text-amber-600 mt-0.5",size:20}),(0,a.jsxs)("div",{className:"text-sm text-amber-800",children:[(0,a.jsx)("p",{className:"font-semibold mb-2",children:e("partner.disclaimers")}),(0,a.jsxs)("ul",{className:"list-disc pl-4 space-y-1",children:[(0,a.jsx)("li",{children:e("partner.disclaimer1")}
1),(0,a.jsx)("li",{children:e("partner.disclaimer2")}),(0,a.jsx)("li",{children:e("partner.disclaimer3")}),(0,a.jsx)("li",{children:e("partner.disclaimer4")})]})]})]})}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("label",{className:"flex items-start gap-3 cursor-pointer p-4 rounded-xl border border-slate-200 hover:bg-slate-50 transition-colors",children:[(0,a.jsx)("input",{type:"checkbox",className:"w-5 h-5 rounded text-emerald-600 focus:ring-emerald-500 mt-0.5",checked:ed.agreeToDisclaimers,onChange:e=>em({...ed,agreeToDisclaimers:e.target.checked})}),(0,a.jsx)("span",{className:"text-sm text-slate-600",children:e("partner.acceptDisclaimers")})]}),(0,a.jsxs)("label",{className:"flex items-start gap-3 cursor-pointer p-4 rounded-xl border border-slate-200 hover:bg-slate-50 transition-colors",children:[(0,a.jsx)("input",{type:"checkbox",className:"w-5 h-5 rounded text-emerald-600 focus:ring-emerald-500 mt-0.5",checked:ed.agreeToTerms,onChange:e=>em({...ed,agreeToTerms:e.target.checked})}),(0,a.jsxs)("span",{className:"text-sm text-slate-600",children:[e("partner.acceptTerms")," ",(0,a.jsx)("a",{href:"/legal/terms",target:"_blank",className:"text-emerald-600 underline hover:text-emerald-700",children:e("partner.partnerTerms")}),"."]})]})]}),es&&(0,a.jsx)("div",{className:"p-4 bg-red-50 border border-red-200 rounded-xl",children:(0,a.jsx)("p",{className:"text-sm text-red-700",children:es})})]})]}),(0,a.jsxs)("div",{className:"bg-slate-50 px-6 md:px-8 py-5 border-t border-slate-200 flex items-center justify-between",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>{L>0&&A(e=>e-1)},className:"flex items-center gap-2 px-4 py-2 text-slate-600 hover:text-slate-900 font-medium transition-colors",children:[(0,a.jsx)(eE,{size:18}),e("common.back")]}),L<e$.length-1?(0,a.jsxs)("button",{type:"button",onClick:e1,disabled:!e2(L),className:"\n                        flex items-center gap-2 px-6 py-3 rounded-xl font-semibold transition-all\n                        ".concat(e2(L)?"bg-gradient-to-r from-emerald-500 to-teal-500 text-white shadow-lg shadow-emerald-500/25 hover:from-emerald-600 hover:to-teal-600":"bg-slate-200 text-slate-400 cursor-not-allowed","\n                      "),children:[e("common.continue"),(0,a.jsx)(eT,{size:18})]}):(0,a.jsx)("button",{type:"button",onClick:e4,disabled:X||!e2(L),className:"\n                        flex items-center gap-2 px-8 py-3 rounded-xl font-semibold transition-all\n                        ".concat(e2(L)&&!X?"bg-gradient-to-r from-emerald-500 to-teal-500 text-white shadow-lg shadow-emerald-500/25 hover:from-emerald-600 hover:to-teal-600":"bg-slate-200 text-slate-400 cursor-not-allowed","\n                      "),children:X?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("svg",{className:"animate-spin h-5 w-5",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),n?e("partnerProfile.savingProfile"):e("partnerProfile.creatingProfile")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(eP,{size:20}),n?e("partnerProfile.saveProfile"):e("partnerProfile.createPartnerProfile")]})})]})]}),(0,a.jsx)("p",{className:"text-center text-xs text-slate-500 mt-4",children:e("partner.noApprovalRequired")})]})})]})]})}},39948:(e,t,s)=>{"use strict";s.d(t,{x:()=>r});var a=s(81204);function r(){let[e,t]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=window.matchMedia("(prefers-reduced-motion: reduce)");(0,a.startTransition)(()=>{t(e.matches)});let s=e=>{(0,a.startTransition)(()=>{t(e.matches)})};return e.addEventListener("change",s),()=>e.removeEventListener("change",s)},[]),e}},49381:(e,t,s)=>{"use strict";s.d(t,{L:()=>m});var a=s(78488),r=s(81204),l=s(44468);let i=e=>{let{size:t=20,className:s=""}=e;return(0,a.jsxs)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),(0,a.jsx)("path",{fill:"#34A853",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),(0,a.jsx)("path",{fill:"#FBBC05",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),(0,a.jsx)("path",{fill:"#EA4335",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]})},n=e=>{let{size:t=20,className:s=""}=e;return(0,a.jsxs)("svg",{className:"animate-spin ".concat(s),width:t,height:t,viewBox:"0 0 24 24",fill:"none",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})},o=e=>{let{size:t=20,className:s=""}=e;return(0,a.jsx)("svg",{className:s,width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,a.jsx)("polyline",{points:"20 6 9 17 4 12"})})},c="679873712738-2sqcosssudqjp1ejtflqf2gj4vkqsc04.apps.googleusercontent.com\n",d="".concat(window.location.origin,"/partner/oauth/google/callback");function m(e){let{onSuccess:t,onError:s,isConnected:m=!1,buttonText:x,className:u="",scopes:h}=e,{t:p}=(0,l.ok)(),[f,b]=(0,r.useState)(!1),[g,j]=(0,r.useState)(null),v=(0,r.useCallback)(()=>{let e=new URLSearchParams({client_id:c,redirect_uri:d,response_type:"token",scope:h?h.join(" "):"https://www.googleapis.com/auth/business.manage",prompt:"consent",access_type:"online"});return"https://accounts.google.com/o/oauth2/v2/auth?".concat(e.toString())},[h]);(0,r.useEffect)(()=>{let e=e=>{var a,r;if(e.origin===window.location.origin)if((null==(a=e.data)?void 0:a.type)==="GOOGLE_OAUTH_SUCCESS"){let{accessToken:s,expiresIn:a}=e.data,r=new Date(Date.now()+1e3*a).toISOString();b(!1),t({accessToken:s,expiresAt:r}),g&&(g.close(),j(null))}else(null==(r=e.data)?void 0:r.type)==="GOOGLE_OAUTH_ERROR"&&(b(!1),null==s||s(e.data.error||p("reviews.oauth
1Failed")),g&&(g.close(),j(null)))};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[t,s,g,p]),(0,r.useEffect)(()=>{if(!g)return;let e=setInterval(()=>{g.closed&&(b(!1),j(null),clearInterval(e))},500);return()=>clearInterval(e)},[g]);let N=(0,r.useCallback)(()=>{if(!c){null==s||s(p("reviews.oauthNotConfigured"));return}b(!0);let e=window.screenX+(window.outerWidth-500)/2,t=window.screenY+(window.outerHeight-600)/2,a=window.open(v(),"google-oauth","width=".concat(500,",height=").concat(600,",left=").concat(e,",top=").concat(t,",popup=yes"));a?(j(a),a.focus()):(b(!1),null==s||s(p("reviews.oauthPopupBlocked")))},[v,s,p]);return m?(0,a.jsxs)("button",{type:"button",disabled:!0,className:"\n          inline-flex items-center gap-3 px-5 py-3 rounded-xl\n          bg-emerald-50 text-emerald-700 font-medium\n          border border-emerald-200\n          ".concat(u,"\n        "),children:[(0,a.jsx)(o,{size:20,className:"text-emerald-600"}),p("reviews.googleConnectedBtn")]}):(0,a.jsx)("button",{type:"button",onClick:N,disabled:f,className:"\n        inline-flex items-center gap-3 px-5 py-3 rounded-xl\n        bg-white text-slate-700 font-medium\n        border border-slate-300 shadow-sm\n        hover:bg-slate-50 hover:border-slate-400\n        focus:outline-none focus:ring-2 focus:ring-blue-500/20\n        disabled:opacity-50 disabled:cursor-not-allowed\n        transition-all\n        ".concat(u,"\n      "),children:f?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n,{size:20,className:"text-slate-500"}),p("reviews.connecting")]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i,{size:20}),x||p("reviews.connectGoogle")]})})}},61269:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/partner/profile",function(){return s(27545)}])}},e=>{e.O(0,[2140,6773,2192,7365,7204,8268,636,6593,8792],()=>e(e.s=61269)),_N_E=e.O()}]);

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.