1import"../chunks/bK7HRQiH.js";import{c as Ue,f as ce,a as v,aF as Ct,aG as n,ae as R,z as e,aH as Dt,aL as h,aO as Tt,aI as i,B as t,aJ as y,aN as zt,aM as de,aK as s,aQ as qe,aP as F,a1 as Me}from"../chunks/DRzz53sC.js";import{s as w}from"../chunks/BJ2atWpg.js";import{i as f}from"../chunks/BWbvDKcH.js";import{e as Fe}from"../chunks/BoMKA7ND.js";import{h as St}from"../chunks/DHO_VYq9.js";import{s as We,r as At,a as Pe}from"../chunks/DUpGFTx9.js";import{d as It,e as ke}from"../chunks/CE9f280Z.js";import{b as be}from"../chunks/CaoRam8X.js";import{i as xe,g as Nt}from"../chunks/DeoKuU8a.js";import{g as Pt}from"../chunks/C-PoYK2Z.js";import{A as Ye}from"../chunks/Din_IZzH.js";import{A as Lt}from"../chunks/B8l-aKoH.js";import{P as Ge}from"../chunks/3VKrR-uw.js";import{L as ve}from"../chunks/DV7OmYMe.js";import"../chunks/BImWvYhI.js";import{s as Qt}from"../chunks/4PmsZw3D.js";import{l as jt,s as Ot}from"../chunks/BmGdimzs.js";import{I as Bt}from"../chunks/CV8EEf7m.js";import{T as Ke}from"../chunks/DdwqGxBF.js";(function(){try{var N=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};N.SENTRY_RELEASE={id:"3083484e88348b31a138e4b75387568ef7945cc2"};var d=new N.Error().stack;d&&(N._sentryDebugIds=N._sentryDebugIds||{},N._sentryDebugIds[d]="4262f578-547e-4e1a-a1ae-0a2fa6d83440",N._sentryDebugIdIdentifier="sentry-dbid-4262f578-547e-4e1a-a1ae-0a2fa6d83440")}catch{}})();function Jt(N,d){const Q=jt(d,["children","$$slots","$$events","$$legacy"]);/** 2 * @license lucide-svelte v0.564.0 - ISC 3 * 4 * ISC License 5 * 6 * Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2026 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2026. 7 * 8 * Permission to use, copy, modify, and/or distribute this software for any 9 * purpose with or without fee is hereby granted, provided that the above 10 * copyright notice and this permission notice appear in all copies. 11 * 12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 19 * 20 * --- 21 * 22 * The MIT License (MIT) (for portions derived from Feather) 23 * 24 * Copyright (c) 2013-2026 Cole Bemis 25 * 26 * Permission is hereby granted, free of charge, to any person obtaining a copy 27 * of this software and associated documentation files (the "Software"), to deal 28 * in the Software without restriction, including without limitation the rights 29 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 30 * copies of the Software, and to permit persons to whom the Software is 31 * furnished to do so, subject to the following conditions: 32 * 33 * The above copyright notice and this permission notice shall be included in all 34 * copies or substantial portions of the Software. 35 * 36 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 37 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 38 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 39 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 40 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 41 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 42 * SOFTWARE. 43 * 44 */const j=[["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4"}],["path",{d:"m9 17-5-5 5-5"}]];Bt(N,Ot({name:"reply"},()=>Q,{get iconNode(){return j},children:(V,te)=>{var ae=Ue(),ue=ce(ae);Qt(ue,d,"default",{}),v(V,ae)},$$slots:{default:!0}}))}var Ht=y('<span class="badge svelte-9yixe8">Michael</span>'),Mt=y('<span class="dot svelte-9yixe8">·</span><span class="edited svelte-9yixe8">edited</span>',1),Ft=y('<button class="icon-btn reply-to-btn svelte-9yixe8" aria-label="Reply to this comment" title="Reply"><!> <span class="reply-to-label svelte-9yixe8">Reply</span></button>'),Wt=y('<button class="icon-btn svelte-9yixe8" aria-label="Edit reply" title="Edit"><!></button> <button class="delete-btn svelte-9yixe8" aria-label="Delete reply" title="Delete"><!></button>',1),Yt=y('<span class="error svelte-9yixe8"> </span>
44'),Gt=y('<form class="edit-form reply-edit svelte-9yixe8"><textarea rows="3" placeholder="Edit your reply" class="svelte-9yixe8"></textarea> <div class="edit-actions svelte-9yixe8"><!> <button type="button" class="ghost svelte-9yixe8">Cancel</button> <button type="submit" class="primary svelte-9yixe8"><!> </button></div></form>'),Kt=y('<div class="reply-body svelte-9yixe8"> </div>'),Ut=y('<div><span class="reply-avatar svelte-9yixe8"><!></span> <div class="reply-main svelte-9yixe8"><div class="reply-meta svelte-9yixe8"><span class="author svelte-9yixe8"> </span> <!> <span class="dot svelte-9yixe8">·</span> <span> </span> <!> <div class="reply-actions svelte-9yixe8"><!> <!></div></div> <!></div></div>'),Vt=y('<div class="head-actions svelte-9yixe8"><button class="icon-btn svelte-9yixe8" aria-label="Edit question" title="Edit"><!></button> <button class="delete-btn svelte-9yixe8" aria-label="Delete question" title="Delete"><!></button></div>'),Xt=y('<span class="error svelte-9yixe8"> </span>'),Zt=y('<form class="edit-form svelte-9yixe8"><input type="text" maxlength="200" placeholder="Title" class="svelte-9yixe8"/> <textarea rows="6" placeholder="Your question" class="svelte-9yixe8"></textarea> <div class="edit-actions svelte-9yixe8"><!> <button type="button" class="ghost svelte-9yixe8">Cancel</button> <button type="submit" class="primary svelte-9yixe8"><!> </button></div></form>'),$t=y('<a class="lesson-link svelte-9yixe8"> </a><span class="dot svelte-9yixe8">·</span>',1),ea=y('<a class="lesson-link svelte-9yixe8"> </a><span class="dot svelte-9yixe8">·</span>',1),ta=y('<span class="dot svelte-9yixe8">·</span><span class="edited svelte-9yixe8">edited</span>',1),aa=y('<span class="pill answered svelte-9yixe8">Answered</span>'),sa=y('<h1 class="svelte-9yixe8"> </h1> <div class="meta svelte-9yixe8"><!> <span> </span> <!> <!></div> <div class="body svelte-9yixe8"> </div>',1),ia=y('<span class="error svelte-9yixe8"> </span>'),ra=y('<form class="child-composer svelte-9yixe8"><textarea rows="2" class="svelte-9yixe8"></textarea> <div class="edit-actions svelte-9yixe8"><!> <button type="button" class="ghost svelte-9yixe8">Cancel</button> <button type="submit" class="primary svelte-9yixe8"><!> </button></div></form>'),la=y('<div class="children svelte-9yixe8"><!> <!></div>'),na=y('<li class="reply-group"><!> <!></li>'),oa=y('<ol class="replies svelte-9yixe8"></ol>'),da=y('<span class="error svelte-9yixe8"> </span>'),va=y('<section class="thread svelte-9yixe8"><a class="back svelte-9yixe8" href="/dashboard/curriculum/forum"><!> Back to forum</a> <article><div class="question-head svelte-9yixe8"><span class="author-row svelte-9yixe8"><!> <span class="author-name svelte-9yixe8"> </span></span> <!></div> <!></article> <!> <form class="reply-form svelte-9yixe8"><textarea placeholder="Add a replyâ¦" rows="4" class="svelte-9yixe8"></textarea> <div class="form-actions svelte-9yixe8"><!> <button type="submit" class="primary svelte-9yixe8"><!> </button></div></form></section>');function Sa(N,d){Ct(d,!0);let Q=h(""),j=h(!1),V=h(""),te=F(()=>d.data.question.lesson_id||null),ae=F(()=>!!e(te)&&e(te).startsWith("sprint:")),ue=F(()=>e(ae)?e(te).slice(7):null),Ve=F(()=>{const o=/^w(\d+)d(\d+)$/.exec(e(ue)??"");return o?`Week ${o[1]}, Day ${o[2]}`:e(ue)}),Ee=F(()=>e(te)&&!e(ae)?Pt(e(te)):null);function Le(o){return new Date(o).toLocaleString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}let Xe=F(()=>d.data.isAdmin||d.data.question.user_id===d.data.userId);function Ze(o){return d.data.isAdmin||o.user_id===d.data.userId}let se=h(!1),ie=h(null),fe=h(!1),re=h(""),le=h(""),O=h(!1),B=h(""),ye=h(null),ne=h(""),W=h(null),Y=h("");function $e(){t(re,d.data.question.title,!0),t(le,d.data.question.body,!0),t(B,""),t(fe,!0)}function et(){t(fe,!1),t(B,"")}async function tt(){if(!e(O)){if(t(B,""),!e(re).trim()){t(B,"Add a title.");return}if(!e(le).trim()){t(B,"Add a question.");return}t(O,!0);try{const o=await fetch(`/api/forum/questions/${d.data.question.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e(re).trim(),body:e(le).trim()})});if(o.ok)t(fe,!1),await xe();else{const x=await o.json().catch(()=>({}));t(B,(x==null?void 0:x.error)||"Could not save.",!0)}}catch{t(B,"Could not save.")}finally{t(O,!1)}}}function at(o){t(ye,o.id,!0),t(ne,o.body,!0),t(Y,"")}function st(){t(ye,null),t(Y,"")}async function it(o){if(!e(W)){if(t(Y,""),!e(ne).trim()){t(Y,"Reply cannot be empty.");return}t(W,o,!0);try{const x=await fetch(`/api/forum/replies/${o}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({body:e(ne).trim()})});if(x.ok)t(ye,null),await xe();else{const l=await x.json().catch(()=>({}));t(Y,(l==null?void 0:l.error)||"Could not save.",!0)}}catch{t(Y,"Could not save.")}finally{t(W,null)}}}async function rt(){if(!e(se)&&confirm("Delete this question and all replies?")){t(se,!0);try{if((await fetch(`/api/forum/questions/${d.data.question.id}`,{method:"DELETE"})).ok){Nt("/dashboard/curriculum/forum");return}alert("Could not delete.")}finally{t(se,!1)}}}async function lt(o){if(!e(ie)&&confirm("Delete this reply?")){t(ie,o,!0);try{(await fetch(`/api/forum/replies/${o}`,{method:"DELETE"})).ok?await xe():alert("Could not delete.")}finally{t(ie,null)}}}async function nt(){if(!(e(j)||!e(Q).trim())){t(j,!0),t(V,"");try{const o=await fetch("/api/forum/replies",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({question_id:d.data.question.id,body:e(Q).trim()})});if(o.ok)t(Q,""),await xe();else{const x=await o.json().catch(()=>({}));t(V,(x==null?void 0:x.error)||"Could not post reply.",!0)}}catch{t(V,"Could not post reply.")}finally{t(j,!1)}}}let ot=F(()=>d.data.replies.filter(o=>!o.parent_reply_id));function dt(o){return d.data.replies.filter(x=>x.parent_reply_id===o)}let oe=h(null),X=h(""),G=h(!1),Z=h("");function vt(o){t(oe,o,!0),t(X,""),t(Z,"")}function ct(){t(oe,null),t(Z,"")}async function ut(o){if(!(e(G)||!e(X).trim())){t(G,!0),t(Z,"");try{const x=await fetch("/api/forum/replies",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({question_id:d.data.question.id,body:e(X).trim(),parent_reply_id:o})});if(x.ok)t(oe,null),t(X,""),await xe();else{const l=await x.json().catch(()=>({}));t(Z,(l==null?void 0:l.error)||"Could not post reply.",!0)}}catch{t(Z,"Could not post reply.")}finally{t(G,!1)}}}var Re=va();St("9yixe8",o=>{Tt(()=>{zt.title=`${d.data.question.title??""} · Course Forum`})});{const o=(l,a=Me,p=Me)=>{var m=Ut();let g;var q=i(m),P=i(q);{let r=F(()=>!a().is_official);Ye(P,{get firstName(){return a().author_name},size:"sm",get colorful(){return e(r)},get accent(){return a().is_official}})}s(q);var T=n(q,2),b=i(T),z=i(b),L=i(z,!0);s(z);var J=n(z,2);{var _=r=>{var u=Ht();v(r,u)};f(J,r=>{a().is_official&&r(_)})}var S=n(J,4),C=i(S,!0);s(S);var A=n(S,2);{var c=r=>{var u=Mt();de(),v(r,u)};f(A,r=>{a().edited_at&&r(c)})}var k=n(A,2),I=i(k);{var $=r=>{var u=Ft();u.__click=()=>vt(a().id);var E=i(u);Jt(E,{size:12}),de(2),s(u),v(r,u)};f(I,r=>{!p()&&e(oe)!==a().id&&r($)})}var H=n(I,2);{var K=r=>{var u=Wt(),E=ce(u);E.__click=()=>at(a());var we=i(E);Ge(we,{size:12}),s(E);var ee=n(E,2);ee.__click=()=>lt(a().id);var Ie=i(ee);{var _e=M=>{ve(M,{size:12,class:"spin"})},me=M=>{Ke(M,{size:12})};f(Ie,M=>{e(ie)===a().id?M(_e):M(me,!1)})}s(ee),R(()=>ee.disabled=e(ie)===a().id),v(r,u)};f(H,r=>{Ze(a())&&e(ye)!==a().id&&r(K)})}s(k),s(b);var U=n(b,2);{var pe=r=>{var u=Gt(),E=i(u);qe(E);var we=n(E,2),ee=i(we);{var Ie=D=>{var Ne=Yt(),Rt=i(Ne,!0);s(Ne),R(()=>w(Rt,e(Y))),v(D,Ne)};f(ee,D=>{e(Y)&&D(Ie)})}var _e=n(ee,2);_e.__click=st;var me=n(_e,2),M=i(me);{var kt=D=>{ve(D,{size:12,class:"spin"})};f(M,D=>{e(W)===a().id&&D(kt)})}var Et=n(M);s(me),s(we),s(u),R(D=>{E.disabled=e(W)===a().id,_e.disabled=e(W)===a().id,me.disabled=D,w(Et,` ${e(W)===a().id?"Savingâ¦":"Save"}`)},[()=>e(W)===a().id||!e(ne).trim()]),ke("submit",u,D=>{D.preventDefault(),it(a().id)}),be(E,()=>e(ne),D=>t(ne,D)),v(r,u)},Ae=r=>{var u=Kt(),E=i(u,!0);s(u),R(()=>w(E,a().body)),v(r,u)};f(U,r=>{e(ye)===a().id?r(pe):r(Ae,!1)})}s(T),s(m),R(r=>{g=We(m,1,"reply svelte-9yixe8",null,g,{child:p(),"is-official":a().is_official,deleting:e(ie)===a().id}),w(L,a().author_name),w(C,r)},[()=>Le(a().created_at)]),v(l,m)};var Ce=i(Re),ft=i(Ce);Lt(ft,{size:14}),de(),s(Ce);var he=n(Ce,2);let x;var De=i(he),Te=i(De),Qe=i(Te);Ye(Qe,{get firstName(){return d.data.askerName},size:"sm",colorful:!0});var je=n(Qe,2),yt=i(je,!0);s(je),s(Te);var pt=n(Te,2);{var _t=l=>{var a=Vt(),p=i(a);p.__click=$e;var m=i(p);Ge(m,{size:14}),s(p);var g=n(p,2);g.__click=rt;var q=i(g);{var P=b=>{ve(b,{size:14,class:"spin"})},T=b=>{Ke(b,{size:14})};f(q,b=>{e(se)?b(P):b(T,!1)})}s(g),s(a),R(()=>g.disabled=e(se)),v(l,a)};f(pt,l=>{e(Xe)&&!e(fe)&&l(_t)})}s(De);var mt=n(De,2);{var bt=l=>{var a=Zt(),p=i(a);At(p);var m=n(p,2);qe(m);var g=n(m,2),q=i(g);{var P=_=>{var S=Xt(),C=i(S,!0);s(S),R(()=>w(C,e(B))),v(_,S)};f(q,_=>
44{e(B)&&_(P)})}var T=n(q,2);T.__click=et;var b=n(T,2),z=i(b);{var L=_=>{ve(_,{size:14,class:"spin"})};f(z,_=>{e(O)&&_(L)})}var J=n(z);s(b),s(g),s(a),R(_=>{p.disabled=e(O),m.disabled=e(O),T.disabled=e(O),b.disabled=_,w(J,` ${e(O)?"Savingâ¦":"Save"}`)},[()=>e(O)||!e(re).trim()||!e(le).trim()]),ke("submit",a,_=>{_.preventDefault(),tt()}),be(p,()=>e(re),_=>t(re,_)),be(m,()=>e(le),_=>t(le,_)),v(l,a)},xt=l=>{var a=sa(),p=ce(a),m=i(p,!0);s(p);var g=n(p,2),q=i(g);{var P=c=>{var k=$t(),I=ce(k),$=i(I);s(I),de(),R(()=>{Pe(I,"href",`/dashboard/sprint/${e(ue)??""}`),w($,`Sprint · ${e(Ve)??""}`)}),v(c,k)},T=c=>{var k=Ue(),I=ce(k);{var $=H=>{var K=ea(),U=ce(K),pe=i(U);s(U),de(),R(()=>{Pe(U,"href",`/dashboard/curriculum/${d.data.question.lesson_id??""}`),w(pe,`${e(Ee).id??""} â ${e(Ee).title??""}`)}),v(H,K)};f(I,H=>{e(Ee)&&H($)},!0)}v(c,k)};f(q,c=>{e(ae)?c(P):c(T,!1)})}var b=n(q,2),z=i(b,!0);s(b);var L=n(b,2);{var J=c=>{var k=ta();de(),v(c,k)};f(L,c=>{d.data.question.edited_at&&c(J)})}var _=n(L,2);{var S=c=>{var k=aa();v(c,k)};f(_,c=>{d.data.question.status==="answered"&&c(S)})}s(g);var C=n(g,2),A=i(C,!0);s(C),R(c=>{w(m,d.data.question.title),w(z,c),w(A,d.data.question.body)},[()=>Le(d.data.question.created_at)]),v(l,a)};f(mt,l=>{e(fe)?l(bt):l(xt,!1)})}s(he);var Oe=n(he,2);{var ht=l=>{var a=oa();Fe(a,21,()=>e(ot),p=>p.id,(p,m)=>{const g=F(()=>dt(e(m).id));var q=na(),P=i(q);o(P,()=>e(m),()=>!1);var T=n(P,2);{var b=z=>{var L=la(),J=i(L);Fe(J,17,()=>e(g),C=>C.id,(C,A)=>{o(C,()=>e(A),()=>!0)});var _=n(J,2);{var S=C=>{var A=ra(),c=i(A);qe(c);var k=n(c,2),I=i(k);{var $=r=>{var u=ia(),E=i(u,!0);s(u),R(()=>w(E,e(Z))),v(r,u)};f(I,r=>{e(Z)&&r($)})}var H=n(I,2);H.__click=ct;var K=n(H,2),U=i(K);{var pe=r=>{ve(r,{size:12,class:"spin"})};f(U,r=>{e(G)&&r(pe)})}var Ae=n(U);s(K),s(k),s(A),R(r=>{Pe(c,"placeholder",`Reply to ${e(m).author_name??""}â¦`),c.disabled=e(G),H.disabled=e(G),K.disabled=r,w(Ae,` ${e(G)?"Postingâ¦":"Reply"}`)},[()=>e(G)||!e(X).trim()]),ke("submit",A,r=>{r.preventDefault(),ut(e(m).id)}),be(c,()=>e(X),r=>t(X,r)),v(C,A)};f(_,C=>{e(oe)===e(m).id&&C(S)})}s(L),v(z,L)};f(T,z=>{(e(g).length>0||e(oe)===e(m).id)&&z(b)})}s(q),v(p,q)}),s(a),v(l,a)};f(Oe,l=>{d.data.replies.length>0&&l(ht)})}var ze=n(Oe,2),ge=i(ze);qe(ge);var Be=n(ge,2),Je=i(Be);{var gt=l=>{var a=da(),p=i(a,!0);s(a),R(()=>w(p,e(V))),v(l,a)};f(Je,l=>{e(V)&&l(gt)})}var Se=n(Je,2),He=i(Se);{var wt=l=>{ve(l,{size:14,class:"spin"})};f(He,l=>{e(j)&&l(wt)})}var qt=n(He);s(Se),s(Be),s(ze),s(Re),R(l=>{x=We(he,1,"question svelte-9yixe8",null,x,{deleting:e(se)}),w(yt,d.data.askerName),ge.disabled=e(j),Se.disabled=l,w(qt,` ${e(j)?"Postingâ¦":"Post reply"}`)},[()=>e(j)||!e(Q).trim()]),ke("submit",ze,l=>{l.preventDefault(),nt()}),be(ge,()=>e(Q),l=>t(Q,l))}v(N,Re),Dt()}It(["click"]);export{Sa as component};
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.