PageSourceSearch

https://delivr.to/assets/Settings-CczMcXsl.js

js delivr.to collected 2026-10-03 22:11:07 UTC 61,273 bytes, 8 lines download raw bytes

1import{j as e}from"./query-DmstuUoN.js";import{a as u,i as Ge}from"./vendor-CHI41uxr.js";import{L as v,T as Ve,a as Re,b as Be,c as le}from"./tabs-C7WAY928.js";import{c as G,u as ae,ae as Ne,y as b,z as w,A as S,a1 as k,B as x,k as se,E as N,L as O,t as xe,v as me,w as he,x as z,O as Le,$ as ie,P as ye,R as we,ai as Ye,a7 as Se,D as V,d as R,e as B,f as Y,g as H,h as L,a0 as He,U as qe,l as $e,H as ce,J as We}from"./index-BNXzEUcY.js";import{u as Je}from"./useDocumentTitle-BOGfSQQj.js";import{S as Ee}from"./separator-DUsDTrP6.js";import{B as C}from"./badge-XJ-ekfky.js";import{T as ue,a as pe,b as K,c as A,d as je,e as P,C as Qe}from"./table-CUu4M3zy.js";import{A as q,a as $,b as W,c as J,d as Q,e as X,f as Z,g as ee}from"./alert-dialog-DR35OEje.js";import{u as Xe,A as Ze,a as es,J as ss,b as de,c as ke,d as Ce,e as as,f as ne,g as ts,h as rs,i as is,j as ns,k as ls,l as cs}from"./JoinTeamCard-BgcWRebY.js";import{M as ve}from"./mail-Dk4-qTC8.js";import{P as Ke}from"./plus-C8Medqfj.js";import{M as ge}from"./more-horizontal-BReLZdfI.js";import{T as te}from"./trash-2-qulV6ogM.js";import{L as M}from"./loader-2-RpObhsNd.js";import{C as ds}from"./clock-DzhGAESw.js";import{E as os}from"./external-link-C0FWOmYM.js";import{S as Ae,a as Pe,b as _e,c as De,d as Me}from"./select-5kNhwI7E.js";import{a as Ie,S as Oe}from"./ServiceIcon-CrwT3mpk.js";import{I as D}from"./input-CnDjsPPe.js";import{S as Ue}from"./send-DlDUKo71.js";import{S as be}from"./shield-B2DJRLUB.js";import{S as xs,L as ms}from"./switch-CytVYzhY.js";import{C as hs}from"./checkbox-CLrZ-oDk.js";import"./ui-WgsiDFN4.js";import"./check-circle-2-BXloP0hd.js";const ze=G("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);const us=G("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);const fe=G("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);const Te=G("PowerOff",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);const Fe=G("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);const ps=G("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);const oe=G("ShieldCheck",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);function js(){const{data:s}=ae(),{data:g=[],isLoading:a}=Ne(),t=Xe(),r=g.filter(_=>_.type==="user"||_.type==="validated"),[i,c]=u.useState(!1),[o,n]=u.useState(null),[p,j]=u.useState(!1),m=()=>{o&&t.mutate(o,{onSuccess:()=>n(null)})},d=_=>{const f=l(_);switch(_){case"user":return e.jsx(C,{variant:"secondary",children:f});case"user_validated":return e.jsx(C,{className:"bg-primary text-white hover:bg-primary/80 dark:text-primary-foreground dark:hover:bg-primary/80",children:f});case"team":return e.jsx(C,{variant:"outline",children:f});case"team_validated":return e.jsx(C,{className:"bg-success text-white hover:bg-success/80 dark:text-success-foreground dark:hover:bg-success/80",children:f});case"validated":return e.jsx(C,{className:"bg-success text-white hover:bg-success/80 dark:text-success-foreground dark:hover:bg-success/80",children:f});case"team_user":return e.jsx(C,{variant:"secondary",children:f});default:return e.jsx(C,{variant:"secondary",children:f})}},l=_=>_.split("_").map(f=>f.charAt(0).toUpperCase()+f.slice(1).toLowerCase()).join(" "),h=s?.subscription_status==="Starter",I=s?.subscription_status==="Premium",U=s?.subscription_status==="Enterprise",E=s?.subscription_status==="Trial",T=U?1/0:I||E?2:h?1:0,y=r.length>=T,F=!y,re=y&&!U;return e.jsxs(e.Fragment,{children:[e.jsxs(b,{children:[e.jsx(w,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs(S,{className:"flex items-center gap-2",children:[e.jsx(ve,{className:"h-5 w-5"}),"Validated Emails"]}
1),e.jsxs(k,{children:["Email addresses you can send campaigns to."," ",e.jsx("a",{href:"https://docs.delivr.to/docs/gettingstarted/adding_a_validated_email.html",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Learn more"})]})]}),re?e.jsxs(x,{onClick:()=>j(!0),size:"sm",variant:"outline",className:"border-primary/50",children:[e.jsx(se,{className:"mr-2 h-4 w-4 text-primary"}),"Upgrade to Add More"]}):e.jsxs(x,{onClick:()=>c(!0),disabled:!F,size:"sm",children:[e.jsx(Ke,{className:"mr-2 h-4 w-4"}),"Add New"]})]})}),e.jsxs(N,{children:[h&&e.jsx("div",{className:"mb-4 rounded-md bg-muted p-3 text-sm text-muted-foreground",children:"Premium and Enterprise users can send payloads to more than one email address."}),a?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(O,{size:32})}):r.length===0?e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"No validated emails yet. Add one to start sending campaigns."}):e.jsxs(ue,{children:[e.jsx(pe,{children:e.jsxs(K,{children:[e.jsx(A,{children:"Email"}),e.jsx(A,{children:"Type"}),e.jsx(A,{className:"w-[50px]"})]})}),e.jsx(je,{children:r.map(_=>e.jsxs(K,{children:[e.jsx(P,{className:"font-medium",children:_.email}),e.jsx(P,{children:d(_.type)}),e.jsx(P,{children:_.deletable&&e.jsxs(xe,{children:[e.jsx(me,{asChild:!0,children:e.jsx(x,{variant:"ghost",size:"icon",className:"h-8 w-8",children:e.jsx(ge,{className:"h-4 w-4"})})}),e.jsx(he,{align:"end",children:e.jsxs(z,{className:"text-destructive focus:text-destructive",onClick:()=>n(_.email),children:[e.jsx(te,{className:"mr-2 h-4 w-4"}),"Delete"]})})]})})]},_.email))})]})]})]}),e.jsx(Ze,{open:i,onOpenChange:c}),e.jsx(Le,{open:p,onOpenChange:j,feature:"more validated emails",requiredTier:h?"premium":"enterprise"}),e.jsx(q,{open:!!o,onOpenChange:()=>n(null),children:e.jsxs($,{children:[e.jsxs(W,{children:[e.jsx(J,{children:"Delete Validated Email"}),e.jsxs(Q,{children:["Are you sure you want to remove ",e.jsx("strong",{children:o})," ","from your validated emails? You won't be able to send campaigns to this address anymore."]})]}),e.jsxs(X,{children:[e.jsx(Z,{children:"Cancel"}),e.jsxs(ee,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[t.isPending?e.jsx(M,{className:"h-4 w-4 mr-2 animate-spin"}):null,"Delete"]})]})]})})]})}function gs(){const s=es(),[g,a]=u.useState(!1),t=()=>{s.mutate(void 0,{onSuccess:()=>{window.location.href="/auth/logout"}})};return e.jsxs(e.Fragment,{children:[e.jsxs(b,{className:"border-destructive/50",children:[e.jsxs(w,{children:[e.jsxs(S,{className:"flex items-center gap-2 text-destructive",children:[e.jsx(ie,{className:"h-5 w-5"}),"Close Account"]}),e.jsx(k,{children:"Permanently delete your account and all associated data."})]}),e.jsxs(N,{children:[e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"This action is irreversible. All your campaigns, templates, integrations, and other data will be permanently deleted."}),e.jsxs(x,{variant:"destructive",onClick:()=>a(!0),children:[e.jsx(te,{className:"mr-2 h-4 w-4"}
1),"Delete My Account"]})]})]}),e.jsx(q,{open:g,onOpenChange:a,children:e.jsxs($,{children:[e.jsxs(W,{children:[e.jsxs(J,{className:"flex items-center gap-2",children:[e.jsx(ie,{className:"h-5 w-5 text-destructive"}),"Are you absolutely sure?"]}),e.jsxs(Q,{className:"space-y-2",children:[e.jsxs("p",{children:["This action ",e.jsx("strong",{children:"cannot be undone"}),". This will permanently delete your account and remove all your data from our servers."]}),e.jsx("p",{children:"This includes:"}),e.jsxs("ul",{className:"list-disc list-inside text-sm mt-2 space-y-1",children:[e.jsx("li",{children:"All campaign results and history"}),e.jsx("li",{children:"Custom payloads and templates"}),e.jsx("li",{children:"Integrations and validated emails"}),e.jsx("li",{children:"API keys and webhook configurations"})]})]})]}),e.jsxs(X,{children:[e.jsx(Z,{disabled:s.isPending,children:"Cancel"}),e.jsxs(ee,{onClick:t,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",disabled:s.isPending,children:[s.isPending&&e.jsx(M,{className:"h-4 w-4 mr-2 animate-spin"}),"Yes, delete my account"]})]})]})})]})}function fs({status:s,showIcon:g=!0,className:a=""}){const r=(()=>{switch(s){case"Enterprise":return{variant:"default",icon:we,className:"bg-chart-purple text-white hover:bg-chart-purple/90"};case"Premium":return{variant:"default",icon:se,className:"bg-primary text-primary-foreground hover:bg-primary/90"};case"Starter":return{variant:"outline",icon:ye,className:""};case"Trial":return{variant:"secondary",icon:ds,className:""};case"Trial Expired":return{variant:"destructive",icon:ie,className:""};default:return{variant:"outline",icon:ye,className:""}}})(),i=r.icon;return e.jsxs(C,{variant:r.variant,className:`${r.className} ${a}`,children:[g&&e.jsx(i,{className:"h-3 w-3 mr-1"}),s]})}function ys(){const{isLoading:s}=ae();return s?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(O,{size:32})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[e.jsx(vs,{}),e.jsx(ss,{})]}),e.jsx(js,{}),e.jsx(gs,{})]})}function vs(){const{data:s}=ae(),{data:g}=Ye(),a=g?.starter_checkout_url||s?.checkout_url,t=g?.premium_checkout_url||s?.checkout_url,r=j=>new Date(j*1e3).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),i=()=>{if(!s)return null;const j=s.subscription_status,m=s.subscription_renews&&s.subscription_renews>0?r(s.subscription_renews):null;switch(j){case"Trial":{const d=s.trial_expires_in,l=d!==void 0&&d>=0?`${d} day${d!==1?"s":""} remaining`:"Trial active";return e.jsxs("div",{className:"flex items-center gap-2 text-amber-600",children:[e.jsx(ie,{className:"h-4 w-4"}),e.jsxs("span",{children:[l,". Upgrade to unlock all features."]})]})}case"Trial Expired":return e.jsxs("div",{className:"flex items-center gap-2 text-destructive",children:[e.jsx(ie,{className:"h-4 w-4"}),e.jsx("span",{children:"Your trial has expired. Upgrade to regain access."})]});case"Enterprise":return e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx("p",{children:"You have access to all features."}),m&&e.jsxs("p",{className:"text-sm mt-1",children:["Renews on ",m]})]});case"Premium":return e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx("p",{children:"Premium plan - enjoy enhanced features."}),m&&e.jsxs("p",{className:"text-sm mt-1",children:["Renews on ",m]})]});case"Starter":return e.jsxs("div",{className:"text-muted-foreground",children:[e.jsx("p",{children:"Starter plan - upgrade for more features."}),m&&e.jsxs("p",{className:"text-sm mt-1",children:["Renews on ",m]})]});default:return null}},c=s?.subscription_status==="Trial"||s?.subscription_status==="Trial Expired"||s?.subscription_status==="Starter"||s?.subscription_status==="Premium"||s?.subscription_status==="Free",o=s?.subscription_status==="Trial"||s?.subscription_status==="Trial Expired"||s?.subscription_status==="Starter"||s?.subscription_status==="Free",n=s?.subscription_status==="Trial"||s?.subscription_status==="Trial Expired"||s?.subscription_status==="Free",p=c||o||n;return e.jsxs(b,{className:"h-full",children:[e.jsx(w,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx(S,{children:"Subscription"}),e.jsx(k,{children:"Manage your subscription plan"})]}),s&&e.jsx(fs,{status:s.subscription_status})]})}),e.jsxs(N,{className:"space-y-4",children:[i(),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Emails Sent"}),e.jsx("p",{className:"text-2xl font-bold",children:s?.total_email_count??0})]}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:"Downloads"}),e.jsx("p",{className:"text-2xl font-bold",children:s?.total_download_count??0})]})]}),e.jsx(Ee,{}),e.jsx("div",{className:"flex flex-wrap gap-2",children:s?.portal_url&&s.portal_url!=="none"&&e.jsx(x,{variant:"outline",asChild:!0,children:e.jsxs("a",{href:s.portal_url,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(us,{className:"mr-2 h-4 w-4"}),"Manage Subscription",e.jsx(os,{className:"ml-2 h-3 w-3"})]})})}),p&&e.jsxs(e.Fragment,{children:[e.jsx(Ee,{}),e.jsxs("div",{className:"flex flex-wrap gap-4",children:[n&&e.jsxs(b,{className:"min-w-[200px] flex-1 flex flex-col",children:[e.jsxs(w,{className:"pb-2",children:[e.jsxs(S,{className:"text-lg flex items-center gap-2",children:[e.jsx(ye,{className:"h-4 w-4 text-muted-foreground"}),"Starter"]}),e.jsx(k,{children:"£99/mo or £999/yr"})]}),e.jsxs(N,{className:"space-y-2 flex-1 flex flex-col",children:[e.jsxs("ul",{className:"text-sm space-y-1 text-muted-foreground flex-1",children:[e.jsx("li",{children:"✓ 100 emails daily"}),e.jsx("li",{children:"✓ 10 downloads daily"}),e.jsx("li",{children:"✓ 1 validated email"})]}),a?e.jsx(x,{variant:"outline",className:"w-full mt-2",asChild:!0,children:e.jsx("a",{href:a,target:"_blank",rel:"noopener noreferrer",children:"Upgrade to Starter"})}):e.jsx(x,{variant:"outline",className:"w-full mt-2",disabled:!0,children:"Upgrade to Starter"})]})]}),o&&e.jsxs(b,{className:"min-w-[200px] flex-1 border-primary/50 flex flex-col",children:[e.jsxs(w,{className:"pb-2",children:[e.jsxs(S,{className:"text-lg flex items-center gap-2",children:[e.jsx(se,{className:"h-4 w-4 text-primary"}),"Premium"]}),e.jsx(k,{children:"£299/mo or £2,999/yr"})]}),e.jsxs(N,{className:"space-y-2 flex-1 flex flex-col",children:[e.jsxs("ul",{className:"text-sm space-y-1 text-muted-foreground flex-1",children:[e.jsx("li",{children:"✓ 2000 emails daily"}),e.jsx("li",{children:"✓ Unlimited downloads"}),e.jsx("li",{children:"✓ 2 validated emails"}),e.jsx("li",{children:"✓ Mailbox integrations"}),e.jsx("li",{children:"✓ Security tool integrations"}),e.jsx("li",{children:"✓ Developer API"})]}),t?e.jsx(x,{className:"w-full mt-2",asChild:!0,children:e.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",children:"Upgrade to Premium"})}):e.jsx(x,{className:"w-full mt-2",disabled:!0,children:"Upgrade to Premium"})]})]}),c&&e.jsxs(b,{className:"min-w-[200px] flex-1 border-chart-purple/50 flex flex-col",children:[e.jsxs(w,{className:"pb-2",children:[e.jsxs(S,{className:"text-lg flex items-center gap-2",children:[e.jsx(we,{className:"h-4 w-4 text-chart-purple"}),"Enterprise"]}),e.jsx(k,{children:"Custom pricing"})]}),e.jsxs(N,{className:"space-y-2 flex-1 flex flex-col",children:[e.jsxs("ul",{className:"text-sm space-y-1 text-muted-foreground flex-1",children:[e.jsx("li",{children:"✓ Unlimited emails"}),e.jsx("li",{children:"✓ Unlimited downloads"}),e.jsx("li",{children:"✓ Unlimited validated emails"}),e.jsx("li",{children:"✓ Team collaboration"}),e.jsx("li",{children:"✓ Custom payloads"}),e.jsx("li",{children:"✓ Priority support"})]}),e.jsx(x,{variant:"outline",className:"w-full mt-2 border-chart-purple/50 hover:bg-chart-purple/10",asChild:!0,children:e.jsx("a",{href:"mailto:[email protected]?subject=Enterprise%20Enquiry",children:"Contact Sales"})})]})]})]})]})]})]})}const bs=()=>e.jsxs("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",children:[e.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"}),e.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"}),e.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"}),e.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"})]}),Ns=()=>e.jsxs("svg",{className:"h-5 w-5",viewBox:"0 0 23 23",children:[e.jsx("rect",{fill:"#f25022",x:"1",y:"1",width:"10",height:"10"}),e.jsx("rect",{fill:"#00a4ef",x:"1",y:"12",width:"10",height:"10"}),e.jsx("rect",{fill:"#7fba00",x:"12",y:"1",width:"10",height:"10"}),e.jsx("rect",{fill:"#ffb900",x:"12",y:"12",width:"10",height:"10"})]});function ws(){const{data:s=[],isLoading:g}=de("mailbox"),{data:a=[]}=Ne(),t=ke(),r=Ce(),i=as(),[c,o]=u.useState(""),[n,p]=u.useState(null),j=h=>{c&&i.mutate({email:c,service:h},{onSuccess:I=>{window.location.href=I}})},m=()=>{n&&t.mutate(n.id,{onSuccess:()=>p(null)})},d=h=>{r.mutate({integrationId:h.id,enabled:!h.enabled})},l=h=>h.enabled?h.status==="active"?e.jsx(C,{className:"bg-success text-white hover:bg-success/80 dark:text-[#134e45] dark:hover:bg-success/80",children:"Active"}):e.jsx(C,{className:"bg-destructive text-white hover:bg-destructive/80 dark:text-[#7f1d1d] dark:hover:bg-destructive/80",children:"Error"}):e.jsx(C,{className:"bg-gray-300 text-gray-700 hover:bg-gray-400 dark:bg-gray-600 dark:text-gray-200 dark:hover:bg-gray-500",children:"Disabled"});return e.jsxs("div",{className:"relative flex-1 flex flex-col",children:[i.isPending&&e.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-background/80 backdrop-blur-sm rounded-lg",children:e.jsxs("div",{className:"text-center space-y-3",children:[e.jsx(O,{size:48,className:"mx-auto text-primary"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Initiating OAuth flow..."})]})}),e.jsxs("div",{className:`flex-1 flex flex-col ${i.isPending?"pointer-events-none":""}`,children:[g?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(O,{size:32})}):s.length>0?e.jsxs(ue,{children:[e.jsx(pe,{children:e.jsxs(K,{children:[e.jsx(A,{children:"Email"}),e.jsx(A,{children:"Service"}),e.jsx(A,{children:"Status"}),e.jsx(A,{className:"w-[50px]"})]})}),e.jsx(je,{children:s.map(h=>e.jsxs(K,{children:[e.jsx(P,{className:"font-medium",children:h.email}),e.jsx(P,{children:e.jsx(Ie,{service:h.integration_type})}),e.jsx(P,{children:l(h)}),e.jsx(P,{children:e.jsxs(xe,{children:[e.jsx(me,{asChild:!0,children:e.jsx(x,{variant:"ghost",size:"icon",className:"h-8 w-8",children:e.jsx(ge,{className:"h-4 w-4"})})}),e.jsxs(he,{align:"end",children:[e.jsx(z,{onClick:()=>d(h),children:h.enabled?e.jsxs(e.Fragment,{children:[e.jsx(Te,{className:"mr-2 h-4 w-4"}),"Disable"]}):e.jsxs(e.Fragment,{children:[e.jsx(Fe,{className:"mr-2 h-4 w-4"}),"Enable"]})}),h.deletable&&e.jsxs(e.Fragment,{children:[e.jsx(Se,{}),e.jsxs(z,{className:"text-destructive focus:text-destructive",onClick:()=>p(h),children:[e.jsx(te,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]})})]}
1,h.id))})]}):e.jsx("div",{className:"text-center py-4 text-muted-foreground text-sm",children:"No mailbox integrations configured."}),e.jsx("div",{className:"border-t pt-4 mt-auto",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{children:"Add Mailbox Integration"}),e.jsxs(Ae,{value:c,onValueChange:o,children:[e.jsx(Pe,{className:"w-full sm:w-[300px]",children:e.jsx(_e,{placeholder:"Select validated email"})}),e.jsx(De,{children:a.map(h=>e.jsx(Me,{value:h.email,children:h.email},h.email))})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsxs(x,{variant:"outline",onClick:()=>j("google"),disabled:!c||i.isPending,className:"h-10 px-4 gap-2 bg-background hover:bg-muted",children:[e.jsx(bs,{}),e.jsx("span",{children:"Sign in with Google"})]}),e.jsxs(x,{variant:"outline",onClick:()=>j("microsoft"),disabled:!c||i.isPending,className:"h-10 px-4 gap-2 bg-background hover:bg-muted",children:[e.jsx(Ns,{}),e.jsx("span",{children:"Sign in with Microsoft"})]})]})]})}),e.jsx(q,{open:!!n,onOpenChange:()=>p(null),children:e.jsxs($,{children:[e.jsxs(W,{children:[e.jsx(J,{children:"Delete Integration"}),e.jsxs(Q,{children:["Are you sure you want to delete this mailbox integration for"," ",e.jsx("strong",{children:n?.email}),"? This action cannot be undone."]})]}),e.jsxs(X,{children:[e.jsx(Z,{children:"Cancel"}),e.jsxs(ee,{onClick:m,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[t.isPending&&e.jsx(M,{className:"h-4 w-4 mr-2 animate-spin"}),"Delete"]})]})]})})]})]})}function Ss({open:s,onOpenChange:g,email:a}){const t=ne(),[r,i]=u.useState(""),[c,o]=u.useState("https://api.platform.sublimesecurity.com"),n=()=>{i(""),o("https://api.platform.sublimesecurity.com")},p=m=>{m||n(),g(m)},j=m=>{if(m.preventDefault(),!r.trim()||!c.trim())return;const d={integration_type:"sublime",email:a,api_key:r.trim(),api_url:c.trim()};t.mutate(d,{onSuccess:()=>p(!1)})};return e.jsx(V,{open:s,onOpenChange:p,children:e.jsxs(R,{className:"sm:max-w-md",children:[e.jsxs(B,{children:[e.jsx(Y,{children:"Add Sublime Integration"}
1),e.jsxs(H,{children:["Connect your Sublime Security platform to track email security events. The integration will be associated with ",e.jsx("strong",{children:a}),"."]})]}),e.jsxs("form",{onSubmit:j,children:[e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"api-key",children:"API Key"}),e.jsx(D,{id:"api-key",type:"password",placeholder:"jc258zp67...",value:r,onChange:m=>i(m.target.value),disabled:t.isPending})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"api-url",children:"API URL"}),e.jsx(D,{id:"api-url",type:"url",placeholder:"https://api.platform.sublimesecurity.com",value:c,onChange:m=>o(m.target.value),disabled:t.isPending})]})]}),e.jsxs(L,{children:[e.jsx(x,{type:"button",variant:"outline",onClick:()=>p(!1),children:"Cancel"}),e.jsxs(x,{type:"submit",disabled:!r.trim()||!c.trim()||t.isPending,children:[t.isPending&&e.jsx(M,{className:"h-4 w-4 mr-2 animate-spin"}),"Add Integration"]})]})]})]})})}function ks({open:s,onOpenChange:g,email:a}){const t=ne(),[r,i]=u.useState(""),[c,o]=u.useState(""),[n,p]=u.useState(""),j=()=>{i(""),o(""),p("")},m=l=>{l||j(),g(l)},d=l=>{if(l.preventDefault(),!r.trim()||!c.trim()||!n.trim())return;const h={integration_type:"defender",email:a,tenant_id:r.trim(),client_id:c.trim(),client_secret:n.trim()};t.mutate(h,{onSuccess:()=>m(!1)})};return e.jsx(V,{open:s,onOpenChange:m,children:e.jsxs(R,{className:"sm:max-w-md",children:[e.jsxs(B,{children:[e.jsx(Y,{children:"Add Microsoft Defender Integration"}
1),e.jsxs(H,{children:["Connect Microsoft Defender for Office 365 to track email security events. The integration will be associated with ",e.jsx("strong",{children:a}),"."," ",e.jsx("a",{href:"https://docs.delivr.to/docs/integrations/defender_integration.html",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Setup instructions"})]})]}),e.jsxs("form",{onSubmit:d,children:[e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"tenant-id",children:"Tenant ID"}),e.jsx(D,{id:"tenant-id",type:"text",placeholder:"25f17ff4-96e4...",value:r,onChange:l=>i(l.target.value),disabled:t.isPending})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"client-id",children:"Client ID"}),e.jsx(D,{id:"client-id",type:"text",placeholder:"44883925-08ec...",value:c,onChange:l=>o(l.target.value),disabled:t.isPending})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"client-secret",children:"Client Secret"}),e.jsx(D,{id:"client-secret",type:"password",placeholder:"VJ78Q~~wbvTT7...",value:n,onChange:l=>p(l.target.value),disabled:t.isPending})]})]}),e.jsxs(L,{children:[e.jsx(x,{type:"button",variant:"outline",onClick:()=>m(!1),children:"Cancel"}),e.jsxs(x,{type:"submit",disabled:!r.trim()||!c.trim()||!n.trim()||t.isPending,children:[t.isPending&&e.jsx(M,{className:"h-4 w-4 mr-2 animate-spin"}),"Add Integration"]})]})]})]})})}function Cs({open:s,onOpenChange:g}){const a=ne(),[t,r]=u.useState(""),i=()=>{r("")},c=n=>{n||i(),g(n)},o=n=>{if(n.preventDefault(),!t.trim())return;const p={integration_type:"push_security",api_key:t.trim()};a.mutate(p,{onSuccess:()=>c(!1)})};return e.jsx(V,{open:s,onOpenChange:c,children:e.jsxs(R,{className:"sm:max-w-md",children:[e.jsxs(B,{children:[e.jsx(Y,{children:"Add Push Security Integration"}),e.jsx(H,{children:"Connect Push Security to detect when web campaign payloads are visited in the browser. A read-only API key is sufficient."})]}),e.jsxs("form",{onSubmit:o,children:[e.jsx("div",{className:"space-y-4 py-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"push-api-key",children:"API Key"}),e.jsx(D,{id:"push-api-key",type:"password",placeholder:"Your Push Security API key",value:t,onChange:n=>r(n.target.value),disabled:a.isPending}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Generate an API key from Settings in the Push admin console."})]})}),e.jsxs(L,{children:[e.jsx(x,{type:"button",variant:"outline",onClick:()=>c(!1),children:"Cancel"}),e.jsxs(x,{type:"submit",disabled:!t.trim()||a.isPending,children:[a.isPending&&e.jsx(M,{className:"h-4 w-4 mr-2 animate-spin"}),"Add Integration"]})]})]})]})})}function As(){const{data:s=[],isLoading:g}=de("mail_control"),{data:a=[],isLoading:t}=de("browser_security"),r=[...s,...a],i=a.some(f=>f.integration_type==="push_security"),c=g||t,{data:o=[]}=Ne(),n=ke(),p=Ce(),[j,m]=u.useState(""),[d,l]=u.useState(null),[h,I]=u.useState(!1),[U,E]=u.useState(!1),[T,y]=u.useState(!1),F=()=>{d&&n.mutate(d.id,{onSuccess:()=>l(null)})},re=f=>{p.mutate({integrationId:f.id,enabled:!f.enabled})},_=f=>f.enabled?f.status==="active"?e.jsx(C,{className:"bg-success text-white hover:bg-success/80 dark:text-[#134e45] dark:hover:bg-success/80",children:"Active"}):e.jsx(C,{className:"bg-destructive text-white hover:bg-destructive/80 dark:text-[#7f1d1d] dark:hover:bg-destructive/80",children:"Error"}):e.jsx(C,{className:"bg-gray-300 text-gray-700 hover:bg-gray-400 dark:bg-gray-600 dark:text-gray-200 dark:hover:bg-gray-500",children:"Disabled"});return e.jsxs("div",{className:"space-y-4",children:[c?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(O,{size:32})}):r.length>0?e.jsxs(ue,{children:[e.jsx(pe,{children:e.jsxs(K,{children:[e.jsx(A,{children:"Scope"}),e.jsx(A,{children:"Service"}),e.jsx(A,{children:"Status"}),e.jsx(A,{className:"w-[50px]"})]})}),e.jsx(je,{children:r.map(f=>e.jsxs(K,{children:[e.jsx(P,{className:"font-medium",children:f.email||"Organisation-Wide"}),e.jsx(P,{children:e.jsx(Ie,{service:f.integration_type})}),e.jsx(P,{children:_(f)}),e.jsx(P,{children:e.jsxs(xe,{children:[e.jsx(me,{asChild:!0,children:e.jsx(x,{variant:"ghost",size:"icon",className:"h-8 w-8",children:e.jsx(ge,{className:"h-4 w-4"})})}),e.jsxs(he,{align:"end",children:[e.jsx(z,{onClick:()=>re(f),children:f.enabled?e.jsxs(e.Fragment,{children:[e.jsx(Te,{className:"mr-2 h-4 w-4"}),"Disable"]}):e.jsxs(e.Fragment,{children:[e.jsx(Fe,{className:"mr-2 h-4 w-4"}),"Enable"]})}),f.deletable&&e.jsxs(e.Fragment,{children:[e.jsx(Se,{}),e.jsxs(z,{className:"text-destructive focus:text-destructive",onClick:()=>l(f),children:[e.jsx(te,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]})})]},f.id))})]}):e.jsx("div",{className:"text-center py-4 text-muted-foreground text-sm",children:"No security tool integrations configured."}),e.jsx("div",{className:"border-t pt-4",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{children:"Add Email Security Integration"}),e.jsxs(Ae,{value:j,onValueChange:m,children:[e.jsx(Pe,{className:"w-full sm:w-[300px]",children:e.jsx(_e,{placeholder:"Select validated email"})}),e.jsx(De,{children:o.map(f=>e.jsx(Me,{value:f.email,children:f.email},f.email))})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsxs(x,{variant:"outline",onClick:()=>I(!0),disabled:!j,className:"h-10 px-4 gap-2 bg-background hover:bg-muted",children:[e.jsx(Oe,{service:"sublime",size:20}),e.jsx("span",{children:"Integrate with Sublime"})]}),e.jsxs(x,{variant:"outline",onClick:()=>E(!0),disabled:!j,className:"h-10 px-4 gap-2 bg-background hover:bg-muted",children:[e.jsx("img",{src:"/images/defender.png",alt:"",className:"h-5 w-5"}),e.jsx("span",{children:"Integrate with Defender 365"})]})]}),e.jsxs("div",{className:"space-y-2 border-t pt-4",children:[e.jsx(v,{children:"Add Browser Security Integration"}),e.jsx("div",{className:"flex flex-wrap gap-3",children:e.jsxs(x,{variant:"outline",onClick:()=>y(!0),disabled:i,title:i?"A Push Security integration is already configured":void 0,className:"h-10 px-4 gap-2 bg-background hover:bg-muted",children:[e.jsx(Oe,{service:"push_security",size:20}),e.jsx("span",{children:"Integrate with Push Security"})]})})]})]})}),e.jsx(q,{open:!!d,onOpenChange:()=>l(null),children:e.jsxs($,{children:[e.jsxs(W,{children:[e.jsx(J,{children:"Delete Integration"}),e.jsxs(Q,{children:["Are you sure you want to delete this"," ",d?.email?e.jsxs(e.Fragment,{children:["security tool integration for"," ",e.jsx("strong",{children:d.email})]}):e.jsx(e.Fragment,{children:"security tool integration"}),"? This action cannot be undone."]})]}),e.jsxs(X,{children:[e.jsx(Z,{children:"Cancel"}),e.jsxs(ee,{onClick:F,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[n.isPending&&e.jsx(M,{className:"h-4 w-4 mr-2 animate-spin"}),"Delete"]})]})]})}),e.jsx(Ss,{open:h,onOpenChange:I,email:j}),e.jsx(ks,{open:U,onOpenChange:E,email:j}),e.jsx(Cs,{open:T,onOpenChange:y})]})}function Ps({open:s,onOpenChange:g}){const a=ne(),[t,r]=u.useState(""),[i,c]=u.useState(""),[o,n]=u.useState(""),p=()=>{r(""),c(""),n("")},j=d=>{d||p(),g(d)},m=d=>{if(d.preventDefault(),!t.trim()||!i.trim()||!o.trim())return;const l={integration_type:"sendgrid",friendly_name:t.trim(),api_key:i.trim(),sending_address:o.trim()};a.mutate(l,{onSuccess:()=>j(!1)})};return e.jsx(V,{open:s,onOpenChange:j,children:e.jsxs(R,{className:"sm:max-w-md",children:[e.jsxs(B,{children:[e.jsx(Y,{children:"Add SendGrid Sender"}
1),e.jsxs(H,{children:["Configure a custom SendGrid sender to use for campaigns."," ",e.jsx("a",{href:"https://docs.delivr.to/docs/integrations/sendgrid_integration.html",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Setup instructions"})]})]}),e.jsxs("form",{onSubmit:m,children:[e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"friendly-name",children:"Friendly Name"}),e.jsx(D,{id:"friendly-name",type:"text",placeholder:"My SendGrid Sender",value:t,onChange:d=>r(d.target.value),disabled:a.isPending}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"A display name to identify this sender"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"api-key",children:"API Key"}),e.jsx(D,{id:"api-key",type:"password",placeholder:"SG.xxxxxxxx...",value:i,onChange:d=>c(d.target.value),disabled:a.isPending}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Your SendGrid API key with Mail Send permission"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"sending-address",children:"Sending Address"}),e.jsx(D,{id:"sending-address",type:"email",placeholder:"[email protected]",value:o,onChange:d=>n(d.target.value),disabled:a.isPending}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The verified sender email address to send from"})]})]}),e.jsxs(L,{children:[e.jsx(x,{type:"button",variant:"outline",onClick:()=>j(!1),children:"Cancel"}),e.jsxs(x,{type:"submit",disabled:!t.trim()||!i.trim()||!o.trim()||a.isPending,children:[a.isPending&&e.jsx(M,{className:"h-4 w-4 mr-2 animate-spin"}),"Add Sender"]})]})]})]})})}function _s({open:s,onOpenChange:g}){const a=ne(),[t,r]=u.useState(""),[i,c]=u.useState(""),[o,n]=u.useState(""),p=()=>{r(""),c(""),n("")},j=d=>{d||p(),g(d)},m=d=>{if(d.preventDefault(),!t.trim()||!i.trim()||!o.trim())return;const l={integration_type:"mailgun",friendly_name:t.trim(),api_key:i.trim(),sending_address:o.trim()};a.mutate(l,{onSuccess:()=>j(!1)})};return e.jsx(V,{open:s,onOpenChange:j,children:e.jsxs(R,{className:"sm:max-w-md",children:[e.jsxs(B,{children:[e.jsx(Y,{children:"Add MailGun Sender"}
1),e.jsxs(H,{children:["Configure a custom MailGun sender to use for campaigns."," ",e.jsx("a",{href:"https://docs.delivr.to/docs/integrations/mailgun_integration.html",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Setup instructions"})]})]}),e.jsxs("form",{onSubmit:m,children:[e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"friendly-name",children:"Friendly Name"}),e.jsx(D,{id:"friendly-name",type:"text",placeholder:"My MailGun Sender",value:t,onChange:d=>r(d.target.value),disabled:a.isPending}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"A display name to identify this sender"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"api-key",children:"API Key"}),e.jsx(D,{id:"api-key",type:"password",placeholder:"key-xxxxxxxx...",value:i,onChange:d=>c(d.target.value),disabled:a.isPending})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"sending-address",children:"Sending Address"}),e.jsx(D,{id:"sending-address",type:"email",placeholder:"[email protected]",value:o,onChange:d=>n(d.target.value),disabled:a.isPending}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The email address to send from (must match domain)"})]})]}),e.jsxs(L,{children:[e.jsx(x,{type:"button",variant:"outline",onClick:()=>j(!1),children:"Cancel"}),e.jsxs(x,{type:"submit",disabled:!t.trim()||!i.trim()||!o.trim()||a.isPending,children:[a.isPending&&e.jsx(M,{className:"h-4 w-4 mr-2 animate-spin"}),"Add Sender"]})]})]})]})})}function Ds(){const{data:s=[],isLoading:g}=de("sender"),a=ke(),t=Ce(),[r,i]=u.useState(null),[c,o]=u.useState(!1),[n,p]=u.useState(!1),j=()=>{r&&a.mutate(r.id,{onSuccess:()=>i(null)})},m=l=>{t.mutate({integrationId:l.id,enabled:!l.enabled})},d=l=>l.enabled?l.status==="active"?e.jsx(C,{className:"bg-success text-white hover:bg-success/80 dark:text-[#134e45] dark:hover:bg-success/80",children:"Active"}):e.jsx(C,{className:"bg-destructive text-white hover:bg-destructive/80 dark:text-[#7f1d1d] dark:hover:bg-destructive/80",children:"Error"}):e.jsx(C,{className:"bg-gray-300 text-gray-700 hover:bg-gray-400 dark:bg-gray-600 dark:text-gray-200 dark:hover:bg-gray-500",children:"Disabled"});return e.jsxs("div",{className:"space-y-4",children:[g?e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(O,{size:32})}):s.length>0?e.jsxs(ue,{children:[e.jsx(pe,{children:e.jsxs(K,{children:[e.jsx(A,{className:"w-[50px]",children:"Provider"}),e.jsx(A,{children:"Name"}),e.jsx(A,{children:"Sending Address"}),e.jsx(A,{children:"Status"}),e.jsx(A,{className:"w-[50px]"})]})}),e.jsx(je,{children:s.map(l=>e.jsxs(K,{children:[e.jsx(P,{children:e.jsx(Ie,{service:l.integration_type,iconSize:18})}),e.jsx(P,{className:"font-medium",children:l.friendly_name||l.integration_type}),e.jsx(P,{children:l.sending_address}),e.jsx(P,{children:d(l)}),e.jsx(P,{children:e.jsxs(xe,{children:[e.jsx(me,{asChild:!0,children:e.jsx(x,{variant:"ghost",size:"icon",className:"h-8 w-8",children:e.jsx(ge,{className:"h-4 w-4"})})}),e.jsxs(he,{align:"end",children:[e.jsx(z,{onClick:()=>m(l),children:l.enabled?e.jsxs(e.Fragment,{children:[e.jsx(Te,{className:"mr-2 h-4 w-4"}),"Disable"]}):e.jsxs(e.Fragment,{children:[e.jsx(Fe,{className:"mr-2 h-4 w-4"}),"Enable"]})}),l.deletable&&e.jsxs(e.Fragment,{children:[e.jsx(Se,{}),e.jsxs(z,{className:"text-destructive focus:text-destructive",onClick:()=>i(l),children:[e.jsx(te,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})]})})]},l.id))})]}):e.jsx("div",{className:"text-center py-4 text-muted-foreground text-sm",children:"No custom sender integrations configured."}),e.jsx("div",{className:"border-t pt-4",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Add a custom sender integration to send campaigns from your own domain."," ",e.jsx("a",{href:"https://docs.delivr.to/docs/integrations/sendgrid_integration",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Learn more"})]}),e.jsxs("div",{className:"flex flex-wrap gap-3",children:[e.jsxs(x,{variant:"outline",onClick:()=>o(!0),className:"h-10 px-4 gap-2 bg-background hover:bg-muted",children:[e.jsx("img",{src:"/images/sendgrid.png",alt:"",className:"h-5 w-5"}),e.jsx("span",{children:"Send with SendGrid"})]}),e.jsxs(x,{variant:"outline",onClick:()=>p(!0),className:"h-10 px-4 gap-2 bg-background hover:bg-muted",children:[e.jsx("img",{src:"/images/mailgun.png",alt:"",className:"h-5 w-5"}),e.jsx("span",{children:"Send with MailGun"})]})]})]})}),e.jsx(q,{open:!!r,onOpenChange:()=>i(null),children:e.jsxs($,{children:[e.jsxs(W,{children:[e.jsx(J,{children:"Delete Integration"}),e.jsxs(Q,{children:["Are you sure you want to delete the sender integration"," ",e.jsx("strong",{children:r?.friendly_name||r?.sending_address}),"? This action cannot be undone."]})]}),e.jsxs(X,{children:[e.jsx(Z,{children:"Cancel"}),e.jsxs(ee,{onClick:j,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[a.isPending&&e.jsx(M,{className:"h-4 w-4 mr-2 animate-spin"}),"Delete"]})]})]})}),e.jsx(Ps,{open:c,onOpenChange:o}),e.jsx(_s,{open:n,onOpenChange:p})]})}function Ms(){const{data:s}
1=ae(),[g,a]=u.useState(!1),t=s?.subscription_status==="Starter",r=s?.subscription_status==="Enterprise",i=s?.checkout_url||"https://delivr.to/pricing";return t?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["Connect your mailbox and security tools to automatically track campaign delivery and blocking."," ",e.jsx("a",{href:"https://docs.delivr.to/docs/integrations/",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Learn more"})]}),e.jsxs("div",{className:"flex flex-wrap gap-4",children:[e.jsxs(b,{className:"min-w-[200px] flex-1 opacity-75",children:[e.jsx(w,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10",children:e.jsx(ve,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx(S,{className:"text-base",children:"Mailbox"}),e.jsx(k,{className:"text-xs",children:"Google & Microsoft 365"})]})]})}),e.jsx(N,{children:e.jsx("p",{className:"text-xs text-muted-foreground",children:"Track what payloads arrived, and in what condition."})})]}),e.jsxs(b,{className:"min-w-[200px] flex-1 opacity-75",children:[e.jsx(w,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10",children:e.jsx(oe,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx(S,{className:"text-base",children:"Security Tools"}),e.jsx(k,{className:"text-xs",children:"Sublime & Defender"})]})]})}),e.jsx(N,{children:e.jsx("p",{className:"text-xs text-muted-foreground",children:"Track where payloads were blocked in your security stack."})})]}),e.jsxs(b,{className:"min-w-[200px] flex-1 opacity-75",children:[e.jsx(w,{className:"pb-3",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10",children:e.jsx(Ue,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx(S,{className:"text-base",children:"Custom Senders"}),e.jsx(k,{className:"text-xs",children:"SendGrid & MailGun"})]})]})}),e.jsx(N,{children:e.jsx("p",{className:"text-xs text-muted-foreground",children:"Send campaigns from your own email infrastructure."})})]})]}),e.jsxs(b,{className:"overflow-hidden",children:[e.jsxs("div",{className:"relative bg-gradient-to-br from-primary/10 via-primary/5 to-chart-purple/10 dark:from-[#0a0a12] dark:via-[#0d1117] dark:to-[#1a1a2e] px-6 pt-8 pb-6 overflow-hidden",children:[e.jsx("div",{className:"absolute top-0 right-0 w-48 h-48 bg-primary/10 dark:bg-primary/20 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute bottom-0 left-0 w-32 h-32 bg-chart-purple/10 dark:bg-chart-purple/20 rounded-full blur-3xl"}),e.jsx("div",{className:"absolute inset-0 opacity-20 dark:opacity-50",style:{backgroundImage:`radial-gradient(1px 1px at 20px 30px, hsl(var(--primary)), transparent),
2                  radial-gradient(1px 1px at 40px 70px, hsl(var(--primary)), transparent),
3                  radial-gradient(1px 1px at 80px 20px, hsl(var(--chart-purple)), transparent),
4                  radial-gradient(1px 1px at 130px 50px, hsl(var(--primary)), transparent),
5                  radial-gradient(1px 1px at 180px 80px, hsl(var(--chart-purple)), transparent),
6                  radial-gradient(1px 1px at 250px 35px, hsl(var(--primary)), transparent),
7                  radial-gradient(1px 1px at 320px 60px, hsl(var(--chart-purple)), transparent),
8                  radial-gradient(1px 1px at 400px 25px, hsl(var(--primary)), transparent)`}}),e.jsxs("div",{className:"relative z-10",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"p-2 rounded-lg bg-primary/20 text-primary",children:e.jsx(se,{className:"h-6 w-6"})}),e.jsx("h2",{className:"text-2xl font-bold text-foreground dark:text-white",children:"Unlock Integrations"})]}),e.jsxs("p",{className:"text-muted-foreground dark:text-gray-300 text-base",children:["Upgrade to"," ",e.jsx("span",{className:"text-primary font-medium",children:"Premium"})," or"," ",e.jsx("span",{className:"text-chart-purple font-medium",children:"Enterprise"})," ","to connect your mailbox and security tools."]})]})]}),e.jsx(N,{className:"p-6",children:e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs(b,{className:"relative border-primary/50 hover:border-primary transition-colors",children:[e.jsx("div",{className:"absolute -top-3 left-4",children:e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-primary text-primary-foreground",children:[e.jsx(He,{className:"h-3 w-3"}),"Popular"]})}),e.jsxs(w,{className:"pb-2 pt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(se,{className:"h-5 w-5 text-primary"}),e.jsx(S,{className:"text-lg",children:"Premium"})]}),e.jsx(k,{children:"£299/mo or £2,999/yr"})]}),e.jsxs(N,{className:"space-y-3",children:[e.jsxs("ul",{className:"text-sm space-y-2 text-muted-foreground",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-success",children:"✓"}),"Mailbox integrations"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-success",children:"✓"}),"Security tool integrations"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-success",children:"✓"}),"2000 emails daily"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-success",children:"✓"}),"Developer API access"]})]}),e.jsx(x,{className:"w-full",asChild:!0,children:e.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:"Upgrade to Premium"})})]})]}),e.jsxs(b,{className:"relative border-chart-purple/50 hover:border-chart-purple transition-colors",children:[e.jsx("div",{className:"absolute -top-3 left-4",children:e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium bg-chart-purple text-white",children:[e.jsx(qe,{className:"h-3 w-3"}),"Teams"]})}),e.jsxs(w,{className:"pb-2 pt-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(we,{className:"h-5 w-5 text-chart-purple"}),e.jsx(S,{className:"text-lg",children:"Enterprise"})]}),e.jsx(k,{children:"Custom pricing"})]}),e.jsxs(N,{className:"space-y-3",children:[e.jsxs("ul",{className:"text-sm space-y-2 text-muted-foreground",children:[e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-success",children:"✓"}),"Everything in Premium"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-success",children:"✓"}),"Custom sender integrations"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-success",children:"✓"}),"Team collaboration"]}),e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-success",children:"✓"}),"Priority support"]})]}),e.jsx(x,{variant:"outline",className:"w-full border-chart-purple/50 hover:bg-chart-purple/10",asChild:!0,children:e.jsx("a",{href:"mailto:[email protected]?subject=Enterprise%20Enquiry",children:"Contact Sales"})})]})]})]})})]})]}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"text-sm text-muted-foreground",children:["Connect your mailbox and security tools to automatically track campaign delivery and blocking."," ",e.jsx("a",{href:"https://docs.delivr.to/docs/integrations/",target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"Learn more"})]}),e.jsxs("div",{className:"flex flex-wrap gap-6",children:[e.jsxs(b,{className:"min-w-[450px] flex-1",children:[e.jsx(w,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10",children:e.jsx(ve,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx(S,{className:"text-base",children:"Mailbox Integrations"}),e.jsx(k,{children:"Google & Microsoft 365 mailboxes"})]})]})}),e.jsx(N,{children:e.jsx(ws,{})})]}),e.jsxs(b,{className:"min-w-[450px] flex-1",children:[e.jsx(w,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10",children:e.jsx(oe,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx(S,{className:"text-base",children:"Security Tools"}),e.jsx(k,{children:"Sublime Security & Microsoft Defender"})]})]})}),e.jsx(N,{children:e.jsx(As,{})})]}),e.jsxs(b,{className:"min-w-[520px] flex-1",children:[e.jsx(w,{children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10",children:e.jsx(Ue,{className:"h-5 w-5 text-primary"})}),e.jsxs("div",{children:[e.jsx(S,{className:"text-base",children:"Custom Senders"}),e.jsx(k,{children:"SendGrid & MailGun integrations"})]})]})}),e.jsx(N,{children:r?e.jsx(Ds,{}):e.jsxs("button",{onClick:()=>a(!0),className:"flex items-center gap-3 w-full p-4 rounded-md bg-muted/50 hover:bg-muted text-left transition-colors",children:[e.jsx(se,{className:"h-5 w-5 text-primary shrink-0"}),e.jsx("span",{className:"text-sm text-muted-foreground",children:"Send campaigns from your own domain with SendGrid or MailGun."})]})})]})]}),e.jsx(Le,{open:g,onOpenChange:a,feature:"custom sender integrations",requiredTier:"enterprise"})]})}function Is(){return e.jsxs("div",{className:"flex flex-wrap gap-6",children:[e.jsx(Ts,{}),e.jsx(Os,{})]})}function Ts(){const{data:s,isLoading:g}=ae(),a=ts(),[t,r]=u.useState(!1),[i,c]=u.useState(!1),o=s?.has_api_key,n=s?.api_key_data,p=n?Math.round(Date.now()/1e3)>parseInt(n.expires):!1,j=d=>new Date(parseInt(d)*1e3).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),m=()=>{a.mutate(void 0,{onSuccess:()=>c(!1)})};return e.jsxs(e.Fragment,{children:[e.jsxs(b,{className:"min-w-[400px] flex-1 flex flex-col",children:[e.jsx(w,{children:e.jsx("div",{className:"flex items-center justify-between",children:e.jsxs("div",{children:[e.jsxs(S,{className:"flex items-center gap-2",children:[e.jsx(fe,{className:"h-5 w-5"}),"API Key"]}),e.jsx(k,{children:"Manage your API key for programmatic access to the delivr.to API"})]})})}),e.jsx(N,{className:"flex-1 flex flex-col justify-end",children:g?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(O,{size:32})}):o&&n?e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:`h-10 w-10 rounded-full flex items-center justify-center ${p?"bg-destructive/20":"bg-success/20"}`,children:e.jsx(fe,{className:`h-5 w-5 ${p?"text-destructive":"text-success"}`})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:p?"API key expired":"API key active"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:p?"Your API key has expired and needs to be recreated":`Valid until ${j(n.expires)}`})]})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(x,{variant:"outline",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>c(!0),children:[e.jsx(te,{className:"h-4 w-4 mr-2"}),"Delete"]}),e.jsxs(x,{size:"sm",onClick:()=>r(!0),children:[e.jsx(ps,{className:"h-4 w-4 mr-2"}),"Rotate"]})]})]}):e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center",children:e.jsx(fe,{className:"h-5 w-5 text-muted-foreground"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"No API key"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Create one to access the API programmatically"})]})]}),e.jsxs(x,{onClick:()=>r(!0),children:[e.jsx(Ke,{className:"h-4 w-4 mr-2"}),"Create API Key"]})]})})]}),e.jsx(Es,{open:t,onOpenChange:r,hasExistingKey:o}),e.jsx(q,{open:i,onOpenChange:c,children:e.jsxs($,{children:[e.jsxs(W,{children:[e.jsx(J,{children:"Delete API Key"}),e.jsx(Q,{children:"Are you sure you want to delete your API key? Any applications using this key will lose access."})]}),e.jsxs(X,{children:[e.jsx(Z,{children:"Cancel"}),e.jsxs(ee,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:m,children:[a.isPending&&e.jsx(M,{className:"h-4 w-4 mr-2 animate-spin"}),"Delete Key"]})]})]})})]})}const Fs=[{value:30,label:"30 days"},{value:90,label:"90 days"},{value:180,label:"180 days (default)"},{value:365,label:"365 days"}];function Es({open:s,onOpenChange:g,hasExistingKey:a}){const t=ls(),[r,i]=u.useState(180),[c,o]=u.useState(null),[n,p]=u.useState(!1),j=()=>{i(180),o(null),p(!1)},m=h=>{h||j(),g(h)},d=h=>{h.preventDefault(),t.mutate({valid_for:r,overwrite:a},{onSuccess:I=>{o(I.key)}})},l=async()=>{c&&(await navigator.clipboard.writeText(c),p(!0),ce.success("API key copied to clipboard"),setTimeout(()=>p(!1),2e3))};return e.jsx(V,{open:s,onOpenChange:m,children:e.jsxs(R,{className:"sm:max-w-md",children:[e.jsxs(B,{children:[e.jsx(Y,{children:a?"Rotate API Key":"Create API Key"}),e.jsx(H,{children:c?"Copy your new API key now. You won't be able to see it again.":a?"Create a new API key. Your existing key will be revoked.":"Create an API key for programmatic access to the delivr.to API."})]}),c?e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{children:"Your API Key"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(D,{readOnly:!0,value:c,className:"font-mono text-sm"}),e.jsx(x,{variant:"outline",onClick:l,children:n?e.jsx($e,{className:"h-4 w-4"}):e.jsx(Qe,{className:"h-4 w-4"})})]}),e.jsx("p",{className:"text-xs text-destructive",children:"Store this key securely — it will only be shown once."})]}),e.jsx(L,{children:e.jsx(x,{onClick:()=>m(!1),children:"Done"})})]}):e.jsxs("form",{onSubmit:d,children:[e.jsxs("div",{className:"space-y-4 py-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"valid-for",children:"Key Validity Period"}),e.jsxs(Ae,{value:String(r),onValueChange:h=>i(Number(h)),disabled:t.isPending,children:[e.jsx(Pe,{className:"w-full",children:e.jsx(_e,{placeholder:"Select validity period"})}),e.jsx(De,{children:Fs.map(h=>
8e.jsx(Me,{value:String(h.value),children:h.label},h.value))})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"How long until the API key expires"})]}),a&&e.jsx("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:e.jsx("p",{className:"text-sm text-destructive",children:"Your existing API key will be revoked immediately when you create a new one."})})]}),e.jsxs(L,{children:[e.jsx(x,{type:"button",variant:"outline",onClick:()=>m(!1),children:"Cancel"}),e.jsxs(x,{type:"submit",disabled:t.isPending,children:[t.isPending&&e.jsx(M,{className:"h-4 w-4 mr-2 animate-spin"}),a?"Rotate Key":"Create Key"]})]})]})]})})}function Os(){const{data:s,isLoading:g}=rs(),a=is(),t=ns(),[r,i]=u.useState(!1),[c,o]=u.useState(!1),[n,p]=u.useState(""),j=s?.status,m=j==="configured",d=j==="external_provider",l=s?.qr,h=()=>{l&&i(!0)},I=()=>{n.trim()&&a.mutate(n.trim(),{onSuccess:()=>{i(!1),p(""),ce.success("MFA enabled successfully")}})},U=()=>{t.mutate(void 0,{onSuccess:()=>{o(!1),ce.success("MFA disabled")}})},E=T=>{T||p(""),i(T)};return e.jsxs(e.Fragment,{children:[e.jsxs(b,{className:"min-w-[400px] flex-1 flex flex-col",children:[e.jsxs(w,{children:[e.jsxs(S,{className:"flex items-center gap-2",children:[m?e.jsx(oe,{className:"h-5 w-5 text-success"}):e.jsx(be,{className:"h-5 w-5"}),"Multi-Factor Authentication"]}),e.jsx(k,{children:"Add an extra layer of security to your account using an authenticator app"})]}),e.jsx(N,{className:"flex-1 flex flex-col justify-end",children:g?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(O,{size:32})}):d?e.jsx("div",{className:"rounded-md bg-muted p-4",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"MFA can't be configured when using external SSO."})}):m?e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-full bg-success/20 flex items-center justify-center",children:e.jsx(oe,{className:"h-5 w-5 text-success"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"MFA is enabled"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your account is protected with multi-factor authentication"})]})]}),e.jsx(x,{variant:"outline",className:"text-destructive hover:text-destructive",onClick:()=>o(!0),children:"Disable MFA"})]}):e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-full bg-muted flex items-center justify-center",children:e.jsx(be,{className:"h-5 w-5 text-muted-foreground"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:"MFA is not enabled"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Protect your account with an authenticator app"})]})]}),e.jsx(x,{onClick:h,disabled:!l,children:"Enable MFA"})]})})]}),e.jsx(V,{open:r,onOpenChange:E,children:e.jsxs(R,{className:"sm:max-w-md",children:[e.jsxs(B,{children:[e.jsx(Y,{children:"Set Up MFA"}),e.jsx(H,{children:"Scan the QR code with your authenticator app, then enter the verification code to complete setup."})]}),e.jsxs("div",{className:"space-y-4 py-4",children:[l&&e.jsx("div",{className:"flex justify-center",children:e.jsx("img",{src:l,alt:"MFA QR Code",className:"w-48 h-48"})}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"mfa-code",children:"Verification Code"}),e.jsx(D,{id:"mfa-code",placeholder:"123456",value:n,onChange:T=>p(T.target.value),maxLength:6,disabled:a.isPending})]})]}),e.jsxs(L,{children:[e.jsx(x,{type:"button",variant:"outline",onClick:()=>E(!1),children:"Cancel"}),e.jsxs(x,{onClick:I,disabled:n.length!==6||a.isPending,children:[a.isPending&&e.jsx(M,{className:"h-4 w-4 mr-2 animate-spin"}),"Verify & Enable"]})]})]})}),e.jsx(q,{open:c,onOpenChange:o,children:e.jsxs($,{children:[e.jsxs(W,{children:[e.jsx(J,{children:"Disable MFA"}),e.jsx(Q,{children:"Are you sure you want to disable multi-factor authentication? This will make your account less secure."})]}),e.jsxs(X,{children:[e.jsx(Z,{children:"Cancel"}),e.jsxs(ee,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:U,children:[t.isPending&&e.jsx(M,{className:"h-4 w-4 mr-2 animate-spin"}),"Disable MFA"]})]})]})})]})}const Us=[{id:"login",label:"You login"},{id:"new_payload",label:"A new payload is released"},{id:"new_validated_email",label:"A validated email is added"},{id:"new_mail_control_integration",label:"A security tool integration is added"},{id:"campaign_scheduled",label:"A campaign is scheduled"},{id:"new_custom_payload",label:"A custom payload is added"},{id:"new_custom_template",label:"A custom template is added"},{id:"new_mailbox_integration",label:"A mailbox integration is added"},{id:"campaign_sent",label:"A campaign is sent"}];function Ls(){const{data:s,isLoading:g}=ae(),a=cs(),[t,r]=u.useState(!1),[i,c]=u.useState(""),[o,n]=u.useState([]),[p,j]=u.useState(!1),[m,d]=u.useState(""),[l,h]=u.useState([]);u.useEffect(()=>{if(s?.webhooks){const y=s.webhooks.actions&&s.webhooks.actions.length>0;r(y??!1),j(y??!1),c(s.webhooks.url||""),d(s.webhooks.url||"");const F=s.webhooks.actions||[];n(F),h(F)}},[s]);const I=t!==p||i!==m||JSON.stringify([...o].sort())!==JSON.stringify([...l].sort()),U=y=>{n(F=>F.includes(y)?F.filter(re=>re!==y):[...F,y])},E=()=>{const y=t?{url:i,actions:o}:{url:"",actions:[]};a.mutate({webhooks:y},{onSuccess:()=>{j(t),d(i),h(o),ce.success("Webhook settings saved successfully")}})},T=()=>{r(p),c(m),n(l)};return g?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx(O,{size:32})}):e.jsxs("div",{className:"space-y-6",children:[e.jsxs(b,{children:[e.jsxs(w,{children:[e.jsxs(S,{className:"flex items-center gap-2",children:[e.jsx(ze,{className:"h-5 w-5"}),"Notifications"]}),e.jsx(k,{children:"Configure webhook notifications to receive alerts when events occur"})]}),e.jsxs(N,{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(v,{htmlFor:"enable-webhooks",className:"text-base",children:"Enable webhook notifications"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Send notifications to a webhook URL when events occur"})]}),e.jsx(xs,{id:"enable-webhooks",checked:t,onCheckedChange:r})]}),t&&e.jsxs("div",{className:"space-y-6 pt-4 border-t",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx(v,{className:"text-sm font-medium",children:"Receive webhook when:"}),e.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:Us.map(y=>e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(hs,{id:y.id,checked:o.includes(y.id),onCheckedChange:()=>U(y.id)}),e.jsx("label",{htmlFor:y.id,className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70 cursor-pointer",children:y.label})]},y.id))})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(v,{htmlFor:"webhook-url",children:"Webhook URL:"}),e.jsx(D,{id:"webhook-url",type:"url",placeholder:"https://hooks.slack.com/services/...",value:i,onChange:y=>c(y.target.value)}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Enter a Slack or Microsoft Teams incoming webhook URL"})]})]})]})]}),e.jsxs("div",{className:"flex justify-end gap-3",children:[e.jsx(x,{variant:"outline",onClick:T,disabled:!I||a.isPending,children:"Reset"}),e.jsxs(x,{onClick:E,disabled:!I||a.isPending,children:[a.isPending&&e.jsx(M,{className:"h-4 w-4 mr-2 animate-spin"}),"Submit"]})]})]})}const Ks=[{id:"account",label:"Account",icon:We},{id:"integrations",label:"Integrations",icon:ms},{id:"security",label:"Security",icon:be},{id:"notifications",label:"Notifications",icon:ze}];function ma(){Je("Settings");const[s,g]=Ge(),a=s.get("tab")||"account",t=r=>{g({tab:r},{replace:!0})};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:"Settings"}),e.jsx("p",{className:"text-muted-foreground",children:"Manage your account, integrations, and preferences"})]}),e.jsxs(Ve,{value:a,onValueChange:t,className:"space-y-6",children:[e.jsx(Re,{className:"grid w-full grid-cols-4 lg:w-auto lg:inline-grid",children:Ks.map(r=>
8e.jsxs(Be,{value:r.id,className:"flex items-center gap-2",children:[e.jsx(r.icon,{className:"h-4 w-4"}),e.jsx("span",{className:"hidden sm:inline",children:r.label})]},r.id))}),e.jsx(le,{value:"account",className:"space-y-6",children:e.jsx(ys,{})}),e.jsx(le,{value:"integrations",className:"space-y-6",children:e.jsx(Ms,{})}),e.jsx(le,{value:"security",className:"space-y-6",children:e.jsx(Is,{})}),e.jsx(le,{value:"notifications",className:"space-y-6",children:e.jsx(Ls,{})})]})]})}export{ma as Settings};

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.