PageSourceSearch

https://thescope360.web.app/static/js/3627.8fda4d59.chunk.js

js thescope360.web.app collected 2026-10-03 12:40:45 UTC 18,179 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkthescope360_app=self.webpackChunkthescope360_app||[]).push([[3627],{10506(e,t,s){s.d(t,{A:()=>n});s(65043);var l=s(45029),a=s(70579);const n=()=>(0,a.jsx)("div",{className:"w-full flex justify-end mb-4",children:(0,a.jsx)(l.N_,{to:"/admin/simulation",className:"inline-flex items-center rounded-full bg-yellow-400 text-slate-900 px-4 py-1.5 text-xs font-semibold shadow-sm hover:bg-yellow-300 transition",children:"\u2190 Back to Simulation Dashboard"})})},53627(e,t,s){s.r(t),s.d(t,{default:()=>h});var l=s(89379),a=s(65043),n=s(67898),i=s(55472),d=s(91729),r=s(10506),o=s(99782),c=s(70579);const x=[...o.jx.legacyAdminEmails,o.jx.contactEmail],m=new Set(["projectName","shortName","status","totalBudget","baseCurrency","timeline","budget","resources","metrics","createdAt","updatedAt"]);function u(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(!e)return"";return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_\-]+/g," ").split(" ").filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function h(){var e,t,s,o,h,j,f,v;const[g,N]=(0,a.useState)(null),[y,w]=(0,a.useState)(null),[S,A]=(0,a.useState)(!0),[P,D]=(0,a.useState)([]),[M,k]=(0,a.useState)(""),[E,_]=(0,a.useState)(null),[B,O]=(0,a.useState)(""),[T,C]=(0,a.useState)(!1),[I,L]=(0,a.useState)(!1),[G,F]=(0,a.useState)("");(0,a.useEffect)(()=>{const e=(0,n.hg)(d.auth,async e=>{if(N(e||null),A(!1),e)try{const t=(0,i.doc)(d.db,"users",e.uid),s=await(0,i.getDoc)(t);s.exists()?w(s.data()||null):w(null)}catch(t){console.error("Error loading user profile:",t),w(null)}else w(null)});return()=>e()},[]);const $=(0,a.useMemo)(()=>g&&x.includes(g.email),[g]),R=(null===y||void 0===y?void 0:y.fullName)||(null===g||void 0===g?void 0:g.displayName)||(null===g||void 0===g?void 0:g.email)||"Simulation Project Manager";(0,a.useEffect)(()=>{if(!$)return;(async()=>{C(!0),F("");try{const e=(await(0,i.GG)((0,i.rJ)(d.db,"simProjects"))).docs.map(e=>({id:e.id,data:e.data()||{}}));D(e),e.length&&!M&&k(e[0].id)}catch(e){console.error("Error loading simProjects:",e),F("Unable to load simulation projects.")}finally{C(!1)}})()},[$]),(0,a.useEffect)(()=>{if(!$||!M)return void _(null);(async()=>{L(!0),F("");try{const e=(0,i.doc)(d.db,"simProjects",M),t=await(0,i.getDoc)(e);if(!t.exists())return F("Selected project not found."),void _(null);const s=t.data()||{};_({id:t.id,data:s})}catch(e){console.error("Error loading project doc:",e),F("There was a problem loading this project."),_(null)}finally{L(!1)}})()},[$,M]);const U=(0,a.useMemo)(()=>{if(null===E||void 0===E||!E.data)return[];const e=E.data;return Object.keys(e).filter(e=>!m.has(e)).sort().map(e=>({id:e,label:u(e)}))},[E]);(0,a.useEffect)(()=>{(U.length&&!B||U.length&&!U.find(e=>e.id===B))&&O(U[0].id)},[U,B]);const J=(null===E||void 0===E||null===(e=E.data)||void 0===e?void 0:e.timeline)||null,z=(null===E||void 0===E||null===(t=E.data)||void 0===t?void 0:t.budget)||null,V=(null===E||void 0===E||null===(s=E.data)||void 0===s?void 0:s.metrics)||null,Z=(0,a.useMemo)(()=>{if(!J||!J.phases||!J.startDate||!J.endDate)return[];const e=new Date(J.startDate),t=new Date(J.endDate)-e||1;return J.phases.map(s=>{const a=new Date(s.startDate),n=new Date(s.endDate),i=a-e,d=Math.max(n-a,1);return(0,l.A)((0,l.A)({},s),{},{offsetPct:Math.max(0,Math.min(100,i/t*100)),widthPct:Math.max(2,Math.min(100,d/t*100))})})},[J]),q=(null===z||void 0===z?void 0:z.total)||(null===z||void 0===z?void 0:z.totalBudget)||0,H=(null===z||void 0===z?void 0:z.spentToDate)||0,K=q>0?Math.round(H/q*100):0,Q=null!==(o=null===V||void 0===V?void 0:V.progressPercent)&&void 0!==o?o:null,W=null!==V&&void 0!==V&&V.expectedROI?Math.round(100*V.expectedROI):null;if(S)return(0,c.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-slate-950 text-slate-100",children:(0,c.jsx)("p",{className:"text-sm",children:"Loading\u2026"})});if(!$)return(0,c.jsxs)("div",{className:"min-h-screen flex flex-col items-center justify-center bg-slate-950 text-slate-100 px-4",children:[(0,c.jsx)("p",{className:"mb-3 text-sm",children:"Access denied. Admins only."}),(0,c.jsx)("p",{className:"text-xs text-slate-400",children:"Sign in with your admin account to view the AI Simulation Sandbox."})]});if(T&&!P.length)return(0,c.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-slate-950 text-slate-100",children:(0,c.jsx)("p",{className:"text-sm",children:"Loading AI Simulation Sandbox\u2026"})});const X=(null===E||void 0===E||null===(h=E.data)||void 0===h?void 0:h.projectName)||(null===E||void 0===E||null===(j=E.data)||void 0===j?void 0:j.shortName)||(null===E||void 0===E?void 0:E.id)||"Simulation Project",Y=(null===E||void 0===E||null===(f=E.data)||void 0===f?void 0:f.status)||"Status not set";return(0,c.jsx)("div",{className:"min-h-screen bg-slate-950 text-slate-50 px-4 py-6",children:(0,c.jsxs)("div",{className:"max-w-7xl mx-auto",children:[(0,c.jsxs)("header",{className:"mb-6",children:[(0,c.jsx)("h1",{className:"text-4xl md:text-5xl font-extrabold text-blue-400",children:"AI Simulation Sandbox"}),(0,c.jsxs)("p",{className:"mt-2 text-xs text-slate-400 max-w-xl",children:["Explore your simulation projects as if you\u2019re inside a live PMO control room\u2014timeline, budget, resources, and documents are all driven directly from your"," ",(0,c.jsx)("span",{className:"font-mono",children:"simProjects"})," collection."]}),(0,c.jsx)(r.A,{}),(0,c.jsxs)("div",{className:"mt-4 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:[(0,c.jsxs)("div",{children:[(0,c.jsxs)("p",{className:"text-sm font-semibold text-yellow-300",children:["Project: ",X]}),(0,c.jsxs)("p",{className:"text-[11px] text-slate-400 mt-1",children:["Project Manager:"," ",(0,c.jsx)("span",{className:"font-medium text-slate-100",children:R})]})]}),(0,c.jsxs)("div",{className:"sm:text-right",children:[(0,c.jsx)("p",{className:"text-[11px] text-slate-400 mb-1",children:"Switch Simulation"}),(0,c.jsx)("select",{value:M,onChange:e=>{k(e.target.value),O("")},className:"w-full sm:w-72 rounded-full bg-slate-900 border border-slate-700 px-3 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-yellow-400",children:P.map(e=>(0,c.jsx)("option",{value:e.id,children:e.data.projectName||e.data.short
1Name||e.id},e.id))})]})]})]}),G&&(0,c.jsx)("div",{className:"mb-4 rounded-lg bg-red-900/40 border border-red-700 px-3 py-2 text-xs text-red-100",children:G}),(0,c.jsxs)("section",{className:"grid gap-4 md:grid-cols-4 mb-6",children:[(0,c.jsx)(b,{label:"Overall Status",value:Y,accent:"bg-yellow-400/20 text-yellow-300 border-yellow-400/60"}),(0,c.jsx)(b,{label:"Delivery Progress",value:null!=Q?"".concat(Q,"% complete"):"Not set",barPct:null!==Q&&void 0!==Q?Q:0}),(0,c.jsx)(b,{label:"Budget Used",value:q?"".concat(K,"% of $").concat((q/1e6).toFixed(1),"M"):"Not set",barPct:K}),(0,c.jsx)(b,{label:"Expected ROI",value:null!=W?"".concat(W,"%"):"Not set"})]}),(0,c.jsxs)("section",{className:"grid gap-6 lg:grid-cols-[1.3fr,1.7fr] mb-6 items-start",children:[(0,c.jsxs)("div",{className:"bg-slate-900/80 border border-slate-800 rounded-2xl p-4",children:[(0,c.jsx)("h2",{className:"text-sm font-semibold text-slate-200 mb-2",children:"Timeline (Gantt Overview)"}),0===Z.length?(0,c.jsxs)("p",{className:"text-xs text-slate-400",children:["Add ",(0,c.jsx)("code",{children:"timeline"})," with phases to this project to see a Gantt-style view."]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)("p",{className:"text-[11px] text-slate-400 mb-3",children:[J.startDate," \u2192 ",J.endDate]}),(0,c.jsx)("div",{className:"relative h-32 bg-slate-950 rounded-xl border border-slate-800 overflow-hidden px-3 py-3",children:Z.map(e=>(0,c.jsx)("div",{className:"absolute top-1/2 -translate-y-1/2 h-6 rounded-full bg-gradient-to-r from-blue-400 to-yellow-400 shadow-[0_0_18px_rgba(59,130,246,0.7)]",style:{left:"".concat(e.offsetPct,"%"),width:"".concat(e.widthPct,"%")},children:(0,c.jsx)("span",{className:"absolute inset-0 flex items-center justify-center text-[10px] font-semibold text-slate-900",children:e.name})},e.id))})]})]}),(0,c.jsxs)("div",{className:"grid gap-4 md:grid-cols-2",children:[(0,c.jsxs)("div",{className:"bg-slate-900/80 border border-slate-800 rounded-2xl p-4",children:[(0,c.jsx)("h2",{className:"text-sm font-semibold text-slate-200 mb-2",children:"Budget Breakdown"}),null!==z&&void 0!==z&&z.categories&&z.categories.length>0?(0,c.jsx)("div",{className:"space-y-2",children:z.categories.map(e=>{const t=e.allocated>0?Math.round(e.spent/e.allocated*100):0;return(0,c.jsxs)("div",{children:[(0,c.jsxs)("div",{className:"flex justify-between text-[11px] mb-1",children:[(0,c.jsx)("span",{className:"text-slate-300",children:e.label}),(0,c.jsxs)("span",{className:"text-slate-400",children:["$",Math.round(e.spent/1e3),"k / $",Math.round(e.allocated/1e3),"k (",t,"%)"]})]}),(0,c.jsx)("div",{className:"h-2 rounded-full bg-slate-800 overflow-hidden",children:(0,c.jsx)("div",{className:"h-full bg-gradient-to-r from-yellow-400 to-blue-400",style:{width:"".concat(Math.min(100,t),"%")}})})]},e.id)})}):(0,c.jsxs)("p",{className:"text-xs text-slate-400",children:["Add a ",(0,c.jsx)("code",{children:"budget.categories"})," array to this project to see allocation by area."]})]}),(0,c.jsxs)("div",{className:"bg-slate-900/80 border border-slate-800 rounded-2xl p-4",children:[(0,c.jsx)("h2",{className:"text-sm font-semibold text-slate-200 mb-2",children:"Burn-down & Value"}),null!==V&&void 0!==V&&V.burnDownPoints&&V.burnDownPoints.length>0?(0,c.jsxs)("div",{className:"mb-3",children:[(0,c.jsx)("p",{className:"text-[11px] text-slate-400 mb-1",children:"Story points per sprint (planned vs actual)"}),(0,c.jsx)("div",{className:"space-y-1",children:V.burnDownPoints.map((e,t)=>{const s=Math.max(e.planned,e.actual,1),l=e.planned/s*100,a=e.actual/s*100;return(0,c.jsxs)("div",{className:"text-[11px] text-slate-300",children:[(0,c.jsxs)("div",{className:"flex justify-between mb-0.5",children:[(0,c.jsx)("span",{children:e.label}),(0,c.jsxs)("span",{className:"text-slate-400",children:[e.actual,"/",e.planned]})]}),(0,c.jsxs)("div",{className:"h-2 rounded-full bg-slate-800 overflow-hidden flex",children:[(0,c.jsx)("div",{className:"h-full bg-blue-500/70",style:{width:"".concat(l,"%")}}),(0,c.jsx)("div",{className:"h-full bg-yellow-400/80",style:{width:"".concat(a,"%")}})]})]},t)})})]}):(0,c.jsxs)("p",{className:"text-[11px] text-slate-400 mb-2",children:["Add ",(0,c.jsx)("code",{children:"metrics.burnDownPoints"})," for burn-down view."]}),(0,c.jsxs)("div",{className:"border-t border-slate-800 pt-2 mt-2 text-[11px] text-slate-300",children:[(0,c.jsxs)("p",{children:["Expected ROI:"," ",(0,c.jsx)("span",{className:"font-semibold text-yellow-300",children:null!=W?"".concat(W,"%"):"N/A"})]}),(null===V||void 0===V?void 0:V.annualBenefit)&&(0,c.jsxs)("p",{className:"mt-1",children:["Est. Annual Benefit: $",V.annualBenefit.toLocaleStr
1ing()]}),(null===V||void 0===V?void 0:V.paybackMonths)&&(0,c.jsxs)("p",{className:"mt-1",children:["Payback Period: ",V.paybackMonths," months"]})]})]})]})]}),(0,c.jsxs)("section",{className:"grid gap-6 lg:grid-cols-[1.1fr,1.9fr] items-start",children:[(0,c.jsxs)("div",{className:"bg-slate-900/80 border border-slate-800 rounded-2xl p-4",children:[(0,c.jsx)("h2",{className:"text-sm font-semibold text-slate-200 mb-3",children:"Project Folders"}),(0,c.jsxs)("p",{className:"text-[11px] text-slate-400 mb-3",children:["Each folder corresponds to a top-level field on this project\u2019s document (excluding core metadata like"," ",(0,c.jsx)("code",{children:"timeline"})," and ",(0,c.jsx)("code",{children:"budget"}),")."]}),0===U.length?(0,c.jsxs)("p",{className:"text-xs text-slate-400",children:["Add additional fields (e.g.,"," ",(0,c.jsx)("code",{children:"documents"}),", ",(0,c.jsx)("code",{children:"risks"}),","," ",(0,c.jsx)("code",{children:"changePlan"}),") to this project in Firestore to see them appear here as folders."]}):(0,c.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:U.map(e=>{const t=e.id===B;return(0,c.jsxs)("button",{type:"button",onClick:()=>O(e.id),className:"group flex flex-col items-center justify-between gap-1 rounded-2xl border px-3 py-3 text-center transition transform "+(t?"border-yellow-400 bg-slate-900 shadow-[0_0_18px_rgba(250,204,21,0.4)] scale-[1.02]":"border-slate-800 bg-slate-950 hover:border-blue-400 hover:shadow-[0_0_14px_rgba(96,165,250,0.5)] hover:scale-[1.01]"),children:[(0,c.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,c.jsx)("div",{className:"text-3xl",children:(0,c.jsx)("span",{className:"inline-block text-yellow-300",children:"\ud83d\udcc1"})}),(0,c.jsx)("p",{className:"text-[11px] font-semibold text-blue-200 leading-snug",children:e.label})]}),(0,c.jsx)("p",{className:"text-[10px] text-slate-500 truncate w-full",children:e.id})]},e.id)})})]}),(0,c.jsxs)("div",{className:"bg-slate-900/80 border border-slate-800 rounded-2xl p-5 relative overflow-hidden",children:[(0,c.jsx)("div",{className:"absolute inset-x-0 top-0 h-[3px] bg-gradient-to-r from-yellow-400 via-blue-400 to-yellow-400 opacity-70"}),(0,c.jsxs)("div",{className:"relative",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"text-[11px] uppercase tracking-wide text-slate-400",children:(null===E||void 0===E||null===(v=E.data)||void 0===v?void 0:v.projectName)||"Simulation Project"}),(0,c.jsx)("h2",{className:"text-lg font-semibold text-blue-300",children:B?u(B):"Select a folder"})]}),I&&(0,c.jsx)("p",{className:"text-[11px] text-slate-400",children:"Refreshing\u2026"})]}),(0,c.jsxs)("div",{className:"bg-slate-950/90 border border-slate-800 rounded-2xl p-4 md:p-6 h-[460px] md:h-[520px] overflow-y-auto shadow-[0_0_30px_rgba(15,23,42,0.9)]",children:[(0,c.jsxs)("div",{className:"flex items-center justify-between mb-4 pb-2 border-b border-slate-800",children:[(0,c.jsxs)("div",{children:[(0,c.jsx)("p",{className:"text-[11px] font-semibold text-yellow-300",children:"TheScope180 Simulation Document"}),(0,c.jsx)("p",{className:"text-[10px] text-slate-400",children:"Auto-rendered from Firestore (read-only view)"})]}),(0,c.jsxs)("p",{className:"text-[10px] text-slate-500 font-mono",children:["ID: ",(null===E||void 0===E?void 0:E.id)||"\u2014"]})]}),B?(e=>{if(null===E||void 0===E||!E.data||!e)return null;const t=E.data[e];return(0,c.jsx)("div",{className:"space-y-4",children:(0,c.jsx)(p,{value:t,depth:0})})})(B):(0,c.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-center",children:[(0,c.jsx)("p",{className:"text-sm text-slate-300 mb-1",children:"Select a folder on the left to open its document."}),(0,c.jsx)("p",{className:"text-[11px] text-slate-500",children:"This panel is styled to match your TheScope180 \u201ctemplate-style\u201d pages."})]})]})]})]})]})]})})}function p(e){let{value:t,depth:s}=e;const l=0===s?"text-sm text-slate-200 leading-relaxed":1===s?"text-[13px] text-slate-200 leading-relaxed":"text-[12px] text-slate-200 leading-relaxed";if(null===t||void 0===t)return(0,c.jsx)("p",{className:"text-xs text-slate-500 italic",children:"No data defined for this section."});const a=typeof t;if("string"===a){const e=t.split(/\n\s*\n/);return(0,c.jsx)(c.Fragment,{children:e.map((e,t)=>(0,c.jsx)("p",{className:l+(t?" mt-3":""),children:e},t))})}if("number"===a||"boolean"===a)return(0,c.jsx)("p",{className:l,children:String(t)});if(Array.isArray(t)){const e=t.every(e=>"string"===typeof e),l=t.every(e=>e&&"object"===typeof e&&!Array.isArray(e));return e?(0,c.jsx)("ul",{className:"list-disc list-inside text-sm text-slate-200 space-y-1",children:t.map((e,t)=>(0,c.jsx)("li",{children:e},t))}):l?(0,c.jsx)("div",{className:"space-y-3",children:t.map((e,t)=>(0,c.jsx)("div",{className:"rounded-xl border border-slate-800 bg-slate-900/70 p-3",children:Object.entries(e).map(e=>{let[t,l]=e;return(0,c.jsxs)("div",{className:"mb-1 last:mb-0",children:[(0,c.jsx)("p",{className:"text-[11px] font-semibold text-blue-300 mb-0.5",children:u(t)}),(0,c.jsx)(p,{value:l,depth:s+1})]},t)})},e.id||t))}):(0,c.jsx)("div",{className:"space-y-2",children:t.map((e,t)=>(0,c.jsx)("div",{children:(0,c.jsx)(p,{value:e,depth:s+1})},t))})}if("object"===a){const e=Object.entries(t);return e.length?(0,c.jsx)("div",{className:"space-y-3",children:e.map(e=>{let[t,l]=e;return(0,c.jsxs)("section",{children:[(0,c.jsx)("h3",{className:"text-sm font-semibold text-blue-300 mb-1",children:u(t)}),(0,c.jsx)(p,{value:l,depth:s+1})]},t)})}):(0,c.jsx)("p",{className:"text-xs text-slate-500 italic",children:"Empty object (no fields)."})}return(0,c.jsx)("pre",{className:"text-[11px] text-slate-200 bg-slate-950/60 border border-slate-800 rounded-lg p-3 overflow-x-auto",children:JSON.stringify(t,null,2)})}function b(e){let{label:t,value:s,barPct:l,accent:a}=e;return(0,c.jsxs)("div",{className:"bg-slate-900/80 border border-slate-800 rounded-2xl p-3 flex flex-col justify-between min-h-[88px]",children:[(0,c.jsx)("p",{className:"text-[11px] text-slate-400 mb-1",children:t}),(0,c.jsx)("div",{className:"flex items-end justify-between gap-2",children:(0,c.jsx)("p",{className:"text-sm font-semibold text-slate-100",children:s})}),"number"===typeof l&&(0,c.jsx)("div",{className:"mt-2 h-1.5 rounded-full bg-slate-800 overflow-hidden",children:(0,c.jsx)("div",{className:"h-full bg-gradient-to-r from-yellow-400 to-blue-400 transition-all",style:{width:"".concat(Math.min(100,Math.max(0,l)),"%")}})}),a&&(0,c.jsx)("span",{className:"mt-2 inline-flex px-2 py-0.5 rounded-full text-[10px] border "+a,children:"Live simulation"})]})}},99782(e,t,s){s.d(t,{Uk:()=>a,jx:()=>l});const l={companyName:"TheScope180, LLC",trademark:"TheScope180\u2122 is a trademark of TheScope180, LLC",entityDescription:"a Georgia limited liability company",address:"8735 Dunwoody Place, Suite 12212, Atlanta, GA 30350",state:"Georgia",contactEmail:"[email protected]
1om",supportEmail:"[email protected]",adminEmail:"[email protected]",legacyAdminEmails:["[email protected]"]},a=!1}}]);
2//# sourceMappingURL=3627.8fda4d59.chunk.js.map

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.