PageSourceSearch

https://www.avisualidentity.com/assets/AdminAnalytics-CgolJ-zC.js

js avisualidentity.com collected 2026-10-04 20:52:51 UTC 41,799 bytes, 14 lines download raw bytes

vendor: 25,730 bytes, lines 1-12
1import{d as Ze,b3 as I,ah as g,bq as Ye,r as U,aY as vt,j as s,a as Oe,R as ke,g as q,i as z,a3 as yt,C as bt,B,O as jt,ar as At,h as ce,k as le,bI as Pt,af as wt,T as kt,P as Ot,s as De}from"./index-BD2l3yj8.js";import{A as Nt}from"./AdminLayout-CMsK17hG.js";import{T as St,a as Tt,b as fe,c as me}from"./tabs-ivWXOHXv.js";import{T as Xe,a as Je,b as X,c as M,d as et,e as w}from"./table-LhWyJyBF.js";import{E as Ce}from"./eye-DdoWp1AG.js";import{T as tt}from"./trending-up-I_oKKRrk.js";import{j as P,_ as rt,F as _t,H as nt,I as Rt,e as K,J as Re,K as E,L as T,M as at,N as Ee,O as st,D as Et,k as Lt,n as J,t as Q,S as $t,A as It,P as Dt,l as Fe,p as Ct,i as W,r as Ft,s as Mt,G as Kt,Q as ge,U as Vt,E as it,V as Bt,W as pe,w as Me,x as Ut,Z as qt,R as ot,T as ct,B as zt,X as Gt,Y as Ht,z as Qt}from"./BarChart-DF6kbEQW.js";import{E as Wt}from"./external-link-DzQ-5ryq.js";import{M as Zt}from"./monitor-CdFTDvOl.js";import"./useAdmin-CxOCbVzW.js";import"./folder-open-_Riu-s2A.js";import"./handshake-CApWjCtw.js";import"./file-pen-line-D6gSoACG.js";import"./image-D91kGlzq.js";import"./Logo-ByjYxy69.js";import"./chevron-down-D9qJ-0JP.js";import"./chevron-right-BvSdPgS6.js";import"./check-D9-eqU8U.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Yt=Ze("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const Xt=Ze("MousePointer",[["path",{d:"M12.586 12.586 19 19",key:"ea5xo7"}],["path",{d:"M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z",key:"277e5u"}]]);var Jt=["points","className","baseLinePoints","connectNulls"];function Z(){return Z=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=n[t])}return r},Z.apply(this,arguments)}function er(r,e){if(r==null)return{};var n=tr(r,e),t,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(a=0;a<i.length;a++)t=i[a],!(e.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(r,t)&&(n[t]=r[t])}return n}function tr(r,e){if(r==null)return{};var n={};for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t)){if(e.indexOf(t)>=0)continue;n[t]=r[t]}return n}function Ke(r){return sr(r)||ar(r)||nr(r)||rr()}function rr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
12In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nr(r,e){if(r){if(typeof r=="string")return Ne(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);if(n==="Object"&&r.constructor&&(n=r.constructor.name),n==="Map"||n==="Set")return Array.from(r);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ne(r,e)}}function ar(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function sr(r){if(Array.isArray(r))return Ne(r)}function Ne(r,e){(e==null||e>r.length)&&(e=r.length);for(var n=0,t=new Array(e);n<e;n++)t[n]=r[n];return t}var Ve=function(e){return e&&e.x===+e.x&&e.y===+e.y},ir=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return e.forEach(function(t){Ve(t)?n[n.length-1].push(t):n[n.length-1].length>0&&n.push([])}),Ve(e[0])&&n[n.length-1].push(e[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},ie=function(e,n){var t=ir(e);n&&(t=[t.reduce(function(i,o){return[].concat(Ke(i),Ke(o))},[])]);var a=t.map(function(i){return i.reduce(function(o,d,p){return"".concat(o).concat(p===0?"M":"L").concat(d.x,",").concat(d.y)},"")}).join("");return t.length===1?"".concat(a,"Z"):a},or=function(e,n,t){var a=ie(e,t);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(ie(n.reverse(),t).slice(1))},cr=function(e){var n=e.points,t=e.className,a=e.baseLinePoints,i=e.connectNulls,o=er(e,Jt);if(!n||!n.length)return null;var d=I("recharts-polygon",t);if(a&&a.length){var p=o.stroke&&o.stroke!=="none",l=or(n,a,i);return g.createElement("g",{className:d},g.createElement("path",Z({},P(o,!0),{fill:l.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:l})),p?g.createElement("path",Z({},P(o,!0),{fill:"none",d:ie(n,i)})):null,p?g.createElement("path",Z({},P(o,!0),{fill:"none",d:ie(a,i)})):null)}var u=ie(n,i);return g.createElement("path",Z({},P(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",className:d,d:u}))},lr=rt,ur=_t,dr=nt;function fr(r,e){return r&&r.length?lr(r,dr(e),ur):void 0}var mr=fr;const pr=Ye(mr);var hr=rt,gr=nt,xr=Rt;function vr(r,e){return r&&r.length?hr(r,gr(e),xr):void 0}var yr=vr;const br=Ye(yr);var jr=["cx","cy","angle","ticks","axisLine"],Ar=["ticks","tick","angle","tickFormatter","stroke"];function ee(r){"@babel/helpers - typeof";return ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ee(r)}function oe(){return oe=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=n[t])}return r},oe.apply(this,arguments)}function Be(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),n.push.apply(n,t)}return n}function C(r){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Be(Object(n),!0).forEach(function(t){je(r,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):Be(Object(n)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))})}return r}function Ue(r,e){if(r==null)return{};var n=Pr(r,e),t,a;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(r);for(a=0;a<i.length;a++)t=i[a],!(e.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(r,t)&&(n[t]=r[t])}return n}function Pr(r,e){if(r==null)return{};var n={};for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t)){if(e.indexOf(t)>=0)continue;n[t]=r[t]}return n}function wr(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function qe(r,e){for(var n=0;n<e.length;n++){var t=e[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(r,ut(t.key),t)}}function kr(r,e,n){return e&&qe(r.prototype,e),n&&qe(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}function Or(r,e,n){return e=ve(e),Nr(r,lt()?Reflect.construct(e,n||[],ve(r).constructor):e.apply(r,n))}function Nr(r,e){if(e&&(ee(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Sr(r)}function Sr(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function lt(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(lt=function(){return!!r})()}function ve(r){return ve=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ve(r)}function Tr(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&Se(r,e)}function Se(r,e){return Se=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,a){return t.__proto__=a,t},Se(r,e)}function je(r,e,n){return e=ut(e),e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n,r}function ut(r){var e=_r(r,"string");return ee(e)=="symbol"?e:e+""}function _r(r,e){if(ee(r)!="object"||!r)return r;var n=r[Symbol.toPrimitive];if(n!==void 0){var t=n.call(r,e);if(ee(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Ae=function(r){function e(){return wr(this,e),Or(this,e,arguments)}return Tr(e,r),kr(e,[{key:"getTickValueCoord",value:function(t){var a=t.coordinate,i=this.props,o=i.angle,d=i.cx,p=i.cy;return E(d,p,a,o)}},{key:"getTickTextAnchor",value:function(){var t=this.props.orientation,a;switch(t){case"left":a="end";break;case"right":a="start";break;default:a="middle";break}return a}},{key:"getViewBox",value:function(){var t=this.props,a=t.cx,i=t.cy,o=t.angle,d=t.ticks,p=pr(d,function(u){return u.coordinate||0}),l=br(d,function(u){return u.coordinate||0});return{cx:a,cy:i,startAngle:o,endAngle:o,innerRadius:l.coordinate||0,outerRadius:p.coordinate||0}}},{key:"renderAxisLine",value:function(){var t=this.props,a=t.cx,i=t.cy,o=t.angle,d=t.ticks,p=t.axisLine,l=Ue(t,jr),u=d.reduce(function(x,m){return[Math.min(x[0],m.coordinate),Math.max(x[1],m.coordinate)]},[1/0,-1/0]),h=E(a,i,u[0],o),y=E(a,i,u[1],o),A=C(C(C({},P(l,!1)),{},{fill:"none"},P(p,!1)),{},{x1:h.x,y1:h.y,x2:y.x,y2:y.y});return g.createElement("line",oe({className:"recharts-polar-radius-axis-line"},A))}},{key:"renderTicks",value:function(){var t=this,a=this.props,i=a.ticks,o=a.tick,d=a.angle,p=a.tickFormatter,l=a.stroke,u=Ue(a,Ar),h=this.getTickTextAnchor(),y=P(u,!1),A=P(o,!1),x=i.map(function(m,j){var c=t.getTickValueCoord(m),f=C(C(C(C({textAnchor:h,transform:"rotate(".concat(90-d,", ").concat(c.x,", ").concat(c.y,")")},y),{},{stroke:"none",fill:l},A),{},{index:j},c),{},{payload:m});return g.createElement(T,oe({className:I("recharts-polar-radius-axis-tick",at(o)),key:"tick-".concat(m.coordinate)},Ee(t.props,m,j)),e.renderTickItem(o,f,p?p(m.value,j):m.value))});return g.createElement(T,{className:"recharts-polar-radius-axis-ticks"},x)}},{key:"render",value:function(){var t=this.props,a=t.ticks,i=t.axisLine,o=t.tick;return!a||!a.length?null:g.createElement(T,{className:I("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),st.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(t,a,i){var o;return g.isValidElement(t)?o=g.cloneElement(t,a):K(t)?o=t(a):o=g.createElement(Re,oe({},a,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])}(U.PureComponent);je(Ae,"displayName","PolarRadiusAxis");je(Ae,"axisType","radiusAxis");je(Ae,"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});function te(r){"@babel/helpers - typeof";return te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},te(r)}function V(){return V=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=n[t])}return r},V.apply(this,arguments)}function ze(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),n.push.apply(n,t)}return n}function F(r){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ze(Object(n),!0).forEach(function(t){Pe(r,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):ze(Object(n)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))})}return r}function Rr(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function Ge(r,e){for(var n=0;n<e.length;n++){var t=e[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(r,ft(t.key),t)}}function Er(r,e,n){return e&&Ge(r.prototype,e),n&&Ge(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}function Lr(r,e,n){return e=ye(e),$r(r,dt()?Reflect.construct(e,n||[],ye(r).constructor):e.apply(r,n))}function $r(r,e){if(e&&(te(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ir(r)}function Ir(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function dt(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(dt=function(){return!!r})()}function ye(r){return ye=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ye(r)}function Dr(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&Te(r,e)}function Te(r,e){return Te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,a){return t.__proto__=a,t},Te(r,e)}function Pe(r,e,n){return e=ft(e),e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n,r}function ft(r){var e=Cr(r,"string");return te(e)=="symbol"?e:e+""}function Cr(r,e){if(te(r)!="object"||!r)return r;var n=r[Symbol.toPrimitive];if(n!==void 0){var t=n.call(r,e);if(te(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}var Fr=Math.PI/180,He=1e-5,we=function(r){function e(){return Rr(this,e),Lr(this,e,arguments)}return Dr(e,r),Er(e,[{key:"getTickLineCoord",value:function(t){var a=this.props,i=a.cx,o=a.cy,d=a.radius,p=a.orientation,l=a.tickSize,u=l||8,h=E(i,o,d,t.coordinate),y=E(i,o,d+(p==="inner"?-1:1)*u,t.coordinate);return{x1:h.x,y1:h.y,x2:y.x,y2:y.y}}},{key:"getTickTextAnchor",value:function(t){var a=this.props.orientation,i=Math.cos(-t.coordinate*Fr),o;return i>He?o=a==="outer"?"start":"end":i<-He?o=a==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var t=this.props,a=t.cx,i=t.cy,o=t.radius,d=t.axisLine,p=t.axisLineType,l=F(F({},P(this.props,!1)),{},{fill:"none"},P(d,!1));if(p==="circle")return g.createElement(Et,V({className:"recharts-polar-angle-axis-line"},l,{cx:a,cy:i,r:o}));var u=this.props.ticks,h=u.map(function(y){return E(a,i,o,y.coordinate)});return g.createElement(cr,V({className:"recharts-polar-angle-axis-line"},l,{points:h}))}},{key:"renderTicks",value:function(){var t=this,a=this.props,i=a.ticks,o=a.tick,d=a.tickLine,p=a.tickFormatter,l=a.stroke,u=P(this.props,!1),h=P(o,!1),y=F(F({},u),{},{fill:"none"},P(d,!1)),A=i.map(function(x,m){var j=t.getTickLineCoord(x),c=t.getTickTextAnchor(x),f=F(F(F({textAnchor:c},u),{},{stroke:"none",fill:l},h),{},{index:m,payload:x,x:j.x2,y:j.y2});return g.createElement(T,V({className:I("recharts-polar-angle-axis-tick",at(o)),key:"tick-".concat(x.coordinate)},Ee(t.props,x,m)),d&&g.createElement("line",V({className:"recharts-polar-angle-axis-tick-line"},y,j)),o&&e.renderTickItem(o,f,p?p(x.value,m):x.value))});return g.createElement(T,{className:"recharts-polar-angle-axis-ticks"},A)}},{key:"render",value:function(){var t=this.props,a=t.ticks,i=t.radius,o=t.axisLine;return i<=0||!a||!a.length?null:g.createElement(T,{className:I("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(t,a,i){var o;return g.isValidElement(t)?o=g.cloneElement(t,a):K(t)?o=t(a):o=g.createElement(Re,V({},a,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])}(U.PureComponent);Pe(we,"displayName","PolarAngleAxis");Pe(we,"axisType","angleAxis");Pe(we,"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 xe;function re(r){"@babel/helpers - typeof";return re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},re(r)}function Y(){return Y=Object.assign?Object.assign.bind():function(r){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(r[t]=n[t])}return r},Y.apply(this,arguments)}function Qe(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(r);e&&(t=t.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),n.push.apply(n,t)}return n}function b(r){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Qe(Object(n),!0).forEach(function(t){N(r,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):Qe(Object(n)).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))})}return r}function Mr(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function We(r,e){for(var n=0;n<e.length;n++){var t=e[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(r,pt(t.key),t)}}function Kr(r,e,n){return e&&We(r.prototype,e),n&&We(r,n),Object.defineProperty(r,"prototype",{writable:!1}),r}function Vr(r,e,n){return e=be(e),Br(r,mt()?Reflect.construct(e,n||[],be(r).constructor):e.apply(r,n))}function Br(r,e){if(e&&(re(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ur(r)}function Ur(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function mt(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(mt=function(){return!!r})()}function be(r){return be=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},be(r)}function qr(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),e&&_e(r,e)}function _e(r,e){return _e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,a){return t.__proto__=a,t},_e(r,e)}function N(r,e,n){return e=pt(e),e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n,r}function pt(r){var e=zr(r,"string");return re(e)=="symbol"?e:e+""}function zr(r,e){if(re(r)!="object"||!r)return r;var n=r[Symbol.toPrimitive];if(n!==void 0){var t=n.call(r,e);if(re(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}var L=function(r){function e(n){var t;return Mr(this,e),t=Vr(this,e,[n]),N(t,"pieRef",null),N(t,"sectorRefs",[]),N(t,"id",Mt("recharts-pie-")),N(t,"handleAnimationEnd",function(){var a=t.props.onAnimationEnd;t.setState({isAnimationFinished:!0}),K(a)&&a()}),N(t,"handleAnimationStart",function(){var a=t.props.onAnimationStart;t.setState({isAnimationFinished:!1}),K(a)&&a()}),t.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},t}return qr(e,r),Kr(e,[{key:"isActiveIndex",value:function(t){var a=this.props.activeIndex;return Array.isArray(a)?a.indexOf(t)!==-1:t===a}},{key:"hasActiveIndex",value:function(){var t=this.props.activeIndex;return Array.isArray(t)?t.length!==0:t||t===0}},{key:"renderLabels",value:function(t){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.label,d=i.labelLine,p=i.dataKey,l=i.valueKey,u=P(this.props,!1),h=P(o,!1),y=P(d,!1),A=o&&o.offsetRadius||20,x=t.map(function(m,j){var c=(m.startAngle+m.endAngle)/2,f=E(m.cx,m.cy,m.outerRadius+A,c),S=b(b(b(b({},u),m),{},{stroke:"none"},h),{},{index:j,textAnchor:e.getTextAnchor(f.x,m.cx)},f),G=b(b(b(b({},u),m),{},{fill:"none",stroke:m.fill},y),{},{index:j,points:[E(m.cx,m.cy,m.outerRadius,c),f]}),_=p;return J(p)&&J(l)?_="value":J(p)&&(_=l),g.createElement(T,{key:"label-".concat(m.startAngle,"-").concat(m.endAngle,"-").concat(m.midAngle,"-").concat(j)},d&&e.renderLabelLineItem(d,G,"line"),e.renderLabelItem(o,S,Q(m,_)))});return g.createElement(T,{className:"recharts-pie-labels"},x)}},{key:"renderSectorsStatically",value:function(t){var a=this,i=this.props,o=i.activeShape,d=i.blendStroke,p=i.inactiveShape;return t.map(function(l,u){if((l==null?void 0:l.startAngle)===0&&(l==null?void 0:l.endAngle)===0&&t.length!==1)return null;var h=a.isActiveIndex(u),y=p&&a.hasActiveIndex()?p:null,A=h?o:y,x=b(b({},l),{},{stroke:d?l.fill:l.stroke,tabIndex:-1});return g.createElement(T,Y({ref:function(j){j&&!a.sectorRefs.includes(j)&&a.sectorRefs.push(j)},tabIndex:-1,className:"recharts-pie-sector"},Ee(a.props,l,u),{key:"sector-".concat(l==null?void 0:l.startAngle,"-").concat(l==null?void 0:l.endAngle,"-").concat(l.midAngle,"-").concat(u)}),g.createElement($t,Y({option:A,isActive:h,shapeType:"sector"},x)))})}},{key:"renderSectorsWithAnimation",value:function(){var t=this,a=this.props,i=a.sectors,o=a.isAnimationActive,d=a.animationBegin,p=a.animationDuration,l=a.animationEasing,u=a.animationId,h=this.state,y=h.prevSectors,A=h.prevIsAnimationActive;return g.createElement(It,{begin:d,duration:p,isActive:o,easing:l,from:{t:0},to:{t:1},key:"pie-".concat(u,"-").concat(A),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(x){var m=x.t,j=[],c=i&&i[0],f=c.startAngle;return i.forEach(function(S,G){var _=y&&y[G],D=G>0?Dt(S,"paddingAngle",0):0;if(_){var ae=Fe(_.endAngle-_.startAngle,S.endAngle-S.startAngle),O=b(b({},S),{},{startAngle:f+D,endAngle:f+ae(m)+D});j.push(O),f=O.endAngle}else{var H=S.endAngle,R=S.startAngle,ue=Fe(0,H-R),de=ue(m),$=b(b({},S),{},{startAngle:f+D,endAngle:f+de+D});j.push($),f=$.endAngle}}),g.createElement(T,null,t.renderSectorsStatically(j))})}},{key:"attachKeyboardHandlers",value:function(t){var a=this;t.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[o].focus(),a.setState({sectorToFocus:o});break}case"ArrowRight":{var d=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[d].focus(),a.setState({sectorToFocus:d});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var t=this.props,a=t.sectors,i=t.isAnimationActive,o=this.state.prevSectors;return i&&a&&a.length&&(!o||!Ct(o,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var t=this,a=this.props,i=a.hide,o=a.sectors,d=a.className,p=a.label,l=a.cx,u=a.cy,h=a.innerRadius,y=a.outerRadius,A=a.isAnimationActive,x=this.state.isAnimationFinished;if(i||!o||!o.length||!W(l)||!W(u)||!W(h)||!W(y))return null;var m=I("recharts-pie",d);return g.createElement(T,{tabIndex:this.props.rootTabIndex,className:m,ref:function(c){t.pieRef=c}},this.renderSectors(),p&&this.renderLabels(o),st.renderCallByParent(this.props,null,!1),(!A||x)&&Ft.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(t,a){return a.prevIsAnimationActive!==t.isAnimationActive?{prevIsAnimationActive:t.isAnimationActive,prevAnimationId:t.animationId,curSectors:t.sectors,prevSectors:[],isAnimationFinished:!0}:t.isAnimationActive&&t.animationId!==a.prevAnimationId?{prevAnimationId:t.animationId,curSectors:t.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:t.sectors!==a.curSectors?{curSectors:t.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(t,a){return t>a?"start":t<a?"end":"middle"}},{key:"renderLabelLineItem",value:function(t,a,i){if(g.isValidElement(t))return g.cloneElement(t,a);if(K(t))return t(a);var o=I("recharts-pie-label-line",typeof t!="boolean"?t.className:"");return g.createElement(Lt,Y({},a,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(t,a,i){if(g.isValidElement(t))return g.cloneElement(t,a);var o=i;if(K(t)&&(o=t(a),g.isValidElement(o)))return o;var d=I("recharts-pie-label-text",typeof t!="boolean"&&!K(t)?t.className:"");return g.createElement(Re,Y({},a,{alignmentBaseline:"middle",className:d}),o)}}])}(U.PureComponent);xe=L;N(L,"displayName","Pie");N(L,"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:!Kt.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});N(L,"parseDeltaAngle",function(r,e){var n=ge(e-r),t=Math.min(Math.abs(e-r),360);return n*t});N(L,"getRealPieData",function(r){var e=r.data,n=r.children,t=P(r,!1),a=Vt(n,it);return e&&e.length?e.map(function(i,o){return b(b(b({payload:i},t),i),a&&a[o]&&a[o].props)}):a&&a.length?a.map(function(i){return b(b({},t),i.props)}):[]});N(L,"parseCoordinateOfPie",function(r,e){var n=e.top,t=e.left,a=e.width,i=e.he
12ight,o=Bt(a,i),d=t+pe(r.cx,a,a/2),p=n+pe(r.cy,i,i/2),l=pe(r.innerRadius,o,0),u=pe(r.outerRadius,o,o*.8),h=r.maxRadius||Math.sqrt(a*a+i*i)/2;return{cx:d,cy:p,innerRadius:l,outerRadius:u,maxRadius:h}});N(L,"getComposedData",function(r){var e=r.item,n=r.offset,t=e.type.defaultProps!==void 0?b(b({},e.type.defaultProps),e.props):e.props,a=xe.getRealPieData(t);if(!a||!a.length)return null;var i=t.cornerRadius,o=t.startAngle,d=t.endAngle,p=t.paddingAngle,l=t.dataKey,u=t.nameKey,h=t.valueKey,y=t.tooltipType,A=Math.abs(t.minAngle),x=xe.parseCoordinateOfPie(t,n),m=xe.parseDeltaAngle(o,d),j=Math.abs(m),c=l;J(l)&&J(h)?(Me(!1,`Use "dataKey" to specify the value of pie,
13      the props "valueKey" will be deprecated in 1.1.0`),c="value"):J(l)&&(Me(!1,`Use "dataKey" to specify the value of pie,
14      the props "valueKey" will be deprecated in 1.1.0`),c=h);var f=a.filter(function(O){return Q(O,c,0)!==0}).length,S=(j>=360?f:f-1)*p,G=j-f*A-S,_=a.reduce(function(O,H){var R=Q(H,c,0);return O+(W(R)?R:0)},0),D;if(_>0){var ae;D=a.map(function(O,H){var R=Q(O,c,0),ue=Q(O,u,H),de=(W(R)?R:0)/_,$;H?$=ae.endAngle+ge(m)*p*(R!==0?1:0):$=o;var Le=$+ge(m)*((R!==0?A:0)+de*G),$e=($+Le)/2,Ie=(x.innerRadius+x.outerRadius)/2,gt=[{name:ue,value:R,payload:O,dataKey:c,type:y}],xt=E(x.cx,x.cy,Ie,$e);return ae=b(b(b({percent:de,cornerRadius:i,name:ue,tooltipPayload:gt,midAngle:$e,middleRadius:Ie,tooltipPosition:xt},O),x),{},{value:Q(O,c),startAngle:$,endAngle:Le,payload:O,paddingAngle:ge(m)*p}),ae})}return b(b({},x),{},{sectors:D,data:a})});var Gr=Ut({chartName:"PieChart",GraphicalChild:L,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:we},{axisType:"radiusAxis",AxisComp:Ae}],formatAxisMap:qt,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});const he=["hsl(var(--primary))","hsl(var(--chart-2))","hsl(var(--chart-3))","hsl(var(--chart-4))","hsl(var(--chart-5))"],v=r=>typeof r=="number"?r:parseFloat(r)||0,k=r=>r>=1e6?`${(r/1e6).toFixed(1)}M`:r>=1e3?`${(r/1e3).toFixed(1)}K`:Math.round(r).toString(),ht=r=>{if(r<60)return`${Math.round(r)}s`;const e=Math.floor(r/60),n=Math.round(r%60);return`${e}m ${n}s`},ne=r=>`${(v(r)*100).toFixed(1)}%`;function se({title:r,value:e,subtitle:n,icon:t,trend:a}){return s.jsxs(q,{children:[s.jsxs(ce,{className:"flex flex-row items-center justify-between pb-2",children:[s.jsx(le,{className:"text-sm font-medium text-muted-foreground",children:r}),s.jsx(t,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(z,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-2xl font-bold",children:e}),a==="up"&&s.jsx(tt,{className:"h-4 w-4 text-green-500"}),a==="down"&&s.jsx(Pt,{className:"h-4 w-4 text-red-500"})]}),n&&s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:n})]})]})}function Hr({pages:r,searchTerm:e}){const[n,t]=U.useState("sessions"),[a,i]=U.useState("desc"),d=[...r.filter(u=>u.landingPage.toLowerCase().includes(e.toLowerCase())||u.pageTitle.toLowerCase().includes(e.toLowerCase()))].sort((u,h)=>{const y=v(u[n]),A=v(h[n]);return a==="desc"?A-y:y-A}),p=u=>{n===u?i(h=>h==="asc"?"desc":"asc"):(t(u),i("desc"))},l=({column:u,label:h})=>s.jsx(M,{className:"cursor-pointer hover:bg-muted/50 transition-colors",onClick:()=>p(u),children:s.jsxs("div",{className:"flex items-center gap-1",children:[h,s.jsx(Yt,{className:"h-3 w-3"})]})});return s.jsx("div",{className:"rounded-md border",children:s.jsxs(Xe,{children:[s.jsx(Je,{children:s.jsxs(X,{children:[s.jsx(M,{className:"w-[300px]",children:"Page"}),s.jsx(l,{column:"sessions",label:"Sessions"}),s.jsx(l,{column:"totalUsers",label:"Users"}),s.jsx(l,{column:"screenPageViews",label:"Views"}),s.jsx(l,{column:"bounceRate",label:"Bounce"}),s.jsx(l,{column:"engagementRate",label:"Engagement"}),s.jsx(l,{column:"averageSessionDuration",label:"Avg Duration"})]})}),s.jsxs(et,{children:[d.slice(0,20).map((u,h)=>s.jsxs(X,{children:[s.jsx(w,{className:"font-medium",children:s.jsxs("div",{className:"max-w-[300px]",children:[s.jsx("p",{className:"truncate text-sm",children:u.landingPage}),s.jsx("p",{className:"truncate text-xs text-muted-foreground",children:u.pageTitle})]})}),s.jsx(w,{children:k(v(u.sessions))}),s.jsx(w,{children:k(v(u.totalUsers))}),s.jsx(w,{children:k(v(u.screenPageViews))}),s.jsx(w,{children:s.jsx(B,{variant:v(u.bounceRate)>.7?"destructive":"secondary",children:ne(u.bounceRate)})}),s.jsx(w,{children:s.jsx(B,{variant:v(u.engagementRate)>.5?"default":"outline",children:ne(u.engagementRate)})}),s.jsx(w,{children:ht(v(u.averageSessionDuration))})]},h)),d.length===0&&s.jsx(X,{children:s.jsx(w,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"No pages match your search"})})]})]})})}function Qr({sources:r}){const e=r.map((n,t)=>({name:n.sessionDefaultChannelGroup,sessions:v(n.sessions),users:v(n.totalUsers),fill:he[t%he.length]}));return s.jsxs(q,{children:[s.jsx(ce,{children:s.jsx(le,{className:"text-lg",children:"Traffic Sources"})}),s.jsxs(z,{children:[s.jsx("div",{className:"h-[300px]",children:s.jsx(ot,{width:"100%",height:"100%",children:s.jsxs(Gr,{children:[s.jsx(L,{data:e,dataKey:"sessions",nameKey:"name",cx:"50%",cy:"50%",outerRadius:100,label:({name:n,percent:t})=>`${n} ${(t*100).toFixed(0)}%`,children:e.map((n,t)=>s.jsx(it,{fill:n.fill},t))}),s.jsx(ct,{})]})})}),s.jsx("div",{className:"mt-4 space-y-2",children:r.map((n,t)=>s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:he[t%he.length]}}),s.jsx("span",{children:n.sessionDefaultChannelGroup})]}),s.jsxs("div",{className:"flex gap-4 text-muted-foreground",children:[s.jsxs("span",{children:[k(v(n.sessions))," sessions"]}),s.jsx(B,{variant:v(n.engagementRate)>.5?"default":"outline",children:ne(n.engagementRate)})]})]},t))})]})]})}function Wr({devices:r}){const e=r.map(t=>({name:t.deviceCategory,sessions:v(t.sessions),users:v(t.totalUsers),views:v(t.screenPageViews)})),n=t=>t.toLowerCase()==="mobile"?s.jsx(Ot,{className:"h-4 w-4"}):s.jsx(Zt,{className:"h-4 w-4"});return s.jsxs(q,{children:[s.jsx(ce,{children:s.jsx(le,{className:"text-lg",children:"Devices"})}),s.jsxs(z,{children:[s.jsx("div",{className:"h-[200px]",children:s.jsx(ot,{width:"100%",height:"100%",children:s.jsxs(zt,{data:e,layout:"vertical",children:[s.jsx(Gt,{type:"number"}),s.jsx(Ht,{type:"category",dataKey:"name",width:80}),s.jsx(ct,{}),s.jsx(Qt,{dataKey:"sessions",fill:"hsl(var(--primary))",radius:[0,4,4,0]})]})})}),s.jsx("div",{className:"mt-4 grid grid-cols-2 gap-4",children:r.map((t,a)=>s.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-muted/50",children:[n(t.deviceCategory),s.jsxs("div",{children:[s.jsx("p",{className:"font-medium capitalize",children:t.deviceCategory}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[k(v(t.sessions))," sessions • ",ne(t.engagementRate)," engaged"]})]})]},a))})]})]})}function Zr({locations:r}){const[e,n]=U.useState(!1),t=e?r:r.slice(0,10);return s.jsxs(q,{children:[s.jsx(ce,{children:s.jsxs(le,{className:"text-lg flex items-center gap-2",children:[s.jsx(wt,{className:"h-4 w-4"}),"Top Locations"]})}),s.jsxs(z,{children:[s.jsx("div",{className:"space-y-2",children:t.map((a,i)=>s.jsxs("div",{className:"flex items-center justify-between py-2 border-b last:border-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(kt,{className:"h-4 w-4 text-muted-foreground"}),s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:a.city!=="(not set)"?a.city:"Unknown"}),s.jsx("p",{className:"text-xs text-muted-foreground",children:a.country})]})]}),s.jsxs("div",{className:"text-right",children:[s.jsxs("p",{className:"text-sm font-medium",children:[k(v(a.sessions))," sessions"]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[k(v(a.totalUsers))," users"]})]})]},i))}),r.length>10&&s.jsx(Oe,{variant:"ghost",className:"w-full mt-4",onClick:()=>n(!e),children:e?"Show Less":`Show All ${r.length} Locations`})]})]})}function Yr({referrers:r}){return s.jsxs(q,{children:[s.jsx(ce,{children:s.jsxs(le,{className:"text-lg flex items-center gap-2",children:[s.jsx(Wt,{className:"h-4 w-4"}),"Top Referrers"]})}),s.jsx(z,{children:s.jsx("div",{className:"space-y-2",children:r.map((e,n)=>s.jsxs("div",{className:"flex items-center justify-between py-2 border-b last:border-0",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-sm font-medium",children:e.sessionSource}),s.jsx("p",{className:"text-xs text-muted-foreground",children:e.sessionMedium})]}),s.jsxs("div",{className:"text-right",children:[s.jsxs("p",{className:"text-sm font-medium",children:[k(v(e.sessions))," sessions"]}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[k(v(e.newUsers))," new users"]})]})]},n))})})]})}const Xr=async()=>{const{data:r,error:e}=await De.from("ga4_daily_metrics").select("*").order("date",{ascending:!1});if(e)throw new Error(e.message);const n=r||[],t=n.length>0?n[n.length-1].date:"N/A",a=n.reduce((c,f)=>c+(f.sessions||0),0),i=n.reduce((c,f)=>c+(f.totalUsers||0),0),o=n.reduce((c,f)=>c+(f.newUsers||0),0),d=n.reduce((c,f)=>c+(f.screenPageViews||0),0),p=n.reduce((c,f)=>c+(f.userEngagementDuration||0),0),l=n.reduce((c,f)=>c+(f.engagedSessions||0),0),u=a>0?p/a:0,h=a>0?1-l/a:0,y=a>0?l/a:0,{data:A}=await De.from("gsc_query_metrics").select("*").order("clicks",{ascending:!1}).limit(500),x=new Map,m=new Map;for(const c of A||[]){if(c.query){const f=x.get(c.query);f?(f.clicks+=c.clicks||0,f.impressions+=c.impressions||0,f.ctr=f.impressions>0?f.clicks/f.impressions:0,f.position=(f.position+(c.position||0))/2):x.set(c.query,{query:c.query,clicks:c.clicks||0,impressions:c.impressions||0,ctr:c.ctr||0,position:c.position||0})}if(c.page){const f=m.get(c.page);f?(f.sessions=String(parseFloat(f.sessions)+(c.clicks||0)),f.screenPageViews=String(parseFloat(f.screenPageViews)+(c.impressions||0))):m.set(c.page,{landingPage:c.page.replace("http://www.avisualidentity.com","").replace("https://www.avisualidentity.com","")||"/",pageTitle:c.page.replace("http://www.avisualidentity.com","").replace("https://www.avisualidentity.com","")||"/",sessions:String(c.clicks||0),totalUsers:"0",newUsers:"0",screenPageViews:String(c.impressions||0),averageSessionDuration:"0",bounceRate:"0",engagementRate:"0"})}}const j=Array.from(x.values()).sort((c,f)=>f.clicks-c.clicks||f.impressions-c.impressions);return{ok:!0,dateRange:{startDate:t,endDate:n.length>0?n[0].date:"today"},overview:{sessions:String(a),totalUsers:String(i),newUsers:String(o),screenPageViews:String(d),averageSessionDuration:String(u),bounceRate:String(h),engagementRate:String(y),sessionsPerUser:i>0?String(a/i):"0",screenPageViewsPerSession:a>0?String(d/a):"0"},topPages:Array.from(m.values()).sort((c,f)=>parseFloat(f.sessions)-parseFloat(c.sessions)),searchQueries:j,trafficSources:[],devices:[],geography:[],referrers:[]}};function vn(){const[r,e]=U.useState(""),{data:n,isLoading:t,refetch:a}=vt({queryKey:["analytics"],queryFn:Xr,staleTime:5*60*1e3,gcTime:30*60*1e3}),i=n==null?void 0:n.overview;return s.jsx(Nt,{children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-3xl font-bold",children:"Analytics Dashboard"}),(n==null?void 0:n.dateRange)&&s.jsxs("p",{className:"text-muted-foreground mt-1",children:[n.dateRange.startDate," → ",n.dateRange.endDate]})]}),s.jsxs(Oe,{onClick:()=>a(),disabled:t,children:[s.jsx(ke,{className:`h-4 w-4 mr-2 ${t?"animate-spin":""}`}),"Refresh Data"]})]}),t&&!n?s.jsx(q,{className:"py-12",children:s.jsxs(z,{className:"text-center",children:[s.jsx(ke,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4 animate-spin"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"Loading Analytics"}),s.jsx("p",{className:"text-muted-foreground",children:"Fetching data from Google Analytics..."})]})}):n?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 ga
14p-4",children:[s.jsx(se,{title:"Total Sessions",value:k(v((i==null?void 0:i.sessions)||0)),subtitle:`${k(v((i==null?void 0:i.sessionsPerUser)||0))} per user`,icon:Xt}),s.jsx(se,{title:"Total Users",value:k(v((i==null?void 0:i.totalUsers)||0)),subtitle:`${k(v((i==null?void 0:i.newUsers)||0))} new`,icon:yt}),s.jsx(se,{title:"Page Views",value:k(v((i==null?void 0:i.screenPageViews)||0)),subtitle:`${v((i==null?void 0:i.screenPageViewsPerSession)||0).toFixed(1)} per session`,icon:Ce}),s.jsx(se,{title:"Avg Duration",value:ht(v((i==null?void 0:i.averageSessionDuration)||0)),icon:bt}),s.jsx(se,{title:"Engagement Rate",value:ne((i==null?void 0:i.engagementRate)||0),subtitle:`${ne((i==null?void 0:i.bounceRate)||0)} bounce`,icon:tt,trend:v((i==null?void 0:i.engagementRate)||0)>.3?"up":"down"})]}),s.jsxs(St,{defaultValue:"queries",className:"space-y-4",children:[s.jsxs(Tt,{children:[s.jsx(fe,{value:"queries",children:"Search Queries"}),s.jsx(fe,{value:"pages",children:"Top Pages"}),s.jsx(fe,{value:"sources",children:"Traffic Sources"}),s.jsx(fe,{value:"audience",children:"Audience"})]}),s.jsxs(me,{value:"queries",className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs(B,{variant:"outline",children:[n.searchQueries.length," queries tracked"]}),s.jsxs(B,{variant:"outline",children:[n.searchQueries.reduce((o,d)=>o+d.clicks,0)," total clicks"]}),s.jsxs(B,{variant:"outline",children:[n.searchQueries.reduce((o,d)=>o+d.impressions,0)," total impressions"]})]}),s.jsx("div",{className:"rounded-md border",children:s.jsxs(Xe,{children:[s.jsx(Je,{children:s.jsxs(X,{children:[s.jsx(M,{className:"w-[300px]",children:"Query"}),s.jsx(M,{className:"text-right",children:"Clicks"}),s.jsx(M,{className:"text-right",children:"Impressions"}),s.jsx(M,{className:"text-right",children:"CTR"}),s.jsx(M,{className:"text-right",children:"Avg Position"})]})}),s.jsx(et,{children:n.searchQueries.length===0?s.jsx(X,{children:s.jsx(w,{colSpan:5,className:"text-center text-muted-foreground py-8",children:"No search query data available"})}):n.searchQueries.map((o,d)=>s.jsxs(X,{children:[s.jsx(w,{className:"font-medium",children:o.query}),s.jsx(w,{className:"text-right font-semibold",children:o.clicks}),s.jsx(w,{className:"text-right",children:o.impressions}),s.jsxs(w,{className:"text-right",children:[(o.ctr*100).toFixed(1),"%"]}),s.jsx(w,{className:"text-right",children:o.position.toFixed(1)})]},d))})]})})]}),s.jsxs(me,{value:"pages",className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs("div",{className:"relative flex-1 max-w-sm",children:[s.jsx(jt,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),s.jsx(At,{placeholder:"Search pages...",value:r,onChange:o=>e(o.target.value),className:"pl-9"})]}),s.jsxs(B,{variant:"outline",children:[n.topPages.length," pages tracked"]})]}),s.jsx(Hr,{pages:n.topPages,searchTerm:r})]}),s.jsx(me,{value:"sources",className:"space-y-4",children:s.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[s.jsx(Qr,{sources:n.trafficSources}),s.jsx(Yr,{referrers:n.referrers})]})}),s.jsx(me,{value:"audience",className:"space-y-4",children:s.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[s.jsx(Wr,{devices:n.devices}),s.jsx(Zr,{locations:n.geography})]})})]})]}):s.jsx(q,{className:"py-12",children:s.jsxs(z,{className:"text-center",children:[s.jsx(Ce,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),s.jsx("h3",{className:"text-lg font-medium mb-2",children:"No Analytics Data"}),s.jsx("p",{className:"text-muted-foreground mb-4",children:"Failed to load analytics data. Click below to retry."}),s.jsxs(Oe,{onClick:()=>a(),disabled:t,children:[s.jsx(ke,{className:`h-4 w-4 mr-2 ${t?"animate-spin":""}`}),"Retry"]})]})})]})})}export{vn 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.