PageSourceSearch

https://delphigrc.org/assets/AdminDashboard-Dvc3gHx9.js

js delphigrc.org collected 2026-10-04 00:27:14 UTC 61,075 bytes, 1 lines download raw bytes

vendor: 25,577 bytes, line 1
1import{f as e,g as t,r,j as a,L as s}from"./vendor-react-BH6F5oQJ.js";import{A as n,P as i,a as o,b as l,f as c}from"./AdminLayout-CKCESQT6.js";import{ak as d,s as u,al as m,H as p,B as h,f as x,C as f,m as v,t as b,M as y,N as g,S as j}from"./index-dRqPaCFl.js";import{S as N,a as w,b as A,c as k,d as O}from"./select-DsVkFSYt.js";import{C as P}from"./calendar-C9CRNsnp.js";import{a as S}from"./vendor-query-CC4VRGyP.js";import{u as _,a as D}from"./useActivityLogs-BzlceYVo.js";import{u as T}from"./useAdminActivityNotifications-B8Iov43A.js";import{u as E,a as C,e as R,b as L,d as I,g as V,h as M,v as F}from"./analyticsMerge-CGnw3nXh.js";import{F as K,U as B,q,n as U,ap as $,a5 as z,ag as W,af as H,E as G,A as Z,a2 as X}from"./vendor-icons-CaI5__By.js";import{f as Y}from"./format-hXGQLsWs.js";import{f as J,_ as Q,d as ee,e as te,g as re,i as ae,h as se,p as ne,j as ie,k as oe,l as le,m as ce,D as de,n as ue,o as me,q as pe,S as he,A as xe,r as fe,s as ve,t as be,u as ye,v as ge,w as je,G as Ne,x as we,y as Ae,z as ke,E as Oe,F as Pe,H as Se,I as _e,J as De,R as Te,L as Ee,C as Ce,X as Re,Y as Le,T as Ie,a as Ve,B as Me,b as Fe,c as Ke}from"./BarChart-Cif1pj26.js";import"./vendor-ui-B4WC06Sp.js";import"./separator-KtQ1mSuG.js";import"./index-CCdGLatk.js";import"./Combination-DzDAyqvK.js";import"./vendor-supabase-COwyE4EW.js";import"./index-B3FPD4RS.js";import"./en-US-DUAJ-5Wt.js";import"./index-DE-eAtGG.js";var Be=["points","className","baseLinePoints","connectNulls"];function qe(){return qe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},qe.apply(this,arguments)}function Ue(e,t){if(null==e)return{};var r,a,s=function(e,t){if(null==e)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)r=n[a],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function $e(e){return function(e){if(Array.isArray(e))return ze(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return ze(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ze(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}var We=function(e){return e&&e.x===+e.x&&e.y===+e.y},He=function(e,t){var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[[]];return e.forEach(function(e){We(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),We(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t}(e);t&&(r=[r.reduce(function(e,t){return[].concat($e(e),$e(t))},[])]);var a=r.map(function(e){return e.reduce(function(e,t,r){return"".concat(e).concat(0===r?"M":"L").concat(t.x,",").concat(t.y)},"")}).join("");return 1===r.length?"".concat(a,"Z"):a},Ge=function(t){var r=t.points,a=t.className,s=t.baseLinePoints,n=t.connectNulls,i=Ue(t,Be);if(!r||!r.length)return null;var o=d("recharts-polygon",a);if(s&&s.length){var l=i.stroke&&"none"!==i.stroke,c=function(e,t,r){var a=He(e,r);return"".concat("Z"===a.slice(-1)?a.slice(0,-1):a,"L").concat(He(t.reverse(),r).slice(1))}(r,s,n);return e.createElement("g",{className:o},e.createElement("path",qe({},J(i,!0),{fill:"Z"===c.slice(-1)?i.fill:"none",stroke:"none",d:c})),l?e.createElement("path",qe({},J(i,!0),{fill:"none",d:He(r,n)})):null,l?e.createElement("path",qe({},J(i,!0),{fill:"none",d:He(s,n)})):null)}var u=He(r,n);return e.createElement("path",qe({},J(i,!0),{fill:"Z"===u.slice(-1)?i.fill:"none",className:o,d:u}))},Ze=Q,Xe=ee,Ye=te;const Je=t(function(e,t){return e&&e.length?Ze(e,Ye(t),Xe):void 0});var Qe=Q,et=te,tt=re;const rt=t(function(e,t){return e&&e.length?Qe(e,et(t),tt):void 0});var at=["cx","cy","angle","ticks","axisLine"],st=["ticks","tick","angle","tickFormatter","stroke"];function nt(e){return(nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function it(){return it=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},it.apply(this,arguments)}function ot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function lt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ot(Object(r),!0).forEach(function(t){xt(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ot(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ct(e,t){if(null==e)return{};var r,a,s=function(e,t){if(null==e)return{};var r={};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){if(t.indexOf(a)>=0)continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(a=0;a<n.length;a++)r=n[a],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(s[r]=e[r])}return s}function dt(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,ft(a.key),a)}}function ut(e,t,r){return t=pt(t),function(e,t){if(t&&("object"===nt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,mt()?Reflect.construct(t,r||[],pt(e).constructor):t.apply(e,r))}function mt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(mt=function(){return!!e})()}function pt(e){return(pt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ht(e,t){return(ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function xt(e,t,r){return(t=ft(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ft(e){var t=function(e,t){if("object"!=nt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t);if("object"!=nt(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==nt(t)?t:t+""}var vt=function(){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ut(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ht(e,t)}(t,r.PureComponent),a=t,n=[{key:"renderTickItem",value:function(t,r,a){return e.isValidElement(t)?e.cloneElement(t,r):ae(t)?t(r):e.createElement(se,it({},r,{className:"recharts-polar-radius-axis-tick-value"}),a)}}],(s=[{key:"getTickValueCoord",value:function(e){var t=e.coordinate,r=this.props,a=r.angle,s=r.cx,n=r.cy;return ne(s,n,t,a)}},{key:"getTickTextAnchor",value:function(){var e;switch(this.props.orientation){case"left":e="end";break;case"right":e="start";break;default:e="middle"}return e}},{key:"getViewBox",value:function(){var e=this.props,t=e.cx,r=e.cy,a=e.angle,s=e.ticks,n=Je(s,function(e){return e.coordinate||0});return{cx:t,cy:r,startAngle:a,endAngle:a,innerRadius:rt(s,function(e){return e.coordinate||0}).coordinate||0,outerRadius:n.coordinate||0}}},{key:"renderAxisLine",value:function(){var t=this.props,r=t.cx,a=t.cy,s=t.angle,n=t.ticks,i=t.axisLine,o=ct(t,at),l=n.reduce(function(e,t){return[Math.min(e[0],t.coordinate),Math.max(e[1],t.coordinate)]},[1/0,-1/0]),c=ne(r,a,l[0],s),d=ne(r,a,l[1],s),u=lt(lt(lt({},J(o,!1)),{},{fill:"none"},J(i,!1)),{},{x1:c.x,y1:c.y,x2:d.x,y2:d.y});return e.createElement("line",it({className:"recharts-polar-radius-axis-line"},u))}},{key:"renderTicks",value:function(){var r=this,a=this.props,s=a.ticks,n=a.tick,i=a.angle,o=a.tickFormatter,l=a.stroke,c=ct(a,st),u=this.getTickTextAnchor(),m=J(c,!1),p=J(n,!1),h=s.map(function(a,s){var c=r.getTickValueCoord(a),h=lt(lt(lt(lt({textAnchor:u,transform:"rotate(".concat(90-i,", ").concat(c.x,", ").concat(c.y,")")},m),{},{stroke:"none",fill:l},p),{},{index:s},c),{},{payload:a});return e.createElement(ie,it({className:d("recharts-polar-radius-axis-tick",oe(n)),key:"tick-".concat(a.coordinate)},le(r.props,a,s)),t.renderTickItem(n,h,o?o(a.value,s):a.value))});return e.createElement(ie,{className:"recharts-polar-radius-axis-ticks"},h)}},{key:"render",value:function(){var t=this.props,r=t.ticks,a=t.axisLine,s=t.tick;return r&&r.length?e.createElement(ie,{className:d("recharts-polar-radius-axis",this.props.className)},a&&this.renderAxisLine(),s&&this.renderTicks(),ce.renderCallByParent(this.props,this.getViewBox())):null}}])&&dt(a.prototype,s),n&&dt(a,n),Object.defineProperty(a,"prototype",{writable:!1}),a;var a,s,n}();function bt(e){return(bt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function yt(){return yt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},yt.apply(this,arguments)}function gt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function jt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gt(Object(r),!0).forEach(function(t){Pt(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gt(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Nt(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,St(a.key),a)}}function wt(e,t,r){return t=kt(t),function(e,t){if(t&&("object"===bt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,At()?Reflect.construct(t,r||[],kt(e).constructor):t.apply(e,r))}function At(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(At=function(){return!!e})()}function kt(e){return(kt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ot(e,t){return(Ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Pt(e,t,r){return(t=St(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function St(e){var t=function(e,t){if("object"!=bt(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t);if("object"!=bt(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==bt(t)?t:t+""}xt(vt,"displayName","PolarRadiusAxis"),xt(vt,"axisType","radiusAxis"),xt(vt,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});var _t,Dt=Math.PI/180,Tt=1e-5,Et=function(){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),wt(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ot(e,t)}(t,r.PureComponent),a=t,n=[{key:"renderTickItem",value:function(t,r,a){return e.isValidElement(t)?e.cloneElement(t,r):ae(t)?t(r):e.createElement(se,yt({},r,{className:"recharts-polar-angle-axis-tick-value"}),a)}}],(s=[{key:"getTickLineCoord",value:function(e){var t=this.props,r=t.cx,a=t.cy,s=t.radius,n=t.orientation,i=t.tickSize||8,o=ne(r,a,s,e.coordinate),l=ne(r,a,s+("inner"===n?-1:1)*i,e.coordinate);return{x1:o.x,y1:o.y,x2:l.x,y2:l.y}}},{key:"getTickTextAnchor",value:function(e){var t=this.props.orientation,r=Math.cos(-e.coordinate*Dt);return r>Tt?"outer"===t?"start":"end":r<-Tt?"outer"===t?"end":"start":"middle"}},{key:"renderAxisLine",value:function(){var t=this.props,r=t.cx,a=t.cy,s=t.radius,n=t.axisLine,i=t.axisLineType,o=jt(jt({},J(this.props,!1)),{},{fill:"none"},J(n,!1));if("circle"===i)return e.createElement(de,yt({className:"recharts-polar-angle-axis-line"},o,{cx:r,cy:a,r:s}));var l=this.props.ticks.map(function(e){return ne(r,a,s,e.coordinate)});return e.createElement(Ge,yt({className:"recharts-polar-angle-axis-line"},o,{points:l}))}},{key:"renderTicks",value:function(){var r=this,a=this.props,s=a.ticks,n=a.tick,i=a.tickLine,o=a.tickFormatter,l=a.stroke,c=J(this.props,!1),u=J(n,!1),m=jt(jt({},c),{},{fill:"none"},J(i,!1)),p=s.map(function(a,s){var p=r.getTickLineCoord(a),h=jt(jt(jt({textAnchor:r.getTickTextAnchor(a)},c),{},{stroke:"none",fill:l},u),{},{index:s,payload:a,x:p.x2,y:p.y2});return e.createElement(ie,yt({className:d("recharts-polar-angle-axis-tick",oe(n)),key:"tick-".concat(a.coordinate)},le(r.props,a,s)),i&&e.createElement("line",yt({className:"recharts-polar-angle-axis-tick-line"},m,p)),n&&t.renderTickItem(n,h,o?o(a.value,s):a.value))});return e.createElement(ie,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var t=this.props,r=t.ticks,a=t.radius,s=t.axisLine;return a<=0||!r||!r.length?null:e.createElement(ie,{className:d("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}])&&Nt(a.prototype,s),n&&Nt(a,n),Object.defineProperty(a,"prototype",{writable:!1}),a;var a,s,n}();function Ct(e){return(Ct="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Rt(){return Rt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(e[a]=r[a])}return e},Rt.apply(this,arguments)}function Lt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function It(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Lt(Object(r),!0).forEach(function(t){qt(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lt(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Vt(e,t){for(var r=0;r<t.length;r++){var a=t[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,Ut(a.key),a)}}function Mt(e,t,r){return t=Kt(t),function(e,t){if(t&&("object"===Ct(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ft()?Reflect.construct(t,r||[],Kt(e).constructor):t.apply(e,r))}function Ft(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ft=function(){return!!e})()}function Kt(e){return(Kt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Bt(e,t){return(Bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function qt(e,t,r){return(t=Ut(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ut(e){var t=function(e,t){if("object"!=Ct(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t);if("object"!=Ct(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==Ct(t)?t:t+""}Pt(Et,"displayName","PolarAngleAxis"),Pt(Et,"axisType","angleAxis"),Pt(Et,"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 $t=function(){function t(e){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),qt(r=Mt(this,t,[e]),"pieRef",null),qt(r,"sectorRefs",[]),qt(r,"id",je("recharts-pie-")),qt(r,"handleAnimationEnd",function(){var e=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),ae(e)&&e()}),qt(r,"handleAnimationStart",function(){var e=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),ae(e)&&e()}),r.state={isAnimationFinished:!e.isAnimationActive,prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,sectorToFocus:0},r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bt(e,t)}(t,r.PureComponent),a=t,n=[{key:"getDerivedStateFromProps",value:function(e,t){return t.prevIsAnimationActive!==e.isAnimationActive?{prevIsAnimationActive:e.isAnimationActive,prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:[],isAnimationFinished:!0}:e.isAnimationActive&&e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curSectors:e.sectors,prevSectors:t.curSectors,isAnimationFinished:!0}:e.sectors!==t.curSectors?{curSectors:e.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(e,t){return e>t?"start":e<t?"end":"middle"}},{key:"renderLabelLineItem",value:function(t,r,a){if(e.isValidElement(t))return e.cloneElement(t,r);if(ae(t))return t(r);var s=d("recharts-pie-label-line","boolean"!=typeof t?t.className:"");return e.createElement(ue,Rt({},r,{key:a,type:"linear",className:s}))}},{key:"renderLabelItem",value:function(t,r,a){if(e.isValidElement(t))return e.cloneElement(t,r);var s=a;if(ae(t)&&(s=t(r),e.isValidElement(s)))return s;var n=d("recharts-pie-label-text","boolean"==typeof t||ae(t)?"":t.className);return e.createElement(se,Rt({},r,{alignmentBaseline:"middle",className:n}),s)}}],(s=[{key:"isActiveIndex",value:function(e){var t=this.props.activeIndex;return Array.isArray(t)?-1!==t.indexOf(e):e===t}},{key:"hasActiveIndex",value:function(){var e=this.props.activeIndex;return Array.isArray(e)?0!==e.length:e||0===e}},{key:"renderLabels",value:function(r){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,s=a.label,n=a.labelLine,i=a.dataKey,o=a.valueKey,l=J(this.props,!1),c=J(s,!1),d=J(n,!1),u=s&&s.offsetRadius||20,m=r.map(function(r,a){var m=(r.startAngle+r.endAngle)/2,p=ne(r.cx,r.cy,r.outerRadius+u,m),h=It(It(It(It({},l),r),{},{stroke:"none"},c),{},{index:a,textAnchor:t.getTextAnchor(p.x,r.cx)},p),x=It(It(It(It({},l),r),{},{fill:"none",stroke:r.fill},d),{},{index:a,points:[ne(r.cx,r.cy,r.outerRadius,m),p]}),f=i;return me(i)&&me(o)?f="value":me(i)&&(f=o),e.createElement(ie,{key:"label-".concat(r.startAngle,"-").concat(r.endAngle,"-").concat(r.midAngle,"-").concat(a)},n&&t.renderLabelLineItem(n,x,"line"),t.renderLabelItem(s,h,pe(r,f)))});return e.createElement(ie,{className:"recharts-pie-labels"},m)}},{key:"renderSectorsStatically",value:function(t){var r=this,a=this.props,s=a.activeShape,n=a.blendStroke,i=a.inactiveShape;return t.map(function(a,o){if(0===(null==a?void 0:a.startAngle)&&0===(null==a?void 0:a.endAngle)&&1!==t.length)return null;var l=r.isActiveIndex(o),c=i&&r.hasActiveIndex()?i:null,d=l?s:c,u=It(It({},a),{},{stroke:n?a.fill:a.stroke,tabIndex:-1});return e.createElement(ie,Rt({ref:function(e){e&&!r.sectorRefs.includes(e)&&r.sectorRefs.push(e)},tabIndex:-1,className:"recharts-pie-sector"},le(r.props,a,o),{key:"sector-".concat(null==a?void 0:a.startAngle,"-").concat(null==a?void 0:a.endAngle,"-").concat(a.midAngle,"-").concat(o)}),e.createElement(he,Rt({option:d,isActive:l,shapeType:"sector"},u)))})}},{key:"renderSectorsWithAnimation",value:function(){var t=this,r=this.props,a=r.sectors,s=r.isAnimationActive,n=r.animationBegin,i=r.animationDuration,o=r.animationEasing,l=r.animationId,c=this.state,d=c.prevSectors,u=c.prevIsAnimationActive;return e.createElement(xe,{begin:n,duration:i,isActive:s,easing:o,from:{t:0},to:{t:1},key:"pie-".concat(l,"-").concat(u),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(r){var s=r.t,n=[],i=(a&&a[0]).startAngle;return a.forEach(function(e,t){var r=d&&d[t],a=t>0?fe(e,"paddingAngle",0):0;if(r){var o=ve(r.endAngle-r.startAngle,e.endAngle-e.startAngle),l=It(It({},e),{},{startAngle:i+a,endAngle:i+o(s)+a});n.push(l),i=l.endAngle}else{var c=e.endAngle,u=e.startAngle,m=ve(0,c-u)(s),p=It(It({},e),{},{startAngle:i+a,endAngle:i+m+a});n.push(p),i=p.endAngle}}),e.createElement(ie,null,t.renderSectorsStatically(n))})}},{key:"attachKeyboardHandlers",value:function(e){var t=this;e.onkeydown=function(e){if(!e.altKey)switch(e.key){case"ArrowLeft":var r=++t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[r].focus(),t.setState({sectorToFocus:r});break;case"ArrowRight":var a=--t.state.sectorToFocus<0?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[a].focus(),t.setState({sectorToFocus:a});break;case"Escape":t.sectorRefs[t.state.sectorToFocus].blur(),t.setState({sectorToFocus:0})}}}},{key:"renderSectors",value:function(){var e=this.props,t=e.sectors,r=e.isAnimationActive,a=this.state.prevSectors;return!(r&&t&&t.length)||a&&be(a,t)?this.renderSectorsStatically(t):this.renderSectorsWithAnimation()}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var t=this,r=this.props,a=r.hide,s=r.sectors,n=r.className,i=r.label,o=r.cx,l=r.cy,c=r.innerRadius,u=r.outerRadius,m=r.isAnimationActive,p=this.state.isAnimationFinished;if(a||!s||!s.length||!ye(o)||!ye(l)||!ye(c)||!ye(u))return null;var h=d("recharts-pie",n);return e.createElement(ie,{tabIndex:this.props.rootTabIndex,className:h,ref:function(e){t.pieRef=e}},this.renderSectors(),i&&this.renderLabels(s),ce.renderCallByParent(this.props,null,!1),(!m||p)&&ge.renderCallByParent(this.props,s,!1))}}])&&Vt(a.prototype,s),n&&Vt(a,n),Object.defineProperty(a,"prototype",{writable:!1}),a;var a,s,n}();_t=$t,qt($t,"displayName","Pie"),qt($t,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!Ne.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0}),qt($t,"parseDeltaAngle",function(e,t){return we(t-e)*Math.min(Math.abs(t-e),360)}),qt($t,"getRealPieData",function(e){var t=e.data,r=e.children,a=J(e,!1),s=Ae(r,ke);return t&&t.length?t.map(function(e,t){return It(It(It({payload:e},a),e),s&&s[t]&&s[t].props)}):s&&s.length?s.map(function(e){return It(It({},a),e.props)}):[]}),qt($t,"parseCoordinateOfPie",function(e,t){var r=t.top,a=t.left,s=t.width,n=t.height,i=Oe(s,n);return{cx:a+Pe(e.cx,s,s/2),cy:r+Pe(e.cy,n,n/2),innerRadius:Pe(e.innerRadius,i,0),outerRadius:Pe(e.outerRadius,i,.8*i),maxRadius:e.maxRadius||Math.sqrt(s*s+n*n)/2}}),qt($t,"getComposedData",function(e){var t=e.item,r=e.offset,a=void 0!==t.type.defaultProps?It(It({},t.type.defaultProps),t.props):t.props,s=_t.getRealPieData(a);if(!s||!s.length)return null;var n=a.cornerRadius,i=a.startAngle,o=a.endAngle,l=a.paddingAngle,c=a.dataKey,d=a.nameKey,u=a.valueKey,m=a.tooltipType,p=Math.abs(a.minAngle),h=_t.parseCoordinateOfPie(a,r),x=_t.parseDeltaAngle(i,o),f=Math.abs(x),v=c;me(c)&&me(u)?(Se(!1,'Use "dataKey" to specify the value of pie,\n      the props "valueKey" will be deprecated 
1in 1.1.0'),v="value"):me(c)&&(Se(!1,'Use "dataKey" to specify the value of pie,\n      the props "valueKey" will be deprecated in 1.1.0'),v=u);var b,y,g=s.filter(function(e){return 0!==pe(e,v,0)}).length,j=f-g*p-(f>=360?g:g-1)*l,N=s.reduce(function(e,t){var r=pe(t,v,0);return e+(ye(r)?r:0)},0);N>0&&(b=s.map(function(e,t){var r,a=pe(e,v,0),s=pe(e,d,t),o=(ye(a)?a:0)/N,c=(r=t?y.endAngle+we(x)*l*(0!==a?1:0):i)+we(x)*((0!==a?p:0)+o*j),u=(r+c)/2,f=(h.innerRadius+h.outerRadius)/2,b=[{name:s,value:a,payload:e,dataKey:v,type:m}],g=ne(h.cx,h.cy,f,u);return y=It(It(It({percent:o,cornerRadius:n,name:s,tooltipPayload:b,midAngle:u,middleRadius:f,tooltipPosition:g},e),h),{},{value:pe(e,v),startAngle:r,endAngle:c,payload:e,paddingAngle:we(x)*l})}));return It(It({},h),{},{sectors:b,data:s})});var zt=_e({chartName:"PieChart",GraphicalChild:$t,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Et},{axisType:"radiusAxis",AxisComp:vt}],formatAxisMap:De,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const Wt=()=>S({queryKey:["dashboard-stats"],queryFn:async()=>{var e;const{data:t,error:r}=await u.rpc("get_dashboard_stats");if(!r){return function(e){const t={published:0,draft:0,archived:0};return{totalPublished:(null==e?void 0:e.total_published)??0,uniqueAuthors:(null==e?void 0:e.unique_authors)??0,totalViews:(null==e?void 0:e.total_views)??0,totalDownloads:(null==e?void 0:e.total_downloads)??0,articlesThisMonth:(null==e?void 0:e.articles_this_month)??0,statusCounts:(null==e?void 0:e.status_counts)??t,topCategories:(null==e?void 0:e.top_categories)??[],topViewedArticles:(null==e?void 0:e.top_viewed_articles)??[]}}((null==t?void 0:t[0])??null)}if("PGRST202"===r.code||(null==(e=r.message)?void 0:e.includes("404")))return async function(){const{data:e,error:t}=await u.from("articles").select("id, author_id, view_count, created_at, title, slug, status, category");if(t)throw t;const r=e??[],a=new Date,s=new Date(a.getFullYear(),a.getMonth(),1),n={published:0,draft:0,archived:0},i=new Set;let o=0,l=0;const c=new Map;for(const u of r){const e=u.status;e in n&&(n[e]+=1),u.author_id&&i.add(u.author_id),o+=u.view_count??0,u.created_at&&new Date(u.created_at)>=s&&(l+=1);const t=u.category||"Uncategorized";c.set(t,(c.get(t)??0)+1)}const d=[...c.entries()].map(([e,t])=>({category:e,count:t})).sort((e,t)=>t.count-e.count).slice(0,5),m=r.filter(e=>"published"===e.status).sort((e,t)=>(t.view_count??0)-(e.view_count??0)).slice(0,5).map(e=>({id:e.id,title:e.title??"",view_count:e.view_count??0,slug:e.slug??e.id}));return{totalPublished:n.published,uniqueAuthors:i.size,totalViews:o,totalDownloads:0,articlesThisMonth:l,statusCounts:n,topCategories:d,topViewedArticles:m}}();throw r}});const Ht=()=>{var e,t,d,J,Q,ee,te,re,ae,se,ne,ie;const{papers:oe}=m(),[le,ce]=r.useState({}),[de,ue]=r.useState("30days"),[me,pe]=r.useState(),[he,xe]=r.useState(),fe=r.useMemo(()=>{if("7days"===de)return 7;if("3months"===de)return 90;if("custom"===de&&me&&he){const e=Math.ceil((he.getTime()-me.getTime())/864e5);return Number.isFinite(e)&&e>0?e:30}return 30},[de,me,he]),{data:ve,isLoading:be}=Wt(),{data:ye,isLoading:ge}=_({pageSize:5}),{data:je,isLoading:Ne}=D(7),{data:we,isLoading:Ae}=E(fe),{data:Oe,isLoading:Pe}=C(le),{data:Se,isLoading:_e}=R(le),{data:De}=L(),{data:Be}=I(le),{data:qe}=V(),{data:Ue,isLoading:$e}=M(le),{data:ze}=S({queryKey:["newsletter-subscriber-count"],queryFn:async()=>{const{count:e,error:t}=await u.from("newsletter_subscribers").select("*",{count:"exact",head:!0});if(t)throw t;return e??0}});T();const We=(null==ye?void 0:ye.logs)||[],He=e=>e>=1e3?(e/1e3).toFixed(1)+"K":e.toString();r.useEffect(()=>{let e,t=new Date;"7days"===de?(e=new Date,e.setDate(e.getDate()-7)):"30days"===de?(e=new Date,e.setDate(e.getDate()-30)):"3months"===de?(e=new Date,e.setMonth(e.getMonth()-3)):"custom"===de&&me&&he&&(e=new Date(me),e.setHours(0,0,0,0),t=new Date(he),t.setHours(23,59,59,999)),ce(r=>({...r,startDate:e,endDate:t}))},[de,me,he]);const Ge=(e,t)=>
1{ce(r=>({...r,[e]:"all"===t?void 0:t}))},Ze=le.country||le.region||le.gender||le.deviceType,Xe=()=>"7days"===de?"Last 7 days":"30days"===de?"Last 30 days":"3months"===de?"Last 3 months":"custom"===de&&me&&he?`${Y(me,"MMM dd, yyyy")} - ${Y(he,"MMM dd, yyyy")}`:"Last 30 days",Ye=F(we),Je=Ye?(null==we?void 0:we.visitors)??0:(null==Oe?void 0:Oe.unique_visitors)??0,Qe=Ye?(null==we?void 0:we.pageviews)??0:(null==Oe?void 0:Oe.total_page_views)??(null==ve?void 0:ve.totalViews)??0,et=Ae||Pe||be,tt=[{title:"Total Research",value:be?"...":((null==ve?void 0:ve.totalPublished)||0).toString(),icon:K,description:"Published papers",trend:be?"":`+${(null==ve?void 0:ve.articlesThisMonth)||0} this month`},{title:"Authors",value:be?"...":((null==ve?void 0:ve.uniqueAuthors)||0).toString(),icon:B,description:"Active contributors",trend:""},{title:"Total Views",value:Pe?"...":He((null==Oe?void 0:Oe.total_page_views)??0),icon:q,description:`Page views · ${Xe().toLowerCase()}`,trend:""},{title:"Engagement",value:be?"...":He((null==ve?void 0:ve.totalDownloads)||0),icon:U,description:"Downloads & shares",trend:""}],rt=r.useMemo(()=>{var e;return Ye&&(null==(e=null==we?void 0:we.trend)?void 0:e.length)?we.trend.map(e=>({date:new Date(e.date).toLocaleDateString("en-US",{month:"short",day:"numeric"}),visitors:e.visitors,pageviews:e.pageviews})):Ue&&Ue.length?Ue:[]},[Ye,we,Ue]);return a.jsxs(n,{children:[a.jsxs(p,{children:[a.jsx("meta",{name:"robots",content:"noindex,nofollow"}),a.jsx("title",{children:"Admin Dashboard - Delphi Global Research Center"})]}),a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"mb-8 flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between",children:[a.jsxs("div",{children:[a.jsx("h1",{className:"mb-2 font-heading text-4xl font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent animate-fade-in",children:"Dashboard"}),a.jsx("p",{className:"text-muted-foreground animate-fade-in",children:"Overview of your research platform"}),Ye?a.jsxs(h,{variant:"secondary",className:"mt-3",children:["Traffic: Vercel Web Analytics (last ",(null==we?void 0:we.rangeDays)??fe," days)"]}):(null==we?void 0:we.error)?a.jsxs("p",{className:"mt-2 text-xs text-muted-foreground",children:["Vercel analytics unavailable — ",we.error,". Showing Supabase data where available."]}):null]}),a.jsx(x,{asChild:!0,variant:"outline",className:"shrink-0",children:a.jsxs(s,{to:"/admin/analytics",className:"gap-2",children:[a.jsx($,{className:"h-4 w-4"}),"Full Analytics"]})})]}),a.jsx(f,{className:"mb-6 border-border/40 hover:border-primary/20 transition-all animate-fade-in",children:a.jsxs(v,{className:"p-4 bg-gradient-to-br from-primary/5 to-transparent",children:[a.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs text-muted-foreground",children:"Date Range"}),a.jsxs(N,{value:de,onValueChange:e=>ue(e),children:[a.jsx(w,{className:"w-[180px]",children:a.jsx(A,{placeholder:"Select range"})}),a.jsxs(k,{children:[a.jsx(O,{value:"7days",children:"Last 7 Days"}),a.jsx(O,{value:"30days",children:"Last 30 Days"}),a.jsx(O,{value:"3months",children:"Last 3 Months"}),a.jsx(O,{value:"custom",children:"Custom Range"})]})]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:Xe()})]}),"custom"===de&&a.jsxs("div",{className:"flex flex-wrap gap-4",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs text-muted-foreground",children:"Start Date"}),a.jsxs(i,{children:[a.jsx(o,{asChild:!0,children:a.jsxs(x,{variant:"outline",className:b("w-[150px] justify-start text-left font-normal",!me&&"text-muted-foreground"),children:[a.jsx(z,{className:"mr-2 h-4 w-4"}),me?Y(me,"PPP"):"Pick date"]})}),a.jsx(l,{className:"w-auto p-0",align:"start",children:a.jsx(P,{mode:"single",selected:me,onSelect:pe,disabled:e=>e>new Date||he&&e>he,initialFocus:!0,className:b("p-3 pointer-events-auto")})})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs text-muted-foreground",children:"End Date"}),a.jsxs(i,{children:[a.jsx(o,{asChild:!0,children:a.jsxs(x,{variant:"outline",className:b("w-[150px] justify-start text-left font-normal",!he&&"text-muted-foreground"),children:[a.jsx(z,{className:"mr-2 h-4 w-4"}),he?Y(he,"PPP"):"Pick date"]})}),a.jsx(l,{className:"w-auto p-0",align:"start",children:a.jsx(P,{mode:"single",selected:he,onSelect:xe,disabled:e=>e>new Date||me&&e<me,initialFocus:!0,className:b("p-3 pointer-events-auto")})})]})]})]})]}),a.jsxs("div",{className:"mt-4 grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-foreground",children:"Country"}),a.jsxs(N,{value:le.country||"all",onValueChange:e=>Ge("country",e),children:[a.jsx(w,{children:a.jsx(A,{placeholder:"All countries"})}),a.jsxs(k,{children:[a.jsx(O,{value:"all",children:"All countries"}),null==(e=null==qe?void 0:qe.countries)?void 0:e.map(e=>a.jsx(O,{value:e,children:e},e))]})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-foreground",children:"Region"}),a.jsxs(N,{value:le.region||"all",onValueChange:e=>Ge("region",e),children:[a.jsx(w,{children:a.jsx(A,{placeholder:"All regions"})}),a.jsxs(k,{children:[a.jsx(O,{value:"all",children:"All regions"}),null==(t=null==qe?void 0:qe.regions)?void 0:t.map(e=>a.jsx(O,{value:e,children:e},e))]})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-foreground",children:"Gender"}),a.jsxs(N,{value:le.gender||"all",onValueChange:e=>Ge("gender",e),children:[a.jsx(w,{children:a.jsx(A,{placeholder:"All genders"})}),a.jsxs(k,{children:[a.jsx(O,{value:"all",children:"All genders"}),null==(d=null==qe?void 0:qe.genders)?void 0:d.map(e=>a.jsx(O,{value:e,children:e},e))]})]})]}),a.jsxs("div",{className:"space-y-1",children:[a.jsx("p",{className:"text-xs font-medium text-foreground",children:"Device"}),a.jsxs(N,{value:le.deviceType||"all",onValueChange:e=>Ge("deviceType",e),children:[a.jsx(w,{children:a.jsx(A,{placeholder:"All devices"})}),a.jsxs(k,{children:[a.jsx(O,{value:"all",children:"All devices"}),null==(J=null==qe?void 0:qe.device_types)?void 0:J.map(e=>a.jsx(O,{value:e,children:e},e))]})]})]})]}),Ze&&a.jsx("div",{className:"mt-4",children:a.jsx(x,{variant:"outline",size:"sm",onClick:()=>{ce({}),ue("30days"),pe(void 0),xe(void 0)},children:"Clear filters"})})]})}),a.jsxs("div",{className:"mb-8 grid gap-6 grid-cols-1 sm:grid-cols-2 lg:grid-cols-4",children:[a.jsxs(f,{className:"group relative overflow-hidden shadow-card border-border/40 hover:border-primary/20 transition-all duration-300 hover:shadow-lg hover:-translate-y-1 animate-fade-in bg-gradient-to-br from-purple-500/10 to-transparent",children:[a.jsxs(y,{className:"flex flex-row items-center justify-between pb-2 relative",children:[a.jsx(g,{className:"text-sm font-medium text-muted-foreground",children:"Visitors (30d)"}),a.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:a.jsx(W,{className:"h-5 w-5 text-primary"})})]}),a.jsxs(v,{children:[et?a.jsx(j,{className:"h-9 w-20 mb-2"}):a.jsx("div",{className:"text-3xl font-bold text-foreground",children:He(Je)}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Unique visitors"})]})]}),a.jsxs(f,{className:"group relative overflow-hidden shadow-card border-border/40 hover:border-primary/20 transition-all duration-300 hover:shadow-lg hover:-translate-y-1 animate-fade-in",children:[a.jsxs(y,{className:"flex flex-row items-center justify-between pb-2 relative",children:[a.jsx(g,{className:"text-sm font-medium text-muted-foreground",children:"Total Views"}),a.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:a.jsx(q,{className:"h-5 w-5 text-primary"})})]}),a.jsxs(v,{children:[et?a.jsx(j,{className:"h-9 w-20 mb-2"}):a.jsx("div",{className:"text-3xl font-bold text-foreground",children:He(Qe)}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Page views"})]})]}),a.jsxs(f,{className:"group relative overflow-hidden shadow-card border-border/40 hover:border-primary/20 transition-all duration-300 hover:shadow-lg hover:-translate-y-1 animate-fade-in",children:[a.jsxs(y,{className:"flex flex-row items-center justify-between pb-2 relative",children:[a.jsx(g,{className:"text-sm font-medium text-muted-foreground",children:"Bounce Rate"}),a.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:a.jsx(H,{className:"h-5 w-5 text-primary"})})]}),a.jsxs(v,{children:[Ae?a.jsx(j,{className:"h-9 w-16 mb-2"}):(null==we?void 0:we.ok)&&null!=we.bounceRate?a.jsxs("div",{className:"text-3xl font-bold text-foreground",children:[we.bounceRate,"%"]}):a.jsx("div",{className:"text-3xl font-bold text-muted-foreground",children:"—"}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Vercel"})]})]}),a.jsxs(f,{className:"group relative overflow-hidden shadow-card border-border/40 hover:border-primary/20 transition-all duration-300 hover:shadow-lg hover:-translate-y-1 animate-fade-in",children:[a.jsxs(y,{className:"flex flex-row items-center justify-between pb-2 relative",children:[a.jsx(g,{className:"text-sm font-medium text-muted-foreground",children:"Total Posts"}),a.jsx("div",{className:"p-2 rounded-lg bg-primary/10",children:a.jsx(K,{className:"h-5 w-5 text-primary"})})]}),a.jsxs(v,{children:[be?a.jsx(j,{className:"h-9 w-16 mb-2"}):a.jsx("div",{className:"text-3xl font-bold text-foreground",children:(null==ve?void 0:ve.totalPublished)??0}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Published"})]})]})]}),a.jsxs("div",{className:"mb-8 grid gap-6 lg:grid-cols-3",children:[a.jsxs(f,{className:"lg:col-span-2 shadow-card border-border/40",children:[a.jsxs(y,{className:"border-b border-border/40 flex flex-row items-center justify-between",children:[a.jsxs(g,{className:"flex items-center gap-2",children:[a.jsx(z,{className:"h-5 w-5 text-primary"}),"Traffic (Last 30 days)"]}),a.jsxs("a",{href:"https://vercel.com/dashboard",target:"_blank",rel:"noopener noreferrer",className:"text-xs font-medium text-primary hover:underline inline-flex items-center gap-1",children:["Vercel ",a.jsx(G,{className:"h-3 w-3"})]})]}),a.jsx(v,{className:"pt-6",children:Ne&&!rt.length?a.jsx("div",{className:"flex items-center justify-center h-[280px]",children:a.jsx(j,{className:"h-[280px] w-full"})}):rt.length>0?a.jsx(Te,{width:"100%",height:280,children:a.jsxs(Ee,{data:rt,margin:{top:5,right:20,left
1:0,bottom:5},children:[a.jsx(Ce,{strokeDasharray:"3 3",className:"stroke-muted"}),a.jsx(Re,{dataKey:"date",className:"text-xs",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Le,{className:"text-xs",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Ie,{contentStyle:{backgroundColor:"hsl(var(--background))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),a.jsx(Ve,{type:"monotone",dataKey:"visitors",name:"Visitors",stroke:"hsl(var(--primary))",strokeWidth:2,dot:{r:3}}),a.jsx(Ve,{type:"monotone",dataKey:"pageviews",name:"Pageviews",stroke:"hsl(var(--muted-foreground))",strokeWidth:2,dot:{r:3},strokeDasharray:"4 4"})]})}):a.jsx("div",{className:"flex items-center justify-center h-[280px] text-muted-foreground text-sm",children:"No trend data. Configure Vercel API or use DB analytics."})})]}),a.jsxs(f,{className:"shadow-card border-border/40",children:[a.jsxs(y,{className:"border-b border-border/40",children:[a.jsx(g,{className:"flex items-center gap-2",children:"Top Referrers"}),a.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:[Xe()," · Supabase analytics"]})]}),a.jsx(v,{className:"pt-6",children:_e?a.jsx("div",{className:"space-y-3",children:[1,2,3,4,5].map(e=>a.jsx(j,{className:"h-5 w-full"},e))}):(null==we?void 0:we.ok)&&(null==(Q=we.topSources)?void 0:Q.length)?a.jsx("ul",{className:"space-y-2",children:we.topSources.slice(0,8).map((e,t)=>a.jsxs("li",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"truncate mr-2",children:e.source||"Direct"}),a.jsx("span",{className:"text-muted-foreground tabular-nums shrink-0",children:He(e.visitors)})]},t))}):(null==Se?void 0:Se.length)?a.jsx("ul",{className:"space-y-2",children:Se.slice(0,8).map((e,t)=>a.jsxs("li",{className:"flex justify-between text-sm gap-2",children:[a.jsx("span",{className:"truncate",title:e.source,children:e.source||"Direct"}),a.jsx("span",{className:"text-muted-foreground tabular-nums shrink-0",children:He(e.visit_count)})]},t))}):a.jsx("p",{className:"text-sm text-muted-foreground",children:"No referrer data. Events are tracked via Supabase."})})]})]}),a.jsxs("div",{className:"mb-8 grid gap-6 lg:grid-cols-2",children:[a.jsxs(f,{className:"shadow-card border-border/40",children:[a.jsxs(y,{className:"border-b border-border/40",children:[a.jsx(g,{className:"flex items-center gap-2",children:"All Pages"}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:Ye&&(null==(ee=null==we?void 0:we.topPages)?void 0:ee.length)?"Vercel Web Analytics":(null==Be?void 0:Be.length)?"Supabase analytics":"Page views"})]}),a.jsx(v,{className:"pt-6",children:Ye&&(null==(te=null==we?void 0:we.topPages)?void 0:te.length)?a.jsx("ul",{className:"max-h-80 space-y-2 overflow-y-auto pr-2",children:we.topPages.map((e,t)=>a.jsxs("li",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"truncate mr-2",children:e.path}),a.jsx("span",{className:"text-muted-foreground tabular-nums shrink-0",children:He(e.pageviews)})]},t))}):(null==Be?void 0:Be.length)?a.jsx("ul",{className:"max-h-80 space-y-2 overflow-y-auto pr-2",children:Be.map((e,t)=>a.jsxs("li",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"truncate mr-2 font-mono text-xs",children:e.page_path}),a.jsx("span",{className:"text-muted-foreground tabular-nums shrink-0",children:He(e.view_count)})]},t))}):(null==De?void 0:De.length)?a.jsx("ul",{className:"space-y-2",children:De.slice(0,8).map(e=>a.jsxs("li",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"truncate mr-2",children:e.title}),a.jsx("span",{className:"text-muted-foreground tabular-nums",children:He(e.view_count)})]},e.article_id))}):a.jsx("p",{className:"text-sm text-muted-foreground",children:"No page data"})})]}),a.jsxs(f,{className:"shadow-card border-border/40 bg-gradient-to-br from-primary/5 to-transparent",children:[a.jsx(y,{className:"border-b border-border/40",children:a.jsx(g,{className:"flex items-center gap-2",children:"Database Stats"})}),a.jsxs(v,{className:"pt-6 grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xl font-bold text-foreground",children:(null==ve?void 0:ve.totalPublished)??0}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Posts"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-2xl font-bold text-foreground",children:ze??0}),a.jsx("p",{className:"text-xs text-muted-foreground",children:"Subscribers"})]})]})]})]}),(null==we?void 0:we.ok)&&((null==(re=we.topCountries)?void 0:re.length)||(null==(ae=we.topDevices)?void 0:ae.length))?a.jsxs("div",{className:"mb-8 grid gap-6 lg:grid-cols-2",children:[(null==(se=we.topCountries)?void 0:se.length)?a.jsxs(f,{className:"shadow-card border-border/40",children:[a.jsxs(y,{className:"border-b border-border/40",children:[a.jsxs(g,{className:"flex items-center gap-2",children:[a.jsx(W,{className:"h-5 w-5 text-primary"}),"Top Countries"]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Vercel · last 30 days"})]}),a.jsx(v,{className:"pt-6",children:a.jsx("ul",{className:"space-y-2",children:we.topCountries.slice(0,8).map((e,t)=>a.jsxs("li",{className:"flex justify-between text-sm gap-2",children:[a.jsx("span",{className:"truncate",children:e.country}),a.jsx("span",{className:"text-muted-foreground tabular-nums shrink-0",children:He(e.visitors)})]},t))})})]}):null,(null==(ne=we.topDevices)?void 0:ne.length)?a.jsxs(f,{className:"shadow-card border-border/40",children:[a.jsxs(y,{className:"border-b border-border/40",children:[a.jsxs(g,{className:"flex items-center gap-2",children:[a.jsx(H,{className:"h-5 w-5 text-primary"}),"Devices"]}),a.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Vercel · last 30 days"})]}),a.jsx(v,{className:"pt-6",children:a.jsx("ul",{className:"space-y-2",children:we.topDevices.slice(0,8).map((e,t)=>a.jsxs("li",{className:"flex justify-between text-sm gap-2",children:[a.jsx("span",{className:"truncate capitalize",children:e.device}),a.jsx("span",{className:"text-muted-foreground tabular-nums shrink-0",children:He(e.visitors)})]},t))})})]}):null]}):null,a.jsx("div",{className:"mb-8 grid gap-6 md:grid-cols-2 lg:grid-cols-4",children:tt.map((e,t)=>{const r=e.icon;return a.jsxs(f,{className:"group relative overflow-hidden shadow-card border-border/40 hover:border-primary/20 transition-all duration-300 hover:shadow-lg hover:-translate-y-1 animate-fade-in",style:{animationDelay:100*t+"ms"},children:[a.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-primary/5 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),a.jsxs(y,{className:"flex flex-row items-center justify-between pb-2 relative",children:[a.jsx(g,{className:"text-sm font-medium text-muted-foreground group-hover:text-foreground transition-colors",children:e.title}),a.jsx("div",{className:"p-2 rounded-lg bg-primary/10 group-hover:bg-primary/20 transition-colors",children:a.jsx(r,{className:"h-5 w-5 text-primary group-hover:scale-110 transition-transform"})})]}),a.jsxs(v,{className:"relative",children:[a.jsx("div",{className:"mb-1 text-3xl font-bold text-foreground group-hover:text-primary transition-colors",children:e.value}),a.jsx("p",{className:"text-xs text-muted-foreground mb-2",children:e.description}),e.trend&&a.jsxs("p",{className:"text-xs font-medium text-accent flex items-center gap-1",children:[a.jsx(U,{className:"h-3 w-3"}),e.trend]})]})]},e.title)})}),a.jsxs("div",{className:"mb-8 grid gap-6 lg:grid-cols-3",children:[a.jsxs(f,{className:"shadow-card border-border/40 hover:border-primary/20 transition-all duration-300 animate-fade-in",children:[a.jsx(y,{className:"border-b border-border/40 bg-gradient-to-br from-blue-500/5 to-transparent",children:a.jsxs(g,{className:"flex items-center gap-2",children:[a.jsx(z,{className:"h-5 w-5 text-blue-500"}),"Activity Trends"]})}),a.jsx(v,{className:"pt-6",children:Ne?a.jsx("div",{className:"flex items-center justify-center h-[300px]",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})}):(null==je?void 0:je.activities_by_day)?a.jsx(Te,{width:"100%",height:300,children:a.jsxs(Ee,{data:Object.entries(je.activities_by_day).map(([e,t])=>({date:new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),activities:t}
1)),margin:{top:5,right:20,left:0,bottom:5},children:[a.jsx(Ce,{strokeDasharray:"3 3",className:"stroke-muted"}),a.jsx(Re,{dataKey:"date",className:"text-xs",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Le,{className:"text-xs",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Ie,{contentStyle:{backgroundColor:"hsl(var(--background))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),a.jsx(Ve,{type:"monotone",dataKey:"activities",stroke:"hsl(var(--primary))",strokeWidth:2,dot:{fill:"hsl(var(--primary))",r:4},activeDot:{r:6}})]})}):a.jsx("div",{className:"flex items-center justify-center h-[300px] text-muted-foreground",children:"No data available"})})]}),a.jsxs(f,{className:"shadow-card border-border/40 hover:border-primary/20 transition-all duration-300 animate-fade-in",children:[a.jsx(y,{className:"border-b border-border/40 bg-gradient-to-br from-purple-500/5 to-transparent",children:a.jsxs(g,{className:"flex items-center gap-2",children:[a.jsx($,{className:"h-5 w-5 text-purple-500"}),"Activity Types Distribution"]})}),a.jsx(v,{className:"pt-6",children:Ne?a.jsx("div",{className:"flex items-center justify-center h-[300px]",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})}):(null==je?void 0:je.activities_by_type)?a.jsx(Te,{width:"100%",height:300,children:a.jsxs(Me,{data:Object.entries(je.activities_by_type).sort((e,t)=>t[1]-e[1]).slice(0,6).map(([e,t])=>({type:e.replace(/_/g," ").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),count:t})),margin:{top:5,right:20,left:0,bottom:5},children:[a.jsx(Ce,{strokeDasharray:"3 3",className:"stroke-muted"}),a.jsx(Re,{dataKey:"type",className:"text-xs",tick:{fill:"hsl(var(--muted-foreground))"},angle:-45,textAnchor:"end",height:100}),a.jsx(Le,{className:"text-xs",tick:{fill:"hsl(var(--muted-foreground))"}}),a.jsx(Ie,{contentStyle:{backgroundColor:"hsl(var(--background))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),a.jsx(Fe,{dataKey:"count",fill:"hsl(var(--primary))",radius:[8,8,0,0]})]})}):a.jsx("div",{className:"flex items-center justify-center h-[300px] text-muted-foreground",children:"No data available"})})]}),a.jsxs(f,{className:"shadow-card border-border/40 hover:border-primary/20 transition-all duration-300 animate-fade-in",children:[a.jsx(y,{className:"border-b border-border/40 bg-gradient-to-br from-green-500/5 to-transparent",children:a.jsxs(g,{className:"flex items-center gap-2",children:[a.jsx(K,{className:"h-5 w-5 text-green-500"}),"Article Status"]})}),a.jsx(v,{className:"pt-6",children:be?a.jsx("div",{className:"flex items-center justify-center h-[300px]",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})}):(null==ve?void 0:ve.statusCounts)?a.jsx(Te,{width:"100%",height:300,children:a.jsxs(zt,{children:[a.jsx($t,{data:[{name:"Published",value:ve.statusCounts.published,color:"hsl(var(--primary))"},{name:"Draft",value:ve.statusCounts.draft,color:"hsl(var(--muted-foreground))"},{name:"Archived",value:ve.statusCounts.archived,color:"hsl(var(--destructive))"}],cx:"50%",cy:"50%",labelLine:!1,label:({name:e,percent:t})=>`${e}: ${(100*t).toFixed(0)}%`,outerRadius:100,fill:"hsl(var(--primary))",dataKey:"value",children:[{name:"Published",value:ve.statusCounts.published,color:"hsl(var(--primary))"},{name:"Draft",value:ve.statusCounts.draft,color:"hsl(var(--muted-foreground))"},{name:"Archived",value:ve.statusCounts.archived,color:"hsl(var(--destructive))"}].map((e,t)=>a.jsx(ke,{fill:e.color},`cell-${t}`))}),a.jsx(Ie,{contentStyle:{backgroundColor:"hsl(var(--background))",border:"1px solid hsl(var(--border))",borderRadius:"8px"}}),a.jsx(Ke,{verticalAlign:"bottom",height:36})]})}):a.jsx("div",{className:"flex items-center justify-center h-[300px] text-muted-foreground",children:"No data available"})})]})]}),a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs(f,{className:"shadow-card border-border/40 hover:border-primary/20 transition-all duration-300 animate-fade-in",children:[a.jsx(y,{className:"border-b border-border/40 bg-gradient-to-br from-primary/5 to-transparent",children:a.jsxs(g,{className:"flex items-center gap-2",children:[a.jsx(K,{className:"h-5 w-5 text-primary"}),"Recent Publications"]})}),a.jsx(v,{className:"pt-6",children:a.jsx("div",{className:"space-y-3",children:oe.slice(0,5).map((e,t)=>a.jsxs("div",{className:"group flex items-start justify-between border-b border-border/40 pb-3 last:border-0 last:pb-0 hover:bg-muted/30 -mx-3 px-3 py-2 rounded-lg transition-all animate-fade-in",style:{animationDelay:50*t+"ms"},children:[a.jsxs("div",{className:"flex-1",children:[a.jsx("h4",{className:"mb-1 text-sm font-medium text-foreground line-clamp-1 group-hover:text-primary transition-colors",children:e.title}),a.jsx("p",{className:"text-xs text-muted-foreground line-clamp-1",children:e.author||"Unknown"})]}),a.jsx("span",{className:"ml-4 text-xs text-muted-foreground whitespace-nowrap",children:e.date})]},e.id))})})]}),a.jsxs(f,{className:"shadow-card border-border/40 hover:border-primary/20 transition-all duration-300 animate-fade-in",children:[a.jsx(y,{className:"border-b border-border/40 bg-gradient-to-br from-primary/5 to-transparent",children:a.jsxs(g,{className:"flex items-center gap-2",children:[a.jsx(U,{className:"h-5 w-5 text-primary"}),"Popular Categories"]})}),a.jsx(v,{className:"pt-6",children:be?a.jsx("div",{className:"flex items-center justify-center h-[200px]",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})}):(null==ve?void 0:ve.topCategories)&&ve.topCategories.length>0?a.jsx("div",{className:"space-y-3",children:ve.topCategories.map((e,t)=>a.jsxs("div",{className:"group flex items-center justify-between hover:bg-muted/30 -mx-3 px-3 py-2 rounded-lg transition-all animate-fade-in",style:{animationDelay:50*t+"ms"},children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-gradient-to-br from-primary/20 to-primary/5 text-sm font-medium text-primary group-hover:scale-110 transition-transform",children:t+1}),a.jsx("span",{className:"text-sm font-medium text-foreground group-hover:text-primary transition-colors",children:e.category})]}),a.jsxs("span",{className:"text-sm text-muted-foreground",children:[e.count," ",1===e.count?"paper":"papers"]})]},e.category))}):a.jsx("div",{className:"flex items-center justify-center h-[200px] text-muted-foreground",children:"No category data available"})})]}),a.jsxs(f,{className:"shadow-card border-border/40 hover:border-primary/20 transition-all duration-300 animate-fade-in",children:[a.jsx(y,{className:"border-b border-border/40 bg-gradient-to-br from-orange-500/5 to-transparent",children:a.jsxs(g,{className:"flex items-center gap-2",children:[a.jsx(q,{className:"h-5 w-5 text-orange-500"}),"Top Viewed Articles"]})}),a.jsx(v,{className:"pt-6",children:be?a.jsx("div",{className:"flex items-center justify-center h-[200px]",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})}):(null==ve?void 0:ve.topViewedArticles)&&ve.topViewedArticles.length>0?a.jsx("div",{className:"space-y-3",children:ve.topViewedArticles.map((e,t)=>a.jsxs(s,{to:`/publications/${e.slug}`,className:"group flex items-start justify-between hover:bg-muted/30 -mx-3 px-3 py-2 rounded-lg transition-all animate-fade-in",style:{animationDelay:50*t+"ms"},children:[a.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[a.jsx("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-lg bg-gradient-to-br from-orange-500/20 to-orange-500/5 text-sm font-medium text-orange-500 group-hover:scale-110 transition-transform",children:t+1}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h4",{className:"text-sm font-medium text-foreground group-hover:text-primary transition-colors line-clamp-2 mb-1",children:e.title}),a.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[a.jsx(q,{className:"h-3 w-3"}),a.jsxs("span",{children:[e.view_count||0," views"]})]})]})]}),a.jsx(Z,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary group-hover:translate-x-1 transition-all flex-shrink-0 ml-2 mt-2"})]},e.id))}):a.jsx("div",{className:"flex items-center justify-center h-[200px] text-muted-foreground",children:"No view data available"})})]})]}),a.jsx("div",{className:"mt-6",children:a.jsxs(f,{className:"shadow-card border-border/40 hover:border-primary/20 transition-all duration-300 animate-fade-in",children:[a.jsxs(y,{className:"flex flex-row items-center justify-between border-b border-border/40 bg-gradient-to-br from-primary/5 to-transparent",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(X,{className:"h-5 w-5 text-primary"}),a.jsx(g,{children:"Recent Admin Activity"})]}),a.jsx(s,{to:"/admin/activity-logs",children:a.jsxs(x,{variant:"ghost",size:"sm",className:"gap-2 hover:bg-primary/10 hover:text-primary transition-colors group",children:["View All",a.jsx(Z,{className:"h-4 w-4 group-hover:translate-x-1 transition-transform"})]})})]}),a.jsxs(v,{className:"pt-6",children:[!Ne&&je&&a.jsxs("div",{className:"mb-6 grid gap-4 md:grid-cols-3",children:[a.jsxs("div",{className:"group rounded-lg border border-border/40 bg-gradient-to-br from-primary/5 to-transparent p-4 hover:border-primary/20 transition-all hover:shadow-lg",children:[a.jsx("div",{className:"text-3xl font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent group-hover:scale-105 transition-transform inline-block",children:je.total_activities||0}),a.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Total Activities (7 days)"})]}),a.jsxs("div",{className:"group rounded-lg border border-border/40 bg-gradient-to-br from-primary/5 to-transparent p-4 hover:border-primary/20 transition-all hover:shadow-lg",children:[a.jsx("div",{className:"text-3xl font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent group-hover:scale-105 transition-transform inline-block",children:je.activities_by_admin&&(null==(ie=Object.keys(je.activities_by_admin)[0])?void 0:ie.split("@")[0])||"N/A"}),a.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Most Active Admin"})]}),a.jsxs("div",{className:"group rounded-lg border border-border/40 bg-gradient-to-br from-primary/5 to-transparent p-4 hover:border-primary/20 transition-all hover:shadow-lg",children:[a.jsx("div",{className:"text-3xl font-bold bg-gradient-to-r from-primary to-primary/60 bg-clip-text text-transparent group-hover:scale-105 transition-transform inline-block",children:je.activities_by_type?Object.keys(je.activities_by_type).length:0}),a.jsx("div",{className:"text-xs text-muted-foreground mt-1",children:"Activity Types"})]})]}),a.jsx("div",{className:"space-y-3",children:ge?a.jsx("div",{className:"flex items-center justify-center py-8",children:a.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})}):We&&We.length>0?We.map((e,t)=>{return a.jsxs("div",{className:"group flex items-start justify-between border-b border-border/40 pb-3 last:border-0 last:pb-0 hover:bg-muted/30 -mx-3 px-3 py-2 rounded-lg transition-all animate-fade-in",style:{animationDelay:50*t+"ms"},children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"mb-1 flex items-center gap-2",children:[a.jsx(h,{variant:(r=e.activity_type,r.includes("create")?"default":r.includes("update")?"secondary":r.includes("delete")?"destructive":"outline"),className:"text-xs",children:e.activity_type.replace(/_/g," ")}),a.jsx("span",{className:"text-xs text-muted-foreground",children:e.admin_email})]}),a.jsx("p",{className:"text-sm text-foreground group-hover:text-primary transition-colors",children:e.action_description}),e.entity_name&&a.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:[e.entity_type,": ",e.entity_name]})]}),a.jsx("span",{className:"ml-4 text-xs text-muted-foreground whitespace-nowrap",children:c(new Date(e.created_at),{addSuffix:!0})})]},e.id);var r}):a.jsx("p",{className:"py-8 text-center text-sm text-muted-foreground",children:"No recent activities"})})]})]})})]})]})};export{Ht as default};

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.