PageSourceSearch

https://ideaevolver.com/assets/QuestionProfile-Doc-p5jl.js

js ideaevolver.com collected 2026-09-24 13:59:17 UTC 10,067 bytes, 1 lines download raw bytes

1import{a as e}from"./rolldown-runtime-BEU_UCik.js";import{r as s}from"./vendor-auth-DAuWozuU.js";import{_ as t,h as a}from"./chunk-62JRHF6Z-D9puh-us.js";import{a as r,n}from"./vendor-query-Ct_3YD9H.js";import{t as o}from"./projectService-D25XshJp.js";import{n as i}from"./ThemeManager-ILkyB1Q0.js";import{t as l}from"./LoadingSkeleton-BqfzfE_a.js";import{t as c}from"./useProject-_1FGJNGu.js";import{_ as d}from"./vendor-charts-CIrZe8F2.js";import{o as F}from"./chartUtils-BgSJGHV9.js";import{t as m}from"./ProjectInfoHeader-ByyklFgd.js";import{t as p}from"./ParticleField-DD4MFwoQ.js";var u=e(d()),f=e(s()),h=r();function x({config:e,theme:s,height:t}){const a=(0,f.useRef)(),{id:r,title:n,subtitle:o,series:i}=e,l={colors:{dark:F("#FFFFFF","#020021",2),light:F("#EA580C","#FED7AA",2)}[s],chart:{id:r,styledMode:!1,backgroundColor:"transparent",height:t||536},title:{text:n,style:{fontFamily:"'Space Grotesk', sans-serif",fontWeight:"600",color:"dark"===s?"#FFFFFF":"#431407"}},subtitle:{text:o,style:{fontFamily:"'Karla', sans-serif",color:"dark"===s?"#FFFFFF99":"#9A3412"}},xAxis:[{title:{text:"Data",style:{fontFamily:"'Karla', sans-serif",color:"dark"===s?"#FFFFFF":"#431407"}},labels:{style:{fontFamily:"'Karla', sans-serif",color:"dark"===s?"#FFFFFF":"#431407"}},alignTicks:!1},{title:{text:"Frequency",style:{fontFamily:"'Karla', sans-serif",color:"dark"===s?"#FFFFFF":"#431407"}},labels:{style:{fontFamily:"'Karla', sans-serif",color:"dark"===s?"#FFFFFF":"#431407"}},alignTicks:!1,opposite:!0}],yAxis:[{title:{text:"Data",style:{fontFamily:"'Karla', sans-serif",color:"dark"===s?"#FFFFFF":"#431407"}},labels:{style:{fontFamily:"'Karla', sans-serif",color:"dark"===s?"#FFFFFF":"#431407"}}},{title:{text:"Frequency",style:{fontFamily:"'Karla', sans-serif",color:"dark"===s?"#FFFFFF":"#431407"}},labels:{style:{fontFamily:"'Karla', sans-serif",color:"dark"===s?"#FFFFFF":"#431407"}},opposite:!0}],plotOptions:{histogram:{color:"dark"===s?"#0561B756":"#EA580C56",accessibility:{point:{valueDescriptionFormat:"{index}. {point.x:.1f} to {point.x2:.1f}, {point.y}."}}},scatter:{marker:{radius:3,symbol:"circle"}}},series:[{name:"Histogram",type:"histogram",xAxis:1,yAxis:1,baseSeries:"s1",zIndex:-1},{name:"Data",type:"scatter",data:i,id:"s1"}],credits:{enabled:!1}};return(0,f.useLayoutEffect)(()=>{const e=u.default.chart(a.current,l);return()=>{e&&"function"==typeof e.destroy&&e.destroy()}},[]),(0,h.jsx)("div",{ref:a})}function j({config:e,theme:s,height:t}){const a=(0,f.useRef)(),{id:r,title:n,subtitle:o,series:i}=e,l=i.map(([e,s])=>e),c=i.map(([e,s])=>s),d={colors:{dark:["#FFFFFF","#FF7347"],light:["#EA580C","#FED7AA"]}[s],chart:{id:r,type:"bar",styledMode:!1,backgroundColor:"transparent",height:t||536},title:{text:n,style:{fontFamily:"'Space Grotesk', sans-serif",fontWeight:"600",color:"dark"===s?"#FFFFFF":"#431407"}},subtitle:{text:o,style:{fontFamily:"'Karla', sans-serif",color:"dark"===s?"#FFFFFF99":"#9A3412"}},xAxis:{categories:l,lineColor:"dark"===s?"#FFFFFF":"#431407",tickColor:"dark"===s?"#FFFFFF":"#431407",gridLineColor:"dark"===s?"#444444":"#e6e6e6",labels:{style:{fontFamily:"'Karla', sans-serif",color:"dark"===s?"#FFFFFF":"#431407",fontSize:"12px",fontWeight:"bold"}},title:{text:null,style:{fontFamily:"'Karla', sans-serif",color:"dark"===s?"#FFFFFF":"#431407"}}},yAxis:{min:0,lineColor:"dark"===s?"#FFFFFF":"#431407",tickColor:"dark"===s?"#FFFFFF":"#431407",gridLineColor:"dark"===s?"#444444":"#e6e6e6",labels:{style:{fontFamily:"'Karla', sans-serif",color:"dark"===s?"#FFFFFF":"#431407",fontSize:"12px"}},title:{text:"People who took the assessment",style:{fontFamily:"'Karla', sans-serif",color:"dark"===s?"#FFFFFF":"#431407",fontWeight:"bold"}}},tooltip:{valueSuffix:" "},plotOptions:{bar:{dataLabels:{enabled:!0,color:"dark"===s?"#FFFFFF":"#431407",style:{fontFamily:"'Space Grotesk', sans-serif",fontSize:"1.25rem",textOutline:"none"}},groupPadding:.1,maxPointWidth:40}},legend:{enabled:!1},series:[{name:"Answered",data:c}],credits:{enabled:!1}};return(0,f.useLayoutEffect)(()=>{const e=u.default.chart(a.current,d);return()=>{e&&"function"==typeof e.destroy&&e.destroy()}},[]),(0,h.jsx)("div",{ref:a})}var y=async({queryKey:e,signal:s})=>{const[,t,a,r]=e,n=await o.getProjectData(t,s);if(!n)throw new Error(`No project data returned for project ${t}`);const{host:i,spec:l,reassessment:c}=n,d=r?c:n,F=d.screenquestions.find(e=>e.screenNumber===Number(a));if(!F)return console.error(`Screen question not found for screen number ${a}`),null;const m=d.screen_components.find(e=>e.screen===F.screen);if(!m)return console.error(`Screen component not found for screen ${F.screen}`),null;const p=Object.values(d.questions).filter(e=>e.Screen===F.screen);
1return 0===p.length?(console.error(`No questions found for screen ${F.screen}`),null):{host:i,spec:l,projectId:t,screen:F,component:m,questions:p}};var g={RadioGroup:j,CheckboxGroup:j,RadioQuestion:j,BPNumbers:x,YesNoButtons:j,SimpleBar:j,Histogram:x},N=(e=0)=>{const s=Math.round(e),t=Math.floor(s/3600),a=Math.floor(s%3600/60),r=s%60,n=e=>String(e).padStart(2,"0");return t>0?`${n(t)}:${n(a)}:${n(r)}`:a>0?`${n(a)}:${n(r)}`:`00:${n(r)}`};function b(){const e=a().questionId,s=a().projectId,[r]=t(),o="true"===r.get("reassessment"),{theme:d}=i(),{project:F}=c(s),{data:u,loading:x,error:j}=function(e,s,t=!1,{enabled:a=!0}={}){const{data:r,error:o,isPending:i,isFetching:l}=n({queryKey:["questionData11",e,s,t],queryFn:y,enabled:!!e&&!!s&&a,staleTime:3e4,gcTime:3e5});return{data:r,loading:i&&!(!e||!a),isFetching:l,error:o??null}}(s,e,o),[b,v]=(0,f.useState)(!0);(0,f.useEffect)(()=>{v(!0)},[e,o]);const q=390,k=844,w=(0,f.useRef)(null),[S,A]=(0,f.useState)(550/k);if((0,f.useLayoutEffect)(()=>{const e=w.current;if(!e)return;const s=e=>{const s=e/q;return Math.max(Math.min(s,550/k),.3)};if(A(s(e.offsetWidth)),"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(([e])=>{A(s(e.contentRect.width))});return t.observe(e),()=>t.disconnect()},[x]),x)return(0,h.jsxs)("div",{className:"page-base question-profile",children:[(0,h.jsx)(m,{className:"mb-4",project:F,showDropdown:!0}),(0,h.jsxs)("div",{className:"qp-hero animate-pulse","aria-busy":"true","aria-live":"polite",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)(l,{className:"h-6 w-40 rounded-lg mb-1.5"}),(0,h.jsx)(l,{className:"h-3.5 w-56 rounded"})]}),(0,h.jsxs)("div",{className:"qp-stats",children:[(0,h.jsx)(l,{className:"h-8 w-28 rounded-lg"}),(0,h.jsx)("span",{className:"qp-stat-divider"}),(0,h.jsx)(l,{className:"h-8 w-24 rounded-lg"}),(0,h.jsx)("span",{className:"qp-stat-divider"}),(0,h.jsx)(l,{className:"h-8 w-24 rounded-lg"})]})]}),(0,h.jsxs)("div",{className:"qp-content-grid",children:[(0,h.jsx)("div",{ref:w,className:"qp-phone-container",children:(0,h.jsx)("div",{className:"relative",style:{width:q*S,height:k*S},children:(0,h.jsx)("div",{className:"absolute top-0 left-1/2",style:{width:q,height:k,transform:`translateX(-50%) scale(${S})`,transformOrigin:"top center"},children:(0,h.jsx)("div",{className:"qp-phone-bezel",children:(0,h.jsx)(p,{className:"w-full h-full",label:"Loading Question"})})})})}),(0,h.jsxs)("div",{className:"qp-chart-panel lg:col-span-2 animate-pulse",children:[(0,h.jsx)(l,{className:"h-5 w-60 rounded mb-2"}),(0,h.jsx)(l,{className:"h-3 w-36 rounded mb-6"}),(0,h.jsx)(l,{className:"h-64 w-full rounded-xl"})]})]})]});if(j)return(0,h.jsxs)("div",{className:"page-base question-profile",children:[(0,h.jsx)(m,{className:"mb-4",project:F,showDropdown:!0}),(0,h.jsx)("div",{className:"p-4",children:(0,h.jsx)("div",{className:"text-red-500 text-center",children:"Error loading question data. Please try again later."})})]});const K={tenant:s,assessment:u.spec,screen:u.component.screen},C=new URL("/screenview",`https://${u.host}`);
1Object.entries(K).forEach(([e,s])=>C.searchParams.set(e,s));const D=C.toString();return(0,h.jsxs)("div",{className:"page-base question-profile",children:[(0,h.jsx)(m,{className:"mb-4",project:F,showDropdown:!0}),(0,h.jsxs)("div",{className:"qp-hero",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("h1",{className:"qp-title",children:u.screen.screenName||u.questions[0]?.Question}),u.screen.screenDescription!==u.screen.screenName&&(0,h.jsx)("p",{className:"qp-title-sub",children:u.screen.screenDescription})]}),(0,h.jsxs)("div",{className:"qp-stats",children:[(0,h.jsxs)("div",{className:"qp-stat qp-animate-in",children:[(0,h.jsx)("span",{className:"qp-stat-label",children:"Type"}),(0,h.jsx)("span",{className:"qp-stat-value",children:[...new Set(u.questions.map(e=>e.Type))].join(", ")})]}),(0,h.jsx)("span",{className:"qp-stat-divider"}),(0,h.jsxs)("div",{className:"qp-stat qp-animate-in",children:[(0,h.jsx)("span",{className:"qp-stat-label",children:"Completions"}),(0,h.jsx)("span",{className:"qp-stat-value",children:u.screen.completed})]}),(0,h.jsx)("span",{className:"qp-stat-divider"}),(0,h.jsxs)("div",{className:"qp-stat qp-animate-in",children:[(0,h.jsx)("span",{className:"qp-stat-label",children:"Avg. Time"}),(0,h.jsx)("span",{className:"qp-stat-value",children:N(u.screen.screentime)})]})]})]}),(0,h.jsxs)("div",{className:"qp-content-grid",children:[(0,h.jsx)("div",{ref:w,className:"qp-phone-container",children:(0,h.jsx)("div",{className:"relative",style:{width:q*S,height:k*S},children:(0,h.jsx)("div",{className:"absolute top-0 left-1/2",style:{width:q,height:k,transform:`translateX(-50%) scale(${S})`,transformOrigin:"top center"},children:(0,h.jsxs)("div",{className:"qp-phone-bezel",children:[b&&(0,h.jsx)("div",{className:"absolute inset-0 z-10",children:(0,h.jsx)(p,{className:"w-full h-full",label:"Loading Question"})}),(0,h.jsx)("iframe",{className:"w-full h-full border-0 transition-opacity duration-500",style:{opacity:b?0:1},title:"Question preview",src:D,onLoad:()=>v(!1)},D)]})})})}),(0,h.jsx)("div",{className:"qp-chart-panel",children:u.component.questions.map(e=>{const s=g[e.type],t=u.component.questions.length<=2?554/u.component.questions.length:554;return(0,h.jsx)(s,{config:e,theme:d,height:t},e.id)})},d)]})]})}export{g as Components,N as calculateCompletionTime,b as default};

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.