PageSourceSearch

https://meetborderless.com/build/assets/edit-DKBdUmL9.js

js meetborderless.com collected 2026-10-09 22:42:18 UTC 18,503 bytes, 1 lines download raw bytes

1import{j as e}from"./app-C1iegf7Q.js";import{h as E,b as u,u as B,H as R,L as C,f as c}from"./inertia-BpyZy4w-.js";import{B as l}from"./button-BE4q1_FS.js";import{I as d}from"./input-DJt0nBB3.js";import{L as a}from"./label-Czc25Mye.js";import{S as z,e as O,f as M,a as U,c as j}from"./select-Bn8hgKYl.js";import{S as h}from"./switch-DhdMz2rn.js";import{T as V}from"./textarea-CXLxrYIG.js";import{a as K}from"./admin-layout-BhXWbUlP.js";import{A as Y}from"./arrow-left-DCX0fhKH.js";import{E as S}from"./external-link-avvfS30C.js";import{L as A}from"./log-in-Dg2nNREu.js";import{S as f}from"./shield-check-CdWPLoDE.js";import{C as g}from"./circle-check-big-AJlsIacq.js";import{C as P}from"./circle-x-Bp6Mbpgt.js";import{U as q}from"./user-x-B--CBM7t.js";import{M as H}from"./mail-Dwbp3545.js";/* empty css            */import"./index-CGXdj8xB.js";import"./utils-BiuKVCuu.js";import"./index-DdRFMukF.js";import"./index-BdQq_4o_.js";import"./index-Dc_FVRD7.js";import"./index-B0NHTN87.js";import"./index-C48dRAib.js";import"./index-BDqbV96p.js";import"./index-Cja0wFUH.js";import"./index-CL12STDK.js";import"./Combination-Cr5kvm8y.js";import"./index-C_n-C52S.js";import"./index-D4vO54bj.js";import"./index-BRU_LjHB.js";import"./index-XydtsrKA.js";import"./index-Cs5D2gCo.js";import"./index-DyGg2PJd.js";import"./chevron-down-B1YaU0K5.js";import"./createLucideIcon-wqc1LSWg.js";import"./check-0O-UND6N.js";import"./chevron-up-CLp5HMgA.js";import"./app-logo-Dz0wogSq.js";import"./logo-light-DU4bWymm.js";import"./flash-toast-C6O0iVL1.js";import"./info-D2ZN_yLm.js";import"./triangle-alert-C7AVwNi-.js";import"./circle-check-BMWvzPMx.js";import"./x-DQSeRCcH.js";import"./menu-BR3Nc3Gr.js";import"./users-BCcupCXV.js";import"./folder-open-I72SPUVk.js";import"./pound-sterling-D16GLaAZ.js";import"./book-open-DVFlG_9t.js";function Ye(){const{props:T}=E(),{provider:r,portalAccess:o,verification:n}=T,[p,b]=u.useState(""),[_,y]=u.useState(""),{data:t,setData:i,patch:I,processing:L,errors:m}=B({name:r.name,bio:r.bio||"",avatar:r.avatar||"",title:r.title||"",stripe_connect_id:r.stripe_connect_id||"",stripe_onboarding_complete:r.stripe_onboarding_complete,manual_payout_override:r.manual_payout_override,specialties:r.specialties||[],credentials:r.credentials||[],provider_type:r.provider_type||"specialist",is_featured:r.is_featured,is_active:r.is_active,sort_order:r.sort_order?.toString()||"",platform_fee_percent:r.platform_fee_percent!=null?String(r.platform_fee_percent):"",payout_delay_days:r.payout_delay_days!=null?String(r.payout_delay_days):"",agreement_terms:r.agreement_terms||[]}),[x,N]=u.useState(""),k=()=>{x.trim()&&!t.agreement_terms.includes(x.trim())&&(i("agreement_terms",[...t.agreement_terms,x.trim()]),N(""))},F=s=>{i("agreement_terms",t.agreement_terms.filter(v=>v!==s))},$=s=>{s.preventDefault(),I(`/admin/providers/${r.slug}`)},w=()=>{p.trim()&&!t.specialties.includes(p.trim())&&(i("specialties",[...t.specialties,p.trim()]),b(""))},D=s=>{i("specialties",t.specialties.filter(v=>v!==s))};return e.jsxs(K,{children:[e.jsx(R,{title:`Edit ${r.name} · Admin`}),e.jsxs("div",{className:"mx-auto max-w-4xl px-4 py-5 sm:px-6 sm:py-7",children:[e.jsxs("div",{className:"mb-5 flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs(C,{href:"/admin/providers",className:"mb-2 inline-flex items-center gap-1 text-xs font-medium text-ink-3 hover:text-ink",children:[e.jsx(Y,{className:"h-3.5 w-3.5"}),"Back to providers"]}),e.jsxs("h1",{className:"text-xl font-semibold text-ink",children:["Edit Provider: ",r.name]})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[r.is_active&&e.jsx("a",{href:`/specialists/${r.slug}`,target:"_blank",rel:"noopener noreferrer",children:e.jsxs(l,{variant:"outline",size:"sm",children:[e.jsx(S,{className:"mr-2 h-4 w-4"}),"View page"]})}),o.has_access&&e.jsxs(l,{variant:"outline",size:"sm",onClick:()=>{confirm(`Log in as ${o.user_name}? You will see their provider dashboard.`)&&c.post(`/admin/providers/${r.slug}/impersonate`)},children:[e.jsx(A,{className:"mr-2 h-4 w-4"}),"Impersonate"]})]})]}),e.jsxs("div",{className:"space-y-5",children:[r.approval_status==="pending"&&e.jsxs("div",{className:"rounded-card border border-amber/30 bg-amber/12 p-5",children:[e.jsxs("h2",{className:"mb-3 flex items-center gap-2 text-sm font-semibold text-amber-ink",children:[e.jsx(f,{className:"h-5 w-5"}),"Application Pending Review"]}),e.jsx("p",{className:"mb-4 text-sm text-ink-2",children:"This provider submitted an application and is awaiting approval."}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(l,{variant:"default",onClick:()=>{confirm("Approve this provider application?")&&c.post(`/admin/providers/${r.slug}/approve`,{},{preserveScroll:!0})},children:[e.jsx(g,{className:"mr-2 h-4 w-4"}),"Approve"]}),e.jsxs(l,{variant:"destructive",onClick:()=>{const s=prompt("Enter rejection reason:");s&&c.post(`/admin/providers/${r.slug}/reject`,{rejection_reason:s},{preserveScroll:!0})},children:[e.jsx(P,{className:"mr-2 h-4 w-4"}),"Reject"]})]})]}),r.approval_status==="rejected"&&e.jsxs("div",{className:"rounded-card border border-red/30 bg-red/10 p-5",children:[e.jsxs("h2",{className:"mb-3 flex items-center gap-2 text-sm font-semibold text-red",children:[e.jsx(P,{className:"h-5 w-5"}),"Application Rejected"]}),e.jsxs("p",{className:"text-sm text-ink-2",children:[e.jsx("strong",{children:"Reason:"})," ",r.rejection_reason||"No reason provided"]})]}),e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsxs("h2",{className:"mb-4 flex items-center gap-2 text-sm font-semibold text-ink",children:[e.jsx(f,{className:"h-5 w-5"}),"Credential verification"]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-3 text-sm md:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Regulator"}),e.jsx("div",{className:"mt-1 text-sm font-medium text-ink",children:n.regulator_name??"Not declared"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Registration number"}),e.jsxs("div",{className:"mt-1 text-sm font-medium text-ink",children:[n.regulator_ref??"—",n.regulator_level?` (Level ${n.regulator_level})`:""]})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"PI insurance"}),e.jsx("div",{className:"mt-1 text-sm font-medium text-ink",children:n.pi_insurance_confirmed?"Confirmed":"Not confirmed"})]}),e.jsxs("div",{children:[e.jsx("span",{className:"text-2xs font-bold uppercase tracking-eyebrow text-ink-3",children:"Agreement"}),e.jsx("div",{className:"mt-1 text-sm font-medium text-ink",children:n.agreement_signed?"Signed":"Not signed"})]})]}),n.register_url&&e.jsxs("a",{href:n.register_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-sm text-teal hover:underline",children:["Open the official register",e.jsx(S,{className:"h-3.5 w-3.5"})]}),n.status==="verified"?e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-lg border border-green/30 bg-green/10 p-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{className:"h-5 w-5 text-green-ink"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-green-ink",children:"Credentials verified"}),n.verified_at&&e.jsxs("p",{className:"text-sm text-ink-3",children:["by ",n.verified_by_name??"an admin"," on"," ",new Date(n.verified_at).toLocaleDateString()]})]})]}),e.jsx(l,{variant:"outline",size:"sm",onClick:()=>{confirm("Remove credential verification?")&&c.delete(`/admin/providers/${r.slug}/verify-credentials`,{preserveScroll:!0})},children:"Unverify"})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsx("p",{className:"text-sm text-ink-3",children:n.regulator_ref?"Check the declared registration on the official register, then mark it verified. This earns the specialist their verified badge.":"This specialist has not declared a regulator yet, so there is nothing to verify."}),e.jsxs(l,{size:"sm",disabled:!n.regulator_ref,onClick:()=>c.post(`/admin/providers/${r.slug}/verify-credentials`,{},{preserveScroll:!0}),children:[e.jsx(g,{className:"mr-2 h-4 w-4"}),"Mark credentials verified"]})]})]})]}),e.jsxs("form",{onSubmit:$,className:"space-y-5",children:[e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-ink",children:"Basic Information"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{htmlFor:"name",children:"Name *"}),e.jsx(d,{id:"name",value:t.name,onChange:s=>i("name",s.target.value)}),m.name&&e.jsx("p",{className:"mt-1 text-xs text-red",children:m.name})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{htmlFor:"title",children:"Title"}),e.jsx(d,{id:"title",value:t.title,onChange:s=>i("title",s.target.value)})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{htmlFor:"bio",children:"Bio"}),e.jsx(V,{id:"bio",value:t.bio,onChange:s=>i("bio",s.target.value),rows:4})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{htmlFor:"avatar",children:"Avatar URL"}),e.jsx(d,{id:"avatar",value:t.avatar,onChange:s=>i("avatar",s.target.value)})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{children:"Specialties"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{value:p,onChange:s=>b(s.target.value),placeholder:"Add specialty...",onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),w())}}),e.jsx(l,{type:"button",variant:"outline",onClick:w,children:"Add"})]}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:t.specialties.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-tag bg-bg-2 px-2 py-1 text-sm text-ink-2",children:[s,e.jsx("button",{type:"button",onClick:()=>D(s),className:"text-ink-3 hover:text-red",children:"×"})]},s))})]})]})]}),e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-ink",children:"Stripe Connect"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{htmlFor:"stripe_connect_id",children:"Stripe Connect Account ID"}),e.jsx(d,{id:"stripe_connect_id",value:t.stripe_connect_id,onChange:s=>i("stripe_connect_id",s.target.value),placeholder:"acct_..."})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{id:"stripe_onboarding_complete",checked:t.stripe_onboarding_complete,onCheckedChange:s=>i("stripe_onboarding_complete",s)}),e.jsx(a,{htmlFor:"stripe_onboarding_complete",children:"Stripe Onboarding Complete"})]}),e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50 p-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{id:"manual_payout_override",checked:t.manual_payout_override,onCheckedChange:s=>i("manual_payout_override",s)}),e.jsx(a,{htmlFor:"manual_payout_override",className:"font-medium",children:"Manual Payout Override"})]}),e.jsx("p",{className:"mt-1.5 text-xs text-amber-700",children:"Bypasses Stripe Connect requirement. Client payments go to the platform account and payouts are handled manually. Only enable for providers onboarding without Stripe Connect."})]})]})]}),e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-ink",children:"Provider Type & Display Settings"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{htmlFor:"provider_type",children:"Provider Type *"}),e.jsxs(z,{value:t.provider_type,onValueChange:s=>i("provider_type",s),children:[e.jsx(O,{children:e.jsx(M,{})}),e.jsxs(U,{children:[e.jsx(j,{value:"specialist",children:"Specialist (Public Profile)"}),e.jsx(j,{value:"partner",children:"Partner (Borderless Services)"}),e.jsx(j,{value:"team",children:"Team (Borderless first-party)"})]})]}),e.jsx("p",{className:"text-xs text-ink-3",children:t.provider_type==="partner"?"Partner providers work behind the scenes for Borderless services. Their identity is hidden from users.":t.provider_type==="team"?"The Borderless first-party account. Exempt from KYC payout gate and excluded from public search. Only one team provider should exist.":"Specialist providers have public profiles and users book directly with them."})]}),e.jsxs("div",{className:"flex items-center gap-4 border-t border-line pt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{id:"is_active",checked:t.is_active,onCheckedChange:s=>i("is_active",s)}),e.jsx(a,{htmlFor:"is_active",children:"Active"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{id:"is_featured",checked:t.is_featured,onCheckedChange:s=>i("is_featured",s)}),e.jsx(a,{htmlFor:"is_featured",children:"Featured"})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{htmlFor:"sort_order",children:"Sort Order"}),e.jsx(d,{id:"sort_order",type:"number",value:t.sort_order,onChange:s=>i("sort_order",s.target.value),className:"max-w-[120px]"})]})]})]}),e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-ink",children:"Commercial terms"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{htmlFor:"platform_fee_percent",children:"Platform fee (%)"}),e.jsx(d,{id:"platform_fee_percent",type:"number",step:"0.01",min:"0",max:"100",value:t.platform_fee_percent,onChange:s=>i("platform_fee_percent",s.target.value),placeholder:"Default (10%)"}),m.platform_fee_percent&&e.jsx("p",{className:"mt-1 text-xs text-red",children:m.platform_fee_percent}),e.jsx("p",{className:"text-xs text-ink-3",children:"Leave blank to use the platform default. Changing this re-prompts the specialist to accept the new terms."})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{htmlFor:"payout_delay_days",children:"Payout delay (days)"}),e.jsx(d,{id:"payout_delay_days",type:"number",min:"0",max:"90",value:t.payout_delay_days,onChange:s=>i("payout_delay_days",s.target.value),placeholder:"Default (7)"}),m.payout_delay_days&&e.jsx("p",{className:"mt-1 text-xs text-red",children:m.payout_delay_days})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(a,{children:"Bespoke clauses"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(d,{value:x,onChange:s=>N(s.target.value),placeholder:"Add a bespoke clause...",onKeyDown:s=>{s.key==="Enter"&&(s.preventDefault(),k())}}),e.jsx(l,{type:"button",variant:"outline",onClick:k,children:"Add"})]}),e.jsx("div",{className:"mt-2 flex flex-col gap-2",children:t.agreement_terms.map(s=>e.jsxs("span",{className:"inline-flex items-center justify-between gap-2 rounded-tag bg-bg-2 px-3 py-2 text-sm text-ink-2",children:[s,e.jsx("button",{type:"button",onClick:()=>F(s),className:"shrink-0 text-ink-3 hover:text-red",children:"×"})]},s))})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-4",children:[e.jsx(l,{type:"button",variant:"outline",asChild:!0,children:e.jsx(C,{href:"/admin/providers",children:"Cancel"})}),e.jsx(l,{type:"submit",disabled:L,children:"Save Changes"})]})]}),e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsxs("h2",{className:"mb-4 flex items-center gap-2 text-sm font-semibold text-ink",children:[e.jsx(f,{className:"h-5 w-5"}),"Provider Portal Access"]}),o.has_access?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-green/30 bg-green/10 p-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-green-ink",children:"Portal access active"}),e.jsxs("p",{className:"mt-1 text-sm text-ink-3",children:["Linked to ",e.jsx("strong",{children:o.user_name})," (",o.user_email,")"]})]}),e.jsx("span",{className:"rounded-tag bg-green/10 px-2 py-0.5 text-2xs font-bold text-green-ink",children:"Active"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(l,{variant:"outline",size:"sm",onClick:()=>{confirm(`
1Log in as ${o.user_name}? You will see their provider dashboard.`)&&c.post(`/admin/providers/${r.slug}/impersonate`)},children:[e.jsx(A,{className:"mr-2 h-4 w-4"}),"Impersonate"]}),e.jsxs(l,{variant:"destructive",size:"sm",onClick:()=>{confirm("Are you sure you want to revoke portal access? The provider will no longer be able to log in.")&&c.delete(`/admin/providers/${r.slug}/revoke`,{preserveScroll:!0})},children:[e.jsx(q,{className:"mr-2 h-4 w-4"}),"Revoke Access"]})]})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-ink-3",children:"Invite this provider to the portal so they can manage their clients' checklists directly. They'll receive an email to set their password and log in."}),e.jsxs("form",{onSubmit:s=>{s.preventDefault(),c.post(`/admin/providers/${r.slug}/invite`,{email:_},{preserveScroll:!0,onSuccess:()=>y("")})},className:"flex gap-2",children:[e.jsx(d,{type:"email",value:_,onChange:s=>y(s.target.value),placeholder:"[email protected]",className:"max-w-sm",required:!0}),e.jsxs(l,{type:"submit",children:[e.jsx(H,{className:"mr-2 h-4 w-4"}),"Send Invite"]})]})]})]}),e.jsxs("div",{className:"rounded-card border border-line bg-white p-5",children:[e.jsx("h2",{className:"mb-4 text-sm font-semibold text-ink",children:"Services"}),e.jsxs("div",{className:"space-y-6",children:[e.jsx("p",{className:"text-sm text-ink-3",children:"Services are managed by the specialist from their own account. This list is read-only."}),r.services&&r.services.length>0?e.jsx("div",{className:"space-y-4",children:r.services.map(s=>e.jsx("div",{className:"rounded-lg border border-line p-4",children:e.jsxs("div",{children:[e.jsx("h4",{className:"font-medium text-ink",children:s.title}),e.jsxs("p",{className:"text-sm text-ink-3",children:[s.service_type==="virtual"?"Virtual":"In-Person"," •"," ",s.duration_minutes," min • £",s.price_gbp]}),s.description&&e.jsx("p",{className:"mt-1 text-sm text-ink-2",children:s.description})]})},s.id))}):e.jsx("p",{className:"py-4 text-center text-sm text-ink-3",children:"No services yet"})]})]})]})]})]})}export{Ye as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.