1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3185],{7388:function(e,t,n){Promise.resolve().then(n.bind(n,64215)),Promise.resolve().then(n.bind(n,26714)),Promise.resolve().then(n.bind(n,69872)),Promise.resolve().then(n.bind(n,43592)),Promise.resolve().then(n.bind(n,4202)),Promise.resolve().then(n.bind(n,82798)),Promise.resolve().then(n.bind(n,33606)),Promise.resolve().then(n.t.bind(n,41572,23)),Promise.resolve().then(n.t.bind(n,99549,23)),Promise.resolve().then(n.t.bind(n,20806,23)),Promise.resolve().then(n.t.bind(n,63375,23)),Promise.resolve().then(n.t.bind(n,81909,23)),Promise.resolve().then(n.t.bind(n,82662,23)),Promise.resolve().then(n.t.bind(n,59444,23)),Promise.resolve().then(n.t.bind(n,47960,23))},81883:function(e,t,n){"use strict";n.d(t,{T:function(){return l},l:function(){return s}});var r=n(57437),i=n(2265);let o={organizationId:null,organizationName:null,logoUrl:null,faviconUrl:null,primaryColor:"#0d6e6e",secondaryColor:"#1e293b",accentColor:"#e3a008",isWhiteLabeled:!1,loading:!0},a=(0,i.createContext)(o);function l(){return(0,i.useContext)(a)}function s({children:e}){let[t,n]=(0,i.useState)(o);(0,i.useEffect)(()=>{let e=!1;return async function(){try{let t=window.location.hostname,r="/api/branding";!t||["localhost","127.0.0.1"].includes(t)||t.includes("abacusai.app")||(r=`/api/branding?domain=${encodeURIComponent(t)}`);let i=await fetch(r);if(!i.ok){e||n(e=>({...e,loading:!1}));return}let o=await i.json();e||(o.branding?n({organizationId:o.branding.organizationId,organizationName:o.branding.organizationName,logoUrl:o.branding.logoUrl,faviconUrl:o.branding.faviconUrl,primaryColor:o.branding.primaryColor||"#0d6e6e",secondaryColor:o.branding.secondaryColor||"#1e293b",accentColor:o.branding.accentColor||"#e3a008",isWhiteLabeled:o.branding.isWhiteLabeled||!1,loading:!1}):n(e=>({...e,loading:!1})))}catch{e||n(e=>({...e,loading:!1}))}}(),()=>{e=!0}},[]),(0,i.useEffect)(()=>{if(t.loading||!t.isWhiteLabeled)return;let e=document.documentElement;e.style.setProperty("--org-primary",t.primaryColor),e.style.setProperty("--org-secondary",t.secondaryColor),e.style.setProperty("--org-accent",t.accentColor);let n=e=>{let t=e.replace("#","");return`${parseInt(t.substring(0,2),16)}, ${parseInt(t.substring(2,4),16)}, ${parseInt(t.substring(4,6),16)}`};return e.style.setProperty("--org-primary-rgb",n(t.primaryColor)),e.style.setProperty("--org-accent-rgb",n(t.accentColor)),()=>{e.style.removeProperty("--org-primary"),e.style.removeProperty("--org-secondary"),e.style.removeProperty("--org-accent"),e.style.removeProperty("--org-primary-rgb"),e.style.removeProperty("--org-accent-rgb")}},[t]),(0,i.useEffect)(()=>{if(t.loading||!t.faviconUrl)return;let e=document.querySelector('link[rel="icon"]');e&&(e.href=t.faviconUrl)},[t.faviconUrl,t.loading]);let l=(0,i.useMemo)(()=>t,[t]);return(0,r.jsx)(a.Provider,{value:l,children:e})}},64215:function(e,t,n){"use strict";n.d(t,{ChunkLoadErrorHandler:function(){return i}});var r=n(2265);function i(){return(0,r.useEffect)(()=>{let e=e=>{(e.error?.name==="ChunkLoadError"||e.error?.message?.includes("Loading chunk"))&&(e.preventDefault(),window.location.reload())};return window.addEventListener("error",e),()=>window.removeEventListener("error",e)},[]),null}},26714:function(e,t,n){"use strict";n.d(t,{Providers:function(){return h}});var r=n(57437),i=n(80605),o=n(81883),a=n(48156),l=n(2265);let s=new Set(["SCRIPT","STYLE","NOSCRIPT","CODE","PRE","TEXTAREA","SVG","PATH"]),c="vp.tcache.";function d(e){let t=e.trim();return!(t.length<2)&&!(!/[A-Za-z\u00C0-\u017F]/.test(t)||/^https?:\/\//i.test(t)||/^\S+@\S+\.\S+$/.test(t))}function u(e){let t=e.match(/^(\s*)([\s\S]*?)(\s*)$/);return t?{lead:t[1]||"",core:t[2]||"",trail:t[3]||""}:{lead:"",core:e,trail:""}}function m(e){let t=e.nodeType===Node.TEXT_NODE?e.parentElement:e;for(;t;){if(s.has(t.tagName)||t.getAttribute&&("no"===t.getAttribute("translate")||t.hasAttribute("data-no-translate")))return!0;t=t.parentElement}return!1}function p(){let{locale:e}=(0,a.ZK)(),t=(0,l.useRef)(new Map),n=(0,l.useRef)(new Map),r=(0,l.useRef)(null),i=(0,l.useRef)(null),o=(0,l.useRef)(new Set),s=(0,l.useRef)(!1);function p(){var e;let i=r.current;i&&i.disconnect(),function(e){let t=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,{acceptNode:e=>!(e.nodeValue||"").trim()||m(e)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),n=t.nextNode();for(;n;)e(n),n=t.nextNode()}(e=>{let{lead:r,core:i,trail:a}=u(e.nodeValue||"");if(!d(i)||n.current.has(i))return;let l=t.current.get(i);l&&l!==i?e.nodeValue=r+l+a:l||o.current.add(i)}),e=e=>{let r=(e.getAttribute("placeholder")||"").trim();if(!d(r)||n.current.has(r))return;let i=t.current.get(r);i&&i!==r?e.setAttribute("placeholder",i):i||o.current.add(r)},document.querySelectorAll("input[placeholder], textarea[placeholder]").forEach(t=>{m(t)||e(t)}),i&&i.observe(document.body,{childList:!0,subtree:!0,characterData:!0}
1)}function h(){i.current&&clearTimeout(i.current),i.current=setTimeout(g,200)}async function g(){if(s.current){h();return}let e=Array.from(o.current);if(0!==e.length){o.current.clear(),s.current=!0;try{let r=await fetch("/api/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({texts:e,target:"es"})});if(r.ok){let i=await r.json(),o=Array.isArray(i?.translations)?i.translations:[];e.forEach((e,r)=>{let i=o[r];"string"==typeof i&&i.length>0&&(t.current.set(e,i),n.current.set(i,e))}),function(e){try{let e={};t.current.forEach((t,n)=>{e[n]=t}),window.localStorage.setItem(c+"es",JSON.stringify(e))}catch{}}(0),p()}}catch{}finally{s.current=!1,o.current.size>0&&h()}}}return(0,l.useEffect)(()=>{if("es"!==e){r.current&&(r.current.disconnect(),r.current=null),function(){let e=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,null),t=e.nextNode();for(;t;){let r=t,{lead:i,core:o,trail:a}=u(r.nodeValue||""),l=n.current.get(o);l&&l!==o&&(r.nodeValue=i+l+a),t=e.nextNode()}document.querySelectorAll("input[placeholder], textarea[placeholder]").forEach(e=>{let t=(e.getAttribute("placeholder")||"").trim(),r=n.current.get(t);r&&r!==t&&e.setAttribute("placeholder",r)})}();return}return function(e){try{let e=window.localStorage.getItem(c+"es");if(e){let r=JSON.parse(e);for(let e of Object.keys(r))t.current.set(e,r[e]),n.current.set(r[e],e)}}catch{}}(0),p(),h(),function(){r.current&&r.current.disconnect();let e=new MutationObserver(()=>{p(),h()});e.observe(document.body,{childList:!0,subtree:!0,characterData:!0}),r.current=e}(),()=>{r.current&&(r.current.disconnect(),r.current=null),i.current&&(clearTimeout(i.current),i.current=null)}},[e]),null}function h({children:e}){return(0,r.jsx)(i.SessionProvider,{children:(0,r.jsx)(a.iL,{children:(0,r.jsxs)(o.l,{children:[(0,r.jsx)(p,{}),e]})})})}},69872:function(e,t,n){"use strict";n.d(t,{default:function(){return i}});var r=n(2265);function i(){return(0,r.useEffect)(()=>{if(!("serviceWorker"in navigator))return;let e=()=>{navigator.serviceWorker.register("/sw.js",{scope:"/"}).catch(e=>{console.warn("[PWA] Service worker registration failed:",e)})};"complete"===document.readyState?e():window.addEventListener("load",e,{once:!0})},[]),null}},43592:function(e,t,n){"use strict";n.d(t,{default:function(){return v}});var r=n(57437),i=n(2265),o=n(99376),a=n(80605),l=n(5095),s=n(60429),c=n(75368),d=n(40875),u=n(82023),m=n(32489),p=n(82718),h=n(62869);let g={"/dashboard":{module:"Practitioner Dashboard",description:"Main dashboard with quick stats, patient overview, and quick actions"},"/patients":{module:"Patient Management",description:"Patient list, patient details, create/edit patients, duplicate management"},"/new-protocol":{module:"Protocol Generation",description:"Create new AI-generated protocols from consult audio recordings"},"/protocols":{module:"Protocol List",description:"View, search, edit, finalize, and export protocols"},"/protocol-architect":{module:"Protocol Architectâ¢",description:"Advanced AI clinical consultation via voice, chat, or avatar"},"/clinical-notes":{module:"Clinical Notes",description:"SOAP, follow-up, initial consult, lab review, and other clinical documentation"},"/lab-interpreter":{module:"Lab Interpretation Engine",description:"AI-powered lab analysis with functional medicine reference ranges"},"/wearables":{module:"Wearables Engine",description:"Oura, WHOOP, Apple Health, Garmin, CGM data and intelligence"},"/telehealth":{module:"Telehealth",description:"Video consultations with AI recording and transcription"},"/scheduling":{module:"Scheduling",description:"Appointment calendar and booking management"},"/billing":{module:"Billing & Membership",description:"Subscription management, invoices, payment methods, tier comparison"},"/companion":{module:"Protocol Companionâ¢",description:"AI Protocol Companion with check-ins, reminders, and coaching"},"/settings":{module:"Settings",description:"AI profile, branding, dispensary, compliance, telehealth, integrations, avatar, embed"},"/enterprise":{module:"Enterprise Admin",description:"Organization dashboard, team members, API keys, webhooks, integrations"},"/admin":{module:"System Administration",description:"User management, feature flags, audit logs, system monitoring"},"/referrals":{module:"Referral Program",description:"Refer practitioners and track commissions"},"/care-teams":{module:"Care Teams",description:"Multi-practitioner team management and patient sharing"},"/marketing-tools":{module:"Marketing Tools",description:"AI content generator for social media, blogs, and emails"},"/patient-handouts":{module:"Patient Handouts",description:"Generate and send educational handouts to patients"},"/ai-usage":{module:"AI Usage Dashboard",description:"Track AI credit consumption and monthly quotas"},"/template-builder":{module:"Template & Rule Builder",description:"Create protocol templates and clinical decision rules"},"/iv-therapy":{module:"IV Therapy Intelligence",description:"IV therapy protocol design and intelligence"},"/cv-precision-engine":{module:"CV Precision Engineâ¢",description:"Cardiovascular risk intelligence and analysis"},"/iron-ferritin":{module:"Iron & Ferritin Intelligence",description:"Iron metabolism and ferritin analysis"},"/chronic-pain":{module:"Pain Intelligence",description:"Chronic pain analysis and treatment intelligence"},"/metabolic-dysfunction":{module:"Metabolic Intelligence",description:"Metabolic dysfunction analysis and optimization"},"/alpha-gal":{module:"Alpha-Gal Syndrome (AGS)",description:"Alp
1ha-galactose allergy syndrome management"},"/uc-intelligence":{module:"UC Intelligence",description:"Ulcerative colitis intelligence and management"},"/urolithin-a":{module:"Mitochondrial Intelligence",description:"Mitochondrial health and Urolithin-A analysis"},"/root-cause-engine":{module:"Root Cause Engine",description:"Identify root causes across symptoms and systems"},"/symptom-intelligence":{module:"Symptom Intelligence",description:"Symptom pattern analysis and correlation"},"/clinical-intelligence":{module:"Clinical Intelligence",description:"Advanced clinical analytics dashboard"},"/practice-intelligence":{module:"Practice Intelligence",description:"Practice-wide analytics and optimization"},"/multi-agent":{module:"Multi-Agent Specialist",description:"AI specialist routing for complex cases"},"/peptide-intelligence":{module:"Peptide Intelligence",description:"Peptide therapy analysis and recommendations"},"/peptide-calculator":{module:"Peptide Calculator",description:"Peptide dosing calculations"},"/clinical-timeline":{module:"Timeline Intelligence",description:"Patient health journey timeline and trends"},"/prescriptions":{module:"Prescription Management",description:"Manage prescriptions within protocols"},"/pharmacy-directory":{module:"Pharmacy Directory",description:"Search compounding and specialty pharmacies"},"/my-intelligence":{module:"My Intelligence",description:"Personalized practice insights and AI analysis"},"/portal":{module:"Patient Portal",description:"Patient-facing portal for health tracking, messages, appointments, and protocols"},"/portal/intake":{module:"Patient Intake Forms",description:"Comprehensive patient health intake questionnaire"},"/portal/companion":{module:"Protocol Companion⢠(Patient)",description:"AI coaching, check-ins, reminders, and meal guidance"},"/portal/uploads":{module:"Patient Lab Uploads",description:"Upload lab results and health documents"},"/portal/wearable":{module:"Patient Wearable Data",description:"View and import wearable device data"},"/portal/telehealth":{module:"Patient Telehealth",description:"Join telehealth video visits"},"/portal/messages":{module:"Patient Messages",description:"Send messages to your practitioner"},"/portal/appointments":{module:"Patient Appointments",description:"View and book appointments"},"/portal/symptoms":{module:"Symptom Tracking",description:"Log and track daily symptoms"},"/portal/check-in":{module:"Daily Check-In",description:"Daily health check-in and progress tracking"}};function f(e){if(!e)return null;if(g[e])return g[e];for(let t of Object.keys(g).sort((e,t)=>t.length-e.length))if(e.startsWith(t))return g[t];return null}let y=["/protocol-architect","/portal/companion","/ai-receptionist"],b=["/ai-receptionist"],x=["molddetox.ai","moldrecovery.abacusai.app"];function v(){let e=(0,o.usePathname)(),{data:t}=(0,a.useSession)()||{},[n,g]=(0,i.useState)(!1),[v,w]=(0,i.useState)(!1),[P,k]=(0,i.useState)(null),[S,N]=(0,i.useState)(!1),E=(0,i.useRef)(null);(0,i.useRef)(!1),(0,i.useEffect)(()=>{let e=window.location.hostname;N(x.some(t=>e===t||e===`www.${t}`))},[]);let C=S||!!e?.startsWith("/mold"),A=C?"MoldDetox.ai Solutionist":"VoiceProtocol Solutionistâ¢",I=C?"[email protected]":"[email protected]",T=y.some(t=>e?.startsWith(t)),j=(0,i.useCallback)(()=>{let n=f(e),r=e?.startsWith("/portal")?"patient":e?.startsWith("/admin")?"admin":e?.startsWith("/affiliate")?"affiliate":e?.startsWith("/enterprise")?"enterprise_admin":t?.user?.role==="ADMIN"?"admin":"practitioner",i=t?.user?.subscriptionTier||"unknown",o=`[CONTEXT â DO NOT REPEAT THIS BACK TO THE USER] The user is currently on:`;return o+=` 2- Page: ${e}`,n&&(o+=` 3- Module: ${n.module} 4- Module Description: ${n.description}`),o+=` 5- User Role: ${r} 6- Subscription Tier: ${i}`,t?.user?.email&&(o+=` 7- User: ${t.user.email}`),o+=` 8 9Use this context to provide relevant, page-specific help. Do not mention this context message to the user.`},[e,t]),M=(0,i.useCallback)(()=>{k(j()),g(!0),w(!1)},[j]),L=(0,i.useCallback)(()=>{k(null),g(!0)},[]);(0,i.useEffect)(()=>{if(!n||!P||!E.current)return;let e=setTimeout(()=>{try{E.current?.contentWindow?.postMessage({type:"SEND_MESSAGE",message:P},"*")}catch{}},2e3);return()=>clearTimeout(e)},[n,P]);let O=C?null:f(e);return b.some(t=>e?.startsWith(t))?null:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.M,{children:!n&&(0,r.jsxs)(s.E.div,{initial:{opacity:0,scale:.8,y:20}
9,animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.8,y:20},transition:{duration:.25},className:`fixed bottom-5 right-5 z-50 flex flex-col items-end gap-2${T?" sm:flex hidden":""}`,children:[(0,r.jsx)(l.M,{children:v&&O&&(0,r.jsxs)(s.E.button,{initial:{opacity:0,y:10,scale:.9},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:10,scale:.9},transition:{duration:.15},onClick:M,className:"flex items-center gap-2 px-3.5 py-2.5 rounded-xl bg-background border shadow-lg hover:shadow-xl transition-all text-sm font-medium text-foreground hover:bg-muted max-w-[260px] text-left",children:[(0,r.jsx)(c.Z,{className:"h-4 w-4 shrink-0 text-teal-500"}),(0,r.jsxs)("span",{className:"line-clamp-2",children:["Ask about ",(0,r.jsx)("span",{className:"font-semibold text-teal-600",children:O.module})]})]})}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[O&&(0,r.jsx)("button",{onClick:()=>w(e=>!e),className:"h-10 w-10 rounded-full bg-background border shadow-md flex items-center justify-center hover:bg-muted transition-colors","aria-label":"Page-specific help",children:(0,r.jsx)(d.Z,{className:`h-4 w-4 text-teal-500 transition-transform ${v?"rotate-180":""}`})}),(0,r.jsxs)("div",{className:"relative group",children:[(0,r.jsx)(h.z,{onClick:L,className:"h-14 w-14 rounded-full shadow-lg hover:shadow-xl transition-shadow p-0 bg-gradient-to-br from-teal-500 to-emerald-600","aria-label":"Open Solutionist assistant",children:(0,r.jsx)(u.Z,{className:"h-6 w-6"})}),(0,r.jsx)("div",{className:"absolute bottom-full right-0 mb-2 px-2.5 py-1 rounded-full bg-background border shadow-md text-xs font-semibold text-foreground whitespace-nowrap opacity-0 group-hover:opacity-100 transition-opacity pointer-events-none",children:"Ask the Solutionist"})]})]})]})}),(0,r.jsx)(l.M,{children:n&&(0,r.jsxs)(s.E.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{duration:.2},className:"fixed bottom-5 right-5 z-50 w-[calc(100vw-2.5rem)] sm:w-[420px] h-[calc(100vh-6rem)] sm:h-[600px] max-h-[85vh] bg-background border rounded-xl shadow-2xl flex flex-col overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 bg-gradient-to-r from-teal-500 to-emerald-600 text-white shrink-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"h-8 w-8 rounded-full bg-white/20 flex items-center justify-center",children:(0,r.jsx)(u.Z,{className:"h-4 w-4"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"font-semibold text-sm leading-tight",children:A}),(0,r.jsx)("div",{className:"text-xs opacity-80 leading-tight",children:O?`Helping with ${O.module}`:C?"Your MoldDetox.ai guide":"Your AI platform expert"})]})]}),(0,r.jsx)("button",{onClick:()=>{g(!1),k(null)},className:"opacity-80 hover:opacity-100 transition-opacity","aria-label":"Close Solutionist",children:(0,r.jsx)(m.Z,{className:"h-5 w-5"})})]}),(0,r.jsx)("div",{className:"flex-1 relative bg-muted/20",children:(0,r.jsx)("iframe",{ref:E,src:`https://apps.abacus.ai/chatllm/?appId=${C?"564a431fc":"1325a88350"}&hideTopBar=2`,className:"absolute inset-0 w-full h-full border-0",allow:"microphone",title:A})}),(0,r.jsxs)("div",{className:"border-t bg-background px-3 py-2 flex items-center justify-between shrink-0",children:[(0,r.jsxs)("span",{className:"text-[10px] text-muted-foreground",children:["Need a human?"," ",(0,r.jsx)("a",{href:`mailto:${I}`,className:"text-teal-500 hover:underline",children:I})]}),O&&(0,r.jsxs)("button",{onClick:M,className:"text-[10px] text-teal-500 hover:text-teal-600 font-medium flex items-center gap-0.5",children:[(0,r.jsx)(p.Z,{className:"h-3 w-3"}),"About this page"]})]})]})})]})}},4202:function(e,t,n){"use strict";n.d(t,{StylesheetErrorHandler:function(){return o}});var r=n(2265);let i="vp_stylesheet_reload_attempt";function o(){return(0,r.useEffect)(()=>{let e;let t=()=>{let e="0";try{e=sessionStorage.getItem(i)||"0"}catch{}if("1"!==e){try{sessionStorage.setItem(i,"1")}catch{}window.location.reload()}},n=e=>{let n=e.target;n&&"LINK"===n.tagName&&"stylesheet"===n.rel&&t()};window.addEventListener("error",n,!0);let r=()=>{try{let e=Array.from(document.querySelectorAll('link[rel="stylesheet"]')).filter(e=>e.href.includes("/_next/"));if(0===e.length)return;Array.from(document.styleSheets).some(e=>{try{return(e.cssRules?.length??0)>0}catch{return!0}})||t()}catch{}},o=()=>{e=setTimeout(r,1500)};"complete"===document.readyState?o():window.addEventListener("load",o,{once:!0});let a=setTimeout(()=>{try{sessionStorage.removeItem(i)}catch{}},5e3);return()=>{window.removeEventListener("error",n,!0),window.removeEventListener("load",o),e&&clearTimeout(e),clearTimeout(a)}},[]),null}},82798:function(e,t,n){"use strict";n.d(t,{ThemeProvider:function(){return o}});var r=n(57437);n(2265);var i=n(25922);function o({children:e,...t}){return(0,r.jsx)(i.f,{...t,children:e})}},33606:function(e,t,n){"use strict";n.d(t,{Toaster:function(){return a}});var r=n(57437),i=n(25922),o=n(14438);let a=({...e})=>{let{theme:t="system"}=(0,i.F)();return(0,r.jsx)(o.x7,{theme:t,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...e})}},47960:function(){}},function(e){e.O(0,[762,3587,8590,429,605,2868,196,4231,2971,2117,1744],function(){return e(e.s=7388)}),_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.