1import{w as ee,a as te}from"./with-props-BZcXWtLJ.js";import{j as a}from"./jsx-runtime-C1HzKVhM.js";import{r as l,n as se,L as d,o as I,p as ie,M as ne,q as ae,S as oe,s as re,O as ce,t as le}from"./chunk-D4RADZKF-Bn0vLlne.js";import{S as T,a as L,P as de,C as B,I as z,b as _,c as q,d as he,R as Q,e as ue,L as Y,f as W,g as fe,T as me,X as pe}from"./index-F5jCzHb4.js";import{c as u}from"./misc-DHc4xibJ.js";import{C as xe}from"./chevron-right-DmgDiADl.js";import{O as V,P as ge,C as G,a as we,T as U,D as Z,R as ve,b as ye}from"./index-C83yQ0rR.js";import{c as je,B as A}from"./button-DmXE5ST_.js";import{c as R}from"./createLucideIcon-D8Tpp_F9.js";import{U as Ne}from"./user-C5rkuuqR.js";import"./index-By2krYrd.js";import"./index-D-Fnt3K6.js";import"./index-BbshJk6d.js";import"./Combination-DYBVxX9W.js";import"./tslib.es6-De9GV7Vy.js";const be="/assets/app-C2lYIuNB.css";/** 2 * @license lucide-react v0.469.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const Me=R("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 7 * @license lucide-react v0.469.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const Ce=R("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** 12 * @license lucide-react v0.469.0 - ISC 13 * 14 * This source code is licensed under the ISC license. 15 * See the LICENSE file in the root directory of this source tree. 16 */const Ie=R("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),Se=fe,Oe=me,Pe=l.forwardRef(({className:e,inset:t,children:n,...i},s)=>a.jsxs(T,{ref:s,className:u("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-stone-200 data-[state=open]:bg-stone-200 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...i,children:[n,a.jsx(xe,{className:"ml-auto"})]}));Pe.displayName=T.displayName;const Fe=l.forwardRef(({className:e,...t},n)=>a.jsx(L,{ref:n,className:u("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 shadow-lg 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));Fe.displayName=L.displayName;const X=l.forwardRef(({className:e,sideOffset:t=4,...n},i)=>a.jsx(de,{children:a.jsx(B,{ref:i,sideOffset:t,className:u("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));X.displayName=B.displayName;const N=l.forwardRef(({className:e,inset:t,...n},i)=>a.jsx(z,{ref:i,className:u("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-stone-200 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n}));N.displayName=z.displayName;const Re=l.forwardRef(({className:e,children:t,checked:n,...i},s)=>a.jsxs(_,{ref:s,className:u("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-stone-200 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...i,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(q,{children:a.jsx(he,{className:"h-4 w-4"})})}),t]}));Re.displayName=_.displayName;
16const ke=l.forwardRef(({className:e,children:t,...n},i)=>a.jsxs(Q,{ref:i,className:u("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-stone-200 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[a.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:a.jsx(q,{children:a.jsx(ue,{className:"h-2 w-2 fill-current"})})}),t]}));ke.displayName=Q.displayName;const H=l.forwardRef(({className:e,inset:t,...n},i)=>a.jsx(Y,{ref:i,className:u("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));H.displayName=Y.displayName;const M=l.forwardRef(({className:e,...t},n)=>a.jsx(W,{ref:n,className:u("-mx-1 my-1 h-px bg-muted",e),...t}));M.displayName=W.displayName;const $="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Layer_2'%20data-name='Layer%202'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20288.39%20288.39'%3e%3cdefs%3e%3cstyle%3e%20.cls-1%20{%20fill:%20%23775335;%20}%20.cls-1,%20.cls-2,%20.cls-3%20{%20stroke-miterlimit:%2010;%20stroke-width:%202px;%20}%20.cls-1,%20.cls-3%20{%20stroke:%20%2361442d;%20}%20.cls-2,%20.cls-3%20{%20fill:%20%23e8ddbf;%20}%20.cls-2,%20.cls-4%20{%20stroke:%20%23e8ddbf;%20}%20.cls-4%20{%20fill:%20none;%20stroke-linecap:%20round;%20stroke-linejoin:%20round;%20stroke-width:%206px;%20}%20%3c/style%3e%3c/defs%3e%3cg%20id='Layer_5'%20data-name='Layer%205'%3e%3cg%20id='Full_Compass'%20data-name='Full%20Compass'%3e%3ccircle%20class='cls-2'%20cx='144.2'%20cy='144.2'%20r='143.2'/%3e%3cg%20id='Big_Star'%20data-name='Big%20Star'%3e%3cpath%20class='cls-1'%20d='M92.16,21.18c0-.06.08-.08.1-.02l27.68,65.58h0c-3.76,4.09-16.06,12.84-21.17,14.59l-6.6-80.14Z'/%3e%3cpath%20class='cls-1'%20d='M119.93,86.74h0'/%3e%3cpath%20class='cls-1'%20d='M181.1,196.82l15.17,70.72-27.07-64.11c4.27-1.8,8.24-4.02,11.9-6.61Z'/%3e%3cpath%20class='cls-1'%20d='M181.1,196.82c-3.65,2.58-7.62,4.8-11.9,6.61'/%3e%3cpath%20class='cls-3'%20d='M142.86,81.73c-3.66,2-18.72,5.88-22.92,5l-27.68-65.58c-.02-.05.05-.09.08-.05l50.52,60.63Z'/%3e%3cpath%20class='cls-1'%20d='M196.07,267.28c0,.06-.08.08-.1.02l-27.6-65.61h0c3.77-4.08,16.08-12.82,21.19-14.56l6.5,80.15Z'/%3e%3cpath%20class='cls-3'%20d='M145.45,206.66c3.66-1.99,18.73-5.85,22.93-4.97l27.6,65.61c.02.05-.05.09-.08.05l-50.45-60.69Z'/%3e%3c/g%3e%3cpath%20class='cls-1'%20d='M202.92,120.44c3.58,8.48,5.17,17.32,4.99,25.96-.06,2.5-.26,4.98-.61,7.44-.68,4.85-1.92,9.59-3.67,14.13-1.75,4.49-4.01,8.79-6.73,12.8-1.54,2.26-3.23,4.43-5.07,6.48-3.16,3.55-6.75,6.77-10.72,9.56-3.65,2.58-7.62,4.8-11.9,6.61h0c-4.27,1.81-8.63,3.11-13.02,3.93-4.79.9-9.6,1.23-14.35,1.01-2.74-.12-5.49-.42-8.18-.89-4.76-.84-9.41-2.23-13.85-4.12-4.48-1.9-8.75-4.32-12.69-7.21-2.02-1.46-3.94-3.05-5.76-4.75-6.33-5.89-11.54-13.2-15.12-21.68-.18-.43-.36-.89-.54-1.33-3.67-9.23-5-18.83-4.27-28.13.15-1.91.38-3.81.69-5.69.83-4.91,2.24-9.69,4.18-14.26,1.96-4.61,4.46-8.98,7.46-13.03.99-1.34,2.02-2.63,3.12-3.88,3.18-3.65,6.81-6.96,10.86-9.84,3.73-2.67,7.81-4.97,12.21-6.82h0c4.4-1.86,8.9-3.19,13.41-4,4.88-.89,9.78-1.18,14.61-.92,1.65.08,3.31.24,4.95.46,5,.67,9.89,1.94,14.55,3.75,4.62,1.78,9.03,4.12,13.13,6.95,1.58,1.08,3.1,2.24,4.57,3.47,7.18,5.97,13.12,13.62,17.18,22.68.19.43.39.88.57,1.31Z'/%3e%3c/g%3e%3cpath%20class='cls-4'%20d='M118.13,111.85v14.32M110.97,119.01h14.32M121.71,161.99v14.32M114.55,169.15h14.32M147.62,114.37l7.21,21.64c.08.25.28.45.53.55l17.86,6.7c.77.29.77,1.37,0,1.66l-17.86,6.7c-.25.09-.44.3-.53.55l-7.21,21.64c-.27.81-1.41.81-1.68,0l-7.21-21.64c-.08-.25-.28-.45-.53-.55l-17.86-6.7c-.77-.29-.77-1.37,0-1.66l17.86-6.7c.25-.09.44-.3.53-.55l7.21-21.64c.27-.81,1.41-.81,1.68,0Z'/%3e%3c/g%3e%3c/svg%3e",De=ve,Ee=ye,Ae=ge,K=l.forwardRef(({className:e,...t},n)=>a.jsx(V,{className:u("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",e),...t,ref:n}));K.displayName=V.displayName;const Te=je("fixed z-50 gap-4 bg-stone-50 p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),J=l.forwardRef(({side:e="right",className:t,children:n,...i},s)=>a.jsxs(Ae,{children:[a.jsx(K,{}
16),a.jsxs(G,{ref:s,className:u(Te({side:e}),t),...i,children:[n,a.jsxs(we,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[a.jsx(pe,{className:"h-4 w-4"}),a.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));J.displayName=G.displayName;const Le=l.forwardRef(({className:e,...t},n)=>a.jsx(U,{ref:n,className:u("text-lg font-semibold text-foreground",e),...t}));Le.displayName=U.displayName;const Be=l.forwardRef(({className:e,...t},n)=>a.jsx(Z,{ref:n,className:u("text-sm text-muted-foreground",e),...t}));Be.displayName=Z.displayName;function ze({user:e,completedDays:t}){const[n,i]=l.useState(!1);let s=se();const o=()=>{s(null,{method:"post",action:"/logout"})};return a.jsx("nav",{className:"shadow-sm",children:a.jsx("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8 py-4",children:a.jsxs("div",{className:"flex justify-between items-center h-16",children:[a.jsx("div",{className:"flex items-center",children:a.jsxs(d,{to:"/",className:"flex items-center text-stone-600 hover:text-double-spanish-white-500",children:[a.jsx("img",{src:$,alt:"AI Foundations Logo",className:"h-12 w-12 md:h-16 md:w-16 text-double-spanish-white-400"}),a.jsx("span",{className:"ml-3 text-xl font-serif font-semibold",children:"AI Foundations"})]})}),a.jsxs("div",{className:"hidden md:flex md:items-center md:gap-4",children:[e&&a.jsx(d,{to:"/dashboard",className:"text-stone-600 hover:text-double-spanish-white-500 px-2",children:"Dashboard"}),a.jsx(d,{to:"/about",className:"text-stone-600 hover:text-double-spanish-white-500 px-2",children:"About"}),e?a.jsxs(Se,{children:[a.jsxs(Oe,{className:"flex items-center gap-2 text-stone-800 hover:text-double-spanish-white-500 hover:cursor-pointer px-2",children:[a.jsx("span",{className:"hidden sm:inline",children:e.email}),a.jsx(Me,{className:"h-5 w-5"})]}),a.jsxs(X,{align:"end",children:[a.jsx(H,{children:"My Account"}),a.jsxs(N,{className:"cursor-default focus:bg-white focus:outline-0 outline-none",children:["Days Complete: ",(t==null?void 0:t.completedCount)??0]}),a.jsx(M,{}),a.jsx(N,{asChild:!0,children:a.jsx(d,{to:"/profile",className:"cursor-pointer",children:"Profile"})}),a.jsx(M,{}),e.role==="admin"&&a.jsx(N,{asChild:!0,children:a.jsx(d,{to:"/admin",className:"cursor-pointer",children:"Admin"})}),a.jsx(M,{}),a.jsx(N,{asChild:!0,children:a.jsx("button",{onClick:o,className:"w-full text-left cursor-pointer",children:"Sign out"})})]})]}):a.jsx(d,{to:"/login",className:"text-gray-600 hover:text-gray-900",children:"Sign in"})]}),a.jsxs(De,{open:n,onOpenChange:i,children:[a.jsx(Ee,{asChild:!0,className:"md:hidden",children:a.jsxs(A,{variant:"ghost",size:"icon",children:[a.jsx(Ce,{className:"h-5 w-5"}),a.jsx("span",{className:"sr-only",children:"Toggle menu"})]})}),a.jsx(J,{side:"right",className:"w-[300px] sm:w-[400px]",children:a.jsxs("div",{className:"flex flex-col gap-6 px-2 py-6",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsx(d,{to:"/",className:"text-xl font-bold font-serif",onClick:()=>i(!1),children:"AI Foundations"})}),a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsx(d,{to:"/dashboard",className:"text-sm font-medium transition-colors hover:text-primary",onClick:()=>i(!1),children:"Dashboard"}),a.jsx(d,{to:"/about",className:"text-sm font-medium transition-colors hover:text-primary",onClick:()=>i(!1),children:"About"}),!e&&a.jsx(d,{to:"/login",className:"text-sm font-medium transition-colors hover:text-primary",onClick:()=>i(!1),children:"Login"})]}),e&&a.jsxs("div",{className:"border-t pt-4",children:[a.jsxs("div",{className:"flex flex-col gap-4 mb-4",children:[a.jsx("p",{className:"text-xs text-stone-700",children:e.email}),a.jsxs("p",{className:"text-xs text-stone-700",children:["Days Complete: ",(t==null?void 0:t.completedCount)??0]})]}),a.jsxs("div",{className:"flex flex-col gap-4",children:[a.jsxs(d,{to:"/profile",className:"flex items-center gap-2 text-sm font-medium transition-colors hover:text-primary",onClick:()=>i(!1),children:[a.jsx(Ne,{className:"h-4 w-4"}),"Profile"]}),e.role==="admin"&&a.jsxs(d,{to:"/admin",className:"flex items-center gap-2 text-sm font-medium transition-colors hover:text-primary",onClick:()=>i(!1),children:[a.jsx(Ie,{className:"h-4 w-4"}),"Admin"]}),a.jsx(A,{variant:"outline",className:"justify-start",onClick:o,children:"Sign out"})]})]})]})})]})]})})})}var C={linear:function(e,t,n,i){var s=n-t;return s*e/i+t},easeInQuad:function(e,t,n,i){var s=n-t;return s*(e/=i)*e+t},easeOutQuad:function(e,t,n,i){var s=n-t;return-s*(e/=i)*(e-2)+t},easeInOutQuad:function(e,t,n,i){var s=n-t;return(e/=i/2)<1?s/2*e*e+t:-s/2*(--e*(e-2)-1)+t},easeInCubic:function(e,t,n,i){var s=n-t;return s*(e/=i)*e*e+t},easeOutCubic:function(e,t,n,i){var s=n-t;return s*((e=e/i-1)*e*e+1)+t},easeInOutCubic:function(e,t,n,i){var s=n-t;return(e/=i/2)<1?s/2*e*e*e+t:s/2*((e-=2)*e*e+2)+t},easeInQuart:function(e,t,n,i){var s=n-t;return s*(e/=i)*e*e*e+t},easeOutQuart:function(e,t,n,i){var s=n-t;return-s*((e=e/i-1)*e*e*e-1)+t},easeInOutQuart:function(e,t,n,i){var s=n-t;return(e/=i/2)<1?s/2*e*e*e*e+t:-s/2*((e-=2)*e*e*e-2)+t},easeInQuint:function(e,t,n,i){var s=n-t;return s*(e/=i)*e*e*e*e+t},easeOutQuint:function(e,t,n,i){var s=n-t;return s*((e=e/i-1)*e*e*e*e+1)+t},easeInOutQuint:function(e,t,n,i){var s=n-t;return(e/=i/2)<1?s/2*e*e*e*e*e+t:s/2*((e-=2)*e*e*e*e+2)+t},easeInSine:function(e,t,n,i){var s=n-t;return-s*Math.cos(e/i*(Math.PI/2))+s+t},easeOutSine:function(e,t,n,i){var s=n-t;return s*Math.sin(e/i*(Math.PI/2))+t},easeInOutSine:function(e,t,n,i){var s=n-t;return-s/2*(Math.cos(Math.PI*e/i)-1)+t},easeInExpo:function(e,t,n,i){var s=n-t;return e==0?t:s*Math.pow(2,10*(e/i-1))+t},easeOutExpo:function(e,t,n,i){var s=n-t;return e==i?t+s:s*(-Math.pow(2,-10*e/i)+1)+t},easeInOutExpo:function(e,t,n,i){var s=n-t;return e===0?t:e===i?t+s:(e/=i/2)<1?s/2*Math.pow(2,10*(e-1))+t:s/2*(-Math.pow(2,-10*--e)+2)+t},easeInCirc:function(e,t,n,i){var s=n-t;return-s*(Math.sqrt(1-(e/=i)*e)-1)+t},easeOutCirc:function(e,t,n,i){var s=n-t;return s*Math.sqrt(1-(e=e/i-1)*e)+t},easeInOutCirc:function(e,t,n,i){var s=n-t;return(e/=i/2)<1?-s/2*(Math.sqrt(1-e*e)-1)+t:s/2*(Math.sqrt(1-(e-=2)*e)+1)+t},easeInElastic:function(e,t,n,i){var s=n-t,o,r,c;return c=1.70158,r=0,o=s,e===0?t:(e/=i)===1?t+s:(r||(r=i*.3),o<Math.abs(s)?(o=s,c=r/4):c=r/(2*Math.PI)*Math.asin(s/o),-(o*Math.pow(2,10*(e-=1))*Math.sin((e*i-c)*(2*Math.PI)/r))+t)},easeOutElastic:function(e,t,n,i){var s=n-t,o,r,c;return c=1.70158,r=0,o=s,e===0?t:(e/=i)===1?t+s:(r||(r=i*.3),o<Math.abs(s)?(o=s,c=r/4):c=r/(2*Math.PI)*Math.asin(s/o),o*Math.pow(2,-10*e)*Math.sin((e*i-c)*(2*Math.PI)/r)+s+t)},easeInOutElastic:function(e,t,n,i){var s=n-t,o,r,c;return c=1.70158,r=0,o=s,e===0?t:(e/=i/2)===2?t+s:(r||(r=i*(.3*1.5)),o<Math.abs(s)?(o=s,c=r/4):c=r/(2*Math.PI)*Math.asin(s/o),e<1?-.5*(o*Math.pow(2,10*(e-=1))*Math.sin((e*i-c)*(2*Math.PI)/r))+t:o*Math.pow(2,-10*(e-=1))*Math.sin((e*i-c)*(2*Math.PI)/r)*.5+s+t)},easeInBack:function(e,t,n,i,s){var o=n-t;return s===void 0&&(s=1.70158),o*(e/=i)*e*((s+1)*e-s)+t},easeOutBack:function(e,t,n,i,s){var o=n-t;return s===void 0&&(s=1.70158),o*((e=e/i-1)*e*((s+1)*e+s)+1)+t},easeInOutBack:function(e,t,n,i,s){var o=n-t;return s===void 0&&(s=1.70158),(e/=i/2)<1?o/2*(e*e*(((s*=1.525)+1)*e-s))+t:o/2*((e-=2)*e*(((s*=1.525)+1)*e+s)+2)+t},easeInBounce:function(e,t,n,i){var s=n-t,o;return o=C.easeOutBounce(i-e,0,s,i),s-o+t},easeOutBounce:function(e,t,n,i){var s=n-t;return(e/=i)<1/2.75?s*(7.5625*e*e)+t:e<2/2.75?s*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?s*(7.5625*(e-=2.25/2.75)*e+.9375)+t:s*(7.5625*(e-=2.625/2.75)*e+.984375)+t},easeInOutBounce:function(e,t,n,i){var s=n-t,o;return e<i/2?(o=C.easeInBounce(e*2,0,s,i),o*.5+t):(o=C.easeOutBounce(e*2-i,0,s,i),o*.5+s*.5+t)}},_e=C;function qe(e){return e*Math.PI/180}function h(e,t){return e+Math.random()*(t-e)}function Qe(e,t){return Math.floor(e+Math.random()*(t-e+1))}var b;(function(e){e[e.Circle=0]="Circle",e[e.Square=1]="Square",e[e.Strip=2]="Strip"})(b||(b={}));var w;(function(e){e[e.Positive=1]="Positive",e[e.Negative=-1]="Negative"})(w||(w={}));const Ye=1e3/60;class We{constructor(t,n,i,s){this.getOptions=n;const{colors:o,initialVelocityX:r,initialVelocityY:c}=this.getOptions();this.context=t,this.x=i,this.y=s,this.w=h(5,20),this.h=h(5,20),this.radius=h(5,10),this.vx=typeof r=="number"?h(-r,r):h(r.min,r.max),this.vy=typeof c=="number"?h(-c,0):h(c.min,c.max),this.shape=Qe(0,2),this.angle=qe(h(0,360)),this.angularSpin=h(-.2,.2),this.color=o[Math.floor(Math.random()*o.length)],this.rotateY=h(0,1),this.rotationDirection=h(0,1)?w.Positive:w.Negative}update(t){const{gravity:n,wind:i,friction:s,opacity:o,drawShape:r}=this.getOptions(),c=t/Ye;this.x+=this.vx*c,this.y+=this.vy*c,this.vy+=n*c,this.vx+=i*c,this.vx*=s**c,this.vy*=s**c,this.rotateY>=1&&this.rotationDirection===w.Positive?this.rotationDirection=w.Negative:this.rotateY<=-1&&this.rotationDirection===w.Negative&&(this.rotationDirection=w.Positive);const f=.1*this.rotationDirection*c;if(this.rotateY+=f,this.angle+=this.angularSpin,this.context.save(),this.context.translate(this.x,this.y),this.context.rotate(this.angle),this.context.scale(1,this.rotateY),this.context.rotate(this.angle),this.context.beginPath(),this.context.fillStyle=this.color,this.context.strokeStyle=this.color,this.context.globalAlpha=o,this.context.lineCap="round",this.context.lineWidth=2,r&&typeof r=="function")r.call(this,this.context);else switch(this.shape){case b.Circle:{this.context.beginPath(),this.context.arc(0,0,this.radius,0,2*Math.PI),this.context.fill();break}case b.Square:{this.context.fillRect(-this.w/2,-this.h/2,this.w,this.h);break}case b.Strip:{this.context.fillRect(-this.w/6,-this.h/2,this.w/3,this.h);break}}
16this.context.closePath(),this.context.restore()}}class Ve{constructor(t,n){this.x=0,this.y=0,this.w=0,this.h=0,this.lastNumberOfPieces=0,this.tweenProgress=0,this.tweenFrom=0,this.particles=[],this.particlesGenerated=0,this.removeParticleAt=s=>{this.particles.splice(s,1)},this.getParticle=()=>{const s=h(this.x,this.w+this.x),o=h(this.y,this.h+this.y);return new We(this.context,this.getOptions,s,o)},this.animate=s=>{const{canvas:o,context:r,particlesGenerated:c,lastNumberOfPieces:f}=this,{run:m,recycle:p,numberOfPieces:x,debug:S,tweenFunction:O,tweenDuration:P}=this.getOptions();if(!m)return!1;const y=this.particles.length,j=p?y:c;if(j<x){f!==x&&(this.tweenProgress=0,this.tweenFrom=j,this.lastNumberOfPieces=x),this.tweenProgress=Math.min(P,Math.max(0,this.tweenProgress+s));const v=O(this.tweenProgress,this.tweenFrom,x,P),g=Math.round(v-j);for(let E=0;E<g;E++)this.particles.push(this.getParticle());this.particlesGenerated+=g}S&&(r.font="12px sans-serif",r.fillStyle="#333",r.textAlign="right",r.fillText(`Particles: ${y}`,o.width-10,o.height-20));for(let v=this.particles.length-1;v>=0;v--){const g=this.particles[v];g.update(s),(g.y>o.height||g.y<-100||g.x>o.width+100||g.x<-100)&&(p&&j<=x?this.particles[v]=this.getParticle():this.removeParticleAt(v))}return y>0||j<x},this.canvas=t;const i=this.canvas.getContext("2d");if(!i)throw new Error("Could not get canvas context");this.context=i,this.getOptions=n}}const k={width:typeof window<"u"?window.innerWidth:300,height:typeof window<"u"?window.innerHeight:200,numberOfPieces:200,friction:.99,wind:0,gravity:.1,initialVelocityX:4,initialVelocityY:10,colors:["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4CAF50","#8BC34A","#CDDC39","#FFEB3B","#FFC107","#FF9800","#FF5722","#795548"],opacity:1,debug:!1,tweenFunction:_e.easeInOutQuad,tweenDuration:5e3,recycle:!0,run:!0};class Ge{constructor(t,n){this.lastFrameTime=0,this.setOptionsWithDefaults=s=>{const o={confettiSource:{x:0,y:0,w:this.canvas.width,h:0}};this._options={...o,...k,...s},Object.assign(this,s.confettiSource)},this.update=(s=0)=>{const{options:{run:o,onConfettiComplete:r,frameRate:c},canvas:f,context:m}=this,p=Math.min(s-this.lastFrameTime,50);if(c&&p<1e3/c){this.rafId=requestAnimationFrame(this.update);return}this.lastFrameTime=s-(c?p%c:0),o&&(m.fillStyle="white",m.clearRect(0,0,f.width,f.height)),this.generator.animate(p)?this.rafId=requestAnimationFrame(this.update):(r&&typeof r=="function"&&this.generator.particlesGenerated>0&&r.call(this,this),this._options.run=!1)},this.reset=()=>{this.generator&&this.generator.particlesGenerated>0&&(this.generator.particlesGenerated=0,this.generator.particles=[],this.generator.lastNumberOfPieces=0)},this.stop=()=>{this.options={run:!1},this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=void 0)},this.canvas=t;const i=this.canvas.getContext("2d");if(!i)throw new Error("Could not get canvas context");this.context=i,this.generator=new Ve(this.canvas,()=>this.options),this.options=n,this.update()}get options(){return this._options}set options(t){var s,o;const n=(s=this._options)==null?void 0:s.run,i=(o=this._options)==null?void 0:o.recycle;this.setOptionsWithDefaults(t),this.generator&&(Object.assign(this.generator,this.options.confettiSource),typeof t.recycle=="boolean"&&t.recycle&&i===!1&&(this.generator.lastNumberOfPieces=this.generator.particles.length)),typeof t.run=="boolean"&&t.run&&n===!1&&this.update()}}const Ue=I.createRef();class D extends I.Component{constructor(t){super(t),this.canvas=I.createRef(),this.canvas=t.canvasRef||Ue}componentDidMount(){if(this.canvas.current){const t=F(this.props)[0];this.confetti=new Ge(this.canvas.current,t)}}componentDidUpdate(){const t=F(this.props)[0];this.confetti&&(this.confetti.options=t)}componentWillUnmount(){this.confetti&&this.confetti.stop(),this.confetti=void 0}render(){const[t,n]=F(this.props),i={zIndex:2,position:"absolute",pointerEvents:"none",top:0,left:0,bottom:0,right:0,...n.style};return a.jsx("canvas",{width:t.width,height:t.height,ref:this.canvas,...n,style:i})}}D.defaultProps={...k};D.displayName="ReactConfetti";function F(e){const t={},n={},i={},s=[...Object.keys(k),"confettiSource","drawShape","onConfettiComplete","frameRate"],o=["canvasRef"];for(const r in e){const c=e[r];s.includes(r)?t[r]=c:o.includes(r)?o[r]=c:i[r]=c}return[t,i,n]}const Ze=I.forwardRef((e,t)=>
16a.jsx(D,{canvasRef:t,...e}));function Xe(){const[e,t]=l.useState({width:typeof window<"u"?window.innerWidth:1200,height:typeof window<"u"?window.innerHeight:800});return l.useEffect(()=>{if(typeof window>"u")return;function n(){t({width:window.innerWidth,height:window.innerHeight})}return window.addEventListener("resize",n),n(),()=>window.removeEventListener("resize",n)},[]),e}function He(){const[e,t]=l.useState(!1);return l.useEffect(()=>{if(typeof window>"u")return;const n=window.matchMedia("(prefers-reduced-motion: reduce)");t(n.matches);const i=s=>{t(s.matches)};return n.addEventListener("change",i),()=>{n.removeEventListener("change",i)}},[]),e}function $e({completedCount:e,totalModules:t}){const[n,i]=l.useState(!1),[s,o]=l.useState(e),{width:r,height:c}=Xe(),f=He(),[m,p]=l.useState(null),x=10*1e3;return l.useEffect(()=>{if(s!==e){if(e>s){const S=e===1,O=e%3===0;if(S||O||e===t){const y=Date.now();(!m||y-m>x)&&(f||(i(!0),p(y),setTimeout(()=>{i(!1)},4e3)))}}o(e)}},[e,s,t,m,f]),n?a.jsx(Ze,{width:r,height:c,recycle:!1,numberOfPieces:e>=6?500:300,tweenDuration:4e3,gravity:.2,colors:["#FF5733","#33FF57","#3357FF","#F033FF","#FF33F0","#FFFF33"]}):null}function Ke({completedCount:e,totalModules:t,celebrationsEnabled:n}){return n?a.jsx($e,{completedCount:e,totalModules:t}):null}const mt=()=>[{rel:"preconnect",href:"https://fonts.googleapis.com"},{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"},{rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"},{rel:"stylesheet",href:"https://fonts.googleapis.com/css2?family=Alegreya:ital,wght@0,400..900;1,400..900&display=swap"},{rel:"stylesheet",href:be}];function pt({children:e}){const{env:t,user:n,preferences:i,userProgress:s,totalActivityDays:o}=ie();let r=null;n&&(r={email:n.user.email??"",role:n.user.role});let c=0;return s!=null&&s.completedDays&&(c=Object.values(s.completedDays).filter(f=>f.completed).length),a.jsxs("html",{lang:"en",children:[a.jsxs("head",{children:[a.jsx("meta",{charSet:"utf-8"}),a.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1"}),a.jsx(ne,{}),a.jsx(ae,{})]}),a.jsxs("body",{children:[a.jsxs("div",{className:"min-h-screen bg-stone-100 flex flex-col",children:[a.jsx(ze,{user:r,completedDays:{completedCount:c}}),e,(n==null?void 0:n.user.id)&&a.jsx(Ke,{completedCount:c,totalModules:o,celebrationsEnabled:(i==null?void 0:i.celebrationsEnabled)??!0}),a.jsx("footer",{className:"px-6 py-8 bg-double-spanish-white-950 text-double-spanish-white-50 mt-auto",children:a.jsxs("div",{className:"max-w-6xl mx-auto",children:[a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 md:justify-items-center gap-8",children:[a.jsx("div",{className:"col-span-2 md:col-span-1",children:a.jsxs("div",{className:"flex items-start mb-4",children:[a.jsx("img",{src:$,alt:"AI Foundations Logo",className:"h-12 w-12 text-double-spanish-white-400"}),a.jsxs("div",{className:"ml-4 flex flex-col gap-2 md:gap-4",children:[a.jsx("span",{className:"font-semibold",children:"AI Foundations"}),a.jsx("p",{className:"text-double-spanish-white-50 text-sm",children:"Your guided journey to practical AI literacy"})]})]})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold mb-4",children:"Resources"}),a.jsxs("ul",{className:"space-y-2 text-double-spanish-white-50",children:[a.jsx("li",{children:a.jsx(d,{to:"/about",className:"hover:text-white text-sm md:text-base",children:"About"})}),a.jsx("li",{children:a.jsx(d,{to:"/privacy",className:"hover:text-white text-sm md:text-base",children:"Privacy Policy"})})]})]}),a.jsxs("div",{className:"col-span-2 md:col-span-1",children:[a.jsx("h3",{className:"font-semibold mb-4",children:"Connect"}),a.jsxs("p",{className:"text-double-spanish-white-50 text-sm mb-4",children:["Questions or ideas? Contact us at ",a.jsx("a",{href:"mailto:[email protected]",className:"text-double-spanish-white-50 hover:underline",children:"[email protected]"})]})]})]}),a.jsx("div",{className:"border-t border-double-spanish-white-500 mt-8 pt-8 text-center text-double-spanish-white-50 text-sm",children:a.jsxs("p",{children:["© ",new Date().getFullYear()," AI Foundations. A project by Boston College Law School."]})})]})})]}),a.jsx(oe,{}),a.jsx(re,{})]})]})}const xt=ee(function(){return a.jsx(ce,{})}),gt=te(function({error:t}){let n="Oops!",i="An unexpected error occurred.",s;return le(t)?(n=t.status===404?"404":"Error",i=t.status===404?"The requested page could not be found.":t.statusText||i):t&&t instanceof Error&&(i=t.message,s=t.stack),a.jsxs("main",{className:"pt-16 p-4 container mx-auto",children:[a.jsx("h1",{children:n}),a.jsx("p",{children:i}),s&&a.jsx("pre",{className:"w-full p-4 overflow-x-auto",children:a.jsx("code",{children:s})})]})});export{gt as ErrorBoundary,pt as Layout,xt as default,mt as links};
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.