PageSourceSearch

https://app.usehabits.com/_next/static/chunks/pages/advisor/intelligence-demo-7e0882b0373306f1.js

js usehabits.com collected 2026-10-01 15:49:04 UTC 9,192 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6690],{24476:(e,s,t)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/advisor/intelligence-demo",function(){return t(31373)}])},31373:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>h});var a=t(14232),l=t(61032),i=t(41086),n=t(48230),r=t.n(n),d=t(22929),c=t(86788),o=t(39117),m=t(37876);let x=e=>{let{children:s}=e,{isEnabled:t,isLoading:i,error:n}=(0,l.A)("advisor-intelligence",{defaultValue:!1}),{canUseIntelligence:x,loading:h}=(0,d.A)();return(a.useEffect(()=>{t&&(0,c.O)(o.s6.INFO,"[AdvisorIntelligence] Feature enabled for user")},[t]),i||h)?(0,m.jsx)("div",{className:"flex items-center justify-center p-4",children:(0,m.jsxs)("div",{className:"animate-pulse flex space-x-2",children:[(0,m.jsx)("div",{className:"h-2 w-2 bg-blue-500 rounded-full animate-bounce"}),(0,m.jsx)("div",{className:"h-2 w-2 bg-blue-500 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),(0,m.jsx)("div",{className:"h-2 w-2 bg-blue-500 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]})}):n?((0,c.O)(o.s6.ERROR,`[AdvisorIntelligence] Feature flag error: ${n}`),null):t?h||!1!==x?s:(0,m.jsxs)("div",{className:"mx-auto max-w-lg p-8 text-center",children:[(0,m.jsx)("p",{className:"text-lg font-medium text-[var(--primary-text)]",children:"Advisor Intelligence is not available yet"}),(0,m.jsx)("p",{className:"mt-2 text-sm text-[var(--label-text)]",children:"Finish creating your account to unlock research and company intelligence tools."}),(0,m.jsx)(r(),{href:o.l4,className:"mt-4 inline-block text-sm font-medium text-habitsgreen underline",children:"Continue registration"})]}):null},h=()=>{let{user:e,userId:s,isAuthenticated:t}=(0,i.A)(),{isEnabled:n,isLoading:r,error:d,refreshFlag:c}=(0,l.A)("advisor-intelligence"),{0:o,1:h}=(0,a.useState)(null),{0:u,1:b}=(0,a.useState)(!1),g=async()=>{b(!0);try{let e=await fetch("/api/beta-testers"),s=await e.json();h(s)}catch(e){console.error("Error fetching beta testers:",e)}finally{b(!1)}};return(0,m.jsx)("div",{className:"max-w-4xl mx-auto p-6 space-y-8",children:(0,m.jsxs)("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[(0,m.jsx)("h1",{className:"text-3xl font-bold text-gray-900 mb-2",children:"\uD83E\uDDE0 Advisor Intelligence Demo"}),(0,m.jsx)("p",{className:"text-gray-600 mb-6",children:"This page demonstrates the beta testing system integration with your backend."}),(0,m.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg mb-6",children:[(0,m.jsx)("h3",{className:"font-semibold text-gray-900 mb-3",children:"Your Current Status"}),(0,m.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[(0,m.jsxs)("div",{children:[(0,m.jsx)("span",{className:"text-gray-600",children:"User Type:"}),(0,m.jsx)("div",{className:"font-medium",children:e||"Not set"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("span",{className:"text-gray-600",children:"User ID:"}),(0,m.jsx)("div",{className:"font-medium",children:s||"Not set"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("span",{className:"text-gray-600",children:"Authenticated:"}),(0,m.jsx)("div",{className:"font-medium",children:t?"✅ Yes":"❌ No"})]}),(0,m.jsxs)("div",{children:[(0,m.jsx)("span",{className:"text-gray-600",children:"Intelligence Access:"}),(0,m.jsx)("div",{className:`font-medium ${n?"text-green-600":"text-red-600"}`,children:r?"⏳ Loading...":n?"✅ Enabled":"❌ Not Enabled"})]})]})]}),(0,m.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4 mb-6",children:[(0,m.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,m.jsx)("h3",{className:"font-semibold text-gray-900",children:"Feature Flag Status"}),(0,m.jsx)("button",{onClick:c,disabled:r,className:"bg-blue-600 hover:bg-blue-700 disabled:opacity-50 text-white px-3 py-1 rounded text-sm",children:r?"Loading...":"Refresh"})]}),(0,m.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,m.jsxs)("div",{className:"flex justify-between",children:[(0,m.jsx)("span",{children:"Advisor Intelligence Enabled:"}),(0,m.jsx)("span",{className:`font-medium ${n?"text-green-600":"text-red-600"}`,children:n?"YES":"NO"})]}),(0,m.jsxs)("div",{className:"flex justify-between",children:[(0,m.jsx)("span",{children:"Loading:"}),(0,m.jsx)("span",{children:r?"YES":"NO"})]}),d&&(0,m.jsxs)("div",{className:"flex justify-between",children:[(0,m.jsx)("span",{children:"Error:"}),(0,m.jsx)("span",{className:"text-red-600",children:d})]})]})]}),(0,m.jsxs)("div",{className:"border border-gray-200 rounded-lg p-4 mb-6",children:[(0,m.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,m.jsx)("h3",{className:"font-semibold text-gray-900",children:"Beta Testers Backend Data"}),(0,m.jsx)("button",{onClick:g,disabled:u,className:"bg-green-600 hover:bg-green-700 disabled:opacity-50 text-white px-3 py-1 rounded text-sm",children:u?"Loading...":"Fetch Data"})]}),o?(0,m.jsx)("div",{className:"space-y-3",children:o.success?(0,m.jsxs)("div",{children:[(0,m.jsx)("p",{className:"text-green-600 font-medium text-sm mb-2",children:"✅ Successfully fetched from backend"}),(0,m.jsxs)("div",{className:"bg-gray-50 p-3 rounded text-sm",children:[(0,m.jsxs)("p",{children:[(0,m.jsx)("strong",{children:"Beta Testers Count:"}
1)," ",o.betaTesters?.length||0]}),(0,m.jsxs)("p",{children:[(0,m.jsx)("strong",{children:"Timestamp:"})," ",new Date(o.timestamp).toLocaleString()]}),o.betaTesters?.length>0&&(0,m.jsxs)("div",{className:"mt-2",children:[(0,m.jsx)("p",{className:"font-medium",children:"Beta Testers:"}),(0,m.jsx)("div",{className:"max-h-32 overflow-y-auto",children:o.betaTesters.map((e,s)=>(0,m.jsxs)("div",{className:"text-xs text-gray-600",children:["• ID: ",e.userId||e.advisorId||e.consumerId||e.advisor_id||e.consumer_id||e.id,e.email&&` - ${e.email}`,e.firstName&&` - ${e.firstName} ${e.lastName||""}`]},s))})]})]})]}):(0,m.jsxs)("p",{className:"text-red-600 font-medium text-sm",children:["❌ Error: ",o.error]})}):(0,m.jsx)("p",{className:"text-gray-600 text-sm",children:'Click "Fetch Data" to see backend response'})]}),(0,m.jsxs)("div",{className:"border-2 border-dashed border-gray-300 rounded-lg p-6",children:[(0,m.jsx)("h3",{className:"font-semibold text-gray-900 mb-4",children:"Advisor Intelligence Feature Demo"}),(0,m.jsx)(x,{children:(0,m.jsxs)("div",{className:"bg-gradient-to-r from-blue-500 to-purple-600 text-white p-6 rounded-lg",children:[(0,m.jsxs)("div",{className:"flex items-center mb-4",children:[(0,m.jsx)("div",{className:"w-12 h-12 bg-white bg-opacity-20 rounded-full flex items-center justify-center mr-4",children:"\uD83E\uDDE0"}),(0,m.jsxs)("div",{children:[(0,m.jsx)("h2",{className:"text-xl font-bold",children:"Welcome to Advisor Intelligence!"}),(0,m.jsx)("p",{className:"text-blue-100",children:"You have access to AI-powered advisory tools."})]})]}),(0,m.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,m.jsxs)("div",{className:"bg-white bg-opacity-10 p-4 rounded",children:[(0,m.jsx)("h4",{className:"font-semibold mb-2",children:"✍️ Content Generation"}),(0,m.jsx)("p",{className:"text-sm text-blue-100",children:"AI-powered content creation"})]}),(0,m.jsxs)("div",{className:"bg-white bg-opacity-10 p-4 rounded",children:[(0,m.jsx)("h4",{className:"font-semibold mb-2",children:"\uD83D\uDCCA Client Insights"}),(0,m.jsx)("p",{className:"text-sm text-blue-100",children:"Deep analytical insights"})]}),(0,m.jsxs)("div",{className:"bg-white bg-opacity-10 p-4 rounded",children:[(0,m.jsx)("h4",{className:"font-semibold mb-2",children:"\uD83C\uDFAF Recommendations"}),(0,m.jsx)("p",{className:"text-sm text-blue-100",children:"Personalized suggestions"})]})]})]})}),!n&&!r&&(0,m.jsxs)("div",{className:"bg-gray-100 p-6 rounded-lg text-center",children:[(0,m.jsx)("div",{className:"text-gray-400 text-2xl mb-2",children:"\uD83D\uDD12"}),(0,m.jsx)("h4",{className:"font-semibold text-gray-700 mb-2",children:"Feature Not Available"}),(0,m.jsx)("p",{className:"text-gray-600 text-sm",children:"You do not currently have access to Advisor Intelligence. The feature above is completely hidden from users without access."})]})]}),(0,m.jsxs)("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[(0,m.jsx)("h4",{className:"font-semibold text-blue-900 mb-2",children:"\uD83D\uDCCB Sidebar Integration"}),(0,m.jsx)("p",{className:"text-blue-800 text-sm mb-2",children:'The "Advisor Intelligence" item in your sidebar will now:'}),(0,m.jsxs)("ul",{className:"text-blue-700 text-sm space-y-1",children:[(0,m.jsxs)("li",{children:["• ",(0,m.jsx)("strong",{children:"Show in sidebar"})," if you have access"]}),(0,m.jsxs)("li",{children:["• ",(0,m.jsx)("strong",{children:"Be completely hidden"})," if you don't have access"]}),(0,m.jsxs)("li",{children:["• ",(0,m.jsx)("strong",{children:"Update automatically"})," when backend access list changes"]}),(0,m.jsxs)("li",{children:["• ",(0,m.jsx)("strong",{children:"Cache for 5 minutes"})," to reduce backend load"]})]}),(0,m.jsx)("p",{className:"text-blue-800 text-sm mt-2",children:"Check your sidebar now to see if the Intelligence item appears!"})]})]})})}}},e=>{e.O(0,[636,6593,8792],()=>e(e.s=24476)),_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.