PageSourceSearch

https://writoryofficial.com/assets/admin-revenue-report-CXKCntnv.js

js writoryofficial.com collected 2026-10-02 21:31:54 UTC 47,024 bytes, 5 lines download raw bytes

1var vt=Object.defineProperty,bt=Object.defineProperties;var gt=Object.getOwnPropertyDescriptors;var $e=Object.getOwnPropertySymbols;var yt=Object.prototype.hasOwnProperty,jt=Object.prototype.propertyIsEnumerable;var Fe=(t,e,a)=>e in t?vt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,Ce=(t,e)=>{for(var a in e||(e={}))yt.call(e,a)&&Fe(t,a,e[a]);if($e)for(var a of $e(e))jt.call(e,a)&&Fe(t,a,e[a]);return t},De=(t,e)=>bt(t,gt(e));var Be=(t,e,a)=>new Promise((r,s)=>{var o=u=>{try{d(a.next(u))}catch(l){s(l)}},i=u=>{try{d(a.throw(u))}catch(l){s(l)}},d=u=>u.done?r(u.value):Promise.resolve(u.value).then(o,i);d((a=a.apply(t,e)).next())});import{aT as Y,Q as Nt,j as n,C as T,q as _,a_ as ue,v as Ke,i as Me,R as At,n as C,o as D,bd as wt,a7 as kt,af as Pt,b_ as me,br as Ot}from"./index-B6cfMRgy.js";import{b as x,g as at,r as E}from"./vendor-DliuPpH9.js";import{T as St,a as Rt,b as Ve,c as oe,d as Tt,e as le}from"./table-BLK5IFQQ.js";import{A as _t}from"./AdminNavigation-CpjpytbM.js";import{A as Et}from"./admin-guard-BmrT7cBl.js";import{S as fe,a as pe,b as xe,c as he,d as M}from"./select-CFHGoXyl.js";import{L as ve}from"./label-CfNCq9ha.js";import{D as It}from"./download-BVS6EhD1.js";import{C as Lt}from"./calendar-CqcRvYgG.js";import{T as $t}from"./trending-up-DI18OGBs.js";import{f as k,_ as st,a as Ft,b as it,c as Ct,i as Z,d as Ie,p as V,e as $,g as ot,h as Le,j as lt,D as Dt,k as Bt,l as ne,m as J,S as Kt,A as Mt,n as Vt,o as Ue,q as Ut,r as ee,s as zt,u as Wt,G as Yt,t as ge,v as Gt,w as ct,x as qt,y as be,z as ze,E as Ht,F as Zt,R as We,C as Xt,X as Qt,Y as Jt,T as Ye}from"./generateCategoricalChart-DfNaJzub.js";import{L as er}from"./LineChart-Bu3DBVDF.js";import{L as tr}from"./Line-DKYZESEE.js";import{C as Ge}from"./chart-column-CE9-16tV.js";import"./settings-C2EuQIhy.js";import"./credit-card-ChOJVc-Y.js";import"./upload-COeFv-bA.js";import"./sparkles-BW8PNQqg.js";import"./user-check-BoPwALF7.js";import"./shopping-bag-DX8O6nzD.js";import"./eye-oTUC4pEi.js";import"./index-BK4LTKmn.js";var rr=["points","className","baseLinePoints","connectNulls"];function te(){return te=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},te.apply(this,arguments)}function nr(t,e){if(t==null)return{};var a=ar(t,e),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}function ar(t,e){if(t==null)return{};var a={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;a[r]=t[r]}return a}function qe(t){return lr(t)||or(t)||ir(t)||sr()}function sr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ir(t,e){if(t){if(typeof t=="string")return Re(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);if(a==="Object"&&t.constructor&&(a=t.constructor.name),a==="Map"||a==="Set")return Array.from(t);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return Re(t,e)}}function or(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function lr(t){if(Array.isArray(t))return Re(t)}function Re(t,e){(e==null||e>t.length)&&(e=t.length);for(var a=0,r=new Array(e);a<e;a++)r[a]=t[a];return r}var He=function(e){return e&&e.x===+e.x&&e.y===+e.y},cr=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],a=[[]];return e.forEach(function(r){He(r)?a[a.length-1].push(r):a[a.length-1].length>0&&a.push([])}),He(e[0])&&a[a.length-1].push(e[0]),a[a.length-1].length<=0&&(a=a.slice(0,-1)),a},ce=function(e,a){var r=cr(e);a&&(r=[r.reduce(function(o,i){return[].concat(qe(o),qe(i))},[])]);var s=r.map(function(o){return o.reduce(function(i,d,u){return"".concat(i).concat(u===0?"M":"L").concat(d.x,",").concat(d.y)},"")}).join("");return r.length===1?"".concat(s,"Z"):s},dr=function(e,a,r){var s=ce(e,r);return"".concat(s.slice(-1)==="Z"?s.slice(0,-1):s,"L").concat(ce(a.reverse(),r).slice(1))}
vendor: 22,214 bytes, line 2
2,ur=function(e){var a=e.points,r=e.className,s=e.baseLinePoints,o=e.connectNulls,i=nr(e,rr);if(!a||!a.length)return null;var d=Y("recharts-polygon",r);if(s&&s.length){var u=i.stroke&&i.stroke!=="none",l=dr(a,s,o);return x.createElement("g",{className:d},x.createElement("path",te({},k(i,!0),{fill:l.slice(-1)==="Z"?i.fill:"none",stroke:"none",d:l})),u?x.createElement("path",te({},k(i,!0),{fill:"none",d:ce(a,o)})):null,u?x.createElement("path",te({},k(i,!0),{fill:"none",d:ce(s,o)})):null)}var p=ce(a,o);return x.createElement("path",te({},k(i,!0),{fill:p.slice(-1)==="Z"?i.fill:"none",className:d,d:p}))},mr=st,fr=Ft,pr=it;function xr(t,e){return t&&t.length?mr(t,pr(e),fr):void 0}var hr=xr;const vr=at(hr);var br=st,gr=it,yr=Ct;function jr(t,e){return t&&t.length?br(t,gr(e),yr):void 0}var Nr=jr;const Ar=at(Nr);var wr=["cx","cy","angle","ticks","axisLine"],kr=["ticks","tick","angle","tickFormatter","stroke"];function ae(t){"@babel/helpers - typeof";return ae=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},ae(t)}function de(){return de=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},de.apply(this,arguments)}function Ze(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),a.push.apply(a,r)}return a}function q(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Ze(Object(a),!0).forEach(function(r){we(t,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Ze(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))})}return t}function Xe(t,e){if(t==null)return{};var a=Pr(t,e),r,s;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(s=0;s<o.length;s++)r=o[s],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(a[r]=t[r])}return a}function Pr(t,e){if(t==null)return{};var a={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;a[r]=t[r]}return a}function Or(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qe(t,e){for(var a=0;a<e.length;a++){var r=e[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ut(r.key),r)}}function Sr(t,e,a){return e&&Qe(t.prototype,e),a&&Qe(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t}function Rr(t,e,a){return e=je(e),Tr(t,dt()?Reflect.construct(e,a||[],je(t).constructor):e.apply(t,a))}function Tr(t,e){if(e&&(ae(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _r(t)}function _r(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function dt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(dt=function(){return!!t})()}function je(t){return je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},je(t)}function Er(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Te(t,e)}function Te(t,e){return Te=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Te(t,e)}function we(t,e,a){return e=ut(e),e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function ut(t){var e=Ir(t,"string");return ae(e)=="symbol"?e:e+""}function Ir(t,e){if(ae(t)!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var r=a.call(t,e);if(ae(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var ke=function(t){function e(){return Or(this,e),Rr(this,e,arguments)}return Er(e,t),Sr(e,[{key:"getTickValueCoord",value:function(r){var s=r.coordinate,o=this.props,i=o.angle,d=o.cx,u=o.cy;return V(d,u,s,i)}},{key:"getTickTextAnchor",value:function(){var r=this.props.orientation,s;switch(r){case"left":s="end";break;case"right":s="start";break;default:s="middle";break}return s}},{key:"getViewBox",value:function(){var r=this.props,s=r.cx,o=r.cy,i=r.angle,d=r.ticks,u=vr(d,function(p){return p.coordinate||0}),l=Ar(d,function(p){return p.coordinate||0});return{cx:s,cy:o,startAngle:i,endAngle:i,innerRadius:l.coordinate||0,outerRadius:u.coordinate||0}}},{key:"renderAxisLine",value:function(){var r=this.props,s=r.cx,o=r.cy,i=r.angle,d=r.ticks,u=r.axisLine,l=Xe(r,wr),p=d.reduce(function(h,m){return[Math.min(h[0],m.coordinate),Math.max(h[1],m.coordinate)]},[1/0,-1/0]),f=V(s,o,p[0],i),g=V(s,o,p[1],i),N=q(q(q({},k(l,!1)),{},{fill:"none"},k(u,!1)),{},{x1:f.x,y1:f.y,x2:g.x,y2:g.y});return x.createElement("line",de({className:"recharts-polar-radius-axis-line"},N))}},{key:"renderTicks",value:function(){var r=this,s=this.props,o=s.ticks,i=s.tick,d=s.angle,u=s.tickFormatter,l=s.stroke,p=Xe(s,kr),f=this.getTickTextAnchor(),g=k(p,!1),N=k(i,!1),h=o.map(function(m,y){var j=r.getTickValueCoord(m),A=q(q(q(q({textAnchor:f,transform:"rotate(".concat(90-d,", ").concat(j.x,", ").concat(j.y,")")},g),{},{stroke:"none",fill:l},N),{},{index:y},j),{},{payload:m});return x.createElement($,de({className:Y("recharts-polar-radius-axis-tick",ot(i)),key:"tick-".concat(m.coordinate)},Le(r.props,m,y)),e.renderTickItem(i,A,u?u(m.value,y):m.value))});return x.createElement($,{className:"recharts-polar-radius-axis-ticks"},h)}},{key:"render",value:function(){var r=this.props,s=r.ticks,o=r.axisLine,i=r.tick;return!s||!s.length?null:x.createElement($,{className:Y("recharts-polar-radius-axis",this.props.className)},o&&this.renderAxisLine(),i&&this.renderTicks(),lt.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(r,s,o){var i;return x.isValidElement(r)?i=x.cloneElement(r,s):Z(r)?i=r(s):i=x.createElement(Ie,de({},s,{className:"recharts-polar-radius-axis-tick-value"}),o),i}}])}(E.PureComponent);we(ke,"displayName","PolarRadiusAxis");we(ke,"axisType","radiusAxis");we(ke,"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 se(t){"@babel/helpers - typeof";return se=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},se(t)}function X(){return X=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},X.apply(this,arguments)}function Je(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),a.push.apply(a,r)}return a}function H(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?Je(Object(a),!0).forEach(function(r){Pe(t,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Je(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))})}return t}function Lr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function et(t,e){for(var a=0;a<e.length;a++){var r=e[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,ft(r.key),r)}}function $r(t,e,a){return e&&et(t.prototype,e),a&&et(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t}function Fr(t,e,a){return e=Ne(e),Cr(t,mt()?Reflect.construct(e,a||[],Ne(t).constructor):e.apply(t,a))}function Cr(t,e){if(e&&(se(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Dr(t)}function Dr(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function mt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(mt=function(){return!!t})()}function Ne(t){return Ne=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},Ne(t)}function Br(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_e(t,e)}function _e(t,e){return _e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},_e(t,e)}function Pe(t,e,a){return e=ft(e),e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function ft(t){var e=Kr(t,"string");return se(e)=="symbol"?e:e+""}function Kr(t,e){if(se(t)!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var r=a.call(t,e);if(se(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Mr=Math.PI/180,tt=1e-5,Oe=function(t){function e(){return Lr(this,e),Fr(this,e,arguments)}return Br(e,t),$r(e,[{key:"getTickLineCoord",value:function(r){var s=this.props,o=s.cx,i=s.cy,d=s.radius,u=s.orientation,l=s.tickSize,p=l||8,f=V(o,i,d,r.coordinate),g=V(o,i,d+(u==="inner"?-1:1)*p,r.coordinate);return{x1:f.x,y1:f.y,x2:g.x,y2:g.y}}},{key:"getTickTextAnchor",value:function(r){var s=this.props.orientation,o=Math.cos(-r.coordinate*Mr),i;return o>tt?i=s==="outer"?"start":"end":o<-tt?i=s==="outer"?"end":"start":i="middle",i}},{key:"renderAxisLine",value:function(){var r=this.props,s=r.cx,o=r.cy,i=r.radius,d=r.axisLine,u=r.axisLineType,l=H(H({},k(this.props,!1)),{},{fill:"none"},k(d,!1));if(u==="circle")return x.createElement(Dt,X({className:"recharts-polar-angle-axis-line"},l,{cx:s,cy:o,r:i}));var p=this.props.ticks,f=p.map(function(g){return V(s,o,i,g.coordinate)});return x.createElement(ur,X({className:"recharts-polar-angle-axis-line"},l,{points:f}))}},{key:"renderTicks",value:function(){var r=this,s=this.props,o=s.ticks,i=s.tick,d=s.tickLine,u=s.tickFormatter,l=s.stroke,p=k(this.props,!1),f=k(i,!1),g=H(H({},p),{},{fill:"none"},k(d,!1)),N=o.map(function(h,m){var y=r.getTickLineCoord(h),j=r.getTickTextAnchor(h),A=H(H(H({textAnchor:j},p),{},{stroke:"none",fill:l},f),{},{index:m,payload:h,x:y.x2,y:y.y2});return x.createElement($,X({className:Y("recharts-polar-angle-axis-tick",ot(i)),key:"tick-".concat(h.coordinate)},Le(r.props,h,m)),d&&x.createElement("line",X({className:"recharts-polar-angle-axis-tick-line"},g,y)),i&&e.renderTickItem(i,A,u?u(h.value,m):h.value))});return x.createElement($,{className:"recharts-polar-angle-axis-ticks"},N)}},{key:"render",value:function(){var r=this.props,s=r.ticks,o=r.radius,i=r.axisLine;return o<=0||!s||!s.length?null:x.createElement($,{className:Y("recharts-polar-angle-axis",this.props.className)},i&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,s,o){var i;return x.isValidElement(r)?i=x.cloneElement(r,s):Z(r)?i=r(s):i=x.createElement(Ie,X({},s,{className:"recharts-polar-angle-axis-tick-value"}),o),i}}])}(E.PureComponent);Pe(Oe,"displayName","PolarAngleAxis");Pe(Oe,"axisType","angleAxis");Pe(Oe,"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 ye;function ie(t){"@babel/helpers - typeof";return ie=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},ie(t)}function re(){return re=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t},re.apply(this,arguments)}function rt(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),a.push.apply(a,r)}return a}function b(t){for(var e=1;e<arguments.length;e++){var a=arguments[e]!=null?arguments[e]:{};e%2?rt(Object(a),!0).forEach(function(r){I(t,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):rt(Object(a)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(a,r))})}return t}function Vr(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nt(t,e){for(var a=0;a<e.length;a++){var r=e[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,xt(r.key),r)}}function Ur(t,e,a){return e&&nt(t.prototype,e),a&&nt(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t}function zr(t,e,a){return e=Ae(e),Wr(t,pt()?Reflect.construct(e,a||[],Ae(t).constructor):e.apply(t,a))}function Wr(t,e){if(e&&(ie(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yr(t)}function Yr(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(pt=function(){return!!t})()}function Ae(t){return Ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(a){return a.__proto__||Object.getPrototypeOf(a)},Ae(t)}function Gr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Ee(t,e)}function Ee(t,e){return Ee=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,s){return r.__proto__=s,r},Ee(t,e)}function I(t,e,a){return e=xt(e),e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}function xt(t){var e=qr(t,"string");return ie(e)=="symbol"?e:e+""}function qr(t,e){if(ie(t)!="object"||!t)return t;var a=t[Symbol.toPrimitive];if(a!==void 0){var r=a.call(t,e);if(ie(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var U=function(t){function e(a){var r;return Vr(this,e),r=zr(this,e,[a]),I(r,"pieRef",null),I(r,"sectorRefs",[]),I(r,"id",Wt("recharts-pie-")),I(r,"handleAnimationEnd",function(){var s=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Z(s)&&s()}),I(r,"handleAnimationStart",function(){var s=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Z(s)&&s()}),r.state={isAnimationFinished:!a.isAnimationActive,prevIsAnimationActive:a.isAnimationActive,prevAnimationId:a.animationId,sectorToFocus:0},r}return Gr(e,t),Ur(e,[{key:"isActiveIndex",value:function(r){var s=this.props.activeIndex;return Array.isArray(s)?s.indexOf(r)!==-1:r===s}},{key:"hasActiveIndex",value:function(){var r=this.props.activeIndex;return Array.isArray(r)?r.length!==0:r||r===0}},{key:"renderLabels",value:function(r){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var o=this.props,i=o.label,d=o.labelLine,u=o.dataKey,l=o.valueKey,p=k(this.props,!1),f=k(i,!1),g=k(d,!1),N=i&&i.offsetRadius||20,h=r.map(function(m,y){var j=(m.startAngle+m.endAngle)/2,A=V(m.cx,m.cy,m.outerRadius+N,j),O=b(b(b(b({},p),m),{},{stroke:"none"},f),{},{index:y,textAnchor:e.getTextAnchor(A.x,m.cx)},A),B=b(b(b(b({},p),m),{},{fill:"none",stroke:m.fill},g),{},{index:y,points:[V(m.cx,m.cy,m.outerRadius,j),A]}),S=u;return ne(u)&&ne(l)?S="value":ne(u)&&(S=l),x.createElement($,{key:"label-".concat(m.startAngle,"-").concat(m.endAngle,"-").concat(m.midAngle,"-").concat(y)},d&&e.renderLabelLineItem(d,B,"line"),e.renderLabelItem(i,O,J(m,S)))});return x.createElement($,{className:"recharts-pie-labels"},h)}},{key:"renderSectorsStatically",value:function(r){var s=this,o=this.props,i=o.activeShape,d=o.blendStroke,u=o.inactiveShape;return r.map(function(l,p){if((l==null?void 0:l.startAngle)===0&&(l==null?void 0:l.endAngle)===0&&r.length!==1)return null;var f=s.isActiveIndex(p),g=u&&s.hasActiveIndex()?u:null,N=f?i:g,h=b(b({},l),{},{stroke:d?l.fill:l.stroke,tabIndex:-1});return x.createElement($,re({ref:function(y){y&&!s.sectorRefs.includes(y)&&s.sectorRefs.push(y)},tabIndex:-1,className:"recharts-pie-sector"},Le(s.props,l,p),{key:"sector-".concat(l==null?void 0:l.startAngle,"-").concat(l==null?void 0:l.endAngle,"-").concat(l.midAngle,"-").concat(p)}),x.createElement(Kt,re({option:N,isActive:f,shapeType:"sector"},h)))})}},{key:"renderSectorsWithAnimation",value:function(){var r=this,s=this.props,o=s.sectors,i=s.isAnimationActive,d=s.animationBegin,u=s.animationDuration,l=s.animationEasing,p=s.animationId,f=this.state,g=f.prevSectors,N=f.prevIsAnimationActive;return x.createElement(Mt,{begin:d,duration:u,isActive:i,easing:l,from:{t:0},to:{t:1},key:"pie-".concat(p,"-").concat(N),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(h){var m=h.t,y=[],j=o&&o[0],A=j.startAngle;return o.forEach(function(O,B){var S=g&&g[B],F=B>0?Vt(O,"paddingAngle",0):0;if(S){var z=Ue(S.endAngle-S.startAngle,O.endAngle-O.startAngle),P=b(b({},O),{},{startAngle:A+F,endAngle:A+z(m)+F});y.push(P),A=P.endAngle}else{var K=O.endAngle,R=O.startAngle,c=Ue(0,K-R),v=c(m),w=b(b({},O),{},{startAngle:A+F,endAngle:A+v+F});y.push(w),A=w.endAngle}}),x.createElement($,null,r.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(r){var s=this;r.onkeydown=function(o){if(!o.altKey)switch(o.key){case"ArrowLeft":{var i=++s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[i].focus(),s.setState({sectorToFocus:i});break}case"ArrowRight":{var d=--s.state.sectorToFocus<0?s.sectorRefs.length-1:s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[d].focus(),s.setState({sectorToFocus:d});break}case"Escape":{s.sectorRefs[s.state.sectorToFocus].blur(),s.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,s=r.sectors,o=r.isAnimationActive,i=this.state.prevSectors;return o&&s&&s.length&&(!i||!Ut(i,s))?this.renderSectorsWithAnimation():this.renderSectorsStatically(s)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,s=this.props,o=s.hide,i=s.sectors,d=s.className,u=s.label,l=s.cx,p=s.cy,f=s.innerRadius,g=s.outerRadius,N=s.isAnimationActive,h=this.state.isAnimationFinished;if(o||!i||!i.length||!ee(l)||!ee(p)||!ee(f)||!ee(g))return null;var m=Y("recharts-pie",d);return x.createElement($,{tabIndex:this.props.rootTabIndex,className:m,ref:function(j){r.pieRef=j}},this.renderSectors(),u&&this.renderLabels(i),lt.renderCallByParent(this.props,null,!1),(!N||h)&&zt.renderCallByParent(this.props,i,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,s){return s.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==s.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:s.curSectors,isAnimationFinished:!0}:r.sectors!==s.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,s){return r>s?"start":r<s?"end":"middle"}},{key:"renderLabelLineItem",value:function(r,s,o){if(x.isValidElement(r))return x.cloneElement(r,s);if(Z(r))return r(s);var i=Y("recharts-pie-label-line",typeof r!="boolean"?r.className:"");return x.createElement(Bt,re({},s,{key:o,type:"linear",className:i}))}},{key:"renderLabelItem",value:function(r,s,o){if(x.isValidElement(r))return x.cloneElement(r,s);var i=o;if(Z(r)&&(i=r(s),x.isValidElement(i)))return i;var d=Y("recharts-pie-label-text",typeof r!="boolean"&&!Z(r)?r.className:"");return x.createElement(Ie,re({},s,{alignmentBaseline:"middle",className:d}),i)}}])}(E.PureComponent);ye=U;I(U,"displayName","Pie");I(U,"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:!Yt.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});I(U,"parseDeltaAngle",function(t,e){var a=ge(e-t),r=Math.min(Math.abs(e-t),360);return a*r});I(U,"getRealPieData",function(t){var e=t.data,a=t.children,r=k(t,!1),s=Gt(a,ct);return e&&e.length?e.map(function(o,i){return b(b(b({payload:o},r),o),s&&s[i]&&s[i].props)}):s&&s.length?s.map(function(o){return b(b({},r),o.props)}):[]});I(U,"parseCoordinateOfPie",function(t,e){var a=e.top,r=e.left,s=e.width,o=e.height,i=qt(s,o),d=r+be(t.cx,s,s/2),u=a+be(t.cy,o,o/2),l=be(t.innerRadius,i,0),p=be(t.outerRadius,i,i*.8),f=t.maxRadius||Math.sqrt(s*s+o*o)/2;return{cx:d,cy:u,innerRadius:l,outerRadius:p,maxRadius:f}});I(U,"getComposedData",function(t){var e=t.item,a=t.offset,r=e.type.defaultProps!==void 0?b(b({},e.type.defaultProps),e.props):e.props,s=ye.getRealPieData(r);if(!s||!s.length)return null;var o=r.cornerRadius,i=r.startAngle,d=r.endAngle,u=r.paddingAngle,l=r.dataKey,p=r.nameKey,f=r.valueKey,g=r.tooltipType,N=Math.abs(r.minAngle),h=ye.parseCoordinateOfPie(r,a),m=ye.parseDeltaAngle(i,d),y=Math.abs(m),j=l;ne(l)&&ne(f)?(ze(!1,`Use "dataKey" to specify the value of pie,
3      the props "valueKey" will be deprecated in 1.1.0`),j="value"):ne(l)&&(ze(!1,`Use "dataKey" to specify the value of pie,
4      the props "valueKey" will be deprecated in 1.1.0`),j=f);var A=s.filter(function(P){return J(P,j,0)!==0}).length,O=(y>=360?A:A-1)*u,B=y-A*N-O,S=s.reduce(function(P,K){var R=J(K,j,0);return P+(ee(R)?R:0)},0),F;if(S>0){var z;F=s.map(function(P,K){var R=J(P,j,0),c=J(P,p,K),v=(ee(R)?R:0)/S,w;K?w=z.endAngle+ge(m)*u*(R!==0?1:0):w=i;var W=w+ge(m)*((R!==0?N:0)+v*B),Q=(w+W)/2,L=(h.innerRadius+h.outerRadius)/2,Se=[{name:c,value:R,payload:P,dataKey:j,type:g}],G=V(h.cx,h.cy,L,Q);return z=b(b(b({percent:v,cornerRadius:o,name:c,tooltipPayload:Se,midAngle:Q,middleRadius:L,tooltipPosition:G},P),h),{},{value:J(P,j),startAngle:w,endAngle:W,payload:P,paddingAngle:ge(m)*u}),z})}return b(b({},h),{},{sectors:F,data:s})});var Hr=Ht({chartName:"PieChart",GraphicalChild:U,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:Oe},{axisType:"radiusAxis",AxisComp:ke}],formatAxisMap:Zt,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});function yn(){var B,S,F,z,P,K,R;const{user:t}=Nt(),[e,a]=E.useState(null),[r,s]=E.useState(!0),[o,i]=E.useState(null),[d,u]=E.useState(new Date),[l,p]=E.useState("overall"),[f,g]=E.useState(new Date().getFullYear().toString()),[N,h]=E.useState(""),m=()=>Be(this,null,function*(){try{s(!0),i(null);const c=new URLSearchParams;c.append("period",l),l==="year"&&f&&c.append("year",f),l==="month"&&f&&N&&(c.append("year",f),c.append("month",N));const v=yield fetch(`/api/admin/revenue?${c.toString()}`,{headers:{Authorization:`Bearer ${yield t==null?void 0:t.getIdToken()}`,"admin-email":(t==null?void 0:t.email)||""}});if(!v.ok)throw new Error(`Failed to fetch revenue data: ${v.status}`);const w=yield v.json();if(w.success)a(w.data),u(new Date);else throw new Error(w.error||"Failed to fetch revenue data")}catch(c){i(c instanceof Error?c.message:"An error occurred"),console.error("Error fetching revenue data:",c)}finally{s(!1)}});E.useEffect(()=>{t&&m()},[t,l,f,N]),E.useEffect(()=>{if(!t)return;const c=setInterval(()=>{m()},3e4);return()=>clearInterval(c)},[t,l,f,N]);const y=()=>{if(e)try{const v=[["Period","Total Revenue (₹)","Total Paid Submissions","Total Free Submissions","Total Submissions"]],w=l==="overall"?"Overall":l==="today"?"Today":l==="yesterday"?"Yesterday":l==="week"?"This Week":l==="month"?"This Month":l==="year"?`Year ${f}`:`Month ${N}/${f}`;v.push([w,e.totalRevenue.toString(),e.totalPaidSubmissions.toString(),e.totalFreeSubmissions.toString(),e.totalSubmissions.toString()]),v.push([]),v.push(["Tier Breakdown"]),v.push(["Tier","Submissions","Revenue (₹)"]),e.tierBreakdown.forEach(G=>{v.push([G.tier,G.submission_count.toString(),G.tier_revenue.toString()])});const W=v.map(G=>G.map(ht=>`"${ht.replace(/"/g,'""')}"`).join(",")).join(`
5`),Q=new Blob([W],{type:"text/csv;charset=utf-8;"}),L=document.createElement("a"),Se=URL.createObjectURL(Q);L.setAttribute("href",Se),L.setAttribute("download",`revenue-report-${l}-${new Date().toISOString().split("T")[0]}.csv`),L.style.visibility="hidden",document.body.appendChild(L),L.click(),document.body.removeChild(L),console.log("✅ Revenue CSV downloaded successfully!")}catch(c){console.error("❌ Error downloading CSV:",c),i("Failed to download CSV")}},j=c=>new Intl.NumberFormat("en-IN",{style:"currency",currency:"INR",minimumFractionDigits:0,maximumFractionDigits:0}).format(c),A=c=>new Date(c).toLocaleDateString("en-US",{year:"numeric",month:"short"}),O=["#0088FE","#00C49F","#FFBB28","#FF8042","#8884D8","#82CA9D"];return t?o?n.jsx("div",{className:"container mx-auto px-3 sm:px-4 py-8",children:n.jsx(T,{children:n.jsx(_,{className:"pt-6",children:n.jsxs("p",{className:"text-center text-destructive font-bold text-lg",children:["Error loading data: ",o]})})})}):n.jsx(Et,{children:n.jsxs("div",{className:"container mx-auto px-3 sm:px-4 py-8",children:[n.jsx(_t,{currentPage:"/admin-revenue-report"}),n.jsxs("div",{className:"flex justify-between items-center mb-6",children:[n.jsxs("div",{children:[n.jsxs("h1",{className:"text-3xl font-bold flex items-center",children:[n.jsx(ue,{className:"mr-3",size:32}),"Revenue Analytics Report"]}),n.jsx("p",{className:"text-muted-foreground mt-2",children:"Comprehensive revenue tracking and financial insights"}),d&&n.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Last updated: ",d.toLocaleTimeString()]})]}),n.jsxs("div",{className:"flex flex-col md:flex-row gap-2 md:gap-4",children:[n.jsx(Ke,{onClick:m,disabled:r,className:"bg-blue-600 hover:bg-blue-700 text-white",children:r?n.jsxs(n.Fragment,{children:[n.jsx(Me,{className:"mr-2 h-4 w-4 animate-spin"}),"Loading..."]}):n.jsxs(n.Fragment,{children:[n.jsx(At,{className:"mr-2 h-4 w-4"}),"Refresh Data"]})}),n.jsxs(Ke,{onClick:y,variant:"outline",className:"bg-green-50 hover:bg-green-100 text-green-700 border-green-200",children:[n.jsx(It,{className:"mr-2 h-4 w-4"}),"Download Report"]})]})]}),n.jsxs(T,{className:"mb-6",children:[n.jsx(C,{children:n.jsxs(D,{className:"flex items-center",children:[n.jsx(Lt,{className:"mr-2 h-5 w-5"}),"Filter Options"]})}),n.jsx(_,{children:n.jsxs("div",{className:"flex flex-wrap gap-4 items-center",children:[n.jsxs("div",{className:"flex items-center space-x-2",children:[n.jsx(ve,{htmlFor:"period-filter",children:"Period:"}),n.jsxs(fe,{value:l,onValueChange:c=>p(c),children:[n.jsx(pe,{className:"w-32",children:n.jsx(xe,{})}),n.jsxs(he,{children:[n.jsx(M,{value:"today",children:"Today"}),n.jsx(M,{value:"yesterday",children:"Yesterday"}),n.jsx(M,{value:"week",children:"This Week"}),n.jsx(M,{value:"month",children:"This Month"}),n.jsx(M,{value:"year",children:"This Year"}),n.jsx(M,{value:"overall",children:"Overall"})]})]})]}),l==="year"&&n.jsxs("div",{className:"flex items-center space-x-2",children:[n.jsx(ve,{htmlFor:"year-filter",children:"Year:"}),n.jsxs(fe,{value:f,onValueChange:g,children:[n.jsx(pe,{className:"w-24",children:n.jsx(xe,{})}),n.jsx(he,{children:Array.from({length:5},(c,v)=>new Date().getFullYear()-v).map(c=>n.jsx(M,{value:c.toString(),children:c},c))})]})]}),l==="month"&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center space-x-2",children:[n.jsx(ve,{htmlFor:"year-filter",children:"Year:"}),n.jsxs(fe,{value:f,onValueChange:g,children:[n.jsx(pe,{className:"w-24",children:n.jsx(xe,{})}),n.jsx(he,{children:Array.from({length:5},(c,v)=>new Date().getFullYear()-v).map(c=>n.jsx(M,{value:c.toString(),children:c},c))})]})]}),n.jsxs("div",{className:"flex items-center space-x-2",children:[n.jsx(ve,{htmlFor:"month-filter",children:"Month:"}),n.jsxs(fe,{value:N,onValueChange:h,children:[n.jsx(pe,{className:"w-24",children:n.jsx(xe,{})}),n.jsx(he,{children:Array.from({length:12},(c,v)=>v+1).map(c=>n.jsx(M,{value:c.toString(),children:new Date(2024,c-1).toLocaleDateString("en-US",{month:"short"})},c))})]})]})]})]})})]}),e&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-5 ga
5p-2 sm:gap-3 md:gap-4 mb-6",children:[n.jsxs(T,{className:"bg-gradient-to-r from-green-50 to-green-100",children:[n.jsxs(C,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[n.jsx(D,{className:"text-sm font-medium",children:"Total Revenue"}),n.jsx(ue,{className:"h-4 w-4 text-green-600"})]}),n.jsxs(_,{children:[n.jsx("div",{className:"text-2xl font-bold text-green-700",children:j(e.totalRevenue)}),n.jsx("p",{className:"text-xs text-green-700",children:"Total earnings from paid submissions"})]})]}),n.jsxs(T,{className:"bg-gradient-to-r from-emerald-50 to-emerald-100",children:[n.jsxs(C,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[n.jsx(D,{className:"text-sm font-medium",children:"Net Revenue"}),n.jsx(ue,{className:"h-4 w-4 text-emerald-600"})]}),n.jsxs(_,{children:[n.jsx("div",{className:"text-2xl font-bold text-emerald-700",children:j(e.netRevenue)}),n.jsxs("p",{className:"text-xs text-emerald-700",children:["After ",e.taxPercentage,"% tax"]})]})]}),n.jsxs(T,{className:"bg-gradient-to-r from-blue-50 to-blue-100",children:[n.jsxs(C,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[n.jsx(D,{className:"text-sm font-medium",children:"Total Submissions"}),n.jsx(wt,{className:"h-4 w-4 text-blue-600"})]}),n.jsxs(_,{children:[n.jsx("div",{className:"text-2xl font-bold text-blue-700",children:e.totalSubmissions}),n.jsx("p",{className:"text-xs text-blue-700",children:"All submissions (free + paid)"})]})]}),n.jsxs(T,{className:"bg-gradient-to-r from-purple-50 to-purple-100",children:[n.jsxs(C,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[n.jsx(D,{className:"text-sm font-medium",children:"Paid Submissions"}),n.jsx(kt,{className:"h-4 w-4 text-purple-600"})]}),n.jsxs(_,{children:[n.jsx("div",{className:"text-2xl font-bold text-purple-700",children:e.totalPaidSubmissions}),n.jsx("p",{className:"text-xs text-purple-700",children:"Submissions with payment"})]})]}),n.jsxs(T,{className:"bg-gradient-to-r from-orange-50 to-orange-100",children:[n.jsxs(C,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[n.jsx(D,{className:"text-sm font-medium",children:"Free Submissions"}),n.jsx(Pt,{className:"h-4 w-4 text-orange-600"})]}),n.jsxs(_,{children:[n.jsx("div",{className:"text-2xl font-bold text-orange-700",children:e.totalFreeSubmissions}),n.jsx("p",{className:"text-xs text-orange-700",children:"Free tier submissions"})]})]})]}),n.jsxs(T,{className:"mb-6 bg-gradient-to-r from-amber-50 to-amber-100 border-amber-200",children:[n.jsxs(C,{children:[n.jsxs(D,{className:"flex items-center text-amber-800",children:[n.jsx(ue,{className:"mr-2 h-5 w-5"}),"Tax Breakdown"]}),n.jsx(me,{className:"text-amber-700",children:"Detailed tax calculation and net revenue"})]}),n.jsxs(_,{children:[n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[n.jsxs("div",{className:"text-center",children:[n.jsxs("div",{className:"text-2xl font-bold text-amber-800",children:["₹",e.totalRevenue]}),n.jsx("div",{className:"text-sm text-amber-700",children:"Gross Revenue"})]}),n.jsxs("div",{className:"text-center",children:[n.jsxs("div",{className:"text-2xl font-bold text-amber-800",children:["₹",e.taxAmount]}),n.jsx("div",{className:"text-sm text-amber-700",children:"Total Tax"})]}),n.jsxs("div",{className:"text-center",children:[n.jsxs("div",{className:"text-2xl font-bold text-amber-800",children:["₹",e.netRevenue]}),n.jsx("div",{className:"text-sm text-amber-700",children:"Net Revenue (contest)"})]})]}),((S=(B=e.addonRevenue)==null?void 0:B.count)!=null?S:0)>0&&n.jsxs("div",{className:"mt-4 p-4 bg-amber-50 rounded-lg border border-amber-200 flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("div",{className:"text-sm text-amber-900",children:[n.jsx("span",{className:"font-bold",children:e.addonRevenue.count})," written-feedback add-on",e.addonRevenue.count===1?"":"s"," sold",n.jsxs("span",{className:"text-amber-700",children:[" ","(",e.addonRevenue.inr>
50?`₹${Math.round(e.addonRevenue.inr).toLocaleString("en-IN")}`:"",e.addonRevenue.inr>0&&e.addonRevenue.usd>0?" + ":"",e.addonRevenue.usd>0?`$${e.addonRevenue.usd.toFixed(2)}`:"",")"]}),n.jsx("div",{className:"text-xs text-amber-700 mt-1",children:"Already counted inside Total Revenue above. Not in the tier breakdown, which lists entry fees only."})]}),n.jsxs("div",{className:"text-right",children:[n.jsxs("div",{className:"text-2xl font-bold text-amber-800",children:["₹",Math.round(e.addonRevenue.netInr).toLocaleString("en-IN")]}),n.jsx("div",{className:"text-sm text-amber-700",children:"Add-on net, after gateway fees"})]})]}),((F=e.adRevenueInr)!=null?F:0)>0&&n.jsxs("div",{className:"mt-4 p-4 bg-sky-50 rounded-lg border border-sky-200 flex flex-wrap items-center justify-between gap-3",children:[n.jsxs("div",{className:"text-sm text-sky-800",children:["+ ",n.jsxs("span",{className:"font-bold",children:["₹",Math.round((z=e.adRevenueInr)!=null?z:0).toLocaleString("en-IN")]})," Ad Revenue",n.jsxs("span",{className:"text-sky-600",children:[" (AdSense $",((P=e.adRevenueUsd)!=null?P:0).toFixed(2)," @ live ₹",(K=e.adRate)!=null?K:92,")"]})]}),n.jsxs("div",{className:"text-right",children:[n.jsxs("div",{className:"text-2xl font-bold text-emerald-700",children:["₹",Math.round((R=e.grandTotalNet)!=null?R:e.netRevenue).toLocaleString("en-IN")]}),n.jsx("div",{className:"text-sm text-emerald-600",children:"Grand Total (contest net + ads)"})]})]}),e.taxBreakdown&&n.jsxs("div",{className:"mt-6 p-4 bg-green-50 rounded-lg border border-green-200",children:[n.jsx("h4",{className:"text-sm font-semibold text-green-800 mb-3",children:"💰 Tax Breakdown by Payment Method"}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4",children:[n.jsxs("div",{className:"bg-white p-3 rounded border border-green-200",children:[n.jsx("div",{className:"text-xs font-semibold text-green-700 mb-2",children:"Razorpay (INR)"}),n.jsxs("div",{className:"text-sm space-y-1",children:[n.jsxs("div",{className:"flex justify-between",children:[n.jsx("span",{className:"text-gray-600",children:"Revenue:"}),n.jsxs("span",{className:"font-semibold",children:["₹",e.taxBreakdown.razorpay.revenueInr]})]}),n.jsxs("div",{className:"flex justify-between",children:[n.jsxs("span",{className:"text-gray-600",children:["Tax (",e.taxBreakdown.razorpay.taxPercent,"%):"]}),n.jsxs("span",{className:"font-semibold text-red-600",children:["₹",e.taxBreakdown.razorpay.taxAmountInr]})]}),n.jsxs("div",{className:"flex justify-between",children:[n.jsx("span",{className:"text-gray-600",children:"Net:"}),n.jsxs("span",{className:"font-semibold text-green-700",children:["₹",e.taxBreakdown.razorpay.netInr]})]})]})]}),n.jsxs("div",{className:"bg-white p-3 rounded border border-blue-200",children:[n.jsx("div",{className:"text-xs font-semibold text-blue-700 mb-2",children:"PayPal (USD)"}),n.jsx("div",{className:"text-xs text-gray-500 mb-1",children:e.taxBreakdown.paypal.taxRules}),n.jsxs("div",{className:"text-sm space-y-1",children:[n.jsxs("div",{className:"flex justify-between",children:[n.jsx("span",{className:"text-gray-600",children:"Revenue:"}),n.jsxs("span",{className:"font-semibold",children:["$",e.taxBreakdown.paypal.revenueUsd]})]}),n.jsxs("div",{className:"flex justify-between",children:[n.jsxs("span",{className:"text-gray-600",children:["Tax (",e.taxBreakdown.paypal.effectiveTaxPercent,"%):"]}),n.jsxs("span",{className:"font-semibold text-red-600",children:["$",e.taxBreakdown.paypal.taxAmountUsd]})]}),n.jsxs("div",{className:"flex justify-between",children:[n.jsx("span",{className:"text-gray-600",children:"Net:"}),n.jsxs("span",{className:"font-semibold text-green-700",children:["$",e.taxBreakdown.paypal.netUsd]})]})]})]})]}),n.jsxs("div",{className:"bg-white p-3 rounded border border-amber-300 mt-3",children:[n.jsx("div",{className:"text-xs font-semibold text-amber-800 mb-2",children:"📊 Total Tax Calculation"}),n.jsxs("div",{className:"text-sm space-y-1",children:[n.jsxs("div",{className:"flex justify-between",children:[n.jsx("span",{className:"text-gray-600",children:"Razorpay Tax (INR):"}),n.jsxs("span",{className:"font-semibold",children:["₹",e.taxBreakdown.razorpay.taxAmountInr]})]}),n.jsxs("div",{className:"flex justify-between",children:[n.jsx("span",{className:"text-gray-600",children:"PayPal Tax (INR equivalent):"}),n.jsxs("span",{className:"font-semibold",children:["₹",e.taxBreakdown.paypal.taxAmountInr]})]}),n.jsxs("div",{className:"flex justify-between border-t border-gray-300 pt-1 mt-1",children:[n.jsx("span",{className:"text-gray-700 font-semibold",children:"Total Tax:"}),n.jsxs("span",{className:"font-bold text-red-700 text-base",children:["₹",e.taxAmount]})]}),n.jsxs("div",{className:"flex justify-between border-t border-gray-300 pt-1 mt-1",children:[n.jsx("span",{className:"text-gray-700 font-semibold",children:"Net Revenue (Gross - Total Tax):"}),n.jsxs("span",{className:"font-bold text-green-700 text-base",children:["₹",e.netRevenue]})]})]})]})]}),e.currencyBreakdown&&n.jsxs("div",{className:"mt-6 p-4 bg-blue-50 rounded-lg border border-blue-200",children:[n.jsx("h4",{className:"text-sm font-semibold text-blue-800 mb-3",children:"💱 Currency Breakdown"}),n.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-sm",children:[n.jsxs("div",{className:"text-center",children:[n.jsxs("div",{className:"text-lg font-bold text-blue-700",children:["₹",e.currencyBreakdown.inr]}),n.jsx("div",{className:"text-xs text-blue-600",children:"INR Revenue"})]}),n.jsxs("div",{className:"text-center",children:[n.jsxs("div",{className:"text-lg font-bold text-blue-700",children:["$",e.currencyBreakdown.usd]}),n.jsx("div",{className:"text-xs text-blue-600",children:"USD Revenue"})]}),n.jsxs("div",{className:"text-center",children:[n.jsxs("div",{className:"text-lg font-bold text-blue-700",children:["₹",e.currencyBreakdown.inr_equivalent]}),n.jsx("div",{className:"text-xs text-blue-600",children:"Total (INR Equivalent)"})]})]}),n.jsxs("div",{className:"mt-2 text-xs text-blue-600 text-center",children:["Conversion Rate: 1 USD = ₹",e.currencyBreakdown.conversion_rate]})]})]})]}),n.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-3 md:gap-4 lg:gap-6 mb-6",children:[n.jsxs(T,{children:[n.jsxs(C,{children:[n.jsxs(D,{className:"flex items-center",children:[n.jsx($t,{className:"mr-2 h-5 w-5"}),"Monthly Revenue Trend"]}),n.jsx(me,{children:"Revenue progression over the last 12 months"})]}),n.jsx(_,{children:n.jsx(We,{width:"100%",height:300,children:n.jsxs(er,{data:e.monthlyRevenue.length>0?e.monthlyRevenue:[{month:"2025-08",revenue:e.totalRevenue}],children:[n.jsx(Xt,{strokeDasharray:"3 3"}),n.jsx(Qt,{dataKey:"month",tickFormatter:A,angle:-45,textAnchor:"end",height:80}),n.jsx(Jt,{tickFormatter:c=>`₹${c}`}),n.jsx(Ye,{formatter:c=>[`₹${c}`,"Revenue"],labelFormatter:A}),n.jsx(tr,{type:"monotone",dataKey:"revenue",stroke:"#8884d8",strokeWidth:3,name:"Revenue",dot:{fill:"#8884d8",strokeWidth:2,r:4}})]})})})]}),n.jsxs(T,{children:[n.jsxs(C,{children:[n.jsxs(D,{className:"flex items-center",children:[n.jsx(Ge,{className:"mr-2 h-5 w-5"}),"Revenue by Tier"]}),n.jsx(me,{children:"Revenue breakdown across different submission tiers"})]}),n.jsx(_,{children:n.jsx(We,{width:"100%",height:300,children:n.jsxs(Hr,{children:[n.jsx(U,{data:e.tierBreakdown.map(c=>De(Ce({},c),{tier_revenue:parseFloat(c.tier_revenue),submission_count:parseInt(c.submission_count)})),cx:"50%",cy:"50%",labelLine:!1,label:({tier:c,tier_revenue:v})=>`${c}: ₹${v}`,outerRadius:80,fill:"#8884d8",dataKey:"tier_revenue",children:e.tierBreakdown.map((c,v)=>n.jsx(ct,{fill:O[v%O.length]},`cell-${v}`))}),n.jsx(Ye,{formatter:c=>[`₹${c}`,"Revenue"]})]})})})]})]}),n.jsxs(T,{className:"mb-6",children:[n.jsxs(C,{children:[n.jsxs(D,{className:"flex items-center",children:[n.jsx(Ge,{className:"mr-2 h-5 w-5"}),"Detailed Tier Breakdown"]}),n.jsx(me,{children:"Comprehensive analysis of submissions and revenue by tier"})]}),n.jsx(_,{children:n.jsxs(St,{children:[n.jsx(Rt,{children:n.jsxs(Ve,{children:[n.jsx(oe,{children:"Tier"}),n.jsx(oe,{children:"Submissions"}),n.jsx(oe,{children:"Revenue"}),n.jsx(oe,{children:"Average per Submission"}),n.jsx(oe,{children:"Percentage of Total"})]})}),n.jsx(Tt,{children:e.tierBreakdown.map((c,v)=>{const w=typeof c.tier_revenue=="string"?parseFloat(c.tier_revenue):c.tier_revenue,W=parseInt(c.submission_count),Q=W>0?w/W:0,L=e.totalRevenue>0?w/e.totalRevenue*100:0;return n.jsxs(Ve,{children:[n.jsx(le,{children:n.jsx(Ot,{variant:"outline",className:"capitalize",children:c.tier})}),n.jsx(le,{className:"font-medium",children:W}),n.jsx(le,{className:"font-bold text-green-600",children:j(w)}),n.jsx(le,{className:"text-muted-foreground",children:j(Q)}),n.jsxs(le,{className:"text-muted-foreground",children:[L.toFixed(1),"%"]})]},v)})})]})})]})]}),r&&n.jsx(T,{children:n.jsx(_,{className:"pt-6",children:n.jsxs("div",{className:"flex items-center justify-center py-8",children:[n.jsx(Me,{className:"h-8 w-8 animate-spin"}),n.jsx("span",{className:"ml-2",children:"Loading revenue data..."})]})})})]})}):n.jsx("div",{className:"container mx-auto px-3 sm:px-4 py-8",children:n.jsx(T,{children:n.jsx(_,{className:"pt-6",children:n.jsx("p",{className:"text-center text-muted-foreground",children:"Please log in to access revenue report data."})})})})}export{yn 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.