PageSourceSearch

https://app.trypolarbear.com/assets/EssayStatTiles-BMM4sk62.js

js trypolarbear.com collected 2026-10-04 23:26:33 UTC 5,919 bytes, 3 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a1068a-f8e9-7710-af78-d148f9f86368")}catch(e){}}();import{j as e}from"./ui-mYohRvpx.js";import{A as E,a as $,C as A}from"./ChartTip-DfCIMrp9.js";import{c as x}from"./main-BuFXTOj5.js";import{k as D,B as C,X as d,Y as h,l as B,R as T,T as k,m as M}from"./generateCategoricalChart-Bs6_qp4C.js";import{L as R,a as w}from"./LineChart-Dy7qWBS1.js";import"./vendor-WF4PsUl_.js";import"./palette-CqZx71TW.js";import"./supabase-QYtBhu3e.js";import"./tldraw-CnXIE9Mk.js";import"./radix-ByKTZOWt.js";import"./analytics-Cr0S8IWA.js";import"./query-BDyhWc0a.js";import"./router-CHD5ebUU.js";import"./motion-B-fsB7B9.js";import"./forms-C2WokjyS.js";import"./index-BBS2sQcx.js";var K=D({chartName:"BarChart",GraphicalChild:C,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:d},{axisType:"yAxis",AxisComp:h}],formatAxisMap:B});const m="#4F8065",L="#9DBFAC",F="#8B867D",W="bg-[#DFDCD4] dark:bg-[#3A3936]",b="text-[10px] font-medium text-muted-foreground";function j({label:t,value:r,delta:i,meta:l,className:o,children:s}){return e.jsxs("div",{className:x("space-y-2 rounded-xl bg-white p-4 dark:bg-[#383835]",o),children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:t}),e.jsxs("div",{className:"flex items-baseline gap-2",children:[e.jsx("span",{className:"text-xl font-bold text-foreground",children:r}),i&&e.jsx("span",{className:x("text-xs font-semibold",i.good?"text-[#1E4634] dark:text-[#9CC7AF]":"text-[#8A6A1F] dark:text-[#D9BC72]"),children:i.text})]}),s,l&&l.length>0&&e.jsx("dl",{className:"space-y-1 border-t border-border pt-2.5",children:l.map(a=>e.jsxs("div",{className:"flex items-baseline justify-between gap-3",children:[e.jsx("dt",{className:"text-xs text-muted-foreground",children:a.label}),e.jsx("dd",{className:"truncate text-xs font-semibold text-foreground",children:a.value})]},a.label))})]})}function S({note:t}){return e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"flex h-14 items-center",children:e.jsx("div",{className:x("h-[2px] w-full rounded-full",W)})}),e.jsx("p",{className:b,children:t})]})}function y({points:t,area:r=!1,tipLabel:i,formatValue:l,emptyNote:o}){if(t.length<2)return e.jsx(S,{note:o});const s=t.map(p=>p.value),a=Math.min(...s),n=Math.max(...s),c=Math.max((n-a)*.15,.5),v=e.jsx(k,{cursor:{stroke:F,strokeDasharray:"4 4",strokeWidth:1},content:({active:p,payload:u})=>{var g;const f=(g=u==null?void 0:u[0])==null?void 0:g.payload;return!p||!f?null:e.jsx(A,{title:f.label,rows:[{dot:m,text:`${i} ${l(f.value)}`}]})}});return e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-14",role:"img","aria-label":`${i} from ${t[0].label} to ${t[t.length-1].label}`,children:e.jsx(T,{width:"100%",height:"100%",children:r?e.jsxs(E,{data:t,margin:{top:4,right:2,bottom:0,left:2},children:[e.jsx(d,{dataKey:"label",hide:!0}),e.jsx(h,{hide:!0,domain:[a-c,n+c]}),v,e.jsx($,{type:"monotone",dataKey:"value",stroke:m,strokeWidth:2,fill:m,fillOpacity:.12,dot:!1,activeDot:{r:3.5,fill:m,stroke:"#FFFFFF",strokeWidth:2},isAnimationActive:!1})]}):e.jsxs(R,{data:t,margin:{top:4,right:2,bottom:0,left:2},children:[e.jsx(d,{dataKey:"label",hide:!0}),e.jsx(h,{hide:!0,domain:[a-c,n+c]}),v,e.jsx(w,{type:"monotone",dataKey:"value",stroke:m,strokeWidth:2,dot:!1,activeDot:{r:3.5,fill:m,stroke:"#FFFFFF",strokeWidth:2},isAnimationActive:!1})]})})}),e.jsxs("div",{className:x("flex items-baseline justify-between gap-2",b),children:[e.jsx("span",{children:t[0].label}),e.jsx("span",{children:t[t.length-1].label})]})]})}const N=6;function I({values:t,labels:r,emptyNote:i}){const l=t.slice(-N).map((s,a)=>({value:s,label:r.slice(-N)[a]??""}));if(l.length===0)return e.jsx(S,{note:i});const o=l.length-1;return e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("div",{className:"h-14",role:"img","aria-label":`Essays per month from ${l[0].label} to ${l[o].label}`,children:e.jsx(T,{width:"100%",height:"100%",children:e.jsxs(K,{data:l,margin:{top:4,right:2,bottom:0,left:2},children:[e.jsx(d,{dataKey:"label",hide:!0}),e.jsx(h,{hide:!0}),e.jsx(k,{cursor:{fill:F,fillOpacity:.08},content:({active:s,payload:a})=>{var c;const n=(c=a==null?void 0:a[0])==null?void 0:c.payload;return!s||!n?null:e.jsx(A,{title:n.label,rows:[{dot:m,text:`${n.value} ${n.value===1?"essay":"essays"}`}]})}}
1),e.jsx(C,{dataKey:"value",radius:[4,4,0,0],isAnimationActive:!1,children:l.map((s,a)=>e.jsx(M,{fill:a===o?m:L},s.label))})]})})}),e.jsx("div",{className:x("flex justify-between gap-1",b),children:l.map(s=>e.jsx("span",{className:"flex-1 truncate text-center",children:s.label.split(" ")[0]},s.label))})]})}function se({data:t,labels:r,meta:i}){const l=t.cumulative.map((s,a)=>({value:s,label:t.monthLabels[a]??""})),o=t.scoreTrend.map((s,a)=>({value:s,label:t.scoreTrendLabels[a]??""}));return e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.jsx(j,{label:r.total,value:String(t.totalEssays),children:e.jsx(y,{points:l,area:!0,tipLabel:"Total",formatValue:s=>String(s),emptyNote:"Not enough history yet"})}),e.jsx(j,{label:r.average,value:`${t.averageScore}/10`,delta:t.improvement!==0?{text:`${t.improvement>0?"+":""}${t.improvement}`,good:t.improvement>0}:void 0,meta:[{label:r.best,value:`${t.bestScore}/10`}],children:e.jsx(y,{points:o,tipLabel:"Score",formatValue:s=>`${s}/10`,emptyNote:"Needs two marked essays"})}),e.jsx(j,{label:r.thisMonth,value:String(t.monthly[t.monthly.length-1]??0),meta:i,className:"sm:col-span-2",children:e.jsx(I,{values:t.monthly,labels:t.monthLabels,emptyNote:"No monthly history yet"})})]})}export{se as EssayStatTiles};
2
3//# chunkId=01a1068a-f8e9-7710-af78-d148f9f86368

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.