�PNG  IHDR22?�� pHYs  �� OiCCPPhotoshop ICC profilexڝSgTS�=���BK���KoR RB���&*! J�!��Q�EEȠ�����Q, � ��!���������{�kּ������>���� �H3Q5� �B�������.@� $p�d!s�#�~<<+"��x� �M��0���B�\���t�8K�@z�B�@F���&S�`�cb�P-`'������{[�!�� e�Dh;��V�EX0fK�9�-0IWfH���� � 0Q��){`�##x��F�W<�+��*x��<�$9E�[-qWW.(�I+6aa�@.�y�2�4���������x����6��_-��"bb���ϫp@�t~��,/��;�m��%�h^ �u��f�@����W�p�~<�5�j>{�-�]c�K'Xt����o��(�h���w��?�G�%�fI�q^D$.Tʳ?�D��*�A��,���� �`6�B$��BB d�r`)��B(�Ͱ*`/�@4�Qh��p.�U�=p�a��(�� A�a!ڈb�X#����!�H�$ ɈQ"K�5H1R�T UH�=r9�\F��;�2����G1���Q=� �C��7�F� �dt1�����r�=�6��Ыhڏ>C�0��3�l0.��B�8, �c˱"� ���V����cϱw�E� 6wB aAHXLXN�H� $4� 7 �Q�'"��K�&���b21�XH,#��/{�C�7$�C2'��I��T��F�nR#�,��4H#���dk�9�, +ȅ����3��!�[ �b@q��S�(R�jJ��4�e�2AU��Rݨ�T5�ZB���R�Q��4u�9̓IK�����hh�i��t�ݕN��W���G���w ��Ljg(�gw��L�Ӌ�T071���oUX*�*|�� �J�&�*/T����ު U�U�T��^S}�FU3S� Ԗ�U��P�SSg�;���g�oT?�~Y��Y�L�OC�Q��_�� c�x,!k ��u�5�&���|v*�����=���9C3J3W�R�f?�q��tN �(���~���)�)�4L�1e\k����X�H�Q�G�6������E�Y��A�J'\'Gg����S�Sݧ �M=:��.�k���Dw�n��^��Lo��y���}/�T�m���G X� $� �<�5qo</���QC]�@C�a�a�ᄑ��<��F�F�i�\�$�m�mƣ&&!&KM�M�RM��)�;L;L���͢�֙5�=1�2��כ߷`ZxZ,����eI��Z�Yn�Z9Y�XUZ]�F���%ֻ�����N�N���gð�ɶ�����ۮ�m�}agbg�Ů��}�}��= ���Z~s�r:V:ޚΜ�?}����/gX���3��)�i�S��Ggg�s�󈋉K��.�>.���Ƚ�Jt�q]�z���������ۯ�6�i�ܟ�4�)�Y3s���C�Q��? ��0k߬~OCO�g��#/c/�W�װ��w��a�>�>r��>�<7�2�Y_�7��ȷ�O�o�_��C#�d�z����%g��A�[��z|!��?:�e����A���AA�������!h�쐭!��Α�i�P~���a�a��~ '���W�?�p�X�1�5w��Cs�D�D�Dޛg1O9�-J5*>�.j<�7�4�?�.fY��X�XIlK9.*�6nl������� �{�/�]py�����.,:�@L�N8��A*��%�w%� y��g"/�6ш�C\*N�H*Mz�쑼5y$�3�,幄'���L Lݛ:��v m2=:�1����qB�!M��g�g�fvˬe����n��/��k���Y- �B��TZ(�*�geWf�͉�9���+��̳�ې7�����ᒶ��KW-X潬j9�������(�x��oʿ�ܔ���Ĺd�f�f���-�[����n �ڴ �V����E�/��(ۻ��C���<��e����;?T�T�T�T6��ݵa��n��{��4���[���>ɾ�UUM�f�e�I���?�������m]�Nmq����#�׹���=TR��+�G�����w- 6 U����#pDy��� �� :�v�{���vg/jB��F�S��[b[�O�>����z�G��499�?r����C�d�&����ˮ/~�����јѡ�򗓿m|������������x31^�V���w�w��O�| (�h���SЧ��������c3-� cHRMz%������u0�`:�o�_�F5IDATx��ytUս�?�;���fN$$��@B�!�k��� -*�gE���j�O�kQ�ʠ`U�B_ �AÐ0%�Ȕ�@r3ޛ;߳��$�@��v����^�s����������$��ߢ !�W��5�̱'-٘������4�>�Rƫ$�G��0U�H}�_ _� #��k�MJ/=�9Du *ڲ�k�PQ;0��j|�*�$�^컂脛y���>�z×� B��� ��(�:$�ʔ_�6��C!B����MVx��a��ζyY����j��ƋY2�9�F�{r��r�딟F��Q��hY6��� x��[l��RC��������nt@��;P��3��� F�w��7��:�P���ɋ'���mj���Bƪ�$�Q�L��y��߷g��\���z����v5�p�v$�v櫻�`6~K �Y�X����,�:��"�o�e0II"(��,������l_�C���/4�+f�E�!q��:����u����c��樼.UE�@� �]K�W���$-�h]�JG���Dz)�`��.�A/ ���mᏣc�3jK� �!�>���$�Q�!�_�? \�C2(E �M$Z I{�U���s�ǣ���=��@Բe ޻��W�����@ �w����}�9v,)��.}*|"�s��di���,���G�]W�AC�������|<����[��ߕ������K�*�G nߴ!��‹��J�!��6(L�a)��Am��������;adf��:�xm��nh�;֦I��(���o�C~ډa?�=��s����h��E������xp����)���_���t��W�����´;8���`dz=(��@@�+,�;�`�fhl��XȌ�3,uI�~z(J����� �ZX�A����H'�À�㜦�82|��a�n�z2��I���� ���EY�h�ε<�0�q�{��C��v�˅��?"@��χ�x�WS+��N�~�KQ�J�8ل�� _.W��� !TU{�����,��"�� �;�������HI S� ��))�o�1�H�D� ���� (� ;����"Ҕ��,���� �F=���O��&�Ph>�`���y��߲ &S��P�<��'��1s�1cĂ�N����2)����@�u��tv��<�+�-&�����h��[!FSG���' � z z0��<����8d&�����E0�,��<��"!P�b4��� �{S�����X����.�囤���T��hEF��X�q0"-<����h���]�Py*����F⩍��@v�˂�Y08�� .q��a��s����(!<̫1�3�L�H��7sYW�`��qtu�\7��?�@�Y�� %Ka�x�GZ�*W�P��y�����N0r9��Z�c�%���q,��k�����!!,��>���IB��� �x1�Xu�Y���v-���ֺ��N������JP��a�2`�e5��w��u;�6�i���̃��(K���ťa��(l51��JL��O'%���]���ٖ뿉!��{*�p+f ���i8��D�ȑ���ܩ�M��V��ӟz��x�7Z�1i}�^͜���6e����x��)u�d�ˏ�V�eG�\�X1�����=n�U'�~Y����L�\,�(d!x ,�:�TW8� M`r���@��r+v�Q0��>^;˴�VbF��('����� �*O��i��j�Ӆ����^�S3&� ���{������.ی�� N;��NU%d0�Ce\r"�C�b��&t7N�7��� �ȪD�[%l�۪�$��'m?�A9tI�9>��NVL ��� 6v~M�����ъ�B���0����9$&=ώm��W�0���L���&��E���f�f��'+�9��hv��7,���M��6�D�&�^� �����8 D֮�����o��k^z��O��hP�8q�5d*��YVq3�{��������#LX4�?��jP=3�~�؅c�ݰ�̱�ұ��8̲��2�G�����j��έ�9��w7���U�X�w�85C��?!I&���o&����L���I#�^�eV�,�^t5�k� �xs˛\��U�8��."���{���ǵ�l4��ݼ�;��r"���G�/~���gJV�N糦��ZZ^k+NN�D��I$�=OE�z����|*�*{��%k���G��>�`9��b;�s���8,�qs��c��.b��q�%�>r��n�R�Ƨ�%�,�A��le#�8���}; 21�0�b�&�QX�f���q�00����$>�h�N�'�a3��A���/�r ��L5�8�GԲ'�����w;��c#�q1���h$*��V^�k��QĽ�b:i������� ����H F#�_���,��]g����Ը����`RUU���� ��"�qD���>-��ϤI�~��3�̴�����NZ[[555�eeek7�m����YF#[��Đ��R��i��L�H�r ��@��J-�Pŝ��_|�-��6y��ks�V�U~��6���w.����(��0A� 4��f��� /���C�xŊ�ٳ����z=6�����rg���mKo��o�/����a�g���?'9%9��P��斓��~���L{�� �H��{AW��B��$����v�1b�&Mb�ر��ر#�0`�`xMBp! )Z�Nmo�mZ�g�}�eذaWTVV ���'99��C5��&�&+5�bT>|8��PUUETT����&���t��~TE%��'������b�tEGG;RSS�S�N�v��ѯ��t����u1@�ޚ"f��͈���r'L�Ph��m��ƌ�74o��`�x�q�P���NRSS�X,�����l&&&��MFFA!-��`��ҷ�n��Yuu�����x<I�LB%����KԒ50�!�3�bz�����ʸKL���;---�l6[��`��������Ȏ;�����egg4��!D�T��jWujyZ��������K����%����p�^���X,6��sV=�ܖ����6�3�X ���4ҿ��A2�&����_k�;d�� �VfOIEND�B`� 0x0x
PHP 8.1.34
Preview: index-CzmBmAdx.js Size: 135.29 KB
/home2/astrociv/public_html/gurujii.in/assets/index-CzmBmAdx.js
import{c as Oe,ad as Es,i as se,r as S,a8 as Re,Y as Ie,I as Te,ae as Xe,H as Ze,M as V,j as e,B as b,L as T,S as we,N as $,af as Os,ag as $s,ah as Bs,ai as zs,aj as qs,X as $e,T as os,P as fe,ak as Le,ab as Fs,a1 as Gs}from"./index-DnuhVBRS.js";import{D as _s,E as Ks,u as Ws,F as Us,G as Vs,H as Qs,I as Hs,J as Js,t as Ys,s as Xs,K as es,L as Zs,g as ea,w as ss,M as sa,N as aa,O as ra,P as ta}from"./api-DcpvyF1R.js";import{B as I}from"./badge-ChJDSqQx.js";import{I as w}from"./input-D3k2IYOD.js";import{L as v}from"./label-HsiH38Rt.js";import{a as J}from"./data-Du3N2DSA.js";import{b as Me,C as as,i as ds,d as la,e as na,s as ia,f as oa,g as da,c as ca,a as ge,h as cs,S as ma}from"./chat-alerts-CqsnocmM.js";import{r as rs,T as ts}from"./tracking-Bf_KRNEa.js";import{b as xa,D as pa,f as ha,d as ua,a as ms,r as ga,K as de,S as ce,R as je,V as ls,T as xs,I as Be,c as Ne,L as ba,E as be,C as fa}from"./admin-export-DN9ojDzD.js";import{I as Y}from"./indian-rupee-C10D62vK.js";import{T as ja}from"./trending-up-DJqPZdTj.js";import{C as X}from"./calendar-days-DD8wZncg.js";import{C as Na,B as q}from"./calendar-CdukJglv.js";import{C as me,S as ze}from"./smartphone-DpASUaiT.js";import{U as Z}from"./users-DWpiYnoP.js";import{U as ee}from"./user-check-DGeaDDxP.js";import{D as ne}from"./download-CtDga5On.js";import{S as qe}from"./star-DD2mL8Kg.js";import{P as Q}from"./package-check-Do-yCAVj.js";import{L as Fe}from"./layout-dashboard-C-GsZ9Zx.js";import{W as ke,C as ye,S as ve}from"./wallet-CWqA2LT6.js";import{C as F}from"./circle-check-CUYDO1Nq.js";import{S as Ce}from"./settings-CG5yRgw4.js";import{F as D,V as ya,P as ps}from"./video-CbEKJQiL.js";import{P as Ge}from"./palette-CksDG8rk.js";import{M as hs,U as va}from"./user-round-CWwfVEVb.js";import{S as H}from"./save-Cbjh4N6M.js";import{S as Ae,C as wa,F as ka}from"./search-DrKpMDSr.js";import{E as le}from"./eye-C6wD8whL.js";const Ca=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],us=Oe("circle",Ca);const Aa=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],Sa=Oe("clipboard-list",Aa);const Pa=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],Ra=Oe("rotate-cw",Pa),gs="astro-baat-admin-account",De={username:"admin",email:"admin@astrobaat.in",displayName:"Practice Owner",phone:"+91 98765 43210",password:"Admin@123"};function bs(){return typeof window<"u"}function ns(){if(!bs())return De;try{const i=JSON.parse(window.localStorage.getItem(gs)||"{}");return{...De,...i}}catch{return De}}function Ia(i){bs()&&(window.localStorage.setItem(gs,JSON.stringify({...i,updatedAt:new Date().toISOString()})),window.dispatchEvent(new Event("admin-account-updated")))}const oe=[{href:"/admin",label:"Overview",icon:Fe},{href:"/admin/alerts",label:"Alert Center",icon:q},{href:"/admin/practice",label:"Practice Setup",icon:Ce},{href:"/admin/account",label:"Admin Account",icon:de},{href:"/admin/bookings",label:"Bookings",icon:X},{href:"/admin/astrologers",label:"Team",icon:qe},{href:"/admin/clients",label:"Clients",icon:Z},{href:"/admin/questions",label:"Questions",icon:me},{href:"/admin/reports",label:"Reports",icon:D},{href:"/admin/services",label:"Services",icon:ce},{href:"/admin/messages",label:"Messages",icon:V},{href:"/admin/products",label:"Store Products",icon:Q},{href:"/admin/wallet",label:"Wallet Mgmt",icon:ke},{href:"/admin/export",label:"Export Data",icon:ne},{href:"/admin/theme",label:"Theme Manager",icon:Ge},{href:"/astrologer",label:"Guruji Admin",icon:ee}],Ta=["/admin/alerts","/admin/bookings","/admin/services","/admin/products","/admin/theme"],La=Gs.filter(i=>i!=="All");function Ee(i){const c=Date.parse(i.waitingSince||i.createdAt||"");return Number.isFinite(c)?Math.max(0,Math.floor((Date.now()-c)/1e3)):0}function fs(i){return i==="question-received"?"border-orange-500/25 bg-orange-500/10 text-orange-700":i==="accepted"?"border-emerald-500/25 bg-emerald-500/10 text-emerald-700":i==="snoozed"?"border-sky-500/25 bg-sky-500/10 text-sky-700":i==="closed"?"border-muted bg-muted/40 text-muted-foreground":"border-rose-500/25 bg-rose-500/10 text-rose-700"}function js(){if(!(typeof window>"u"))try{const i=window.AudioContext||window.webkitAudioContext;if(!i)return;const c=new i,h=c.createGain(),l=c.createOscillator();l.type="sine",l.frequency.setValueAtTime(740,c.currentTime),l.frequency.exponentialRampToValueAtTime(980,c.currentTime+.12),h.gain.setValueAtTime(1e-4,c.currentTime),h.gain.exponentialRampToValueAtTime(.18,c.currentTime+.02),h.gain.exponentialRampToValueAtTime(1e-4,c.currentTime+.28),l.connect(h),h.connect(c.destination),l.start(),l.stop(c.currentTime+.3)}catch{}}function Ma({current:i,alertCount:c,adminAccount:h,settings:l}){return e.jsx("div",{className:"hidden w-72 flex-shrink-0 overflow-y-auto border-r border-primary/15 bg-gradient-to-b from-card via-background to-primary/5 md:block",children:e.jsxs("div",{className:"p-5",children:[e.jsxs("div",{className:"mb-5 overflow-hidden rounded-3xl border border-primary/20 bg-primary/8 p-4 shadow-sm",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"grid h-12 w-12 place-items-center rounded-2xl bg-primary text-primary-foreground shadow-[0_14px_34px_rgba(212,175,55,.2)]",children:e.jsx(we,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"truncate font-serif text-xl font-black text-primary",children:l.businessName}),e.jsx("p",{className:"text-[11px] font-bold uppercase tracking-[0.16em] text-muted-foreground",children:"Owner Admin"})]})]}),e.jsxs("div",{className:"mt-4 grid grid-cols-2 gap-2 text-[11px]",children:[e.jsx("span",{className:"rounded-xl border border-emerald-500/20 bg-emerald-500/10 px-2.5 py-2 font-black text-emerald-700",children:"Live System"}),e.jsx("span",{className:"rounded-xl border border-primary/20 bg-background/70 px-2.5 py-2 font-black text-primary",children:"Razorpay Ready"})]})]}),e.jsx("nav",{className:"space-y-1.5",children:oe.map(p=>{const x=p.icon,A=i===p.href;return e.jsxs(T,{href:p.href,className:`group flex items-center gap-3 rounded-2xl border px-3 py-2.5 text-sm font-bold transition-all ${A?"border-primary/35 bg-primary/12 text-primary shadow-sm":"border-transparent text-muted-foreground hover:border-primary/15 hover:bg-primary/5 hover:text-foreground"}`,children:[e.jsx("span",{className:`grid h-8 w-8 shrink-0 place-items-center rounded-xl transition ${A?"bg-primary text-primary-foreground":"bg-muted/60 text-muted-foreground group-hover:bg-primary/10 group-hover:text-primary"}`,children:e.jsx(x,{className:"h-4 w-4"})}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:p.label}),p.href==="/admin/alerts"&&c>0&&e.jsx("span",{className:"ml-auto rounded-full bg-rose-500 px-1.5 py-0.5 text-[10px] font-black text-white",children:c})]},p.href)})}),e.jsxs("div",{className:"mt-6 rounded-3xl border border-primary/15 bg-card/80 p-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"grid h-10 w-10 place-items-center rounded-2xl bg-primary/12 text-sm font-black text-primary",children:h.displayName.charAt(0)}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate text-sm font-black",children:h.displayName}),e.jsxs("span",{className:"block truncate text-xs text-primary",children:["@",h.username]})]})]}),e.jsx(T,{href:"/admin/account",children:e.jsx(b,{variant:"outline",className:"mt-3 h-9 w-full rounded-xl border-primary/20 text-xs font-bold text-primary",children:"Edit Admin Login"})})]})]})})}function Da({current:i,alertCount:c,settings:h}){const l=["bg-primary/12 text-primary","bg-emerald-500/10 text-emerald-700","bg-sky-500/10 text-sky-700","bg-rose-500/10 text-rose-700","bg-violet-500/10 text-violet-700","bg-orange-500/10 text-orange-700"];return e.jsxs("div",{className:"md:hidden -mx-4 mb-4 border-b border-primary/15 bg-background/90 px-4 pb-3 backdrop-blur-xl",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-[11px] font-black uppercase tracking-[0.18em] text-muted-foreground",children:h.businessName}),e.jsx("h1",{className:"font-serif text-xl font-black text-primary",children:"Admin Control"})]}),e.jsx(T,{href:"/astrologer",children:e.jsx(b,{size:"sm",className:"gold-gradient h-9 rounded-xl text-xs font-black text-primary-foreground",children:"Guruji"})})]}),e.jsx("div",{className:"flex gap-2 overflow-x-auto pb-1",children:oe.map((p,x)=>{const A=p.icon,r=i===p.href;return e.jsxs(T,{href:p.href,className:`relative inline-flex min-h-11 shrink-0 items-center gap-2 rounded-2xl border px-3 text-xs font-bold transition ${r?"border-primary/35 bg-primary/12 text-primary":"border-primary/10 bg-card/70 text-muted-foreground"}`,children:[e.jsx("span",{className:`grid h-8 w-8 place-items-center rounded-xl ${l[x%l.length]}`,children:e.jsx(A,{className:"h-4 w-4"})}),p.label,p.href==="/admin/alerts"&&c>0&&e.jsx("span",{className:"-mr-1 rounded-full bg-rose-500 px-1.5 py-0.5 text-[10px] text-white",children:c})]},p.href)})})]})}function Ea({current:i,alertCount:c,adminAccount:h,settings:l,onExport:p}){const x=oe.find(o=>o.href===i)||oe[0],A=x.icon,r=oe.filter(o=>Ta.includes(o.href));return e.jsx("div",{className:"guruji-backend-topbar sticky top-0 z-30 -mx-4 mb-4 border-b border-primary/15 px-4 py-3 md:-mx-6 md:mb-6 md:px-6",children:e.jsxs("div",{className:"flex flex-col gap-3 xl:flex-row xl:items-center xl:justify-between",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("div",{className:"guruji-backend-logo grid h-12 w-12 shrink-0 place-items-center rounded-2xl border border-primary/25 text-primary-foreground",children:e.jsx(we,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-[11px] font-black uppercase tracking-[0.18em] text-muted-foreground",children:"Owner Backend"}),e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx(A,{className:"h-4 w-4 shrink-0 text-primary"}),e.jsx("h1",{className:"truncate font-serif text-xl font-black text-primary md:text-2xl",children:x.label})]})]})]}),e.jsx("nav",{className:"hidden min-w-0 flex-1 justify-center gap-1 xl:flex",children:r.map(o=>{const n=o.icon,y=i===o.href;return e.jsxs(T,{href:o.href,className:`guruji-backend-navlink ${y?"is-active":""}`,children:[e.jsx(n,{className:"h-4 w-4"}),e.jsx("span",{children:o.label}),o.href==="/admin/alerts"&&c>0&&e.jsx("span",{className:"rounded-full bg-rose-500 px-1.5 py-0.5 text-[10px] font-black text-white",children:c})]},o.href)})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"hidden max-w-[170px] truncate rounded-2xl border border-primary/15 bg-background/70 px-3 py-2 text-xs font-black text-primary sm:inline-flex",children:l.businessName}),e.jsxs("span",{className:"rounded-2xl border border-emerald-500/25 bg-emerald-500/10 px-3 py-2 text-xs font-black text-emerald-700",children:["@",h.username]}),e.jsxs(b,{onClick:p,size:"sm",variant:"outline",className:"h-10 rounded-2xl border-primary/25 bg-background/70 px-3 text-xs font-black text-primary",children:[e.jsx(ne,{className:"mr-2 h-4 w-4"})," Export"]}),e.jsx(T,{href:"/",children:e.jsx(b,{size:"sm",className:"gold-gradient h-10 rounded-2xl px-4 text-xs font-black text-primary-foreground",children:"View Site"})})]})]})})}function Pr(){const c=Es()?.section||"",h=c?`/admin/${c}`:"/admin",{toast:l}=se(),{data:p,isLoading:x}=_s(),{data:A}=Ks({},{query:{queryKey:sa({})}}),{data:r}=Ws({},{query:{queryKey:ea({})}}),{data:o}=Us({},{query:{queryKey:aa({})}}),{data:n}=Vs({},{query:{queryKey:ra({})}}),y=J(A),u=J(r),k=J(o),g=J(n),[d,f]=S.useState(()=>Re()),[s,j]=S.useState(()=>ns()),[m,t]=S.useState(()=>Ie()),[P,G]=S.useState(()=>Ie()[0]?.id||""),[ae,N]=S.useState(""),[M,z]=S.useState({search:"",status:"All",source:"All"}),[_,xe]=S.useState(()=>rs()),[K,R]=S.useState(()=>Me()),[B,W]=S.useState(()=>Te()),[pe,_e]=S.useState(""),[Se,Ke]=S.useState("All");S.useEffect(()=>{const a=()=>f(Re());return window.addEventListener(Xe,a),window.addEventListener("storage",a),()=>{window.removeEventListener(Xe,a),window.removeEventListener("storage",a)}},[]),S.useEffect(()=>{const a=()=>R(Me());window.addEventListener(as,a),window.addEventListener("storage",a);const C=window.setInterval(a,1e3);return()=>{window.removeEventListener(as,a),window.removeEventListener("storage",a),window.clearInterval(C)}},[]),S.useEffect(()=>{const a=()=>W(Te());return window.addEventListener(Ze,a),window.addEventListener("storage",a),()=>{window.removeEventListener(Ze,a),window.removeEventListener("storage",a)}},[]),S.useEffect(()=>{const a=()=>xe(rs());return window.addEventListener(ts,a),window.addEventListener("storage",a),()=>{window.removeEventListener(ts,a),window.removeEventListener("storage",a)}},[]);const he=S.useMemo(()=>K.filter(ds),[K]),Pe=he.length,We=xa(_,g),re=We.length?We:pa,Ns=["All",...Array.from(new Set(re.map(a=>a.status)))],ie=ha(re,M),ys=re.reduce((a,C)=>a+Number(C.amount||0),0),vs={role:"admin",adminAccount:{...s,password:"hidden"},settings:d,stats:p,bookings:y,astrologers:u,users:k,questions:g,reportOrders:re,filteredReportOrders:ie,chatAlerts:K,activeChatAlerts:he,products:m,trackingRecords:_,serviceControls:B},ue=()=>{ua("astro-baat-admin-all-data",vs),l({title:"Admin data export ready",description:"All admin dashboard data was downloaded as a JSON file."})},Ue=()=>{ms("astro-baat-report-orders",ga(ie)),l({title:"Report CSV downloaded",description:`${ie.length} report row${ie.length===1?"":"s"} exported.`})},ws=a=>{Ia(a),j(ns()),l({title:"Admin account updated",description:"Username, profile and login password settings are saved."})},Ve=async a=>{Os(a);const C=await $s(Bs({practiceSettings:a}));f(Re()),l({variant:C.ok||C.source==="server"?"default":"destructive",title:C.source==="server"?"Theme published":"Theme saved",description:C.message})},Qe=(a,C)=>{t(E=>E.map(O=>O.id===a?{...O,...C}:O))},ks=()=>{const a=m[0]||Ie()[0],C=Date.now(),E={...a,id:`admin-product-${C}`,slug:`admin-product-${C}`,name:"New Store Product",category:"Remedies",price:999,salePrice:799,purpose:"Custom client remedy",rating:4.8,stock:"In Stock",description:"Add complete product details, remedy benefit, price, stock and product image.",recommendedFor:"Clients who need a personalized astrology remedy",visualLabel:"NS",isActive:!0};t(O=>[E,...O]),G(E.id),l({title:"Product draft added",description:"Edit details and save to publish it."})},Cs=a=>{if(a.startsWith("admin-product-")||a.startsWith("custom-product-")){t(C=>C.filter(E=>E.id!==a)),G(C=>C===a?m.find(E=>E.id!==a)?.id||"":C),l({title:"Product removed"});return}Qe(a,{isActive:!1}),l({title:"Product hidden",description:"Save the catalog to remove it from the customer store."})},As=()=>{zs(m),l({title:"Store catalog saved",description:"Admin and customer store are now updated."})},Ss=(a,C)=>{W(E=>({...E,services:E.services.map(O=>O.id===a?{...O,...C,price:C.price===void 0?O.price:Number(C.price||0)}:O)}))},Ps=a=>{W(C=>({...C,payment:{...C.payment,...a}}))},Rs=()=>{const a=Date.now(),C=Se==="All"?"booking":Se,E={id:`admin-service-${a}`,kind:C,name:"New Admin Service",label:"Custom Service",price:501,duration:"Custom",enabled:!0,description:"Create a new service and control its customer visibility."};W(O=>({...O,services:[E,...O.services]})),Ke(C),_e(""),l({title:"Service added",description:"Edit the service and save controls to publish it."})},Is=()=>{qs(B),W(Te()),l({title:"Service controls saved",description:"Guruji, Admin, customer pages and Razorpay settings are updated."})},te=()=>R(Me()),He=a=>{la(a.id),te(),l({title:"Alert accepted",description:`${a.clientName||"Client"} is marked connected for Guruji.`})},Je=a=>{na(a.id),te(),l({title:"Alert closed",description:"This alert is removed from the active queue."})},Ts=a=>{ia(a.id),te(),l({title:"Alert snoozed",description:"Guruji can reopen it from alert history."})},Ls=a=>{oa(a.id),te(),l({title:"Alert reopened",description:"The client request is back in the live queue."})},Ms=()=>{da(),te(),l({title:"Alert history cleaned",description:"Closed and accepted alerts were removed."})},Ye=()=>{const a=new Date().toISOString(),C={id:`admin-test-alert-${Date.now()}`,clientName:"Demo Client",language:"Hindi",dateOfBirth:"1994-08-18",astrologerName:d.astrologerName,question:"Career and marriage timing guidance needed.",createdAt:a,waitingSince:a,status:"question-received"};ca(C),js(),te(),l({title:"Test alert created",description:"Open Guruji Live Chat to accept this request."})},Ds=[{label:"Total Revenue",value:`₹${p?.totalRevenue||0}`,icon:Y,color:"text-primary bg-primary/10 border-primary/30"},{label:"Today's Revenue",value:`₹${p?.todayRevenue||0}`,icon:ja,color:"text-emerald-600 bg-emerald-500/10 border-emerald-500/30"},{label:"Total Bookings",value:p?.totalBookings||0,icon:X,color:"text-sky-600 bg-sky-500/10 border-sky-500/30"},{label:"Today's Bookings",value:p?.todayBookings||0,icon:Na,color:"text-blue-600 bg-blue-500/10 border-blue-500/30"},{label:"Active Chats",value:p?.activeChats||0,icon:V,color:"text-violet-600 bg-violet-500/10 border-violet-500/30"},{label:"Pending Questions",value:p?.pendingQuestions||0,icon:me,color:"text-orange-600 bg-orange-500/10 border-orange-500/30"},{label:"Total Clients",value:p?.totalClients||0,icon:Z,color:"text-teal-600 bg-teal-500/10 border-teal-500/30"},{label:"Team Members",value:p?.totalAstrologers||u.length||1,icon:ee,color:"text-amber-600 bg-amber-500/10 border-amber-500/30"}];return e.jsx("div",{className:"guruji-admin-theme min-h-[100dvh] bg-background text-foreground",children:e.jsxs("div",{className:"guruji-admin-shell flex h-[100dvh] overflow-hidden",children:[e.jsx(Ma,{current:h,alertCount:Pe,adminAccount:s,settings:d}),e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 md:p-6",children:[e.jsx(Ea,{current:h,alertCount:Pe,adminAccount:s,settings:d,onExport:ue}),e.jsx(Da,{current:h,alertCount:Pe,settings:d}),(!c||c==="")&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h1",{className:"text-2xl font-serif font-bold text-primary",children:"Dashboard Overview"}),e.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[e.jsxs(b,{onClick:ue,variant:"outline",className:"hidden border-primary/25 font-bold text-primary sm:inline-flex",children:[e.jsx(ne,{className:"mr-2 h-4 w-4"})," Export All"]}),e.jsx("div",{className:"text-xs text-muted-foreground",children:new Date().toLocaleDateString("en-IN",{weekday:"long",year:"numeric",month:"long",day:"numeric"})})]})]}),x?e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-8",children:[...Array(8)].map((a,C)=>e.jsx("div",{className:"h-24 glass-card animate-pulse"},C))}):e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-8",children:Ds.map(a=>{const C=a.icon;return e.jsxs("div",{className:`p-4 rounded-xl border ${a.color}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:a.label}),e.jsx(C,{className:"w-4 h-4"})]}),e.jsx("p",{className:"text-2xl font-bold",children:a.value})]},a.label)})}),e.jsx(qa,{alerts:he,settings:d,bookings:y,questions:g,managedProducts:m,onAcceptAlert:He,onCloseAlert:Je,onCreateTestAlert:Ye}),e.jsxs("div",{className:"grid md:grid-cols-3 gap-5 mb-8",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"font-serif font-bold mb-3 flex items-center gap-2",children:[e.jsx(X,{className:"w-4 h-4 text-primary"})," Recent Bookings"]}),e.jsxs("div",{className:"space-y-2",children:[y.slice(0,4).map(a=>e.jsxs("div",{className:"flex items-center justify-between text-sm p-2 rounded-lg bg-primary/5",children:[e.jsx("span",{className:"truncate max-w-[120px]",children:a.clientName||`Booking #${a.id}`}),e.jsx(I,{className:`text-[10px] ${a.status==="completed"?"bg-emerald-500/10 text-emerald-600":a.status==="pending"?"bg-amber-500/10 text-amber-600":"bg-sky-500/10 text-sky-600"}`,children:a.status})]},a.id)),y.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"No bookings yet"})]}),e.jsx(T,{href:"/admin/bookings",children:e.jsx(b,{size:"sm",variant:"ghost",className:"w-full mt-3 text-xs text-primary",children:"View All"})})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"font-serif font-bold mb-3 flex items-center gap-2",children:[e.jsx(qe,{className:"w-4 h-4 text-primary"})," Practice Team"]}),e.jsx("div",{className:"space-y-2",children:u.slice(0,4).map(a=>e.jsxs("div",{className:"flex items-center gap-2 text-sm p-2 rounded-lg bg-primary/5",children:[e.jsx("div",{className:"w-7 h-7 rounded-full bg-primary/20 flex items-center justify-center text-xs font-bold text-primary",children:a.name.charAt(0)}),e.jsx("span",{className:"flex-1 truncate text-xs",children:a.name}),e.jsx("span",{className:`w-2 h-2 rounded-full flex-shrink-0 ${a.isOnline?"bg-emerald-500":"bg-muted-foreground/40"}`})]},a.id))}),e.jsx(T,{href:"/admin/astrologers",children:e.jsx(b,{size:"sm",variant:"ghost",className:"w-full mt-3 text-xs text-primary",children:"View All"})})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"font-serif font-bold mb-3 flex items-center gap-2",children:[e.jsx(me,{className:"w-4 h-4 text-primary"})," Pending Questions"]}),e.jsxs("div",{className:"space-y-2",children:[g.filter(a=>a.status==="pending").slice(0,4).map(a=>e.jsxs("div",{className:"text-xs p-2 rounded-lg bg-orange-500/5 border border-orange-500/10",children:[e.jsx("p",{className:"font-medium text-xs truncate",children:a.title}),e.jsx("p",{className:"text-muted-foreground",children:a.category})]},a.id)),g.filter(a=>a.status==="pending").length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"All questions answered!"})]}),e.jsx(T,{href:"/admin/questions",children:e.jsx(b,{size:"sm",variant:"ghost",className:"w-full mt-3 text-xs text-primary",children:"View All"})})]})]}),e.jsx("div",{className:"glass-card mb-8 overflow-hidden",children:e.jsxs("div",{className:"grid gap-0 lg:grid-cols-[1fr_340px]",children:[e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"font-serif text-xl font-bold text-primary flex items-center gap-2",children:[e.jsx(Q,{className:"w-5 h-5"})," Store Health"]}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Product catalog, images, inventory and active store visibility."})]}),e.jsx(T,{href:"/admin/products",children:e.jsxs(b,{className:"gold-gradient font-bold text-primary-foreground",children:[e.jsx(we,{className:"mr-2 h-4 w-4"})," Manage Store"]})})]}),e.jsx("div",{className:"mt-5 grid grid-cols-2 gap-3 lg:grid-cols-4",children:[{label:"Total Products",value:m.length},{label:"Live Products",value:m.filter(a=>a.isActive!==!1).length},{label:"Hidden",value:m.filter(a=>a.isActive===!1).length},{label:"Catalog Value",value:$(m.reduce((a,C)=>a+Number(C.salePrice||0),0))}].map(a=>e.jsxs("div",{className:"rounded-2xl border border-primary/15 bg-primary/5 p-4",children:[e.jsx("p",{className:"text-2xl font-black text-primary",children:a.value}),e.jsx("p",{className:"mt-1 text-xs font-semibold text-muted-foreground",children:a.label})]},a.label))})]}),e.jsxs("div",{className:"border-t border-primary/10 bg-primary/5 p-5 lg:border-l lg:border-t-0",children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Featured Store Preview"}),e.jsxs("div",{className:"mt-4 flex gap-3 rounded-2xl border border-primary/15 bg-background/80 p-3",children:[e.jsx("img",{src:m[0]?.image,alt:m[0]?.name||"Store product",className:"h-20 w-20 rounded-2xl object-cover"}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"line-clamp-1 font-serif text-lg font-bold",children:m[0]?.name||"Store Product"}),e.jsx("p",{className:"mt-1 text-xs text-muted-foreground line-clamp-2",children:m[0]?.purpose||"Manage your premium spiritual store catalog."}),e.jsx("p",{className:"mt-2 font-bold text-primary",children:$(m[0]?.salePrice||0)})]})]})]})]})}),e.jsxs("div",{className:"glass-card p-6",children:[e.jsxs("h3",{className:"font-serif font-bold mb-5 flex items-center gap-2",children:[e.jsx(Fe,{className:"w-4 h-4 text-primary"})," Practice Summary"]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[{label:"Wallet Balance (All)",value:`₹${p?.totalWalletBalance||0}`},{label:"Avg Booking Value",value:`₹${Math.round((p?.totalRevenue||0)/Math.max(p?.totalBookings||1,1))}`},{label:"New Clients (7d)",value:k.filter(a=>a.role==="client").length},{label:"Total Reviews",value:p?.totalReviews||0}].map(a=>e.jsxs("div",{className:"p-4 rounded-xl bg-primary/5 border border-primary/10 text-center",children:[e.jsx("p",{className:"text-2xl font-bold text-primary",children:a.value}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:a.label})]},a.label))})]})]}),c==="alerts"&&e.jsx(Ga,{alerts:K,activeAlerts:he,settings:d,onAcceptAlert:He,onCloseAlert:Je,onSnoozeAlert:Ts,onReopenAlert:Ls,onClearClosed:Ms,onCreateTestAlert:Ye}),c==="practice"&&e.jsx(Ja,{settings:d,stats:p,bookings:y,users:k,questions:g,onSaveSettings:Ve}),c==="account"&&e.jsx(_a,{account:s,onSave:ws}),c==="bookings"&&e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-serif font-bold text-primary mb-6",children:"All Bookings"}),e.jsx("div",{className:"glass-card overflow-hidden",children:e.jsxs("div",{className:"overflow-x-auto",children:[e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-primary/5 border-b border-primary/20",children:e.jsx("tr",{children:["ID","Client","Astrologer","Mode","Date","Amount","Status"].map(a=>e.jsx("th",{className:"text-left px-4 py-3 text-xs font-bold text-muted-foreground uppercase tracking-wide",children:a},a))})}),e.jsx("tbody",{className:"divide-y divide-primary/10",children:y.map(a=>e.jsxs("tr",{className:"hover:bg-primary/5 transition-colors",children:[e.jsx("td",{className:"px-4 py-3 font-mono text-xs text-primary",children:a.bookingNumber||`#${a.id}`}),e.jsx("td",{className:"px-4 py-3",children:a.clientName||"—"}),e.jsx("td",{className:"px-4 py-3",children:a.astrologerName||"—"}),e.jsx("td",{className:"px-4 py-3 capitalize",children:a.serviceMode}),e.jsx("td",{className:"px-4 py-3 text-xs text-muted-foreground",children:a.slotDate||"—"}),e.jsxs("td",{className:"px-4 py-3 font-bold text-primary",children:["₹",a.totalAmount]}),e.jsx("td",{className:"px-4 py-3",children:e.jsx(I,{className:`text-[10px] ${a.status==="completed"?"bg-emerald-500/10 text-emerald-600 border-emerald-500/20":a.status==="pending"?"bg-amber-500/10 text-amber-600 border-amber-500/20":a.status==="cancelled"?"bg-rose-500/10 text-rose-600 border-rose-500/20":"bg-sky-500/10 text-sky-600 border-sky-500/20"}`,children:a.status})})]},a.id))})]}),y.length===0&&e.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"No bookings found."})]})})]}),c==="astrologers"&&e.jsx(Xa,{astrologers:u}),c==="clients"&&e.jsx(za,{users:k,bookings:y,questions:g,trackItems:_}),c==="questions"&&e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-serif font-bold text-primary mb-6",children:"Questions"}),e.jsxs("div",{className:"space-y-4",children:[g.map(a=>e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("div",{className:"flex items-start justify-between mb-2",children:[e.jsx("h3",{className:"font-bold text-sm",children:a.title}),e.jsx(I,{className:`text-[10px] ${a.status==="answered"?"bg-emerald-500/10 text-emerald-600":"bg-orange-500/10 text-orange-600"}`,children:a.status})]}),e.jsxs("p",{className:"text-xs text-muted-foreground mb-2",children:[a.category," • ",a.question?.slice(0,120),"..."]}),a.status==="pending"&&e.jsx(b,{size:"sm",className:"gold-gradient text-primary-foreground text-xs mt-2",children:"Answer Now"})]},a.id)),g.length===0&&e.jsx("div",{className:"text-center py-12 text-muted-foreground glass-card",children:"No questions found."})]})]}),c==="reports"&&e.jsx(Ka,{rows:re,filteredRows:ie,filters:M,statuses:Ns,paidReportAmount:ys,onFilterChange:z,onExportFiltered:Ue,onExportAll:ue}),c==="services"&&e.jsx(Ba,{controls:B,serviceSearch:pe,serviceKindFilter:Se,onSearchChange:_e,onKindFilterChange:Ke,onChangeService:Ss,onChangePayment:Ps,onAddService:Rs,onSave:Is}),c==="messages"&&e.jsx(Ya,{}),c==="products"&&e.jsx(Ua,{products:m,editingProductId:P,productSearch:ae,onSearchChange:N,onSelectProduct:G,onChangeProduct:Qe,onAddProduct:ks,onRemoveProduct:Cs,onSaveProducts:As}),c==="wallet"&&e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-serif font-bold text-primary mb-6",children:"Wallet Management"}),e.jsx("div",{className:"grid md:grid-cols-3 gap-5 mb-6",children:[{label:"Total Wallet Balance",value:`₹${p?.totalWalletBalance||0}`,icon:ke},{label:"Total Revenue",value:`₹${p?.totalRevenue||0}`,icon:Y},{label:"Active Wallets",value:k.filter(a=>a.role==="client").length,icon:Z}].map(a=>{const C=a.icon;return e.jsxs("div",{className:"glass-card p-5 flex items-center gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-xl gold-gradient flex items-center justify-center",children:e.jsx(C,{className:"w-6 h-6 text-primary-foreground"})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-2xl font-bold text-primary",children:a.value}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a.label})]})]},a.label)})}),e.jsxs("div",{className:"glass-card p-6",children:[e.jsx("h3",{className:"font-serif font-bold mb-2",children:"Payment Gateway"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Razorpay is connected in test mode. All wallet recharges and bookings route through Razorpay with UPI QR support."}),e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-xl bg-emerald-500/5 border border-emerald-500/20",children:[e.jsx(F,{className:"w-5 h-5 text-emerald-600"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-bold",children:"Razorpay Settings Active"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Key: ",d.razorpayKeyId]})]})]})]})]}),c==="export"&&e.jsx(Wa,{settings:d,stats:p,bookings:y,users:k,astrologers:u,questions:g,reports:re,products:m,alerts:K,trackItems:_,onExportAll:ue,onExportReports:Ue}),c==="theme"&&e.jsx(Ha,{settings:d,onSave:Ve}),c==="theme-old"&&e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-serif font-bold text-primary mb-6",children:"Theme Manager"}),e.jsxs("div",{className:"glass-card p-6",children:[e.jsx("h3",{className:"font-serif font-bold mb-4",children:"Active Theme — Royal Light Premium"}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4 mb-6",children:[{name:"Cream Base",cls:"bg-background border"},{name:"Royal Gold",cls:"bg-primary"},{name:"Deep Maroon",cls:"bg-secondary"},{name:"Temple Saffron",cls:"bg-accent"}].map(a=>e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:`h-16 rounded-xl ${a.cls} border-primary/20 mb-2 shadow-sm`}),e.jsx("p",{className:"text-xs text-muted-foreground",children:a.name})]},a.name))}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your astrology business software uses a curated light palette inspired by Indian royal aesthetics — cream backgrounds with gold, saffron, and maroon accents, Cormorant Garamond serif headings, and elegant glass surfaces."})]})]})]})]})})}const is=["All","booking","report","puja","question","calculator"];function Oa(i){return{booking:ps,report:D,puja:ka,question:me,calculator:wa}[i]}function $a(i){return{booking:"border-sky-500/20 bg-sky-500/8 text-sky-700",report:"border-orange-500/20 bg-orange-500/8 text-orange-700",puja:"border-rose-500/20 bg-rose-500/8 text-rose-700",question:"border-emerald-500/20 bg-emerald-500/8 text-emerald-700",calculator:"border-violet-500/20 bg-violet-500/8 text-violet-700"}[i]}function Ba({controls:i,serviceSearch:c,serviceKindFilter:h,onSearchChange:l,onKindFilterChange:p,onChangeService:x,onChangePayment:A,onAddService:r,onSave:o}){const n=c.trim().toLowerCase(),y=S.useMemo(()=>i.services.filter(d=>{const f=`${d.name} ${d.label} ${d.kind} ${d.description}`.toLowerCase(),s=!n||f.includes(n),j=h==="All"||d.kind===h;return s&&j}),[i.services,n,h]),u=i.services.filter(d=>d.enabled).length,k=i.services.length-u,g=i.services.reduce((d,f)=>d+(f.enabled?Number(f.price||0):0),0);return e.jsxs("div",{className:"space-y-6 pb-10",children:[e.jsxs("div",{className:"overflow-hidden rounded-3xl border border-primary/20 bg-gradient-to-br from-primary/12 via-background to-sky-500/10 p-5 md:p-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{children:[e.jsx(I,{className:"mb-3 border-primary/20 bg-primary/10 text-primary",children:"Admin Service Control"}),e.jsx("h1",{className:"font-serif text-3xl font-black text-primary",children:"Reports, Puja, Booking, Questions & Tools"}),e.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-muted-foreground",children:"Change every service name, price, duration and on/off status. These controls are shared with Guruji panel, report page, puja page, paid questions, calculators, call/video booking and Razorpay payments."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(b,{onClick:r,variant:"outline",className:"border-primary/25 bg-background/70 font-bold text-primary",children:[e.jsx(fe,{className:"mr-2 h-4 w-4"})," Add Service"]}),e.jsxs(b,{onClick:o,className:"gold-gradient font-black text-primary-foreground",children:[e.jsx(H,{className:"mr-2 h-4 w-4"})," Save All Controls"]})]})]}),e.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[{label:"Active",value:u,icon:le,tone:"border-emerald-500/20 bg-emerald-500/8 text-emerald-700"},{label:"Service Off",value:k,icon:be,tone:"border-orange-500/20 bg-orange-500/8 text-orange-700"},{label:"Total Editable",value:i.services.length,icon:ce,tone:"border-primary/20 bg-primary/8 text-primary"},{label:"Enabled Value",value:$(g),icon:Y,tone:"border-sky-500/20 bg-sky-500/8 text-sky-700"}].map(d=>{const f=d.icon;return e.jsxs("div",{className:`rounded-2xl border p-4 ${d.tone}`,children:[e.jsx(f,{className:"mb-2 h-5 w-5"}),e.jsx("p",{className:"text-2xl font-black",children:d.value}),e.jsx("p",{className:"text-xs font-black uppercase tracking-wide opacity-75",children:d.label})]},d.label)})})]}),e.jsxs("div",{className:"grid gap-5 xl:grid-cols-[minmax(0,1fr)_360px]",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-2xl font-black text-primary",children:"Editable Services"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Use OFF to hide any service from customer pages."})]}),e.jsxs("label",{className:"relative block lg:w-72",children:[e.jsx(Ae,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-primary"}),e.jsx("input",{value:c,onChange:d=>l(d.target.value),placeholder:"Search service...",className:"h-11 w-full rounded-xl border border-primary/15 bg-card pl-10 pr-3 text-sm outline-none focus:border-primary"})]})]}),e.jsx("div",{className:"mb-5 flex gap-2 overflow-x-auto pb-1",children:is.map(d=>{const f=h===d;return e.jsx("button",{type:"button",onClick:()=>p(d),className:`shrink-0 rounded-full border px-4 py-2 text-xs font-black transition ${f?"border-primary/30 bg-primary/12 text-primary":"border-primary/12 bg-background/70 text-muted-foreground hover:border-primary/30 hover:text-primary"}`,children:d==="All"?"All Services":Le(d)},d)})}),e.jsx("div",{className:"grid gap-4 2xl:grid-cols-2",children:y.map(d=>{const f=Oa(d.kind),s=$a(d.kind);return e.jsxs("article",{className:`rounded-3xl border p-4 ${d.enabled?"border-primary/15 bg-card/80":"border-orange-500/25 bg-orange-500/5"}`,children:[e.jsxs("div",{className:"mb-4 flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 gap-3",children:[e.jsx("span",{className:`grid h-11 w-11 shrink-0 place-items-center rounded-2xl border ${s}`,children:e.jsx(f,{className:"h-5 w-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx(I,{className:`${s} mb-2 text-[10px]`,children:Le(d.kind)}),e.jsx("input",{value:d.name,onChange:j=>x(d.id,{name:j.target.value}),className:"w-full rounded-xl border border-transparent bg-transparent text-base font-black outline-none focus:border-primary/20 focus:bg-background focus:px-2 focus:py-1"})]})]}),e.jsx("button",{type:"button",onClick:()=>x(d.id,{enabled:!d.enabled}),className:`rounded-full border px-3 py-1 text-[11px] font-black ${d.enabled?"border-emerald-500/20 bg-emerald-500/10 text-emerald-700":"border-orange-500/20 bg-orange-500/10 text-orange-700"}`,children:d.enabled?"ON":"OFF"})]}),e.jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[e.jsx(L,{label:"Label",value:d.label,onChange:j=>x(d.id,{label:j})}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Type"}),e.jsx("select",{value:d.kind,onChange:j=>x(d.id,{kind:j.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary",children:is.filter(j=>j!=="All").map(j=>e.jsx("option",{value:j,children:Le(j)},j))})]}),e.jsx(L,{label:"Price",type:"number",value:d.price,onChange:j=>x(d.id,{price:Number(j||0)})}),e.jsx(L,{label:"Duration / Delivery",value:d.duration,onChange:j=>x(d.id,{duration:j})}),e.jsxs("label",{className:"space-y-1.5 text-sm md:col-span-2",children:[e.jsx("span",{className:"font-bold",children:"Description"}),e.jsx("textarea",{value:d.description,onChange:j=>x(d.id,{description:j.target.value}),rows:3,className:"w-full resize-none rounded-xl border border-primary/15 bg-card px-3 py-3 text-sm outline-none focus:border-primary"})]})]})]},d.id)})})]}),e.jsxs("aside",{className:"space-y-5",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"mb-4 flex items-center gap-2 font-serif text-xl font-black text-primary",children:[e.jsx(de,{className:"h-5 w-5"})," Razorpay / Wallet"]}),e.jsxs("div",{className:"space-y-3",children:[e.jsx(L,{label:"Razorpay Key ID",value:i.payment.razorpayKeyId,onChange:d=>A({razorpayKeyId:d}),placeholder:"rzp_live_xxxxxx"}),e.jsx(L,{label:"Razorpay Secret",value:i.payment.razorpayKeySecret,onChange:d=>A({razorpayKeySecret:d}),placeholder:"Secret for setup"}),e.jsx(L,{label:"UPI ID",value:i.payment.upiId,onChange:d=>A({upiId:d}),placeholder:"guruji@bank"}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Payment Mode"}),e.jsxs("select",{value:i.payment.paymentMode,onChange:d=>A({paymentMode:d.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary",children:[e.jsx("option",{value:"test",children:"Test Mode"}),e.jsx("option",{value:"live",children:"Live Mode"})]})]}),e.jsxs(b,{onClick:o,className:"gold-gradient w-full font-black text-primary-foreground",children:[e.jsx(H,{className:"mr-2 h-4 w-4"})," Save Gateway"]})]})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"font-serif text-xl font-black text-primary",children:"Connected Screens"}),e.jsx("div",{className:"mt-4 grid gap-2",children:[["/astrologer/services","Guruji Services"],["/reports","Report Orders"],["/puja","Puja Booking"],["/questions","Paid Questions"],["/calculators","Calculators"],["/book?mode=call","Call Booking"],["/book?mode=video","Video Booking"]].map(([d,f])=>e.jsx(T,{href:d,children:e.jsxs(b,{variant:"outline",className:"w-full justify-start border-primary/20 text-primary",children:[e.jsx(ce,{className:"mr-2 h-4 w-4"})," ",f]})},d))})]})]})]})]})}function L({label:i,value:c,onChange:h,type:l="text",placeholder:p}){return e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:i}),e.jsx("input",{type:l,value:c,placeholder:p,onChange:x=>h(x.target.value),className:"h-11 w-full rounded-xl border border-primary/15 bg-card px-3 text-sm outline-none focus:border-primary"})]})}function za({users:i,bookings:c,questions:h,trackItems:l}){const{toast:p}=se(),[x,A]=S.useState(""),r=t=>String(t||"").replace(/\D/g,""),o=t=>String(t||"").trim().toLowerCase(),n=t=>{const P=t?new Date(String(t)):null;return P&&!Number.isNaN(P.getTime())?P.toLocaleDateString("en-IN",{day:"numeric",month:"short",year:"numeric"}):"New lead"},y=S.useMemo(()=>{const t=i.filter(P=>o(P.role||"client")==="client");return t.length?t:[{id:"demo-1",name:"Priya Sharma",email:"priya.sharma@example.com",phone:"+91 98765 43210",role:"client",createdAt:new Date().toISOString()},{id:"demo-2",name:"Rahul Mehta",email:"rahul.mehta@example.com",phone:"+91 98123 45678",role:"client",createdAt:new Date(Date.now()-864e5*3).toISOString()},{id:"demo-3",name:"Sneha Kapoor",email:"sneha.kapoor@example.com",phone:"+91 99000 22119",role:"client",createdAt:new Date(Date.now()-864e5*7).toISOString()}]},[i]),u=S.useMemo(()=>y.map(t=>{const P=String(t.id||""),G=o(t.name||t.fullName||t.clientName),ae=r(t.phone||t.mobile||t.mobileNumber),N=R=>{const B=String(R.clientId||R.userId||R.customerId||""),W=o(R.clientName||R.customerName||R.userName||R.name||R.fullName),pe=r(R.phone||R.clientPhone||R.mobile||R.customerPhone);return!!(P&&B&&P===B||G&&W&&G===W||ae&&pe&&ae===pe)},M=c.filter(N),z=h.filter(N),_=l.filter(N),xe=[...M.map(R=>Number(R.totalAmount||R.amount||R.price||0)),..._.map(R=>Number(R.amount||0))].reduce((R,B)=>R+(Number.isFinite(B)?B:0),0),K=[...M,...z,..._].map(R=>R.createdAt||R.slotDate||R.date).filter(Boolean).sort((R,B)=>Date.parse(String(B))-Date.parse(String(R)))[0];return{client:t,name:t.name||t.fullName||t.clientName||"Website Client",email:t.email||"not added",phone:t.phone||t.mobile||t.mobileNumber||"not added",joined:n(t.createdAt),spend:xe,bookings:M.length,questions:z.length,tracking:_.length,latestActivity:K?n(K):"No activity yet",status:xe>0?"Paid Client":z.length?"Question Lead":"New Lead"}}),[c,y,h,l]),k=S.useMemo(()=>{const t=o(x);return t?u.filter(P=>o(`${P.name} ${P.email} ${P.phone} ${P.status}`).includes(t)):u},[u,x]),g=u.filter(t=>t.spend>0).length,d=u.reduce((t,P)=>t+P.spend,0),f=u.filter(t=>t.questions>0||t.tracking>0).length,s=()=>{ms("astro-baat-clients",k.map(t=>({id:t.client.id,name:t.name,email:t.email,phone:t.phone,status:t.status,spend:t.spend,bookings:t.bookings,questions:t.questions,trackingRecords:t.tracking,joined:t.joined,latestActivity:t.latestActivity}))),p({title:"Client CRM exported",description:`${k.length} client records downloaded as CSV.`})},j=[{label:"Total Clients",value:u.length,icon:Z,tone:"border-primary/20 bg-primary/8 text-primary"},{label:"Paid Clients",value:g,icon:ve,tone:"border-emerald-500/20 bg-emerald-500/8 text-emerald-700"},{label:"Client Value",value:$(d),icon:Y,tone:"border-orange-500/20 bg-orange-500/8 text-orange-700"},{label:"Active Leads",value:f,icon:je,tone:"border-sky-500/20 bg-sky-500/8 text-sky-700"}],m=[{href:"/astrologer",label:"Guruji Dashboard",desc:"Live overview, earnings and work queue",icon:Fe},{href:"/astrologer/live",label:"Live Chat Desk",desc:"Accept and reply to client chats",icon:V},{href:"/astrologer/services",label:"Service Controls",desc:"Reports, puja, call, video and wallet pricing",icon:ce},{href:"/admin/account",label:"Login Security",desc:"Admin username and password",icon:de}];return e.jsxs("div",{className:"space-y-6 pb-10",children:[e.jsxs("div",{className:"overflow-hidden rounded-3xl border border-primary/20 bg-gradient-to-br from-primary/12 via-background to-emerald-500/10 p-5 md:p-6",children:[e.jsxs("div",{className:"flex flex-col gap-5 xl:flex-row xl:items-start xl:justify-between",children:[e.jsxs("div",{children:[e.jsx(I,{className:"mb-3 border-primary/20 bg-primary/10 text-primary",children:"Client CRM"}),e.jsx("h1",{className:"font-serif text-3xl font-black text-primary",children:"Admin Client Management"}),e.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:"See every client, paid lead, booking, report, puja, store and question activity in one premium admin view connected with Guruji operations."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(b,{onClick:s,variant:"outline",className:"border-primary/25 font-bold text-primary",children:[e.jsx(ne,{className:"mr-2 h-4 w-4"})," Export Clients"]}),e.jsx(T,{href:"/astrologer",children:e.jsxs(b,{className:"gold-gradient font-bold text-primary-foreground",children:[e.jsx(ee,{className:"mr-2 h-4 w-4"})," Open Guruji Admin"]})})]})]}),e.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:j.map(t=>{const P=t.icon;return e.jsxs("div",{className:`rounded-2xl border p-4 ${t.tone}`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(P,{className:"h-5 w-5"}),e.jsx("span",{className:"text-[10px] font-black uppercase tracking-wide opacity-70",children:t.label})]}),e.jsx("p",{className:"mt-3 truncate text-2xl font-black",children:t.value})]},t.label)})})]}),e.jsxs("div",{className:"grid gap-5 xl:grid-cols-[1fr_360px]",children:[e.jsxs("div",{className:"space-y-5",children:[e.jsx("div",{className:"glass-card p-4",children:e.jsxs("div",{className:"grid gap-3 lg:grid-cols-[1fr_auto] lg:items-center",children:[e.jsxs("label",{className:"relative block",children:[e.jsx(Ae,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-primary"}),e.jsx(w,{value:x,onChange:t=>A(t.target.value),placeholder:"Search client name, phone, email or status...",className:"h-12 rounded-2xl border-primary/15 bg-background pl-10"})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(T,{href:"/admin/bookings",children:e.jsxs(b,{variant:"outline",className:"border-primary/20 text-primary",children:[e.jsx(X,{className:"mr-2 h-4 w-4"})," Bookings"]})}),e.jsx(T,{href:"/admin/reports",children:e.jsxs(b,{variant:"outline",className:"border-primary/20 text-primary",children:[e.jsx(D,{className:"mr-2 h-4 w-4"})," Reports"]})})]})]})}),e.jsx("div",{className:"grid gap-4 lg:grid-cols-3",children:k.slice(0,3).map((t,P)=>e.jsxs("div",{className:"glass-card p-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("span",{className:`grid h-12 w-12 shrink-0 place-items-center rounded-2xl text-sm font-black ${P===0?"bg-primary text-primary-foreground":P===1?"bg-emerald-500/12 text-emerald-700":"bg-sky-500/12 text-sky-700"}`,children:t.name.charAt(0).toUpperCase()}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate font-serif text-lg font-black text-primary",children:t.name}),e.jsx("p",{className:"truncate text-xs text-muted-foreground",children:t.phone})]})]}),e.jsxs("div",{className:"mt-4 grid grid-cols-3 gap-2 text-center text-xs",children:[e.jsxs("span",{className:"rounded-xl border border-primary/10 bg-primary/5 p-2",children:[e.jsx("b",{className:"block text-primary",children:t.bookings}),"Booking"]}),e.jsxs("span",{className:"rounded-xl border border-primary/10 bg-primary/5 p-2",children:[e.jsx("b",{className:"block text-primary",children:t.questions}),"Question"]}),e.jsxs("span",{className:"rounded-xl border border-primary/10 bg-primary/5 p-2",children:[e.jsx("b",{className:"block text-primary",children:t.tracking}),"Track"]})]}),e.jsxs("div",{className:"mt-4 flex items-center justify-between gap-2",children:[e.jsx(I,{className:t.spend>0?"border-emerald-500/20 bg-emerald-500/10 text-emerald-700":"border-orange-500/20 bg-orange-500/10 text-orange-700",children:t.status}),e.jsx("span",{className:"font-black text-primary",children:$(t.spend)})]})]},t.client.id||t.name))}),e.jsxs("div",{className:"glass-card overflow-hidden",children:[e.jsxs("div",{className:"border-b border-primary/10 p-4",children:[e.jsx("h2",{className:"font-serif text-xl font-black text-primary",children:"All Clients"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Responsive client table with payment and activity signals."})]}),e.jsxs("div",{className:"overflow-x-auto",children:[e.jsxs("table",{className:"w-full min-w-[780px] text-sm",children:[e.jsx("thead",{className:"border-b border-primary/15 bg-primary/5",children:e.jsx("tr",{children:["Client","Contact","Activity","Spend","Joined","Actions"].map(t=>e.jsx("th",{className:"px-4 py-3 text-left text-[11px] font-black uppercase tracking-wide text-muted-foreground",children:t},t))})}),e.jsx("tbody",{className:"divide-y divide-primary/10",children:k.map(t=>e.jsxs("tr",{className:"transition hover:bg-primary/5",children:[e.jsx("td",{className:"px-4 py-4",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"grid h-10 w-10 place-items-center rounded-2xl bg-primary/12 text-sm font-black text-primary",children:t.name.charAt(0).toUpperCase()}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block truncate font-black",children:t.name}),e.jsxs("span",{className:"block text-xs text-muted-foreground",children:["#",t.client.id||"client"]})]})]})}),e.jsxs("td",{className:"px-4 py-4",children:[e.jsxs("p",{className:"flex items-center gap-2 text-xs",children:[e.jsx(ps,{className:"h-3.5 w-3.5 text-primary"})," ",t.phone]}),e.jsxs("p",{className:"mt-1 flex items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(hs,{className:"h-3.5 w-3.5"})," ",t.email]})]}),e.jsxs("td",{className:"px-4 py-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.jsxs(I,{className:"border-primary/15 bg-primary/8 text-primary text-[10px]",children:[t.bookings," bookings"]}),e.jsxs(I,{className:"border-sky-500/20 bg-sky-500/10 text-sky-700 text-[10px]",children:[t.questions," questions"]}),e.jsxs(I,{className:"border-orange-500/20 bg-orange-500/10 text-orange-700 text-[10px]",children:[t.tracking," orders"]})]}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["Last: ",t.latestActivity]})]}),e.jsxs("td",{className:"px-4 py-4",children:[e.jsx("p",{className:"font-black text-primary",children:$(t.spend)}),e.jsx(I,{className:t.spend>0?"mt-1 border-emerald-500/20 bg-emerald-500/10 text-emerald-700 text-[10px]":"mt-1 border-muted bg-muted/50 text-muted-foreground text-[10px]",children:t.status})]}),e.jsx("td",{className:"px-4 py-4 text-xs text-muted-foreground",children:t.joined}),e.jsx("td",{className:"px-4 py-4",children:e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(b,{size:"sm",variant:"outline",className:"h-8 border-primary/20 text-xs text-primary",onClick:()=>p({title:"Client profile ready",description:`${t.name} is connected to bookings, reports and questions.`}),children:[e.jsx(le,{className:"mr-1.5 h-3.5 w-3.5"})," View"]}),e.jsxs(b,{size:"sm",className:"h-8 bg-emerald-600 text-xs text-white hover:bg-emerald-700",onClick:()=>p({title:"Message action",description:`WhatsApp or chat follow-up can be sent to ${t.name}.`}),children:[e.jsx(V,{className:"mr-1.5 h-3.5 w-3.5"})," Message"]})]})})]},t.client.id||t.name))})]}),k.length===0&&e.jsxs("div",{className:"p-12 text-center",children:[e.jsx(Z,{className:"mx-auto mb-3 h-10 w-10 text-primary"}),e.jsx("h3",{className:"font-serif text-2xl font-black text-primary",children:"No clients found"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Try another search or wait for new customer registrations."})]})]})]})]}),e.jsxs("aside",{className:"space-y-5",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[e.jsx("span",{className:"grid h-12 w-12 place-items-center rounded-2xl bg-primary text-primary-foreground",children:e.jsx(ee,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-serif text-xl font-black text-primary",children:"Guruji Admin"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Advanced owner and astrologer controls"})]})]}),e.jsx("div",{className:"grid gap-2",children:m.map(t=>{const P=t.icon;return e.jsx(T,{href:t.href,children:e.jsxs(b,{variant:"outline",className:"h-auto w-full justify-start rounded-2xl border-primary/15 p-3 text-left text-primary",children:[e.jsx("span",{className:"grid h-10 w-10 shrink-0 place-items-center rounded-xl bg-primary/10 text-primary",children:e.jsx(P,{className:"h-4 w-4"})}),e.jsxs("span",{className:"ml-3 min-w-0",children:[e.jsx("span",{className:"block font-black",children:t.label}),e.jsx("span",{className:"block truncate text-xs font-normal text-muted-foreground",children:t.desc})]})]})},t.href)})})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"font-serif text-xl font-black text-primary",children:"Client Flow Health"}),e.jsx("div",{className:"mt-4 space-y-3",children:[{label:"Booking to payment",value:"Connected",icon:ye,tone:"text-emerald-700 bg-emerald-500/10"},{label:"Report delivery",value:`${l.filter(t=>t.kind==="report").length} records`,icon:D,tone:"text-orange-700 bg-orange-500/10"},{label:"Live chat handoff",value:"Guruji alert ready",icon:q,tone:"text-rose-700 bg-rose-500/10"},{label:"Store tracking",value:`${l.filter(t=>t.kind==="order").length} orders`,icon:Q,tone:"text-sky-700 bg-sky-500/10"}].map(t=>{const P=t.icon;return e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-2xl border border-primary/10 bg-background/70 p-3",children:[e.jsxs("span",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`grid h-9 w-9 place-items-center rounded-xl ${t.tone}`,children:e.jsx(P,{className:"h-4 w-4"})}),e.jsx("span",{className:"text-sm font-bold",children:t.label})]}),e.jsx("span",{className:"text-xs font-black text-primary",children:t.value})]},t.label)})})]})]})]})]})}function qa({alerts:i,settings:c,bookings:h,questions:l,managedProducts:p,onAcceptAlert:x,onCloseAlert:A,onCreateTestAlert:r}){const o=i.filter(g=>Ee(g)>=Number(c.missedAlertAfterSec||45)).length,n=l.filter(g=>g.status==="pending").length,y=p.filter(g=>g.isActive!==!1).length,u=h.filter(g=>g.status!=="cancelled"&&g.status!=="completed").length,k=i.slice(0,3);return e.jsx("section",{className:"mb-8 overflow-hidden rounded-3xl border border-primary/20 bg-gradient-to-br from-primary/12 via-background to-rose-500/8 shadow-sm",children:e.jsxs("div",{className:"grid gap-0 xl:grid-cols-[1fr_370px]",children:[e.jsxs("div",{className:"p-5 md:p-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{children:[e.jsx(I,{className:"mb-3 border-primary/20 bg-primary/10 text-primary",children:"Guruji Admin Command Center"}),e.jsx("h2",{className:"font-serif text-3xl font-black text-primary",children:"All live work in one control room"}),e.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:"Track chat alerts, paid bookings, reports, products, wallet rules and client follow-ups from one advanced admin dashboard."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(b,{onClick:r,variant:"outline",className:"border-rose-500/25 bg-rose-500/5 font-bold text-rose-700",children:[e.jsx(je,{className:"mr-2 h-4 w-4"})," Test Alert"]}),e.jsx(T,{href:"/admin/alerts",children:e.jsxs(b,{className:"gold-gradient font-bold text-primary-foreground",children:[e.jsx(q,{className:"mr-2 h-4 w-4"})," Open Alerts"]})})]})]}),e.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[{label:"Live Alerts",value:i.length,desc:o?`${o} over SLA`:"Within SLA",icon:q,tone:"border-rose-500/20 bg-rose-500/8 text-rose-700"},{label:"Active Bookings",value:u,desc:c.bookingAcceptMode,icon:X,tone:"border-sky-500/20 bg-sky-500/8 text-sky-700"},{label:"Pending Reports",value:n,desc:`${c.reportDeliveryDays} day report SLA`,icon:D,tone:"border-orange-500/20 bg-orange-500/8 text-orange-700"},{label:"Live Store",value:y,desc:"Products visible",icon:Q,tone:"border-primary/20 bg-primary/8 text-primary"}].map(g=>{const d=g.icon;return e.jsxs("div",{className:`rounded-2xl border p-4 ${g.tone}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(d,{className:"h-5 w-5"}),e.jsx("span",{className:"text-[10px] font-black uppercase tracking-wide opacity-70",children:g.label})]}),e.jsx("p",{className:"mt-3 text-3xl font-black",children:g.value}),e.jsx("p",{className:"mt-1 line-clamp-1 text-xs opacity-75",children:g.desc})]},g.label)})}),e.jsx("div",{className:"mt-5 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:[{label:"Chat",text:c.chatAcceptMode,icon:V,href:"/admin/messages"},{label:"Razorpay",text:c.razorpayKeyId,icon:ye,href:"/admin/practice"},{label:"WhatsApp",text:c.escalationNumber,icon:ze,href:"/admin/practice"},{label:"Guruji Live",text:"Accept queue",icon:ee,href:"/astrologer/live"}].map(g=>{const d=g.icon;return e.jsx(T,{href:g.href,children:e.jsxs("a",{className:"flex items-center gap-3 rounded-2xl border border-primary/12 bg-background/75 p-3 transition hover:border-primary/35 hover:bg-primary/5",children:[e.jsx("span",{className:"grid h-10 w-10 place-items-center rounded-xl bg-primary/10 text-primary",children:e.jsx(d,{className:"h-5 w-5"})}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-sm font-black",children:g.label}),e.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:g.text})]})]})},g.label)})})]}),e.jsxs("div",{className:"border-t border-primary/10 bg-background/70 p-5 xl:border-l xl:border-t-0",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-black uppercase tracking-wider text-muted-foreground",children:"Incoming Alert Queue"}),e.jsx("h3",{className:"font-serif text-xl font-black text-primary",children:i.length?`${i.length} client request${i.length===1?"":"s"}`:"No active alerts"})]}),e.jsx("span",{className:`h-3 w-3 rounded-full ${i.length?"animate-pulse bg-rose-500":"bg-emerald-500"}`})]}),e.jsxs("div",{className:"space-y-3",children:[k.map(g=>e.jsx(Fa,{alert:g,onAcceptAlert:x,onCloseAlert:A},g.id)),k.length===0&&e.jsxs("div",{className:"rounded-2xl border border-emerald-500/20 bg-emerald-500/8 p-4 text-sm text-emerald-700",children:[e.jsx(F,{className:"mb-2 h-5 w-5"}),"Guruji is ready. New chat intake alerts will appear here instantly."]})]})]})]})})}function Fa({alert:i,onAcceptAlert:c,onCloseAlert:h}){return e.jsxs("div",{className:"rounded-2xl border border-primary/12 bg-card/80 p-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-black",children:i.clientName||"Website Client"}),e.jsxs("p",{className:"mt-1 text-[11px] text-muted-foreground",children:[i.language," - DOB ",i.dateOfBirth||"not shared"]})]}),e.jsx(I,{className:`shrink-0 text-[10px] ${fs(i.status)}`,children:i.status.replace("-"," ")})]}),e.jsx("p",{className:"mt-2 line-clamp-2 text-xs leading-5 text-muted-foreground",children:i.question||"Client has completed intake and is waiting for Guruji."}),e.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs font-bold text-orange-700",children:[e.jsx(ge,{className:"h-3.5 w-3.5"})," ",cs(i.waitingSince)]}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsx(b,{size:"sm",onClick:()=>c(i),className:"h-7 rounded-lg bg-emerald-600 px-2 text-[10px] font-black text-white hover:bg-emerald-700",children:"Accept"}),e.jsx(b,{size:"sm",variant:"outline",onClick:()=>h(i),className:"h-7 rounded-lg border-primary/20 px-2 text-[10px]",children:"Close"})]})]})]})}function Ga({alerts:i,activeAlerts:c,settings:h,onAcceptAlert:l,onCloseAlert:p,onSnoozeAlert:x,onReopenAlert:A,onClearClosed:r,onCreateTestAlert:o}){const{toast:n}=se(),[y,u]=S.useState("active"),[k,g]=S.useState({sound:h.alertSound!=="Off",browser:h.browserNotifications!=="Off",whatsapp:h.whatsappAlerts!=="Off",email:h.emailAlerts!=="Off",autoAssign:h.autoAssignGuruji!=="Off"}),[d,f]=S.useState(()=>typeof window<"u"&&"Notification"in window?Notification.permission:"unsupported"),s=c.filter(N=>Ee(N)>=Number(h.missedAlertAfterSec||45)).length,j=y==="active"?c:i,m=i.filter(N=>N.status==="accepted"||N.status==="closed").length,t=N=>{g(M=>({...M,[N]:!M[N]}))},P=async()=>{if(typeof window>"u"||!("Notification"in window)){n({variant:"destructive",title:"Browser alerts unavailable"});return}const N=await Notification.requestPermission();f(N),n({title:N==="granted"?"Browser alerts enabled":"Browser alerts not enabled",description:N==="granted"?"Guruji can receive desktop notifications for new chat requests.":"You can enable notifications from browser settings later."})},G=()=>{js(),n({title:"Alert sound tested",description:"This tone plays when a new live chat request arrives."})},ae=[{key:"sound",title:"Sound Alert",desc:"Play a short bell for new requests.",icon:ls},{key:"browser",title:"Browser Push",desc:`Permission: ${d}`,icon:q},{key:"whatsapp",title:"WhatsApp Escalation",desc:h.escalationNumber,icon:ze},{key:"email",title:"Email Copy",desc:h.email,icon:hs},{key:"autoAssign",title:"Auto Assign Guruji",desc:h.astrologerName,icon:ee}];return e.jsxs("div",{className:"space-y-6 pb-10",children:[e.jsxs("div",{className:"overflow-hidden rounded-3xl border border-primary/20 bg-gradient-to-br from-rose-500/10 via-background to-primary/10 p-5 md:p-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{children:[e.jsx(I,{className:"mb-3 border-rose-500/20 bg-rose-500/10 text-rose-700",children:"Advanced Alert System"}),e.jsx("h1",{className:"font-serif text-3xl font-black text-primary",children:"Guruji Alert Center"}),e.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:"Monitor free questions, paid chat requests, call/video readiness and missed-alert escalation from one fast queue."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(b,{onClick:G,variant:"outline",className:"border-primary/25 font-bold text-primary",children:[e.jsx(ls,{className:"mr-2 h-4 w-4"})," Test Sound"]}),e.jsxs(b,{onClick:P,variant:"outline",className:"border-primary/25 font-bold text-primary",children:[e.jsx(q,{className:"mr-2 h-4 w-4"})," Browser Alerts"]}),e.jsxs(b,{onClick:o,className:"gold-gradient font-bold text-primary-foreground",children:[e.jsx(je,{className:"mr-2 h-4 w-4"})," Create Test Alert"]})]})]}),e.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[{label:"Active Alerts",value:c.length,icon:q,tone:"border-rose-500/20 bg-rose-500/8 text-rose-700"},{label:"Over SLA",value:s,icon:xs,tone:"border-orange-500/20 bg-orange-500/8 text-orange-700"},{label:"Resolved",value:m,icon:F,tone:"border-emerald-500/20 bg-emerald-500/8 text-emerald-700"},{label:"SLA Timer",value:`${h.missedAlertAfterSec}s`,icon:ge,tone:"border-primary/20 bg-primary/8 text-primary"}].map(N=>{const M=N.icon;return e.jsxs("div",{className:`rounded-2xl border p-4 ${N.tone}`,children:[e.jsx(M,{className:"mb-2 h-5 w-5"}),e.jsx("p",{className:"text-3xl font-black",children:N.value}),e.jsx("p",{className:"text-xs font-black uppercase tracking-wide opacity-75",children:N.label})]},N.label)})})]}),e.jsxs("div",{className:"grid gap-5 xl:grid-cols-[minmax(0,1fr)_360px]",children:[e.jsxs("div",{className:"space-y-5",children:[e.jsx("div",{className:"glass-card p-4",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-xl font-black text-primary",children:"Live Intake Queue"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Accept, snooze, close or reopen client alerts."})]}),e.jsx("div",{className:"flex rounded-2xl border border-primary/15 bg-background/70 p-1",children:[["active","Active"],["history","History"]].map(([N,M])=>e.jsx("button",{onClick:()=>u(N),className:`rounded-xl px-4 py-2 text-xs font-black transition ${y===N?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-primary"}`,children:M},N))})]})}),e.jsxs("div",{className:"grid gap-4",children:[j.map(N=>e.jsx("div",{className:"glass-card p-5",children:e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"font-serif text-xl font-black text-primary",children:N.clientName||"Website Client"}),e.jsx(I,{className:`text-[10px] ${fs(N.status)}`,children:N.status.replace("-"," ")}),Ee(N)>=Number(h.missedAlertAfterSec||45)&&e.jsx(I,{className:"border-orange-500/20 bg-orange-500/10 text-orange-700 text-[10px]",children:"Escalate"})]}),e.jsxs("div",{className:"mt-3 grid gap-2 text-sm text-muted-foreground sm:grid-cols-2 lg:grid-cols-4",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 rounded-xl border border-primary/10 bg-primary/5 px-3 py-2",children:[e.jsx(V,{className:"h-4 w-4 text-primary"})," ",N.language]}),e.jsxs("span",{className:"inline-flex items-center gap-2 rounded-xl border border-primary/10 bg-primary/5 px-3 py-2",children:[e.jsx(X,{className:"h-4 w-4 text-primary"})," ",N.dateOfBirth||"DOB pending"]}),e.jsxs("span",{className:"inline-flex items-center gap-2 rounded-xl border border-primary/10 bg-primary/5 px-3 py-2",children:[e.jsx(ee,{className:"h-4 w-4 text-primary"})," ",N.astrologerName||h.astrologerName]}),e.jsxs("span",{className:"inline-flex items-center gap-2 rounded-xl border border-orange-500/15 bg-orange-500/5 px-3 py-2 text-orange-700",children:[e.jsx(ge,{className:"h-4 w-4"})," ",cs(N.waitingSince)]})]}),e.jsx("p",{className:"mt-4 rounded-2xl border border-primary/10 bg-background/70 p-4 text-sm leading-6 text-muted-foreground",children:N.question||"Client completed language and birth-date intake. Ask the first free question or move them into paid consultation."})]}),e.jsx("div",{className:"grid min-w-[12rem] gap-2",children:ds(N)?e.jsxs(e.Fragment,{children:[e.jsxs(b,{onClick:()=>l(N),className:"bg-emerald-600 font-black text-white hover:bg-emerald-700",children:[e.jsx(F,{className:"mr-2 h-4 w-4"})," Accept Now"]}),e.jsxs(b,{onClick:()=>x(N),variant:"outline",className:"border-sky-500/25 bg-sky-500/5 font-bold text-sky-700",children:[e.jsx(ge,{className:"mr-2 h-4 w-4"})," Snooze"]}),e.jsxs(b,{onClick:()=>p(N),variant:"outline",className:"border-rose-500/25 bg-rose-500/5 font-bold text-rose-700",children:[e.jsx($e,{className:"mr-2 h-4 w-4"})," Close"]})]}):e.jsxs(b,{onClick:()=>A(N),variant:"outline",className:"border-primary/25 font-bold text-primary",children:[e.jsx(Ra,{className:"mr-2 h-4 w-4"})," Reopen"]})})]})},N.id)),j.length===0&&e.jsxs("div",{className:"glass-card p-12 text-center",children:[e.jsx(F,{className:"mx-auto mb-3 h-10 w-10 text-emerald-600"}),e.jsx("h3",{className:"font-serif text-2xl font-black text-primary",children:"No alerts in this view"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Use Create Test Alert or open the chat page to create a real intake alert."}),e.jsxs(b,{onClick:o,className:"mt-5 gold-gradient font-bold text-primary-foreground",children:[e.jsx(je,{className:"mr-2 h-4 w-4"})," Create Test Alert"]})]})]})]}),e.jsxs("aside",{className:"space-y-5",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"mb-4 flex items-center gap-2 font-serif text-xl font-black text-primary",children:[e.jsx(ce,{className:"h-5 w-5"})," Alert Rules"]}),e.jsx("div",{className:"space-y-3",children:ae.map(N=>{const M=N.icon,z=k[N.key];return e.jsx("button",{type:"button",onClick:()=>t(N.key),className:`w-full rounded-2xl border p-3 text-left transition ${z?"border-primary/35 bg-primary/10":"border-primary/10 bg-background/60"}`,children:e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("span",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`grid h-10 w-10 place-items-center rounded-xl ${z?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,children:e.jsx(M,{className:"h-5 w-5"})}),e.jsxs("span",{children:[e.jsx("span",{className:"block text-sm font-black",children:N.title}),e.jsx("span",{className:"block max-w-[14rem] truncate text-xs text-muted-foreground",children:N.desc})]})]}),e.jsx("span",{className:`rounded-full px-2 py-1 text-[10px] font-black ${z?"bg-emerald-500/10 text-emerald-700":"bg-muted text-muted-foreground"}`,children:z?"ON":"OFF"})]})},N.key)})}),e.jsx(T,{href:"/admin/practice",children:e.jsxs(b,{variant:"outline",className:"mt-4 w-full border-primary/25 font-bold text-primary",children:[e.jsx(Ce,{className:"mr-2 h-4 w-4"})," Edit Permanent Rules"]})})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"mb-4 flex items-center gap-2 font-serif text-xl font-black text-primary",children:[e.jsx(ve,{className:"h-5 w-5"})," Routing Matrix"]}),[{label:"Free Question",desc:"Chat intake creates instant Guruji alert",icon:V},{label:"Paid Chat",desc:"Wallet check then connect to live queue",icon:ke},{label:"Call / Video",desc:"Payment token and booking slot required",icon:ya},{label:"Report Order",desc:"Paid form moves to report delivery queue",icon:D}].map(N=>{const M=N.icon;return e.jsxs("div",{className:"flex items-start gap-3 border-b border-primary/10 py-3 last:border-0",children:[e.jsx("span",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-xl bg-primary/10 text-primary",children:e.jsx(M,{className:"h-4 w-4"})}),e.jsxs("span",{children:[e.jsx("span",{className:"block text-sm font-black",children:N.label}),e.jsx("span",{className:"block text-xs leading-5 text-muted-foreground",children:N.desc})]})]},N.label)})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"font-serif text-xl font-black text-primary",children:"Alert Maintenance"}),e.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:"Clear resolved alerts after testing or after Guruji has handled the queue."}),e.jsxs(b,{onClick:r,variant:"outline",className:"mt-4 w-full border-rose-500/25 bg-rose-500/5 font-bold text-rose-700",children:[e.jsx(os,{className:"mr-2 h-4 w-4"})," Clear Resolved"]})]})]})]})]})}function _a({account:i,onSave:c}){const{toast:h}=se(),[l,p]=S.useState(i),[x,A]=S.useState(""),[r,o]=S.useState(""),[n,y]=S.useState("");S.useEffect(()=>{p(i)},[i]);const u=(s,j)=>{p(m=>({...m,[s]:j}))},k=()=>{if(!l.username.trim()||!l.email.trim()||!l.displayName.trim()){h({variant:"destructive",title:"Admin details required",description:"Username, email and display name cannot be empty."});return}c({...i,username:l.username.trim(),email:l.email.trim(),displayName:l.displayName.trim(),phone:l.phone.trim()})},g=()=>{if(x!==i.password){h({variant:"destructive",title:"Current password is wrong",description:"Enter the existing admin password before saving a new one."});return}if(r.length<8){h({variant:"destructive",title:"Use a stronger password",description:"Password must be at least 8 characters."});return}if(r!==n){h({variant:"destructive",title:"Passwords do not match",description:"New password and confirm password must be same."});return}c({...i,...l,password:r}),A(""),o(""),y("")},d=r.length>=12?"Strong":r.length>=8?"Good":"Weak",f=d==="Strong"?"bg-emerald-500/10 text-emerald-700 border-emerald-500/20":d==="Good"?"bg-primary/10 text-primary border-primary/20":"bg-orange-500/10 text-orange-700 border-orange-500/20";return e.jsxs("div",{className:"space-y-6 pb-10",children:[e.jsxs("div",{className:"overflow-hidden rounded-3xl border border-primary/20 bg-gradient-to-br from-primary/12 via-background to-sky-500/10 p-5 md:p-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{children:[e.jsx(I,{className:"mb-3 border-primary/20 bg-primary/10 text-primary",children:"Admin Login Control"}),e.jsx("h1",{className:"font-serif text-3xl font-black text-primary",children:"Username & Password Settings"}),e.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:"Edit admin name, username, email and password used for this Astro Baat admin login."})]}),e.jsxs("div",{className:"rounded-2xl border border-primary/15 bg-background/70 p-4 text-sm",children:[e.jsx("p",{className:"font-black text-primary",children:"Current Login"}),e.jsxs("p",{className:"mt-1 text-muted-foreground",children:["Username: ",e.jsx("span",{className:"font-bold text-foreground",children:i.username})]}),e.jsxs("p",{className:"text-muted-foreground",children:["Email: ",e.jsx("span",{className:"font-bold text-foreground",children:i.email})]})]})]}),e.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-3",children:[{label:"Admin Name",value:i.displayName,icon:va},{label:"Login Username",value:i.username,icon:de},{label:"Access Level",value:"Owner",icon:ve}].map(s=>{const j=s.icon;return e.jsxs("div",{className:"rounded-2xl border border-primary/15 bg-background/70 p-4",children:[e.jsx(j,{className:"mb-2 h-5 w-5 text-primary"}),e.jsx("p",{className:"truncate text-xl font-black text-primary",children:s.value}),e.jsx("p",{className:"text-xs font-bold uppercase tracking-wide text-muted-foreground",children:s.label})]},s.label)})})]}),e.jsxs("div",{className:"grid gap-5 xl:grid-cols-[1fr_420px]",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("div",{className:"mb-5 flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-2xl font-black text-primary",children:"Edit Admin Profile"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"This controls the admin owner identity shown in the dashboard and login account."})]}),e.jsxs(b,{onClick:k,className:"gold-gradient font-black text-primary-foreground",children:[e.jsx(H,{className:"mr-2 h-4 w-4"})," Save Profile"]})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Display Name"}),e.jsx(w,{value:l.displayName,onChange:s=>u("displayName",s.target.value),placeholder:"Practice Owner",className:"h-11 rounded-xl"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Username"}),e.jsx(w,{value:l.username,onChange:s=>u("username",s.target.value),placeholder:"admin",className:"h-11 rounded-xl"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Email"}),e.jsx(w,{type:"email",value:l.email,onChange:s=>u("email",s.target.value),placeholder:"admin@astrobaat.in",className:"h-11 rounded-xl"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Mobile Number"}),e.jsx(w,{value:l.phone,onChange:s=>u("phone",s.target.value),placeholder:"+91 98765 43210",className:"h-11 rounded-xl"})]})]}),e.jsxs("div",{className:"mt-5 rounded-2xl border border-primary/12 bg-primary/5 p-4",children:[e.jsxs("p",{className:"flex items-center gap-2 text-sm font-black text-primary",children:[e.jsx(ve,{className:"h-4 w-4"})," Login Note"]}),e.jsxs("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:["After saving, admin can login using either the username ",e.jsx("span",{className:"font-bold text-foreground",children:l.username||"admin"})," or email ",e.jsx("span",{className:"font-bold text-foreground",children:l.email||"admin@astrobaat.in"}),"."]})]})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("div",{className:"mb-5",children:[e.jsx(I,{className:"mb-3 border-rose-500/20 bg-rose-500/10 text-rose-700",children:"Security"}),e.jsx("h2",{className:"font-serif text-2xl font-black text-primary",children:"Change Password"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Verify the current password before setting a new admin password."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Current Password"}),e.jsx(w,{type:"password",value:x,onChange:s=>A(s.target.value),placeholder:"Enter current password",className:"h-11 rounded-xl"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(v,{children:"New Password"}),e.jsx(I,{className:`text-[10px] ${f}`,children:d})]}),e.jsx(w,{type:"password",value:r,onChange:s=>o(s.target.value),placeholder:"Minimum 8 characters",className:"h-11 rounded-xl"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Confirm New Password"}),e.jsx(w,{type:"password",value:n,onChange:s=>y(s.target.value),placeholder:"Repeat new password",className:"h-11 rounded-xl"})]}),e.jsxs(b,{onClick:g,className:"w-full bg-emerald-600 font-black text-white hover:bg-emerald-700",children:[e.jsx(de,{className:"mr-2 h-4 w-4"})," Update Password"]})]})]})]})]})}function Ka({rows:i,filteredRows:c,filters:h,statuses:l,paidReportAmount:p,onFilterChange:x,onExportFiltered:A,onExportAll:r}){const o=["All","Report Order","Question Queue","Demo"];return e.jsxs("div",{className:"space-y-6 pb-10",children:[e.jsxs("div",{className:"overflow-hidden rounded-3xl border border-primary/20 bg-gradient-to-br from-primary/12 via-background to-orange-500/10 p-5 md:p-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{children:[e.jsx(I,{className:"mb-3 border-orange-500/20 bg-orange-500/10 text-orange-700",children:"Report Operations"}),e.jsx("h1",{className:"font-serif text-3xl font-black text-primary",children:"Reports, Filters & Delivery"}),e.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:"Manage paid report requests, report-like question leads, payment status, delivery SLA and birth-detail records in one admin view."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(b,{onClick:A,variant:"outline",className:"border-primary/25 font-bold text-primary",children:[e.jsx(ne,{className:"mr-2 h-4 w-4"})," Export Filtered"]}),e.jsxs(b,{onClick:r,className:"gold-gradient font-bold text-primary-foreground",children:[e.jsx(Ne,{className:"mr-2 h-4 w-4"})," Export All Data"]})]})]}),e.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[{label:"Total Reports",value:i.length,icon:D,tone:"border-primary/20 bg-primary/8 text-primary"},{label:"Filtered Rows",value:c.length,icon:ba,tone:"border-sky-500/20 bg-sky-500/8 text-sky-700"},{label:"Paid Value",value:$(p),icon:Y,tone:"border-emerald-500/20 bg-emerald-500/8 text-emerald-700"},{label:"Report Sources",value:new Set(i.map(n=>n.source)).size,icon:Ne,tone:"border-orange-500/20 bg-orange-500/8 text-orange-700"}].map(n=>{const y=n.icon;return e.jsxs("div",{className:`rounded-2xl border p-4 ${n.tone}`,children:[e.jsx(y,{className:"mb-2 h-5 w-5"}),e.jsx("p",{className:"text-2xl font-black",children:n.value}),e.jsx("p",{className:"text-xs font-bold uppercase tracking-wide opacity-75",children:n.label})]},n.label)})})]}),e.jsx("div",{className:"glass-card p-4",children:e.jsxs("div",{className:"grid gap-3 lg:grid-cols-[1fr_220px_220px]",children:[e.jsxs("label",{className:"relative block",children:[e.jsx(Ae,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-primary"}),e.jsx("input",{value:h.search,onChange:n=>x(y=>({...y,search:n.target.value})),placeholder:"Search ID, client, phone, report, payment...",className:"h-11 w-full rounded-xl border border-primary/15 bg-background pl-10 pr-3 text-sm outline-none focus:border-primary"})]}),e.jsx("select",{value:h.status,onChange:n=>x(y=>({...y,status:n.target.value})),className:"h-11 rounded-xl border border-primary/15 bg-background px-3 text-sm outline-none focus:border-primary",children:l.map(n=>e.jsx("option",{children:n},n))}),e.jsx("select",{value:h.source,onChange:n=>x(y=>({...y,source:n.target.value})),className:"h-11 rounded-xl border border-primary/15 bg-background px-3 text-sm outline-none focus:border-primary",children:o.map(n=>e.jsx("option",{children:n},n))})]})}),e.jsxs("div",{className:"grid gap-4",children:[c.map(n=>e.jsx("div",{className:"glass-card p-5",children:e.jsxs("div",{className:"flex flex-col gap-4 xl:flex-row xl:items-center xl:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[e.jsx("h3",{className:"font-serif text-xl font-black text-primary",children:n.reportName}),e.jsx(I,{className:"border-primary/20 bg-primary/10 text-primary text-[10px]",children:n.source}),e.jsxs(I,{className:"border-orange-500/20 bg-orange-500/10 text-orange-700 text-[10px]",children:["Due ",n.dueLabel]})]}),e.jsxs("p",{className:"text-sm font-bold",children:[n.clientName," ",e.jsxs("span",{className:"font-normal text-muted-foreground",children:["- ",n.phone||"phone not added"]})]}),e.jsx("p",{className:"mt-2 line-clamp-2 text-sm leading-6 text-muted-foreground",children:n.summary||"Report request details are connected to the admin delivery queue."}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-2 text-[11px] text-muted-foreground",children:[["ID",n.id],["Birth Date",n.birthDate],["Birth Time",n.birthTime],["Birth Place",n.birthPlace],["Created",n.createdAt?new Date(n.createdAt).toLocaleDateString("en-IN"):""]].filter(([,y])=>!!y).map(([y,u])=>e.jsxs("span",{className:"rounded-full border border-primary/10 bg-primary/5 px-3 py-1",children:[y,": ",u]},y))})]}),e.jsxs("div",{className:"grid gap-2 sm:min-w-[230px]",children:[e.jsxs("div",{className:"rounded-2xl border border-primary/15 bg-background/75 p-3",children:[e.jsx("p",{className:"text-xs font-bold text-muted-foreground",children:"Amount"}),e.jsx("p",{className:"text-xl font-black text-primary",children:$(n.amount)}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[n.paymentStatus," - ",n.status]})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[e.jsx(b,{size:"sm",variant:"outline",className:"border-primary/25 text-primary",children:"Open"}),e.jsx(b,{size:"sm",className:"bg-emerald-600 text-white hover:bg-emerald-700",children:"Delivered"})]})]})]})},n.id)),c.length===0&&e.jsxs("div",{className:"glass-card p-12 text-center",children:[e.jsx(D,{className:"mx-auto mb-3 h-10 w-10 text-primary"}),e.jsx("h3",{className:"font-serif text-2xl font-black text-primary",children:"No reports match this filter"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Change search, status or source to see more records."})]})]})]})}function Wa({settings:i,stats:c,bookings:h,users:l,astrologers:p,questions:x,reports:A,products:r,alerts:o,trackItems:n,onExportAll:y,onExportReports:u}){const k=[{label:"Bookings",value:h.length,desc:"Client, astrologer, mode, slot, amount and status.",icon:X},{label:"Reports",value:A.length,desc:"Paid report orders, delivery status and birth details.",icon:D},{label:"Clients",value:l.filter(g=>g.role==="client").length,desc:"Customer identity and contact records.",icon:Z},{label:"Team",value:p.length||1,desc:"Astrologer/team records and online state.",icon:qe},{label:"Questions",value:x.length,desc:"Paid questions, pending answers and report leads.",icon:me},{label:"Store",value:r.length,desc:"Images, pricing, stock and product visibility.",icon:Q},{label:"Alerts",value:o.length,desc:"Live chat intake, accepted chats and wait status.",icon:q},{label:"Tracking",value:n.length,desc:"Report, puja, booking and store tracking records.",icon:Ne}];return e.jsxs("div",{className:"space-y-6 pb-10",children:[e.jsxs("div",{className:"overflow-hidden rounded-3xl border border-primary/20 bg-gradient-to-br from-primary/12 via-background to-emerald-500/10 p-5 md:p-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{children:[e.jsx(I,{className:"mb-3 border-primary/20 bg-primary/10 text-primary",children:"Admin Export Center"}),e.jsx("h1",{className:"font-serif text-3xl font-black text-primary",children:"Download Complete Business Data"}),e.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:"Create a full JSON backup of the connected admin backend data, local order tracking, products, alerts, settings and report delivery records."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(b,{onClick:u,variant:"outline",className:"border-primary/25 font-bold text-primary",children:[e.jsx(ne,{className:"mr-2 h-4 w-4"})," Reports CSV"]}),e.jsxs(b,{onClick:y,className:"gold-gradient min-h-11 font-black text-primary-foreground",children:[e.jsx(Ne,{className:"mr-2 h-4 w-4"})," Download All Data"]})]})]}),e.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:k.slice(0,4).map(g=>{const d=g.icon;return e.jsxs("div",{className:"rounded-2xl border border-primary/15 bg-background/70 p-4",children:[e.jsx(d,{className:"mb-2 h-5 w-5 text-primary"}),e.jsx("p",{className:"text-3xl font-black text-primary",children:g.value}),e.jsx("p",{className:"text-xs font-bold uppercase tracking-wide text-muted-foreground",children:g.label})]},g.label)})})]}),e.jsxs("div",{className:"grid gap-5 lg:grid-cols-[1fr_360px]",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h2",{className:"mb-4 font-serif text-2xl font-black text-primary",children:"Export Includes"}),e.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:k.map(g=>{const d=g.icon;return e.jsxs("div",{className:"rounded-2xl border border-primary/12 bg-primary/5 p-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"grid h-10 w-10 place-items-center rounded-xl bg-primary/10 text-primary",children:e.jsx(d,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-bold text-primary",children:g.label}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[g.value," records"]})]})]}),e.jsx("p",{className:"mt-3 text-sm leading-6 text-muted-foreground",children:g.desc})]},g.label)})})]}),e.jsxs("aside",{className:"space-y-4",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"font-serif text-xl font-black text-primary",children:"Business Snapshot"}),e.jsx("div",{className:"mt-4 space-y-3 text-sm",children:[["Business",i.businessName],["Guruji",i.astrologerName],["Razorpay Key",i.razorpayKeyId],["Payment Mode",i.paymentMode],["Revenue",$(c?.totalRevenue||0)]].map(([g,d])=>e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl border border-primary/10 bg-background/70 px-3 py-2",children:[e.jsx("span",{className:"text-muted-foreground",children:g}),e.jsx("span",{className:"max-w-[12rem] truncate font-bold text-primary",children:d})]},g))})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"font-serif text-xl font-black text-primary",children:"Connected Admin Pages"}),e.jsx("div",{className:"mt-4 grid gap-2",children:[{href:"/admin/reports",label:"Report Filters",icon:D},{href:"/admin/products",label:"Store Products",icon:Q},{href:"/admin/practice",label:"Practice Setup",icon:Ce}].map(g=>{const d=g.icon;return e.jsx(T,{href:g.href,children:e.jsxs(b,{variant:"outline",className:"w-full justify-start border-primary/20 text-primary",children:[e.jsx(d,{className:"mr-2 h-4 w-4"})," ",g.label]})},g.href)})})]})]})]})]})}function Ua({products:i,editingProductId:c,productSearch:h,onSearchChange:l,onSelectProduct:p,onChangeProduct:x,onAddProduct:A,onRemoveProduct:r,onSaveProducts:o}){const n=i.find(m=>m.id===c)||i[0],y=h.trim().toLowerCase(),u=i.filter(m=>{const t=`${m.name} ${m.category} ${m.purpose} ${m.description}`.toLowerCase();return!y||t.includes(y)}),k=i.filter(m=>m.isActive!==!1).length,g=i.length-k,d=i.filter(m=>m.stock==="Out of Stock").length,f=i.reduce((m,t)=>m+Number(t.salePrice||0),0),s=m=>{if(!m||!n)return;const t=new FileReader;t.onload=()=>x(n.id,{image:String(t.result||n.image)}),t.readAsDataURL(m)};if(!n)return e.jsxs("div",{className:"glass-card p-10 text-center",children:[e.jsx(Q,{className:"mx-auto mb-3 h-10 w-10 text-primary"}),e.jsx("h1",{className:"font-serif text-2xl font-bold text-primary",children:"Store Product Manager"}),e.jsx("p",{className:"mt-2 text-sm text-muted-foreground",children:"Add products, prices and images to start selling remedies."}),e.jsxs(b,{onClick:A,className:"mt-5 gold-gradient font-bold text-primary-foreground",children:[e.jsx(fe,{className:"mr-2 h-4 w-4"})," Add Product"]})]});const j=n.isActive!==!1;return e.jsxs("div",{className:"space-y-6 pb-10",children:[e.jsxs("div",{className:"overflow-hidden rounded-3xl border border-primary/20 bg-gradient-to-br from-primary/10 via-background to-amber-500/10 p-5",children:[e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between",children:[e.jsxs("div",{children:[e.jsx(I,{className:"mb-3 border-primary/20 bg-primary/10 text-primary",children:"Admin Commerce Control"}),e.jsx("h1",{className:"font-serif text-3xl font-black text-primary",children:"Store Product Manager"}),e.jsx("p",{className:"mt-2 max-w-2xl text-sm leading-6 text-muted-foreground",children:"Manage live product catalog, photos, prices, stock status and customer visibility from one admin screen."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(T,{href:"/products",children:e.jsxs(b,{variant:"outline",className:"border-primary/25 font-bold text-primary",children:[e.jsx(le,{className:"mr-2 h-4 w-4"})," View Store"]})}),e.jsxs(b,{onClick:A,variant:"outline",className:"border-primary/25 font-bold text-primary",children:[e.jsx(fe,{className:"mr-2 h-4 w-4"})," Add Product"]}),e.jsxs(b,{onClick:o,className:"gold-gradient font-bold text-primary-foreground",children:[e.jsx(H,{className:"mr-2 h-4 w-4"})," Save Catalog"]})]})]}),e.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[{label:"Live Products",value:k,icon:le,color:"border-emerald-500/20 bg-emerald-500/8 text-emerald-700"},{label:"Hidden",value:g,icon:be,color:"border-orange-500/20 bg-orange-500/8 text-orange-700"},{label:"Out of Stock",value:d,icon:$e,color:"border-rose-500/20 bg-rose-500/8 text-rose-700"},{label:"Catalog Value",value:$(f),icon:Y,color:"border-primary/20 bg-primary/8 text-primary"}].map(m=>{const t=m.icon;return e.jsxs("div",{className:`rounded-2xl border p-4 ${m.color}`,children:[e.jsx(t,{className:"mb-2 h-5 w-5"}),e.jsx("p",{className:"text-2xl font-black",children:m.value}),e.jsx("p",{className:"text-xs font-bold opacity-75",children:m.label})]},m.label)})})]}),e.jsxs("div",{className:"grid gap-5 xl:grid-cols-[360px_1fr]",children:[e.jsxs("div",{className:"glass-card p-4",children:[e.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[e.jsx("h2",{className:"font-serif text-lg font-bold text-primary",children:"Catalog List"}),e.jsx(I,{className:"border-primary/20 bg-primary/10 text-primary",children:u.length})]}),e.jsxs("label",{className:"relative mb-4 block",children:[e.jsx(Ae,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-primary"}),e.jsx("input",{value:h,onChange:m=>l(m.target.value),placeholder:"Search product, category, remedy...",className:"h-11 w-full rounded-xl border border-primary/15 bg-background pl-10 pr-3 text-sm outline-none focus:border-primary"})]}),e.jsx("div",{className:"max-h-[690px] space-y-2 overflow-y-auto pr-1",children:u.map(m=>e.jsx("button",{type:"button",onClick:()=>p(m.id),className:`w-full rounded-2xl border p-3 text-left transition ${n.id===m.id?"border-primary/45 bg-primary/10":"border-primary/10 bg-background/70 hover:border-primary/30"}`,children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx("img",{src:m.image,alt:m.name,className:"h-14 w-14 rounded-xl border border-primary/10 object-cover"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"truncate text-sm font-bold",children:m.name}),m.isActive===!1&&e.jsx(be,{className:"h-3.5 w-3.5 text-orange-600"})]}),e.jsxs("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:[m.category," - ",$(m.salePrice)]}),e.jsx("p",{className:"mt-1 line-clamp-1 text-[11px] text-muted-foreground",children:m.purpose})]})]})},m.id))})]}),e.jsx("div",{className:"glass-card overflow-hidden",children:e.jsxs("div",{className:"grid lg:grid-cols-[340px_1fr]",children:[e.jsxs("div",{className:"border-b border-primary/10 bg-primary/5 p-5 lg:border-b-0 lg:border-r",children:[e.jsxs("div",{className:"relative overflow-hidden rounded-3xl border border-primary/20 bg-card",children:[e.jsx("img",{src:n.image,alt:n.name,className:"h-80 w-full object-cover"}),e.jsxs("div",{className:"absolute left-4 top-4 flex flex-wrap gap-2",children:[e.jsx(I,{className:j?"border-emerald-500/20 bg-emerald-500/10 text-emerald-700":"border-orange-500/20 bg-orange-500/10 text-orange-700",children:j?"Live":"Hidden"}),e.jsx(I,{className:"border-primary/20 bg-background/80 text-primary",children:n.stock})]})]}),e.jsxs("div",{className:"mt-4 grid gap-2",children:[e.jsx("input",{id:`admin-product-image-${n.id}`,type:"file",accept:"image/*",className:"hidden",onChange:m=>s(m.target.files?.[0])}),e.jsxs("label",{htmlFor:`admin-product-image-${n.id}`,className:"inline-flex min-h-11 cursor-pointer items-center justify-center gap-2 rounded-2xl border border-primary/25 bg-background/80 px-4 text-sm font-bold text-primary transition hover:bg-primary/5",children:[e.jsx(Be,{className:"h-4 w-4"})," Upload Image"]}),e.jsxs(b,{type:"button",variant:"outline",onClick:()=>x(n.id,{isActive:!j}),className:j?"rounded-2xl border-orange-500/25 bg-orange-500/5 text-orange-700":"rounded-2xl border-emerald-500/25 bg-emerald-500/5 text-emerald-700",children:[j?e.jsx(be,{className:"mr-2 h-4 w-4"}):e.jsx(le,{className:"mr-2 h-4 w-4"}),j?"Turn Off Product":"Turn On Product"]}),e.jsxs(b,{type:"button",variant:"outline",onClick:()=>r(n.id),className:"rounded-2xl border-red-500/25 bg-red-500/5 text-red-700",children:[e.jsx(os,{className:"mr-2 h-4 w-4"})," ",n.id.startsWith("admin-product-")||n.id.startsWith("custom-product-")?"Delete Product":"Hide Product"]})]}),e.jsxs("div",{className:"mt-4 rounded-2xl border border-primary/12 bg-background/70 p-4",children:[e.jsxs("p",{className:"flex items-center gap-2 text-sm font-bold text-primary",children:[e.jsx(we,{className:"h-4 w-4"})," Publishing Note"]}),e.jsx("p",{className:"mt-2 text-xs leading-5 text-muted-foreground",children:"Save catalog after edits. The store page and sticky cart will read the updated product image, price and visibility."})]})]}),e.jsxs("div",{className:"p-5",children:[e.jsxs("div",{className:"mb-5 flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-2xl font-black text-primary",children:"Edit Product"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Set original photo, name, price, stock, recommendation and remedy details."})]}),e.jsx(I,{className:"w-fit border-primary/20 bg-primary/10 text-primary",children:n.category})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(U,{label:"Product Name",value:n.name,onChange:m=>x(n.id,{name:m})}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Category"}),e.jsx("select",{value:n.category,onChange:m=>x(n.id,{category:m.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-background px-3 text-sm outline-none focus:border-primary",children:La.map(m=>e.jsx("option",{children:m},m))})]}),e.jsx(U,{label:"Regular Price",type:"number",value:n.price,onChange:m=>x(n.id,{price:Number(m||0)})}),e.jsx(U,{label:"Sale Price",type:"number",value:n.salePrice,onChange:m=>x(n.id,{salePrice:Number(m||0)})}),e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:"Stock"}),e.jsx("select",{value:n.stock,onChange:m=>x(n.id,{stock:m.target.value}),className:"h-11 w-full rounded-xl border border-primary/15 bg-background px-3 text-sm outline-none focus:border-primary",children:["In Stock","Limited Stock","Out of Stock"].map(m=>e.jsx("option",{children:m},m))})]}),e.jsx(U,{label:"Image URL",value:n.image,onChange:m=>x(n.id,{image:m})}),e.jsx(U,{label:"Planet",value:n.planet||"",placeholder:"Sun, Saturn, Rahu...",onChange:m=>x(n.id,{planet:m})}),e.jsx(U,{label:"Zodiac",value:n.zodiac||"",placeholder:"Leo, All Signs...",onChange:m=>x(n.id,{zodiac:m})}),e.jsx(U,{label:"Purpose",value:n.purpose,onChange:m=>x(n.id,{purpose:m})}),e.jsx(U,{label:"Recommended For",value:n.recommendedFor,onChange:m=>x(n.id,{recommendedFor:m})}),e.jsxs("label",{className:"space-y-1.5 text-sm md:col-span-2",children:[e.jsx("span",{className:"font-bold",children:"Description"}),e.jsx("textarea",{value:n.description,onChange:m=>x(n.id,{description:m.target.value}),rows:4,className:"w-full resize-none rounded-xl border border-primary/15 bg-background px-3 py-3 text-sm outline-none focus:border-primary"})]})]}),e.jsx("div",{className:"mt-5 rounded-2xl border border-amber-500/20 bg-amber-500/8 p-4",children:e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-serif text-lg font-bold text-primary",children:n.name}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[$(n.salePrice)," - ",n.stock," - ",j?"Live":"Hidden"]})]}),e.jsxs(b,{onClick:o,className:"gold-gradient min-h-11 font-bold text-primary-foreground",children:[e.jsx(H,{className:"mr-2 h-4 w-4"})," Save Product"]})]})})]})]})})]})]})}function U({label:i,value:c,onChange:h,type:l="text",placeholder:p}){return e.jsxs("label",{className:"space-y-1.5 text-sm",children:[e.jsx("span",{className:"font-bold",children:i}),e.jsx("input",{type:l,value:c,placeholder:p,onChange:x=>h(x.target.value),className:"h-11 w-full rounded-xl border border-primary/15 bg-background px-3 text-sm outline-none focus:border-primary"})]})}function Va(i){return new Promise((c,h)=>{const l=new FileReader;l.onload=()=>c(String(l.result||"")),l.onerror=()=>h(l.error),l.readAsDataURL(i)})}function Qa({settings:i,size:c="lg"}){const h=c==="lg"?"h-24 w-24 rounded-[1.75rem] text-2xl":"h-14 w-14 rounded-2xl text-lg";return i.logoImage?e.jsx("img",{src:i.logoImage,alt:i.businessName,className:`${h} border border-white/35 object-contain bg-white/90 p-2 shadow-xl`}):e.jsx("div",{className:`${h} grid place-items-center border border-white/35 bg-white/20 font-serif font-black text-white shadow-xl`,children:i.logoText||"AB"})}function Ha({settings:i,onSave:c}){const{toast:h}=se(),[l,p]=S.useState(i);S.useEffect(()=>p(i),[i]);const x=(o,n)=>{p(y=>({...y,[o]:n}))},A=async o=>{if(!o)return;if(!o.type.startsWith("image/")){h({variant:"destructive",title:"Please upload an image logo"});return}if(o.size>9e5){h({variant:"destructive",title:"Logo image is too large",description:"Use a compressed PNG/JPG/WebP under 900 KB for static hosting."});return}const n=await Va(o);x("logoImage",n),h({title:"Logo uploaded",description:"Save settings to publish this logo across the website."})},r=[{key:"primaryColor",label:"Primary Gold"},{key:"accentColor",label:"Accent / Maroon"},{key:"goldColor",label:"Glow Gold"},{key:"backgroundColor",label:"Page Background"},{key:"surfaceColor",label:"Card Surface"},{key:"textColor",label:"Text Color"}];return e.jsxs("div",{className:"space-y-6 pb-10",children:[e.jsx("div",{className:"overflow-hidden rounded-3xl border border-primary/20 bg-gradient-to-br from-primary/14 via-background to-rose-500/8 p-5 md:p-6",children:e.jsxs("div",{className:"flex flex-col gap-5 xl:flex-row xl:items-start xl:justify-between",children:[e.jsxs("div",{children:[e.jsx(I,{className:"mb-3 border-primary/20 bg-primary/10 text-primary",children:"Theme Settings"}),e.jsx("h1",{className:"font-serif text-3xl font-black text-primary",children:"Customize Website Branding"}),e.jsx("p",{className:"mt-2 max-w-3xl text-sm leading-6 text-muted-foreground",children:"Change logo image, website name, Guruji name, contact details, address and colors. Saved changes replace Astro Baat branding across the website."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(b,{onClick:()=>c(l),className:"gold-gradient font-black text-primary-foreground",children:[e.jsx(H,{className:"mr-2 h-4 w-4"})," Save Theme"]}),e.jsx(T,{href:"/",children:e.jsxs(b,{variant:"outline",className:"border-primary/25 font-bold text-primary",children:[e.jsx(le,{className:"mr-2 h-4 w-4"})," View Site"]})})]})]})}),e.jsxs("div",{className:"grid gap-6 xl:grid-cols-[minmax(0,1fr)_380px]",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"glass-card p-5 md:p-6",children:[e.jsxs("h2",{className:"mb-4 flex items-center gap-2 font-serif text-xl font-black text-primary",children:[e.jsx(Be,{className:"h-5 w-5"})," Logo & Website Identity"]}),e.jsxs("div",{className:"grid gap-5 md:grid-cols-[220px_1fr]",children:[e.jsxs("div",{className:"rounded-3xl border border-primary/15 bg-primary/5 p-4 text-center",children:[e.jsx("div",{className:"mx-auto mb-4 grid h-32 w-32 place-items-center rounded-[2rem] border border-primary/20 bg-card shadow-sm",children:l.logoImage?e.jsx("img",{src:l.logoImage,alt:l.businessName,className:"max-h-24 max-w-24 object-contain"}):e.jsx("span",{className:"grid h-20 w-20 place-items-center rounded-3xl bg-primary text-2xl font-serif font-black text-primary-foreground",children:l.logoText||"AB"})}),e.jsxs("label",{className:"block",children:[e.jsx("input",{type:"file",accept:"image/*",className:"sr-only",onChange:o=>A(o.target.files?.[0])}),e.jsxs("span",{className:"inline-flex h-10 cursor-pointer items-center justify-center rounded-2xl border border-primary/25 bg-background px-4 text-xs font-black text-primary",children:[e.jsx(fa,{className:"mr-2 h-4 w-4"})," Upload Logo"]})]}),l.logoImage&&e.jsx("button",{type:"button",onClick:()=>x("logoImage",""),className:"mt-3 text-xs font-bold text-rose-700 hover:underline",children:"Remove image logo"})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(L,{label:"Website / Company Name",value:l.businessName,onChange:o=>x("businessName",o),placeholder:"Your astrology brand"}),e.jsx(L,{label:"Guruji / Astrologer Name",value:l.astrologerName,onChange:o=>x("astrologerName",o),placeholder:"Acharya name"}),e.jsx(L,{label:"Logo Text Fallback",value:l.logoText,onChange:o=>x("logoText",o.toUpperCase().slice(0,4)),placeholder:"AB"}),e.jsx(L,{label:"Client Welcome Message",value:l.welcomeMessage,onChange:o=>x("welcomeMessage",o)}),e.jsxs("label",{className:"space-y-1.5 text-sm md:col-span-2",children:[e.jsx("span",{className:"font-bold",children:"Footer / About Note"}),e.jsx("textarea",{value:l.footerNote,onChange:o=>x("footerNote",o.target.value),rows:3,className:"w-full rounded-xl border border-primary/15 bg-card px-3 py-3 text-sm outline-none focus:border-primary"})]})]})]})]}),e.jsxs("div",{className:"glass-card p-5 md:p-6",children:[e.jsxs("h2",{className:"mb-4 flex items-center gap-2 font-serif text-xl font-black text-primary",children:[e.jsx(Ge,{className:"h-5 w-5"})," Website Color Control"]}),e.jsx("div",{className:"grid gap-4 sm:grid-cols-2 xl:grid-cols-3",children:r.map(o=>e.jsxs("label",{className:"space-y-2 rounded-2xl border border-primary/12 bg-card/70 p-4 text-sm",children:[e.jsx("span",{className:"font-black",children:o.label}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(w,{type:"color",value:String(l[o.key]),onChange:n=>x(o.key,n.target.value),className:"h-11 w-14 shrink-0 rounded-xl p-1"}),e.jsx(w,{value:String(l[o.key]),onChange:n=>x(o.key,n.target.value),className:"h-11 rounded-xl font-mono text-xs"})]})]},o.key))}),e.jsx("div",{className:"mt-5 grid gap-3 sm:grid-cols-3",children:[["Classic Gold","#D4AF37","#7A0610","#FFF8E8"],["Royal Purple","#A855F7","#4C1D95","#F7F1FF"],["Temple Saffron","#F59E0B","#9A3412","#FFF7ED"]].map(([o,n,y,u])=>e.jsxs("button",{type:"button",onClick:()=>p(k=>({...k,primaryColor:n,accentColor:y,goldColor:n,backgroundColor:u})),className:"rounded-2xl border border-primary/15 bg-background p-3 text-left text-xs font-black transition hover:border-primary/35",children:[e.jsx("span",{className:"mb-2 flex gap-1",children:[n,y,u].map(k=>e.jsx("span",{className:"h-6 flex-1 rounded-lg border",style:{backgroundColor:k}},k))}),o]},o))})]}),e.jsxs("div",{className:"glass-card p-5 md:p-6",children:[e.jsxs("h2",{className:"mb-4 flex items-center gap-2 font-serif text-xl font-black text-primary",children:[e.jsx(ze,{className:"h-5 w-5"})," Contact Details & Address"]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsx(L,{label:"WhatsApp Number",value:l.whatsapp,onChange:o=>x("whatsapp",o),placeholder:"+91 98765 43210"}),e.jsx(L,{label:"Mobile Number",value:l.mobileNumber,onChange:o=>x("mobileNumber",o),placeholder:"+91 98765 43210"}),e.jsx(L,{label:"Support Phone",value:l.supportPhone,onChange:o=>x("supportPhone",o),placeholder:"+91 98765 43210"}),e.jsx(L,{label:"Email",value:l.email,onChange:o=>x("email",o),placeholder:"support@example.com"}),e.jsx(L,{label:"Business Address",value:l.businessAddress,onChange:o=>x("businessAddress",o),placeholder:"Office / temple address"}),e.jsx(L,{label:"City",value:l.city,onChange:o=>x("city",o),placeholder:"City"}),e.jsx(L,{label:"State",value:l.state,onChange:o=>x("state",o),placeholder:"State"}),e.jsx(L,{label:"Pincode",value:l.pincode,onChange:o=>x("pincode",o),placeholder:"302001"}),e.jsx(L,{label:"Working Hours",value:l.workingHours,onChange:o=>x("workingHours",o),placeholder:"09:00 - 22:00"}),e.jsx(L,{label:"Timezone",value:l.timezone,onChange:o=>x("timezone",o),placeholder:"Asia/Kolkata"})]})]})]}),e.jsxs("aside",{className:"space-y-5 xl:sticky xl:top-24 xl:h-fit",children:[e.jsxs("div",{className:"glass-card overflow-hidden",children:[e.jsxs("div",{className:"p-5 text-white",style:{background:`radial-gradient(circle at 12% 8%, rgba(255,255,255,.22), transparent 28%), linear-gradient(135deg, ${l.accentColor}, ${l.primaryColor})`},children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(Qa,{settings:l}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] font-black uppercase tracking-[0.22em] text-white/70",children:"Live Brand Preview"}),e.jsx("h3",{className:"truncate font-serif text-2xl font-black",children:l.businessName||"Website Name"}),e.jsx("p",{className:"truncate text-sm text-white/78",children:l.astrologerName||"Guruji Name"})]})]}),e.jsx("p",{className:"mt-6 text-sm leading-6 text-white/88",children:l.welcomeMessage})]}),e.jsxs("div",{className:"space-y-3 p-5 text-sm",children:[e.jsxs("div",{className:"rounded-2xl border border-primary/12 bg-primary/5 p-3",children:[e.jsx("p",{className:"text-xs font-black uppercase tracking-wide text-muted-foreground",children:"Header Name"}),e.jsx("p",{className:"font-serif text-xl font-black text-primary",children:l.businessName})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsxs("div",{className:"rounded-xl border border-primary/12 p-3",children:[e.jsx("b",{className:"block text-primary",children:"Phone"}),l.mobileNumber]}),e.jsxs("div",{className:"rounded-xl border border-primary/12 p-3",children:[e.jsx("b",{className:"block text-primary",children:"WhatsApp"}),l.whatsapp]}),e.jsxs("div",{className:"col-span-2 rounded-xl border border-primary/12 p-3",children:[e.jsx("b",{className:"block text-primary",children:"Email"}),l.email]}),e.jsxs("div",{className:"col-span-2 rounded-xl border border-primary/12 p-3",children:[e.jsx("b",{className:"block text-primary",children:"Address"}),l.businessAddress,", ",l.city]})]}),e.jsxs(b,{onClick:()=>c(l),className:"gold-gradient h-11 w-full font-black text-primary-foreground",children:[e.jsx(H,{className:"mr-2 h-4 w-4"})," Publish Branding"]})]})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"font-serif text-lg font-black text-primary",children:"Where This Applies"}),e.jsx("div",{className:"mt-3 grid gap-2 text-sm",children:["Header logo","Mobile menu","Footer contact","Payment popup","Guruji profile","Export data","Client welcome text"].map(o=>e.jsxs("div",{className:"flex items-center gap-2 rounded-xl border border-primary/10 bg-background/70 px-3 py-2",children:[e.jsx(F,{className:"h-4 w-4 text-emerald-600"})," ",o]},o))})]})]})]})]})}function Ja({settings:i,stats:c,bookings:h,users:l,questions:p,onSaveSettings:x}){const{toast:A}=se(),[r,o]=S.useState(i);S.useEffect(()=>o(i),[i]);const n=["Paid Question","Wallet Chat","Phone Call","Video Call","Puja Booking","PDF Reports","Spiritual Store","Calculators","Track Booking","Dakshina","Live Chat Accept","Wallet Recharge"],y=["Full Kundli","Marriage Compatibility","Career Report","Business Report","Numerology Report","Yearly Horoscope","Gemstone Report","Vastu Report","Love Report","Health Report","Child Birth Report","Palm Reading Report"],u=(s,j)=>o(m=>({...m,[s]:j})),k=(s,j)=>{o(m=>{const t=m[s]||[];return{...m,[s]:t.includes(j)?t.filter(P=>P!==j):[...t,j]}})},g=()=>{x(r),A({title:"Practice settings saved",description:"Branding, Razorpay and content settings are ready for bookings."})},d=[{label:"Total Orders",value:h.length||(c?.totalBookings??0),icon:Sa,color:"text-sky-600 bg-sky-500/10 border-sky-500/25"},{label:"Total Revenue",value:`₹${c?.totalRevenue||0}`,icon:Y,color:"text-primary bg-primary/10 border-primary/25"},{label:"Pending Reports",value:p.filter(s=>s.status==="pending").length,icon:D,color:"text-orange-600 bg-orange-500/10 border-orange-500/25"},{label:"Clients",value:l.filter(s=>s.role==="client").length,icon:Z,color:"text-emerald-600 bg-emerald-500/10 border-emerald-500/25"}],f=[{label:"Live Chat",value:r.liveChatStatus,desc:r.chatAcceptMode,icon:V,color:"border-emerald-500/25 bg-emerald-500/5 text-emerald-700"},{label:"Alert SLA",value:`${r.missedAlertAfterSec||45}s`,desc:r.autoAssignGuruji==="On"?"Auto assign enabled":"Manual assignment",icon:xs,color:"border-rose-500/25 bg-rose-500/5 text-rose-700"},{label:"Reports SLA",value:`${r.reportDeliveryDays||3} days`,desc:"Kundli and PDF delivery control",icon:D,color:"border-orange-500/25 bg-orange-500/5 text-orange-700"},{label:"Wallet Rule",value:`₹${r.walletMinRecharge||0}+`,desc:"Minimum client recharge",icon:ke,color:"border-primary/25 bg-primary/5 text-primary"},{label:"Gateway",value:r.paymentMode,desc:r.razorpayKeyId,icon:ye,color:"border-sky-500/25 bg-sky-500/5 text-sky-700"}];return e.jsxs("div",{className:"space-y-6 pb-10",children:[e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-serif font-bold text-primary",children:"Astrologer Admin Setup"}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Control business name, logo text, colors, Razorpay keys, content, services and report offerings."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(T,{href:"/",children:e.jsxs(b,{variant:"outline",className:"border-primary/30 gap-2",children:[e.jsx(Be,{className:"w-4 h-4"})," View Site"]})}),e.jsxs(b,{onClick:g,className:"gold-gradient text-primary-foreground font-bold gap-2",children:[e.jsx(H,{className:"w-4 h-4"})," Save Settings"]})]})]}),e.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4 gap-4",children:d.map(s=>{const j=s.icon;return e.jsxs("div",{className:`rounded-xl border p-4 ${s.color}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s.label}),e.jsx(j,{className:"w-4 h-4"})]}),e.jsx("p",{className:"mt-2 text-2xl font-bold",children:s.value})]},s.label)})}),e.jsx("div",{className:"grid md:grid-cols-2 xl:grid-cols-5 gap-4",children:f.map(s=>{const j=s.icon;return e.jsxs("div",{className:`rounded-2xl border p-4 ${s.color}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"grid h-10 w-10 place-items-center rounded-xl bg-background/80 shadow-sm",children:e.jsx(j,{className:"w-5 h-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s.label}),e.jsx("p",{className:"font-serif font-bold truncate",children:s.value})]})]}),e.jsx("p",{className:"mt-3 text-xs text-muted-foreground line-clamp-2",children:s.desc})]},s.label)})}),e.jsxs("div",{className:"grid xl:grid-cols-[1fr_360px] gap-6",children:[e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"glass-card p-6",children:[e.jsxs("h2",{className:"font-serif font-bold text-lg text-primary mb-4 flex items-center gap-2",children:[e.jsx(Ge,{className:"w-5 h-5"})," Branding"]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Business Name"}),e.jsx(w,{value:r.businessName,onChange:s=>u("businessName",s.target.value),placeholder:"Your astrology brand"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Astrologer Name"}),e.jsx(w,{value:r.astrologerName,onChange:s=>u("astrologerName",s.target.value),placeholder:"Acharya / Pandit name"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Logo Text"}),e.jsx(w,{value:r.logoText,maxLength:4,onChange:s=>u("logoText",s.target.value.toUpperCase()),placeholder:"AP"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"WhatsApp Number"}),e.jsx(w,{value:r.whatsapp,onChange:s=>u("whatsapp",s.target.value),placeholder:"+91 98765 43210"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Mobile Number"}),e.jsx(w,{value:r.mobileNumber,onChange:s=>u("mobileNumber",s.target.value),placeholder:"+91 98765 43210"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Support Phone"}),e.jsx(w,{value:r.supportPhone,onChange:s=>u("supportPhone",s.target.value),placeholder:"+91 98765 43210"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Email"}),e.jsx(w,{value:r.email,onChange:s=>u("email",s.target.value),placeholder:"support@example.com"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Business Address"}),e.jsx(w,{value:r.businessAddress,onChange:s=>u("businessAddress",s.target.value),placeholder:"City, State"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Timezone"}),e.jsx(w,{value:r.timezone,onChange:s=>u("timezone",s.target.value),placeholder:"Asia/Kolkata"})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Primary Color"}),e.jsx(w,{type:"color",value:r.primaryColor,onChange:s=>u("primaryColor",s.target.value),className:"h-10 p-1"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Accent Color"}),e.jsx(w,{type:"color",value:r.accentColor,onChange:s=>u("accentColor",s.target.value),className:"h-10 p-1"})]})]})]})]}),e.jsxs("div",{className:"glass-card p-6",children:[e.jsxs("h2",{className:"font-serif font-bold text-lg text-primary mb-4 flex items-center gap-2",children:[e.jsx(ye,{className:"w-5 h-5"})," Razorpay & Payment"]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Razorpay Key ID"}),e.jsx(w,{value:r.razorpayKeyId,onChange:s=>u("razorpayKeyId",s.target.value),placeholder:"rzp_live_xxxxx"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Razorpay Key Secret"}),e.jsx(w,{type:"password",value:r.razorpayKeySecret,onChange:s=>u("razorpayKeySecret",s.target.value),placeholder:"Secret key"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Webhook Secret"}),e.jsx(w,{type:"password",value:r.webhookSecret,onChange:s=>u("webhookSecret",s.target.value),placeholder:"Webhook secret"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"UPI ID"}),e.jsx(w,{value:r.upiId,onChange:s=>u("upiId",s.target.value),placeholder:"business@razorpay"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Payment Mode"}),e.jsx(w,{value:r.paymentMode,onChange:s=>u("paymentMode",s.target.value),placeholder:"Razorpay + UPI"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Currency"}),e.jsx(w,{value:r.currency,onChange:s=>u("currency",s.target.value),placeholder:"INR"})]})]}),e.jsxs("div",{className:"mt-4 flex items-start gap-3 rounded-xl border border-emerald-500/20 bg-emerald-500/5 p-3",children:[e.jsx(F,{className:"mt-0.5 h-5 w-5 text-emerald-600"}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Bookings and wallet payments read this key ID, UPI ID and business name. Live payment capture still needs the production Razorpay account and server verification."})]})]}),e.jsxs("div",{className:"glass-card p-6",children:[e.jsxs("h2",{className:"font-serif font-bold text-lg text-primary mb-4 flex items-center gap-2",children:[e.jsx(Ce,{className:"w-5 h-5"})," Live Operations"]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Live Chat Status"}),e.jsxs("select",{value:r.liveChatStatus,onChange:s=>u("liveChatStatus",s.target.value),className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm shadow-sm outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsx("option",{children:"Open"}),e.jsx("option",{children:"Busy"}),e.jsx("option",{children:"Offline"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Chat Accept Mode"}),e.jsxs("select",{value:r.chatAcceptMode,onChange:s=>u("chatAcceptMode",s.target.value),className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm shadow-sm outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsx("option",{children:"Manual approval"}),e.jsx("option",{children:"Auto accept paid clients"}),e.jsx("option",{children:"Team approval"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Booking Accept Mode"}),e.jsxs("select",{value:r.bookingAcceptMode,onChange:s=>u("bookingAcceptMode",s.target.value),className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm shadow-sm outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsx("option",{children:"Auto accept paid orders"}),e.jsx("option",{children:"Manual review after payment"}),e.jsx("option",{children:"Only scheduled slots"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Report Delivery Days"}),e.jsx(w,{type:"number",min:"1",value:r.reportDeliveryDays,onChange:s=>u("reportDeliveryDays",s.target.value)})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Wallet Minimum Recharge"}),e.jsx(w,{type:"number",min:"1",value:r.walletMinRecharge,onChange:s=>u("walletMinRecharge",s.target.value)})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Store Shipping Fee"}),e.jsx(w,{type:"number",min:"0",value:r.shippingFee,onChange:s=>u("shippingFee",s.target.value)})]})]})]}),e.jsxs("div",{className:"glass-card p-6",children:[e.jsxs("h2",{className:"font-serif font-bold text-lg text-primary mb-4 flex items-center gap-2",children:[e.jsx(q,{className:"w-5 h-5"})," Alert System"]}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Alert Sound"}),e.jsxs("select",{value:r.alertSound,onChange:s=>u("alertSound",s.target.value),className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm shadow-sm outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsx("option",{children:"On"}),e.jsx("option",{children:"Off"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Browser Notifications"}),e.jsxs("select",{value:r.browserNotifications,onChange:s=>u("browserNotifications",s.target.value),className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm shadow-sm outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsx("option",{children:"On"}),e.jsx("option",{children:"Off"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"WhatsApp Alerts"}),e.jsxs("select",{value:r.whatsappAlerts,onChange:s=>u("whatsappAlerts",s.target.value),className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm shadow-sm outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsx("option",{children:"On"}),e.jsx("option",{children:"Off"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Email Alerts"}),e.jsxs("select",{value:r.emailAlerts,onChange:s=>u("emailAlerts",s.target.value),className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm shadow-sm outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsx("option",{children:"On"}),e.jsx("option",{children:"Off"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Auto Assign Guruji"}),e.jsxs("select",{value:r.autoAssignGuruji,onChange:s=>u("autoAssignGuruji",s.target.value),className:"h-10 w-full rounded-md border border-input bg-background px-3 text-sm shadow-sm outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[e.jsx("option",{children:"On"}),e.jsx("option",{children:"Off"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Missed Alert Timer (seconds)"}),e.jsx(w,{type:"number",min:"10",value:r.missedAlertAfterSec,onChange:s=>u("missedAlertAfterSec",s.target.value)})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Escalation Mobile"}),e.jsx(w,{value:r.escalationNumber,onChange:s=>u("escalationNumber",s.target.value),placeholder:"+91 98765 43210"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Working Hours"}),e.jsx(w,{value:r.workingHours,onChange:s=>u("workingHours",s.target.value),placeholder:"09:00 - 22:00"})]}),e.jsxs("div",{className:"space-y-1.5 md:col-span-2",children:[e.jsx(v,{children:"Auto Reply Template"}),e.jsx("textarea",{value:r.autoReplyTemplate,onChange:s=>u("autoReplyTemplate",s.target.value),className:"min-h-20 w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm outline-none focus-visible:ring-2 focus-visible:ring-ring"})]})]})]}),e.jsxs("div",{className:"glass-card p-6",children:[e.jsxs("h2",{className:"font-serif font-bold text-lg text-primary mb-4 flex items-center gap-2",children:[e.jsx(D,{className:"w-5 h-5"})," Website Content"]}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Homepage Headline"}),e.jsx(w,{value:r.homepageHeadline,onChange:s=>u("homepageHeadline",s.target.value)})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Homepage Intro"}),e.jsx("textarea",{value:r.homepageIntro,onChange:s=>u("homepageIntro",s.target.value),className:"min-h-24 w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm outline-none focus-visible:ring-2 focus-visible:ring-ring"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Client Welcome Message"}),e.jsx("textarea",{value:r.welcomeMessage,onChange:s=>u("welcomeMessage",s.target.value),className:"min-h-24 w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm outline-none focus-visible:ring-2 focus-visible:ring-ring"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Homepage Image Direction"}),e.jsx(w,{value:r.homepageHeroImage,onChange:s=>u("homepageHeroImage",s.target.value),placeholder:"Indian astrologer image, puja image, report image..."})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Footer Note"}),e.jsx("textarea",{value:r.footerNote,onChange:s=>u("footerNote",s.target.value),className:"min-h-20 w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm outline-none focus-visible:ring-2 focus-visible:ring-ring"})]})]})]}),e.jsxs("div",{className:"grid lg:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"glass-card p-6",children:[e.jsxs("h2",{className:"font-serif font-bold text-lg text-primary mb-4 flex items-center gap-2",children:[e.jsx(Q,{className:"w-5 h-5"})," Services"]}),e.jsx("div",{className:"grid sm:grid-cols-2 gap-2",children:n.map(s=>e.jsxs("label",{className:`flex items-center gap-2 rounded-xl border p-3 text-sm cursor-pointer transition ${r.enabledServices.includes(s)?"border-primary/40 bg-primary/10 text-primary":"border-primary/10 bg-background/60 text-muted-foreground"}`,children:[e.jsx("input",{type:"checkbox",checked:r.enabledServices.includes(s),onChange:()=>k("enabledServices",s),className:"accent-primary"}),s]},s))})]}),e.jsxs("div",{className:"glass-card p-6",children:[e.jsxs("h2",{className:"font-serif font-bold text-lg text-primary mb-4 flex items-center gap-2",children:[e.jsx(D,{className:"w-5 h-5"})," Reports"]}),e.jsx("div",{className:"grid sm:grid-cols-2 gap-2",children:y.map(s=>e.jsxs("label",{className:`flex items-center gap-2 rounded-xl border p-3 text-sm cursor-pointer transition ${r.enabledReports.includes(s)?"border-primary/40 bg-primary/10 text-primary":"border-primary/10 bg-background/60 text-muted-foreground"}`,children:[e.jsx("input",{type:"checkbox",checked:r.enabledReports.includes(s),onChange:()=>k("enabledReports",s),className:"accent-primary"}),s]},s))})]})]})]}),e.jsxs("div",{className:"xl:sticky xl:top-24 h-fit space-y-4",children:[e.jsxs("div",{className:"glass-card overflow-hidden",children:[e.jsxs("div",{className:"p-5 text-white",style:{background:`linear-gradient(135deg, ${r.accentColor}, ${r.primaryColor})`},children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"grid h-14 w-14 place-items-center rounded-2xl bg-white/20 text-xl font-serif font-black shadow-inner",children:r.logoText||"AP"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-serif text-xl font-bold",children:r.businessName||"Astro Baat"}),e.jsx("p",{className:"text-xs text-white/80",children:r.astrologerName||"Astrologer Name"})]})]}),e.jsx("p",{className:"mt-5 text-sm text-white/90",children:r.homepageHeadline})]}),e.jsxs("div",{className:"p-5 space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs("div",{className:"rounded-xl border border-primary/15 p-3 text-center",children:[e.jsx("p",{className:"text-lg font-bold text-primary",children:"₹999"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Starter Demo"})]}),e.jsxs("div",{className:"rounded-xl border border-primary/15 p-3 text-center",children:[e.jsx("p",{className:"text-lg font-bold text-primary",children:r.enabledServices.length}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Services On"})]})]}),e.jsx(b,{className:"w-full text-white font-bold",style:{backgroundColor:r.primaryColor},children:"Pay via Razorpay"}),e.jsxs("p",{className:"text-[11px] text-muted-foreground break-all",children:["Key ID: ",r.razorpayKeyId]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[11px]",children:[e.jsxs("div",{className:"rounded-lg bg-emerald-500/10 px-3 py-2 text-emerald-700",children:[e.jsx("span",{className:"block font-bold",children:r.liveChatStatus}),"Chat status"]}),e.jsxs("div",{className:"rounded-lg bg-primary/10 px-3 py-2 text-primary",children:[e.jsxs("span",{className:"block font-bold",children:["₹",r.walletMinRecharge,"+"]}),"Wallet start"]}),e.jsxs("div",{className:"rounded-lg bg-sky-500/10 px-3 py-2 text-sky-700",children:[e.jsx("span",{className:"block font-bold",children:r.currency}),"Currency"]}),e.jsxs("div",{className:"rounded-lg bg-orange-500/10 px-3 py-2 text-orange-700",children:[e.jsxs("span",{className:"block font-bold",children:[r.reportDeliveryDays," days"]}),"Report SLA"]}),e.jsxs("div",{className:"rounded-lg bg-rose-500/10 px-3 py-2 text-rose-700",children:[e.jsxs("span",{className:"block font-bold",children:[r.missedAlertAfterSec,"s"]}),"Alert SLA"]}),e.jsxs("div",{className:"rounded-lg bg-emerald-500/10 px-3 py-2 text-emerald-700",children:[e.jsx("span",{className:"block font-bold",children:r.autoAssignGuruji}),"Auto assign"]})]})]})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"font-serif font-bold text-primary mb-3",children:"Setup Checklist"}),[["Business name",r.businessName],["Logo text",r.logoText],["Mobile number",r.mobileNumber],["Razorpay key",r.razorpayKeyId],["UPI ID",r.upiId],["Chat accept mode",r.chatAcceptMode],["Alert sound",r.alertSound],["Escalation mobile",r.escalationNumber],["Wallet minimum",r.walletMinRecharge],["At least one service",r.enabledServices.length>0],["At least one report",r.enabledReports.length>0]].map(([s,j])=>e.jsxs("div",{className:"flex items-center justify-between py-2 text-sm border-b border-primary/10 last:border-0",children:[e.jsx("span",{children:s}),j?e.jsx(F,{className:"w-4 h-4 text-emerald-600"}):e.jsx(us,{className:"w-4 h-4 text-muted-foreground"})]},String(s)))]})]})]})]})}function Ya(){const i=Fs(),{data:c}=Qs({},{query:{queryKey:ta({}),refetchInterval:5e3}}),{data:h}=Hs({},{query:{queryKey:es({}),refetchInterval:5e3}}),l=Js(),p=Ys(),[x,A]=S.useState(null),[r,o]=S.useState(""),{data:n}=Xs(x,{query:{enabled:!!x,queryKey:ss(x),refetchInterval:4e3}}),y=J(c),u=J(h),k=J(n),g=u.filter(f=>!f.isRead).length,d=()=>{const f=r.trim();!f||!x||(o(""),p.mutate({data:{sessionId:x,message:f,senderRole:"astrologer"}},{onSuccess:()=>i.invalidateQueries({queryKey:ss(x)})}))};return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("h1",{className:"text-2xl font-serif font-bold text-primary flex items-center gap-3",children:["Messages",g>0&&e.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full bg-rose-500 text-white font-sans",children:[g," new"]})]}),e.jsxs(b,{variant:"outline",className:"border-primary/30 gap-2 text-sm",onClick:()=>l.mutate(void 0,{onSuccess:()=>{i.invalidateQueries({queryKey:es({})}),i.invalidateQueries({queryKey:Zs()})}}),children:[e.jsx(q,{className:"w-4 h-4"})," Mark all read"]})]}),e.jsxs("div",{className:"grid md:grid-cols-[320px_1fr] gap-5 h-[calc(100vh-220px)]",children:[e.jsxs("div",{className:"glass-card p-3 overflow-y-auto",children:[y.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground p-3",children:"No conversations yet."}),y.map(f=>{const s=u.filter(j=>j.sessionId===f.id&&!j.isRead).length;return e.jsxs("button",{onClick:()=>A(f.id),className:`w-full text-left p-3 rounded-xl mb-1 flex items-center gap-3 transition ${x===f.id?"bg-primary/10 border border-primary/30":"hover:bg-muted/50"}`,children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-primary/20 flex items-center justify-center font-serif font-bold text-primary flex-shrink-0",children:(f.astrologer?.name||"A").charAt(0)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-bold truncate",children:f.astrologer?.name||`Session #${f.id}`}),e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["Client #",f.clientId," • ",f.status]})]}),s>0&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-rose-500 text-white",children:s})]},f.id)})]}),e.jsx("div",{className:"glass-card flex flex-col overflow-hidden",children:x?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-2.5",children:[k.length===0&&e.jsx("p",{className:"text-center text-xs text-muted-foreground py-8",children:"No messages in this conversation."}),k.map(f=>{const s=f.senderRole==="client",j=f.attachmentType?.startsWith("image/");return e.jsx("div",{className:`flex ${s?"justify-start":"justify-end"}`,children:e.jsxs("div",{className:`max-w-[75%] px-3.5 py-2 rounded-2xl text-sm ${s?"bg-muted text-foreground rounded-tl-sm":"bg-primary text-primary-foreground rounded-tr-sm"}`,children:[f.attachmentUrl&&(j?e.jsx("a",{href:`/api/storage${f.attachmentUrl}`,target:"_blank",rel:"noreferrer",className:"block mb-1",children:e.jsx("img",{src:`/api/storage${f.attachmentUrl}`,alt:f.attachmentName||"image",className:"rounded-lg max-h-52"})}):e.jsxs("a",{href:`/api/storage${f.attachmentUrl}`,target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 mb-1 underline",children:[e.jsx(D,{className:"w-4 h-4"})," ",f.attachmentName||"Document"]})),f.message&&e.jsx("p",{className:"whitespace-pre-wrap break-words",children:f.message})]})},f.id)})]}),e.jsxs("div",{className:"p-3 border-t border-primary/15 flex gap-2",children:[e.jsx(w,{value:r,onChange:f=>o(f.target.value),onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),d())},placeholder:"Type your reply as astrologer...",className:"border-primary/30"}),e.jsxs(b,{onClick:d,disabled:!r.trim(),className:"gold-gradient text-primary-foreground font-bold gap-2",children:[e.jsx(ma,{className:"w-4 h-4"})," Send"]})]})]}):e.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground text-sm",children:"Select a conversation to view and reply"})})]})]})}function Xa({astrologers:i}){const{toast:c}=se(),[h,l]=S.useState(!1),[p,x]=S.useState({name:"",expertise:"",experience:"",chatPricePerMin:"",callPrice:"",languages:""}),A=()=>{if(!p.name.trim()){c({variant:"destructive",title:"Name required"});return}c({title:"Astrologer Saved",description:`${p.name} has been onboarded (demo).`}),l(!1),x({name:"",expertise:"",experience:"",chatPricePerMin:"",callPrice:"",languages:""})};return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h1",{className:"text-2xl font-serif font-bold text-primary",children:"Astrologers"}),e.jsx(b,{onClick:()=>l(r=>!r),className:"gold-gradient text-primary-foreground font-bold gap-2",children:h?e.jsxs(e.Fragment,{children:[e.jsx($e,{className:"w-4 h-4"})," Close"]}):e.jsxs(e.Fragment,{children:[e.jsx(fe,{className:"w-4 h-4"})," Add Astrologer"]})})]}),h&&e.jsxs("div",{className:"glass-card p-6 mb-6",children:[e.jsx("h3",{className:"font-serif font-bold mb-4",children:"Onboard New Astrologer"}),e.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Full Name"}),e.jsx(w,{value:p.name,onChange:r=>x({...p,name:r.target.value}),placeholder:"Pt. Name Sharma"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Expertise (comma separated)"}),e.jsx(w,{value:p.expertise,onChange:r=>x({...p,expertise:r.target.value}),placeholder:"Vedic, Tarot, Numerology"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Experience (years)"}),e.jsx(w,{type:"number",value:p.experience,onChange:r=>x({...p,experience:r.target.value}),placeholder:"15"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Languages"}),e.jsx(w,{value:p.languages,onChange:r=>x({...p,languages:r.target.value}),placeholder:"Hindi, English"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Chat Price (₹/min)"}),e.jsx(w,{type:"number",value:p.chatPricePerMin,onChange:r=>x({...p,chatPricePerMin:r.target.value}),placeholder:"15"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(v,{children:"Call Price (₹)"}),e.jsx(w,{type:"number",value:p.callPrice,onChange:r=>x({...p,callPrice:r.target.value}),placeholder:"800"})]})]}),e.jsxs(b,{onClick:A,className:"mt-5 gold-gradient text-primary-foreground font-bold gap-2",children:[e.jsx(F,{className:"w-4 h-4"})," Save Astrologer"]})]}),e.jsx("div",{className:"grid md:grid-cols-2 gap-5",children:i.map(r=>e.jsxs("div",{className:"glass-card p-5 flex items-start gap-4",children:[e.jsx("div",{className:"w-14 h-14 rounded-full bg-primary/20 border border-primary/40 flex items-center justify-center text-2xl font-serif font-bold text-primary flex-shrink-0",children:r.name.charAt(0)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("h3",{className:"font-bold text-sm",children:r.name}),e.jsxs("span",{className:`flex items-center gap-1 text-[10px] ${r.isOnline?"text-emerald-600":"text-muted-foreground"}`,children:[r.isOnline?e.jsx(F,{className:"w-3 h-3"}):e.jsx(us,{className:"w-3 h-3"})," ",r.isOnline?"Online":"Offline"]})]}),e.jsx("p",{className:"text-xs text-primary mb-1",children:(r.expertise||[]).join(" • ")}),e.jsxs("div",{className:"grid grid-cols-3 gap-2 mt-2",children:[e.jsxs("div",{className:"text-[10px] text-center",children:[e.jsx("div",{className:"font-bold",children:r.totalConsultations||0}),e.jsx("div",{className:"text-muted-foreground",children:"Consultations"})]}),e.jsxs("div",{className:"text-[10px] text-center",children:[e.jsx("div",{className:"font-bold text-primary",children:r.rating}),e.jsx("div",{className:"text-muted-foreground",children:"Rating"})]}),e.jsxs("div",{className:"text-[10px] text-center",children:[e.jsxs("div",{className:"font-bold",children:["₹",r.chatPricePerMin,"/m"]}),e.jsx("div",{className:"text-muted-foreground",children:"Chat"})]})]}),e.jsxs("div",{className:"flex gap-2 mt-3",children:[e.jsx(b,{size:"sm",variant:"outline",className:"border-primary/30 text-xs h-7 flex-1",children:"Edit"}),e.jsx(b,{size:"sm",variant:"outline",className:"border-primary/30 text-xs h-7 flex-1",children:"View"})]})]})]},r.id))})]})}export{Pr as default};

Directory Contents

Dirs: 0 × Files: 147
Name Size Perms Modified Actions
6.66 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.46 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
21.60 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
166 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
5.13 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.43 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
85 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.47 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
155 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.46 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.41 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.40 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.63 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.34 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.30 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
365 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
312 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
738 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.17 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.13 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.10 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
221 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
500 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
306 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
495 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
337 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.06 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.81 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
252 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.45 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
120 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
129 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
131 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
174 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.99 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.24 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.22 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
81 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.26 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.31 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
407 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
300 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
165 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
232 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
209 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.11 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
233 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.09 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.18 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
252 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
335 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.15 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
82 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
238 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
259 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.73 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
88 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
84 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.56 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.09 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
368.72 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
70.25 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
32.06 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
19.09 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
92.81 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
137.79 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
21.54 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
10.82 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
22.04 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
16.81 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
42.67 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
135.29 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
232 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
51.00 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
18.79 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
7.52 KB lrw-r--r-- 2026-06-06 12:45:10
Edit Download
4.15 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
42.87 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
16.20 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
16.65 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
36.20 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
292 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
557 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
79 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.45 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
884 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.19 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
85 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
317 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
352 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
140 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
202 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
372 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
24.59 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
255 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.53 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
81 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.32 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.77 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.63 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
427 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
506 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
32.09 KB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.19 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
617 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
158 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.01 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
81 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.37 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
83 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.53 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
298 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.90 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.13 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
201 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.24 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.37 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.67 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
328 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
808 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
483 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.98 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
398 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
473 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
642 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
85 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.45 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.06 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
86 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.98 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
871 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
176 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
402 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
239 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
192 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
343 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
307 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
78 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
2.08 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.36 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
808 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.45 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
86 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
718 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
1.33 MB lrw-r--r-- 2026-06-29 09:44:41
Edit Download
1.94 MB lrw-r--r-- 2026-06-06 12:39:32
Edit Download
263 B lrw-r--r-- 2026-06-06 12:39:32
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).
© 2026 0xNothings — Secure File Manager. All rights reserved. Built with ❤️ & Tailwind x Dark UI