import{y as m,bo as Fe,r as oe,cz as et,bV as tt,j as l,H as rt,bW as nt,bb as it,cA as at,be as ot,cB as st,L as ct,bY as lt,bZ as ut,b_ as ft,b$ as pt}from"./vendor-BKmmeuxg.js";import{T as dt}from"./table-header-DVkEnG6Y.js";import{B as mt}from"./button-BpNwv2aE.js";import{C as de}from"./card-D9_SJYq6.js";import{T as vt,a as ht,b as Pe,c as je}from"./table-DWOXv4Pu.js";import{D as yt}from"./layout-DkwBWm5d.js";import{b as N,c as gt}from"./utils-DxSsnXxD.js";import bt from"./payouts-table-columns-D8iLZUfs.js";import xt from"./request-table-columns-BwXCUZf8.js";import{f as O,r as Ke,a as At,b as Ve,c as Ot,i as D,T as ge,p as T,L as _,g as qe,d as be,e as ze,D as Pt,C as jt,h as z,j as F,S as kt,k as _t,l as ke,m as wt,n as K,o as St,u as Tt,G as Rt,q as te,s as Et,t as We,v as Nt,w as ee,x as _e,y as It,z as Lt,R as we,A as $t,B as Dt,E as Ct}from"./revenue-chart-CoUDa3Pt.js";import"./index-WW_1X1qx.js";import"./sidebar-BYcYxQeZ.js";import"./separator-_3LZ_wAA.js";import"./sheet-DSvHVmaW.js";import"./tooltip-BsX7Z6vz.js";import"./main-_V386djS.js";import"./index-D9-QKOod.js";import"./appearance-D2z3xcjR.js";import"./dropdown-menu-DO-po5c1.js";import"./app-BytVvUs_.js";/* empty css */import"./language-BFZ7KItL.js";import"./notification-CYMPYbAP.js";import"./popover-B4kBsMuI.js";import"./scroll-area-C8HGru-R.js";import"./app-logo-CmnEIwal.js";import"./accordion-CNBvFN43.js";import"./route-B4ZMN77y.js";import"./avatar-j28afJTV.js";import"./use-lang-YfV87_zl.js";var Bt=["points","className","baseLinePoints","connectNulls"];function V(){return V=Object.assign?Object.assign.bind():function(r){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(r,t)&&(n[t]=r[t])}return n}function Ft(r,e){if(r==null)return{};var n={};for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t)){if(e.indexOf(t)>=0)continue;n[t]=r[t]}return n}function Se(r){return zt(r)||qt(r)||Vt(r)||Kt()}function Kt(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vt(r,e){if(r){if(typeof r=="string")return me(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor&&(n=r.constructor.name),n==="Map"||n==="Set")return Array.from(r);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return me(r,e)}}function qt(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function zt(r){if(Array.isArray(r))return me(r)}function me(r,e){(e==null||e>r.length)&&(e=r.length);for(var n=0,t=new Array(e);n0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return e.forEach(function(t){Te(t)?n[n.length-1].push(t):n[n.length-1].length>0&&n.push([])}),Te(e[0])&&n[n.length-1].push(e[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},Y=function(e,n){var t=Wt(e);n&&(t=[t.reduce(function(o,a){return[].concat(Se(o),Se(a))},[])]);var i=t.map(function(o){return o.reduce(function(a,u,c){return"".concat(a).concat(c===0?"M":"L").concat(u.x,",").concat(u.y)},"")}).join("");return t.length===1?"".concat(i,"Z"):i},Ht=function(e,n,t){var i=Y(e,t);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(Y(n.reverse(),t).slice(1))},Ut=function(e){var n=e.points,t=e.className,i=e.baseLinePoints,o=e.connectNulls,a=Mt(e,Bt);if(!n||!n.length)return null;var u=N("recharts-polygon",t);if(i&&i.length){var c=a.stroke&&a.stroke!=="none",s=Ht(n,i,o);return m.createElement("g",{className:u},m.createElement("path",V({},O(a,!0),{fill:s.slice(-1)==="Z"?a.fill:"none",stroke:"none",d:s})),c?m.createElement("path",V({},O(a,!0),{fill:"none",d:Y(n,o)})):null,c?m.createElement("path",V({},O(a,!0),{fill:"none",d:Y(i,o)})):null)}var p=Y(n,o);return m.createElement("path",V({},O(a,!0),{fill:p.slice(-1)==="Z"?a.fill:"none",className:u,d:p}))},fe,Re;function Zt(){if(Re)return fe;Re=1;var r=Ke(),e=At(),n=Ve();function t(i,o){return i&&i.length?r(i,n(o,2),e):void 0}return fe=t,fe}var Gt=Zt();const Yt=Fe(Gt);var pe,Ee;function Jt(){if(Ee)return pe;Ee=1;var r=Ke(),e=Ve(),n=Ot();function t(i,o){return i&&i.length?r(i,e(o,2),n):void 0}return pe=t,pe}var Qt=Jt();const Xt=Fe(Qt);var er=["cx","cy","angle","ticks","axisLine"],tr=["ticks","tick","angle","tickFormatter","stroke"];function W(r){"@babel/helpers - typeof";return W=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W(r)}function J(){return J=Object.assign?Object.assign.bind():function(r){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(r,t)&&(n[t]=r[t])}return n}function rr(r,e){if(r==null)return{};var n={};for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t)){if(e.indexOf(t)>=0)continue;n[t]=r[t]}return n}function nr(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Le(r,e){for(var n=0;nCe?a=i==="outer"?"start":"end":o<-Ce?a=i==="outer"?"end":"start":a="middle",a}},{key:"renderAxisLine",value:function(){var t=this.props,i=t.cx,o=t.cy,a=t.radius,u=t.axisLine,c=t.axisLineType,s=$($({},O(this.props,!1)),{},{fill:"none"},O(u,!1));if(c==="circle")return m.createElement(Pt,C({className:"recharts-polar-angle-axis-line"},s,{cx:i,cy:o,r:a}));var p=this.props.ticks,v=p.map(function(y){return T(i,o,a,y.coordinate)});return m.createElement(Ut,C({className:"recharts-polar-angle-axis-line"},s,{points:v}))}},{key:"renderTicks",value:function(){var t=this,i=this.props,o=i.ticks,a=i.tick,u=i.tickLine,c=i.tickFormatter,s=i.stroke,p=O(this.props,!1),v=O(a,!1),y=$($({},p),{},{fill:"none"},O(u,!1)),g=o.map(function(d,f){var b=t.getTickLineCoord(d),x=t.getTickTextAnchor(d),A=$($($({textAnchor:x},p),{},{stroke:"none",fill:s},v),{},{index:f,payload:d,x:b.x2,y:b.y2});return m.createElement(_,C({className:N("recharts-polar-angle-axis-tick",qe(a)),key:"tick-".concat(d.coordinate)},be(t.props,d,f)),u&&m.createElement("line",C({className:"recharts-polar-angle-axis-tick-line"},y,b)),a&&e.renderTickItem(a,A,c?c(d.value,f):d.value))});return m.createElement(_,{className:"recharts-polar-angle-axis-ticks"},g)}},{key:"render",value:function(){var t=this.props,i=t.ticks,o=t.radius,a=t.axisLine;return o<=0||!i||!i.length?null:m.createElement(_,{className:N("recharts-polar-angle-axis",this.props.className)},a&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(t,i,o){var a;return m.isValidElement(t)?a=m.cloneElement(t,i):D(t)?a=t(i):a=m.createElement(ge,C({},i,{className:"recharts-polar-angle-axis-tick-value"}),o),a}}])})(oe.PureComponent);le(ue,"displayName","PolarAngleAxis");le(ue,"axisType","angleAxis");le(ue,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var re;function U(r){"@babel/helpers - typeof";return U=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},U(r)}function q(){return q=Object.assign?Object.assign.bind():function(r){for(var e=1;e0?_t(k,"paddingAngle",0):0;if(w){var Z=ke(w.endAngle-w.startAngle,k.endAngle-k.startAngle),P=h(h({},k),{},{startAngle:A+I,endAngle:A+Z(f)+I});b.push(P),A=P.endAngle}else{var M=k.endAngle,S=k.startAngle,Q=ke(0,M-S),X=Q(f),E=h(h({},k),{},{startAngle:A+I,endAngle:A+X+I});b.push(E),A=E.endAngle}}),m.createElement(_,null,t.renderSectorsStatically(b))})}},{key:"attachKeyboardHandlers",value:function(t){var i=this;t.onkeydown=function(o){if(!o.altKey)switch(o.key){case"ArrowLeft":{var a=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[a].focus(),i.setState({sectorToFocus:a});break}case"ArrowRight":{var u=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[u].focus(),i.setState({sectorToFocus:u});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var t=this.props,i=t.sectors,o=t.isAnimationActive,a=this.state.prevSectors;return o&&i&&i.length&&(!a||!wt(a,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var t=this,i=this.props,o=i.hide,a=i.sectors,u=i.className,c=i.label,s=i.cx,p=i.cy,v=i.innerRadius,y=i.outerRadius,g=i.isAnimationActive,d=this.state.isAnimationFinished;if(o||!a||!a.length||!K(s)||!K(p)||!K(v)||!K(y))return null;var f=N("recharts-pie",u);return m.createElement(_,{tabIndex:this.props.rootTabIndex,className:f,ref:function(x){t.pieRef=x}},this.renderSectors(),c&&this.renderLabels(a),ze.renderCallByParent(this.props,null,!1),(!g||d)&&St.renderCallByParent(this.props,a,!1))}}],[{key:"getDerivedStateFromProps",value:function(t,i){return i.prevIsAnimationActive!==t.isAnimationActive?{prevIsAnimationActive:t.isAnimationActive,prevAnimationId:t.animationId,curSectors:t.sectors,prevSectors:[],isAnimationFinished:!0}:t.isAnimationActive&&t.animationId!==i.prevAnimationId?{prevAnimationId:t.animationId,curSectors:t.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:t.sectors!==i.curSectors?{curSectors:t.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(t,i){return t>i?"start":t=360?A:A-1)*c,B=b-A*g-k,w=i.reduce(function(P,M){var S=F(M,x,0);return P+(K(S)?S:0)},0),I;if(w>0){var Z;I=i.map(function(P,M){var S=F(P,x,0),Q=F(P,p,M),X=(K(S)?S:0)/w,E;M?E=Z.endAngle+te(f)*c*(S!==0?1:0):E=a;var xe=E+te(f)*((S!==0?g:0)+X*B),Ae=(E+xe)/2,Oe=(d.innerRadius+d.outerRadius)/2,Qe=[{name:Q,value:S,payload:P,dataKey:x,type:y}],Xe=T(d.cx,d.cy,Oe,Ae);return Z=h(h(h({percent:X,cornerRadius:o,name:Q,tooltipPayload:Qe,midAngle:Ae,middleRadius:Oe,tooltipPosition:Xe},P),d),{},{value:F(P,x),startAngle:E,endAngle:xe,payload:P,paddingAngle:te(f)*c}),Z})}return h(h({},d),{},{sectors:I,data:i})});var kr=It({chartName:"PieChart",GraphicalChild:R,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:ue},{axisType:"radiusAxis",AxisComp:ce}],formatAxisMap:Lt,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const _r=r=>{var y;const{auth:e,system:n,statistics:t,revenueData:i,courseStatusDistribution:o,pendingWithdrawals:a,translate:u}=r,{frontend:c}=u,s=e.user.role==="admin",p=oe.useMemo(()=>Object.entries(o).map(([g,d])=>({name:g,value:d})),[o]),v=tt({data:a,columns:s?xt(r.translate):bt(r.translate),getCoreRowModel:pt(),getSortedRowModel:ft(),getFilteredRowModel:ut()});return l.jsxs("div",{className:"space-y-7",children:[l.jsx(rt,{title:c.dashboard}),l.jsxs("div",{className:gt("grid grid-cols-1 gap-6 sm:grid-cols-2 md:grid-cols-3",s?"lg:grid-cols-5":"lg:grid-cols-4"),children:[l.jsx(G,{title:c.courses,value:t.courses,icon:l.jsx(nt,{className:"h-6 w-6 text-blue-500"})}),l.jsx(G,{title:c.lessons,value:t.lessons,icon:l.jsx(it,{className:"h-6 w-6 text-green-500"})}),l.jsx(G,{title:c.enrollment,value:t.enrollments,icon:l.jsx(at,{className:"h-6 w-6 text-amber-500"})}),l.jsx(G,{title:c.students,value:t.students,icon:l.jsx(ot,{className:"h-6 w-6 text-purple-500"})}),s&&l.jsx(G,{title:"Instructors",value:t.instructors,icon:l.jsx(st,{className:"h-6 w-6 text-rose-500"})})]}),n.sub_type==="collaborative"&&l.jsx(we,{}),l.jsxs("div",{className:"grid grid-cols-2 gap-6 lg:grid-cols-12",children:[l.jsxs(de,{className:"col-span-full p-6 lg:col-span-4",children:[l.jsx("h3",{className:"mb-4 text-lg font-medium",children:c.course_status}),l.jsx("div",{className:"flex items-center justify-center",children:l.jsx($t,{width:"100%",height:300,children:l.jsxs(kr,{children:[l.jsx(R,{data:p,cx:"50%",cy:"50%",innerRadius:0,outerRadius:80,fill:"#8884d8",dataKey:"value",paddingAngle:0,label:!1,children:p.map((g,d)=>l.jsx(We,{fill:["oklch(0.8 0.14 160.7)","oklch(0.75 0.145 160.7)","oklch(0.65 0.145 160.7)","oklch(0.55 0.14 160.7)","oklch(0.45 0.135 160.7)"][d%5]},`cell-${d}`))}),l.jsx(Dt,{layout:"horizontal",align:"center",verticalAlign:"bottom",iconType:"circle"}),l.jsx(Ct,{formatter:g=>[g,c.courses]})]})})})]}),n.sub_type==="collaborative"?l.jsxs(de,{className:"col-span-full lg:col-span-8",children:[l.jsxs("div",{className:"flex items-center justify-between gap-6 p-6",children:[l.jsx("h3",{className:"text-lg font-medium",children:c.latest_pending_withdrawal_request}),l.jsx(mt,{asChild:!0,variant:"outline",children:l.jsx(ct,{href:s?route("payouts.request.index"):route("payouts.index"),children:c.view_all})})]}),l.jsxs(vt,{className:"border-border border-y",children:[l.jsx(dt,{table:v}),l.jsx(ht,{children:(y=v.getRowModel().rows)!=null&&y.length?v.getRowModel().rows.map(g=>l.jsx(Pe,{"data-state":g.getIsSelected()&&"selected",children:g.getVisibleCells().map(d=>l.jsx(je,{children:lt(d.column.columnDef.cell,d.getContext())},d.id))},g.id)):l.jsx(Pe,{children:l.jsx(je,{className:"h-24 text-center",children:c.no_results})})})]})]}):l.jsx("div",{className:"col-span-full lg:col-span-8",children:l.jsx(we,{})})]})]})},G=({title:r,value:e,icon:n})=>l.jsx(de,{className:"p-4 sm:p-6",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-muted-foreground text-sm font-medium",children:r}),l.jsx("h4",{className:"mt-1 text-2xl font-semibold",children:e})]}),l.jsx("div",{className:"rounded-full bg-gray-100 p-3",children:n})]})});_r.layout=r=>l.jsx(yt,{children:r});export{_r as default};