1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5025],{13546:(e,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>u});var n=a(37876),t=a(14232),i=a(77328),l=a.n(i),c=a(34979),r=a(40505),d=a(58565),o=a(86719),h=a(61785),m=a.n(h);function u(){let{authLoading:e}=(0,c.E)(),[s,a]=(0,t.useState)(null),[i,h]=(0,t.useState)(null),[u,p]=(0,t.useState)(!0),[j,x]=(0,t.useState)(""),[g,_]=(0,t.useState)([]),[N,b]=(0,t.useState)("");(0,t.useEffect)(()=>{e||Promise.all([fetch("/api/admin/publishing/gmail").then(e=>e.json()),fetch("/api/admin/publishing/zoominfo").then(e=>e.json())]).then(e=>{let[s,n]=e;a(s),h(n)}).finally(()=>p(!1))},[e]);let f=async()=>{var e,s;let a=await fetch("/api/admin/publishing/gmail",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"sync"})}),n=await a.json();alert("Synced: ".concat(null!=(e=n.messagesScanned)?e:0," messages, ").concat(null!=(s=n.activitiesCreated)?s:0," activities created"))},v=async()=>{var e;let s=await fetch("/api/admin/publishing/zoominfo",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"search",query:j})});_(null!=(e=(await s.json()).results)?e:[])};return e||u?(0,n.jsx)(o.A,{children:(0,n.jsx)("div",{className:m().center,children:(0,n.jsx)(d.A,{})})}):(0,n.jsxs)(o.A,{children:[(0,n.jsx)(l(),{children:(0,n.jsx)("title",{children:"Settings â Publishing CRM"})}),(0,n.jsxs)("div",{className:m().page,children:[(0,n.jsx)(r.A,{title:"Publishing CRM Settings"}),(0,n.jsxs)("div",{className:m().card,style:{marginBottom:16},children:[(0,n.jsx)("p",{className:m().cardTitle,children:"Gmail Integration"}),(null==s?void 0:s.connected)?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("p",{children:["Connected: ",s.emailAddress]}),(0,n.jsxs)("p",{className:m().listMeta,children:["Last synced: ",s.lastSyncedAt?new Date(s.lastSyncedAt).toLocaleString():"Never"]}),(0,n.jsx)("button",{className:m().btn,onClick:f,children:"Sync Now"})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{children:"Connect your Gmail mailbox to sync emails matching CRM contacts."}),(0,n.jsx)("p",{className:m().listMeta,children:"Other admins cannot browse your mailbox. Only matched contact emails create shared activity records."}),(0,n.jsx)("p",{className:m().listMeta,children:"TODO: Complete Google OAuth flow with gmail.readonly scope."})]})]}),(0,n.jsxs)("div",{className:m().card,style:{marginBottom:16},children:[(0,n.jsx)("p",{className:m().cardTitle,children:"ZoomInfo Integration"}),(0,n.jsx)("p",{children:null==i?void 0:i.message}),(0,n.jsxs)("div",{className:m().filters,children:[(0,n.jsx)("input",{className:m().input,placeholder:"Search associationsâ¦",value:j,onChange:e=>x(e.target.value)}),(0,n.jsx)("button",{className:m().btn,onClick:v,children:"Search"})]}),0===g.length&&(0,n.jsx)("p",{className:m().listMeta,children:"No results â API integration pending credentials."})]}),(0,n.jsxs)("div",{className:m().card,style:{marginBottom:16},children:[(0,n.jsx)("p",{className:m().cardTitle,children:"AI Configuration"}),(0,n.jsxs)("p",{children:["Set ",(0,n.jsx)("code",{children:"OPENAI_API_KEY"})," in environment variables to enable AI insights, email drafts, and analysis."]}),(0,n.jsxs)("p",{className:m().listMeta,children:["Optional: ",(0,n.jsx)("code",{children:"OPENAI_MODEL"})," (default: gpt-4o-mini)"]})]}),!1]})]})}},40505:(e,s,a)=>{"use strict";a.d(s,{A:()=>h});var n=a(37876),t=a(48230),i=a.n(t),l=a(77821),c=a.n(l);function r(e){let{crumbs:s}=e;return(0,n.jsx)("nav",{className:c().breadcrumbs,"aria-label":"Breadcrumb",children:s.map((e,a)=>{let t=a===s.length-1;return(0,n.jsxs)("span",{className:c().item,children:[a>0&&(0,n.jsx)("span",{className:c().sep,children:"/"}),e.href&&!t?(0,n.jsx)(i(),{href:e.href,className:c().link,children:e.label}):(0,n.jsx)("span",{className:t?c().current:c().link,children:e.label})]},a)})})}var d=a(46963),o=a.n(d);function h(e){let{title:s,crumbs:a,action:t}=e;return(0,n.jsxs)("div",{className:o().header,children:[(0,n.jsxs)("div",{className:o().left,children:[a&&a.length>0&&(0,n.jsx)(r,{crumbs:a}),(0,n.jsx)("h1",{className:o().title,children:s})]}),t&&(0,n.jsx)("div",{className:o().action,children:t})]})}},46963:e=>{e.exports={header:"PageHeader_header__M06pS",left:"PageHeader_left__vrvwU",title:"PageHeader_title__50hUa",action:"PageHeader_action__XPlYH"}},77821:e=>{e.exports={breadcrumbs:"Breadcrumbs_breadcrumbs__zQHYu",item:"Breadcrumbs_item___vgqj",sep:"Breadcrumbs_sep__Xtka6",link:"Breadcrumbs_link___lqmB",current:"Breadcrumbs_current__rkAHt"}},90992:(e,s,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/publishing/settings",function(){return a(13546)}])}},e=>{e.O(0,[552,636,6593,8792],()=>e(e.s=90992)),_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.