1"use strict";(self.rspackChunksciobot_next=self.rspackChunksciobot_next||[]).push([["09"],{yTz:function(e,t,a){a.r(t),a.d(t,{Component:function(){return O},default:function(){return E}});var n=a("X"),r=a("k"),i=a("mu"),s=a("u"),l=a("Fa"),o=a("Ok"),c=a("V5"),d=a("gVX"),m=a("FI"),u=a("L1"),h=a("cm"),x=a("Ld"),f=a("V4"),_=a("Hhu"),g=a("oc"),p=a("Nm"),w=a("In"),v=a("b"),b=a("rI");function y(e,t=null){return{data:null,error:e,errorCode:t}}async function N(e){let t=await e.json().catch(()=>({}));return e.ok?{data:t,error:null,errorCode:null}:y(t.error??`HTTP ${e.status}`,function(e){if("string"==typeof e.errorCode&&e.errorCode.trim())return e.errorCode.trim();if(e.details&&"object"==typeof e.details){let t=e.details.errorCode;if("string"==typeof t&&t.trim())return t.trim()}return null}(t))}async function j(e){let t=new URLSearchParams;e.search&&t.set("search",e.search),e.dateFrom&&t.set("dateFrom",e.dateFrom),e.dateTo&&t.set("dateTo",e.dateTo),t.set("limit",String(e.limit)),t.set("offset",String(e.offset)),t.set("sort",e.sort??"period_expires_at"),t.set("sortDir",e.sortDir??"asc");try{return await N(await (0,b.apiFetch)(`${v.API_CONFIG.ADMIN_INVOICES_URL}/renewals?${t}`))}catch(e){return y(e instanceof Error?e.message:"Network error")}}let S={undecided:0,renew:0,decline:0,auto_invoice:0,withdraw:0};function C(){let e,t,a,v,b,y,N,C,k,D,E,O,$,K,P,T,U,H,W,q,V,M,G,X,Y,B,J,Q,Z,ee,et,ea,en,er,ei,es,el,eo,ec,ed,em,eu,eh,ex,ef,e_,eg,ep,ew,ev,eb,ey,eN,ej,eS,eC,eF,eI,eR,ez,eA,eL,ek,eD,eE,eO,e$,eK,eP,eT,eU,eH,eW,eq,eV,eM,eG=(0,r.c)(184),{LL:eX,locale:eY}=(0,w.PO)(),eB=eX.admin.schoolRenewals,eJ=eX.admin.invoices;eG[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,f.KF)("30d"),eG[0]=e):e=eG[0];let eQ=e,[eZ,e1]=(0,s.useState)("30d"),[e0,e4]=(0,s.useState)(eQ.from),[e5,e2]=(0,s.useState)(eQ.to),[e3,e6]=(0,s.useState)(S);eG[1]!==eB?(t=function(e){return"pending"===e?eB.statePending():"reminded"===e?eB.stateReminded():"declined"===e?eB.stateDeclined():"ordered"===e?eB.stateOrdered():"auto_invoiced"===e?eB.stateAutoInvoiced():"withdraw_requested"===e?eB.stateWithdrawRequested():e},eG[1]=eB,eG[2]=t):t=eG[2];let e7=t;eG[3]!==eB?(a=function(e){return"initial_reminder"===e?eB.emailInitialReminder():"auto_invoice"===e?eB.emailAutoInvoice():"renew"===e?eB.decisionRenew():"declined"===e?eB.emailDeclined():"withdraw_requested"===e?eB.eventWithdraw():"due_reminder"===e?eB.emailDueReminder():"overdue_alert"===e?eB.emailOverdueAlert():eB.emailCreditNote()},eG[3]=eB,eG[4]=a):a=eG[4];let e8=a;eG[5]!==eB?(v=function(e){return"decision"===e?eB.eventKindDecision():eB.eventKindEmail()},eG[5]=eB,eG[6]=v):v=eG[6];let e9=v;eG[7]!==eJ?(b=function(e){return"paid"===e?eJ.statusPaid():"cancelled"===e?eJ.statusCancelled():"compensated"===e?eJ.statusCompensated():"created"===e?eJ.statusCreated():"pending"===e?eJ.statusGenerating():e?eJ.statusUndefined():null},eG[7]=eJ,eG[8]=b):b=eG[8];let te=b;eG[9]===Symbol.for("react.memo_cache_sentinel")?(y=async e=>{let t=await j({limit:e.pageSize,offset:Math.max(0,(e.page-1)*e.pageSize),search:e.search,dateFrom:e.filters.dateFrom,dateTo:e.filters.dateTo,sort:e.sortBy??"period_expires_at",sortDir:e.sortDir??"asc"});if(t.error)throw Error(t.error);return e6(t.data?.stats??S),{rows:t.data?.flows??[],total:t.data?.total??0}},eG[9]=y):y=eG[9];let tt=y;eG[10]!==eB?(N=eB.colSchool(),eG[10]=eB,eG[11]=N):N=eG[11],eG[12]!==eB?(C=e=>{let{row:t}=e;return(0,n.jsxs)(m.N_,{to:`/admin/schools/${t.original.school_id}`,"aria-label":eB.openSchool(),className:"flex max-w-full flex-col gap-0.5 hover:underline",children:[(0,n.jsx)("span",{className:"truncate font-medium",children:t.original.school_name||`#${t.original.school_id}`}),(0,n.jsx)("span",{className:"text-xs text-content-tertiary",children:t.original.school_id})]})},eG[12]=eB,eG[13]=C):C=eG[13],eG[14]===Symbol.for("react.memo_cache_sentinel")?(k={headerClassName:"min-w-[14rem]",cellClassName:"min-w-[14rem]"},eG[14]=k):k=eG[14],eG[15]!==N||eG[16]!==C?(D={accessorKey:"school_name",header:N,cell:C,meta:k},eG[15]=N,eG[16]=C,eG[17]=D):D=eG[17],eG[18]!==eB?(E=eB.colExpires(),eG[18]=eB,eG[19]=E):E=eG[19],eG[20]===Symbol.for("react.memo_cache_sentinel")?(O={headerClassName:"min-w-[9rem]",cellClassName:"min-w-[9rem]"},eG[20]=O):O=eG[20],eG[21]!==E?($={accessorKey:"period_expires_at",header:E,cell:A,meta:O},eG[21]=E,eG[22]=$):$=eG[22],eG[23]!==eB?(K=eB.colStarted(),eG[23]=eB,eG[24]=K):K=eG[24],eG[25]===Symbol.for("react.memo_cache_sentinel")?(P={headerClassName:"min-w-[11rem]",cellClassName:"min-w-[11rem]"},eG[25]=P):P=eG[25],eG[26]!==K?(T={accessorKey:"created_at",header:K,cell:z,meta:P},eG[26]=K,eG[27]=T):T=eG[27],eG[28]!==eB?(U=eB.colState(),eG[28]=eB,eG[29]=U):U=eG[29],eG[30]!==e7?(H=e=>{let{row:t}=e;return(0,n.jsx)(g.E,{variant:"outline",className:h.YU[t.original.state]??h.YU.pending,children:e7(t.original.state)})},eG[30]=e7,eG[31]=H):H=eG[31],eG[32]===Symbol.for("react.memo_cache_sentinel")?(W={headerClassName:"min-w-[9rem]",cellClassName:"min-w-[9rem]"},eG[32]=W):W=eG[32],eG[33]!==U||eG[34]!==H?(q={accessorKey:"state",header:U,cell:H,meta:W},eG[33]=U,eG[34]=H,eG[35]=q):q=eG[35],eG[36]!==eB?(V=eB.colDecision(),eG[36]=eB,eG[37]=V):V=eG[37],eG[38]!==eB?(M=e=>{let{row:t}=e,a=t.original.successor_order_number;return"withdraw_requested"===t.original.state?(0,n.jsx)(g.E,{variant:"outline",className:h.LO.withdraw,children:eB.decisionWithdraw()}):(0,h.OU)(t.original)?(0,n.jsxs)("div",{className:"flex max-w-full flex-col gap-0.5",children:[(0,n.jsx)(g.E,{variant:"outline",className:h.LO.renew,children:eB.decisionRenew()}),null!=a?(0,n.jsx)("span",{className:"text-xs text-content-tertiary",children:eB.orderNumber({number:String(a)})}):null]}):"decline"===t.original.decision?(0,n.jsx)(g.E,{variant:"outline",className:h.LO.decline,children:eB.decisionDecline()}):(0,n.jsx)(g.E,{variant:"outline",className:h.LO.undecided,children:eB.decisionUndecided()})},eG[38]=eB,eG[39]=M):M=eG[39],eG[40]===Symbol.for("react.memo_cache_sentinel")?(G={headerClassName:"min-w-[10rem]",cellClassName:"min-w-[10rem]"},eG[40]=G):G=eG[40],eG[41]!==V||eG[42]!==M?(X={accessorKey:"decision",header:V,cell:M,meta:G},eG[41]=V,eG[42]=M,eG[43]=X):X=eG[43],eG[44]!==eB?(Y=eB.colAutoInvoice(),eG[44]=eB,eG[45]=Y):Y=eG[45],eG[46]!==te||eG[47]!==eB?(B=e=>{let{row:t}=e;if(!t.original.auto_invoice)return(0,n.jsx)("span",{className:"text-content-tertiary",children:eB.autoInvoiceNone()});let a=t.original.invoice_status;return(0,n.jsxs)("div",{className:"flex max-w-full flex-col gap-0.5",children:[(0,n.jsx)("span",{className:"truncate font-medium",children:t.original.invoice_number||eB.stateAutoInvoiced()}),a?(0,n.jsx)(g.E,{variant:"outline",className:f.of[a]?.badge??f.of.undefined.badge,children:te(a)}):null,t.original.invoice_due_at?(0,n.jsx)("span",{className:"text-xs text-content-tertiary",children:eB.invoiceDue({date:(0,_.Cy)(t.original.invoice_due_at)})}):null]})},eG[46]=te,eG[47]=eB,eG[48]=B):B=eG[48],eG[49]===Symbol.for("react.memo_cache_sentinel")?(J={headerClassName:"min-w-[11rem]",cellClassName:"min-w-[11rem]"},eG[49]=J):J=eG[49],eG[50]!==Y||eG[51]!==B?(Q={accessorKey:"auto_invoice",header:Y,cell:B,meta:J},eG[50]=Y,eG[51]=B,eG[52]=Q):Q=eG[52],eG[53]!==eB?(Z=eB.colEvents(),eG[53]=eB,eG[54]=Z):Z=eG[54],eG[55]!==e9||eG[56]!==e8||eG[57]!==eY||eG[58]!==eB?(ee=e=>{let{row:t}=e;return(0,n.jsx)(L,{events:t.original.events,label:e8,kindLabel:e9,line:eB.eventLine,none:eB.eventsNone(),locale:eY})},eG[55]=e9,eG[56]=e8,eG[57]=eY,eG[58]=eB,eG[59]=ee):ee=eG[59],eG[60]===Symbol.for("react.memo_cache_sentinel")?(et={headerClassName:"min-w-[14rem]",cellClassName:"min-w-[14rem]"},eG[60]=et):et=eG[60],eG[61]!==Z||eG[62]!==ee?(ea={id:"events",accessorFn:R,header:Z,enableSorting:!1,cell:ee,meta:et},eG[61]=Z,eG[62]=ee,eG[63]=ea):ea=eG[63],eG[64]!==$||eG[65]!==T||eG[66]!==q||eG[67]!==X||eG[68]!==Q||eG[69]!==ea||eG[70]!==D?(en=[D,$,T,q,X,Q,ea],eG[64]=$,eG[65]=T,eG[66]=q,eG[67]=X,eG[68]=Q,eG[69]=ea,eG[70]=D,eG[71]=en):en=eG[71];let ta=en;eG[72]===Symbol.for("react.memo_cache_sentinel")?(er=[{id:"period_expires_at",desc:!1}],eG[72]=er):er=eG[72],eG[73]!==e0||eG[74]!==e5?(ei={dateFrom:e0,dateTo:e5},eG[73]=e0,eG[74]=e5,eG[75]=ei):ei=eG[75],eG[76]!==ta||eG[77]!==ei?(es={columns:ta,fetchFn:tt,getRowId:I,defaultSort:er,defaultPageSize:50,paginationMode:"offset",filters:ei},eG[76]=ta,eG[77]=ei,eG[78]=es):es=eG[78];let tn=(0,p.o5)(es),tr=tn.isLoading&&e3===S,ti=tn.search,ts=tn.setSearch;eG[79]!==eB?(el=eB.searchPlaceholder(),eG[79]=eB,eG[80]=el):el=eG[80],eG[81]!==tn.search||eG[82]!==tn.setSearch||eG[83]!==el?(eo=(0,n.jsx)(p.T3,{value:ti,onChange:ts,placeholder:el}),eG[81]=tn.search,eG[82]=tn.setSearch,eG[83]=el,eG[84]=eo):eo=eG[84],eG[85]===Symbol.for("react.memo_cache_sentinel")?(ec=e=>{let t=(0,f.KF)(e);e1(e),e4(t.from),e2(t.to)},ed=(e,t)=>{e1("custom"),e4(e),e2(t)},eG[85]=ec,eG[86]=ed):(ec=eG[85],ed=eG[86]),eG[87]!==e0||eG[88]!==eZ||eG[89]!==e5?(em=(0,n.jsx)(x.f,{preset:eZ,from:e0,to:e5,onPreset:ec,onCustomRange:ed}),eG[87]=e0,eG[88]=eZ,eG[89]=e5,eG[90]=em):em=eG[90],eG[91]!==eo||eG[92]!==em?(eu=(0,n.jsxs)("div",{className:"flex flex-col gap-3 xl:flex-row xl:items-center xl:justify-between",children:[eo,em]}),eG[91]=eo,eG[92]=em,eG[93]=eu):eu=eG[93],eG[94]===Symbol.for("react.memo_cache_sentinel")?(eh=(0,n.jsx)(l.A,{className:"size-4"}),eG[94]=eh):eh=eG[94],eG[95]!==eB?(ex=eB.statUndecided(),eG[95]=eB,eG[96]=ex):ex=eG[96];let tl=tr?"â":String(e3.undecided);eG[97]!==eB?(ef=eB.statUndecidedHint(),eG[97]=eB,eG[98]=ef):ef=eG[98],eG[99]!==ex||eG[100]!==tl||eG[101]!==ef?(e_=(0,n.jsx)(u.F,{icon:eh,label:ex,value:tl,hint:ef}),eG[99]=ex,eG[100]=tl,eG[101]=ef,eG[102]=e_):e_=eG[102],eG[103]===Symbol.for("react.memo_cache_sentinel")?(eg=(0,n.jsx)(i.A,{className:"size-4"}),eG[103]=eg):eg=eG[103],eG[104]!==eB?(ep=eB.statRenew(),eG[104]=eB,eG[105]=ep):ep=eG[105];let to=tr?"â":String(e3.renew);eG[106]!==eB?(ew=eB.statRenewHint(),eG[106]=eB,eG[107]=ew):ew=eG[107],eG[108]!==ep||eG[109]!==to||eG[110]!==ew?(ev=(0,n.jsx)(u.F,{icon:eg,label:ep,value:to,hint:ew}),eG[108]=ep,eG[109]=to,eG[110]=ew,eG[111]=ev):ev=eG[111],eG[112]===Symbol.for("react.memo_cache_sentinel")?(eb=(0,n.jsx)(o.A,{className:"size-4"}
1),eG[112]=eb):eb=eG[112],eG[113]!==eB?(ey=eB.statDecline(),eG[113]=eB,eG[114]=ey):ey=eG[114];let tc=tr?"â":String(e3.decline);eG[115]!==eB?(eN=eB.statDeclineHint(),eG[115]=eB,eG[116]=eN):eN=eG[116],eG[117]!==ey||eG[118]!==tc||eG[119]!==eN?(ej=(0,n.jsx)(u.F,{icon:eb,label:ey,value:tc,hint:eN}),eG[117]=ey,eG[118]=tc,eG[119]=eN,eG[120]=ej):ej=eG[120],eG[121]===Symbol.for("react.memo_cache_sentinel")?(eS=(0,n.jsx)(c.A,{className:"size-4"}),eG[121]=eS):eS=eG[121],eG[122]!==eB?(eC=eB.statAutoInvoice(),eG[122]=eB,eG[123]=eC):eC=eG[123];let td=tr?"â":String(e3.auto_invoice);eG[124]!==eB?(eF=eB.statAutoInvoiceHint(),eG[124]=eB,eG[125]=eF):eF=eG[125],eG[126]!==eC||eG[127]!==td||eG[128]!==eF?(eI=(0,n.jsx)(u.F,{icon:eS,label:eC,value:td,hint:eF}),eG[126]=eC,eG[127]=td,eG[128]=eF,eG[129]=eI):eI=eG[129],eG[130]===Symbol.for("react.memo_cache_sentinel")?(eR=(0,n.jsx)(d.A,{className:"size-4"}),eG[130]=eR):eR=eG[130],eG[131]!==eB?(ez=eB.statWithdraw(),eG[131]=eB,eG[132]=ez):ez=eG[132];let tm=tr?"â":String(e3.withdraw);eG[133]!==eB?(eA=eB.statWithdrawHint(),eG[133]=eB,eG[134]=eA):eA=eG[134],eG[135]!==ez||eG[136]!==tm||eG[137]!==eA?(eL=(0,n.jsx)(u.F,{icon:eR,label:ez,value:tm,hint:eA}),eG[135]=ez,eG[136]=tm,eG[137]=eA,eG[138]=eL):eL=eG[138],eG[139]!==e_||eG[140]!==ev||eG[141]!==ej||eG[142]!==eI||eG[143]!==eL?(ek=(0,n.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-5",children:[e_,ev,ej,eI,eL]}),eG[139]=e_,eG[140]=ev,eG[141]=ej,eG[142]=eI,eG[143]=eL,eG[144]=ek):ek=eG[144];let tu=tn.table,th=tn.isLoading,tx=tn.pagination,tf=tn.paginationControls,t_=tn.store,tg=tn.error;return eG[145]!==tn?(eD=()=>void tn.retry(),eG[145]=tn,eG[146]=eD):eD=eG[146],eG[147]===Symbol.for("react.memo_cache_sentinel")?(eE={estimateSize:72,maxHeightClassName:"max-h-[min(42rem,calc(100dvh-12rem))]"},eG[147]=eE):eE=eG[147],eG[148]!==eB?(eO=e=>{let{count:t}=e;return eB.rowCount({count:t})},e$=eB.empty(),eG[148]=eB,eG[149]=eO,eG[150]=e$):(eO=eG[149],e$=eG[150]),eG[151]!==eB?(eK=eB.loading(),eG[151]=eB,eG[152]=eK):eK=eG[152],eG[153]!==eB?(eP=eB.error(),eG[153]=eB,eG[154]=eP):eP=eG[154],eG[155]!==eB?(eT=eB.retry(),eG[155]=eB,eG[156]=eT):eT=eG[156],eG[157]!==eX.common.table?(eU=eX.common.table.previous(),eG[157]=eX.common.table,eG[158]=eU):eU=eG[158],eG[159]!==eX.common.table?(eH=eX.common.table.next(),eG[159]=eX.common.table,eG[160]=eH):eH=eG[160],eG[161]!==eU||eG[162]!==eH?(eW={previous:eU,next:eH,page:F},eG[161]=eU,eG[162]=eH,eG[163]=eW):eW=eG[163],eG[164]!==eO||eG[165]!==e$||eG[166]!==eK||eG[167]!==eP||eG[168]!==eT||eG[169]!==eW?(eq={totalCount:eO,noResults:e$,loading:eK,error:eP,retry:eT,pagination:eW},eG[164]=eO,eG[165]=e$,eG[166]=eK,eG[167]=eP,eG[168]=eT,eG[169]=eW,eG[170]=eq):eq=eG[170],eG[171]!==tn.error||eG[172]!==tn.isLoading||eG[173]!==tn.pagination||eG[174]!==tn.paginationControls||eG[175]!==tn.store||eG[176]!==tn.table||eG[177]!==eD||eG[178]!==eq?(eV=(0,n.jsx)(p.zh,{table:tu,isLoading:th,pagination:tx,paginationControls:tf,store:t_,error:tg,onRetry:eD,virtualize:eE,labels:eq}),eG[171]=tn.error,eG[172]=tn.isLoading,eG[173]=tn.pagination,eG[174]=tn.paginationControls,eG[175]=tn.store,eG[176]=tn.table,eG[177]=eD,eG[178]=eq,eG[179]=eV):eV=eG[179],eG[180]!==eu||eG[181]!==ek||eG[182]!==eV?(eM=(0,n.jsxs)("div",{className:"flex min-w-0 flex-col gap-5",children:[eu,ek,eV]}),eG[180]=eu,eG[181]=ek,eG[182]=eV,eG[183]=eM):eM=eG[183],eM}function F(e){let{page:t,pageCount:a}=e;return null==a?String(t):`${t} / ${a}`}function I(e){return e.id}function R(e){return e.events[0]?.at??""}function z(e){let{row:t}=e,a=(0,h.pC)(t.original.period_expires_at,t.original.created_at);return(0,n.jsxs)("span",{className:"whitespace-nowrap tabular-nums text-content-secondary",children:[(0,_.Cy)(t.original.created_at),a?` ${a}`:null]})}function A(e){let{row:t}=e;return(0,n.jsx)("span",{className:"whitespace-nowrap tabular-nums text-content-secondary",children:(0,_.Cy)(t.original.period_expires_at)})}function L(e){let t,a,i=(0,r.c)(15),{events:s,label:l,kindLabel:o,line:c,none:d,locale:m}=e;if(0===s.length){let e;return i[0]!==d?(e=(0,n.jsx)("span",{className:"text-content-tertiary",children:d}),i[0]=d,i[1]=e):e=i[1],e}if(i[2]!==s||i[3]!==o||i[4]!==l||i[5]!==c||i[6]!==m){let e;i[8]!==o||i[9]!==l||i[10]!==c||i[11]!==m?(e=e=>(0,n.jsx)("span",{children:c({kind:o(e.kind),label:l(e.key),date:(0,h.x$)(e.at,m)})},`${e.kind}-${e.key}-${e.at??"none"}`),i[8]=o,i[9]=l,i[10]=c,i[11]=m,i[12]=e):e=i[12],t=s.map(e),i[2]=s,i[3]=o,i[4]=l,i[5]=c,i[6]=m,i[7]=t}else t=i[7];return i[13]!==t?(a=(0,n.jsx)("div",{className:"flex flex-col gap-0.5 text-xs text-content-secondary",children:t}),i[13]=t,i[14]=a):a=i[14],a}var k=a("evd");function D(){let e,t,a,s,l,o,c,d,m,u=(0,r.c)(16),{LL:h}=(0,w.PO)(),x=h.admin.schoolRenewals;return u[0]!==x?(e=x.title(),u[0]=x,u[1]=e):e=u[1],u[2]===Symbol.for("react.memo_cache_sentinel")?(t=(0,n.jsx)("span",{className:"flex size-9 items-center justify-center rounded-lg bg-primary/10 text-primary",children:(0,n.jsx)(i.A,{className:"size-4.5","aria-hidden":!0})}),u[2]=t):t=u[2],u[3]!==e?(a=(0,n.jsx)(k.z,{title:e,leading:t}),u[3]=e,u[4]=a):a=u[4],u[5]===Symbol.for("react.memo_cache_sentinel")?(s=(0,n.jsx)("div",{className:"h-px self-stretch bg-border"}),u[5]=s):s=u[5],u[6]!==x?(l=x.subtitle(),u[6]=x,u[7]=l):l=u[7],u[8]!==l?
1(o=(0,n.jsx)("p",{className:"mb-5 text-body-md text-content-secondary",children:l}),u[8]=l,u[9]=o):o=u[9],u[10]===Symbol.for("react.memo_cache_sentinel")?(c=(0,n.jsx)(C,{}),u[10]=c):c=u[10],u[11]!==o?(d=(0,n.jsxs)("div",{className:"flex min-h-0 w-full min-w-0 flex-1 flex-col px-6 py-5",children:[o,c]}),u[11]=o,u[12]=d):d=u[12],u[13]!==a||u[14]!==d?(m=(0,n.jsxs)(n.Fragment,{children:[a,s,d]}),u[13]=a,u[14]=d,u[15]=m):m=u[15],m}var E=D;let O=D}}]);
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.