PageSourceSearch

https://dealassist.replit.app/assets/settings-Ds52wNM5.js

js dealassist.replit.app collected 2026-10-03 03:50:01 UTC 8,845 bytes, 1 lines download raw bytes

1import{c as y,a1 as M,i as _,u as E,r as d,q as j,b as B,k as R,j as e,C as n,d as i,e as c,a as r,M as o,f as A,s as g,I as P,B as f,E as V,h as q}from"./index-ymGASxfw.js";import{H as z}from"./help-sidebar-D9Bn0ZmA.js";import{S as U}from"./switch-CcJNCP59.js";import{S as $,a as H,b as K,c as O,d as C}from"./select-Uo3n-gk9.js";import{M as Q}from"./moon-DhuFLsOm.js";import{M as F}from"./mail-B9dzUvLq.js";import{C as W}from"./circle-check-big-DTkDuEbO.js";import{C as G}from"./circle-x-CLRsEJyg.js";import"./index-DEMw4C8u.js";import"./chevron-up-Xz_mYCrv.js";import"./check-BQ84uMGu.js";const J=y("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);const Y=y("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);function le(){const{theme:x,setTheme:N}=M(),{toast:a}=_(),{user:w}=E(),u=w?.role==="admin",[l,v]=d.useState(()=>localStorage.getItem("dashboardView")==="brokerage"?"brokerage":"my"),[h,p]=d.useState("");d.useEffect(()=>{localStorage.setItem("dashboardView",l)},[l]),d.useEffect(()=>{const t=new URLSearchParams(window.location.search);t.get("cc_connected")==="true"?(a({title:"Constant Contact connected successfully"}),j.invalidateQueries({queryKey:["/api/constant-contact/status"]}),window.history.replaceState({},"","/settings")):t.get("cc_error")&&(a({title:"Constant Contact connection failed",description:t.get("cc_error")||void 0,variant:"destructive"}),window.history.replaceState({},"","/settings"))},[]);const{data:s,isLoading:k}=B({queryKey:["/api/constant-contact/status"],enabled:u}),m=R({mutationFn:t=>q("POST","/api/constant-contact/save-client-id",{client_id:t}),onSuccess:()=>{a({title:"Client ID saved"}),p(""),j.invalidateQueries({queryKey:["/api/constant-contact/status"]})},onError:t=>{a({title:"Failed to save Client ID",description:t.message,variant:"destructive"})}}),b=async()=>{try{const t=await fetch("/api/constant-contact/auth-info",{credentials:"include"});if(!t.ok){const D=await t.json();a({title:"Cannot connect",description:D.message||"Client ID not configured",variant:"destructive"});return}const{client_id:S,state:I,redirect_uri:X}=await t.json(),L=X||`${window.location.origin}/api/constant-contact/callback`,T=`https://authz.constantcontact.com/oauth2/default/v1/authorize?response_type=code&client_id=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(L)}&scope=contact_data+campaign_data+offline_access&state=${encodeURIComponent(I)}`;window.location.href=T}catch(t){a({title:"Error",description:t.message,variant:"destructive"})}};return e.jsxs("div",{className:"p-6 space-y-6 max-w-3xl mx-auto",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight","data-testid":"text-settings-title",children:"Settings"}),e.jsx(z,{path:"/settings"})]}),e.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Application configuration"})]}),e.jsxs(n,{children:[e.jsx(i,{children:e.jsxs(c,{className:"text-base flex items-center gap-2",children:[e.jsx(J,{className:"h-4 w-4"}),"Dashboard Preferences"]})}),e.jsx(r,{children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(o,{className:"text-sm font-medium",children:"Default Dashboard View"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Choose whether the dashboard shows only your listings and deals, or the entire brokerage."})]}),e.jsxs($,{value:l,onValueChange:t=>v(t),children:[e.jsx(H,{className:"w-[160px]","data-testid":"select-dashboard-view",children:e.jsx(K,{})}
1),e.jsxs(O,{children:[e.jsx(C,{value:"my",children:"My View"}),e.jsx(C,{value:"brokerage",children:"Brokerage"})]})]})]})})]}),e.jsxs(n,{children:[e.jsx(i,{children:e.jsxs(c,{className:"text-base flex items-center gap-2",children:[x==="dark"?e.jsx(Q,{className:"h-4 w-4"}):e.jsx(Y,{className:"h-4 w-4"}),"Appearance"]})}),e.jsx(r,{children:e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(o,{className:"text-sm font-medium",children:"Dark Mode"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Switch between light and dark themes."})]}),e.jsx(U,{checked:x==="dark",onCheckedChange:t=>N(t?"dark":"light"),"data-testid":"switch-dark-mode"})]})})]}),e.jsxs(n,{children:[e.jsx(i,{children:e.jsx(c,{className:"text-base",children:"Brokerage Information"})}),e.jsx(r,{children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-md bg-primary/10 border",children:e.jsx(A,{className:"h-8 w-8 text-primary"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold","data-testid":"text-brokerage-name",children:"Wiese & Associates"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Commercial Real Estate Brokerage"})]})]})})]}),e.jsxs(n,{children:[e.jsx(i,{children:e.jsx(c,{className:"text-base",children:"Invoice Settings"})}),e.jsx(r,{children:e.jsxs("div",{className:"space-y-2 text-sm text-muted-foreground",children:[e.jsx("p",{children:"Payment instructions that appear on generated invoices:"}),e.jsxs("div",{className:"p-3 rounded-md bg-muted/30 border",children:[e.jsx("p",{className:"font-medium text-foreground",children:"Wire Transfer Instructions"}),e.jsx("p",{children:"Bank: Commercial Bank"}),e.jsx("p",{children:"Routing: XXXXXXXXX"}),e.jsx("p",{children:"Account: XXXXXXXXX"}),e.jsx("p",{className:"mt-2",children:"Please reference the invoice number in your payment."})]})]})})]}),e.jsxs(n,{children:[e.jsx(i,{children:e.jsx(c,{className:"text-base",children:"Default Marketing Items"})}),e.jsx(r,{children:e.jsxs("div",{className:"space-y-1 text-sm text-muted-foreground",children:[e.jsx("p",{children:"These items are automatically added to new listings:"}),e.jsxs("ul",{className:"list-disc list-inside mt-2 space-y-1",children:[e.jsx("li",{children:"Take photos"}),e.jsx("li",{children:"Create floor plan"}),e.jsx("li",{children:"Install sign"}),e.jsx("li",{children:"Create brochure"}),e.jsx("li",{children:"List on CoStar"}),e.jsx("li",{children:"List on LoopNet"}),e.jsx("li",{children:"List on BizBuySell"}),e.jsx("li",{children:"List on MLS"}),e.jsx("li",{children:"Post to ewiese.com"}),e.jsx("li",{children:"Send mass email campaign"})]})]})})]}),u&&e.jsxs(n,{children:[e.jsx(i,{children:e.jsxs(c,{className:"text-base flex items-center gap-2",children:[e.jsx(F,{className:"h-4 w-4"}),"Constant Contact Integration"]})}),e.jsxs(r,{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(o,{className:"text-sm font-medium",children:"Status:"}),k?e.jsx(g,{className:"h-4 w-4 animate-spin text-muted-foreground","data-testid":"loader-cc-status"}):s?.connected?e.jsxs("span",{className:"flex items-center gap-1 text-sm text-green-600 dark:text-green-400","data-testid":"text-cc-connected",children:[e.jsx(W,{className:"h-4 w-4"}),"Connected"]}):e.jsxs("span",{className:"flex items-center gap-1 text-sm text-red-600 dark:text-red-400","data-testid":"text-cc-disconnected",children:[e.jsx(G,{className:"h-4 w-4"}),"Disconnected"]})]}),s&&!s.connected&&s.error&&e.jsx("p",{className:"text-xs text-muted-foreground","data-testid":"text-cc-error",children:s.error}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{className:"text-sm font-medium",children:"Client ID"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(P,{type:"text",placeholder:s?.hasClientId?"Client ID is configured (enter new to update)":"Enter Constant Contact Client ID",value:h,onChange:t=>p(t.target.value),"data-testid":"input-cc-client-id"}),e.jsx(f,{size:"sm",onClick:()=>m.mutate(h),disabled:!h.trim()||m.isPending,"data-testid":"button-save-cc-client-id",children:m.isPending?e.jsx(g,{className:"h-4 w-4 animate-spin"}):"Save"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"The Client Secret should be set as the CONSTANT_CONTACT_CLIENT_SECRET environment variable."})]}),e.jsxs(f,{onClick:b,variant:s?.connected?"outline":"default",className:"w-full","data-testid":"button-connect-cc",children:[e.jsx(V,{className:"h-4 w-4 mr-2"}),s?.connected?"Reconnect to Constant Contact":"Connect to Constant Contact"]})]})]})]})}export{le 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.