1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[18841,50948,94927],{2948:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(92949).A)("unlink",[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]])},5748:(e,t,r)=>{r.d(t,{A:()=>s});var s=r(9492).YY.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>{let t=e.style.textAlign;return this.options.alignments.includes(t)?t:this.options.defaultAlignment},renderHTML:e=>e.textAlign?{style:`text-align: ${e.textAlign}`}:{}}}}]},addCommands(){return{setTextAlign:e=>({commands:t})=>!!this.options.alignments.includes(e)&&this.options.types.map(r=>t.updateAttributes(r,{textAlign:e})).some(e=>e),unsetTextAlign:()=>({commands:e})=>this.options.types.map(t=>e.resetAttributes(t,"textAlign")).some(e=>e),toggleTextAlign:e=>({editor:t,commands:r})=>!!this.options.alignments.includes(e)&&(t.isActive({textAlign:e})?r.unsetTextAlign():r.setTextAlign(e))}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}})},8931:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(92949).A)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]])},9529:(e,t,r)=>{r.d(t,{N:()=>a});var s=r(10660);r(65364);let a=(0,s.U)()},13272:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(92949).A)("text-align-end",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}
1]])},27323:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(92949).A)("text-align-start",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]])},29010:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(92949).A)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]])},32371:(e,t,r)=>{r.d(t,{H4:()=>v,_V:()=>A,bL:()=>g});var s=r(14232),a=r(77977),n=r(91844),l=r(62146),i=r(81285),o=r(66326),d=r(37876),c=Object.defineProperty,u=(e,t)=>c(e,"name",{value:t,configurable:!0}),h="Avatar",[m,p]=(0,n.A)(h),f=[0,()=>void 0],[y,x]=m(h),g=s.forwardRef(u(function(e,t){let{__scopeAvatar:r,...a}=e,[n,l]=s.useState("idle"),[i,c]=j();return(0,d.jsx)(y,{scope:r,imageLoadingStatus:n,setImageLoadingStatus:l,imageCount:i,setImageCount:c,children:(0,d.jsx)(o.sG.span,{...a,ref:t})})},"Avatar")),A=s.forwardRef(u(function(e,t){let{__scopeAvatar:r,src:a,onLoadingStatusChange:n,...c}=e,u=x("AvatarImage",r);N(u.setImageCount);let h=w(a,{referrerPolicy:c.referrerPolicy,crossOrigin:c.crossOrigin,loadingStatus:u.imageLoadingStatus,setLoadingStatus:u.setImageLoadingStatus}),m=(0,l.c)(e=>{n?.(e)}),p=s.useRef(h);return(0,i.N)(()=>{let e=p.current;p.current=h,h!==e&&m(h)},[h,m]),"loaded"===h?(0,d.jsx)(o.sG.img,{...c,ref:t,src:a}):null},"AvatarImage")),v=s.forwardRef(u(function(e,t){let{__scopeAvatar:r,delayMs:a,...n}=e,l=x("AvatarFallback",r),[i,c]=s.useState(void 0===a);return s.useEffect(()=>{if(void 0!==a){let e=window.setTimeout(()=>c(!0),a);return()=>window.clearTimeout(e)}},[a]),i&&"loaded"!==l.imageLoadingStatus?(0,d.jsx)(o.sG.span,{...n,ref:t}):null},"AvatarFallback"));function w(e,{loadingStatus:t,setLoadingStatus:r,referrerPolicy:s,crossOrigin:a}){return(0,i.N)(()=>{if(!e)return void r("error");let t=new window.Image,n=u(e=>{r(k(e.currentTarget))},"handleLoad"),l=u(()=>r("error"),"handleError");return t.addEventListener("load",n),t.addEventListener("error",l),s&&(t.referrerPolicy=s),t.crossOrigin=a??null,t.src=e,r(k(t)),()=>{t.removeEventListener("load",n),t.removeEventListener("error",l),r("idle")}},[e,a,s,r]),t}function k(e){return e.complete?e.naturalWidth>0?"loaded":"error":"loading"}function j(){let e=f;if(a.D){let[t]=e=s.useState(0),r=s.useRef(!1);s.useEffect(()=>{t>1&&!r.current&&(r.current=!0,console.warn("Avatar: Only one `Avatar.Image` component should be rendered per `Avatar.Root`, but multiple were detected. This will lead to unexpected behavior."))},[t])}return e}function N(e){a.D&&s.useEffect(()=>(e(e=>e+1),()=>{e(e=>e-1)}),[e])}u(w,"useImageLoadingStatus"),u(k,"getImageLoadingStatus"),u(j,"useImageCount"),u(N,"useUpdateImageCount")},39451:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(92949).A)("undo",[["path",{d:"M3 7v6h6",key:"1v2h90"}],["path",{d:"M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13",key:"1r6uu6"}]])},48186:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(92949).A)("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},48588:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(92949).A)("text-align-center",[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]])},49241:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(92949).A)("redo",[["path",{d:"M21 7v6h-6",key:"3ptur4"}],["path",{d:"M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7",key:"1kgawr"}]])},71442:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(92949).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},75198:(e,t,r)=>{r.d(t,{A:()=>s});let s=(0,r(92949).A)("heading-2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]])},85940:(e,t,r)=>{r.d(t,{BK:()=>o,eu:()=>i,q5:()=>d});var s=r(37876),a=r(14232),n=r(32371),l=r(1773);let i=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)(n.bL,{ref:r,className:(0,l.cn)("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));i.displayName=n.bL.displayName;let o=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)(n._V,{ref:r,className:(0,l.cn)("aspect-square h-full w-full object-cover",e),...t}));o.displayName=n._V.displayName;let d=a.forwardRef(({className:e,...t},r)=>(0,s.jsx)(n.H4,{ref:r,className:(0,l.cn)("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));d.displayName=n.H4.displayName},90508:(e,t,r)=>{r.r(t),r.d(t,{OneToOneSessionNotesPanel:()=>x,default:()=>g});var s=r(37876),a=r(14232),n=r(20967),l=r(43e3),i=r(72895),o=r(80901),d=r(60067),c=r(54347),u=r(75656),h=r(40846),m=r(11165),p=r(16447),f=r(59688);let y={content:"",isSubmitting:!1,error:null};function x({sessionId:e,lesson:t}){let{user:r,userRole:g}=(0,c.A)(),A=(0,a.useMemo)(()=>t?(t.shared_slot_lessons?.length?t.shared_slot_lessons:[t]).map(e=>e.id).sort():[],[t]),v=`${e}:${A.join(",")}`,[w,k]=(0,a.useState)({}),[j,N]=(0,a.useState)({}),{notes:b,isLoading:M,error:S,addNote:R,updateNote:T,deleteNote:L,refresh:_}=function(e,t={}){let{revalidateOnFocus:r=!1,dedupingInterval:s=1e4}
1=t,n=(Array.isArray(e)?e:e?[e]:[]).filter(Boolean).sort(),l=n[0],i=n.length>0?`/api/admin/school/session-notes?scheduled_lesson_ids=${n.join(",")}`:null,{data:o,error:d,isLoading:c,mutate:m,isValidating:p}=(0,u.Ay)(i,h.IU,{revalidateOnFocus:r,revalidateOnReconnect:!0,dedupingInterval:s,keepPreviousData:!0,errorRetryCount:3,errorRetryInterval:1e3}),f=async e=>{if(!l)return null;try{let t=await fetch("/api/admin/school/session-notes",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({scheduled_lesson_id:l,content:e})});if(!t.ok){let e=await t.json(),r=e.details?`${e.error}: ${e.details}`:e.error||"Failed to add note";throw Error(r)}let{note:r}=await t.json();return m(),r}catch(e){throw m(),e}},y=async(e,t)=>{try{m(r=>r?{notes:r.notes.map(r=>r.id===e?{...r,content:t,updated_at:new Date().toISOString()}:r)}:r,{revalidate:!1});let r=await fetch(`/api/admin/school/session-notes/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({content:t})});if(!r.ok){let e=await r.json();throw Error(e.error||"Failed to update note")}let{note:s}=await r.json();return m(),s}catch(e){throw m(),e}},x=async e=>{try{m(t=>t?{notes:t.notes.filter(t=>t.id!==e)}:t,{revalidate:!1});let t=await fetch(`/api/admin/school/session-notes/${e}`,{method:"DELETE",credentials:"include"});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to delete note")}return m(),!0}catch(e){throw m(),e}};return{notes:o?.notes||[],isLoading:c,isValidating:p,error:d,mutate:m,addNote:f,updateNote:y,deleteNote:x,refresh:(0,a.useCallback)(()=>{m()},[m])}}(A),C=(0,a.useMemo)(()=>b.filter(e=>e.scheduled_lesson_id&&A.includes(e.scheduled_lesson_id)).slice().reverse(),[b,A]),E=async e=>{try{await R(e),f.oR.success("Note added")}catch(e){throw f.oR.error("Failed to add note"),e}},H=async(e,t)=>{try{await T(e,t),f.oR.success("Note updated")}catch(e){throw f.oR.error("Failed to update note"),e}},I=async t=>{try{await L(t),N(r=>({...r,[`${e}:${t}`]:null})),f.oR.success("Note deleted")}catch(e){throw f.oR.error("Failed to delete note"),e}};return t?(0,s.jsxs)(o.Zp,{className:"flex min-w-0 flex-col xl:min-h-[38rem]",children:[(0,s.jsx)(o.aR,{className:"p-4 pb-3 sm:p-5 sm:pb-3",children:(0,s.jsxs)(o.ZB,{className:"flex items-center gap-2 text-base font-semibold",children:[(0,s.jsx)(n.A,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),"Notes for this lesson",C.length>0&&(0,s.jsxs)("span",{className:"text-sm font-normal text-muted-foreground",children:["(",C.length,")"]})]})}),(0,s.jsxs)(o.Wu,{className:"flex flex-1 flex-col gap-4 p-4 pt-0 sm:p-5 sm:pt-0",children:[S?(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",role:"alert",children:[(0,s.jsx)(l.A,{className:"h-4 w-4 shrink-0 text-destructive","aria-hidden":"true"}),(0,s.jsx)("span",{className:"text-destructive",children:"Could not load notes for this lesson."}),(0,s.jsx)(d.$,{variant:"outline",size:"sm",onClick:_,children:"Retry"})]}):M?(0,s.jsxs)("div",{role:"status",className:"flex items-center gap-2 py-2 text-sm text-muted-foreground",children:[(0,s.jsx)(i.A,{className:"h-4 w-4 animate-spin","aria-hidden":"true"}),"Loading lesson notesâ¦"]}):0===C.length?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"No notes for this lesson yet."}):(0,s.jsx)("div",{className:"divide-y divide-border",children:C.map(t=>{let a=`${e}:${t.id}`;return(0,s.jsx)(m.m,{note:t,currentUserId:r?.id||"",currentUserRole:g,onUpdate:H,onDelete:I,editDraft:j[a]??null,onEditDraftChange:e=>N(t=>({...t,[a]:"function"==typeof e?e(t[a]??null):e}))},a)})}),(0,s.jsx)("div",{className:"mt-auto border-t border-border pt-4",children:(0,s.jsx)(p.y,{onSubmit:E,placeholder:"Add a note about this lesson...",draft:w[v]??y,onDraftChange:e=>k(t=>({...t,[v]:"function"==typeof e?e(t[v]??y):e}))},v)})]})]}):(0,s.jsxs)(o.Zp,{className:"min-w-0 xl:min-h-[38rem]",children:[(0,s.jsx)(o.aR,{className:"p-4 sm:p-5",children:(0,s.jsxs)(o.ZB,{className:"flex items-center gap-2 text-base font-semibold",children:[(0,s.jsx)(n.A,{className:"h-4 w-4 text-muted-foreground","aria-hidden":"true"}),"Notes for this lesson"]})}),(0,s.jsx)(o.Wu,{className:"flex min-h-48 items-center justify-center p-4 text-center text-sm text-muted-foreground",children:"Select a lesson to view or add notes."})]})}let g=x},93958:(e,t,r)=>{r.d(t,{I:()=>s});function s(e,{email:t,fallback:r="??",normalizeWhitespace:a=!1}={}){if(e){if(a)return e.trim().split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()||"").join("")||r;let t=e.split(" ");return t.length>=2?`${t[0][0]}${t[1][0]}`.toUpperCase():e.substring(0,2).toUpperCase()}return t?t.substring(0,2).toUpperCase():r}}}]);
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.