1import{R as e,g as t,r,j as n}from"./framer-DNXtdBgj.js";import{A as a}from"./AdminLayout-DLcnHFvP.js";import{br as o,a2 as i,e as s}from"./index-XTUkK5WH.js";import{f as c,_ as l,a as u,b as d,c as p,i as f,T as m,p as y,L as h,g as v,d as b,e as g,D as x,G as j,C as O,h as A,j as w,S as k,A as P,k as S,l as N,m as E,n as L,o as T,q as R,r as C,s as D,t as I,w as _,u as F,v as K,x as B,y as M,z as V,B as z,X as q,Y as U,E as $,F as Z,H as G,I as H,J as Q}from"./chart-DkEoCwki.js";import{C as W,a as J,b as X,e as Y,c as ee}from"./card-Bfb46Kgw.js";import{A as te,a as re}from"./AreaChart-NB82IaBb.js";import{C as ne}from"./clock-BnArT1ze.js";import{C as ae}from"./circle-x-9je29lWZ.js";import{U as oe,N as ie}from"./users-round-C_OE1rsU.js";import{C as se}from"./circle-alert-n9Uv_QXA.js";import"./textarea-x1LPr9Af.js";import"./badge-5FdbKFYY.js";import{U as ce}from"./users-BomTj5bm.js";import{T as le}from"./trending-up-CCgO3IUu.js";import{T as ue}from"./target-CQCdL--z.js";import{P as de}from"./percent-BxtVv4_8.js";import{F as pe}from"./file-text-IPr1Bv1X.js";import"./rocket-Ckmnaf0E.js";import"./wrench-k69Xhg9M.js";import"./factory-g-lDNgT_.js";import"./package-BE07Fgma.js";import"./puzzle-ms8g5hLX.js";import"./building-2-Cf048s_3.js";import"./chart-column-x2tYRpNA.js";import"./supabase-CVkO6afG.js";import"./minus-CpB6H7Bv.js";import"./trending-down-DZynLLBS.js";import"./index-CPvwnzbo.js";var fe=["points","className","baseLinePoints","connectNulls"];function me(){return me=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},me.apply(this,arguments)}function ye(e){return function(e){if(Array.isArray(e))return he(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){if("string"==typeof e)return he(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?he(e,t):void 0}}(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 he(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);t>r;r++)n[r]=e[r];return n}var ve=function(e){return e&&e.x===+e.x&&e.y===+e.y},be=function(e,t){var r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[[]];return e.forEach(function(e){ve(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),ve(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(ye(e),ye(t))},[])]);var n=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(n,"Z"):n},ge=function(t){var r=t.points,n=t.className,a=t.baseLinePoints,i=t.connectNulls,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;o.length>n;n++)0>t.indexOf(r=o[n])&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,fe);if(!r||!r.length)return null;var l=o("recharts-polygon",n);if(a&&a.length){var u=s.stroke&&"none"!==s.stroke,d=function(e,t,r){var n=be(e,r);return"".concat("Z"===n.slice(-1)?n.slice(0,-1):n,"L").concat(be(t.reverse(),r).slice(1))}(r,a,i);return e.createElement("g",{className:l},e.createElement("path",me({},c(s,!0),{fill:"Z"===d.slice(-1)?s.fill:"none",stroke:"none",d:d})),u?e.createElement("path",me({},c(s,!0),{fill:"none",d:be(r,i)})):null,u?e.createElement("path",me({},c(s,!0),{fill:"none",d:be(a,i)})):null)}var p=be(r,i);return e.createElement("path",me({},c(s,!0),{fill:"Z"===p.slice(-1)?s.fill:"none",className:l,d:p}))},xe=l,je=u,Oe=d;const Ae=t(function(e,t){return e&&e.length?xe(e,Oe(t),je):void 0});var we=l,ke=d,Pe=p;const Se=t(function(e,t){return e&&e.length?we(e,ke(t),Pe):void 0});
1var Ne=["cx","cy","angle","ticks","axisLine"],Ee=["ticks","tick","angle","tickFormatter","stroke"];function Le(e){return(Le="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 Te(){return Te=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Te.apply(this,arguments)}function Re(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ce(e){for(var t=1;arguments.length>t;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Re(Object(r),!0).forEach(function(t){Be(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Re(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function De(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;o.length>n;n++)0>t.indexOf(r=o[n])&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function Ie(e,t){for(var r=0;t.length>r;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Me(n.key),n)}}function _e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(_e=function(){return!!e})()}function Fe(e){return(Fe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ke(e,t){return(Ke=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function Be(e,t,r){return(t=Me(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Me(e){var t=function(e){if("object"!=Le(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=Le(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Le(t)?t:t+""}var Ve=function(){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=arguments,r=Fe(r=t),function(e,t){if(t&&("object"===Le(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,_e()?Reflect.construct(r,n||[],Fe(e).constructor):r.apply(e,n));var e,r,n}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&&Ke(e,t)}(t,r.PureComponent),n=t,i=[{key:"renderTickItem",value:function(t,r,n){return e.isValidElement(t)?e.cloneElement(t,r):f(t)?t(r):e.createElement(m,Te({},r,{className:"recharts-polar-radius-axis-tick-value"}),n)}}],(a=[{key:"getTickValueCoord",value:function(e){var t=this.props;return y(t.cx,t.cy,e.coordinate,t.angle)}},{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,n=e.angle,a=e.ticks,o=Ae(a,function(e){return e.coordinate||0});return{cx:t,cy:r,startAngle:n,endAngle:n,innerRadius:Se(a,function(e){return e.coordinate||0}).coordinate||0,outerRadius:o.coordinate||0}}},{key:"renderAxisLine",value:function(){var t=this.props,r=t.cx,n=t.cy,a=t.angle,o=t.ticks,i=t.axisLine,s=De(t,Ne),l=o.reduce(function(e,t){return[Math.min(e[0],t.coordinate),Math.max(e[1],t.coordinate)]},[1/0,-1/0]),u=y(r,n,l[0],a),d=y(r,n,l[1],a),p=Ce(Ce(Ce({},c(s,!1)),{},{fill:"none"},c(i,!1)),{},{x1:u.x,y1:u.y,x2:d.x,y2:d.y});return e.createElement("line",Te({className:"recharts-polar-radius-axis-line"},p))}},{key:"renderTicks",value:function(){var r=this,n=this.props,a=n.ticks,i=n.tick,s=n.angle,l=n.tickFormatter,u=n.stroke,d=De(n,Ee),p=this.getTickTextAnchor(),f=c(d,!1),m=c(i,!1),y=a.map(function(n,a){var c=r.getTickValueCoord(n),d=Ce(Ce(Ce(Ce({textAnchor:p,transform:"rotate(".concat(90-s,", ").concat(c.x,", ").concat(c.y,")")},f),{},{stroke:"none",fill:u},m),{},{index:a}
1,c),{},{payload:n});return e.createElement(h,Te({className:o("recharts-polar-radius-axis-tick",v(i)),key:"tick-".concat(n.coordinate)},b(r.props,n,a)),t.renderTickItem(i,d,l?l(n.value,a):n.value))});return e.createElement(h,{className:"recharts-polar-radius-axis-ticks"},y)}},{key:"render",value:function(){var t=this.props,r=t.ticks,n=t.axisLine,a=t.tick;return r&&r.length?e.createElement(h,{className:o("recharts-polar-radius-axis",this.props.className)},n&&this.renderAxisLine(),a&&this.renderTicks(),g.renderCallByParent(this.props,this.getViewBox())):null}}])&&Ie(n.prototype,a),i&&Ie(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,a,i}();function ze(e){return(ze="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 qe(){return qe=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qe.apply(this,arguments)}function Ue(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function $e(e){for(var t=1;arguments.length>t;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ue(Object(r),!0).forEach(function(t){We(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ue(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Ze(e,t){for(var r=0;t.length>r;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Je(n.key),n)}}function Ge(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ge=function(){return!!e})()}function He(e){return(He=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Qe(e,t){return(Qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function We(e,t,r){return(t=Je(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Je(e){var t=function(e){if("object"!=ze(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=ze(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ze(t)?t:t+""}Be(Ve,"displayName","PolarRadiusAxis"),Be(Ve,"axisType","radiusAxis"),Be(Ve,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine
1:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});var Xe,Ye=Math.PI/180,et=1e-5,tt=function(){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=arguments,r=He(r=t),function(e,t){if(t&&("object"===ze(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,Ge()?Reflect.construct(r,n||[],He(e).constructor):r.apply(e,n));var e,r,n}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&&Qe(e,t)}(t,r.PureComponent),n=t,i=[{key:"renderTickItem",value:function(t,r,n){return e.isValidElement(t)?e.cloneElement(t,r):f(t)?t(r):e.createElement(m,qe({},r,{className:"recharts-polar-angle-axis-tick-value"}),n)}}],(a=[{key:"getTickLineCoord",value:function(e){var t=this.props,r=t.cx,n=t.cy,a=t.radius,o=t.orientation,i=t.tickSize||8,s=y(r,n,a,e.coordinate),c=y(r,n,a+("inner"===o?-1:1)*i,e.coordinate);return{x1:s.x,y1:s.y,x2:c.x,y2:c.y}}},{key:"getTickTextAnchor",value:function(e){var t=this.props.orientation,r=Math.cos(-e.coordinate*Ye);return r>et?"outer"===t?"start":"end":-et>r?"outer"===t?"end":"start":"middle"}},{key:"renderAxisLine",value:function(){var t=this.props,r=t.cx,n=t.cy,a=t.radius,o=t.axisLine,i=t.axisLineType,s=$e($e({},c(this.props,!1)),{},{fill:"none"},c(o,!1));if("circle"===i)return e.createElement(x,qe({className:"recharts-polar-angle-axis-line"},s,{cx:r,cy:n,r:a}));var l=this.props.ticks.map(function(e){return y(r,n,a,e.coordinate)});return e.createElement(ge,qe({className:"recharts-polar-angle-axis-line"},s,{points:l}))}},{key:"renderTicks",value:function(){var r=this,n=this.props,a=n.ticks,i=n.tick,s=n.tickLine,l=n.tickFormatter,u=n.stroke,d=c(this.props,!1),p=c(i,!1),f=$e($e({},d),{},{fill:"none"},c(s,!1)),m=a.map(function(n,a){var c=r.getTickLineCoord(n),m=$e($e($e({textAnchor:r.getTickTextAnchor(n)},d),{},{stroke:"none",fill:u},p),{},{index:a,payload:n,x:c.x2,y:c.y2});return e.createElement(h,qe({className:o("recharts-polar-angle-axis-tick",v(i)),key:"tick-".concat(n.coordinate)},b(r.props,n,a)),s&&e.createElement("line",qe({className:"recharts-polar-angle-axis-tick-line"},f,c)),i&&t.renderTickItem(i,m,l?l(n.value,a):n.value))});return e.createElement(h,{className:"recharts-polar-angle-axis-ticks"},m)}},{key:"render",value:function(){var t=this.props,r=t.ticks,n=t.axisLine;return t.radius>0&&r&&r.length?e.createElement(h,{className:o("recharts-polar-angle-axis",this.props.className)},n&&this.renderAxisLine(),this.renderTicks()):null}}])&&Ze(n.prototype,a),i&&Ze(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,a,i}();function rt(e){return(rt="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 nt(){return nt=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nt.apply(this,arguments)}function at(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function ot(e){for(var t=1;arguments.length>t;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?at(Object(r),!0).forEach(function(t){ut(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function it(e,t){for(var r=0;t.length>r;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,dt(n.key),n)}}function st(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(st=function(){return!!e})()}function ct(e){return(ct=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function lt(e,t){return(lt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function ut(e,t,r){return(t=dt(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dt(e){var t=function(e){if("object"!=rt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=rt(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==rt(t)?t:t+""}We(tt,"displayName","PolarAngleAxis"),We(tt,"axisType","angleAxis"),We(tt,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine
vendor: 4,760 bytes, line 1
1:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var pt=function(){function t(e){var r,n,a,o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),ut((n=this,o=[e],a=ct(a=t),r=function(e,t){if(t&&("object"===rt(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)}(n,st()?Reflect.construct(a,o||[],ct(n).constructor):a.apply(n,o))),"pieRef",null),ut(r,"sectorRefs",[]),ut(r,"id",K("recharts-pie-")),ut(r,"handleAnimationEnd",function(){var e=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),f(e)&&e()}),ut(r,"handleAnimationStart",function(){var e=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),f(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&<(e,t)}(t,r.PureComponent),n=t,i=[{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":t>e?"end":"middle"}},{key:"renderLabelLineItem",value:function(t,r,n){if(e.isValidElement(t))return e.cloneElement(t,r);if(f(t))return t(r);var a=o("recharts-pie-label-line","boolean"!=typeof t?t.className:"");return e.createElement(O,nt({},r,{key:n,type:"linear",className:a}))}},{key:"renderLabelItem",value:function(t,r,n){if(e.isValidElement(t))return e.cloneElement(t,r);var a=n;if(f(t)&&(a=t(r),e.isValidElement(a)))return a;var i=o("recharts-pie-label-text","boolean"==typeof t||f(t)?"":t.className);return e.createElement(m,nt({},r,{alignmentBaseline:"middle",className:i}),a)}}],(a=[{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 n=this.props,a=n.label,o=n.labelLine,i=n.dataKey,s=n.valueKey,l=c(this.props,!1),u=c(a,!1),d=c(o,!1),p=a&&a.offsetRadius||20,f=r.map(function(r,n){var c=(r.startAngle+r.endAngle)/2,f=y(r.cx,r.cy,r.outerRadius+p,c),m=ot(ot(ot(ot({},l),r),{},{stroke:"none"},u),{},{index:n,textAnchor:t.getTextAnchor(f.x,r.cx)},f),v=ot(ot(ot(ot({},l),r),{},{fill:"none",stroke:r.fill},d),{},{index:n,points:[y(r.cx,r.cy,r.outerRadius,c),f]}),b=i;return A(i)&&A(s)?b="value":A(i)&&(b=s),e.createElement(h,{key:"label-".concat(r.startAngle,"-").concat(r.endAngle,"-").concat(r.midAngle,"-").concat(n)},o&&t.renderLabelLineItem(o,v,"line"),t.renderLabelItem(a,m,w(r,b)))});return e.createElement(h,{className:"recharts-pie-labels"},f)}},{key:"renderSectorsStatically",value:function(t){var r=this,n=this.props,a=n.activeShape,o=n.blendStroke,i=n.inactiveShape;return t.map(function(n,s){if(0===(null==n?void 0:n.startAngle)&&0===(null==n?void 0:n.endAngle)&&1!==t.length)return null;var c=r.isActiveIndex(s),l=i&&r.hasActiveIndex()?i:null,u=c?a:l,d=ot(ot({},n),{},{stroke:o?n.fill:n.stroke,tabIndex:-1});return e.createElement(h,nt({ref:function(e){e&&!r.sectorRefs.includes(e)&&r.sectorRefs.push(e)},tabIndex:-1,className:"recharts-pie-sector"},b(r.props,n,s),{key:"sector-".concat(null==n?void 0:n.startAngle,"-").concat(null==n?void 0:n.endAngle,"-").concat(n.midAngle,"-").concat(s)}),e.createElement(k,nt({option:u,isActive:c,shapeType:"sector"},d)))})}},{key:"renderSectorsWithAnimation",value:function(){var t=this,r=this.props,n=r.sectors,a=this.state,o=a.prevSectors,i=a.prevIsAnimationActive;return e.createElement(P,{begin:r.animationBegin,duration:r.animationDuration,isActive:r.isAnimationActive,easing:r.animationEasing,from:{t:0},to:{t:1},key:"pie-".concat(r.animationId,"-").concat(i),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(r){var a=r.t,i=[],s=(n&&n[0]).startAngle;
1return n.forEach(function(e,t){var r=o&&o[t],n=t>0?S(e,"paddingAngle",0):0;if(r){var c=N(r.endAngle-r.startAngle,e.endAngle-e.startAngle),l=ot(ot({},e),{},{startAngle:s+n,endAngle:s+c(a)+n});i.push(l),s=l.endAngle}else{var u=N(0,e.endAngle-e.startAngle)(a),d=ot(ot({},e),{},{startAngle:s+n,endAngle:s+u+n});i.push(d),s=d.endAngle}}),e.createElement(h,null,t.renderSectorsStatically(i))})}},{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 n=0>--t.state.sectorToFocus?t.sectorRefs.length-1:t.state.sectorToFocus%t.sectorRefs.length;t.sectorRefs[n].focus(),t.setState({sectorToFocus:n});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=this.state.prevSectors;return!(e.isAnimationActive&&t&&t.length)||r&&E(r,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,n=r.sectors,a=r.className,i=r.label,s=r.cy,c=r.innerRadius,l=r.outerRadius,u=r.isAnimationActive,d=this.state.isAnimationFinished;if(r.hide||!n||!n.length||!L(r.cx)||!L(s)||!L(c)||!L(l))return null;var p=o("recharts-pie",a);return e.createElement(h,{tabIndex:this.props.rootTabIndex,className:p,ref:function(e){t.pieRef=e}},this.renderSectors(),i&&this.renderLabels(n),g.renderCallByParent(this.props,null,!1),(!u||d)&&T.renderCallByParent(this.props,n,!1))}}])&&it(n.prototype,a),i&&it(n,i),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,a,i}();Xe=pt,ut(pt,"displayName","Pie"),ut(pt,"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:!j.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0}),ut(pt,"parseDeltaAngle",function(e,t){return F(t-e)*Math.min(Math.abs(t-e),360)}),ut(pt,"getRealPieData",function(e){var t=e.data,r=e.children,n=c(e,!1),a=R(r,C);return t&&t.length?t.map(function(e,t){return ot(ot(ot({payload:e},n),e),a&&a[t]&&a[t].props)}):a&&a.length?a.map(function(e){return ot(ot({},n),e.props)}):[]}),ut(pt,"parseCoordinateOfPie",function(e,t){var r=t.top,n=t.left,a=t.width,o=t.height,i=D(a,o);return{cx:n+I(e.cx,a,a/2),cy:r+I(e.cy,o,o/2),innerRadius:I(e.innerRadius,i,0),outerRadius:I(e.outerRadius,i,.8*i),maxRadius:e.maxRadius||Math.sqrt(a*a+o*o)/2}}),ut(pt,"getComposedData",function(e){var t=e.item,r=e.offset,n=void 0!==t.type.defaultProps?ot(ot({},t.type.defaultProps),t.props):t.props,a=Xe.getRealPieData(n);if(!a||!a.length)return null;var o=n.cornerRadius,i=n.startAngle,s=n.endAngle,c=n.paddingAngle,l=n.dataKey,u=n.nameKey,d=n.valueKey,p=n.tooltipType,f=Math.abs(n.minAngle),m=Xe.parseCoordinateOfPie(n,r),h=Xe.parseDeltaAngle(i,s),v=Math.abs(h),b=l;A(l)&&A(d)?(_(!1,'Use "dataKey" to specify the value of pie,\n the props "valueKey" will be deprecated
1in 1.1.0'),b="value"):A(l)&&(_(!1,'Use "dataKey" to specify the value of pie,\n the props "valueKey" will be deprecated in 1.1.0'),b=d);var g,x,j=a.filter(function(e){return 0!==w(e,b,0)}).length,O=v-j*f-(360>v?j-1:j)*c,k=a.reduce(function(e,t){var r=w(t,b,0);return e+(L(r)?r:0)},0);return k>0&&(g=a.map(function(e,t){var r,n=w(e,b,0),a=w(e,u,t),s=(L(n)?n:0)/k,l=(r=t?x.endAngle+F(h)*c*(0!==n?1:0):i)+F(h)*((0!==n?f:0)+s*O),d=(r+l)/2,v=(m.innerRadius+m.outerRadius)/2,g=[{name:a,value:n,payload:e,dataKey:b,type:p}],j=y(m.cx,m.cy,v,d);return x=ot(ot(ot({percent:s,cornerRadius:o,name:a,tooltipPayload:g,midAngle:d,middleRadius:v,tooltipPosition:j},e),m),{},{value:w(e,b),startAngle:r,endAngle:l,payload:e,paddingAngle:F(h)*c})})),ot(ot({},m),{},{sectors:g,data:a})});var ft=B({chartName:"PieChart",GraphicalChild:pt,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:tt},{axisType:"radiusAxis",AxisComp:Ve}],formatAxisMap:M,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const mt={leads:{label:"Leads",color:"hsl(var(--primary))"}},yt=({data:e,isLoading:t})=>n.jsxs(W,{className:"col-span-full lg:col-span-2",children:[n.jsxs(J,{children:[n.jsx(X,{children:"Leads ao Longo do Tempo"}),n.jsx(Y,{children:"Ãltimos 30 dias"})]}),n.jsx(ee,{children:t?n.jsx("div",{className:"flex items-center justify-center h-[300px]",children:n.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-primary"})}):0===e.length?n.jsx("div",{className:"flex items-center justify-center h-[300px] text-muted-foreground",children:"Nenhum dado disponÃvel"}):n.jsx(V,{config:mt,className:"h-[300px] w-full",children:n.jsxs(te,{data:e,margin:{top:10,right:10,left:0,bottom:0},children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:"colorLeads",x1:"0",y1:"0",x2:"0",y2:"1",children:[n.jsx("stop",{offset:"5%",stopColor:"hsl(var(--primary))",stopOpacity:.3}),n.jsx("stop",{offset:"95%",stopColor:"hsl(var(--primary))",stopOpacity:0})]})}),n.jsx(z,{strokeDasharray:"3 3",className:"stroke-muted"}),n.jsx(q,{dataKey:"date",tick:{fontSize:12},tickLine:!1,axisLine:!1}),n.jsx(U,{tick:{fontSize:12},tickLine:!1,axisLine:!1,allowDecimals:!1}),n.jsx($,{content:n.jsx(Z,{})}),n.jsx(re,{type:"monotone",dataKey:"leads",stroke:"hsl(var(--primary))",strokeWidth:2,fill:"url(#colorLeads)"})]})})})]}),ht=["hsl(var(--primary))","hsl(var(--accent))","hsl(142 76% 36%)","hsl(45 93% 47%)","hsl(var(--muted-foreground))"],vt={count:{label:"Leads"}},bt=({data:e,isLoading:t})=>{const r=e.map((e,t)=>({...e,fill:ht[t%ht.length]}));return n.jsxs(W,{children:[n.jsxs(J,{children:[n.jsx(X,{children:"Leads por Fonte"}),n.jsx(Y,{children:"Origem dos leads (UTM Source)"})]}),n.jsx(ee,{children:t?n.jsx("div",{className:"flex items-center justify-center h-[250px]",children:n.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-primary"})}):0===e.length?n.jsx("div",{className:"flex items-center justify-center h-[250px] text-muted-foreground",children:"Nenhum dado disponÃvel"}):n.jsx(V,{config:vt,className:"h-[250px] w-full",children:n.jsxs(ft,{children:[n.jsx(pt,{data:r,cx:"50%",cy:"50%",labelLine:!1,outerRadius:80,innerRadius:40,dataKey:"count",nameKey:"source",label:({source:e,percent:t})=>`${e} ${(100*t).toFixed(0)}%`,children:r.map((e,t)=>n.jsx(C,{fill:e.fill},`cell-${t}`))}),n.jsx($,{content:n.jsx(Z,{nameKey:"source"})})]})})})]})},gt={new:"hsl(45 93% 47%)",contacted:"hsl(var(--primary))",qualified:"hsl(var(--accent))",converted:"hsl(142 76% 36%)",lost:"hsl(var(--destructive))"},xt={count:{label:"Leads"}},jt=({data:e,isLoading:t})=>{const r=e.reduce((e,t)=>e+t.count,0),a=e.find(e=>"converted"===e.status)?.count||0,o=r>0?(a/r*100).toFixed(1):"0";return n.jsxs(W,{children:[n.jsxs(J,{children:[n.jsxs(X,{className:"flex items-center justify-between",children:["Funil de Conversão",n.jsxs("span",{className:"text-sm font-normal text-muted-foreground",children:["Taxa: ",n.jsxs("span",{className:"text-primary font-semibold",children:[o,"%"]})]})]}),n.jsx(Y,{children:"Status dos leads"})]}),n.jsx(ee,{children:t?n.jsx("div",{className:"flex items-center justify-center h-[250px]",children:n.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-primary"})}):0===e.length?n.jsx("div",{className:"flex items-center justify-center h-[250px] text-muted-foreground",children:"Nenhum dado disponÃvel"}):n.jsx(V,{config:xt,className:"h-[250px] w-full",children:n.jsxs(G,{data:e,layout:"vertical",margin:{top:10,right:10,left:60,bottom:0},children:[n.jsx(z,{strokeDasharray:"3 3",className:"stroke-muted",horizontal:!1}
1),n.jsx(q,{type:"number",tickLine:!1,axisLine:!1}),n.jsx(U,{type:"category",dataKey:"label",tickLine:!1,axisLine:!1,width:60}),n.jsx($,{content:n.jsx(Z,{})}),n.jsx(H,{dataKey:"count",radius:[0,4,4,0],children:e.map(e=>n.jsx(C,{fill:gt[e.status]||"hsl(var(--muted))"},`cell-${e.status}`))})]})})})]})},Ot=e=>{switch(e){case"new":return n.jsx(se,{className:"h-4 w-4 text-yellow-500"});case"contacted":return n.jsx(ne,{className:"h-4 w-4 text-primary"});case"qualified":return n.jsx(oe,{className:"h-4 w-4 text-accent"});case"converted":return n.jsx(i,{className:"h-4 w-4 text-green-500"});case"lost":return n.jsx(ae,{className:"h-4 w-4 text-destructive"});default:return n.jsx(ne,{className:"h-4 w-4 text-muted-foreground"})}},At=({leads:e,isLoading:t})=>n.jsxs(W,{className:"col-span-full",children:[n.jsxs(J,{children:[n.jsx(X,{children:"Leads Recentes"}),n.jsx(Y,{children:"Ãltimos contatos recebidos pelo site"})]}),n.jsx(ee,{children:n.jsx("div",t?{className:"flex items-center justify-center py-8",children:n.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-primary"})}:0===e.length?{className:"text-center py-8 text-muted-foreground",children:"Nenhum lead recebido ainda."}:{className:"space-y-4",children:e.map(e=>{return n.jsxs("div",{className:"flex items-center justify-between p-4 rounded-lg border",children:[n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center",children:n.jsx("span",{className:"text-sm font-medium text-primary",children:e.name[0].toUpperCase()})}),n.jsxs("div",{children:[n.jsx("div",{className:"font-medium",children:e.name}),n.jsx("div",{className:"text-sm text-muted-foreground",children:e.email})]})]}),n.jsxs("div",{className:"flex items-center gap-4",children:[n.jsx("div",{className:"text-sm text-muted-foreground",children:new Date(e.created_at).toLocaleDateString("pt-BR")}),n.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 rounded-full bg-muted text-sm",children:[Ot(e.status),(t=e.status,{new:"Novo",contacted:"Contatado",qualified:"Qualificado",converted:"Convertido",lost:"Perdido"}[t]||t)]})]})]},e.id);var t})})})]}),wt={new:"Novos",contacted:"Contatados",qualified:"Qualificados",converted:"Convertidos",lost:"Perdidos"},kt=()=>{const[e,t]=r.useState({totalLeads:0,newLeads:0,convertedLeads:0,conversionRate:"0",totalPages:0,totalPosts:0}),[o,i]=r.useState([]),[c,l]=r.useState([]),[u,d]=r.useState([]),[p,f]=r.useState([]),[m,y]=r.useState(!0);r.useEffect(()=>{(async()=>{try{const{data:e}=await s.from("leads").select("*").order("created_at",{ascending:!1}),r=e||[],n=r.length,a=r.filter(e=>"new"===e.status).length,o=r.filter(e=>"converted"===e.status).length,c=n>0?(o/n*100).toFixed(1):"0",{count:u}=await s.from("pages").select("*",{count:"exact",head:!0}),{count:p}=await s.from("blog_posts").select("*",{count:"exact",head:!0});t({totalLeads:n,newLeads:a,convertedLeads:o,conversionRate:c,totalPages:u||0,totalPosts:p||0}),f(r.slice(0,5));const m=new Date;m.setDate(m.getDate()-30);const y=r.filter(e=>new Date(e.created_at)>=m),h={};for(let t=29;t>=0;t--){const e=new Date;e.setDate(e.getDate()-t);const r=e.toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit"});h[r]=0}y.forEach(e=>{const t=new Date(e.created_at).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit"});void 0!==h[t]&&h[t]++}),i(Object.entries(h).map(([e,t])=>({date:e,leads:t})));const v={};r.forEach(e=>{const t=e.utm_source||"Direto";v[t]=(v[t]||0)+1}),l(Object.entries(v).map(([e,t])=>({source:e,count:t})).sort((e,t)=>t.count-e.count).slice(0,5));const b={new:0,contacted:0,qualified:0,converted:0,lost:0};r.forEach(e=>{void 0!==b[e.status]&&b[e.status]++}),d(Object.entries(b).map(([e,t])=>({status:e,count:t,label:wt[e]||e})))}catch(e){console.error("Error fetching dashboard data:",e)}finally{y(!1)}})()},[]);const h=[{title:"Total de Leads",value:e.totalLeads,icon:ce,color:"text-primary",bgColor:"bg-primary/10"},{title:"Leads Novos",value:e.newLeads,icon:le,color:"text-yellow-500",bgColor:"bg-yellow-500/10"},{title:"Convertidos",value:e.convertedLeads,icon:ue,color:"text-green-500",bgColor:"bg-green-500/10"},{title:"Taxa de Conversão",value:`${e.conversionRate}
1%`,icon:de,color:"text-accent",bgColor:"bg-accent/10"},{title:"Páginas",value:e.totalPages,icon:pe,color:"text-blue-500",bgColor:"bg-blue-500/10"},{title:"Posts do Blog",value:e.totalPosts,icon:ie,color:"text-purple-500",bgColor:"bg-purple-500/10"}];return n.jsx(a,{children:n.jsxs("div",{className:"space-y-6",children:[n.jsxs("div",{children:[n.jsx("h1",{className:"font-display text-3xl font-bold",children:"Dashboard"}),n.jsx("p",{className:"text-muted-foreground",children:"Visão geral do site OTEN Tecnologia"})]}),n.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6",children:h.map(e=>n.jsx(Q,{title:e.title,value:e.value,icon:e.icon,color:e.color,bgColor:e.bgColor,isLoading:m},e.title))}),n.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[n.jsx(yt,{data:o,isLoading:m}),n.jsx(jt,{data:u,isLoading:m})]}),n.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[n.jsx(bt,{data:c,isLoading:m}),n.jsx("div",{className:"lg:col-span-2",children:n.jsx(At,{leads:p,isLoading:m})})]})]})})};export{kt 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.