1/*! For license information please see 3032.app.86296b90ad85204e9b0d.js.LICENSE.txt */ 2"use strict"; 3!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._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c15cf979-9e5b-5995-be58-d8a3bba1d286")}catch(e){}}(); 4(self.webpackChunkcodio_dashboard=self.webpackChunkcodio_dashboard||[]).push([[3032],{38575(e,t,s){s.d(t,{A:()=>a});var n=s(37095),r=s(210);const i=n.A.createActions({addSource:{asyncResult:!0,sync:!1},removeSource:{asyncResult:!0,sync:!1},useSource:{asyncResult:!0,sync:!1},unUseSource:{asyncResult:!0,sync:!1},checkForSourceUpdates:{asyncResult:!0,sync:!1},updateSources:{asyncResult:!0,sync:!1}});i.addSource.listenAndPromise(((e,t,s)=>r.W9.addSource(e,t,s))),i.removeSource.listenAndPromise(((e,t,s)=>r.W9.removeSource(e,t,s))),i.useSource.listenAndPromise(((e,t,s)=>r.W9.useSource(e,t,s))),i.unUseSource.listenAndPromise(((e,t,s)=>r.W9.unUseSource(e,t,s))),i.checkForSourceUpdates.listenAndPromise((async(e,t,s)=>r.W9.checkForSourceUpdates(e,t,s))),i.updateSources.listenAndPromise((async(e,t,s)=>r.W9.updateSources(e,t,s)));const a=i},7676(e,t,s){s.d(t,{A:()=>a});var n=s(37095),r=s(210);const i=n.A.createActions({create:{asyncResult:!0,sync:!1},update:{asyncResult:!0,sync:!1},remove:{asyncResult:!0,sync:!1}});i.create.listenAndPromise((e=>r.IB.create(e))),i.update.listenAndPromise((e=>r.IB.update(e))),i.remove.listenAndPromise(((e,t)=>r.IB.remove(e,t)));const a=i},52294(e,t,s){s.d(t,{A:()=>a});var n=s(37095),r=s(210);const i=n.A.createActions({reset:{asyncResult:!0,sync:!1},isLtiAllowed:{asyncResult:!0,sync:!1},listCommonCartridgeExports:{asyncResult:!0,sync:!1},initCommonCartridgeExports:{asyncResult:!0,sync:!1},applyLmsIdentificationField:{asyncResult:!0,sync:!1}});i.reset.listenAndPromise((e=>r.l1.reset(e))),i.isLtiAllowed.listenAndPromise((e=>r.l1.isLtiAllowed(e))),i.listCommonCartridgeExports.listenAndPromise((e=>r.l1.listCommonCartridgeExports(e))),i.initCommonCartridgeExports.listenAndPromise((e=>r.l1.initCommonCartridgeExports(e))),i.applyLmsIdentificationField.listenAndPromise(((e,t)=>r.l1.applyLmsIdentificationField(e,t)));const a=i},85221(e,t,s){s.d(t,{A:()=>a});var n=s(37095),r=s(210);const i=n.A.createActions({create:{asyncResult:!0,sync:!1},update:{asyncResult:!0,sync:!1},remove:{asyncResult:!0,sync:!1}});i.create.listenAndPromise((e=>r.ws.create(e))),i.update.listenAndPromise((e=>r.ws.update(e))),i.remove.listenAndPromise((e=>r.ws.remove(e)));const a=i},62238(e,t,s){s.d(t,{A:()=>u});var n=s(85979),r=s(44094),i=(s(96540),s(2543)),a=s.n(i),l=s(94861),o=s(76359),d=s(74848),c=s(48320);const u=a().flowRight(l.N$,o.s)((e=>{var t=(0,c.dC)(1);try{const{name:t,onChange:s,value:i,disabled:l,setValue:o,isFormDisabled:c,label:u}=e,h=e=>{const t=e.currentTarget.checked;o(t),a().isFunction(s)&&s(t)},m=(0,d.jsx)(r.A,{checked:!!i,onChange:h,disabled:c||l,name:t});return u?(0,d.jsx)(n.A,{control:m,label:u}):m}finally{t.f()}}))},17965(e,t,s){s.d(t,{A:()=>R});var n=s(53988),r=s(60673),i=s(76832),a=s(26411),l=s(20743),o=s(59763),d=s(23807),c=s(13285),u=s(96540),h=s(94861),m=s(2543),A=s.n(m),p=s(91048),g=s(99853),x=s(76359),v=s(41622),y=s(68240),j=s(71263),f=s(23633),b=s(74848),C=s(48320);const S=u.forwardRef(((e,t)=>{const s=u.useRef(),[n,r]=u.useState(""),[i,a]=u.useState(""),l=()=>{s.current?.close()};return(0,u.useImperativeHandle)(t,(()=>({open:(e,t)=>(r(e||""),a(t||""),s.current?.open()),close:l}))),(0,b.jsx)(j.A,{ref:s,title:i?"Edit support url":"Add support url",variant:"medium",children:(0,b.jsxs)(c.A,{spacing:1,children:[(0,b.jsx)(f.A,{name:"text",label:"Text",required:!0,autoFocus:!0,fullWidth:!0,value:n}),(0,b.jsx)(f.A,{name:"url",label:"Url",required:!0,fullWidth:!0,value:i})]})})})),w=({children:e,value:t,fullWidth:s,disabled:h,isError:m,required:x,setValue:j,isFormDisabled:f,sx:w})=>{var R=(0,C.dC)(1);try{const C=u.useRef(),R=t||[],U=async()=>{const e=await C.current.open();e&&j([...R,e])},F=e=>{const s=A().cloneDeep(t),n=s.splice(e,1);A().isEmpty(s)||(s[0].isDefault=s[0].isDefault||n[0].isDefault),j(s)},I=async e=>{const s=A().cloneDeep(t),n=s[e],r=await C.current.open(n.text,n.url);r&&(r.text===n.text&&r.url===n.url||(s.splice(e,1,r),j(s)))},P=(0,u.useMemo)((()=>(0,v.$C)(8)),[]);return(0,b.jsxs)(n.A,{fullWidth:s,disabled:h||f,error:m,required:x,sx:w,children:[(0,b.jsx)(d.A,{htmlFor:P,children:"Student Support Chat URL"}),(0,b.jsx)(y.A,{variant:"outlined",children:A().map(R,((e,t)=>(0,b.jsx)(y.c,{children:(0,b.jsxs)(c.A,{spacing:2,direction:"row",sx:{flex:1},children:[(0,b.jsxs)(c.A,{spacing:0,sx:{flex:1},children:[(0,b.jsx)(o.A,{children:e.text}),(0,b.jsx)(o.A,{variant:"body2",children:e.url})]}),(0,b.jsxs)(c.A,{spacing:1,direction:"row",children:[(0,b.jsx)(a.A,{title:"Edit",children:(0,b.jsx)("span",{children:(0,b.jsx)(l.A,{onClick:()=>I(t),"aria-label":"Edit",disabled:h||f,children:(0,b.jsx)(g.A,{})})})}),(0,b.jsx)(a.A,{title:"Delete",children:(0,b.jsx)("span",{children:(0,b.jsx)(l.A,{onClick:()=>F(t),"aria-label":"Delete",disabled:h||f,color:"error",children:(0,b.jsx)(p.A,{})})})})]})]})},t)))}),(0,b.jsx)(r.A,{children:(0,b.jsx)(i.A,{variant:"contained",onClick:U,disabled:h||f,children:"Add support url"})}),A().isEmpty(R)?e:null,(0,b.jsx)(S,{ref:C})]})}finally{R.f()}};w.displayName="ContactUrls";const R=A().flowRight(h.N$,x.s)(w)}
4,87398(e,t,s){s.d(t,{A:()=>v});var n=s(53988),r=s(23807),i=s(47086),a=s(74353),l=s.n(a),o=s(96540),d=s(94861),c=s(2543),u=s.n(c),h=s(54532),m=s(76359),A=s(41622),p=s(74848),g=s(48320);const x=e=>{var t=(0,g.dC)(1);try{const{id:t,label:s,readOnly:a,onChange:d=()=>{},setValue:c,isPristine:m,required:g,errorMessage:x,isFormDisabled:v,value:y,fullWidth:j,forceValidate:f,needValidation:b=!0,showError:C,showRequired:S,autoFocus:w,hintText:R,disabled:U,sx:F,minDate:I,maxDate:P,clearable:E}=e,k=e=>{const t=e?.toDate()||null;c(t),d(t)},L=(f||!m)&&b&&(C||S);let q=R;const D=t||(0,o.useMemo)((()=>(0,A.$C)(8)),[]);return q&&u().isString(q)&&(q=(0,p.jsx)(i.A,{error:!1,children:R})),(0,p.jsxs)(n.A,{fullWidth:j,disabled:U||v,error:L,required:g,sx:F,children:[s?(0,p.jsx)(r.A,{htmlFor:D,children:s}):null,(0,p.jsx)(h.l,{autoFocus:w,value:y?l()(y):null,readOnly:a,onChange:k,minDate:I?l()(I):void 0,maxDate:P?l()(P):void 0,disabled:U||v,slotProps:{field:{clearable:E,id:D}}}),L&&x?(0,p.jsx)(i.A,{children:x}):null,q||null]})}finally{t.f()}};x.displayName="FormDatePicker";const v=u().flowRight(d.N$,m.s)(x)},78476(e,t,s){s.d(t,{A:()=>c});s(96540);var n=s(94861),r=s(2543),i=s.n(r),a=s(76359),l=s(30775),o=s(74848),d=s(48320);const c=i().flowRight(n.N$,a.s)((e=>{var t=(0,d.dC)(1);try{const{name:t,label:s,onChange:n=()=>{},setValue:r,isPristine:i,required:a,errorMessage:d,isFormDisabled:c,value:u,fullWidth:h,forceValidate:m,needValidation:A=!0,showError:p,showRequired:g,hintText:x,disabled:v,defaultValue:y="",theme:j="vs",language:f="javascript",options:b={minimap:{enabled:!1}},height:C=200,showPanel:S,autoFocus:w,onEditorDidMount:R}=e,U=e=>{r(e),n(e)},F=(m||!i)&&A&&(p||g);return(0,o.jsx)(l.A,{name:t,label:s,onChange:U,required:a,isError:F,errorMessage:d,disabled:v||c,value:u,fullWidth:h,hint:x,defaultValue:y,theme:j,language:f,options:b,height:C,showPanel:S,autoFocus:w,onEditorDidMount:R})}finally{t.f()}}))},11111(e,t,s){s.d(t,{A:()=>p});var n=s(791),r=s(85979),i=(s(96540),s(2543)),a=s.n(i),l=s(94861),o=s(9594),d=s(46942),c=s.n(d),u=s(76359),h=s(74848),m=s(48320);const A=(0,o.Ay)(r.A,{name:"MuiCodioSwitchFormControlLabel",slot:"root"})((()=>({"& .MuiFormControlLabel-label":{flex:1},"&.MuiCodioSwitchFormControlLabel-edge-labelTop":{marginTop:"1.4375em"}}))),p=a().flowRight(l.N$,u.s)((e=>{var t=(0,m.dC)(1);try{const{name:t,onChange:s,value:r,disabled:i,setValue:l,isFormDisabled:o,label:d,sx:u,edge:m}=e,p=e=>{const t=e.currentTarget.checked;l(t),a().isFunction(s)&&s(t)},g=(0,h.jsx)(n.A,{checked:!!r,onChange:p,disabled:o||i,name:t}),x=c()("MuiCodioSwitchFormControlLabel-root",e.className,{"MuiCodioSwitchFormControlLabel-edge-labelTop":"labelTop"===m});return(0,h.jsx)(A,{control:g,label:d,labelPlacement:"start",sx:u,className:x})}finally{t.f()}}))},16783(e,t,s){s.d(t,{A:()=>g,L:()=>m});var n=s(26411),r=s(20743),i=s(96540),a=s(33823),l=s(87393),o=s.n(l),d=s(41622),c=s(52038),u=s(74848),h=s(48320);const m=({target:e})=>{e.value?.length&&e.setSelectionRange(0,e.value.length)},A=e=>{const t=document.querySelector(`#${e}`)?.closest(".MuiDialog-container");return t||void 0},p=e=>{var t=(0,h.dC)(1);try{const[t,s]=i.useState(!1),l=(0,i.useMemo)((()=>(0,d.$C)(8)),[]),h=`button_${l}`,m=`input_${l}`,p=()=>{new(o())(`#${h}`,{container:A(m),text:()=>document.querySelector(`#${m}`).value,target:()=>document.querySelector(`#${m}`)}).on("success",(e=>{e.clearSelection&&e.clearSelection(),s(!0)}))};(0,i.useEffect)((()=>{setTimeout((()=>{p(h,m)}),1e3)}),[]);const{endAdornment:g,onSuccessCopyText:x,...v}=e,y=(0,u.jsxs)(u.Fragment,{children:[g,(0,u.jsx)(n.A,{onClose:()=>s(!1),open:t,leaveDelay:700,title:x||"Copied!",children:(0,u.jsx)(r.A,{id:h,children:(0,u.jsx)(a.A,{})})})]});return(0,u.jsx)(c.A,{...v,endAdornment:y,id:m})}finally{t.f()}};p.displayName="ClipboardTextField";const g=p},89497(e,t,s){s.d(t,{A:()=>E});var n=s(76832),r=s(242),i=s(13285),a=s(59763),l=s(35168),o=s(96540),d=s(2543),c=s.n(d),u=s(92101),h=s(58297),m=s(3684),A=s(28739),p=s(39825),g=s(4761),x=s(89458),v=s(30759),y=s(62397),j=s(955),f=s(23868),b=s(11111),C=s(54363),S=s(23633),w=s(68579),R=s(49791),U=s(30256),F=s(74848);const{serverUrl:I}=h.A,P=({recordId:e,consentStorageActions:t,currentIpConsent:s,allowDownload:d=!0,disableGutters:h})=>{const[P,E]=(0,o.useState)(null),[k,L]=(0,o.useState)(null),[q,D]=(0,o.useState)(!1),[M,W]=(0,o.useState)(""),$=(0,o.useRef)(),N=(0,o.useRef)(),T=(0,o.useRef)(),V=(0,o.useRef)(),z=(0,o.useRef)();(0,o.useEffect)((()=>{$.current=P,N.current=q,T.current=M}));const O=(0,v.a)(),B=(0,o.useRef)(),K=(0,o.useRef)(),_=async e=>{try{const n=s?s.consentId:null,r=await t.getIPConsentInfo(e,n);O()&&E(r)}catch(e){O()&&L(e.message)}};(0,o.useEffect)((()=>{_(e)}),[e]);const G=async(s,n=!0)=>{let r;if(r=N.current?T.current:B.current.getValue(),!r)return;let i=null;try{i=await t.publishIPConsentVersion(e,$.current.consentId,r,s),O()&&E(i),$.current.consentId||await t.updateIpConsent(e,i.consentId,{revision:0,enabled:!1}
4),s||n&&x.A.info("Version published")}catch(e){O()&&x.A.error(e.message)}return i},Y=(0,o.useCallback)(c().debounce((()=>G(!0)),1e3,{maxWait:1e4}),[]),H=e=>{const t=[];let s=-1;return e&&P.draft&&t.push({label:"Current Draft",value:-1}),P.versions.forEach(((e,s)=>{t.push({label:`Revision ${s+1}`,value:s})})),!P.consentId||e&&P.draft||(s=P.versions.size-1),c().isEmpty(t)&&e&&t.push({label:"Current Draft",value:-1}),{versions:t,position:s}},Q=async({ipConsentEnabled:s,revision:n},r=!0)=>{try{await t.updateIpConsent(e,P.consentId,{revision:n,enabled:s}),O()&&await _(e),r&&x.A.info("Status updated")}catch(e){O()&&x.A.error(e.message)}},Z=e=>{W(e),Y()};if(k)return(0,F.jsx)(m.A,{children:k});if(!P)return(0,F.jsx)(A.A,{});const J=H(!0);return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)(y.A,{spacing:2,disableGutters:h,children:[(0,F.jsxs)(f.Ay,{label:"IP Consent Status",children:[(0,F.jsx)(f.Nb,{children:(0,F.jsx)(w.A,{ref:V,onSubmit:Q,children:(()=>{const t=H(!1);if(c().isEmpty(t.versions))return(0,F.jsx)(l.A,{severity:"info",children:"Publish consent version to enable"});const s=d?(0,F.jsx)(r.A,{href:`${I}raw?ip-consent=1&orgId=${e}`,target:"_blank",children:(0,F.jsxs)(i.A,{spacing:1,direction:"row",children:[(0,F.jsx)(u.A,{}),(0,F.jsx)(a.A,{children:"Download CSV"})]})}):null;return(0,F.jsxs)(i.A,{spacing:2,children:[(0,F.jsxs)(i.A,{spacing:2,direction:"row",children:[(0,F.jsx)(b.A,{name:"ipConsentEnabled",label:"Enable IP Consent",value:P?.state.enabled,sx:{flex:1}},"ipConsentEnabled"),(0,F.jsxs)(R.A,{sx:{flex:1},children:["Require users to accept your IP consent form."," ",(0,F.jsx)(U.A,{docKey:"org.ipConsent",children:"Learn more"})]})]}),(0,F.jsx)(C.A,{name:"revision",data:t.versions,value:P?.state.revision,label:"Select version",valueField:"value",textField:"label",required:!0}),s]})})()})}),(0,F.jsx)(f.ZQ,{children:(0,F.jsx)(n.A,{variant:"contained",color:"primary",sx:{ml:"auto"},onClick:()=>V.current.submit(),children:"Update Consent Status"})})]}),(0,F.jsx)(f.Ay,{label:"IP Consent Versions",children:(0,F.jsx)(f.Nb,{children:(0,F.jsx)(w.A,{ref:z,onSubmit:async()=>{await G(!0),_(e)},children:(0,F.jsxs)(i.A,{spacing:2,children:[(0,F.jsx)(C.A,{name:"endpoint",data:J.versions,value:J.position,label:"Select version",valueField:"value",textField:"label",onChange:e=>{let t;t=-1===e?M||P.draft:P.versions.get(e),q?W(t):B.current.setValue(t)}}),(()=>{const e={html:!0};return q?(0,F.jsx)(p.A,{source:M,options:e}):(0,F.jsx)(S.A,{name:"revision",label:"IP Consent revision",placeholder:"IP Consent revision",required:!0,innerRef:e=>{B.current=e},value:M||(P?P.draft?P.draft:P.versions.last()||"":""),onChange:Z,fullWidth:!0,rows:6,multiline:!0})})()]})})})})]}),(0,F.jsx)(j.A,{primaryActions:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(n.A,{variant:"contained",color:"secondary",onClick:()=>z.current.submit(),children:"Save Draft"}),(0,F.jsx)(n.A,{variant:"contained",color:"primary",onClick:()=>(async()=>{try{if(!await K.current.open())return;const e=(await G(!1,!1)).versions.size-1;O()&&await Q({ipConsentEnabled:P&&P.state.enabled,revision:e},!1),x.A.info("New version is published")}catch{}})(),children:"Publish new version"})]}),secondaryActions:(0,F.jsx)(n.A,{variant:"contained",color:"tertiary",onClick:()=>{q?D(!1):(W(B.current.getValue()),D(!0))},children:"Preview"})}),(0,F.jsx)(g.A,{title:"Publish new version",ref:K,children:(0,F.jsx)(a.A,{children:"Would you like to publish new IP Consent version?"})})]})};P.displayName="IPConsentForm";const E=P},39259(e,t,s){s.d(t,{A:()=>U});var n=s(77421),r=s(26411),i=s(20743),a=s(13285),l=s(59763),o=s(72515),d=s(65312),c=s(27454),u=s(16742),h=s(45254),m=s(7857),A=s(40231),p=s(2543),g=s.n(p),x=s(96540),v=s(20759),y=s(73885),j=s(3684),f=s(28739),b=s(89458),C=s(6373),S=s(23868),w=s(68240),R=s(74848);const U=({org:e,course:t,custom:s,noDataCb:p=()=>{}})=>{if(g().isEmpty(e)&&g().isEmpty(t))return null;const[U,F]=(0,x.useState)(!1),[I,P]=(0,x.useState)(null),[E,k]=(0,x.useState)(null);(0,x.useEffect)((()=>C.A.listen(L)),[]);const L=e=>{"update"!==e.event||e.error||q()};(0,x.useEffect)((()=>{q()}),[]);const q=async()=>{try{F(!0);const n=await y.A.getLlmMetrics(e?.id,t?.id,s);k(n),z(n)&&p()}catch({message:e}){P(e)}finally{F(!1)}},D=s?" (custom providers)":"",M=e=>`$ ${e} USD`,W=({headers:e,rows:t})=>(0,R.jsx)(d.A,{component:o.A,variant:"outlined",children:(0,R.jsxs)(c.A,{size:"small",children:[(0,R.jsx)(h.A,{children:(0,R.jsx)(m.A,{children:g().map(e,(e=>(0,R.jsx)(A.A,{children:e},e)))})}),(0,R.jsx)(u.A,{children:g().map(t,(e=>(0,R.jsx)(m.A,{children:g().map(e,(e=>(0,R.jsx)(A.A,{children:e},e)))},e[0])))})]})}),$=e=>0===e?.lastDayUsage&&0===e?.lastDayUsageRequests&&0===e?.lastWeekUsage&&0===e?.lastWeekUsageRequests&&0===e?.lastMonthUsage&&0===e?.lastMonthUsageRequests&&0===e?.totalUsage&&0===e?.totalUsageRequests,N=e=>0===e?.topForDay.size&&0===e?.topForMonth.size,T=e=>0===e?.usagePerCourse.size,V=e=>0===e?.spentLlmKeys.size,z=e=>$(e)&&N(e)&&T(e)&&V(e),O=`Total Usage in ${e?e.details.name:t.details.name}${D}`,B=`Top 10 Usage in ${e?.details?.name||t?.details?.name}${D}`;return I?(0,R.jsx)(j.A,{children:I}):!E&&U?(0,R.jsx)(f.A,{}):(0,R.jsxs)(R.Fragment,{children:[$(E)?null:(0,R.jsx)(S.Ay,{label:O,children:(0,R.jsx)(S.Nb,{children:(0,R.jsx)(d.A,{component:o.A,variant:"outlined",children:(0,R.jsx)(c.A,{"aria-label":"total usage",size:"small",children:(0,R.jsxs)(u.A,{children:[(0,R.jsxs)(m.A,{children:[(0,R.jsx)(A.A,{children:"Last 24h usage"}),s?null:(0,R.jsx)(A.A,{children:M(E?.lastDayUsage)}),(0,R.jsx)(A.A,{children:E?.lastDayUsageRequests})]}),(0,R.jsxs)(m.A,{children:[(0,R.jsx)(A.A,{children:"Last 7 days usage"}),s?null:(0,R.jsx)(A.A,{children:M(E?.lastWeekUsage)}),(0,R.jsx)(A.A,{children:E?.lastWeekUsageRequests})]}),(0,R.jsxs)(m.A,{children:[(0,R.jsx)(A.A,{children:"Last 30 days usage"}),s?null:(0,R.jsx)(A.A,{children:M(E?.lastMonthUsage)}),(0,R.jsx)(A.A,{children:E?.lastMonthUsageRequests})]}),(0,R.jsxs)(m.A,{children:[(0,R.jsx)(A.A,{children:"Total usage(6 months)"}),s?null:(0,R.jsx)(A.A,{children:M(E?.totalUsage)}),(0,R.jsx)(A.A,{children:E?.totalUsageRequests})]})]})})})})}),(()=>{if(N(E))return null;const e=s?["User","Requests"]:["User","Money Spent","Requests"],t=E?.topForDay.map((e=>s?[e.name,e.requests]:[e.name,M(e.spent),e.requests])).toArray(),n=E?.topForMonth.map((e=>s?[e.name,e.requests]:[e.name,M(e.spent),e.requests])).toArray();return(0,R.jsx)(S.Ay,{label:B,children:(0,R.jsx)(S.Nb,{children:(0,R.jsxs)(a.A,{spacing:2,direction:"row",children:[(0,R.jsxs)(a.A,{spacing:2,sx:{flex:1},children:[(0,R.jsx)(l.A,{variant:"h6",children:"Last 24h usage"}),W({headers:e,rows:t})]}),(0,R.jsxs)(a.A,{spacing:2,sx:{flex:1},children:[(0,R.jsx)(l.A,{variant:"h6",children:"Last 30 days usage"}),W({headers:e,rows:n})]})]})})})})(),(()=>{if(T(E))return null;const e=s?["Course","Requests"]:["Course","Money Spent","Requests"],t=E?.usagePerCourse.filter((e=>e.spent>0||e.requests>0)).map((e=>s?[e.name,e.requests]:[e.name,M(e.spent),e.requests])).toArray();if(0===t?.length)return null;const n=`Usage per Course${D}`;return(0,R.jsx)(S.Ay,{label:n,children:(0,R.jsx)(S.Nb,{children:W({headers:e,rows:t})})})})(),(()=>{if(V(E))return null;const e=`Reset LLM Keys${D}`;return(0,R.jsx)(S.Ay,{label:e,children:(0,R.jsx)(S.Nb,{children:(0,R.jsx)(w.A,{variant:"outlined",children:E?.spentLlmKeys.map((e=>(0,R.jsx)(w.c,{secondaryAction:(0,R.jsx)(r.A,{title:"Reset limit",children:(0,R.jsx)(i.A,{edge:"end","aria-label":"reset limit",onClick:()=>(async(e,t,s)=>{try{F(!0),await y.A.resetLlmProxyKey(e,t,s),b.A.success("LLM key has been reset; student must restart their assignment box."),q()}catch({message:e}){P(e)}finally{F(!1)}})(t.id,e.userId,e.linkedKey),children:(0,R.jsx)(v.A,{})})}),children:(0,R.jsx)(n.A,{primary:e.userName})}
4,e.userId)))})})})})()]})}},16120(e,t,s){s.d(t,{q:()=>r,t:()=>n});const n={eduSelfPaid:"Student Pay",eduOrgNonProfit:"Education Non Profit",eduOrgInternal:"Education Internal",eduOrgTeachersAssociation:"Teachers Association"},r={0:{sign:"$",text:"USD"},1:{sign:"£",text:"GBP"},2:{sign:"â¬",text:"EUR"}}},89357(e,t,s){s.d(t,{A:()=>x});var n=s(13285),r=s(76832),i=s(2543),a=s.n(i),l=s(96540),o=s(28690),d=s(89458),c=s(30759),u=s(23633),h=s(54363),m=s(71263),A=s(74848);const p=[{value:0,label:"Teacher"},{value:1,label:"Read-only teacher"},{value:2,label:"Organization owner"}],g=({isEducationalOrg:e,orgId:t,onUpdate:s=()=>{},courseId:i,onUserExist:g,sx:x})=>{const[v,y]=(0,l.useState)(!1),j=(0,c.a)(),f=(0,l.useRef)(),b=(0,l.useMemo)((()=>i?a().filter(p,(e=>2!==e.value)):p),[i]);return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(r.A,{variant:"contained",disabled:v,color:"primary",onClick:async()=>{const e=await f.current.open();if(!e)return;y(!0);const{userRoleSelector:n}=e,r=a().trim(e.email),l=1===n,c=2===n;try{await o.A.sendInvitation(t,r,c,l,i),d.A.info("Your organization invitation will expire in 7 days."),j()&&s()}catch({message:e}){if(a().includes(e,"The invitation has already been sent"))return void d.A.info("The invitation has already been sent.");if(a().includes(e,"User is already added to the organization"))return d.A.info("User is already added to the organization."),void(g&&g(r,l));d.A.error(e)}finally{y(!1)}},sx:x,children:"Add Member"}),(0,A.jsx)(m.A,{ref:f,title:"Invite new member",variant:"medium",confirmTitle:"Send Invite",children:(0,A.jsxs)(n.A,{spacing:1,children:[(0,A.jsx)(u.A,{label:e?"Teacher Email":"User Email",fullWidth:!0,name:"email",validations:"email",validationError:"The email selected is not valid.",required:!0,autoFocus:!0}),(0,A.jsx)(h.A,{name:"userRoleSelector",data:b,value:i?1:0,label:"Invite as",valueField:"value",textField:"label",required:!0,fullWidth:!0})]})})]})};g.displayName="InviteToOrganization";const x=g},62129(e,t,s){s.d(t,{A:()=>x});var n=s(35168),r=s(13285),i=s(14198),a=s(59763),l=s(96540),o=s(2543),d=s.n(o),c=s(28690),u=s(89458),h=s(68240),m=s(73573),A=s(74848);const p=({item:e,resend:t=()=>{},revoke:s=()=>{},courseId:n,...o})=>{const c=l.useRef(null),{email:u,status:p,isOwner:g,courseReadOnly:x}=e,v=g?"OWNER":null,y=!!n&&!d().isEmpty(e.readOnlyCourseIds)||x?"Read-only":null,j=t=>{t(e),c.current?.close()};return(0,A.jsx)(h.c,{disablePadding:!0,...o,children:(0,A.jsxs)(r.A,{spacing:2,direction:"row",sx:{flex:1,alignItems:"center"},children:[(0,A.jsx)(a.A,{sx:{flex:1},children:u}),(0,A.jsxs)(a.A,{variant:"h6",children:[v,y]}),(0,A.jsx)(a.A,{children:p}),(0,A.jsxs)(m.A,{ref:c,title:"More",children:[(0,A.jsx)(i.A,{onClick:()=>j(t),children:"Resend"}),(0,A.jsx)(i.A,{onClick:()=>j(s),children:"Revoke"})]})]})})},g=e=>{const t=async t=>{try{await c.A.revokeInvitation(t.orgId,t.invite,e.courseId),e.onUpdate&&e.onUpdate()}catch(e){u.A.error(e.message)}},s=async t=>{try{await c.A.resendInvitation(t.orgId,t.invite,e.courseId),e.onUpdate&&e.onUpdate()}catch(e){u.A.error(e.message)}},{invites:i}=e;return(0,A.jsxs)(r.A,{spacing:1,children:[(0,A.jsx)(a.A,{variant:"h4",children:"Pending invites"}),i.isEmpty()?(0,A.jsx)(n.A,{severity:"info",children:"There are no outstanding invitations. You can invite another team member by clicking the Add Member button below."}):(0,A.jsx)(h.A,{variant:"outlined",children:i.map(((n,r)=>(0,A.jsx)(p,{item:n,sx:{px:2,py:1},resend:s,revoke:t,courseId:e.courseId},r)))})]})};g.displayName="OrgInvitesList";const x=g},92498(e,t,s){s.d(t,{A:()=>l});var n=s(37095),r=s(38575),i=s(210),a=s(83524);const l=n.A.createStore({listenables:r.A,onAddSourceCompleted(){this.trigger({event:"addSource"})},onAddSourceFailed(e){this.trigger({error:e,event:"addSource"})},onRemoveSourceCompleted(){this.trigger({event:"removeSource"})},onRemoveSourceFailed(e){this.trigger({error:e,event:"removeSource"})},onUseSourceCompleted(){this.trigger({event:"useSource"})},onUseSourceFailed(e){this.trigger({error:e,event:"useSource"})},onUnUseSourceCompleted(){this.trigger({event:"unUseSource"})},onUnUseSourceFailed(e){this.trigger({error:e,event:"unUseSource"})},onCheckForSourceUpdatesCompleted(e){this.trigger({event:"checkForSourceUpdates",data:e})},onCheckForSourceUpdatesFailed(e){this.trigger({error:e,event:"checkForSourceUpdates"})},onUpdateSourcesCompleted(){this.trigger({event:"updateSources"})},onUpdateSourcesFailed(e){this.trigger({error:e,event:"updateSources"})},listSource:(e,t)=>i.W9.listSource(e,t).then((e=>e.map(a._v))),listReleaseUsages:(e,t)=>i.W9.listReleaseUsages(e,t).then((e=>e.map(a.M9)))})},10725(e,t,s){s.d(t,{A:()=>a});var n=s(37095),r=s(7676),i=s(210);const a=n.A.createStore({listenables:r.A,onCreateCompleted(e){this.trigger({event:"create",template:e})},onCreateFailed(e){this.trigger({error:e,event:"create"})},onRemoveCompleted(e){this.trigger({event:"remove",template:e})},onRemoveFailed(e){this.trigger({error:e,event:"remove"})},onUpdateCompleted(e){this.trigger({event:"update",template:e})},onUpdateFailed(e){this.trigger({error:e,event:"update"})},get:(e,t)=>i.IB.find(t,e).then((e=>{if(e.isEmpty())throw new Error("Not found");return e.get(0)})),getByOrganization:e=>i.IB.find(e)})},22581(e,t,s){s.d(t,{A:()=>d});var n=s(37095),r=s(210),i=s(52294),a=s(89150);let l={};const o={},d=n.A.createStore({listenables:[i.A,a.A],onResetCompleted(){l={},this.trigger({event:"reset"})},getLtiConsumer:e=>(l[e]||(l[e]=r.l1.lookup(e).catch((t=>{throw delete l[e],t}))),l[e]),getLtiConfiguration:e=>r.l1.configuration(e),getLtiApplications:e=>r.l1.listApplications(e),addLtiApplication:e=>r.l1.addApplication(e),editLtiApplication:e=>r.l1.editApplication(e),deleteLtiApplication:(e,t)=>
4r.l1.deleteApplication(e,t),isLtiAllowed:e=>(o[e]||(o[e]=r.l1.isLtiAllowed(e).then((e=>!!e)).catch((t=>{throw delete o[e],t}))),o[e]),getLmsIdentificationField:e=>r.l1.getLmsIdentificationField(e),onApplyLmsIdentificationFieldCompleted(){this.trigger({event:"changeIdentification"})}})},55250(e,t,s){s.d(t,{A:()=>a});var n=s(37095),r=s(85221),i=s(88822);const a=n.A.createStore({listenables:[r.A],onCreateCompleted(e){this.trigger({event:"create",data:e})},onCreateFailed(e){this.trigger({event:"create",error:e})},onUpdateCompleted(e){this.trigger({event:"update",data:e})},onUpdateFailed(e){this.trigger({event:"update",error:e})},onRemoveCompleted(e){this.trigger({event:"remove",data:e})},onRemoveFailed(e){this.trigger({event:"remove",error:e})},getById:e=>i.find(e),integrationIsEnabled:e=>i.integrationIsEnabled(e)})}}]); 5//# sourceMappingURL=http://sourcemaps.codio.test:22334/dashboard/js/3032.app.86296b90ad85204e9b0d.js.map 6//# debugId=c15cf979-9e5b-5995-be58-d8a3bba1d286
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.