1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2600,3786,5105],{4819:(e,t,a)=>{"use strict";a.d(t,{M:()=>n,v:()=>l});var r=a(25535),s=a(55617);function n(e,t){var a,r,s;let n=e.find(e=>e.id===t);if(n&&n.count>0)return t;let o=e.find(e=>e.count>0);return null!==(s=null!==(r=null==o?void 0:o.id)&&void 0!==r?r:null===(a=e[0])||void 0===a?void 0:a.id)&&void 0!==s?s:t}function o(e,t){let a=t.find(t=>t.id===e),r=null==a?void 0:a.companyType,s=r?r.toLowerCase():null;return"idea"===s?"idea":"career"===s?"career":"hackathon"===s?"hackathon":"market_readiness"===s?"market_readiness":"business"}function i(e,t){var a,r,s,n,o;return!!String(null!==(s=e.reportType)&&void 0!==s?s:"").toLowerCase().startsWith("career-")||"career"===(String(null!==(o=null!==(n=null===(a=e.company)||void 0===a?void 0:a.companyType)&&void 0!==n?n:null===(r=t.find(t=>t.id===e.companyId))||void 0===r?void 0:r.companyType)&&void 0!==o?o:"").toLowerCase()||"")}function l(e,t){let a=e.filter(e=>"completed"===e.status),n=a.filter(e=>i(e,t)).length,l=e.filter(e=>(0,s.PD)(e)).length,c=a.filter(e=>"idea"===o(e.companyId,t)).length,d=a.filter(e=>{var a,r;return"market_readiness"===o(e.companyId,t)||null!==(r=null===(a=e.reportType)||void 0===a?void 0:a.toLowerCase().startsWith("mr-"))&&void 0!==r&&r}).length;return[{id:"career",count:n},{id:"founder",count:l},{id:"idea",count:c},{id:"market_readiness",count:d},{id:"hackathon",count:a.filter(e=>(0,r.FU)(e,t)).length},{id:"business",count:a.filter(e=>{var a,n;return!(i(e,t)||(0,s.OH)(e,t)||(null===(a=e.reportType)||void 0===a?void 0:a.toLowerCase().startsWith("idea-"))||(null===(n=e.reportType)||void 0===n?void 0:n.toLowerCase().startsWith("mr-"))||(0,r.FU)(e,t))&&"business"===o(e.companyId,t)}).length}]}},8500:(e,t,a)=>{"use strict";a.d(t,{g:()=>n});var r=a(4118),s=a(34916);function n(e){var t,a,n,o,i,l;let{isOpen:c,onClose:d,onBuyCredits:u,creditsData:m}=e;return c?(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,r.jsx)("div",{className:"fixed inset-0 bg-black/50",onClick:d}),(0,r.jsx)("div",{className:"relative z-10 bg-white rounded-3xl p-8 w-full max-w-lg mx-4 shadow-xl",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"flex justify-center items-center mb-6 relative",children:(0,r.jsx)("img",{src:"/assets/Unlockcredits.svg",alt:"Credits",className:"h-25 w-25 relative z-10"})}),(null==m?void 0:m.success)&&(null===(t=m.data)||void 0===t?void 0:t.totalCredits)>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h3",{className:"text-xl font-semibold text-black mb-3",children:"Boost your credit balance."}),(0,r.jsx)("p",{className:"text-base text-gray-600 mb-6",children:"Would you like to purchase additional credits on top of your current balance?"})]}),(null==m?void 0:m.success)&&(null===(a=m.data)||void 0===a?void 0:a.totalCredits)==0&&(null===(n=m.data)||void 0===n?void 0:n.totalPurchases)>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h3",{className:"text-xl font-semibold text-black mb-3",children:"Oops! Out of credits"}),(0,r.jsxs)("p",{className:"text-base text-gray-600 mb-6",children:["You've used up all your credits. Add more to"," ",(0,r.jsx)("br",{className:"hidden md:block"}),"continue your journey."]})]}),(null==m?void 0:m.success)&&(null===(o=m.data)||void 0===o?void 0:o.totalPurchases)==0&&(null!==(l=null===(i=m.data)||void 0===i?void 0:i.totalCredits)&&void 0!==l?l:0)===0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("h3",{className:"text-xl font-semibold text-black mb-3",children:"Unlock Valuation Experience!"}),(0,r.jsxs)("p",{className:"text-base text-gray-600 mb-6",children:["Add credits to explore AI autofill and cover ",(0,r.jsx)("br",{})," payments when needed."]})]}),(0,r.jsxs)("div",{className:"flex gap-3 justify-center",children:[(0,r.jsx)(s.Button,{onClick:d,variant:"outline",className:"bg-white border-gray-300 hover:bg-gray-50 text-black font-medium px-6 py-2 rounded-sm w-[140px]",children:"Not now"}),(0,r.jsx)(s.Button,{onClick:()=>{d(),u()},className:"bg-gradient-to-r from-[#004EF9] to-[#26DFFE] text-white font-medium px-6 py-2 rounded-sm w-[140px]",children:"Proceed"})]})]})})]}):null}},10501:(e,t,a)=>{"use strict";a.d(t,{u:()=>i});var r=a(4118),s=a(12430),n=a(61363),o=a(34161);function i(e){let{type:t,label:a,className:i,iconClassName:l}=e,c=o.y[t],d=null!=a?a:c.label;return(0,r.jsxs)("span",{className:(0,n.cn)("inline-flex items-center gap-2 text-sm font-normal",i),children:[c.iconSrc?(0,r.jsx)("img",{src:c.iconSrc,alt:"","aria-hidden":!0,
1className:(0,n.cn)("h-4 w-4 shrink-0 object-contain pointer-events-none",l)}):"all"===t?(0,r.jsx)(s.A,{"aria-hidden":!0,className:(0,n.cn)("h-4 w-4 shrink-0 text-[#677489] pointer-events-none",l)}):null,(0,r.jsx)("span",{children:d})]})}},12430:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(41037).A)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]])},13786:(e,t,a)=>{"use strict";a.d(t,{v:()=>I});var r=a(4118),s=a(78870),n=a(62400),o=a(12799),i=a(33099),l=a(52880),c=a(49935),d=a(15019),u=a(34916),m=a(40732),h=a(37560),f=a(78967),p=a(8500),x=a(45401),g=a(93627),v=a(61363),y=a(8735),b=a.n(y),w=a(36048),j=a(55670),N=a(75797);function S(){try{return"true"===new URLSearchParams(window.location.search).get(v.eF)}catch(e){return!1}}function k(){try{return new URLSearchParams(window.location.search)}catch(e){return new URLSearchParams}}function I(e){var t,a;let{showBuyCredits:y=!1,preferBuyCreditsLabel:I=!1,blendHeaderBackground:C=!1,forceBuyCreditsOnly:T=!1,clearNewSignupWelcomeOnLogoNavigate:E=!1,disableLogoLink:M=!1,disableCredits:F=!1,hideInviteFriends:D=!1}=e,L=(0,n.usePathname)(),{user:V,logout:R}=(0,o.J)(),{theme:A,isPartnerTheme:P}=(0,i.D)(),{creditsData:_,creditsLoading:O}=(0,l.I)(),[B,U]=(0,s.useState)(!1),[W,$]=(0,s.useState)(!1),[J,q]=(0,s.useState)(!1),[z,Y]=(0,s.useState)(!1),[G,Z]=(0,s.useState)(S),[H,Q]=(0,s.use
1State)(()=>(0,N.xF)({pathname:window.location.pathname,searchParams:k()})),{openReferralModal:K}=(0,w.a)();(0,s.useEffect)(()=>{Z(S()),Q((0,N.xF)({pathname:null!=L?L:"",searchParams:k()}))},[L]);let X=F||H,ee=I||H&&!T,et=()=>{null!=L&&L.includes("/dashboard/buy-credits")||(sessionStorage.setItem("fromCreditPurchase","true"),localStorage.setItem("fromCreditPurchase","true"),sessionStorage.setItem("creditPurchaseReturnUrl",window.location.href),localStorage.setItem("creditPurchaseReturnUrl",window.location.href),window.location.href="/dashboard/buy-credits")},ea=()=>{var e,t;if(X||(null==L?void 0:L.includes("/dashboard/buy-credits")))return;let a=null!==(t=null==_?void 0:null===(e=_.data)||void 0===e?void 0:e.totalCredits)&&void 0!==t?t:0;if((null==_?void 0:_.success)&&a>0&&!T){et();return}Y(!0)};(0,s.useEffect)(()=>{let e=()=>{let e=(0,v.zE)();if(y&&!e){q(!0);return}q("true"===sessionStorage.getItem("fromSignupYes")||"true"===sessionStorage.getItem("fromFocusSelection")||"true"===sessionStorage.getItem("fromValuationSelection")||"true"===sessionStorage.getItem("fromNewValuation")&&!e)};return e(),window.addEventListener("signupFlowChanged",e),()=>window.removeEventListener("signupFlowChanged",e)},[y]);let er=(null==_?void 0:_.success)&&_.data&&null!==(t=_.data.totalCredits)&&void 0!==t?t:0;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("header",{className:(0,v.cn)("sticky top-0 z-50 w-full border-b",I&&!C?"border-gray-200/90 bg-white":"border-gray-200/90 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60"),children:(0,r.jsxs)("div",{className:"mx-auto flex h-16 w-full max-w-8xl items-center justify-between px-4 md:px-8 lg:px-16",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 md:gap-6",children:[M?(0,r.jsx)("div",{className:"flex cursor-default items-center gap-2 pointer-events-none md:gap-3",children:(0,r.jsx)(c.x,{className:"h-6 w-auto sm:h-7"})}):(0,r.jsx)(b(),{href:"/dashboard",className:"flex items-center gap-2 md:gap-3 focus:outline-none focus:ring-0 focus-visible:ring-0",onClick:()=>{if(E&&(null==V?void 0:V.id))try{localStorage.removeItem((0,v.fG)(V.id))}catch(e){}},children:(0,r.jsx)(c.x,{className:"h-6 w-auto sm:h-7"})}),!J&&!y&&(0,r.jsx)("nav",{className:"hidden items-center gap-2 text-sm font-medium text-slate-500 md:flex"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 sm:gap-4",children:[y&&(0,r.jsxs)("div",{className:(0,v.cn)("flex items-center gap-2 sm:gap-3",X&&"pointer-events-none cursor-default"),children:[!X&&(0,r.jsx)(j.m,{className:"hover:bg-slate-100"}),ee&&(0,r.jsx)("div",{className:"flex items-center gap-2 rounded-full border border-gray-200 bg-white px-3 py-2 h-9 text-xs font-medium text-black sm:text-sm","aria-live":"polite","aria-label":O?"Loading credit balance":"".concat(er," credits available"),children:O?(0,r.jsx)(m.A,{className:"h-4 w-4 shrink-0 animate-spin text-gray-500"}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("img",{src:"/assets/buycredits.png",alt:"",className:"h-4 w-4 shrink-0"}),(0,r.jsxs)("span",{children:[er," Credits"]})]})}),!ee&&(O?(0,r.jsxs)(u.Button,{variant:"outline",className:"bg-white border-gray-200 rounded-full text-black font-medium px-3 py-2 h-9 text-xs sm:px-4 sm:text-sm",disabled:!0,children:[(0,r.jsx)(m.A,{className:"h-4 w-4 mr-2 animate-spin"}),"Loading..."]}):(null==_?void 0:_.success)&&(null==_?void 0:_.data)&&(null!==(a=_.data.totalCredits)&&void 0!==a?a:0)>0&&!T?(0,r.jsxs)(u.Button,{variant:"outline",className:(0,v.cn)("bg-white border-gray-200 rounded-full text-black font-medium px-3 py-2 h-9 text-xs sm:px-4 sm:text-sm",(null==L?void 0:L.includes("/dashboard/buy-credits"))?"opacity-50 cursor-not-allowed":"hover:bg-gray-50"),onClick:ea,disabled:null==L?void 0:L.includes("/dashboard/buy-credits"),children:[(0,r.jsx)("img",{src:"/assets/buycredits.png",alt:"Credits",className:"h-4 w-4 mr-2"}),_.data.totalCredits||0," Credits"]}):(0,r.jsxs)(u.Button,{variant:"outline",className:(0,v.cn)("bg-white border-gray-200 rounded-full text-black font-medium px-3 py-2 h-9 text-xs sm:px-4 sm:text-sm",(null==L?void 0:L.includes("/dashboard/buy-credits"))?"opacity-50 cursor-not-allowed":"hover:bg-gray-50"),onClick:ea,disabled:null==L?void 0:L.includes("/dashboard/buy-credits"),children:[(0,r.jsx)("img",{src:"/assets/buycredits.png",alt:"Credits",className:"h-4 w-4 mr-2"}),"Buy Credits"]}))]}),(0,r.jsxs)(x.rI,{open:W,onOpenChange:$,children:[(0,r.jsx)(x.ty,{asChild:!0,children:(0,r.jsx)(u.Button,{variant:"ghost",className:"relative h-9 w-9 sm:h-10 sm:w-10 rounded-full p-0 hover:bg-transparent focus:bg-transparent active:bg-transparent focus:outline-none focus:ring-0 focus-visible:ring-0",children:(0,r.jsxs)(d.eu,{className:(0,v.cn)("h-7 w-7 sm:h-8 sm:w-8 border bg-white text-xs sm:text-sm font-semibold",P&&"cebos"===A?"border-[#5c3a8f]":"border-blue-200"),children:[(0,r.jsx)(d.BK,{src:null==V?void 0:V.image,alt:(null==V?void 0:V.name)||"User avatar",className:"h-full w-full object-cover"}),(0,r.jsx)(d.q5,{className:(0,v.cn)("text-white text-sm font-semibold",P&&"cebos"===A?"bg-[#5c3a8f]":"bg-gradient-to-r from-blue-600 to-cyan-500"),style:{textTransform:"uppercase"},children:(()=>
1{if(!V)return"U";let e="GOOGLE"===V.authProvider||V.image&&(V.image.includes("googleusercontent.com")||V.image.includes("googleapis.com"));if(V.name){if(e){let e=V.name.trim().split(" ").filter(Boolean);return 1===e.length?e[0].slice(0,2).toUpperCase():e.map(e=>e[0].toUpperCase()).join("")}return V.name.charAt(0).toUpperCase()}return V.email?V.email.charAt(0).toUpperCase():"U"})()})]})})}),(0,r.jsxs)(x.SQ,{className:"w-56",align:"end",side:"bottom",sideOffset:12,children:[(0,r.jsx)(x.lp,{children:(0,r.jsxs)("div",{className:"flex flex-col space-y-1",children:[(0,r.jsx)("span",{className:"text-sm font-medium leading-none text-foreground",children:(null==V?void 0:V.name)||"Guest"}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:null==V?void 0:V.email})]})}),(0,r.jsx)(x.mB,{}),D||G?null:(0,r.jsxs)(x._2,{className:"cursor-pointer",onClick:()=>{$(!1),K()},children:[(0,r.jsx)(h.A,{className:"mr-2 h-4 w-4"}),"Invite Friends"]}),(0,r.jsxs)(x._2,{className:"cursor-pointer",onClick:()=>{U(!0),$(!1)},children:[(0,r.jsx)(f.A,{className:"mr-2 h-4 w-4"}),"Log out"]})]})]})]})]})}),(0,r.jsx)(g.Lt,{open:B,onOpenChange:e=>{U(e),e||($(!1),setTimeout(()=>{},50))},children:(0,r.jsxs)(g.EO,{children:[(0,r.jsxs)(g.wd,{children:[(0,r.jsx)(g.r7,{children:"Logout"}),(0,r.jsx)(g.$v,{children:"Are you sure you want to logout?"})]}),(0,r.jsxs)(g.ck,{children:[(0,r.jsx)(g.Zr,{className:"bg-white text-black border border-gray-300 hover:bg-gray-50 px-8",children:"No"}),(0,r.jsx)(g.Rx,{onClick:()=>{U(!1),setTimeout(()=>{R()},100)},className:"bg-blue-600 text-white hover:bg-blue-700 px-8",children:"Yes"})]})]})}),(0,r.jsx)(p.g,{isOpen:z,onClose:()=>Y(!1),creditsData:null!=_?_:void 0,onBuyCredits:et})]})}},15e3:(e,t,a)=>{"use strict";a.d(t,{p:()=>o});var r=a(4118),s=a(78870),n=a(61363);let o=s.forwardRef((e,t)=>{let{className:a,type:s,...o}=e;return(0,r.jsx)("input",{type:s,className:(0,n.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-[12px] sm:text-sm ring-offset-background file:border-0 file:bg-transparent file:text-xs sm:file:text-sm file:font-medium file:text-foreground placeholder:text-[12px] sm:placeholder:text-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 mobile-input-fix",a),ref:t,...o})});o.displayName="Input"},32782:(e,t,a)=>{"use strict";a.d(t,{S:()=>s});var r=a(50511);function s(e){var t,a,s,n,o;let i=String(null!==(a=e.status)&&void 0!==a?a:"").toLowerCase();if(function(e){var t,a,r,s;let n=String(null!==(a=e.reportType)&&void 0!==a?a:"").toLowerCase(),o=String(null!==(s=null!==(r=e.companyType)&&void 0!==r?r:null===(t=e.company)||void 0===t?void 0:t.companyType)&&void 0!==s?s:"").toLowerCase();return!(n.startsWith("career-")||"career"===o||n.includes("hackathon")||"hackathon"===o||"founder"===n||"founder"===o||n.startsWith("idea-")||"idea"===o||n.startsWith("mr-")||"market_readiness"===o)}(e))return(!(0,r.Pp)(e.company)||!!function(e){if(!e||"object"!=typeof e)return!1;for(let t of Object.values(e))if(null!=t){if("object"==typeof t){for(let e of Object.values(t))if(null!=e){if("string"==typeof e){if(e.trim())return!0}else if(Array.isArray(e)){if(e.length>0)return!0}else if("number"==typeof e)return!0;else if("boolean"==typeof e)return!0;else if("object"==typeof e&&Object.keys(e).length>0)return!0}continue}if("string"==typeof t&&t.trim()||"number"==typeof t||"boolean"==typeof t)return!0}return!1}(e.responses))&&"in_progress"===i;if("in_progress"===i)return!0;if("draft"!==i)return!1;let l=String(null!==(s=e.reportType)&&void 0!==s?s:"").toLowerCase(),c=String(null!==(o=null!==(n=e.companyType)&&void 0!==n?n:null===(t=e.company)||void 0===t?void 0:t.companyType)&&void 0!==o?o:"").toLowerCase();return!(l.startsWith("career-")||"career"===c||l.includes("hackathon")||"hackathon"===c)}},33099:(e,t,a)=>{"use strict";a.d(t,{D:()=>i,ThemeProvider:()=>o});var r=a(4118),s=a(78870);let n=(0,s.createContext)(void 0);function o(e){let{children:t}
1=e,[a,o]=(0,s.useState)("default"),[i,l]=(0,s.useState)(!1),[c,d]=(0,s.useState)(!0);(0,s.useEffect)(()=>{let e=document.body.classList.contains("cebos-theme"),t=localStorage.getItem("trueval-theme");if(document.body.classList.contains("theme-applied")){e||"cebos"===t?(console.log("Using pre-applied CEBOS theme"),o("cebos"),l(!0)):(console.log("Using pre-applied default theme"),o("default"),l(!1)),d(!1);return}let a="valuations.cebos.io"===window.location.hostname&&window.location.pathname.includes("/dashboard/valuations/public/"),r=document.referrer.includes("cebos")||document.referrer.includes("localhost:3000")||window.location.search.includes("partner=cebos")||a||window.location.hostname.includes("cebos")||window.location.pathname.includes("cebos");if(console.log("Theme detection debug:",{referrer:document.referrer,search:window.location.search,hostname:window.location.hostname,pathname:window.location.pathname,isCebosPartner:r,persistedTheme:localStorage.getItem("trueval-theme")}),r)console.log("Setting CEBOS theme"),o("cebos"),l(!0),document.body.classList.add("from-partner"),document.body.classList.add("cebos-theme"),localStorage.setItem("trueval-theme","cebos");else{let e=localStorage.getItem("trueval-theme");e&&("cebos"===e||"default"===e)?(console.log("Using persisted theme:",e),o(e),l("cebos"===e),"cebos"===e&&(document.body.classList.add("from-partner"),document.body.classList.add("cebos-theme"))):(console.log("Using default theme"),o("default"),l(!1),localStorage.setItem("trueval-theme","default"))}d(!1),document.body.classList.add("theme-applied")},[]),(0,s.useEffect)(()=>{let e=()=>{let e="valuations.cebos.io"===window.location.hostname&&window.location.pathname.includes("/dashboard/valuations/public/"),t=document.referrer.includes("cebos")||document.referrer.includes("localhost:3000")||window.location.search.includes("partner=cebos")||e||window.location.hostname.includes("cebos")||window.location.pathname.includes("cebos");console.log("URL change detected:",{search:window.location.search,isCebosPartner:t,currentTheme:a}),t&&"cebos"!==a?(console.log("Switching to CEBOS theme due to URL change"),o("cebos"),l(!0),document.body.classList.add("from-partner"),document.body.classList.add("cebos-theme"),localStorage.setItem("trueval-theme","cebos")):t||"cebos"!==a||(console.log("Switching to default theme due to URL change"),o("default"),l(!1),document.body.classList.remove("from-partner","cebos-theme"),localStorage.setItem("trueval-theme","default"))};return window.addEventListener("popstate",e),window.addEventListener("focus",e),()=>{window.removeEventListener("popstate",e),window.removeEventListener("focus",e)}},[a]);let u=e=>{o(e),l("cebos"===e),document.body.classList.remove("from-partner","cebos-theme"),"cebos"===e&&(document.body.classList.add("from-partner"),document.body.classList.add("cebos-theme")),localStorage.setItem("trueval-theme",e)};return(0,r.jsx)(n.Provider,{value:{theme:a,setTheme:u,clearPersistedTheme:()=>{localStorage.removeItem("trueval-theme"),u("default")},isPartnerTheme:i,isThemeLoading:c},children:t})}function i(){let e=(0,s.useContext)(n);if(void 0===e)throw Error("useTheme must be used within a ThemeProvider");return e}},34161:(e,t,a)=>{"use strict";a.d(t,{y:()=>r});let r={all:{label:"All",iconSrc:null,iconAlt:"All"},career:{label:"Career",iconSrc:"/assets/career.svg",iconAlt:"Career"},founder:{label:"Founder",iconSrc:"/assets/founder.svg",iconAlt:"Founder"},idea:{label:"Idea",iconSrc:"/Idea.svg",iconAlt:"Idea"},market_readiness:{label:"Growth readiness",iconSrc:"/assets/market-readiness-icon.svg",iconAlt:"Growth readiness"},hackathon:{label:"Startup potential",iconSrc:"/startup-potential-a.svg",iconAlt:"Startup potential"},startup_potential:{label:"Startup potential",iconSrc:"/startup-potential-a.svg",iconAlt:"Startup potential"},company:{label:"Business",iconSrc:"/Company.svg",iconAlt:"Business"},business:{label:"Business",iconSrc:"/Company.svg",iconAlt:"Business"}}},41877:(e,t,a)=>{"use strict";a.d(t,{E:()=>n});var r=a(4118),s=a(61363);function n(e){let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,s.cn)("animate-pulse rounded-md bg-muted",t),...a})}},46681:(e,t,a)=>{"use strict";a.d(t,{j:()=>u});var r=a(4118),s=a(78870),n=a(62400),o=a(19320),i=a(7662),l=a(61363),c=a(53143),d=a(95591);function u(e){let{userId:t,userCredits:a,onClose:u,stayOnPage:m=!1}=e,h=(0,n.useRouter)(),{trackButtonClick:f}=(0,i.p)(),p=(0,s.useCallback)(()=>{try{localStorage.removeItem((0,l.fG)(t)),sessionStorage.removeItem(l.ui),(0,l.d$)()}catch(e){}u()},[t,u]),x=(0,s.useCallback)(()=>
1{if(f("Redeem Credits",{location:m?"welcome_signup_bonus_shared_invite":"welcome_signup_bonus_dashboard"}),"true"===sessionStorage.getItem(l.cO)){try{sessionStorage.removeItem(l.cO)}catch(e){}p(),(0,l.n$)();return}p(),m||((0,c.bv)()?(0,l.n$)():(0,l.Z6)(),h.replace((0,l.M$)()))},[p,h,m,f]),g=(0,c.Gb)()||(()=>{try{return"true"===localStorage.getItem("fromIdeaValuationContext")}catch(e){return!1}})(),v=g?null!=a?a:l.Vr:void 0;return(0,r.jsx)("div",{className:"fixed inset-0 z-[200] flex items-center justify-center overflow-x-hidden bg-black/35 p-4 backdrop-blur-sm sm:p-6",role:"dialog","aria-modal":"true","aria-labelledby":"welcome-signup-title",children:(0,r.jsx)("div",{className:"relative w-full max-w-lg shrink-0",children:(0,r.jsx)(o.U,{layout:"creditsOnly",onDismiss:x,bonusCredits:v,welcomeSubtext:g?"Your Idea Valuation credits are ready. Use them to unlock your first report from the dashboard.":void 0,showReferralBonus:(0,d.j7)(t)})})})}},52600:(e,t,a)=>{"use strict";a.r(t),a.d(t,{QuestionnaireEngineService:()=>o,default:()=>i,sanitizeQuestionnaireResponses:()=>n});var r=a(6957),s=a(52850);function n(e){if(!e||"object"!=typeof e)return{};let t=(e,a)=>{if(null==a)return a;if(!("undefined"!=typeof File&&a instanceof File||"undefined"!=typeof Blob&&a instanceof Blob)){if("string"==typeof a){if(a.startsWith("data:")&&a.length>8e3||a.startsWith("blob:"))return;return a}if(Array.isArray(a))return"socialLinks"===e||"social_links"===e?a.filter(e=>e&&"object"==typeof e).map(e=>{var t,a;return{platform:String(null!==(t=e.platform)&&void 0!==t?t:"").trim(),url:String(null!==(a=e.url)&&void 0!==a?a:"").trim(),...void 0!==e.isActive?{isActive:!!e.isActive}:{}}}).filter(e=>e.platform&&e.url):a.map(a=>t(e,a)).filter(e=>void 0!==e);if(a&&"object"==typeof a&&!Array.isArray(a)){if("base64Data"in a||"file"in a||("preview"in a||"uploading"in a)&&("name"in a||"size"in a||"type"in a)){let e="string"==typeof a.preview?a.preview:"";return"string"==typeof a.s3Url&&a.s3Url||"string"==typeof a.url&&a.url||(!e||e.startsWith("data:")||e.startsWith("blob:")?null:e)||void 0}let e={};for(let[r,s]of Object.entries(a)){let a=t(r,s);void 0!==a&&(e[r]=a)}return e}return a}},a={};for(let[r,s]of Object.entries(e)){let e=t(r,s);void 0!==e&&(a[r]=e)}let r=[a["logo-url"],a["company-logo-url"],a.logo,a["company-logo"]].find(e=>"string"==typeof e&&e.trim()&&!e.startsWith("data:")&&!e.startsWith("blob:"));return r&&(a["logo-url"]=r,a.logo=r,a["company-logo-url"]=r),"string"!=typeof a["company-logo"]&&delete a["company-logo"],delete a.logoPreview,delete a.base64Data,a}class o{static getInstance(){return o.instance||(o.instance=new o),o.instance}setCurrentValuationId(e){this.currentValuationId=e}getCurrentValuationId(){return this.currentValuationId}generateBusinessInfoHash(e){let t=Object.keys(e).sort().map(t=>"".concat(t,":").concat(e[t])).join("|");try{return btoa(encodeURIComponent(t)).slice(0,16)}catch(e){return console.warn("Failed to generate hash using btoa, using fallback method:",e),(t.length.toString(36)+Math.abs(t.split("").reduce((e,t)=>(e=(e<<5)-e+t.charCodeAt(0))&e,0)).toString(36)).slice(0,16)}}getCachedValuationData(e,t){let a=this.valuationCache.get(e);if(!a)return null;if(t){let r=this.generateBusinessInfoHash(t);if(a.businessInformationHash!==r)return this.valuationCache.delete(e),null}return Date.now()-a.lastUpdated.getTime()>864e5?(this.valuationCache.delete(e),null):a}cacheValuationData(e,t,a,r){let s=r?this.generateBusinessInfoHash(r):"";this.valuationCache.set(e,{valuationId:e,recommendedMethods:t,sections:a,businessInformationHash:s,lastUpdated:new Date})}clearValuationCache(e){this.valuationCache.delete(e)}clearAllCache(){this.valuationCache.clear(),this.sectionCache.clear()}getCachedSections(e){let t=this.getCachedValuationData(e);return t&&t.sections?[...t.sections].sort((e,t)=>{var a,r;let s=null!==(a=e.order)&&void 0!==a?a:0,n=null!==(r=t.order)&&void 0!==r?r:0;if(s!==n)return s-n;let o=e.sectionId||e.slug||e.id||"",i=t.sectionId||t.slug||t.id||"";return o.localeCompare(i)}):null}getCachedMethods(e){let t=this.getCachedValuationData(e);return t?t.recommendedMethods:null}getCachedSectionData(e){let t=this.sectionCache.get(e);return t?Date.now()-t.lastUpdated.getTime()>864e5?(this.sectionCache.delete(e),null):t.sectionData:null}cacheSectionData(e,t){this.sectionCache.set(e,{slug:e,sectionData:t,lastUpdated:new Date})}clearSectionCache(e){e?this.sectionCache.delete(e):this.sectionCache.clear()}async getEngineType(){try{let e=await fetch("".concat(r.JR,"/questionnaire-engine/engine-type"));if(!e.ok)throw Error("Failed to get engine type");return await e.json()}catch(e){return console.error("Error getting engine type:",e),{engineType:"non-ai"}}}async generateAIAnswers(e){try{let t=await fetch("".concat(r.JR,"/questionnaire-engine/generate-ai-answers"),{method:"POST",headers:{"Content-Type":"application/json",...(0,s.z5)()},body:JSON.stringify({companyInfo:e})});if(!t.ok){let e=await t.text();throw Error("Failed to generate AI answers: ".concat(e))}let a=await t.json();if(!1===a.success)throw Error(a.message||"AI generation failed");return{answers:a.answers||a,generationTime:a.generationTime,sectionsProcessed:a.sectionsProcessed,message:a.message}}catch(e){throw console.error("Error generating AI answers:",e),Error("Unable to generate AI answers. Please try again later.")}}async fillWithAI(e){try{let t=await fetch("".concat(r.JR,"/questionnaire-engine/fill-with-ai"),{method:"POST",headers:{"Content-Type":"application/json",...(0,s.z5)()},body:JSON.stringify({companyInfo:e})});if(!t.ok){let e=await t.text();throw Error("Failed to fill with AI: ".concat(e))}let a=await t.json();if(!1===a.success)throw Error(a.message||"AI generation failed");return{answers:a.answers||a,generationTime:a.generationTime,sectionsProcessed:a.sectionsProcessed,message:a.message,model:a.model}}catch(e){throw console.error("Error filling with AI:",e),Error("Unable to fill with AI. Please try again later.")}}async recommendMethods(e){try{let t=await fetch("".concat(r.JR,"/questionnaire-engine/recommend-methods"),{method:"POST",headers:(0,s.z5)(),body:JSON.stringify({business_information:e})});if(!t.ok)throw Error("Failed to recommend methods");return(await t.json()).recommendedMethods}catch(e){return console.error("Error recommending methods:",e),["financial-information","market-analysis","assets-and-liabilities","growth-and-projections","startup-specific-factors","risk-assessment"]}}async determineSections(e,t){try{let a=await fetch("".concat(r.JR,"/questionnaire-engine/determine-sections"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,methodIds:t})});if(!a.ok)throw Error("Failed to determine sections");return(await a.json()).sections}catch(e){return console.error("Error determining sections:",e),["financial-information","market-analysis","assets-and-liabilities","growth-and-projections","startup-specific-factors","risk-assessment"]}}async getQuestions(e,t,a){try{let s=await fetch("".concat(r.JR,"/questionnaire-engine/get-questions"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,methodIds:t,sectionIds:a})});if(!s.ok)throw Error("Failed to get questions");return(await s.json()).questionnaireSections}catch(e){return console.error("Error getting questions:",e),[]}}async createValuation(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";try{let a=await fetch("".concat(r.JR,"/questionnaire-engine/create-valuation"),{method:"POST",headers:(0,s.z5)(),body:JSON.stringify({companyId:e,valuationType:t})});if(!a.ok){let e=await a.text();throw console.error("Create valuation error:",e),Error("Failed to create valuation: ".concat(a.status," - ").concat(e))}return(await a.json()).valuationId}catch(e){throw console.error("Error creating valuation:",e),e}}async setupSections(e,t,a){try{let n=await fetch("".concat(r.JR,"/questionnaire-engine/setup-sections"),{method:"POST",headers:(0,s.z5)(),body:JSON.stringify({valuationId:e,sections:t,methodIds:a})});if(!n.ok){let e=await n.text();throw console.error("Setup sections error:",e),Error("Failed to setup sections: ".concat(n.status," - ").concat(e))}return(await n.json()).success}catch(e){throw console.error("Error setting up sections:",e),e}}async startSection(e,t){try{let a=await fetch("".concat(r.JR,"/questionnaire-engine/start-section"),{method:"POST",headers:(0,s.z5)(),body:JSON.stringify({valuationId:e,sectionId:t})});if(!a.ok){let e=await a.text();throw console.error("Start section error:",e),Error("Failed to start section: ".concat(a.status," - ").concat(e))}return(await a.json()).progress}catch(e){throw console.error("Error starting section:",e),e}}async getOrderedSections(){try{return(await this.getAllAvailableSections()).filter(e=>{var t,a;let r=null!==(a=null===(t=e.title)||void 0===t?void 0:t.toLowerCase())&&void 0!==a?a:"";return!r.includes("business information")&&!r.includes("business info")}).sort((e,t)=>
1{var a,r;let s=null!==(a=e.order)&&void 0!==a?a:0,n=null!==(r=t.order)&&void 0!==r?r:0;if(s!==n)return s-n;let o=e.id||e.slug||e.title||"",i=t.id||t.slug||t.title||"";return o.localeCompare(i)}).map(e=>this.mapSectionTitleToSlug(e.title))}catch(e){return console.error("Error getting ordered sections:",e),["financial-information","market-analysis","assets-and-liabilities","growth-and-projections","startup-specific-factors","risk-assessment"]}}mapSectionTitleToSlug(e){var t;return null!==(t=({"Business Information":"business-information","Product / Service Information":"product-service-information","Financial Information":"financial-information","Market Analysis":"market-analysis","Business Model & Financial Overview":"business-model-financial-overview","Customer/User Information":"customer-user-information","Legal/Compliance/IP overview":"legal-compliance-ip-overview","Strategic Plans & Growth":"strategic-plans-growth","Assets and Liabilities":"assets-liabilities","Growth and Projections":"growth-projections","Startup Specific Factors":"startup-specific-factors","Risk Assessment":"risk-assessment"})[e])&&void 0!==t?t:e}async saveBusinessSummary(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"default",n=arguments.length>3?arguments[3]:void 0;try{var o,i,l,c,d,u;if(!t)throw Error("A valid company ID is required to create a valuation");let m={companyType:String(null!==(o=e.companyType)&&void 0!==o?o:"Startup (With revenue)"),industry:String(null!==(i=e.industry)&&void 0!==i?i:"SaaS (Software as a Service)"),businessStage:String(null!==(l=e.businessStage)&&void 0!==l?l:"Early Revenue (product in market)"),description:String(null!==(c=e.description)&&void 0!==c?c:"Cloud-based enterprise software solution for mid-market businesses")},h=await fetch("".concat(r.JR,"/questionnaire-engine/process-business-information"),{method:"POST",headers:(0,s.z5)(),body:JSON.stringify({companyId:t||"temp-company-id",business_information:{company_type:m.companyType,industry:m.industry,business_stage:m.businessStage,description:m.description,...e.businessModelCategory&&{business_model_category:e.businessModelCategory},...e.operationalFoundation&&{operational_foundation:e.operationalFoundation}},valuationType:a,methodIds:n||[]})});if(!h.ok){let e=await h.text();throw console.error("Process business information error:",e),Error("Failed to process business information: ".concat(h.status," ").concat(e))}let f=await h.json(),p=null!==(u=null!==(d=f.recommendedMethods)&&void 0!==d?d:n)&&void 0!==u?u:[],x=await this.createValuation(t,a),g=await this.getOrderedSections();return{valuationId:x,recommendedMethods:p,sections:g}}catch(e){throw console.error("Error saving business summary:",e),e}}async getAllAvailableSections(){let e=this.getCachedSectionData("all-sections");return e||(this.allSectionsInFlight||(this.allSectionsInFlight=(async()=>{try{let e=await fetch("".concat(r.JR,"/questions/section"),{headers:(0,s.z5)()});if(!e.ok)throw Error("Failed to fetch sections: ".concat(e.status));let t=await e.json();return this.cacheSectionData("all-sections",t),t}catch(e){return console.error("Error fetching all sections:",e),[]}finally{this.allSectionsInFlight=null}})()),this.allSectionsInFlight)}async getSectionQuestionsBySlug(e){let t=this.getCachedSectionData(e);if(t)return t;let a=this.sectionFetchInFlight.get(e);if(a)return a;let r=this.fetchSectionQuestionsBySlug(e);return this.sectionFetchInFlight.set(e,r),r.finally(()=>this.sectionFetchInFlight.delete(e)),r}async fetchSectionQuestionsBySlug(e){try{var t,a,n,o;let i=(await this.getAllAvailableSections()).find(t=>t.slug===e);if(!i){console.warn("No matching section found for slug: ".concat(e));let t={id:e,title:e,description:"",order:1,requiredForFlow:"both",questions:[]};return this.cacheSectionData(e,t),t}let l=i.id,c=await fetch("".concat(r.JR,"/questions?sectionId=").concat(l),{headers:(0,s.z5)()});if(!c.ok)throw Error("Failed to fetch questions for section ".concat(e,": ").concat(c.status));let d=await c.json(),u={id:e,title:null!==(t=i.title)&&void 0!==t?t:e,description:null!==(a=i.description)&&void 0!==a?a:"",order:null!==(n=i.order)&&void 0!==n?n:1,requiredForFlow:null!==(o=i.requiredForFlow)&&void 0!==o?o:"both",questions:d};return this.cacheSectionData(e,u),u}catch(a){console.error("Error getting questions for section ".concat(e,":"),a);let t={id:e,title:e,description:"",order:1,requiredForFlow:"both",questions:[]};return this.cacheSectionData(e,t),t}}
1async getSectionQuestions(){return this.getSectionQuestionsBySlug("business-information")}async updateValuation(e,t,a){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];try{let i=o?"".concat(r.JR,"/questionnaire-engine/update-valuation-ai-responses"):"".concat(r.JR,"/questionnaire-engine/update-valuation"),l=n(a),c=await fetch(i,{method:"POST",headers:(0,s.z5)(),body:JSON.stringify({valuationId:e,sectionId:t,responses:l})});if(!c.ok){let e=await c.text().catch(()=>"");throw console.error("updateValuation failed (".concat(c.status,") for section ").concat(t,":"),e),Error("Failed to save data (".concat(c.status).concat(e?": ".concat(e.slice(0,180)):"",")"))}return(await c.json()).success}catch(e){if(console.error("Error updating valuation ".concat(o?"AI ":"","responses for section ").concat(t,":"),e),e instanceof Error&&e.message.startsWith("Failed to save data"))throw e;throw Error("Failed to save data")}}async getSectionUuidToSlugMap(){let e=await this.getAllAvailableSections(),t={};for(let a of e)a.id&&a.slug&&(t[a.id]=a.slug);return t}async processBusinessInformation(e){try{let{valuationId:t,responses:a}=e,o=this.getCachedValuationData(t,a);if(o)return{recommendedMethods:o.recommendedMethods,sections:o.sections};let i={companyId:t,business_information:n(a),valuationType:"default",methodIds:[]},l=await fetch("".concat(r.JR,"/questionnaire-engine/process-business-information"),{method:"POST",headers:(0,s.z5)(),body:JSON.stringify(i)});if(!l.ok){let e=await l.text();throw console.error("Process business information error:",e),Error("Failed to process business information: ".concat(l.status," ").concat(e))}let c=await l.json(),d=c.recommendedMethods||[],u=c.sections||[];return this.cacheValuationData(t,d,u,a),{recommendedMethods:d,sections:u}}catch(e){throw console.error("Error processing business information:",e),e}}constructor(){this.currentValuationId=null,this.valuationCache=new Map,this.sectionCache=new Map,this.sectionFetchInFlight=new Map,this.allSectionsInFlight=null}}let i=o},59385:(e,t,a)=>{"use strict";a.d(t,{Ad:()=>f,DS:()=>o,EE:()=>s,Kk:()=>c,O2:()=>i,_j:()=>m,f$:()=>u,l1:()=>l,tM:()=>h,wj:()=>d});var r=a(73104);let s="careerDerivedReport";function n(e){return Math.round(Math.min(100,Math.max(0,e)))}function o(e){let t=n(e);return t>=80?"Ready for Career Success":t>=65?"Strong Career Potential":t>=50?"Career Momentum Is Growing":"Career Foundation Is Building"}function i(){let e=Math.floor(31*Math.random())+45;return{score:e,percentileLabel:o(e),source:"random"}}function l(e){var t;if(!e)return!1;if("completed"===String(e.status||"").toLowerCase())return!0;let a=null===(t=e.aiResponses)||void 0===t?void 0:t.careerInsights;return null!=a&&"object"==typeof a&&!!(Object.keys(a).length>0)||"paid"===String(e.paymentStatus||"").toLowerCase()&&"number"==typeof e.value&&!!(e.value>0)}function c(e){var t;if(!e)return null;let a=null===(t=e.aiResponses)||void 0===t?void 0:t.careerInsights,r=null!=a&&"object"==typeof a&&Object.keys(a).length>0,s=e.score;if("number"!=typeof s||!Number.isFinite(s)||s<=0)return null;let o=n(s);if(r)return o;if("completed"!==e.status&&"paid"!==e.paymentStatus)return null;let i=function(e){var t,a,r;let s=null==e?void 0:e.responses;if(!s)return null;let o=s.career,i=s.previewScore,l=null!==(r=null==o?void 0:null===(t=o.previewScore)||void 0===t?void 0:t.score)&&void 0!==r?r:null==i?void 0:i.score;if("number"==typeof l&&l>0)return n(l);let c=null==o?void 0:null===(a=o.derivedReport)||void 0===a?void 0:a.careerScore;return"number"==typeof c&&c>0?n(c):null}(e);return null!=i&&o===i?null:o}function d(e,t){let a=(0,r.Jz)(function(e){var t,a,r;let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Your Profile",n=(null===(t=e.industry)||void 0===t?void 0:t.trim())||"",o=(null===(a=e.description)||void 0===a?void 0:a.trim())||"",i=n&&o?"".concat(o," [Role: ").concat(n,"]"):o||(n?"Role: ".concat(n):"");return{projectName:(null===(r=e.name)||void 0===r?void 0:r.trim())||s,productDescription:i,stage:"Career",revenueModels:[]}}(e,t));return{...a,percentileLabel:o(a.startupPotentialScore)}}function u(e){var t,a;let s=null==e?void 0:null===(t=e.responses)||void 0===t?void 0:t.career,o=(0,r.L1)(null==s?void 0:s.derivedReport);
1return o?"number"==typeof(null==s?void 0:null===(a=s.derivedReport)||void 0===a?void 0:a.careerScore)?{...o,startupPotentialScore:n(s.derivedReport.careerScore)}:o:null}function m(){try{let e=sessionStorage.getItem(s);if(!e)return null;return(0,r.L1)(JSON.parse(e))}catch(e){return null}}function h(e,t){var a;if(!t)return e;let r=n(t.score);return{...e,startupPotentialScore:r,percentileLabel:(null===(a=t.percentileLabel)||void 0===a?void 0:a.trim())||o(r)}}function f(e){return e.persistedDerived?h(e.persistedDerived,e.previewScore):h(d(e.snapshot,e.fallbackName),e.previewScore)}},64421:(e,t,a)=>{Promise.resolve().then(a.bind(a,88506))},69328:(e,t,a)=>{"use strict";function r(e){if(null==e)return null;let t=null;if("string"==typeof e)try{t=JSON.parse(e)}catch(e){return null}else"object"==typeof e&&(t=e);if(!t)return null;let a=t.market_strength_gauges,r=t.market_strength_overview,s=Array.isArray(a)&&a.length>0?a:Array.isArray(r)&&r.length>0?r:null;if(!s)return null;for(let e of s){var n;if(e&&"object"==typeof e&&"market demand"===String(null!==(n=e.label)&&void 0!==n?n:"").trim().toLowerCase()){let t="string"==typeof e.value?parseFloat(e.value):Number(e.value);if(Number.isFinite(t))return Math.round(Math.min(100,Math.max(0,t)))}}return null}a.d(t,{s:()=>r})},76678:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(41037).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},78508:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(41037).A)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])},86982:(e,t,a)=>{"use strict";a.d(t,{M:()=>y});var r=a(4118),s=a(34916),n=a(62400),o=a(99849),i=a(52600),l=a(7662),c=a(66926),d=a(95179),u=a(73119),m=a(8042),h=a(73104),f=a(13220),p=a(40568),x=a(91719),g=a(50511),v=a(20114);function y(e){let{variant:t="gradient",showIcon:a=!0,fullWidth:y=!1,className:b="",children:w,companyId:j,activeType:N,fromDashboard:S=!1,...k}=e,I=(0,n.useRouter)(),{clearFormData:C}=(0,o.X)(),{trackButtonClick:T,trackValuationStarted:E}=(0,l.p)(),{companies:M,valuations:F}=(0,c.e6)(),D=()=>{Object.keys(localStorage).forEach(e=>{e.startsWith("valuationSections-")&&localStorage.removeItem(e)})},L=e=>{let t=M.find(t=>t.id===e),a=(null==t?void 0:t.companyType)==="idea";try{let t=localStorage.getItem("ideaOverrides"),r=t?JSON.parse(t):[];Array.isArray(r)&&r.includes(e)&&(a=!0)}catch(e){}return!!a},V=async e=>{e.preventDefault(),await R()},R=async()=>{if(C(),D(),i.default.getInstance().clearAllCache(),E("temp_".concat(Date.now()),{company_id:j,source:"new_valuation_button",disclaimer_accepted:!0}),"/dashboard/valuations"===window.location.pathname&&sessionStorage.setItem("fromValuationsPage","true"),j&&"hackathon"===N){try{let t=(await m.valuationsService.getValuationsByCompany(j)).sort((e,t)=>new Date(t.date||t.createdAt||0).getTime()-new Date(e.date||e.createdAt||0).getTime())[0];if(null==t?void 0:t.id){var e;let a=await m.valuationsService.getValuation(t.id),r=null==a?void 0:null===(e=a.responses)||void 0===e?void 0:e.hackathon;(null==r?void 0:r.review)!=null&&sessionStorage.setItem(f.J,JSON.stringify(r.review)),(null==r?void 0:r.derivedReport)!=null&&sessionStorage.setItem(h.j$,JSON.stringify(r.derivedReport)),(null==r?void 0:r.projectUrl)&&sessionStorage.setItem("hackathonProjectUrl",String(r.projectUrl)),(null==r?void 0:r.fileName)&&sessionStorage.setItem("hackathonProjectFileName",String(r.fileName)),(0,u.c$)(),(0,u.TW)(j);let s=new URLSearchParams({fromNewValuation:"true",companyId:j});S&&s.set("fromDashboard","true"),I.push("/hackathon-valuation/review?".concat(s.toString()));return}}catch(e){console.error("Error opening startup potential review:",e)}(0,u.c$)(),(0,u.TW)(j),I.push(S?"/hackathon-valuation?fromNewValuation=true&fromDashboard=true&companyId=".concat(encodeURIComponent(j)):"/hackathon-valuation?fromNewValuation=true&companyId=".concat(encodeURIComponent(j)));return}if(j){{let e=window.location.pathname;(e==="/dashboard/companies/".concat(j)||e==="/dashboard/market-readiness/".concat(j))&&sessionStorage.setItem("companyDetailsReturnUrl",e)}let e=M.find(e=>e.id===j),t="hackathon"===N?"hackathon":(0,x.IY)(e,{valuations:F,companies:M});I.push((0,x.ZJ)({companyId:j,flowType:null!=t?t:void 0}));return}if(N)try{if("hackathon"===N){(0,u.c$)(),sessionStorage.setItem("fromValuationSelection","true"),sessionStorage.setItem("fromNewValuation","true"),S&&sessionStorage.setItem("fromDashboard","true");let e=(0,v.l8)(M,F);
1if(0===e.length)try{let[t,a]=await Promise.all([d.companiesService.getCompanies(),m.valuationsService.getValuations()]);e=(0,v.l8)(t,a)}catch(t){e=[]}if(0===e.length){I.push(S?"/hackathon-valuation?fromNewValuation=true&fromDashboard=true":"/hackathon-valuation?fromNewValuation=true");return}I.push("/dashboard/valuations/new/select-company?type=hackathon");return}if("founder"===N){sessionStorage.setItem("fromValuationSelection","true"),sessionStorage.setItem("fromNewValuation","true"),S&&sessionStorage.setItem("fromDashboard","true");let e=M.filter(e=>(0,p.a8)(e));if(0===e.length)try{e=(await d.companiesService.getCompanies()).filter(e=>(0,p.a8)(e))}catch(t){e=[]}if(0===e.length){I.push(S?"/founder-valuation?fromNewValuation=true&fromDashboard=true":"/founder-valuation?fromNewValuation=true");return}I.push("/dashboard/valuations/new/select-company?type=founder");return}if("market_readiness"===N){sessionStorage.setItem("fromValuationSelection","true"),sessionStorage.setItem("fromNewValuation","true"),S&&sessionStorage.setItem("fromDashboard","true");let e=M.filter(e=>"market_readiness"===e.companyType);if(0===e.length)try{e=(await d.companiesService.getCompanies()).filter(e=>"market_readiness"===e.companyType)}catch(t){e=[]}if(0===e.length){I.push(S?"/dashboard/valuations/new/market-readiness?fromNewValuation=true&fromDashboard=true":"/dashboard/valuations/new/market-readiness?fromNewValuation=true");return}I.push("/dashboard/valuations/new/select-company?type=market_readiness");return}if("career"===N){sessionStorage.setItem("fromValuationSelection","true"),sessionStorage.setItem("fromNewValuation","true"),S&&sessionStorage.setItem("fromDashboard","true");let e=M.filter(e=>"career"===e.companyType);if(0===e.length)try{e=(await d.companiesService.getCompanies()).filter(e=>"career"===e.companyType)}catch(t){e=[]}if(0===e.length){sessionStorage.setItem("fromSelectCareer","true"),I.push(S?"/career-valuation?fromNewValuation=true&fromSelectCareer=true&fromDashboard=true":"/career-valuation?fromNewValuation=true&fromSelectCareer=true");return}I.push("/dashboard/valuations/new/select-company?type=career");return}let e=M;0===e.length&&(e=await d.companiesService.getCompanies());let t=e.filter(e=>"idea"===N?L(e.id):"company"===N?1===(0,x.oP)([e]).length:!L(e.id)).length;if("company"===N)if(0===t){S&&sessionStorage.setItem("fromDashboard","true");let e=await (0,g.H3)();I.push(e);return}else{S&&sessionStorage.setItem("fromDashboard","true"),I.push("/dashboard/valuations/new/select-company");return}if("idea"===N)if(0===t){S&&sessionStorage.setItem("fromDashboard","true"),I.push(S?"/valuate-idea?fromNewValuation=true&fromDashboard=true":"/valuate-idea?fromNewValuation=true&fromValuationsPage=true");return}else{S&&sessionStorage.setItem("fromDashboard","true"),I.push("/dashboard/valuations/new/select-company?type=idea");return}}catch(e){if(console.error("Error determining routing:",e),"hackathon"===N){(0,u.c$)(),sessionStorage.setItem("fromValuationSelection","true"),sessionStorage.setItem("fromNewValuation","true"),S&&sessionStorage.setItem("fromDashboard","true"),I.push(S?"/hackathon-valuation?fromNewValuation=true&fromDashboard=true":"/hackathon-valuation?fromNewValuation=true");return}if("career"===N){sessionStorage.setItem("fromValuationSelection","true"),sessionStorage.setItem("fromNewValuation","true"),sessionStorage.setItem("fromSelectCareer","true"),I.push(S?"/career-valuation?fromNewValuation=true&fromSelectCareer=true&fromDashboard=true":"/career-valuation?fromNewValuation=true&fromSelectCareer=true");return}}try{sessionStorage.setItem("valuationSelectionReturn",window.location.pathname+window.location.search);let e=sessionStorage.getItem("valuationsTypeTab")||"company";sessionStorage.setItem("valuationSelectionReturnTabType",e)}catch(e){}I.push(S?"/valuation-selection?fromNewValuation=true&fromDashboard=true":"/valuation-selection?fromNewValuation=true")};return(0,r.jsxs)(s.Button,{variant:t,className:"".concat(y?"w-full":""," ").concat(b),onClick:V,...k,children:[a&&(0,r.jsx)("i",{className:"fa-solid fa-plus mr-2 ".concat(b.includes("!text-black")||b.includes("text-black")?"!text-black":""),style:b.includes("!text-black")||b.includes("text-black")?{color:"#000000"}:void 0}),null!=w?w:"New Valuation"]})}},88506:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>K});var r=a(4118),s=a(34916),n=a(45398),o=a(67487),i=a(24694),l=a(8735),c=a.n(l),d=a(86982),u=a(99028),m=a(78870),h=a(95179),f=a(8042),p=a(91403),x=a(62400),g=a(66926),v=a(12799);a(6957);var y=a(42116),b=a(51424),w=a(41877),j=a(7662),N=a(61363),S=a(21675),k=a(55617),I=a(40568),C=a(44291),T=a(25535),E=a(32782),M=a(71877
1),F=a(4819),D=a(10501),L=a(34161),V=a(73104),R=a(69328),A=a(50511),P=a(59385),_=a(99984),O=a(65738),B=a(46681),U=a(33099),W=a(80351),$=a(2113),J=a(61640),q=a(45401),z=a(4475),Y=a(38502),G=a(6874);let Z="valuationCardDisclaimerSeen";function H(e){let{anchor:t,bounds:a,data:s,formatCurrencyCompact:n,onPointerEnter:o,onPointerLeave:i}=e,l=(0,m.useRef)(null),[c,d]=(0,m.useState)({w:240,h:80});(0,m.useLayoutEffect)(()=>{if(!l.current)return;let{width:e,height:t}=l.current.getBoundingClientRect();e>0&&t>0&&d({w:e,h:t})},[s,t.x,t.y]);let u=t.y-a.top-8,h=u>a.top+a.height-t.y-8?t.y-c.h-12:t.y+12,f=t.x-c.w/2,p=window.innerWidth,x=window.innerHeight;f=Math.max(8,Math.min(f,p-c.w-8)),h=Math.max(8,Math.min(h,x-c.h-8));let g=s.percentChange>=0;return(0,r.jsxs)("div",{ref:l,role:"tooltip",className:"fixed z-50 flex w-max max-w-[min(280px,calc(100vw-1rem))] flex-col gap-2 rounded-lg border border-purple-300 bg-white px-4 py-3 shadow-lg sm:flex-row sm:items-center sm:gap-4 pointer-events-auto",style:{left:f,top:h},onMouseEnter:o,onMouseLeave:i,children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1 text-left",children:[(0,r.jsx)("p",{className:"text-sm font-semibold text-gray-900 break-words",children:s.companyName}),(0,r.jsx)("p",{className:"mt-0.5 text-xs text-gray-500 whitespace-nowrap",children:s.dateStr}),(0,r.jsx)("p",{className:"mt-1 text-sm font-semibold text-gray-900 break-words",children:n(s.value)}),(0,r.jsx)("p",{className:"mt-0.5 text-xs text-gray-600",children:null!=s.score?"".concat(s.score,"/100"):"â"})]}),(0,r.jsxs)("span",{className:"shrink-0 text-lg font-semibold whitespace-nowrap ".concat(g?"text-green-600":"text-red-500"),children:[g?"+":"",s.percentChange.toFixed(0),"%"]})]})}function Q(){var e,t;let a,l=(0,x.useRouter)(),{user:Q,isLoading:K}=(0,v.J)(),{companies:X,valuations:ee,loading:et}=(0,g.e6)(),ea=(0,m.useCallback)(async e=>{let t=X.find(t=>t.id===e);if(t)return t;try{return await h.companiesService.getCompany(e)}catch(e){return null}},[X]),[er,es]=(0,m.useState)(!1);(0,m.useLayoutEffect)(()=>{es((0,N.NA)())},[]),(0,m.useLayoutEffect)(()=>{(null==Q?void 0:Q.id)&&!K&&(0,N.n$)()},[null==Q?void 0:Q.id,K]);let[en,eo]=(0,m.useState)(!1),[ei,el]=(0,m.useState)(!1);(0,m.useLayoutEffect)(()=>{if(!(null==Q?void 0:Q.id)){eo(!1);return}if((0,C.kx)(Q.id)){(0,N.rg)(Q.id),(0,N.n$)(),eo(!1);return}eo("true"===localStorage.getItem((0,N.fG)(Q.id)))},[null==Q?void 0:Q.id]),(0,m.useLayoutEffect)(()=>{el(!1)},[null==Q?void 0:Q.id]),(0,m.useLayoutEffect)(()=>{if((null==Q?void 0:Q.id)&&!K&&!et&&(0,N.iO)(Q.id)){if((0,C.yr)(Q.id)){l.replace(C.pQ);return}if((0,C.kx)(Q.id)){(0,N.rg)(Q.id),(0,N.n$)();return}!(X.length>0)&&!(ee.length>0)&&!er&&"true"!==sessionStorage.getItem(N.ui)&&l.replace("/valuation-selection")}},[null==Q?void 0:Q.id,K,et,X.length,ee.length,er,l]);let{trackButtonClick:ec}=(0,j.p)(),{toast:ed}=(0,b.dj)(),{theme:eu}=(0,U.D)(),em="cebos"===eu?"#5c3a8f":"#004EF9",eh="cebos"===eu?"#8C27F1":"#004EF9",ef="cebos"===eu?"#9065DB":"#004EF9",[ep,ex]=(0,m.useState)(null),[eg,ev]=(0,m.useState)({}),[ey,eb]=(0,m.useState)({}),[ew,ej]=(0,m.useState)({}),[eN,eS]=(0,m.useState)(!1),[ek,eI]=(0,m.useState)("career"),[eC,eT]=(0,m.useState)("1M"),[eE,eM]=(0,m.useState)({}),[eF,eD]=(0,m.useState)(null),eL=(0,m.useRef)(null),eV=(0,m.useRef)(null),eR=(0,m.useRef)(null),eA=(0,m.useRef)(null),[eP,e_]=(0,m.useState)(null),[eO,eB]=(0,m.useState)(!1),[eU,eW]=(0,m.useState)({w:0,h:0}),e$=(0,m.useRef)(null);e$.current=eF;let eJ=(0,m.useCallback)(()=>{let e=e$.current,t=eR.current,a=eA.current;if(null===e||!t||!a)return;let r=t.querySelector('[data-perf-chart-dot="'.concat(e,'"]'));if(!r)return;let s=r.getBoundingClientRect(),n=a.getBoundingClientRect();e_({anchor:{x:s.left+s.width/2,y:s.top+s.height/2},bounds:{left:n.left,top:n.top,width:n.width,height:n.height}})},[]),[eq,ez]=(0,m.useState)("score"),[eY,eG]=(0,m.useState)(null),eZ=(0,m.useRef)(null),[eH,eQ]=(0,m.useState)([]),[eK,eX]=(0,m.useState)(!1),e0=(0,m.useRef)(null);(0,m.useEffect)(()=>{if(null===eY)return;let e=e=>{var t;null!==(t=eZ.current)&&void 0!==t&&t.contains(e.target)||eG(null)};return document.addEventListener("touchstart",e,{passive:!0}),()=>document.removeEventListener("touchstart",e)},[eY]),(0,m.useEffect)(()=>{try{localStorage.removeItem("creditsUsed"),localStorage.removeItem("useCredits"),localStorage.removeItem("planAmount"),localStorage.removeItem("paymentMethod"),sessionStorage.removeItem("fromCreditPurchase"),sessionStorage.removeItem("creditPurchaseReturnUrl"),localStorage.removeItem("fromCreditPurchase"),localStorage.removeItem("creditPurchaseReturnUrl"),localStorage.removeItem("creditOnlyPaymentProcessed"),localStorage.removeItem("ideaFormData"),sessionStorage.removeItem("valuatedIdeaCompanyId"),sessionStorage.removeItem("fromValuateIdea")}catch(e){console.warn("Storage cleanup failed:",e)}},[]),(0,m.useEffect)(()=>{let e=sessionStorage.getItem("showQuickPeepNotifyToast"),t=sessionStorage.getItem("quickPeepNotifyEmail");"true"===e&&t&&(ed({title:"Report is on the way!",description:"You'll be notified to ".concat(t," the moment it's ready")}),sessionStorage.removeItem("showQuickPeepNotifyToast"),sessionStorage.removeItem("quickPeepNotifyEmail"))},[ed]),(0,m.useEffect)(()=>{let e=sessionStorage.getItem("showIdeaNotifyToast"),t=sessionStorage.getItem("ideaNotifyEmail");"true"===e&&t&&(ed({title:"Report is on the way!",description:"You'll be notified to ".concat(t," the moment it's ready")}),sessionStorage.removeItem("showIdeaNotifyToast"),sessionStorage.removeItem("ideaNotifyEmail"))},[ed]),(0,m.useEffect)(()=>{let e=sessionStorage.getItem("showValuationNotifyToast"),t=sessionStorage.getItem("valuationNotifyEmail");"true"===e&&t&&(ed({title:"Report is on the way!",description:"You'll be notified to ".concat(t," the moment it's ready")}),sessionStorage.removeItem("showValuationNotifyToast"),sessionStorage.removeItem("valuationNotifyEmail"))},[ed]),(0,m.useEffect)(()=>
1{let e=sessionStorage.getItem("showCareerNotifyToast"),t=sessionStorage.getItem("careerNotifyEmail");"true"===e&&t&&(ed({title:"Report is on the way!",description:"You'll be notified to ".concat(t," the moment your career report is ready")}),sessionStorage.removeItem("showCareerNotifyToast"),sessionStorage.removeItem("careerNotifyEmail"))},[ed]),(0,m.useEffect)(()=>{let e=sessionStorage.getItem("showFounderNotifyToast"),t=sessionStorage.getItem("founderNotifyEmail");"true"===e&&t&&(ed({title:"Report is on the way!",description:"You'll be notified to ".concat(t," the moment your founder report is ready")}),sessionStorage.removeItem("showFounderNotifyToast"),sessionStorage.removeItem("founderNotifyEmail"))},[ed]),(0,m.useEffect)(()=>{let e=sessionStorage.getItem("showMarketReadinessNotifyToast"),t=sessionStorage.getItem("marketReadinessNotifyEmail");"true"===e&&t&&(ed({title:"Report is on the way!",description:"You'll be notified to ".concat(t," the moment it's ready")}),sessionStorage.removeItem("showMarketReadinessNotifyToast"),sessionStorage.removeItem("marketReadinessNotifyEmail"))},[ed]),(0,m.useEffect)(()=>{let e=new Date;e.setDate(e.getDate()-30);let t=e=>{var t;let a=X.find(t=>t.id===e),r=null==a?void 0:null===(t=a.companyType)||void 0===t?void 0:t.toLowerCase();return"idea"!==r&&"market_readiness"!==r};eT((null!=ee?ee:[]).some(a=>"completed"===a.status&&new Date(a.date)>=e&&t(a.companyId))?"1M":"1Y")},[X,ee]),(0,m.useLayoutEffect)(()=>{let e=eV.current;e&&(e.scrollLeft=0),eD(null),e_(null)},[eC,eO]),(0,m.useLayoutEffect)(()=>{if(null===eF){e_(null);return}eJ()},[eF,eJ]),(0,m.useEffect)(()=>{if(null===eF)return;let e=eV.current,t=()=>eJ();return window.addEventListener("resize",t),null==e||e.addEventListener("scroll",t),()=>{window.removeEventListener("resize",t),null==e||e.removeEventListener("scroll",t)}},[eF,eJ]),(0,m.useEffect)(()=>{let e=window.matchMedia("(max-width: 767px)"),t=()=>eB(e.matches);return t(),e.addEventListener("change",t),()=>e.removeEventListener("change",t)},[]),(0,m.useLayoutEffect)(()=>{let e=eR.current;if(!e)return;let t=()=>{let{width:t,height:a}=e.getBoundingClientRect();t>0&&a>0&&eW({w:t,h:a})};t();let a=new ResizeObserver(t);return a.observe(e),()=>a.disconnect()},[eC,eO,et]);let e1=e=>p.N.extractScoreFromAnalysis(e),e2=e=>{if(!e||"string"!=typeof e)return null;let t=e.match(/Business Health Score:\s*(\d+(?:\.\d+)?)\/100/);return t?parseFloat(t[1]):null},e4=e=>{if(null==e)return null;let t=String(e).trim();if(!t)return null;let a=parseFloat(t.replace(/[$,]/g,""));if(Number.isFinite(a)&&a>=0)return a;let r=t.match(/\$?\s*([0-9,]+(?:\.[0-9]+)?)/);return r?parseFloat(r[1].replace(/,/g,"")):null},e5=async e=>{eS(!0);let t=e=>{var t;return null===(t=e.reportType)||void 0===t?void 0:t.toLowerCase().startsWith("career-")},a=e=>{var t,a,r,s;return(null===(a=X.find(t=>t.id===e.companyId))||void 0===a?void 0:null===(t=a.companyType)||void 0===t?void 0:t.toLowerCase())==="market_readiness"||null!==(s=null===(r=e.reportType)||void 0===r?void 0:r.toLowerCase().startsWith("mr-"))&&void 0!==s&&s},r=await Promise.all(e.map(async e=>{let r,s,n=null;try{var o,i,l,c,d,u,m,h,f,x,g,v;let y=await p.N.getReportsByValuation(e.id);if(y&&y.length>0&&y[0].analysis){let e=y[0].analysis;if("object"==typeof e&&(null===(i=e.executive_summary)||void 0===i?void 0:i.primary_valuation))r=e.executive_summary.primary_valuation;else if("string"==typeof e)try{let t=JSON.parse(e);(null===(l=t.executive_summary)||void 0===l?void 0:l.primary_valuation)&&(r=t.executive_summary.primary_valuation)}catch(a){let t=e.match(/\$([0-9,]+)/);t&&(r=parseInt(t[1].replace(/,/g,""),10))}let t="object"==typeof e?e:(()=>{try{return JSON.parse(e)}catch(e){return null}})(),a=e1(t);null==a&&y[0].content&&(a=e2(y[0].content)),null!=a&&(s=Math.round(Number(a)))}if(a(e)&&y&&y.length>0&&(n=(0,R.s)(y[0].analysis)),t(e)&&(null==r||0===r)){let t=null!=e.value&&e.value>0?e.value:null,a=null===(u=e.aiResponses)||void 0===u?void 0:null===(d=u.careerInsights)||void 0===d?void 0:null===(c=d.currentMarketValue)||void 0===c?void 0:c.value,s=null!=a?e4(a):null,n=(null===(m=e.responses)||void 0===m?void 0:m.targetSalary)!=null?e4(e.responses.targetSalary):null,o=null!==(f=null!==(h=null!=t?t:s)&&void 0!==h?h:n)&&void 0!==f?f:0;o>
10&&(r=o)}if((null==r||0===r)&&(0,T.FU)(e,X)){let t,a=null===(g=e.responses)||void 0===g?void 0:null===(x=g.hackathon)||void 0===x?void 0:x.derivedReport,s=(0,V.L1)(a);if((null==s?void 0:s.ideaValuation)!=null&&s.ideaValuation>0)t=s.ideaValuation;else if(null!=a)try{let e="string"==typeof a?JSON.parse(a):a;if(e&&"object"==typeof e){let a=Number(e.ideaValuation);Number.isFinite(a)&&a>0&&(t=a)}}catch(e){}null!=t&&t>0&&(r=t)}if(null==s&&(0,T.FU)(e,X)){let t=(0,V.xn)(e);null!=t&&t>0&&(s=t)}let b=X.find(t=>t.id===e.companyId);if(((null==b?void 0:b.companyType)==="idea"||null!==(v=null===(o=e.reportType)||void 0===o?void 0:o.toLowerCase().startsWith("idea-"))&&void 0!==v&&v)&&null==s&&null!=e.score&&Number.isFinite(Number(e.score))&&Number(e.score)>0&&(s=Math.round(Number(e.score))),t(e)){let t=(0,P.Kk)(e);s=null!=t&&t>0?t:void 0}if(a(e)&&null==s){let t=(0,_.t3)(e);t&&t.score>0?s=t.score:null!=e.score&&Number.isFinite(Number(e.score))&&Number(e.score)>0&&(s=Math.round(Number(e.score)))}if((0,k.OH)(e,X)&&null==s){let t=(0,k.PN)(e);null!=t&&t>0?s=t:null!=e.score&&Number.isFinite(Number(e.score))&&Number(e.score)>0&&(s=Math.round(Number(e.score)))}null==r&&null!=e.value&&e.value>0&&(r=e.value)}catch(t){console.error("Error fetching value for valuation ".concat(e.id,":"),t)}return{id:e.id,value:r,score:s,marketDemandPct:n}})),s={},n={},o={};r.forEach(e=>{var t;null!=e.value&&(s[e.id]=e.value),null!=e.score&&(n[e.id]=e.score),o[e.id]=null!==(t=e.marketDemandPct)&&void 0!==t?t:null}),ev(s),eb(e=>({...e,...n})),ej(e=>({...e,...o})),eS(!1)};(0,m.useEffect)(()=>{K||null!==Q||l.replace("/auth")},[Q,K,l]),(0,m.useEffect)(()=>{if(ee&&ee.length>0){let e=ee.filter(e=>"completed"===e.status);e.length>0&&e5(e)}},[ee,X]),(0,m.useEffect)(()=>{let e=(null!=ee?ee:[]).filter(e=>{var t;let a=e.company||X.find(t=>t.id===e.companyId)||null,r={...e,company:a,companyType:(null===(t=e.company)||void 0===t?void 0:t.companyType)||(null==a?void 0:a.companyType)};return(0,E.S)(r)&&!(0,T.AE)(e)&&!(0,k.PD)(r)}).sort((e,t)=>new Date(t.updatedAt||t.date||t.createdAt).getTime()-new Date(e.updatedAt||e.date||e.createdAt).getTime()).slice(0,3);if(0===e.length){eM({});return}let t=!1,a={};return Promise.all(e.map(async e=>{try{var t;let a=await f.valuationsService.getValuationProgress(e.id),r=await (0,z.tA)({id:e.id,companyId:e.companyId,reportType:e.reportType,companyType:null===(t=X.find(t=>t.id===e.companyId))||void 0===t?void 0:t.companyType,responses:e.responses,paymentStatus:e.paymentStatus},a,{getCompany:ea});return{id:e.id,pct:r}}catch(t){return{id:e.id,pct:0}}})).then(e=>{t||(e.forEach(e=>{a[e.id]=e.pct}),eM(e=>({...e,...a})))}),()=>{t=!0}},[ee,X,et,ea]),(0,m.useEffect)(()=>{if(et||!(null==Q?void 0:Q.id))return;let e=!1;return G.j.listDrafts().then(t=>{e||eQ(t)}).catch(t=>{e||(console.warn("Failed to load career drafts:",t),eQ([]))}),()=>{e=!0}},[et,null==Q?void 0:Q.id]),(0,m.useEffect)(()=>{if(et)return;let e=(0,F.v)(null!=ee?ee:[],X);eI(t=>{let a=(0,F.M)(e,t);return a===t?t:a})},[et,ee,X]);let e3=(0,m.useCallback)(async e=>{ec("Continue Valuation",{location:"dashboard_in_progress",type:"career_draft"});let t=(0,M.Rp)(e);l.push(null!=t?t:await (0,Y.uI)(e))},[l,ec]);if(K)return(0,r.jsx)("div",{className:"container py-6 font-geist [&_*]:font-geist",children:(0,r.jsx)("p",{className:"text-center",children:"Loading..."})});if(null===Q)return null;let e6=e=>{let t=X.find(t=>t.id===e);return t?(0,N.OZ)(t.name):"Unknown Company"},e8=e=>0===e?"0":e<10?"0".concat(e):e.toString(),e9=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}).format(e).replace(/^\$/,"$ "),e7=e=>{if(0===e)return"$ 0";if(e>=1e12){let t=e/1e12,a=t%1==0?String(Math.round(t)):t.toFixed(1).replace(/\.0$/,"");return"$ ".concat(a,"T")}if(e>=1e9){let t=e/1e9,a=t%1==0?String(Math.round(t)):t.toFixed(1).replace(/\.0$/,"");return"$ ".concat(a,"B")}if(e>=1e6){let t=e/1e6,a=t%1==0?String(Math.round(t)):t.toFixed(1).replace(/\.0$/,"");return"$ ".concat(a,"M")}if(e>=1e3){let t=e/1e3,a=t%1==0?String(Math.round(t)):t.toFixed(1).replace(/\.0$/,"");return"$ ".concat(a,"K")}return e9(e)},te=async e=>{var t,a;if("completed"===e.status){ec("View Valuation Results",{valuation_id:e.id,company_name:e.companyName||"Unknown",status:e.status});let a=X.find(t=>
1t.id===e.companyId),r=(0,k.OH)({...e,company:a},X),s=!r&&(null===(t=e.reportType)||void 0===t?void 0:t.toLowerCase().startsWith("career-"));if((0,T.FU)(e,X)){l.push("/hackathon-valuation/results?valuationId=".concat(encodeURIComponent(e.id),"&fromDashboard=true"));return}let n=!r&&((null==a?void 0:a.companyType)==="market_readiness"||e.reportType&&String(e.reportType).toLowerCase().startsWith("mr-")),o=!r&&!n&&(null==a?void 0:a.companyType)==="idea",i=r?(0,k.tC)(e.id,{fromDashboard:!0}):s?"/dashboard/valuations/".concat(e.id,"/career-results"):n?"/dashboard/valuations/".concat(e.id,"/market-readiness-results"):o?"/dashboard/valuations/".concat(e.id,"/idea-results"):"/dashboard/valuations/".concat(e.id,"/all-in-one-results");l.push(i);return}ec("Continue Valuation",{valuation_id:e.id,company_name:e.companyName||e6(e.companyId)||"Unknown",status:e.status});let r=eE[e.id],s=String(e.status);if((null!=r?r:0)>=99&&("in_progress"===s||"draft"===s)){let e="";try{let t=localStorage.getItem("user");if(t){let a=JSON.parse(t);e=(null==a?void 0:a.notifyEmail)||(null==a?void 0:a.email)||""}}catch(e){console.warn("Could not get user email for toast:",e)}ed({title:"Valuation Processing",description:"Your valuation is currently being processed. You'll be notified to ".concat(e||"your email"," when it's ready."),variant:"default"});return}ex(e.id);try{let t=X.find(t=>t.id===e.companyId),r=(0,M.oH)({...e,companyType:(null===(a=e.company)||void 0===a?void 0:a.companyType)||(null==t?void 0:t.companyType)},{fromDashboard:!0});if(r){l.push(r);return}if((0,T.FU)(e,X)){let t=await (0,S.m7)(e,{fromDashboard:!0});l.push(t);return}let s=X.find(t=>t.id===e.companyId);if(y.o_.valuationIsCareerFlow({reportType:e.reportType,company:s?{companyType:s.companyType}:null})){let t=await (0,Y.LL)(e);if("processing_toast"===t.type){let e="";try{let t=localStorage.getItem("user");if(t){let a=JSON.parse(t);e=(null==a?void 0:a.notifyEmail)||(null==a?void 0:a.email)||""}}catch(e){console.warn("Could not get user email for toast:",e)}ed({title:"Valuation Processing",description:"Your valuation is currently being processed. You'll be notified to ".concat(e||"your email"," when it's ready."),variant:"default"});return}l.push(t.path);return}if((0,k.OH)(e,X)){l.push((0,k.Yy)(e,{fromDashboard:!0}));return}let n=await y.o_.getNextStepPathForValuation(e.id);l.push(n.path)}catch(n){console.error("Error getting next step:",n);let t=X.find(t=>t.id===e.companyId),a=y.o_.valuationIsCareerFlow({reportType:e.reportType,company:t?{companyType:t.companyType}:null}),r=y.o_.valuationIsIdeaFlow({reportType:e.reportType,company:t?{companyType:t.companyType}:null}),s=y.o_.valuationIsMarketReadinessFlow({reportType:e.reportType,company:t?{companyType:t.companyType}:null});if(ed({title:"Error",description:"Failed to determine next step. Please try again.",variant:"destructive"}),(0,k.OH)(e,X))l.push((0,k.Yy)(e,{fromDashboard:!0}));else if(a){let t=await (0,Y.LL)(e);"navigate"===t.type&&l.push(t.path)}else if(r&&e.companyId){let t=new URLSearchParams({companyId:e.companyId,valuationId:e.id,fromResumeIdeaReview:"true",fromNewValuation:"true",fromDashboard:"true"});l.push("/dashboard/valuations/new/idea/review?".concat(t.toString()))}else if(r)l.push("/valuate-idea?valuationId=".concat(e.id));else if(s&&e.companyId){let t=new URLSearchParams({companyId:e.companyId,valuationId:e.id,fromResumeMrValuation:"true",fromNewValuation:"true",fromDashboard:"true"}),a=(e.reportType||"mr-premium").toLowerCase();if(a.startsWith("mr-")){let e=a.replace(/^mr-/i,"").trim();e&&t.set("plan",e)}l.push("/dashboard/valuations/new/market-readiness/review?".concat(t.toString()))}else if(s){let t=new URLSearchParams({fromNewValuation:"true",fromResumeMrValuation:"true",fromDashboard:"true",valuationId:e.id}),a=(e.reportType||"mr-premium").toLowerCase();if(a.startsWith("mr-")){let e=a.replace(/^mr-/i,"").trim();e&&t.set("plan",e)}l.push("/dashboard/valuations/new/market-readiness?".concat(t.toString()))}else if((0,T.FU)(e,X)){let t=await (0,S.m7)(e,{fromDashboard:!0});l.push(t)}else l.push("/dashboard/valuations/new/business-information?valuationId=".concat(e.id,"&companyId=").concat(e.companyId))}finally{ex(null)}};if(et||eN){let t=(null!==(e=null==ee?void 0:ee.length)&&void 0!==e?e:0)===0;return(0,r.jsxs)("div",{className:"font-geist [&_*]:font-geist space-y-6 rounded-xl p-0 md:p-6 ".concat("cebos"===eu?"bg-[#eff5ff]/90":"bg-blue-50/80"),style:{"--dashboard-primary":em},children:[(0,r.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-2xl font-geist font-medium text-black",children:"Dashboard"}),(0,r.jsx)("p",{className:"text-muted-foreground",children:t?"Welcome to your valuation dashboard!":"Welcome back to your valuation dashboard!"})]}),(0,r.jsxs)("div",{className:"flex gap-3",children:[(0,r.jsx)(c(),{href:"/quick-peep",children:(0,r.jsxs)(s.Button,{variant:"outline",className:"shadow-sm !bg-white !border hover:!bg-gray-50 text-[var(--dashboard-primary)] border-[#
1E3E8EF]",onClick:()=>ec("Quick Peep",{location:"dashboard_header"}),children:[(0,r.jsx)(o.A,{className:"mr-2 h-4 w-4 text-inherit"}),"Quick Look"]})}),(0,r.jsx)(d.M,{className:"shadow-sm text-white border-0 text-sm font-normal bg-[var(--dashboard-primary)]",showIcon:!0,fromDashboard:!0,children:"New Valuation"})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-10 gap-6 md:items-stretch",children:[(0,r.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 shadow-sm overflow-hidden md:col-span-7 md:self-start",children:(0,r.jsx)("div",{className:"flex flex-col md:flex-row md:items-center",children:[,,,].fill(0).map((e,t)=>(0,r.jsxs)(m.Fragment,{children:[(0,r.jsxs)("div",{className:"flex-1 p-4 flex flex-row items-center justify-between gap-3",children:[(0,r.jsxs)("div",{className:"flex flex-col min-w-0",children:[(0,r.jsx)(w.E,{className:"h-4 w-36"}),(0,r.jsx)(w.E,{className:"h-3 w-28 mt-1"})]}),(0,r.jsx)(w.E,{className:"h-8 w-12 shrink-0"})]}),t<2&&(0,r.jsx)("div",{className:"hidden md:block w-px h-8 bg-gray-200 flex-shrink-0 self-center"})]},t))})}),(0,r.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 shadow-sm p-6 md:col-span-3 md:row-span-2 min-h-[200px]",children:[(0,r.jsx)(w.E,{className:"h-5 w-40 mb-2"}),(0,r.jsx)(w.E,{className:"h-3 w-full mb-4"}),(0,r.jsxs)("div",{className:"py-8 flex flex-col items-center",children:[(0,r.jsx)(w.E,{className:"h-16 w-16 rounded-full mb-4"}),(0,r.jsx)(w.E,{className:"h-4 w-36 mb-2"}),(0,r.jsx)(w.E,{className:"h-3 w-28"})]})]}),(0,r.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 shadow-sm p-6 md:col-span-7",children:[(0,r.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(w.E,{className:"h-5 w-56 mb-2"}),(0,r.jsx)(w.E,{className:"h-3 w-64"})]}),(0,r.jsx)("div",{className:"flex gap-1",children:[,,,,].fill(0).map((e,t)=>(0,r.jsx)(w.E,{className:"h-8 w-10"},t))})]}),(0,r.jsxs)("div",{className:"py-12 flex flex-col items-center",children:[(0,r.jsx)(w.E,{className:"h-20 w-20 rounded-full mb-4"}),(0,r.jsx)(w.E,{className:"h-4 w-48 mb-2"}),(0,r.jsx)(w.E,{className:"h-3 w-64"})]})]})]}),(0,r.jsxs)("div",{className:"grid gap-6 md:grid-cols-2",children:[(0,r.jsxs)("div",{className:"bg-white rounded-lg border p-6",children:[(0,r.jsxs)("div",{className:"mb-4 flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(w.E,{className:"h-6 w-40 mb-2"}),(0,r.jsx)(w.E,{className:"h-4 w-48"})]}),(0,r.jsx)(w.E,{className:"h-8 w-24"})]}),(0,r.jsxs)("div",{className:"space-y-4",children:[[,,,].fill(0).map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center gap-4 p-3 rounded-lg",children:[(0,r.jsxs)("div",{className:"flex-1 min-w-0 overflow-hidden",children:[(0,r.jsx)(w.E,{className:"h-4 w-32 mb-1"}),(0,r.jsx)(w.E,{className:"h-3 w-24"})]}),(0,r.jsx)(w.E,{className:"h-4 w-20"})]},t)),(0,r.jsx)("div",{className:"pt-2",children:(0,r.jsx)(w.E,{className:"h-10 w-full"})})]})]}),(0,r.jsxs)("div",{className:"bg-white rounded-lg border p-6",children:[(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)(w.E,{className:"h-6 w-48 mb-2"}),(0,r.jsx)(w.E,{className:"h-4 w-64"})]}),(0,r.jsx)("div",{className:"space-y-4",children:[,,,].fill(0).map((e,t)=>(0,r.jsx)("div",{className:"w-full h-auto py-3 border rounded-lg",children:(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)(w.E,{className:"h-10 w-10 rounded-full"}),(0,r.jsxs)("div",{className:"text-left flex-1",children:[(0,r.jsx)(w.E,{className:"h-4 w-32 mb-1"}),(0,r.jsx)(w.E,{className:"h-3 w-48"})]})]})},t))})]})]})]})}if(0===X.length&&0===ee.length&&!er&&en)return(0,r.jsx)("div",{className:"container py-6 font-geist [&_*]:font-geist",children:(0,r.jsx)(O.default,{})});ee.length;let tt=e=>{let t=X.find(t=>t.id===e);if(t&&(0,I.a8)(t))return"founder";let a=null==t?void 0:t.companyType,r=a?a.toLowerCase():null;return"idea"===r?"idea":"founder"===r?"founder":"career"===r?"career":"hackathon"===r?"hackathon":"market_readiness"===r?"market_readiness":"business"},ta=X.filter(e=>"business"===tt(e.id)&&!(0,A.Pp)(e)),tr=X.filter(e=>"idea"===tt(e.id));X.filter(e=>"career"===tt(e.id));let ts=X.filter(e=>"founder"===tt(e.id)),tn=ee.filter(e=>{var t;return"business"===tt(e.companyId)&&"completed"===e.status&&!(null===(t=e.reportType)||void 0===t?void 0:t.toLowerCase().startsWith("mr-"))}),to=ee.filter(e=>"idea"===tt(e.companyId)&&"completed"===e.status),ti=e=>{var t,a;return!(0,k.OH)(e,X)&&null!==(a=null===(t=e.reportType)||void 0===t?void 0:t.toLowerCase().startsWith("career-"))&&void 0!==a&&a},tl=e=>(0,k.OH)(e,X);ee.filter(e=>ti(e)&&(0,P.l1)(e));let tc=ee.filter(e=>tl(e)&&"completed"===e.status),td=e=>{var t,a;return"market_readiness"===tt(e.companyId)||null!==(a=null===(t=e.reportType)||void 0===t?void 0:t.toLowerCase().startsWith("mr-"))&&void 0!==a&&a},tu=e=>"career_draft"===e.kind?new Date(e.data.createdAt).getTime():new Date(e.data.updatedAt||e.data.date||e.data.createdAt).getTime(),tm=(null!=ee?ee:[]).filter(e=>{var t;let a=e.company||X.find(t=>
1t.id===e.companyId)||null,r={...e,company:a,companyType:(null===(t=e.company)||void 0===t?void 0:t.companyType)||(null==a?void 0:a.companyType)};return(0,E.S)(r)&&!(0,T.AE)(e)&&!(0,k.PD)(r)}).sort((e,t)=>new Date(t.updatedAt||t.date||t.createdAt).getTime()-new Date(e.updatedAt||e.date||e.createdAt).getTime()).map(e=>({kind:"valuation",data:e})),th=new Set((null!=ee?ee:[]).filter(e=>{var t,a;let r=e.company||X.find(t=>t.id===e.companyId)||null,s={...e,company:r,companyType:(null===(t=e.company)||void 0===t?void 0:t.companyType)||(null==r?void 0:r.companyType)};if(!(0,E.S)(s)||(0,k.PD)(s)||(0,T.AE)(e))return!1;let n=String(e.companyId||"").trim();return!!n&&(String(null!==(a=e.reportType)&&void 0!==a?a:"").toLowerCase().startsWith("career-")||"career"===tt(n))}).map(e=>String(e.companyId||"").trim())),tf=[...tm,...eH.filter(e=>{let t=String(e.companyId||"").trim();return!t||!th.has(t)}).map(e=>({kind:"career_draft",data:e}))].sort((e,t)=>tu(t)-tu(e)).slice(0,3),tp=e=>{let t=tt(e);return"idea"===t?"Idea":"founder"===t?"Founder":"market_readiness"===t?"Growth Readiness":"career"===t?"Career":"business"===t?"Business":"hackathon"===t?"Startup potential":"Career"},tx=e=>{var t;let a=null===(t=e.reportType)||void 0===t?void 0:t.toLowerCase();return"founder"===a?"Founder":(null==a?void 0:a.startsWith("idea-"))?"Idea":(null==a?void 0:a.startsWith("mr-"))?"Growth Readiness":a&&a.includes("hackathon")||"hackathon"===tt(e.companyId)?"Startup potential":tp(e.companyId)},tg=e=>{var t,a,r;let s={...e,companyType:(null===(t=e.company)||void 0===t?void 0:t.companyType)||tt(e.companyId)};if(!(0,T.FU)(e,X))return(0,M.qE)(s,e6(e.companyId));let n=null===(r=e.responses)||void 0===r?void 0:null===(a=r.hackathon)||void 0===a?void 0:a.review,o="string"==typeof(null==n?void 0:n.projectName)?n.projectName.trim():"",i=X.find(t=>t.id===e.companyId),l=(o||(null==i?void 0:i.name)||"").trim();if(!l)return(0,M.qE)(s,M.Um.hackathon);let c=(0,N.j8)(l)||l;return(0,M.qE)(s,(0,N.OZ)(c)||c)},tv=e=>new Date(e).toLocaleDateString("en-US",{month:"short",day:"2-digit",year:"numeric"}).replace(/,/g,""),ty=(a=[...null!=ee?ee:[]].filter(e=>"completed"===e.status).sort((e,t)=>new Date(t.date).getTime()-new Date(e.date).getTime()),"business"===ek?a=a.filter(e=>{var t,a;return!(ti(e)||tl(e)||(null===(t=e.reportType)||void 0===t?void 0:t.toLowerCase().startsWith("idea-"))||(null===(a=e.reportType)||void 0===a?void 0:a.toLowerCase().startsWith("mr-"))||(0,T.FU)(e,X))&&"business"===tt(e.companyId)}):"idea"===ek?a=a.filter(e=>"idea"===tt(e.companyId)):"founder"===ek?a=a.filter(e=>tl(e)):"market_readiness"===ek?a=a.filter(e=>td(e)&&"completed"===e.status):"hackathon"===ek?a=a.filter(e=>(0,T.FU)(e,X)):"career"===ek&&(a=[...null!=ee?ee:[]].filter(e=>"completed"===e.status&&ti(e)).sort((e,t)=>new Date(t.date).getTime()-new Date(e.date).getTime())),a.slice(0,3)),tb=e=>{var t;return!("completed"!==e.status||ti(e)||tl(e)||(null===(t=e.reportType)||void 0===t?void 0:t.toLowerCase().startsWith("idea-")))&&"business"===tt(e.companyId)},tw=(null!=ee?ee:[]).filter(tb).length>=3,tj=(()=>{if(!tw)return[];let e=(null!=ee?ee:[]).filter(tb).sort((e,t)=>new Date(t.date).getTime()-new Date(e.date).getTime()).map(e=>{var t,a,r,s;let n=null!==(a=null!==(t=eg[e.id])&&void 0!==t?t:e.value)&&void 0!==a?a:0;return{valuationId:e.id,name:e6(e.companyId),dateLabel:new Date(e.date).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),score:null!==(s=null!==(r=ey[e.id])&&void 0!==r?r:e.score)&&void 0!==s?s:0,value:n}}),t=Math.max(...e.map(e=>e.value),1);e.forEach(e=>{e.score<=0&&e.value>0&&(e.score=Math.round(Math.min(100,e.value/t*100)))});let a="score"===eq?e=>e.score>0:e=>e.value>0;return(e=e.filter(a)).sort((e,t)=>"score"===eq?t.score-e.score:t.value-e.value).slice(0,5)})(),tN=tj.length>0&&"valuation"===eq?Math.max(...tj.map(e=>e.value),1):100,tS=tj.length>0&&"valuation"===eq?Math.min(...tj.map(e=>e.value).filter(e=>e>0),tN):0,tk=e=>{if(0===e)return"$0";if(e>=1e12)return"$".concat(Math.round(e/1e12),"T");if(e>=1e9){let t=e/1e9;return t>=10||t%1==0?"$".concat(Math.round(t),"B"):t>=1?"$".concat(t.toFixed(1),"B"):"$".concat(t.toFixed(2),"B")}if(e>=1e6){let t=e/1e6;return t>=10||t%1==0?"$".concat(Math.round(t),"M"):t>=1?"$".concat(t.toFixed(1),"M"):"$".concat(t.toFixed(2),"M")}if(e>=1e3){let t=e/1e3;return t>=10||t%1==0?"$".concat(Math.round(t),"K"):"$".concat(t.toFixed(1),"K")}return"$".concat(Math.round(e))},tI=e=>{if(e<=0)return 100;let t=10**Math.floor(Math.log10(e)),a=e/t;return(a<=1?1:a<=2?2:a<=5?5:10)*t},tC=e=>{if(e<=0)return 1;let t=10**Math.floor(Math.log10(e)),a=e/t;return a<=1?t:a<=2?2*t:a<=5?5*t:10*t},tT=(()=>{let e,t;if("valuation"!==eq||0===tj.length)return null;let a=tS>0?tS:tN/1e6,r=tI(Math.max(tN,1));if(tN/Math.max(a,1)>50){let s=Math.max(1,Math.min(a/10,r/100)),n=Math.log(s),o=Math.log(r)-n;t=e=>e<=0?0:Math.max(3,Math.min(100,Math.max(0,(Math.log(Math.max(e,s))-n)/o*100))),e=[r,Math.exp(n+.75*o),Math.exp(n+.5*o),Math.exp(n+.25*o),0]}else t=e=>e<=0?0:Math.max(3,r>0?Math.min(100,e/r*100):0),e=[r,3/4*r,.5*r,1/4*r,0];return{scaleCeiling:r,tickValues:e,valueToBarPercent:t}})(),tE={"1M":30,"3M":90,"6M":180,"1Y":365},tM=(()=>{let e=new Date;return e.setDate(e.getDate()-tE[eC]),e})(),tF=(()=>{let e=(null!=ee?ee:[]).filter(e=>"completed"===e.status&&new Date(e.date)>=tM).filter(e=>"business"===tt(e.companyId)).sort((e,t)=>
1new Date(e.date).getTime()-new Date(t.date).getTime()),t="1M"===eC?e.slice(-6):e.slice(-24);return t.map((e,a)=>{var r,s,n,o,i,l;let c=new Date(e.date),d=null!==(s=null!==(r=eg[e.id])&&void 0!==r?r:e.value)&&void 0!==s?s:0,u=a>0?null!==(o=null!==(n=eg[t[a-1].id])&&void 0!==n?n:t[a-1].value)&&void 0!==o?o:0:d,m=c.toLocaleDateString("en-US",{month:"short"}),h=c.getMonth();return{valuation:e,value:d,companyName:e6(e.companyId),dateStr:c.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),score:null!==(l=null!==(i=ey[e.id])&&void 0!==i?i:e.score)&&void 0!==l?l:null,percentChange:u>0?(d-u)/u*100:0,monthShort:m,monthIndex:h,dateMs:c.getTime()}})})(),tD=tF.length,tL=eO?4:7,tV=tD>tL,tR="1M"!==eC||tV,tA=(e,t)=>t<=1?50:tV?2+e/(t-1)*96:5+e/(t-1)*90,tP=tF.map((e,t)=>"Val ".concat(String(t+1).padStart(2,"0"))),t_=tF.length?Math.max(...tF.map(e=>e.value),0):0,tO=tF.length>0?(e=>{if(e<=0)return{ceiling:1,tickValues:[0,.25,.5,.75,1],valueToPercent:e=>e<=0?0:Math.min(100,100*e)};let t=tC(e/5),a=Math.ceil(e/t)*t,r=[];for(let e=0;e<=a+1e-9*t;e+=t)r.push(e);return{ceiling:a,tickValues:r,valueToPercent:e=>a>0?Math.min(100,Math.max(0,e/a*100)):0}})(t_):null,tB="1M"!==eC,tU=tB&&tF.length>0?Math.min(...tF.map(e=>e.value).filter(e=>e>0),t_):0,tW=(()=>{let e;if(!tB||0===tF.length)return null;let t=Math.max(t_,1),a=tU>0?tU:t/1e6,r=tI(t),s=Math.max(1e-9,Math.min(a/10,r/100)),n=Math.log(s),o=Math.log(r)-n;e=o<1e-14?e=>50*(e>0):e=>e<=0?0:Math.min(100,Math.max(0,(Math.log(Math.max(e,s))-n)/o*100));let i=o<1e-14?[r,0]:[r,Math.exp(n+.75*o),Math.exp(n+.5*o),Math.exp(n+.25*o),0];return{scaleCeiling:r,tickValues:i,valueToBarPercent:e}})(),t$=tW?{tickValues:tW.tickValues,valueToPercent:tW.valueToBarPercent}:tO?{tickValues:tO.tickValues,valueToPercent:tO.valueToPercent}:null,tJ=eU.w>0?eU.w/400:1,tq=eU.h>0?eU.h/200:1,tz=tJ>0?tq/tJ:1,tY=0===X.length&&0===ee.length&&!er&&en,tG=!ei&&!et&&!!(null==Q?void 0:Q.id)&&"true"===localStorage.getItem((0,N.fG)(Q.id))&&"true"===sessionStorage.getItem(N.ui)&&!tY;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"font-geist [&_*]:font-geist min-w-0 overflow-x-clip space-y-6 rounded-xl p-0 md:p-6 ".concat("cebos"===eu?"bg-[#eff5ff]/90":"bg-blue-50/80"),style:{"--dashboard-primary":em},children:[(0,r.jsx)(J.J,{suppressed:tG||tY}),(0,r.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-4 min-w-0",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("h1",{className:"text-2xl font-geist font-medium text-black ",children:"Dashboard"}),(0,r.jsx)("p",{className:"text-muted-foreground",children:"Welcome back to your valuation dashboard!"})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-3 shrink-0 w-full md:w-auto",children:[(0,r.jsx)(c(),{href:"/quick-peep",children:(0,r.jsxs)(s.Button,{variant:"outline",className:"shadow-sm !bg-white !border hover:!bg-gray-50 text-[var(--dashboard-primary)] border-[#E3E8EF]",onClick:()=>ec("Quick Peep",{location:"dashboard_header"}),children:[(0,r.jsx)(o.A,{className:"mr-2 h-4 w-4 text-inherit"}),"Quick Look"]})}),(0,r.jsx)(d.M,{className:"shadow-sm text-white border-0 text-sm font-normal bg-[var(--dashboard-primary)]",showIcon:!0,fromDashboard:!0,children:"New Valuation"})]})]}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-10 gap-6 md:items-stretch",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-6 min-h-0 md:col-span-7 md:h-full",children:[(0,r.jsx)(n.Zp,{className:"rounded-xl border border-gray-200 bg-white shadow-sm overflow-hidden shrink-0",children:(0,r.jsxs)("div",{className:"flex flex-col md:flex-row md:items-center",children:[(0,r.jsxs)("div",{className:"flex-1 p-4 flex flex-row items-center justify-between gap-3 min-h-0",children:[(0,r.jsxs)("div",{className:"flex flex-col text-left min-w-0",children:[(0,r.jsx)("h3",{className:"text-sm font-medium text-[#030816]",children:"Total Founder Valuation"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:et?(0,r.jsx)(w.E,{className:"h-4 w-28 inline-block"}):"Across ".concat(ts.length," Profiles")})]}),(0,r.jsx)("span",{className:"text-xl md:text-2xl font-semibold text-gray-900 shrink-0",children:et?(0,r.jsx)(w.E,{className:"h-8 w-10 inline-block"}
1):e8(tc.length)})]}),(0,r.jsx)("div",{className:"hidden md:block w-px h-8 bg-gray-200 flex-shrink-0 self-center"}),(0,r.jsxs)("div",{className:"flex-1 p-4 flex flex-row items-center justify-between gap-3 min-h-0",children:[(0,r.jsxs)("div",{className:"flex flex-col text-left min-w-0",children:[(0,r.jsx)("h3",{className:"text-sm font-medium text-[#030816]",children:"Total Idea valuation"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:et?(0,r.jsx)(w.E,{className:"h-4 w-28 inline-block"}):"Across ".concat(tr.length," Concepts")})]}),(0,r.jsx)("span",{className:"text-xl md:text-2xl font-semibold text-gray-900 shrink-0",children:et?(0,r.jsx)(w.E,{className:"h-8 w-10 inline-block"}):e8(to.length)})]}),(0,r.jsx)("div",{className:"hidden md:block w-px h-8 bg-gray-200 flex-shrink-0 self-center"}),(0,r.jsxs)("div",{className:"flex-1 p-4 flex flex-row items-center justify-between gap-3 min-h-0",children:[(0,r.jsxs)("div",{className:"flex flex-col text-left min-w-0",children:[(0,r.jsx)("h3",{className:"text-sm font-medium text-[#030816]",children:"Total Business Valuation"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:et?(0,r.jsx)(w.E,{className:"h-4 w-28 inline-block"}):"Across ".concat(ta.length," Companies")})]}),(0,r.jsx)("span",{className:"text-xl md:text-2xl font-semibold text-gray-900 shrink-0",children:et?(0,r.jsx)(w.E,{className:"h-8 w-10 inline-block"}):e8(tn.length)})]})]})}),(0,r.jsxs)(n.Zp,{className:"rounded-xl border border-gray-200 bg-white shadow-sm overflow-hidden flex flex-col flex-1 min-h-[320px]",children:[(0,r.jsx)(n.aR,{className:"pb-5 flex-shrink-0",children:(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start sm:justify-between gap-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(n.ZB,{className:"sm:text-sm text-[13px] font-medium text-[#030816]",children:"Valuation Performance Over Time"}),(0,r.jsx)(n.BT,{className:"text-[#677489] sm:text-[13px] text-xs mt-0.5",children:"Track how your latest business valuations are evolving"})]}),(0,r.jsx)("div",{className:"flex justify-center sm:justify-end",children:(0,r.jsx)("div",{className:"flex rounded-sm overflow-hidden border border-gray-200 shrink-0 shadow-sm",children:["1M","3M","6M","1Y"].map((e,t)=>(0,r.jsx)("button",{type:"button",onClick:()=>eT(e),className:"min-w-[2.75rem] px-3 py-2 text-xs font-medium transition-colors md:min-w-[3.5rem] md:px-4 md:text-sm ".concat(0===t?"rounded-l-lg":""," ").concat(3===t?"rounded-r-lg":""," ").concat(eC===e?"text-white bg-[var(--dashboard-primary)]":"bg-white text-gray-700 hover:bg-gray-50 border-0"),children:e},e))})})]})}),(0,r.jsx)(n.Wu,{className:"flex flex-1 flex-col min-h-0 pb-6",children:0===tF.length?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-6 min-h-[220px] flex-1",children:[(0,r.jsx)("img",{src:"/assets/no-data.svg",alt:"",className:"h-17 w-17 sm:w-32 sm:h-20 object-contain mb-3 text-gray-300"}),(0,r.jsx)("p",{className:"font-semibold text-gray-900 mb-1",children:"No business valuation data available"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 text-center",children:"Perform a valuation to see the performance trend"})]}):(0,r.jsxs)("div",{ref:eA,className:"relative min-h-[220px] flex-1 overflow-hidden rounded-lg bg-gradient-to-b from-white to-[#F9F9FF]",children:[(0,r.jsxs)("div",{className:tR||tV?"flex w-full min-w-0":"",children:[(0,r.jsx)("div",{className:tR||tV?"shrink-0 w-9 h-[180px] text-left text-[10px] text-gray-500 font-medium md:w-12 md:text-xs relative":"absolute left-0 top-0 w-9 h-[180px] text-left text-[10px] text-gray-500 font-medium md:w-12 md:text-xs",children:null==t$?void 0:t$.tickValues.map((e,t)=>{let a=t$.valueToPercent(e);return(0,r.jsx)("span",{className:"absolute left-0 whitespace-nowrap -translate-y-1/2",style:{top:"".concat(15+(1-a/100)*170,"px")},children:tk(e)},"perf-tick-".concat(t,"-").concat(e))})}),(0,r.jsx)("div",{ref:eV,className:tR||tV?"performance-chart-scroll overflow-x-auto overflow-y-visible flex-1 min-w-0":"",children:(0,r.jsxs)("div",{className:tR||tV?"relative w-full min-w-0 pb-2 pl-0 pr-10":"relative w-full min-w-0 pb-2 pl-9 md:pl-12",style:tR||tV?{minWidth:tD>tL?"".concat(tD/tL*100,"%"):"100%"}:void 0,children:[(0,r.jsx)("div",{className:"relative h-[180px] w-full",children:(0,r.jsxs)("svg",{ref:eR,className:"dashboard-performance-chart w-full h-full block",viewBox:"0 0 400 200",preserveAspectRatio:"none",children:[(0,r.jsx)("defs",{children:(0,r.jsxs)("linearGradient",{id:"chartAreaGradient",x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[(0,r.jsx)("stop",{offset:"0%",stopColor:"#FFFFFF"}),(0,r.jsx)("stop",{offset:"100%",stopColor:"#F9F9FF"})]})}),(0,r.jsx)("rect",{width:400,height:200,fill:"url(#chartAreaGradient)"}),null==t$?void 0:t$.tickValues.map((e,t)=>{let a=185-t$.valueToPercent(e)/100*170;return(0,r.jsx)("line",{x1:0,y1:a,x2:400,y2:a,stroke:"#e5e7eb",strokeWidth:1,strokeDasharray:"4 4"},"perf-grid-".concat(t,"-").concat(e))}),tF.length>0&&(()=>{let e=tF.length,t=t=>tA(t,e)/100*400,a=e=>t$?185-t$.valueToPercent(e)/100*170:185,s=tF.map((e,r)=>({x:t(r),y:a(e.value)})),n=(()=>
1{if(1===e){let e=a(0);return"M 0 ".concat(e," L ").concat(s[0].x," ").concat(s[0].y)}if(2===e)return"M ".concat(s[0].x," ").concat(s[0].y," L ").concat(s[1].x," ").concat(s[1].y);let t="M ".concat(s[0].x," ").concat(s[0].y);for(let e=0;e<s.length-1;e++){let a=s[Math.max(0,e-1)],r=s[e],n=s[e+1],o=s[Math.min(s.length-1,e+2)],i=r.x+(n.x-a.x)/6,l=r.y+(n.y-a.y)/6,c=n.x-(o.x-r.x)/6,d=n.y-(o.y-r.y)/6;t+=" C ".concat(i," ").concat(l," ").concat(c," ").concat(d," ").concat(n.x," ").concat(n.y)}return t})();return(0,r.jsxs)(r.Fragment,{children:[n&&(0,r.jsx)("path",{d:n,fill:"none",stroke:eh,strokeWidth:2.5,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"}),tF.map((e,s)=>{let n=t(s),o=a(e.value),i=eF===s;return(0,r.jsx)("g",{children:(0,r.jsx)("g",{transform:"translate(".concat(n,", ").concat(o,")"),children:(0,r.jsx)("g",{transform:"scale(".concat(tz,", 1)"),children:(0,r.jsx)("circle",{"data-perf-chart-dot":s,cx:0,cy:0,r:4.5,fill:i?"white":eh,stroke:eh,strokeWidth:1.5*!!i,vectorEffect:"non-scaling-stroke",onMouseEnter:()=>{eL.current&&(clearTimeout(eL.current),eL.current=null),eD(s)},onMouseLeave:()=>{eL.current=setTimeout(()=>{eD(null),e_(null)},150)},className:"cursor-pointer"})})})},e.valuation.id)})]})})()]})}),(0,r.jsx)("div",{className:"relative min-h-[2.25rem] w-full pt-1",children:tP.map((e,t)=>{let a=tP.length;return(0,r.jsx)("span",{className:"absolute bottom-0 text-[10px] text-gray-500 font-medium -translate-x-1/2 whitespace-nowrap md:text-xs",style:{left:"".concat(tA(t,a),"%")},children:e},"".concat(e,"-").concat(t))})})]})})]}),eP&&null!==eF&&tF[eF]&&(0,r.jsx)(H,{anchor:eP.anchor,bounds:eP.bounds,data:{companyName:tF[eF].companyName,dateStr:tF[eF].dateStr,value:tF[eF].value,score:tF[eF].score,percentChange:tF[eF].percentChange},formatCurrencyCompact:e=>{if(0===e)return"$ 0";if(e>=1e12){let t=e/1e12;return t>=10||t%1==0?"$ ".concat(Math.round(t),"T"):"$ ".concat(t.toFixed(2),"T")}if(e>=1e9){let t=e/1e9;return t>=10||t%1==0?"$ ".concat(Math.round(t),"B"):"$ ".concat(t.toFixed(2),"B")}if(e>=1e6){let t=e/1e6;return t>=10||t%1==0?"$ ".concat(Math.round(t),"M"):"$ ".concat(t.toFixed(2),"M")}if(e>=1e3){let t=e/1e3;return t>=10||t%1==0?"$ ".concat(Math.round(t),"K"):"$ ".concat(t.toFixed(2),"K")}return e9(e)},onPointerEnter:()=>{eL.current&&(clearTimeout(eL.current),eL.current=null)},onPointerLeave:()=>{eD(null),e_(null)}})]})})]})]}),(0,r.jsxs)(n.Zp,{className:"rounded-xl border border-gray-200 bg-white shadow-sm overflow-hidden md:col-span-3 md:self-stretch flex flex-col",children:[(0,r.jsxs)(n.aR,{className:"pb-2 flex-shrink-0 space-y-0",children:[(0,r.jsx)(n.ZB,{className:"sm:text-sm text-[13px] font-medium text-[#030816]",children:"In-Progress Valuations"}),(0,r.jsx)(n.BT,{className:"text-[#677489] sm:text-[13px] text-xs mt-0",children:"Track your valuations currently awaiting completion."})]}),(0,r.jsx)(n.Wu,{className:"pt-0 mt-5",children:tf.length>0?(0,r.jsx)("div",{className:"space-y-4",children:tf.map(e=>{var t,a;if("career_draft"===e.kind){let a=e.data,s=(null===(t=a.profileName)||void 0===t?void 0:t.trim())?(0,M.qE)({status:"in_progress",companyType:"career"},a.profileName):M.Um.career,n=tv(a.createdAt),o=(0,z.Y1)(a.step);return(0,r.jsxs)("div",{role:"button",tabIndex:0,className:"rounded-xl border border-gray-200 bg-white px-4 py-5 min-h-[100px] shadow-sm hover:bg-gray-50/80 transition-colors cursor-pointer text-left",onClick:()=>void e3(a),onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),e3(a))},children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-4",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"font-medium text-gray-900 truncate text-sm",children:s}),(0,r.jsxs)("p",{className:"text-xs text-gray-500 truncate mt-0.5",children:["Career ⢠",n]})]}),(0,r.jsxs)("span",{className:"font-semibold text-gray-900 text-sm shrink-0",children:[o,"%"]})]}),(0,r.jsx)("div",{className:"h-1.5 w-full rounded-full bg-gray-200 overflow-hidden",children:(0,r.jsx)("div",{className:"h-full rounded-full transition-all duration-300 bg-[var(--dashboard-primary)]",style:{width:"".concat(o,"%")}})})]},"draft-".concat(a.id))}let s=e.data,n=tg(s),o=tx(s),i=tv(s.updatedAt||s.date),l=null!==(a=eE[s.id])&&void 0!==a?a:0;return(0,r.jsxs)("div",{role:"button",tabIndex:0,className:"rounded-xl border border-gray-200 bg-white px-4 py-5 min-h-[100px] shadow-sm hover:bg-gray-50/80 transition-colors cursor-pointer text-left",onClick:()=>te(s),onKeyDown:e=>
1{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),te(s))},children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-4",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("p",{className:"font-medium text-gray-900 truncate text-sm",children:n}),(0,r.jsxs)("p",{className:"text-xs text-gray-500 truncate mt-0.5",children:[o," ⢠",i]})]}),(0,r.jsxs)("span",{className:"font-semibold text-gray-900 text-sm shrink-0",children:[l,"%"]})]}),(0,r.jsx)("div",{className:"h-1.5 w-full rounded-full bg-gray-200 overflow-hidden",children:(0,r.jsx)("div",{className:"h-full rounded-full transition-all duration-300 bg-[var(--dashboard-primary)]",style:{width:"".concat(l,"%")}})})]},s.id)})}):(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-8 md:py-10 flex-1 min-h-[200px]",children:[(0,r.jsx)("img",{src:"/assets/no-valuation.svg",alt:"",className:"h-12 w-12 md:h-16 md:w-16 object-contain mb-3"}),(0,r.jsx)("p",{className:"font-semibold text-gray-900 mb-1 text-center",children:"No valuations in progress"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 text-center",children:"You don't have any ongoing valuations right now."})]})})]})]}),(0,r.jsxs)("div",{className:"grid gap-6 ".concat(tw?"md:grid-cols-5":"md:grid-cols-2"),children:[(0,r.jsxs)(n.Zp,{className:tw?"md:col-span-2 dashboard-card":"md:col-span-1 dashboard-card",children:[(0,r.jsx)(n.aR,{children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(n.ZB,{className:"sm:text-sm text-[13px] font-medium text-[#030816]",children:"Recent Valuations"}),(0,r.jsx)(n.BT,{className:"text-[#677489] sm:text-[13px] text-xs mt-0.5",children:"Your most recent valuations"})]}),(0,r.jsxs)(u.l6,{value:ek,onValueChange:e=>eI(e),children:[(0,r.jsx)(u.bq,{className:"w-full sm:w-[180px] font-normal",children:(0,r.jsx)(u.yv,{placeholder:"Career"})}),(0,r.jsx)(u.gC,{className:"min-w-[200px]",children:["career","founder","idea","market_readiness","hackathon","business"].map(e=>(0,r.jsx)(u.eb,{value:e,textValue:L.y[e].label,className:"font-normal",hideIndicator:!0,children:(0,r.jsx)(D.u,{type:e})},e))})]})]})}),(0,r.jsx)(n.Wu,{children:(0,r.jsxs)("div",{className:"space-y-4 overflow-hidden",children:[et||eN?(0,r.jsx)("div",{className:"space-y-4",children:[,,,].fill(0).map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3 p-2 sm:p-3 rounded-lg overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex-1 min-w-0 overflow-hidden",children:[(0,r.jsx)(w.E,{className:"h-3 sm:h-4 w-24 sm:w-32 mb-1"}),(0,r.jsx)(w.E,{className:"h-3 w-20 sm:w-24"})]}),(0,r.jsx)("div",{className:"text-right flex-shrink-0 min-w-0 max-w-[120px] sm:max-w-none",children:(0,r.jsx)(w.E,{className:"h-3 sm:h-4 w-16 sm:w-20"})})]},t))}):ty.length>0?ty.map(e=>{var t,a,s;let n=ew[e.id],o="founder"===ek?"".concat((0,N.F5)(null!==(t=ey[e.id])&&void 0!==t?t:0),"/100"):"market_readiness"===ek?null!=n?"".concat((0,N.F5)(n),"%"):"â":e7(eg[e.id]||e.value||0),i="founder"===ek?o:"market_readiness"===ek?o:e9(null!==(s=null!==(a=eg[e.id])&&void 0!==a?a:e.value)&&void 0!==s?s:0);return(0,r.jsxs)("div",{className:"flex items-center gap-2 sm:gap-3 p-2 sm:p-3 rounded-lg hover:bg-accent transition-colors cursor-pointer overflow-hidden",onClick:()=>te(e),children:[(0,r.jsxs)("div",{className:"flex-1 min-w-0 overflow-hidden",children:[(0,r.jsx)("p",{className:"font-normal truncate text-xs sm:text-sm",children:tg(e)}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:new Date(e.date).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})})]}),(0,r.jsxs)("div",{className:"text-right flex-shrink-0 min-w-0 max-w-[120px] sm:max-w-none flex flex-col items-end",children:[(0,r.jsx)("p",{className:"font-normal text-xs sm:text-sm truncate",title:i,children:o}),"market_readiness"===ek&&(0,r.jsx)("p",{className:"text-xs text-muted-foreground truncate",children:"Market demand"})]})]},e.id)}):(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-10 min-h-[180px]",children:[(0,r.jsx)("img",{src:"/assets/no-valuation.svg",alt:"",className:"h-12 w-12 sm:h-16 sm:w-16 object-contain mb-3"}),(0,r.jsx)("p",{className:"font-semibold text-gray-900 mb-1",children:"No completed valuations yet"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 mb-6 text-center",children:"Start a valuation to view completed results"}),(0,r.jsx)(d.M,{className:"bg-blue-600 hover:bg-blue-700 text-white shadow-sm rounded-md",showIcon:!0,activeType:"career"===ek?"career":"founder"===ek?"founder":"idea"===ek?"idea":"market_readiness"===ek?"market_readiness":"hackathon"===ek?"hackathon":"company",fromDashboard:!0,children:"Create New Valuation"})]}),!et&&!eN&&ty.length>0&&(0,r.jsx)("div",{className:"pt-2",children:(0,r.jsx)(c(),{href:"/dashboard/valuations",onClick:()=>{sessionStorage.setItem("valuationSelectionReturnTabType","business"===ek?"company":"career"===ek?"career":"founder"===ek?"founder":"market_readiness"===ek?"market_readiness":"hackathon"===ek?"hackathon":"idea")},children:(0,r.jsx)(s.Button,{variant:"outline",className:"w-full",children:"View all valuations"})})})]})})]}),tw?(0,r.jsxs)(n.Zp,{className:"md:col-span-3 dashboard-card",children:[(0,r.jsx)(n.aR,{children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)(n.ZB,{className:"sm:text-sm text-[13px] font-medium text-[#030816]",children:"Company Overview"}),(0,r.jsx)(n.BT,{className:"text-[#677489] sm:text-[13px] text-xs",children:"score"===eq?"Comparison of business scores across your companies.":"Comparison of business valuation across your companies."})]}),(0,r.jsxs)(q.rI,{children:[(0,r.jsx)(q.ty,{asChild:!0,children:(0,r.jsxs)(s.Button,{variant:"outline",className:"sm:font-sm text-xs h-[40px] gap-2 focus-visible:ring-0 focus-visible:ring-offset-0",children:["score"===eq?"Score":"Valuation",(0,r.jsx)(i.A,{className:"h-4 w-4 shrink-0"})]})}),(0,r.jsxs)(q.SQ,{align:"end",children:[(0,r.jsx)(q._2,{onClick:()=>ez("score"),className:"score"===eq?"bg-accent":"",children:"Score"}),(0,r.jsx)(q._2,{onClick:()=>ez("valuation"),className:"valuation"===eq?"bg-accent":"",children:"Valuation"})]})]})]})}),(0,r.jsx)(n.Wu,{className:"pt-4 pb-4 bg-gradient-to-b from-white to-[#F9F9FF] rounded-b-xl",children:tj.length>0?(0,r.jsxs)("div",{className:"grid w-full grid-cols-[auto_1fr] grid-rows-[200px_auto] gap-x-2 gap-y-2 items-end mt-4 md:gap-x-3",children:[(0,r.jsxs)("div",{className:"col-span-full rounded-lg flex gap-2 py-2 px-2 items-end bg-gradient-to-b from-white to-[#F9F9FF] md:gap-3 md:px-3 relative",children:["valuation"===eq&&(0,r.jsx)("svg",{className:"absolute inset-0 w-full h-[200px] pointer-events-none",viewBox:"0 0 400 200",preserveAspectRatio:"none","aria-hidden":!0,
1children:[0,25,50,75,100].map(e=>{let t=200-e/100*200;return(0,r.jsx)("line",{x1:0,y1:t,x2:400,y2:t,stroke:"#e5e7eb",strokeWidth:1,strokeDasharray:"4 4"},e)})}),(0,r.jsx)("div",{className:"text-xs text-gray-500 font-medium text-left shrink-0 w-9 h-[200px] md:w-12 ".concat("score"===eq?"flex flex-col justify-between":"relative"),children:"score"===eq?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{children:"100"}),(0,r.jsx)("span",{children:"80"}),(0,r.jsx)("span",{children:"60"}),(0,r.jsx)("span",{children:"40"}),(0,r.jsx)("span",{children:"0"})]}):null!==(t=null==tT?void 0:tT.tickValues.map((e,t)=>{let a=t/(tT.tickValues.length-1)*200,s=tT.tickValues[t];return(0,r.jsx)("span",{className:"absolute left-0 whitespace-nowrap -translate-y-1/2",style:{top:"".concat(a,"px")},children:tk(s)},"valuation-tick-".concat(t))}))&&void 0!==t?t:null}),(0,r.jsxs)("div",{className:"relative flex-1 min-w-0 h-[200px]",children:["score"===eq&&(0,r.jsx)("svg",{className:"absolute inset-0 w-full pointer-events-none",viewBox:"0 0 400 200",preserveAspectRatio:"none",children:[0,40,60,80,100].map(e=>{let t=200-e/100*200;return(0,r.jsx)("line",{x1:0,y1:t,x2:400,y2:t,stroke:"#e5e7eb",strokeWidth:1,strokeDasharray:"4 4"},e)})}),(0,r.jsx)("div",{className:"absolute inset-0 flex items-end justify-between gap-0",ref:eZ,children:tj.map((e,t)=>{var a,s;let n="score"===eq?Math.min(100,Math.max(0,e.score)):null!==(s=null==tT?void 0:null===(a=tT.valueToBarPercent)||void 0===a?void 0:a.call(tT,e.value))&&void 0!==s?s:0;return(0,r.jsxs)("div",{className:"flex-1 flex justify-center h-[200px] relative",onMouseEnter:()=>eG(t),onMouseLeave:()=>eG(null),onClick:()=>eG(eY===t?null:t),onTouchEnd:e=>{e.preventDefault(),eG(t)},role:"button",tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),eG(eY===t?null:t))},children:[eY===t&&(0,r.jsxs)("div",{role:"tooltip",className:"absolute z-30 left-1/2 -translate-x-1/2 bottom-full mb-1.5 w-max min-w-[140px] max-w-[min(260px,calc(100vw-2rem))] rounded-lg border border-gray-200 bg-white px-3 py-2 text-left shadow-[0_3px_20px_0_rgba(0,0,0,0.08)] md:max-w-none",children:[(0,r.jsx)("p",{className:"font-semibold text-gray-900 text-sm truncate max-w-full",children:e.name}),(0,r.jsx)("p",{className:"mt-0.5 whitespace-nowrap text-xs text-gray-500",children:e.dateLabel}),(0,r.jsx)("p",{className:"text-xs text-gray-600 mt-0.5",children:"score"===eq?"".concat(Math.round(e.score),"/100"):e7(e.value)}),(0,r.jsx)("div",{className:"absolute left-1/2 -translate-x-1/2 top-full w-0 h-0 border-l-[6px] border-l-transparent border-r-[6px] border-r-transparent border-t-[6px] border-t-gray-200","aria-hidden":!0}),(0,r.jsx)("div",{className:"absolute left-1/2 -translate-x-1/2 top-full -mt-px w-0 h-0 border-l-[5px] border-l-transparent border-r-[5px] border-r-transparent border-t-[5px] border-t-white","aria-hidden":!0})]}),(0,r.jsxs)("div",{className:"relative rounded-t overflow-hidden flex-shrink-0 w-7 h-[200px] md:w-[36px]",children:[(0,r.jsx)("div",{className:"absolute inset-x-0 bottom-0 rounded-t bg-gray-200 h-[200px] z-0"}),(0,r.jsx)("div",{className:"absolute inset-x-0 bottom-0 rounded-t transition-all duration-300 z-[1]",style:{height:"".concat(Math.max(n/100*200,0),"px"),backgroundColor:ef}})]})]},e.valuationId)})})]})]}),(0,r.jsxs)("div",{className:"col-span-full flex gap-2 min-w-0 md:gap-3",children:[(0,r.jsx)("div",{className:"shrink-0 w-9 md:w-12","aria-hidden":!0}),(0,r.jsx)("div",{className:"flex-1 flex justify-between gap-0 min-w-0",children:tj.map(e=>(0,r.jsx)("div",{className:"flex-1 flex flex-col items-center justify-start min-w-0 px-0 md:px-0.5",children:(0,r.jsx)("span",{className:"text-[10px] text-gray-600 font-medium text-center break-words leading-tight w-full md:text-xs",children:(0,r.jsx)("span",{className:"block truncate",children:e.name})})},e.valuationId))})]})]}):(0,r.jsx)("div",{className:"flex flex-col items-center justify-center py-6 min-h-[120px] text-center",children:(0,r.jsx)("p",{className:"text-[#677489] sm:text-[13px] text-xs",children:"No business scores to compare yet."})})})]}):(0,r.jsxs)(n.Zp,{className:"md:col-span-1",children:[(0,r.jsxs)(n.aR,{children:[(0,r.jsx)(n.ZB,{className:"text-sm sm:text-base font-semibold",children:"What Would You Like to do Today?"}),(0,r.jsx)(n.BT,{children:"Evaluate your path with clarity and explore actionable growth insights."})]}),(0,r.jsx)(n.Wu,{children:(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("div",{onClick:async()=>{ec("Founder Valuation",{location:"dashboard_card"});let e=()=>{if(sessionStorage.setItem("fromDashboard","true"),sessionStorage.setItem("fromValuationSelection","true"),sessionStorage.setItem("fromNewValuation","true"),0===ts.length){l.push("/founder-valuation?fromNewValuation=true&fromDashboard=true");return}l.push("/dashboard/valuations/new/select-company?type=founder")};if("true"===localStorage.getItem(Z)){e();return}if(localStorage.getItem("token"))try{if(!(await $.n.getStatus()).needsAcknowledgment){localStorage.setItem(Z,"true"),e();return}}catch(e){}
1e0.current=e,eX(!0)},className:"p-4 rounded-xl cursor-pointer transition-all duration-200 border-2 border-gray-200 hover:bg-gray-50",onMouseEnter:e=>{e.currentTarget.style.borderColor=em,e.currentTarget.style.borderWidth="2px"},onMouseLeave:e=>{e.currentTarget.style.borderColor="rgb(229, 231, 235)",e.currentTarget.style.borderWidth="2px"},children:(0,r.jsxs)("div",{className:"flex items-center md:items-start gap-4",children:[(0,r.jsx)("div",{className:"flex-shrink-0 flex items-center justify-center",children:(0,r.jsx)("img",{src:"cebos"===eu?"/assets/career-valuation-cebos1.svg":"/assets/career-valuation1.svg",alt:"Founder Valuation",className:"w-10 h-10"})}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-gray-900 mb-1",children:"Founder Valuation"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Evaluate your founder potential and core career strengths."})]})]})}),(0,r.jsx)("div",{onClick:async()=>{ec("Idea Valuation",{location:"dashboard_card"});let e=()=>{if(sessionStorage.setItem("fromDashboard","true"),0===tr.length){l.push("/valuate-idea?fromNewValuation=true&fromDashboard=true");return}l.push("/dashboard/valuations/new/select-company?type=idea")};if("true"===localStorage.getItem(Z)){e();return}if(localStorage.getItem("token"))try{if(!(await $.n.getStatus()).needsAcknowledgment){localStorage.setItem(Z,"true"),e();return}}catch(e){}e0.current=e,eX(!0)},className:"p-4 rounded-xl cursor-pointer transition-all duration-200 border-2 border-gray-200 hover:bg-gray-50",onMouseEnter:e=>{e.currentTarget.style.borderColor=em,e.currentTarget.style.borderWidth="2px"},onMouseLeave:e=>{e.currentTarget.style.borderColor="rgb(229, 231, 235)",e.currentTarget.style.borderWidth="2px"},children:(0,r.jsxs)("div",{className:"flex items-center md:items-start gap-4",children:[(0,r.jsx)("div",{className:"flex-shrink-0 flex items-center justify-center",children:(0,r.jsx)("img",{src:"cebos"===eu?"/assets/idea-valuation-cebos1.svg":"/assets/idea-valuation1.svg",alt:"Idea Valuation",className:"w-10 h-10"})}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-gray-900 mb-1",children:"Idea Valuation"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Lets you validate and measure the potential of your startup concept."})]})]})}),(0,r.jsx)("div",{onClick:async()=>{ec("Business Valuation",{location:"dashboard_card"});let e=()=>{if(sessionStorage.setItem("fromDashboard","true"),0===ta.length){(0,A.H3)().then(e=>l.push(e)).catch(e=>console.error("Failed to start business information flow:",e));return}l.push("/dashboard/valuations/new/select-company")};if("true"===localStorage.getItem(Z)){e();return}if(localStorage.getItem("token"))try{if(!(await $.n.getStatus()).needsAcknowledgment){localStorage.setItem(Z,"true"),e();return}}catch(e){}e0.current=e,eX(!0)},className:"p-4 rounded-xl cursor-pointer transition-all duration-200 border-2 border-gray-200 hover:bg-gray-50",onMouseEnter:e=>{e.currentTarget.style.borderColor=em,e.currentTarget.style.borderWidth="2px"},onMouseLeave:e=>{e.currentTarget.style.borderColor="rgb(229, 231, 235)",e.currentTarget.style.borderWidth="2px"},children:(0,r.jsxs)("div",{className:"flex items-center md:items-start gap-4",children:[(0,r.jsx)("div",{className:"flex-shrink-0 flex items-center justify-center",children:(0,r.jsx)("img",{src:"cebos"===eu?"/assets/business-valuation-cebos.svg":"/assets/business-valuation.svg",alt:"Business Valuation",className:"w-10 h-10"})}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-gray-900 mb-1",children:"Business Valuation"}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Business valuation helps you understand the true worth of your company."})]})]})})]})})]})]}),(0,r.jsx)(W.w,{open:eK,onOpenChange:eX,forceShow:!0,onAccept:()=>{var e;localStorage.setItem(Z,"true"),null===(e=e0.current)||void 0===e||e.call(e0),e0.current=null,eX(!1)}})]}),tG&&(null==Q?void 0:Q.id)?(0,r.jsx)(B.j,{userId:Q.id,userCredits:Q.credits,onClose:()=>{el(!0),Q.id&&eo("true"===localStorage.getItem((0,N.fG)(Q.id)))}}):null]})}function K(){return(0,r.jsx)(m.Suspense,{fallback:(0,r.jsx)("div",{className:"container py-6 font-geist [&_*]:font-geist",children:(0,r.jsx)("p",{className:"text-center",children:"Loading..."})}),children:(0,r.jsx)(Q,{})})}},89185:(e,t,a)=>{"use strict";a.d(t,{A:()=>r});let r=(0,a(41037).A)("upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]])},93627:(e,t,a)=>{"use strict";a.d(t,{$v:()=>p,EO:()=>u,Lt:()=>l,Rx:()=>x,Zr:()=>g,ck:()=>h,r7:()=>f,wd:()=>m});var r=a(4118),s=a(78870),n=a(26871),o=a(61363),i=a(34916);let l=n.bL;n.l9;let c=n.ZL,d=s.forwardRef((e,t)=>
1{let{className:a,...s}=e;return(0,r.jsx)(n.hJ,{className:(0,o.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...s,ref:t})});d.displayName=n.hJ.displayName;let u=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsxs)(c,{children:[(0,r.jsx)(d,{}),(0,r.jsx)(n.UC,{ref:t,className:(0,o.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background px-8 py-6 sm:p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-[10px] sm:rounded-lg",a),...s})]})});u.displayName=n.UC.displayName;let m=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,o.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...a})};m.displayName="AlertDialogHeader";let h=e=>{let{className:t,...a}=e;return(0,r.jsx)("div",{className:(0,o.cn)("flex flex-row justify-center sm:justify-end space-x-2",t),...a})};h.displayName="AlertDialogFooter";let f=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.hE,{ref:t,className:(0,o.cn)("text-lg font-semibold",a),...s})});f.displayName=n.hE.displayName;let p=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.VY,{ref:t,className:(0,o.cn)("text-sm text-muted-foreground",a),...s})});p.displayName=n.VY.displayName;let x=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.rc,{ref:t,className:(0,o.cn)((0,i.r)(),"mt-[8px] sm:mt-0",a),...s})});x.displayName=n.rc.displayName;let g=s.forwardRef((e,t)=>{let{className:a,...s}=e;return(0,r.jsx)(n.ZD,{ref:t,className:(0,o.cn)((0,i.r)({variant:"outline"}),"mt-2 sm:mt-0",a),...s})});g.displayName=n.ZD.displayName},99849:(e,t,a)=>{"use strict";a.d(t,{ValuationProvider:()=>o,X:()=>i});var r=a(4118),s=a(78870);let n=(0,s.createContext)(void 0);function o(e){let{children:t}=e,[a,o]=(0,s.useState)(null),[i,l]=(0,s.useState)({});(0,s.useEffect)(()=>{let e=localStorage.getItem("form-data");e&&l(JSON.parse(e))},[]),(0,s.useEffect)(()=>{localStorage.setItem("form-data",JSON.stringify(i))},[i]);let c=s.useCallback((e,t)=>{l(a=>({...a,[e]:t}))},[]);return(0,r.jsx)(n.Provider,{value:{valuation:a,formData:i,setValuation:o,setFormData:l,updateFormData:c,clearFormData:()=>{l({}),localStorage.removeItem("form-data")}},children:t})}function i(){let e=(0,s.useContext)(n);if(void 0===e)throw Error("useValuation must be used within a ValuationProvider");return e}},99984:(e,t,a)=>{"use strict";function r(e){return Math.round(Math.min(100,Math.max(0,e)))}function s(){let e=Math.floor(31*Math.random())+45;return{score:e,readinessTierLabel:n(e),source:"random"}}function n(e){let t=r(e);return t>=80?"Ready to Attract Investors":t>=65?"Strong Potential Is Emerging":t>=50?"Momentum Is Building":"A Foundation Is Being Built"}function o(e){let t=r(e);return t>=80?{lead:"strong launch readiness",detail:"Your inputs align with patterns seen in products positioned for scalable market entry."}:t>=60?{lead:"solid launch fundamentals",detail:"Refining go-to-market positioning could accelerate early adoption."}:t>=40?{lead:"emerging launch potential",detail:"Strengthening customer validation and go-to-market clarity could lift readiness."}:t>=20?{lead:"early-stage readiness signals",detail:"Clarifying target customers, product stage, and operational basics would strengthen the case."}:{lead:"foundational gaps to address",detail:"Defining the core problem, customer need, and launch path are important next steps."}}a.d(t,{Kk:()=>l,LG:()=>n,LI:()=>s,Y4:()=>d,if:()=>u,o2:()=>h,t3:()=>m,y7:()=>o});let i=o(72),l={productName:"Your product",score:72,readinessTierLabel:n(72),opportunityLead:i.lead,opportunityDetail:i.detail,metrics:{productMarketFit:76,goToMarket:68,operationsReadiness:71,marketDemand:74}},c="growthReadinessPreviewScore:";function d(e,t){if(e)try{sessionStorage.setItem("".concat(c).concat(e),JSON.stringify(t))}catch(e){}}function u(e){if(!e)return null;try{let t=sessionStorage.getItem("".concat(c).concat(e));if(!t)return null;let a=JSON.parse(t);if("number"!=typeof a.score||a.score<=0)return null;let s=r(a.score);return{score:s,readinessTierLabel:n(s)}}catch(e){return null}}function m(e){var t;let a=null==e?void 0:null===(t=e.responses)||void 0===t?void 0:t.marketReadiness,s=null==a?void 0:a.previewScore;if(s&&"number"==typeof s.score&&s.score>0){let e=r(s.score);return{score:e,readinessTierLabel:n(e)}}if("number"==typeof(null==e?void 0:e.score)&&e.score>0){let t=r(e.score);return{score:t,readinessTierLabel:n(t)}}return null}function h(e){let t=new URLSearchParams,a=t=>{if(e instanceof URLSearchParams)return e.get(t);let a=e[t];return null==a?null:String(a)};for(let e of["companyId","valuationId","plan","methods","fromNewValuation","fromSelectMarketReadiness","fromCompanies","fromDashboard","fromResumeMrValuation","fromMrReview"]){var r;let s=null===(r=a(e))||void 0===r?void 0:r.trim();s&&t.set(e,s)}return t}}},e=>{var t=t=>e(e.s=t);e.O(0,[6931,2144,4024,7453,8585,8735,8526,1114,1046,185,1291,7440,8755,1363,8042,5617,3104,2116,7226,2799,7390,7662,2880,4820,9001,9095,6894,1298,1929,7358],()=>t(64421)),_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.