1"use strict";(globalThis.webpackChunkedupark_client||=[]).push([[1409,9224],{66477(e,t,s){s(58878);var a=s(88874),i=s(90782);const n=e=>{let{content:t,className:s="",mode:n="auto"}=e;return(0,i.jsx)(a.A,{content:t,mode:n,className:s})};s.d(t,["A",0,n])},91409(e,t,s){s.r(t);s(58878);var a=s(49350),i=s(4329),n=s(90782);const r=e=>{let{isOpen:t,onClose:s,onConfirm:r,title:l,message:o,confirmText:d="Delete",cancelText:c="Cancel",isLoading:u=!1,loadingText:m="Deleting..."}=e;return(0,n.jsx)(a.a,{isOpen:t,onClose:s,size:"sm",icon:"error",title:l,description:o,footer:(0,n.jsxs)("div",{className:"flex justify-center gap-3",children:[(0,n.jsx)(i.$,{variant:"outline",size:"md",onClick:s,disabled:u,children:c}),(0,n.jsx)(i.$,{variant:"destructive",size:"md",onClick:r,isLoading:u,children:u?m:d})]})})};s.d(t,["default",0,r])},58679(e,t,s){var a=s(58878),i=s(71813),n=s(1060),r=s(19765),l=s(81676),o=s(98639),d=s(90782);const c=["exam_type","exam_section","subject","topic","subtopic","concept","passage_type","general"],u=r.J1` 2 query GetTags($type: String, $search: String, $is_public: Boolean) { 3 getTags(type: $type, search: $search, is_public: $is_public) { 4 id 5 type 6 name 7 description 8 is_public 9 parent_tag_id 10 parent_tag { 11 id 12 type 13 name 14 description 15 is_public 16 parent_tag_id 17 parent_tag { 18 id 19 type 20 name 21 description 22 is_public 23 parent_tag_id 24 parent_tag { 25 id 26 type 27 name 28 description 29 is_public 30 parent_tag_id 31 parent_tag { 32 id 33 type 34 name 35 description 36 is_public 37 parent_tag_id 38 } 39 } 40 } 41 } 42 } 43 } 44`,m=e=>{let{selectedTagIds:t,onTagIdsChange:s,onSelectedTagsChange:r,className:m="",placeholder:g,maxTags:p,publicOnly:x=!1,defaultAddParentTags:h=!0,allowedTypes:b,examTypeId:v,organizationId:f}=e;const{t:y}=(0,i.B)(),[_,j]=(0,a.useState)(""),[N,w]=(0,a.useState)(!1),[I,$]=(0,a.useState)([]),[k,T]=(0,a.useState)(h),{data:z}=(0,n.IT)(u,{...(0,o.X)("session"),variables:{is_public:!!x||void 0,examTypeId:v||void 0}}),{data:C,loading:P}=(0,n.IT)(u,{...(0,o.X)("session"),variables:{search:_||void 0,is_public:!!x||void 0,examTypeId:v||void 0},skip:!N}),O=(0,a.useMemo)(()=>(null===C||void 0===C?void 0:C.getTags)||[],[C]);(0,a.useEffect)(()=>{const e=[...(null===z||void 0===z?void 0:z.getTags)||[],...(null===C||void 0===C?void 0:C.getTags)||[]];e.length>0&&$(t=>{const s=e.filter(e=>!t.some(t=>t.id===e.id));return[...t,...s]})},[z,C]);const A=(0,a.useMemo)(()=>I.filter(e=>t.includes(e.id)),[I,t]);(0,a.useEffect)(()=>{r&&r(A.map(e=>({id:e.id,type:e.type,name:e.name})))},[A,r]);const q=(0,a.useMemo)(()=>O.filter(e=>!t.includes(e.id)&&!(b&&b.length>0&&!b.includes(e.type))),[O,t,b]),S=(0,a.useMemo)(()=>{const e={};return q.forEach(t=>{e[t.type]||(e[t.type]=[]),e[t.type].push(t)}),e},[q]),B=(0,a.useMemo)(()=>(b&&b.length>0?c.filter(e=>b.includes(e)):c).filter(e=>S[e]&&S[e].length>0).map(e=>({type:e,tags:S[e]})),[S,b]);return(0,d.jsxs)("div",{className:`relative ${m}`,children:[t.length>0&&(0,d.jsx)("div",{className:"mb-2 flex flex-wrap gap-1",children:A.map(e=>(0,d.jsxs)("span",{className:`inline-flex items-center px-2 py-1 rounded-md text-sm ${(0,l.iY)(e.type)}`,children:[(0,d.jsx)("span",{className:"mr-1 text-xs bg-primary-200 px-1 rounded",children:(0,l.Fm)(e.type)}),e.name,(0,d.jsx)("button",{type:"button",onClick:()=>(e=>{const a=t.filter(t=>t!==e);s(a)})(e.id),className:"ml-1 text-primary-600 hover:text-primary-800",children:"\xd7"})]},e.id))}),(0,d.jsxs)("div",{className:"mb-2 flex items-center",children:[(0,d.jsx)("input",{type:"checkbox",id:"add-parent-tags",checked:k,onChange:e=>T(e.target.checked),className:"h-4 w-4 text-primary-600 rounded border-border-strong focus:ring-primary-500"}),(0,d.jsx)("label",{htmlFor:"add-parent-tags",className:"ml-2 text-sm text-text-muted",children:y("Add all parent tags automatically")})]}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("input",{type:"text",value:_,onCh
44ange:e=>{j(e.target.value),w(!0)},onFocus:()=>{w(!0)},onBlur:()=>{setTimeout(()=>w(!1),200)},placeholder:null!==g&&void 0!==g?g:y("Search and select tags..."),className:"w-full px-3 py-2 border border-border-strong rounded-md focus:outline-none focus:ring-2 focus:ring-primary-500 focus:border-transparent"}),(0,d.jsx)("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3",children:(0,d.jsx)("svg",{className:"w-4 h-4 text-text-subtle transition-transform "+(N?"rotate-180":""),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,d.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})})]}),N&&(0,d.jsx)("div",{className:"absolute z-10 w-full mt-1 bg-surface-raised border border-border-strong rounded-md shadow-lg max-h-60 overflow-y-auto",children:P?(0,d.jsx)("div",{className:"px-3 py-2 text-text-subtle",children:y("Loading tags...")}):0===q.length?(0,d.jsx)("div",{className:"px-3 py-2 text-text-subtle",children:y(_?"No tags found":"Start typing to search tags")}):B.map(e=>{let{type:a,tags:i}=e;return(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"px-3 py-1 bg-surface-sunken text-xs font-semibold text-text-muted uppercase",children:(0,l.Fm)(a)}),i.map(e=>(0,d.jsx)("button",{type:"button",onClick:()=>(e=>{let a=[...t,e.id];if(k){const t=(e=>{const t=[];let s=e;for(;s&&s.parent_tag;){const e=s.parent_tag.id;t.includes(e)||t.push(e),s=s.parent_tag}return t})(e);t.forEach(e=>{a.includes(e)||a.push(e)})}p&&a.length>p&&(a=[...t,e.id]),s(a),j("")})(e),className:"w-full px-3 py-2 text-left hover:bg-surface-sunken focus:bg-surface-sunken focus:outline-none",disabled:!!p&&t.length>=p,children:(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"font-medium text-text",children:e.name}),e.description&&(0,d.jsx)("div",{className:"text-sm text-text-subtle",children:e.description})]}),!e.is_public&&(0,d.jsx)("span",{className:"text-xs bg-warning-100 text-warning-800 px-1 rounded",children:"Private"})]})},e.id))]},a)})}),p&&t.length>=p&&(0,d.jsxs)("div",{className:"mt-1 text-sm text-warning-600",children:["Maximum ",p," tags selected"]})]})};s.d(t,["A",0,m])},19224(e,t,s){s.r(t),s.d(t,{default:()=>F});var a=s(58878),i=s(71813),n=s(39018),r=s(48987),l=s(37508),o=s(44842),d=s(90523),c=s(75980),u=s(1060),m=s(65852),g=s(81910),p=s(61311),x=s(64199),h=s(15310),b=s(38926),v=s(4329),f=s(68155),y=s(66477),_=s(67122),j=s(58679),N=s(91409),w=s(49381),I=s(8129),$=s(85431),k=s(589),T=s(96725),z=s(98639),C=s(41947),P=s(90782);const O=(e,t)=>{switch(t){case"multiple_choice":return e("Multiple Choice",{context:"problemType"});case"fill_blank":return e("Fill in the Blank",{context:"problemType"});case"essay":return e("Essay",{context:"problemType"});case"multi_select":return e("Multi-select",{context:"problemType"});case"true_false_set":return e("True/False set",{context:"problemType"});case"categorization":return e("Categorization",{context:"problemType"});case"true_false":return e("True/False",{context:"problemType"});case"short_answer":return e("Short Answer",{context:"problemType"});case"matching":return e("Matching",{context:"problemType"});case"ordering":return e("Ordering",{context:"problemType"});case"drag_drop":return e("Drag and Drop",{context:"problemType"});default:return t}},A=e=>{const t=(e.content||[]).find(e=>"text"===e.type&&e.description&&""!==e.description.trim());return(null===t||void 0===t?void 0:t.description)||"(no text content)"},q=e=>{var t,s,l,d,c;let{embedded:q=!1}=e;const{t:S}=(0,i.B)(),{slug:B}=(0,n.g)(),E=(0,n.Zp)(),{org:M,myRole:D,isPlatformAdminView:F}=(0,o.II)(),L=null===M||void 0===M?void 0:M.id,J="owner"===D||"admin"===D||F,[U,V]=(0,a.useState)(""),[R,X]=(0,a.useState)(""),[W,Y]=(0,a.useState)(""),[G,Z]=(0,a.useState)([]),[Q,H]=(0,a.useState)(null),[K,ee]=(0,a.useState)(!1),te=(0,a.useMemo)(()=>({...R?{examTypeId:R}:{},...W?{examSectionId:W}:{},...G.length>0?{tagIds:G}:{},...U.trim()?{search:U.trim()}:{}}),[R,W,G,U]),{data:se,loading:ae,error:ie,fetchMore:ne}=(0,u.IT)($.vY,{variables:{organizationId:L,filters:te,pagination:{limit:50,offset:0}},skip:!L,...(0,z.X)("session")}),[re,le]=(0,a.useState)(!1),{data:oe}=(0,u.IT)(T.Rg,{...(0,z.X)("session")}),de=(null===oe||void 0===oe||null===(t=oe.getExamTypes)||void 0===t?void 0:t.exam_types)||[],{data:ce}=(0,u.IT)(T.jm,{...(0,z.X)("session"),variables:{exam_type_id:R},skip:!R}),ue=(null===ce||void 0===ce||null===(s=ce.getExamSectionsByExamType)||void 0===s?void 0:s.exam_sections)||[],[me,{loading:ge}]=(0,m.n)($.Vp),pe=(null===se||void 0===se||null===(l=se.getOrgProblems)||void 0===l?void 0:l.problems)||[],xe=null!==(d=null===se||void 0===se||null===(c=se.getOrgProblems)||void 0===c?void 0:c.total)&&void 0!==d?d:pe.length,he=pe.length<xe,be=pe.some(e=>!1!==e.is_active),{data:ve}=(0,u.IT)(k.Vgv,{variables:{orgId:L,includePrimaryStudent:!0,excludePersonal:!0},skip:!L||!be,...(0,z.X)("session")}),fe=(0,a.useMemo)(()=>{var e;return(null!==(e=null===ve||void 0===ve?void 0:ve.getOrgClasses)&&void 0!==e?e:[]).filter(e=>!e.isArchived&&!e.closedAt&&!(0,C.LW)(e))},[ve]),ye=e=>E(`/org/${B}/classes/${e}/assignments/new?source=org_bank&return=question-bank`),_e=!!U.trim()||!!R||!!W||G.length>0,je=!(!ae&&0===pe.length&&!_e),Ne=()=>{V(""),X(""),Y(""),Z([])};return(0,P.jsxs)("div",{children:[!q&&(0,P.jsx)(r.H,{title:S("Question Bank"),subtitle:S("Your organization's own questions \u2014 private to your org and used only in the assignments your instructors build, never in adaptive practice."),mascotMood:"none",className:"mb-6"}),je&&(0,P.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-3 mb-6",children:[be&&(0===fe.length?(0,P.jsx)(v.$,{variant:"secondary",size:"md",leftIcon:(0,P.jsx)(g.A,{size:16}),disabled:!0,title:S("Create a class first, then assign these questions to it."),children:S("Use in an assignment")}):(0,P.jsx)(v.$,{onClick:()=>{1!==fe.length?ee(!0):ye(fe[0].id)},variant:"secondary",size:"md",leftIcon:(0,P.jsx)(g.A,{size:16}),children:S("Use in an assignment")})),J&&(0,P.jsx)(v.$,{onClick:()=>E(`/org/${B}/question-bank/new`),variant:"primary",size:"md",leftIcon:(0,P.jsx)(p.A,{size:16}),children:S("Create question")})]}),je&&be&&0===fe.length&&(0,P.jsxs)("p",{className:"-mt-3 mb-6 text-right text-sm text-text-muted",children:[S("To assign these questions,")," ",(0,P.jsx)("button",{type:"button",onClick:()=>E(`/org/${B}/classes`),className:"font-medium text-brand hover:underline",children:S("create a class first")}),"."]}),(0,P.jsxs)("div",{className:"bg-gradient-to-br from-surface-raised to-surface-sunken rounded-3xl shadow-elevation-md ring-1 ring-neutral-100 p-4 mb-6 space-y-4",children:[(0,P.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[(0,P.jsx)("input",{type:"text",value:U,onChange:e=>V(e.target.value),placeholder:S("Search questions..."),className:"px-3 py-2 border border-border-strong rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-primary-500"}),(0,P.jsxs)("select",{value:R,onChange:e=>{X(e.target.value),Y("")},className:"px-3 py-2 border border-border-strong rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-primary-500",children:[(0,P.jsx)("option",{value:"",children:S("All exam types")}),de.map(e=>(0,P.jsx)("option",{value:e.id,children:e.display_name||e.name},e.id))]}),(0,P.jsxs)("select",{value:W,onChange:e=>Y(e.target.value),disabled:!R,className:"px-3 py-2 border border-border-strong rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-primary-500 disabled:bg-surface-sunken disabled:text-text-subtle",children:[(0,P.jsx)("option",{value:"",children:S("All sections")}),ue.map(e=>(0,P.jsx)("option",{value:e.id,children:e.display_name||e.name},e.id))]})]}),(0,P.jsxs)("div",{children:[(0,P.jsx)("label",{className:"block text-xs font-medium text-text-muted mb-1",children:S("Filter by tags")}),(0,P.jsx)(j.A,{selectedTagIds:G,onTagIdsChange:Z,placeholder:S("Filter by tags..."),maxTags:10,defaultAddParentTags:!1,organizationId:L})]}),_e&&(0,P.jsx)("button",{onClick:Ne,className:"text-sm text-primary-600 hover:text-primary-800",children:S("Clear filters")})]}),ie&&(0,P.jsx)("div",{className:"bg-error-50 ring-1 ring-error-200 rounded-2xl p-4 mb-6 text-sm text-error-700",children:S("Error loading questions: {{message}}",{message:ie.message})}),ae&&0===pe.length&&(0,P.jsxs)("div",{className:"bg-surface-raised rounded-3xl shadow-elevation-md ring-1 ring-neutral-100 overflow-hidden animate-pulse",children:[(0,P.jsxs)("div",{className:"flex items-center gap-4 px-4 py-3 bg-surface-sunken",children:[(0,P.jsx)(_.l1,{animate:!1,className:"h-3 flex-1 max-w-[12rem]"}),(0,P.jsx)(_.l1,{animate:!1,className:"h-3 w-20"}),(0,P.jsx)(_.l1,{animate:!1,className:"h-3 w-16"}),(0,P.jsx)(_.l1,{animate:!1,className:"h-3 w-16 ml-auto"})]}),[1,2,3,4,5].map(e=>(0,P.jsxs)("div",{className:"flex items-center gap-4 px-4 py-3 border-t border-border",children:[(0,P.jsxs)("div",{className:"flex-1 max-w-md
44space-y-2",children:[(0,P.jsx)(_.l1,{animate:!1,className:"h-4 w-full"}),(0,P.jsx)(_.l1,{animate:!1,className:"h-3 w-2/3"})]}),(0,P.jsx)(_.l1,{animate:!1,className:"h-4 w-24"}),(0,P.jsx)(_.l1,{animate:!1,rounded:"full",className:"h-5 w-16"}),(0,P.jsx)(_.l1,{animate:!1,className:"h-4 w-20 ml-auto"})]},e))]}),!ae&&0===pe.length&&_e&&(0,P.jsxs)("div",{className:"text-center py-16 border border-dashed border-border-strong rounded-lg",children:[(0,P.jsx)(x.A,{className:"mx-auto h-10 w-10 text-text-subtle"}),(0,P.jsx)("h3",{className:"mt-3 text-sm font-medium text-text",children:S("No questions match your filters")}),(0,P.jsx)("p",{className:"mt-1 text-sm text-text-subtle",children:(0,P.jsx)("button",{onClick:Ne,className:"text-primary-600 hover:text-primary-800",children:S("Clear filters")})})]}),!ae&&0===pe.length&&!_e&&(0,P.jsxs)(f.Z,{variant:"soft",padding:"lg",className:"text-center",children:[(0,P.jsx)("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-brand-subtle",children:(0,P.jsx)(x.A,{className:"h-7 w-7 text-brand"})}),(0,P.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text",children:S(J?"Build your question bank":"No questions yet")}),(0,P.jsx)("p",{className:"mx-auto mt-2 max-w-md text-sm text-text-muted",children:S(J?"Author your org's own questions and assign them to your classes \u2014 private to your org, never in adaptive practice.":"Your organization hasn't added any questions yet. Ask an admin to build the bank.")}),J&&(0,P.jsx)("div",{className:"mt-6 flex justify-center",children:(0,P.jsx)(v.$,{onClick:()=>E(`/org/${B}/question-bank/new`),variant:"primary",size:"md",leftIcon:(0,P.jsx)(p.A,{size:16}),children:S("Create your first question")})})]}),pe.length>0&&(0,P.jsxs)("div",{className:I.B.scroll,children:[(0,P.jsx)("div",{className:I.B.wrapper,children:(0,P.jsxs)("table",{className:"w-full min-w-[560px]",children:[(0,P.jsx)("thead",{children:(0,P.jsxs)("tr",{className:I.B.headerRow,children:[(0,P.jsx)("th",{className:I.B.headerCell,children:S("Question")}),(0,P.jsx)("th",{className:I.B.headerCell,children:S("Type")}),(0,P.jsx)("th",{className:I.B.headerCell,children:S("Status")}),J&&(0,P.jsx)("th",{className:I.B.headerCellRight,children:S("Actions")})]})}),(0,P.jsx)("tbody",{className:I.B.body,children:pe.map(e=>(0,P.jsxs)("tr",{className:"hover:bg-surface-sunken transition-colors",children:[(0,P.jsxs)("td",{className:`${I.B.cell} max-w-md`,children:[(0,P.jsx)("div",{className:"text-sm text-text line-clamp-2",children:(0,P.jsx)(y.A,{content:A(e)})}),e.tags&&e.tags.length>0&&(0,P.jsx)("div",{className:"mt-1 flex flex-wrap gap-1",children:e.tags.slice(0,4).map(e=>(0,P.jsx)("span",{className:"inline-block px-1.5 py-0.5 text-xs bg-surface-sunken text-text-muted rounded",children:e.name},e.id))})]}),(0,P.jsx)("td",{className:`${I.B.cell} ${I.B.cellSecondary} text-sm whitespace-nowrap`,children:O(S,e.type)}),(0,P.jsx)("td",{className:`${I.B.cell} whitespace-nowrap`,children:!1===e.is_active?(0,P.jsx)("span",{className:"inline-block px-2 py-0.5 text-xs bg-surface-sunken text-text-subtle rounded-full",children:S("Removed")}):(0,P.jsx)("span",{className:"inline-block px-2 py-0.5 text-xs bg-success-100 text-success-700 rounded-full",children:S("Active",{context:"status"})})}),J&&(0,P.jsx)("td",{className:`${I.B.cell} text-right whitespace-nowrap`,children:(0,P.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,P.jsxs)("button",{onClick:()=>E(`/org/${B}/question-bank/${e.id}`),className:"inline-flex items-center gap-1 px-2 py-1 text-sm text-primary-600 hover:text-primary-800",title:S("Edit question"),children:[(0,P.jsx)(h.A,{size:14}),S("Edit")]}),!1!==e.is_active&&(0,P.jsxs)("button",{onClick:()=>H(e),className:"inline-flex items-center gap-1 px-2 py-1 text-sm text-error-600 hover:text-error-800",title:S("Delete question"),children:[(0,P.jsx)(b.A,{size:14}),S("Delete")]})]})})]},e.id))})]})}),(0,P.jsxs)("div",{className:"px-4 py-3 flex items-center justify-between border-t border-border",children:[(0,P.jsx)("span",{className:"text-sm text-text-subtle",children:S("Showing {{shown}} of {{total}} questions",{shown:pe.length,total:xe})}),he&&(0,P.jsx)("button",{onClick:async()=>
44{if(L){le(!0);try{var e,t,s;await ne({variables:{organizationId:L,filters:te,pagination:{limit:50,offset:null!==(e=null===se||void 0===se||null===(t=se.getOrgProblems)||void 0===t||null===(s=t.problems)||void 0===s?void 0:s.length)&&void 0!==e?e:0}},updateQuery:(e,t)=>{var s,a;let{fetchMoreResult:i}=t;return null!==i&&void 0!==i&&i.getOrgProblems?{getOrgProblems:{...i.getOrgProblems,problems:[...null!==(s=null===e||void 0===e||null===(a=e.getOrgProblems)||void 0===a?void 0:a.problems)&&void 0!==s?s:[],...i.getOrgProblems.problems]}}:e}})}finally{le(!1)}}},disabled:re,className:"text-sm font-medium text-primary-600 hover:text-primary-800 disabled:opacity-50",children:S(re?"Loading...":"Load more")})]})]}),(0,P.jsx)(w.A,{isOpen:K,onClose:()=>ee(!1),classes:fe,orgSlug:B||"",onPick:ye}),(0,P.jsx)(N.default,{isOpen:!!Q,onClose:()=>H(null),onConfirm:async()=>{if(L&&Q)try{var e,t;const i=await me({variables:{organizationId:L,id:Q.id},refetchQueries:[{query:$.vY,variables:{organizationId:L,filters:te,pagination:{limit:50,offset:0}}}]});var s,a;if(null!==(e=i.data)&&void 0!==e&&null!==(t=e.deleteOrgProblem)&&void 0!==t&&t.success)H(null);else console.error("Failed to delete org question:",null===(s=i.data)||void 0===s||null===(a=s.deleteOrgProblem)||void 0===a?void 0:a.error)}catch(i){console.error("Error deleting org question:",i)}},title:S("Delete question"),message:S("Delete this question? If it is used in an assignment, that assignment keeps working \u2014 the question is just dropped from future plays. This cannot be undone."),confirmText:S("Delete"),isLoading:ge})]})};
44var S=s(66736),B=s(56480),E=s(41401),M=s(286);const D=e=>{let{orgId:t,readOnly:s=!1,openSetId:n}=e;const{t:r}=(0,i.B)(),[l,o]=(0,a.useState)(null),[d,c]=(0,a.useState)(!1),m=(0,a.useRef)(!1);(0,a.useEffect)(()=>{n&&!m.current&&(m.current=!0,o(n),c(!0))},[n]);const{data:g,loading:x,refetch:b}=(0,u.IT)(E.Bl,{variables:{organizationId:t},skip:!t,...(0,z.X)("session")}),y=(null===g||void 0===g?void 0:g.vocabStudySets)||[],j=()=>{o(null),c(!0)};return(0,P.jsxs)("div",{children:[(0,P.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-4",children:[(0,P.jsxs)("div",{className:"min-w-0",children:[(0,P.jsx)("h2",{className:"text-lg font-semibold text-text",children:r("Vocab Units")}),(0,P.jsx)("p",{className:"text-sm text-text-subtle",children:r("Reusable word lists you can build quizzes from in any class.")})]}),!s&&y.length>0&&(0,P.jsx)(v.$,{variant:"secondary",size:"sm",onClick:j,leftIcon:(0,P.jsx)(p.A,{size:14}),children:r("New unit")})]}),x&&0===y.length?(0,P.jsx)("div",{className:"space-y-2",children:[0,1,2].map(e=>(0,P.jsx)(_.l1,{className:"h-14 w-full rounded-2xl"},e))}):0===y.length?(0,P.jsxs)(f.Z,{variant:"soft",padding:"lg",className:"text-center",children:[(0,P.jsx)(S.A,{className:"mx-auto h-10 w-10 mb-3 text-text-subtle"}),(0,P.jsx)("p",{className:"text-text-muted mb-1",children:r("No vocab units yet.")}),(0,P.jsx)("p",{className:"text-sm text-text-subtle mb-4",children:r("Curate a reusable vocab unit, then build quizzes from it across your classes without repeating words.")}),!s&&(0,P.jsx)(v.$,{variant:"primary",size:"sm",onClick:j,leftIcon:(0,P.jsx)(p.A,{size:14}),children:r("Create your first unit")})]}):(0,P.jsx)(f.Z,{variant:"soft",padding:"lg",children:(0,P.jsx)("ul",{className:"divide-y divide-border-subtle",children:y.map(e=>{var t;return(0,P.jsxs)("li",{className:"flex items-center justify-between gap-3 py-2.5",children:[(0,P.jsxs)("div",{className:"min-w-0",children:[(0,P.jsx)("p",{className:"text-sm font-medium text-text truncate",children:e.name}),(0,P.jsx)("p",{className:"text-xs text-text-subtle",children:r("{{count}} words",{count:e.wordCount})})]}),(0,P.jsxs)("div",{className:"flex items-center gap-2 flex-shrink-0",children:[0===(null!==(t=e.sharedWordCount)&&void 0!==t?t:0)?(0,P.jsx)(B.E,{variant:"success",size:"xs",children:r("Unique",{context:"vocabUnit"})}):(0,P.jsx)("span",{title:r("Words shared with other units"),children:(0,P.jsx)(B.E,{variant:"neutral",size:"xs",children:r("{{count}} shared",{count:e.sharedWordCount})})}),!s&&(0,P.jsx)("button",{type:"button",onClick:()=>{return t=e.id,o(t),void c(!0);var t},className:"text-text-subtle hover:text-brand","aria-label":r("Edit {{name}}",{name:e.name}),children:(0,P.jsx)(h.A,{size:14})})]})]},e.id)})})}),d&&(0,P.jsx)(M.A,{isOpen:d,setId:l,orgId:t,onClose:()=>c(!1),onSaved:()=>{c(!1),b()}})]})},F=()=>{const{t:e}=(0,i.B)(),{org:t}=(0,o.II)(),s=null===t||void 0===t?void 0:t.id,{isEnabled:u}=(0,d.u)(c.mr),[m,g]=(0,n.ok)(),p=m.get("set"),x=(0,a.useMemo)(()=>u?p||"vocab"===m.get("tab")?"vocab":"problems":"vocab",[u,m,p]);return(0,P.jsxs)("div",{children:[(0,P.jsx)(r.H,{title:e(u?"Content Library":"Vocab Units"),subtitle:e(u?"Your organization's reusable teaching content \u2014 question bank and vocab units \u2014 private to your org and assignable into any class.":"Reusable vocab units \u2014 curate a word list once and build quizzes from it in any class without repeating words."),mascotMood:"none",className:"mb-6"}),u&&(0,P.jsx)("div",{className:"mb-6",children:(0,P.jsx)(l.I,{ariaLabel:e("Content library sections"),activeId:x,onChange:e=>{return g("problems"===(t=e)?{}:{tab:t},{replace:!0});var t},items:[{id:"problems",label:e("Problems")},{id:"vocab",label:e("Vocab Units")}]})}),"problems"===x?(0,P.jsx)(q,{embedded:!0}):s?(0,P.jsx)(D,{orgId:s,openSetId:p}):null]})}},85431(e,t,s){var a=s(19765),i=s(54484),n=s(54966);const r=a.J1` 45 fragment OrgProblemVisualExplanationFields on Problem { 46 visual_explanation { 47 steps { 48 stepNumber 49 title 50 instruction 51 highlights { 52 target 53 ranges { 54 start 55 end 56 text 57 } 58 answerIndex 59 color 60 style 61 } 62 concept 63 conceptExplanation 64 equationTransform { 65 before 66 operation 67 after 68 highlightParts { 69 before { 70 latex 71 color 72 } 73 after { 74 latex 75 color 76 } 77 } 78 } 79 learningModuleId 80 learningModules { 81 id 82 concept 83 title 84 } 85 keyFormulas { 86 name 87 latex 88 description 89 } 90 diagramHighlights { 91 elementId 92 action 93 color 94 annotation 95 } 96 diagramContent { 97 mode 98 svgContent 99 title 100 } 101 phase 102 givenInfo 103 findTarget 104 verificationCheck 105 eliminateAnswers 106 answerAnnotations { 107 answerIndex 108 label 109 type 110 } 111 passageSimplifications { 112 range { 113 start 114 end 115 } 116 simplified 117 } 118 passageCrossouts { 119 start 120 end 121 } 122 mathWorkLines 123 calloutTarget 124 highlightLegend { 125 color 126 label 127 } 128 } 129 wrongAnswerExplanations { 130 answerIndex 131 label 132 explanation 133 commonMisconception 134 mistakeType 135 commonMistake 136 } 137 correctAnswerExplanation { 138 answerIndex 139 label 140 explanation 141 keyInsight 142 } 143 keyFormulas { 144 name 145 latex 146 description 147 } 148 relatedModules { 149 id 150 title 151 } 152 insights { 153 testMakerTraps { 154 trapType 155 description 156 affectedAnswerIndices 157 revealTiming 158 stepNumber 159 } 160 expertTips { 161 category 162 tip 163 timing 164 stepNumber 165 priority 166 } 167 conceptConnections { 168 connectionType 169 description 170 moduleId 171 moduleTitle 172 } 173 } 174 } 175 } 176`,l=a.J1` 177 query GetOrgProblems( 178 $organizationId: ID! 179 $filters: OrgProblemFilters 180 $pagination: OrgPaginationInput 181 ) { 182 getOrgProblems( 183 organizationId: $organizationId 184 filters: $filters 185 pagination: $pagination 186 ) { 187 problems { 188 id 189 content { 190 type 191 description 192 image_alt 193 image_src 194 width 195 height 196 format 197 svg_content 198 svg_description 199 svg_caption 200 svg_title 201 svg_width 202 svg_height 203 svg_config 204 table_headers 205 table_rows 206 table_footnote 207 table_title 208 table_column_group { 209 label 210 columns 211 } 212 } 213 type 214 subject 215 tag_ids 216 tags { 217 id 218 type 219 name 220 description 221 is_public 222 parent_tag_id 223 } 224 options 225 ...ProblemOptionBlocksFields 226 solutions 227 explanation 228 official_sources 229 is_active 230 is_public 231 is_verified 232 passage_id 233 passage { 234 id 235 title 236 content 237 metadata 238 created_at 239 updated_at 240 created_by 241 author { 242 email 243 } 244 } 245 created_at 246 authored_by 247 } 248 total 249 hasMore 250 } 251 } 252 ${i.O2} 253`,o=a.J1` 254 query GetOrgProblem($organizationId: ID!, $id: ID!) { 255 getOrgProblem(organizationId: $organizationId, id: $id) { 256 id 257 content { 258 type 259 description 260 image_alt 261 image_src 262 width 263 height 264 format 265 svg_content 266 svg_description 267 svg_caption 268 svg_title 269 svg_width 270 svg_height 271 svg_config 272 table_headers 273 table_rows 274 table_footnote 275 table_title 276 table_column_group { 277 label 278 columns 279 } 280 } 281 type 282 subject 283 tag_ids 284 tags { 285 id 286 type 287 name 288 description 289 is_public 290 parent_tag_id 291 } 292 options 293 ...ProblemOptionBlocksFields 294 solutions 295 explanation 296 ...OrgProblemVisualExplanationFields 297 official_sources 298 is_active 299 is_public 300 is_verified 301 passage_id 302 passage { 303 id 304 title 305 content 306 metadata 307 created_at 308 updated_at 309 created_by 310 author { 311 email 312 } 313 } 314 created_at 315 authored_by 316 } 317 } 318 ${r} 319 ${i.O2} 320`,d=a.J1` 321 query GetOrgProblemPassages($organizationId: ID!) { 322 getOrgProblemPassages(organizationId: $organizationId) { 323 id 324 title 325 content 326 metadata 327 ${n.pI} 328 is_verified 329 is_active 330 verified_at 331 created_at 332 updated_at 333 created_by 334 author { 335 email 336 } 337 } 338 } 339`,c=a.J1` 340 mutation GenerateProblemEnrichment($input: ProblemEnrichmentInput!) { 341 generateProblemEnrichment(input: $input) { 342 suggestedTagIds 343 suggestedDifficultyTagId 344 suggestedTags { 345 tagId 346 tagName 347 tagType 348 confidence 349 isParentTag 350 } 351 explanation 352 visualExplanation 353 inferredTagIds 354 sectionTagWarning 355 warnings 356 } 357 } 358`,u=a.J1` 359 mutation CreateOrgProblem( 360 $organizationId: ID! 361 $input: CreateOrgProblemInput! 362 ) { 363 createOrgProblem(organizationId: $organizationId, input: $input) { 364 success 365 problem { 366 id 367 content { 368 type 369 description 370 image_alt 371 image_src 372 width 373 height 374 format 375 svg_content 376 svg_description 377 svg_caption 378 svg_title 379 svg_width 380 svg_height 381 svg_config 382 table_headers 383 table_rows 384 table_footnote 385 table_title 386 table_column_group { 387 label 388 columns 389 } 390 } 391 type 392 subject 393 options 394 ...ProblemOptionBlocksFields 395 solutions 396 explanation 397 ...OrgProblemVisualExplanationFields 398 official_sources 399 tag_ids 400 is_active 401 is_public 402 is_verified 403 passage_id 404 created_at 405 authored_by 406 } 407 error 408 } 409 } 410 ${r} 411 ${i.O2} 412`,m=a.J1` 413 mutation UpdateOrgProblem( 414 $organizationId: ID! 415 $id: ID! 416 $input: UpdateOrgProblemInput! 417 ) { 418 updateOrgProblem(organizationId: $organizationId, id: $id, input: $input) { 419 success 420 problem { 421 id 422 content { 423 type 424 description 425 image_alt 426 image_src 427 width 428 height 429 format 430 svg_content 431 svg_description 432 svg_caption 433 svg_title 434 svg_width 435 svg_height 436 svg_config 437 table_headers 438 table_rows 439 table_footnote 440 table_title 441 table_column_group { 442 label 443 columns 444 } 445 } 446 type 447 subject 448 options 449 ...ProblemOptionBlocksFields 450 solutions 451 explanation 452 ...OrgProblemVisualExplanationFields 453 official_sources 454 tag_ids 455 is_active 456 is_public 457 is_verified 458 passage_id 459 created_at 460 authored_by 461 } 462 error 463 } 464 } 465 ${r} 466 ${i.O2} 467`,g=a.J1` 468 mutation DeleteOrgProblem($organizationId: ID!, $id: ID!) { 469 deleteOrgProblem(organizationId: $organizationId, id: $id) { 470 success 471 error 472 } 473 } 474`,p=a.J1` 475 mutation CreateOrgProblemPassage( 476 $organizationId: ID! 477 $input: CreateOrgProblemPassageInput! 478 ) { 479 createOrgProblemPassage(organizationId: $organizationId, input: $input) { 480 success 481 passage { 482 id 483 title 484 content 485 metadata 486 ${n.oN} 487 created_at 488 updated_at 489 created_by 490 author { 491 email 492 } 493 } 494 error 495 } 496 } 497`,x=a.J1` 498 mutation UpdateOrgProblemPassage( 499 $organizationId: ID! 500 $id: ID! 501 $input: UpdateOrgProblemPassageInput! 502 ) { 503 updateOrgProblemPassage(organizationId: $organizationId, id: $id, input: $input) { 504 success 505 passage { 506 id 507 title 508 content 509 metadata 510 ${n.oN} 511 created_at 512 updated_at 513 created_by 514 author { 515 email 516 } 517 } 518 error 519 } 520 } 521`;s.d(t,["Aw",0,o,"G",0,u,"JU",0,m,"Vp",0,g,"Zv",0,p,"i7",0,x,"oO",0,d,"vY",0,l,"yX",0,c])}}]);
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.