diff --git a/dist/assets/Bookings-BLIHHfA5.js b/dist/assets/Bookings-BLIHHfA5.js deleted file mode 100644 index c9dd558..0000000 --- a/dist/assets/Bookings-BLIHHfA5.js +++ /dev/null @@ -1 +0,0 @@ -import{r as H,j as e,i as q,b as u,B as j,T as g,S as ae,l as re,C as te,f as se,I as ie,M as J}from"./index-DpAn5wLF.js";import{d as L,D as ne,a as oe,b as le,c as ce}from"./Close-BdNf_RlN.js";import{T as de,d as ue}from"./DeleteOutline-BVDDlNca.js";import{d as Q}from"./LocalShippingOutlined-Ds2yAonP.js";import{P as he,G as i,C as O,A as me}from"./PageHeader-CEew5Fw4.js";import{S as T}from"./StatCard-Nzv53jX8.js";import{E as pe}from"./EmptyState-BsjYeVAX.js";import{A as z,C as ge}from"./ClientFormDialog-K7w_VS5d.js";import{C as xe}from"./Link-Bme8npFv.js";import{T as c}from"./TextField-C0dUZvW0.js";import{I as je}from"./InputAdornment-BWnl4jqW.js";import{B as _}from"./Button-BGNvVfej.js";import{T as fe,a as E}from"./Tabs-Cp4sZXyZ.js";import{T as ve,a as ye,b as be,c as U,d as Ce}from"./TableRow-BcqnvRn2.js";import{T as m}from"./TableCell-PEGz6qo_.js";import{S as ke}from"./Snackbar-B0wJYiYQ.js";import{F as we,C as Se}from"./FormControlLabel-DwXmo7ko.js";import"./SwitchBase-1TkNOx4a.js";var K={},Pe=q;Object.defineProperty(K,"__esModule",{value:!0});var X=K.default=void 0,Ae=Pe(H()),_e=e;X=K.default=(0,Ae.default)((0,_e.jsx)("path",{d:"M15.5 1h-8C6.12 1 5 2.12 5 3.5v17C5 21.88 6.12 23 7.5 23h8c1.38 0 2.5-1.12 2.5-2.5v-17C18 2.12 16.88 1 15.5 1m-4 21c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m4.5-4H7V4h9z"}),"PhoneIphoneOutlined");var G={},Be=q;Object.defineProperty(G,"__esModule",{value:!0});var Y=G.default=void 0,Ie=Be(H()),Fe=e;Y=G.default=(0,Ie.default)((0,Fe.jsx)("path",{d:"M21 2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h7v2H8v2h8v-2h-2v-2h7c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H3V4h18z"}),"DesktopWindowsOutlined");var V={},De=q;Object.defineProperty(V,"__esModule",{value:!0});var Z=V.default=void 0,Te=De(H()),ze=e;Z=V.default=(0,Te.default)((0,ze.jsx)("path",{d:"M17 12c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m1.65 7.35L16.5 17.2V14h1v2.79l1.85 1.85zM18 3h-3.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H6c-1.1 0-2 .9-2 2v15c0 1.1.9 2 2 2h6.11c-.59-.57-1.07-1.25-1.42-2H6V5h2v3h8V5h2v5.08c.71.1 1.38.31 2 .6V5c0-1.1-.9-2-2-2m-6 2c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1"}),"PendingActionsOutlined");const W="https://api.doormile.com/api/v1",We=["Chennai","Coimbatore","Madurai","Tiruchirappalli","Salem","Tuticorin","Tirupur","Erode","Vellore","Tirunelveli","Thanjavur","Dindigul","Hosur","Nagercoil","Karur","Namakkal","Kanchipuram","Cuddalore","Thoothukudi","Bengaluru","Mysuru","Mangaluru","Hubli","Belagavi","Kalaburagi","Davangere","Ballari","Kochi","Thiruvananthapuram","Kozhikode","Kannur","Thrissur","Kollam","Hyderabad","Warangal","Visakhapatnam","Vijayawada","Tirupati","Guntur","Rajahmundry","Nellore","Mumbai","Pune","Nagpur","Nashik","Aurangabad","Kolhapur","Solapur","New Delhi","Gurugram","Noida","Faridabad","Chandigarh","Amritsar","Ludhiana","Jalandhar","Ahmedabad","Surat","Vadodara","Rajkot","Bhavnagar","Jamnagar","Kolkata","Howrah","Durgapur","Asansol","Siliguri","Lucknow","Kanpur","Agra","Varanasi","Allahabad","Meerut","Bhopal","Indore","Gwalior","Jabalpur","Jaipur","Jodhpur","Udaipur","Kota","Bikaner","Patna","Gaya","Bhagalpur","Bhubaneswar","Cuttack","Rourkela","Guwahati","Raipur","Ranchi","Dehradun"],R=()=>{const o=localStorage.getItem("auth_token");return{"Content-Type":"application/json",...o?{Authorization:`Bearer ${o}`}:{}}};async function Re(){const o=await fetch(`${W}/admin/bookings`,{headers:R()});if(!o.ok)throw new Error("Failed to fetch bookings");const d=await o.json();return Array.isArray(d)?d:d.data||[]}async function $e(){const o=await fetch(`${W}/admin/competitor-branches?limit=1000`,{headers:R()});if(!o.ok)throw new Error("Failed to fetch surveys");const d=await o.json();return Array.isArray(d)?d:d.data||[]}async function Ne(o){const d=await fetch(`${W}/admin/crmbooking`,{method:"POST",headers:R(),body:JSON.stringify(o)});if(!d.ok){const y=await d.json().catch(()=>({}));throw new Error(y.error||"Failed to create booking")}return d.json()}function Me({open:o,onClose:d,onSave:y,clients:$,surveys:B}){var p;const[I,b]=u.useState(!1),[s,l]=u.useState({customer_name:"",customer_phone:"",pickupaddress:"",pickuppincode:"",deliveryaddress:"",deliverypincode:"",deliverycity:"",providercompany:"",providerlocation:"",notes:"",service_option:"Normal",finalprice:"",insuranceamount:"",needsinsurance:!1,declaredvalue:"",parcels:[{itemcategory:"",weight:"",length:"",width:"",height:""}]}),[C,k]=u.useState(!1),[F,f]=u.useState(null),[w,S]=u.useState(null);u.useEffect(()=>{o&&(l({customer_name:"",customer_phone:"",pickupaddress:"",pickuppincode:"",deliveryaddress:"",deliverypincode:"",deliverycity:"",providercompany:"",providerlocation:"",notes:"",service_option:"Normal",finalprice:"",insuranceamount:"",needsinsurance:!1,declaredvalue:"",parcels:[{itemcategory:"",weight:"",length:"",width:"",height:""}]}),f(null),S(null))},[o]);const h=a=>r=>l(n=>({...n,[a]:r.target.value})),x=(a,r)=>n=>{const A=[...s.parcels];A[a]={...A[a],[r]:n.target.value},l(ee=>({...ee,parcels:A}))},N=()=>{l(a=>({...a,parcels:[...a.parcels,{itemcategory:"",weight:"",length:"",width:"",height:""}]}))},D=a=>{if(s.parcels.length<=1)return;const r=[...s.parcels];r.splice(a,1),l(n=>({...n,parcels:r}))},v=async()=>{k(!0),f(null);try{if(!s.pickupaddress||!s.pickuppincode)throw new Error("Pickup Address and Pincode are required");const a={...s,finalprice:parseFloat(s.finalprice)||0,insuranceamount:parseFloat(s.insuranceamount)||0,parcels:s.parcels.map(r=>({itemcategory:r.itemcategory||"General",weight:parseFloat(r.weight)||1,length:parseFloat(r.length)||1,width:parseFloat(r.width)||1,height:parseFloat(r.height)||1}))};await Ne(a),y(),d()}catch(a){console.error(a),f(a.message||"Failed to create booking")}finally{k(!1)}},M=async()=>{try{const a=await fetch(`${W}/admin/pricing/quote`,{method:"POST",headers:R(),body:JSON.stringify({parcels:s.parcels.map(r=>({weight:parseFloat(r.weight)||1,length:parseFloat(r.length)||1,width:parseFloat(r.width)||1,height:parseFloat(r.height)||1}))})});if(a.ok){const r=await a.json();S(r),s.finalprice||l(n=>{var A;return{...n,finalprice:((A=r.basequote)==null?void 0:A.toFixed(2))||""}})}}catch(a){console.error(a)}},P=Array.from(new Set(B.map(a=>a.company).filter(Boolean))),t=B.filter(a=>a.company===s.providercompany).map(a=>a.area||a.address).filter(Boolean);return e.jsxs(e.Fragment,{children:[e.jsx(ke,{open:!!F,autoHideDuration:6e3,onClose:()=>f(null),anchorOrigin:{vertical:"top",horizontal:"right"},sx:{zIndex:9999},children:e.jsx(me,{onClose:()=>f(null),severity:"error",variant:"filled",sx:{width:"100%",boxShadow:3},children:F})}),e.jsxs(ne,{open:o,onClose:C?void 0:d,maxWidth:"md",fullWidth:!0,children:[e.jsx(oe,{sx:{fontWeight:800},children:"Create New Booking"}),e.jsxs(le,{dividers:!0,children:[e.jsx(g,{variant:"subtitle1",sx:{fontWeight:700,mb:1,color:"primary.main"},children:"Customer Details"}),e.jsx(i,{container:!0,spacing:2,sx:{mb:3},children:e.jsx(i,{item:!0,xs:12,children:e.jsxs(j,{sx:{display:"flex",gap:2,alignItems:"center"},children:[e.jsx(z,{options:$,sx:{flexGrow:1},getOptionLabel:a=>typeof a=="string"?a:`${a.first_name||""} ${a.last_name||""} - ${a.phone||""}`,onChange:(a,r)=>{l(r&&typeof r=="object"?n=>({...n,customer_name:`${r.first_name||""} ${r.last_name||""}`.trim(),customer_phone:r.phone||""}):n=>({...n,customer_name:"",customer_phone:""}))},renderInput:a=>e.jsx(c,{...a,label:"Select Existing Client",size:"small"})}),e.jsx(_,{variant:"outlined",startIcon:e.jsx(L,{}),onClick:()=>b(!0),sx:{whiteSpace:"nowrap"},children:"New Client"})]})})}),e.jsx(g,{variant:"subtitle1",sx:{fontWeight:700,mb:1,color:"primary.main"},children:"Assigned Provider (From Survey)"}),e.jsxs(i,{container:!0,spacing:2,sx:{mb:3},children:[e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsx(z,{options:P,value:s.providercompany,onChange:(a,r)=>l(n=>({...n,providercompany:r||"",providerlocation:""})),renderInput:a=>e.jsx(c,{...a,label:"Provider Name",size:"small"})})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsx(z,{options:t,value:s.providerlocation,onChange:(a,r)=>l(n=>({...n,providerlocation:r||""})),renderInput:a=>e.jsx(c,{...a,label:"Provider Location / Sub Hub",size:"small"}),disabled:!s.providercompany})})]}),e.jsx(g,{variant:"subtitle1",sx:{fontWeight:700,mb:1,color:"primary.main"},children:"Pickup Location"}),e.jsxs(i,{container:!0,spacing:2,sx:{mb:3},children:[e.jsx(i,{item:!0,xs:12,sm:8,children:e.jsx(c,{fullWidth:!0,label:"Pickup Address *",value:s.pickupaddress,onChange:h("pickupaddress"),size:"small"})}),e.jsx(i,{item:!0,xs:12,sm:4,children:e.jsx(c,{fullWidth:!0,label:"Pickup Pincode *",value:s.pickuppincode,onChange:h("pickuppincode"),size:"small"})})]}),e.jsx(g,{variant:"subtitle1",sx:{fontWeight:700,mb:1,color:"primary.main"},children:"Delivery Destination"}),e.jsxs(i,{container:!0,spacing:2,sx:{mb:3},children:[e.jsx(i,{item:!0,xs:12,sm:12,children:e.jsx(c,{fullWidth:!0,label:"Delivery Address",value:s.deliveryaddress,onChange:h("deliveryaddress"),size:"small"})}),e.jsx(i,{item:!0,xs:12,sm:8,children:e.jsx(z,{freeSolo:!0,options:We,value:s.deliverycity,onChange:(a,r)=>l(n=>({...n,deliverycity:r||""})),onInputChange:(a,r)=>l(n=>({...n,deliverycity:r||""})),renderInput:a=>e.jsx(c,{...a,label:"Search City",size:"small"})})}),e.jsx(i,{item:!0,xs:12,sm:4,children:e.jsx(c,{fullWidth:!0,label:"Delivery Pincode",value:s.deliverypincode,onChange:h("deliverypincode"),size:"small"})})]}),e.jsxs(j,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[e.jsx(g,{variant:"subtitle1",sx:{fontWeight:700,color:"primary.main"},children:"Parcel Details"}),e.jsx(_,{size:"small",startIcon:e.jsx(L,{}),onClick:N,children:"Add Parcel"})]}),s.parcels.map((a,r)=>e.jsxs(i,{container:!0,spacing:1.5,sx:{mb:2,alignItems:"center"},children:[e.jsx(i,{item:!0,xs:12,sm:3,children:e.jsx(c,{fullWidth:!0,label:"Category (e.g. Box)",value:a.itemcategory,onChange:x(r,"itemcategory"),size:"small"})}),e.jsx(i,{item:!0,xs:6,sm:2,children:e.jsx(c,{fullWidth:!0,label:"Weight (kg)",type:"number",value:a.weight,onChange:x(r,"weight"),size:"small"})}),e.jsx(i,{item:!0,xs:6,sm:2,children:e.jsx(c,{fullWidth:!0,label:"Length (cm)",type:"number",value:a.length,onChange:x(r,"length"),size:"small"})}),e.jsx(i,{item:!0,xs:6,sm:2,children:e.jsx(c,{fullWidth:!0,label:"Width (cm)",type:"number",value:a.width,onChange:x(r,"width"),size:"small"})}),e.jsx(i,{item:!0,xs:4,sm:2,children:e.jsx(c,{fullWidth:!0,label:"Height (cm)",type:"number",value:a.height,onChange:x(r,"height"),size:"small"})}),e.jsx(i,{item:!0,xs:2,sm:1,children:e.jsx(ie,{color:"error",onClick:()=>D(r),disabled:s.parcels.length===1,children:e.jsx(ue,{})})})]},r)),e.jsxs(j,{sx:{display:"flex",gap:2,alignItems:"center",mt:2,mb:1},children:[e.jsx(g,{variant:"subtitle1",sx:{fontWeight:700,color:"primary.main"},children:"Price & Insurance"}),e.jsx(_,{size:"small",variant:"outlined",onClick:M,children:"Check Price Estimate"})]}),w&&e.jsxs(g,{variant:"body2",color:"text.secondary",sx:{mb:2,px:1,borderLeft:"4px solid #3b82f6",bgcolor:"#eff6ff",py:1},children:["Estimated Base Price: ",e.jsxs("strong",{children:["₹",(p=w.basequote)==null?void 0:p.toFixed(2)]})," (Chargeable Weight: ",w.chargeableweight," kg)"]}),e.jsxs(i,{container:!0,spacing:2,sx:{mb:3},children:[e.jsx(i,{item:!0,xs:12,sm:3,children:e.jsx(c,{fullWidth:!0,label:"Final Price (₹)",type:"number",value:s.finalprice,onChange:h("finalprice"),size:"small"})}),e.jsx(i,{item:!0,xs:12,sm:9,children:e.jsxs(j,{sx:{display:"flex",gap:2,alignItems:"center"},children:[e.jsx(we,{control:e.jsx(Se,{checked:s.needsinsurance,onChange:a=>{const r=a.target.checked;l(n=>({...n,needsinsurance:r,insuranceamount:r&&n.declaredvalue?(parseFloat(n.declaredvalue)*.01).toFixed(2):n.insuranceamount}))}}),label:"Needs Insurance? (1%)",sx:{whiteSpace:"nowrap"}}),e.jsx(c,{label:"Declared Value (₹)",type:"number",size:"small",sx:{width:150},value:s.declaredvalue,onChange:a=>{const r=a.target.value;l(n=>({...n,declaredvalue:r,insuranceamount:n.needsinsurance&&r?(parseFloat(r)*.01).toFixed(2):n.insuranceamount}))}}),e.jsx(c,{label:"Insurance Amount (₹)",type:"number",size:"small",sx:{width:150},value:s.insuranceamount,onChange:h("insuranceamount")})]})})]}),e.jsx(g,{variant:"subtitle1",sx:{fontWeight:700,mb:1,color:"primary.main"},children:"Additional Information"}),e.jsxs(i,{container:!0,spacing:2,children:[e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsxs(c,{select:!0,fullWidth:!0,label:"Select Speed",value:s.service_option,onChange:h("service_option"),size:"small",children:[e.jsx(J,{value:"Normal",children:"Normal"}),e.jsx(J,{value:"Fast",children:"Fast Express"})]})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsx(c,{fullWidth:!0,label:"Notes / Remarks",value:s.notes,onChange:h("notes"),size:"small"})})]})]}),e.jsxs(ce,{sx:{p:2},children:[e.jsx(_,{onClick:d,disabled:C,children:"Cancel"}),e.jsx(_,{variant:"contained",onClick:v,disabled:C||!s.customer_phone,sx:{bgcolor:"primary.main","&:hover":{bgcolor:"primary.dark"}},children:C?"Creating...":"Create Booking"})]})]}),I&&e.jsx(ge,{open:I,mode:"create",onClose:()=>b(!1),onSaved:()=>{b(!1),y()}})]})}function sa(){const[o,d]=u.useState([]),[y,$]=u.useState([]),[B,I]=u.useState([]),[b,s]=u.useState(!0),[l,C]=u.useState(""),[k,F]=u.useState("All"),[f,w]=u.useState(!1),[S,h]=u.useState(0),[x,N]=u.useState(10),D=async()=>{s(!0);try{const[t,p,a]=await Promise.all([Re(),se().catch(()=>[]),$e().catch(()=>[])]);d(Array.isArray(t)?t:[]),$(Array.isArray(p)?p:[]),I(Array.isArray(a)?a:[])}catch(t){console.error(t)}finally{s(!1)}};u.useEffect(()=>{D()},[]);const v=o.filter(t=>{const p=(t.bookingno||"").toLowerCase().includes(l.toLowerCase())||(t.pickupaddress||"").toLowerCase().includes(l.toLowerCase())||(t.deliverycity||"").toLowerCase().includes(l.toLowerCase())||(t.providercompany||"").toLowerCase().includes(l.toLowerCase()),a=k==="All"||t.bookingsource===k;return p&&a}),M=v.slice(S*x,S*x+x),P={total:o.length,app:o.filter(t=>t.bookingsource==="Customer_App").length,crm:o.filter(t=>t.bookingsource==="CRM_Console").length,pending:o.filter(t=>t.status==="Pending_Pickup").length};return e.jsxs(e.Fragment,{children:[e.jsx(he,{title:"Bookings Management",breadcrumbs:[{label:"Bookings"}]}),e.jsxs(i,{container:!0,spacing:2.5,sx:{mb:3},children:[e.jsx(i,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(T,{accent:!0,title:"Total Bookings",value:P.total,icon:Q,color:"primary",caption:"All sources"})}),e.jsx(i,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(T,{accent:!0,title:"App Bookings",value:P.app,icon:X,color:"primary",caption:"Via customer app"})}),e.jsx(i,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(T,{accent:!0,title:"CRM Bookings",value:P.crm,icon:Y,color:"primary",caption:"Created in console"})}),e.jsx(i,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(T,{accent:!0,title:"Pending Pickup",value:P.pending,icon:Z,color:"primary",caption:"Awaiting collection"})})]}),e.jsxs(xe,{sx:{overflow:"hidden"},children:[e.jsxs(j,{sx:{px:{xs:2,sm:2.5},py:2,borderBottom:1,borderColor:"divider",display:"flex",alignItems:"center",gap:1.5,background:t=>`linear-gradient(90deg, ${t.palette.primary.lighter}66 0%, ${t.palette.background.paper} 70%)`},children:[e.jsx(j,{sx:{width:40,height:40,borderRadius:2,bgcolor:"primary.lighter",color:"primary.main",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Q,{fontSize:"small"})}),e.jsxs(j,{children:[e.jsx(g,{variant:"subtitle1",sx:{fontWeight:700,color:"grey.800",lineHeight:1.2},children:"All Bookings"}),e.jsx(g,{variant:"caption",color:"text.secondary",children:"Track and manage every shipment booking"})]})]}),e.jsxs(ae,{direction:{xs:"column",md:"row"},spacing:1.5,sx:{p:2},alignItems:{md:"center"},children:[e.jsx(c,{size:"small",placeholder:"Search bookings…",value:l,onChange:t=>{C(t.target.value),h(0)},sx:{width:{xs:"100%",md:300}},InputProps:{startAdornment:e.jsx(je,{position:"start",children:e.jsx(re,{fontSize:"small"})})}}),e.jsx(j,{sx:{flexGrow:1}}),!b&&e.jsxs(g,{variant:"body2",color:"text.secondary",children:[v.length," ",v.length===1?"booking":"bookings"]}),e.jsx(_,{variant:"contained",startIcon:e.jsx(L,{}),onClick:()=>w(!0),sx:{flex:{xs:1,md:"none"}},children:"New Booking"})]}),e.jsx(j,{sx:{px:2,borderBottom:1,borderColor:"divider"},children:e.jsxs(fe,{value:k,onChange:(t,p)=>{F(p),h(0)},"aria-label":"booking source filter tabs",children:[e.jsx(E,{label:"All Bookings",value:"All"}),e.jsx(E,{label:"App Bookings",value:"Customer_App"}),e.jsx(E,{label:"CRM Bookings",value:"CRM_Console"})]})}),b?e.jsx(j,{sx:{display:"flex",justifyContent:"center",py:6},children:e.jsx(te,{})}):v.length===0?e.jsx(pe,{title:"No bookings found",caption:"Try a different filter or search term."}):e.jsx(ve,{children:e.jsxs(ye,{children:[e.jsx(be,{children:e.jsxs(U,{sx:{"& th":{bgcolor:"grey.50",fontWeight:700,color:"grey.700",textTransform:"uppercase",fontSize:"0.72rem",letterSpacing:.4}},children:[e.jsx(m,{children:"Booking No"}),e.jsx(m,{children:"Delivery City"}),e.jsx(m,{children:"Provider"}),e.jsx(m,{children:"Source"}),e.jsx(m,{children:"Price"}),e.jsx(m,{children:"Status"})]})}),e.jsx(Ce,{children:M.map(t=>e.jsxs(U,{hover:!0,children:[e.jsx(m,{sx:{fontWeight:600},children:t.bookingno}),e.jsx(m,{children:t.deliverycity||t.deliverypincode||"N/A"}),e.jsx(m,{children:t.providercompany?e.jsx(O,{label:t.providercompany,size:"small",sx:{mr:1}}):"N/A"}),e.jsx(m,{children:e.jsx(O,{label:t.bookingsource==="CRM_Console"?"CRM":"App",size:"small",variant:"outlined",color:t.bookingsource==="CRM_Console"?"secondary":"primary"})}),e.jsx(m,{children:t.serviceoptions&&t.serviceoptions.length>0?`₹${t.serviceoptions[0].estimatedprice}`:"N/A"}),e.jsx(m,{children:e.jsx(O,{label:t.status,size:"small",color:t.status==="Pending_Pickup"?"warning":"primary"})})]},t.bookingid))})]})}),e.jsx(de,{component:"div",count:v.length,page:S,onPageChange:(t,p)=>h(p),rowsPerPage:x,onRowsPerPageChange:t=>{N(+t.target.value),h(0)},rowsPerPageOptions:[5,10,25]})]}),e.jsx(Me,{open:f,onClose:()=>w(!1),onSave:()=>{D()},clients:y,surveys:B})]})}export{sa as default}; diff --git a/dist/assets/Bookings-BbGscC3O.js b/dist/assets/Bookings-BbGscC3O.js new file mode 100644 index 0000000..ee74ff9 --- /dev/null +++ b/dist/assets/Bookings-BbGscC3O.js @@ -0,0 +1 @@ +import{r as H,j as e,i as q,b as u,B as j,T as g,S as ae,l as re,C as te,f as se,I as ie,M as J}from"./index-D7LVXeIK.js";import{d as L,D as ne,a as oe,b as le,c as ce}from"./Close-D3HB9j5y.js";import{T as de,d as ue}from"./DeleteOutline-Dhk3Cr2d.js";import{d as Q}from"./LocalShippingOutlined-C1uYlQnS.js";import{P as he,G as i,C as O,A as me}from"./PageHeader-naLAT9xr.js";import{S as T,E as pe}from"./EmptyState-B9FcYx_n.js";import{A as z,C as ge}from"./ClientFormDialog-Clwkcvac.js";import{C as xe}from"./Link-BEif5YS2.js";import{T as c}from"./TextField-Sd_pshci.js";import{I as je}from"./InputAdornment-CMIlL2rx.js";import{B as _}from"./Button-Bqp5awT1.js";import{T as ve,a as E}from"./Tabs-BUgAhQiL.js";import{T as fe,a as ye,b as be,c as U,d as Ce}from"./TableRow-jBgitpDf.js";import{T as m}from"./TableCell-DreGbAeW.js";import{S as ke}from"./Snackbar-DOheZfWW.js";import{F as we,C as Se}from"./FormControlLabel-Bp5Li47e.js";import"./SwitchBase-CWj2k0Bo.js";var K={},Pe=q;Object.defineProperty(K,"__esModule",{value:!0});var X=K.default=void 0,Ae=Pe(H()),_e=e;X=K.default=(0,Ae.default)((0,_e.jsx)("path",{d:"M15.5 1h-8C6.12 1 5 2.12 5 3.5v17C5 21.88 6.12 23 7.5 23h8c1.38 0 2.5-1.12 2.5-2.5v-17C18 2.12 16.88 1 15.5 1m-4 21c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m4.5-4H7V4h9z"}),"PhoneIphoneOutlined");var G={},Be=q;Object.defineProperty(G,"__esModule",{value:!0});var Y=G.default=void 0,Ie=Be(H()),Fe=e;Y=G.default=(0,Ie.default)((0,Fe.jsx)("path",{d:"M21 2H3c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h7v2H8v2h8v-2h-2v-2h7c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m0 14H3V4h18z"}),"DesktopWindowsOutlined");var V={},De=q;Object.defineProperty(V,"__esModule",{value:!0});var Z=V.default=void 0,Te=De(H()),ze=e;Z=V.default=(0,Te.default)((0,ze.jsx)("path",{d:"M17 12c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5m1.65 7.35L16.5 17.2V14h1v2.79l1.85 1.85zM18 3h-3.18C14.4 1.84 13.3 1 12 1s-2.4.84-2.82 2H6c-1.1 0-2 .9-2 2v15c0 1.1.9 2 2 2h6.11c-.59-.57-1.07-1.25-1.42-2H6V5h2v3h8V5h2v5.08c.71.1 1.38.31 2 .6V5c0-1.1-.9-2-2-2m-6 2c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1"}),"PendingActionsOutlined");const W="https://api.doormile.com/api/v1",We=["Chennai","Coimbatore","Madurai","Tiruchirappalli","Salem","Tuticorin","Tirupur","Erode","Vellore","Tirunelveli","Thanjavur","Dindigul","Hosur","Nagercoil","Karur","Namakkal","Kanchipuram","Cuddalore","Thoothukudi","Bengaluru","Mysuru","Mangaluru","Hubli","Belagavi","Kalaburagi","Davangere","Ballari","Kochi","Thiruvananthapuram","Kozhikode","Kannur","Thrissur","Kollam","Hyderabad","Warangal","Visakhapatnam","Vijayawada","Tirupati","Guntur","Rajahmundry","Nellore","Mumbai","Pune","Nagpur","Nashik","Aurangabad","Kolhapur","Solapur","New Delhi","Gurugram","Noida","Faridabad","Chandigarh","Amritsar","Ludhiana","Jalandhar","Ahmedabad","Surat","Vadodara","Rajkot","Bhavnagar","Jamnagar","Kolkata","Howrah","Durgapur","Asansol","Siliguri","Lucknow","Kanpur","Agra","Varanasi","Allahabad","Meerut","Bhopal","Indore","Gwalior","Jabalpur","Jaipur","Jodhpur","Udaipur","Kota","Bikaner","Patna","Gaya","Bhagalpur","Bhubaneswar","Cuttack","Rourkela","Guwahati","Raipur","Ranchi","Dehradun"],R=()=>{const o=localStorage.getItem("auth_token");return{"Content-Type":"application/json",...o?{Authorization:`Bearer ${o}`}:{}}};async function Re(){const o=await fetch(`${W}/admin/bookings`,{headers:R()});if(!o.ok)throw new Error("Failed to fetch bookings");const d=await o.json();return Array.isArray(d)?d:d.data||[]}async function $e(){const o=await fetch(`${W}/admin/competitor-branches?limit=1000`,{headers:R()});if(!o.ok)throw new Error("Failed to fetch surveys");const d=await o.json();return Array.isArray(d)?d:d.data||[]}async function Ne(o){const d=await fetch(`${W}/admin/crmbooking`,{method:"POST",headers:R(),body:JSON.stringify(o)});if(!d.ok){const y=await d.json().catch(()=>({}));throw new Error(y.error||"Failed to create booking")}return d.json()}function Me({open:o,onClose:d,onSave:y,clients:$,surveys:B}){var p;const[I,b]=u.useState(!1),[s,l]=u.useState({customer_name:"",customer_phone:"",pickupaddress:"",pickuppincode:"",deliveryaddress:"",deliverypincode:"",deliverycity:"",providercompany:"",providerlocation:"",notes:"",service_option:"Normal",finalprice:"",insuranceamount:"",needsinsurance:!1,declaredvalue:"",parcels:[{itemcategory:"",weight:"",length:"",width:"",height:""}]}),[C,k]=u.useState(!1),[F,v]=u.useState(null),[w,S]=u.useState(null);u.useEffect(()=>{o&&(l({customer_name:"",customer_phone:"",pickupaddress:"",pickuppincode:"",deliveryaddress:"",deliverypincode:"",deliverycity:"",providercompany:"",providerlocation:"",notes:"",service_option:"Normal",finalprice:"",insuranceamount:"",needsinsurance:!1,declaredvalue:"",parcels:[{itemcategory:"",weight:"",length:"",width:"",height:""}]}),v(null),S(null))},[o]);const h=a=>r=>l(n=>({...n,[a]:r.target.value})),x=(a,r)=>n=>{const A=[...s.parcels];A[a]={...A[a],[r]:n.target.value},l(ee=>({...ee,parcels:A}))},N=()=>{l(a=>({...a,parcels:[...a.parcels,{itemcategory:"",weight:"",length:"",width:"",height:""}]}))},D=a=>{if(s.parcels.length<=1)return;const r=[...s.parcels];r.splice(a,1),l(n=>({...n,parcels:r}))},f=async()=>{k(!0),v(null);try{if(!s.pickupaddress||!s.pickuppincode)throw new Error("Pickup Address and Pincode are required");const a={...s,finalprice:parseFloat(s.finalprice)||0,insuranceamount:parseFloat(s.insuranceamount)||0,parcels:s.parcels.map(r=>({itemcategory:r.itemcategory||"General",weight:parseFloat(r.weight)||1,length:parseFloat(r.length)||1,width:parseFloat(r.width)||1,height:parseFloat(r.height)||1}))};await Ne(a),y(),d()}catch(a){console.error(a),v(a.message||"Failed to create booking")}finally{k(!1)}},M=async()=>{try{const a=await fetch(`${W}/admin/pricing/quote`,{method:"POST",headers:R(),body:JSON.stringify({parcels:s.parcels.map(r=>({weight:parseFloat(r.weight)||1,length:parseFloat(r.length)||1,width:parseFloat(r.width)||1,height:parseFloat(r.height)||1}))})});if(a.ok){const r=await a.json();S(r),s.finalprice||l(n=>{var A;return{...n,finalprice:((A=r.basequote)==null?void 0:A.toFixed(2))||""}})}}catch(a){console.error(a)}},P=Array.from(new Set(B.map(a=>a.company).filter(Boolean))),t=B.filter(a=>a.company===s.providercompany).map(a=>a.area||a.address).filter(Boolean);return e.jsxs(e.Fragment,{children:[e.jsx(ke,{open:!!F,autoHideDuration:6e3,onClose:()=>v(null),anchorOrigin:{vertical:"top",horizontal:"right"},sx:{zIndex:9999},children:e.jsx(me,{onClose:()=>v(null),severity:"error",variant:"filled",sx:{width:"100%",boxShadow:3},children:F})}),e.jsxs(ne,{open:o,onClose:C?void 0:d,maxWidth:"md",fullWidth:!0,children:[e.jsx(oe,{sx:{fontWeight:800},children:"Create New Booking"}),e.jsxs(le,{dividers:!0,children:[e.jsx(g,{variant:"subtitle1",sx:{fontWeight:700,mb:1,color:"primary.main"},children:"Customer Details"}),e.jsx(i,{container:!0,spacing:2,sx:{mb:3},children:e.jsx(i,{item:!0,xs:12,children:e.jsxs(j,{sx:{display:"flex",gap:2,alignItems:"center"},children:[e.jsx(z,{options:$,sx:{flexGrow:1},getOptionLabel:a=>typeof a=="string"?a:`${a.first_name||""} ${a.last_name||""} - ${a.phone||""}`,onChange:(a,r)=>{l(r&&typeof r=="object"?n=>({...n,customer_name:`${r.first_name||""} ${r.last_name||""}`.trim(),customer_phone:r.phone||""}):n=>({...n,customer_name:"",customer_phone:""}))},renderInput:a=>e.jsx(c,{...a,label:"Select Existing Client",size:"small"})}),e.jsx(_,{variant:"outlined",startIcon:e.jsx(L,{}),onClick:()=>b(!0),sx:{whiteSpace:"nowrap"},children:"New Client"})]})})}),e.jsx(g,{variant:"subtitle1",sx:{fontWeight:700,mb:1,color:"primary.main"},children:"Assigned Provider (From Survey)"}),e.jsxs(i,{container:!0,spacing:2,sx:{mb:3},children:[e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsx(z,{options:P,value:s.providercompany,onChange:(a,r)=>l(n=>({...n,providercompany:r||"",providerlocation:""})),renderInput:a=>e.jsx(c,{...a,label:"Provider Name",size:"small"})})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsx(z,{options:t,value:s.providerlocation,onChange:(a,r)=>l(n=>({...n,providerlocation:r||""})),renderInput:a=>e.jsx(c,{...a,label:"Provider Location / Sub Hub",size:"small"}),disabled:!s.providercompany})})]}),e.jsx(g,{variant:"subtitle1",sx:{fontWeight:700,mb:1,color:"primary.main"},children:"Pickup Location"}),e.jsxs(i,{container:!0,spacing:2,sx:{mb:3},children:[e.jsx(i,{item:!0,xs:12,sm:8,children:e.jsx(c,{fullWidth:!0,label:"Pickup Address *",value:s.pickupaddress,onChange:h("pickupaddress"),size:"small"})}),e.jsx(i,{item:!0,xs:12,sm:4,children:e.jsx(c,{fullWidth:!0,label:"Pickup Pincode *",value:s.pickuppincode,onChange:h("pickuppincode"),size:"small"})})]}),e.jsx(g,{variant:"subtitle1",sx:{fontWeight:700,mb:1,color:"primary.main"},children:"Delivery Destination"}),e.jsxs(i,{container:!0,spacing:2,sx:{mb:3},children:[e.jsx(i,{item:!0,xs:12,sm:12,children:e.jsx(c,{fullWidth:!0,label:"Delivery Address",value:s.deliveryaddress,onChange:h("deliveryaddress"),size:"small"})}),e.jsx(i,{item:!0,xs:12,sm:8,children:e.jsx(z,{freeSolo:!0,options:We,value:s.deliverycity,onChange:(a,r)=>l(n=>({...n,deliverycity:r||""})),onInputChange:(a,r)=>l(n=>({...n,deliverycity:r||""})),renderInput:a=>e.jsx(c,{...a,label:"Search City",size:"small"})})}),e.jsx(i,{item:!0,xs:12,sm:4,children:e.jsx(c,{fullWidth:!0,label:"Delivery Pincode",value:s.deliverypincode,onChange:h("deliverypincode"),size:"small"})})]}),e.jsxs(j,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:1},children:[e.jsx(g,{variant:"subtitle1",sx:{fontWeight:700,color:"primary.main"},children:"Parcel Details"}),e.jsx(_,{size:"small",startIcon:e.jsx(L,{}),onClick:N,children:"Add Parcel"})]}),s.parcels.map((a,r)=>e.jsxs(i,{container:!0,spacing:2,sx:{mb:2,alignItems:"center"},children:[e.jsx(i,{item:!0,xs:12,sm:3,children:e.jsx(c,{fullWidth:!0,label:"Category (e.g. Box)",value:a.itemcategory,onChange:x(r,"itemcategory"),size:"small"})}),e.jsx(i,{item:!0,xs:6,sm:2,children:e.jsx(c,{fullWidth:!0,label:"Weight (kg)",type:"number",value:a.weight,onChange:x(r,"weight"),size:"small"})}),e.jsx(i,{item:!0,xs:6,sm:2,children:e.jsx(c,{fullWidth:!0,label:"Length (cm)",type:"number",value:a.length,onChange:x(r,"length"),size:"small"})}),e.jsx(i,{item:!0,xs:6,sm:2,children:e.jsx(c,{fullWidth:!0,label:"Width (cm)",type:"number",value:a.width,onChange:x(r,"width"),size:"small"})}),e.jsx(i,{item:!0,xs:4,sm:2,children:e.jsx(c,{fullWidth:!0,label:"Height (cm)",type:"number",value:a.height,onChange:x(r,"height"),size:"small"})}),e.jsx(i,{item:!0,xs:2,sm:1,children:e.jsx(ie,{color:"error",onClick:()=>D(r),disabled:s.parcels.length===1,children:e.jsx(ue,{})})})]},r)),e.jsxs(j,{sx:{display:"flex",gap:2,alignItems:"center",mb:1},children:[e.jsx(g,{variant:"subtitle1",sx:{fontWeight:700,color:"primary.main"},children:"Price & Insurance"}),e.jsx(_,{size:"small",variant:"outlined",onClick:M,children:"Check Price Estimate"})]}),w&&e.jsxs(g,{variant:"body2",color:"text.secondary",sx:{mb:2,px:1,borderLeft:"4px solid #3b82f6",bgcolor:"#eff6ff",py:1},children:["Estimated Base Price: ",e.jsxs("strong",{children:["₹",(p=w.basequote)==null?void 0:p.toFixed(2)]})," (Chargeable Weight: ",w.chargeableweight," kg)"]}),e.jsxs(i,{container:!0,spacing:2,sx:{mb:3},children:[e.jsx(i,{item:!0,xs:12,sm:3,children:e.jsx(c,{fullWidth:!0,label:"Final Price (₹)",type:"number",value:s.finalprice,onChange:h("finalprice"),size:"small"})}),e.jsx(i,{item:!0,xs:12,sm:9,children:e.jsxs(j,{sx:{display:"flex",gap:2,alignItems:"center"},children:[e.jsx(we,{control:e.jsx(Se,{checked:s.needsinsurance,onChange:a=>{const r=a.target.checked;l(n=>({...n,needsinsurance:r,insuranceamount:r&&n.declaredvalue?(parseFloat(n.declaredvalue)*.01).toFixed(2):n.insuranceamount}))}}),label:"Needs Insurance? (1%)",sx:{whiteSpace:"nowrap"}}),e.jsx(c,{label:"Declared Value (₹)",type:"number",size:"small",sx:{width:150},value:s.declaredvalue,onChange:a=>{const r=a.target.value;l(n=>({...n,declaredvalue:r,insuranceamount:n.needsinsurance&&r?(parseFloat(r)*.01).toFixed(2):n.insuranceamount}))}}),e.jsx(c,{label:"Insurance Amount (₹)",type:"number",size:"small",sx:{width:150},value:s.insuranceamount,onChange:h("insuranceamount")})]})})]}),e.jsx(g,{variant:"subtitle1",sx:{fontWeight:700,mb:1,color:"primary.main"},children:"Additional Information"}),e.jsxs(i,{container:!0,spacing:2,children:[e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsxs(c,{select:!0,fullWidth:!0,label:"Select Speed",value:s.service_option,onChange:h("service_option"),size:"small",children:[e.jsx(J,{value:"Normal",children:"Normal"}),e.jsx(J,{value:"Fast",children:"Fast Express"})]})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsx(c,{fullWidth:!0,label:"Notes / Remarks",value:s.notes,onChange:h("notes"),size:"small"})})]})]}),e.jsxs(ce,{sx:{px:3,py:2},children:[e.jsx(_,{onClick:d,disabled:C,children:"Cancel"}),e.jsx(_,{variant:"contained",onClick:f,disabled:C||!s.customer_phone,sx:{bgcolor:"primary.main","&:hover":{bgcolor:"primary.dark"}},children:C?"Creating...":"Create Booking"})]})]}),I&&e.jsx(ge,{open:I,mode:"create",onClose:()=>b(!1),onSaved:()=>{b(!1),y()}})]})}function ta(){const[o,d]=u.useState([]),[y,$]=u.useState([]),[B,I]=u.useState([]),[b,s]=u.useState(!0),[l,C]=u.useState(""),[k,F]=u.useState("All"),[v,w]=u.useState(!1),[S,h]=u.useState(0),[x,N]=u.useState(10),D=async()=>{s(!0);try{const[t,p,a]=await Promise.all([Re(),se().catch(()=>[]),$e().catch(()=>[])]);d(Array.isArray(t)?t:[]),$(Array.isArray(p)?p:[]),I(Array.isArray(a)?a:[])}catch(t){console.error(t)}finally{s(!1)}};u.useEffect(()=>{D()},[]);const f=o.filter(t=>{const p=(t.bookingno||"").toLowerCase().includes(l.toLowerCase())||(t.pickupaddress||"").toLowerCase().includes(l.toLowerCase())||(t.deliverycity||"").toLowerCase().includes(l.toLowerCase())||(t.providercompany||"").toLowerCase().includes(l.toLowerCase()),a=k==="All"||t.bookingsource===k;return p&&a}),M=f.slice(S*x,S*x+x),P={total:o.length,app:o.filter(t=>t.bookingsource==="Customer_App").length,crm:o.filter(t=>t.bookingsource==="CRM_Console").length,pending:o.filter(t=>t.status==="Pending_Pickup").length};return e.jsxs(e.Fragment,{children:[e.jsx(he,{title:"Bookings Management",breadcrumbs:[{label:"Bookings"}]}),e.jsxs(i,{container:!0,spacing:2.5,sx:{mb:3},children:[e.jsx(i,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(T,{accent:!0,title:"Total Bookings",value:P.total,icon:Q,color:"primary",caption:"All sources"})}),e.jsx(i,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(T,{accent:!0,title:"App Bookings",value:P.app,icon:X,color:"primary",caption:"Via customer app"})}),e.jsx(i,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(T,{accent:!0,title:"CRM Bookings",value:P.crm,icon:Y,color:"primary",caption:"Created in console"})}),e.jsx(i,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(T,{accent:!0,title:"Pending Pickup",value:P.pending,icon:Z,color:"primary",caption:"Awaiting collection"})})]}),e.jsxs(xe,{sx:{overflow:"hidden"},children:[e.jsxs(j,{sx:{px:{xs:2,sm:2.5},py:2,borderBottom:1,borderColor:"divider",display:"flex",alignItems:"center",gap:1.5,background:t=>`linear-gradient(90deg, ${t.palette.primary.lighter}66 0%, ${t.palette.background.paper} 70%)`},children:[e.jsx(j,{sx:{width:40,height:40,borderRadius:2,bgcolor:"primary.lighter",color:"primary.main",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Q,{fontSize:"small"})}),e.jsxs(j,{children:[e.jsx(g,{variant:"subtitle1",sx:{fontWeight:700,color:"grey.800",lineHeight:1.2},children:"All Bookings"}),e.jsx(g,{variant:"caption",color:"text.secondary",children:"Track and manage every shipment booking"})]})]}),e.jsxs(ae,{direction:{xs:"column",md:"row"},spacing:1.5,sx:{p:2},alignItems:{md:"center"},children:[e.jsx(c,{size:"small",placeholder:"Search bookings…",value:l,onChange:t=>{C(t.target.value),h(0)},sx:{width:{xs:"100%",md:300}},InputProps:{startAdornment:e.jsx(je,{position:"start",children:e.jsx(re,{fontSize:"small"})})}}),e.jsx(j,{sx:{flexGrow:1}}),!b&&e.jsxs(g,{variant:"body2",color:"text.secondary",children:[f.length," ",f.length===1?"booking":"bookings"]}),e.jsx(_,{variant:"contained",startIcon:e.jsx(L,{}),onClick:()=>w(!0),sx:{flex:{xs:1,md:"none"}},children:"New Booking"})]}),e.jsx(j,{sx:{px:2,borderBottom:1,borderColor:"divider"},children:e.jsxs(ve,{value:k,onChange:(t,p)=>{F(p),h(0)},"aria-label":"booking source filter tabs",children:[e.jsx(E,{label:"All Bookings",value:"All"}),e.jsx(E,{label:"App Bookings",value:"Customer_App"}),e.jsx(E,{label:"CRM Bookings",value:"CRM_Console"})]})}),b?e.jsx(j,{sx:{display:"flex",justifyContent:"center",py:6},children:e.jsx(te,{})}):f.length===0?e.jsx(pe,{title:"No bookings found",caption:"Try a different filter or search term."}):e.jsx(fe,{children:e.jsxs(ye,{children:[e.jsx(be,{children:e.jsxs(U,{sx:{"& th":{bgcolor:"grey.50",fontWeight:700,color:"grey.700",textTransform:"uppercase",fontSize:"0.72rem",letterSpacing:.4}},children:[e.jsx(m,{children:"Booking No"}),e.jsx(m,{children:"Delivery City"}),e.jsx(m,{children:"Provider"}),e.jsx(m,{children:"Source"}),e.jsx(m,{children:"Price"}),e.jsx(m,{children:"Status"})]})}),e.jsx(Ce,{children:M.map(t=>e.jsxs(U,{hover:!0,children:[e.jsx(m,{sx:{fontWeight:600},children:t.bookingno}),e.jsx(m,{children:t.deliverycity||t.deliverypincode||"N/A"}),e.jsx(m,{children:t.providercompany?e.jsx(O,{label:t.providercompany,size:"small",sx:{mr:1}}):"N/A"}),e.jsx(m,{children:e.jsx(O,{label:t.bookingsource==="CRM_Console"?"CRM":"App",size:"small",variant:"outlined",color:t.bookingsource==="CRM_Console"?"secondary":"primary"})}),e.jsx(m,{children:t.serviceoptions&&t.serviceoptions.length>0?`₹${t.serviceoptions[0].estimatedprice}`:"N/A"}),e.jsx(m,{children:e.jsx(O,{label:t.status,size:"small",color:t.status==="Pending_Pickup"?"warning":"primary"})})]},t.bookingid))})]})}),e.jsx(de,{component:"div",count:f.length,page:S,onPageChange:(t,p)=>h(p),rowsPerPage:x,onRowsPerPageChange:t=>{N(+t.target.value),h(0)},rowsPerPageOptions:[5,10,25]})]}),e.jsx(Me,{open:v,onClose:()=>w(!1),onSave:()=>{D()},clients:y,surveys:B})]})}export{ta as default}; diff --git a/dist/assets/Button-BGNvVfej.js b/dist/assets/Button-Bqp5awT1.js similarity index 98% rename from dist/assets/Button-BGNvVfej.js rename to dist/assets/Button-Bqp5awT1.js index aa28d3f..729416f 100644 --- a/dist/assets/Button-BGNvVfej.js +++ b/dist/assets/Button-Bqp5awT1.js @@ -1 +1 @@ -import{x as O,y as V,b as d,aK as _,z as j,E as F,_ as r,j as b,F as R,G as n,H as G,J as z,Z as U,Y as H,O as u}from"./index-DpAn5wLF.js";function D(o){return O("MuiButton",o)}const v=V("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),A=d.createContext({}),J=d.createContext(void 0),K=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],Y=o=>{const{color:a,disableElevation:i,fullWidth:s,size:t,variant:l,classes:c}=o,x={root:["root",l,`${l}${n(a)}`,`size${n(t)}`,`${l}Size${n(t)}`,`color${n(a)}`,i&&"disableElevation",s&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${n(t)}`],endIcon:["icon","endIcon",`iconSize${n(t)}`]},g=G(x,D,c);return r({},c,g)},k=o=>r({},o.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},o.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},o.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),Z=z(U,{shouldForwardProp:o=>H(o)||o==="classes",name:"MuiButton",slot:"Root",overridesResolver:(o,a)=>{const{ownerState:i}=o;return[a.root,a[i.variant],a[`${i.variant}${n(i.color)}`],a[`size${n(i.size)}`],a[`${i.variant}Size${n(i.size)}`],i.color==="inherit"&&a.colorInherit,i.disableElevation&&a.disableElevation,i.fullWidth&&a.fullWidth]}})(({theme:o,ownerState:a})=>{var i,s;const t=o.palette.mode==="light"?o.palette.grey[300]:o.palette.grey[800],l=o.palette.mode==="light"?o.palette.grey.A100:o.palette.grey[700];return r({},o.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(o.vars||o).shape.borderRadius,transition:o.transitions.create(["background-color","box-shadow","border-color","color"],{duration:o.transitions.duration.short}),"&:hover":r({textDecoration:"none",backgroundColor:o.vars?`rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})`:u(o.palette.text.primary,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},a.variant==="text"&&a.color!=="inherit"&&{backgroundColor:o.vars?`rgba(${o.vars.palette[a.color].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:u(o.palette[a.color].main,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},a.variant==="outlined"&&a.color!=="inherit"&&{border:`1px solid ${(o.vars||o).palette[a.color].main}`,backgroundColor:o.vars?`rgba(${o.vars.palette[a.color].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:u(o.palette[a.color].main,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},a.variant==="contained"&&{backgroundColor:o.vars?o.vars.palette.Button.inheritContainedHoverBg:l,boxShadow:(o.vars||o).shadows[4],"@media (hover: none)":{boxShadow:(o.vars||o).shadows[2],backgroundColor:(o.vars||o).palette.grey[300]}},a.variant==="contained"&&a.color!=="inherit"&&{backgroundColor:(o.vars||o).palette[a.color].dark,"@media (hover: none)":{backgroundColor:(o.vars||o).palette[a.color].main}}),"&:active":r({},a.variant==="contained"&&{boxShadow:(o.vars||o).shadows[8]}),[`&.${v.focusVisible}`]:r({},a.variant==="contained"&&{boxShadow:(o.vars||o).shadows[6]}),[`&.${v.disabled}`]:r({color:(o.vars||o).palette.action.disabled},a.variant==="outlined"&&{border:`1px solid ${(o.vars||o).palette.action.disabledBackground}`},a.variant==="contained"&&{color:(o.vars||o).palette.action.disabled,boxShadow:(o.vars||o).shadows[0],backgroundColor:(o.vars||o).palette.action.disabledBackground})},a.variant==="text"&&{padding:"6px 8px"},a.variant==="text"&&a.color!=="inherit"&&{color:(o.vars||o).palette[a.color].main},a.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},a.variant==="outlined"&&a.color!=="inherit"&&{color:(o.vars||o).palette[a.color].main,border:o.vars?`1px solid rgba(${o.vars.palette[a.color].mainChannel} / 0.5)`:`1px solid ${u(o.palette[a.color].main,.5)}`},a.variant==="contained"&&{color:o.vars?o.vars.palette.text.primary:(i=(s=o.palette).getContrastText)==null?void 0:i.call(s,o.palette.grey[300]),backgroundColor:o.vars?o.vars.palette.Button.inheritContainedBg:t,boxShadow:(o.vars||o).shadows[2]},a.variant==="contained"&&a.color!=="inherit"&&{color:(o.vars||o).palette[a.color].contrastText,backgroundColor:(o.vars||o).palette[a.color].main},a.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},a.size==="small"&&a.variant==="text"&&{padding:"4px 5px",fontSize:o.typography.pxToRem(13)},a.size==="large"&&a.variant==="text"&&{padding:"8px 11px",fontSize:o.typography.pxToRem(15)},a.size==="small"&&a.variant==="outlined"&&{padding:"3px 9px",fontSize:o.typography.pxToRem(13)},a.size==="large"&&a.variant==="outlined"&&{padding:"7px 21px",fontSize:o.typography.pxToRem(15)},a.size==="small"&&a.variant==="contained"&&{padding:"4px 10px",fontSize:o.typography.pxToRem(13)},a.size==="large"&&a.variant==="contained"&&{padding:"8px 22px",fontSize:o.typography.pxToRem(15)},a.fullWidth&&{width:"100%"})},({ownerState:o})=>o.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${v.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${v.disabled}`]:{boxShadow:"none"}}),q=z("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(o,a)=>{const{ownerState:i}=o;return[a.startIcon,a[`iconSize${n(i.size)}`]]}})(({ownerState:o})=>r({display:"inherit",marginRight:8,marginLeft:-4},o.size==="small"&&{marginLeft:-2},k(o))),Q=z("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(o,a)=>{const{ownerState:i}=o;return[a.endIcon,a[`iconSize${n(i.size)}`]]}})(({ownerState:o})=>r({display:"inherit",marginRight:-4,marginLeft:8},o.size==="small"&&{marginRight:-2},k(o))),w=d.forwardRef(function(a,i){const s=d.useContext(A),t=d.useContext(J),l=_(s,a),c=j({props:l,name:"MuiButton"}),{children:x,color:g="primary",component:C="button",className:E,disabled:f=!1,disableElevation:h=!1,disableFocusRipple:y=!1,endIcon:I,focusVisibleClassName:P,fullWidth:W=!1,size:M="medium",startIcon:$,type:B,variant:N="text"}=c,L=F(c,K),p=r({},c,{color:g,component:C,disabled:f,disableElevation:h,disableFocusRipple:y,fullWidth:W,size:M,type:B,variant:N}),e=Y(p),S=$&&b.jsx(q,{className:e.startIcon,ownerState:p,children:$}),T=I&&b.jsx(Q,{className:e.endIcon,ownerState:p,children:I}),m=t||"";return b.jsxs(Z,r({ownerState:p,className:R(s.className,e.root,E,m),component:C,disabled:f,focusRipple:!y,focusVisibleClassName:R(e.focusVisible,P),ref:i,type:B},L,{classes:e,children:[S,x,T]}))});export{w as B}; +import{x as O,y as V,b as d,aK as _,z as j,E as F,_ as r,j as b,F as R,G as n,H as G,J as z,Z as U,Y as H,O as u}from"./index-D7LVXeIK.js";function D(o){return O("MuiButton",o)}const v=V("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),A=d.createContext({}),J=d.createContext(void 0),K=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],Y=o=>{const{color:a,disableElevation:i,fullWidth:s,size:t,variant:l,classes:c}=o,x={root:["root",l,`${l}${n(a)}`,`size${n(t)}`,`${l}Size${n(t)}`,`color${n(a)}`,i&&"disableElevation",s&&"fullWidth"],label:["label"],startIcon:["icon","startIcon",`iconSize${n(t)}`],endIcon:["icon","endIcon",`iconSize${n(t)}`]},g=G(x,D,c);return r({},c,g)},k=o=>r({},o.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},o.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},o.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),Z=z(U,{shouldForwardProp:o=>H(o)||o==="classes",name:"MuiButton",slot:"Root",overridesResolver:(o,a)=>{const{ownerState:i}=o;return[a.root,a[i.variant],a[`${i.variant}${n(i.color)}`],a[`size${n(i.size)}`],a[`${i.variant}Size${n(i.size)}`],i.color==="inherit"&&a.colorInherit,i.disableElevation&&a.disableElevation,i.fullWidth&&a.fullWidth]}})(({theme:o,ownerState:a})=>{var i,s;const t=o.palette.mode==="light"?o.palette.grey[300]:o.palette.grey[800],l=o.palette.mode==="light"?o.palette.grey.A100:o.palette.grey[700];return r({},o.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(o.vars||o).shape.borderRadius,transition:o.transitions.create(["background-color","box-shadow","border-color","color"],{duration:o.transitions.duration.short}),"&:hover":r({textDecoration:"none",backgroundColor:o.vars?`rgba(${o.vars.palette.text.primaryChannel} / ${o.vars.palette.action.hoverOpacity})`:u(o.palette.text.primary,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},a.variant==="text"&&a.color!=="inherit"&&{backgroundColor:o.vars?`rgba(${o.vars.palette[a.color].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:u(o.palette[a.color].main,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},a.variant==="outlined"&&a.color!=="inherit"&&{border:`1px solid ${(o.vars||o).palette[a.color].main}`,backgroundColor:o.vars?`rgba(${o.vars.palette[a.color].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:u(o.palette[a.color].main,o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},a.variant==="contained"&&{backgroundColor:o.vars?o.vars.palette.Button.inheritContainedHoverBg:l,boxShadow:(o.vars||o).shadows[4],"@media (hover: none)":{boxShadow:(o.vars||o).shadows[2],backgroundColor:(o.vars||o).palette.grey[300]}},a.variant==="contained"&&a.color!=="inherit"&&{backgroundColor:(o.vars||o).palette[a.color].dark,"@media (hover: none)":{backgroundColor:(o.vars||o).palette[a.color].main}}),"&:active":r({},a.variant==="contained"&&{boxShadow:(o.vars||o).shadows[8]}),[`&.${v.focusVisible}`]:r({},a.variant==="contained"&&{boxShadow:(o.vars||o).shadows[6]}),[`&.${v.disabled}`]:r({color:(o.vars||o).palette.action.disabled},a.variant==="outlined"&&{border:`1px solid ${(o.vars||o).palette.action.disabledBackground}`},a.variant==="contained"&&{color:(o.vars||o).palette.action.disabled,boxShadow:(o.vars||o).shadows[0],backgroundColor:(o.vars||o).palette.action.disabledBackground})},a.variant==="text"&&{padding:"6px 8px"},a.variant==="text"&&a.color!=="inherit"&&{color:(o.vars||o).palette[a.color].main},a.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},a.variant==="outlined"&&a.color!=="inherit"&&{color:(o.vars||o).palette[a.color].main,border:o.vars?`1px solid rgba(${o.vars.palette[a.color].mainChannel} / 0.5)`:`1px solid ${u(o.palette[a.color].main,.5)}`},a.variant==="contained"&&{color:o.vars?o.vars.palette.text.primary:(i=(s=o.palette).getContrastText)==null?void 0:i.call(s,o.palette.grey[300]),backgroundColor:o.vars?o.vars.palette.Button.inheritContainedBg:t,boxShadow:(o.vars||o).shadows[2]},a.variant==="contained"&&a.color!=="inherit"&&{color:(o.vars||o).palette[a.color].contrastText,backgroundColor:(o.vars||o).palette[a.color].main},a.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},a.size==="small"&&a.variant==="text"&&{padding:"4px 5px",fontSize:o.typography.pxToRem(13)},a.size==="large"&&a.variant==="text"&&{padding:"8px 11px",fontSize:o.typography.pxToRem(15)},a.size==="small"&&a.variant==="outlined"&&{padding:"3px 9px",fontSize:o.typography.pxToRem(13)},a.size==="large"&&a.variant==="outlined"&&{padding:"7px 21px",fontSize:o.typography.pxToRem(15)},a.size==="small"&&a.variant==="contained"&&{padding:"4px 10px",fontSize:o.typography.pxToRem(13)},a.size==="large"&&a.variant==="contained"&&{padding:"8px 22px",fontSize:o.typography.pxToRem(15)},a.fullWidth&&{width:"100%"})},({ownerState:o})=>o.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${v.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${v.disabled}`]:{boxShadow:"none"}}),q=z("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(o,a)=>{const{ownerState:i}=o;return[a.startIcon,a[`iconSize${n(i.size)}`]]}})(({ownerState:o})=>r({display:"inherit",marginRight:8,marginLeft:-4},o.size==="small"&&{marginLeft:-2},k(o))),Q=z("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(o,a)=>{const{ownerState:i}=o;return[a.endIcon,a[`iconSize${n(i.size)}`]]}})(({ownerState:o})=>r({display:"inherit",marginRight:-4,marginLeft:8},o.size==="small"&&{marginRight:-2},k(o))),w=d.forwardRef(function(a,i){const s=d.useContext(A),t=d.useContext(J),l=_(s,a),c=j({props:l,name:"MuiButton"}),{children:x,color:g="primary",component:C="button",className:E,disabled:f=!1,disableElevation:h=!1,disableFocusRipple:y=!1,endIcon:I,focusVisibleClassName:P,fullWidth:W=!1,size:M="medium",startIcon:$,type:B,variant:N="text"}=c,L=F(c,K),p=r({},c,{color:g,component:C,disabled:f,disableElevation:h,disableFocusRipple:y,fullWidth:W,size:M,type:B,variant:N}),e=Y(p),S=$&&b.jsx(q,{className:e.startIcon,ownerState:p,children:$}),T=I&&b.jsx(Q,{className:e.endIcon,ownerState:p,children:I}),m=t||"";return b.jsxs(Z,r({ownerState:p,className:R(s.className,e.root,E,m),component:C,disabled:f,focusRipple:!y,focusVisibleClassName:R(e.focusVisible,P),ref:i,type:B},L,{classes:e,children:[S,x,T]}))});export{w as B}; diff --git a/dist/assets/ClientFormDialog-K7w_VS5d.js b/dist/assets/ClientFormDialog-Clwkcvac.js similarity index 99% rename from dist/assets/ClientFormDialog-K7w_VS5d.js rename to dist/assets/ClientFormDialog-Clwkcvac.js index 88bef06..1282a62 100644 --- a/dist/assets/ClientFormDialog-K7w_VS5d.js +++ b/dist/assets/ClientFormDialog-Clwkcvac.js @@ -1 +1 @@ -import{b as x,q as Wt,s as ct,v as Qe,w as Ht,_ as P,x as kt,y as wt,z as Dt,E as De,j as r,F as Te,G as ot,H as Nt,J as K,P as zt,K as Mt,L as Vt,N as fe,I as mt,O as pt,r as Bt,i as _t,u as Gt,a as Kt,T as dt,M as Ze,D as Pt,C as Tt,Q as Ut,R as qt}from"./index-DpAn5wLF.js";import{D as Jt,a as Qt,e as Zt,b as Yt,c as Xt}from"./Close-BdNf_RlN.js";import{S as eo}from"./Snackbar-B0wJYiYQ.js";import{a as to,C as oo,A as ro,G as h}from"./PageHeader-CEew5Fw4.js";import{A as no,f as Pe,o as Ot,i as ft,T as C}from"./TextField-C0dUZvW0.js";import{B as gt}from"./Button-BGNvVfej.js";const ao=o=>{const a=x.useRef({});return x.useEffect(()=>{a.current=o}),a.current};function jt(o){return typeof o.normalize<"u"?o.normalize("NFD").replace(/[\u0300-\u036f]/g,""):o}function so(o={}){const{ignoreAccents:a=!0,ignoreCase:d=!0,limit:y,matchFrom:D="any",stringify:T,trim:L=!1}=o;return(v,{inputValue:s,getOptionLabel:A})=>{let O=L?s.trim():s;d&&(O=O.toLowerCase()),a&&(O=jt(O));const W=O?v.filter(Z=>{let $=(T||A)(Z);return d&&($=$.toLowerCase()),a&&($=jt($)),D==="start"?$.indexOf(O)===0:$.indexOf(O)>-1}):v;return typeof y=="number"?W.slice(0,y):W}}function Ye(o,a){for(let d=0;d{var a;return o.current!==null&&((a=o.current.parentElement)==null?void 0:a.contains(document.activeElement))},uo=[];function co(o){const{unstable_isActiveElementInListbox:a=io,unstable_classNamePrefix:d="Mui",autoComplete:y=!1,autoHighlight:D=!1,autoSelect:T=!1,blurOnSelect:L=!1,clearOnBlur:v=!o.freeSolo,clearOnEscape:s=!1,componentName:A="useAutocomplete",defaultValue:O=o.multiple?uo:null,disableClearable:W=!1,disableCloseOnSelect:Z=!1,disabled:$,disabledItemsFocusable:ge=!1,disableListWrap:ie=!1,filterOptions:Ne=lo,filterSelectedOptions:b=!1,freeSolo:Y=!1,getOptionDisabled:i,getOptionKey:R,getOptionLabel:j=t=>{var e;return(e=t.label)!=null?e:t},groupBy:_,handleHomeEndKeys:H=!o.freeSolo,id:oe,includeInputInList:Oe=!1,inputValue:he,isOptionEqualToValue:se=(t,e)=>t===e,multiple:g=!1,onChange:U,onClose:ze,onHighlightChange:Me,onInputChange:re,onOpen:Ee,open:xt,openOnFocus:vt=!1,options:je,readOnly:ue=!1,selectOnFocus:Le=!o.freeSolo,value:Fe}=o,V=Wt(oe);let M=j;M=t=>{const e=j(t);return typeof e!="string"?String(e):e};const Ae=x.useRef(!1),We=x.useRef(!0),k=x.useRef(null),B=x.useRef(null),[me,rt]=x.useState(null),[E,$e]=x.useState(-1),He=D?0:-1,N=x.useRef(He),[u,yt]=ct({controlled:Fe,default:O,name:A}),[f,ne]=ct({controlled:he,default:"",name:A,state:"inputValue"}),[be,Ve]=x.useState(!1),ce=x.useCallback((t,e)=>{if(!(g?u.length!(b&&(g?u:[u]).some(e=>e!==null&&se(t,e)))),{inputValue:Ge&&nt?"":f,getOptionLabel:M}):[],q=ao({filteredOptions:m,value:u,inputValue:f});x.useEffect(()=>{const t=u!==q.value;be&&!t||Y&&!t||ce(null,u)},[u,ce,be,q.value,Y]);const Re=le&&m.length>0&&!ue,xe=Qe(t=>{t===-1?k.current.focus():me.querySelector(`[data-tag-index="${t}"]`).focus()});x.useEffect(()=>{g&&E>u.length-1&&($e(-1),xe(-1))},[u,g,E,xe]);function ve(t,e){if(!B.current||t<0||t>=m.length)return-1;let n=t;for(;;){const l=B.current.querySelector(`[data-option-index="${n}"]`),p=ge?!1:!l||l.disabled||l.getAttribute("aria-disabled")==="true";if(l&&l.hasAttribute("tabindex")&&!p)return n;if(e==="next"?n=(n+1)%m.length:n=(n-1+m.length)%m.length,n===t)return-1}}const X=Qe(({event:t,index:e,reason:n="auto"})=>{if(N.current=e,e===-1?k.current.removeAttribute("aria-activedescendant"):k.current.setAttribute("aria-activedescendant",`${V}-option-${e}`),Me&&Me(t,e===-1?null:m[e],n),!B.current)return;const l=B.current.querySelector(`[role="option"].${d}-focused`);l&&(l.classList.remove(`${d}-focused`),l.classList.remove(`${d}-focusVisible`));let p=B.current;if(B.current.getAttribute("role")!=="listbox"&&(p=B.current.parentElement.querySelector('[role="listbox"]')),!p)return;if(e===-1){p.scrollTop=0;return}const S=B.current.querySelector(`[data-option-index="${e}"]`);if(S&&(S.classList.add(`${d}-focused`),n==="keyboard"&&S.classList.add(`${d}-focusVisible`),p.scrollHeight>p.clientHeight&&n!=="mouse"&&n!=="touch")){const I=S,te=p.clientHeight+p.scrollTop,It=I.offsetTop+I.offsetHeight;It>te?p.scrollTop=It-p.clientHeight:I.offsetTop-I.offsetHeight*(_?1.3:0){if(!F)return;const S=ve((()=>{const I=m.length-1;if(e==="reset")return He;if(e==="start")return 0;if(e==="end")return I;const te=N.current+e;return te<0?te===-1&&Oe?-1:ie&&N.current!==-1||Math.abs(e)>1?0:I:te>I?te===I+1&&Oe?-1:ie||Math.abs(e)>1?I:0:te})(),n);if(X({index:S,reason:l,event:t}),y&&e!=="reset")if(S===-1)k.current.value=f;else{const I=M(m[S]);k.current.value=I,I.toLowerCase().indexOf(f.toLowerCase())===0&&f.length>0&&k.current.setSelectionRange(f.length,I.length)}}),ye=()=>{const t=(e,n)=>{const l=e?M(e):"",p=n?M(n):"";return l===p};if(N.current!==-1&&q.filteredOptions&&q.filteredOptions.length!==m.length&&q.inputValue===f&&(g?u.length===q.value.length&&q.value.every((e,n)=>M(u[n])===M(e)):t(q.value,u))){const e=q.filteredOptions[N.current];if(e)return Ye(m,n=>M(n)===M(e))}return-1},ke=x.useCallback(()=>{if(!F)return;const t=ye();if(t!==-1){N.current=t;return}const e=g?u[0]:u;if(m.length===0||e==null){J({diff:"reset"});return}if(B.current){if(e!=null){const n=m[N.current];if(g&&n&&Ye(u,p=>se(n,p))!==-1)return;const l=Ye(m,p=>se(p,e));l===-1?J({diff:"reset"}):X({index:l});return}if(N.current>=m.length-1){X({index:m.length-1});return}X({index:N.current})}},[m.length,g?!1:u,b,J,X,F,f,g]),at=Qe(t=>{Ht(B,t),t&&ke()});x.useEffect(()=>{ke()},[ke]);const G=t=>{le||(Be(!0),_e(!0),Ee&&Ee(t))},ae=(t,e)=>{le&&(Be(!1),ze&&ze(t,e))},ee=(t,e,n,l)=>{if(g){if(u.length===e.length&&u.every((p,S)=>p===e[S]))return}else if(u===e)return;U&&U(t,e,n,l),yt(e)},Ce=x.useRef(!1),pe=(t,e,n="selectOption",l="options")=>{let p=n,S=e;if(g){S=Array.isArray(u)?u.slice():[];const I=Ye(S,te=>se(e,te));I===-1?S.push(e):l!=="freeSolo"&&(S.splice(I,1),p="removeOption")}ce(t,S),ee(t,S,p,{option:e}),!Z&&(!t||!t.ctrlKey&&!t.metaKey)&&ae(t,p),(L===!0||L==="touch"&&Ce.current||L==="mouse"&&!Ce.current)&&k.current.blur()};function Ke(t,e){if(t===-1)return-1;let n=t;for(;;){if(e==="next"&&n===u.length||e==="previous"&&n===-1)return-1;const l=me.querySelector(`[data-tag-index="${n}"]`);if(!l||!l.hasAttribute("tabindex")||l.disabled||l.getAttribute("aria-disabled")==="true")n+=e==="next"?1:-1;else return n}}const Ue=(t,e)=>{if(!g)return;f===""&&ae(t,"toggleInput");let n=E;E===-1?f===""&&e==="previous"&&(n=u.length-1):(n+=e==="next"?1:-1,n<0&&(n=0),n===u.length&&(n=-1)),n=Ke(n,e),$e(n),xe(n)},qe=t=>{Ae.current=!0,ne(""),re&&re(t,"","clear"),ee(t,g?[]:null,"clear")},st=t=>e=>{if(t.onKeyDown&&t.onKeyDown(e),!e.defaultMuiPrevented&&(E!==-1&&["ArrowLeft","ArrowRight"].indexOf(e.key)===-1&&($e(-1),xe(-1)),e.which!==229))switch(e.key){case"Home":F&&H&&(e.preventDefault(),J({diff:"start",direction:"next",reason:"keyboard",event:e}));break;case"End":F&&H&&(e.preventDefault(),J({diff:"end",direction:"previous",reason:"keyboard",event:e}));break;case"PageUp":e.preventDefault(),J({diff:-Lt,direction:"previous",reason:"keyboard",event:e}),G(e);break;case"PageDown":e.preventDefault(),J({diff:Lt,direction:"next",reason:"keyboard",event:e}),G(e);break;case"ArrowDown":e.preventDefault(),J({diff:1,direction:"next",reason:"keyboard",event:e}),G(e);break;case"ArrowUp":e.preventDefault(),J({diff:-1,direction:"previous",reason:"keyboard",event:e}),G(e);break;case"ArrowLeft":Ue(e,"previous");break;case"ArrowRight":Ue(e,"next");break;case"Enter":if(N.current!==-1&&F){const n=m[N.current],l=i?i(n):!1;if(e.preventDefault(),l)return;pe(e,n,"selectOption"),y&&k.current.setSelectionRange(k.current.value.length,k.current.value.length)}else Y&&f!==""&&Ge===!1&&(g&&e.preventDefault(),pe(e,f,"createOption","freeSolo"));break;case"Escape":F?(e.preventDefault(),e.stopPropagation(),ae(e,"escape")):s&&(f!==""||g&&u.length>0)&&(e.preventDefault(),e.stopPropagation(),qe(e));break;case"Backspace":if(g&&!ue&&f===""&&u.length>0){const n=E===-1?u.length-1:E,l=u.slice();l.splice(n,1),ee(e,l,"removeOption",{option:u[n]})}break;case"Delete":if(g&&!ue&&f===""&&u.length>0&&E!==-1){const n=E,l=u.slice();l.splice(n,1),ee(e,l,"removeOption",{option:u[n]})}break}},Ct=t=>{Ve(!0),vt&&!Ae.current&&G(t)},Se=t=>{if(a(B)){k.current.focus();return}Ve(!1),We.current=!0,Ae.current=!1,T&&N.current!==-1&&F?pe(t,m[N.current],"blur"):T&&Y&&f!==""?pe(t,f,"blur","freeSolo"):v&&ce(t,u),ae(t,"blur")},z=t=>{const e=t.target.value;f!==e&&(ne(e),_e(!1),re&&re(t,e,"input")),e===""?!W&&!g&&ee(t,null,"clear"):G(t)},w=t=>{const e=Number(t.currentTarget.getAttribute("data-option-index"));N.current!==e&&X({event:t,index:e,reason:"mouse"})},Q=t=>{X({event:t,index:Number(t.currentTarget.getAttribute("data-option-index")),reason:"touch"}),Ce.current=!0},St=t=>{const e=Number(t.currentTarget.getAttribute("data-option-index"));pe(t,m[e],"selectOption"),Ce.current=!1},lt=t=>e=>{const n=u.slice();n.splice(t,1),ee(e,n,"removeOption",{option:u[t]})},it=t=>{le?ae(t,"toggleInput"):G(t)},ut=t=>{t.currentTarget.contains(t.target)&&t.target.getAttribute("id")!==V&&t.preventDefault()},Je=t=>{t.currentTarget.contains(t.target)&&(k.current.focus(),Le&&We.current&&k.current.selectionEnd-k.current.selectionStart===0&&k.current.select(),We.current=!1)},we=t=>{!$&&(f===""||!le)&&it(t)};let de=Y&&f.length>0;de=de||(g?u.length>0:u!==null);let Ie=m;return _&&(Ie=m.reduce((t,e,n)=>{const l=_(e);return t.length>0&&t[t.length-1].group===l?t[t.length-1].options.push(e):t.push({key:n,index:n,group:l,options:[e]}),t},[])),$&&be&&Se(),{getRootProps:(t={})=>P({"aria-owns":Re?`${V}-listbox`:null},t,{onKeyDown:st(t),onMouseDown:ut,onClick:Je}),getInputLabelProps:()=>({id:`${V}-label`,htmlFor:V}),getInputProps:()=>({id:V,value:f,onBlur:Se,onFocus:Ct,onChange:z,onMouseDown:we,"aria-activedescendant":F?"":null,"aria-autocomplete":y?"both":"list","aria-controls":Re?`${V}-listbox`:void 0,"aria-expanded":Re,autoComplete:"off",ref:k,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:$}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:qe}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:it}),getTagProps:({index:t})=>P({key:t,"data-tag-index":t,tabIndex:-1},!ue&&{onDelete:lt(t)}),getListboxProps:()=>({role:"listbox",id:`${V}-listbox`,"aria-labelledby":`${V}-label`,ref:at,onMouseDown:t=>{t.preventDefault()}}),getOptionProps:({index:t,option:e})=>{var n;const l=(g?u:[u]).some(S=>S!=null&&se(e,S)),p=i?i(e):!1;return{key:(n=R==null?void 0:R(e))!=null?n:M(e),tabIndex:-1,role:"option",id:`${V}-option-${t}`,onMouseMove:w,onClick:St,onTouchStart:Q,"data-option-index":t,"aria-disabled":p,"aria-selected":l}},id:V,inputValue:f,value:u,dirty:de,expanded:F&&me,popupOpen:F,focused:be||E!==-1,anchorEl:me,setAnchorEl:rt,focusedTag:E,groupedOptions:Ie}}function po(o){return kt("MuiListSubheader",o)}wt("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const fo=["className","color","component","disableGutters","disableSticky","inset"],go=o=>{const{classes:a,color:d,disableGutters:y,inset:D,disableSticky:T}=o,L={root:["root",d!=="default"&&`color${ot(d)}`,!y&&"gutters",D&&"inset",!T&&"sticky"]};return Nt(L,po,a)},ho=K("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(o,a)=>{const{ownerState:d}=o;return[a.root,d.color!=="default"&&a[`color${ot(d.color)}`],!d.disableGutters&&a.gutters,d.inset&&a.inset,!d.disableSticky&&a.sticky]}})(({theme:o,ownerState:a})=>P({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(o.vars||o).palette.text.secondary,fontFamily:o.typography.fontFamily,fontWeight:o.typography.fontWeightMedium,fontSize:o.typography.pxToRem(14)},a.color==="primary"&&{color:(o.vars||o).palette.primary.main},a.color==="inherit"&&{color:"inherit"},!a.disableGutters&&{paddingLeft:16,paddingRight:16},a.inset&&{paddingLeft:72},!a.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(o.vars||o).palette.background.paper})),Et=x.forwardRef(function(a,d){const y=Dt({props:a,name:"MuiListSubheader"}),{className:D,color:T="default",component:L="li",disableGutters:v=!1,disableSticky:s=!1,inset:A=!1}=y,O=De(y,fo),W=P({},y,{color:T,component:L,disableGutters:v,disableSticky:s,inset:A}),Z=go(W);return r.jsx(ho,P({as:L,className:Te(Z.root,D),ref:d,ownerState:W},O))});Et.muiSkipListHighlight=!0;function mo(o){return kt("MuiAutocomplete",o)}const c=wt("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var At,$t;const bo=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionKey","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],xo=["ref"],vo=["key"],yo=["key"],Co=o=>{const{classes:a,disablePortal:d,expanded:y,focused:D,fullWidth:T,hasClearIcon:L,hasPopupIcon:v,inputFocused:s,popupOpen:A,size:O}=o,W={root:["root",y&&"expanded",D&&"focused",T&&"fullWidth",L&&"hasClearIcon",v&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",s&&"inputFocused"],tag:["tag",`tagSize${ot(O)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",A&&"popupIndicatorOpen"],popper:["popper",d&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Nt(W,mo,a)},So=K("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(o,a)=>{const{ownerState:d}=o,{fullWidth:y,hasClearIcon:D,hasPopupIcon:T,inputFocused:L,size:v}=d;return[{[`& .${c.tag}`]:a.tag},{[`& .${c.tag}`]:a[`tagSize${ot(v)}`]},{[`& .${c.inputRoot}`]:a.inputRoot},{[`& .${c.input}`]:a.input},{[`& .${c.input}`]:L&&a.inputFocused},a.root,y&&a.fullWidth,T&&a.hasPopupIcon,D&&a.hasClearIcon]}})({[`&.${c.focused} .${c.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${c.clearIndicator}`]:{visibility:"visible"}},[`& .${c.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${c.inputRoot}`]:{[`.${c.hasPopupIcon}&, .${c.hasClearIcon}&`]:{paddingRight:30},[`.${c.hasPopupIcon}.${c.hasClearIcon}&`]:{paddingRight:56},[`& .${c.input}`]:{width:0,minWidth:30}},[`& .${ft.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${ft.root}.${fe.sizeSmall}`]:{[`& .${ft.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Ot.root}`]:{padding:9,[`.${c.hasPopupIcon}&, .${c.hasClearIcon}&`]:{paddingRight:39},[`.${c.hasPopupIcon}.${c.hasClearIcon}&`]:{paddingRight:65},[`& .${c.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${c.endAdornment}`]:{right:9}},[`& .${Ot.root}.${fe.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${c.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${Pe.root}`]:{paddingTop:19,paddingLeft:8,[`.${c.hasPopupIcon}&, .${c.hasClearIcon}&`]:{paddingRight:39},[`.${c.hasPopupIcon}.${c.hasClearIcon}&`]:{paddingRight:65},[`& .${Pe.input}`]:{padding:"7px 4px"},[`& .${c.endAdornment}`]:{right:9}},[`& .${Pe.root}.${fe.sizeSmall}`]:{paddingBottom:1,[`& .${Pe.input}`]:{padding:"2.5px 4px"}},[`& .${fe.hiddenLabel}`]:{paddingTop:8},[`& .${Pe.root}.${fe.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${c.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${Pe.root}.${fe.hiddenLabel}.${fe.sizeSmall}`]:{[`& .${c.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${c.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${c.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${c.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${c.inputRoot}`]:{flexWrap:"wrap"}}}]}),Io=K("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(o,a)=>a.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),Po=K(mt,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(o,a)=>a.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),To=K(mt,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:o},a)=>P({},a.popupIndicator,o.popupOpen&&a.popupIndicatorOpen)})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),Oo=K(Mt,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(o,a)=>{const{ownerState:d}=o;return[{[`& .${c.option}`]:a.option},a.popper,d.disablePortal&&a.popperDisablePortal]}})(({theme:o})=>({zIndex:(o.vars||o).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]})),jo=K(zt,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(o,a)=>a.paper})(({theme:o})=>P({},o.typography.body1,{overflow:"auto"})),Lo=K("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(o,a)=>a.loading})(({theme:o})=>({color:(o.vars||o).palette.text.secondary,padding:"14px 16px"})),Ao=K("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(o,a)=>a.noOptions})(({theme:o})=>({color:(o.vars||o).palette.text.secondary,padding:"14px 16px"})),$o=K("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(o,a)=>a.listbox})(({theme:o})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${c.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[o.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${c.focused}`]:{backgroundColor:(o.vars||o).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(o.vars||o).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${c.focusVisible}`]:{backgroundColor:(o.vars||o).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / ${o.vars.palette.action.selectedOpacity})`:pt(o.palette.primary.main,o.palette.action.selectedOpacity),[`&.${c.focused}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.hoverOpacity}))`:pt(o.palette.primary.main,o.palette.action.selectedOpacity+o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(o.vars||o).palette.action.selected}},[`&.${c.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.focusOpacity}))`:pt(o.palette.primary.main,o.palette.action.selectedOpacity+o.palette.action.focusOpacity)}}}})),Ro=K(Et,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(o,a)=>a.groupLabel})(({theme:o})=>({backgroundColor:(o.vars||o).palette.background.paper,top:-8})),ko=K("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(o,a)=>a.groupUl})({padding:0,[`& .${c.option}`]:{paddingLeft:24}}),Xe=x.forwardRef(function(a,d){var y,D,T,L;const v=Dt({props:a,name:"MuiAutocomplete"}),{autoComplete:s=!1,autoHighlight:A=!1,autoSelect:O=!1,blurOnSelect:W=!1,ChipProps:Z,className:$,clearIcon:ge=At||(At=r.jsx(to,{fontSize:"small"})),clearOnBlur:ie=!v.freeSolo,clearOnEscape:Ne=!1,clearText:b="Clear",closeText:Y="Close",componentsProps:i={},defaultValue:R=v.multiple?[]:null,disableClearable:j=!1,disableCloseOnSelect:_=!1,disabled:H=!1,disabledItemsFocusable:oe=!1,disableListWrap:Oe=!1,disablePortal:he=!1,filterSelectedOptions:se=!1,forcePopupIcon:g="auto",freeSolo:U=!1,fullWidth:ze=!1,getLimitTagsText:Me=e=>`+${e}`,getOptionLabel:re,groupBy:Ee,handleHomeEndKeys:xt=!v.freeSolo,includeInputInList:vt=!1,limitTags:je=-1,ListboxComponent:ue="ul",ListboxProps:Le,loading:Fe=!1,loadingText:V="Loading…",multiple:M=!1,noOptionsText:Ae="No options",openOnFocus:We=!1,openText:k="Open",PaperComponent:B=zt,PopperComponent:me=Mt,popupIcon:rt=$t||($t=r.jsx(no,{})),readOnly:E=!1,renderGroup:$e,renderInput:He,renderOption:N,renderTags:u,selectOnFocus:yt=!v.freeSolo,size:f="medium",slotProps:ne={}}=v,be=De(v,bo),{getRootProps:Ve,getInputProps:ce,getInputLabelProps:le,getPopupIndicatorProps:Be,getClearProps:nt,getTagProps:_e,getListboxProps:Ge,getOptionProps:F,value:m,dirty:q,expanded:Re,id:xe,popupOpen:ve,focused:X,focusedTag:J,anchorEl:ye,setAnchorEl:ke,inputValue:at,groupedOptions:G}=co(P({},v,{componentName:"Autocomplete"})),ae=!j&&!H&&q&&!E,ee=(!U||g===!0)&&g!==!1,{onMouseDown:Ce}=ce(),{ref:pe}=Le??{},Ke=Ge(),{ref:Ue}=Ke,qe=De(Ke,xo),st=Vt(Ue,pe),Se=re||(e=>{var n;return(n=e.label)!=null?n:e}),z=P({},v,{disablePortal:he,expanded:Re,focused:X,fullWidth:ze,getOptionLabel:Se,hasClearIcon:ae,hasPopupIcon:ee,inputFocused:J===-1,popupOpen:ve,size:f}),w=Co(z);let Q;if(M&&m.length>0){const e=n=>P({className:w.tag,disabled:H},_e(n));u?Q=u(m,e,z):Q=m.map((n,l)=>{const p=e({index:l}),{key:S}=p,I=De(p,vo);return r.jsx(oo,P({label:Se(n),size:f},I,Z),S)})}if(je>-1&&Array.isArray(Q)){const e=Q.length-je;!X&&e>0&&(Q=Q.splice(0,je),Q.push(r.jsx("span",{className:w.tag,children:Me(e)},Q.length)))}const lt=$e||(e=>r.jsxs("li",{children:[r.jsx(Ro,{className:w.groupLabel,ownerState:z,component:"div",children:e.group}),r.jsx(ko,{className:w.groupUl,ownerState:z,children:e.children})]},e.key)),ut=N||((e,n)=>{const{key:l}=e,p=De(e,yo);return r.jsx("li",P({},p,{children:Se(n)}),l)}),Je=(e,n)=>{const l=F({option:e,index:n});return ut(P({},l,{className:w.option}),e,{selected:l["aria-selected"],index:n,inputValue:at},z)},we=(y=ne.clearIndicator)!=null?y:i.clearIndicator,de=(D=ne.paper)!=null?D:i.paper,Ie=(T=ne.popper)!=null?T:i.popper,t=(L=ne.popupIndicator)!=null?L:i.popupIndicator;return r.jsxs(x.Fragment,{children:[r.jsx(So,P({ref:d,className:Te(w.root,$),ownerState:z},Ve(be),{children:He({id:xe,disabled:H,fullWidth:!0,size:f==="small"?"small":void 0,InputLabelProps:le(),InputProps:P({ref:ke,className:w.inputRoot,startAdornment:Q,onClick:e=>{e.target===e.currentTarget&&Ce(e)}},(ae||ee)&&{endAdornment:r.jsxs(Io,{className:w.endAdornment,ownerState:z,children:[ae?r.jsx(Po,P({},nt(),{"aria-label":b,title:b,ownerState:z},we,{className:Te(w.clearIndicator,we==null?void 0:we.className),children:ge})):null,ee?r.jsx(To,P({},Be(),{disabled:H,"aria-label":ve?Y:k,title:ve?Y:k,ownerState:z},t,{className:Te(w.popupIndicator,t==null?void 0:t.className),children:rt})):null]})}),inputProps:P({className:w.input,disabled:H,readOnly:E},ce())})})),ye?r.jsx(Oo,P({as:me,disablePortal:he,style:{width:ye?ye.clientWidth:null},ownerState:z,role:"presentation",anchorEl:ye,open:ve},Ie,{className:Te(w.popper,Ie==null?void 0:Ie.className),children:r.jsxs(jo,P({ownerState:z,as:B},de,{className:Te(w.paper,de==null?void 0:de.className),children:[Fe&&G.length===0?r.jsx(Lo,{className:w.loading,ownerState:z,children:V}):null,G.length===0&&!U&&!Fe?r.jsx(Ao,{className:w.noOptions,ownerState:z,role:"presentation",onMouseDown:e=>{e.preventDefault()},children:Ae}):null,G.length>0?r.jsx($o,P({as:ue,className:w.listbox,ownerState:z},qe,Le,{ref:st,children:G.map((e,n)=>Ee?lt({key:e.key,group:e.group,children:e.options.map((l,p)=>Je(l,e.index+p))}):Je(e,n))})):null]}))})):null]})});var bt={},wo=_t;Object.defineProperty(bt,"__esModule",{value:!0});var Ft=bt.default=void 0,Do=wo(Bt()),No=r;Ft=bt.default=(0,Do.default)((0,No.jsx)("path",{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7"}),"MyLocation");const zo=["retail","wholesale","manufacturer","distributor","services","ecommerce","other"],Mo=["newClient","contacted","onboarded","lost"],Eo=["Daily","Weekly","Bi-weekly","Monthly","On-demand"],Fo=["basicOnly","full","none"],Wo=["Blue Dart","Delhivery","DTDC","India Post / Speed Post","The Professional Couriers","XpressBees","Ecom Express","Shadowfax","Safexpress","VRL Logistics","TCI (Transport Corporation of India)","Om Logistics","Best Roadways","MSS (Mettur Super Services)","ABT Travels & Logistics","Navata Road Transport","KRS (Kerala Roadways)","Parveen Travels / Parveen Express","SRM Transports","KPN Travels & KPN Speed Parcel","SRS Travels","Hindusthan Travels","City Travels","Essaar Travels","No. 1 Air Travels","A1 Travels","Krish Travels","Hebron Transports","Horma Travels","Vivegam Travels","PSS Transport","SRT (Renugambal Travels)","Thamarai Bus Transports","Rathimeena Travels","Ganesh Travels","John Kennedy Bus Service","Arun Travel","Saaji Meera Roadways","ARC Parcel Service","Chakra Travels & Parcel Service","MVA Parcel And Bus Service","Shrinath Travels & Cargo","Hans Travels","Zingbus","Kalpana Travels / City Land Travels","Trackon Couriers","North India Transways","RSRTC Cargo","UPSRTC Cargo"],ht=["Chennai","Coimbatore","Madurai","Tiruchirappalli","Salem","Tuticorin","Tirupur","Erode","Vellore","Tirunelveli","Thanjavur","Dindigul","Hosur","Nagercoil","Karur","Namakkal","Kanchipuram","Cuddalore","Thoothukudi","Bengaluru","Mysuru","Mangaluru","Hubli","Belagavi","Kalaburagi","Davangere","Ballari","Kochi","Thiruvananthapuram","Kozhikode","Kannur","Thrissur","Kollam","Hyderabad","Warangal","Visakhapatnam","Vijayawada","Tirupati","Guntur","Rajahmundry","Nellore","Mumbai","Pune","Nagpur","Nashik","Aurangabad","Kolhapur","Solapur","New Delhi","Gurugram","Noida","Faridabad","Chandigarh","Amritsar","Ludhiana","Jalandhar","Ahmedabad","Surat","Vadodara","Rajkot","Bhavnagar","Jamnagar","Jaipur","Jodhpur","Udaipur","Kota","Bikaner","Lucknow","Kanpur","Varanasi","Agra","Prayagraj","Gorakhpur","Bhopal","Indore","Gwalior","Jabalpur","Raipur","Kolkata","Siliguri","Durgapur","Patna","Gaya","Ranchi","Jamshedpur","Bhubaneswar","Cuttack","Guwahati","Dibrugarh","Agartala","Imphal","Shillong","Aizawl","Dimapur","Dehradun","Haridwar","Shimla","Srinagar","Jammu","Leh","Panaji","Puducherry","Port Blair"],Rt={name:"",email:"",password:"",phone:"",city:"",businessState:"",businessType:"retail",status:"newClient",frequency:"Daily",parcelVolume:0,activeContracts:0,provider:"",efficiency:"",logisticsSegment:"",transitFrom:"",transitTo:"",neighbourhood:"",surveyAddress:"",surveyLat:"",surveyLng:"",dataConsent:"full",notes:"",pincode:""},et=o=>typeof o=="string"?o.charAt(0).toUpperCase()+o.slice(1).replace(/([A-Z])/g," $1").trim():o,tt=(o,a)=>a&&!o.includes(a)?[a,...o]:o;function Uo({open:o,mode:a,initial:d,onClose:y,onSaved:D}){const T=a==="edit",L=Gt(),v=Kt(L.breakpoints.down("sm")),[s,A]=x.useState(Rt),[O,W]=x.useState(!1),[Z,$]=x.useState(null),[ge,ie]=x.useState(!1),Ne=()=>{if(!navigator.geolocation){alert("Geolocation is not supported by your browser");return}ie(!0),navigator.geolocation.getCurrentPosition(async i=>{const R=i.coords.latitude,j=i.coords.longitude;A(_=>({..._,surveyLat:R,surveyLng:j}));try{const H=await(await fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${R}&lon=${j}`)).json();if(H&&H.address){const oe=H.address,Oe=oe.city||oe.town||oe.village||oe.county||"",he=oe.state||"",se=oe.postcode||"",g=H.display_name||"";A(U=>({...U,city:Oe||U.city,businessState:he||U.businessState,pincode:se||U.pincode,surveyAddress:g||U.surveyAddress}))}}catch(_){console.error("Reverse geocoding failed",_)}finally{ie(!1)}},i=>{alert("Unable to retrieve your location"),ie(!1)})};x.useEffect(()=>{o&&(A({...Rt,...d||{}}),$(null))},[o,d]);const b=i=>R=>A(j=>({...j,[i]:R.target.value})),Y=async()=>{if(!s.name.trim()){$("Client name is required.");return}W(!0),$(null);const i=s.surveyLat===""?void 0:Number(s.surveyLat),R=s.surveyLng===""?void 0:Number(s.surveyLng),j={first_name:s.name.trim(),phone:s.phone,city:s.city,businessState:s.businessState,businessType:s.businessType,status:s.status,frequency:s.frequency,parcelVolume:Number(s.parcelVolume)||0,activeContracts:Number(s.activeContracts)||0,provider:s.provider,efficiency:s.efficiency,logisticsSegment:s.logisticsSegment,transitFrom:s.transitFrom,transitTo:s.transitTo,neighbourhood:s.neighbourhood,pincode:s.pincode,surveyAddress:s.surveyAddress,dataConsent:s.dataConsent,notes:s.notes,lastUpdated:new Date().toISOString().slice(0,10),registration_source:"web",...s.email.trim()?{email:s.email.trim()}:{},...i!=null?{survey_lat:i}:{},...R!=null?{survey_long:R}:{}};try{T?await Ut(d.id,j):await qt({...j,...s.password?{password:s.password}:{}}),D()}catch(_){$(_.message||"Failed to save client")}finally{W(!1)}};return r.jsxs(r.Fragment,{children:[r.jsx(eo,{open:!!Z,autoHideDuration:6e3,onClose:()=>$(null),anchorOrigin:{vertical:"top",horizontal:"right"},sx:{zIndex:9999},children:r.jsx(ro,{onClose:()=>$(null),severity:"error",variant:"filled",sx:{width:"100%",boxShadow:3},children:Z})}),r.jsxs(Jt,{open:o,onClose:O?void 0:y,maxWidth:"md",fullWidth:!0,fullScreen:typeof v<"u"?v:!1,children:[r.jsxs(Qt,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[T?"Edit Client":"Add Client",r.jsx(mt,{onClick:y,size:"small",disabled:O,children:r.jsx(Zt,{})})]}),r.jsxs(Yt,{dividers:!0,children:[r.jsx(dt,{variant:"overline",color:"text.secondary",children:"Business"}),r.jsxs(h,{container:!0,spacing:2,sx:{mt:0,mb:1},children:[r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Client Name *",value:s.name,onChange:b("name")})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Phone",value:s.phone,onChange:b("phone")})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Email",value:s.email,onChange:b("email")})}),!T&&r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Password",type:"password",value:s.password,onChange:b("password")})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{select:!0,fullWidth:!0,size:"small",label:"Business Type",value:s.businessType,onChange:b("businessType"),children:tt(zo,s.businessType).map(i=>r.jsx(Ze,{value:i,children:et(i)},i))})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{select:!0,fullWidth:!0,size:"small",label:"Status",value:s.status,onChange:b("status"),children:tt(Mo,s.status).map(i=>r.jsx(Ze,{value:i,children:et(i)},i))})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{select:!0,fullWidth:!0,size:"small",label:"Order Frequency",value:s.frequency,onChange:b("frequency"),children:tt(Eo,s.frequency).map(i=>r.jsx(Ze,{value:i,children:et(i)},i))})}),r.jsx(h,{item:!0,xs:12,sm:3,children:r.jsx(C,{fullWidth:!0,size:"small",type:"number",label:"Parcel Volume",value:s.parcelVolume,onChange:b("parcelVolume")})}),r.jsx(h,{item:!0,xs:12,sm:3,children:r.jsx(C,{fullWidth:!0,size:"small",type:"number",label:"Active Contracts",value:s.activeContracts,onChange:b("activeContracts")})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(Xe,{autoHighlight:!0,options:Wo,value:s.provider||null,onChange:(i,R)=>A(j=>({...j,provider:R||""})),renderInput:i=>r.jsx(C,{...i,fullWidth:!0,size:"small",label:"Current Provider"})})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Efficiency",value:s.efficiency,onChange:b("efficiency")})}),r.jsx(h,{item:!0,xs:12,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Logistics Segment",value:s.logisticsSegment,onChange:b("logisticsSegment"),placeholder:"First Mile, Last Mile"})})]}),r.jsx(Pt,{sx:{my:1.5}}),r.jsx(dt,{variant:"overline",color:"text.secondary",children:"Location & Transit"}),r.jsxs(h,{container:!0,spacing:2,sx:{mt:0,mb:1},children:[r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(Xe,{autoHighlight:!0,options:ht,value:s.city||null,onChange:(i,R)=>A(j=>({...j,city:R||""})),renderInput:i=>r.jsx(C,{...i,fullWidth:!0,size:"small",label:"City"})})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{fullWidth:!0,size:"small",label:"State",value:s.businessState,onChange:b("businessState")})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Pincode",value:s.pincode,onChange:b("pincode")})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Neighbourhood / Zone",value:s.neighbourhood,onChange:b("neighbourhood")})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(Xe,{autoHighlight:!0,options:ht,value:s.transitFrom||null,onChange:(i,R)=>A(j=>({...j,transitFrom:R||""})),renderInput:i=>r.jsx(C,{...i,fullWidth:!0,size:"small",label:"Transit From"})})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(Xe,{autoHighlight:!0,options:ht,value:s.transitTo||null,onChange:(i,R)=>A(j=>({...j,transitTo:R||""})),renderInput:i=>r.jsx(C,{...i,fullWidth:!0,size:"small",label:"Transit To"})})}),r.jsx(h,{item:!0,xs:12,sm:3,children:r.jsx(C,{fullWidth:!0,size:"small",type:"number",label:"Latitude",value:s.surveyLat,onChange:b("surveyLat")})}),r.jsx(h,{item:!0,xs:12,sm:3,children:r.jsx(C,{fullWidth:!0,size:"small",type:"number",label:"Longitude",value:s.surveyLng,onChange:b("surveyLng")})}),r.jsx(h,{item:!0,xs:12,sm:6,display:"flex",alignItems:"center",children:r.jsx(gt,{variant:"outlined",size:"small",onClick:Ne,disabled:ge,startIcon:ge?r.jsx(Tt,{size:16}):r.jsx(Ft,{}),fullWidth:!0,children:"Get GPS Location"})}),r.jsx(h,{item:!0,xs:12,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Survey Address",value:s.surveyAddress,onChange:b("surveyAddress"),multiline:!0,minRows:2})})]}),r.jsx(Pt,{sx:{my:1.5}}),r.jsx(dt,{variant:"overline",color:"text.secondary",children:"Other"}),r.jsxs(h,{container:!0,spacing:2,sx:{mt:0},children:[r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{select:!0,fullWidth:!0,size:"small",label:"Data Consent",value:s.dataConsent,onChange:b("dataConsent"),children:tt(Fo,s.dataConsent).map(i=>r.jsx(Ze,{value:i,children:et(i)},i))})}),r.jsx(h,{item:!0,xs:12,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Notes",value:s.notes,onChange:b("notes"),multiline:!0,minRows:2})})]})]}),r.jsxs(Xt,{sx:{px:3,py:2},children:[r.jsx(gt,{onClick:y,disabled:O,children:"Cancel"}),r.jsx(gt,{variant:"contained",onClick:Y,disabled:O,startIcon:O?r.jsx(Tt,{size:16,color:"inherit"}):null,children:T?"Save Changes":"Create Client"})]})]})]})}export{Xe as A,Uo as C}; +import{b as x,q as Wt,s as ct,v as Qe,w as Ht,_ as P,x as kt,y as wt,z as Dt,E as De,j as r,F as Te,G as ot,H as Nt,J as K,P as zt,K as Mt,L as Vt,N as fe,I as mt,O as pt,r as Bt,i as _t,u as Gt,a as Kt,T as dt,M as Ze,D as Pt,C as Tt,Q as Ut,R as qt}from"./index-D7LVXeIK.js";import{D as Jt,a as Qt,e as Zt,b as Yt,c as Xt}from"./Close-D3HB9j5y.js";import{S as eo}from"./Snackbar-DOheZfWW.js";import{a as to,C as oo,A as ro,G as h}from"./PageHeader-naLAT9xr.js";import{A as no,f as Pe,o as Ot,i as ft,T as C}from"./TextField-Sd_pshci.js";import{B as gt}from"./Button-Bqp5awT1.js";const ao=o=>{const a=x.useRef({});return x.useEffect(()=>{a.current=o}),a.current};function jt(o){return typeof o.normalize<"u"?o.normalize("NFD").replace(/[\u0300-\u036f]/g,""):o}function so(o={}){const{ignoreAccents:a=!0,ignoreCase:d=!0,limit:y,matchFrom:D="any",stringify:T,trim:L=!1}=o;return(v,{inputValue:s,getOptionLabel:A})=>{let O=L?s.trim():s;d&&(O=O.toLowerCase()),a&&(O=jt(O));const W=O?v.filter(Z=>{let $=(T||A)(Z);return d&&($=$.toLowerCase()),a&&($=jt($)),D==="start"?$.indexOf(O)===0:$.indexOf(O)>-1}):v;return typeof y=="number"?W.slice(0,y):W}}function Ye(o,a){for(let d=0;d{var a;return o.current!==null&&((a=o.current.parentElement)==null?void 0:a.contains(document.activeElement))},uo=[];function co(o){const{unstable_isActiveElementInListbox:a=io,unstable_classNamePrefix:d="Mui",autoComplete:y=!1,autoHighlight:D=!1,autoSelect:T=!1,blurOnSelect:L=!1,clearOnBlur:v=!o.freeSolo,clearOnEscape:s=!1,componentName:A="useAutocomplete",defaultValue:O=o.multiple?uo:null,disableClearable:W=!1,disableCloseOnSelect:Z=!1,disabled:$,disabledItemsFocusable:ge=!1,disableListWrap:ie=!1,filterOptions:Ne=lo,filterSelectedOptions:b=!1,freeSolo:Y=!1,getOptionDisabled:i,getOptionKey:R,getOptionLabel:j=t=>{var e;return(e=t.label)!=null?e:t},groupBy:_,handleHomeEndKeys:H=!o.freeSolo,id:oe,includeInputInList:Oe=!1,inputValue:he,isOptionEqualToValue:se=(t,e)=>t===e,multiple:g=!1,onChange:U,onClose:ze,onHighlightChange:Me,onInputChange:re,onOpen:Ee,open:xt,openOnFocus:vt=!1,options:je,readOnly:ue=!1,selectOnFocus:Le=!o.freeSolo,value:Fe}=o,V=Wt(oe);let M=j;M=t=>{const e=j(t);return typeof e!="string"?String(e):e};const Ae=x.useRef(!1),We=x.useRef(!0),k=x.useRef(null),B=x.useRef(null),[me,rt]=x.useState(null),[E,$e]=x.useState(-1),He=D?0:-1,N=x.useRef(He),[u,yt]=ct({controlled:Fe,default:O,name:A}),[f,ne]=ct({controlled:he,default:"",name:A,state:"inputValue"}),[be,Ve]=x.useState(!1),ce=x.useCallback((t,e)=>{if(!(g?u.length!(b&&(g?u:[u]).some(e=>e!==null&&se(t,e)))),{inputValue:Ge&&nt?"":f,getOptionLabel:M}):[],q=ao({filteredOptions:m,value:u,inputValue:f});x.useEffect(()=>{const t=u!==q.value;be&&!t||Y&&!t||ce(null,u)},[u,ce,be,q.value,Y]);const Re=le&&m.length>0&&!ue,xe=Qe(t=>{t===-1?k.current.focus():me.querySelector(`[data-tag-index="${t}"]`).focus()});x.useEffect(()=>{g&&E>u.length-1&&($e(-1),xe(-1))},[u,g,E,xe]);function ve(t,e){if(!B.current||t<0||t>=m.length)return-1;let n=t;for(;;){const l=B.current.querySelector(`[data-option-index="${n}"]`),p=ge?!1:!l||l.disabled||l.getAttribute("aria-disabled")==="true";if(l&&l.hasAttribute("tabindex")&&!p)return n;if(e==="next"?n=(n+1)%m.length:n=(n-1+m.length)%m.length,n===t)return-1}}const X=Qe(({event:t,index:e,reason:n="auto"})=>{if(N.current=e,e===-1?k.current.removeAttribute("aria-activedescendant"):k.current.setAttribute("aria-activedescendant",`${V}-option-${e}`),Me&&Me(t,e===-1?null:m[e],n),!B.current)return;const l=B.current.querySelector(`[role="option"].${d}-focused`);l&&(l.classList.remove(`${d}-focused`),l.classList.remove(`${d}-focusVisible`));let p=B.current;if(B.current.getAttribute("role")!=="listbox"&&(p=B.current.parentElement.querySelector('[role="listbox"]')),!p)return;if(e===-1){p.scrollTop=0;return}const S=B.current.querySelector(`[data-option-index="${e}"]`);if(S&&(S.classList.add(`${d}-focused`),n==="keyboard"&&S.classList.add(`${d}-focusVisible`),p.scrollHeight>p.clientHeight&&n!=="mouse"&&n!=="touch")){const I=S,te=p.clientHeight+p.scrollTop,It=I.offsetTop+I.offsetHeight;It>te?p.scrollTop=It-p.clientHeight:I.offsetTop-I.offsetHeight*(_?1.3:0){if(!F)return;const S=ve((()=>{const I=m.length-1;if(e==="reset")return He;if(e==="start")return 0;if(e==="end")return I;const te=N.current+e;return te<0?te===-1&&Oe?-1:ie&&N.current!==-1||Math.abs(e)>1?0:I:te>I?te===I+1&&Oe?-1:ie||Math.abs(e)>1?I:0:te})(),n);if(X({index:S,reason:l,event:t}),y&&e!=="reset")if(S===-1)k.current.value=f;else{const I=M(m[S]);k.current.value=I,I.toLowerCase().indexOf(f.toLowerCase())===0&&f.length>0&&k.current.setSelectionRange(f.length,I.length)}}),ye=()=>{const t=(e,n)=>{const l=e?M(e):"",p=n?M(n):"";return l===p};if(N.current!==-1&&q.filteredOptions&&q.filteredOptions.length!==m.length&&q.inputValue===f&&(g?u.length===q.value.length&&q.value.every((e,n)=>M(u[n])===M(e)):t(q.value,u))){const e=q.filteredOptions[N.current];if(e)return Ye(m,n=>M(n)===M(e))}return-1},ke=x.useCallback(()=>{if(!F)return;const t=ye();if(t!==-1){N.current=t;return}const e=g?u[0]:u;if(m.length===0||e==null){J({diff:"reset"});return}if(B.current){if(e!=null){const n=m[N.current];if(g&&n&&Ye(u,p=>se(n,p))!==-1)return;const l=Ye(m,p=>se(p,e));l===-1?J({diff:"reset"}):X({index:l});return}if(N.current>=m.length-1){X({index:m.length-1});return}X({index:N.current})}},[m.length,g?!1:u,b,J,X,F,f,g]),at=Qe(t=>{Ht(B,t),t&&ke()});x.useEffect(()=>{ke()},[ke]);const G=t=>{le||(Be(!0),_e(!0),Ee&&Ee(t))},ae=(t,e)=>{le&&(Be(!1),ze&&ze(t,e))},ee=(t,e,n,l)=>{if(g){if(u.length===e.length&&u.every((p,S)=>p===e[S]))return}else if(u===e)return;U&&U(t,e,n,l),yt(e)},Ce=x.useRef(!1),pe=(t,e,n="selectOption",l="options")=>{let p=n,S=e;if(g){S=Array.isArray(u)?u.slice():[];const I=Ye(S,te=>se(e,te));I===-1?S.push(e):l!=="freeSolo"&&(S.splice(I,1),p="removeOption")}ce(t,S),ee(t,S,p,{option:e}),!Z&&(!t||!t.ctrlKey&&!t.metaKey)&&ae(t,p),(L===!0||L==="touch"&&Ce.current||L==="mouse"&&!Ce.current)&&k.current.blur()};function Ke(t,e){if(t===-1)return-1;let n=t;for(;;){if(e==="next"&&n===u.length||e==="previous"&&n===-1)return-1;const l=me.querySelector(`[data-tag-index="${n}"]`);if(!l||!l.hasAttribute("tabindex")||l.disabled||l.getAttribute("aria-disabled")==="true")n+=e==="next"?1:-1;else return n}}const Ue=(t,e)=>{if(!g)return;f===""&&ae(t,"toggleInput");let n=E;E===-1?f===""&&e==="previous"&&(n=u.length-1):(n+=e==="next"?1:-1,n<0&&(n=0),n===u.length&&(n=-1)),n=Ke(n,e),$e(n),xe(n)},qe=t=>{Ae.current=!0,ne(""),re&&re(t,"","clear"),ee(t,g?[]:null,"clear")},st=t=>e=>{if(t.onKeyDown&&t.onKeyDown(e),!e.defaultMuiPrevented&&(E!==-1&&["ArrowLeft","ArrowRight"].indexOf(e.key)===-1&&($e(-1),xe(-1)),e.which!==229))switch(e.key){case"Home":F&&H&&(e.preventDefault(),J({diff:"start",direction:"next",reason:"keyboard",event:e}));break;case"End":F&&H&&(e.preventDefault(),J({diff:"end",direction:"previous",reason:"keyboard",event:e}));break;case"PageUp":e.preventDefault(),J({diff:-Lt,direction:"previous",reason:"keyboard",event:e}),G(e);break;case"PageDown":e.preventDefault(),J({diff:Lt,direction:"next",reason:"keyboard",event:e}),G(e);break;case"ArrowDown":e.preventDefault(),J({diff:1,direction:"next",reason:"keyboard",event:e}),G(e);break;case"ArrowUp":e.preventDefault(),J({diff:-1,direction:"previous",reason:"keyboard",event:e}),G(e);break;case"ArrowLeft":Ue(e,"previous");break;case"ArrowRight":Ue(e,"next");break;case"Enter":if(N.current!==-1&&F){const n=m[N.current],l=i?i(n):!1;if(e.preventDefault(),l)return;pe(e,n,"selectOption"),y&&k.current.setSelectionRange(k.current.value.length,k.current.value.length)}else Y&&f!==""&&Ge===!1&&(g&&e.preventDefault(),pe(e,f,"createOption","freeSolo"));break;case"Escape":F?(e.preventDefault(),e.stopPropagation(),ae(e,"escape")):s&&(f!==""||g&&u.length>0)&&(e.preventDefault(),e.stopPropagation(),qe(e));break;case"Backspace":if(g&&!ue&&f===""&&u.length>0){const n=E===-1?u.length-1:E,l=u.slice();l.splice(n,1),ee(e,l,"removeOption",{option:u[n]})}break;case"Delete":if(g&&!ue&&f===""&&u.length>0&&E!==-1){const n=E,l=u.slice();l.splice(n,1),ee(e,l,"removeOption",{option:u[n]})}break}},Ct=t=>{Ve(!0),vt&&!Ae.current&&G(t)},Se=t=>{if(a(B)){k.current.focus();return}Ve(!1),We.current=!0,Ae.current=!1,T&&N.current!==-1&&F?pe(t,m[N.current],"blur"):T&&Y&&f!==""?pe(t,f,"blur","freeSolo"):v&&ce(t,u),ae(t,"blur")},z=t=>{const e=t.target.value;f!==e&&(ne(e),_e(!1),re&&re(t,e,"input")),e===""?!W&&!g&&ee(t,null,"clear"):G(t)},w=t=>{const e=Number(t.currentTarget.getAttribute("data-option-index"));N.current!==e&&X({event:t,index:e,reason:"mouse"})},Q=t=>{X({event:t,index:Number(t.currentTarget.getAttribute("data-option-index")),reason:"touch"}),Ce.current=!0},St=t=>{const e=Number(t.currentTarget.getAttribute("data-option-index"));pe(t,m[e],"selectOption"),Ce.current=!1},lt=t=>e=>{const n=u.slice();n.splice(t,1),ee(e,n,"removeOption",{option:u[t]})},it=t=>{le?ae(t,"toggleInput"):G(t)},ut=t=>{t.currentTarget.contains(t.target)&&t.target.getAttribute("id")!==V&&t.preventDefault()},Je=t=>{t.currentTarget.contains(t.target)&&(k.current.focus(),Le&&We.current&&k.current.selectionEnd-k.current.selectionStart===0&&k.current.select(),We.current=!1)},we=t=>{!$&&(f===""||!le)&&it(t)};let de=Y&&f.length>0;de=de||(g?u.length>0:u!==null);let Ie=m;return _&&(Ie=m.reduce((t,e,n)=>{const l=_(e);return t.length>0&&t[t.length-1].group===l?t[t.length-1].options.push(e):t.push({key:n,index:n,group:l,options:[e]}),t},[])),$&&be&&Se(),{getRootProps:(t={})=>P({"aria-owns":Re?`${V}-listbox`:null},t,{onKeyDown:st(t),onMouseDown:ut,onClick:Je}),getInputLabelProps:()=>({id:`${V}-label`,htmlFor:V}),getInputProps:()=>({id:V,value:f,onBlur:Se,onFocus:Ct,onChange:z,onMouseDown:we,"aria-activedescendant":F?"":null,"aria-autocomplete":y?"both":"list","aria-controls":Re?`${V}-listbox`:void 0,"aria-expanded":Re,autoComplete:"off",ref:k,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:$}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:qe}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:it}),getTagProps:({index:t})=>P({key:t,"data-tag-index":t,tabIndex:-1},!ue&&{onDelete:lt(t)}),getListboxProps:()=>({role:"listbox",id:`${V}-listbox`,"aria-labelledby":`${V}-label`,ref:at,onMouseDown:t=>{t.preventDefault()}}),getOptionProps:({index:t,option:e})=>{var n;const l=(g?u:[u]).some(S=>S!=null&&se(e,S)),p=i?i(e):!1;return{key:(n=R==null?void 0:R(e))!=null?n:M(e),tabIndex:-1,role:"option",id:`${V}-option-${t}`,onMouseMove:w,onClick:St,onTouchStart:Q,"data-option-index":t,"aria-disabled":p,"aria-selected":l}},id:V,inputValue:f,value:u,dirty:de,expanded:F&&me,popupOpen:F,focused:be||E!==-1,anchorEl:me,setAnchorEl:rt,focusedTag:E,groupedOptions:Ie}}function po(o){return kt("MuiListSubheader",o)}wt("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const fo=["className","color","component","disableGutters","disableSticky","inset"],go=o=>{const{classes:a,color:d,disableGutters:y,inset:D,disableSticky:T}=o,L={root:["root",d!=="default"&&`color${ot(d)}`,!y&&"gutters",D&&"inset",!T&&"sticky"]};return Nt(L,po,a)},ho=K("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(o,a)=>{const{ownerState:d}=o;return[a.root,d.color!=="default"&&a[`color${ot(d.color)}`],!d.disableGutters&&a.gutters,d.inset&&a.inset,!d.disableSticky&&a.sticky]}})(({theme:o,ownerState:a})=>P({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(o.vars||o).palette.text.secondary,fontFamily:o.typography.fontFamily,fontWeight:o.typography.fontWeightMedium,fontSize:o.typography.pxToRem(14)},a.color==="primary"&&{color:(o.vars||o).palette.primary.main},a.color==="inherit"&&{color:"inherit"},!a.disableGutters&&{paddingLeft:16,paddingRight:16},a.inset&&{paddingLeft:72},!a.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(o.vars||o).palette.background.paper})),Et=x.forwardRef(function(a,d){const y=Dt({props:a,name:"MuiListSubheader"}),{className:D,color:T="default",component:L="li",disableGutters:v=!1,disableSticky:s=!1,inset:A=!1}=y,O=De(y,fo),W=P({},y,{color:T,component:L,disableGutters:v,disableSticky:s,inset:A}),Z=go(W);return r.jsx(ho,P({as:L,className:Te(Z.root,D),ref:d,ownerState:W},O))});Et.muiSkipListHighlight=!0;function mo(o){return kt("MuiAutocomplete",o)}const c=wt("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]);var At,$t;const bo=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionKey","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],xo=["ref"],vo=["key"],yo=["key"],Co=o=>{const{classes:a,disablePortal:d,expanded:y,focused:D,fullWidth:T,hasClearIcon:L,hasPopupIcon:v,inputFocused:s,popupOpen:A,size:O}=o,W={root:["root",y&&"expanded",D&&"focused",T&&"fullWidth",L&&"hasClearIcon",v&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",s&&"inputFocused"],tag:["tag",`tagSize${ot(O)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",A&&"popupIndicatorOpen"],popper:["popper",d&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Nt(W,mo,a)},So=K("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(o,a)=>{const{ownerState:d}=o,{fullWidth:y,hasClearIcon:D,hasPopupIcon:T,inputFocused:L,size:v}=d;return[{[`& .${c.tag}`]:a.tag},{[`& .${c.tag}`]:a[`tagSize${ot(v)}`]},{[`& .${c.inputRoot}`]:a.inputRoot},{[`& .${c.input}`]:a.input},{[`& .${c.input}`]:L&&a.inputFocused},a.root,y&&a.fullWidth,T&&a.hasPopupIcon,D&&a.hasClearIcon]}})({[`&.${c.focused} .${c.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${c.clearIndicator}`]:{visibility:"visible"}},[`& .${c.tag}`]:{margin:3,maxWidth:"calc(100% - 6px)"},[`& .${c.inputRoot}`]:{[`.${c.hasPopupIcon}&, .${c.hasClearIcon}&`]:{paddingRight:30},[`.${c.hasPopupIcon}.${c.hasClearIcon}&`]:{paddingRight:56},[`& .${c.input}`]:{width:0,minWidth:30}},[`& .${ft.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${ft.root}.${fe.sizeSmall}`]:{[`& .${ft.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Ot.root}`]:{padding:9,[`.${c.hasPopupIcon}&, .${c.hasClearIcon}&`]:{paddingRight:39},[`.${c.hasPopupIcon}.${c.hasClearIcon}&`]:{paddingRight:65},[`& .${c.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${c.endAdornment}`]:{right:9}},[`& .${Ot.root}.${fe.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${c.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${Pe.root}`]:{paddingTop:19,paddingLeft:8,[`.${c.hasPopupIcon}&, .${c.hasClearIcon}&`]:{paddingRight:39},[`.${c.hasPopupIcon}.${c.hasClearIcon}&`]:{paddingRight:65},[`& .${Pe.input}`]:{padding:"7px 4px"},[`& .${c.endAdornment}`]:{right:9}},[`& .${Pe.root}.${fe.sizeSmall}`]:{paddingBottom:1,[`& .${Pe.input}`]:{padding:"2.5px 4px"}},[`& .${fe.hiddenLabel}`]:{paddingTop:8},[`& .${Pe.root}.${fe.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${c.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${Pe.root}.${fe.hiddenLabel}.${fe.sizeSmall}`]:{[`& .${c.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${c.input}`]:{flexGrow:1,textOverflow:"ellipsis",opacity:0},variants:[{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{[`& .${c.tag}`]:{margin:2,maxWidth:"calc(100% - 4px)"}}},{props:{inputFocused:!0},style:{[`& .${c.input}`]:{opacity:1}}},{props:{multiple:!0},style:{[`& .${c.inputRoot}`]:{flexWrap:"wrap"}}}]}),Io=K("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(o,a)=>a.endAdornment})({position:"absolute",right:0,top:"50%",transform:"translate(0, -50%)"}),Po=K(mt,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(o,a)=>a.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),To=K(mt,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:o},a)=>P({},a.popupIndicator,o.popupOpen&&a.popupIndicatorOpen)})({padding:2,marginRight:-2,variants:[{props:{popupOpen:!0},style:{transform:"rotate(180deg)"}}]}),Oo=K(Mt,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(o,a)=>{const{ownerState:d}=o;return[{[`& .${c.option}`]:a.option},a.popper,d.disablePortal&&a.popperDisablePortal]}})(({theme:o})=>({zIndex:(o.vars||o).zIndex.modal,variants:[{props:{disablePortal:!0},style:{position:"absolute"}}]})),jo=K(zt,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(o,a)=>a.paper})(({theme:o})=>P({},o.typography.body1,{overflow:"auto"})),Lo=K("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(o,a)=>a.loading})(({theme:o})=>({color:(o.vars||o).palette.text.secondary,padding:"14px 16px"})),Ao=K("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(o,a)=>a.noOptions})(({theme:o})=>({color:(o.vars||o).palette.text.secondary,padding:"14px 16px"})),$o=K("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(o,a)=>a.listbox})(({theme:o})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${c.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[o.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${c.focused}`]:{backgroundColor:(o.vars||o).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(o.vars||o).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${c.focusVisible}`]:{backgroundColor:(o.vars||o).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / ${o.vars.palette.action.selectedOpacity})`:pt(o.palette.primary.main,o.palette.action.selectedOpacity),[`&.${c.focused}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.hoverOpacity}))`:pt(o.palette.primary.main,o.palette.action.selectedOpacity+o.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(o.vars||o).palette.action.selected}},[`&.${c.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.focusOpacity}))`:pt(o.palette.primary.main,o.palette.action.selectedOpacity+o.palette.action.focusOpacity)}}}})),Ro=K(Et,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(o,a)=>a.groupLabel})(({theme:o})=>({backgroundColor:(o.vars||o).palette.background.paper,top:-8})),ko=K("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(o,a)=>a.groupUl})({padding:0,[`& .${c.option}`]:{paddingLeft:24}}),Xe=x.forwardRef(function(a,d){var y,D,T,L;const v=Dt({props:a,name:"MuiAutocomplete"}),{autoComplete:s=!1,autoHighlight:A=!1,autoSelect:O=!1,blurOnSelect:W=!1,ChipProps:Z,className:$,clearIcon:ge=At||(At=r.jsx(to,{fontSize:"small"})),clearOnBlur:ie=!v.freeSolo,clearOnEscape:Ne=!1,clearText:b="Clear",closeText:Y="Close",componentsProps:i={},defaultValue:R=v.multiple?[]:null,disableClearable:j=!1,disableCloseOnSelect:_=!1,disabled:H=!1,disabledItemsFocusable:oe=!1,disableListWrap:Oe=!1,disablePortal:he=!1,filterSelectedOptions:se=!1,forcePopupIcon:g="auto",freeSolo:U=!1,fullWidth:ze=!1,getLimitTagsText:Me=e=>`+${e}`,getOptionLabel:re,groupBy:Ee,handleHomeEndKeys:xt=!v.freeSolo,includeInputInList:vt=!1,limitTags:je=-1,ListboxComponent:ue="ul",ListboxProps:Le,loading:Fe=!1,loadingText:V="Loading…",multiple:M=!1,noOptionsText:Ae="No options",openOnFocus:We=!1,openText:k="Open",PaperComponent:B=zt,PopperComponent:me=Mt,popupIcon:rt=$t||($t=r.jsx(no,{})),readOnly:E=!1,renderGroup:$e,renderInput:He,renderOption:N,renderTags:u,selectOnFocus:yt=!v.freeSolo,size:f="medium",slotProps:ne={}}=v,be=De(v,bo),{getRootProps:Ve,getInputProps:ce,getInputLabelProps:le,getPopupIndicatorProps:Be,getClearProps:nt,getTagProps:_e,getListboxProps:Ge,getOptionProps:F,value:m,dirty:q,expanded:Re,id:xe,popupOpen:ve,focused:X,focusedTag:J,anchorEl:ye,setAnchorEl:ke,inputValue:at,groupedOptions:G}=co(P({},v,{componentName:"Autocomplete"})),ae=!j&&!H&&q&&!E,ee=(!U||g===!0)&&g!==!1,{onMouseDown:Ce}=ce(),{ref:pe}=Le??{},Ke=Ge(),{ref:Ue}=Ke,qe=De(Ke,xo),st=Vt(Ue,pe),Se=re||(e=>{var n;return(n=e.label)!=null?n:e}),z=P({},v,{disablePortal:he,expanded:Re,focused:X,fullWidth:ze,getOptionLabel:Se,hasClearIcon:ae,hasPopupIcon:ee,inputFocused:J===-1,popupOpen:ve,size:f}),w=Co(z);let Q;if(M&&m.length>0){const e=n=>P({className:w.tag,disabled:H},_e(n));u?Q=u(m,e,z):Q=m.map((n,l)=>{const p=e({index:l}),{key:S}=p,I=De(p,vo);return r.jsx(oo,P({label:Se(n),size:f},I,Z),S)})}if(je>-1&&Array.isArray(Q)){const e=Q.length-je;!X&&e>0&&(Q=Q.splice(0,je),Q.push(r.jsx("span",{className:w.tag,children:Me(e)},Q.length)))}const lt=$e||(e=>r.jsxs("li",{children:[r.jsx(Ro,{className:w.groupLabel,ownerState:z,component:"div",children:e.group}),r.jsx(ko,{className:w.groupUl,ownerState:z,children:e.children})]},e.key)),ut=N||((e,n)=>{const{key:l}=e,p=De(e,yo);return r.jsx("li",P({},p,{children:Se(n)}),l)}),Je=(e,n)=>{const l=F({option:e,index:n});return ut(P({},l,{className:w.option}),e,{selected:l["aria-selected"],index:n,inputValue:at},z)},we=(y=ne.clearIndicator)!=null?y:i.clearIndicator,de=(D=ne.paper)!=null?D:i.paper,Ie=(T=ne.popper)!=null?T:i.popper,t=(L=ne.popupIndicator)!=null?L:i.popupIndicator;return r.jsxs(x.Fragment,{children:[r.jsx(So,P({ref:d,className:Te(w.root,$),ownerState:z},Ve(be),{children:He({id:xe,disabled:H,fullWidth:!0,size:f==="small"?"small":void 0,InputLabelProps:le(),InputProps:P({ref:ke,className:w.inputRoot,startAdornment:Q,onClick:e=>{e.target===e.currentTarget&&Ce(e)}},(ae||ee)&&{endAdornment:r.jsxs(Io,{className:w.endAdornment,ownerState:z,children:[ae?r.jsx(Po,P({},nt(),{"aria-label":b,title:b,ownerState:z},we,{className:Te(w.clearIndicator,we==null?void 0:we.className),children:ge})):null,ee?r.jsx(To,P({},Be(),{disabled:H,"aria-label":ve?Y:k,title:ve?Y:k,ownerState:z},t,{className:Te(w.popupIndicator,t==null?void 0:t.className),children:rt})):null]})}),inputProps:P({className:w.input,disabled:H,readOnly:E},ce())})})),ye?r.jsx(Oo,P({as:me,disablePortal:he,style:{width:ye?ye.clientWidth:null},ownerState:z,role:"presentation",anchorEl:ye,open:ve},Ie,{className:Te(w.popper,Ie==null?void 0:Ie.className),children:r.jsxs(jo,P({ownerState:z,as:B},de,{className:Te(w.paper,de==null?void 0:de.className),children:[Fe&&G.length===0?r.jsx(Lo,{className:w.loading,ownerState:z,children:V}):null,G.length===0&&!U&&!Fe?r.jsx(Ao,{className:w.noOptions,ownerState:z,role:"presentation",onMouseDown:e=>{e.preventDefault()},children:Ae}):null,G.length>0?r.jsx($o,P({as:ue,className:w.listbox,ownerState:z},qe,Le,{ref:st,children:G.map((e,n)=>Ee?lt({key:e.key,group:e.group,children:e.options.map((l,p)=>Je(l,e.index+p))}):Je(e,n))})):null]}))})):null]})});var bt={},wo=_t;Object.defineProperty(bt,"__esModule",{value:!0});var Ft=bt.default=void 0,Do=wo(Bt()),No=r;Ft=bt.default=(0,Do.default)((0,No.jsx)("path",{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7"}),"MyLocation");const zo=["retail","wholesale","manufacturer","distributor","services","ecommerce","other"],Mo=["newClient","contacted","onboarded","lost"],Eo=["Daily","Weekly","Bi-weekly","Monthly","On-demand"],Fo=["basicOnly","full","none"],Wo=["Blue Dart","Delhivery","DTDC","India Post / Speed Post","The Professional Couriers","XpressBees","Ecom Express","Shadowfax","Safexpress","VRL Logistics","TCI (Transport Corporation of India)","Om Logistics","Best Roadways","MSS (Mettur Super Services)","ABT Travels & Logistics","Navata Road Transport","KRS (Kerala Roadways)","Parveen Travels / Parveen Express","SRM Transports","KPN Travels & KPN Speed Parcel","SRS Travels","Hindusthan Travels","City Travels","Essaar Travels","No. 1 Air Travels","A1 Travels","Krish Travels","Hebron Transports","Horma Travels","Vivegam Travels","PSS Transport","SRT (Renugambal Travels)","Thamarai Bus Transports","Rathimeena Travels","Ganesh Travels","John Kennedy Bus Service","Arun Travel","Saaji Meera Roadways","ARC Parcel Service","Chakra Travels & Parcel Service","MVA Parcel And Bus Service","Shrinath Travels & Cargo","Hans Travels","Zingbus","Kalpana Travels / City Land Travels","Trackon Couriers","North India Transways","RSRTC Cargo","UPSRTC Cargo"],ht=["Chennai","Coimbatore","Madurai","Tiruchirappalli","Salem","Tuticorin","Tirupur","Erode","Vellore","Tirunelveli","Thanjavur","Dindigul","Hosur","Nagercoil","Karur","Namakkal","Kanchipuram","Cuddalore","Thoothukudi","Bengaluru","Mysuru","Mangaluru","Hubli","Belagavi","Kalaburagi","Davangere","Ballari","Kochi","Thiruvananthapuram","Kozhikode","Kannur","Thrissur","Kollam","Hyderabad","Warangal","Visakhapatnam","Vijayawada","Tirupati","Guntur","Rajahmundry","Nellore","Mumbai","Pune","Nagpur","Nashik","Aurangabad","Kolhapur","Solapur","New Delhi","Gurugram","Noida","Faridabad","Chandigarh","Amritsar","Ludhiana","Jalandhar","Ahmedabad","Surat","Vadodara","Rajkot","Bhavnagar","Jamnagar","Jaipur","Jodhpur","Udaipur","Kota","Bikaner","Lucknow","Kanpur","Varanasi","Agra","Prayagraj","Gorakhpur","Bhopal","Indore","Gwalior","Jabalpur","Raipur","Kolkata","Siliguri","Durgapur","Patna","Gaya","Ranchi","Jamshedpur","Bhubaneswar","Cuttack","Guwahati","Dibrugarh","Agartala","Imphal","Shillong","Aizawl","Dimapur","Dehradun","Haridwar","Shimla","Srinagar","Jammu","Leh","Panaji","Puducherry","Port Blair"],Rt={name:"",email:"",password:"",phone:"",city:"",businessState:"",businessType:"retail",status:"newClient",frequency:"Daily",parcelVolume:0,activeContracts:0,provider:"",efficiency:"",logisticsSegment:"",transitFrom:"",transitTo:"",neighbourhood:"",surveyAddress:"",surveyLat:"",surveyLng:"",dataConsent:"full",notes:"",pincode:""},et=o=>typeof o=="string"?o.charAt(0).toUpperCase()+o.slice(1).replace(/([A-Z])/g," $1").trim():o,tt=(o,a)=>a&&!o.includes(a)?[a,...o]:o;function Uo({open:o,mode:a,initial:d,onClose:y,onSaved:D}){const T=a==="edit",L=Gt(),v=Kt(L.breakpoints.down("sm")),[s,A]=x.useState(Rt),[O,W]=x.useState(!1),[Z,$]=x.useState(null),[ge,ie]=x.useState(!1),Ne=()=>{if(!navigator.geolocation){alert("Geolocation is not supported by your browser");return}ie(!0),navigator.geolocation.getCurrentPosition(async i=>{const R=i.coords.latitude,j=i.coords.longitude;A(_=>({..._,surveyLat:R,surveyLng:j}));try{const H=await(await fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${R}&lon=${j}`)).json();if(H&&H.address){const oe=H.address,Oe=oe.city||oe.town||oe.village||oe.county||"",he=oe.state||"",se=oe.postcode||"",g=H.display_name||"";A(U=>({...U,city:Oe||U.city,businessState:he||U.businessState,pincode:se||U.pincode,surveyAddress:g||U.surveyAddress}))}}catch(_){console.error("Reverse geocoding failed",_)}finally{ie(!1)}},i=>{alert("Unable to retrieve your location"),ie(!1)})};x.useEffect(()=>{o&&(A({...Rt,...d||{}}),$(null))},[o,d]);const b=i=>R=>A(j=>({...j,[i]:R.target.value})),Y=async()=>{if(!s.name.trim()){$("Client name is required.");return}W(!0),$(null);const i=s.surveyLat===""?void 0:Number(s.surveyLat),R=s.surveyLng===""?void 0:Number(s.surveyLng),j={first_name:s.name.trim(),phone:s.phone,city:s.city,businessState:s.businessState,businessType:s.businessType,status:s.status,frequency:s.frequency,parcelVolume:Number(s.parcelVolume)||0,activeContracts:Number(s.activeContracts)||0,provider:s.provider,efficiency:s.efficiency,logisticsSegment:s.logisticsSegment,transitFrom:s.transitFrom,transitTo:s.transitTo,neighbourhood:s.neighbourhood,pincode:s.pincode,surveyAddress:s.surveyAddress,dataConsent:s.dataConsent,notes:s.notes,lastUpdated:new Date().toISOString().slice(0,10),registration_source:"web",...s.email.trim()?{email:s.email.trim()}:{},...i!=null?{survey_lat:i}:{},...R!=null?{survey_long:R}:{}};try{T?await Ut(d.id,j):await qt({...j,...s.password?{password:s.password}:{}}),D()}catch(_){$(_.message||"Failed to save client")}finally{W(!1)}};return r.jsxs(r.Fragment,{children:[r.jsx(eo,{open:!!Z,autoHideDuration:6e3,onClose:()=>$(null),anchorOrigin:{vertical:"top",horizontal:"right"},sx:{zIndex:9999},children:r.jsx(ro,{onClose:()=>$(null),severity:"error",variant:"filled",sx:{width:"100%",boxShadow:3},children:Z})}),r.jsxs(Jt,{open:o,onClose:O?void 0:y,maxWidth:"md",fullWidth:!0,fullScreen:typeof v<"u"?v:!1,children:[r.jsxs(Qt,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[T?"Edit Client":"Add Client",r.jsx(mt,{onClick:y,size:"small",disabled:O,children:r.jsx(Zt,{})})]}),r.jsxs(Yt,{dividers:!0,children:[r.jsx(dt,{variant:"overline",color:"text.secondary",children:"Business"}),r.jsxs(h,{container:!0,spacing:2,sx:{mt:0,mb:1},children:[r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Client Name *",value:s.name,onChange:b("name")})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Phone",value:s.phone,onChange:b("phone")})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Email",value:s.email,onChange:b("email")})}),!T&&r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Password",type:"password",value:s.password,onChange:b("password")})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{select:!0,fullWidth:!0,size:"small",label:"Business Type",value:s.businessType,onChange:b("businessType"),children:tt(zo,s.businessType).map(i=>r.jsx(Ze,{value:i,children:et(i)},i))})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{select:!0,fullWidth:!0,size:"small",label:"Status",value:s.status,onChange:b("status"),children:tt(Mo,s.status).map(i=>r.jsx(Ze,{value:i,children:et(i)},i))})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{select:!0,fullWidth:!0,size:"small",label:"Order Frequency",value:s.frequency,onChange:b("frequency"),children:tt(Eo,s.frequency).map(i=>r.jsx(Ze,{value:i,children:et(i)},i))})}),r.jsx(h,{item:!0,xs:12,sm:3,children:r.jsx(C,{fullWidth:!0,size:"small",type:"number",label:"Parcel Volume",value:s.parcelVolume,onChange:b("parcelVolume")})}),r.jsx(h,{item:!0,xs:12,sm:3,children:r.jsx(C,{fullWidth:!0,size:"small",type:"number",label:"Active Contracts",value:s.activeContracts,onChange:b("activeContracts")})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(Xe,{autoHighlight:!0,options:Wo,value:s.provider||null,onChange:(i,R)=>A(j=>({...j,provider:R||""})),renderInput:i=>r.jsx(C,{...i,fullWidth:!0,size:"small",label:"Current Provider"})})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Efficiency",value:s.efficiency,onChange:b("efficiency")})}),r.jsx(h,{item:!0,xs:12,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Logistics Segment",value:s.logisticsSegment,onChange:b("logisticsSegment"),placeholder:"First Mile, Last Mile"})})]}),r.jsx(Pt,{sx:{my:1.5}}),r.jsx(dt,{variant:"overline",color:"text.secondary",children:"Location & Transit"}),r.jsxs(h,{container:!0,spacing:2,sx:{mt:0,mb:1},children:[r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(Xe,{autoHighlight:!0,options:ht,value:s.city||null,onChange:(i,R)=>A(j=>({...j,city:R||""})),renderInput:i=>r.jsx(C,{...i,fullWidth:!0,size:"small",label:"City"})})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{fullWidth:!0,size:"small",label:"State",value:s.businessState,onChange:b("businessState")})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Pincode",value:s.pincode,onChange:b("pincode")})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Neighbourhood / Zone",value:s.neighbourhood,onChange:b("neighbourhood")})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(Xe,{autoHighlight:!0,options:ht,value:s.transitFrom||null,onChange:(i,R)=>A(j=>({...j,transitFrom:R||""})),renderInput:i=>r.jsx(C,{...i,fullWidth:!0,size:"small",label:"Transit From"})})}),r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(Xe,{autoHighlight:!0,options:ht,value:s.transitTo||null,onChange:(i,R)=>A(j=>({...j,transitTo:R||""})),renderInput:i=>r.jsx(C,{...i,fullWidth:!0,size:"small",label:"Transit To"})})}),r.jsx(h,{item:!0,xs:12,sm:3,children:r.jsx(C,{fullWidth:!0,size:"small",type:"number",label:"Latitude",value:s.surveyLat,onChange:b("surveyLat")})}),r.jsx(h,{item:!0,xs:12,sm:3,children:r.jsx(C,{fullWidth:!0,size:"small",type:"number",label:"Longitude",value:s.surveyLng,onChange:b("surveyLng")})}),r.jsx(h,{item:!0,xs:12,sm:6,display:"flex",alignItems:"center",children:r.jsx(gt,{variant:"outlined",size:"small",onClick:Ne,disabled:ge,startIcon:ge?r.jsx(Tt,{size:16}):r.jsx(Ft,{}),fullWidth:!0,children:"Get GPS Location"})}),r.jsx(h,{item:!0,xs:12,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Survey Address",value:s.surveyAddress,onChange:b("surveyAddress"),multiline:!0,minRows:2})})]}),r.jsx(Pt,{sx:{my:1.5}}),r.jsx(dt,{variant:"overline",color:"text.secondary",children:"Other"}),r.jsxs(h,{container:!0,spacing:2,sx:{mt:0},children:[r.jsx(h,{item:!0,xs:12,sm:6,children:r.jsx(C,{select:!0,fullWidth:!0,size:"small",label:"Data Consent",value:s.dataConsent,onChange:b("dataConsent"),children:tt(Fo,s.dataConsent).map(i=>r.jsx(Ze,{value:i,children:et(i)},i))})}),r.jsx(h,{item:!0,xs:12,children:r.jsx(C,{fullWidth:!0,size:"small",label:"Notes",value:s.notes,onChange:b("notes"),multiline:!0,minRows:2})})]})]}),r.jsxs(Xt,{sx:{px:3,py:2},children:[r.jsx(gt,{onClick:y,disabled:O,children:"Cancel"}),r.jsx(gt,{variant:"contained",onClick:Y,disabled:O,startIcon:O?r.jsx(Tt,{size:16,color:"inherit"}):null,children:T?"Save Changes":"Create Client"})]})]})]})}export{Xe as A,Uo as C}; diff --git a/dist/assets/Close-BdNf_RlN.js b/dist/assets/Close-D3HB9j5y.js similarity index 99% rename from dist/assets/Close-BdNf_RlN.js rename to dist/assets/Close-D3HB9j5y.js index 3386752..c11d2fc 100644 --- a/dist/assets/Close-BdNf_RlN.js +++ b/dist/assets/Close-D3HB9j5y.js @@ -1 +1 @@ -import{x as v,y as h,b as d,z as b,u as Z,P as N,a9 as oo,E as D,_ as s,q as eo,j as n,F as x,G as f,H as C,J as u,aa as ao,ab as to,T as so,r as U,i as F}from"./index-DpAn5wLF.js";function io(o){return v("MuiDialog",o)}const R=h("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),I=d.createContext({}),ro=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],lo=u(to,{name:"MuiDialog",slot:"Backdrop",overrides:(o,e)=>e.backdrop})({zIndex:-1}),no=o=>{const{classes:e,scroll:a,maxWidth:t,fullWidth:r,fullScreen:i}=o,c={root:["root"],container:["container",`scroll${f(a)}`],paper:["paper",`paperScroll${f(a)}`,`paperWidth${f(String(t))}`,r&&"paperFullWidth",i&&"paperFullScreen"]};return C(c,io,e)},co=u(ao,{name:"MuiDialog",slot:"Root",overridesResolver:(o,e)=>e.root})({"@media print":{position:"absolute !important"}}),po=u("div",{name:"MuiDialog",slot:"Container",overridesResolver:(o,e)=>{const{ownerState:a}=o;return[e.container,e[`scroll${f(a.scroll)}`]]}})(({ownerState:o})=>s({height:"100%","@media print":{height:"auto"},outline:0},o.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},o.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),uo=u(N,{name:"MuiDialog",slot:"Paper",overridesResolver:(o,e)=>{const{ownerState:a}=o;return[e.paper,e[`scrollPaper${f(a.scroll)}`],e[`paperWidth${f(String(a.maxWidth))}`],a.fullWidth&&e.paperFullWidth,a.fullScreen&&e.paperFullScreen]}})(({theme:o,ownerState:e})=>s({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},e.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},e.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!e.maxWidth&&{maxWidth:"calc(100% - 64px)"},e.maxWidth==="xs"&&{maxWidth:o.breakpoints.unit==="px"?Math.max(o.breakpoints.values.xs,444):`max(${o.breakpoints.values.xs}${o.breakpoints.unit}, 444px)`,[`&.${R.paperScrollBody}`]:{[o.breakpoints.down(Math.max(o.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.maxWidth&&e.maxWidth!=="xs"&&{maxWidth:`${o.breakpoints.values[e.maxWidth]}${o.breakpoints.unit}`,[`&.${R.paperScrollBody}`]:{[o.breakpoints.down(o.breakpoints.values[e.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.fullWidth&&{width:"calc(100% - 64px)"},e.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${R.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),Ao=d.forwardRef(function(e,a){const t=b({props:e,name:"MuiDialog"}),r=Z(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{"aria-describedby":c,"aria-labelledby":l,BackdropComponent:p,BackdropProps:k,children:E,className:q,disableEscapeKeyDown:T=!1,fullScreen:z=!1,fullWidth:L=!1,maxWidth:H="sm",onBackdropClick:j,onClick:_,onClose:y,open:w,PaperComponent:Y=N,PaperProps:B={},scroll:O="paper",TransitionComponent:X=oo,transitionDuration:A=i,TransitionProps:K}=t,V=D(t,ro),m=s({},t,{disableEscapeKeyDown:T,fullScreen:z,fullWidth:L,maxWidth:H,scroll:O}),W=no(m),M=d.useRef(),G=g=>{M.current=g.target===g.currentTarget},J=g=>{_&&_(g),M.current&&(M.current=null,j&&j(g),y&&y(g,"backdropClick"))},S=eo(l),Q=d.useMemo(()=>({titleId:S}),[S]);return n.jsx(co,s({className:x(W.root,q),closeAfterTransition:!0,components:{Backdrop:lo},componentsProps:{backdrop:s({transitionDuration:A,as:p},k)},disableEscapeKeyDown:T,onClose:y,open:w,ref:a,onClick:J,ownerState:m},V,{children:n.jsx(X,s({appear:!0,in:w,timeout:A,role:"presentation"},K,{children:n.jsx(po,{className:x(W.container),onMouseDown:G,ownerState:m,children:n.jsx(uo,s({as:Y,elevation:24,role:"dialog","aria-describedby":c,"aria-labelledby":S},B,{className:x(W.paper,B.className),ownerState:m,children:n.jsx(I.Provider,{value:Q,children:E})}))})}))}))});function go(o){return v("MuiDialogActions",o)}h("MuiDialogActions",["root","spacing"]);const xo=["className","disableSpacing"],fo=o=>{const{classes:e,disableSpacing:a}=o;return C({root:["root",!a&&"spacing"]},go,e)},mo=u("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:a}=o;return[e.root,!a.disableSpacing&&e.spacing]}})(({ownerState:o})=>s({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!o.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),No=d.forwardRef(function(e,a){const t=b({props:e,name:"MuiDialogActions"}),{className:r,disableSpacing:i=!1}=t,c=D(t,xo),l=s({},t,{disableSpacing:i}),p=fo(l);return n.jsx(mo,s({className:x(p.root,r),ownerState:l,ref:a},c))});function vo(o){return v("MuiDialogContent",o)}h("MuiDialogContent",["root","dividers"]);function ho(o){return v("MuiDialogTitle",o)}const bo=h("MuiDialogTitle",["root"]),Do=["className","dividers"],Co=o=>{const{classes:e,dividers:a}=o;return C({root:["root",a&&"dividers"]},vo,e)},ko=u("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:a}=o;return[e.root,a.dividers&&e.dividers]}})(({theme:o,ownerState:e})=>s({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},e.dividers?{padding:"16px 24px",borderTop:`1px solid ${(o.vars||o).palette.divider}`,borderBottom:`1px solid ${(o.vars||o).palette.divider}`}:{[`.${bo.root} + &`]:{paddingTop:0}})),Uo=d.forwardRef(function(e,a){const t=b({props:e,name:"MuiDialogContent"}),{className:r,dividers:i=!1}=t,c=D(t,Do),l=s({},t,{dividers:i}),p=Co(l);return n.jsx(ko,s({className:x(p.root,r),ownerState:l,ref:a},c))}),yo=["className","id"],Wo=o=>{const{classes:e}=o;return C({root:["root"]},ho,e)},Mo=u(so,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(o,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),Fo=d.forwardRef(function(e,a){const t=b({props:e,name:"MuiDialogTitle"}),{className:r,id:i}=t,c=D(t,yo),l=t,p=Wo(l),{titleId:k=i}=d.useContext(I);return n.jsx(Mo,s({component:"h2",className:x(p.root,r),ownerState:l,ref:a,variant:"h6",id:i??k},c))});var $={},So=F;Object.defineProperty($,"__esModule",{value:!0});var Ro=$.default=void 0,$o=So(U()),Po=n;Ro=$.default=(0,$o.default)((0,Po.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add");var P={},To=F;Object.defineProperty(P,"__esModule",{value:!0});var jo=P.default=void 0,_o=To(U()),wo=n;jo=P.default=(0,_o.default)((0,wo.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");export{Ao as D,Fo as a,Uo as b,No as c,Ro as d,jo as e}; +import{x as v,y as h,b as d,z as b,u as Z,P as N,a9 as oo,E as D,_ as s,q as eo,j as n,F as x,G as f,H as C,J as u,aa as ao,ab as to,T as so,r as U,i as F}from"./index-D7LVXeIK.js";function io(o){return v("MuiDialog",o)}const R=h("MuiDialog",["root","scrollPaper","scrollBody","container","paper","paperScrollPaper","paperScrollBody","paperWidthFalse","paperWidthXs","paperWidthSm","paperWidthMd","paperWidthLg","paperWidthXl","paperFullWidth","paperFullScreen"]),I=d.createContext({}),ro=["aria-describedby","aria-labelledby","BackdropComponent","BackdropProps","children","className","disableEscapeKeyDown","fullScreen","fullWidth","maxWidth","onBackdropClick","onClick","onClose","open","PaperComponent","PaperProps","scroll","TransitionComponent","transitionDuration","TransitionProps"],lo=u(to,{name:"MuiDialog",slot:"Backdrop",overrides:(o,e)=>e.backdrop})({zIndex:-1}),no=o=>{const{classes:e,scroll:a,maxWidth:t,fullWidth:r,fullScreen:i}=o,c={root:["root"],container:["container",`scroll${f(a)}`],paper:["paper",`paperScroll${f(a)}`,`paperWidth${f(String(t))}`,r&&"paperFullWidth",i&&"paperFullScreen"]};return C(c,io,e)},co=u(ao,{name:"MuiDialog",slot:"Root",overridesResolver:(o,e)=>e.root})({"@media print":{position:"absolute !important"}}),po=u("div",{name:"MuiDialog",slot:"Container",overridesResolver:(o,e)=>{const{ownerState:a}=o;return[e.container,e[`scroll${f(a.scroll)}`]]}})(({ownerState:o})=>s({height:"100%","@media print":{height:"auto"},outline:0},o.scroll==="paper"&&{display:"flex",justifyContent:"center",alignItems:"center"},o.scroll==="body"&&{overflowY:"auto",overflowX:"hidden",textAlign:"center","&::after":{content:'""',display:"inline-block",verticalAlign:"middle",height:"100%",width:"0"}})),uo=u(N,{name:"MuiDialog",slot:"Paper",overridesResolver:(o,e)=>{const{ownerState:a}=o;return[e.paper,e[`scrollPaper${f(a.scroll)}`],e[`paperWidth${f(String(a.maxWidth))}`],a.fullWidth&&e.paperFullWidth,a.fullScreen&&e.paperFullScreen]}})(({theme:o,ownerState:e})=>s({margin:32,position:"relative",overflowY:"auto","@media print":{overflowY:"visible",boxShadow:"none"}},e.scroll==="paper"&&{display:"flex",flexDirection:"column",maxHeight:"calc(100% - 64px)"},e.scroll==="body"&&{display:"inline-block",verticalAlign:"middle",textAlign:"left"},!e.maxWidth&&{maxWidth:"calc(100% - 64px)"},e.maxWidth==="xs"&&{maxWidth:o.breakpoints.unit==="px"?Math.max(o.breakpoints.values.xs,444):`max(${o.breakpoints.values.xs}${o.breakpoints.unit}, 444px)`,[`&.${R.paperScrollBody}`]:{[o.breakpoints.down(Math.max(o.breakpoints.values.xs,444)+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.maxWidth&&e.maxWidth!=="xs"&&{maxWidth:`${o.breakpoints.values[e.maxWidth]}${o.breakpoints.unit}`,[`&.${R.paperScrollBody}`]:{[o.breakpoints.down(o.breakpoints.values[e.maxWidth]+32*2)]:{maxWidth:"calc(100% - 64px)"}}},e.fullWidth&&{width:"calc(100% - 64px)"},e.fullScreen&&{margin:0,width:"100%",maxWidth:"100%",height:"100%",maxHeight:"none",borderRadius:0,[`&.${R.paperScrollBody}`]:{margin:0,maxWidth:"100%"}})),Ao=d.forwardRef(function(e,a){const t=b({props:e,name:"MuiDialog"}),r=Z(),i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{"aria-describedby":c,"aria-labelledby":l,BackdropComponent:p,BackdropProps:k,children:E,className:q,disableEscapeKeyDown:T=!1,fullScreen:z=!1,fullWidth:L=!1,maxWidth:H="sm",onBackdropClick:j,onClick:_,onClose:y,open:w,PaperComponent:Y=N,PaperProps:B={},scroll:O="paper",TransitionComponent:X=oo,transitionDuration:A=i,TransitionProps:K}=t,V=D(t,ro),m=s({},t,{disableEscapeKeyDown:T,fullScreen:z,fullWidth:L,maxWidth:H,scroll:O}),W=no(m),M=d.useRef(),G=g=>{M.current=g.target===g.currentTarget},J=g=>{_&&_(g),M.current&&(M.current=null,j&&j(g),y&&y(g,"backdropClick"))},S=eo(l),Q=d.useMemo(()=>({titleId:S}),[S]);return n.jsx(co,s({className:x(W.root,q),closeAfterTransition:!0,components:{Backdrop:lo},componentsProps:{backdrop:s({transitionDuration:A,as:p},k)},disableEscapeKeyDown:T,onClose:y,open:w,ref:a,onClick:J,ownerState:m},V,{children:n.jsx(X,s({appear:!0,in:w,timeout:A,role:"presentation"},K,{children:n.jsx(po,{className:x(W.container),onMouseDown:G,ownerState:m,children:n.jsx(uo,s({as:Y,elevation:24,role:"dialog","aria-describedby":c,"aria-labelledby":S},B,{className:x(W.paper,B.className),ownerState:m,children:n.jsx(I.Provider,{value:Q,children:E})}))})}))}))});function go(o){return v("MuiDialogActions",o)}h("MuiDialogActions",["root","spacing"]);const xo=["className","disableSpacing"],fo=o=>{const{classes:e,disableSpacing:a}=o;return C({root:["root",!a&&"spacing"]},go,e)},mo=u("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:a}=o;return[e.root,!a.disableSpacing&&e.spacing]}})(({ownerState:o})=>s({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto"},!o.disableSpacing&&{"& > :not(style) ~ :not(style)":{marginLeft:8}})),No=d.forwardRef(function(e,a){const t=b({props:e,name:"MuiDialogActions"}),{className:r,disableSpacing:i=!1}=t,c=D(t,xo),l=s({},t,{disableSpacing:i}),p=fo(l);return n.jsx(mo,s({className:x(p.root,r),ownerState:l,ref:a},c))});function vo(o){return v("MuiDialogContent",o)}h("MuiDialogContent",["root","dividers"]);function ho(o){return v("MuiDialogTitle",o)}const bo=h("MuiDialogTitle",["root"]),Do=["className","dividers"],Co=o=>{const{classes:e,dividers:a}=o;return C({root:["root",a&&"dividers"]},vo,e)},ko=u("div",{name:"MuiDialogContent",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:a}=o;return[e.root,a.dividers&&e.dividers]}})(({theme:o,ownerState:e})=>s({flex:"1 1 auto",WebkitOverflowScrolling:"touch",overflowY:"auto",padding:"20px 24px"},e.dividers?{padding:"16px 24px",borderTop:`1px solid ${(o.vars||o).palette.divider}`,borderBottom:`1px solid ${(o.vars||o).palette.divider}`}:{[`.${bo.root} + &`]:{paddingTop:0}})),Uo=d.forwardRef(function(e,a){const t=b({props:e,name:"MuiDialogContent"}),{className:r,dividers:i=!1}=t,c=D(t,Do),l=s({},t,{dividers:i}),p=Co(l);return n.jsx(ko,s({className:x(p.root,r),ownerState:l,ref:a},c))}),yo=["className","id"],Wo=o=>{const{classes:e}=o;return C({root:["root"]},ho,e)},Mo=u(so,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(o,e)=>e.root})({padding:"16px 24px",flex:"0 0 auto"}),Fo=d.forwardRef(function(e,a){const t=b({props:e,name:"MuiDialogTitle"}),{className:r,id:i}=t,c=D(t,yo),l=t,p=Wo(l),{titleId:k=i}=d.useContext(I);return n.jsx(Mo,s({component:"h2",className:x(p.root,r),ownerState:l,ref:a,variant:"h6",id:i??k},c))});var $={},So=F;Object.defineProperty($,"__esModule",{value:!0});var Ro=$.default=void 0,$o=So(U()),Po=n;Ro=$.default=(0,$o.default)((0,Po.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add");var P={},To=F;Object.defineProperty(P,"__esModule",{value:!0});var jo=P.default=void 0,_o=To(U()),wo=n;jo=P.default=(0,_o.default)((0,wo.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");export{Ao as D,Fo as a,Uo as b,No as c,Ro as d,jo as e}; diff --git a/dist/assets/ComingSoon-CX1ajblG.js b/dist/assets/ComingSoon-CRbMapOp.js similarity index 93% rename from dist/assets/ComingSoon-CX1ajblG.js rename to dist/assets/ComingSoon-CRbMapOp.js index b15e1b4..4187871 100644 --- a/dist/assets/ComingSoon-CX1ajblG.js +++ b/dist/assets/ComingSoon-CRbMapOp.js @@ -1 +1 @@ -import{b as c,j as e,B as n,S as i,ar as x,T as t}from"./index-DpAn5wLF.js";import{T as d}from"./TextField-C0dUZvW0.js";import{B as h}from"./Button-BGNvVfej.js";const a=[{label:"Days",value:12},{label:"Hours",value:8},{label:"Minutes",value:45},{label:"Seconds",value:30}];function u(){const[s,o]=c.useState("");return e.jsx(n,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",p:3,textAlign:"center"},children:e.jsxs(i,{spacing:3,alignItems:"center",sx:{maxWidth:620,width:"100%"},children:[e.jsx(x,{}),e.jsx(t,{variant:"h2",sx:{fontWeight:800,color:"grey.800"},children:"Coming Soon"}),e.jsx(t,{variant:"body1",color:"text.secondary",children:"Something new is on its way"}),e.jsx(i,{direction:"row",spacing:{xs:1,sm:2},alignItems:"center",justifyContent:"center",children:a.map((r,l)=>e.jsxs(i,{direction:"row",spacing:{xs:1,sm:2},alignItems:"center",children:[e.jsxs(n,{sx:{width:{xs:64,sm:84},py:2,borderRadius:2,bgcolor:"primary.lighter",border:1,borderColor:"primary.light"},children:[e.jsx(t,{variant:"h2",sx:{fontWeight:800,color:"primary.main",lineHeight:1},children:String(r.value).padStart(2,"0")}),e.jsx(t,{variant:"caption",color:"text.secondary",sx:{textTransform:"uppercase",letterSpacing:1},children:r.label})]}),lo(r.target.value)}),e.jsx(h,{variant:"contained",sx:{whiteSpace:"nowrap",px:3},children:"Notify Me"})]})]})]})})}export{u as default}; +import{b as c,j as e,B as n,S as i,ar as x,T as t}from"./index-D7LVXeIK.js";import{T as d}from"./TextField-Sd_pshci.js";import{B as h}from"./Button-Bqp5awT1.js";const a=[{label:"Days",value:12},{label:"Hours",value:8},{label:"Minutes",value:45},{label:"Seconds",value:30}];function u(){const[s,o]=c.useState("");return e.jsx(n,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",p:3,textAlign:"center"},children:e.jsxs(i,{spacing:3,alignItems:"center",sx:{maxWidth:620,width:"100%"},children:[e.jsx(x,{}),e.jsx(t,{variant:"h2",sx:{fontWeight:800,color:"grey.800"},children:"Coming Soon"}),e.jsx(t,{variant:"body1",color:"text.secondary",children:"Something new is on its way"}),e.jsx(i,{direction:"row",spacing:{xs:1,sm:2},alignItems:"center",justifyContent:"center",children:a.map((r,l)=>e.jsxs(i,{direction:"row",spacing:{xs:1,sm:2},alignItems:"center",children:[e.jsxs(n,{sx:{width:{xs:64,sm:84},py:2,borderRadius:2,bgcolor:"primary.lighter",border:1,borderColor:"primary.light"},children:[e.jsx(t,{variant:"h2",sx:{fontWeight:800,color:"primary.main",lineHeight:1},children:String(r.value).padStart(2,"0")}),e.jsx(t,{variant:"caption",color:"text.secondary",sx:{textTransform:"uppercase",letterSpacing:1},children:r.label})]}),lo(r.target.value)}),e.jsx(h,{variant:"contained",sx:{whiteSpace:"nowrap",px:3},children:"Notify Me"})]})]})]})})}export{u as default}; diff --git a/dist/assets/Dashboard-BLe4n5eQ.js b/dist/assets/Dashboard-BLe4n5eQ.js new file mode 100644 index 0000000..660efbc --- /dev/null +++ b/dist/assets/Dashboard-BLe4n5eQ.js @@ -0,0 +1 @@ +import{r as W,j as e,i as M,S as o,B as c,T as n,u as q,a as z,b as h,t as S,C as Q,d as J,U as I,D as E,c as K,f as X,e as Y,g as Z,h as ee}from"./index-D7LVXeIK.js";import{d as te}from"./Refresh-DA6RLQV4.js";import{d as re,a as se,b as ae,S as L}from"./StatusChip-B_YdJiMW.js";import{P as F,A as ne,G as m}from"./PageHeader-naLAT9xr.js";import{S as w,E as _}from"./EmptyState-B9FcYx_n.js";import{B}from"./Button-Bqp5awT1.js";import{T as ie,a as oe,b as le,c as N,d as ce}from"./TableRow-jBgitpDf.js";import{T as d}from"./TableCell-DreGbAeW.js";import{L as de}from"./LinearProgress-yV9HNsZU.js";import{C as xe}from"./Link-BEif5YS2.js";var A={},ue=M;Object.defineProperty(A,"__esModule",{value:!0});var H=A.default=void 0,he=ue(W()),me=e;H=A.default=(0,he.default)((0,me.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m-1 5v5l4.25 2.52.77-1.28-3.52-2.09V8z"}),"HistoryOutlined");var k={},pe=M;Object.defineProperty(k,"__esModule",{value:!0});var U=k.default=void 0,je=pe(W()),ge=e;U=k.default=(0,je.default)((0,ge.jsx)("path",{d:"M13 5.08c3.06.44 5.48 2.86 5.92 5.92h3.03c-.47-4.72-4.23-8.48-8.95-8.95zM18.92 13c-.44 3.06-2.86 5.48-5.92 5.92v3.03c4.72-.47 8.48-4.23 8.95-8.95zM11 18.92c-3.39-.49-6-3.4-6-6.92s2.61-6.43 6-6.92V2.05c-5.05.5-9 4.76-9 9.95 0 5.19 3.95 9.45 9 9.95z"}),"DonutLargeOutlined");var O={},fe=M;Object.defineProperty(O,"__esModule",{value:!0});var V=O.default=void 0,be=fe(W()),ye=e;V=O.default=(0,be.default)((0,ye.jsx)("path",{d:"m12 2-5.5 9h11zm0 3.84L13.93 9h-3.87zM17.5 13c-2.49 0-4.5 2.01-4.5 4.5s2.01 4.5 4.5 4.5 4.5-2.01 4.5-4.5-2.01-4.5-4.5-4.5m0 7c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5M3 21.5h8v-8H3zm2-6h4v4H5z"}),"CategoryOutlined");function ve({data:x=[],size:a=180,thickness:s=26,centerLabel:p,centerValue:j}){const b=x.reduce((i,f)=>i+f.value,0)||1,g=(a-s)/2,y=2*Math.PI*g;let v=0;return e.jsxs(o,{direction:{xs:"column",sm:"row"},spacing:3,alignItems:"center",justifyContent:"center",sx:{flexWrap:"wrap"},children:[e.jsxs(c,{sx:{position:"relative",width:a,maxWidth:"100%",aspectRatio:"1 / 1"},children:[e.jsx("svg",{width:"100%",height:"100%",viewBox:`0 0 ${a} ${a}`,children:e.jsxs("g",{transform:`rotate(-90 ${a/2} ${a/2})`,children:[e.jsx("circle",{cx:a/2,cy:a/2,r:g,fill:"none",stroke:"#F0F0F0",strokeWidth:s}),x.map((i,f)=>{const u=i.value/b*y,C=e.jsx("circle",{cx:a/2,cy:a/2,r:g,fill:"none",stroke:i.color,strokeWidth:s,strokeDasharray:`${u} ${y-u}`,strokeDashoffset:-v,strokeLinecap:"butt"},f);return v+=u,C})]})}),e.jsxs(c,{sx:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[e.jsx(n,{variant:"h3",sx:{fontWeight:700},children:j??b}),e.jsx(n,{variant:"caption",color:"text.secondary",children:p??"Total"})]})]}),e.jsx(o,{spacing:1.25,children:x.map(i=>e.jsxs(o,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(c,{sx:{width:10,height:10,borderRadius:"3px",bgcolor:i.color}}),e.jsx(n,{variant:"body2",color:"text.secondary",sx:{minWidth:80},children:i.label}),e.jsx(n,{variant:"subtitle2",children:i.value.toLocaleString("en-IN")})]},i.label))})]})}const Ce={newclient:"#00A2AE",contacted:"#FFBF00",onboarded:"#00A854",lost:"#F04134"},Se=x=>Ce[String(x||"").toLowerCase()]||"#8C8C8C",T=["#C01227","#00A2AE","#00A854","#FFBF00","#9E0E20","#8C8C8C","#D6515C"];function $({icon:x,title:a,action:s,color:p="primary",noPadding:j=!1,children:b}){return e.jsxs(xe,{sx:{height:"100%",display:"flex",flexDirection:"column",borderRadius:4,boxShadow:"0 10px 30px rgba(0,0,0,0.03)",border:"1px solid rgba(0,0,0,0.04)"},children:[e.jsxs(o,{direction:"row",spacing:1.5,alignItems:"center",sx:{px:{xs:2,sm:2.5},py:2,borderBottom:1,borderColor:"divider",background:g=>`linear-gradient(90deg, ${g.palette[p].lighter}66 0%, transparent 100%)`},children:[e.jsx(c,{sx:{width:40,height:40,borderRadius:2,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:`${p}.lighter`,color:`${p}.main`,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.05)"},children:e.jsx(x,{fontSize:"small"})}),e.jsx(n,{variant:"h6",sx:{fontWeight:700,color:"grey.800",flexGrow:1,letterSpacing:"-0.3px"},children:a}),s]}),e.jsx(c,{sx:{p:j?0:{xs:2,sm:3},flexGrow:1},children:b})]})}function Ae(){var P;const x=q(),a=z(x.breakpoints.down("sm")),[s,p]=h.useState([]),[j,b]=h.useState([]),[g,y]=h.useState(!0),[v,i]=h.useState(null),f=()=>{y(!0),i(null),Promise.all([X(),Y()]).then(([t,r])=>{p((t||[]).map(Z)),b((r||[]).map(ee))}).catch(t=>i(t.message||"Failed to load dashboard data")).finally(()=>y(!1))};h.useEffect(()=>{f()},[]);const u=h.useMemo(()=>({total:s.length,newCount:s.filter(t=>t.status==="newClient").length,parcels:s.reduce((t,r)=>t+r.parcelVolume,0),contracts:s.reduce((t,r)=>t+r.activeContracts,0)}),[s]),C=h.useMemo(()=>{const t={};return s.forEach(r=>{t[r.status]=(t[r.status]||0)+1}),Object.entries(t).sort((r,l)=>l[1]-r[1]).map(([r,l])=>({label:S(r),value:l,color:Se(r)}))},[s]),D=h.useMemo(()=>{const t={};return s.forEach(r=>{const l=r.businessType||"other";t[l]=(t[l]||0)+1}),Object.entries(t).sort((r,l)=>l[1]-r[1])},[s]),G=((P=D[0])==null?void 0:P[1])||1,R=h.useMemo(()=>[...s].sort((t,r)=>String(r.lastUpdated).localeCompare(String(t.lastUpdated))).slice(0,6),[s]);return new Date().toLocaleDateString("en-IN",{weekday:"long",day:"numeric",month:"long",year:"numeric"}),g?e.jsxs(e.Fragment,{children:[e.jsx(F,{title:"Dashboard",breadcrumbs:[{label:"Dashboard"}]}),e.jsx(c,{sx:{display:"flex",justifyContent:"center",py:12},children:e.jsx(Q,{})})]}):e.jsxs(e.Fragment,{children:[e.jsx(F,{title:"Dashboard",breadcrumbs:[{label:"Dashboard"}],action:e.jsx(B,{variant:"outlined",startIcon:e.jsx(te,{}),onClick:f,children:"Refresh"})}),v&&e.jsx(ne,{severity:"error",sx:{mb:2.5},action:e.jsx(B,{color:"inherit",size:"small",onClick:f,children:"Retry"}),children:v}),e.jsxs(m,{container:!0,spacing:2.5,children:[e.jsx(m,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(w,{accent:!0,title:"Total Clients",value:u.total,icon:J,color:"primary",caption:"All registered"})}),e.jsx(m,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(w,{accent:!0,title:"New Clients",value:u.newCount,icon:re,color:"primary",caption:"Awaiting onboarding"})}),e.jsx(m,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(w,{accent:!0,title:"Total Parcel Volume",value:u.parcels.toLocaleString("en-IN"),icon:se,color:"primary",caption:"Across all clients"})}),e.jsx(m,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(w,{accent:!0,title:"Active Contracts",value:u.contracts,icon:ae,color:"primary",caption:"Currently running"})}),e.jsx(m,{item:!0,xs:12,lg:8,children:e.jsx($,{icon:H,title:"Recent Clients",color:"primary",noPadding:!0,children:R.length===0?e.jsx(_,{title:"No clients yet",caption:"Add a client to see it here."}):a?e.jsx(o,{divider:e.jsx(E,{}),children:R.map(t=>e.jsxs(o,{direction:"row",spacing:1.25,alignItems:"center",sx:{px:2,py:1.5},children:[e.jsx(I,{name:t.name,size:36}),e.jsxs(c,{sx:{minWidth:0,flexGrow:1},children:[e.jsx(n,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},noWrap:!0,children:t.name}),e.jsxs(n,{variant:"caption",color:"text.secondary",noWrap:!0,sx:{display:"block"},children:[[S(t.businessType),t.city].filter(Boolean).join(" · ")||"—"," · ",t.parcelVolume.toLocaleString("en-IN")," parcels"]})]}),e.jsx(L,{status:t.status})]},t.id))}):e.jsx(ie,{children:e.jsxs(oe,{sx:{minWidth:600},children:[e.jsx(le,{children:e.jsxs(N,{sx:{"& th":{bgcolor:"grey.50",fontWeight:700,color:"grey.700",textTransform:"uppercase",fontSize:"0.72rem",letterSpacing:.4}},children:[e.jsx(d,{children:"Client"}),e.jsx(d,{children:"Type"}),e.jsx(d,{children:"Location"}),e.jsx(d,{align:"right",children:"Parcels"}),e.jsx(d,{children:"Status"})]})}),e.jsx(ce,{children:R.map(t=>e.jsxs(N,{hover:!0,children:[e.jsx(d,{children:e.jsxs(o,{direction:"row",spacing:1.25,alignItems:"center",children:[e.jsx(I,{name:t.name,size:32}),e.jsx(n,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},children:t.name})]})}),e.jsx(d,{children:e.jsx(n,{variant:"body2",children:S(t.businessType)||"—"})}),e.jsx(d,{children:e.jsxs(n,{variant:"body2",children:[t.city||"—",t.businessState?`, ${t.businessState}`:""]})}),e.jsx(d,{align:"right",sx:{fontWeight:600},children:t.parcelVolume.toLocaleString("en-IN")}),e.jsx(d,{children:e.jsx(L,{status:t.status})})]},t.id))})]})})})}),e.jsx(m,{item:!0,xs:12,lg:4,children:e.jsx($,{icon:U,title:"Clients by Status",color:"primary",children:e.jsx(c,{sx:{py:1.5},children:C.length===0?e.jsx(_,{title:"No data"}):e.jsx(ve,{data:C,centerValue:u.total,centerLabel:"Clients"})})})}),e.jsx(m,{item:!0,xs:12,lg:8,children:e.jsx($,{icon:V,title:"Clients by Business Type",color:"primary",children:D.length===0?e.jsx(_,{title:"No data"}):e.jsx(o,{spacing:2,children:D.map(([t,r],l)=>e.jsxs(c,{children:[e.jsxs(o,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:.75},children:[e.jsxs(o,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(c,{sx:{width:10,height:10,borderRadius:"3px",bgcolor:T[l%T.length]}}),e.jsx(n,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},children:S(t)})]}),e.jsxs(n,{variant:"body2",color:"text.secondary",children:[r," · ",Math.round(r/s.length*100),"%"]})]}),e.jsx(de,{variant:"determinate",value:r/G*100,sx:{height:8,borderRadius:4,bgcolor:"grey.100","& .MuiLinearProgress-bar":{borderRadius:4,backgroundColor:T[l%T.length]}}})]},t))})})}),e.jsx(m,{item:!0,xs:12,lg:4,children:e.jsx($,{icon:K,title:`App Users · ${j.length}`,color:"primary",children:j.length===0?e.jsx(_,{title:"No team users"}):e.jsx(o,{divider:e.jsx(E,{}),spacing:0,children:j.slice(0,6).map(t=>e.jsxs(o,{direction:"row",spacing:1.5,alignItems:"center",sx:{py:1.5},children:[e.jsx(I,{name:t.name,size:36}),e.jsxs(c,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(n,{variant:"subtitle2",sx:{fontWeight:600},children:t.name}),e.jsx(n,{variant:"caption",color:"text.secondary",noWrap:!0,sx:{display:"block"},children:t.email})]}),e.jsx(L,{status:t.role})]},t.id))})})})]})]})}export{Ae as default}; diff --git a/dist/assets/Dashboard-DO4SnFU-.js b/dist/assets/Dashboard-DO4SnFU-.js deleted file mode 100644 index 09033f4..0000000 --- a/dist/assets/Dashboard-DO4SnFU-.js +++ /dev/null @@ -1 +0,0 @@ -import{r as W,j as e,i as M,S as o,B as c,T as n,u as q,a as z,b as h,t as S,C as Q,d as J,U as I,D as E,c as K,f as X,e as Y,g as Z,h as ee}from"./index-DpAn5wLF.js";import{d as te}from"./Refresh-B8qCgQHN.js";import{d as re,a as se,b as ae,S as L}from"./StatusChip-C72vLAK4.js";import{P as F,A as ne,G as m}from"./PageHeader-CEew5Fw4.js";import{S as w}from"./StatCard-Nzv53jX8.js";import{E as _}from"./EmptyState-BsjYeVAX.js";import{B}from"./Button-BGNvVfej.js";import{T as ie,a as oe,b as le,c as N,d as ce}from"./TableRow-BcqnvRn2.js";import{T as d}from"./TableCell-PEGz6qo_.js";import{L as de}from"./LinearProgress-CwfnEpKL.js";import{C as xe}from"./Link-Bme8npFv.js";var A={},ue=M;Object.defineProperty(A,"__esModule",{value:!0});var H=A.default=void 0,he=ue(W()),me=e;H=A.default=(0,he.default)((0,me.jsx)("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9m-1 5v5l4.25 2.52.77-1.28-3.52-2.09V8z"}),"HistoryOutlined");var k={},pe=M;Object.defineProperty(k,"__esModule",{value:!0});var U=k.default=void 0,je=pe(W()),ge=e;U=k.default=(0,je.default)((0,ge.jsx)("path",{d:"M13 5.08c3.06.44 5.48 2.86 5.92 5.92h3.03c-.47-4.72-4.23-8.48-8.95-8.95zM18.92 13c-.44 3.06-2.86 5.48-5.92 5.92v3.03c4.72-.47 8.48-4.23 8.95-8.95zM11 18.92c-3.39-.49-6-3.4-6-6.92s2.61-6.43 6-6.92V2.05c-5.05.5-9 4.76-9 9.95 0 5.19 3.95 9.45 9 9.95z"}),"DonutLargeOutlined");var O={},fe=M;Object.defineProperty(O,"__esModule",{value:!0});var V=O.default=void 0,be=fe(W()),ye=e;V=O.default=(0,be.default)((0,ye.jsx)("path",{d:"m12 2-5.5 9h11zm0 3.84L13.93 9h-3.87zM17.5 13c-2.49 0-4.5 2.01-4.5 4.5s2.01 4.5 4.5 4.5 4.5-2.01 4.5-4.5-2.01-4.5-4.5-4.5m0 7c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5M3 21.5h8v-8H3zm2-6h4v4H5z"}),"CategoryOutlined");function ve({data:x=[],size:a=180,thickness:s=26,centerLabel:p,centerValue:j}){const b=x.reduce((i,f)=>i+f.value,0)||1,g=(a-s)/2,y=2*Math.PI*g;let v=0;return e.jsxs(o,{direction:{xs:"column",sm:"row"},spacing:3,alignItems:"center",justifyContent:"center",sx:{flexWrap:"wrap"},children:[e.jsxs(c,{sx:{position:"relative",width:a,maxWidth:"100%",aspectRatio:"1 / 1"},children:[e.jsx("svg",{width:"100%",height:"100%",viewBox:`0 0 ${a} ${a}`,children:e.jsxs("g",{transform:`rotate(-90 ${a/2} ${a/2})`,children:[e.jsx("circle",{cx:a/2,cy:a/2,r:g,fill:"none",stroke:"#F0F0F0",strokeWidth:s}),x.map((i,f)=>{const u=i.value/b*y,C=e.jsx("circle",{cx:a/2,cy:a/2,r:g,fill:"none",stroke:i.color,strokeWidth:s,strokeDasharray:`${u} ${y-u}`,strokeDashoffset:-v,strokeLinecap:"butt"},f);return v+=u,C})]})}),e.jsxs(c,{sx:{position:"absolute",inset:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[e.jsx(n,{variant:"h3",sx:{fontWeight:700},children:j??b}),e.jsx(n,{variant:"caption",color:"text.secondary",children:p??"Total"})]})]}),e.jsx(o,{spacing:1.25,children:x.map(i=>e.jsxs(o,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(c,{sx:{width:10,height:10,borderRadius:"3px",bgcolor:i.color}}),e.jsx(n,{variant:"body2",color:"text.secondary",sx:{minWidth:80},children:i.label}),e.jsx(n,{variant:"subtitle2",children:i.value.toLocaleString("en-IN")})]},i.label))})]})}const Ce={newclient:"#00A2AE",contacted:"#FFBF00",onboarded:"#00A854",lost:"#F04134"},Se=x=>Ce[String(x||"").toLowerCase()]||"#8C8C8C",T=["#C01227","#00A2AE","#00A854","#FFBF00","#9E0E20","#8C8C8C","#D6515C"];function $({icon:x,title:a,action:s,color:p="primary",noPadding:j=!1,children:b}){return e.jsxs(xe,{sx:{height:"100%",display:"flex",flexDirection:"column",borderRadius:4,boxShadow:"0 10px 30px rgba(0,0,0,0.03)",border:"1px solid rgba(0,0,0,0.04)"},children:[e.jsxs(o,{direction:"row",spacing:1.5,alignItems:"center",sx:{px:{xs:2,sm:3},py:2,borderBottom:1,borderColor:"divider",background:g=>`linear-gradient(90deg, ${g.palette[p].lighter}66 0%, transparent 100%)`},children:[e.jsx(c,{sx:{width:40,height:40,borderRadius:2,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:`${p}.lighter`,color:`${p}.main`,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.05)"},children:e.jsx(x,{fontSize:"small"})}),e.jsx(n,{variant:"h6",sx:{fontWeight:700,color:"grey.800",flexGrow:1,letterSpacing:"-0.3px"},children:a}),s]}),e.jsx(c,{sx:{p:j?0:{xs:2,sm:3},flexGrow:1},children:b})]})}function ke(){var P;const x=q(),a=z(x.breakpoints.down("sm")),[s,p]=h.useState([]),[j,b]=h.useState([]),[g,y]=h.useState(!0),[v,i]=h.useState(null),f=()=>{y(!0),i(null),Promise.all([X(),Y()]).then(([t,r])=>{p((t||[]).map(Z)),b((r||[]).map(ee))}).catch(t=>i(t.message||"Failed to load dashboard data")).finally(()=>y(!1))};h.useEffect(()=>{f()},[]);const u=h.useMemo(()=>({total:s.length,newCount:s.filter(t=>t.status==="newClient").length,parcels:s.reduce((t,r)=>t+r.parcelVolume,0),contracts:s.reduce((t,r)=>t+r.activeContracts,0)}),[s]),C=h.useMemo(()=>{const t={};return s.forEach(r=>{t[r.status]=(t[r.status]||0)+1}),Object.entries(t).sort((r,l)=>l[1]-r[1]).map(([r,l])=>({label:S(r),value:l,color:Se(r)}))},[s]),D=h.useMemo(()=>{const t={};return s.forEach(r=>{const l=r.businessType||"other";t[l]=(t[l]||0)+1}),Object.entries(t).sort((r,l)=>l[1]-r[1])},[s]),G=((P=D[0])==null?void 0:P[1])||1,R=h.useMemo(()=>[...s].sort((t,r)=>String(r.lastUpdated).localeCompare(String(t.lastUpdated))).slice(0,6),[s]);return new Date().toLocaleDateString("en-IN",{weekday:"long",day:"numeric",month:"long",year:"numeric"}),g?e.jsxs(e.Fragment,{children:[e.jsx(F,{title:"Dashboard",breadcrumbs:[{label:"Dashboard"}]}),e.jsx(c,{sx:{display:"flex",justifyContent:"center",py:12},children:e.jsx(Q,{})})]}):e.jsxs(e.Fragment,{children:[e.jsx(F,{title:"Dashboard",breadcrumbs:[{label:"Dashboard"}],action:e.jsx(B,{variant:"outlined",startIcon:e.jsx(te,{}),onClick:f,children:"Refresh"})}),v&&e.jsx(ne,{severity:"error",sx:{mb:2.5},action:e.jsx(B,{color:"inherit",size:"small",onClick:f,children:"Retry"}),children:v}),e.jsxs(m,{container:!0,spacing:3,children:[e.jsx(m,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(w,{accent:!0,title:"Total Clients",value:u.total,icon:J,color:"primary",caption:"All registered"})}),e.jsx(m,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(w,{accent:!0,title:"New Clients",value:u.newCount,icon:re,color:"primary",caption:"Awaiting onboarding"})}),e.jsx(m,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(w,{accent:!0,title:"Total Parcel Volume",value:u.parcels.toLocaleString("en-IN"),icon:se,color:"primary",caption:"Across all clients"})}),e.jsx(m,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(w,{accent:!0,title:"Active Contracts",value:u.contracts,icon:ae,color:"primary",caption:"Currently running"})}),e.jsx(m,{item:!0,xs:12,lg:8,children:e.jsx($,{icon:H,title:"Recent Clients",color:"primary",noPadding:!0,children:R.length===0?e.jsx(_,{title:"No clients yet",caption:"Add a client to see it here."}):a?e.jsx(o,{divider:e.jsx(E,{}),children:R.map(t=>e.jsxs(o,{direction:"row",spacing:1.25,alignItems:"center",sx:{px:2,py:1.5},children:[e.jsx(I,{name:t.name,size:36}),e.jsxs(c,{sx:{minWidth:0,flexGrow:1},children:[e.jsx(n,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},noWrap:!0,children:t.name}),e.jsxs(n,{variant:"caption",color:"text.secondary",noWrap:!0,sx:{display:"block"},children:[[S(t.businessType),t.city].filter(Boolean).join(" · ")||"—"," · ",t.parcelVolume.toLocaleString("en-IN")," parcels"]})]}),e.jsx(L,{status:t.status})]},t.id))}):e.jsx(ie,{children:e.jsxs(oe,{sx:{minWidth:600},children:[e.jsx(le,{children:e.jsxs(N,{sx:{"& th":{bgcolor:"grey.50",fontWeight:700,color:"grey.700",textTransform:"uppercase",fontSize:"0.72rem",letterSpacing:.4}},children:[e.jsx(d,{children:"Client"}),e.jsx(d,{children:"Type"}),e.jsx(d,{children:"Location"}),e.jsx(d,{align:"right",children:"Parcels"}),e.jsx(d,{children:"Status"})]})}),e.jsx(ce,{children:R.map(t=>e.jsxs(N,{hover:!0,children:[e.jsx(d,{children:e.jsxs(o,{direction:"row",spacing:1.25,alignItems:"center",children:[e.jsx(I,{name:t.name,size:32}),e.jsx(n,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},children:t.name})]})}),e.jsx(d,{children:e.jsx(n,{variant:"body2",children:S(t.businessType)||"—"})}),e.jsx(d,{children:e.jsxs(n,{variant:"body2",children:[t.city||"—",t.businessState?`, ${t.businessState}`:""]})}),e.jsx(d,{align:"right",sx:{fontWeight:600},children:t.parcelVolume.toLocaleString("en-IN")}),e.jsx(d,{children:e.jsx(L,{status:t.status})})]},t.id))})]})})})}),e.jsx(m,{item:!0,xs:12,lg:4,children:e.jsx($,{icon:U,title:"Clients by Status",color:"primary",children:e.jsx(c,{sx:{py:1.5},children:C.length===0?e.jsx(_,{title:"No data"}):e.jsx(ve,{data:C,centerValue:u.total,centerLabel:"Clients"})})})}),e.jsx(m,{item:!0,xs:12,lg:8,children:e.jsx($,{icon:V,title:"Clients by Business Type",color:"primary",children:D.length===0?e.jsx(_,{title:"No data"}):e.jsx(o,{spacing:2.25,children:D.map(([t,r],l)=>e.jsxs(c,{children:[e.jsxs(o,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:.75},children:[e.jsxs(o,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(c,{sx:{width:10,height:10,borderRadius:"3px",bgcolor:T[l%T.length]}}),e.jsx(n,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},children:S(t)})]}),e.jsxs(n,{variant:"body2",color:"text.secondary",children:[r," · ",Math.round(r/s.length*100),"%"]})]}),e.jsx(de,{variant:"determinate",value:r/G*100,sx:{height:8,borderRadius:4,bgcolor:"grey.100","& .MuiLinearProgress-bar":{borderRadius:4,backgroundColor:T[l%T.length]}}})]},t))})})}),e.jsx(m,{item:!0,xs:12,lg:4,children:e.jsx($,{icon:K,title:`App Users · ${j.length}`,color:"primary",children:j.length===0?e.jsx(_,{title:"No team users"}):e.jsx(o,{divider:e.jsx(E,{}),spacing:0,children:j.slice(0,6).map(t=>e.jsxs(o,{direction:"row",spacing:1.5,alignItems:"center",sx:{py:1.25},children:[e.jsx(I,{name:t.name,size:36}),e.jsxs(c,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(n,{variant:"subtitle2",sx:{fontWeight:600},children:t.name}),e.jsx(n,{variant:"caption",color:"text.secondary",noWrap:!0,sx:{display:"block"},children:t.email})]}),e.jsx(L,{status:t.role})]},t.id))})})})]})]})}export{ke as default}; diff --git a/dist/assets/DeleteOutline-BVDDlNca.js b/dist/assets/DeleteOutline-Dhk3Cr2d.js similarity index 97% rename from dist/assets/DeleteOutline-BVDDlNca.js rename to dist/assets/DeleteOutline-Dhk3Cr2d.js index c1260d6..b807ab2 100644 --- a/dist/assets/DeleteOutline-BVDDlNca.js +++ b/dist/assets/DeleteOutline-Dhk3Cr2d.js @@ -1 +1 @@ -import{a5 as F,j as e,b as U,E as Z,a2 as at,I as N,_ as s,x as lt,y as it,z as rt,q as X,F as z,a6 as ct,a7 as ut,H as pt,J as x,M as dt,a8 as gt,r as bt,i as ht}from"./index-DpAn5wLF.js";import{T as G}from"./TableCell-PEGz6qo_.js";import{S as Bt}from"./TextField-C0dUZvW0.js";const xt=F(e.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),Pt=F(e.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),mt=F(e.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),It=F(e.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight"),ft=["backIconButtonProps","count","disabled","getItemAriaLabel","nextIconButtonProps","onPageChange","page","rowsPerPage","showFirstButton","showLastButton","slots","slotProps"],vt=U.forwardRef(function(o,h){var R,P,y,C,_,$,m,u;const{backIconButtonProps:k,count:I,disabled:f=!1,getItemAriaLabel:p,nextIconButtonProps:H,onPageChange:v,page:a,rowsPerPage:g,showFirstButton:b,showLastButton:L,slots:d={},slotProps:n={}}=o,E=Z(o,ft),l=at(),K=B=>{v(B,0)},q=B=>{v(B,a-1)},S=B=>{v(B,a+1)},i=B=>{v(B,Math.max(0,Math.ceil(I/g)-1))},r=(R=d.firstButton)!=null?R:N,j=(P=d.lastButton)!=null?P:N,w=(y=d.nextButton)!=null?y:N,A=(C=d.previousButton)!=null?C:N,T=(_=d.firstButtonIcon)!=null?_:xt,D=($=d.lastButtonIcon)!=null?$:Pt,c=(m=d.nextButtonIcon)!=null?m:It,J=(u=d.previousButtonIcon)!=null?u:mt,O=l?j:r,tt=l?w:A,ot=l?A:w,et=l?r:j,st=l?n.lastButton:n.firstButton,W=l?n.nextButton:n.previousButton,Q=l?n.previousButton:n.nextButton,nt=l?n.firstButton:n.lastButton;return e.jsxs("div",s({ref:h},E,{children:[b&&e.jsx(O,s({onClick:K,disabled:f||a===0,"aria-label":p("first",a),title:p("first",a)},st,{children:l?e.jsx(D,s({},n.lastButtonIcon)):e.jsx(T,s({},n.firstButtonIcon))})),e.jsx(tt,s({onClick:q,disabled:f||a===0,color:"inherit","aria-label":p("previous",a),title:p("previous",a)},W??k,{children:l?e.jsx(c,s({},n.nextButtonIcon)):e.jsx(J,s({},n.previousButtonIcon))})),e.jsx(ot,s({onClick:S,disabled:f||(I!==-1?a>=Math.ceil(I/g)-1:!1),color:"inherit","aria-label":p("next",a),title:p("next",a)},Q??H,{children:l?e.jsx(J,s({},n.previousButtonIcon)):e.jsx(c,s({},n.nextButtonIcon))})),L&&e.jsx(et,s({onClick:i,disabled:f||a>=Math.ceil(I/g)-1,"aria-label":p("last",a),title:p("last",a)},nt,{children:l?e.jsx(T,s({},n.firstButtonIcon)):e.jsx(D,s({},n.lastButtonIcon))}))]}))});function Rt(t){return lt("MuiTablePagination",t)}const M=it("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var Y;const Lt=["ActionsComponent","backIconButtonProps","className","colSpan","component","count","disabled","getItemAriaLabel","labelDisplayedRows","labelRowsPerPage","nextIconButtonProps","onPageChange","onRowsPerPageChange","page","rowsPerPage","rowsPerPageOptions","SelectProps","showFirstButton","showLastButton","slotProps","slots"],St=x(G,{name:"MuiTablePagination",slot:"Root",overridesResolver:(t,o)=>o.root})(({theme:t})=>({overflow:"auto",color:(t.vars||t).palette.text.primary,fontSize:t.typography.pxToRem(14),"&:last-child":{padding:0}})),jt=x(gt,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(t,o)=>s({[`& .${M.actions}`]:o.actions},o.toolbar)})(({theme:t})=>({minHeight:52,paddingRight:2,[`${t.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[t.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${M.actions}`]:{flexShrink:0,marginLeft:20}})),wt=x("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(t,o)=>o.spacer})({flex:"1 1 100%"}),Tt=x("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(t,o)=>o.selectLabel})(({theme:t})=>s({},t.typography.body2,{flexShrink:0})),Mt=x(Bt,{name:"MuiTablePagination",slot:"Select",overridesResolver:(t,o)=>s({[`& .${M.selectIcon}`]:o.selectIcon,[`& .${M.select}`]:o.select},o.input,o.selectRoot)})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${M.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),yt=x(dt,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(t,o)=>o.menuItem})({}),Ct=x("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(t,o)=>o.displayedRows})(({theme:t})=>s({},t.typography.body2,{flexShrink:0}));function _t({from:t,to:o,count:h}){return`${t}–${o} of ${h!==-1?h:`more than ${o}`}`}function $t(t){return`Go to ${t} page`}const kt=t=>{const{classes:o}=t;return pt({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},Rt,o)},Kt=U.forwardRef(function(o,h){var R;const P=rt({props:o,name:"MuiTablePagination"}),{ActionsComponent:y=vt,backIconButtonProps:C,className:_,colSpan:$,component:m=G,count:u,disabled:k=!1,getItemAriaLabel:I=$t,labelDisplayedRows:f=_t,labelRowsPerPage:p="Rows per page:",nextIconButtonProps:H,onPageChange:v,onRowsPerPageChange:a,page:g,rowsPerPage:b,rowsPerPageOptions:L=[10,25,50,100],SelectProps:d={},showFirstButton:n=!1,showLastButton:E=!1,slotProps:l={},slots:K={}}=P,q=Z(P,Lt),S=P,i=kt(S),r=(R=l==null?void 0:l.select)!=null?R:d,j=r.native?"option":yt;let w;(m===G||m==="td")&&(w=$||1e3);const A=X(r.id),T=X(r.labelId),D=()=>u===-1?(g+1)*b:b===-1?u:Math.min(u,(g+1)*b);return e.jsx(St,s({colSpan:w,ref:h,as:m,ownerState:S,className:z(i.root,_)},q,{children:e.jsxs(jt,{className:i.toolbar,children:[e.jsx(wt,{className:i.spacer}),L.length>1&&e.jsx(Tt,{className:i.selectLabel,id:T,children:p}),L.length>1&&e.jsx(Mt,s({variant:"standard"},!r.variant&&{input:Y||(Y=e.jsx(ct,{}))},{value:b,onChange:a,id:A,labelId:T},r,{classes:s({},r.classes,{root:z(i.input,i.selectRoot,(r.classes||{}).root),select:z(i.select,(r.classes||{}).select),icon:z(i.selectIcon,(r.classes||{}).icon)}),disabled:k,children:L.map(c=>U.createElement(j,s({},!ut(j)&&{ownerState:S},{className:i.menuItem,key:c.label?c.label:c,value:c.value?c.value:c}),c.label?c.label:c))})),e.jsx(Ct,{className:i.displayedRows,children:f({from:u===0?0:g*b+1,to:D(),count:u===-1?-1:u,page:g})}),e.jsx(y,{className:i.actions,backIconButtonProps:C,count:u,nextIconButtonProps:H,onPageChange:v,page:g,rowsPerPage:b,showFirstButton:n,showLastButton:E,slotProps:l.actions,slots:K.actions,getItemAriaLabel:I,disabled:k})]})}))});var V={},At=ht;Object.defineProperty(V,"__esModule",{value:!0});var Dt=V.default=void 0,Nt=At(bt()),zt=e;Dt=V.default=(0,Nt.default)((0,zt.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutline");export{mt as K,Kt as T,It as a,Dt as d}; +import{a5 as F,j as e,b as U,E as Z,a2 as at,I as N,_ as s,x as lt,y as it,z as rt,q as X,F as z,a6 as ct,a7 as ut,H as pt,J as x,M as dt,a8 as gt,r as bt,i as ht}from"./index-D7LVXeIK.js";import{T as G}from"./TableCell-DreGbAeW.js";import{S as Bt}from"./TextField-Sd_pshci.js";const xt=F(e.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"}),"FirstPage"),Pt=F(e.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}),"LastPage"),mt=F(e.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),It=F(e.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight"),ft=["backIconButtonProps","count","disabled","getItemAriaLabel","nextIconButtonProps","onPageChange","page","rowsPerPage","showFirstButton","showLastButton","slots","slotProps"],vt=U.forwardRef(function(o,h){var R,P,y,C,_,$,m,u;const{backIconButtonProps:k,count:I,disabled:f=!1,getItemAriaLabel:p,nextIconButtonProps:H,onPageChange:v,page:a,rowsPerPage:g,showFirstButton:b,showLastButton:L,slots:d={},slotProps:n={}}=o,E=Z(o,ft),l=at(),K=B=>{v(B,0)},q=B=>{v(B,a-1)},S=B=>{v(B,a+1)},i=B=>{v(B,Math.max(0,Math.ceil(I/g)-1))},r=(R=d.firstButton)!=null?R:N,j=(P=d.lastButton)!=null?P:N,w=(y=d.nextButton)!=null?y:N,A=(C=d.previousButton)!=null?C:N,T=(_=d.firstButtonIcon)!=null?_:xt,D=($=d.lastButtonIcon)!=null?$:Pt,c=(m=d.nextButtonIcon)!=null?m:It,J=(u=d.previousButtonIcon)!=null?u:mt,O=l?j:r,tt=l?w:A,ot=l?A:w,et=l?r:j,st=l?n.lastButton:n.firstButton,W=l?n.nextButton:n.previousButton,Q=l?n.previousButton:n.nextButton,nt=l?n.firstButton:n.lastButton;return e.jsxs("div",s({ref:h},E,{children:[b&&e.jsx(O,s({onClick:K,disabled:f||a===0,"aria-label":p("first",a),title:p("first",a)},st,{children:l?e.jsx(D,s({},n.lastButtonIcon)):e.jsx(T,s({},n.firstButtonIcon))})),e.jsx(tt,s({onClick:q,disabled:f||a===0,color:"inherit","aria-label":p("previous",a),title:p("previous",a)},W??k,{children:l?e.jsx(c,s({},n.nextButtonIcon)):e.jsx(J,s({},n.previousButtonIcon))})),e.jsx(ot,s({onClick:S,disabled:f||(I!==-1?a>=Math.ceil(I/g)-1:!1),color:"inherit","aria-label":p("next",a),title:p("next",a)},Q??H,{children:l?e.jsx(J,s({},n.previousButtonIcon)):e.jsx(c,s({},n.nextButtonIcon))})),L&&e.jsx(et,s({onClick:i,disabled:f||a>=Math.ceil(I/g)-1,"aria-label":p("last",a),title:p("last",a)},nt,{children:l?e.jsx(T,s({},n.firstButtonIcon)):e.jsx(D,s({},n.lastButtonIcon))}))]}))});function Rt(t){return lt("MuiTablePagination",t)}const M=it("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var Y;const Lt=["ActionsComponent","backIconButtonProps","className","colSpan","component","count","disabled","getItemAriaLabel","labelDisplayedRows","labelRowsPerPage","nextIconButtonProps","onPageChange","onRowsPerPageChange","page","rowsPerPage","rowsPerPageOptions","SelectProps","showFirstButton","showLastButton","slotProps","slots"],St=x(G,{name:"MuiTablePagination",slot:"Root",overridesResolver:(t,o)=>o.root})(({theme:t})=>({overflow:"auto",color:(t.vars||t).palette.text.primary,fontSize:t.typography.pxToRem(14),"&:last-child":{padding:0}})),jt=x(gt,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(t,o)=>s({[`& .${M.actions}`]:o.actions},o.toolbar)})(({theme:t})=>({minHeight:52,paddingRight:2,[`${t.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[t.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${M.actions}`]:{flexShrink:0,marginLeft:20}})),wt=x("div",{name:"MuiTablePagination",slot:"Spacer",overridesResolver:(t,o)=>o.spacer})({flex:"1 1 100%"}),Tt=x("p",{name:"MuiTablePagination",slot:"SelectLabel",overridesResolver:(t,o)=>o.selectLabel})(({theme:t})=>s({},t.typography.body2,{flexShrink:0})),Mt=x(Bt,{name:"MuiTablePagination",slot:"Select",overridesResolver:(t,o)=>s({[`& .${M.selectIcon}`]:o.selectIcon,[`& .${M.select}`]:o.select},o.input,o.selectRoot)})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${M.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),yt=x(dt,{name:"MuiTablePagination",slot:"MenuItem",overridesResolver:(t,o)=>o.menuItem})({}),Ct=x("p",{name:"MuiTablePagination",slot:"DisplayedRows",overridesResolver:(t,o)=>o.displayedRows})(({theme:t})=>s({},t.typography.body2,{flexShrink:0}));function _t({from:t,to:o,count:h}){return`${t}–${o} of ${h!==-1?h:`more than ${o}`}`}function $t(t){return`Go to ${t} page`}const kt=t=>{const{classes:o}=t;return pt({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},Rt,o)},Kt=U.forwardRef(function(o,h){var R;const P=rt({props:o,name:"MuiTablePagination"}),{ActionsComponent:y=vt,backIconButtonProps:C,className:_,colSpan:$,component:m=G,count:u,disabled:k=!1,getItemAriaLabel:I=$t,labelDisplayedRows:f=_t,labelRowsPerPage:p="Rows per page:",nextIconButtonProps:H,onPageChange:v,onRowsPerPageChange:a,page:g,rowsPerPage:b,rowsPerPageOptions:L=[10,25,50,100],SelectProps:d={},showFirstButton:n=!1,showLastButton:E=!1,slotProps:l={},slots:K={}}=P,q=Z(P,Lt),S=P,i=kt(S),r=(R=l==null?void 0:l.select)!=null?R:d,j=r.native?"option":yt;let w;(m===G||m==="td")&&(w=$||1e3);const A=X(r.id),T=X(r.labelId),D=()=>u===-1?(g+1)*b:b===-1?u:Math.min(u,(g+1)*b);return e.jsx(St,s({colSpan:w,ref:h,as:m,ownerState:S,className:z(i.root,_)},q,{children:e.jsxs(jt,{className:i.toolbar,children:[e.jsx(wt,{className:i.spacer}),L.length>1&&e.jsx(Tt,{className:i.selectLabel,id:T,children:p}),L.length>1&&e.jsx(Mt,s({variant:"standard"},!r.variant&&{input:Y||(Y=e.jsx(ct,{}))},{value:b,onChange:a,id:A,labelId:T},r,{classes:s({},r.classes,{root:z(i.input,i.selectRoot,(r.classes||{}).root),select:z(i.select,(r.classes||{}).select),icon:z(i.selectIcon,(r.classes||{}).icon)}),disabled:k,children:L.map(c=>U.createElement(j,s({},!ut(j)&&{ownerState:S},{className:i.menuItem,key:c.label?c.label:c,value:c.value?c.value:c}),c.label?c.label:c))})),e.jsx(Ct,{className:i.displayedRows,children:f({from:u===0?0:g*b+1,to:D(),count:u===-1?-1:u,page:g})}),e.jsx(y,{className:i.actions,backIconButtonProps:C,count:u,nextIconButtonProps:H,onPageChange:v,page:g,rowsPerPage:b,showFirstButton:n,showLastButton:E,slotProps:l.actions,slots:K.actions,getItemAriaLabel:I,disabled:k})]})}))});var V={},At=ht;Object.defineProperty(V,"__esModule",{value:!0});var Dt=V.default=void 0,Nt=At(bt()),zt=e;Dt=V.default=(0,Nt.default)((0,zt.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"}),"DeleteOutline");export{mt as K,Kt as T,It as a,Dt as d}; diff --git a/dist/assets/EditOutlined-B2ltVbl8.js b/dist/assets/EditOutlined-DS7hq7Cq.js similarity index 84% rename from dist/assets/EditOutlined-B2ltVbl8.js rename to dist/assets/EditOutlined-DS7hq7Cq.js index 0174d1b..7c122c6 100644 --- a/dist/assets/EditOutlined-B2ltVbl8.js +++ b/dist/assets/EditOutlined-DS7hq7Cq.js @@ -1 +1 @@ -import{r as t,j as r,i as a}from"./index-DpAn5wLF.js";var e={},u=a;Object.defineProperty(e,"__esModule",{value:!0});var i=e.default=void 0,d=u(t()),l=r;i=e.default=(0,d.default)((0,l.jsx)("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"}),"EditOutlined");export{i as d}; +import{r as t,j as r,i as a}from"./index-D7LVXeIK.js";var e={},u=a;Object.defineProperty(e,"__esModule",{value:!0});var i=e.default=void 0,d=u(t()),l=r;i=e.default=(0,d.default)((0,l.jsx)("path",{d:"m14.06 9.02.92.92L5.92 19H5v-.92zM17.66 3c-.25 0-.51.1-.7.29l-1.83 1.83 3.75 3.75 1.83-1.83c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.2-.2-.45-.29-.71-.29m-3.6 3.19L3 17.25V21h3.75L17.81 9.94z"}),"EditOutlined");export{i as d}; diff --git a/dist/assets/EmptyState-B9FcYx_n.js b/dist/assets/EmptyState-B9FcYx_n.js new file mode 100644 index 0000000..159878c --- /dev/null +++ b/dist/assets/EmptyState-B9FcYx_n.js @@ -0,0 +1 @@ +import{x as C,y as w,b as _,z as R,E as S,_ as b,j as e,F as z,H as $,J as I,r as u,i as p,B as d,S as x,T as i}from"./index-D7LVXeIK.js";import{C as M}from"./Link-BEif5YS2.js";function D(r){return C("MuiCardContent",r)}w("MuiCardContent",["root"]);const k=["className","component"],E=r=>{const{classes:o}=r;return $({root:["root"]},D,o)},U=I("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(r,o)=>o.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),H=_.forwardRef(function(o,t){const s=R({props:o,name:"MuiCardContent"}),{className:l,component:n="div"}=s,v=S(s,k),a=b({},s,{component:n}),c=E(a);return e.jsx(U,b({as:n,className:z(c.root,l),ownerState:a,ref:t},v))});var h={},q=p;Object.defineProperty(h,"__esModule",{value:!0});var j=h.default=void 0,A=q(u()),O=e;j=h.default=(0,A.default)((0,O.jsx)("path",{d:"M13 19V7.83l4.88 4.88c.39.39 1.03.39 1.42 0 .39-.39.39-1.02 0-1.41l-6.59-6.59a.9959.9959 0 0 0-1.41 0l-6.6 6.58c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L11 7.83V19c0 .55.45 1 1 1s1-.45 1-1"}),"ArrowUpwardRounded");var f={},P=p;Object.defineProperty(f,"__esModule",{value:!0});var m=f.default=void 0,V=P(u()),W=e;m=f.default=(0,V.default)((0,W.jsx)("path",{d:"M11 5v11.17l-4.88-4.88c-.39-.39-1.03-.39-1.42 0-.39.39-.39 1.02 0 1.41l6.59 6.59c.39.39 1.02.39 1.41 0l6.59-6.59c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L13 16.17V5c0-.55-.45-1-1-1s-1 .45-1 1"}),"ArrowDownwardRounded");function G({title:r,value:o,icon:t,color:s="primary",trend:l,caption:n,accent:v=!1}){const a=typeof l=="number"?l>=0:null;return e.jsxs(M,{sx:{height:"100%",position:"relative",overflow:"hidden",borderRadius:3,boxShadow:"0 8px 24px rgba(0,0,0,0.03)",border:"1px solid rgba(0,0,0,0.04)",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)","&:hover":{transform:"translateY(-4px)",boxShadow:"0 16px 32px rgba(0,0,0,0.06)"},background:c=>`linear-gradient(145deg, ${c.palette.background.paper} 0%, ${c.palette[s].lighter}15 100%)`},children:[t&&e.jsx(d,{sx:{position:"absolute",right:-15,bottom:-15,opacity:.04,transform:"rotate(-15deg)",pointerEvents:"none"},children:e.jsx(t,{sx:{fontSize:110}})}),e.jsxs(H,{sx:{p:2.5,"&:last-child":{pb:2.5},height:"100%",display:"flex",flexDirection:"column"},children:[e.jsxs(x,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:1.5,position:"relative",zIndex:2},children:[e.jsx(i,{variant:"body2",sx:{fontWeight:600,color:"text.secondary"},children:r}),t&&e.jsx(d,{sx:{width:38,height:38,borderRadius:2,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:`${s}.lighter`,color:`${s}.main`,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.05)"},children:e.jsx(t,{fontSize:"small"})})]}),e.jsx(d,{sx:{flexGrow:1,position:"relative",zIndex:2},children:e.jsx(i,{variant:"h4",sx:{fontWeight:800,color:"grey.900",letterSpacing:"-0.5px",lineHeight:1},children:o})}),(a!==null||n)&&e.jsxs(x,{direction:"row",spacing:1,alignItems:"center",sx:{mt:2,pt:1.5,borderTop:"1px dashed rgba(0,0,0,0.06)",position:"relative",zIndex:2},children:[a!==null&&e.jsxs(x,{direction:"row",spacing:.25,alignItems:"center",sx:{bgcolor:a?"success.lighter":"error.lighter",px:.75,py:.25,borderRadius:1},children:[a?e.jsx(j,{sx:{fontSize:14,color:"success.dark"}}):e.jsx(m,{sx:{fontSize:14,color:"error.dark"}}),e.jsxs(i,{variant:"caption",sx:{fontWeight:700,color:a?"success.dark":"error.dark"},children:[Math.abs(l),"%"]})]}),n&&e.jsx(i,{variant:"caption",sx:{color:"text.secondary",fontWeight:600},children:n})]})]})]})}var g={},N=p;Object.defineProperty(g,"__esModule",{value:!0});var y=g.default=void 0,B=N(u()),L=e;y=g.default=(0,B.default)((0,L.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5v-3h3.56c.69 1.19 1.97 2 3.45 2s2.75-.81 3.45-2H19zm0-5h-4.99c0 1.1-.9 2-2 2s-2-.9-2-2H5V5h14z"}),"InboxOutlined");function J({icon:r=y,title:o="No records found",caption:t,sx:s}){return e.jsxs(d,{sx:{textAlign:"center",py:6,px:2,...s},children:[e.jsx(d,{sx:{width:72,height:72,borderRadius:"50%",bgcolor:"grey.100",display:"inline-flex",alignItems:"center",justifyContent:"center",mb:2},children:e.jsx(r,{sx:{fontSize:34,color:"grey.400"}})}),e.jsx(i,{variant:"h5",color:"text.secondary",children:o}),t&&e.jsx(i,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:t})]})}export{J as E,G as S}; diff --git a/dist/assets/EmptyState-BsjYeVAX.js b/dist/assets/EmptyState-BsjYeVAX.js deleted file mode 100644 index 6a89406..0000000 --- a/dist/assets/EmptyState-BsjYeVAX.js +++ /dev/null @@ -1 +0,0 @@ -import{r as d,j as e,i as l,B as o,T as n}from"./index-DpAn5wLF.js";var r={},x=l;Object.defineProperty(r,"__esModule",{value:!0});var a=r.default=void 0,u=x(d()),h=e;a=r.default=(0,u.default)((0,h.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 16H5v-3h3.56c.69 1.19 1.97 2 3.45 2s2.75-.81 3.45-2H19zm0-5h-4.99c0 1.1-.9 2-2 2s-2-.9-2-2H5V5h14z"}),"InboxOutlined");function p({icon:s=a,title:i="No records found",caption:t,sx:c}){return e.jsxs(o,{sx:{textAlign:"center",py:6,px:2,...c},children:[e.jsx(o,{sx:{width:72,height:72,borderRadius:"50%",bgcolor:"grey.100",display:"inline-flex",alignItems:"center",justifyContent:"center",mb:2},children:e.jsx(s,{sx:{fontSize:34,color:"grey.400"}})}),e.jsx(n,{variant:"h5",color:"text.secondary",children:i}),t&&e.jsx(n,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:t})]})}export{p as E}; diff --git a/dist/assets/Error404-BKXchBZ5.js b/dist/assets/Error404-C6jWFP53.js similarity index 79% rename from dist/assets/Error404-BKXchBZ5.js rename to dist/assets/Error404-C6jWFP53.js index 12eafac..0e03164 100644 --- a/dist/assets/Error404-BKXchBZ5.js +++ b/dist/assets/Error404-C6jWFP53.js @@ -1 +1 @@ -import{aq as o,j as e,B as t,S as i,T as r}from"./index-DpAn5wLF.js";import{d as n}from"./HomeOutlined-DE-nKXdW.js";import{B as s}from"./Button-BGNvVfej.js";function c(){const a=o();return e.jsx(t,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",p:3,textAlign:"center"},children:e.jsxs(i,{spacing:2,alignItems:"center",children:[e.jsx(r,{sx:{fontWeight:900,fontSize:{xs:"6rem",md:"9rem"},lineHeight:1,color:"primary.main"},children:"404"}),e.jsx(t,{sx:{width:64,height:4,borderRadius:2,bgcolor:"primary.main"}}),e.jsx(r,{variant:"h3",sx:{fontWeight:700,color:"grey.800"},children:"Page Not Found"}),e.jsx(r,{variant:"body1",color:"text.secondary",sx:{maxWidth:460},children:"The page you are looking for was moved, removed, renamed, or might never exist!"}),e.jsx(s,{variant:"contained",size:"large",startIcon:e.jsx(n,{}),onClick:()=>a("/dashboard"),sx:{mt:1},children:"Back To Home"})]})})}export{c as default}; +import{aq as o,j as e,B as t,S as i,T as r}from"./index-D7LVXeIK.js";import{d as n}from"./HomeOutlined-Bb25CBrJ.js";import{B as s}from"./Button-Bqp5awT1.js";function c(){const a=o();return e.jsx(t,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",p:3,textAlign:"center"},children:e.jsxs(i,{spacing:2,alignItems:"center",children:[e.jsx(r,{sx:{fontWeight:900,fontSize:{xs:"6rem",md:"9rem"},lineHeight:1,color:"primary.main"},children:"404"}),e.jsx(t,{sx:{width:64,height:4,borderRadius:2,bgcolor:"primary.main"}}),e.jsx(r,{variant:"h3",sx:{fontWeight:700,color:"grey.800"},children:"Page Not Found"}),e.jsx(r,{variant:"body1",color:"text.secondary",sx:{maxWidth:460},children:"The page you are looking for was moved, removed, renamed, or might never exist!"}),e.jsx(s,{variant:"contained",size:"large",startIcon:e.jsx(n,{}),onClick:()=>a("/dashboard"),sx:{mt:1},children:"Back To Home"})]})})}export{c as default}; diff --git a/dist/assets/Error500-DApcbPUH.js b/dist/assets/Error500-C7U9zgDa.js similarity index 79% rename from dist/assets/Error500-DApcbPUH.js rename to dist/assets/Error500-C7U9zgDa.js index 03b8f63..2304d80 100644 --- a/dist/assets/Error500-DApcbPUH.js +++ b/dist/assets/Error500-C7U9zgDa.js @@ -1 +1 @@ -import{aq as i,j as r,B as t,S as n,T as e}from"./index-DpAn5wLF.js";import{d as s}from"./HomeOutlined-DE-nKXdW.js";import{B as o}from"./Button-BGNvVfej.js";function m(){const a=i();return r.jsx(t,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",p:3,textAlign:"center"},children:r.jsxs(n,{spacing:2,alignItems:"center",children:[r.jsx(e,{sx:{fontWeight:900,fontSize:{xs:"6rem",md:"9rem"},lineHeight:1,color:"primary.main"},children:"500"}),r.jsx(t,{sx:{width:64,height:4,borderRadius:2,bgcolor:"primary.main"}}),r.jsx(e,{variant:"h3",sx:{fontWeight:700,color:"grey.800"},children:"Internal Server Error"}),r.jsx(e,{variant:"body1",color:"text.secondary",sx:{maxWidth:460},children:"Server error 500. We are fixing the problem. Please try again at a later stage."}),r.jsx(o,{variant:"contained",size:"large",startIcon:r.jsx(s,{}),onClick:()=>a("/dashboard"),sx:{mt:1},children:"Back To Home"})]})})}export{m as default}; +import{aq as i,j as r,B as t,S as n,T as e}from"./index-D7LVXeIK.js";import{d as s}from"./HomeOutlined-Bb25CBrJ.js";import{B as o}from"./Button-Bqp5awT1.js";function m(){const a=i();return r.jsx(t,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",p:3,textAlign:"center"},children:r.jsxs(n,{spacing:2,alignItems:"center",children:[r.jsx(e,{sx:{fontWeight:900,fontSize:{xs:"6rem",md:"9rem"},lineHeight:1,color:"primary.main"},children:"500"}),r.jsx(t,{sx:{width:64,height:4,borderRadius:2,bgcolor:"primary.main"}}),r.jsx(e,{variant:"h3",sx:{fontWeight:700,color:"grey.800"},children:"Internal Server Error"}),r.jsx(e,{variant:"body1",color:"text.secondary",sx:{maxWidth:460},children:"Server error 500. We are fixing the problem. Please try again at a later stage."}),r.jsx(o,{variant:"contained",size:"large",startIcon:r.jsx(s,{}),onClick:()=>a("/dashboard"),sx:{mt:1},children:"Back To Home"})]})})}export{m as default}; diff --git a/dist/assets/FormControlLabel-DwXmo7ko.js b/dist/assets/FormControlLabel-Bp5Li47e.js similarity index 97% rename from dist/assets/FormControlLabel-DwXmo7ko.js rename to dist/assets/FormControlLabel-Bp5Li47e.js index 1252ea2..6afb71a 100644 --- a/dist/assets/FormControlLabel-DwXmo7ko.js +++ b/dist/assets/FormControlLabel-Bp5Li47e.js @@ -1 +1 @@ -import{a5 as M,j as a,x as N,y as q,b as x,z as E,E as H,_ as n,F as j,G as b,H as T,J as S,Y as O,O as D,at as V,au as A,T as _,S as w}from"./index-DpAn5wLF.js";import{S as W}from"./SwitchBase-1TkNOx4a.js";const G=M(a.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),J=M(a.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),Y=M(a.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function K(e){return N("MuiCheckbox",e)}const R=q("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),Q=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],X=e=>{const{classes:o,indeterminate:r,color:s,size:l}=e,t={root:["root",r&&"indeterminate",`color${b(s)}`,`size${b(l)}`]},c=T(t,K,o);return n({},o,c)},Z=S(W,{shouldForwardProp:e=>O(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:r}=e;return[o.root,r.indeterminate&&o.indeterminate,o[`size${b(r.size)}`],r.color!=="default"&&o[`color${b(r.color)}`]]}})(({theme:e,ownerState:o})=>n({color:(e.vars||e).palette.text.secondary},!o.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${o.color==="default"?e.vars.palette.action.activeChannel:e.vars.palette[o.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:D(o.color==="default"?e.palette.action.active:e.palette[o.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},o.color!=="default"&&{[`&.${R.checked}, &.${R.indeterminate}`]:{color:(e.vars||e).palette[o.color].main},[`&.${R.disabled}`]:{color:(e.vars||e).palette.action.disabled}})),ee=a.jsx(J,{}),oe=a.jsx(G,{}),re=a.jsx(Y,{}),de=x.forwardRef(function(o,r){var s,l;const t=E({props:o,name:"MuiCheckbox"}),{checkedIcon:c=ee,color:y="primary",icon:d=oe,indeterminate:i=!1,indeterminateIcon:v=re,inputProps:$,size:h="medium",className:k}=t,z=H(t,Q),P=i?v:d,p=i?v:c,C=n({},t,{color:y,indeterminate:i,size:h}),m=X(C);return a.jsx(Z,n({type:"checkbox",inputProps:n({"data-indeterminate":i},$),icon:x.cloneElement(P,{fontSize:(s=P.props.fontSize)!=null?s:h}),checkedIcon:x.cloneElement(p,{fontSize:(l=p.props.fontSize)!=null?l:h}),ownerState:C,ref:r,className:j(m.root,k)},z,{classes:m}))});function te(e){return N("MuiFormControlLabel",e)}const f=q("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),ae=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],le=e=>{const{classes:o,disabled:r,labelPlacement:s,error:l,required:t}=e,c={root:["root",r&&"disabled",`labelPlacement${b(s)}`,l&&"error",t&&"required"],label:["label",r&&"disabled"],asterisk:["asterisk",l&&"error"]};return T(c,te,o)},se=S("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:r}=e;return[{[`& .${f.label}`]:o.label},o.root,o[`labelPlacement${b(r.labelPlacement)}`]]}})(({theme:e,ownerState:o})=>n({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${f.disabled}`]:{cursor:"default"}},o.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},o.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},o.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${f.label}`]:{[`&.${f.disabled}`]:{color:(e.vars||e).palette.text.disabled}}})),ne=S("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,o)=>o.asterisk})(({theme:e})=>({[`&.${f.error}`]:{color:(e.vars||e).palette.error.main}})),pe=x.forwardRef(function(o,r){var s,l;const t=E({props:o,name:"MuiFormControlLabel"}),{className:c,componentsProps:y={},control:d,disabled:i,disableTypography:v,label:$,labelPlacement:h="end",required:k,slotProps:z={}}=t,P=H(t,ae),p=V(),C=(s=i??d.props.disabled)!=null?s:p==null?void 0:p.disabled,m=k??d.props.required,B={disabled:C,required:m};["checked","name","onChange","value","inputRef"].forEach(g=>{typeof d.props[g]>"u"&&typeof t[g]<"u"&&(B[g]=t[g])});const U=A({props:t,muiFormControl:p,states:["error"]}),I=n({},t,{disabled:C,labelPlacement:h,required:m,error:U.error}),L=le(I),F=(l=z.typography)!=null?l:y.typography;let u=$;return u!=null&&u.type!==_&&!v&&(u=a.jsx(_,n({component:"span"},F,{className:j(L.label,F==null?void 0:F.className),children:u}))),a.jsxs(se,n({className:j(L.root,c),ownerState:I,ref:r},P,{children:[x.cloneElement(d,B),m?a.jsxs(w,{display:"block",children:[u,a.jsxs(ne,{ownerState:I,"aria-hidden":!0,className:L.asterisk,children:[" ","*"]})]}):u]}))});export{de as C,pe as F}; +import{a5 as M,j as a,x as N,y as q,b as x,z as E,E as H,_ as n,F as j,G as b,H as T,J as S,Y as O,O as D,at as V,au as A,T as _,S as w}from"./index-D7LVXeIK.js";import{S as W}from"./SwitchBase-CWj2k0Bo.js";const G=M(a.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),J=M(a.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),Y=M(a.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function K(e){return N("MuiCheckbox",e)}const R=q("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),Q=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],X=e=>{const{classes:o,indeterminate:r,color:s,size:l}=e,t={root:["root",r&&"indeterminate",`color${b(s)}`,`size${b(l)}`]},c=T(t,K,o);return n({},o,c)},Z=S(W,{shouldForwardProp:e=>O(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:r}=e;return[o.root,r.indeterminate&&o.indeterminate,o[`size${b(r.size)}`],r.color!=="default"&&o[`color${b(r.color)}`]]}})(({theme:e,ownerState:o})=>n({color:(e.vars||e).palette.text.secondary},!o.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${o.color==="default"?e.vars.palette.action.activeChannel:e.vars.palette[o.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:D(o.color==="default"?e.palette.action.active:e.palette[o.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},o.color!=="default"&&{[`&.${R.checked}, &.${R.indeterminate}`]:{color:(e.vars||e).palette[o.color].main},[`&.${R.disabled}`]:{color:(e.vars||e).palette.action.disabled}})),ee=a.jsx(J,{}),oe=a.jsx(G,{}),re=a.jsx(Y,{}),de=x.forwardRef(function(o,r){var s,l;const t=E({props:o,name:"MuiCheckbox"}),{checkedIcon:c=ee,color:y="primary",icon:d=oe,indeterminate:i=!1,indeterminateIcon:v=re,inputProps:$,size:h="medium",className:k}=t,z=H(t,Q),P=i?v:d,p=i?v:c,C=n({},t,{color:y,indeterminate:i,size:h}),m=X(C);return a.jsx(Z,n({type:"checkbox",inputProps:n({"data-indeterminate":i},$),icon:x.cloneElement(P,{fontSize:(s=P.props.fontSize)!=null?s:h}),checkedIcon:x.cloneElement(p,{fontSize:(l=p.props.fontSize)!=null?l:h}),ownerState:C,ref:r,className:j(m.root,k)},z,{classes:m}))});function te(e){return N("MuiFormControlLabel",e)}const f=q("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),ae=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],le=e=>{const{classes:o,disabled:r,labelPlacement:s,error:l,required:t}=e,c={root:["root",r&&"disabled",`labelPlacement${b(s)}`,l&&"error",t&&"required"],label:["label",r&&"disabled"],asterisk:["asterisk",l&&"error"]};return T(c,te,o)},se=S("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:r}=e;return[{[`& .${f.label}`]:o.label},o.root,o[`labelPlacement${b(r.labelPlacement)}`]]}})(({theme:e,ownerState:o})=>n({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${f.disabled}`]:{cursor:"default"}},o.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},o.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},o.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${f.label}`]:{[`&.${f.disabled}`]:{color:(e.vars||e).palette.text.disabled}}})),ne=S("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,o)=>o.asterisk})(({theme:e})=>({[`&.${f.error}`]:{color:(e.vars||e).palette.error.main}})),pe=x.forwardRef(function(o,r){var s,l;const t=E({props:o,name:"MuiFormControlLabel"}),{className:c,componentsProps:y={},control:d,disabled:i,disableTypography:v,label:$,labelPlacement:h="end",required:k,slotProps:z={}}=t,P=H(t,ae),p=V(),C=(s=i??d.props.disabled)!=null?s:p==null?void 0:p.disabled,m=k??d.props.required,B={disabled:C,required:m};["checked","name","onChange","value","inputRef"].forEach(g=>{typeof d.props[g]>"u"&&typeof t[g]<"u"&&(B[g]=t[g])});const U=A({props:t,muiFormControl:p,states:["error"]}),I=n({},t,{disabled:C,labelPlacement:h,required:m,error:U.error}),L=le(I),F=(l=z.typography)!=null?l:y.typography;let u=$;return u!=null&&u.type!==_&&!v&&(u=a.jsx(_,n({component:"span"},F,{className:j(L.label,F==null?void 0:F.className),children:u}))),a.jsxs(se,n({className:j(L.root,c),ownerState:I,ref:r},P,{children:[x.cloneElement(d,B),m?a.jsxs(w,{display:"block",children:[u,a.jsxs(ne,{ownerState:I,"aria-hidden":!0,className:L.asterisk,children:[" ","*"]})]}):u]}))});export{de as C,pe as F}; diff --git a/dist/assets/HomeOutlined-DE-nKXdW.js b/dist/assets/HomeOutlined-Bb25CBrJ.js similarity index 78% rename from dist/assets/HomeOutlined-DE-nKXdW.js rename to dist/assets/HomeOutlined-Bb25CBrJ.js index bed1ffb..79066c9 100644 --- a/dist/assets/HomeOutlined-DE-nKXdW.js +++ b/dist/assets/HomeOutlined-Bb25CBrJ.js @@ -1 +1 @@ -import{r,j as t,i as a}from"./index-DpAn5wLF.js";var e={},u=a;Object.defineProperty(e,"__esModule",{value:!0});var v=e.default=void 0,o=u(r()),i=t;v=e.default=(0,o.default)((0,i.jsx)("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"}),"HomeOutlined");export{v as d}; +import{r,j as t,i as a}from"./index-D7LVXeIK.js";var e={},u=a;Object.defineProperty(e,"__esModule",{value:!0});var v=e.default=void 0,o=u(r()),i=t;v=e.default=(0,o.default)((0,i.jsx)("path",{d:"m12 5.69 5 4.5V18h-2v-6H9v6H7v-7.81zM12 3 2 12h3v8h6v-6h2v6h6v-8h3z"}),"HomeOutlined");export{v as d}; diff --git a/dist/assets/InputAdornment-BWnl4jqW.js b/dist/assets/InputAdornment-CMIlL2rx.js similarity index 96% rename from dist/assets/InputAdornment-BWnl4jqW.js rename to dist/assets/InputAdornment-CMIlL2rx.js index 8ffe854..0b95092 100644 --- a/dist/assets/InputAdornment-BWnl4jqW.js +++ b/dist/assets/InputAdornment-CMIlL2rx.js @@ -1 +1 @@ -import{x as P,y as C,b,z as I,E as A,at as j,_ as c,j as a,av as L,F as z,T as R,G as m,H as F,J as T}from"./index-DpAn5wLF.js";function _(n){return P("MuiInputAdornment",n)}const x=C("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var f;const $=["children","className","component","disablePointerEvents","disableTypography","position","variant"],M=(n,t)=>{const{ownerState:e}=n;return[t.root,t[`position${m(e.position)}`],e.disablePointerEvents===!0&&t.disablePointerEvents,t[e.variant]]},N=n=>{const{classes:t,disablePointerEvents:e,hiddenLabel:o,position:s,size:r,variant:l}=n,d={root:["root",e&&"disablePointerEvents",s&&`position${m(s)}`,l,o&&"hiddenLabel",r&&`size${m(r)}`]};return F(d,_,t)},U=T("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:M})(({theme:n,ownerState:t})=>c({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(n.vars||n).palette.action.active},t.variant==="filled"&&{[`&.${x.positionStart}&:not(.${x.hiddenLabel})`]:{marginTop:16}},t.position==="start"&&{marginRight:8},t.position==="end"&&{marginLeft:8},t.disablePointerEvents===!0&&{pointerEvents:"none"})),w=b.forwardRef(function(t,e){const o=I({props:t,name:"MuiInputAdornment"}),{children:s,className:r,component:l="div",disablePointerEvents:d=!1,disableTypography:g=!1,position:u,variant:v}=o,E=A(o,$),i=j()||{};let p=v;v&&i.variant,i&&!p&&(p=i.variant);const h=c({},o,{hiddenLabel:i.hiddenLabel,size:i.size,disablePointerEvents:d,position:u,variant:p}),y=N(h);return a.jsx(L.Provider,{value:null,children:a.jsx(U,c({as:l,ownerState:h,className:z(y.root,r),ref:e},E,{children:typeof s=="string"&&!g?a.jsx(R,{color:"text.secondary",children:s}):a.jsxs(b.Fragment,{children:[u==="start"?f||(f=a.jsx("span",{className:"notranslate",children:"​"})):null,s]})}))})});export{w as I}; +import{x as P,y as C,b,z as I,E as A,at as j,_ as c,j as a,av as L,F as z,T as R,G as m,H as F,J as T}from"./index-D7LVXeIK.js";function _(n){return P("MuiInputAdornment",n)}const x=C("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var f;const $=["children","className","component","disablePointerEvents","disableTypography","position","variant"],M=(n,t)=>{const{ownerState:e}=n;return[t.root,t[`position${m(e.position)}`],e.disablePointerEvents===!0&&t.disablePointerEvents,t[e.variant]]},N=n=>{const{classes:t,disablePointerEvents:e,hiddenLabel:o,position:s,size:r,variant:l}=n,d={root:["root",e&&"disablePointerEvents",s&&`position${m(s)}`,l,o&&"hiddenLabel",r&&`size${m(r)}`]};return F(d,_,t)},U=T("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:M})(({theme:n,ownerState:t})=>c({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(n.vars||n).palette.action.active},t.variant==="filled"&&{[`&.${x.positionStart}&:not(.${x.hiddenLabel})`]:{marginTop:16}},t.position==="start"&&{marginRight:8},t.position==="end"&&{marginLeft:8},t.disablePointerEvents===!0&&{pointerEvents:"none"})),w=b.forwardRef(function(t,e){const o=I({props:t,name:"MuiInputAdornment"}),{children:s,className:r,component:l="div",disablePointerEvents:d=!1,disableTypography:g=!1,position:u,variant:v}=o,E=A(o,$),i=j()||{};let p=v;v&&i.variant,i&&!p&&(p=i.variant);const h=c({},o,{hiddenLabel:i.hiddenLabel,size:i.size,disablePointerEvents:d,position:u,variant:p}),y=N(h);return a.jsx(L.Provider,{value:null,children:a.jsx(U,c({as:l,ownerState:h,className:z(y.root,r),ref:e},E,{children:typeof s=="string"&&!g?a.jsx(R,{color:"text.secondary",children:s}):a.jsxs(b.Fragment,{children:[u==="start"?f||(f=a.jsx("span",{className:"notranslate",children:"​"})):null,s]})}))})});export{w as I}; diff --git a/dist/assets/LinearProgress-CwfnEpKL.js b/dist/assets/LinearProgress-yV9HNsZU.js similarity index 98% rename from dist/assets/LinearProgress-CwfnEpKL.js rename to dist/assets/LinearProgress-yV9HNsZU.js index 19749f3..f2b87d9 100644 --- a/dist/assets/LinearProgress-CwfnEpKL.js +++ b/dist/assets/LinearProgress-yV9HNsZU.js @@ -1,4 +1,4 @@ -import{x as j,y as q,b as M,z,E as D,_ as s,a2 as U,j as b,F as O,G as t,H as T,J as m,ae as h,ac as A,ad as E,af as C}from"./index-DpAn5wLF.js";function K(r){return j("MuiLinearProgress",r)}q("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const X=["className","color","value","valueBuffer","variant"];let l=r=>r,$,k,L,_,B,I;const v=4,F=C($||($=l` +import{x as j,y as q,b as M,z,E as D,_ as s,a2 as U,j as b,F as O,G as t,H as T,J as m,ae as h,ac as A,ad as E,af as C}from"./index-D7LVXeIK.js";function K(r){return j("MuiLinearProgress",r)}q("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const X=["className","color","value","valueBuffer","variant"];let l=r=>r,$,k,L,_,B,I;const v=4,F=C($||($=l` 0% { left: -35%; right: 100%; diff --git a/dist/assets/Link-Bme8npFv.js b/dist/assets/Link-BEif5YS2.js similarity index 97% rename from dist/assets/Link-Bme8npFv.js rename to dist/assets/Link-BEif5YS2.js index 1ad748c..a2d7fd0 100644 --- a/dist/assets/Link-Bme8npFv.js +++ b/dist/assets/Link-BEif5YS2.js @@ -1 +1 @@ -import{x,y as h,b as p,z as g,E as k,_ as a,j as v,F as R,H as F,J as L,P as z,aw as C,O as E,ax as H,L as W,G as V,T as O}from"./index-DpAn5wLF.js";function G(e){return x("MuiCard",e)}h("MuiCard",["root"]);const I=["className","raised"],J=e=>{const{classes:o}=e;return F({root:["root"]},G,o)},S=L(z,{name:"MuiCard",slot:"Root",overridesResolver:(e,o)=>o.root})(()=>({overflow:"hidden"})),so=p.forwardRef(function(o,s){const r=g({props:o,name:"MuiCard"}),{className:t,raised:n=!1}=r,c=k(r,I),i=a({},r,{raised:n}),u=J(i);return v.jsx(S,a({className:R(u.root,t),elevation:n?8:void 0,ref:s,ownerState:i},c))});function q(e){return x("MuiLink",e)}const K=h("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),D={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Q=e=>D[e]||e,X=({theme:e,ownerState:o})=>{const s=Q(o.color),r=C(e,`palette.${s}`,!1)||o.color,t=C(e,`palette.${s}Channel`);return"vars"in e&&t?`rgba(${t} / 0.4)`:E(r,.4)},Y=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],Z=e=>{const{classes:o,component:s,focusVisible:r,underline:t}=e,n={root:["root",`underline${V(t)}`,s==="button"&&"button",r&&"focusVisible"]};return F(n,q,o)},oo=L(O,{name:"MuiLink",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[o.root,o[`underline${V(s.underline)}`],s.component==="button"&&o.button]}})(({theme:e,ownerState:o})=>a({},o.underline==="none"&&{textDecoration:"none"},o.underline==="hover"&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},o.underline==="always"&&a({textDecoration:"underline"},o.color!=="inherit"&&{textDecorationColor:X({theme:e,ownerState:o})},{"&:hover":{textDecorationColor:"inherit"}}),o.component==="button"&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${K.focusVisible}`]:{outline:"auto"}})),ro=p.forwardRef(function(o,s){const r=g({props:o,name:"MuiLink"}),{className:t,color:n="primary",component:c="a",onBlur:i,onFocus:u,TypographyClasses:M,underline:$="always",variant:f="inherit",sx:d}=r,N=k(r,Y),{isFocusVisibleRef:m,onBlur:T,onFocus:j,ref:A}=H(),[B,y]=p.useState(!1),P=W(s,A),U=l=>{T(l),m.current===!1&&y(!1),i&&i(l)},_=l=>{j(l),m.current===!0&&y(!0),u&&u(l)},b=a({},r,{color:n,component:c,focusVisible:B,underline:$,variant:f}),w=Z(b);return v.jsx(oo,a({color:n,className:R(w.root,t),classes:M,component:c,onBlur:U,onFocus:_,ref:P,ownerState:b,variant:f,sx:[...Object.keys(D).includes(n)?[]:[{color:n}],...Array.isArray(d)?d:[d]]},N))});export{so as C,ro as L}; +import{x,y as h,b as p,z as g,E as k,_ as a,j as v,F as R,H as F,J as L,P as z,aw as C,O as E,ax as H,L as W,G as V,T as O}from"./index-D7LVXeIK.js";function G(e){return x("MuiCard",e)}h("MuiCard",["root"]);const I=["className","raised"],J=e=>{const{classes:o}=e;return F({root:["root"]},G,o)},S=L(z,{name:"MuiCard",slot:"Root",overridesResolver:(e,o)=>o.root})(()=>({overflow:"hidden"})),so=p.forwardRef(function(o,s){const r=g({props:o,name:"MuiCard"}),{className:t,raised:n=!1}=r,c=k(r,I),i=a({},r,{raised:n}),u=J(i);return v.jsx(S,a({className:R(u.root,t),elevation:n?8:void 0,ref:s,ownerState:i},c))});function q(e){return x("MuiLink",e)}const K=h("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),D={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},Q=e=>D[e]||e,X=({theme:e,ownerState:o})=>{const s=Q(o.color),r=C(e,`palette.${s}`,!1)||o.color,t=C(e,`palette.${s}Channel`);return"vars"in e&&t?`rgba(${t} / 0.4)`:E(r,.4)},Y=["className","color","component","onBlur","onFocus","TypographyClasses","underline","variant","sx"],Z=e=>{const{classes:o,component:s,focusVisible:r,underline:t}=e,n={root:["root",`underline${V(t)}`,s==="button"&&"button",r&&"focusVisible"]};return F(n,q,o)},oo=L(O,{name:"MuiLink",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:s}=e;return[o.root,o[`underline${V(s.underline)}`],s.component==="button"&&o.button]}})(({theme:e,ownerState:o})=>a({},o.underline==="none"&&{textDecoration:"none"},o.underline==="hover"&&{textDecoration:"none","&:hover":{textDecoration:"underline"}},o.underline==="always"&&a({textDecoration:"underline"},o.color!=="inherit"&&{textDecorationColor:X({theme:e,ownerState:o})},{"&:hover":{textDecorationColor:"inherit"}}),o.component==="button"&&{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${K.focusVisible}`]:{outline:"auto"}})),ro=p.forwardRef(function(o,s){const r=g({props:o,name:"MuiLink"}),{className:t,color:n="primary",component:c="a",onBlur:i,onFocus:u,TypographyClasses:M,underline:$="always",variant:f="inherit",sx:d}=r,N=k(r,Y),{isFocusVisibleRef:m,onBlur:T,onFocus:j,ref:A}=H(),[B,y]=p.useState(!1),P=W(s,A),U=l=>{T(l),m.current===!1&&y(!1),i&&i(l)},_=l=>{j(l),m.current===!0&&y(!0),u&&u(l)},b=a({},r,{color:n,component:c,focusVisible:B,underline:$,variant:f}),w=Z(b);return v.jsx(oo,a({color:n,className:R(w.root,t),classes:M,component:c,onBlur:U,onFocus:_,ref:P,ownerState:b,variant:f,sx:[...Object.keys(D).includes(n)?[]:[{color:n}],...Array.isArray(d)?d:[d]]},N))});export{so as C,ro as L}; diff --git a/dist/assets/LocalShippingOutlined-Ds2yAonP.js b/dist/assets/LocalShippingOutlined-C1uYlQnS.js similarity index 87% rename from dist/assets/LocalShippingOutlined-Ds2yAonP.js rename to dist/assets/LocalShippingOutlined-C1uYlQnS.js index 9109fff..dc3dc5a 100644 --- a/dist/assets/LocalShippingOutlined-Ds2yAonP.js +++ b/dist/assets/LocalShippingOutlined-C1uYlQnS.js @@ -1 +1 @@ -import{r,j as t,i as a}from"./index-DpAn5wLF.js";var e={},i=a;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,s=i(r()),o=t;u=e.default=(0,s.default)((0,o.jsx)("path",{d:"M20 8h-3V4H3c-1.1 0-2 .9-2 2v11h2c0 1.66 1.34 3 3 3s3-1.34 3-3h6c0 1.66 1.34 3 3 3s3-1.34 3-3h2v-5zm-.5 1.5 1.96 2.5H17V9.5zM6 18c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m2.22-3c-.55-.61-1.33-1-2.22-1s-1.67.39-2.22 1H3V6h12v9zM18 18c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1"}),"LocalShippingOutlined");export{u as d}; +import{r,j as t,i as a}from"./index-D7LVXeIK.js";var e={},i=a;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,s=i(r()),o=t;u=e.default=(0,s.default)((0,o.jsx)("path",{d:"M20 8h-3V4H3c-1.1 0-2 .9-2 2v11h2c0 1.66 1.34 3 3 3s3-1.34 3-3h6c0 1.66 1.34 3 3 3s3-1.34 3-3h2v-5zm-.5 1.5 1.96 2.5H17V9.5zM6 18c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m2.22-3c-.55-.61-1.33-1-2.22-1s-1.67.39-2.22 1H3V6h12v9zM18 18c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1"}),"LocalShippingOutlined");export{u as d}; diff --git a/dist/assets/Login-yAAi8q2k.js b/dist/assets/Login-_QJq_Cs6.js similarity index 90% rename from dist/assets/Login-yAAi8q2k.js rename to dist/assets/Login-_QJq_Cs6.js index 168aa7c..1920226 100644 --- a/dist/assets/Login-yAAi8q2k.js +++ b/dist/assets/Login-_QJq_Cs6.js @@ -1 +1 @@ -import{aq as f,b as a,j as e,B as t,ar as j,T as r,S as g,I as v,as as y}from"./index-DpAn5wLF.js";import{d as w,a as S}from"./VisibilityOff-DwiupP03.js";import{C as k,L as I}from"./Link-Bme8npFv.js";import{T as u}from"./TextField-C0dUZvW0.js";import{I as C}from"./InputAdornment-BWnl4jqW.js";import{F as W,C as z}from"./FormControlLabel-DwXmo7ko.js";import{B as A}from"./Button-BGNvVfej.js";import"./SwitchBase-1TkNOx4a.js";const D="/assets/mid-mile-approach-Drwn-ig9.jpg";function _(){const b=f(),[s,h]=a.useState(!1),[n,p]=a.useState(""),[i,m]=a.useState(""),[l,d]=a.useState(""),c=async()=>{try{d("");const o=await y(n,i);localStorage.setItem("logged_in","true"),localStorage.setItem("auth_token",o.token),localStorage.setItem("user",JSON.stringify(o.user)),b("/dashboard")}catch(o){d(o.message||"Invalid email or password")}},x=o=>{o.key==="Enter"&&c()};return e.jsxs(t,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundImage:`url(${D})`,backgroundSize:"cover",backgroundPosition:"center",position:"relative","&::before":{content:'""',position:"absolute",inset:0,background:"linear-gradient(180deg, rgba(15,23,42,0.6) 0%, rgba(192, 18, 39, 0.8) 100%)",zIndex:1}},children:[e.jsxs(k,{sx:{position:"relative",zIndex:2,width:"100%",maxWidth:440,p:{xs:4,sm:5},m:2,background:"rgba(255, 255, 255, 0.85)",backdropFilter:"blur(24px)",WebkitBackdropFilter:"blur(24px)",border:"1px solid rgba(255, 255, 255, 0.5)",boxShadow:"0 24px 48px rgba(0,0,0,0.2)",borderRadius:4},children:[e.jsx(t,{sx:{mb:4,display:"flex",justifyContent:"center"},children:e.jsx(j,{})}),e.jsx(r,{variant:"h3",sx:{fontWeight:800,textAlign:"center",letterSpacing:"-0.5px",color:"#1e293b"},children:"Welcome back"}),e.jsx(r,{variant:"body1",sx:{mt:1,mb:4,textAlign:"center",color:"#475569"},children:"Sign in to your Doormile operations account."}),e.jsxs(g,{spacing:2.5,children:[e.jsxs(t,{children:[e.jsx(r,{variant:"subtitle2",sx:{mb:.75,color:"#334155",fontWeight:600},children:"Email"}),e.jsx(u,{fullWidth:!0,placeholder:"Enter your email address",value:n,onChange:o=>p(o.target.value),onKeyDown:x,sx:{"& .MuiOutlinedInput-root":{bgcolor:"rgba(255,255,255,0.6)",borderRadius:2,transition:"all 0.2s ease","&:hover":{bgcolor:"rgba(255,255,255,0.9)"},"&.Mui-focused":{bgcolor:"#fff",boxShadow:"0 4px 12px rgba(0,0,0,0.05)"}}}})]}),e.jsxs(t,{children:[e.jsx(r,{variant:"subtitle2",sx:{mb:.75,color:"#334155",fontWeight:600},children:"Password"}),e.jsx(u,{fullWidth:!0,type:s?"text":"password",placeholder:"Enter your password",value:i,onChange:o=>m(o.target.value),onKeyDown:x,sx:{"& .MuiOutlinedInput-root":{bgcolor:"rgba(255,255,255,0.6)",borderRadius:2,transition:"all 0.2s ease","&:hover":{bgcolor:"rgba(255,255,255,0.9)"},"&.Mui-focused":{bgcolor:"#fff",boxShadow:"0 4px 12px rgba(0,0,0,0.05)"}}},InputProps:{endAdornment:e.jsx(C,{position:"end",children:e.jsx(v,{onClick:()=>h(o=>!o),edge:"end",size:"small",children:s?e.jsx(w,{fontSize:"small",sx:{color:"#94a3b8"}}):e.jsx(S,{fontSize:"small",sx:{color:"#94a3b8"}})})})}})]}),e.jsxs(g,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(W,{control:e.jsx(z,{defaultChecked:!0,size:"small",sx:{color:"#cbd5e1","&.Mui-checked":{color:"primary.main"}}}),label:e.jsx(r,{variant:"body2",sx:{color:"#475569",fontWeight:500},children:"Remember me"})}),e.jsx(I,{href:"#",underline:"hover",variant:"body2",color:"primary",sx:{fontWeight:600},children:"Forgot password?"})]}),l&&e.jsx(r,{variant:"body2",color:"error",textAlign:"center",sx:{fontWeight:600},children:l}),e.jsx(A,{fullWidth:!0,size:"large",variant:"contained",onClick:c,sx:{mt:2,py:1.5,borderRadius:2,fontSize:"1.05rem",fontWeight:700,textTransform:"none",boxShadow:"0 8px 16px rgba(192, 18, 39, 0.25)","&:hover":{boxShadow:"0 12px 20px rgba(192, 18, 39, 0.35)"},transition:"box-shadow 0.2s ease"},children:"Sign In"})]})]}),e.jsx(t,{sx:{position:"absolute",bottom:20,zIndex:2},children:e.jsxs(r,{variant:"caption",sx:{color:"rgba(255,255,255,0.8)",fontSize:"0.8rem"},children:["© ",new Date().getFullYear()," Doormile Technologies. All rights reserved."]})})]})}export{_ as default}; +import{aq as f,b as a,j as e,B as t,ar as j,T as r,S as g,I as v,as as y}from"./index-D7LVXeIK.js";import{d as w,a as S}from"./VisibilityOff-DxGE-YKE.js";import{C as k,L as I}from"./Link-BEif5YS2.js";import{T as u}from"./TextField-Sd_pshci.js";import{I as C}from"./InputAdornment-CMIlL2rx.js";import{F as W,C as z}from"./FormControlLabel-Bp5Li47e.js";import{B as A}from"./Button-Bqp5awT1.js";import"./SwitchBase-CWj2k0Bo.js";const D="/assets/mid-mile-approach-Drwn-ig9.jpg";function _(){const b=f(),[s,h]=a.useState(!1),[n,p]=a.useState(""),[i,m]=a.useState(""),[l,d]=a.useState(""),c=async()=>{try{d("");const o=await y(n,i);localStorage.setItem("logged_in","true"),localStorage.setItem("auth_token",o.token),localStorage.setItem("user",JSON.stringify(o.user)),b("/dashboard")}catch(o){d(o.message||"Invalid email or password")}},x=o=>{o.key==="Enter"&&c()};return e.jsxs(t,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",backgroundImage:`url(${D})`,backgroundSize:"cover",backgroundPosition:"center",position:"relative","&::before":{content:'""',position:"absolute",inset:0,background:"linear-gradient(180deg, rgba(15,23,42,0.6) 0%, rgba(192, 18, 39, 0.8) 100%)",zIndex:1}},children:[e.jsxs(k,{sx:{position:"relative",zIndex:2,width:"100%",maxWidth:440,p:{xs:4,sm:5},m:2,background:"rgba(255, 255, 255, 0.85)",backdropFilter:"blur(24px)",WebkitBackdropFilter:"blur(24px)",border:"1px solid rgba(255, 255, 255, 0.5)",boxShadow:"0 24px 48px rgba(0,0,0,0.2)",borderRadius:4},children:[e.jsx(t,{sx:{mb:4,display:"flex",justifyContent:"center"},children:e.jsx(j,{})}),e.jsx(r,{variant:"h3",sx:{fontWeight:800,textAlign:"center",letterSpacing:"-0.5px",color:"#1e293b"},children:"Welcome back"}),e.jsx(r,{variant:"body1",sx:{mt:1,mb:4,textAlign:"center",color:"#475569"},children:"Sign in to your Doormile operations account."}),e.jsxs(g,{spacing:2.5,children:[e.jsxs(t,{children:[e.jsx(r,{variant:"subtitle2",sx:{mb:.75,color:"#334155",fontWeight:600},children:"Email"}),e.jsx(u,{fullWidth:!0,placeholder:"Enter your email address",value:n,onChange:o=>p(o.target.value),onKeyDown:x,sx:{"& .MuiOutlinedInput-root":{bgcolor:"rgba(255,255,255,0.6)",borderRadius:2,transition:"all 0.2s ease","&:hover":{bgcolor:"rgba(255,255,255,0.9)"},"&.Mui-focused":{bgcolor:"#fff",boxShadow:"0 4px 12px rgba(0,0,0,0.05)"}}}})]}),e.jsxs(t,{children:[e.jsx(r,{variant:"subtitle2",sx:{mb:.75,color:"#334155",fontWeight:600},children:"Password"}),e.jsx(u,{fullWidth:!0,type:s?"text":"password",placeholder:"Enter your password",value:i,onChange:o=>m(o.target.value),onKeyDown:x,sx:{"& .MuiOutlinedInput-root":{bgcolor:"rgba(255,255,255,0.6)",borderRadius:2,transition:"all 0.2s ease","&:hover":{bgcolor:"rgba(255,255,255,0.9)"},"&.Mui-focused":{bgcolor:"#fff",boxShadow:"0 4px 12px rgba(0,0,0,0.05)"}}},InputProps:{endAdornment:e.jsx(C,{position:"end",children:e.jsx(v,{onClick:()=>h(o=>!o),edge:"end",size:"small",children:s?e.jsx(w,{fontSize:"small",sx:{color:"#94a3b8"}}):e.jsx(S,{fontSize:"small",sx:{color:"#94a3b8"}})})})}})]}),e.jsxs(g,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[e.jsx(W,{control:e.jsx(z,{defaultChecked:!0,size:"small",sx:{color:"#cbd5e1","&.Mui-checked":{color:"primary.main"}}}),label:e.jsx(r,{variant:"body2",sx:{color:"#475569",fontWeight:500},children:"Remember me"})}),e.jsx(I,{href:"#",underline:"hover",variant:"body2",color:"primary",sx:{fontWeight:600},children:"Forgot password?"})]}),l&&e.jsx(r,{variant:"body2",color:"error",textAlign:"center",sx:{fontWeight:600},children:l}),e.jsx(A,{fullWidth:!0,size:"large",variant:"contained",onClick:c,sx:{mt:2,py:1.5,borderRadius:2,fontSize:"1.05rem",fontWeight:700,textTransform:"none",boxShadow:"0 8px 16px rgba(192, 18, 39, 0.25)","&:hover":{boxShadow:"0 12px 20px rgba(192, 18, 39, 0.35)"},transition:"box-shadow 0.2s ease"},children:"Sign In"})]})]}),e.jsx(t,{sx:{position:"absolute",bottom:20,zIndex:2},children:e.jsxs(r,{variant:"caption",sx:{color:"rgba(255,255,255,0.8)",fontSize:"0.8rem"},children:["© ",new Date().getFullYear()," Doormile Technologies. All rights reserved."]})})]})}export{_ as default}; diff --git a/dist/assets/MapOutlined-QidbDh4A.js b/dist/assets/MapOutlined-CMNX914Q.js similarity index 86% rename from dist/assets/MapOutlined-QidbDh4A.js rename to dist/assets/MapOutlined-CMNX914Q.js index caf590b..d73529a 100644 --- a/dist/assets/MapOutlined-QidbDh4A.js +++ b/dist/assets/MapOutlined-CMNX914Q.js @@ -1 +1 @@ -import{r,j as t,i as a}from"./index-DpAn5wLF.js";var e={},l=a;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=l(r()),o=t;u=e.default=(0,i.default)((0,o.jsx)("path",{d:"m20.5 3-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5M10 5.47l4 1.4v11.66l-4-1.4zm-5 .99 3-1.01v11.7l-3 1.16zm14 11.08-3 1.01V6.86l3-1.16z"}),"MapOutlined");export{u as d}; +import{r,j as t,i as a}from"./index-D7LVXeIK.js";var e={},l=a;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,i=l(r()),o=t;u=e.default=(0,i.default)((0,o.jsx)("path",{d:"m20.5 3-.16.03L15 5.1 9 3 3.36 4.9c-.21.07-.36.25-.36.48V20.5c0 .28.22.5.5.5l.16-.03L9 18.9l6 2.1 5.64-1.9c.21-.07.36-.25.36-.48V3.5c0-.28-.22-.5-.5-.5M10 5.47l4 1.4v11.66l-4-1.4zm-5 .99 3-1.01v11.7l-3 1.16zm14 11.08-3 1.01V6.86l3-1.16z"}),"MapOutlined");export{u as d}; diff --git a/dist/assets/PageHeader-CEew5Fw4.js b/dist/assets/PageHeader-naLAT9xr.js similarity index 99% rename from dist/assets/PageHeader-CEew5Fw4.js rename to dist/assets/PageHeader-naLAT9xr.js index 167655e..2057ec3 100644 --- a/dist/assets/PageHeader-CEew5Fw4.js +++ b/dist/assets/PageHeader-naLAT9xr.js @@ -1 +1 @@ -import{x as _,y as G,a5 as w,j as n,b as x,z as K,E as D,_ as g,al as ro,I as mo,F as B,G as p,H as U,J as M,P as $o,ad as to,ac as lo,L as yo,Z as J,O as P,ai as no,a3 as ko,T as Q,u as Io,am as ho,an as F,ao as X,r as So,i as zo,S as Mo,B as so,ap as io}from"./index-DpAn5wLF.js";import{L as co}from"./Link-Bme8npFv.js";function Ro(o){return _("MuiAlert",o)}const po=G("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]),jo=w(n.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"}),"SuccessOutlined"),Po=w(n.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"}),"ReportProblemOutlined"),Bo=w(n.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}),"ErrorOutline"),No=w(n.jsx("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"}),"InfoOutlined"),Ao=w(n.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close"),Oo=["action","children","className","closeText","color","components","componentsProps","icon","iconMapping","onClose","role","severity","slotProps","slots","variant"],Lo=o=>{const{variant:e,color:t,severity:a,classes:r}=o,l={root:["root",`color${p(t||a)}`,`${e}${p(t||a)}`,`${e}`],icon:["icon"],message:["message"],action:["action"]};return U(l,Ro,r)},Wo=M($o,{name:"MuiAlert",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o;return[e.root,e[t.variant],e[`${t.variant}${p(t.color||t.severity)}`]]}})(({theme:o})=>{const e=o.palette.mode==="light"?to:lo,t=o.palette.mode==="light"?lo:to;return g({},o.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(o.palette).filter(([,a])=>a.main&&a.light).map(([a])=>({props:{colorSeverity:a,variant:"standard"},style:{color:o.vars?o.vars.palette.Alert[`${a}Color`]:e(o.palette[a].light,.6),backgroundColor:o.vars?o.vars.palette.Alert[`${a}StandardBg`]:t(o.palette[a].light,.9),[`& .${po.icon}`]:o.vars?{color:o.vars.palette.Alert[`${a}IconColor`]}:{color:o.palette[a].main}}})),...Object.entries(o.palette).filter(([,a])=>a.main&&a.light).map(([a])=>({props:{colorSeverity:a,variant:"outlined"},style:{color:o.vars?o.vars.palette.Alert[`${a}Color`]:e(o.palette[a].light,.6),border:`1px solid ${(o.vars||o).palette[a].light}`,[`& .${po.icon}`]:o.vars?{color:o.vars.palette.Alert[`${a}IconColor`]}:{color:o.palette[a].main}}})),...Object.entries(o.palette).filter(([,a])=>a.main&&a.dark).map(([a])=>({props:{colorSeverity:a,variant:"filled"},style:g({fontWeight:o.typography.fontWeightMedium},o.vars?{color:o.vars.palette.Alert[`${a}FilledColor`],backgroundColor:o.vars.palette.Alert[`${a}FilledBg`]}:{backgroundColor:o.palette.mode==="dark"?o.palette[a].dark:o.palette[a].main,color:o.palette.getContrastText(o.palette[a].main)})}))]})}),wo=M("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(o,e)=>e.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Eo=M("div",{name:"MuiAlert",slot:"Message",overridesResolver:(o,e)=>e.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),uo=M("div",{name:"MuiAlert",slot:"Action",overridesResolver:(o,e)=>e.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),go={success:n.jsx(jo,{fontSize:"inherit"}),warning:n.jsx(Po,{fontSize:"inherit"}),error:n.jsx(Bo,{fontSize:"inherit"}),info:n.jsx(No,{fontSize:"inherit"})},Ie=x.forwardRef(function(e,t){const a=K({props:e,name:"MuiAlert"}),{action:r,children:l,className:s,closeText:i="Close",color:d,components:f={},componentsProps:u={},icon:v,iconMapping:$=go,onClose:b,role:m="alert",severity:S="success",slotProps:N={},slots:I={},variant:j="standard"}=a,L=D(a,Oo),y=g({},a,{color:d,severity:S,variant:j,colorSeverity:d||S}),z=Lo(y),h={slots:g({closeButton:f.CloseButton,closeIcon:f.CloseIcon},I),slotProps:g({},u,N)},[C,R]=ro("closeButton",{elementType:mo,externalForwardedProps:h,ownerState:y}),[A,O]=ro("closeIcon",{elementType:Ao,externalForwardedProps:h,ownerState:y});return n.jsxs(Wo,g({role:m,elevation:0,ownerState:y,className:B(z.root,s),ref:t},L,{children:[v!==!1?n.jsx(wo,{ownerState:y,className:z.icon,children:v||$[S]||go[S]}):null,n.jsx(Eo,{ownerState:y,className:z.message,children:l}),r!=null?n.jsx(uo,{ownerState:y,className:z.action,children:r}):null,r==null&&b?n.jsx(uo,{ownerState:y,className:z.action,children:n.jsx(C,g({size:"small","aria-label":i,title:i,color:"inherit",onClick:b},R,{children:n.jsx(A,g({fontSize:"small"},O))}))}):null]}))}),To=w(n.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function Vo(o){return _("MuiChip",o)}const c=G("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),Do=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],_o=o=>{const{classes:e,disabled:t,size:a,color:r,iconColor:l,onDelete:s,clickable:i,variant:d}=o,f={root:["root",d,t&&"disabled",`size${p(a)}`,`color${p(r)}`,i&&"clickable",i&&`clickableColor${p(r)}`,s&&"deletable",s&&`deletableColor${p(r)}`,`${d}${p(r)}`],label:["label",`label${p(a)}`],avatar:["avatar",`avatar${p(a)}`,`avatarColor${p(r)}`],icon:["icon",`icon${p(a)}`,`iconColor${p(l)}`],deleteIcon:["deleteIcon",`deleteIcon${p(a)}`,`deleteIconColor${p(r)}`,`deleteIcon${p(d)}Color${p(r)}`]};return U(f,Vo,e)},Go=M("div",{name:"MuiChip",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o,{color:a,iconColor:r,clickable:l,onDelete:s,size:i,variant:d}=t;return[{[`& .${c.avatar}`]:e.avatar},{[`& .${c.avatar}`]:e[`avatar${p(i)}`]},{[`& .${c.avatar}`]:e[`avatarColor${p(a)}`]},{[`& .${c.icon}`]:e.icon},{[`& .${c.icon}`]:e[`icon${p(i)}`]},{[`& .${c.icon}`]:e[`iconColor${p(r)}`]},{[`& .${c.deleteIcon}`]:e.deleteIcon},{[`& .${c.deleteIcon}`]:e[`deleteIcon${p(i)}`]},{[`& .${c.deleteIcon}`]:e[`deleteIconColor${p(a)}`]},{[`& .${c.deleteIcon}`]:e[`deleteIcon${p(d)}Color${p(a)}`]},e.root,e[`size${p(i)}`],e[`color${p(a)}`],l&&e.clickable,l&&a!=="default"&&e[`clickableColor${p(a)})`],s&&e.deletable,s&&a!=="default"&&e[`deletableColor${p(a)}`],e[d],e[`${d}${p(a)}`]]}})(({theme:o,ownerState:e})=>{const t=o.palette.mode==="light"?o.palette.grey[700]:o.palette.grey[300];return g({maxWidth:"100%",fontFamily:o.typography.fontFamily,fontSize:o.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(o.vars||o).palette.text.primary,backgroundColor:(o.vars||o).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:o.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${c.disabled}`]:{opacity:(o.vars||o).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${c.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:o.vars?o.vars.palette.Chip.defaultAvatarColor:t,fontSize:o.typography.pxToRem(12)},[`& .${c.avatarColorPrimary}`]:{color:(o.vars||o).palette.primary.contrastText,backgroundColor:(o.vars||o).palette.primary.dark},[`& .${c.avatarColorSecondary}`]:{color:(o.vars||o).palette.secondary.contrastText,backgroundColor:(o.vars||o).palette.secondary.dark},[`& .${c.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:o.typography.pxToRem(10)},[`& .${c.icon}`]:g({marginLeft:5,marginRight:-6},e.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},e.iconColor===e.color&&g({color:o.vars?o.vars.palette.Chip.defaultIconColor:t},e.color!=="default"&&{color:"inherit"})),[`& .${c.deleteIcon}`]:g({WebkitTapHighlightColor:"transparent",color:o.vars?`rgba(${o.vars.palette.text.primaryChannel} / 0.26)`:P(o.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:o.vars?`rgba(${o.vars.palette.text.primaryChannel} / 0.4)`:P(o.palette.text.primary,.4)}},e.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},e.color!=="default"&&{color:o.vars?`rgba(${o.vars.palette[e.color].contrastTextChannel} / 0.7)`:P(o.palette[e.color].contrastText,.7),"&:hover, &:active":{color:(o.vars||o).palette[e.color].contrastText}})},e.size==="small"&&{height:24},e.color!=="default"&&{backgroundColor:(o.vars||o).palette[e.color].main,color:(o.vars||o).palette[e.color].contrastText},e.onDelete&&{[`&.${c.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.focusOpacity}))`:P(o.palette.action.selected,o.palette.action.selectedOpacity+o.palette.action.focusOpacity)}},e.onDelete&&e.color!=="default"&&{[`&.${c.focusVisible}`]:{backgroundColor:(o.vars||o).palette[e.color].dark}})},({theme:o,ownerState:e})=>g({},e.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:o.vars?`rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.hoverOpacity}))`:P(o.palette.action.selected,o.palette.action.selectedOpacity+o.palette.action.hoverOpacity)},[`&.${c.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.focusOpacity}))`:P(o.palette.action.selected,o.palette.action.selectedOpacity+o.palette.action.focusOpacity)},"&:active":{boxShadow:(o.vars||o).shadows[1]}},e.clickable&&e.color!=="default"&&{[`&:hover, &.${c.focusVisible}`]:{backgroundColor:(o.vars||o).palette[e.color].dark}}),({theme:o,ownerState:e})=>g({},e.variant==="outlined"&&{backgroundColor:"transparent",border:o.vars?`1px solid ${o.vars.palette.Chip.defaultBorder}`:`1px solid ${o.palette.mode==="light"?o.palette.grey[400]:o.palette.grey[700]}`,[`&.${c.clickable}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${c.focusVisible}`]:{backgroundColor:(o.vars||o).palette.action.focus},[`& .${c.avatar}`]:{marginLeft:4},[`& .${c.avatarSmall}`]:{marginLeft:2},[`& .${c.icon}`]:{marginLeft:4},[`& .${c.iconSmall}`]:{marginLeft:2},[`& .${c.deleteIcon}`]:{marginRight:5},[`& .${c.deleteIconSmall}`]:{marginRight:3}},e.variant==="outlined"&&e.color!=="default"&&{color:(o.vars||o).palette[e.color].main,border:`1px solid ${o.vars?`rgba(${o.vars.palette[e.color].mainChannel} / 0.7)`:P(o.palette[e.color].main,.7)}`,[`&.${c.clickable}:hover`]:{backgroundColor:o.vars?`rgba(${o.vars.palette[e.color].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:P(o.palette[e.color].main,o.palette.action.hoverOpacity)},[`&.${c.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette[e.color].mainChannel} / ${o.vars.palette.action.focusOpacity})`:P(o.palette[e.color].main,o.palette.action.focusOpacity)},[`& .${c.deleteIcon}`]:{color:o.vars?`rgba(${o.vars.palette[e.color].mainChannel} / 0.7)`:P(o.palette[e.color].main,.7),"&:hover, &:active":{color:(o.vars||o).palette[e.color].main}}})),Ko=M("span",{name:"MuiChip",slot:"Label",overridesResolver:(o,e)=>{const{ownerState:t}=o,{size:a}=t;return[e.label,e[`label${p(a)}`]]}})(({ownerState:o})=>g({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},o.variant==="outlined"&&{paddingLeft:11,paddingRight:11},o.size==="small"&&{paddingLeft:8,paddingRight:8},o.size==="small"&&o.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function fo(o){return o.key==="Backspace"||o.key==="Delete"}const he=x.forwardRef(function(e,t){const a=K({props:e,name:"MuiChip"}),{avatar:r,className:l,clickable:s,color:i="default",component:d,deleteIcon:f,disabled:u=!1,icon:v,label:$,onClick:b,onDelete:m,onKeyDown:S,onKeyUp:N,size:I="medium",variant:j="filled",tabIndex:L,skipFocusWhenDisabled:y=!1}=a,z=D(a,Do),h=x.useRef(null),C=yo(h,t),R=k=>{k.stopPropagation(),m&&m(k)},A=k=>{k.currentTarget===k.target&&fo(k)&&k.preventDefault(),S&&S(k)},O=k=>{k.currentTarget===k.target&&(m&&fo(k)?m(k):k.key==="Escape"&&h.current&&h.current.blur()),N&&N(k)},H=s!==!1&&b?!0:s,Z=H||m?J:d||"div",q=g({},a,{component:Z,disabled:u,size:I,color:i,iconColor:x.isValidElement(v)&&v.props.color||i,onDelete:!!m,clickable:H,variant:j}),W=_o(q),bo=Z===J?g({component:d||"div",focusVisibleClassName:W.focusVisible},m&&{disableRipple:!0}):{};let oo=null;m&&(oo=f&&x.isValidElement(f)?x.cloneElement(f,{className:B(f.props.className,W.deleteIcon),onClick:R}):n.jsx(To,{className:B(W.deleteIcon),onClick:R}));let eo=null;r&&x.isValidElement(r)&&(eo=x.cloneElement(r,{className:B(W.avatar,r.props.className)}));let ao=null;return v&&x.isValidElement(v)&&(ao=x.cloneElement(v,{className:B(W.icon,v.props.className)})),n.jsxs(Go,g({as:Z,className:B(W.root,l),disabled:H&&u?!0:void 0,onClick:b,onKeyDown:A,onKeyUp:O,ref:C,tabIndex:y&&u?-1:L,ownerState:q},bo,z,{children:[eo||ao,n.jsx(Ko,{className:B(W.label),ownerState:q,children:$}),oo]}))}),Uo=w(n.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),Fo=["slots","slotProps"],Ho=M(J,{name:"MuiBreadcrumbCollapsed"})(({theme:o})=>g({display:"flex",marginLeft:`calc(${o.spacing(1)} * 0.5)`,marginRight:`calc(${o.spacing(1)} * 0.5)`},o.palette.mode==="light"?{backgroundColor:o.palette.grey[100],color:o.palette.grey[700]}:{backgroundColor:o.palette.grey[700],color:o.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":g({},o.palette.mode==="light"?{backgroundColor:o.palette.grey[200]}:{backgroundColor:o.palette.grey[600]}),"&:active":g({boxShadow:o.shadows[0]},o.palette.mode==="light"?{backgroundColor:no(o.palette.grey[200],.12)}:{backgroundColor:no(o.palette.grey[600],.12)})})),Zo=M(Uo)({width:24,height:16});function qo(o){const{slots:e={},slotProps:t={}}=o,a=D(o,Fo),r=o;return n.jsx("li",{children:n.jsx(Ho,g({focusRipple:!0},a,{ownerState:r,children:n.jsx(Zo,g({as:e.CollapsedIcon,ownerState:r},t.collapsedIcon))}))})}function Jo(o){return _("MuiBreadcrumbs",o)}const Qo=G("MuiBreadcrumbs",["root","ol","li","separator"]),Xo=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],Yo=o=>{const{classes:e}=o;return U({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},Jo,e)},oe=M(Q,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(o,e)=>[{[`& .${Qo.li}`]:e.li},e.root]})({}),ee=M("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(o,e)=>e.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),ae=M("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(o,e)=>e.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function re(o,e,t,a){return o.reduce((r,l,s)=>(s{const R=()=>{N(!0);const A=y.current.querySelector("a[href],button,[tabindex]");A&&A.focus()};return v+u>=C.length?C:[...C.slice(0,v),n.jsx(qo,{"aria-label":f,slots:{CollapsedIcon:i.CollapsedIcon},slotProps:{collapsedIcon:L},onClick:R},"ellipsis"),...C.slice(C.length-u,C.length)]},h=x.Children.toArray(r).filter(C=>x.isValidElement(C)).map((C,R)=>n.jsx("li",{className:j.li,children:C},`child-${R}`));return n.jsx(oe,g({ref:t,component:s,color:"text.secondary",className:B(j.root,l),ownerState:I},m,{children:n.jsx(ee,{className:j.ol,ref:y,ownerState:I,children:re(S||$&&h.length<=$?h:z(h),j.separator,b,I)})}))}),vo=x.createContext();function le(o){return _("MuiGrid",o)}const ne=[0,1,2,3,4,5,6,7,8,9,10],se=["column-reverse","column","row-reverse","row"],ie=["nowrap","wrap-reverse","wrap"],T=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],V=G("MuiGrid",["root","container","item","zeroMinWidth",...ne.map(o=>`spacing-xs-${o}`),...se.map(o=>`direction-xs-${o}`),...ie.map(o=>`wrap-xs-${o}`),...T.map(o=>`grid-xs-${o}`),...T.map(o=>`grid-sm-${o}`),...T.map(o=>`grid-md-${o}`),...T.map(o=>`grid-lg-${o}`),...T.map(o=>`grid-xl-${o}`)]),ce=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function E(o){const e=parseFloat(o);return`${e}${String(o).replace(String(e),"")||"px"}`}function pe({theme:o,ownerState:e}){let t;return o.breakpoints.keys.reduce((a,r)=>{let l={};if(e[r]&&(t=e[r]),!t)return a;if(t===!0)l={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(t==="auto")l={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=F({values:e.columns,breakpoints:o.breakpoints.values}),i=typeof s=="object"?s[r]:s;if(i==null)return a;const d=`${Math.round(t/i*1e8)/1e6}%`;let f={};if(e.container&&e.item&&e.columnSpacing!==0){const u=o.spacing(e.columnSpacing);if(u!=="0px"){const v=`calc(${d} + ${E(u)})`;f={flexBasis:v,maxWidth:v}}}l=g({flexBasis:d,flexGrow:0,maxWidth:d},f)}return o.breakpoints.values[r]===0?Object.assign(a,l):a[o.breakpoints.up(r)]=l,a},{})}function de({theme:o,ownerState:e}){const t=F({values:e.direction,breakpoints:o.breakpoints.values});return X({theme:o},t,a=>{const r={flexDirection:a};return a.indexOf("column")===0&&(r[`& > .${V.item}`]={maxWidth:"none"}),r})}function xo({breakpoints:o,values:e}){let t="";Object.keys(e).forEach(r=>{t===""&&e[r]!==0&&(t=r)});const a=Object.keys(o).sort((r,l)=>o[r]-o[l]);return a.slice(0,a.indexOf(t))}function ue({theme:o,ownerState:e}){const{container:t,rowSpacing:a}=e;let r={};if(t&&a!==0){const l=F({values:a,breakpoints:o.breakpoints.values});let s;typeof l=="object"&&(s=xo({breakpoints:o.breakpoints.values,values:l})),r=X({theme:o},l,(i,d)=>{var f;const u=o.spacing(i);return u!=="0px"?{marginTop:`-${E(u)}`,[`& > .${V.item}`]:{paddingTop:E(u)}}:(f=s)!=null&&f.includes(d)?{}:{marginTop:0,[`& > .${V.item}`]:{paddingTop:0}}})}return r}function ge({theme:o,ownerState:e}){const{container:t,columnSpacing:a}=e;let r={};if(t&&a!==0){const l=F({values:a,breakpoints:o.breakpoints.values});let s;typeof l=="object"&&(s=xo({breakpoints:o.breakpoints.values,values:l})),r=X({theme:o},l,(i,d)=>{var f;const u=o.spacing(i);return u!=="0px"?{width:`calc(100% + ${E(u)})`,marginLeft:`-${E(u)}`,[`& > .${V.item}`]:{paddingLeft:E(u)}}:(f=s)!=null&&f.includes(d)?{}:{width:"100%",marginLeft:0,[`& > .${V.item}`]:{paddingLeft:0}}})}return r}function fe(o,e,t={}){if(!o||o<=0)return[];if(typeof o=="string"&&!Number.isNaN(Number(o))||typeof o=="number")return[t[`spacing-xs-${String(o)}`]];const a=[];return e.forEach(r=>{const l=o[r];Number(l)>0&&a.push(t[`spacing-${r}-${String(l)}`])}),a}const ve=M("div",{name:"MuiGrid",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o,{container:a,direction:r,item:l,spacing:s,wrap:i,zeroMinWidth:d,breakpoints:f}=t;let u=[];a&&(u=fe(s,f,e));const v=[];return f.forEach($=>{const b=t[$];b&&v.push(e[`grid-${$}-${String(b)}`])}),[e.root,a&&e.container,l&&e.item,d&&e.zeroMinWidth,...u,r!=="row"&&e[`direction-xs-${String(r)}`],i!=="wrap"&&e[`wrap-xs-${String(i)}`],...v]}})(({ownerState:o})=>g({boxSizing:"border-box"},o.container&&{display:"flex",flexWrap:"wrap",width:"100%"},o.item&&{margin:0},o.zeroMinWidth&&{minWidth:0},o.wrap!=="wrap"&&{flexWrap:o.wrap}),de,ue,ge,pe);function xe(o,e){if(!o||o<=0)return[];if(typeof o=="string"&&!Number.isNaN(Number(o))||typeof o=="number")return[`spacing-xs-${String(o)}`];const t=[];return e.forEach(a=>{const r=o[a];if(Number(r)>0){const l=`spacing-${a}-${String(r)}`;t.push(l)}}),t}const Ce=o=>{const{classes:e,container:t,direction:a,item:r,spacing:l,wrap:s,zeroMinWidth:i,breakpoints:d}=o;let f=[];t&&(f=xe(l,d));const u=[];d.forEach($=>{const b=o[$];b&&u.push(`grid-${$}-${String(b)}`)});const v={root:["root",t&&"container",r&&"item",i&&"zeroMinWidth",...f,a!=="row"&&`direction-xs-${String(a)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...u]};return U(v,le,e)},Se=x.forwardRef(function(e,t){const a=K({props:e,name:"MuiGrid"}),{breakpoints:r}=Io(),l=ho(a),{className:s,columns:i,columnSpacing:d,component:f="div",container:u=!1,direction:v="row",item:$=!1,rowSpacing:b,spacing:m=0,wrap:S="wrap",zeroMinWidth:N=!1}=l,I=D(l,ce),j=b||m,L=d||m,y=x.useContext(vo),z=u?i||12:y,h={},C=g({},I);r.keys.forEach(O=>{I[O]!=null&&(h[O]=I[O],delete C[O])});const R=g({},l,{columns:z,container:u,direction:v,item:$,rowSpacing:j,columnSpacing:L,wrap:S,zeroMinWidth:N,spacing:m},h,{breakpoints:r.keys}),A=Ce(R);return n.jsx(vo.Provider,{value:z,children:n.jsx(ve,g({ownerState:R,className:B(A.root,s),as:f,ref:t},C))})});var Y={},be=zo;Object.defineProperty(Y,"__esModule",{value:!0});var Co=Y.default=void 0,me=be(So()),$e=n;Co=Y.default=(0,me.default)((0,$e.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext");function ze({title:o,breadcrumbs:e=[],action:t}){return n.jsxs(Mo,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:1.5,sx:{mb:3},children:[n.jsxs(so,{children:[n.jsx(Q,{variant:"h3",sx:{fontWeight:700,color:"grey.800"},children:o}),e.length>0&&n.jsxs(te,{separator:n.jsx(Co,{fontSize:"small"}),sx:{mt:.5},children:[n.jsx(co,{component:io,to:"/dashboard",underline:"hover",color:"text.secondary",variant:"caption",children:"Home"}),e.map((a,r)=>a.to&&r{const{variant:e,color:t,severity:a,classes:r}=o,l={root:["root",`color${p(t||a)}`,`${e}${p(t||a)}`,`${e}`],icon:["icon"],message:["message"],action:["action"]};return U(l,Ro,r)},Wo=M($o,{name:"MuiAlert",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o;return[e.root,e[t.variant],e[`${t.variant}${p(t.color||t.severity)}`]]}})(({theme:o})=>{const e=o.palette.mode==="light"?to:lo,t=o.palette.mode==="light"?lo:to;return g({},o.typography.body2,{backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(o.palette).filter(([,a])=>a.main&&a.light).map(([a])=>({props:{colorSeverity:a,variant:"standard"},style:{color:o.vars?o.vars.palette.Alert[`${a}Color`]:e(o.palette[a].light,.6),backgroundColor:o.vars?o.vars.palette.Alert[`${a}StandardBg`]:t(o.palette[a].light,.9),[`& .${po.icon}`]:o.vars?{color:o.vars.palette.Alert[`${a}IconColor`]}:{color:o.palette[a].main}}})),...Object.entries(o.palette).filter(([,a])=>a.main&&a.light).map(([a])=>({props:{colorSeverity:a,variant:"outlined"},style:{color:o.vars?o.vars.palette.Alert[`${a}Color`]:e(o.palette[a].light,.6),border:`1px solid ${(o.vars||o).palette[a].light}`,[`& .${po.icon}`]:o.vars?{color:o.vars.palette.Alert[`${a}IconColor`]}:{color:o.palette[a].main}}})),...Object.entries(o.palette).filter(([,a])=>a.main&&a.dark).map(([a])=>({props:{colorSeverity:a,variant:"filled"},style:g({fontWeight:o.typography.fontWeightMedium},o.vars?{color:o.vars.palette.Alert[`${a}FilledColor`],backgroundColor:o.vars.palette.Alert[`${a}FilledBg`]}:{backgroundColor:o.palette.mode==="dark"?o.palette[a].dark:o.palette[a].main,color:o.palette.getContrastText(o.palette[a].main)})}))]})}),wo=M("div",{name:"MuiAlert",slot:"Icon",overridesResolver:(o,e)=>e.icon})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),Eo=M("div",{name:"MuiAlert",slot:"Message",overridesResolver:(o,e)=>e.message})({padding:"8px 0",minWidth:0,overflow:"auto"}),uo=M("div",{name:"MuiAlert",slot:"Action",overridesResolver:(o,e)=>e.action})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),go={success:n.jsx(jo,{fontSize:"inherit"}),warning:n.jsx(Po,{fontSize:"inherit"}),error:n.jsx(Bo,{fontSize:"inherit"}),info:n.jsx(No,{fontSize:"inherit"})},Ie=x.forwardRef(function(e,t){const a=K({props:e,name:"MuiAlert"}),{action:r,children:l,className:s,closeText:i="Close",color:d,components:f={},componentsProps:u={},icon:v,iconMapping:$=go,onClose:b,role:m="alert",severity:S="success",slotProps:N={},slots:I={},variant:j="standard"}=a,L=D(a,Oo),y=g({},a,{color:d,severity:S,variant:j,colorSeverity:d||S}),z=Lo(y),h={slots:g({closeButton:f.CloseButton,closeIcon:f.CloseIcon},I),slotProps:g({},u,N)},[C,R]=ro("closeButton",{elementType:mo,externalForwardedProps:h,ownerState:y}),[A,O]=ro("closeIcon",{elementType:Ao,externalForwardedProps:h,ownerState:y});return n.jsxs(Wo,g({role:m,elevation:0,ownerState:y,className:B(z.root,s),ref:t},L,{children:[v!==!1?n.jsx(wo,{ownerState:y,className:z.icon,children:v||$[S]||go[S]}):null,n.jsx(Eo,{ownerState:y,className:z.message,children:l}),r!=null?n.jsx(uo,{ownerState:y,className:z.action,children:r}):null,r==null&&b?n.jsx(uo,{ownerState:y,className:z.action,children:n.jsx(C,g({size:"small","aria-label":i,title:i,color:"inherit",onClick:b},R,{children:n.jsx(A,g({fontSize:"small"},O))}))}):null]}))}),To=w(n.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function Vo(o){return _("MuiChip",o)}const c=G("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),Do=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],_o=o=>{const{classes:e,disabled:t,size:a,color:r,iconColor:l,onDelete:s,clickable:i,variant:d}=o,f={root:["root",d,t&&"disabled",`size${p(a)}`,`color${p(r)}`,i&&"clickable",i&&`clickableColor${p(r)}`,s&&"deletable",s&&`deletableColor${p(r)}`,`${d}${p(r)}`],label:["label",`label${p(a)}`],avatar:["avatar",`avatar${p(a)}`,`avatarColor${p(r)}`],icon:["icon",`icon${p(a)}`,`iconColor${p(l)}`],deleteIcon:["deleteIcon",`deleteIcon${p(a)}`,`deleteIconColor${p(r)}`,`deleteIcon${p(d)}Color${p(r)}`]};return U(f,Vo,e)},Go=M("div",{name:"MuiChip",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o,{color:a,iconColor:r,clickable:l,onDelete:s,size:i,variant:d}=t;return[{[`& .${c.avatar}`]:e.avatar},{[`& .${c.avatar}`]:e[`avatar${p(i)}`]},{[`& .${c.avatar}`]:e[`avatarColor${p(a)}`]},{[`& .${c.icon}`]:e.icon},{[`& .${c.icon}`]:e[`icon${p(i)}`]},{[`& .${c.icon}`]:e[`iconColor${p(r)}`]},{[`& .${c.deleteIcon}`]:e.deleteIcon},{[`& .${c.deleteIcon}`]:e[`deleteIcon${p(i)}`]},{[`& .${c.deleteIcon}`]:e[`deleteIconColor${p(a)}`]},{[`& .${c.deleteIcon}`]:e[`deleteIcon${p(d)}Color${p(a)}`]},e.root,e[`size${p(i)}`],e[`color${p(a)}`],l&&e.clickable,l&&a!=="default"&&e[`clickableColor${p(a)})`],s&&e.deletable,s&&a!=="default"&&e[`deletableColor${p(a)}`],e[d],e[`${d}${p(a)}`]]}})(({theme:o,ownerState:e})=>{const t=o.palette.mode==="light"?o.palette.grey[700]:o.palette.grey[300];return g({maxWidth:"100%",fontFamily:o.typography.fontFamily,fontSize:o.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(o.vars||o).palette.text.primary,backgroundColor:(o.vars||o).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:o.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${c.disabled}`]:{opacity:(o.vars||o).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${c.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:o.vars?o.vars.palette.Chip.defaultAvatarColor:t,fontSize:o.typography.pxToRem(12)},[`& .${c.avatarColorPrimary}`]:{color:(o.vars||o).palette.primary.contrastText,backgroundColor:(o.vars||o).palette.primary.dark},[`& .${c.avatarColorSecondary}`]:{color:(o.vars||o).palette.secondary.contrastText,backgroundColor:(o.vars||o).palette.secondary.dark},[`& .${c.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:o.typography.pxToRem(10)},[`& .${c.icon}`]:g({marginLeft:5,marginRight:-6},e.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},e.iconColor===e.color&&g({color:o.vars?o.vars.palette.Chip.defaultIconColor:t},e.color!=="default"&&{color:"inherit"})),[`& .${c.deleteIcon}`]:g({WebkitTapHighlightColor:"transparent",color:o.vars?`rgba(${o.vars.palette.text.primaryChannel} / 0.26)`:P(o.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:o.vars?`rgba(${o.vars.palette.text.primaryChannel} / 0.4)`:P(o.palette.text.primary,.4)}},e.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},e.color!=="default"&&{color:o.vars?`rgba(${o.vars.palette[e.color].contrastTextChannel} / 0.7)`:P(o.palette[e.color].contrastText,.7),"&:hover, &:active":{color:(o.vars||o).palette[e.color].contrastText}})},e.size==="small"&&{height:24},e.color!=="default"&&{backgroundColor:(o.vars||o).palette[e.color].main,color:(o.vars||o).palette[e.color].contrastText},e.onDelete&&{[`&.${c.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.focusOpacity}))`:P(o.palette.action.selected,o.palette.action.selectedOpacity+o.palette.action.focusOpacity)}},e.onDelete&&e.color!=="default"&&{[`&.${c.focusVisible}`]:{backgroundColor:(o.vars||o).palette[e.color].dark}})},({theme:o,ownerState:e})=>g({},e.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:o.vars?`rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.hoverOpacity}))`:P(o.palette.action.selected,o.palette.action.selectedOpacity+o.palette.action.hoverOpacity)},[`&.${c.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.action.selectedChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.focusOpacity}))`:P(o.palette.action.selected,o.palette.action.selectedOpacity+o.palette.action.focusOpacity)},"&:active":{boxShadow:(o.vars||o).shadows[1]}},e.clickable&&e.color!=="default"&&{[`&:hover, &.${c.focusVisible}`]:{backgroundColor:(o.vars||o).palette[e.color].dark}}),({theme:o,ownerState:e})=>g({},e.variant==="outlined"&&{backgroundColor:"transparent",border:o.vars?`1px solid ${o.vars.palette.Chip.defaultBorder}`:`1px solid ${o.palette.mode==="light"?o.palette.grey[400]:o.palette.grey[700]}`,[`&.${c.clickable}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${c.focusVisible}`]:{backgroundColor:(o.vars||o).palette.action.focus},[`& .${c.avatar}`]:{marginLeft:4},[`& .${c.avatarSmall}`]:{marginLeft:2},[`& .${c.icon}`]:{marginLeft:4},[`& .${c.iconSmall}`]:{marginLeft:2},[`& .${c.deleteIcon}`]:{marginRight:5},[`& .${c.deleteIconSmall}`]:{marginRight:3}},e.variant==="outlined"&&e.color!=="default"&&{color:(o.vars||o).palette[e.color].main,border:`1px solid ${o.vars?`rgba(${o.vars.palette[e.color].mainChannel} / 0.7)`:P(o.palette[e.color].main,.7)}`,[`&.${c.clickable}:hover`]:{backgroundColor:o.vars?`rgba(${o.vars.palette[e.color].mainChannel} / ${o.vars.palette.action.hoverOpacity})`:P(o.palette[e.color].main,o.palette.action.hoverOpacity)},[`&.${c.focusVisible}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette[e.color].mainChannel} / ${o.vars.palette.action.focusOpacity})`:P(o.palette[e.color].main,o.palette.action.focusOpacity)},[`& .${c.deleteIcon}`]:{color:o.vars?`rgba(${o.vars.palette[e.color].mainChannel} / 0.7)`:P(o.palette[e.color].main,.7),"&:hover, &:active":{color:(o.vars||o).palette[e.color].main}}})),Ko=M("span",{name:"MuiChip",slot:"Label",overridesResolver:(o,e)=>{const{ownerState:t}=o,{size:a}=t;return[e.label,e[`label${p(a)}`]]}})(({ownerState:o})=>g({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},o.variant==="outlined"&&{paddingLeft:11,paddingRight:11},o.size==="small"&&{paddingLeft:8,paddingRight:8},o.size==="small"&&o.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function fo(o){return o.key==="Backspace"||o.key==="Delete"}const he=x.forwardRef(function(e,t){const a=K({props:e,name:"MuiChip"}),{avatar:r,className:l,clickable:s,color:i="default",component:d,deleteIcon:f,disabled:u=!1,icon:v,label:$,onClick:b,onDelete:m,onKeyDown:S,onKeyUp:N,size:I="medium",variant:j="filled",tabIndex:L,skipFocusWhenDisabled:y=!1}=a,z=D(a,Do),h=x.useRef(null),C=yo(h,t),R=k=>{k.stopPropagation(),m&&m(k)},A=k=>{k.currentTarget===k.target&&fo(k)&&k.preventDefault(),S&&S(k)},O=k=>{k.currentTarget===k.target&&(m&&fo(k)?m(k):k.key==="Escape"&&h.current&&h.current.blur()),N&&N(k)},H=s!==!1&&b?!0:s,Z=H||m?J:d||"div",q=g({},a,{component:Z,disabled:u,size:I,color:i,iconColor:x.isValidElement(v)&&v.props.color||i,onDelete:!!m,clickable:H,variant:j}),W=_o(q),bo=Z===J?g({component:d||"div",focusVisibleClassName:W.focusVisible},m&&{disableRipple:!0}):{};let oo=null;m&&(oo=f&&x.isValidElement(f)?x.cloneElement(f,{className:B(f.props.className,W.deleteIcon),onClick:R}):n.jsx(To,{className:B(W.deleteIcon),onClick:R}));let eo=null;r&&x.isValidElement(r)&&(eo=x.cloneElement(r,{className:B(W.avatar,r.props.className)}));let ao=null;return v&&x.isValidElement(v)&&(ao=x.cloneElement(v,{className:B(W.icon,v.props.className)})),n.jsxs(Go,g({as:Z,className:B(W.root,l),disabled:H&&u?!0:void 0,onClick:b,onKeyDown:A,onKeyUp:O,ref:C,tabIndex:y&&u?-1:L,ownerState:q},bo,z,{children:[eo||ao,n.jsx(Ko,{className:B(W.label),ownerState:q,children:$}),oo]}))}),Uo=w(n.jsx("path",{d:"M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreHoriz"),Fo=["slots","slotProps"],Ho=M(J,{name:"MuiBreadcrumbCollapsed"})(({theme:o})=>g({display:"flex",marginLeft:`calc(${o.spacing(1)} * 0.5)`,marginRight:`calc(${o.spacing(1)} * 0.5)`},o.palette.mode==="light"?{backgroundColor:o.palette.grey[100],color:o.palette.grey[700]}:{backgroundColor:o.palette.grey[700],color:o.palette.grey[100]},{borderRadius:2,"&:hover, &:focus":g({},o.palette.mode==="light"?{backgroundColor:o.palette.grey[200]}:{backgroundColor:o.palette.grey[600]}),"&:active":g({boxShadow:o.shadows[0]},o.palette.mode==="light"?{backgroundColor:no(o.palette.grey[200],.12)}:{backgroundColor:no(o.palette.grey[600],.12)})})),Zo=M(Uo)({width:24,height:16});function qo(o){const{slots:e={},slotProps:t={}}=o,a=D(o,Fo),r=o;return n.jsx("li",{children:n.jsx(Ho,g({focusRipple:!0},a,{ownerState:r,children:n.jsx(Zo,g({as:e.CollapsedIcon,ownerState:r},t.collapsedIcon))}))})}function Jo(o){return _("MuiBreadcrumbs",o)}const Qo=G("MuiBreadcrumbs",["root","ol","li","separator"]),Xo=["children","className","component","slots","slotProps","expandText","itemsAfterCollapse","itemsBeforeCollapse","maxItems","separator"],Yo=o=>{const{classes:e}=o;return U({root:["root"],li:["li"],ol:["ol"],separator:["separator"]},Jo,e)},oe=M(Q,{name:"MuiBreadcrumbs",slot:"Root",overridesResolver:(o,e)=>[{[`& .${Qo.li}`]:e.li},e.root]})({}),ee=M("ol",{name:"MuiBreadcrumbs",slot:"Ol",overridesResolver:(o,e)=>e.ol})({display:"flex",flexWrap:"wrap",alignItems:"center",padding:0,margin:0,listStyle:"none"}),ae=M("li",{name:"MuiBreadcrumbs",slot:"Separator",overridesResolver:(o,e)=>e.separator})({display:"flex",userSelect:"none",marginLeft:8,marginRight:8});function re(o,e,t,a){return o.reduce((r,l,s)=>(s{const R=()=>{N(!0);const A=y.current.querySelector("a[href],button,[tabindex]");A&&A.focus()};return v+u>=C.length?C:[...C.slice(0,v),n.jsx(qo,{"aria-label":f,slots:{CollapsedIcon:i.CollapsedIcon},slotProps:{collapsedIcon:L},onClick:R},"ellipsis"),...C.slice(C.length-u,C.length)]},h=x.Children.toArray(r).filter(C=>x.isValidElement(C)).map((C,R)=>n.jsx("li",{className:j.li,children:C},`child-${R}`));return n.jsx(oe,g({ref:t,component:s,color:"text.secondary",className:B(j.root,l),ownerState:I},m,{children:n.jsx(ee,{className:j.ol,ref:y,ownerState:I,children:re(S||$&&h.length<=$?h:z(h),j.separator,b,I)})}))}),vo=x.createContext();function le(o){return _("MuiGrid",o)}const ne=[0,1,2,3,4,5,6,7,8,9,10],se=["column-reverse","column","row-reverse","row"],ie=["nowrap","wrap-reverse","wrap"],T=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],V=G("MuiGrid",["root","container","item","zeroMinWidth",...ne.map(o=>`spacing-xs-${o}`),...se.map(o=>`direction-xs-${o}`),...ie.map(o=>`wrap-xs-${o}`),...T.map(o=>`grid-xs-${o}`),...T.map(o=>`grid-sm-${o}`),...T.map(o=>`grid-md-${o}`),...T.map(o=>`grid-lg-${o}`),...T.map(o=>`grid-xl-${o}`)]),ce=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function E(o){const e=parseFloat(o);return`${e}${String(o).replace(String(e),"")||"px"}`}function pe({theme:o,ownerState:e}){let t;return o.breakpoints.keys.reduce((a,r)=>{let l={};if(e[r]&&(t=e[r]),!t)return a;if(t===!0)l={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(t==="auto")l={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=F({values:e.columns,breakpoints:o.breakpoints.values}),i=typeof s=="object"?s[r]:s;if(i==null)return a;const d=`${Math.round(t/i*1e8)/1e6}%`;let f={};if(e.container&&e.item&&e.columnSpacing!==0){const u=o.spacing(e.columnSpacing);if(u!=="0px"){const v=`calc(${d} + ${E(u)})`;f={flexBasis:v,maxWidth:v}}}l=g({flexBasis:d,flexGrow:0,maxWidth:d},f)}return o.breakpoints.values[r]===0?Object.assign(a,l):a[o.breakpoints.up(r)]=l,a},{})}function de({theme:o,ownerState:e}){const t=F({values:e.direction,breakpoints:o.breakpoints.values});return X({theme:o},t,a=>{const r={flexDirection:a};return a.indexOf("column")===0&&(r[`& > .${V.item}`]={maxWidth:"none"}),r})}function xo({breakpoints:o,values:e}){let t="";Object.keys(e).forEach(r=>{t===""&&e[r]!==0&&(t=r)});const a=Object.keys(o).sort((r,l)=>o[r]-o[l]);return a.slice(0,a.indexOf(t))}function ue({theme:o,ownerState:e}){const{container:t,rowSpacing:a}=e;let r={};if(t&&a!==0){const l=F({values:a,breakpoints:o.breakpoints.values});let s;typeof l=="object"&&(s=xo({breakpoints:o.breakpoints.values,values:l})),r=X({theme:o},l,(i,d)=>{var f;const u=o.spacing(i);return u!=="0px"?{marginTop:`-${E(u)}`,[`& > .${V.item}`]:{paddingTop:E(u)}}:(f=s)!=null&&f.includes(d)?{}:{marginTop:0,[`& > .${V.item}`]:{paddingTop:0}}})}return r}function ge({theme:o,ownerState:e}){const{container:t,columnSpacing:a}=e;let r={};if(t&&a!==0){const l=F({values:a,breakpoints:o.breakpoints.values});let s;typeof l=="object"&&(s=xo({breakpoints:o.breakpoints.values,values:l})),r=X({theme:o},l,(i,d)=>{var f;const u=o.spacing(i);return u!=="0px"?{width:`calc(100% + ${E(u)})`,marginLeft:`-${E(u)}`,[`& > .${V.item}`]:{paddingLeft:E(u)}}:(f=s)!=null&&f.includes(d)?{}:{width:"100%",marginLeft:0,[`& > .${V.item}`]:{paddingLeft:0}}})}return r}function fe(o,e,t={}){if(!o||o<=0)return[];if(typeof o=="string"&&!Number.isNaN(Number(o))||typeof o=="number")return[t[`spacing-xs-${String(o)}`]];const a=[];return e.forEach(r=>{const l=o[r];Number(l)>0&&a.push(t[`spacing-${r}-${String(l)}`])}),a}const ve=M("div",{name:"MuiGrid",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o,{container:a,direction:r,item:l,spacing:s,wrap:i,zeroMinWidth:d,breakpoints:f}=t;let u=[];a&&(u=fe(s,f,e));const v=[];return f.forEach($=>{const b=t[$];b&&v.push(e[`grid-${$}-${String(b)}`])}),[e.root,a&&e.container,l&&e.item,d&&e.zeroMinWidth,...u,r!=="row"&&e[`direction-xs-${String(r)}`],i!=="wrap"&&e[`wrap-xs-${String(i)}`],...v]}})(({ownerState:o})=>g({boxSizing:"border-box"},o.container&&{display:"flex",flexWrap:"wrap",width:"100%"},o.item&&{margin:0},o.zeroMinWidth&&{minWidth:0},o.wrap!=="wrap"&&{flexWrap:o.wrap}),de,ue,ge,pe);function xe(o,e){if(!o||o<=0)return[];if(typeof o=="string"&&!Number.isNaN(Number(o))||typeof o=="number")return[`spacing-xs-${String(o)}`];const t=[];return e.forEach(a=>{const r=o[a];if(Number(r)>0){const l=`spacing-${a}-${String(r)}`;t.push(l)}}),t}const Ce=o=>{const{classes:e,container:t,direction:a,item:r,spacing:l,wrap:s,zeroMinWidth:i,breakpoints:d}=o;let f=[];t&&(f=xe(l,d));const u=[];d.forEach($=>{const b=o[$];b&&u.push(`grid-${$}-${String(b)}`)});const v={root:["root",t&&"container",r&&"item",i&&"zeroMinWidth",...f,a!=="row"&&`direction-xs-${String(a)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...u]};return U(v,le,e)},Se=x.forwardRef(function(e,t){const a=K({props:e,name:"MuiGrid"}),{breakpoints:r}=Io(),l=ho(a),{className:s,columns:i,columnSpacing:d,component:f="div",container:u=!1,direction:v="row",item:$=!1,rowSpacing:b,spacing:m=0,wrap:S="wrap",zeroMinWidth:N=!1}=l,I=D(l,ce),j=b||m,L=d||m,y=x.useContext(vo),z=u?i||12:y,h={},C=g({},I);r.keys.forEach(O=>{I[O]!=null&&(h[O]=I[O],delete C[O])});const R=g({},l,{columns:z,container:u,direction:v,item:$,rowSpacing:j,columnSpacing:L,wrap:S,zeroMinWidth:N,spacing:m},h,{breakpoints:r.keys}),A=Ce(R);return n.jsx(vo.Provider,{value:z,children:n.jsx(ve,g({ownerState:R,className:B(A.root,s),as:f,ref:t},C))})});var Y={},be=zo;Object.defineProperty(Y,"__esModule",{value:!0});var Co=Y.default=void 0,me=be(So()),$e=n;Co=Y.default=(0,me.default)((0,$e.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext");function ze({title:o,breadcrumbs:e=[],action:t}){return n.jsxs(Mo,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:1.5,sx:{mb:3},children:[n.jsxs(so,{children:[n.jsx(Q,{variant:"h3",sx:{fontWeight:700,color:"grey.800"},children:o}),e.length>0&&n.jsxs(te,{separator:n.jsx(Co,{fontSize:"small"}),sx:{mt:.5},children:[n.jsx(co,{component:io,to:"/dashboard",underline:"hover",color:"text.secondary",variant:"caption",children:"Home"}),e.map((a,r)=>a.to&&r{const{classes:e}=t,o=v({root:["root"]},_,e);return c({},e,o)},j=f(m,{shouldForwardProp:t=>D(t)||t==="classes",name:"MuiDialogContentText",slot:"Root",overridesResolver:(t,e)=>e.root})({}),S=p.forwardRef(function(e,a){const o=x({props:e,name:"MuiDialogContentText"}),{className:i}=o,r=C(o,h),n=R(r);return l.jsx(j,c({component:"p",variant:"body1",color:"text.secondary",ref:a,ownerState:r,className:g(n.root,i)},o,{classes:n}))});var s={},M=T;Object.defineProperty(s,"__esModule",{value:!0});var P=s.default=void 0,b=M(y()),w=l;P=s.default=(0,b.default)((0,w.jsx)("path",{d:"M6.54 5c.06.89.21 1.76.45 2.59l-1.2 1.2c-.41-1.2-.67-2.47-.76-3.79zm9.86 12.02c.85.24 1.72.39 2.6.45v1.49c-1.32-.09-2.59-.35-3.8-.75zM7.5 3H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.49c0-.55-.45-1-1-1-1.24 0-2.45-.2-3.57-.57-.1-.04-.21-.05-.31-.05-.26 0-.51.1-.71.29l-2.2 2.2c-2.83-1.45-5.15-3.76-6.59-6.59l2.2-2.2c.28-.28.36-.67.25-1.02C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1"}),"PhoneOutlined");export{S as D,P as d}; +import{x as u,y as d,b as p,z as x,E as C,j as l,_ as c,F as g,H as v,J as f,T as m,Y as D,r as y,i as T}from"./index-D7LVXeIK.js";function _(t){return u("MuiDialogContentText",t)}d("MuiDialogContentText",["root"]);const h=["children","className"],R=t=>{const{classes:e}=t,o=v({root:["root"]},_,e);return c({},e,o)},j=f(m,{shouldForwardProp:t=>D(t)||t==="classes",name:"MuiDialogContentText",slot:"Root",overridesResolver:(t,e)=>e.root})({}),S=p.forwardRef(function(e,a){const o=x({props:e,name:"MuiDialogContentText"}),{className:i}=o,r=C(o,h),n=R(r);return l.jsx(j,c({component:"p",variant:"body1",color:"text.secondary",ref:a,ownerState:r,className:g(n.root,i)},o,{classes:n}))});var s={},M=T;Object.defineProperty(s,"__esModule",{value:!0});var P=s.default=void 0,b=M(y()),w=l;P=s.default=(0,b.default)((0,w.jsx)("path",{d:"M6.54 5c.06.89.21 1.76.45 2.59l-1.2 1.2c-.41-1.2-.67-2.47-.76-3.79zm9.86 12.02c.85.24 1.72.39 2.6.45v1.49c-1.32-.09-2.59-.35-3.8-.75zM7.5 3H4c-.55 0-1 .45-1 1 0 9.39 7.61 17 17 17 .55 0 1-.45 1-1v-3.49c0-.55-.45-1-1-1-1.24 0-2.45-.2-3.57-.57-.1-.04-.21-.05-.31-.05-.26 0-.51.1-.71.29l-2.2 2.2c-2.83-1.45-5.15-3.76-6.59-6.59l2.2-2.2c.28-.28.36-.67.25-1.02C8.7 6.45 8.5 5.25 8.5 4c0-.55-.45-1-1-1"}),"PhoneOutlined");export{S as D,P as d}; diff --git a/dist/assets/Pricing-CttgMHSv.js b/dist/assets/Pricing-CttgMHSv.js deleted file mode 100644 index 106899c..0000000 --- a/dist/assets/Pricing-CttgMHSv.js +++ /dev/null @@ -1 +0,0 @@ -import{r as ce,j as e,i as de,b as l,S as _,l as he,B as w,M as N,A as ge,T as y,n as me,C as pe,o as xe,e as ue,I as fe}from"./index-DpAn5wLF.js";import{d as ye,D as je,a as be,e as ve,b as Se,c as we}from"./Close-BdNf_RlN.js";import{d as se}from"./EditOutlined-B2ltVbl8.js";import{c as Ce,d as ie,a as _e,b as We}from"./StorefrontOutlined-B0ka2NHy.js";import{P as Ie,C as H,A as ze,G as W}from"./PageHeader-CEew5Fw4.js";import{C as K}from"./Link-Bme8npFv.js";import{T as F,F as Ae,S as ke,O as Ee}from"./TextField-C0dUZvW0.js";import{I as Te}from"./InputAdornment-BWnl4jqW.js";import{B as O}from"./Button-BGNvVfej.js";import{T as Pe,a as Re,b as Le,c as q,d as Fe}from"./TableRow-BcqnvRn2.js";import{T as I}from"./TableCell-PEGz6qo_.js";import{S as Oe}from"./Snackbar-B0wJYiYQ.js";var Q={},$e=de;Object.defineProperty(Q,"__esModule",{value:!0});var oe=Q.default=void 0,Be=$e(ce()),Me=e;oe=Q.default=(0,Be.default)((0,Me.jsx)("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutline");const D="https://api.doormile.com/api/v1",J=()=>{const i=localStorage.getItem("auth_token");return{"Content-Type":"application/json",...i?{Authorization:`Bearer ${i}`}:{}}};async function He(){const i=await fetch(`${D}/admin/carrier-pricing?limit=1000`,{headers:J()});if(!i.ok)throw new Error("Failed to fetch pricing");const n=await i.json();return Array.isArray(n)?{data:n}:n}async function qe(i){const n=!!i.id,b=n?`${D}/admin/carrier-pricing/${i.id}`:`${D}/admin/carrier-pricing`,u=await fetch(b,{method:n?"PUT":"POST",headers:J(),body:JSON.stringify({company:i.company,weight_slab:i.weight_slab,zone:i.zone||"",service_type:i.service_type||"",rate:String(i.rate)})});if(!u.ok){const C=await u.json().catch(()=>({}));throw new Error(C.error||C.message||"Failed to save pricing")}return u.status===204?{}:u.json().catch(()=>({}))}const Ne=["Local / Same","Within Tamilnadu","Interstate India"],De=["< 500g","500g - 1kg","1kg - 2kg","2kg - 5kg","> 5kg"];function Ge({open:i,onClose:n,onSave:b,initialData:x,isCell:u=!1,pricingList:C=[],providerColumns:m=[],providerUsesServiceType:v=!1}){const[a,z]=l.useState({}),[h,A]=l.useState(!1),[$,p]=l.useState(null);l.useEffect(()=>{i&&(z(x||{company:"",weight_slab:"",zone:"",rate:""}),p(null))},[i,x]);const k=s=>f=>z(S=>({...S,[s]:f.target.value})),B=s=>(s.zone||"").trim()||(s.service_type||"").trim(),g=s=>{const f=(s.company||"").trim(),S=(s.weight_slab||"").trim(),c=(s.zone||s.service_type||"").trim();return C.find(j=>(j.company||"").trim()===f&&(j.weight_slab||"").trim()===S&&B(j)===c)||null},G=async()=>{var f,S;const s=(a.zone||a.service_type||"").trim();if(!u){if(!((f=a.company)!=null&&f.trim())){p("Company is required.");return}if(!((S=a.weight_slab)!=null&&S.trim())){p("Weight slab is required.");return}if(!s){p("Zone / Service Type is required.");return}}if(!String(a.rate??"").trim()){p("Rate is required.");return}A(!0),p(null);try{let c={...a};if(u||(c={...c,zone:v?"":s,service_type:v?s:c.service_type||""}),!c.id){const j=g(c);j&&(c={...c,id:j.id})}await qe(c),b(),n()}catch(c){console.error(c),p(c.message||"Failed to save. Please try again.")}finally{A(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(Oe,{open:!!$,autoHideDuration:6e3,onClose:()=>p(null),anchorOrigin:{vertical:"top",horizontal:"right"},sx:{zIndex:9999},children:e.jsx(ze,{onClose:()=>p(null),severity:"error",variant:"filled",sx:{width:"100%",boxShadow:3},children:$})}),e.jsxs(je,{open:i,onClose:h?void 0:n,maxWidth:"xs",fullWidth:!0,children:[e.jsxs(be,{sx:{fontWeight:800,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[u?x!=null&&x.id?"Edit Rate":"Add Rate":x!=null&&x.id?"Edit Rate":"Add New Rate",e.jsx(fe,{size:"small",onClick:n,disabled:h,children:e.jsx(ve,{fontSize:"small"})})]}),e.jsx(Se,{dividers:!0,children:e.jsxs(W,{container:!0,spacing:2,children:[u?e.jsx(W,{item:!0,xs:12,children:e.jsxs(w,{sx:{p:1.5,borderRadius:2,bgcolor:"primary.lighter",border:"1px solid",borderColor:"primary.light",mb:.5},children:[e.jsx(y,{variant:"caption",sx:{fontWeight:700,color:"grey.500",letterSpacing:.5,display:"block",mb:.5},children:"UPDATING RATE FOR"}),e.jsx(y,{variant:"subtitle2",sx:{fontWeight:700,color:"grey.900"},children:a.company}),e.jsxs(y,{variant:"body2",sx:{color:"grey.600",mt:.25},children:[a.weight_slab," · ",a.zone||a.service_type]})]})}):e.jsxs(e.Fragment,{children:[e.jsx(W,{item:!0,xs:12,children:e.jsx(F,{fullWidth:!0,label:"Company *",value:a.company||"",onChange:k("company"),size:"small"})}),e.jsx(W,{item:!0,xs:12,children:e.jsx(F,{select:!0,fullWidth:!0,label:"Weight Slab *",value:a.weight_slab||"",onChange:k("weight_slab"),size:"small",children:De.map(s=>e.jsx(N,{value:s,children:s},s))})}),e.jsx(W,{item:!0,xs:12,children:e.jsx(F,{select:!0,fullWidth:!0,label:v?"Service Type *":"Zone / Service Type *",value:a.zone||a.service_type||"",onChange:s=>z(f=>({...f,zone:v?"":s.target.value,service_type:v?s.target.value:""})),size:"small",children:(m.length>0?m:Ne).map(s=>e.jsx(N,{value:s,children:s},s))})})]}),e.jsx(W,{item:!0,xs:12,children:e.jsx(F,{fullWidth:!0,label:"Rate (₹) *",value:a.rate||"",onChange:k("rate"),size:"small",placeholder:"e.g. 25 or 25-35",autoFocus:!0})})]})}),e.jsxs(we,{sx:{p:2,bgcolor:"grey.50"},children:[e.jsx(O,{onClick:n,disabled:h,color:"inherit",children:"Cancel"}),e.jsx(O,{onClick:G,disabled:h,variant:"contained",children:h?"Saving...":"Save Rate"})]})]})]})}async function Ze(){const i=await fetch(`${D}/admin/competitor-branches?limit=1000`,{headers:J()});if(!i.ok)throw new Error("Failed to fetch surveys");const n=await i.json(),b=Array.isArray(n)?n:n.data||[];return{data:b,total:b.length}}function or(){const[i,n]=l.useState([]),[b,x]=l.useState([]),[u,C]=l.useState(!0),[m,v]=l.useState(""),[a,z]=l.useState(""),[h,A]=l.useState(!1),[$,p]=l.useState(!1),[k,B]=l.useState(null),[g,G]=l.useState(!1),[s,f]=l.useState(!1),[S,c]=l.useState([]),j=()=>{let r=!1;return C(!0),Promise.all([He().catch(()=>({data:[]})),Ze().catch(()=>({data:[]})),ue().catch(()=>[])]).then(([t,o,d])=>{r||(n(Array.isArray(t)?t:t.data||[]),x(o.data||o||[]),c(Array.isArray(d)?d:d.data||[]))}).catch(t=>console.error("Failed to fetch data",t)).finally(()=>{r||C(!1)}),()=>{r=!0}};l.useEffect(()=>j(),[]);const E=[...new Set(i.map(r=>r.company).filter(Boolean))];l.useEffect(()=>{!m&&E.length>0&&v(E[0])},[E,m]);const ae=i.filter(r=>r.company===m),X=r=>(r||"").toLowerCase().trim().replace(/\s+/g," "),Z=X(m),M=b.filter(r=>{const t=X(r.company);return t===Z||t.startsWith(Z)||Z.startsWith(t)}),T=[...ae].sort((r,t)=>(t.id||0)-(r.id||0)),Y=r=>{const t=(r||"").toLowerCase().replace(/\s+/g,""),o=t.match(/[\d.]+/g);if(!o)return 9999;const d=parseFloat(o[0]),R=t.includes("kg")?d*1e3:d;return t.startsWith("<")||t.startsWith("upto")?R-.5:t.startsWith(">")||t.includes("above")||t.endsWith("+")?R+.5:R},ee=r=>(r.zone||"").trim()||(r.service_type||"").trim(),U=T.length>0&&T.every(r=>!(r.zone||"").trim()),P=[...new Set(T.map(ee).filter(Boolean))].sort(),re=[...new Set(T.map(r=>(r.weight_slab||"").trim()).filter(Boolean))].sort((r,t)=>Y(r)-Y(t)),te=a?re.filter(r=>r.toLowerCase().includes(a.toLowerCase())):re;return e.jsxs(e.Fragment,{children:[e.jsx(Ie,{title:"Logistics Pricing Board",breadcrumbs:[{label:"Pricing Overview"}]}),e.jsxs(_,{spacing:3,children:[e.jsx(K,{sx:{overflow:"hidden"},children:e.jsxs(_,{direction:{xs:"column",md:"row"},spacing:2,sx:{p:2},alignItems:{md:"center"},children:[e.jsx(F,{size:"small",placeholder:"Search weight slabs…",value:a,onChange:r=>z(r.target.value),sx:{width:{xs:"100%",md:300}},InputProps:{startAdornment:e.jsx(Te,{position:"start",children:e.jsx(he,{fontSize:"small"})})}}),e.jsx(w,{sx:{flexGrow:1}}),e.jsx(Ae,{size:"small",sx:{minWidth:220},children:e.jsx(ke,{value:m||"",onChange:r=>v(r.target.value),displayEmpty:!0,size:"small",IconComponent:Ce,input:e.jsx(Ee,{sx:{fontWeight:700}}),children:E.length===0?e.jsx(N,{value:"",disabled:!0,children:"Loading Providers..."}):E.map(r=>e.jsx(N,{value:r,sx:{fontWeight:600},children:r},r))})}),e.jsx(O,{variant:"contained",startIcon:e.jsx(ye,{}),onClick:()=>{B({company:m,weight_slab:"",zone:"",rate:""}),f(!1),p(!0)},sx:{whiteSpace:"nowrap"},children:"Add Rate"}),e.jsx(O,{variant:g?"contained":"outlined",color:g?"inherit":"primary",startIcon:e.jsx(se,{}),onClick:()=>G(!g),sx:{whiteSpace:"nowrap",...g&&{bgcolor:"grey.800",color:"white","&:hover":{bgcolor:"grey.900"}}},children:g?"Done":"Edit"})]})}),m&&M.length>0&&e.jsxs(K,{elevation:0,sx:{border:"1px solid",borderColor:h?"primary.main":"grey.200",transition:"border-color 0.3s ease, box-shadow 0.3s ease","&:hover":{borderColor:"primary.main",boxShadow:"0 8px 30px rgba(192, 18, 39, 0.08)"}},children:[e.jsxs(_,{direction:{xs:"column",md:"row"},spacing:3,sx:{p:{xs:2,sm:2.5},cursor:"pointer",userSelect:"none"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",onClick:()=>A(!h),children:[e.jsxs(_,{direction:"row",spacing:2,alignItems:"center",sx:{minWidth:260},children:[e.jsx(ge,{sx:{width:42,height:42,bgcolor:"primary.lighter",color:"primary.main",fontWeight:800,borderRadius:2},children:(m||"A")[0].toUpperCase()}),e.jsxs(w,{children:[e.jsx(y,{variant:"overline",sx:{color:"grey.500",fontWeight:700,letterSpacing:1.2},children:"LOGISTICS PARTNER"}),e.jsx(y,{variant:"h5",sx:{fontWeight:800,color:"grey.900",lineHeight:1.1,mt:.25},children:m}),e.jsxs(y,{variant:"body2",sx:{color:"grey.600",mt:1,fontWeight:500,display:"flex",alignItems:"center"},children:[e.jsx(ie,{sx:{fontSize:16,mr:.5,color:"primary.main"}}),M.length," Registered Location",M.length!==1&&"s"]})]})]}),e.jsxs(_,{direction:"row",spacing:3,alignItems:"center",children:[e.jsxs(_,{direction:"row",spacing:1,sx:{display:{xs:"none",md:"flex"}},children:[e.jsx(H,{size:"small",label:"First Mile",sx:{bgcolor:"primary.lighter",color:"primary.main",fontWeight:700}}),e.jsx(H,{size:"small",label:"Mid Mile",sx:{bgcolor:"primary.lighter",color:"primary.main",fontWeight:700}}),e.jsx(H,{size:"small",label:"Last Mile",sx:{bgcolor:"primary.lighter",color:"primary.main",fontWeight:700}})]}),e.jsx(O,{onClick:r=>{r.stopPropagation(),A(!h)},sx:{borderRadius:2,py:1,px:3,fontWeight:700,color:h?"primary.main":"grey.700",bgcolor:h?"primary.lighter":"grey.100","&:hover":{bgcolor:"primary.lighter",color:"primary.main"}},endIcon:h?e.jsx(_e,{}):e.jsx(We,{}),children:h?"Hide Coverage":"View Coverage Map"})]})]}),e.jsx(me,{in:h,timeout:"auto",unmountOnExit:!0,children:e.jsxs(w,{sx:{p:2,pt:0,borderTop:"1px dashed",borderColor:"grey.200",bgcolor:"grey.50"},children:[e.jsxs(w,{sx:{display:"flex",alignItems:"center",mb:1.5,mt:2},children:[e.jsx(ie,{sx:{color:"primary.main",fontSize:20,mr:1}}),e.jsx(y,{variant:"caption",sx:{color:"grey.600",fontWeight:700,letterSpacing:1},children:"ALL SERVICED AREAS:"})]}),e.jsx(w,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:M.map((r,t)=>e.jsx(H,{label:r.area||r.address,sx:{fontWeight:600,bgcolor:"background.paper",color:"grey.800",border:"1px solid",borderColor:"grey.300","&:hover":{borderColor:"primary.main",color:"primary.main",bgcolor:"primary.lighter"},transition:"border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease"}},r.id??t))})]})})]}),e.jsx(K,{sx:{overflow:"hidden"},children:u?e.jsx(w,{sx:{display:"flex",justifyContent:"center",alignItems:"center",py:10},children:e.jsx(pe,{size:40,sx:{color:"primary.light"}})}):e.jsx(Pe,{children:e.jsxs(Re,{sx:{minWidth:700},children:[e.jsx(Le,{children:e.jsxs(q,{sx:{"& th":{bgcolor:"grey.50",fontWeight:700,color:"grey.700",textTransform:"uppercase",fontSize:"0.72rem",letterSpacing:.4}},children:[e.jsx(I,{children:"Weight Slab"}),P.map(r=>e.jsx(I,{align:"center",children:r},r))]})}),e.jsx(Fe,{children:P.length===0?e.jsx(q,{children:e.jsx(I,{colSpan:1,align:"center",sx:{py:8},children:e.jsx(y,{variant:"body1",color:"text.secondary",sx:{fontWeight:500},children:"No pricing data for this provider yet."})})}):te.length===0?e.jsx(q,{children:e.jsx(I,{colSpan:P.length+1,align:"center",sx:{py:8},children:e.jsx(y,{variant:"body1",color:"text.secondary",sx:{fontWeight:500},children:"No weight slabs match your search."})})}):te.map(r=>e.jsxs(q,{hover:!0,sx:{"&:last-child td":{borderBottom:0}},children:[e.jsx(I,{sx:{fontWeight:600,color:"grey.800"},children:r}),P.map(t=>{const o=T.find(L=>(L.weight_slab||"").trim()===r&&ee(L)===t),d=!!o,R=o?`₹${o.rate}`:"—";let V="";if(o&&o.updated_by){const L=S.find(le=>le.id===o.updated_by);V=`Last updated by: ${L?L.first_name:"ID "+o.updated_by}`}const ne=()=>{B({id:o?o.id:void 0,company:m,weight_slab:r,zone:U?"":t,service_type:U?t:(o==null?void 0:o.service_type)||"",rate:o?String(o.rate):""}),f(!0),p(!0)};return e.jsx(I,{align:"center",sx:{cursor:g?"pointer":"default",transition:"background 0.15s","&:hover":g?{bgcolor:"primary.lighter"}:{}},onClick:g?ne:void 0,children:e.jsx(xe,{title:g?d?"Click to edit rate":"Click to add rate":V,placement:"top",arrow:!0,disableHoverListener:!g&&!V,children:e.jsxs(w,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1},children:[e.jsx(y,{sx:{display:"inline-block",fontWeight:d?700:400,color:d?"success.dark":g?"primary.light":"grey.300",fontSize:d?"0.95rem":"0.85rem",bgcolor:d?"success.lighter":"transparent",px:d?1.5:0,py:d?.5:0,borderRadius:2},children:R}),g&&(d?e.jsx(se,{sx:{fontSize:13,color:"grey.400"}}):e.jsx(oe,{sx:{fontSize:13,color:"primary.light"}}))]})})},t)})]},r))})]})})})]}),e.jsx(Ge,{open:$,onClose:()=>p(!1),onSave:()=>j(),initialData:k,isCell:s,pricingList:i,providerColumns:P,providerUsesServiceType:U})]})}export{or as default}; diff --git a/dist/assets/Pricing-DDTUtTRz.js b/dist/assets/Pricing-DDTUtTRz.js new file mode 100644 index 0000000..476330b --- /dev/null +++ b/dist/assets/Pricing-DDTUtTRz.js @@ -0,0 +1 @@ +import{r as oe,j as e,i as ne,b as l,S as _,B as j,T as x,l as pe,M as D,A as me,n as xe,C as ue,o as fe,e as ye,I as je}from"./index-D7LVXeIK.js";import{d as ve,D as be,a as Se,e as we,b as Ce,c as _e}from"./Close-D3HB9j5y.js";import{d as se}from"./EditOutlined-DS7hq7Cq.js";import{c as We,d as ae,a as Ie,b as ze}from"./StorefrontOutlined-Be07_1-Y.js";import{P as ke,C as M,A as Ae,G as W}from"./PageHeader-naLAT9xr.js";import{C as K}from"./Link-BEif5YS2.js";import{T as $,F as Ee,S as Pe,O as Re}from"./TextField-Sd_pshci.js";import{I as Te}from"./InputAdornment-CMIlL2rx.js";import{B as F}from"./Button-Bqp5awT1.js";import{T as Le,a as $e,b as Fe,c as q,d as Oe}from"./TableRow-jBgitpDf.js";import{T as I}from"./TableCell-DreGbAeW.js";import{S as Be}from"./Snackbar-DOheZfWW.js";var Q={},He=ne;Object.defineProperty(Q,"__esModule",{value:!0});var le=Q.default=void 0,Me=He(oe()),qe=e;le=Q.default=(0,Me.default)((0,qe.jsx)("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutline");var J={},De=ne;Object.defineProperty(J,"__esModule",{value:!0});var ce=J.default=void 0,Ne=De(oe()),Ve=e;ce=J.default=(0,Ne.default)((0,Ve.jsx)("path",{d:"M11 13V9c0-.55-.45-1-1-1H6V6h5V4H8.5V3h-2v1H5c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1h4v2H4v2h2.5v1h2v-1H10c.55 0 1-.45 1-1m8.59-.48-5.66 5.65-2.83-2.83-1.41 1.42L13.93 21 21 13.93z"}),"PriceCheckOutlined");const N="https://api.doormile.com/api/v1",X=()=>{const s=localStorage.getItem("auth_token");return{"Content-Type":"application/json",...s?{Authorization:`Bearer ${s}`}:{}}};async function Ge(){const s=await fetch(`${N}/admin/carrier-pricing?limit=1000`,{headers:X()});if(!s.ok)throw new Error("Failed to fetch pricing");const n=await s.json();return Array.isArray(n)?{data:n}:n}async function Ze(s){const n=!!s.id,b=n?`${N}/admin/carrier-pricing/${s.id}`:`${N}/admin/carrier-pricing`,f=await fetch(b,{method:n?"PUT":"POST",headers:X(),body:JSON.stringify({company:s.company,weight_slab:s.weight_slab,zone:s.zone||"",service_type:s.service_type||"",rate:String(s.rate)})});if(!f.ok){const C=await f.json().catch(()=>({}));throw new Error(C.error||C.message||"Failed to save pricing")}return f.status===204?{}:f.json().catch(()=>({}))}const Ue=["Local / Same","Within Tamilnadu","Interstate India"],Ke=["< 500g","500g - 1kg","1kg - 2kg","2kg - 5kg","> 5kg"];function Qe({open:s,onClose:n,onSave:b,initialData:u,isCell:f=!1,pricingList:C=[],providerColumns:p=[],providerUsesServiceType:S=!1}){const[o,z]=l.useState({}),[h,k]=l.useState(!1),[O,m]=l.useState(null);l.useEffect(()=>{s&&(z(u||{company:"",weight_slab:"",zone:"",rate:""}),m(null))},[s,u]);const A=i=>y=>z(w=>({...w,[i]:y.target.value})),B=i=>(i.zone||"").trim()||(i.service_type||"").trim(),g=i=>{const y=(i.company||"").trim(),w=(i.weight_slab||"").trim(),c=(i.zone||i.service_type||"").trim();return C.find(v=>(v.company||"").trim()===y&&(v.weight_slab||"").trim()===w&&B(v)===c)||null},V=async()=>{var y,w;const i=(o.zone||o.service_type||"").trim();if(!f){if(!((y=o.company)!=null&&y.trim())){m("Company is required.");return}if(!((w=o.weight_slab)!=null&&w.trim())){m("Weight slab is required.");return}if(!i){m("Zone / Service Type is required.");return}}if(!String(o.rate??"").trim()){m("Rate is required.");return}k(!0),m(null);try{let c={...o};if(f||(c={...c,zone:S?"":i,service_type:S?i:c.service_type||""}),!c.id){const v=g(c);v&&(c={...c,id:v.id})}await Ze(c),b(),n()}catch(c){console.error(c),m(c.message||"Failed to save. Please try again.")}finally{k(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(Be,{open:!!O,autoHideDuration:6e3,onClose:()=>m(null),anchorOrigin:{vertical:"top",horizontal:"right"},sx:{zIndex:9999},children:e.jsx(Ae,{onClose:()=>m(null),severity:"error",variant:"filled",sx:{width:"100%",boxShadow:3},children:O})}),e.jsxs(be,{open:s,onClose:h?void 0:n,maxWidth:"xs",fullWidth:!0,children:[e.jsxs(Se,{sx:{fontWeight:800,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[f?u!=null&&u.id?"Edit Rate":"Add Rate":u!=null&&u.id?"Edit Rate":"Add New Rate",e.jsx(je,{size:"small",onClick:n,disabled:h,children:e.jsx(we,{fontSize:"small"})})]}),e.jsx(Ce,{dividers:!0,children:e.jsxs(W,{container:!0,spacing:2,children:[f?e.jsx(W,{item:!0,xs:12,children:e.jsxs(j,{sx:{p:1.5,borderRadius:2,bgcolor:"primary.lighter",border:"1px solid",borderColor:"primary.light",mb:.5},children:[e.jsx(x,{variant:"caption",sx:{fontWeight:700,color:"grey.500",letterSpacing:.5,display:"block",mb:.5},children:"UPDATING RATE FOR"}),e.jsx(x,{variant:"subtitle2",sx:{fontWeight:700,color:"grey.900"},children:o.company}),e.jsxs(x,{variant:"body2",sx:{color:"grey.600",mt:.25},children:[o.weight_slab," · ",o.zone||o.service_type]})]})}):e.jsxs(e.Fragment,{children:[e.jsx(W,{item:!0,xs:12,children:e.jsx($,{fullWidth:!0,label:"Company *",value:o.company||"",onChange:A("company"),size:"small"})}),e.jsx(W,{item:!0,xs:12,children:e.jsx($,{select:!0,fullWidth:!0,label:"Weight Slab *",value:o.weight_slab||"",onChange:A("weight_slab"),size:"small",children:Ke.map(i=>e.jsx(D,{value:i,children:i},i))})}),e.jsx(W,{item:!0,xs:12,children:e.jsx($,{select:!0,fullWidth:!0,label:S?"Service Type *":"Zone / Service Type *",value:o.zone||o.service_type||"",onChange:i=>z(y=>({...y,zone:S?"":i.target.value,service_type:S?i.target.value:""})),size:"small",children:(p.length>0?p:Ue).map(i=>e.jsx(D,{value:i,children:i},i))})})]}),e.jsx(W,{item:!0,xs:12,children:e.jsx($,{fullWidth:!0,label:"Rate (₹) *",value:o.rate||"",onChange:A("rate"),size:"small",placeholder:"e.g. 25 or 25-35",autoFocus:!0})})]})}),e.jsxs(_e,{sx:{px:3,py:2},children:[e.jsx(F,{onClick:n,disabled:h,color:"inherit",children:"Cancel"}),e.jsx(F,{onClick:V,disabled:h,variant:"contained",children:h?"Saving...":"Save Rate"})]})]})]})}async function Je(){const s=await fetch(`${N}/admin/competitor-branches?limit=1000`,{headers:X()});if(!s.ok)throw new Error("Failed to fetch surveys");const n=await s.json(),b=Array.isArray(n)?n:n.data||[];return{data:b,total:b.length}}function dr(){const[s,n]=l.useState([]),[b,u]=l.useState([]),[f,C]=l.useState(!0),[p,S]=l.useState(""),[o,z]=l.useState(""),[h,k]=l.useState(!1),[O,m]=l.useState(!1),[A,B]=l.useState(null),[g,V]=l.useState(!1),[i,y]=l.useState(!1),[w,c]=l.useState([]),v=()=>{let r=!1;return C(!0),Promise.all([Ge().catch(()=>({data:[]})),Je().catch(()=>({data:[]})),ye().catch(()=>[])]).then(([t,a,d])=>{r||(n(Array.isArray(t)?t:t.data||[]),u(a.data||a||[]),c(Array.isArray(d)?d:d.data||[]))}).catch(t=>console.error("Failed to fetch data",t)).finally(()=>{r||C(!1)}),()=>{r=!0}};l.useEffect(()=>v(),[]);const E=[...new Set(s.map(r=>r.company).filter(Boolean))];l.useEffect(()=>{!p&&E.length>0&&S(E[0])},[E,p]);const de=s.filter(r=>r.company===p),Y=r=>(r||"").toLowerCase().trim().replace(/\s+/g," "),G=Y(p),H=b.filter(r=>{const t=Y(r.company);return t===G||t.startsWith(G)||G.startsWith(t)}),P=[...de].sort((r,t)=>(t.id||0)-(r.id||0)),ee=r=>{const t=(r||"").toLowerCase().replace(/\s+/g,""),a=t.match(/[\d.]+/g);if(!a)return 9999;const d=parseFloat(a[0]),T=t.includes("kg")?d*1e3:d;return t.startsWith("<")||t.startsWith("upto")?T-.5:t.startsWith(">")||t.includes("above")||t.endsWith("+")?T+.5:T},re=r=>(r.zone||"").trim()||(r.service_type||"").trim(),Z=P.length>0&&P.every(r=>!(r.zone||"").trim()),R=[...new Set(P.map(re).filter(Boolean))].sort(),te=[...new Set(P.map(r=>(r.weight_slab||"").trim()).filter(Boolean))].sort((r,t)=>ee(r)-ee(t)),ie=o?te.filter(r=>r.toLowerCase().includes(o.toLowerCase())):te;return e.jsxs(e.Fragment,{children:[e.jsx(ke,{title:"Logistics Pricing Board",breadcrumbs:[{label:"Pricing Overview"}]}),e.jsxs(_,{spacing:3,children:[e.jsxs(K,{sx:{overflow:"hidden"},children:[e.jsxs(j,{sx:{px:{xs:2,sm:2.5},py:2,borderBottom:1,borderColor:"divider",display:"flex",alignItems:"center",gap:1.5,background:r=>`linear-gradient(90deg, ${r.palette.primary.lighter}66 0%, ${r.palette.background.paper} 70%)`},children:[e.jsx(j,{sx:{width:40,height:40,borderRadius:2,bgcolor:"primary.lighter",color:"primary.main",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx(ce,{fontSize:"small"})}),e.jsxs(j,{children:[e.jsx(x,{variant:"subtitle1",sx:{fontWeight:700,color:"grey.800",lineHeight:1.2},children:"Pricing Matrix"}),e.jsx(x,{variant:"caption",color:"text.secondary",children:"Manage carrier rates by weight slab and zone"})]})]}),e.jsxs(_,{direction:{xs:"column",md:"row"},spacing:1.5,sx:{p:2},alignItems:{md:"center"},children:[e.jsx($,{size:"small",placeholder:"Search weight slabs…",value:o,onChange:r=>z(r.target.value),sx:{width:{xs:"100%",md:300}},InputProps:{startAdornment:e.jsx(Te,{position:"start",children:e.jsx(pe,{fontSize:"small"})})}}),e.jsx(j,{sx:{flexGrow:1}}),e.jsx(Ee,{size:"small",sx:{minWidth:220},children:e.jsx(Pe,{value:p||"",onChange:r=>S(r.target.value),displayEmpty:!0,size:"small",IconComponent:We,input:e.jsx(Re,{sx:{fontWeight:700}}),children:E.length===0?e.jsx(D,{value:"",disabled:!0,children:"Loading Providers..."}):E.map(r=>e.jsx(D,{value:r,sx:{fontWeight:600},children:r},r))})}),e.jsx(F,{variant:"contained",startIcon:e.jsx(ve,{}),onClick:()=>{B({company:p,weight_slab:"",zone:"",rate:""}),y(!1),m(!0)},sx:{whiteSpace:"nowrap"},children:"Add Rate"}),e.jsx(F,{variant:g?"contained":"outlined",color:g?"inherit":"primary",startIcon:e.jsx(se,{}),onClick:()=>V(!g),sx:{whiteSpace:"nowrap",...g&&{bgcolor:"grey.800",color:"white","&:hover":{bgcolor:"grey.900"}}},children:g?"Done":"Edit"})]})]}),p&&H.length>0&&e.jsxs(K,{elevation:0,sx:{border:"1px solid",borderColor:h?"primary.main":"grey.200",transition:"border-color 0.3s ease, box-shadow 0.3s ease","&:hover":{borderColor:"primary.main",boxShadow:"0 8px 30px rgba(192, 18, 39, 0.08)"}},children:[e.jsxs(_,{direction:{xs:"column",md:"row"},spacing:3,sx:{p:{xs:2,sm:2.5},cursor:"pointer",userSelect:"none"},alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",onClick:()=>k(!h),children:[e.jsxs(_,{direction:"row",spacing:2,alignItems:"center",sx:{minWidth:260},children:[e.jsx(me,{sx:{width:42,height:42,bgcolor:"primary.lighter",color:"primary.main",fontWeight:800,borderRadius:2},children:(p||"A")[0].toUpperCase()}),e.jsxs(j,{children:[e.jsx(x,{variant:"overline",sx:{color:"grey.500",fontWeight:700,letterSpacing:1.2},children:"LOGISTICS PARTNER"}),e.jsx(x,{variant:"h5",sx:{fontWeight:800,color:"grey.900",lineHeight:1.1,mt:.25},children:p}),e.jsxs(x,{variant:"body2",sx:{color:"grey.600",mt:1,fontWeight:500,display:"flex",alignItems:"center"},children:[e.jsx(ae,{sx:{fontSize:16,mr:.5,color:"primary.main"}}),H.length," Registered Location",H.length!==1&&"s"]})]})]}),e.jsxs(_,{direction:"row",spacing:3,alignItems:"center",children:[e.jsxs(_,{direction:"row",spacing:1,sx:{display:{xs:"none",md:"flex"}},children:[e.jsx(M,{size:"small",label:"First Mile",sx:{bgcolor:"primary.lighter",color:"primary.main",fontWeight:700}}),e.jsx(M,{size:"small",label:"Mid Mile",sx:{bgcolor:"primary.lighter",color:"primary.main",fontWeight:700}}),e.jsx(M,{size:"small",label:"Last Mile",sx:{bgcolor:"primary.lighter",color:"primary.main",fontWeight:700}})]}),e.jsx(F,{onClick:r=>{r.stopPropagation(),k(!h)},sx:{borderRadius:2,py:1,px:3,fontWeight:700,color:h?"primary.main":"grey.700",bgcolor:h?"primary.lighter":"grey.100","&:hover":{bgcolor:"primary.lighter",color:"primary.main"}},endIcon:h?e.jsx(Ie,{}):e.jsx(ze,{}),children:h?"Hide Coverage":"View Coverage Map"})]})]}),e.jsx(xe,{in:h,timeout:"auto",unmountOnExit:!0,children:e.jsxs(j,{sx:{p:2,borderTop:"1px dashed",borderColor:"grey.200",bgcolor:"grey.50"},children:[e.jsxs(j,{sx:{display:"flex",alignItems:"center",mb:1.5},children:[e.jsx(ae,{sx:{color:"primary.main",fontSize:20,mr:1}}),e.jsx(x,{variant:"caption",sx:{color:"grey.600",fontWeight:700,letterSpacing:1},children:"ALL SERVICED AREAS:"})]}),e.jsx(j,{sx:{display:"flex",gap:1,flexWrap:"wrap"},children:H.map((r,t)=>e.jsx(M,{label:r.area||r.address,sx:{fontWeight:600,bgcolor:"background.paper",color:"grey.800",border:"1px solid",borderColor:"grey.300","&:hover":{borderColor:"primary.main",color:"primary.main",bgcolor:"primary.lighter"},transition:"border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease"}},r.id??t))})]})})]}),e.jsx(K,{sx:{overflow:"hidden"},children:f?e.jsx(j,{sx:{display:"flex",justifyContent:"center",alignItems:"center",py:10},children:e.jsx(ue,{size:40,sx:{color:"primary.light"}})}):e.jsx(Le,{children:e.jsxs($e,{sx:{minWidth:700},children:[e.jsx(Fe,{children:e.jsxs(q,{sx:{"& th":{bgcolor:"grey.50",fontWeight:700,color:"grey.700",textTransform:"uppercase",fontSize:"0.72rem",letterSpacing:.4}},children:[e.jsx(I,{children:"Weight Slab"}),R.map(r=>e.jsx(I,{align:"center",children:r},r))]})}),e.jsx(Oe,{children:R.length===0?e.jsx(q,{children:e.jsx(I,{colSpan:1,align:"center",sx:{py:8},children:e.jsx(x,{variant:"body1",color:"text.secondary",sx:{fontWeight:500},children:"No pricing data for this provider yet."})})}):ie.length===0?e.jsx(q,{children:e.jsx(I,{colSpan:R.length+1,align:"center",sx:{py:8},children:e.jsx(x,{variant:"body1",color:"text.secondary",sx:{fontWeight:500},children:"No weight slabs match your search."})})}):ie.map(r=>e.jsxs(q,{hover:!0,sx:{"&:last-child td":{borderBottom:0}},children:[e.jsx(I,{sx:{fontWeight:600,color:"grey.800"},children:r}),R.map(t=>{const a=P.find(L=>(L.weight_slab||"").trim()===r&&re(L)===t),d=!!a,T=a?`₹${a.rate}`:"—";let U="";if(a&&a.updated_by){const L=w.find(ge=>ge.id===a.updated_by);U=`Last updated by: ${L?L.first_name:"ID "+a.updated_by}`}const he=()=>{B({id:a?a.id:void 0,company:p,weight_slab:r,zone:Z?"":t,service_type:Z?t:(a==null?void 0:a.service_type)||"",rate:a?String(a.rate):""}),y(!0),m(!0)};return e.jsx(I,{align:"center",sx:{cursor:g?"pointer":"default",transition:"background 0.15s","&:hover":g?{bgcolor:"primary.lighter"}:{}},onClick:g?he:void 0,children:e.jsx(fe,{title:g?d?"Click to edit rate":"Click to add rate":U,placement:"top",arrow:!0,disableHoverListener:!g&&!U,children:e.jsxs(j,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1},children:[e.jsx(x,{sx:{display:"inline-block",fontWeight:d?700:400,color:d?"success.dark":g?"primary.light":"grey.300",fontSize:d?"0.95rem":"0.85rem",bgcolor:d?"success.lighter":"transparent",px:d?1.5:0,py:d?.5:0,borderRadius:2},children:T}),g&&(d?e.jsx(se,{sx:{fontSize:13,color:"grey.400"}}):e.jsx(le,{sx:{fontSize:13,color:"primary.light"}}))]})})},t)})]},r))})]})})})]}),e.jsx(Qe,{open:O,onClose:()=>m(!1),onSave:()=>v(),initialData:A,isCell:i,pricingList:s,providerColumns:R,providerUsesServiceType:Z})]})}export{dr as default}; diff --git a/dist/assets/Refresh-B8qCgQHN.js b/dist/assets/Refresh-DA6RLQV4.js similarity index 84% rename from dist/assets/Refresh-B8qCgQHN.js rename to dist/assets/Refresh-DA6RLQV4.js index af7133e..89c0670 100644 --- a/dist/assets/Refresh-B8qCgQHN.js +++ b/dist/assets/Refresh-DA6RLQV4.js @@ -1 +1 @@ -import{r,j as t,i as a}from"./index-DpAn5wLF.js";var e={},s=a;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,o=s(r()),i=t;u=e.default=(0,o.default)((0,i.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");export{u as d}; +import{r,j as t,i as a}from"./index-D7LVXeIK.js";var e={},s=a;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,o=s(r()),i=t;u=e.default=(0,o.default)((0,i.jsx)("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh");export{u as d}; diff --git a/dist/assets/Settings-5wBismGd.js b/dist/assets/Settings-Cp4ure_x.js similarity index 50% rename from dist/assets/Settings-5wBismGd.js rename to dist/assets/Settings-Cp4ure_x.js index d461453..244ebd6 100644 --- a/dist/assets/Settings-5wBismGd.js +++ b/dist/assets/Settings-Cp4ure_x.js @@ -1 +1 @@ -import{x as _e,y as $e,b as w,z as ze,E as Ce,_ as P,j as e,F as ke,G as z,H as Re,J as N,ac as Ie,ad as Me,O as se,r as v,i as m,S as l,T as x,B as u,A as Oe,M as ie,D as I,I as Pe}from"./index-DpAn5wLF.js";import{d as Ae,a as Ne}from"./VisibilityOff-DwiupP03.js";import{P as Te,C as D,G as C,A as He}from"./PageHeader-CEew5Fw4.js";import{B as k}from"./Button-BGNvVfej.js";import{C as A}from"./Link-Bme8npFv.js";import{T as $}from"./TextField-C0dUZvW0.js";import{S as We}from"./SwitchBase-1TkNOx4a.js";import{L as De}from"./LinearProgress-CwfnEpKL.js";import{S as Ve}from"./Snackbar-B0wJYiYQ.js";import{I as Le}from"./InputAdornment-BWnl4jqW.js";function Ee(t){return _e("MuiSwitch",t)}const c=$e("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),Be=["className","color","edge","size","sx"],Fe=t=>{const{classes:r,edge:s,size:o,color:g,checked:d,disabled:n}=t,S={root:["root",s&&`edge${z(s)}`,`size${z(o)}`],switchBase:["switchBase",`color${z(g)}`,d&&"checked",n&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},y=Re(S,Ee,r);return P({},r,y)},Ge=N("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,r)=>{const{ownerState:s}=t;return[r.root,s.edge&&r[`edge${z(s.edge)}`],r[`size${z(s.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${c.thumb}`]:{width:16,height:16},[`& .${c.switchBase}`]:{padding:4,[`&.${c.checked}`]:{transform:"translateX(16px)"}}}}]}),qe=N(We,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,r)=>{const{ownerState:s}=t;return[r.switchBase,{[`& .${c.input}`]:r.input},s.color!=="default"&&r[`color${z(s.color)}`]]}})(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${c.checked}`]:{transform:"translateX(20px)"},[`&.${c.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${c.checked} + .${c.track}`]:{opacity:.5},[`&.${c.disabled} + .${c.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${c.input}`]:{left:"-100%",width:"300%"}}),({theme:t})=>({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:se(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(([,r])=>r.main&&r.light).map(([r])=>({props:{color:r},style:{[`&.${c.checked}`]:{color:(t.vars||t).palette[r].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:se(t.palette[r].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${c.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${r}DisabledColor`]:`${t.palette.mode==="light"?Ie(t.palette[r].main,.62):Me(t.palette[r].main,.55)}`}},[`&.${c.checked} + .${c.track}`]:{backgroundColor:(t.vars||t).palette[r].main}}}))]})),Ue=N("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,r)=>r.track})(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`})),Ye=N("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,r)=>r.thumb})(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),M=w.forwardRef(function(r,s){const o=ze({props:r,name:"MuiSwitch"}),{className:g,color:d="primary",edge:n=!1,size:S="medium",sx:y}=o,R=Ce(o,Be),i=P({},o,{color:d,edge:n,size:S}),j=Fe(i),b=e.jsx(Ye,{className:j.thumb,ownerState:i});return e.jsxs(Ge,{className:ke(j.root,g),sx:y,ownerState:i,children:[e.jsx(qe,P({type:"checkbox",icon:b,checkedIcon:b,ref:s,ownerState:i},R,{classes:P({},j,{root:j.switchBase})})),e.jsx(Ue,{className:j.track,ownerState:i})]})});var E={},Ze=m;Object.defineProperty(E,"__esModule",{value:!0});var de=E.default=void 0,Xe=Ze(v()),Je=e;de=E.default=(0,Xe.default)((0,Je.jsx)("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm2 16H5V5h11.17L19 7.83zm-7-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3M6 6h9v4H6z"}),"SaveOutlined");var B={},Ke=m;Object.defineProperty(B,"__esModule",{value:!0});var F=B.default=void 0,Qe=Ke(v()),et=e;F=B.default=(0,Qe.default)((0,et.jsx)("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"}),"TuneOutlined");var G={},tt=m;Object.defineProperty(G,"__esModule",{value:!0});var q=G.default=void 0,rt=tt(v()),at=e;q=G.default=(0,rt.default)((0,at.jsx)("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"}),"NotificationsNone");var U={},st=m;Object.defineProperty(U,"__esModule",{value:!0});var Y=U.default=void 0,it=st(v()),ot=e;Y=U.default=(0,it.default)((0,ot.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2M9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9zm9 14H6V10h12zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2"}),"LockOutlined");var Z={},nt=m;Object.defineProperty(Z,"__esModule",{value:!0});var L=Z.default=void 0,lt=nt(v()),ct=e;L=Z.default=(0,lt.default)((0,ct.jsx)("path",{d:"M12 2 4 5v6.09c0 5.05 3.41 9.76 8 10.91 4.59-1.15 8-5.86 8-10.91V5zm6 9.09c0 4-2.55 7.7-6 8.83-3.45-1.13-6-4.82-6-8.83v-4.7l6-2.25 6 2.25z"}),"ShieldOutlined");var X={},dt=m;Object.defineProperty(X,"__esModule",{value:!0});var ue=X.default=void 0,ut=dt(v()),ht=e;ue=X.default=(0,ut.default)((0,ht.jsx)("path",{d:"M18 11v2h4v-2zm-2 6.61c.96.71 2.21 1.65 3.2 2.39.4-.53.8-1.07 1.2-1.6-.99-.74-2.24-1.68-3.2-2.4-.4.54-.8 1.08-1.2 1.61M20.4 5.6c-.4-.53-.8-1.07-1.2-1.6-.99.74-2.24 1.68-3.2 2.4.4.53.8 1.07 1.2 1.6.96-.72 2.21-1.65 3.2-2.4M4 9c-1.1 0-2 .9-2 2v2c0 1.1.9 2 2 2h1v4h2v-4h1l5 3V6L8 9zm5.03 1.71L11 9.53v4.94l-1.97-1.18-.48-.29H4v-2h4.55zM15.5 12c0-1.33-.58-2.53-1.5-3.35v6.69c.92-.81 1.5-2.01 1.5-3.34"}),"CampaignOutlined");var J={},pt=m;Object.defineProperty(J,"__esModule",{value:!0});var he=J.default=void 0,xt=pt(v()),vt=e;he=J.default=(0,xt.default)((0,vt.jsx)("path",{d:"M12 7V3H2v18h20V7zM6 19H4v-2h2zm0-4H4v-2h2zm0-4H4V9h2zm0-4H4V5h2zm4 12H8v-2h2zm0-4H8v-2h2zm0-4H8V9h2zm0-4H8V5h2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8zm-2-8h-2v2h2zm0 4h-2v2h2z"}),"BusinessOutlined");var K={},mt=m;Object.defineProperty(K,"__esModule",{value:!0});var pe=K.default=void 0,gt=mt(v()),oe=e;pe=K.default=(0,gt.default)([(0,oe.jsx)("path",{d:"M23 11.99 20.56 9.2l.34-3.69-3.61-.82L15.4 1.5 12 2.96 8.6 1.5 6.71 4.69 3.1 5.5l.34 3.7L1 11.99l2.44 2.79-.34 3.7 3.61.82 1.89 3.2 3.4-1.47 3.4 1.46 1.89-3.19 3.61-.82-.34-3.69zm-3.95 1.48-.56.65.08.85.18 1.95-1.9.43-.84.19-.44.74-.99 1.68-1.78-.77-.8-.34-.79.34-1.78.77-.99-1.67-.44-.74-.84-.19-1.9-.43.18-1.96.08-.85-.56-.65L3.67 12l1.29-1.48.56-.65-.09-.86-.18-1.94 1.9-.43.84-.19.44-.74.99-1.68 1.78.77.8.34.79-.34 1.78-.77.99 1.68.44.74.84.19 1.9.43-.18 1.95-.08.85.56.65 1.29 1.47z"},"0"),(0,oe.jsx)("path",{d:"m10.09 13.75-2.32-2.33-1.48 1.49 3.8 3.81 7.34-7.36-1.48-1.49z"},"1")],"VerifiedOutlined");var Q={},ft=m;Object.defineProperty(Q,"__esModule",{value:!0});var xe=Q.default=void 0,jt=ft(v()),bt=e;xe=Q.default=(0,jt.default)((0,bt.jsx)("path",{d:"M12 5.99 19.53 19H4.47zM2.74 18c-.77 1.33.19 3 1.73 3h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0zM11 11v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1m0 5h2v2h-2z"}),"WarningAmberRounded");var ee={},wt=m;Object.defineProperty(ee,"__esModule",{value:!0});var ve=ee.default=void 0,yt=wt(v()),St=e;ve=ee.default=(0,yt.default)((0,St.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m-1-4h2v2h-2zm1.61-9.96c-2.06-.3-3.88.97-4.43 2.79-.18.58.26 1.17.87 1.17h.2c.41 0 .74-.29.88-.67.32-.89 1.27-1.5 2.3-1.28.95.2 1.65 1.13 1.57 2.1-.1 1.34-1.62 1.63-2.45 2.88 0 .01-.01.01-.01.02-.01.02-.02.03-.03.05-.09.15-.18.32-.25.5-.01.03-.03.05-.04.08-.01.02-.01.04-.02.07-.12.34-.2.75-.2 1.25h2c0-.42.11-.77.28-1.07.02-.03.03-.06.05-.09.08-.14.18-.27.28-.39.01-.01.02-.03.03-.04.1-.12.21-.23.33-.34.96-.91 2.26-1.65 1.99-3.56-.24-1.74-1.61-3.21-3.35-3.47"}),"HelpOutlineRounded");var te={},_t=m;Object.defineProperty(te,"__esModule",{value:!0});var me=te.default=void 0,$t=_t(v()),zt=e;me=te.default=(0,$t.default)((0,zt.jsx)("path",{d:"m17 8-1.41 1.41L17.17 11H9v2h8.17l-1.58 1.58L17 16l4-4zM5 5h7V3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h7v-2H5z"}),"LogoutOutlined");var re={},Ct=m;Object.defineProperty(re,"__esModule",{value:!0});var ge=re.default=void 0,kt=Ct(v()),Rt=e;ge=re.default=(0,kt.default)((0,Rt.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");const fe=["Asia/Kolkata (IST)","Asia/Dubai (GST)","UTC","America/New_York (EST)"],je=["English","हिन्दी (Hindi)","العربية (Arabic)"],ne={orgName:"Doormile Technologies",supportEmail:"support@doormile.in",contact:"+91 63749 46729",timezone:fe[0],language:je[0]},le={newClient:!0,contractStatus:!0,teamAccess:!1,databaseSync:!0,emailAlerts:!0,smsAlerts:!1},ce={currentPassword:"",newPassword:"",confirmPassword:"",twoFactor:!1},It=[{icon:F,label:"General",desc:"Organisation profile"},{icon:q,label:"Notifications",desc:"Alerts & channels"},{icon:Y,label:"Security",desc:"Password & 2FA"}],Mt=[{k:"newClient",t:"New client onboarded",d:"Notify when a new client is added to the system"},{k:"contractStatus",t:"Contract status",d:"When a client contract becomes active or expires"},{k:"teamAccess",t:"Team access",d:"When a new team member is granted or revoked access"},{k:"databaseSync",t:"Database sync",d:"Alerts for vector database synchronization events"}],Ot=[{label:"Too weak",color:"error"},{label:"Weak",color:"error"},{label:"Fair",color:"warning"},{label:"Good",color:"info"},{label:"Strong",color:"success"}],Pt=t=>{let r=0;return t.length>=8&&r++,/[a-z]/.test(t)&&/[A-Z]/.test(t)&&r++,/\d/.test(t)&&r++,/[^A-Za-z0-9]/.test(t)&&r++,r};function _({icon:t,title:r,subtitle:s,color:o="primary",danger:g=!1,children:d}){return e.jsxs(A,{sx:g?{borderColor:"error.light"}:void 0,children:[e.jsxs(l,{direction:"row",spacing:1.75,alignItems:"center",sx:{px:{xs:2,sm:3},py:2.25,borderBottom:1,borderColor:"divider",background:n=>`linear-gradient(90deg, ${n.palette[o].lighter}66 0%, ${n.palette.background.paper} 72%)`},children:[e.jsx(u,{sx:{width:40,height:40,borderRadius:2,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:`${o}.lighter`,color:`${o}.main`},children:e.jsx(t,{fontSize:"small"})}),e.jsxs(u,{sx:{minWidth:0},children:[e.jsx(x,{variant:"subtitle1",sx:{fontWeight:700,color:"grey.800",lineHeight:1.3},children:r}),s&&e.jsx(x,{variant:"caption",color:"text.secondary",children:s})]})]}),e.jsx(u,{sx:{px:{xs:2,sm:3}},children:d})]})}function p({label:t,description:r,children:s,align:o="center"}){return e.jsxs(C,{container:!0,spacing:2,alignItems:o,sx:{py:2.5,borderRadius:2,transition:"background-color .15s","&:hover":{bgcolor:"grey.50"}},children:[e.jsxs(C,{item:!0,xs:12,sm:5,children:[e.jsx(x,{variant:"subtitle2",sx:{fontWeight:600,color:"grey.800"},children:t}),r&&e.jsx(x,{variant:"caption",color:"text.secondary",children:r})]}),e.jsx(C,{item:!0,xs:12,sm:7,children:s})]})}const O={display:"flex",justifyContent:{sm:"flex-end"}};function V({label:t,value:r,onChange:s,autoComplete:o}){const[g,d]=w.useState(!1);return e.jsx($,{fullWidth:!0,size:"small",type:g?"text":"password",label:t,value:r,onChange:s,autoComplete:o,InputProps:{endAdornment:e.jsx(Le,{position:"end",children:e.jsx(Pe,{onClick:()=>d(n=>!n),edge:"end",size:"small",children:g?e.jsx(Ae,{fontSize:"small"}):e.jsx(Ne,{fontSize:"small"})})})}})}function Ft(){const[t,r]=w.useState(0),[s,o]=w.useState(!1),[g,d]=w.useState(!1),[n,S]=w.useState(ne),[y,R]=w.useState(le),[i,j]=w.useState(ce),b=a=>f=>{S(h=>({...h,[a]:f.target.value})),d(!0)},T=a=>f=>{R(h=>({...h,[a]:f.target.checked})),d(!0)},H=a=>f=>{j(h=>({...h,[a]:f.target.value})),d(!0)},be=()=>{o(!0),d(!1)},we=()=>{S(ne),R(le),j(ce),d(!1)},ae=Pt(i.newPassword),W=Ot[ae],ye=i.confirmPassword&&i.newPassword!==i.confirmPassword;return e.jsxs(e.Fragment,{children:[e.jsx(Te,{title:"Settings",breadcrumbs:[{label:"Settings"}],action:e.jsxs(l,{direction:"row",spacing:1.5,alignItems:"center",useFlexGap:!0,flexWrap:"wrap",sx:{width:{xs:"100%",sm:"auto"},justifyContent:{xs:"flex-start",sm:"flex-end"}},children:[g&&e.jsx(D,{size:"small",label:"Unsaved changes",sx:{bgcolor:"warning.lighter",color:"warning.dark",fontWeight:600}}),e.jsx(k,{variant:"outlined",onClick:we,sx:{flex:{xs:1,sm:"none"}},children:"Discard"}),e.jsx(k,{variant:"contained",startIcon:e.jsx(de,{}),onClick:be,sx:{flex:{xs:1,sm:"none"}},children:"Save Changes"})]})}),e.jsxs(C,{container:!0,spacing:2.5,children:[e.jsx(C,{item:!0,xs:12,md:3,children:e.jsxs(l,{spacing:2.5,sx:{position:{md:"sticky"},top:{md:88}},children:[e.jsxs(A,{sx:{p:1.5},children:[e.jsx(x,{variant:"overline",sx:{px:1,color:"text.secondary",fontWeight:700,letterSpacing:.6},children:"Preferences"}),e.jsx(l,{spacing:.25,sx:{mt:.5},children:It.map((a,f)=>{const h=t===f,Se=a.icon;return e.jsxs(l,{direction:"row",spacing:1.5,alignItems:"center",onClick:()=>r(f),sx:{px:1.5,py:1.25,borderRadius:2,cursor:"pointer",position:"relative",bgcolor:h?"primary.lighter":"transparent",transition:"background-color .15s","&:hover":{bgcolor:h?"primary.lighter":"grey.50"},"&::before":h?{content:'""',position:"absolute",left:0,top:9,bottom:9,width:3,borderRadius:3,bgcolor:"primary.main"}:{}},children:[e.jsx(u,{sx:{width:34,height:34,borderRadius:1.5,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:h?"primary.main":"grey.100",color:h?"#fff":"grey.600"},children:e.jsx(Se,{fontSize:"small"})}),e.jsxs(u,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(x,{variant:"subtitle2",sx:{fontWeight:600,color:h?"primary.main":"grey.800"},children:a.label}),e.jsx(x,{variant:"caption",color:"text.secondary",children:a.desc})]}),e.jsx(ge,{sx:{fontSize:18,color:h?"primary.main":"grey.300"}})]},a.label)})})]}),e.jsx(A,{sx:{p:2.5,bgcolor:"primary.lighter",borderColor:"primary.100"},children:e.jsxs(l,{spacing:1.25,children:[e.jsx(u,{sx:{width:38,height:38,borderRadius:2,bgcolor:"primary.main",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(ve,{fontSize:"small"})}),e.jsxs(u,{children:[e.jsx(x,{variant:"subtitle2",sx:{fontWeight:700,color:"primary.dark"},children:"Need a hand?"}),e.jsx(x,{variant:"caption",sx:{color:"primary.dark",opacity:.85},children:"Our team is available 24/7 for operational support."})]}),e.jsx(k,{size:"small",variant:"contained",sx:{alignSelf:"flex-start"},children:"Contact support"})]})})]})}),e.jsxs(C,{item:!0,xs:12,md:9,children:[t===0&&e.jsxs(l,{spacing:2.5,children:[e.jsx(A,{sx:{overflow:"hidden"},children:e.jsxs(l,{direction:{xs:"column",sm:"row"},spacing:2.5,alignItems:{sm:"center"},sx:{p:3,background:a=>`linear-gradient(90deg, ${a.palette.primary.lighter}88 0%, ${a.palette.background.paper} 75%)`},children:[e.jsx(Oe,{variant:"rounded",sx:{width:64,height:64,bgcolor:"primary.main",color:"#fff"},children:e.jsx(he,{})}),e.jsxs(u,{sx:{flexGrow:1,minWidth:0},children:[e.jsxs(l,{direction:"row",spacing:1,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:[e.jsx(x,{variant:"h5",sx:{fontWeight:700,color:"grey.800"},children:n.orgName}),e.jsx(D,{size:"small",icon:e.jsx(pe,{sx:{fontSize:15,ml:.5}}),label:"Verified",sx:{fontWeight:700,bgcolor:"success.lighter",color:"success.dark","& .MuiChip-icon":{color:"inherit"}}})]}),e.jsxs(x,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:[n.supportEmail," · ",n.contact]})]}),e.jsx(k,{variant:"outlined",size:"small",children:"Change logo"})]})}),e.jsx(_,{icon:F,title:"Organisation",subtitle:"Profile and regional preferences",color:"primary",children:e.jsxs(l,{divider:e.jsx(I,{}),children:[e.jsx(p,{label:"Organisation name",description:"Shown on invoices and exports",children:e.jsx($,{fullWidth:!0,size:"small",value:n.orgName,onChange:b("orgName")})}),e.jsx(p,{label:"Support email",description:"Where customer replies are routed",children:e.jsx($,{fullWidth:!0,size:"small",value:n.supportEmail,onChange:b("supportEmail")})}),e.jsx(p,{label:"Contact number",description:"Primary operations line",children:e.jsx($,{fullWidth:!0,size:"small",value:n.contact,onChange:b("contact")})}),e.jsx(p,{label:"Timezone",description:"Used for schedules and reports",children:e.jsx($,{select:!0,fullWidth:!0,size:"small",value:n.timezone,onChange:b("timezone"),children:fe.map(a=>e.jsx(ie,{value:a,children:a},a))})}),e.jsx(p,{label:"Language",description:"Console display language",children:e.jsx($,{select:!0,fullWidth:!0,size:"small",value:n.language,onChange:b("language"),children:je.map(a=>e.jsx(ie,{value:a,children:a},a))})})]})})]}),t===1&&e.jsxs(l,{spacing:2.5,children:[e.jsx(_,{icon:q,title:"Notification Preferences",subtitle:"Choose what you get alerted about",color:"primary",children:e.jsx(l,{divider:e.jsx(I,{}),children:Mt.map(a=>e.jsx(p,{label:a.t,description:a.d,children:e.jsx(u,{sx:O,children:e.jsx(M,{checked:y[a.k],onChange:T(a.k)})})},a.k))})}),e.jsx(_,{icon:ue,title:"Delivery Channels",subtitle:"How alerts reach your team",color:"primary",children:e.jsxs(l,{divider:e.jsx(I,{}),children:[e.jsx(p,{label:"Email alerts",description:"Send notifications to the support inbox",children:e.jsx(u,{sx:O,children:e.jsx(M,{checked:y.emailAlerts,onChange:T("emailAlerts")})})}),e.jsx(p,{label:"SMS alerts",description:"Send notifications to the registered mobile",children:e.jsx(u,{sx:O,children:e.jsx(M,{checked:y.smsAlerts,onChange:T("smsAlerts")})})})]})})]}),t===2&&e.jsxs(l,{spacing:2.5,children:[e.jsx(_,{icon:Y,title:"Change Password",subtitle:"Use 8+ characters with a mix of letters, numbers & symbols",color:"primary",children:e.jsxs(l,{divider:e.jsx(I,{}),children:[e.jsx(p,{label:"Current password",description:"Enter your existing password",align:"flex-start",children:e.jsx(V,{label:"Current password",value:i.currentPassword,onChange:H("currentPassword"),autoComplete:"current-password"})}),e.jsx(p,{label:"New password",description:"Choose a strong, unique password",align:"flex-start",children:e.jsxs(u,{children:[e.jsx(V,{label:"New password",value:i.newPassword,onChange:H("newPassword"),autoComplete:"new-password"}),i.newPassword&&e.jsxs(l,{direction:"row",spacing:1.5,alignItems:"center",sx:{mt:1},children:[e.jsx(De,{variant:"determinate",value:ae/4*100,color:W.color,sx:{flexGrow:1,height:6,borderRadius:3}}),e.jsx(x,{variant:"caption",sx:{fontWeight:700,color:`${W.color}.main`,minWidth:56},children:W.label})]})]})}),e.jsx(p,{label:"Confirm new password",description:"Re-enter the new password",align:"flex-start",children:e.jsxs(u,{children:[e.jsx(V,{label:"Confirm new password",value:i.confirmPassword,onChange:H("confirmPassword"),autoComplete:"new-password"}),ye&&e.jsx(x,{variant:"caption",color:"error.main",sx:{mt:.75,display:"block"},children:"Passwords do not match"})]})})]})}),e.jsx(_,{icon:L,title:"Two-Factor Authentication",subtitle:"Add an extra layer of security to your account",color:"primary",children:e.jsx(p,{label:"Authenticator app",description:"Require a one-time code at sign-in for extra security",children:e.jsxs(l,{direction:"row",spacing:1.5,alignItems:"center",sx:{justifyContent:{sm:"flex-end"}},children:[e.jsx(D,{size:"small",icon:e.jsx(L,{sx:{fontSize:15,ml:.5}}),label:i.twoFactor?"Enabled":"Disabled",sx:{fontWeight:700,bgcolor:i.twoFactor?"success.lighter":"grey.100",color:i.twoFactor?"success.dark":"grey.600","& .MuiChip-icon":{color:"inherit"}}}),e.jsx(M,{checked:i.twoFactor,onChange:a=>{j(f=>({...f,twoFactor:a.target.checked})),d(!0)}})]})})}),e.jsx(_,{icon:xe,title:"Danger Zone",subtitle:"Irreversible and high-impact actions",color:"error",danger:!0,children:e.jsx(p,{label:"Sign out of all sessions",description:"End every active session on all devices",children:e.jsx(u,{sx:O,children:e.jsx(k,{variant:"outlined",color:"error",startIcon:e.jsx(me,{}),onClick:()=>{localStorage.removeItem("auth_token"),window.location.href="/login"},children:"Sign out everywhere"})})})})]})]})]}),e.jsx(Ve,{open:s,autoHideDuration:2500,onClose:()=>o(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:e.jsx(He,{severity:"success",variant:"filled",onClose:()=>o(!1),sx:{width:"100%"},children:"Settings saved successfully."})})]})}export{Ft as default}; +import{x as _e,y as $e,b as w,z as ze,E as Ce,_ as P,j as e,F as ke,G as z,H as Re,J as N,ac as Ie,ad as Me,O as se,r as v,i as m,S as l,T as x,B as u,A as Oe,M as ie,D as I,I as Pe}from"./index-D7LVXeIK.js";import{d as Ae,a as Ne}from"./VisibilityOff-DxGE-YKE.js";import{P as Te,C as D,G as C,A as He}from"./PageHeader-naLAT9xr.js";import{B as k}from"./Button-Bqp5awT1.js";import{C as A}from"./Link-BEif5YS2.js";import{T as $}from"./TextField-Sd_pshci.js";import{S as We}from"./SwitchBase-CWj2k0Bo.js";import{L as De}from"./LinearProgress-yV9HNsZU.js";import{S as Ve}from"./Snackbar-DOheZfWW.js";import{I as Le}from"./InputAdornment-CMIlL2rx.js";function Ee(t){return _e("MuiSwitch",t)}const c=$e("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),Be=["className","color","edge","size","sx"],Fe=t=>{const{classes:r,edge:s,size:o,color:g,checked:d,disabled:n}=t,S={root:["root",s&&`edge${z(s)}`,`size${z(o)}`],switchBase:["switchBase",`color${z(g)}`,d&&"checked",n&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},y=Re(S,Ee,r);return P({},r,y)},Ge=N("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,r)=>{const{ownerState:s}=t;return[r.root,s.edge&&r[`edge${z(s.edge)}`],r[`size${z(s.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${c.thumb}`]:{width:16,height:16},[`& .${c.switchBase}`]:{padding:4,[`&.${c.checked}`]:{transform:"translateX(16px)"}}}}]}),qe=N(We,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,r)=>{const{ownerState:s}=t;return[r.switchBase,{[`& .${c.input}`]:r.input},s.color!=="default"&&r[`color${z(s.color)}`]]}})(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${c.checked}`]:{transform:"translateX(20px)"},[`&.${c.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${c.checked} + .${c.track}`]:{opacity:.5},[`&.${c.disabled} + .${c.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${c.input}`]:{left:"-100%",width:"300%"}}),({theme:t})=>({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:se(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(t.palette).filter(([,r])=>r.main&&r.light).map(([r])=>({props:{color:r},style:{[`&.${c.checked}`]:{color:(t.vars||t).palette[r].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[r].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:se(t.palette[r].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${c.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${r}DisabledColor`]:`${t.palette.mode==="light"?Ie(t.palette[r].main,.62):Me(t.palette[r].main,.55)}`}},[`&.${c.checked} + .${c.track}`]:{backgroundColor:(t.vars||t).palette[r].main}}}))]})),Ue=N("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,r)=>r.track})(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`})),Ye=N("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,r)=>r.thumb})(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),M=w.forwardRef(function(r,s){const o=ze({props:r,name:"MuiSwitch"}),{className:g,color:d="primary",edge:n=!1,size:S="medium",sx:y}=o,R=Ce(o,Be),i=P({},o,{color:d,edge:n,size:S}),j=Fe(i),b=e.jsx(Ye,{className:j.thumb,ownerState:i});return e.jsxs(Ge,{className:ke(j.root,g),sx:y,ownerState:i,children:[e.jsx(qe,P({type:"checkbox",icon:b,checkedIcon:b,ref:s,ownerState:i},R,{classes:P({},j,{root:j.switchBase})})),e.jsx(Ue,{className:j.track,ownerState:i})]})});var E={},Ze=m;Object.defineProperty(E,"__esModule",{value:!0});var de=E.default=void 0,Xe=Ze(v()),Je=e;de=E.default=(0,Xe.default)((0,Je.jsx)("path",{d:"M17 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V7zm2 16H5V5h11.17L19 7.83zm-7-7c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3M6 6h9v4H6z"}),"SaveOutlined");var B={},Ke=m;Object.defineProperty(B,"__esModule",{value:!0});var F=B.default=void 0,Qe=Ke(v()),et=e;F=B.default=(0,Qe.default)((0,et.jsx)("path",{d:"M3 17v2h6v-2zM3 5v2h10V5zm10 16v-2h8v-2h-8v-2h-2v6zM7 9v2H3v2h4v2h2V9zm14 4v-2H11v2zm-6-4h2V7h4V5h-4V3h-2z"}),"TuneOutlined");var G={},tt=m;Object.defineProperty(G,"__esModule",{value:!0});var q=G.default=void 0,rt=tt(v()),at=e;q=G.default=(0,rt.default)((0,at.jsx)("path",{d:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2m6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5z"}),"NotificationsNone");var U={},st=m;Object.defineProperty(U,"__esModule",{value:!0});var Y=U.default=void 0,it=st(v()),ot=e;Y=U.default=(0,it.default)((0,ot.jsx)("path",{d:"M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2M9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9zm9 14H6V10h12zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2"}),"LockOutlined");var Z={},nt=m;Object.defineProperty(Z,"__esModule",{value:!0});var L=Z.default=void 0,lt=nt(v()),ct=e;L=Z.default=(0,lt.default)((0,ct.jsx)("path",{d:"M12 2 4 5v6.09c0 5.05 3.41 9.76 8 10.91 4.59-1.15 8-5.86 8-10.91V5zm6 9.09c0 4-2.55 7.7-6 8.83-3.45-1.13-6-4.82-6-8.83v-4.7l6-2.25 6 2.25z"}),"ShieldOutlined");var X={},dt=m;Object.defineProperty(X,"__esModule",{value:!0});var ue=X.default=void 0,ut=dt(v()),ht=e;ue=X.default=(0,ut.default)((0,ht.jsx)("path",{d:"M18 11v2h4v-2zm-2 6.61c.96.71 2.21 1.65 3.2 2.39.4-.53.8-1.07 1.2-1.6-.99-.74-2.24-1.68-3.2-2.4-.4.54-.8 1.08-1.2 1.61M20.4 5.6c-.4-.53-.8-1.07-1.2-1.6-.99.74-2.24 1.68-3.2 2.4.4.53.8 1.07 1.2 1.6.96-.72 2.21-1.65 3.2-2.4M4 9c-1.1 0-2 .9-2 2v2c0 1.1.9 2 2 2h1v4h2v-4h1l5 3V6L8 9zm5.03 1.71L11 9.53v4.94l-1.97-1.18-.48-.29H4v-2h4.55zM15.5 12c0-1.33-.58-2.53-1.5-3.35v6.69c.92-.81 1.5-2.01 1.5-3.34"}),"CampaignOutlined");var J={},pt=m;Object.defineProperty(J,"__esModule",{value:!0});var he=J.default=void 0,xt=pt(v()),vt=e;he=J.default=(0,xt.default)((0,vt.jsx)("path",{d:"M12 7V3H2v18h20V7zM6 19H4v-2h2zm0-4H4v-2h2zm0-4H4V9h2zm0-4H4V5h2zm4 12H8v-2h2zm0-4H8v-2h2zm0-4H8V9h2zm0-4H8V5h2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8zm-2-8h-2v2h2zm0 4h-2v2h2z"}),"BusinessOutlined");var K={},mt=m;Object.defineProperty(K,"__esModule",{value:!0});var pe=K.default=void 0,gt=mt(v()),oe=e;pe=K.default=(0,gt.default)([(0,oe.jsx)("path",{d:"M23 11.99 20.56 9.2l.34-3.69-3.61-.82L15.4 1.5 12 2.96 8.6 1.5 6.71 4.69 3.1 5.5l.34 3.7L1 11.99l2.44 2.79-.34 3.7 3.61.82 1.89 3.2 3.4-1.47 3.4 1.46 1.89-3.19 3.61-.82-.34-3.69zm-3.95 1.48-.56.65.08.85.18 1.95-1.9.43-.84.19-.44.74-.99 1.68-1.78-.77-.8-.34-.79.34-1.78.77-.99-1.67-.44-.74-.84-.19-1.9-.43.18-1.96.08-.85-.56-.65L3.67 12l1.29-1.48.56-.65-.09-.86-.18-1.94 1.9-.43.84-.19.44-.74.99-1.68 1.78.77.8.34.79-.34 1.78-.77.99 1.68.44.74.84.19 1.9.43-.18 1.95-.08.85.56.65 1.29 1.47z"},"0"),(0,oe.jsx)("path",{d:"m10.09 13.75-2.32-2.33-1.48 1.49 3.8 3.81 7.34-7.36-1.48-1.49z"},"1")],"VerifiedOutlined");var Q={},ft=m;Object.defineProperty(Q,"__esModule",{value:!0});var xe=Q.default=void 0,jt=ft(v()),bt=e;xe=Q.default=(0,jt.default)((0,bt.jsx)("path",{d:"M12 5.99 19.53 19H4.47zM2.74 18c-.77 1.33.19 3 1.73 3h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0zM11 11v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1m0 5h2v2h-2z"}),"WarningAmberRounded");var ee={},wt=m;Object.defineProperty(ee,"__esModule",{value:!0});var ve=ee.default=void 0,yt=wt(v()),St=e;ve=ee.default=(0,yt.default)((0,St.jsx)("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m-1-4h2v2h-2zm1.61-9.96c-2.06-.3-3.88.97-4.43 2.79-.18.58.26 1.17.87 1.17h.2c.41 0 .74-.29.88-.67.32-.89 1.27-1.5 2.3-1.28.95.2 1.65 1.13 1.57 2.1-.1 1.34-1.62 1.63-2.45 2.88 0 .01-.01.01-.01.02-.01.02-.02.03-.03.05-.09.15-.18.32-.25.5-.01.03-.03.05-.04.08-.01.02-.01.04-.02.07-.12.34-.2.75-.2 1.25h2c0-.42.11-.77.28-1.07.02-.03.03-.06.05-.09.08-.14.18-.27.28-.39.01-.01.02-.03.03-.04.1-.12.21-.23.33-.34.96-.91 2.26-1.65 1.99-3.56-.24-1.74-1.61-3.21-3.35-3.47"}),"HelpOutlineRounded");var te={},_t=m;Object.defineProperty(te,"__esModule",{value:!0});var me=te.default=void 0,$t=_t(v()),zt=e;me=te.default=(0,$t.default)((0,zt.jsx)("path",{d:"m17 8-1.41 1.41L17.17 11H9v2h8.17l-1.58 1.58L17 16l4-4zM5 5h7V3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h7v-2H5z"}),"LogoutOutlined");var re={},Ct=m;Object.defineProperty(re,"__esModule",{value:!0});var ge=re.default=void 0,kt=Ct(v()),Rt=e;ge=re.default=(0,kt.default)((0,Rt.jsx)("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight");const fe=["Asia/Kolkata (IST)","Asia/Dubai (GST)","UTC","America/New_York (EST)"],je=["English","हिन्दी (Hindi)","العربية (Arabic)"],ne={orgName:"Doormile Technologies",supportEmail:"support@doormile.in",contact:"+91 63749 46729",timezone:fe[0],language:je[0]},le={newClient:!0,contractStatus:!0,teamAccess:!1,databaseSync:!0,emailAlerts:!0,smsAlerts:!1},ce={currentPassword:"",newPassword:"",confirmPassword:"",twoFactor:!1},It=[{icon:F,label:"General",desc:"Organisation profile"},{icon:q,label:"Notifications",desc:"Alerts & channels"},{icon:Y,label:"Security",desc:"Password & 2FA"}],Mt=[{k:"newClient",t:"New client onboarded",d:"Notify when a new client is added to the system"},{k:"contractStatus",t:"Contract status",d:"When a client contract becomes active or expires"},{k:"teamAccess",t:"Team access",d:"When a new team member is granted or revoked access"},{k:"databaseSync",t:"Database sync",d:"Alerts for vector database synchronization events"}],Ot=[{label:"Too weak",color:"error"},{label:"Weak",color:"error"},{label:"Fair",color:"warning"},{label:"Good",color:"info"},{label:"Strong",color:"success"}],Pt=t=>{let r=0;return t.length>=8&&r++,/[a-z]/.test(t)&&/[A-Z]/.test(t)&&r++,/\d/.test(t)&&r++,/[^A-Za-z0-9]/.test(t)&&r++,r};function _({icon:t,title:r,subtitle:s,color:o="primary",danger:g=!1,children:d}){return e.jsxs(A,{sx:g?{borderColor:"error.light"}:void 0,children:[e.jsxs(l,{direction:"row",spacing:1.75,alignItems:"center",sx:{px:{xs:2,sm:3},py:2,borderBottom:1,borderColor:"divider",background:n=>`linear-gradient(90deg, ${n.palette[o].lighter}66 0%, ${n.palette.background.paper} 72%)`},children:[e.jsx(u,{sx:{width:40,height:40,borderRadius:2,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:`${o}.lighter`,color:`${o}.main`},children:e.jsx(t,{fontSize:"small"})}),e.jsxs(u,{sx:{minWidth:0},children:[e.jsx(x,{variant:"subtitle1",sx:{fontWeight:700,color:"grey.800",lineHeight:1.3},children:r}),s&&e.jsx(x,{variant:"caption",color:"text.secondary",children:s})]})]}),e.jsx(u,{sx:{px:{xs:2,sm:3}},children:d})]})}function p({label:t,description:r,children:s,align:o="center"}){return e.jsxs(C,{container:!0,spacing:2,alignItems:o,sx:{py:2.5,borderRadius:2,transition:"background-color .15s","&:hover":{bgcolor:"grey.50"}},children:[e.jsxs(C,{item:!0,xs:12,sm:5,children:[e.jsx(x,{variant:"subtitle2",sx:{fontWeight:600,color:"grey.800"},children:t}),r&&e.jsx(x,{variant:"caption",color:"text.secondary",children:r})]}),e.jsx(C,{item:!0,xs:12,sm:7,children:s})]})}const O={display:"flex",justifyContent:{sm:"flex-end"}};function V({label:t,value:r,onChange:s,autoComplete:o}){const[g,d]=w.useState(!1);return e.jsx($,{fullWidth:!0,size:"small",type:g?"text":"password",label:t,value:r,onChange:s,autoComplete:o,InputProps:{endAdornment:e.jsx(Le,{position:"end",children:e.jsx(Pe,{onClick:()=>d(n=>!n),edge:"end",size:"small",children:g?e.jsx(Ae,{fontSize:"small"}):e.jsx(Ne,{fontSize:"small"})})})}})}function Ft(){const[t,r]=w.useState(0),[s,o]=w.useState(!1),[g,d]=w.useState(!1),[n,S]=w.useState(ne),[y,R]=w.useState(le),[i,j]=w.useState(ce),b=a=>f=>{S(h=>({...h,[a]:f.target.value})),d(!0)},T=a=>f=>{R(h=>({...h,[a]:f.target.checked})),d(!0)},H=a=>f=>{j(h=>({...h,[a]:f.target.value})),d(!0)},be=()=>{o(!0),d(!1)},we=()=>{S(ne),R(le),j(ce),d(!1)},ae=Pt(i.newPassword),W=Ot[ae],ye=i.confirmPassword&&i.newPassword!==i.confirmPassword;return e.jsxs(e.Fragment,{children:[e.jsx(Te,{title:"Settings",breadcrumbs:[{label:"Settings"}],action:e.jsxs(l,{direction:"row",spacing:1.5,alignItems:"center",useFlexGap:!0,flexWrap:"wrap",sx:{width:{xs:"100%",sm:"auto"},justifyContent:{xs:"flex-start",sm:"flex-end"}},children:[g&&e.jsx(D,{size:"small",label:"Unsaved changes",sx:{bgcolor:"warning.lighter",color:"warning.dark",fontWeight:600}}),e.jsx(k,{variant:"outlined",onClick:we,sx:{flex:{xs:1,sm:"none"}},children:"Discard"}),e.jsx(k,{variant:"contained",startIcon:e.jsx(de,{}),onClick:be,sx:{flex:{xs:1,sm:"none"}},children:"Save Changes"})]})}),e.jsxs(C,{container:!0,spacing:2.5,children:[e.jsx(C,{item:!0,xs:12,md:3,children:e.jsxs(l,{spacing:2.5,sx:{position:{md:"sticky"},top:{md:88}},children:[e.jsxs(A,{sx:{p:2},children:[e.jsx(x,{variant:"overline",sx:{px:1,color:"text.secondary",fontWeight:700,letterSpacing:.6},children:"Preferences"}),e.jsx(l,{spacing:.25,sx:{mt:.5},children:It.map((a,f)=>{const h=t===f,Se=a.icon;return e.jsxs(l,{direction:"row",spacing:1.5,alignItems:"center",onClick:()=>r(f),sx:{px:1.5,py:1.5,borderRadius:2,cursor:"pointer",position:"relative",bgcolor:h?"primary.lighter":"transparent",transition:"background-color .15s","&:hover":{bgcolor:h?"primary.lighter":"grey.50"},"&::before":h?{content:'""',position:"absolute",left:0,top:9,bottom:9,width:3,borderRadius:3,bgcolor:"primary.main"}:{}},children:[e.jsx(u,{sx:{width:34,height:34,borderRadius:1.5,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:h?"primary.main":"grey.100",color:h?"#fff":"grey.600"},children:e.jsx(Se,{fontSize:"small"})}),e.jsxs(u,{sx:{flexGrow:1,minWidth:0},children:[e.jsx(x,{variant:"subtitle2",sx:{fontWeight:600,color:h?"primary.main":"grey.800"},children:a.label}),e.jsx(x,{variant:"caption",color:"text.secondary",children:a.desc})]}),e.jsx(ge,{sx:{fontSize:18,color:h?"primary.main":"grey.300"}})]},a.label)})})]}),e.jsx(A,{sx:{p:2,bgcolor:"primary.lighter",borderColor:"primary.100"},children:e.jsxs(l,{spacing:1.25,children:[e.jsx(u,{sx:{width:38,height:38,borderRadius:2,bgcolor:"primary.main",color:"#fff",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(ve,{fontSize:"small"})}),e.jsxs(u,{children:[e.jsx(x,{variant:"subtitle2",sx:{fontWeight:700,color:"primary.dark"},children:"Need a hand?"}),e.jsx(x,{variant:"caption",sx:{color:"primary.dark",opacity:.85},children:"Our team is available 24/7 for operational support."})]}),e.jsx(k,{size:"small",variant:"contained",sx:{alignSelf:"flex-start"},children:"Contact support"})]})})]})}),e.jsxs(C,{item:!0,xs:12,md:9,children:[t===0&&e.jsxs(l,{spacing:2.5,children:[e.jsx(A,{sx:{overflow:"hidden"},children:e.jsxs(l,{direction:{xs:"column",sm:"row"},spacing:2.5,alignItems:{sm:"center"},sx:{p:3,background:a=>`linear-gradient(90deg, ${a.palette.primary.lighter}88 0%, ${a.palette.background.paper} 75%)`},children:[e.jsx(Oe,{variant:"rounded",sx:{width:64,height:64,bgcolor:"primary.main",color:"#fff"},children:e.jsx(he,{})}),e.jsxs(u,{sx:{flexGrow:1,minWidth:0},children:[e.jsxs(l,{direction:"row",spacing:1,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:[e.jsx(x,{variant:"h5",sx:{fontWeight:700,color:"grey.800"},children:n.orgName}),e.jsx(D,{size:"small",icon:e.jsx(pe,{sx:{fontSize:15,ml:.5}}),label:"Verified",sx:{fontWeight:700,bgcolor:"success.lighter",color:"success.dark","& .MuiChip-icon":{color:"inherit"}}})]}),e.jsxs(x,{variant:"body2",color:"text.secondary",sx:{mt:.25},children:[n.supportEmail," · ",n.contact]})]}),e.jsx(k,{variant:"outlined",size:"small",children:"Change logo"})]})}),e.jsx(_,{icon:F,title:"Organisation",subtitle:"Profile and regional preferences",color:"primary",children:e.jsxs(l,{divider:e.jsx(I,{}),children:[e.jsx(p,{label:"Organisation name",description:"Shown on invoices and exports",children:e.jsx($,{fullWidth:!0,size:"small",value:n.orgName,onChange:b("orgName")})}),e.jsx(p,{label:"Support email",description:"Where customer replies are routed",children:e.jsx($,{fullWidth:!0,size:"small",value:n.supportEmail,onChange:b("supportEmail")})}),e.jsx(p,{label:"Contact number",description:"Primary operations line",children:e.jsx($,{fullWidth:!0,size:"small",value:n.contact,onChange:b("contact")})}),e.jsx(p,{label:"Timezone",description:"Used for schedules and reports",children:e.jsx($,{select:!0,fullWidth:!0,size:"small",value:n.timezone,onChange:b("timezone"),children:fe.map(a=>e.jsx(ie,{value:a,children:a},a))})}),e.jsx(p,{label:"Language",description:"Console display language",children:e.jsx($,{select:!0,fullWidth:!0,size:"small",value:n.language,onChange:b("language"),children:je.map(a=>e.jsx(ie,{value:a,children:a},a))})})]})})]}),t===1&&e.jsxs(l,{spacing:2.5,children:[e.jsx(_,{icon:q,title:"Notification Preferences",subtitle:"Choose what you get alerted about",color:"primary",children:e.jsx(l,{divider:e.jsx(I,{}),children:Mt.map(a=>e.jsx(p,{label:a.t,description:a.d,children:e.jsx(u,{sx:O,children:e.jsx(M,{checked:y[a.k],onChange:T(a.k)})})},a.k))})}),e.jsx(_,{icon:ue,title:"Delivery Channels",subtitle:"How alerts reach your team",color:"primary",children:e.jsxs(l,{divider:e.jsx(I,{}),children:[e.jsx(p,{label:"Email alerts",description:"Send notifications to the support inbox",children:e.jsx(u,{sx:O,children:e.jsx(M,{checked:y.emailAlerts,onChange:T("emailAlerts")})})}),e.jsx(p,{label:"SMS alerts",description:"Send notifications to the registered mobile",children:e.jsx(u,{sx:O,children:e.jsx(M,{checked:y.smsAlerts,onChange:T("smsAlerts")})})})]})})]}),t===2&&e.jsxs(l,{spacing:2.5,children:[e.jsx(_,{icon:Y,title:"Change Password",subtitle:"Use 8+ characters with a mix of letters, numbers & symbols",color:"primary",children:e.jsxs(l,{divider:e.jsx(I,{}),children:[e.jsx(p,{label:"Current password",description:"Enter your existing password",align:"flex-start",children:e.jsx(V,{label:"Current password",value:i.currentPassword,onChange:H("currentPassword"),autoComplete:"current-password"})}),e.jsx(p,{label:"New password",description:"Choose a strong, unique password",align:"flex-start",children:e.jsxs(u,{children:[e.jsx(V,{label:"New password",value:i.newPassword,onChange:H("newPassword"),autoComplete:"new-password"}),i.newPassword&&e.jsxs(l,{direction:"row",spacing:1.5,alignItems:"center",sx:{mt:1},children:[e.jsx(De,{variant:"determinate",value:ae/4*100,color:W.color,sx:{flexGrow:1,height:6,borderRadius:3}}),e.jsx(x,{variant:"caption",sx:{fontWeight:700,color:`${W.color}.main`,minWidth:56},children:W.label})]})]})}),e.jsx(p,{label:"Confirm new password",description:"Re-enter the new password",align:"flex-start",children:e.jsxs(u,{children:[e.jsx(V,{label:"Confirm new password",value:i.confirmPassword,onChange:H("confirmPassword"),autoComplete:"new-password"}),ye&&e.jsx(x,{variant:"caption",color:"error.main",sx:{mt:.75,display:"block"},children:"Passwords do not match"})]})})]})}),e.jsx(_,{icon:L,title:"Two-Factor Authentication",subtitle:"Add an extra layer of security to your account",color:"primary",children:e.jsx(p,{label:"Authenticator app",description:"Require a one-time code at sign-in for extra security",children:e.jsxs(l,{direction:"row",spacing:1.5,alignItems:"center",sx:{justifyContent:{sm:"flex-end"}},children:[e.jsx(D,{size:"small",icon:e.jsx(L,{sx:{fontSize:15,ml:.5}}),label:i.twoFactor?"Enabled":"Disabled",sx:{fontWeight:700,bgcolor:i.twoFactor?"success.lighter":"grey.100",color:i.twoFactor?"success.dark":"grey.600","& .MuiChip-icon":{color:"inherit"}}}),e.jsx(M,{checked:i.twoFactor,onChange:a=>{j(f=>({...f,twoFactor:a.target.checked})),d(!0)}})]})})}),e.jsx(_,{icon:xe,title:"Danger Zone",subtitle:"Irreversible and high-impact actions",color:"error",danger:!0,children:e.jsx(p,{label:"Sign out of all sessions",description:"End every active session on all devices",children:e.jsx(u,{sx:O,children:e.jsx(k,{variant:"outlined",color:"error",startIcon:e.jsx(me,{}),onClick:()=>{localStorage.removeItem("auth_token"),window.location.href="/login"},children:"Sign out everywhere"})})})})]})]})]}),e.jsx(Ve,{open:s,autoHideDuration:2500,onClose:()=>o(!1),anchorOrigin:{vertical:"bottom",horizontal:"center"},children:e.jsx(He,{severity:"success",variant:"filled",onClose:()=>o(!1),sx:{width:"100%"},children:"Settings saved successfully."})})]})}export{Ft as default}; diff --git a/dist/assets/Snackbar-B0wJYiYQ.js b/dist/assets/Snackbar-DOheZfWW.js similarity index 98% rename from dist/assets/Snackbar-B0wJYiYQ.js rename to dist/assets/Snackbar-DOheZfWW.js index 9feeb29..16a9f72 100644 --- a/dist/assets/Snackbar-B0wJYiYQ.js +++ b/dist/assets/Snackbar-DOheZfWW.js @@ -1 +1 @@ -import{ag as q,b as h,v as R,_ as c,ah as T,x as z,y as B,z as H,E as M,j as b,F as J,H as A,J as k,P as X,ai as Q,u as V,aj as Y,a3 as Z,ak as nn,G as C}from"./index-DpAn5wLF.js";function en(n={}){const{autoHideDuration:e=null,disableWindowBlurListener:s=!1,onClose:r,open:i,resumeHideDuration:g}=n,u=q();h.useEffect(()=>{if(!i)return;function o(t){t.defaultPrevented||(t.key==="Escape"||t.key==="Esc")&&(r==null||r(t,"escapeKeyDown"))}return document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o)}},[i,r]);const m=R((o,t)=>{r==null||r(o,t)}),d=R(o=>{!r||o==null||u.start(o,()=>{m(null,"timeout")})});h.useEffect(()=>(i&&d(e),u.clear),[i,e,d,u]);const p=o=>{r==null||r(o,"clickaway")},l=u.clear,f=h.useCallback(()=>{e!=null&&d(g??e*.5)},[e,g,d]),x=o=>t=>{const a=o.onBlur;a==null||a(t),f()},v=o=>t=>{const a=o.onFocus;a==null||a(t),l()},y=o=>t=>{const a=o.onMouseEnter;a==null||a(t),l()},E=o=>t=>{const a=o.onMouseLeave;a==null||a(t),f()};return h.useEffect(()=>{if(!s&&i)return window.addEventListener("focus",f),window.addEventListener("blur",l),()=>{window.removeEventListener("focus",f),window.removeEventListener("blur",l)}},[s,i,f,l]),{getRootProps:(o={})=>{const t=c({},T(n),T(o));return c({role:"presentation"},o,t,{onBlur:x(t),onFocus:v(t),onMouseEnter:y(t),onMouseLeave:E(t)})},onClickAway:p}}function on(n){return z("MuiSnackbarContent",n)}B("MuiSnackbarContent",["root","message","action"]);const tn=["action","className","message","role"],rn=n=>{const{classes:e}=n;return A({root:["root"],action:["action"],message:["message"]},on,e)},sn=k(X,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(n,e)=>e.root})(({theme:n})=>{const e=n.palette.mode==="light"?.8:.98,s=Q(n.palette.background.default,e);return c({},n.typography.body2,{color:n.vars?n.vars.palette.SnackbarContent.color:n.palette.getContrastText(s),backgroundColor:n.vars?n.vars.palette.SnackbarContent.bg:s,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(n.vars||n).shape.borderRadius,flexGrow:1,[n.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}})}),an=k("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(n,e)=>e.message})({padding:"8px 0"}),cn=k("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(n,e)=>e.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),ln=h.forwardRef(function(e,s){const r=H({props:e,name:"MuiSnackbarContent"}),{action:i,className:g,message:u,role:m="alert"}=r,d=M(r,tn),p=r,l=rn(p);return b.jsxs(sn,c({role:m,square:!0,elevation:6,className:J(l.root,g),ownerState:p,ref:s},d,{children:[b.jsx(an,{className:l.message,ownerState:p,children:u}),i?b.jsx(cn,{className:l.action,ownerState:p,children:i}):null]}))});function un(n){return z("MuiSnackbar",n)}B("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const dn=["onEnter","onExited"],pn=["action","anchorOrigin","autoHideDuration","children","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onBlur","onClose","onFocus","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"],gn=n=>{const{classes:e,anchorOrigin:s}=n,r={root:["root",`anchorOrigin${C(s.vertical)}${C(s.horizontal)}`]};return A(r,un,e)},j=k("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:s}=n;return[e.root,e[`anchorOrigin${C(s.anchorOrigin.vertical)}${C(s.anchorOrigin.horizontal)}`]]}})(({theme:n,ownerState:e})=>{const s={left:"50%",right:"auto",transform:"translateX(-50%)"};return c({zIndex:(n.vars||n).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center"},e.anchorOrigin.vertical==="top"?{top:8}:{bottom:8},e.anchorOrigin.horizontal==="left"&&{justifyContent:"flex-start"},e.anchorOrigin.horizontal==="right"&&{justifyContent:"flex-end"},{[n.breakpoints.up("sm")]:c({},e.anchorOrigin.vertical==="top"?{top:24}:{bottom:24},e.anchorOrigin.horizontal==="center"&&s,e.anchorOrigin.horizontal==="left"&&{left:24,right:"auto"},e.anchorOrigin.horizontal==="right"&&{right:24,left:"auto"})})}),hn=h.forwardRef(function(e,s){const r=H({props:e,name:"MuiSnackbar"}),i=V(),g={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{action:u,anchorOrigin:{vertical:m,horizontal:d}={vertical:"bottom",horizontal:"left"},autoHideDuration:p=null,children:l,className:f,ClickAwayListenerProps:x,ContentProps:v,disableWindowBlurListener:y=!1,message:E,open:w,TransitionComponent:o=Y,transitionDuration:t=g,TransitionProps:{onEnter:a,onExited:O}={}}=r,D=M(r.TransitionProps,dn),N=M(r,pn),S=c({},r,{anchorOrigin:{vertical:m,horizontal:d},autoHideDuration:p,disableWindowBlurListener:y,TransitionComponent:o,transitionDuration:t}),F=gn(S),{getRootProps:_,onClickAway:U}=en(c({},S)),[W,P]=h.useState(!0),$=Z({elementType:j,getSlotProps:_,externalForwardedProps:N,ownerState:S,additionalProps:{ref:s},className:[F.root,f]}),I=L=>{P(!0),O&&O(L)},G=(L,K)=>{P(!1),a&&a(L,K)};return!w&&W?null:b.jsx(nn,c({onClickAway:U},x,{children:b.jsx(j,c({},$,{children:b.jsx(o,c({appear:!0,in:w,timeout:t,direction:m==="top"?"down":"up",onEnter:G,onExited:I},D,{children:l||b.jsx(ln,c({message:E,action:u},v))}))}))}))});export{hn as S}; +import{ag as q,b as h,v as R,_ as c,ah as T,x as z,y as B,z as H,E as M,j as b,F as J,H as A,J as k,P as X,ai as Q,u as V,aj as Y,a3 as Z,ak as nn,G as C}from"./index-D7LVXeIK.js";function en(n={}){const{autoHideDuration:e=null,disableWindowBlurListener:s=!1,onClose:r,open:i,resumeHideDuration:g}=n,u=q();h.useEffect(()=>{if(!i)return;function o(t){t.defaultPrevented||(t.key==="Escape"||t.key==="Esc")&&(r==null||r(t,"escapeKeyDown"))}return document.addEventListener("keydown",o),()=>{document.removeEventListener("keydown",o)}},[i,r]);const m=R((o,t)=>{r==null||r(o,t)}),d=R(o=>{!r||o==null||u.start(o,()=>{m(null,"timeout")})});h.useEffect(()=>(i&&d(e),u.clear),[i,e,d,u]);const p=o=>{r==null||r(o,"clickaway")},l=u.clear,f=h.useCallback(()=>{e!=null&&d(g??e*.5)},[e,g,d]),x=o=>t=>{const a=o.onBlur;a==null||a(t),f()},v=o=>t=>{const a=o.onFocus;a==null||a(t),l()},y=o=>t=>{const a=o.onMouseEnter;a==null||a(t),l()},E=o=>t=>{const a=o.onMouseLeave;a==null||a(t),f()};return h.useEffect(()=>{if(!s&&i)return window.addEventListener("focus",f),window.addEventListener("blur",l),()=>{window.removeEventListener("focus",f),window.removeEventListener("blur",l)}},[s,i,f,l]),{getRootProps:(o={})=>{const t=c({},T(n),T(o));return c({role:"presentation"},o,t,{onBlur:x(t),onFocus:v(t),onMouseEnter:y(t),onMouseLeave:E(t)})},onClickAway:p}}function on(n){return z("MuiSnackbarContent",n)}B("MuiSnackbarContent",["root","message","action"]);const tn=["action","className","message","role"],rn=n=>{const{classes:e}=n;return A({root:["root"],action:["action"],message:["message"]},on,e)},sn=k(X,{name:"MuiSnackbarContent",slot:"Root",overridesResolver:(n,e)=>e.root})(({theme:n})=>{const e=n.palette.mode==="light"?.8:.98,s=Q(n.palette.background.default,e);return c({},n.typography.body2,{color:n.vars?n.vars.palette.SnackbarContent.color:n.palette.getContrastText(s),backgroundColor:n.vars?n.vars.palette.SnackbarContent.bg:s,display:"flex",alignItems:"center",flexWrap:"wrap",padding:"6px 16px",borderRadius:(n.vars||n).shape.borderRadius,flexGrow:1,[n.breakpoints.up("sm")]:{flexGrow:"initial",minWidth:288}})}),an=k("div",{name:"MuiSnackbarContent",slot:"Message",overridesResolver:(n,e)=>e.message})({padding:"8px 0"}),cn=k("div",{name:"MuiSnackbarContent",slot:"Action",overridesResolver:(n,e)=>e.action})({display:"flex",alignItems:"center",marginLeft:"auto",paddingLeft:16,marginRight:-8}),ln=h.forwardRef(function(e,s){const r=H({props:e,name:"MuiSnackbarContent"}),{action:i,className:g,message:u,role:m="alert"}=r,d=M(r,tn),p=r,l=rn(p);return b.jsxs(sn,c({role:m,square:!0,elevation:6,className:J(l.root,g),ownerState:p,ref:s},d,{children:[b.jsx(an,{className:l.message,ownerState:p,children:u}),i?b.jsx(cn,{className:l.action,ownerState:p,children:i}):null]}))});function un(n){return z("MuiSnackbar",n)}B("MuiSnackbar",["root","anchorOriginTopCenter","anchorOriginBottomCenter","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft"]);const dn=["onEnter","onExited"],pn=["action","anchorOrigin","autoHideDuration","children","className","ClickAwayListenerProps","ContentProps","disableWindowBlurListener","message","onBlur","onClose","onFocus","onMouseEnter","onMouseLeave","open","resumeHideDuration","TransitionComponent","transitionDuration","TransitionProps"],gn=n=>{const{classes:e,anchorOrigin:s}=n,r={root:["root",`anchorOrigin${C(s.vertical)}${C(s.horizontal)}`]};return A(r,un,e)},j=k("div",{name:"MuiSnackbar",slot:"Root",overridesResolver:(n,e)=>{const{ownerState:s}=n;return[e.root,e[`anchorOrigin${C(s.anchorOrigin.vertical)}${C(s.anchorOrigin.horizontal)}`]]}})(({theme:n,ownerState:e})=>{const s={left:"50%",right:"auto",transform:"translateX(-50%)"};return c({zIndex:(n.vars||n).zIndex.snackbar,position:"fixed",display:"flex",left:8,right:8,justifyContent:"center",alignItems:"center"},e.anchorOrigin.vertical==="top"?{top:8}:{bottom:8},e.anchorOrigin.horizontal==="left"&&{justifyContent:"flex-start"},e.anchorOrigin.horizontal==="right"&&{justifyContent:"flex-end"},{[n.breakpoints.up("sm")]:c({},e.anchorOrigin.vertical==="top"?{top:24}:{bottom:24},e.anchorOrigin.horizontal==="center"&&s,e.anchorOrigin.horizontal==="left"&&{left:24,right:"auto"},e.anchorOrigin.horizontal==="right"&&{right:24,left:"auto"})})}),hn=h.forwardRef(function(e,s){const r=H({props:e,name:"MuiSnackbar"}),i=V(),g={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{action:u,anchorOrigin:{vertical:m,horizontal:d}={vertical:"bottom",horizontal:"left"},autoHideDuration:p=null,children:l,className:f,ClickAwayListenerProps:x,ContentProps:v,disableWindowBlurListener:y=!1,message:E,open:w,TransitionComponent:o=Y,transitionDuration:t=g,TransitionProps:{onEnter:a,onExited:O}={}}=r,D=M(r.TransitionProps,dn),N=M(r,pn),S=c({},r,{anchorOrigin:{vertical:m,horizontal:d},autoHideDuration:p,disableWindowBlurListener:y,TransitionComponent:o,transitionDuration:t}),F=gn(S),{getRootProps:_,onClickAway:U}=en(c({},S)),[W,P]=h.useState(!0),$=Z({elementType:j,getSlotProps:_,externalForwardedProps:N,ownerState:S,additionalProps:{ref:s},className:[F.root,f]}),I=L=>{P(!0),O&&O(L)},G=(L,K)=>{P(!1),a&&a(L,K)};return!w&&W?null:b.jsx(nn,c({onClickAway:U},x,{children:b.jsx(j,c({},$,{children:b.jsx(o,c({appear:!0,in:w,timeout:t,direction:m==="top"?"down":"up",onEnter:G,onExited:I},D,{children:l||b.jsx(ln,c({message:E,action:u},v))}))}))}))});export{hn as S}; diff --git a/dist/assets/StatCard-Nzv53jX8.js b/dist/assets/StatCard-Nzv53jX8.js deleted file mode 100644 index dff4c6d..0000000 --- a/dist/assets/StatCard-Nzv53jX8.js +++ /dev/null @@ -1 +0,0 @@ -import{x as j,y as C,b as w,z as y,E as R,_ as g,j as e,F as S,H as _,J as z,r as f,i as v,B as c,S as x,T as d}from"./index-DpAn5wLF.js";import{C as M}from"./Link-Bme8npFv.js";function $(r){return j("MuiCardContent",r)}C("MuiCardContent",["root"]);const k=["className","component"],D=r=>{const{classes:o}=r;return _({root:["root"]},$,o)},I=z("div",{name:"MuiCardContent",slot:"Root",overridesResolver:(r,o)=>o.root})(()=>({padding:16,"&:last-child":{paddingBottom:24}})),U=w.forwardRef(function(o,s){const a=y({props:o,name:"MuiCardContent"}),{className:i,component:n="div"}=a,h=R(a,k),t=g({},a,{component:n}),l=D(t);return e.jsx(I,g({as:n,className:S(l.root,i),ownerState:t,ref:s},h))});var p={},E=v;Object.defineProperty(p,"__esModule",{value:!0});var b=p.default=void 0,W=E(f()),q=e;b=p.default=(0,W.default)((0,q.jsx)("path",{d:"M13 19V7.83l4.88 4.88c.39.39 1.03.39 1.42 0 .39-.39.39-1.02 0-1.41l-6.59-6.59a.9959.9959 0 0 0-1.41 0l-6.6 6.58c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L11 7.83V19c0 .55.45 1 1 1s1-.45 1-1"}),"ArrowUpwardRounded");var u={},A=v;Object.defineProperty(u,"__esModule",{value:!0});var m=u.default=void 0,P=A(f()),B=e;m=u.default=(0,P.default)((0,B.jsx)("path",{d:"M11 5v11.17l-4.88-4.88c-.39-.39-1.03-.39-1.42 0-.39.39-.39 1.02 0 1.41l6.59 6.59c.39.39 1.02.39 1.41 0l6.59-6.59c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L13 16.17V5c0-.55-.45-1-1-1s-1 .45-1 1"}),"ArrowDownwardRounded");function T({title:r,value:o,icon:s,color:a="primary",trend:i,caption:n,accent:h=!1}){const t=typeof i=="number"?i>=0:null;return e.jsxs(M,{sx:{height:"100%",position:"relative",overflow:"hidden",borderRadius:3,boxShadow:"0 8px 24px rgba(0,0,0,0.03)",border:"1px solid rgba(0,0,0,0.04)",transition:"all 0.3s cubic-bezier(0.4, 0, 0.2, 1)","&:hover":{transform:"translateY(-4px)",boxShadow:"0 16px 32px rgba(0,0,0,0.06)"},background:l=>`linear-gradient(145deg, ${l.palette.background.paper} 0%, ${l.palette[a].lighter}15 100%)`},children:[s&&e.jsx(c,{sx:{position:"absolute",right:-15,bottom:-15,opacity:.04,transform:"rotate(-15deg)",pointerEvents:"none"},children:e.jsx(s,{sx:{fontSize:110}})}),e.jsxs(U,{sx:{p:2.5,"&:last-child":{pb:2.5},height:"100%",display:"flex",flexDirection:"column"},children:[e.jsxs(x,{direction:"row",justifyContent:"space-between",alignItems:"flex-start",sx:{mb:1.5,position:"relative",zIndex:2},children:[e.jsx(d,{variant:"body2",sx:{fontWeight:600,color:"text.secondary"},children:r}),s&&e.jsx(c,{sx:{width:38,height:38,borderRadius:2,display:"flex",alignItems:"center",justifyContent:"center",bgcolor:`${a}.lighter`,color:`${a}.main`,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.05)"},children:e.jsx(s,{fontSize:"small"})})]}),e.jsx(c,{sx:{flexGrow:1,position:"relative",zIndex:2},children:e.jsx(d,{variant:"h4",sx:{fontWeight:800,color:"grey.900",letterSpacing:"-0.5px",lineHeight:1},children:o})}),(t!==null||n)&&e.jsxs(x,{direction:"row",spacing:1,alignItems:"center",sx:{mt:2,pt:1.5,borderTop:"1px dashed rgba(0,0,0,0.06)",position:"relative",zIndex:2},children:[t!==null&&e.jsxs(x,{direction:"row",spacing:.25,alignItems:"center",sx:{bgcolor:t?"success.lighter":"error.lighter",px:.75,py:.25,borderRadius:1},children:[t?e.jsx(b,{sx:{fontSize:14,color:"success.dark"}}):e.jsx(m,{sx:{fontSize:14,color:"error.dark"}}),e.jsxs(d,{variant:"caption",sx:{fontWeight:700,color:t?"success.dark":"error.dark"},children:[Math.abs(i),"%"]})]}),n&&e.jsx(d,{variant:"caption",sx:{color:"text.secondary",fontWeight:600},children:n})]})]})]})}export{T as S}; diff --git a/dist/assets/StatusChip-C72vLAK4.js b/dist/assets/StatusChip-B_YdJiMW.js similarity index 96% rename from dist/assets/StatusChip-C72vLAK4.js rename to dist/assets/StatusChip-B_YdJiMW.js index 686ecf6..f7606c9 100644 --- a/dist/assets/StatusChip-C72vLAK4.js +++ b/dist/assets/StatusChip-B_YdJiMW.js @@ -1 +1 @@ -import{r,j as e,i as o}from"./index-DpAn5wLF.js";import{C as h}from"./PageHeader-CEew5Fw4.js";var a={},m=o;Object.defineProperty(a,"__esModule",{value:!0});var _=a.default=void 0,O=m(r()),C=e;_=a.default=(0,O.default)((0,C.jsx)("path",{d:"M7.25 12.5 4.75 9H3.5v6h1.25v-3.5L7.3 15h1.2V9H7.25zM9.5 15h4v-1.25H11v-1.11h2.5v-1.26H11v-1.12h2.5V9h-4zm9.75-6v4.5h-1.12V9.99h-1.25v3.52h-1.13V9H14.5v5c0 .55.45 1 1 1h4c.55 0 1-.45 1-1V9z"}),"FiberNewOutlined");var c={},E=o;Object.defineProperty(c,"__esModule",{value:!0});var F=c.default=void 0,j=E(r()),d=e;F=c.default=(0,j.default)([(0,d.jsx)("path",{d:"M20 2H4c-1 0-2 .9-2 2v3.01c0 .72.43 1.34 1 1.69V20c0 1.1 1.1 2 2 2h14c.9 0 2-.9 2-2V8.7c.57-.35 1-.97 1-1.69V4c0-1.1-1-2-2-2m-1 18H5V9h14zm1-13H4V4h16z"},"0"),(0,d.jsx)("path",{d:"M9 12h6v2H9z"},"1")],"Inventory2Outlined");var n={},x=o;Object.defineProperty(n,"__esModule",{value:!0});var w=n.default=void 0,y=x(r()),H=e;w=n.default=(0,y.default)((0,H.jsx)("path",{d:"M12.22 19.85c-.18.18-.5.21-.71 0-.18-.18-.21-.5 0-.71l3.39-3.39-1.41-1.41-3.39 3.39c-.19.2-.51.19-.71 0-.21-.21-.18-.53 0-.71l3.39-3.39-1.41-1.41-3.39 3.39c-.18.18-.5.21-.71 0-.19-.19-.19-.51 0-.71l3.39-3.39-1.42-1.41-3.39 3.39c-.18.18-.5.21-.71 0-.19-.2-.19-.51 0-.71L9.52 8.4l1.87 1.86c.95.95 2.59.94 3.54 0 .98-.98.98-2.56 0-3.54l-1.86-1.86.28-.28c.78-.78 2.05-.78 2.83 0l4.24 4.24c.78.78.78 2.05 0 2.83zm9.61-6.78c1.56-1.56 1.56-4.09 0-5.66l-4.24-4.24c-1.56-1.56-4.09-1.56-5.66 0l-.28.28-.28-.28c-1.56-1.56-4.09-1.56-5.66 0L2.17 6.71C.75 8.13.62 10.34 1.77 11.9l1.45-1.45c-.39-.75-.26-1.7.37-2.33l3.54-3.54c.78-.78 2.05-.78 2.83 0l3.56 3.56c.18.18.21.5 0 .71-.21.21-.53.18-.71 0L9.52 5.57l-5.8 5.79c-.98.97-.98 2.56 0 3.54.39.39.89.63 1.42.7.07.52.3 1.02.7 1.42.4.4.9.63 1.42.7.07.52.3 1.02.7 1.42.4.4.9.63 1.42.7.07.54.31 1.03.7 1.42.47.47 1.1.73 1.77.73.67 0 1.3-.26 1.77-.73z"}),"HandshakeOutlined");const M={pending:{color:"warning",label:"Pending"},created:{color:"info",label:"Created"},assigned:{color:"info",label:"Assigned"},accepted:{color:"info",label:"Accepted"},arrived:{color:"info",label:"Arrived"},picked:{color:"primary",label:"Picked"},"in-transit":{color:"info",label:"In Transit"},active:{color:"primary",label:"Active"},delivered:{color:"success",label:"Delivered"},completed:{color:"success",label:"Completed"},skipped:{color:"warning",label:"Skipped"},failed:{color:"error",label:"Failed"},cancelled:{color:"error",label:"Cancelled"},newclient:{color:"info",label:"New Client"},contacted:{color:"warning",label:"Contacted"},onboarded:{color:"success",label:"Onboarded"},lost:{color:"error",label:"Lost"},admin:{color:"primary",label:"Admin"},rep:{color:"info",label:"Rep"},manager:{color:"success",label:"Manager"},support:{color:"warning",label:"Support"},online:{color:"success",label:"Online"},offline:{color:"default",label:"Offline"},"on-delivery":{color:"info",label:"On Delivery"},inactive:{color:"default",label:"Inactive"},paid:{color:"success",label:"Paid"},open:{color:"info",label:"Open"},overdue:{color:"error",label:"Overdue"},prepaid:{color:"success",label:"Prepaid"},cod:{color:"warning",label:"COD"}},s={success:{bg:"#E3F6EC",fg:"#00773B"},warning:{bg:"#FFF7E0",fg:"#8A6500"},info:{bg:"#E0F7F8",fg:"#00727B"},error:{bg:"#FEEAE9",fg:"#A82216"},primary:{bg:"#F8E0E3",fg:"#9E0E20"},default:{bg:"#F0F0F0",fg:"#595959"}};function z({status:l,size:u="small",label:b,sx:f}){const v=String(l||"").toLowerCase().replace(/\s+/g,"-"),p=String(l||"").replace(/[_-]+/g," ").replace(/\b\w/g,g=>g.toUpperCase()),t=M[v]||{color:"default",label:p||l},i=s[t.color]||s.default;return e.jsx(h,{size:u,label:b||t.label,sx:{bgcolor:i.bg,color:i.fg,border:"none",...f}})}export{z as S,F as a,w as b,_ as d}; +import{r,j as e,i as o}from"./index-D7LVXeIK.js";import{C as h}from"./PageHeader-naLAT9xr.js";var a={},m=o;Object.defineProperty(a,"__esModule",{value:!0});var _=a.default=void 0,O=m(r()),C=e;_=a.default=(0,O.default)((0,C.jsx)("path",{d:"M7.25 12.5 4.75 9H3.5v6h1.25v-3.5L7.3 15h1.2V9H7.25zM9.5 15h4v-1.25H11v-1.11h2.5v-1.26H11v-1.12h2.5V9h-4zm9.75-6v4.5h-1.12V9.99h-1.25v3.52h-1.13V9H14.5v5c0 .55.45 1 1 1h4c.55 0 1-.45 1-1V9z"}),"FiberNewOutlined");var c={},E=o;Object.defineProperty(c,"__esModule",{value:!0});var F=c.default=void 0,j=E(r()),d=e;F=c.default=(0,j.default)([(0,d.jsx)("path",{d:"M20 2H4c-1 0-2 .9-2 2v3.01c0 .72.43 1.34 1 1.69V20c0 1.1 1.1 2 2 2h14c.9 0 2-.9 2-2V8.7c.57-.35 1-.97 1-1.69V4c0-1.1-1-2-2-2m-1 18H5V9h14zm1-13H4V4h16z"},"0"),(0,d.jsx)("path",{d:"M9 12h6v2H9z"},"1")],"Inventory2Outlined");var n={},x=o;Object.defineProperty(n,"__esModule",{value:!0});var w=n.default=void 0,y=x(r()),H=e;w=n.default=(0,y.default)((0,H.jsx)("path",{d:"M12.22 19.85c-.18.18-.5.21-.71 0-.18-.18-.21-.5 0-.71l3.39-3.39-1.41-1.41-3.39 3.39c-.19.2-.51.19-.71 0-.21-.21-.18-.53 0-.71l3.39-3.39-1.41-1.41-3.39 3.39c-.18.18-.5.21-.71 0-.19-.19-.19-.51 0-.71l3.39-3.39-1.42-1.41-3.39 3.39c-.18.18-.5.21-.71 0-.19-.2-.19-.51 0-.71L9.52 8.4l1.87 1.86c.95.95 2.59.94 3.54 0 .98-.98.98-2.56 0-3.54l-1.86-1.86.28-.28c.78-.78 2.05-.78 2.83 0l4.24 4.24c.78.78.78 2.05 0 2.83zm9.61-6.78c1.56-1.56 1.56-4.09 0-5.66l-4.24-4.24c-1.56-1.56-4.09-1.56-5.66 0l-.28.28-.28-.28c-1.56-1.56-4.09-1.56-5.66 0L2.17 6.71C.75 8.13.62 10.34 1.77 11.9l1.45-1.45c-.39-.75-.26-1.7.37-2.33l3.54-3.54c.78-.78 2.05-.78 2.83 0l3.56 3.56c.18.18.21.5 0 .71-.21.21-.53.18-.71 0L9.52 5.57l-5.8 5.79c-.98.97-.98 2.56 0 3.54.39.39.89.63 1.42.7.07.52.3 1.02.7 1.42.4.4.9.63 1.42.7.07.52.3 1.02.7 1.42.4.4.9.63 1.42.7.07.54.31 1.03.7 1.42.47.47 1.1.73 1.77.73.67 0 1.3-.26 1.77-.73z"}),"HandshakeOutlined");const M={pending:{color:"warning",label:"Pending"},created:{color:"info",label:"Created"},assigned:{color:"info",label:"Assigned"},accepted:{color:"info",label:"Accepted"},arrived:{color:"info",label:"Arrived"},picked:{color:"primary",label:"Picked"},"in-transit":{color:"info",label:"In Transit"},active:{color:"primary",label:"Active"},delivered:{color:"success",label:"Delivered"},completed:{color:"success",label:"Completed"},skipped:{color:"warning",label:"Skipped"},failed:{color:"error",label:"Failed"},cancelled:{color:"error",label:"Cancelled"},newclient:{color:"info",label:"New Client"},contacted:{color:"warning",label:"Contacted"},onboarded:{color:"success",label:"Onboarded"},lost:{color:"error",label:"Lost"},admin:{color:"primary",label:"Admin"},rep:{color:"info",label:"Rep"},manager:{color:"success",label:"Manager"},support:{color:"warning",label:"Support"},online:{color:"success",label:"Online"},offline:{color:"default",label:"Offline"},"on-delivery":{color:"info",label:"On Delivery"},inactive:{color:"default",label:"Inactive"},paid:{color:"success",label:"Paid"},open:{color:"info",label:"Open"},overdue:{color:"error",label:"Overdue"},prepaid:{color:"success",label:"Prepaid"},cod:{color:"warning",label:"COD"}},s={success:{bg:"#E3F6EC",fg:"#00773B"},warning:{bg:"#FFF7E0",fg:"#8A6500"},info:{bg:"#E0F7F8",fg:"#00727B"},error:{bg:"#FEEAE9",fg:"#A82216"},primary:{bg:"#F8E0E3",fg:"#9E0E20"},default:{bg:"#F0F0F0",fg:"#595959"}};function z({status:l,size:u="small",label:b,sx:f}){const v=String(l||"").toLowerCase().replace(/\s+/g,"-"),p=String(l||"").replace(/[_-]+/g," ").replace(/\b\w/g,g=>g.toUpperCase()),t=M[v]||{color:"default",label:p||l},i=s[t.color]||s.default;return e.jsx(h,{size:u,label:b||t.label,sx:{bgcolor:i.bg,color:i.fg,border:"none",...f}})}export{z as S,F as a,w as b,_ as d}; diff --git a/dist/assets/StorefrontOutlined-B0ka2NHy.js b/dist/assets/StorefrontOutlined-Be07_1-Y.js similarity index 96% rename from dist/assets/StorefrontOutlined-B0ka2NHy.js rename to dist/assets/StorefrontOutlined-Be07_1-Y.js index cc0ba8c..2df653a 100644 --- a/dist/assets/StorefrontOutlined-B0ka2NHy.js +++ b/dist/assets/StorefrontOutlined-Be07_1-Y.js @@ -1 +1 @@ -import{r as e,j as r,i as a}from"./index-DpAn5wLF.js";var t={},o=a;Object.defineProperty(t,"__esModule",{value:!0});var v=t.default=void 0,c=o(e()),i=r;v=t.default=(0,c.default)((0,i.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");var u={},f=a;Object.defineProperty(u,"__esModule",{value:!0});var n=u.default=void 0,s=f(e()),_=r;n=u.default=(0,s.default)((0,_.jsx)("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");var d={},p=a;Object.defineProperty(d,"__esModule",{value:!0});var j=d.default=void 0,x=p(e()),$=r;j=d.default=(0,x.default)((0,$.jsx)("path",{d:"M12 12c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m6-1.8C18 6.57 15.35 4 12 4s-6 2.57-6 6.2c0 2.34 1.95 5.44 6 9.14 4.05-3.7 6-6.8 6-9.14M12 2c4.2 0 8 3.22 8 8.2 0 3.32-2.67 7.25-8 11.8-5.33-4.55-8-8.48-8-11.8C4 5.22 7.8 2 12 2"}),"PlaceOutlined");var l={},m=a;Object.defineProperty(l,"__esModule",{value:!0});var M=l.default=void 0,R=m(e()),b=r;M=l.default=(0,R.default)((0,b.jsx)("path",{d:"m21.9 8.89-1.05-4.37c-.22-.9-1-1.52-1.91-1.52H5.05c-.9 0-1.69.63-1.9 1.52L2.1 8.89c-.24 1.02-.02 2.06.62 2.88.08.11.19.19.28.29V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6.94c.09-.09.2-.18.28-.28.64-.82.87-1.87.62-2.89m-2.99-3.9 1.05 4.37c.1.42.01.84-.25 1.17-.14.18-.44.47-.94.47-.61 0-1.14-.49-1.21-1.14L16.98 5zM13 5h1.96l.54 4.52c.05.39-.07.78-.33 1.07-.22.26-.54.41-.95.41-.67 0-1.22-.59-1.22-1.31zM8.49 9.52 9.04 5H11v4.69c0 .72-.55 1.31-1.29 1.31-.34 0-.65-.15-.89-.41-.25-.29-.37-.68-.33-1.07m-4.45-.16L5.05 5h1.97l-.58 4.86c-.08.65-.6 1.14-1.21 1.14-.49 0-.8-.29-.93-.47-.27-.32-.36-.75-.26-1.17M5 19v-6.03c.08.01.15.03.23.03.87 0 1.66-.36 2.24-.95.6.6 1.4.95 2.31.95.87 0 1.65-.36 2.23-.93.59.57 1.39.93 2.29.93.84 0 1.64-.35 2.24-.95.58.59 1.37.95 2.24.95.08 0 .15-.02.23-.03V19z"}),"StorefrontOutlined");export{n as a,v as b,M as c,j as d}; +import{r as e,j as r,i as a}from"./index-D7LVXeIK.js";var t={},o=a;Object.defineProperty(t,"__esModule",{value:!0});var v=t.default=void 0,c=o(e()),i=r;v=t.default=(0,c.default)((0,i.jsx)("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");var u={},f=a;Object.defineProperty(u,"__esModule",{value:!0});var n=u.default=void 0,s=f(e()),_=r;n=u.default=(0,s.default)((0,_.jsx)("path",{d:"M7.41 15.41 12 10.83l4.59 4.58L18 14l-6-6-6 6z"}),"KeyboardArrowUp");var d={},p=a;Object.defineProperty(d,"__esModule",{value:!0});var j=d.default=void 0,x=p(e()),$=r;j=d.default=(0,x.default)((0,$.jsx)("path",{d:"M12 12c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2m6-1.8C18 6.57 15.35 4 12 4s-6 2.57-6 6.2c0 2.34 1.95 5.44 6 9.14 4.05-3.7 6-6.8 6-9.14M12 2c4.2 0 8 3.22 8 8.2 0 3.32-2.67 7.25-8 11.8-5.33-4.55-8-8.48-8-11.8C4 5.22 7.8 2 12 2"}),"PlaceOutlined");var l={},m=a;Object.defineProperty(l,"__esModule",{value:!0});var M=l.default=void 0,R=m(e()),b=r;M=l.default=(0,R.default)((0,b.jsx)("path",{d:"m21.9 8.89-1.05-4.37c-.22-.9-1-1.52-1.91-1.52H5.05c-.9 0-1.69.63-1.9 1.52L2.1 8.89c-.24 1.02-.02 2.06.62 2.88.08.11.19.19.28.29V19c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-6.94c.09-.09.2-.18.28-.28.64-.82.87-1.87.62-2.89m-2.99-3.9 1.05 4.37c.1.42.01.84-.25 1.17-.14.18-.44.47-.94.47-.61 0-1.14-.49-1.21-1.14L16.98 5zM13 5h1.96l.54 4.52c.05.39-.07.78-.33 1.07-.22.26-.54.41-.95.41-.67 0-1.22-.59-1.22-1.31zM8.49 9.52 9.04 5H11v4.69c0 .72-.55 1.31-1.29 1.31-.34 0-.65-.15-.89-.41-.25-.29-.37-.68-.33-1.07m-4.45-.16L5.05 5h1.97l-.58 4.86c-.08.65-.6 1.14-1.21 1.14-.49 0-.8-.29-.93-.47-.27-.32-.36-.75-.26-1.17M5 19v-6.03c.08.01.15.03.23.03.87 0 1.66-.36 2.24-.95.6.6 1.4.95 2.31.95.87 0 1.65-.36 2.23-.93.59.57 1.39.93 2.29.93.84 0 1.64-.35 2.24-.95.58.59 1.37.95 2.24.95.08 0 .15-.02.23-.03V19z"}),"StorefrontOutlined");export{n as a,v as b,M as c,j as d}; diff --git a/dist/assets/Survey-CP7wVFIm.js b/dist/assets/Survey-CP7wVFIm.js new file mode 100644 index 0000000..7b75e4b --- /dev/null +++ b/dist/assets/Survey-CP7wVFIm.js @@ -0,0 +1 @@ +import{r as de,j as e,i as he,b as u,B as h,T as a,S as _,l as xe,C as J,e as pe,p as ue,A as ge,n as re,M as C,I as M}from"./index-D7LVXeIK.js";import{d as me}from"./EditOutlined-DS7hq7Cq.js";import{T as fe,d as ye}from"./DeleteOutline-Dhk3Cr2d.js";import{d as se,D as je}from"./PhoneOutlined-Uvrb40S4.js";import{c as H,a as be,b as ve,d as N}from"./StorefrontOutlined-Be07_1-Y.js";import{d as _e}from"./LocalShippingOutlined-C1uYlQnS.js";import{d as Ce}from"./MapOutlined-CMNX914Q.js";import{d as q,D as te,a as ie,b as ne,c as oe,e as X}from"./Close-D3HB9j5y.js";import{P as Se,G as i,A as ae,C as T}from"./PageHeader-naLAT9xr.js";import{S as U,E as ke}from"./EmptyState-B9FcYx_n.js";import{C as le}from"./Link-BEif5YS2.js";import{T as g}from"./TextField-Sd_pshci.js";import{I as Ie}from"./InputAdornment-CMIlL2rx.js";import{B as k}from"./Button-Bqp5awT1.js";import{S as Pe}from"./Snackbar-DOheZfWW.js";import"./TableCell-DreGbAeW.js";var G={},ze=he;Object.defineProperty(G,"__esModule",{value:!0});var D=G.default=void 0,We=ze(de()),Ee=e;D=G.default=(0,We.default)((0,Ee.jsx)("path",{d:"M7 15h7v2H7zm0-4h10v2H7zm0-4h10v2H7zm12-4h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-.14 0-.27.01-.4.04-.39.08-.74.28-1.01.55-.18.18-.33.4-.43.64-.1.23-.16.49-.16.77v14c0 .27.06.54.16.78s.25.45.43.64c.27.27.62.47 1.01.55.13.02.26.03.4.03h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7-.25c.41 0 .75.34.75.75s-.34.75-.75.75-.75-.34-.75-.75.34-.75.75-.75M19 19H5V5h14z"}),"AssignmentOutlined");const O="https://api.doormile.com/api/v1",Y=()=>{const r=localStorage.getItem("auth_token");return{"Content-Type":"application/json",...r?{Authorization:`Bearer ${r}`}:{}}},Ae={textTransform:"uppercase",letterSpacing:.4,fontSize:"0.68rem",fontWeight:700,color:"grey.700"};function ee({label:r,color:l="default"}){return r?e.jsx(T,{size:"small",label:r,sx:{fontWeight:600,...l==="default"?{bgcolor:"grey.100",color:"grey.700"}:{bgcolor:`${l}.lighter`,color:`${l}.dark`}}}):e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:"grey.500"},children:"—"})}function f({label:r,children:l}){return e.jsxs(h,{children:[e.jsx(a,{variant:"caption",color:"text.secondary",sx:Ae,children:r}),e.jsx(h,{sx:{mt:.5},children:l})]})}function B({icon:r,title:l,children:x}){return e.jsxs(h,{sx:{height:"100%",borderRadius:2,border:1,borderColor:"divider",bgcolor:"background.paper",overflow:"hidden"},children:[e.jsxs(_,{direction:"row",spacing:1,alignItems:"center",sx:{px:2,py:1.25,borderBottom:1,borderColor:"divider",bgcolor:"primary.lighter"},children:[e.jsx(r,{sx:{fontSize:18,color:"primary.main"}}),e.jsx(a,{variant:"overline",sx:{fontWeight:700,color:"grey.800",letterSpacing:.6,lineHeight:1},children:l})]}),e.jsx(_,{spacing:1.75,sx:{p:2},children:x})]})}async function we(){const r=await fetch(`${O}/admin/competitor-branches?limit=1000`,{headers:Y()});if(!r.ok)throw new Error("Failed to fetch surveys");const l=await r.json(),x=Array.isArray(l)?l:l.data||[];return{data:x,total:x.length}}async function Re(r){const l=!!r.id,x=l?`${O}/admin/competitor-branches/${r.id}`:`${O}/admin/competitor-branches`,s=await fetch(x,{method:l?"PUT":"POST",headers:Y(),body:JSON.stringify(r)});if(!s.ok){const c=await s.json().catch(()=>({}));throw new Error(c.error||c.message||"Failed to save survey")}return s.status===204?{}:s.json().catch(()=>({}))}async function Te(r){const l=!!r.id,x=l?`${O}/admin/carrier-pricing/${r.id}`:`${O}/admin/carrier-pricing`,s=await fetch(x,{method:l?"PUT":"POST",headers:Y(),body:JSON.stringify({company:r.company,weight_slab:r.weight_slab,zone:r.zone||"",service_type:r.service_type||"",rate:String(r.rate)})});if(!s.ok){const c=await s.json().catch(()=>({}));throw new Error(c.error||c.message||"Failed to save pricing")}return s.status===204?{}:s.json().catch(()=>({}))}const De=["Local / Same","Within Tamilnadu","Interstate India"],Oe=["< 500g","500g - 1kg","1kg - 2kg","2kg - 5kg","> 5kg"];function $e({open:r,onClose:l,onSave:x,initialData:m}){const[s,c]=u.useState({}),[y,v]=u.useState(!1),[p,I]=u.useState(null);u.useEffect(()=>{r&&(c(m?{...m,pincodes:m.pincodes?m.pincodes.split(",").map(n=>n.trim()).filter(Boolean):[]}:{company:"",area:"",phone:"",rate_per_kg:"",offers_pickup:"no",offers_drop:"no",packing_charge:"",time_in_days:"",plus_code:"",address:"",frequency:"",pincodes:[],slabs:[]}),I(null))},[r,m]);const j=n=>t=>{c(d=>({...d,[n]:t.target.value}))},z=(n,t)=>d=>{const W=[...s.slabs||[]];W[n]={...W[n],[t]:d.target.value},c(w=>({...w,slabs:W}))},F=()=>{c(n=>({...n,slabs:[...n.slabs||[],{weight_slab:"",zone:"",service_type:"",rate:""}]}))},$=n=>{const t=[...s.slabs||[]];t.splice(n,1),c(d=>({...d,slabs:t}))},S=n=>t=>{const d=[...s.pincodes||[]];d[n]=t.target.value,c(W=>({...W,pincodes:d}))},E=()=>{c(n=>({...n,pincodes:[...n.pincodes||[],""]}))},A=n=>{const t=[...s.pincodes||[]];t.splice(n,1),c(d=>({...d,pincodes:t}))},L=async()=>{v(!0),I(null);try{if(s.pincodes&&s.pincodes.length>0){const t=s.pincodes.filter(d=>d.trim()&&!/^\d{6}$/.test(d.trim()));if(t.length>0)throw new Error(`Invalid pincodes detected: ${t.join(", ")}. All pincodes must be exactly 6 numeric digits.`)}const n={...s.id?{id:s.id}:{},company:s.company||"",area:s.area||"",phone:s.phone||"",rate_per_kg:s.rate_per_kg||"",offers_pickup:s.offers_pickup||"no",offers_drop:s.offers_drop||"no",packing_charge:s.packing_charge||"",time_in_days:s.time_in_days||"",plus_code:s.plus_code||"",address:s.address||"",frequency:s.frequency||"",pincodes:s.pincodes?s.pincodes.join(","):""};if(await Re(n),s.slabs&&s.slabs.length>0&&s.company)try{await Promise.all(s.slabs.map(t=>t.weight_slab&&t.rate?Te({company:s.company,weight_slab:t.weight_slab,zone:t.zone||"",service_type:t.service_type||"",rate:t.rate}):Promise.resolve()))}catch(t){console.error("Failed to save pricing slabs",t)}x(),l()}catch(n){console.error(n),I(n.message||"Failed to save. Please try again.")}finally{v(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(Pe,{open:!!p,autoHideDuration:6e3,onClose:()=>I(null),anchorOrigin:{vertical:"top",horizontal:"right"},sx:{zIndex:9999},children:e.jsx(ae,{onClose:()=>I(null),severity:"error",variant:"filled",sx:{width:"100%",boxShadow:3},children:p})}),e.jsxs(te,{open:r,onClose:y?void 0:l,maxWidth:"sm",fullWidth:!0,children:[e.jsx(ie,{sx:{fontWeight:800},children:m?"Edit Survey Record":"Add New Survey"}),e.jsx(ne,{dividers:!0,children:e.jsxs(i,{container:!0,spacing:2,children:[e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsx(g,{fullWidth:!0,label:"Company",value:s.company||"",onChange:j("company"),size:"small"})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsx(g,{fullWidth:!0,label:"Area / Zone",value:s.area||"",onChange:j("area"),size:"small"})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsx(g,{fullWidth:!0,label:"Phone",value:s.phone||"",onChange:j("phone"),size:"small"})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsx(g,{fullWidth:!0,label:"Rate Per KG",value:s.rate_per_kg||"",onChange:j("rate_per_kg"),size:"small"})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsxs(g,{select:!0,fullWidth:!0,label:"Offers Pickup",value:s.offers_pickup||"no",onChange:j("offers_pickup"),size:"small",children:[e.jsx(C,{value:"yes",children:"Yes"}),e.jsx(C,{value:"no",children:"No"})]})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsxs(g,{select:!0,fullWidth:!0,label:"Offers Drop",value:s.offers_drop||"no",onChange:j("offers_drop"),size:"small",children:[e.jsx(C,{value:"yes",children:"Yes"}),e.jsx(C,{value:"no",children:"No"})]})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsx(g,{fullWidth:!0,label:"Time in Days",value:s.time_in_days||"",onChange:j("time_in_days"),size:"small"})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsx(g,{fullWidth:!0,label:"Packing Charge",value:s.packing_charge||"",onChange:j("packing_charge"),size:"small"})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsxs(g,{select:!0,fullWidth:!0,label:"Frequency",value:s.frequency||"",onChange:j("frequency"),size:"small",children:[e.jsx(C,{value:"Daily",children:"Daily"}),e.jsx(C,{value:"Weekly",children:"Weekly"}),e.jsx(C,{value:"Bi-weekly",children:"Bi-weekly"}),e.jsx(C,{value:"Monthly",children:"Monthly"}),e.jsx(C,{value:"On-demand",children:"On-demand"})]})}),e.jsx(i,{item:!0,xs:12,children:e.jsx(g,{fullWidth:!0,label:"Plus Code",value:s.plus_code||"",onChange:j("plus_code"),size:"small"})}),e.jsx(i,{item:!0,xs:12,children:e.jsxs(h,{sx:{mt:1,pt:2,borderTop:"1px dashed",borderColor:"divider"},children:[e.jsxs(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[e.jsx(a,{variant:"subtitle2",sx:{fontWeight:700,color:"primary.main",letterSpacing:.5},children:"SERVICEABLE PINCODES"}),e.jsx(k,{size:"small",startIcon:e.jsx(q,{}),onClick:E,sx:{fontWeight:600},children:"Add Pincode"})]}),(s.pincodes||[]).map((n,t)=>e.jsxs(i,{container:!0,spacing:1.5,sx:{mb:1.5,alignItems:"center"},children:[e.jsx(i,{item:!0,xs:10,sm:11,children:e.jsx(g,{fullWidth:!0,label:`Pincode ${t+1}`,value:n,onChange:S(t),size:"small",placeholder:"e.g. 600001",inputProps:{maxLength:6}})}),e.jsx(i,{item:!0,xs:2,sm:1,children:e.jsx(M,{size:"small",color:"error",onClick:()=>A(t),children:e.jsx(X,{fontSize:"small"})})})]},t)),(!s.pincodes||s.pincodes.length===0)&&e.jsx(a,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",py:2,bgcolor:"grey.50",borderRadius:1,border:"1px dashed",borderColor:"grey.300"},children:"Click 'Add Pincode' to assign locations to this competitor."})]})}),e.jsx(i,{item:!0,xs:12,children:e.jsx(g,{fullWidth:!0,multiline:!0,rows:2,label:"Address",value:s.address||"",onChange:j("address"),size:"small"})}),e.jsx(i,{item:!0,xs:12,children:e.jsxs(h,{sx:{mt:1,pt:2,borderTop:"1px dashed",borderColor:"divider"},children:[e.jsxs(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[e.jsx(a,{variant:"subtitle2",sx:{fontWeight:700,color:"primary.main",letterSpacing:.5},children:"PRICING SLABS (OPTIONAL)"}),e.jsx(k,{size:"small",startIcon:e.jsx(q,{}),onClick:F,sx:{fontWeight:600},children:"Add Slab"})]}),(s.slabs||[]).map((n,t)=>e.jsxs(i,{container:!0,spacing:1.5,sx:{mb:1.5,alignItems:"center"},children:[e.jsx(i,{item:!0,xs:6,sm:3,children:e.jsx(g,{select:!0,fullWidth:!0,label:"Weight Slab",value:n.weight_slab||"",onChange:z(t,"weight_slab"),size:"small",children:Oe.map(d=>e.jsx(C,{value:d,children:d},d))})}),e.jsx(i,{item:!0,xs:6,sm:3,children:e.jsx(g,{select:!0,fullWidth:!0,label:"Zone",value:n.zone||"",onChange:z(t,"zone"),size:"small",children:De.map(d=>e.jsx(C,{value:d,children:d},d))})}),e.jsx(i,{item:!0,xs:6,sm:3,children:e.jsx(g,{fullWidth:!0,label:"Service Type",value:n.service_type||"",onChange:z(t,"service_type"),size:"small",placeholder:"e.g. Air"})}),e.jsx(i,{item:!0,xs:4,sm:2,children:e.jsx(g,{fullWidth:!0,label:"Rate (₹)",value:n.rate||"",onChange:z(t,"rate"),size:"small",placeholder:"e.g. 25"})}),e.jsx(i,{item:!0,xs:2,sm:1,children:e.jsx(M,{size:"small",color:"error",onClick:()=>$(t),children:e.jsx(X,{fontSize:"small"})})})]},t)),(!s.slabs||s.slabs.length===0)&&e.jsx(a,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",py:2,bgcolor:"grey.50",borderRadius:1,border:"1px dashed",borderColor:"grey.300"},children:"Click 'Add Slab' to add pricing entries for this competitor."})]})})]})}),e.jsxs(oe,{sx:{px:3,py:2},children:[e.jsx(k,{onClick:l,disabled:y,color:"inherit",children:"Cancel"}),e.jsx(k,{onClick:L,disabled:y,variant:"contained",children:y?"Saving...":"Save Record"})]})]})]})}function Le({row:r,onEdit:l,onDelete:x,users:m}){const[s,c]=u.useState(!1),y=m.find(p=>p.id===r.created_by),v=m.find(p=>p.id===r.updated_by);return e.jsxs(h,{sx:{p:2,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",transition:"border-color 0.2s ease, box-shadow 0.2s ease","&:hover":{borderColor:"primary.main",boxShadow:"0 4px 12px rgba(192, 18, 39, 0.05)"}},children:[e.jsxs(i,{container:!0,spacing:2,alignItems:"center",onClick:()=>c(!s),sx:{cursor:"pointer",userSelect:"none"},children:[e.jsx(i,{item:!0,xs:12,md:4.5,children:e.jsxs(_,{direction:"row",spacing:1.5,alignItems:"center",children:[e.jsx(h,{sx:{p:1,borderRadius:1.5,bgcolor:"primary.lighter",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(N,{sx:{color:"primary.main",fontSize:18}})}),e.jsxs(h,{children:[e.jsx(a,{variant:"subtitle2",sx:{fontWeight:700,color:"grey.900",lineHeight:1.2},children:r.area||"Unknown Area"}),e.jsxs(a,{variant:"caption",sx:{color:"grey.600",display:"flex",alignItems:"center",gap:.5,mt:.25},children:[e.jsx(se,{sx:{fontSize:12}})," ",r.phone||"—"]})]})]})}),e.jsx(i,{item:!0,xs:6,md:3.5,children:e.jsxs(h,{children:[e.jsx(a,{variant:"caption",sx:{color:"grey.500",fontWeight:700,letterSpacing:.5,display:"block",mb:.5},children:"RATE PER KG"}),e.jsx(ee,{label:r.rate_per_kg,color:!r.rate_per_kg||r.rate_per_kg.toLowerCase().includes("not answered")||r.rate_per_kg.toLowerCase().includes("wrong number")?"warning":"success"})]})}),e.jsx(i,{item:!0,xs:6,md:2,children:e.jsxs(h,{children:[e.jsx(a,{variant:"caption",sx:{color:"grey.500",fontWeight:700,letterSpacing:.5,display:"block",mb:.5},children:"LOGISTICS"}),e.jsx(a,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},children:r.offers_pickup==="yes"||r.offers_drop==="yes"?`${r.offers_pickup==="yes"?"Pickup":""} ${r.offers_drop==="yes"?"Drop":""}`:"—"})]})}),e.jsxs(i,{item:!0,xs:12,md:2,sx:{display:"flex",justifyContent:{xs:"flex-start",md:"flex-end"},alignItems:"center",gap:.5},children:[e.jsx(k,{size:"small",sx:{borderRadius:1.5,color:s?"primary.main":"grey.700",bgcolor:s?"primary.lighter":"transparent","&:hover":{bgcolor:"primary.lighter",color:"primary.main"}},children:s?"Hide Info":"More Info"}),e.jsx(M,{size:"small",onClick:p=>{p.stopPropagation(),l(r)},sx:{color:"grey.400","&:hover":{color:"primary.main",bgcolor:"primary.lighter"}},children:e.jsx(me,{fontSize:"small"})}),e.jsx(M,{size:"small",onClick:p=>{p.stopPropagation(),x(r)},sx:{color:"grey.400","&:hover":{color:"error.main",bgcolor:"error.lighter"}},children:e.jsx(ye,{fontSize:"small"})})]})]}),e.jsx(re,{in:s,timeout:"auto",unmountOnExit:!0,children:e.jsx(h,{sx:{mt:2,pt:2,borderTop:"1px dashed",borderColor:"divider"},children:e.jsxs(i,{container:!0,spacing:2,alignItems:"stretch",children:[e.jsx(i,{item:!0,xs:12,md:4,children:e.jsxs(B,{icon:H,title:"ENQUIRY DETAILS",children:[e.jsx(f,{label:"RATE PER KG",children:e.jsx(ee,{label:r.rate_per_kg,color:"success"})}),e.jsx(f,{label:"PICKUP",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:r.offers_pickup?"grey.800":"grey.500"},children:r.offers_pickup||"—"})}),e.jsx(f,{label:"DROP",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:r.offers_drop?"grey.800":"grey.500"},children:r.offers_drop||"—"})}),e.jsx(f,{label:"PACKING",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:r.packing_charge?"grey.800":"grey.500"},children:r.packing_charge||"—"})})]})}),e.jsx(i,{item:!0,xs:12,md:4,children:e.jsxs(B,{icon:_e,title:"LOGISTICS & OPS",children:[e.jsx(f,{label:"TIME IN DAYS",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:r.time_in_days?"grey.800":"grey.500"},children:r.time_in_days||"—"})}),e.jsx(f,{label:"COMPANY",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:r.company||"—"})}),e.jsx(f,{label:"FREQUENCY",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:r.frequency||"—"})}),e.jsx(f,{label:"CONTACT NUMBER",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:r.phone||"—"})})]})}),e.jsx(i,{item:!0,xs:12,md:4,children:e.jsxs(B,{icon:N,title:"LOCATION & PINCODE",children:[e.jsx(f,{label:"AREA / ZONE",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:r.area||"—"})}),e.jsx(f,{label:"SERVICEABLE PINCODES",children:r.pincodes?e.jsx(h,{sx:{display:"flex",gap:.5,flexWrap:"wrap",mt:.5},children:r.pincodes.split(",").map((p,I)=>e.jsx(T,{label:p.trim(),size:"small",sx:{fontSize:"0.7rem",height:20}},I))}):e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:"grey.500"},children:"—"})}),e.jsx(f,{label:"PLUS CODE",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:r.plus_code?"grey.800":"grey.500"},children:r.plus_code||"—"})}),e.jsx(f,{label:"FULL ADDRESS",children:e.jsxs(_,{spacing:1.5,children:[e.jsxs(_,{direction:"row",spacing:1,sx:{p:1.5,borderRadius:1.5,bgcolor:"grey.50",border:1,borderColor:"divider"},children:[e.jsx(N,{sx:{fontSize:16,color:"grey.400",mt:"2px"}}),e.jsx(a,{variant:"body2",sx:{color:"grey.800",lineHeight:1.5},children:r.address||"—"})]}),(r.address||r.plus_code)&&e.jsx(k,{component:"a",href:`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(r.plus_code?r.plus_code+" "+(r.address||""):r.address)}`,target:"_blank",rel:"noopener",size:"small",variant:"outlined",startIcon:e.jsx(Ce,{sx:{fontSize:16}}),sx:{alignSelf:"flex-start",py:.5,px:1.5,fontSize:"0.75rem",fontWeight:600,borderRadius:2,color:"primary.main",borderColor:"primary.light",bgcolor:"primary.lighter","&:hover":{borderColor:"primary.main",bgcolor:"primary.lighter"}},children:"View on map"})]})})]})}),e.jsx(i,{item:!0,xs:12,children:e.jsx(B,{icon:D,title:"RECORD METADATA",children:e.jsxs(i,{container:!0,spacing:2,children:[e.jsx(i,{item:!0,xs:6,children:e.jsx(f,{label:"CREATED BY",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:y?y.first_name:r.created_by?`User ID: ${r.created_by}`:"System"})})}),e.jsx(i,{item:!0,xs:6,children:e.jsx(f,{label:"LAST EDITED BY",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:v?v.first_name:r.updated_by?`User ID: ${r.updated_by}`:"—"})})})]})})})]})})})]})}function Be({companyName:r,branches:l,onEdit:x,onDelete:m,users:s}){const[c,y]=u.useState(!1);return e.jsxs(le,{elevation:0,sx:{borderColor:c?"primary.main":"grey.200",p:2,mb:2,transition:"border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1)","&:hover":{borderColor:"primary.main",boxShadow:"0 8px 30px rgba(192, 18, 39, 0.08)"}},children:[e.jsxs(_,{direction:{xs:"column",md:"row"},spacing:3,alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",onClick:()=>y(!c),sx:{cursor:"pointer",userSelect:"none"},children:[e.jsxs(_,{direction:"row",spacing:2,alignItems:"center",children:[e.jsx(ge,{sx:{width:42,height:42,bgcolor:"primary.lighter",color:"primary.main",fontWeight:800,borderRadius:2},children:(r||"A")[0].toUpperCase()}),e.jsxs(h,{children:[e.jsx(a,{variant:"h5",sx:{fontWeight:800,lineHeight:1.2,color:"grey.900"},children:r||"Unknown Company"}),e.jsxs(a,{variant:"body2",sx:{color:"grey.600",mt:.5,display:"flex",alignItems:"center",gap:.5},children:[e.jsx(H,{sx:{fontSize:16}})," ",l.length," Location",l.length!==1&&"s"," Surveyed"]})]})]}),e.jsxs(_,{direction:"row",spacing:3,alignItems:"center",children:[e.jsxs(_,{direction:"row",spacing:1,sx:{display:{xs:"none",md:"flex"}},children:[e.jsx(T,{size:"small",label:"First Mile",sx:{bgcolor:"primary.lighter",color:"primary.main",fontWeight:700}}),e.jsx(T,{size:"small",label:"Mid Mile",sx:{bgcolor:"primary.lighter",color:"primary.main",fontWeight:700}}),e.jsx(T,{size:"small",label:"Last Mile",sx:{bgcolor:"primary.lighter",color:"primary.main",fontWeight:700}})]}),e.jsx(_,{direction:"row",spacing:1.5,alignItems:"center",children:e.jsx(k,{sx:{borderRadius:2,py:1,px:3,fontWeight:700,color:c?"primary.main":"grey.700",bgcolor:c?"primary.lighter":"grey.100","&:hover":{bgcolor:"primary.lighter",color:"primary.main"}},endIcon:c?e.jsx(be,{}):e.jsx(ve,{}),children:c?"Hide Locations":"View Locations"})})]})]}),e.jsx(re,{in:c,timeout:"auto",unmountOnExit:!0,children:e.jsx(h,{sx:{mt:2,pt:2,borderTop:"2px dashed",borderColor:"grey.200"},children:e.jsx(_,{spacing:1.5,children:l.map((v,p)=>e.jsx(Le,{row:v,onEdit:x,onDelete:m,users:s},v.id??p))})})})]})}function sr(){const[r,l]=u.useState([]),[x,m]=u.useState(!0),[s,c]=u.useState(""),[y,v]=u.useState(0),[p,I]=u.useState(5),[j,z]=u.useState(!1),[F,$]=u.useState(null),[S,E]=u.useState(null),[A,L]=u.useState(!1),[n,t]=u.useState(null),[d,W]=u.useState([]),w=()=>{let o=!1;return m(!0),Promise.all([we(),pe().catch(()=>[])]).then(([b,R])=>{o||(l(b.data||b||[]),W(R||[]))}).catch(b=>console.error("Error fetching data:",b)).finally(()=>{o||m(!1)}),()=>{o=!0}};u.useEffect(()=>w(),[]);const ce=async()=>{L(!0),t(null);try{await ue(S.id),E(null),w()}catch(o){t(o.message||"Failed to delete. Please try again.")}finally{L(!1)}},K=r.filter(o=>(o.company||"").toLowerCase().includes(s.toLowerCase())||(o.area||"").toLowerCase().includes(s.toLowerCase())||(o.phone||"").toLowerCase().includes(s.toLowerCase())),V=K.reduce((o,b)=>{const R=b.company||"Unknown Company";return o[R]||(o[R]=[]),o[R].push(b),o},{}),Z=Object.keys(V).sort(),Q=Z.slice(y*p,y*p+p),P={total:r.length,quoted:r.filter(o=>o.rate_per_kg&&!String(o.rate_per_kg).toLowerCase().includes("not answered")).length,missing:r.filter(o=>!o.rate_per_kg||String(o.rate_per_kg).toLowerCase().includes("not answered")).length};return e.jsxs(e.Fragment,{children:[e.jsx(Se,{title:"Field Surveys",breadcrumbs:[{label:"Survey Management"}]}),e.jsxs(i,{container:!0,spacing:2.5,sx:{mb:3},children:[e.jsx(i,{item:!0,xs:12,md:4,children:e.jsx(U,{accent:!0,title:"Total Enquiries",value:x?"…":P.total,icon:D,color:"primary",caption:"All field surveys"})}),e.jsx(i,{item:!0,xs:12,md:4,children:e.jsx(U,{accent:!0,title:"Rates Quoted",value:x?"…":P.quoted,icon:H,color:"success",caption:P.total?`${Math.round(P.quoted/P.total*100)}% of total`:"0% of total"})}),e.jsx(i,{item:!0,xs:12,md:4,children:e.jsx(U,{accent:!0,title:"Missing Info",value:x?"…":P.missing,icon:se,color:"warning",caption:P.total?`${Math.round(P.missing/P.total*100)}% of total`:"0% of total"})})]}),e.jsxs(le,{sx:{overflow:"hidden"},children:[e.jsxs(h,{sx:{px:{xs:2,sm:2.5},py:2,borderBottom:1,borderColor:"divider",display:"flex",alignItems:"center",gap:1.5,background:o=>`linear-gradient(90deg, ${o.palette.primary.lighter}66 0%, ${o.palette.background.paper} 70%)`},children:[e.jsx(h,{sx:{width:40,height:40,borderRadius:2,bgcolor:"primary.lighter",color:"primary.main",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx(D,{fontSize:"small"})}),e.jsxs(h,{children:[e.jsx(a,{variant:"subtitle1",sx:{fontWeight:700,color:"grey.800",lineHeight:1.2},children:"Survey Records"}),e.jsx(a,{variant:"caption",color:"text.secondary",children:"Manage business enquiry and survey data from the field"})]})]}),e.jsxs(_,{direction:{xs:"column",md:"row"},spacing:1.5,sx:{p:2},alignItems:{md:"center"},children:[e.jsx(g,{size:"small",placeholder:"Search by company, area or phone...",value:s,onChange:o=>{c(o.target.value),v(0)},sx:{width:{xs:"100%",md:300}},InputProps:{startAdornment:e.jsx(Ie,{position:"start",children:e.jsx(xe,{fontSize:"small"})})}}),e.jsx(h,{sx:{flexGrow:1}}),!x&&e.jsxs(a,{variant:"body2",color:"text.secondary",children:[K.length," records"]}),e.jsx(k,{variant:"contained",startIcon:e.jsx(q,{}),onClick:()=>{$(null),z(!0)},sx:{flex:{xs:1,md:"none"}},children:"Add New Survey"})]}),e.jsx(h,{sx:{p:2,bgcolor:"grey.50"},children:x?e.jsx(h,{sx:{display:"flex",justifyContent:"center",py:6},children:e.jsx(J,{})}):Q.length>0?e.jsx(h,{children:Q.map(o=>e.jsx(Be,{companyName:o,branches:V[o],onEdit:b=>{$(b),z(!0)},onDelete:b=>E(b),users:d},o))}):e.jsx(ke,{icon:D,title:"No survey records found.",caption:"Try adjusting your search filters."})}),e.jsx(fe,{component:"div",count:Z.length,page:y,onPageChange:(o,b)=>v(b),rowsPerPage:p,onRowsPerPageChange:o=>{I(parseInt(o.target.value,10)),v(0)},rowsPerPageOptions:[5,10,25],labelRowsPerPage:"Companies per page:"})]}),e.jsx($e,{open:j,onClose:()=>z(!1),onSave:()=>w(),initialData:F}),e.jsxs(te,{open:!!S,onClose:A?void 0:()=>{E(null),t(null)},children:[e.jsx(ie,{children:"Delete survey record?"}),e.jsxs(ne,{children:[e.jsxs(je,{children:["This will permanently remove the record for ",e.jsx("strong",{children:(S==null?void 0:S.area)||(S==null?void 0:S.company)}),". This cannot be undone."]}),n&&e.jsx(ae,{severity:"error",sx:{mt:2},children:n})]}),e.jsxs(oe,{sx:{px:3,py:2},children:[e.jsx(k,{onClick:()=>{E(null),t(null)},disabled:A,color:"inherit",children:"Cancel"}),e.jsx(k,{color:"error",variant:"contained",onClick:ce,disabled:A,startIcon:A?e.jsx(J,{size:16,color:"inherit"}):null,children:"Delete"})]})]})]})}export{sr as default}; diff --git a/dist/assets/Survey-DnRJ0EJJ.js b/dist/assets/Survey-DnRJ0EJJ.js deleted file mode 100644 index 2d48723..0000000 --- a/dist/assets/Survey-DnRJ0EJJ.js +++ /dev/null @@ -1 +0,0 @@ -import{r as de,j as e,i as he,b as u,B as h,T as a,S as _,l as xe,C as J,e as pe,p as ue,A as ge,n as re,M as C,I as M}from"./index-DpAn5wLF.js";import{d as me}from"./EditOutlined-B2ltVbl8.js";import{T as fe,d as ye}from"./DeleteOutline-BVDDlNca.js";import{d as se,D as je}from"./PhoneOutlined-CDgMDTyj.js";import{c as H,a as be,b as ve,d as N}from"./StorefrontOutlined-B0ka2NHy.js";import{d as _e}from"./LocalShippingOutlined-Ds2yAonP.js";import{d as Ce}from"./MapOutlined-QidbDh4A.js";import{d as q,D as te,a as ie,b as ne,c as oe,e as X}from"./Close-BdNf_RlN.js";import{P as Se,G as i,A as ae,C as T}from"./PageHeader-CEew5Fw4.js";import{S as U}from"./StatCard-Nzv53jX8.js";import{E as ke}from"./EmptyState-BsjYeVAX.js";import{C as le}from"./Link-Bme8npFv.js";import{T as g}from"./TextField-C0dUZvW0.js";import{I as Ie}from"./InputAdornment-BWnl4jqW.js";import{B as k}from"./Button-BGNvVfej.js";import{S as Pe}from"./Snackbar-B0wJYiYQ.js";import"./TableCell-PEGz6qo_.js";var G={},ze=he;Object.defineProperty(G,"__esModule",{value:!0});var D=G.default=void 0,We=ze(de()),Ee=e;D=G.default=(0,We.default)((0,Ee.jsx)("path",{d:"M7 15h7v2H7zm0-4h10v2H7zm0-4h10v2H7zm12-4h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-.14 0-.27.01-.4.04-.39.08-.74.28-1.01.55-.18.18-.33.4-.43.64-.1.23-.16.49-.16.77v14c0 .27.06.54.16.78s.25.45.43.64c.27.27.62.47 1.01.55.13.02.26.03.4.03h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-7-.25c.41 0 .75.34.75.75s-.34.75-.75.75-.75-.34-.75-.75.34-.75.75-.75M19 19H5V5h14z"}),"AssignmentOutlined");const O="https://api.doormile.com/api/v1",Y=()=>{const r=localStorage.getItem("auth_token");return{"Content-Type":"application/json",...r?{Authorization:`Bearer ${r}`}:{}}},Ae={textTransform:"uppercase",letterSpacing:.4,fontSize:"0.68rem",fontWeight:700,color:"grey.700"};function ee({label:r,color:l="default"}){return r?e.jsx(T,{size:"small",label:r,sx:{fontWeight:600,...l==="default"?{bgcolor:"grey.100",color:"grey.700"}:{bgcolor:`${l}.lighter`,color:`${l}.dark`}}}):e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:"grey.500"},children:"—"})}function f({label:r,children:l}){return e.jsxs(h,{children:[e.jsx(a,{variant:"caption",color:"text.secondary",sx:Ae,children:r}),e.jsx(h,{sx:{mt:.5},children:l})]})}function B({icon:r,title:l,children:x}){return e.jsxs(h,{sx:{height:"100%",borderRadius:2,border:1,borderColor:"divider",bgcolor:"background.paper",overflow:"hidden"},children:[e.jsxs(_,{direction:"row",spacing:1,alignItems:"center",sx:{px:2,py:1.25,borderBottom:1,borderColor:"divider",bgcolor:"primary.lighter"},children:[e.jsx(r,{sx:{fontSize:18,color:"primary.main"}}),e.jsx(a,{variant:"overline",sx:{fontWeight:700,color:"grey.800",letterSpacing:.6,lineHeight:1},children:l})]}),e.jsx(_,{spacing:2,sx:{p:2},children:x})]})}async function we(){const r=await fetch(`${O}/admin/competitor-branches?limit=1000`,{headers:Y()});if(!r.ok)throw new Error("Failed to fetch surveys");const l=await r.json(),x=Array.isArray(l)?l:l.data||[];return{data:x,total:x.length}}async function Re(r){const l=!!r.id,x=l?`${O}/admin/competitor-branches/${r.id}`:`${O}/admin/competitor-branches`,s=await fetch(x,{method:l?"PUT":"POST",headers:Y(),body:JSON.stringify(r)});if(!s.ok){const c=await s.json().catch(()=>({}));throw new Error(c.error||c.message||"Failed to save survey")}return s.status===204?{}:s.json().catch(()=>({}))}async function Te(r){const l=!!r.id,x=l?`${O}/admin/carrier-pricing/${r.id}`:`${O}/admin/carrier-pricing`,s=await fetch(x,{method:l?"PUT":"POST",headers:Y(),body:JSON.stringify({company:r.company,weight_slab:r.weight_slab,zone:r.zone||"",service_type:r.service_type||"",rate:String(r.rate)})});if(!s.ok){const c=await s.json().catch(()=>({}));throw new Error(c.error||c.message||"Failed to save pricing")}return s.status===204?{}:s.json().catch(()=>({}))}const De=["Local / Same","Within Tamilnadu","Interstate India"],Oe=["< 500g","500g - 1kg","1kg - 2kg","2kg - 5kg","> 5kg"];function $e({open:r,onClose:l,onSave:x,initialData:m}){const[s,c]=u.useState({}),[y,v]=u.useState(!1),[p,I]=u.useState(null);u.useEffect(()=>{r&&(c(m?{...m,pincodes:m.pincodes?m.pincodes.split(",").map(n=>n.trim()).filter(Boolean):[]}:{company:"",area:"",phone:"",rate_per_kg:"",offers_pickup:"no",offers_drop:"no",packing_charge:"",time_in_days:"",plus_code:"",address:"",frequency:"",pincodes:[],slabs:[]}),I(null))},[r,m]);const j=n=>t=>{c(d=>({...d,[n]:t.target.value}))},z=(n,t)=>d=>{const W=[...s.slabs||[]];W[n]={...W[n],[t]:d.target.value},c(w=>({...w,slabs:W}))},F=()=>{c(n=>({...n,slabs:[...n.slabs||[],{weight_slab:"",zone:"",service_type:"",rate:""}]}))},$=n=>{const t=[...s.slabs||[]];t.splice(n,1),c(d=>({...d,slabs:t}))},S=n=>t=>{const d=[...s.pincodes||[]];d[n]=t.target.value,c(W=>({...W,pincodes:d}))},E=()=>{c(n=>({...n,pincodes:[...n.pincodes||[],""]}))},A=n=>{const t=[...s.pincodes||[]];t.splice(n,1),c(d=>({...d,pincodes:t}))},L=async()=>{v(!0),I(null);try{if(s.pincodes&&s.pincodes.length>0){const t=s.pincodes.filter(d=>d.trim()&&!/^\d{6}$/.test(d.trim()));if(t.length>0)throw new Error(`Invalid pincodes detected: ${t.join(", ")}. All pincodes must be exactly 6 numeric digits.`)}const n={...s.id?{id:s.id}:{},company:s.company||"",area:s.area||"",phone:s.phone||"",rate_per_kg:s.rate_per_kg||"",offers_pickup:s.offers_pickup||"no",offers_drop:s.offers_drop||"no",packing_charge:s.packing_charge||"",time_in_days:s.time_in_days||"",plus_code:s.plus_code||"",address:s.address||"",frequency:s.frequency||"",pincodes:s.pincodes?s.pincodes.join(","):""};if(await Re(n),s.slabs&&s.slabs.length>0&&s.company)try{await Promise.all(s.slabs.map(t=>t.weight_slab&&t.rate?Te({company:s.company,weight_slab:t.weight_slab,zone:t.zone||"",service_type:t.service_type||"",rate:t.rate}):Promise.resolve()))}catch(t){console.error("Failed to save pricing slabs",t)}x(),l()}catch(n){console.error(n),I(n.message||"Failed to save. Please try again.")}finally{v(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(Pe,{open:!!p,autoHideDuration:6e3,onClose:()=>I(null),anchorOrigin:{vertical:"top",horizontal:"right"},sx:{zIndex:9999},children:e.jsx(ae,{onClose:()=>I(null),severity:"error",variant:"filled",sx:{width:"100%",boxShadow:3},children:p})}),e.jsxs(te,{open:r,onClose:y?void 0:l,maxWidth:"sm",fullWidth:!0,children:[e.jsx(ie,{sx:{fontWeight:800},children:m?"Edit Survey Record":"Add New Survey"}),e.jsx(ne,{dividers:!0,children:e.jsxs(i,{container:!0,spacing:2,children:[e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsx(g,{fullWidth:!0,label:"Company",value:s.company||"",onChange:j("company"),size:"small"})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsx(g,{fullWidth:!0,label:"Area / Zone",value:s.area||"",onChange:j("area"),size:"small"})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsx(g,{fullWidth:!0,label:"Phone",value:s.phone||"",onChange:j("phone"),size:"small"})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsx(g,{fullWidth:!0,label:"Rate Per KG",value:s.rate_per_kg||"",onChange:j("rate_per_kg"),size:"small"})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsxs(g,{select:!0,fullWidth:!0,label:"Offers Pickup",value:s.offers_pickup||"no",onChange:j("offers_pickup"),size:"small",children:[e.jsx(C,{value:"yes",children:"Yes"}),e.jsx(C,{value:"no",children:"No"})]})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsxs(g,{select:!0,fullWidth:!0,label:"Offers Drop",value:s.offers_drop||"no",onChange:j("offers_drop"),size:"small",children:[e.jsx(C,{value:"yes",children:"Yes"}),e.jsx(C,{value:"no",children:"No"})]})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsx(g,{fullWidth:!0,label:"Time in Days",value:s.time_in_days||"",onChange:j("time_in_days"),size:"small"})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsx(g,{fullWidth:!0,label:"Packing Charge",value:s.packing_charge||"",onChange:j("packing_charge"),size:"small"})}),e.jsx(i,{item:!0,xs:12,sm:6,children:e.jsxs(g,{select:!0,fullWidth:!0,label:"Frequency",value:s.frequency||"",onChange:j("frequency"),size:"small",children:[e.jsx(C,{value:"Daily",children:"Daily"}),e.jsx(C,{value:"Weekly",children:"Weekly"}),e.jsx(C,{value:"Bi-weekly",children:"Bi-weekly"}),e.jsx(C,{value:"Monthly",children:"Monthly"}),e.jsx(C,{value:"On-demand",children:"On-demand"})]})}),e.jsx(i,{item:!0,xs:12,children:e.jsx(g,{fullWidth:!0,label:"Plus Code",value:s.plus_code||"",onChange:j("plus_code"),size:"small"})}),e.jsx(i,{item:!0,xs:12,children:e.jsxs(h,{sx:{mt:1,pt:2,borderTop:"1px dashed",borderColor:"divider"},children:[e.jsxs(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[e.jsx(a,{variant:"subtitle2",sx:{fontWeight:700,color:"primary.main",letterSpacing:.5},children:"SERVICEABLE PINCODES"}),e.jsx(k,{size:"small",startIcon:e.jsx(q,{}),onClick:E,sx:{fontWeight:600},children:"Add Pincode"})]}),(s.pincodes||[]).map((n,t)=>e.jsxs(i,{container:!0,spacing:1.5,sx:{mb:1.5,alignItems:"center"},children:[e.jsx(i,{item:!0,xs:10,sm:11,children:e.jsx(g,{fullWidth:!0,label:`Pincode ${t+1}`,value:n,onChange:S(t),size:"small",placeholder:"e.g. 600001",inputProps:{maxLength:6}})}),e.jsx(i,{item:!0,xs:2,sm:1,children:e.jsx(M,{size:"small",color:"error",onClick:()=>A(t),children:e.jsx(X,{fontSize:"small"})})})]},t)),(!s.pincodes||s.pincodes.length===0)&&e.jsx(a,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",py:2,bgcolor:"grey.50",borderRadius:1,border:"1px dashed",borderColor:"grey.300"},children:"Click 'Add Pincode' to assign locations to this competitor."})]})}),e.jsx(i,{item:!0,xs:12,children:e.jsx(g,{fullWidth:!0,multiline:!0,rows:2,label:"Address",value:s.address||"",onChange:j("address"),size:"small"})}),e.jsx(i,{item:!0,xs:12,children:e.jsxs(h,{sx:{mt:1,pt:2,borderTop:"1px dashed",borderColor:"divider"},children:[e.jsxs(h,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2},children:[e.jsx(a,{variant:"subtitle2",sx:{fontWeight:700,color:"primary.main",letterSpacing:.5},children:"PRICING SLABS (OPTIONAL)"}),e.jsx(k,{size:"small",startIcon:e.jsx(q,{}),onClick:F,sx:{fontWeight:600},children:"Add Slab"})]}),(s.slabs||[]).map((n,t)=>e.jsxs(i,{container:!0,spacing:1.5,sx:{mb:1.5,alignItems:"center"},children:[e.jsx(i,{item:!0,xs:6,sm:3,children:e.jsx(g,{select:!0,fullWidth:!0,label:"Weight Slab",value:n.weight_slab||"",onChange:z(t,"weight_slab"),size:"small",children:Oe.map(d=>e.jsx(C,{value:d,children:d},d))})}),e.jsx(i,{item:!0,xs:6,sm:3,children:e.jsx(g,{select:!0,fullWidth:!0,label:"Zone",value:n.zone||"",onChange:z(t,"zone"),size:"small",children:De.map(d=>e.jsx(C,{value:d,children:d},d))})}),e.jsx(i,{item:!0,xs:6,sm:3,children:e.jsx(g,{fullWidth:!0,label:"Service Type",value:n.service_type||"",onChange:z(t,"service_type"),size:"small",placeholder:"e.g. Air"})}),e.jsx(i,{item:!0,xs:4,sm:2,children:e.jsx(g,{fullWidth:!0,label:"Rate (₹)",value:n.rate||"",onChange:z(t,"rate"),size:"small",placeholder:"e.g. 25"})}),e.jsx(i,{item:!0,xs:2,sm:1,children:e.jsx(M,{size:"small",color:"error",onClick:()=>$(t),children:e.jsx(X,{fontSize:"small"})})})]},t)),(!s.slabs||s.slabs.length===0)&&e.jsx(a,{variant:"body2",color:"text.secondary",sx:{textAlign:"center",py:2,bgcolor:"grey.50",borderRadius:1,border:"1px dashed",borderColor:"grey.300"},children:"Click 'Add Slab' to add pricing entries for this competitor."})]})})]})}),e.jsxs(oe,{sx:{p:2,bgcolor:"grey.50"},children:[e.jsx(k,{onClick:l,disabled:y,color:"inherit",children:"Cancel"}),e.jsx(k,{onClick:L,disabled:y,variant:"contained",children:y?"Saving...":"Save Record"})]})]})]})}function Le({row:r,onEdit:l,onDelete:x,users:m}){const[s,c]=u.useState(!1),y=m.find(p=>p.id===r.created_by),v=m.find(p=>p.id===r.updated_by);return e.jsxs(h,{sx:{p:1.5,py:1.25,borderRadius:2,border:"1px solid",borderColor:"divider",bgcolor:"background.paper",transition:"border-color 0.2s ease, box-shadow 0.2s ease","&:hover":{borderColor:"primary.main",boxShadow:"0 4px 12px rgba(192, 18, 39, 0.05)"}},children:[e.jsxs(i,{container:!0,spacing:2,alignItems:"center",onClick:()=>c(!s),sx:{cursor:"pointer",userSelect:"none"},children:[e.jsx(i,{item:!0,xs:12,md:4.5,children:e.jsxs(_,{direction:"row",spacing:1.5,alignItems:"center",children:[e.jsx(h,{sx:{p:1,borderRadius:1.5,bgcolor:"primary.lighter",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(N,{sx:{color:"primary.main",fontSize:18}})}),e.jsxs(h,{children:[e.jsx(a,{variant:"subtitle2",sx:{fontWeight:700,color:"grey.900",lineHeight:1.2},children:r.area||"Unknown Area"}),e.jsxs(a,{variant:"caption",sx:{color:"grey.600",display:"flex",alignItems:"center",gap:.5,mt:.25},children:[e.jsx(se,{sx:{fontSize:12}})," ",r.phone||"—"]})]})]})}),e.jsx(i,{item:!0,xs:6,md:3.5,children:e.jsxs(h,{children:[e.jsx(a,{variant:"caption",sx:{color:"grey.500",fontWeight:700,letterSpacing:.5,display:"block",mb:.5},children:"RATE PER KG"}),e.jsx(ee,{label:r.rate_per_kg,color:!r.rate_per_kg||r.rate_per_kg.toLowerCase().includes("not answered")||r.rate_per_kg.toLowerCase().includes("wrong number")?"warning":"success"})]})}),e.jsx(i,{item:!0,xs:6,md:2,children:e.jsxs(h,{children:[e.jsx(a,{variant:"caption",sx:{color:"grey.500",fontWeight:700,letterSpacing:.5,display:"block",mb:.5},children:"LOGISTICS"}),e.jsx(a,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},children:r.offers_pickup==="yes"||r.offers_drop==="yes"?`${r.offers_pickup==="yes"?"Pickup":""} ${r.offers_drop==="yes"?"Drop":""}`:"—"})]})}),e.jsxs(i,{item:!0,xs:12,md:2,sx:{display:"flex",justifyContent:{xs:"flex-start",md:"flex-end"},alignItems:"center",gap:.5},children:[e.jsx(k,{size:"small",sx:{borderRadius:1.5,color:s?"primary.main":"grey.700",bgcolor:s?"primary.lighter":"transparent","&:hover":{bgcolor:"primary.lighter",color:"primary.main"}},children:s?"Hide Info":"More Info"}),e.jsx(M,{size:"small",onClick:p=>{p.stopPropagation(),l(r)},sx:{color:"grey.400","&:hover":{color:"primary.main",bgcolor:"primary.lighter"}},children:e.jsx(me,{fontSize:"small"})}),e.jsx(M,{size:"small",onClick:p=>{p.stopPropagation(),x(r)},sx:{color:"grey.400","&:hover":{color:"error.main",bgcolor:"error.lighter"}},children:e.jsx(ye,{fontSize:"small"})})]})]}),e.jsx(re,{in:s,timeout:"auto",unmountOnExit:!0,children:e.jsx(h,{sx:{mt:2.5,pt:2.5,borderTop:"1px dashed",borderColor:"divider"},children:e.jsxs(i,{container:!0,spacing:2,alignItems:"stretch",children:[e.jsx(i,{item:!0,xs:12,md:4,children:e.jsxs(B,{icon:H,title:"ENQUIRY DETAILS",children:[e.jsx(f,{label:"RATE PER KG",children:e.jsx(ee,{label:r.rate_per_kg,color:"success"})}),e.jsx(f,{label:"PICKUP",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:r.offers_pickup?"grey.800":"grey.500"},children:r.offers_pickup||"—"})}),e.jsx(f,{label:"DROP",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:r.offers_drop?"grey.800":"grey.500"},children:r.offers_drop||"—"})}),e.jsx(f,{label:"PACKING",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:r.packing_charge?"grey.800":"grey.500"},children:r.packing_charge||"—"})})]})}),e.jsx(i,{item:!0,xs:12,md:4,children:e.jsxs(B,{icon:_e,title:"LOGISTICS & OPS",children:[e.jsx(f,{label:"TIME IN DAYS",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:r.time_in_days?"grey.800":"grey.500"},children:r.time_in_days||"—"})}),e.jsx(f,{label:"COMPANY",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:r.company||"—"})}),e.jsx(f,{label:"FREQUENCY",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:r.frequency||"—"})}),e.jsx(f,{label:"CONTACT NUMBER",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:r.phone||"—"})})]})}),e.jsx(i,{item:!0,xs:12,md:4,children:e.jsxs(B,{icon:N,title:"LOCATION & PINCODE",children:[e.jsx(f,{label:"AREA / ZONE",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:r.area||"—"})}),e.jsx(f,{label:"SERVICEABLE PINCODES",children:r.pincodes?e.jsx(h,{sx:{display:"flex",gap:.5,flexWrap:"wrap",mt:.5},children:r.pincodes.split(",").map((p,I)=>e.jsx(T,{label:p.trim(),size:"small",sx:{fontSize:"0.7rem",height:20}},I))}):e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:"grey.500"},children:"—"})}),e.jsx(f,{label:"PLUS CODE",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:r.plus_code?"grey.800":"grey.500"},children:r.plus_code||"—"})}),e.jsx(f,{label:"FULL ADDRESS",children:e.jsxs(_,{spacing:1.5,children:[e.jsxs(_,{direction:"row",spacing:1,sx:{p:1.5,borderRadius:1.5,bgcolor:"grey.50",border:1,borderColor:"divider"},children:[e.jsx(N,{sx:{fontSize:16,color:"grey.400",mt:"2px"}}),e.jsx(a,{variant:"body2",sx:{color:"grey.800",lineHeight:1.5},children:r.address||"—"})]}),(r.address||r.plus_code)&&e.jsx(k,{component:"a",href:`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(r.plus_code?r.plus_code+" "+(r.address||""):r.address)}`,target:"_blank",rel:"noopener",size:"small",variant:"outlined",startIcon:e.jsx(Ce,{sx:{fontSize:16}}),sx:{alignSelf:"flex-start",py:.5,px:1.5,fontSize:"0.75rem",fontWeight:600,borderRadius:2,color:"primary.main",borderColor:"primary.light",bgcolor:"primary.lighter","&:hover":{borderColor:"primary.main",bgcolor:"primary.lighter"}},children:"View on map"})]})})]})}),e.jsx(i,{item:!0,xs:12,children:e.jsx(B,{icon:D,title:"RECORD METADATA",children:e.jsxs(i,{container:!0,spacing:2,children:[e.jsx(i,{item:!0,xs:6,children:e.jsx(f,{label:"CREATED BY",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:y?y.first_name:r.created_by?`User ID: ${r.created_by}`:"System"})})}),e.jsx(i,{item:!0,xs:6,children:e.jsx(f,{label:"LAST EDITED BY",children:e.jsx(a,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:v?v.first_name:r.updated_by?`User ID: ${r.updated_by}`:"—"})})})]})})})]})})})]})}function Be({companyName:r,branches:l,onEdit:x,onDelete:m,users:s}){const[c,y]=u.useState(!1);return e.jsxs(le,{elevation:0,sx:{borderColor:c?"primary.main":"grey.200",p:2,mb:2,transition:"border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1)","&:hover":{borderColor:"primary.main",boxShadow:"0 8px 30px rgba(192, 18, 39, 0.08)"}},children:[e.jsxs(_,{direction:{xs:"column",md:"row"},spacing:3,alignItems:{xs:"flex-start",md:"center"},justifyContent:"space-between",onClick:()=>y(!c),sx:{cursor:"pointer",userSelect:"none"},children:[e.jsxs(_,{direction:"row",spacing:2,alignItems:"center",children:[e.jsx(ge,{sx:{width:42,height:42,bgcolor:"primary.lighter",color:"primary.main",fontWeight:800,borderRadius:2},children:(r||"A")[0].toUpperCase()}),e.jsxs(h,{children:[e.jsx(a,{variant:"h5",sx:{fontWeight:800,lineHeight:1.2,color:"grey.900"},children:r||"Unknown Company"}),e.jsxs(a,{variant:"body2",sx:{color:"grey.600",mt:.5,display:"flex",alignItems:"center",gap:.5},children:[e.jsx(H,{sx:{fontSize:16}})," ",l.length," Location",l.length!==1&&"s"," Surveyed"]})]})]}),e.jsxs(_,{direction:"row",spacing:3,alignItems:"center",children:[e.jsxs(_,{direction:"row",spacing:1,sx:{display:{xs:"none",md:"flex"}},children:[e.jsx(T,{size:"small",label:"First Mile",sx:{bgcolor:"primary.lighter",color:"primary.main",fontWeight:700}}),e.jsx(T,{size:"small",label:"Mid Mile",sx:{bgcolor:"primary.lighter",color:"primary.main",fontWeight:700}}),e.jsx(T,{size:"small",label:"Last Mile",sx:{bgcolor:"primary.lighter",color:"primary.main",fontWeight:700}})]}),e.jsx(_,{direction:"row",spacing:1.5,alignItems:"center",children:e.jsx(k,{sx:{borderRadius:2,py:1,px:3,fontWeight:700,color:c?"primary.main":"grey.700",bgcolor:c?"primary.lighter":"grey.100","&:hover":{bgcolor:"primary.lighter",color:"primary.main"}},endIcon:c?e.jsx(be,{}):e.jsx(ve,{}),children:c?"Hide Locations":"View Locations"})})]})]}),e.jsx(re,{in:c,timeout:"auto",unmountOnExit:!0,children:e.jsx(h,{sx:{mt:2,pt:2,borderTop:"2px dashed",borderColor:"grey.200"},children:e.jsx(_,{spacing:1.5,children:l.map((v,p)=>e.jsx(Le,{row:v,onEdit:x,onDelete:m,users:s},v.id??p))})})})]})}function tr(){const[r,l]=u.useState([]),[x,m]=u.useState(!0),[s,c]=u.useState(""),[y,v]=u.useState(0),[p,I]=u.useState(5),[j,z]=u.useState(!1),[F,$]=u.useState(null),[S,E]=u.useState(null),[A,L]=u.useState(!1),[n,t]=u.useState(null),[d,W]=u.useState([]),w=()=>{let o=!1;return m(!0),Promise.all([we(),pe().catch(()=>[])]).then(([b,R])=>{o||(l(b.data||b||[]),W(R||[]))}).catch(b=>console.error("Error fetching data:",b)).finally(()=>{o||m(!1)}),()=>{o=!0}};u.useEffect(()=>w(),[]);const ce=async()=>{L(!0),t(null);try{await ue(S.id),E(null),w()}catch(o){t(o.message||"Failed to delete. Please try again.")}finally{L(!1)}},K=r.filter(o=>(o.company||"").toLowerCase().includes(s.toLowerCase())||(o.area||"").toLowerCase().includes(s.toLowerCase())||(o.phone||"").toLowerCase().includes(s.toLowerCase())),V=K.reduce((o,b)=>{const R=b.company||"Unknown Company";return o[R]||(o[R]=[]),o[R].push(b),o},{}),Z=Object.keys(V).sort(),Q=Z.slice(y*p,y*p+p),P={total:r.length,quoted:r.filter(o=>o.rate_per_kg&&!String(o.rate_per_kg).toLowerCase().includes("not answered")).length,missing:r.filter(o=>!o.rate_per_kg||String(o.rate_per_kg).toLowerCase().includes("not answered")).length};return e.jsxs(e.Fragment,{children:[e.jsx(Se,{title:"Field Surveys",breadcrumbs:[{label:"Survey Management"}]}),e.jsxs(i,{container:!0,spacing:2.5,sx:{mb:3},children:[e.jsx(i,{item:!0,xs:12,md:4,children:e.jsx(U,{accent:!0,title:"Total Enquiries",value:x?"…":P.total,icon:D,color:"primary",caption:"All field surveys"})}),e.jsx(i,{item:!0,xs:12,md:4,children:e.jsx(U,{accent:!0,title:"Rates Quoted",value:x?"…":P.quoted,icon:H,color:"success",caption:P.total?`${Math.round(P.quoted/P.total*100)}% of total`:"0% of total"})}),e.jsx(i,{item:!0,xs:12,md:4,children:e.jsx(U,{accent:!0,title:"Missing Info",value:x?"…":P.missing,icon:se,color:"warning",caption:P.total?`${Math.round(P.missing/P.total*100)}% of total`:"0% of total"})})]}),e.jsxs(le,{sx:{overflow:"hidden"},children:[e.jsxs(h,{sx:{px:{xs:2,sm:2.5},py:2,borderBottom:1,borderColor:"divider",display:"flex",alignItems:"center",gap:1.5,background:o=>`linear-gradient(90deg, ${o.palette.primary.lighter}66 0%, ${o.palette.background.paper} 70%)`},children:[e.jsx(h,{sx:{width:40,height:40,borderRadius:2,bgcolor:"primary.lighter",color:"primary.main",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx(D,{fontSize:"small"})}),e.jsxs(h,{children:[e.jsx(a,{variant:"subtitle1",sx:{fontWeight:700,color:"grey.800",lineHeight:1.2},children:"Survey Records"}),e.jsx(a,{variant:"caption",color:"text.secondary",children:"Manage business enquiry and survey data from the field"})]})]}),e.jsxs(_,{direction:{xs:"column",md:"row"},spacing:1.5,sx:{p:2},alignItems:{md:"center"},children:[e.jsx(g,{size:"small",placeholder:"Search by company, area or phone...",value:s,onChange:o=>{c(o.target.value),v(0)},sx:{width:{xs:"100%",md:300}},InputProps:{startAdornment:e.jsx(Ie,{position:"start",children:e.jsx(xe,{fontSize:"small"})})}}),e.jsx(h,{sx:{flexGrow:1}}),!x&&e.jsxs(a,{variant:"body2",color:"text.secondary",children:[K.length," records"]}),e.jsx(k,{variant:"contained",startIcon:e.jsx(q,{}),onClick:()=>{$(null),z(!0)},sx:{flex:{xs:1,md:"none"}},children:"Add New Survey"})]}),e.jsx(h,{sx:{p:2,bgcolor:"grey.50"},children:x?e.jsx(h,{sx:{display:"flex",justifyContent:"center",py:6},children:e.jsx(J,{})}):Q.length>0?e.jsx(h,{children:Q.map(o=>e.jsx(Be,{companyName:o,branches:V[o],onEdit:b=>{$(b),z(!0)},onDelete:b=>E(b),users:d},o))}):e.jsx(ke,{icon:D,title:"No survey records found.",caption:"Try adjusting your search filters."})}),e.jsx(fe,{component:"div",count:Z.length,page:y,onPageChange:(o,b)=>v(b),rowsPerPage:p,onRowsPerPageChange:o=>{I(parseInt(o.target.value,10)),v(0)},rowsPerPageOptions:[5,10,25],labelRowsPerPage:"Companies per page:"})]}),e.jsx($e,{open:j,onClose:()=>z(!1),onSave:()=>w(),initialData:F}),e.jsxs(te,{open:!!S,onClose:A?void 0:()=>{E(null),t(null)},children:[e.jsx(ie,{children:"Delete survey record?"}),e.jsxs(ne,{children:[e.jsxs(je,{children:["This will permanently remove the record for ",e.jsx("strong",{children:(S==null?void 0:S.area)||(S==null?void 0:S.company)}),". This cannot be undone."]}),n&&e.jsx(ae,{severity:"error",sx:{mt:2},children:n})]}),e.jsxs(oe,{sx:{px:3,py:2},children:[e.jsx(k,{onClick:()=>{E(null),t(null)},disabled:A,color:"inherit",children:"Cancel"}),e.jsx(k,{color:"error",variant:"contained",onClick:ce,disabled:A,startIcon:A?e.jsx(J,{size:16,color:"inherit"}):null,children:"Delete"})]})]})]})}export{tr as default}; diff --git a/dist/assets/SwitchBase-1TkNOx4a.js b/dist/assets/SwitchBase-CWj2k0Bo.js similarity index 96% rename from dist/assets/SwitchBase-1TkNOx4a.js rename to dist/assets/SwitchBase-CWj2k0Bo.js index f2583d5..fa39cfe 100644 --- a/dist/assets/SwitchBase-1TkNOx4a.js +++ b/dist/assets/SwitchBase-CWj2k0Bo.js @@ -1 +1 @@ -import{x as G,y as H,b as J,E as W,s as Y,at as Z,_ as i,j as C,F as $,G as A,H as D,J as F,Z as K,Y as Q}from"./index-DpAn5wLF.js";function T(e){return G("PrivateSwitchBase",e)}H("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const V=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],X=e=>{const{classes:o,checked:d,disabled:l,edge:a}=e,r={root:["root",d&&"checked",l&&"disabled",a&&`edge${A(a)}`],input:["input"]};return D(r,T,o)},ee=F(K,{name:"MuiSwitchBase"})(({ownerState:e})=>i({padding:9,borderRadius:"50%"},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12})),se=F("input",{name:"MuiSwitchBase",shouldForwardProp:Q})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),oe=J.forwardRef(function(o,d){const{autoFocus:l,checked:a,checkedIcon:r,className:w,defaultChecked:h,disabled:y,disableFocusRipple:p=!1,edge:S=!1,icon:R,id:P,inputProps:I,inputRef:v,name:j,onBlur:f,onChange:g,onFocus:m,readOnly:E,required:z=!1,tabIndex:N,type:c,value:b}=o,U=W(o,V),[B,_]=Y({controlled:a,default:!!h,name:"SwitchBase",state:"checked"}),t=Z(),L=s=>{m&&m(s),t&&t.onFocus&&t.onFocus(s)},q=s=>{f&&f(s),t&&t.onBlur&&t.onBlur(s)},M=s=>{if(s.nativeEvent.defaultPrevented)return;const x=s.target.checked;_(x),g&&g(s,x)};let n=y;t&&typeof n>"u"&&(n=t.disabled);const O=c==="checkbox"||c==="radio",u=i({},o,{checked:B,disabled:n,disableFocusRipple:p,edge:S}),k=X(u);return C.jsxs(ee,i({component:"span",className:$(k.root,w),centerRipple:!0,focusRipple:!p,disabled:n,tabIndex:null,role:void 0,onFocus:L,onBlur:q,ownerState:u,ref:d},U,{children:[C.jsx(se,i({autoFocus:l,checked:a,defaultChecked:h,className:k.input,disabled:n,id:O?P:void 0,name:j,onChange:M,readOnly:E,ref:v,required:z,ownerState:u,tabIndex:N,type:c},c==="checkbox"&&b===void 0?{}:{value:b},I)),B?r:R]}))});export{oe as S}; +import{x as G,y as H,b as J,E as W,s as Y,at as Z,_ as i,j as C,F as $,G as A,H as D,J as F,Z as K,Y as Q}from"./index-D7LVXeIK.js";function T(e){return G("PrivateSwitchBase",e)}H("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const V=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],X=e=>{const{classes:o,checked:d,disabled:l,edge:a}=e,r={root:["root",d&&"checked",l&&"disabled",a&&`edge${A(a)}`],input:["input"]};return D(r,T,o)},ee=F(K,{name:"MuiSwitchBase"})(({ownerState:e})=>i({padding:9,borderRadius:"50%"},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12})),se=F("input",{name:"MuiSwitchBase",shouldForwardProp:Q})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),oe=J.forwardRef(function(o,d){const{autoFocus:l,checked:a,checkedIcon:r,className:w,defaultChecked:h,disabled:y,disableFocusRipple:p=!1,edge:S=!1,icon:R,id:P,inputProps:I,inputRef:v,name:j,onBlur:f,onChange:g,onFocus:m,readOnly:E,required:z=!1,tabIndex:N,type:c,value:b}=o,U=W(o,V),[B,_]=Y({controlled:a,default:!!h,name:"SwitchBase",state:"checked"}),t=Z(),L=s=>{m&&m(s),t&&t.onFocus&&t.onFocus(s)},q=s=>{f&&f(s),t&&t.onBlur&&t.onBlur(s)},M=s=>{if(s.nativeEvent.defaultPrevented)return;const x=s.target.checked;_(x),g&&g(s,x)};let n=y;t&&typeof n>"u"&&(n=t.disabled);const O=c==="checkbox"||c==="radio",u=i({},o,{checked:B,disabled:n,disableFocusRipple:p,edge:S}),k=X(u);return C.jsxs(ee,i({component:"span",className:$(k.root,w),centerRipple:!0,focusRipple:!p,disabled:n,tabIndex:null,role:void 0,onFocus:L,onBlur:q,ownerState:u,ref:d},U,{children:[C.jsx(se,i({autoFocus:l,checked:a,defaultChecked:h,className:k.input,disabled:n,id:O?P:void 0,name:j,onChange:M,readOnly:E,ref:v,required:z,ownerState:u,tabIndex:N,type:c},c==="checkbox"&&b===void 0?{}:{value:b},I)),B?r:R]}))});export{oe as S}; diff --git a/dist/assets/TabLabelCount-C_C4hO8i.js b/dist/assets/TabLabelCount-1dep75sI.js similarity index 93% rename from dist/assets/TabLabelCount-C_C4hO8i.js rename to dist/assets/TabLabelCount-1dep75sI.js index 39fe756..b0b3cd9 100644 --- a/dist/assets/TabLabelCount-C_C4hO8i.js +++ b/dist/assets/TabLabelCount-1dep75sI.js @@ -1 +1 @@ -import{r as c,j as r,i as s,S as o,B as h}from"./index-DpAn5wLF.js";var t={},d=s;Object.defineProperty(t,"__esModule",{value:!0});var l=t.default=void 0,u=d(c()),e=r;l=t.default=(0,u.default)([(0,e.jsx)("path",{d:"M14 12h4v1.5h-4zm0 3h4v1.5h-4z"},"0"),(0,e.jsx)("path",{d:"M20 7h-5V4c0-1.1-.9-2-2-2h-2c-1.1 0-2 .9-2 2v3H4c-1.1 0-2 .9-2 2v11c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2m-9 0V4h2v5h-2zm9 13H4V9h5c0 1.1.9 2 2 2h2c1.1 0 2-.9 2-2h5z"},"1"),(0,e.jsx)("circle",{cx:"9",cy:"13.5",r:"1.5"},"2"),(0,e.jsx)("path",{d:"M11.08 16.18c-.64-.28-1.34-.43-2.08-.43s-1.44.15-2.08.43c-.56.24-.92.78-.92 1.39V18h6v-.43c0-.61-.36-1.15-.92-1.39"},"3")],"BadgeOutlined");function p({label:i,count:n,active:a=!1}){return r.jsxs(o,{direction:"row",alignItems:"center",spacing:1,children:[r.jsx("span",{children:i}),r.jsx(h,{component:"span",sx:{minWidth:20,height:20,px:.75,borderRadius:10,fontSize:"0.72rem",fontWeight:700,lineHeight:"20px",textAlign:"center",bgcolor:a?"primary.main":"grey.200",color:a?"#fff":"text.secondary"},children:n})]})}export{p as T,l as d}; +import{r as c,j as r,i as s,S as o,B as h}from"./index-D7LVXeIK.js";var t={},d=s;Object.defineProperty(t,"__esModule",{value:!0});var l=t.default=void 0,u=d(c()),e=r;l=t.default=(0,u.default)([(0,e.jsx)("path",{d:"M14 12h4v1.5h-4zm0 3h4v1.5h-4z"},"0"),(0,e.jsx)("path",{d:"M20 7h-5V4c0-1.1-.9-2-2-2h-2c-1.1 0-2 .9-2 2v3H4c-1.1 0-2 .9-2 2v11c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V9c0-1.1-.9-2-2-2m-9 0V4h2v5h-2zm9 13H4V9h5c0 1.1.9 2 2 2h2c1.1 0 2-.9 2-2h5z"},"1"),(0,e.jsx)("circle",{cx:"9",cy:"13.5",r:"1.5"},"2"),(0,e.jsx)("path",{d:"M11.08 16.18c-.64-.28-1.34-.43-2.08-.43s-1.44.15-2.08.43c-.56.24-.92.78-.92 1.39V18h6v-.43c0-.61-.36-1.15-.92-1.39"},"3")],"BadgeOutlined");function p({label:i,count:n,active:a=!1}){return r.jsxs(o,{direction:"row",alignItems:"center",spacing:1,children:[r.jsx("span",{children:i}),r.jsx(h,{component:"span",sx:{minWidth:20,height:20,px:.75,borderRadius:10,fontSize:"0.72rem",fontWeight:700,lineHeight:"20px",textAlign:"center",bgcolor:a?"primary.main":"grey.200",color:a?"#fff":"text.secondary"},children:n})]})}export{p as T,l as d}; diff --git a/dist/assets/TableCell-PEGz6qo_.js b/dist/assets/TableCell-DreGbAeW.js similarity index 97% rename from dist/assets/TableCell-PEGz6qo_.js rename to dist/assets/TableCell-DreGbAeW.js index 765aec0..c934d60 100644 --- a/dist/assets/TableCell-PEGz6qo_.js +++ b/dist/assets/TableCell-DreGbAeW.js @@ -1,2 +1,2 @@ -import{b as l,x as R,y as $,z as P,E as _,_ as b,j,F as A,G as s,H as M,J as D,ac as N,O as z,ad as U}from"./index-DpAn5wLF.js";const E=l.createContext(),W=l.createContext();function J(a){return R("MuiTableCell",a)}const L=$("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),B=["align","className","component","padding","scope","size","sortDirection","variant"],F=a=>{const{classes:e,variant:i,align:o,padding:r,size:g,stickyHeader:d}=a,x={root:["root",i,d&&"stickyHeader",o!=="inherit"&&`align${s(o)}`,r!=="normal"&&`padding${s(r)}`,`size${s(g)}`]};return M(x,J,e)},G=D("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(a,e)=>{const{ownerState:i}=a;return[e.root,e[i.variant],e[`size${s(i.size)}`],i.padding!=="normal"&&e[`padding${s(i.padding)}`],i.align!=="inherit"&&e[`align${s(i.align)}`],i.stickyHeader&&e.stickyHeader]}})(({theme:a,ownerState:e})=>b({},a.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:a.vars?`1px solid ${a.vars.palette.TableCell.border}`:`1px solid +import{b as l,x as R,y as $,z as P,E as _,_ as b,j,F as A,G as s,H as M,J as D,ac as N,O as z,ad as U}from"./index-D7LVXeIK.js";const E=l.createContext(),W=l.createContext();function J(a){return R("MuiTableCell",a)}const L=$("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),B=["align","className","component","padding","scope","size","sortDirection","variant"],F=a=>{const{classes:e,variant:i,align:o,padding:r,size:g,stickyHeader:d}=a,x={root:["root",i,d&&"stickyHeader",o!=="inherit"&&`align${s(o)}`,r!=="normal"&&`padding${s(r)}`,`size${s(g)}`]};return M(x,J,e)},G=D("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(a,e)=>{const{ownerState:i}=a;return[e.root,e[i.variant],e[`size${s(i.size)}`],i.padding!=="normal"&&e[`padding${s(i.padding)}`],i.align!=="inherit"&&e[`align${s(i.align)}`],i.stickyHeader&&e.stickyHeader]}})(({theme:a,ownerState:e})=>b({},a.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:a.vars?`1px solid ${a.vars.palette.TableCell.border}`:`1px solid ${a.palette.mode==="light"?N(z(a.palette.divider,1),.88):U(z(a.palette.divider,1),.68)}`,textAlign:"left",padding:16},e.variant==="head"&&{color:(a.vars||a).palette.text.primary,lineHeight:a.typography.pxToRem(24),fontWeight:a.typography.fontWeightMedium},e.variant==="body"&&{color:(a.vars||a).palette.text.primary},e.variant==="footer"&&{color:(a.vars||a).palette.text.secondary,lineHeight:a.typography.pxToRem(21),fontSize:a.typography.pxToRem(12)},e.size==="small"&&{padding:"6px 16px",[`&.${L.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},e.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},e.padding==="none"&&{padding:0},e.align==="left"&&{textAlign:"left"},e.align==="center"&&{textAlign:"center"},e.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},e.align==="justify"&&{textAlign:"justify"},e.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(a.vars||a).palette.background.default})),O=l.forwardRef(function(e,i){const o=P({props:e,name:"MuiTableCell"}),{align:r="inherit",className:g,component:d,padding:x,scope:k,size:T,sortDirection:y,variant:h}=o,m=_(o,B),t=l.useContext(E),p=l.useContext(W),u=p&&p.variant==="head";let n;d?n=d:n=u?"th":"td";let c=k;n==="td"?c=void 0:!c&&u&&(c="col");const C=h||p&&p.variant,v=b({},o,{align:r,component:n,padding:x||(t&&t.padding?t.padding:"normal"),size:T||(t&&t.size?t.size:"medium"),sortDirection:y,stickyHeader:C==="head"&&t&&t.stickyHeader,variant:C}),H=F(v);let f=null;return y&&(f=y==="asc"?"ascending":"descending"),j.jsx(G,b({as:n,ref:i,className:A(H.root,g),"aria-sort":f,scope:c,ownerState:v},m))});export{O as T,E as a,W as b}; diff --git a/dist/assets/TableRow-BcqnvRn2.js b/dist/assets/TableRow-jBgitpDf.js similarity index 97% rename from dist/assets/TableRow-BcqnvRn2.js rename to dist/assets/TableRow-jBgitpDf.js index 91a2c4c..5876aae 100644 --- a/dist/assets/TableRow-BcqnvRn2.js +++ b/dist/assets/TableRow-jBgitpDf.js @@ -1 +1 @@ -import{x as v,y,b as p,z as m,E as T,_ as n,j as d,F as f,H as C,J as R,O as g}from"./index-DpAn5wLF.js";import{a as j,b as x}from"./TableCell-PEGz6qo_.js";function k(o){return v("MuiTable",o)}y("MuiTable",["root","stickyHeader"]);const S=["className","component","padding","size","stickyHeader"],_=o=>{const{classes:e,stickyHeader:s}=o;return C({root:["root",s&&"stickyHeader"]},k,e)},B=R("table",{name:"MuiTable",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:s}=o;return[e.root,s.stickyHeader&&e.stickyHeader]}})(({theme:o,ownerState:e})=>n({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":n({},o.typography.body2,{padding:o.spacing(2),color:(o.vars||o).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},e.stickyHeader&&{borderCollapse:"separate"})),h="table",eo=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTable"}),{className:c,component:a=h,padding:l="normal",size:r="medium",stickyHeader:i=!1}=t,u=T(t,S),b=n({},t,{component:a,padding:l,size:r,stickyHeader:i}),w=_(b),U=p.useMemo(()=>({padding:l,size:r,stickyHeader:i}),[l,r,i]);return d.jsx(j.Provider,{value:U,children:d.jsx(B,n({as:a,role:a===h?null:"table",ref:s,className:f(w.root,c),ownerState:b},u))})});function O(o){return v("MuiTableBody",o)}y("MuiTableBody",["root"]);const P=["className","component"],z=o=>{const{classes:e}=o;return C({root:["root"]},O,e)},E=R("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(o,e)=>e.root})({display:"table-row-group"}),A={variant:"body"},M="tbody",to=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTableBody"}),{className:c,component:a=M}=t,l=T(t,P),r=n({},t,{component:a}),i=z(r);return d.jsx(x.Provider,{value:A,children:d.jsx(E,n({className:f(i.root,c),as:a,ref:s,role:a===M?null:"rowgroup",ownerState:r},l))})});function D(o){return v("MuiTableContainer",o)}y("MuiTableContainer",["root"]);const F=["className","component"],J=o=>{const{classes:e}=o;return C({root:["root"]},D,e)},L=R("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(o,e)=>e.root})({width:"100%",overflowX:"auto"}),so=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTableContainer"}),{className:c,component:a="div"}=t,l=T(t,F),r=n({},t,{component:a}),i=J(r);return d.jsx(L,n({ref:s,as:a,className:f(i.root,c),ownerState:r},l))});function W(o){return v("MuiTableHead",o)}y("MuiTableHead",["root"]);const X=["className","component"],q=o=>{const{classes:e}=o;return C({root:["root"]},W,e)},G=R("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(o,e)=>e.root})({display:"table-header-group"}),I={variant:"head"},$="thead",ao=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTableHead"}),{className:c,component:a=$}=t,l=T(t,X),r=n({},t,{component:a}),i=q(r);return d.jsx(x.Provider,{value:I,children:d.jsx(G,n({as:a,className:f(i.root,c),ref:s,role:a===$?null:"rowgroup",ownerState:r},l))})});function K(o){return v("MuiTableRow",o)}const H=y("MuiTableRow",["root","selected","hover","head","footer"]),Q=["className","component","hover","selected"],V=o=>{const{classes:e,selected:s,hover:t,head:c,footer:a}=o;return C({root:["root",s&&"selected",t&&"hover",c&&"head",a&&"footer"]},K,e)},Y=R("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:s}=o;return[e.root,s.head&&e.head,s.footer&&e.footer]}})(({theme:o})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${H.hover}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${H.selected}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / ${o.vars.palette.action.selectedOpacity})`:g(o.palette.primary.main,o.palette.action.selectedOpacity),"&:hover":{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.hoverOpacity}))`:g(o.palette.primary.main,o.palette.action.selectedOpacity+o.palette.action.hoverOpacity)}}})),N="tr",ro=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTableRow"}),{className:c,component:a=N,hover:l=!1,selected:r=!1}=t,i=T(t,Q),u=p.useContext(x),b=n({},t,{component:a,hover:l,selected:r,head:u&&u.variant==="head",footer:u&&u.variant==="footer"}),w=V(b);return d.jsx(Y,n({as:a,ref:s,className:f(w.root,c),role:a===N?null:"row",ownerState:b},i))});export{so as T,eo as a,ao as b,ro as c,to as d}; +import{x as v,y,b as p,z as m,E as T,_ as n,j as d,F as f,H as C,J as R,O as g}from"./index-D7LVXeIK.js";import{a as j,b as x}from"./TableCell-DreGbAeW.js";function k(o){return v("MuiTable",o)}y("MuiTable",["root","stickyHeader"]);const S=["className","component","padding","size","stickyHeader"],_=o=>{const{classes:e,stickyHeader:s}=o;return C({root:["root",s&&"stickyHeader"]},k,e)},B=R("table",{name:"MuiTable",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:s}=o;return[e.root,s.stickyHeader&&e.stickyHeader]}})(({theme:o,ownerState:e})=>n({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":n({},o.typography.body2,{padding:o.spacing(2),color:(o.vars||o).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},e.stickyHeader&&{borderCollapse:"separate"})),h="table",eo=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTable"}),{className:c,component:a=h,padding:l="normal",size:r="medium",stickyHeader:i=!1}=t,u=T(t,S),b=n({},t,{component:a,padding:l,size:r,stickyHeader:i}),w=_(b),U=p.useMemo(()=>({padding:l,size:r,stickyHeader:i}),[l,r,i]);return d.jsx(j.Provider,{value:U,children:d.jsx(B,n({as:a,role:a===h?null:"table",ref:s,className:f(w.root,c),ownerState:b},u))})});function O(o){return v("MuiTableBody",o)}y("MuiTableBody",["root"]);const P=["className","component"],z=o=>{const{classes:e}=o;return C({root:["root"]},O,e)},E=R("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(o,e)=>e.root})({display:"table-row-group"}),A={variant:"body"},M="tbody",to=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTableBody"}),{className:c,component:a=M}=t,l=T(t,P),r=n({},t,{component:a}),i=z(r);return d.jsx(x.Provider,{value:A,children:d.jsx(E,n({className:f(i.root,c),as:a,ref:s,role:a===M?null:"rowgroup",ownerState:r},l))})});function D(o){return v("MuiTableContainer",o)}y("MuiTableContainer",["root"]);const F=["className","component"],J=o=>{const{classes:e}=o;return C({root:["root"]},D,e)},L=R("div",{name:"MuiTableContainer",slot:"Root",overridesResolver:(o,e)=>e.root})({width:"100%",overflowX:"auto"}),so=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTableContainer"}),{className:c,component:a="div"}=t,l=T(t,F),r=n({},t,{component:a}),i=J(r);return d.jsx(L,n({ref:s,as:a,className:f(i.root,c),ownerState:r},l))});function W(o){return v("MuiTableHead",o)}y("MuiTableHead",["root"]);const X=["className","component"],q=o=>{const{classes:e}=o;return C({root:["root"]},W,e)},G=R("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(o,e)=>e.root})({display:"table-header-group"}),I={variant:"head"},$="thead",ao=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTableHead"}),{className:c,component:a=$}=t,l=T(t,X),r=n({},t,{component:a}),i=q(r);return d.jsx(x.Provider,{value:I,children:d.jsx(G,n({as:a,className:f(i.root,c),ref:s,role:a===$?null:"rowgroup",ownerState:r},l))})});function K(o){return v("MuiTableRow",o)}const H=y("MuiTableRow",["root","selected","hover","head","footer"]),Q=["className","component","hover","selected"],V=o=>{const{classes:e,selected:s,hover:t,head:c,footer:a}=o;return C({root:["root",s&&"selected",t&&"hover",c&&"head",a&&"footer"]},K,e)},Y=R("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:s}=o;return[e.root,s.head&&e.head,s.footer&&e.footer]}})(({theme:o})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${H.hover}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${H.selected}`]:{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / ${o.vars.palette.action.selectedOpacity})`:g(o.palette.primary.main,o.palette.action.selectedOpacity),"&:hover":{backgroundColor:o.vars?`rgba(${o.vars.palette.primary.mainChannel} / calc(${o.vars.palette.action.selectedOpacity} + ${o.vars.palette.action.hoverOpacity}))`:g(o.palette.primary.main,o.palette.action.selectedOpacity+o.palette.action.hoverOpacity)}}})),N="tr",ro=p.forwardRef(function(e,s){const t=m({props:e,name:"MuiTableRow"}),{className:c,component:a=N,hover:l=!1,selected:r=!1}=t,i=T(t,Q),u=p.useContext(x),b=n({},t,{component:a,hover:l,selected:r,head:u&&u.variant==="head",footer:u&&u.variant==="footer"}),w=V(b);return d.jsx(Y,n({as:a,ref:s,className:f(w.root,c),role:a===N?null:"row",ownerState:b},i))});export{so as T,eo as a,ao as b,ro as c,to as d}; diff --git a/dist/assets/Tabs-Cp4sZXyZ.js b/dist/assets/Tabs-BUgAhQiL.js similarity index 99% rename from dist/assets/Tabs-Cp4sZXyZ.js rename to dist/assets/Tabs-BUgAhQiL.js index 9ae68c2..83bf775 100644 --- a/dist/assets/Tabs-Cp4sZXyZ.js +++ b/dist/assets/Tabs-BUgAhQiL.js @@ -1 +1 @@ -import{x as ft,y as pt,b as d,z as ht,E as rt,_ as b,F as L,j as m,G as Pt,H as vt,J as H,Z as Nt,$ as Zt,a0 as Lt,a1 as kt,a2 as Ft,a3 as lt,u as Qt,v as ut,a4 as te}from"./index-DpAn5wLF.js";import{K as ee,a as oe}from"./DeleteOutline-BVDDlNca.js";let U;function $t(){if(U)return U;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),U="reverse",t.scrollLeft>0?U="default":(t.scrollLeft=1,t.scrollLeft===0&&(U="negative")),document.body.removeChild(t),U}function le(t,e){const r=t.scrollLeft;if(e!=="rtl")return r;switch($t()){case"negative":return t.scrollWidth-t.clientWidth+r;case"reverse":return t.scrollWidth-t.clientWidth-r;default:return r}}function re(t){return ft("MuiTab",t)}const N=pt("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),ne=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],se=t=>{const{classes:e,textColor:r,fullWidth:a,wrapped:s,icon:c,label:h,selected:p,disabled:u}=t,x={root:["root",c&&h&&"labelIcon",`textColor${Pt(r)}`,a&&"fullWidth",s&&"wrapped",p&&"selected",u&&"disabled"],iconWrapper:["iconWrapper"]};return vt(x,re,e)},ae=H(Nt,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.label&&r.icon&&e.labelIcon,e[`textColor${Pt(r.textColor)}`],r.fullWidth&&e.fullWidth,r.wrapped&&e.wrapped,{[`& .${N.iconWrapper}`]:e.iconWrapper}]}})(({theme:t,ownerState:e})=>b({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${N.iconWrapper}`]:b({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${N.selected}`]:{opacity:1},[`&.${N.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${N.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${N.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${N.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${N.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),Re=d.forwardRef(function(e,r){const a=ht({props:e,name:"MuiTab"}),{className:s,disabled:c=!1,disableFocusRipple:h=!1,fullWidth:p,icon:u,iconPosition:x="top",indicator:B,label:y,onChange:v,onClick:w,onFocus:k,selected:I,selectionFollowsFocus:g,textColor:j="inherit",value:M,wrapped:nt=!1}=a,D=rt(a,ne),Y=b({},a,{disabled:c,disableFocusRipple:h,selected:I,icon:!!u,iconPosition:x,label:!!y,fullWidth:p,textColor:j,wrapped:nt}),X=se(Y),F=u&&y&&d.isValidElement(u)?d.cloneElement(u,{className:L(X.iconWrapper,u.props.className)}):u,J=R=>{!I&&v&&v(R,M),w&&w(R)},_=R=>{g&&!I&&v&&v(R,M),k&&k(R)};return m.jsxs(ae,b({focusRipple:!h,className:L(X.root,s),ref:r,role:"tab","aria-selected":I,disabled:c,onClick:J,onFocus:_,ownerState:Y,tabIndex:I?0:-1},D,{children:[x==="top"||x==="start"?m.jsxs(d.Fragment,{children:[F,y]}):m.jsxs(d.Fragment,{children:[y,F]}),B]}))});function ie(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function ce(t,e,r,a={},s=()=>{}){const{ease:c=ie,duration:h=300}=a;let p=null;const u=e[t];let x=!1;const B=()=>{x=!0},y=v=>{if(x){s(new Error("Animation cancelled"));return}p===null&&(p=v);const w=Math.min(1,(v-p)/h);if(e[t]=c(w)*(r-u)+u,w>=1){requestAnimationFrame(()=>{s(null)});return}requestAnimationFrame(y)};return u===r?(s(new Error("Element already at target position")),B):(requestAnimationFrame(y),B)}const de=["onChange"],ue={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function be(t){const{onChange:e}=t,r=rt(t,de),a=d.useRef(),s=d.useRef(null),c=()=>{a.current=s.current.offsetHeight-s.current.clientHeight};return Zt(()=>{const h=Lt(()=>{const u=a.current;c(),u!==a.current&&e(a.current)}),p=kt(s.current);return p.addEventListener("resize",h),()=>{h.clear(),p.removeEventListener("resize",h)}},[e]),d.useEffect(()=>{c(),e(a.current)},[e]),m.jsx("div",b({style:ue},r,{ref:s}))}function fe(t){return ft("MuiTabScrollButton",t)}const pe=pt("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),he=["className","slots","slotProps","direction","orientation","disabled"],ve=t=>{const{classes:e,orientation:r,disabled:a}=t;return vt({root:["root",r,a&&"disabled"]},fe,e)},Se=H(Nt,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.orientation&&e[r.orientation]]}})(({ownerState:t})=>b({width:40,flexShrink:0,opacity:.8,[`&.${pe.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),me=d.forwardRef(function(e,r){var a,s;const c=ht({props:e,name:"MuiTabScrollButton"}),{className:h,slots:p={},slotProps:u={},direction:x}=c,B=rt(c,he),y=Ft(),v=b({isRtl:y},c),w=ve(v),k=(a=p.StartScrollButtonIcon)!=null?a:ee,I=(s=p.EndScrollButtonIcon)!=null?s:oe,g=lt({elementType:k,externalSlotProps:u.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:v}),j=lt({elementType:I,externalSlotProps:u.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:v});return m.jsx(Se,b({component:"div",className:L(w.root,h),ref:r,role:null,ownerState:v,tabIndex:null},B,{children:x==="left"?m.jsx(k,b({},g)):m.jsx(I,b({},j))}))});function xe(t){return ft("MuiTabs",t)}const bt=pt("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),ge=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Rt=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,Wt=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,ot=(t,e,r)=>{let a=!1,s=r(t,e);for(;s;){if(s===t.firstChild){if(a)return;a=!0}const c=s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||c)s=r(t,s);else{s.focus();return}}},ye=t=>{const{vertical:e,fixed:r,hideScrollbar:a,scrollableX:s,scrollableY:c,centered:h,scrollButtonsHideMobile:p,classes:u}=t;return vt({root:["root",e&&"vertical"],scroller:["scroller",r&&"fixed",a&&"hideScrollbar",s&&"scrollableX",c&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",h&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",p&&"scrollButtonsHideMobile"],scrollableX:[s&&"scrollableX"],hideScrollbar:[a&&"hideScrollbar"]},xe,u)},Ce=H("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${bt.scrollButtons}`]:e.scrollButtons},{[`& .${bt.scrollButtons}`]:r.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,r.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>b({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${bt.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),Be=H("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.scroller,r.fixed&&e.fixed,r.hideScrollbar&&e.hideScrollbar,r.scrollableX&&e.scrollableX,r.scrollableY&&e.scrollableY]}})(({ownerState:t})=>b({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),we=H("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.flexContainer,r.vertical&&e.flexContainerVertical,r.centered&&e.centered]}})(({ownerState:t})=>b({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),Ie=H("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>b({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),Te=H(be)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),zt={},We=d.forwardRef(function(e,r){const a=ht({props:e,name:"MuiTabs"}),s=Qt(),c=Ft(),{"aria-label":h,"aria-labelledby":p,action:u,centered:x=!1,children:B,className:y,component:v="div",allowScrollButtonsMobile:w=!1,indicatorColor:k="primary",onChange:I,orientation:g="horizontal",ScrollButtonComponent:j=me,scrollButtons:M="auto",selectionFollowsFocus:nt,slots:D={},slotProps:Y={},TabIndicatorProps:X={},TabScrollButtonProps:F={},textColor:J="primary",value:_,variant:R="standard",visibleScrollbar:st=!1}=a,Ot=rt(a,ge),T=R==="scrollable",C=g==="vertical",V=C?"scrollTop":"scrollLeft",Z=C?"top":"left",Q=C?"bottom":"right",at=C?"clientHeight":"clientWidth",K=C?"height":"width",$=b({},a,{component:v,allowScrollButtonsMobile:w,indicatorColor:k,orientation:g,vertical:C,scrollButtons:M,textColor:J,variant:R,visibleScrollbar:st,fixed:!T,hideScrollbar:T&&!st,scrollableX:T&&!C,scrollableY:T&&C,centered:x&&!T,scrollButtonsHideMobile:!w}),z=ye($),At=lt({elementType:D.StartScrollButtonIcon,externalSlotProps:Y.startScrollButtonIcon,ownerState:$}),Ht=lt({elementType:D.EndScrollButtonIcon,externalSlotProps:Y.endScrollButtonIcon,ownerState:$}),[St,jt]=d.useState(!1),[O,mt]=d.useState(zt),[xt,Dt]=d.useState(!1),[gt,Xt]=d.useState(!1),[yt,_t]=d.useState(!1),[Ct,Ut]=d.useState({overflow:"hidden",scrollbarWidth:0}),Bt=new Map,W=d.useRef(null),A=d.useRef(null),wt=()=>{const o=W.current;let l;if(o){const n=o.getBoundingClientRect();l={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:le(o,c?"rtl":"ltr"),scrollWidth:o.scrollWidth,top:n.top,bottom:n.bottom,left:n.left,right:n.right}}let i;if(o&&_!==!1){const n=A.current.children;if(n.length>0){const f=n[Bt.get(_)];i=f?f.getBoundingClientRect():null}}return{tabsMeta:l,tabMeta:i}},q=ut(()=>{const{tabsMeta:o,tabMeta:l}=wt();let i=0,n;if(C)n="top",l&&o&&(i=l.top-o.top+o.scrollTop);else if(n=c?"right":"left",l&&o){const S=c?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;i=(c?-1:1)*(l[n]-o[n]+S)}const f={[n]:i,[K]:l?l[K]:0};if(isNaN(O[n])||isNaN(O[K]))mt(f);else{const S=Math.abs(O[n]-f[n]),E=Math.abs(O[K]-f[K]);(S>=1||E>=1)&&mt(f)}}),it=(o,{animation:l=!0}={})=>{l?ce(V,W.current,o,{duration:s.transitions.duration.standard}):W.current[V]=o},It=o=>{let l=W.current[V];C?l+=o:(l+=o*(c?-1:1),l*=c&&$t()==="reverse"?-1:1),it(l)},Tt=()=>{const o=W.current[at];let l=0;const i=Array.from(A.current.children);for(let n=0;no){n===0&&(l=o);break}l+=f[at]}return l},Yt=()=>{It(-1*Tt())},Vt=()=>{It(Tt())},Kt=d.useCallback(o=>{Ut({overflow:null,scrollbarWidth:o})},[]),qt=()=>{const o={};o.scrollbarSizeListener=T?m.jsx(Te,{onChange:Kt,className:L(z.scrollableX,z.hideScrollbar)}):null;const i=T&&(M==="auto"&&(xt||gt)||M===!0);return o.scrollButtonStart=i?m.jsx(j,b({slots:{StartScrollButtonIcon:D.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:At},orientation:g,direction:c?"right":"left",onClick:Yt,disabled:!xt},F,{className:L(z.scrollButtons,F.className)})):null,o.scrollButtonEnd=i?m.jsx(j,b({slots:{EndScrollButtonIcon:D.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:Ht},orientation:g,direction:c?"left":"right",onClick:Vt,disabled:!gt},F,{className:L(z.scrollButtons,F.className)})):null,o},Et=ut(o=>{const{tabsMeta:l,tabMeta:i}=wt();if(!(!i||!l)){if(i[Z]l[Q]){const n=l[V]+(i[Q]-l[Q]);it(n,{animation:o})}}}),tt=ut(()=>{T&&M!==!1&&_t(!yt)});d.useEffect(()=>{const o=Lt(()=>{W.current&&q()});let l;const i=S=>{S.forEach(E=>{E.removedNodes.forEach(G=>{var P;(P=l)==null||P.unobserve(G)}),E.addedNodes.forEach(G=>{var P;(P=l)==null||P.observe(G)})}),o(),tt()},n=kt(W.current);n.addEventListener("resize",o);let f;return typeof ResizeObserver<"u"&&(l=new ResizeObserver(o),Array.from(A.current.children).forEach(S=>{l.observe(S)})),typeof MutationObserver<"u"&&(f=new MutationObserver(i),f.observe(A.current,{childList:!0})),()=>{var S,E;o.clear(),n.removeEventListener("resize",o),(S=f)==null||S.disconnect(),(E=l)==null||E.disconnect()}},[q,tt]),d.useEffect(()=>{const o=Array.from(A.current.children),l=o.length;if(typeof IntersectionObserver<"u"&&l>0&&T&&M!==!1){const i=o[0],n=o[l-1],f={root:W.current,threshold:.99},S=dt=>{Dt(!dt[0].isIntersecting)},E=new IntersectionObserver(S,f);E.observe(i);const G=dt=>{Xt(!dt[0].isIntersecting)},P=new IntersectionObserver(G,f);return P.observe(n),()=>{E.disconnect(),P.disconnect()}}},[T,M,yt,B==null?void 0:B.length]),d.useEffect(()=>{jt(!0)},[]),d.useEffect(()=>{q()}),d.useEffect(()=>{Et(zt!==O)},[Et,O]),d.useImperativeHandle(u,()=>({updateIndicator:q,updateScrollButtons:tt}),[q,tt]);const Mt=m.jsx(Ie,b({},X,{className:L(z.indicator,X.className),ownerState:$,style:b({},O,X.style)}));let et=0;const Gt=d.Children.map(B,o=>{if(!d.isValidElement(o))return null;const l=o.props.value===void 0?et:o.props.value;Bt.set(l,et);const i=l===_;return et+=1,d.cloneElement(o,b({fullWidth:R==="fullWidth",indicator:i&&!St&&Mt,selected:i,selectionFollowsFocus:nt,onChange:I,textColor:J,value:l},et===1&&_===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),Jt=o=>{const l=A.current,i=te(l).activeElement;if(i.getAttribute("role")!=="tab")return;let f=g==="horizontal"?"ArrowLeft":"ArrowUp",S=g==="horizontal"?"ArrowRight":"ArrowDown";switch(g==="horizontal"&&c&&(f="ArrowRight",S="ArrowLeft"),o.key){case f:o.preventDefault(),ot(l,i,Wt);break;case S:o.preventDefault(),ot(l,i,Rt);break;case"Home":o.preventDefault(),ot(l,null,Rt);break;case"End":o.preventDefault(),ot(l,null,Wt);break}},ct=qt();return m.jsxs(Ce,b({className:L(z.root,y),ownerState:$,ref:r,as:v},Ot,{children:[ct.scrollButtonStart,ct.scrollbarSizeListener,m.jsxs(Be,{className:z.scroller,ownerState:$,style:{overflow:Ct.overflow,[C?`margin${c?"Left":"Right"}`:"marginBottom"]:st?void 0:-Ct.scrollbarWidth},ref:W,children:[m.jsx(we,{"aria-label":h,"aria-labelledby":p,"aria-orientation":g==="vertical"?"vertical":null,className:z.flexContainer,ownerState:$,onKeyDown:Jt,ref:A,role:"tablist",children:Gt}),St&&Mt]}),ct.scrollButtonEnd]}))});export{We as T,Re as a}; +import{x as ft,y as pt,b as d,z as ht,E as rt,_ as b,F as L,j as m,G as Pt,H as vt,J as H,Z as Nt,$ as Zt,a0 as Lt,a1 as kt,a2 as Ft,a3 as lt,u as Qt,v as ut,a4 as te}from"./index-D7LVXeIK.js";import{K as ee,a as oe}from"./DeleteOutline-Dhk3Cr2d.js";let U;function $t(){if(U)return U;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),U="reverse",t.scrollLeft>0?U="default":(t.scrollLeft=1,t.scrollLeft===0&&(U="negative")),document.body.removeChild(t),U}function le(t,e){const r=t.scrollLeft;if(e!=="rtl")return r;switch($t()){case"negative":return t.scrollWidth-t.clientWidth+r;case"reverse":return t.scrollWidth-t.clientWidth-r;default:return r}}function re(t){return ft("MuiTab",t)}const N=pt("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),ne=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],se=t=>{const{classes:e,textColor:r,fullWidth:a,wrapped:s,icon:c,label:h,selected:p,disabled:u}=t,x={root:["root",c&&h&&"labelIcon",`textColor${Pt(r)}`,a&&"fullWidth",s&&"wrapped",p&&"selected",u&&"disabled"],iconWrapper:["iconWrapper"]};return vt(x,re,e)},ae=H(Nt,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.label&&r.icon&&e.labelIcon,e[`textColor${Pt(r.textColor)}`],r.fullWidth&&e.fullWidth,r.wrapped&&e.wrapped,{[`& .${N.iconWrapper}`]:e.iconWrapper}]}})(({theme:t,ownerState:e})=>b({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${N.iconWrapper}`]:b({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${N.selected}`]:{opacity:1},[`&.${N.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${N.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${N.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${N.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${N.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),Re=d.forwardRef(function(e,r){const a=ht({props:e,name:"MuiTab"}),{className:s,disabled:c=!1,disableFocusRipple:h=!1,fullWidth:p,icon:u,iconPosition:x="top",indicator:B,label:y,onChange:v,onClick:w,onFocus:k,selected:I,selectionFollowsFocus:g,textColor:j="inherit",value:M,wrapped:nt=!1}=a,D=rt(a,ne),Y=b({},a,{disabled:c,disableFocusRipple:h,selected:I,icon:!!u,iconPosition:x,label:!!y,fullWidth:p,textColor:j,wrapped:nt}),X=se(Y),F=u&&y&&d.isValidElement(u)?d.cloneElement(u,{className:L(X.iconWrapper,u.props.className)}):u,J=R=>{!I&&v&&v(R,M),w&&w(R)},_=R=>{g&&!I&&v&&v(R,M),k&&k(R)};return m.jsxs(ae,b({focusRipple:!h,className:L(X.root,s),ref:r,role:"tab","aria-selected":I,disabled:c,onClick:J,onFocus:_,ownerState:Y,tabIndex:I?0:-1},D,{children:[x==="top"||x==="start"?m.jsxs(d.Fragment,{children:[F,y]}):m.jsxs(d.Fragment,{children:[y,F]}),B]}))});function ie(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function ce(t,e,r,a={},s=()=>{}){const{ease:c=ie,duration:h=300}=a;let p=null;const u=e[t];let x=!1;const B=()=>{x=!0},y=v=>{if(x){s(new Error("Animation cancelled"));return}p===null&&(p=v);const w=Math.min(1,(v-p)/h);if(e[t]=c(w)*(r-u)+u,w>=1){requestAnimationFrame(()=>{s(null)});return}requestAnimationFrame(y)};return u===r?(s(new Error("Element already at target position")),B):(requestAnimationFrame(y),B)}const de=["onChange"],ue={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function be(t){const{onChange:e}=t,r=rt(t,de),a=d.useRef(),s=d.useRef(null),c=()=>{a.current=s.current.offsetHeight-s.current.clientHeight};return Zt(()=>{const h=Lt(()=>{const u=a.current;c(),u!==a.current&&e(a.current)}),p=kt(s.current);return p.addEventListener("resize",h),()=>{h.clear(),p.removeEventListener("resize",h)}},[e]),d.useEffect(()=>{c(),e(a.current)},[e]),m.jsx("div",b({style:ue},r,{ref:s}))}function fe(t){return ft("MuiTabScrollButton",t)}const pe=pt("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),he=["className","slots","slotProps","direction","orientation","disabled"],ve=t=>{const{classes:e,orientation:r,disabled:a}=t;return vt({root:["root",r,a&&"disabled"]},fe,e)},Se=H(Nt,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.orientation&&e[r.orientation]]}})(({ownerState:t})=>b({width:40,flexShrink:0,opacity:.8,[`&.${pe.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),me=d.forwardRef(function(e,r){var a,s;const c=ht({props:e,name:"MuiTabScrollButton"}),{className:h,slots:p={},slotProps:u={},direction:x}=c,B=rt(c,he),y=Ft(),v=b({isRtl:y},c),w=ve(v),k=(a=p.StartScrollButtonIcon)!=null?a:ee,I=(s=p.EndScrollButtonIcon)!=null?s:oe,g=lt({elementType:k,externalSlotProps:u.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:v}),j=lt({elementType:I,externalSlotProps:u.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:v});return m.jsx(Se,b({component:"div",className:L(w.root,h),ref:r,role:null,ownerState:v,tabIndex:null},B,{children:x==="left"?m.jsx(k,b({},g)):m.jsx(I,b({},j))}))});function xe(t){return ft("MuiTabs",t)}const bt=pt("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),ge=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Rt=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,Wt=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,ot=(t,e,r)=>{let a=!1,s=r(t,e);for(;s;){if(s===t.firstChild){if(a)return;a=!0}const c=s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||c)s=r(t,s);else{s.focus();return}}},ye=t=>{const{vertical:e,fixed:r,hideScrollbar:a,scrollableX:s,scrollableY:c,centered:h,scrollButtonsHideMobile:p,classes:u}=t;return vt({root:["root",e&&"vertical"],scroller:["scroller",r&&"fixed",a&&"hideScrollbar",s&&"scrollableX",c&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",h&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",p&&"scrollButtonsHideMobile"],scrollableX:[s&&"scrollableX"],hideScrollbar:[a&&"hideScrollbar"]},xe,u)},Ce=H("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${bt.scrollButtons}`]:e.scrollButtons},{[`& .${bt.scrollButtons}`]:r.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,r.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>b({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${bt.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),Be=H("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.scroller,r.fixed&&e.fixed,r.hideScrollbar&&e.hideScrollbar,r.scrollableX&&e.scrollableX,r.scrollableY&&e.scrollableY]}})(({ownerState:t})=>b({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),we=H("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.flexContainer,r.vertical&&e.flexContainerVertical,r.centered&&e.centered]}})(({ownerState:t})=>b({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),Ie=H("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>b({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),Te=H(be)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),zt={},We=d.forwardRef(function(e,r){const a=ht({props:e,name:"MuiTabs"}),s=Qt(),c=Ft(),{"aria-label":h,"aria-labelledby":p,action:u,centered:x=!1,children:B,className:y,component:v="div",allowScrollButtonsMobile:w=!1,indicatorColor:k="primary",onChange:I,orientation:g="horizontal",ScrollButtonComponent:j=me,scrollButtons:M="auto",selectionFollowsFocus:nt,slots:D={},slotProps:Y={},TabIndicatorProps:X={},TabScrollButtonProps:F={},textColor:J="primary",value:_,variant:R="standard",visibleScrollbar:st=!1}=a,Ot=rt(a,ge),T=R==="scrollable",C=g==="vertical",V=C?"scrollTop":"scrollLeft",Z=C?"top":"left",Q=C?"bottom":"right",at=C?"clientHeight":"clientWidth",K=C?"height":"width",$=b({},a,{component:v,allowScrollButtonsMobile:w,indicatorColor:k,orientation:g,vertical:C,scrollButtons:M,textColor:J,variant:R,visibleScrollbar:st,fixed:!T,hideScrollbar:T&&!st,scrollableX:T&&!C,scrollableY:T&&C,centered:x&&!T,scrollButtonsHideMobile:!w}),z=ye($),At=lt({elementType:D.StartScrollButtonIcon,externalSlotProps:Y.startScrollButtonIcon,ownerState:$}),Ht=lt({elementType:D.EndScrollButtonIcon,externalSlotProps:Y.endScrollButtonIcon,ownerState:$}),[St,jt]=d.useState(!1),[O,mt]=d.useState(zt),[xt,Dt]=d.useState(!1),[gt,Xt]=d.useState(!1),[yt,_t]=d.useState(!1),[Ct,Ut]=d.useState({overflow:"hidden",scrollbarWidth:0}),Bt=new Map,W=d.useRef(null),A=d.useRef(null),wt=()=>{const o=W.current;let l;if(o){const n=o.getBoundingClientRect();l={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:le(o,c?"rtl":"ltr"),scrollWidth:o.scrollWidth,top:n.top,bottom:n.bottom,left:n.left,right:n.right}}let i;if(o&&_!==!1){const n=A.current.children;if(n.length>0){const f=n[Bt.get(_)];i=f?f.getBoundingClientRect():null}}return{tabsMeta:l,tabMeta:i}},q=ut(()=>{const{tabsMeta:o,tabMeta:l}=wt();let i=0,n;if(C)n="top",l&&o&&(i=l.top-o.top+o.scrollTop);else if(n=c?"right":"left",l&&o){const S=c?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;i=(c?-1:1)*(l[n]-o[n]+S)}const f={[n]:i,[K]:l?l[K]:0};if(isNaN(O[n])||isNaN(O[K]))mt(f);else{const S=Math.abs(O[n]-f[n]),E=Math.abs(O[K]-f[K]);(S>=1||E>=1)&&mt(f)}}),it=(o,{animation:l=!0}={})=>{l?ce(V,W.current,o,{duration:s.transitions.duration.standard}):W.current[V]=o},It=o=>{let l=W.current[V];C?l+=o:(l+=o*(c?-1:1),l*=c&&$t()==="reverse"?-1:1),it(l)},Tt=()=>{const o=W.current[at];let l=0;const i=Array.from(A.current.children);for(let n=0;no){n===0&&(l=o);break}l+=f[at]}return l},Yt=()=>{It(-1*Tt())},Vt=()=>{It(Tt())},Kt=d.useCallback(o=>{Ut({overflow:null,scrollbarWidth:o})},[]),qt=()=>{const o={};o.scrollbarSizeListener=T?m.jsx(Te,{onChange:Kt,className:L(z.scrollableX,z.hideScrollbar)}):null;const i=T&&(M==="auto"&&(xt||gt)||M===!0);return o.scrollButtonStart=i?m.jsx(j,b({slots:{StartScrollButtonIcon:D.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:At},orientation:g,direction:c?"right":"left",onClick:Yt,disabled:!xt},F,{className:L(z.scrollButtons,F.className)})):null,o.scrollButtonEnd=i?m.jsx(j,b({slots:{EndScrollButtonIcon:D.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:Ht},orientation:g,direction:c?"left":"right",onClick:Vt,disabled:!gt},F,{className:L(z.scrollButtons,F.className)})):null,o},Et=ut(o=>{const{tabsMeta:l,tabMeta:i}=wt();if(!(!i||!l)){if(i[Z]l[Q]){const n=l[V]+(i[Q]-l[Q]);it(n,{animation:o})}}}),tt=ut(()=>{T&&M!==!1&&_t(!yt)});d.useEffect(()=>{const o=Lt(()=>{W.current&&q()});let l;const i=S=>{S.forEach(E=>{E.removedNodes.forEach(G=>{var P;(P=l)==null||P.unobserve(G)}),E.addedNodes.forEach(G=>{var P;(P=l)==null||P.observe(G)})}),o(),tt()},n=kt(W.current);n.addEventListener("resize",o);let f;return typeof ResizeObserver<"u"&&(l=new ResizeObserver(o),Array.from(A.current.children).forEach(S=>{l.observe(S)})),typeof MutationObserver<"u"&&(f=new MutationObserver(i),f.observe(A.current,{childList:!0})),()=>{var S,E;o.clear(),n.removeEventListener("resize",o),(S=f)==null||S.disconnect(),(E=l)==null||E.disconnect()}},[q,tt]),d.useEffect(()=>{const o=Array.from(A.current.children),l=o.length;if(typeof IntersectionObserver<"u"&&l>0&&T&&M!==!1){const i=o[0],n=o[l-1],f={root:W.current,threshold:.99},S=dt=>{Dt(!dt[0].isIntersecting)},E=new IntersectionObserver(S,f);E.observe(i);const G=dt=>{Xt(!dt[0].isIntersecting)},P=new IntersectionObserver(G,f);return P.observe(n),()=>{E.disconnect(),P.disconnect()}}},[T,M,yt,B==null?void 0:B.length]),d.useEffect(()=>{jt(!0)},[]),d.useEffect(()=>{q()}),d.useEffect(()=>{Et(zt!==O)},[Et,O]),d.useImperativeHandle(u,()=>({updateIndicator:q,updateScrollButtons:tt}),[q,tt]);const Mt=m.jsx(Ie,b({},X,{className:L(z.indicator,X.className),ownerState:$,style:b({},O,X.style)}));let et=0;const Gt=d.Children.map(B,o=>{if(!d.isValidElement(o))return null;const l=o.props.value===void 0?et:o.props.value;Bt.set(l,et);const i=l===_;return et+=1,d.cloneElement(o,b({fullWidth:R==="fullWidth",indicator:i&&!St&&Mt,selected:i,selectionFollowsFocus:nt,onChange:I,textColor:J,value:l},et===1&&_===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),Jt=o=>{const l=A.current,i=te(l).activeElement;if(i.getAttribute("role")!=="tab")return;let f=g==="horizontal"?"ArrowLeft":"ArrowUp",S=g==="horizontal"?"ArrowRight":"ArrowDown";switch(g==="horizontal"&&c&&(f="ArrowRight",S="ArrowLeft"),o.key){case f:o.preventDefault(),ot(l,i,Wt);break;case S:o.preventDefault(),ot(l,i,Rt);break;case"Home":o.preventDefault(),ot(l,null,Rt);break;case"End":o.preventDefault(),ot(l,null,Wt);break}},ct=qt();return m.jsxs(Ce,b({className:L(z.root,y),ownerState:$,ref:r,as:v},Ot,{children:[ct.scrollButtonStart,ct.scrollbarSizeListener,m.jsxs(Be,{className:z.scroller,ownerState:$,style:{overflow:Ct.overflow,[C?`margin${c?"Left":"Right"}`:"marginBottom"]:st?void 0:-Ct.scrollbarWidth},ref:W,children:[m.jsx(we,{"aria-label":h,"aria-labelledby":p,"aria-orientation":g==="vertical"?"vertical":null,className:z.flexContainer,ownerState:$,onKeyDown:Jt,ref:A,role:"tablist",children:Gt}),St&&Mt]}),ct.scrollButtonEnd]}))});export{We as T,Re as a}; diff --git a/dist/assets/TeamUsers-BPLTRPAZ.js b/dist/assets/TeamUsers-BPLTRPAZ.js deleted file mode 100644 index 8e741f9..0000000 --- a/dist/assets/TeamUsers-BPLTRPAZ.js +++ /dev/null @@ -1 +0,0 @@ -import{r as M,j as e,i as P,u as re,a as te,b as n,I as N,M as _e,C as V,V as ze,W as $e,t as le,S as m,B as h,c as Ie,T as p,l as Te,o as Z,e as Me,h as Pe,X as ke,D as Re,U as De}from"./index-DpAn5wLF.js";import{D as ne,a as ie,e as Ee,b as ae,c as oe,d as we}from"./Close-BdNf_RlN.js";import{d as Ae}from"./Refresh-B8qCgQHN.js";import{d as ce}from"./EditOutlined-B2ltVbl8.js";import{d as de,T as Oe}from"./DeleteOutline-BVDDlNca.js";import{d as xe,D as Ue}from"./PhoneOutlined-CDgMDTyj.js";import{T as We,d as Le}from"./TabLabelCount-C_C4hO8i.js";import{A as ue,G as C,P as qe,C as me}from"./PageHeader-CEew5Fw4.js";import{E as Be}from"./EmptyState-BsjYeVAX.js";import{T as _}from"./TextField-C0dUZvW0.js";import{B as v}from"./Button-BGNvVfej.js";import{C as Ne,L as W}from"./Link-Bme8npFv.js";import{I as Ve}from"./InputAdornment-BWnl4jqW.js";import{T as Fe,a as He}from"./Tabs-Cp4sZXyZ.js";import{T as Ge,a as Qe,b as Ke,c as ee,d as Xe}from"./TableRow-BcqnvRn2.js";import{T as d}from"./TableCell-PEGz6qo_.js";var F={},Ye=P;Object.defineProperty(F,"__esModule",{value:!0});var H=F.default=void 0,Je=Ye(M()),Ze=e;H=F.default=(0,Je.default)((0,Ze.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 14H4V8l8 5 8-5zm-8-7L4 6h16z"}),"MailOutline");var G={},es=P;Object.defineProperty(G,"__esModule",{value:!0});var he=G.default=void 0,ss=es(M()),O=e;he=G.default=(0,ss.default)((0,O.jsxs)("g",{fillRule:"evenodd",children:[(0,O.jsx)("circle",{cx:"17",cy:"15.5",r:"1.12"}),(0,O.jsx)("path",{d:"M17 17.5c-.73 0-2.19.36-2.24 1.08.5.71 1.32 1.17 2.24 1.17s1.74-.46 2.24-1.17c-.05-.72-1.51-1.08-2.24-1.08"}),(0,O.jsx)("path",{d:"M18 11.09V6.27L10.5 3 3 6.27v4.91c0 4.54 3.2 8.79 7.5 9.82.55-.13 1.08-.32 1.6-.55C13.18 21.99 14.97 23 17 23c3.31 0 6-2.69 6-6 0-2.97-2.16-5.43-5-5.91M11 17c0 .56.08 1.11.23 1.62-.24.11-.48.22-.73.3-3.17-1-5.5-4.24-5.5-7.74v-3.6l5.5-2.4 5.5 2.4v3.51c-2.84.48-5 2.94-5 5.91m6 4c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4"})]}),"AdminPanelSettingsOutlined");var Q={},rs=P;Object.defineProperty(Q,"__esModule",{value:!0});var pe=Q.default=void 0,ts=rs(M()),U=e;pe=Q.default=(0,ts.default)([(0,U.jsx)("path",{d:"M21 12.22C21 6.73 16.74 3 12 3c-4.69 0-9 3.65-9 9.28-.6.34-1 .98-1 1.72v2c0 1.1.9 2 2 2h1v-6.1c0-3.87 3.13-7 7-7s7 3.13 7 7V19h-8v2h8c1.1 0 2-.9 2-2v-1.22c.59-.31 1-.92 1-1.64v-2.3c0-.7-.41-1.31-1-1.62"},"0"),(0,U.jsx)("circle",{cx:"9",cy:"13",r:"1"},"1"),(0,U.jsx)("circle",{cx:"15",cy:"13",r:"1"},"2"),(0,U.jsx)("path",{d:"M18 11.03C17.52 8.18 15.04 6 12.05 6c-3.03 0-6.29 2.51-6.03 6.45 2.47-1.01 4.33-3.21 4.86-5.89 1.31 2.63 4 4.44 7.12 4.47"},"3")],"SupportAgentOutlined");var K={},ls=P;Object.defineProperty(K,"__esModule",{value:!0});var je=K.default=void 0,ns=ls(M()),is=e;je=K.default=(0,ns.default)((0,is.jsx)("path",{d:"M4 18v-.65c0-.34.16-.66.41-.81C6.1 15.53 8.03 15 10 15c.03 0 .05 0 .08.01.1-.7.3-1.37.59-1.98-.22-.02-.44-.03-.67-.03-2.42 0-4.68.67-6.61 1.82-.88.52-1.39 1.5-1.39 2.53V20h9.26c-.42-.6-.75-1.28-.97-2zm6-6c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m10.75 10c0-.22-.03-.42-.06-.63l1.14-1.01-1-1.73-1.45.49c-.32-.27-.68-.48-1.08-.63L18 11h-2l-.3 1.49c-.4.15-.76.36-1.08.63l-1.45-.49-1 1.73 1.14 1.01c-.03.21-.06.41-.06.63s.03.42.06.63l-1.14 1.01 1 1.73 1.45-.49c.32.27.68.48 1.08.63L16 21h2l.3-1.49c.4-.15.76-.36 1.08-.63l1.45.49 1-1.73-1.14-1.01c.03-.21.06-.41.06-.63M17 18c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"ManageAccountsOutlined");var X={},as=P;Object.defineProperty(X,"__esModule",{value:!0});var fe=X.default=void 0,os=as(M()),cs=e;fe=X.default=(0,os.default)((0,cs.jsx)("path",{d:"M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4"}),"PersonOutlineOutlined");const ds=["admin","rep","manager"],se={name:"",email:"",phone:"",role:"rep",pin:"",password:""},xs=(r,i)=>i&&!r.includes(i)?[i,...r]:r;function us({open:r,mode:i,initial:a,onClose:j,onSaved:y}){const x=i==="edit",k=re(),z=te(k.breakpoints.down("sm")),[t,R]=n.useState(se),[f,D]=n.useState(!1),[b,u]=n.useState(null);n.useEffect(()=>{r&&(R({...se,...a||{}}),u(null))},[r,a]);const o=c=>g=>R(S=>({...S,[c]:g.target.value})),L=async()=>{if(!t.name.trim()){u("Name is required.");return}if(!t.email.trim()){u("Email is required.");return}if(!x&&!t.password.trim()){u("Password is required.");return}D(!0),u(null);const c={first_name:t.name.trim(),email:t.email.trim(),phone:t.phone,role:t.role,...t.password?{password:t.password}:{},...t.pin?{pin:String(t.pin)}:{}};try{x?await ze(a.id,c):await $e(c),y()}catch(g){u(g.message||"Failed to save user")}finally{D(!1)}};return e.jsxs(ne,{open:r,onClose:f?void 0:j,maxWidth:"sm",fullWidth:!0,fullScreen:z,children:[e.jsxs(ie,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[x?"Edit Team User":"Add Team User",e.jsx(N,{onClick:j,size:"small",disabled:f,children:e.jsx(Ee,{})})]}),e.jsxs(ae,{dividers:!0,children:[b&&e.jsx(ue,{severity:"error",sx:{mb:2},children:b}),e.jsxs(C,{container:!0,spacing:2,sx:{mt:0},children:[e.jsx(C,{item:!0,xs:12,sm:6,children:e.jsx(_,{fullWidth:!0,size:"small",label:"Name *",value:t.name,onChange:o("name")})}),e.jsx(C,{item:!0,xs:12,sm:6,children:e.jsx(_,{fullWidth:!0,size:"small",label:"Email *",value:t.email,onChange:o("email")})}),e.jsx(C,{item:!0,xs:12,sm:6,children:e.jsx(_,{fullWidth:!0,size:"small",label:"Phone",value:t.phone,onChange:o("phone")})}),e.jsx(C,{item:!0,xs:12,sm:6,children:e.jsx(_,{select:!0,fullWidth:!0,size:"small",label:"Role",value:t.role,onChange:o("role"),children:xs(ds,t.role).map(c=>e.jsx(_e,{value:c,children:c},c))})}),e.jsx(C,{item:!0,xs:12,sm:6,children:e.jsx(_,{fullWidth:!0,size:"small",label:"PIN",value:t.pin,onChange:o("pin")})}),e.jsx(C,{item:!0,xs:12,sm:6,children:e.jsx(_,{fullWidth:!0,size:"small",type:"password",label:x?"New Password (optional)":"Password *",value:t.password,onChange:o("password")})})]})]}),e.jsxs(oe,{sx:{px:3,py:2},children:[e.jsx(v,{onClick:j,disabled:f,children:"Cancel"}),e.jsx(v,{variant:"contained",onClick:L,disabled:f,startIcon:f?e.jsx(V,{size:16,color:"inherit"}):null,children:x?"Save Changes":"Create User"})]})]})}const ms={admin:{color:"primary",icon:he},manager:{color:"success",icon:je},rep:{color:"info",icon:Le},support:{color:"warning",icon:pe}},ge=r=>ms[String(r||"").toLowerCase()]||{color:"secondary",icon:fe};function ve({name:r,email:i,role:a}){const{color:j,icon:y}=ge(a),x=i?i.split("@")[0]:"";return e.jsxs(m,{direction:"row",spacing:1.5,alignItems:"center",children:[e.jsxs(h,{sx:{position:"relative",display:"inline-flex"},children:[e.jsx(De,{name:r,size:40,sx:{border:"2px solid",borderColor:`${j}.lighter`}}),e.jsx(h,{sx:{position:"absolute",right:-3,bottom:-3,width:18,height:18,borderRadius:"50%",bgcolor:`${j}.main`,color:"#fff",display:"inline-flex",alignItems:"center",justifyContent:"center",border:"2px solid #fff"},children:e.jsx(y,{sx:{fontSize:11}})})]}),e.jsxs(h,{sx:{minWidth:0},children:[e.jsx(p,{variant:"body2",sx:{fontWeight:600,color:"grey.800",lineHeight:1.25},children:r}),x&&e.jsxs(p,{variant:"caption",color:"text.secondary",children:["@",x]})]})]})}function be({role:r}){const{color:i,icon:a}=ge(r);return e.jsx(me,{size:"small",icon:e.jsx(a,{sx:{fontSize:15,ml:.5}}),label:le(r),sx:{fontWeight:600,bgcolor:`${i==="secondary"?"grey.100":`${i}.lighter`}`,color:`${i==="secondary"?"grey.700":`${i}.dark`}`,"& .MuiChip-icon":{color:"inherit"}}})}function hs({row:r,index:i,onEdit:a,onDelete:j}){return e.jsxs(h,{sx:{p:1.75,borderRadius:3,border:1,borderColor:"divider",bgcolor:"background.paper"},children:[e.jsxs(m,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[e.jsx(h,{sx:{flexGrow:1,minWidth:0},children:e.jsx(ve,{name:r.name,email:r.email,role:r.role})}),e.jsx(be,{role:r.role})]}),e.jsxs(m,{spacing:1,sx:{mt:1.75},children:[e.jsxs(m,{direction:"row",spacing:1,alignItems:"center",sx:{minWidth:0},children:[e.jsx(H,{sx:{fontSize:16,color:"grey.400",flexShrink:0}}),r.email?e.jsx(W,{href:`mailto:${r.email}`,underline:"hover",color:"text.primary",noWrap:!0,sx:{fontSize:"0.8125rem"},children:r.email}):e.jsx(p,{variant:"body2",color:"text.disabled",children:"No email"})]}),e.jsxs(m,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(xe,{sx:{fontSize:16,color:"grey.400",flexShrink:0}}),r.phone?e.jsx(W,{href:`tel:${r.phone}`,underline:"hover",color:"text.primary",sx:{fontSize:"0.8125rem"},children:r.phone}):e.jsx(p,{variant:"body2",color:"text.disabled",children:"No phone"})]})]}),e.jsx(Re,{sx:{my:1.5}}),e.jsxs(m,{direction:"row",spacing:1,justifyContent:"space-between",alignItems:"center",children:[e.jsxs(p,{variant:"caption",color:"text.secondary",children:["#",i]}),e.jsxs(m,{direction:"row",spacing:1,children:[e.jsx(v,{size:"small",variant:"outlined",startIcon:e.jsx(ce,{fontSize:"small"}),onClick:()=>a(r),children:"Edit"}),e.jsx(v,{size:"small",variant:"outlined",color:"error",startIcon:e.jsx(de,{fontSize:"small"}),onClick:()=>j(r),children:"Delete"})]})]})]})}function ks(){var J;const r=re(),i=te(r.breakpoints.down("md")),[a,j]=n.useState([]),[y,x]=n.useState(!0),[k,z]=n.useState(null),[t,R]=n.useState(0),[f,D]=n.useState(""),[b,u]=n.useState(0),[o,L]=n.useState(10),[c,g]=n.useState({open:!1,mode:"add",initial:null}),[S,$]=n.useState(null),[E,Y]=n.useState(!1),I=()=>{x(!0),z(null),Me().then(s=>j(s.map(Pe))).catch(s=>z(s.message||"Failed to load team users")).finally(()=>x(!1))};n.useEffect(()=>{I()},[]);const w=n.useMemo(()=>{const s=[];return a.forEach(l=>{s.includes(l.role)||s.push(l.role)}),[{key:"all",label:"All"},...s.map(l=>({key:l,label:le(l)}))]},[a]),q=((J=w[Math.min(t,w.length-1)])==null?void 0:J.key)||"all",ye=n.useMemo(()=>{const s={all:a.length};return a.forEach(l=>{s[l.role]=(s[l.role]||0)+1}),s},[a]),A=n.useMemo(()=>a.filter(s=>{const l=q==="all"||s.role===q,T=!f||[s.name,s.email,s.phone,s.role].join(" ").toLowerCase().includes(f.toLowerCase());return l&&T}),[a,q,f]),B=A.slice(b*o,b*o+o),Se=()=>{g({open:!1,mode:"add",initial:null}),I()},Ce=async()=>{Y(!0);try{await ke(S.id),$(null),I()}catch(s){z(s.message||"Failed to delete user")}finally{Y(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(qe,{title:"App Users",breadcrumbs:[{label:"App Users"}],action:e.jsxs(m,{direction:"row",spacing:1.5,sx:{width:{xs:"100%",sm:"auto"}},children:[e.jsx(v,{variant:"outlined",startIcon:e.jsx(Ae,{}),onClick:I,disabled:y,sx:{flex:{xs:1,sm:"none"}},children:"Refresh"}),e.jsx(v,{variant:"contained",startIcon:e.jsx(we,{}),onClick:()=>g({open:!0,mode:"add",initial:null}),sx:{flex:{xs:1,sm:"none"}},children:"Add User"})]})}),e.jsxs(Ne,{sx:{overflow:"hidden"},children:[e.jsxs(h,{sx:{px:{xs:1.75,sm:2.5},py:2,borderBottom:1,borderColor:"divider",display:"flex",alignItems:"center",gap:1.5,background:s=>`linear-gradient(90deg, ${s.palette.primary.lighter}66 0%, ${s.palette.background.paper} 70%)`},children:[e.jsx(h,{sx:{width:40,height:40,borderRadius:2,bgcolor:"primary.lighter",color:"primary.main",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx(Ie,{fontSize:"small"})}),e.jsxs(h,{children:[e.jsx(p,{variant:"subtitle1",sx:{fontWeight:700,color:"grey.800",lineHeight:1.2},children:"App Users Directory"}),e.jsx(p,{variant:"caption",color:"text.secondary",children:"Manage console members, roles and access"})]})]}),e.jsxs(m,{direction:{xs:"column",md:"row"},spacing:1.5,sx:{p:{xs:1.5,sm:2}},alignItems:{md:"center"},children:[e.jsx(_,{size:"small",placeholder:"Search by name, email, phone…",value:f,onChange:s=>{D(s.target.value),u(0)},sx:{width:{xs:"100%",md:300}},InputProps:{startAdornment:e.jsx(Ve,{position:"start",children:e.jsx(Te,{fontSize:"small"})})}}),e.jsx(h,{sx:{flexGrow:1}}),!y&&e.jsxs(m,{direction:"row",spacing:1,alignItems:"center",children:[e.jsxs(p,{variant:"body2",color:"text.secondary",children:[A.length," ",A.length===1?"user":"users"]}),e.jsx(me,{size:"small",label:"live · PostgreSQL",sx:{height:22,fontSize:"0.7rem",bgcolor:"success.lighter",color:"success.dark",fontWeight:600}})]})]}),e.jsx(h,{sx:{px:2,borderBottom:1,borderColor:"divider"},children:e.jsx(Fe,{value:Math.min(t,w.length-1),onChange:(s,l)=>{R(l),u(0)},variant:"scrollable",scrollButtons:"auto",children:w.map((s,l)=>e.jsx(He,{label:e.jsx(We,{label:s.label,count:ye[s.key]||0,active:t===l})},s.key))})}),k&&e.jsx(ue,{severity:"error",sx:{m:2},action:e.jsx(v,{color:"inherit",size:"small",onClick:I,children:"Retry"}),children:k}),y?e.jsx(h,{sx:{display:"flex",justifyContent:"center",py:6},children:e.jsx(V,{})}):B.length===0?e.jsx(Be,{title:"No team users found",caption:"Try a different role or search term, or add a user."}):i?e.jsx(m,{spacing:1.25,sx:{p:{xs:1.5,sm:2}},children:B.map((s,l)=>e.jsx(hs,{row:s,index:b*o+l+1,onEdit:T=>g({open:!0,mode:"edit",initial:T}),onDelete:T=>$(T)},s.id))}):e.jsx(Ge,{children:e.jsxs(Qe,{sx:{minWidth:800},children:[e.jsx(Ke,{children:e.jsxs(ee,{sx:{"& th":{bgcolor:"grey.50",fontWeight:700,color:"grey.700",textTransform:"uppercase",fontSize:"0.72rem",letterSpacing:.4}},children:[e.jsx(d,{sx:{width:64},children:"S.No"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Email"}),e.jsx(d,{children:"Phone"}),e.jsx(d,{children:"Role"}),e.jsx(d,{align:"right",children:"Actions"})]})}),e.jsx(Xe,{children:B.map((s,l)=>e.jsxs(ee,{hover:!0,children:[e.jsx(d,{children:e.jsx(p,{variant:"body2",color:"text.secondary",children:b*o+l+1})}),e.jsx(d,{children:e.jsx(ve,{name:s.name,email:s.email,role:s.role})}),e.jsx(d,{children:s.email?e.jsxs(W,{href:`mailto:${s.email}`,underline:"hover",color:"text.primary",sx:{display:"inline-flex",alignItems:"center",gap:.75,fontSize:"0.8125rem"},children:[e.jsx(H,{sx:{fontSize:15,color:"grey.400"}}),s.email]}):e.jsx(p,{variant:"body2",color:"text.disabled",children:"—"})}),e.jsx(d,{children:s.phone?e.jsxs(W,{href:`tel:${s.phone}`,underline:"hover",color:"text.primary",sx:{display:"inline-flex",alignItems:"center",gap:.75,fontSize:"0.8125rem"},children:[e.jsx(xe,{sx:{fontSize:15,color:"grey.400"}}),s.phone]}):e.jsx(p,{variant:"body2",color:"text.disabled",children:"—"})}),e.jsx(d,{children:e.jsx(be,{role:s.role})}),e.jsxs(d,{align:"right",children:[e.jsx(Z,{title:"Edit",children:e.jsx(N,{size:"small",onClick:()=>g({open:!0,mode:"edit",initial:s}),children:e.jsx(ce,{fontSize:"small"})})}),e.jsx(Z,{title:"Delete",children:e.jsx(N,{size:"small",color:"error",onClick:()=>$(s),children:e.jsx(de,{fontSize:"small"})})})]})]},s.id))})]})}),e.jsx(Oe,{component:"div",count:A.length,page:b,onPageChange:(s,l)=>u(l),rowsPerPage:o,onRowsPerPageChange:s=>{L(+s.target.value),u(0)},rowsPerPageOptions:[5,10,25]})]}),e.jsx(us,{open:c.open,mode:c.mode,initial:c.initial,onClose:()=>g({open:!1,mode:"add",initial:null}),onSaved:Se}),e.jsxs(ne,{open:!!S,onClose:E?void 0:()=>$(null),children:[e.jsx(ie,{children:"Delete user?"}),e.jsx(ae,{children:e.jsxs(Ue,{children:["This will permanently remove ",e.jsx("strong",{children:S==null?void 0:S.name})," from the PostgreSQL database. This cannot be undone."]})}),e.jsxs(oe,{sx:{px:3,py:2},children:[e.jsx(v,{onClick:()=>$(null),disabled:E,children:"Cancel"}),e.jsx(v,{color:"error",variant:"contained",onClick:Ce,disabled:E,startIcon:E?e.jsx(V,{size:16,color:"inherit"}):null,children:"Delete"})]})]})]})}export{ks as default}; diff --git a/dist/assets/TeamUsers-Djs_f-Bi.js b/dist/assets/TeamUsers-Djs_f-Bi.js new file mode 100644 index 0000000..79d5a16 --- /dev/null +++ b/dist/assets/TeamUsers-Djs_f-Bi.js @@ -0,0 +1 @@ +import{r as M,j as e,i as P,u as oe,a as ce,b as i,I as V,M as $e,C as H,V as Ie,W as Me,t as de,S as h,c as le,B as p,T as j,l as Pe,o as ne,e as Re,h as ke,X as De,D as Ee,U as we}from"./index-D7LVXeIK.js";import{D as xe,a as ue,e as Ae,b as me,c as he,d as Ue}from"./Close-D3HB9j5y.js";import{d as Oe}from"./Refresh-DA6RLQV4.js";import{d as pe}from"./EditOutlined-DS7hq7Cq.js";import{d as je,T as We}from"./DeleteOutline-Dhk3Cr2d.js";import{d as fe,D as Le}from"./PhoneOutlined-Uvrb40S4.js";import{T as qe,d as Be}from"./TabLabelCount-1dep75sI.js";import{A as ge,G as x,P as Fe,C as ve}from"./PageHeader-naLAT9xr.js";import{S as O,E as Ne}from"./EmptyState-B9FcYx_n.js";import{T as z}from"./TextField-Sd_pshci.js";import{B as b}from"./Button-Bqp5awT1.js";import{C as Ve,L as q}from"./Link-BEif5YS2.js";import{I as He}from"./InputAdornment-CMIlL2rx.js";import{T as Ge,a as Qe}from"./Tabs-BUgAhQiL.js";import{T as Ke,a as Xe,b as Ye,c as ie,d as Je}from"./TableRow-jBgitpDf.js";import{T as d}from"./TableCell-DreGbAeW.js";var G={},Ze=P;Object.defineProperty(G,"__esModule",{value:!0});var Q=G.default=void 0,es=Ze(M()),ss=e;Q=G.default=(0,es.default)((0,ss.jsx)("path",{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2m0 14H4V8l8 5 8-5zm-8-7L4 6h16z"}),"MailOutline");var K={},rs=P;Object.defineProperty(K,"__esModule",{value:!0});var X=K.default=void 0,ts=rs(M()),W=e;X=K.default=(0,ts.default)((0,W.jsxs)("g",{fillRule:"evenodd",children:[(0,W.jsx)("circle",{cx:"17",cy:"15.5",r:"1.12"}),(0,W.jsx)("path",{d:"M17 17.5c-.73 0-2.19.36-2.24 1.08.5.71 1.32 1.17 2.24 1.17s1.74-.46 2.24-1.17c-.05-.72-1.51-1.08-2.24-1.08"}),(0,W.jsx)("path",{d:"M18 11.09V6.27L10.5 3 3 6.27v4.91c0 4.54 3.2 8.79 7.5 9.82.55-.13 1.08-.32 1.6-.55C13.18 21.99 14.97 23 17 23c3.31 0 6-2.69 6-6 0-2.97-2.16-5.43-5-5.91M11 17c0 .56.08 1.11.23 1.62-.24.11-.48.22-.73.3-3.17-1-5.5-4.24-5.5-7.74v-3.6l5.5-2.4 5.5 2.4v3.51c-2.84.48-5 2.94-5 5.91m6 4c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4"})]}),"AdminPanelSettingsOutlined");var Y={},ls=P;Object.defineProperty(Y,"__esModule",{value:!0});var J=Y.default=void 0,ns=ls(M()),L=e;J=Y.default=(0,ns.default)([(0,L.jsx)("path",{d:"M21 12.22C21 6.73 16.74 3 12 3c-4.69 0-9 3.65-9 9.28-.6.34-1 .98-1 1.72v2c0 1.1.9 2 2 2h1v-6.1c0-3.87 3.13-7 7-7s7 3.13 7 7V19h-8v2h8c1.1 0 2-.9 2-2v-1.22c.59-.31 1-.92 1-1.64v-2.3c0-.7-.41-1.31-1-1.62"},"0"),(0,L.jsx)("circle",{cx:"9",cy:"13",r:"1"},"1"),(0,L.jsx)("circle",{cx:"15",cy:"13",r:"1"},"2"),(0,L.jsx)("path",{d:"M18 11.03C17.52 8.18 15.04 6 12.05 6c-3.03 0-6.29 2.51-6.03 6.45 2.47-1.01 4.33-3.21 4.86-5.89 1.31 2.63 4 4.44 7.12 4.47"},"3")],"SupportAgentOutlined");var Z={},is=P;Object.defineProperty(Z,"__esModule",{value:!0});var ee=Z.default=void 0,as=is(M()),os=e;ee=Z.default=(0,as.default)((0,os.jsx)("path",{d:"M4 18v-.65c0-.34.16-.66.41-.81C6.1 15.53 8.03 15 10 15c.03 0 .05 0 .08.01.1-.7.3-1.37.59-1.98-.22-.02-.44-.03-.67-.03-2.42 0-4.68.67-6.61 1.82-.88.52-1.39 1.5-1.39 2.53V20h9.26c-.42-.6-.75-1.28-.97-2zm6-6c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m10.75 10c0-.22-.03-.42-.06-.63l1.14-1.01-1-1.73-1.45.49c-.32-.27-.68-.48-1.08-.63L18 11h-2l-.3 1.49c-.4.15-.76.36-1.08.63l-1.45-.49-1 1.73 1.14 1.01c-.03.21-.06.41-.06.63s.03.42.06.63l-1.14 1.01 1 1.73 1.45-.49c.32.27.68.48 1.08.63L16 21h2l.3-1.49c.4-.15.76-.36 1.08-.63l1.45.49 1-1.73-1.14-1.01c.03-.21.06-.41.06-.63M17 18c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"ManageAccountsOutlined");var se={},cs=P;Object.defineProperty(se,"__esModule",{value:!0});var be=se.default=void 0,ds=cs(M()),xs=e;be=se.default=(0,ds.default)((0,xs.jsx)("path",{d:"M12 5.9c1.16 0 2.1.94 2.1 2.1s-.94 2.1-2.1 2.1S9.9 9.16 9.9 8s.94-2.1 2.1-2.1m0 9c2.97 0 6.1 1.46 6.1 2.1v1.1H5.9V17c0-.64 3.13-2.1 6.1-2.1M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 9c-2.67 0-8 1.34-8 4v3h16v-3c0-2.66-5.33-4-8-4"}),"PersonOutlineOutlined");const us=["admin","rep","manager"],ae={name:"",email:"",phone:"",role:"rep",pin:"",password:""},ms=(r,a)=>a&&!r.includes(a)?[a,...r]:r;function hs({open:r,mode:a,initial:n,onClose:f,onSaved:C}){const u=a==="edit",R=oe(),T=ce(R.breakpoints.down("sm")),[t,k]=i.useState(ae),[g,D]=i.useState(!1),[y,m]=i.useState(null);i.useEffect(()=>{r&&(k({...ae,...n||{}}),m(null))},[r,n]);const o=c=>v=>k(_=>({..._,[c]:v.target.value})),B=async()=>{if(!t.name.trim()){m("Name is required.");return}if(!t.email.trim()){m("Email is required.");return}if(!u&&!t.password.trim()){m("Password is required.");return}D(!0),m(null);const c={first_name:t.name.trim(),email:t.email.trim(),phone:t.phone,role:t.role,...t.password?{password:t.password}:{},...t.pin?{pin:String(t.pin)}:{}};try{u?await Ie(n.id,c):await Me(c),C()}catch(v){m(v.message||"Failed to save user")}finally{D(!1)}};return e.jsxs(xe,{open:r,onClose:g?void 0:f,maxWidth:"sm",fullWidth:!0,fullScreen:T,children:[e.jsxs(ue,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[u?"Edit Team User":"Add Team User",e.jsx(V,{onClick:f,size:"small",disabled:g,children:e.jsx(Ae,{})})]}),e.jsxs(me,{dividers:!0,children:[y&&e.jsx(ge,{severity:"error",sx:{mb:2},children:y}),e.jsxs(x,{container:!0,spacing:2,sx:{mt:0},children:[e.jsx(x,{item:!0,xs:12,sm:6,children:e.jsx(z,{fullWidth:!0,size:"small",label:"Name *",value:t.name,onChange:o("name")})}),e.jsx(x,{item:!0,xs:12,sm:6,children:e.jsx(z,{fullWidth:!0,size:"small",label:"Email *",value:t.email,onChange:o("email")})}),e.jsx(x,{item:!0,xs:12,sm:6,children:e.jsx(z,{fullWidth:!0,size:"small",label:"Phone",value:t.phone,onChange:o("phone")})}),e.jsx(x,{item:!0,xs:12,sm:6,children:e.jsx(z,{select:!0,fullWidth:!0,size:"small",label:"Role",value:t.role,onChange:o("role"),children:ms(us,t.role).map(c=>e.jsx($e,{value:c,children:c},c))})}),e.jsx(x,{item:!0,xs:12,sm:6,children:e.jsx(z,{fullWidth:!0,size:"small",label:"PIN",value:t.pin,onChange:o("pin")})}),e.jsx(x,{item:!0,xs:12,sm:6,children:e.jsx(z,{fullWidth:!0,size:"small",type:"password",label:u?"New Password (optional)":"Password *",value:t.password,onChange:o("password")})})]})]}),e.jsxs(he,{sx:{px:3,py:2},children:[e.jsx(b,{onClick:f,disabled:g,children:"Cancel"}),e.jsx(b,{variant:"contained",onClick:B,disabled:g,startIcon:g?e.jsx(H,{size:16,color:"inherit"}):null,children:u?"Save Changes":"Create User"})]})]})}const ps={admin:{color:"primary",icon:X},manager:{color:"success",icon:ee},rep:{color:"info",icon:Be},support:{color:"warning",icon:J}},ye=r=>ps[String(r||"").toLowerCase()]||{color:"secondary",icon:be};function Se({name:r,email:a,role:n}){const{color:f,icon:C}=ye(n),u=a?a.split("@")[0]:"";return e.jsxs(h,{direction:"row",spacing:1.5,alignItems:"center",children:[e.jsxs(p,{sx:{position:"relative",display:"inline-flex"},children:[e.jsx(we,{name:r,size:40,sx:{border:"2px solid",borderColor:`${f}.lighter`}}),e.jsx(p,{sx:{position:"absolute",right:-3,bottom:-3,width:18,height:18,borderRadius:"50%",bgcolor:`${f}.main`,color:"#fff",display:"inline-flex",alignItems:"center",justifyContent:"center",border:"2px solid #fff"},children:e.jsx(C,{sx:{fontSize:11}})})]}),e.jsxs(p,{sx:{minWidth:0},children:[e.jsx(j,{variant:"body2",sx:{fontWeight:600,color:"grey.800",lineHeight:1.25},children:r}),u&&e.jsxs(j,{variant:"caption",color:"text.secondary",children:["@",u]})]})]})}function Ce({role:r}){const{color:a,icon:n}=ye(r);return e.jsx(ve,{size:"small",icon:e.jsx(n,{sx:{fontSize:15,ml:.5}}),label:de(r),sx:{fontWeight:600,bgcolor:`${a==="secondary"?"grey.100":`${a}.lighter`}`,color:`${a==="secondary"?"grey.700":`${a}.dark`}`,"& .MuiChip-icon":{color:"inherit"}}})}function js({row:r,index:a,onEdit:n,onDelete:f}){return e.jsxs(p,{sx:{p:2,borderRadius:3,border:1,borderColor:"divider",bgcolor:"background.paper"},children:[e.jsxs(h,{direction:"row",spacing:1.25,alignItems:"flex-start",children:[e.jsx(p,{sx:{flexGrow:1,minWidth:0},children:e.jsx(Se,{name:r.name,email:r.email,role:r.role})}),e.jsx(Ce,{role:r.role})]}),e.jsxs(h,{spacing:1,sx:{mt:1.75},children:[e.jsxs(h,{direction:"row",spacing:1,alignItems:"center",sx:{minWidth:0},children:[e.jsx(Q,{sx:{fontSize:16,color:"grey.400",flexShrink:0}}),r.email?e.jsx(q,{href:`mailto:${r.email}`,underline:"hover",color:"text.primary",noWrap:!0,sx:{fontSize:"0.8125rem"},children:r.email}):e.jsx(j,{variant:"body2",color:"text.disabled",children:"No email"})]}),e.jsxs(h,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(fe,{sx:{fontSize:16,color:"grey.400",flexShrink:0}}),r.phone?e.jsx(q,{href:`tel:${r.phone}`,underline:"hover",color:"text.primary",sx:{fontSize:"0.8125rem"},children:r.phone}):e.jsx(j,{variant:"body2",color:"text.disabled",children:"No phone"})]})]}),e.jsx(Ee,{sx:{my:1.5}}),e.jsxs(h,{direction:"row",spacing:1,justifyContent:"space-between",alignItems:"center",children:[e.jsxs(j,{variant:"caption",color:"text.secondary",children:["#",a]}),e.jsxs(h,{direction:"row",spacing:1,children:[e.jsx(b,{size:"small",variant:"outlined",startIcon:e.jsx(pe,{fontSize:"small"}),onClick:()=>n(r),children:"Edit"}),e.jsx(b,{size:"small",variant:"outlined",color:"error",startIcon:e.jsx(je,{fontSize:"small"}),onClick:()=>f(r),children:"Delete"})]})]})]})}function Ds(){var te;const r=oe(),a=ce(r.breakpoints.down("md")),[n,f]=i.useState([]),[C,u]=i.useState(!0),[R,T]=i.useState(null),[t,k]=i.useState(0),[g,D]=i.useState(""),[y,m]=i.useState(0),[o,B]=i.useState(10),[c,v]=i.useState({open:!1,mode:"add",initial:null}),[_,$]=i.useState(null),[E,re]=i.useState(!1),I=()=>{u(!0),T(null),Re().then(s=>f(s.map(ke))).catch(s=>T(s.message||"Failed to load team users")).finally(()=>u(!1))};i.useEffect(()=>{I()},[]);const w=i.useMemo(()=>{const s=[];return n.forEach(l=>{s.includes(l.role)||s.push(l.role)}),[{key:"all",label:"All"},...s.map(l=>({key:l,label:de(l)}))]},[n]),F=((te=w[Math.min(t,w.length-1)])==null?void 0:te.key)||"all",_e=i.useMemo(()=>{const s={all:n.length};return n.forEach(l=>{s[l.role]=(s[l.role]||0)+1}),s},[n]),A=i.useMemo(()=>{const s={admin:0,manager:0,rep:0,support:0};return n.forEach(l=>{const S=String(l.role||"").toLowerCase();S in s&&(s[S]+=1)}),s},[n]),U=i.useMemo(()=>n.filter(s=>{const l=F==="all"||s.role===F,S=!g||[s.name,s.email,s.phone,s.role].join(" ").toLowerCase().includes(g.toLowerCase());return l&&S}),[n,F,g]),N=U.slice(y*o,y*o+o),ze=()=>{v({open:!1,mode:"add",initial:null}),I()},Te=async()=>{re(!0);try{await De(_.id),$(null),I()}catch(s){T(s.message||"Failed to delete user")}finally{re(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(Fe,{title:"App Users",breadcrumbs:[{label:"App Users"}],action:e.jsxs(h,{direction:"row",spacing:1.5,sx:{width:{xs:"100%",sm:"auto"}},children:[e.jsx(b,{variant:"outlined",startIcon:e.jsx(Oe,{}),onClick:I,disabled:C,sx:{flex:{xs:1,sm:"none"}},children:"Refresh"}),e.jsx(b,{variant:"contained",startIcon:e.jsx(Ue,{}),onClick:()=>v({open:!0,mode:"add",initial:null}),sx:{flex:{xs:1,sm:"none"}},children:"Add User"})]})}),e.jsxs(x,{container:!0,spacing:2.5,sx:{mb:3},children:[e.jsx(x,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(O,{accent:!0,title:"Total Users",value:n.length,icon:le,color:"primary",caption:"All console members"})}),e.jsx(x,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(O,{accent:!0,title:"Admins",value:A.admin,icon:X,color:"primary",caption:"Full access"})}),e.jsx(x,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(O,{accent:!0,title:"Managers",value:A.manager,icon:ee,color:"primary",caption:"Team oversight"})}),e.jsx(x,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(O,{accent:!0,title:"Reps & Support",value:A.rep+A.support,icon:J,color:"primary",caption:"Frontline staff"})})]}),e.jsxs(Ve,{sx:{overflow:"hidden"},children:[e.jsxs(p,{sx:{px:{xs:2,sm:2.5},py:2,borderBottom:1,borderColor:"divider",display:"flex",alignItems:"center",gap:1.5,background:s=>`linear-gradient(90deg, ${s.palette.primary.lighter}66 0%, ${s.palette.background.paper} 70%)`},children:[e.jsx(p,{sx:{width:40,height:40,borderRadius:2,bgcolor:"primary.lighter",color:"primary.main",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx(le,{fontSize:"small"})}),e.jsxs(p,{children:[e.jsx(j,{variant:"subtitle1",sx:{fontWeight:700,color:"grey.800",lineHeight:1.2},children:"App Users Directory"}),e.jsx(j,{variant:"caption",color:"text.secondary",children:"Manage console members, roles and access"})]})]}),e.jsxs(h,{direction:{xs:"column",md:"row"},spacing:1.5,sx:{p:2},alignItems:{md:"center"},children:[e.jsx(z,{size:"small",placeholder:"Search by name, email, phone…",value:g,onChange:s=>{D(s.target.value),m(0)},sx:{width:{xs:"100%",md:300}},InputProps:{startAdornment:e.jsx(He,{position:"start",children:e.jsx(Pe,{fontSize:"small"})})}}),e.jsx(p,{sx:{flexGrow:1}}),!C&&e.jsxs(h,{direction:"row",spacing:1,alignItems:"center",children:[e.jsxs(j,{variant:"body2",color:"text.secondary",children:[U.length," ",U.length===1?"user":"users"]}),e.jsx(ve,{size:"small",label:"live · PostgreSQL",sx:{height:22,fontSize:"0.7rem",bgcolor:"success.lighter",color:"success.dark",fontWeight:600}})]})]}),e.jsx(p,{sx:{px:2,borderBottom:1,borderColor:"divider"},children:e.jsx(Ge,{value:Math.min(t,w.length-1),onChange:(s,l)=>{k(l),m(0)},variant:"scrollable",scrollButtons:"auto",children:w.map((s,l)=>e.jsx(Qe,{label:e.jsx(qe,{label:s.label,count:_e[s.key]||0,active:t===l})},s.key))})}),R&&e.jsx(ge,{severity:"error",sx:{m:2},action:e.jsx(b,{color:"inherit",size:"small",onClick:I,children:"Retry"}),children:R}),C?e.jsx(p,{sx:{display:"flex",justifyContent:"center",py:6},children:e.jsx(H,{})}):N.length===0?e.jsx(Ne,{title:"No team users found",caption:"Try a different role or search term, or add a user."}):a?e.jsx(h,{spacing:1.5,sx:{p:2},children:N.map((s,l)=>e.jsx(js,{row:s,index:y*o+l+1,onEdit:S=>v({open:!0,mode:"edit",initial:S}),onDelete:S=>$(S)},s.id))}):e.jsx(Ke,{children:e.jsxs(Xe,{sx:{minWidth:800},children:[e.jsx(Ye,{children:e.jsxs(ie,{sx:{"& th":{bgcolor:"grey.50",fontWeight:700,color:"grey.700",textTransform:"uppercase",fontSize:"0.72rem",letterSpacing:.4}},children:[e.jsx(d,{sx:{width:64},children:"S.No"}),e.jsx(d,{children:"User"}),e.jsx(d,{children:"Email"}),e.jsx(d,{children:"Phone"}),e.jsx(d,{children:"Role"}),e.jsx(d,{align:"right",children:"Actions"})]})}),e.jsx(Je,{children:N.map((s,l)=>e.jsxs(ie,{hover:!0,children:[e.jsx(d,{children:e.jsx(j,{variant:"body2",color:"text.secondary",children:y*o+l+1})}),e.jsx(d,{children:e.jsx(Se,{name:s.name,email:s.email,role:s.role})}),e.jsx(d,{children:s.email?e.jsxs(q,{href:`mailto:${s.email}`,underline:"hover",color:"text.primary",sx:{display:"inline-flex",alignItems:"center",gap:.75,fontSize:"0.8125rem"},children:[e.jsx(Q,{sx:{fontSize:15,color:"grey.400"}}),s.email]}):e.jsx(j,{variant:"body2",color:"text.disabled",children:"—"})}),e.jsx(d,{children:s.phone?e.jsxs(q,{href:`tel:${s.phone}`,underline:"hover",color:"text.primary",sx:{display:"inline-flex",alignItems:"center",gap:.75,fontSize:"0.8125rem"},children:[e.jsx(fe,{sx:{fontSize:15,color:"grey.400"}}),s.phone]}):e.jsx(j,{variant:"body2",color:"text.disabled",children:"—"})}),e.jsx(d,{children:e.jsx(Ce,{role:s.role})}),e.jsxs(d,{align:"right",children:[e.jsx(ne,{title:"Edit",children:e.jsx(V,{size:"small",onClick:()=>v({open:!0,mode:"edit",initial:s}),children:e.jsx(pe,{fontSize:"small"})})}),e.jsx(ne,{title:"Delete",children:e.jsx(V,{size:"small",color:"error",onClick:()=>$(s),children:e.jsx(je,{fontSize:"small"})})})]})]},s.id))})]})}),e.jsx(We,{component:"div",count:U.length,page:y,onPageChange:(s,l)=>m(l),rowsPerPage:o,onRowsPerPageChange:s=>{B(+s.target.value),m(0)},rowsPerPageOptions:[5,10,25]})]}),e.jsx(hs,{open:c.open,mode:c.mode,initial:c.initial,onClose:()=>v({open:!1,mode:"add",initial:null}),onSaved:ze}),e.jsxs(xe,{open:!!_,onClose:E?void 0:()=>$(null),children:[e.jsx(ue,{children:"Delete user?"}),e.jsx(me,{children:e.jsxs(Le,{children:["This will permanently remove ",e.jsx("strong",{children:_==null?void 0:_.name})," from the PostgreSQL database. This cannot be undone."]})}),e.jsxs(he,{sx:{px:3,py:2},children:[e.jsx(b,{onClick:()=>$(null),disabled:E,children:"Cancel"}),e.jsx(b,{color:"error",variant:"contained",onClick:Te,disabled:E,startIcon:E?e.jsx(H,{size:16,color:"inherit"}):null,children:"Delete"})]})]})]})}export{Ds as default}; diff --git a/dist/assets/Tenants-nHqVcNog.js b/dist/assets/Tenants-nHqVcNog.js deleted file mode 100644 index 6278865..0000000 --- a/dist/assets/Tenants-nHqVcNog.js +++ /dev/null @@ -1 +0,0 @@ -import{r as K,j as e,i as Q,u as ze,a as Te,b as c,k as $e,t as f,S as a,d as ae,B as o,T as s,l as _e,C as le,f as ke,g as De,m as We,U as X,D as V,n as ce,I as w,o as G}from"./index-DpAn5wLF.js";import{d as Pe,D as Re,a as Le,b as Be,c as Ae}from"./Close-BdNf_RlN.js";import{d as Ee}from"./Refresh-B8qCgQHN.js";import{d as J}from"./EditOutlined-B2ltVbl8.js";import{T as Fe,d as de}from"./DeleteOutline-BVDDlNca.js";import{d as _,a as xe,b as he,c as Me}from"./StorefrontOutlined-B0ka2NHy.js";import{d as qe,a as ue,b as me,S as Y}from"./StatusChip-C72vLAK4.js";import{D as Oe,d as ge}from"./PhoneOutlined-CDgMDTyj.js";import{d as He}from"./LocalShippingOutlined-Ds2yAonP.js";import{d as Ne}from"./MapOutlined-QidbDh4A.js";import{T as we,d as Ve}from"./TabLabelCount-C_C4hO8i.js";import{P as Ge,G as u,C as Z,A as Ue}from"./PageHeader-CEew5Fw4.js";import{S as B}from"./StatCard-Nzv53jX8.js";import{E as Ke}from"./EmptyState-BsjYeVAX.js";import{C as Qe}from"./ClientFormDialog-K7w_VS5d.js";import{B as p}from"./Button-BGNvVfej.js";import{C as Xe}from"./Link-Bme8npFv.js";import{T as Je}from"./TextField-C0dUZvW0.js";import{I as Ye}from"./InputAdornment-BWnl4jqW.js";import{T as Ze,a as et}from"./Tabs-Cp4sZXyZ.js";import{T as tt,a as rt,b as it,c as U,d as nt}from"./TableRow-BcqnvRn2.js";import{T as x}from"./TableCell-PEGz6qo_.js";import"./Snackbar-B0wJYiYQ.js";var ee={},st=Q;Object.defineProperty(ee,"__esModule",{value:!0});var pe=ee.default=void 0,at=st(K()),lt=e;pe=ee.default=(0,at.default)((0,lt.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined");var te={},ot=Q;Object.defineProperty(te,"__esModule",{value:!0});var je=te.default=void 0,ct=ot(K()),dt=e;je=te.default=(0,ct.default)((0,dt.jsx)("path",{d:"M21 11.01 3 11v2h18zM3 16h12v2H3zM21 6H3v2.01L21 8z"}),"NotesOutlined");var re={},xt=Q;Object.defineProperty(re,"__esModule",{value:!0});var fe=re.default=void 0,ht=xt(K()),ut=e;fe=re.default=(0,ht.default)((0,ut.jsx)("path",{d:"M16.01 11H4v2h12.01v3L20 12l-3.99-4z"}),"ArrowRightAlt");const mt=t=>({full:"success",basiconly:"info",none:"default"})[String(t||"").toLowerCase()]||"default",gt=t=>{const l=String(t||"").toLowerCase();return/high|good|excellent/.test(l)?"success":/med|average|moderate/.test(l)?"warning":/low|poor|bad/.test(l)?"error":"info"},pt={textTransform:"uppercase",letterSpacing:.4,fontSize:"0.68rem",fontWeight:700,color:"grey.700"};function j({label:t,color:l="default"}){return t==null||t===""?e.jsx(s,{variant:"body2",sx:{fontWeight:500,color:"grey.500"},children:"—"}):e.jsx(Z,{size:"small",label:t,sx:{fontWeight:600,...l==="default"?{bgcolor:"grey.100",color:"grey.700"}:{bgcolor:`${l}.lighter`,color:`${l}.dark`}}})}function m({label:t,children:l}){return e.jsxs(o,{children:[e.jsx(s,{variant:"caption",color:"text.secondary",sx:pt,children:t}),e.jsx(o,{sx:{mt:.5},children:l})]})}function A({label:t,value:l}){return e.jsx(m,{label:t,children:e.jsx(s,{variant:"body2",sx:{fontWeight:500,color:l?"grey.800":"grey.500",wordBreak:"break-word"},children:l||"—"})})}function E({icon:t,title:l,accent:i="primary",children:d}){return e.jsxs(o,{sx:{height:"100%",borderRadius:2,border:1,borderColor:"divider",bgcolor:"background.paper",overflow:"hidden"},children:[e.jsxs(a,{direction:"row",spacing:1,alignItems:"center",sx:{px:2,py:1.25,borderBottom:1,borderColor:"divider",bgcolor:`${i}.lighter`,opacity:.999},children:[e.jsx(t,{sx:{fontSize:18,color:`${i}.main`}}),e.jsx(s,{variant:"overline",sx:{fontWeight:700,color:"grey.800",letterSpacing:.6,lineHeight:1},children:l})]}),e.jsx(a,{spacing:1.75,sx:{p:2},children:d})]})}function oe({label:t,value:l,icon:i,color:d="primary"}){return e.jsx(o,{sx:{flex:1,p:1.5,borderRadius:1.5,border:1,borderColor:"divider",bgcolor:"grey.50"},children:e.jsxs(a,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(o,{sx:{width:32,height:32,borderRadius:1,bgcolor:`${d}.lighter`,color:`${d}.main`,display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx(i,{sx:{fontSize:18}})}),e.jsxs(o,{children:[e.jsx(s,{variant:"h5",sx:{fontWeight:700,color:"grey.800",lineHeight:1.1},children:l}),e.jsx(s,{variant:"caption",color:"text.secondary",children:t})]})]})})}function F({label:t,value:l,color:i="grey.800"}){return e.jsxs(o,{sx:{textAlign:"center",minWidth:56},children:[e.jsx(s,{variant:"body2",sx:{fontWeight:700,color:i,lineHeight:1.2},children:l}),e.jsx(s,{variant:"caption",color:"text.secondary",sx:{fontSize:"0.65rem"},children:t})]})}function be({row:t,onEdit:l}){return e.jsxs(o,{sx:{m:2,borderRadius:2.5,border:1,borderColor:"divider",overflow:"hidden",boxShadow:"0 4px 16px rgba(0,0,0,0.06)"},children:[e.jsxs(a,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:1.5,sx:{px:2.5,py:1.75,borderBottom:1,borderColor:"divider",background:i=>`linear-gradient(90deg, ${i.palette.primary.lighter}88 0%, ${i.palette.background.paper} 75%)`},children:[e.jsxs(a,{direction:"row",spacing:1.5,alignItems:"center",children:[e.jsx(X,{name:t.name,size:40}),e.jsxs(o,{children:[e.jsx(s,{variant:"subtitle1",sx:{fontWeight:700,lineHeight:1.2},children:t.name}),e.jsxs(a,{direction:"row",spacing:.75,alignItems:"center",sx:{mt:.25},children:[e.jsx(Ve,{sx:{fontSize:14,color:"grey.400"}}),e.jsx(s,{variant:"caption",color:"text.secondary",children:t.clientId})]})]}),e.jsx(Y,{status:t.status,sx:{ml:.5}})]}),e.jsx(p,{size:"small",variant:"contained",startIcon:e.jsx(J,{}),onClick:()=>l(t),sx:{width:{xs:"100%",sm:"auto"}},children:"Edit Client"})]}),e.jsx(o,{sx:{p:{xs:1.5,sm:2.5},bgcolor:"grey.50"},children:e.jsxs(u,{container:!0,spacing:2.5,alignItems:"stretch",children:[e.jsx(u,{item:!0,xs:12,md:4,children:e.jsxs(E,{icon:Me,title:"Business",accent:"primary",children:[e.jsxs(a,{direction:"row",spacing:1.5,children:[e.jsx(oe,{label:"Parcel Volume",value:Number(t.parcelVolume).toLocaleString(),icon:ue,color:"primary"}),e.jsx(oe,{label:"Active Contracts",value:t.activeContracts,icon:me,color:"primary"})]}),e.jsx(m,{label:"Client ID",children:e.jsx(s,{variant:"body2",sx:{fontFamily:"monospace",fontWeight:600,color:"grey.800"},children:t.clientId})}),e.jsx(m,{label:"Business Type",children:e.jsx(j,{label:t.businessType&&f(t.businessType),color:"primary"})}),e.jsx(m,{label:"Order Frequency",children:e.jsx(j,{label:t.frequency&&f(t.frequency),color:"info"})})]})}),e.jsx(u,{item:!0,xs:12,md:4,children:e.jsxs(E,{icon:He,title:"Logistics",accent:"primary",children:[e.jsx(m,{label:"Logistics Segment",children:t.logisticsSegment?e.jsx(a,{direction:"row",spacing:.75,flexWrap:"wrap",useFlexGap:!0,children:String(t.logisticsSegment).split(/[,/]/).map(i=>i.trim()).filter(Boolean).map(i=>e.jsx(j,{label:f(i),color:"primary"},i))}):e.jsx(j,{label:null})}),e.jsx(A,{label:"Current Provider",value:t.provider}),e.jsx(m,{label:"Efficiency",children:e.jsx(j,{label:t.efficiency&&f(t.efficiency),color:gt(t.efficiency)})}),e.jsx(m,{label:"Transit Route",children:(()=>{const i=[t.transitFrom,...String(t.transitTo||"").split(",")].map(d=>d.trim()).filter(Boolean);return i.length?e.jsx(a,{direction:"row",spacing:.75,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:i.map((d,h)=>e.jsxs(c.Fragment,{children:[h>0&&e.jsx(fe,{sx:{fontSize:20,color:"primary.main"}}),e.jsx(j,{label:f(d),color:h===0?"default":"info"})]},`${d}-${h}`))}):e.jsx(j,{label:null})})()})]})}),e.jsx(u,{item:!0,xs:12,md:4,children:e.jsxs(E,{icon:_,title:"Location & Survey",accent:"primary",children:[e.jsx(m,{label:"City / State",children:e.jsx(s,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:[t.city,t.businessState].filter(Boolean).join(", ")||"—"})}),e.jsx(A,{label:"Neighbourhood",value:t.neighbourhood}),e.jsx(m,{label:"Survey Address",children:e.jsxs(a,{direction:"row",spacing:1,sx:{p:1.25,borderRadius:1.5,bgcolor:"grey.50",border:1,borderColor:"divider"},children:[e.jsx(_,{sx:{fontSize:16,color:"grey.400",mt:"2px"}}),e.jsx(s,{variant:"body2",sx:{color:"grey.800",lineHeight:1.5},children:t.surveyAddress||"—"})]})}),e.jsx(m,{label:"Coordinates",children:t.surveyLat&&t.surveyLng?e.jsxs(a,{direction:"row",spacing:1.25,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:[e.jsx(G,{title:`${t.surveyLat}, ${t.surveyLng}`,arrow:!0,placement:"top",children:e.jsxs(a,{direction:"row",spacing:.5,alignItems:"center",sx:{cursor:"default"},children:[e.jsx(_,{sx:{fontSize:16,color:"grey.400"}}),e.jsx(s,{variant:"body2",sx:{fontWeight:500,color:"grey.800",borderBottom:"1px dotted",borderColor:"grey.300"},children:[t.neighbourhood,t.city].filter(Boolean).join(", ")||"Pinned location"})]})}),e.jsx(p,{component:"a",href:`https://www.google.com/maps?q=${t.surveyLat},${t.surveyLng}`,target:"_blank",rel:"noopener",size:"small",variant:"outlined",startIcon:e.jsx(Ne,{sx:{fontSize:16}}),sx:{py:.25,px:1.25,minWidth:0,fontSize:"0.75rem",fontWeight:600,borderRadius:5,color:"primary.main",borderColor:"primary.100",bgcolor:"primary.lighter","&:hover":{borderColor:"primary.main",bgcolor:"primary.lighter"}},children:"View on map"})]}):e.jsx(s,{variant:"body2",sx:{color:"grey.500"},children:"—"})})]})}),e.jsx(u,{item:!0,xs:12,children:e.jsx(E,{icon:pe,title:"Contact & Compliance",accent:"primary",children:e.jsxs(u,{container:!0,spacing:2.5,children:[e.jsx(u,{item:!0,xs:12,sm:6,md:4,children:e.jsx(A,{label:"Phone",value:t.phone})}),e.jsx(u,{item:!0,xs:12,sm:6,md:4,children:e.jsx(m,{label:"Data Consent",children:e.jsx(j,{label:t.dataConsent&&f(t.dataConsent),color:mt(t.dataConsent)})})}),e.jsx(u,{item:!0,xs:12,sm:6,md:4,children:e.jsx(A,{label:"Last Updated",value:t.lastUpdated})}),t.notes&&e.jsx(u,{item:!0,xs:12,children:e.jsxs(o,{sx:{p:2,borderRadius:1.5,bgcolor:"warning.lighter",border:1,borderColor:"warning.light"},children:[e.jsxs(a,{direction:"row",spacing:1,alignItems:"center",sx:{mb:.5},children:[e.jsx(je,{sx:{fontSize:16,color:"warning.dark"}}),e.jsx(s,{variant:"caption",sx:{color:"warning.dark",textTransform:"uppercase",letterSpacing:.4,fontSize:"0.68rem",fontWeight:700},children:"Notes"})]}),e.jsx(s,{variant:"body2",sx:{color:"grey.800"},children:t.notes})]})})]})})})]})})]})}function jt({row:t,onEdit:l,onDelete:i}){const[d,h]=c.useState(!1);return e.jsxs(o,{sx:{borderRadius:3,border:1,borderColor:d?"primary.light":"divider",bgcolor:"background.paper",overflow:"hidden"},children:[e.jsxs(o,{sx:{p:2},children:[e.jsxs(a,{direction:"row",spacing:1.25,alignItems:"center",children:[e.jsx(X,{name:t.name,size:42}),e.jsxs(o,{sx:{minWidth:0,flexGrow:1},children:[e.jsx(s,{variant:"body2",sx:{fontWeight:700,color:"grey.800"},noWrap:!0,children:t.name}),e.jsx(s,{variant:"caption",sx:{fontFamily:"monospace",fontWeight:700,color:"primary.main"},children:t.logicalId})]}),e.jsx(Y,{status:t.status})]}),e.jsxs(a,{spacing:1,sx:{mt:1.75},children:[e.jsxs(a,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(ge,{sx:{fontSize:16,color:"grey.400",flexShrink:0}}),e.jsx(s,{variant:"body2",children:t.phone||"—"})]}),e.jsxs(a,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(_,{sx:{fontSize:16,color:"grey.400",flexShrink:0}}),e.jsxs(s,{variant:"body2",noWrap:!0,children:[t.city||"—",t.businessState?`, ${t.businessState}`:""]})]})]}),e.jsxs(a,{direction:"row",spacing:1.5,alignItems:"center",divider:e.jsx(V,{orientation:"vertical",flexItem:!0}),sx:{mt:1.75},children:[e.jsx(F,{label:"Parcels",value:Number(t.parcelVolume).toLocaleString()}),e.jsx(F,{label:"Contracts",value:t.activeContracts,color:"primary.main"})]}),e.jsx(V,{sx:{my:1.5}}),e.jsxs(a,{direction:"row",spacing:1,justifyContent:"space-between",alignItems:"center",children:[e.jsx(p,{size:"small",onClick:()=>h(b=>!b),endIcon:d?e.jsx(xe,{}):e.jsx(he,{}),children:d?"Hide":"Details"}),e.jsxs(a,{direction:"row",spacing:1,children:[e.jsx(p,{size:"small",variant:"outlined",startIcon:e.jsx(J,{fontSize:"small"}),onClick:()=>l(t),children:"Edit"}),e.jsx(p,{size:"small",variant:"outlined",color:"error",startIcon:e.jsx(de,{fontSize:"small"}),onClick:()=>i(t),children:"Delete"})]})]})]}),e.jsx(ce,{in:d,timeout:"auto",unmountOnExit:!0,children:e.jsx(o,{sx:{borderTop:1,borderColor:"divider"},children:e.jsx(be,{row:t,onEdit:l})})})]})}function ft({row:t,index:l,onEdit:i,onDelete:d}){const[h,b]=c.useState(!1);return e.jsxs(c.Fragment,{children:[e.jsxs(U,{hover:!0,sx:{cursor:"pointer","& > *":{borderBottom:h?"unset":void 0},...h&&{bgcolor:"primary.lighter","&:hover":{bgcolor:"primary.lighter"}}},onClick:()=>b(g=>!g),children:[e.jsx(x,{padding:"checkbox",children:e.jsx(w,{size:"small",onClick:g=>{g.stopPropagation(),b(v=>!v)},children:h?e.jsx(xe,{}):e.jsx(he,{})})}),e.jsx(x,{sx:{whiteSpace:"nowrap"},children:e.jsx(s,{variant:"caption",sx:{fontFamily:"monospace",fontWeight:700,color:"primary.main",bgcolor:"primary.lighter",px:1,py:.5,borderRadius:1,border:"1px solid",borderColor:"primary.light",whiteSpace:"nowrap"},children:t.logicalId})}),e.jsx(x,{children:e.jsxs(a,{direction:"row",spacing:1.25,alignItems:"center",children:[e.jsx(X,{name:t.name,size:38}),e.jsxs(o,{sx:{minWidth:0},children:[e.jsx(s,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},children:t.name}),e.jsx(a,{direction:"row",spacing:.75,alignItems:"center",sx:{mt:.4},children:t.businessType&&e.jsx(Z,{size:"small",label:f(t.businessType),sx:{height:20,fontSize:"0.68rem",fontWeight:600,bgcolor:"grey.100",color:"grey.700"}})})]})]})}),e.jsx(x,{children:e.jsxs(a,{direction:"row",spacing:.75,alignItems:"center",children:[e.jsx(ge,{sx:{fontSize:15,color:"grey.400"}}),e.jsxs(o,{children:[e.jsx(s,{variant:"body2",children:t.phone||"—"}),t.frequency&&e.jsx(s,{variant:"caption",color:"text.secondary",children:t.frequency})]})]})}),e.jsx(x,{children:e.jsxs(a,{direction:"row",spacing:.75,alignItems:"center",children:[e.jsx(_,{sx:{fontSize:15,color:"grey.400"}}),e.jsxs(o,{children:[e.jsxs(s,{variant:"body2",children:[t.city||"—",t.businessState?`, ${t.businessState}`:""]}),t.neighbourhood&&e.jsx(s,{variant:"caption",color:"text.secondary",children:t.neighbourhood})]})]})}),e.jsx(x,{children:e.jsxs(a,{direction:"row",spacing:1.5,alignItems:"center",justifyContent:"center",divider:e.jsx(V,{orientation:"vertical",flexItem:!0}),children:[e.jsx(F,{label:"Parcels",value:Number(t.parcelVolume).toLocaleString()}),e.jsx(F,{label:"Contracts",value:t.activeContracts,color:"primary.main"})]})}),e.jsx(x,{children:e.jsx(Y,{status:t.status})}),e.jsxs(x,{align:"right",children:[e.jsx(G,{title:"Edit",children:e.jsx(w,{size:"small",onClick:g=>{g.stopPropagation(),i(t)},children:e.jsx(J,{fontSize:"small"})})}),e.jsx(G,{title:"Delete",children:e.jsx(w,{size:"small",onClick:g=>{g.stopPropagation(),d(t)},children:e.jsx(de,{fontSize:"small"})})})]})]}),e.jsx(U,{children:e.jsx(x,{colSpan:8,sx:{py:0,borderBottom:h?void 0:"none"},children:e.jsx(ce,{in:h,timeout:"auto",unmountOnExit:!0,children:e.jsx(be,{row:t,onEdit:i})})})})]})}function Ht(){var se;const t=ze(),l=Te(t.breakpoints.down("md")),[i,d]=c.useState([]),[h,b]=c.useState(!0),[g,v]=c.useState(null),[M]=$e(),[q,ye]=c.useState(0),[k,ie]=c.useState(M.get("q")||""),[D,C]=c.useState(0),[S,ve]=c.useState(10);c.useEffect(()=>{const r=M.get("q");r!=null&&(ie(r),C(0))},[M]);const[O,I]=c.useState({open:!1,mode:"add",initial:null}),[z,T]=c.useState(null),[W,ne]=c.useState(!1),y=(r=!1)=>{r||(b(!0),v(null)),ke().then(n=>d(n.map(De))).catch(n=>{r||v(n.message||"Failed to load clients")}).finally(()=>{r||b(!1)})};c.useEffect(()=>{y();const r=setInterval(()=>{y(!0)},1e4);return()=>clearInterval(r)},[]);const P=c.useMemo(()=>({total:i.length,newCount:i.filter(r=>r.status==="newClient").length,parcels:i.reduce((r,n)=>r+(Number(n.parcelVolume)||0),0),contracts:i.reduce((r,n)=>r+(Number(n.activeContracts)||0),0)}),[i]),R=c.useMemo(()=>{const r=[];return i.forEach(n=>{r.includes(n.status)||r.push(n.status)}),[{key:"all",label:"All"},...r.map(n=>({key:n,label:f(n)}))]},[i]),H=((se=R[Math.min(q,R.length-1)])==null?void 0:se.key)||"all",Ce=c.useMemo(()=>{const r={all:i.length};return i.forEach(n=>{r[n.status]=(r[n.status]||0)+1}),r},[i]),L=c.useMemo(()=>i.filter(r=>{const n=H==="all"||r.status===H,$=!k||[r.name,r.phone,r.city,r.businessType,r.clientId,r.neighbourhood].join(" ").toLowerCase().includes(k.toLowerCase());return n&&$}),[i,H,k]),N=L.slice(D*S,D*S+S),Se=()=>{I({open:!1,mode:"add",initial:null}),y()},Ie=async()=>{ne(!0);try{await We(z.id),T(null),y()}catch(r){v(r.message||"Failed to delete client")}finally{ne(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(Ge,{title:"Clients",breadcrumbs:[{label:"Clients"}],action:e.jsxs(a,{direction:"row",spacing:1.5,sx:{width:{xs:"100%",sm:"auto"}},children:[e.jsx(p,{variant:"outlined",startIcon:e.jsx(Ee,{}),onClick:y,disabled:h,sx:{flex:{xs:1,sm:"none"}},children:"Refresh"}),e.jsx(p,{variant:"contained",startIcon:e.jsx(Pe,{}),onClick:()=>I({open:!0,mode:"add",initial:null}),sx:{flex:{xs:1,sm:"none"}},children:"Add Client"})]})}),e.jsxs(u,{container:!0,spacing:2.5,sx:{mb:3},children:[e.jsx(u,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(B,{accent:!0,title:"Total Clients",value:P.total,icon:ae,caption:"All registered"})}),e.jsx(u,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(B,{accent:!0,title:"New Clients",value:P.newCount,icon:qe,color:"primary",caption:"Awaiting onboarding"})}),e.jsx(u,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(B,{accent:!0,title:"Total Parcel Volume",value:P.parcels.toLocaleString(),icon:ue,color:"primary",caption:"Across all clients"})}),e.jsx(u,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(B,{accent:!0,title:"Active Contracts",value:P.contracts,icon:me,color:"primary",caption:"Currently running"})})]}),e.jsxs(Xe,{sx:{overflow:"hidden"},children:[e.jsxs(o,{sx:{px:2.5,py:2,borderBottom:1,borderColor:"divider",display:"flex",alignItems:"center",gap:1.5,background:r=>`linear-gradient(90deg, ${r.palette.primary.lighter}66 0%, ${r.palette.background.paper} 70%)`},children:[e.jsx(o,{sx:{width:40,height:40,borderRadius:2,bgcolor:"primary.lighter",color:"primary.main",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx(ae,{fontSize:"small"})}),e.jsxs(o,{children:[e.jsx(s,{variant:"subtitle1",sx:{fontWeight:700,color:"grey.800",lineHeight:1.2},children:"Client Directory"}),e.jsx(s,{variant:"caption",color:"text.secondary",children:"Browse, search and manage every client account"})]})]}),e.jsxs(a,{direction:{xs:"column",md:"row"},spacing:1.5,sx:{p:2},alignItems:{md:"center"},children:[e.jsx(Je,{size:"small",placeholder:"Search by name, phone, city, ID…",value:k,onChange:r=>{ie(r.target.value),C(0)},sx:{width:{xs:"100%",md:300}},InputProps:{startAdornment:e.jsx(Ye,{position:"start",children:e.jsx(_e,{fontSize:"small"})})}}),e.jsx(o,{sx:{flexGrow:1}}),!h&&e.jsxs(a,{direction:"row",spacing:1,alignItems:"center",children:[e.jsxs(s,{variant:"body2",color:"text.secondary",children:[L.length," ",L.length===1?"client":"clients"]}),e.jsx(Z,{size:"small",label:"live · doormile_clients",sx:{height:22,fontSize:"0.7rem",bgcolor:"success.lighter",color:"success.dark",fontWeight:600}})]})]}),e.jsx(o,{sx:{px:2,borderBottom:1,borderColor:"divider"},children:e.jsx(Ze,{value:Math.min(q,R.length-1),onChange:(r,n)=>{ye(n),C(0)},variant:"scrollable",scrollButtons:"auto",children:R.map((r,n)=>e.jsx(et,{label:e.jsx(we,{label:r.label,count:Ce[r.key]||0,active:q===n})},r.key))})}),g&&e.jsx(Ue,{severity:"error",sx:{m:2},action:e.jsx(p,{color:"inherit",size:"small",onClick:y,children:"Retry"}),children:g}),h?e.jsx(o,{sx:{display:"flex",justifyContent:"center",py:6},children:e.jsx(le,{})}):N.length===0?e.jsx(Ke,{title:"No clients found",caption:"Try a different tab or search term, or add a client."}):l?e.jsx(a,{spacing:1.5,sx:{p:2},children:N.map(r=>e.jsx(jt,{row:r,onEdit:n=>I({open:!0,mode:"edit",initial:n}),onDelete:n=>T(n)},r.id))}):e.jsx(tt,{children:e.jsxs(rt,{sx:{minWidth:900},children:[e.jsx(it,{children:e.jsxs(U,{sx:{"& th":{bgcolor:"grey.50",fontWeight:700,color:"grey.700",textTransform:"uppercase",fontSize:"0.72rem",letterSpacing:.4}},children:[e.jsx(x,{padding:"checkbox"}),e.jsx(x,{children:"ID"}),e.jsx(x,{children:"Client"}),e.jsx(x,{children:"Contact"}),e.jsx(x,{children:"Location"}),e.jsx(x,{align:"center",children:"Volume"}),e.jsx(x,{children:"Status"}),e.jsx(x,{align:"right",children:"Actions"})]})}),e.jsx(nt,{children:N.map((r,n)=>e.jsx(ft,{row:r,index:D*S+n,onEdit:$=>I({open:!0,mode:"edit",initial:$}),onDelete:$=>T($)},r.id))})]})}),e.jsx(Fe,{component:"div",count:L.length,page:D,onPageChange:(r,n)=>C(n),rowsPerPage:S,onRowsPerPageChange:r=>{ve(+r.target.value),C(0)},rowsPerPageOptions:[5,10,25]})]}),e.jsx(Qe,{open:O.open,mode:O.mode,initial:O.initial,onClose:()=>I({open:!1,mode:"add",initial:null}),onSaved:Se}),e.jsxs(Re,{open:!!z,onClose:W?void 0:()=>T(null),children:[e.jsx(Le,{children:"Delete client?"}),e.jsx(Be,{children:e.jsxs(Oe,{children:["This will permanently remove ",e.jsx("strong",{children:z==null?void 0:z.name})," from the doormile_clients collection. This cannot be undone."]})}),e.jsxs(Ae,{sx:{px:3,py:2},children:[e.jsx(p,{onClick:()=>T(null),disabled:W,children:"Cancel"}),e.jsx(p,{color:"error",variant:"contained",onClick:Ie,disabled:W,startIcon:W?e.jsx(le,{size:16,color:"inherit"}):null,children:"Delete"})]})]})]})}export{Ht as default}; diff --git a/dist/assets/Tenants-pp9mqXyF.js b/dist/assets/Tenants-pp9mqXyF.js new file mode 100644 index 0000000..19587aa --- /dev/null +++ b/dist/assets/Tenants-pp9mqXyF.js @@ -0,0 +1 @@ +import{r as K,j as e,i as Q,u as ze,a as Te,b as c,k as $e,t as f,S as a,d as ae,B as o,T as s,l as _e,C as le,f as ke,g as De,m as We,U as X,D as V,n as ce,I as w,o as G}from"./index-D7LVXeIK.js";import{d as Pe,D as Re,a as Le,b as Be,c as Ae}from"./Close-D3HB9j5y.js";import{d as Ee}from"./Refresh-DA6RLQV4.js";import{d as J}from"./EditOutlined-DS7hq7Cq.js";import{T as Fe,d as de}from"./DeleteOutline-Dhk3Cr2d.js";import{d as _,a as xe,b as he,c as Me}from"./StorefrontOutlined-Be07_1-Y.js";import{d as qe,a as ue,b as me,S as Y}from"./StatusChip-B_YdJiMW.js";import{D as Oe,d as ge}from"./PhoneOutlined-Uvrb40S4.js";import{d as He}from"./LocalShippingOutlined-C1uYlQnS.js";import{d as Ne}from"./MapOutlined-CMNX914Q.js";import{T as we,d as Ve}from"./TabLabelCount-1dep75sI.js";import{P as Ge,G as u,C as Z,A as Ue}from"./PageHeader-naLAT9xr.js";import{S as B,E as Ke}from"./EmptyState-B9FcYx_n.js";import{C as Qe}from"./ClientFormDialog-Clwkcvac.js";import{B as p}from"./Button-Bqp5awT1.js";import{C as Xe}from"./Link-BEif5YS2.js";import{T as Je}from"./TextField-Sd_pshci.js";import{I as Ye}from"./InputAdornment-CMIlL2rx.js";import{T as Ze,a as et}from"./Tabs-BUgAhQiL.js";import{T as tt,a as rt,b as it,c as U,d as nt}from"./TableRow-jBgitpDf.js";import{T as x}from"./TableCell-DreGbAeW.js";import"./Snackbar-DOheZfWW.js";var ee={},st=Q;Object.defineProperty(ee,"__esModule",{value:!0});var pe=ee.default=void 0,at=st(K()),lt=e;pe=ee.default=(0,at.default)((0,lt.jsx)("path",{d:"M11 7h2v2h-2zm0 4h2v6h-2zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"InfoOutlined");var te={},ot=Q;Object.defineProperty(te,"__esModule",{value:!0});var je=te.default=void 0,ct=ot(K()),dt=e;je=te.default=(0,ct.default)((0,dt.jsx)("path",{d:"M21 11.01 3 11v2h18zM3 16h12v2H3zM21 6H3v2.01L21 8z"}),"NotesOutlined");var re={},xt=Q;Object.defineProperty(re,"__esModule",{value:!0});var fe=re.default=void 0,ht=xt(K()),ut=e;fe=re.default=(0,ht.default)((0,ut.jsx)("path",{d:"M16.01 11H4v2h12.01v3L20 12l-3.99-4z"}),"ArrowRightAlt");const mt=t=>({full:"success",basiconly:"info",none:"default"})[String(t||"").toLowerCase()]||"default",gt=t=>{const l=String(t||"").toLowerCase();return/high|good|excellent/.test(l)?"success":/med|average|moderate/.test(l)?"warning":/low|poor|bad/.test(l)?"error":"info"},pt={textTransform:"uppercase",letterSpacing:.4,fontSize:"0.68rem",fontWeight:700,color:"grey.700"};function j({label:t,color:l="default"}){return t==null||t===""?e.jsx(s,{variant:"body2",sx:{fontWeight:500,color:"grey.500"},children:"—"}):e.jsx(Z,{size:"small",label:t,sx:{fontWeight:600,...l==="default"?{bgcolor:"grey.100",color:"grey.700"}:{bgcolor:`${l}.lighter`,color:`${l}.dark`}}})}function m({label:t,children:l}){return e.jsxs(o,{children:[e.jsx(s,{variant:"caption",color:"text.secondary",sx:pt,children:t}),e.jsx(o,{sx:{mt:.5},children:l})]})}function A({label:t,value:l}){return e.jsx(m,{label:t,children:e.jsx(s,{variant:"body2",sx:{fontWeight:500,color:l?"grey.800":"grey.500",wordBreak:"break-word"},children:l||"—"})})}function E({icon:t,title:l,accent:i="primary",children:d}){return e.jsxs(o,{sx:{height:"100%",borderRadius:2,border:1,borderColor:"divider",bgcolor:"background.paper",overflow:"hidden"},children:[e.jsxs(a,{direction:"row",spacing:1,alignItems:"center",sx:{px:2,py:1.25,borderBottom:1,borderColor:"divider",bgcolor:`${i}.lighter`,opacity:.999},children:[e.jsx(t,{sx:{fontSize:18,color:`${i}.main`}}),e.jsx(s,{variant:"overline",sx:{fontWeight:700,color:"grey.800",letterSpacing:.6,lineHeight:1},children:l})]}),e.jsx(a,{spacing:1.75,sx:{p:2},children:d})]})}function oe({label:t,value:l,icon:i,color:d="primary"}){return e.jsx(o,{sx:{flex:1,p:1.5,borderRadius:1.5,border:1,borderColor:"divider",bgcolor:"grey.50"},children:e.jsxs(a,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(o,{sx:{width:32,height:32,borderRadius:1,bgcolor:`${d}.lighter`,color:`${d}.main`,display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx(i,{sx:{fontSize:18}})}),e.jsxs(o,{children:[e.jsx(s,{variant:"h5",sx:{fontWeight:700,color:"grey.800",lineHeight:1.1},children:l}),e.jsx(s,{variant:"caption",color:"text.secondary",children:t})]})]})})}function F({label:t,value:l,color:i="grey.800"}){return e.jsxs(o,{sx:{textAlign:"center",minWidth:56},children:[e.jsx(s,{variant:"body2",sx:{fontWeight:700,color:i,lineHeight:1.2},children:l}),e.jsx(s,{variant:"caption",color:"text.secondary",sx:{fontSize:"0.65rem"},children:t})]})}function be({row:t,onEdit:l}){return e.jsxs(o,{sx:{m:2,borderRadius:2.5,border:1,borderColor:"divider",overflow:"hidden",boxShadow:"0 4px 16px rgba(0,0,0,0.06)"},children:[e.jsxs(a,{direction:{xs:"column",sm:"row"},justifyContent:"space-between",alignItems:{xs:"flex-start",sm:"center"},spacing:1.5,sx:{px:{xs:2,sm:2.5},py:2,borderBottom:1,borderColor:"divider",background:i=>`linear-gradient(90deg, ${i.palette.primary.lighter}88 0%, ${i.palette.background.paper} 75%)`},children:[e.jsxs(a,{direction:"row",spacing:1.5,alignItems:"center",children:[e.jsx(X,{name:t.name,size:40}),e.jsxs(o,{children:[e.jsx(s,{variant:"subtitle1",sx:{fontWeight:700,lineHeight:1.2},children:t.name}),e.jsxs(a,{direction:"row",spacing:.75,alignItems:"center",sx:{mt:.25},children:[e.jsx(Ve,{sx:{fontSize:14,color:"grey.400"}}),e.jsx(s,{variant:"caption",color:"text.secondary",children:t.clientId})]})]}),e.jsx(Y,{status:t.status,sx:{ml:.5}})]}),e.jsx(p,{size:"small",variant:"contained",startIcon:e.jsx(J,{}),onClick:()=>l(t),sx:{width:{xs:"100%",sm:"auto"}},children:"Edit Client"})]}),e.jsx(o,{sx:{p:{xs:1.5,sm:2.5},bgcolor:"grey.50"},children:e.jsxs(u,{container:!0,spacing:2.5,alignItems:"stretch",children:[e.jsx(u,{item:!0,xs:12,md:4,children:e.jsxs(E,{icon:Me,title:"Business",accent:"primary",children:[e.jsxs(a,{direction:"row",spacing:1.5,children:[e.jsx(oe,{label:"Parcel Volume",value:Number(t.parcelVolume).toLocaleString(),icon:ue,color:"primary"}),e.jsx(oe,{label:"Active Contracts",value:t.activeContracts,icon:me,color:"primary"})]}),e.jsx(m,{label:"Client ID",children:e.jsx(s,{variant:"body2",sx:{fontFamily:"monospace",fontWeight:600,color:"grey.800"},children:t.clientId})}),e.jsx(m,{label:"Business Type",children:e.jsx(j,{label:t.businessType&&f(t.businessType),color:"primary"})}),e.jsx(m,{label:"Order Frequency",children:e.jsx(j,{label:t.frequency&&f(t.frequency),color:"info"})})]})}),e.jsx(u,{item:!0,xs:12,md:4,children:e.jsxs(E,{icon:He,title:"Logistics",accent:"primary",children:[e.jsx(m,{label:"Logistics Segment",children:t.logisticsSegment?e.jsx(a,{direction:"row",spacing:.75,flexWrap:"wrap",useFlexGap:!0,children:String(t.logisticsSegment).split(/[,/]/).map(i=>i.trim()).filter(Boolean).map(i=>e.jsx(j,{label:f(i),color:"primary"},i))}):e.jsx(j,{label:null})}),e.jsx(A,{label:"Current Provider",value:t.provider}),e.jsx(m,{label:"Efficiency",children:e.jsx(j,{label:t.efficiency&&f(t.efficiency),color:gt(t.efficiency)})}),e.jsx(m,{label:"Transit Route",children:(()=>{const i=[t.transitFrom,...String(t.transitTo||"").split(",")].map(d=>d.trim()).filter(Boolean);return i.length?e.jsx(a,{direction:"row",spacing:.75,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:i.map((d,h)=>e.jsxs(c.Fragment,{children:[h>0&&e.jsx(fe,{sx:{fontSize:20,color:"primary.main"}}),e.jsx(j,{label:f(d),color:h===0?"default":"info"})]},`${d}-${h}`))}):e.jsx(j,{label:null})})()})]})}),e.jsx(u,{item:!0,xs:12,md:4,children:e.jsxs(E,{icon:_,title:"Location & Survey",accent:"primary",children:[e.jsx(m,{label:"City / State",children:e.jsx(s,{variant:"body2",sx:{fontWeight:500,color:"grey.800"},children:[t.city,t.businessState].filter(Boolean).join(", ")||"—"})}),e.jsx(A,{label:"Neighbourhood",value:t.neighbourhood}),e.jsx(m,{label:"Survey Address",children:e.jsxs(a,{direction:"row",spacing:1,sx:{p:1.25,borderRadius:1.5,bgcolor:"grey.50",border:1,borderColor:"divider"},children:[e.jsx(_,{sx:{fontSize:16,color:"grey.400",mt:"2px"}}),e.jsx(s,{variant:"body2",sx:{color:"grey.800",lineHeight:1.5},children:t.surveyAddress||"—"})]})}),e.jsx(m,{label:"Coordinates",children:t.surveyLat&&t.surveyLng?e.jsxs(a,{direction:"row",spacing:1.25,alignItems:"center",flexWrap:"wrap",useFlexGap:!0,children:[e.jsx(G,{title:`${t.surveyLat}, ${t.surveyLng}`,arrow:!0,placement:"top",children:e.jsxs(a,{direction:"row",spacing:.5,alignItems:"center",sx:{cursor:"default"},children:[e.jsx(_,{sx:{fontSize:16,color:"grey.400"}}),e.jsx(s,{variant:"body2",sx:{fontWeight:500,color:"grey.800",borderBottom:"1px dotted",borderColor:"grey.300"},children:[t.neighbourhood,t.city].filter(Boolean).join(", ")||"Pinned location"})]})}),e.jsx(p,{component:"a",href:`https://www.google.com/maps?q=${t.surveyLat},${t.surveyLng}`,target:"_blank",rel:"noopener",size:"small",variant:"outlined",startIcon:e.jsx(Ne,{sx:{fontSize:16}}),sx:{py:.25,px:1.25,minWidth:0,fontSize:"0.75rem",fontWeight:600,borderRadius:5,color:"primary.main",borderColor:"primary.100",bgcolor:"primary.lighter","&:hover":{borderColor:"primary.main",bgcolor:"primary.lighter"}},children:"View on map"})]}):e.jsx(s,{variant:"body2",sx:{color:"grey.500"},children:"—"})})]})}),e.jsx(u,{item:!0,xs:12,children:e.jsx(E,{icon:pe,title:"Contact & Compliance",accent:"primary",children:e.jsxs(u,{container:!0,spacing:2.5,children:[e.jsx(u,{item:!0,xs:12,sm:6,md:4,children:e.jsx(A,{label:"Phone",value:t.phone})}),e.jsx(u,{item:!0,xs:12,sm:6,md:4,children:e.jsx(m,{label:"Data Consent",children:e.jsx(j,{label:t.dataConsent&&f(t.dataConsent),color:mt(t.dataConsent)})})}),e.jsx(u,{item:!0,xs:12,sm:6,md:4,children:e.jsx(A,{label:"Last Updated",value:t.lastUpdated})}),t.notes&&e.jsx(u,{item:!0,xs:12,children:e.jsxs(o,{sx:{p:2,borderRadius:1.5,bgcolor:"warning.lighter",border:1,borderColor:"warning.light"},children:[e.jsxs(a,{direction:"row",spacing:1,alignItems:"center",sx:{mb:.5},children:[e.jsx(je,{sx:{fontSize:16,color:"warning.dark"}}),e.jsx(s,{variant:"caption",sx:{color:"warning.dark",textTransform:"uppercase",letterSpacing:.4,fontSize:"0.68rem",fontWeight:700},children:"Notes"})]}),e.jsx(s,{variant:"body2",sx:{color:"grey.800"},children:t.notes})]})})]})})})]})})]})}function jt({row:t,onEdit:l,onDelete:i}){const[d,h]=c.useState(!1);return e.jsxs(o,{sx:{borderRadius:3,border:1,borderColor:d?"primary.light":"divider",bgcolor:"background.paper",overflow:"hidden"},children:[e.jsxs(o,{sx:{p:2},children:[e.jsxs(a,{direction:"row",spacing:1.25,alignItems:"center",children:[e.jsx(X,{name:t.name,size:42}),e.jsxs(o,{sx:{minWidth:0,flexGrow:1},children:[e.jsx(s,{variant:"body2",sx:{fontWeight:700,color:"grey.800"},noWrap:!0,children:t.name}),e.jsx(s,{variant:"caption",sx:{fontFamily:"monospace",fontWeight:700,color:"primary.main"},children:t.logicalId})]}),e.jsx(Y,{status:t.status})]}),e.jsxs(a,{spacing:1,sx:{mt:1.75},children:[e.jsxs(a,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(ge,{sx:{fontSize:16,color:"grey.400",flexShrink:0}}),e.jsx(s,{variant:"body2",children:t.phone||"—"})]}),e.jsxs(a,{direction:"row",spacing:1,alignItems:"center",children:[e.jsx(_,{sx:{fontSize:16,color:"grey.400",flexShrink:0}}),e.jsxs(s,{variant:"body2",noWrap:!0,children:[t.city||"—",t.businessState?`, ${t.businessState}`:""]})]})]}),e.jsxs(a,{direction:"row",spacing:1.5,alignItems:"center",divider:e.jsx(V,{orientation:"vertical",flexItem:!0}),sx:{mt:1.75},children:[e.jsx(F,{label:"Parcels",value:Number(t.parcelVolume).toLocaleString()}),e.jsx(F,{label:"Contracts",value:t.activeContracts,color:"primary.main"})]}),e.jsx(V,{sx:{my:1.5}}),e.jsxs(a,{direction:"row",spacing:1,justifyContent:"space-between",alignItems:"center",children:[e.jsx(p,{size:"small",onClick:()=>h(b=>!b),endIcon:d?e.jsx(xe,{}):e.jsx(he,{}),children:d?"Hide":"Details"}),e.jsxs(a,{direction:"row",spacing:1,children:[e.jsx(p,{size:"small",variant:"outlined",startIcon:e.jsx(J,{fontSize:"small"}),onClick:()=>l(t),children:"Edit"}),e.jsx(p,{size:"small",variant:"outlined",color:"error",startIcon:e.jsx(de,{fontSize:"small"}),onClick:()=>i(t),children:"Delete"})]})]})]}),e.jsx(ce,{in:d,timeout:"auto",unmountOnExit:!0,children:e.jsx(o,{sx:{borderTop:1,borderColor:"divider"},children:e.jsx(be,{row:t,onEdit:l})})})]})}function ft({row:t,index:l,onEdit:i,onDelete:d}){const[h,b]=c.useState(!1);return e.jsxs(c.Fragment,{children:[e.jsxs(U,{hover:!0,sx:{cursor:"pointer","& > *":{borderBottom:h?"unset":void 0},...h&&{bgcolor:"primary.lighter","&:hover":{bgcolor:"primary.lighter"}}},onClick:()=>b(g=>!g),children:[e.jsx(x,{padding:"checkbox",children:e.jsx(w,{size:"small",onClick:g=>{g.stopPropagation(),b(v=>!v)},children:h?e.jsx(xe,{}):e.jsx(he,{})})}),e.jsx(x,{sx:{whiteSpace:"nowrap"},children:e.jsx(s,{variant:"caption",sx:{fontFamily:"monospace",fontWeight:700,color:"primary.main",bgcolor:"primary.lighter",px:1,py:.5,borderRadius:1,border:"1px solid",borderColor:"primary.light",whiteSpace:"nowrap"},children:t.logicalId})}),e.jsx(x,{children:e.jsxs(a,{direction:"row",spacing:1.25,alignItems:"center",children:[e.jsx(X,{name:t.name,size:38}),e.jsxs(o,{sx:{minWidth:0},children:[e.jsx(s,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},children:t.name}),e.jsx(a,{direction:"row",spacing:.75,alignItems:"center",sx:{mt:.4},children:t.businessType&&e.jsx(Z,{size:"small",label:f(t.businessType),sx:{height:20,fontSize:"0.68rem",fontWeight:600,bgcolor:"grey.100",color:"grey.700"}})})]})]})}),e.jsx(x,{children:e.jsxs(a,{direction:"row",spacing:.75,alignItems:"center",children:[e.jsx(ge,{sx:{fontSize:15,color:"grey.400"}}),e.jsxs(o,{children:[e.jsx(s,{variant:"body2",children:t.phone||"—"}),t.frequency&&e.jsx(s,{variant:"caption",color:"text.secondary",children:t.frequency})]})]})}),e.jsx(x,{children:e.jsxs(a,{direction:"row",spacing:.75,alignItems:"center",children:[e.jsx(_,{sx:{fontSize:15,color:"grey.400"}}),e.jsxs(o,{children:[e.jsxs(s,{variant:"body2",children:[t.city||"—",t.businessState?`, ${t.businessState}`:""]}),t.neighbourhood&&e.jsx(s,{variant:"caption",color:"text.secondary",children:t.neighbourhood})]})]})}),e.jsx(x,{children:e.jsxs(a,{direction:"row",spacing:1.5,alignItems:"center",justifyContent:"center",divider:e.jsx(V,{orientation:"vertical",flexItem:!0}),children:[e.jsx(F,{label:"Parcels",value:Number(t.parcelVolume).toLocaleString()}),e.jsx(F,{label:"Contracts",value:t.activeContracts,color:"primary.main"})]})}),e.jsx(x,{children:e.jsx(Y,{status:t.status})}),e.jsxs(x,{align:"right",children:[e.jsx(G,{title:"Edit",children:e.jsx(w,{size:"small",onClick:g=>{g.stopPropagation(),i(t)},children:e.jsx(J,{fontSize:"small"})})}),e.jsx(G,{title:"Delete",children:e.jsx(w,{size:"small",onClick:g=>{g.stopPropagation(),d(t)},children:e.jsx(de,{fontSize:"small"})})})]})]}),e.jsx(U,{children:e.jsx(x,{colSpan:8,sx:{py:0,borderBottom:h?void 0:"none"},children:e.jsx(ce,{in:h,timeout:"auto",unmountOnExit:!0,children:e.jsx(be,{row:t,onEdit:i})})})})]})}function Ot(){var se;const t=ze(),l=Te(t.breakpoints.down("md")),[i,d]=c.useState([]),[h,b]=c.useState(!0),[g,v]=c.useState(null),[M]=$e(),[q,ye]=c.useState(0),[k,ie]=c.useState(M.get("q")||""),[D,C]=c.useState(0),[S,ve]=c.useState(10);c.useEffect(()=>{const r=M.get("q");r!=null&&(ie(r),C(0))},[M]);const[O,I]=c.useState({open:!1,mode:"add",initial:null}),[z,T]=c.useState(null),[W,ne]=c.useState(!1),y=(r=!1)=>{r||(b(!0),v(null)),ke().then(n=>d(n.map(De))).catch(n=>{r||v(n.message||"Failed to load clients")}).finally(()=>{r||b(!1)})};c.useEffect(()=>{y();const r=setInterval(()=>{y(!0)},1e4);return()=>clearInterval(r)},[]);const P=c.useMemo(()=>({total:i.length,newCount:i.filter(r=>r.status==="newClient").length,parcels:i.reduce((r,n)=>r+(Number(n.parcelVolume)||0),0),contracts:i.reduce((r,n)=>r+(Number(n.activeContracts)||0),0)}),[i]),R=c.useMemo(()=>{const r=[];return i.forEach(n=>{r.includes(n.status)||r.push(n.status)}),[{key:"all",label:"All"},...r.map(n=>({key:n,label:f(n)}))]},[i]),H=((se=R[Math.min(q,R.length-1)])==null?void 0:se.key)||"all",Ce=c.useMemo(()=>{const r={all:i.length};return i.forEach(n=>{r[n.status]=(r[n.status]||0)+1}),r},[i]),L=c.useMemo(()=>i.filter(r=>{const n=H==="all"||r.status===H,$=!k||[r.name,r.phone,r.city,r.businessType,r.clientId,r.neighbourhood].join(" ").toLowerCase().includes(k.toLowerCase());return n&&$}),[i,H,k]),N=L.slice(D*S,D*S+S),Se=()=>{I({open:!1,mode:"add",initial:null}),y()},Ie=async()=>{ne(!0);try{await We(z.id),T(null),y()}catch(r){v(r.message||"Failed to delete client")}finally{ne(!1)}};return e.jsxs(e.Fragment,{children:[e.jsx(Ge,{title:"Clients",breadcrumbs:[{label:"Clients"}],action:e.jsxs(a,{direction:"row",spacing:1.5,sx:{width:{xs:"100%",sm:"auto"}},children:[e.jsx(p,{variant:"outlined",startIcon:e.jsx(Ee,{}),onClick:y,disabled:h,sx:{flex:{xs:1,sm:"none"}},children:"Refresh"}),e.jsx(p,{variant:"contained",startIcon:e.jsx(Pe,{}),onClick:()=>I({open:!0,mode:"add",initial:null}),sx:{flex:{xs:1,sm:"none"}},children:"Add Client"})]})}),e.jsxs(u,{container:!0,spacing:2.5,sx:{mb:3},children:[e.jsx(u,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(B,{accent:!0,title:"Total Clients",value:P.total,icon:ae,caption:"All registered"})}),e.jsx(u,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(B,{accent:!0,title:"New Clients",value:P.newCount,icon:qe,color:"primary",caption:"Awaiting onboarding"})}),e.jsx(u,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(B,{accent:!0,title:"Total Parcel Volume",value:P.parcels.toLocaleString(),icon:ue,color:"primary",caption:"Across all clients"})}),e.jsx(u,{item:!0,xs:12,sm:6,lg:3,children:e.jsx(B,{accent:!0,title:"Active Contracts",value:P.contracts,icon:me,color:"primary",caption:"Currently running"})})]}),e.jsxs(Xe,{sx:{overflow:"hidden"},children:[e.jsxs(o,{sx:{px:{xs:2,sm:2.5},py:2,borderBottom:1,borderColor:"divider",display:"flex",alignItems:"center",gap:1.5,background:r=>`linear-gradient(90deg, ${r.palette.primary.lighter}66 0%, ${r.palette.background.paper} 70%)`},children:[e.jsx(o,{sx:{width:40,height:40,borderRadius:2,bgcolor:"primary.lighter",color:"primary.main",display:"inline-flex",alignItems:"center",justifyContent:"center"},children:e.jsx(ae,{fontSize:"small"})}),e.jsxs(o,{children:[e.jsx(s,{variant:"subtitle1",sx:{fontWeight:700,color:"grey.800",lineHeight:1.2},children:"Client Directory"}),e.jsx(s,{variant:"caption",color:"text.secondary",children:"Browse, search and manage every client account"})]})]}),e.jsxs(a,{direction:{xs:"column",md:"row"},spacing:1.5,sx:{p:2},alignItems:{md:"center"},children:[e.jsx(Je,{size:"small",placeholder:"Search by name, phone, city, ID…",value:k,onChange:r=>{ie(r.target.value),C(0)},sx:{width:{xs:"100%",md:300}},InputProps:{startAdornment:e.jsx(Ye,{position:"start",children:e.jsx(_e,{fontSize:"small"})})}}),e.jsx(o,{sx:{flexGrow:1}}),!h&&e.jsxs(a,{direction:"row",spacing:1,alignItems:"center",children:[e.jsxs(s,{variant:"body2",color:"text.secondary",children:[L.length," ",L.length===1?"client":"clients"]}),e.jsx(Z,{size:"small",label:"live · doormile_clients",sx:{height:22,fontSize:"0.7rem",bgcolor:"success.lighter",color:"success.dark",fontWeight:600}})]})]}),e.jsx(o,{sx:{px:2,borderBottom:1,borderColor:"divider"},children:e.jsx(Ze,{value:Math.min(q,R.length-1),onChange:(r,n)=>{ye(n),C(0)},variant:"scrollable",scrollButtons:"auto",children:R.map((r,n)=>e.jsx(et,{label:e.jsx(we,{label:r.label,count:Ce[r.key]||0,active:q===n})},r.key))})}),g&&e.jsx(Ue,{severity:"error",sx:{m:2},action:e.jsx(p,{color:"inherit",size:"small",onClick:y,children:"Retry"}),children:g}),h?e.jsx(o,{sx:{display:"flex",justifyContent:"center",py:6},children:e.jsx(le,{})}):N.length===0?e.jsx(Ke,{title:"No clients found",caption:"Try a different tab or search term, or add a client."}):l?e.jsx(a,{spacing:1.5,sx:{p:2},children:N.map(r=>e.jsx(jt,{row:r,onEdit:n=>I({open:!0,mode:"edit",initial:n}),onDelete:n=>T(n)},r.id))}):e.jsx(tt,{children:e.jsxs(rt,{sx:{minWidth:900},children:[e.jsx(it,{children:e.jsxs(U,{sx:{"& th":{bgcolor:"grey.50",fontWeight:700,color:"grey.700",textTransform:"uppercase",fontSize:"0.72rem",letterSpacing:.4}},children:[e.jsx(x,{padding:"checkbox"}),e.jsx(x,{children:"ID"}),e.jsx(x,{children:"Client"}),e.jsx(x,{children:"Contact"}),e.jsx(x,{children:"Location"}),e.jsx(x,{align:"center",children:"Volume"}),e.jsx(x,{children:"Status"}),e.jsx(x,{align:"right",children:"Actions"})]})}),e.jsx(nt,{children:N.map((r,n)=>e.jsx(ft,{row:r,index:D*S+n,onEdit:$=>I({open:!0,mode:"edit",initial:$}),onDelete:$=>T($)},r.id))})]})}),e.jsx(Fe,{component:"div",count:L.length,page:D,onPageChange:(r,n)=>C(n),rowsPerPage:S,onRowsPerPageChange:r=>{ve(+r.target.value),C(0)},rowsPerPageOptions:[5,10,25]})]}),e.jsx(Qe,{open:O.open,mode:O.mode,initial:O.initial,onClose:()=>I({open:!1,mode:"add",initial:null}),onSaved:Se}),e.jsxs(Re,{open:!!z,onClose:W?void 0:()=>T(null),children:[e.jsx(Le,{children:"Delete client?"}),e.jsx(Be,{children:e.jsxs(Oe,{children:["This will permanently remove ",e.jsx("strong",{children:z==null?void 0:z.name})," from the doormile_clients collection. This cannot be undone."]})}),e.jsxs(Ae,{sx:{px:3,py:2},children:[e.jsx(p,{onClick:()=>T(null),disabled:W,children:"Cancel"}),e.jsx(p,{color:"error",variant:"contained",onClick:Ie,disabled:W,startIcon:W?e.jsx(le,{size:16,color:"inherit"}):null,children:"Delete"})]})]})]})}export{Ot as default}; diff --git a/dist/assets/TextField-C0dUZvW0.js b/dist/assets/TextField-Sd_pshci.js similarity index 99% rename from dist/assets/TextField-C0dUZvW0.js rename to dist/assets/TextField-Sd_pshci.js index eac9627..cd05e2d 100644 --- a/dist/assets/TextField-C0dUZvW0.js +++ b/dist/assets/TextField-Sd_pshci.js @@ -1 +1 @@ -import{_ as r,N as Se,y as A,x as U,a5 as co,j as m,b as f,z as K,E as T,ay as ke,a6 as Pe,H as _,J as C,az as Me,aA as Oe,Y,aB as Ne,aC as Le,aD as Fe,aE as po,aF as $e,av as fo,F as Q,G as q,at as de,au as ue,s as De,L as Je,a4 as mo,aG as bo,q as Ye,aH as vo,aI as go,aJ as xo}from"./index-DpAn5wLF.js";function ho(e){return U("MuiInput",e)}const le=r({},Se,A("MuiInput",["root","underline","input"]));function Co(e){return U("MuiOutlinedInput",e)}const J=r({},Se,A("MuiOutlinedInput",["root","notchedOutline","input"]));function Io(e){return U("MuiFilledInput",e)}const ee=r({},Se,A("MuiFilledInput",["root","underline","input"])),Ro=co(m.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),yo=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],Fo=e=>{const{classes:o,disableUnderline:t}=e,s=_({root:["root",!t&&"underline"],input:["input"]},Io,o);return r({},o,s)},$o=C(Me,{shouldForwardProp:e=>Y(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[...Oe(e,o),!t.disableUnderline&&o.underline]}})(({theme:e,ownerState:o})=>{var t;const n=e.palette.mode==="light",s=n?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",d=n?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",a=n?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",u=n?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return r({position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:d,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:a,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:d}},[`&.${ee.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:d},[`&.${ee.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:u}},!o.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(t=(e.vars||e).palette[o.color||"primary"])==null?void 0:t.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${ee.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${ee.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:s}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${ee.disabled}, .${ee.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${ee.disabled}:before`]:{borderBottomStyle:"dotted"}},o.startAdornment&&{paddingLeft:12},o.endAdornment&&{paddingRight:12},o.multiline&&r({padding:"25px 12px 8px"},o.size==="small"&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.hiddenLabel&&o.size==="small"&&{paddingTop:8,paddingBottom:9}))}),So=C(Ne,{name:"MuiFilledInput",slot:"Input",overridesResolver:Le})(({theme:e,ownerState:o})=>r({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},o.size==="small"&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0},o.hiddenLabel&&o.size==="small"&&{paddingTop:8,paddingBottom:9},o.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),we=f.forwardRef(function(o,t){var n,s,d,a;const u=K({props:o,name:"MuiFilledInput"}),{components:c={},componentsProps:l,fullWidth:p=!1,inputComponent:v="input",multiline:g=!1,slotProps:I,slots:h={},type:S="text"}=u,F=T(u,yo),$=r({},u,{fullWidth:p,inputComponent:v,multiline:g,type:S}),R=Fo(u),k={root:{ownerState:$},input:{ownerState:$}},b=I??l?ke(k,I??l):k,L=(n=(s=h.root)!=null?s:c.Root)!=null?n:$o,O=(d=(a=h.input)!=null?a:c.Input)!=null?d:So;return m.jsx(Pe,r({slots:{root:L,input:O},componentsProps:b,fullWidth:p,inputComponent:v,multiline:g,ref:t,type:S},F,{classes:R}))});we.muiName="Input";function ko(e){return U("MuiFormControl",e)}A("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Po=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],Mo=e=>{const{classes:o,margin:t,fullWidth:n}=e,s={root:["root",t!=="none"&&`margin${q(t)}`,n&&"fullWidth"]};return _(s,ko,o)},Oo=C("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:e},o)=>r({},o.root,o[`margin${q(e.margin)}`],e.fullWidth&&o.fullWidth)})(({ownerState:e})=>r({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},e.margin==="normal"&&{marginTop:16,marginBottom:8},e.margin==="dense"&&{marginTop:8,marginBottom:4},e.fullWidth&&{width:"100%"})),No=f.forwardRef(function(o,t){const n=K({props:o,name:"MuiFormControl"}),{children:s,className:d,color:a="primary",component:u="div",disabled:c=!1,error:l=!1,focused:p,fullWidth:v=!1,hiddenLabel:g=!1,margin:I="none",required:h=!1,size:S="medium",variant:F="outlined"}=n,$=T(n,Po),R=r({},n,{color:a,component:u,disabled:c,error:l,fullWidth:v,hiddenLabel:g,margin:I,required:h,size:S,variant:F}),k=Mo(R),[b,L]=f.useState(()=>{let P=!1;return s&&f.Children.forEach(s,M=>{if(!Fe(M,["Input","Select"]))return;const E=Fe(M,["Select"])?M.props.input:M;E&&po(E.props)&&(P=!0)}),P}),[O,w]=f.useState(()=>{let P=!1;return s&&f.Children.forEach(s,M=>{Fe(M,["Input","Select"])&&($e(M.props,!0)||$e(M.props.inputProps,!0))&&(P=!0)}),P}),[z,j]=f.useState(!1);c&&z&&j(!1);const D=p!==void 0&&!c?p:z;let H;const V=f.useMemo(()=>({adornedStart:b,setAdornedStart:L,color:a,disabled:c,error:l,filled:O,focused:D,fullWidth:v,hiddenLabel:g,size:S,onBlur:()=>{j(!1)},onEmpty:()=>{w(!1)},onFilled:()=>{w(!0)},onFocus:()=>{j(!0)},registerEffect:H,required:h,variant:F}),[b,a,c,l,O,D,v,g,H,h,S,F]);return m.jsx(fo.Provider,{value:V,children:m.jsx(Oo,r({as:u,ownerState:R,className:Q(k.root,d),ref:t},$,{children:s}))})});function Lo(e){return U("MuiFormHelperText",e)}const He=A("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var Ve;const wo=["children","className","component","disabled","error","filled","focused","margin","required","variant"],Wo=e=>{const{classes:o,contained:t,size:n,disabled:s,error:d,filled:a,focused:u,required:c}=e,l={root:["root",s&&"disabled",d&&"error",n&&`size${q(n)}`,t&&"contained",u&&"focused",a&&"filled",c&&"required"]};return _(l,Lo,o)},Bo=C("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,t.size&&o[`size${q(t.size)}`],t.contained&&o.contained,t.filled&&o.filled]}})(({theme:e,ownerState:o})=>r({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${He.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${He.error}`]:{color:(e.vars||e).palette.error.main}},o.size==="small"&&{marginTop:4},o.contained&&{marginLeft:14,marginRight:14})),To=f.forwardRef(function(o,t){const n=K({props:o,name:"MuiFormHelperText"}),{children:s,className:d,component:a="p"}=n,u=T(n,wo),c=de(),l=ue({props:n,muiFormControl:c,states:["variant","size","disabled","error","filled","focused","required"]}),p=r({},n,{component:a,contained:l.variant==="filled"||l.variant==="outlined",variant:l.variant,size:l.size,disabled:l.disabled,error:l.error,filled:l.filled,focused:l.focused,required:l.required}),v=Wo(p);return m.jsx(Bo,r({as:a,ownerState:p,className:Q(v.root,d),ref:t},u,{children:s===" "?Ve||(Ve=m.jsx("span",{className:"notranslate",children:"​"})):s}))});function zo(e){return U("MuiFormLabel",e)}const ae=A("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),Eo=["children","className","color","component","disabled","error","filled","focused","required"],jo=e=>{const{classes:o,color:t,focused:n,disabled:s,error:d,filled:a,required:u}=e,c={root:["root",`color${q(t)}`,s&&"disabled",d&&"error",a&&"filled",n&&"focused",u&&"required"],asterisk:["asterisk",d&&"error"]};return _(c,zo,o)},Ao=C("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:e},o)=>r({},o.root,e.color==="secondary"&&o.colorSecondary,e.filled&&o.filled)})(({theme:e,ownerState:o})=>r({color:(e.vars||e).palette.text.secondary},e.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${ae.focused}`]:{color:(e.vars||e).palette[o.color].main},[`&.${ae.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${ae.error}`]:{color:(e.vars||e).palette.error.main}})),Uo=C("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,o)=>o.asterisk})(({theme:e})=>({[`&.${ae.error}`]:{color:(e.vars||e).palette.error.main}})),_o=f.forwardRef(function(o,t){const n=K({props:o,name:"MuiFormLabel"}),{children:s,className:d,component:a="label"}=n,u=T(n,Eo),c=de(),l=ue({props:n,muiFormControl:c,states:["color","required","focused","disabled","error","filled"]}),p=r({},n,{color:l.color||"primary",component:a,disabled:l.disabled,error:l.error,filled:l.filled,focused:l.focused,required:l.required}),v=jo(p);return m.jsxs(Ao,r({as:a,ownerState:p,className:Q(v.root,d),ref:t},u,{children:[s,l.required&&m.jsxs(Uo,{ownerState:p,"aria-hidden":!0,className:v.asterisk,children:[" ","*"]})]}))}),qo=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],Do=e=>{const{classes:o,disableUnderline:t}=e,s=_({root:["root",!t&&"underline"],input:["input"]},ho,o);return r({},o,s)},Ho=C(Me,{shouldForwardProp:e=>Y(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[...Oe(e,o),!t.disableUnderline&&o.underline]}})(({theme:e,ownerState:o})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),r({position:"relative"},o.formControl&&{"label + &":{marginTop:16}},!o.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[o.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${le.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${le.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${le.disabled}, .${le.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${le.disabled}:before`]:{borderBottomStyle:"dotted"}})}),Vo=C(Ne,{name:"MuiInput",slot:"Input",overridesResolver:Le})({}),We=f.forwardRef(function(o,t){var n,s,d,a;const u=K({props:o,name:"MuiInput"}),{disableUnderline:c,components:l={},componentsProps:p,fullWidth:v=!1,inputComponent:g="input",multiline:I=!1,slotProps:h,slots:S={},type:F="text"}=u,$=T(u,qo),R=Do(u),b={root:{ownerState:{disableUnderline:c}}},L=h??p?ke(h??p,b):b,O=(n=(s=S.root)!=null?s:l.Root)!=null?n:Ho,w=(d=(a=S.input)!=null?a:l.Input)!=null?d:Vo;return m.jsx(Pe,r({slots:{root:O,input:w},slotProps:L,fullWidth:v,inputComponent:g,multiline:I,ref:t,type:F},$,{classes:R}))});We.muiName="Input";function Ko(e){return U("MuiInputLabel",e)}A("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Xo=["disableAnimation","margin","shrink","variant","className"],Go=e=>{const{classes:o,formControl:t,size:n,shrink:s,disableAnimation:d,variant:a,required:u}=e,c={root:["root",t&&"formControl",!d&&"animated",s&&"shrink",n&&n!=="normal"&&`size${q(n)}`,a],asterisk:[u&&"asterisk"]},l=_(c,Ko,o);return r({},o,l)},Jo=C(_o,{shouldForwardProp:e=>Y(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`& .${ae.asterisk}`]:o.asterisk},o.root,t.formControl&&o.formControl,t.size==="small"&&o.sizeSmall,t.shrink&&o.shrink,!t.disableAnimation&&o.animated,t.focused&&o.focused,o[t.variant]]}})(({theme:e,ownerState:o})=>r({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},o.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},o.size==="small"&&{transform:"translate(0, 17px) scale(1)"},o.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!o.disableAnimation&&{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},o.variant==="filled"&&r({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},o.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},o.shrink&&r({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},o.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),o.variant==="outlined"&&r({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},o.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},o.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),Yo=f.forwardRef(function(o,t){const n=K({name:"MuiInputLabel",props:o}),{disableAnimation:s=!1,shrink:d,className:a}=n,u=T(n,Xo),c=de();let l=d;typeof l>"u"&&c&&(l=c.filled||c.focused||c.adornedStart);const p=ue({props:n,muiFormControl:c,states:["size","variant","required","focused"]}),v=r({},n,{disableAnimation:s,formControl:c,shrink:l,size:p.size,variant:p.variant,required:p.required,focused:p.focused}),g=Go(v);return m.jsx(Jo,r({"data-shrink":l,ownerState:v,ref:t,className:Q(g.root,a)},u,{classes:g}))});function Qo(e){return U("MuiNativeSelect",e)}const Be=A("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Zo=["className","disabled","error","IconComponent","inputRef","variant"],et=e=>{const{classes:o,variant:t,disabled:n,multiple:s,open:d,error:a}=e,u={select:["select",t,n&&"disabled",s&&"multiple",a&&"error"],icon:["icon",`icon${q(t)}`,d&&"iconOpen",n&&"disabled"]};return _(u,Qo,o)},Qe=({ownerState:e,theme:o})=>r({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":r({},o.vars?{backgroundColor:`rgba(${o.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:o.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${Be.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(o.vars||o).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},e.variant==="filled"&&{"&&&":{paddingRight:32}},e.variant==="outlined"&&{borderRadius:(o.vars||o).shape.borderRadius,"&:focus":{borderRadius:(o.vars||o).shape.borderRadius},"&&&":{paddingRight:32}}),ot=C("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Y,overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.select,o[t.variant],t.error&&o.error,{[`&.${Be.multiple}`]:o.multiple}]}})(Qe),Ze=({ownerState:e,theme:o})=>r({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(o.vars||o).palette.action.active,[`&.${Be.disabled}`]:{color:(o.vars||o).palette.action.disabled}},e.open&&{transform:"rotate(180deg)"},e.variant==="filled"&&{right:7},e.variant==="outlined"&&{right:7}),tt=C("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.icon,t.variant&&o[`icon${q(t.variant)}`],t.open&&o.iconOpen]}})(Ze),nt=f.forwardRef(function(o,t){const{className:n,disabled:s,error:d,IconComponent:a,inputRef:u,variant:c="standard"}=o,l=T(o,Zo),p=r({},o,{disabled:s,variant:c,error:d}),v=et(p);return m.jsxs(f.Fragment,{children:[m.jsx(ot,r({ownerState:p,className:Q(v.select,n),disabled:s,ref:u||t},l)),o.multiple?null:m.jsx(tt,{as:a,ownerState:p,className:v.icon})]})});var Ke;const rt=["children","classes","className","label","notched"],st=C("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:Y})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),lt=C("legend",{name:"MuiNotchedOutlined",shouldForwardProp:Y})(({ownerState:e,theme:o})=>r({float:"unset",width:"auto",overflow:"hidden"},!e.withLabel&&{padding:0,lineHeight:"11px",transition:o.transitions.create("width",{duration:150,easing:o.transitions.easing.easeOut})},e.withLabel&&r({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:o.transitions.create("max-width",{duration:50,easing:o.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},e.notched&&{maxWidth:"100%",transition:o.transitions.create("max-width",{duration:100,easing:o.transitions.easing.easeOut,delay:50})})));function it(e){const{className:o,label:t,notched:n}=e,s=T(e,rt),d=t!=null&&t!=="",a=r({},e,{notched:n,withLabel:d});return m.jsx(st,r({"aria-hidden":!0,className:o,ownerState:a},s,{children:m.jsx(lt,{ownerState:a,children:d?m.jsx("span",{children:t}):Ke||(Ke=m.jsx("span",{className:"notranslate",children:"​"}))})}))}const at=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],dt=e=>{const{classes:o}=e,n=_({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},Co,o);return r({},o,n)},ut=C(Me,{shouldForwardProp:e=>Y(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Oe})(({theme:e,ownerState:o})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return r({position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${J.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${J.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${J.focused} .${J.notchedOutline}`]:{borderColor:(e.vars||e).palette[o.color].main,borderWidth:2},[`&.${J.error} .${J.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${J.disabled} .${J.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}},o.startAdornment&&{paddingLeft:14},o.endAdornment&&{paddingRight:14},o.multiline&&r({padding:"16.5px 14px"},o.size==="small"&&{padding:"8.5px 14px"}))}),ct=C(it,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,o)=>o.notchedOutline})(({theme:e})=>{const o=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:o}}),pt=C(Ne,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Le})(({theme:e,ownerState:o})=>r({padding:"16.5px 14px"},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},o.size==="small"&&{padding:"8.5px 14px"},o.multiline&&{padding:0},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0})),Te=f.forwardRef(function(o,t){var n,s,d,a,u;const c=K({props:o,name:"MuiOutlinedInput"}),{components:l={},fullWidth:p=!1,inputComponent:v="input",label:g,multiline:I=!1,notched:h,slots:S={},type:F="text"}=c,$=T(c,at),R=dt(c),k=de(),b=ue({props:c,muiFormControl:k,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),L=r({},c,{color:b.color||"primary",disabled:b.disabled,error:b.error,focused:b.focused,formControl:k,fullWidth:p,hiddenLabel:b.hiddenLabel,multiline:I,size:b.size,type:F}),O=(n=(s=S.root)!=null?s:l.Root)!=null?n:ut,w=(d=(a=S.input)!=null?a:l.Input)!=null?d:pt;return m.jsx(Pe,r({slots:{root:O,input:w},renderSuffix:z=>m.jsx(ct,{ownerState:L,className:R.notchedOutline,label:g!=null&&g!==""&&b.required?u||(u=m.jsxs(f.Fragment,{children:[g," ","*"]})):g,notched:typeof h<"u"?h:!!(z.startAdornment||z.filled||z.focused)}),fullWidth:p,inputComponent:v,multiline:I,ref:t,type:F},$,{classes:r({},R,{notchedOutline:null})}))});Te.muiName="Input";function ft(e){return U("MuiSelect",e)}const ie=A("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Xe;const mt=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],bt=C("div",{name:"MuiSelect",slot:"Select",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`&.${ie.select}`]:o.select},{[`&.${ie.select}`]:o[t.variant]},{[`&.${ie.error}`]:o.error},{[`&.${ie.multiple}`]:o.multiple}]}})(Qe,{[`&.${ie.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),vt=C("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.icon,t.variant&&o[`icon${q(t.variant)}`],t.open&&o.iconOpen]}})(Ze),gt=C("input",{shouldForwardProp:e=>go(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,o)=>o.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function Ge(e,o){return typeof o=="object"&&o!==null?e===o:String(e)===String(o)}function xt(e){return e==null||typeof e=="string"&&!e.trim()}const ht=e=>{const{classes:o,variant:t,disabled:n,multiple:s,open:d,error:a}=e,u={select:["select",t,n&&"disabled",s&&"multiple",a&&"error"],icon:["icon",`icon${q(t)}`,d&&"iconOpen",n&&"disabled"],nativeInput:["nativeInput"]};return _(u,ft,o)},Ct=f.forwardRef(function(o,t){var n;const{"aria-describedby":s,"aria-label":d,autoFocus:a,autoWidth:u,children:c,className:l,defaultOpen:p,defaultValue:v,disabled:g,displayEmpty:I,error:h=!1,IconComponent:S,inputRef:F,labelId:$,MenuProps:R={},multiple:k,name:b,onBlur:L,onChange:O,onClose:w,onFocus:z,onOpen:j,open:D,readOnly:H,renderValue:V,SelectDisplayProps:P={},tabIndex:M,value:E,variant:X="standard"}=o,G=T(o,mt),[y,Z]=De({controlled:E,default:v,name:"Select"}),[ce,pe]=De({controlled:D,default:p,name:"Select"}),fe=f.useRef(null),B=f.useRef(null),[W,re]=f.useState(null),{current:oe}=f.useRef(D!=null),[Ce,se]=f.useState(),oo=Je(t,F),to=f.useCallback(i=>{B.current=i,i&&re(i)},[]),me=W==null?void 0:W.parentNode;f.useImperativeHandle(oo,()=>({focus:()=>{B.current.focus()},node:fe.current,value:y}),[y]),f.useEffect(()=>{p&&ce&&W&&!oe&&(se(u?null:me.clientWidth),B.current.focus())},[W,u]),f.useEffect(()=>{a&&B.current.focus()},[a]),f.useEffect(()=>{if(!$)return;const i=mo(B.current).getElementById($);if(i){const x=()=>{getSelection().isCollapsed&&B.current.focus()};return i.addEventListener("click",x),()=>{i.removeEventListener("click",x)}}},[$]);const be=(i,x)=>{i?j&&j(x):w&&w(x),oe||(se(u?null:me.clientWidth),pe(i))},no=i=>{i.button===0&&(i.preventDefault(),B.current.focus(),be(!0,i))},ro=i=>{be(!1,i)},Ee=f.Children.toArray(c),so=i=>{const x=Ee.find(N=>N.props.value===i.target.value);x!==void 0&&(Z(x.props.value),O&&O(i,x))},lo=i=>x=>{let N;if(x.currentTarget.hasAttribute("tabindex")){if(k){N=Array.isArray(y)?y.slice():[];const ne=y.indexOf(i.props.value);ne===-1?N.push(i.props.value):N.splice(ne,1)}else N=i.props.value;if(i.props.onClick&&i.props.onClick(x),y!==N&&(Z(N),O)){const ne=x.nativeEvent||x,qe=new ne.constructor(ne.type,ne);Object.defineProperty(qe,"target",{writable:!0,value:{value:N,name:b}}),O(qe,i)}k||be(!1,x)}},io=i=>{H||[" ","ArrowUp","ArrowDown","Enter"].indexOf(i.key)!==-1&&(i.preventDefault(),be(!0,i))},ve=W!==null&&ce,ao=i=>{!ve&&L&&(Object.defineProperty(i,"target",{writable:!0,value:{value:y,name:b}}),L(i))};delete G["aria-invalid"];let te,je;const ge=[];let xe=!1;($e({value:y})||I)&&(V?te=V(y):xe=!0);const uo=Ee.map(i=>{if(!f.isValidElement(i))return null;let x;if(k){if(!Array.isArray(y))throw new Error(bo(2));x=y.some(N=>Ge(N,i.props.value)),x&&xe&&ge.push(i.props.children)}else x=Ge(y,i.props.value),x&&xe&&(je=i.props.children);return f.cloneElement(i,{"aria-selected":x?"true":"false",onClick:lo(i),onKeyUp:N=>{N.key===" "&&N.preventDefault(),i.props.onKeyUp&&i.props.onKeyUp(N)},role:"option",selected:x,value:void 0,"data-value":i.props.value})});xe&&(k?ge.length===0?te=null:te=ge.reduce((i,x,N)=>(i.push(x),N{const{classes:o}=e;return o},ze={name:"MuiSelect",overridesResolver:(e,o)=>o.root,shouldForwardProp:e=>Y(e)&&e!=="variant",slot:"Root"},Ft=C(We,ze)(""),$t=C(Te,ze)(""),St=C(we,ze)(""),eo=f.forwardRef(function(o,t){const n=K({name:"MuiSelect",props:o}),{autoWidth:s=!1,children:d,classes:a={},className:u,defaultOpen:c=!1,displayEmpty:l=!1,IconComponent:p=Ro,id:v,input:g,inputProps:I,label:h,labelId:S,MenuProps:F,multiple:$=!1,native:R=!1,onClose:k,onOpen:b,open:L,renderValue:O,SelectDisplayProps:w,variant:z="outlined"}=n,j=T(n,It),D=R?nt:Ct,H=de(),V=ue({props:n,muiFormControl:H,states:["variant","error"]}),P=V.variant||z,M=r({},n,{variant:P,classes:a}),E=yt(M),X=T(E,Rt),G=g||{standard:m.jsx(Ft,{ownerState:M}),outlined:m.jsx($t,{label:h,ownerState:M}),filled:m.jsx(St,{ownerState:M})}[P],y=Je(t,xo(G));return m.jsx(f.Fragment,{children:f.cloneElement(G,r({inputComponent:D,inputProps:r({children:d,error:V.error,IconComponent:p,variant:P,type:void 0,multiple:$},R?{id:v}:{autoWidth:s,defaultOpen:c,displayEmpty:l,labelId:S,MenuProps:F,onClose:k,onOpen:b,open:L,renderValue:O,SelectDisplayProps:r({id:v},w)},I,{classes:I?ke(X,I.classes):X},g?g.props.inputProps:{})},($&&R||l)&&P==="outlined"?{notched:!0}:{},{ref:y,className:Q(G.props.className,u,E.root)},!g&&{variant:P},j))})});eo.muiName="Select";function kt(e){return U("MuiTextField",e)}A("MuiTextField",["root"]);const Pt=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],Mt={standard:We,filled:we,outlined:Te},Ot=e=>{const{classes:o}=e;return _({root:["root"]},kt,o)},Nt=C(No,{name:"MuiTextField",slot:"Root",overridesResolver:(e,o)=>o.root})({}),wt=f.forwardRef(function(o,t){const n=K({props:o,name:"MuiTextField"}),{autoComplete:s,autoFocus:d=!1,children:a,className:u,color:c="primary",defaultValue:l,disabled:p=!1,error:v=!1,FormHelperTextProps:g,fullWidth:I=!1,helperText:h,id:S,InputLabelProps:F,inputProps:$,InputProps:R,inputRef:k,label:b,maxRows:L,minRows:O,multiline:w=!1,name:z,onBlur:j,onChange:D,onFocus:H,placeholder:V,required:P=!1,rows:M,select:E=!1,SelectProps:X,type:G,value:y,variant:Z="outlined"}=n,ce=T(n,Pt),pe=r({},n,{autoFocus:d,color:c,disabled:p,error:v,fullWidth:I,multiline:w,required:P,select:E,variant:Z}),fe=Ot(pe),B={};Z==="outlined"&&(F&&typeof F.shrink<"u"&&(B.notched=F.shrink),B.label=b),E&&((!X||!X.native)&&(B.id=void 0),B["aria-describedby"]=void 0);const W=Ye(S),re=h&&W?`${W}-helper-text`:void 0,oe=b&&W?`${W}-label`:void 0,Ce=Mt[Z],se=m.jsx(Ce,r({"aria-describedby":re,autoComplete:s,autoFocus:d,defaultValue:l,fullWidth:I,multiline:w,name:z,rows:M,maxRows:L,minRows:O,type:G,value:y,id:W,inputRef:k,onBlur:j,onChange:D,onFocus:H,placeholder:V,inputProps:$},B,R));return m.jsxs(Nt,r({className:Q(fe.root,u),disabled:p,error:v,fullWidth:I,ref:t,required:P,color:c,variant:Z,ownerState:pe},ce,{children:[b!=null&&b!==""&&m.jsx(Yo,r({htmlFor:W,id:oe},F,{children:b})),E?m.jsx(eo,r({"aria-describedby":re,id:W,labelId:oe,value:y,input:se},X,{children:a})):se,h&&m.jsx(To,r({id:re},g,{children:h}))]}))});export{Ro as A,No as F,Te as O,eo as S,wt as T,ee as f,le as i,J as o}; +import{_ as r,N as Se,y as A,x as U,a5 as co,j as m,b as f,z as K,E as T,ay as ke,a6 as Pe,H as _,J as C,az as Me,aA as Oe,Y,aB as Ne,aC as Le,aD as Fe,aE as po,aF as $e,av as fo,F as Q,G as q,at as de,au as ue,s as De,L as Je,a4 as mo,aG as bo,q as Ye,aH as vo,aI as go,aJ as xo}from"./index-D7LVXeIK.js";function ho(e){return U("MuiInput",e)}const le=r({},Se,A("MuiInput",["root","underline","input"]));function Co(e){return U("MuiOutlinedInput",e)}const J=r({},Se,A("MuiOutlinedInput",["root","notchedOutline","input"]));function Io(e){return U("MuiFilledInput",e)}const ee=r({},Se,A("MuiFilledInput",["root","underline","input"])),Ro=co(m.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown"),yo=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],Fo=e=>{const{classes:o,disableUnderline:t}=e,s=_({root:["root",!t&&"underline"],input:["input"]},Io,o);return r({},o,s)},$o=C(Me,{shouldForwardProp:e=>Y(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[...Oe(e,o),!t.disableUnderline&&o.underline]}})(({theme:e,ownerState:o})=>{var t;const n=e.palette.mode==="light",s=n?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",d=n?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",a=n?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",u=n?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return r({position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:d,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:a,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:d}},[`&.${ee.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:d},[`&.${ee.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:u}},!o.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(t=(e.vars||e).palette[o.color||"primary"])==null?void 0:t.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${ee.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${ee.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:s}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${ee.disabled}, .${ee.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${ee.disabled}:before`]:{borderBottomStyle:"dotted"}},o.startAdornment&&{paddingLeft:12},o.endAdornment&&{paddingRight:12},o.multiline&&r({padding:"25px 12px 8px"},o.size==="small"&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.hiddenLabel&&o.size==="small"&&{paddingTop:8,paddingBottom:9}))}),So=C(Ne,{name:"MuiFilledInput",slot:"Input",overridesResolver:Le})(({theme:e,ownerState:o})=>r({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},o.size==="small"&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0},o.hiddenLabel&&o.size==="small"&&{paddingTop:8,paddingBottom:9},o.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),we=f.forwardRef(function(o,t){var n,s,d,a;const u=K({props:o,name:"MuiFilledInput"}),{components:c={},componentsProps:l,fullWidth:p=!1,inputComponent:v="input",multiline:g=!1,slotProps:I,slots:h={},type:S="text"}=u,F=T(u,yo),$=r({},u,{fullWidth:p,inputComponent:v,multiline:g,type:S}),R=Fo(u),k={root:{ownerState:$},input:{ownerState:$}},b=I??l?ke(k,I??l):k,L=(n=(s=h.root)!=null?s:c.Root)!=null?n:$o,O=(d=(a=h.input)!=null?a:c.Input)!=null?d:So;return m.jsx(Pe,r({slots:{root:L,input:O},componentsProps:b,fullWidth:p,inputComponent:v,multiline:g,ref:t,type:S},F,{classes:R}))});we.muiName="Input";function ko(e){return U("MuiFormControl",e)}A("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Po=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],Mo=e=>{const{classes:o,margin:t,fullWidth:n}=e,s={root:["root",t!=="none"&&`margin${q(t)}`,n&&"fullWidth"]};return _(s,ko,o)},Oo=C("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:e},o)=>r({},o.root,o[`margin${q(e.margin)}`],e.fullWidth&&o.fullWidth)})(({ownerState:e})=>r({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},e.margin==="normal"&&{marginTop:16,marginBottom:8},e.margin==="dense"&&{marginTop:8,marginBottom:4},e.fullWidth&&{width:"100%"})),No=f.forwardRef(function(o,t){const n=K({props:o,name:"MuiFormControl"}),{children:s,className:d,color:a="primary",component:u="div",disabled:c=!1,error:l=!1,focused:p,fullWidth:v=!1,hiddenLabel:g=!1,margin:I="none",required:h=!1,size:S="medium",variant:F="outlined"}=n,$=T(n,Po),R=r({},n,{color:a,component:u,disabled:c,error:l,fullWidth:v,hiddenLabel:g,margin:I,required:h,size:S,variant:F}),k=Mo(R),[b,L]=f.useState(()=>{let P=!1;return s&&f.Children.forEach(s,M=>{if(!Fe(M,["Input","Select"]))return;const E=Fe(M,["Select"])?M.props.input:M;E&&po(E.props)&&(P=!0)}),P}),[O,w]=f.useState(()=>{let P=!1;return s&&f.Children.forEach(s,M=>{Fe(M,["Input","Select"])&&($e(M.props,!0)||$e(M.props.inputProps,!0))&&(P=!0)}),P}),[z,j]=f.useState(!1);c&&z&&j(!1);const D=p!==void 0&&!c?p:z;let H;const V=f.useMemo(()=>({adornedStart:b,setAdornedStart:L,color:a,disabled:c,error:l,filled:O,focused:D,fullWidth:v,hiddenLabel:g,size:S,onBlur:()=>{j(!1)},onEmpty:()=>{w(!1)},onFilled:()=>{w(!0)},onFocus:()=>{j(!0)},registerEffect:H,required:h,variant:F}),[b,a,c,l,O,D,v,g,H,h,S,F]);return m.jsx(fo.Provider,{value:V,children:m.jsx(Oo,r({as:u,ownerState:R,className:Q(k.root,d),ref:t},$,{children:s}))})});function Lo(e){return U("MuiFormHelperText",e)}const He=A("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var Ve;const wo=["children","className","component","disabled","error","filled","focused","margin","required","variant"],Wo=e=>{const{classes:o,contained:t,size:n,disabled:s,error:d,filled:a,focused:u,required:c}=e,l={root:["root",s&&"disabled",d&&"error",n&&`size${q(n)}`,t&&"contained",u&&"focused",a&&"filled",c&&"required"]};return _(l,Lo,o)},Bo=C("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,t.size&&o[`size${q(t.size)}`],t.contained&&o.contained,t.filled&&o.filled]}})(({theme:e,ownerState:o})=>r({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${He.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${He.error}`]:{color:(e.vars||e).palette.error.main}},o.size==="small"&&{marginTop:4},o.contained&&{marginLeft:14,marginRight:14})),To=f.forwardRef(function(o,t){const n=K({props:o,name:"MuiFormHelperText"}),{children:s,className:d,component:a="p"}=n,u=T(n,wo),c=de(),l=ue({props:n,muiFormControl:c,states:["variant","size","disabled","error","filled","focused","required"]}),p=r({},n,{component:a,contained:l.variant==="filled"||l.variant==="outlined",variant:l.variant,size:l.size,disabled:l.disabled,error:l.error,filled:l.filled,focused:l.focused,required:l.required}),v=Wo(p);return m.jsx(Bo,r({as:a,ownerState:p,className:Q(v.root,d),ref:t},u,{children:s===" "?Ve||(Ve=m.jsx("span",{className:"notranslate",children:"​"})):s}))});function zo(e){return U("MuiFormLabel",e)}const ae=A("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),Eo=["children","className","color","component","disabled","error","filled","focused","required"],jo=e=>{const{classes:o,color:t,focused:n,disabled:s,error:d,filled:a,required:u}=e,c={root:["root",`color${q(t)}`,s&&"disabled",d&&"error",a&&"filled",n&&"focused",u&&"required"],asterisk:["asterisk",d&&"error"]};return _(c,zo,o)},Ao=C("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:e},o)=>r({},o.root,e.color==="secondary"&&o.colorSecondary,e.filled&&o.filled)})(({theme:e,ownerState:o})=>r({color:(e.vars||e).palette.text.secondary},e.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${ae.focused}`]:{color:(e.vars||e).palette[o.color].main},[`&.${ae.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${ae.error}`]:{color:(e.vars||e).palette.error.main}})),Uo=C("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,o)=>o.asterisk})(({theme:e})=>({[`&.${ae.error}`]:{color:(e.vars||e).palette.error.main}})),_o=f.forwardRef(function(o,t){const n=K({props:o,name:"MuiFormLabel"}),{children:s,className:d,component:a="label"}=n,u=T(n,Eo),c=de(),l=ue({props:n,muiFormControl:c,states:["color","required","focused","disabled","error","filled"]}),p=r({},n,{color:l.color||"primary",component:a,disabled:l.disabled,error:l.error,filled:l.filled,focused:l.focused,required:l.required}),v=jo(p);return m.jsxs(Ao,r({as:a,ownerState:p,className:Q(v.root,d),ref:t},u,{children:[s,l.required&&m.jsxs(Uo,{ownerState:p,"aria-hidden":!0,className:v.asterisk,children:[" ","*"]})]}))}),qo=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],Do=e=>{const{classes:o,disableUnderline:t}=e,s=_({root:["root",!t&&"underline"],input:["input"]},ho,o);return r({},o,s)},Ho=C(Me,{shouldForwardProp:e=>Y(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[...Oe(e,o),!t.disableUnderline&&o.underline]}})(({theme:e,ownerState:o})=>{let n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(n=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),r({position:"relative"},o.formControl&&{"label + &":{marginTop:16}},!o.disableUnderline&&{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[o.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${le.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${le.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${le.disabled}, .${le.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},[`&.${le.disabled}:before`]:{borderBottomStyle:"dotted"}})}),Vo=C(Ne,{name:"MuiInput",slot:"Input",overridesResolver:Le})({}),We=f.forwardRef(function(o,t){var n,s,d,a;const u=K({props:o,name:"MuiInput"}),{disableUnderline:c,components:l={},componentsProps:p,fullWidth:v=!1,inputComponent:g="input",multiline:I=!1,slotProps:h,slots:S={},type:F="text"}=u,$=T(u,qo),R=Do(u),b={root:{ownerState:{disableUnderline:c}}},L=h??p?ke(h??p,b):b,O=(n=(s=S.root)!=null?s:l.Root)!=null?n:Ho,w=(d=(a=S.input)!=null?a:l.Input)!=null?d:Vo;return m.jsx(Pe,r({slots:{root:O,input:w},slotProps:L,fullWidth:v,inputComponent:g,multiline:I,ref:t,type:F},$,{classes:R}))});We.muiName="Input";function Ko(e){return U("MuiInputLabel",e)}A("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const Xo=["disableAnimation","margin","shrink","variant","className"],Go=e=>{const{classes:o,formControl:t,size:n,shrink:s,disableAnimation:d,variant:a,required:u}=e,c={root:["root",t&&"formControl",!d&&"animated",s&&"shrink",n&&n!=="normal"&&`size${q(n)}`,a],asterisk:[u&&"asterisk"]},l=_(c,Ko,o);return r({},o,l)},Jo=C(_o,{shouldForwardProp:e=>Y(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`& .${ae.asterisk}`]:o.asterisk},o.root,t.formControl&&o.formControl,t.size==="small"&&o.sizeSmall,t.shrink&&o.shrink,!t.disableAnimation&&o.animated,t.focused&&o.focused,o[t.variant]]}})(({theme:e,ownerState:o})=>r({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},o.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},o.size==="small"&&{transform:"translate(0, 17px) scale(1)"},o.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!o.disableAnimation&&{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},o.variant==="filled"&&r({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},o.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},o.shrink&&r({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},o.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),o.variant==="outlined"&&r({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},o.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},o.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),Yo=f.forwardRef(function(o,t){const n=K({name:"MuiInputLabel",props:o}),{disableAnimation:s=!1,shrink:d,className:a}=n,u=T(n,Xo),c=de();let l=d;typeof l>"u"&&c&&(l=c.filled||c.focused||c.adornedStart);const p=ue({props:n,muiFormControl:c,states:["size","variant","required","focused"]}),v=r({},n,{disableAnimation:s,formControl:c,shrink:l,size:p.size,variant:p.variant,required:p.required,focused:p.focused}),g=Go(v);return m.jsx(Jo,r({"data-shrink":l,ownerState:v,ref:t,className:Q(g.root,a)},u,{classes:g}))});function Qo(e){return U("MuiNativeSelect",e)}const Be=A("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Zo=["className","disabled","error","IconComponent","inputRef","variant"],et=e=>{const{classes:o,variant:t,disabled:n,multiple:s,open:d,error:a}=e,u={select:["select",t,n&&"disabled",s&&"multiple",a&&"error"],icon:["icon",`icon${q(t)}`,d&&"iconOpen",n&&"disabled"]};return _(u,Qo,o)},Qe=({ownerState:e,theme:o})=>r({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":r({},o.vars?{backgroundColor:`rgba(${o.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:o.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${Be.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(o.vars||o).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},e.variant==="filled"&&{"&&&":{paddingRight:32}},e.variant==="outlined"&&{borderRadius:(o.vars||o).shape.borderRadius,"&:focus":{borderRadius:(o.vars||o).shape.borderRadius},"&&&":{paddingRight:32}}),ot=C("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Y,overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.select,o[t.variant],t.error&&o.error,{[`&.${Be.multiple}`]:o.multiple}]}})(Qe),Ze=({ownerState:e,theme:o})=>r({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(o.vars||o).palette.action.active,[`&.${Be.disabled}`]:{color:(o.vars||o).palette.action.disabled}},e.open&&{transform:"rotate(180deg)"},e.variant==="filled"&&{right:7},e.variant==="outlined"&&{right:7}),tt=C("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.icon,t.variant&&o[`icon${q(t.variant)}`],t.open&&o.iconOpen]}})(Ze),nt=f.forwardRef(function(o,t){const{className:n,disabled:s,error:d,IconComponent:a,inputRef:u,variant:c="standard"}=o,l=T(o,Zo),p=r({},o,{disabled:s,variant:c,error:d}),v=et(p);return m.jsxs(f.Fragment,{children:[m.jsx(ot,r({ownerState:p,className:Q(v.select,n),disabled:s,ref:u||t},l)),o.multiple?null:m.jsx(tt,{as:a,ownerState:p,className:v.icon})]})});var Ke;const rt=["children","classes","className","label","notched"],st=C("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:Y})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),lt=C("legend",{name:"MuiNotchedOutlined",shouldForwardProp:Y})(({ownerState:e,theme:o})=>r({float:"unset",width:"auto",overflow:"hidden"},!e.withLabel&&{padding:0,lineHeight:"11px",transition:o.transitions.create("width",{duration:150,easing:o.transitions.easing.easeOut})},e.withLabel&&r({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:o.transitions.create("max-width",{duration:50,easing:o.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},e.notched&&{maxWidth:"100%",transition:o.transitions.create("max-width",{duration:100,easing:o.transitions.easing.easeOut,delay:50})})));function it(e){const{className:o,label:t,notched:n}=e,s=T(e,rt),d=t!=null&&t!=="",a=r({},e,{notched:n,withLabel:d});return m.jsx(st,r({"aria-hidden":!0,className:o,ownerState:a},s,{children:m.jsx(lt,{ownerState:a,children:d?m.jsx("span",{children:t}):Ke||(Ke=m.jsx("span",{className:"notranslate",children:"​"}))})}))}const at=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],dt=e=>{const{classes:o}=e,n=_({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},Co,o);return r({},o,n)},ut=C(Me,{shouldForwardProp:e=>Y(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Oe})(({theme:e,ownerState:o})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return r({position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${J.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${J.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${J.focused} .${J.notchedOutline}`]:{borderColor:(e.vars||e).palette[o.color].main,borderWidth:2},[`&.${J.error} .${J.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${J.disabled} .${J.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}},o.startAdornment&&{paddingLeft:14},o.endAdornment&&{paddingRight:14},o.multiline&&r({padding:"16.5px 14px"},o.size==="small"&&{padding:"8.5px 14px"}))}),ct=C(it,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,o)=>o.notchedOutline})(({theme:e})=>{const o=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:o}}),pt=C(Ne,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Le})(({theme:e,ownerState:o})=>r({padding:"16.5px 14px"},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},o.size==="small"&&{padding:"8.5px 14px"},o.multiline&&{padding:0},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0})),Te=f.forwardRef(function(o,t){var n,s,d,a,u;const c=K({props:o,name:"MuiOutlinedInput"}),{components:l={},fullWidth:p=!1,inputComponent:v="input",label:g,multiline:I=!1,notched:h,slots:S={},type:F="text"}=c,$=T(c,at),R=dt(c),k=de(),b=ue({props:c,muiFormControl:k,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),L=r({},c,{color:b.color||"primary",disabled:b.disabled,error:b.error,focused:b.focused,formControl:k,fullWidth:p,hiddenLabel:b.hiddenLabel,multiline:I,size:b.size,type:F}),O=(n=(s=S.root)!=null?s:l.Root)!=null?n:ut,w=(d=(a=S.input)!=null?a:l.Input)!=null?d:pt;return m.jsx(Pe,r({slots:{root:O,input:w},renderSuffix:z=>m.jsx(ct,{ownerState:L,className:R.notchedOutline,label:g!=null&&g!==""&&b.required?u||(u=m.jsxs(f.Fragment,{children:[g," ","*"]})):g,notched:typeof h<"u"?h:!!(z.startAdornment||z.filled||z.focused)}),fullWidth:p,inputComponent:v,multiline:I,ref:t,type:F},$,{classes:r({},R,{notchedOutline:null})}))});Te.muiName="Input";function ft(e){return U("MuiSelect",e)}const ie=A("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Xe;const mt=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],bt=C("div",{name:"MuiSelect",slot:"Select",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`&.${ie.select}`]:o.select},{[`&.${ie.select}`]:o[t.variant]},{[`&.${ie.error}`]:o.error},{[`&.${ie.multiple}`]:o.multiple}]}})(Qe,{[`&.${ie.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),vt=C("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.icon,t.variant&&o[`icon${q(t.variant)}`],t.open&&o.iconOpen]}})(Ze),gt=C("input",{shouldForwardProp:e=>go(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,o)=>o.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function Ge(e,o){return typeof o=="object"&&o!==null?e===o:String(e)===String(o)}function xt(e){return e==null||typeof e=="string"&&!e.trim()}const ht=e=>{const{classes:o,variant:t,disabled:n,multiple:s,open:d,error:a}=e,u={select:["select",t,n&&"disabled",s&&"multiple",a&&"error"],icon:["icon",`icon${q(t)}`,d&&"iconOpen",n&&"disabled"],nativeInput:["nativeInput"]};return _(u,ft,o)},Ct=f.forwardRef(function(o,t){var n;const{"aria-describedby":s,"aria-label":d,autoFocus:a,autoWidth:u,children:c,className:l,defaultOpen:p,defaultValue:v,disabled:g,displayEmpty:I,error:h=!1,IconComponent:S,inputRef:F,labelId:$,MenuProps:R={},multiple:k,name:b,onBlur:L,onChange:O,onClose:w,onFocus:z,onOpen:j,open:D,readOnly:H,renderValue:V,SelectDisplayProps:P={},tabIndex:M,value:E,variant:X="standard"}=o,G=T(o,mt),[y,Z]=De({controlled:E,default:v,name:"Select"}),[ce,pe]=De({controlled:D,default:p,name:"Select"}),fe=f.useRef(null),B=f.useRef(null),[W,re]=f.useState(null),{current:oe}=f.useRef(D!=null),[Ce,se]=f.useState(),oo=Je(t,F),to=f.useCallback(i=>{B.current=i,i&&re(i)},[]),me=W==null?void 0:W.parentNode;f.useImperativeHandle(oo,()=>({focus:()=>{B.current.focus()},node:fe.current,value:y}),[y]),f.useEffect(()=>{p&&ce&&W&&!oe&&(se(u?null:me.clientWidth),B.current.focus())},[W,u]),f.useEffect(()=>{a&&B.current.focus()},[a]),f.useEffect(()=>{if(!$)return;const i=mo(B.current).getElementById($);if(i){const x=()=>{getSelection().isCollapsed&&B.current.focus()};return i.addEventListener("click",x),()=>{i.removeEventListener("click",x)}}},[$]);const be=(i,x)=>{i?j&&j(x):w&&w(x),oe||(se(u?null:me.clientWidth),pe(i))},no=i=>{i.button===0&&(i.preventDefault(),B.current.focus(),be(!0,i))},ro=i=>{be(!1,i)},Ee=f.Children.toArray(c),so=i=>{const x=Ee.find(N=>N.props.value===i.target.value);x!==void 0&&(Z(x.props.value),O&&O(i,x))},lo=i=>x=>{let N;if(x.currentTarget.hasAttribute("tabindex")){if(k){N=Array.isArray(y)?y.slice():[];const ne=y.indexOf(i.props.value);ne===-1?N.push(i.props.value):N.splice(ne,1)}else N=i.props.value;if(i.props.onClick&&i.props.onClick(x),y!==N&&(Z(N),O)){const ne=x.nativeEvent||x,qe=new ne.constructor(ne.type,ne);Object.defineProperty(qe,"target",{writable:!0,value:{value:N,name:b}}),O(qe,i)}k||be(!1,x)}},io=i=>{H||[" ","ArrowUp","ArrowDown","Enter"].indexOf(i.key)!==-1&&(i.preventDefault(),be(!0,i))},ve=W!==null&&ce,ao=i=>{!ve&&L&&(Object.defineProperty(i,"target",{writable:!0,value:{value:y,name:b}}),L(i))};delete G["aria-invalid"];let te,je;const ge=[];let xe=!1;($e({value:y})||I)&&(V?te=V(y):xe=!0);const uo=Ee.map(i=>{if(!f.isValidElement(i))return null;let x;if(k){if(!Array.isArray(y))throw new Error(bo(2));x=y.some(N=>Ge(N,i.props.value)),x&&xe&&ge.push(i.props.children)}else x=Ge(y,i.props.value),x&&xe&&(je=i.props.children);return f.cloneElement(i,{"aria-selected":x?"true":"false",onClick:lo(i),onKeyUp:N=>{N.key===" "&&N.preventDefault(),i.props.onKeyUp&&i.props.onKeyUp(N)},role:"option",selected:x,value:void 0,"data-value":i.props.value})});xe&&(k?ge.length===0?te=null:te=ge.reduce((i,x,N)=>(i.push(x),N{const{classes:o}=e;return o},ze={name:"MuiSelect",overridesResolver:(e,o)=>o.root,shouldForwardProp:e=>Y(e)&&e!=="variant",slot:"Root"},Ft=C(We,ze)(""),$t=C(Te,ze)(""),St=C(we,ze)(""),eo=f.forwardRef(function(o,t){const n=K({name:"MuiSelect",props:o}),{autoWidth:s=!1,children:d,classes:a={},className:u,defaultOpen:c=!1,displayEmpty:l=!1,IconComponent:p=Ro,id:v,input:g,inputProps:I,label:h,labelId:S,MenuProps:F,multiple:$=!1,native:R=!1,onClose:k,onOpen:b,open:L,renderValue:O,SelectDisplayProps:w,variant:z="outlined"}=n,j=T(n,It),D=R?nt:Ct,H=de(),V=ue({props:n,muiFormControl:H,states:["variant","error"]}),P=V.variant||z,M=r({},n,{variant:P,classes:a}),E=yt(M),X=T(E,Rt),G=g||{standard:m.jsx(Ft,{ownerState:M}),outlined:m.jsx($t,{label:h,ownerState:M}),filled:m.jsx(St,{ownerState:M})}[P],y=Je(t,xo(G));return m.jsx(f.Fragment,{children:f.cloneElement(G,r({inputComponent:D,inputProps:r({children:d,error:V.error,IconComponent:p,variant:P,type:void 0,multiple:$},R?{id:v}:{autoWidth:s,defaultOpen:c,displayEmpty:l,labelId:S,MenuProps:F,onClose:k,onOpen:b,open:L,renderValue:O,SelectDisplayProps:r({id:v},w)},I,{classes:I?ke(X,I.classes):X},g?g.props.inputProps:{})},($&&R||l)&&P==="outlined"?{notched:!0}:{},{ref:y,className:Q(G.props.className,u,E.root)},!g&&{variant:P},j))})});eo.muiName="Select";function kt(e){return U("MuiTextField",e)}A("MuiTextField",["root"]);const Pt=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],Mt={standard:We,filled:we,outlined:Te},Ot=e=>{const{classes:o}=e;return _({root:["root"]},kt,o)},Nt=C(No,{name:"MuiTextField",slot:"Root",overridesResolver:(e,o)=>o.root})({}),wt=f.forwardRef(function(o,t){const n=K({props:o,name:"MuiTextField"}),{autoComplete:s,autoFocus:d=!1,children:a,className:u,color:c="primary",defaultValue:l,disabled:p=!1,error:v=!1,FormHelperTextProps:g,fullWidth:I=!1,helperText:h,id:S,InputLabelProps:F,inputProps:$,InputProps:R,inputRef:k,label:b,maxRows:L,minRows:O,multiline:w=!1,name:z,onBlur:j,onChange:D,onFocus:H,placeholder:V,required:P=!1,rows:M,select:E=!1,SelectProps:X,type:G,value:y,variant:Z="outlined"}=n,ce=T(n,Pt),pe=r({},n,{autoFocus:d,color:c,disabled:p,error:v,fullWidth:I,multiline:w,required:P,select:E,variant:Z}),fe=Ot(pe),B={};Z==="outlined"&&(F&&typeof F.shrink<"u"&&(B.notched=F.shrink),B.label=b),E&&((!X||!X.native)&&(B.id=void 0),B["aria-describedby"]=void 0);const W=Ye(S),re=h&&W?`${W}-helper-text`:void 0,oe=b&&W?`${W}-label`:void 0,Ce=Mt[Z],se=m.jsx(Ce,r({"aria-describedby":re,autoComplete:s,autoFocus:d,defaultValue:l,fullWidth:I,multiline:w,name:z,rows:M,maxRows:L,minRows:O,type:G,value:y,id:W,inputRef:k,onBlur:j,onChange:D,onFocus:H,placeholder:V,inputProps:$},B,R));return m.jsxs(Nt,r({className:Q(fe.root,u),disabled:p,error:v,fullWidth:I,ref:t,required:P,color:c,variant:Z,ownerState:pe},ce,{children:[b!=null&&b!==""&&m.jsx(Yo,r({htmlFor:W,id:oe},F,{children:b})),E?m.jsx(eo,r({"aria-describedby":re,id:W,labelId:oe,value:y,input:se},X,{children:a})):se,h&&m.jsx(To,r({id:re},g,{children:h}))]}))});export{Ro as A,No as F,Te as O,eo as S,wt as T,ee as f,le as i,J as o}; diff --git a/dist/assets/UnderConstruction-D702AE0F.js b/dist/assets/UnderConstruction-BIaq8IYK.js similarity index 91% rename from dist/assets/UnderConstruction-D702AE0F.js rename to dist/assets/UnderConstruction-BIaq8IYK.js index d00f366..87a01f1 100644 --- a/dist/assets/UnderConstruction-D702AE0F.js +++ b/dist/assets/UnderConstruction-BIaq8IYK.js @@ -1 +1 @@ -import{r as o,j as e,i as s,aq as c,B as r,S as l,T as n}from"./index-DpAn5wLF.js";import{d}from"./HomeOutlined-DE-nKXdW.js";import{B as u}from"./Button-BGNvVfej.js";var t={},x=s;Object.defineProperty(t,"__esModule",{value:!0});var a=t.default=void 0,h=x(o()),m=e;a=t.default=(0,h.default)((0,m.jsx)("path",{d:"m13.7826 15.1719 2.1213-2.1213 5.9963 5.9962-2.1213 2.1213zM17.5 10c1.93 0 3.5-1.57 3.5-3.5 0-.58-.16-1.12-.41-1.6l-2.7 2.7-1.49-1.49 2.7-2.7c-.48-.25-1.02-.41-1.6-.41C15.57 3 14 4.57 14 6.5c0 .41.08.8.21 1.16l-1.85 1.85-1.78-1.78.71-.71-1.41-1.41L12 3.49c-1.17-1.17-3.07-1.17-4.24 0L4.22 7.03l1.41 1.41H2.81l-.71.71 3.54 3.54.71-.71V9.15l1.41 1.41.71-.71 1.78 1.78-7.41 7.41 2.12 2.12L16.34 9.79c.36.13.75.21 1.16.21"}),"ConstructionOutlined");function j(){const i=c();return e.jsx(r,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",p:3,textAlign:"center"},children:e.jsxs(l,{spacing:2.5,alignItems:"center",children:[e.jsx(r,{sx:{width:110,height:110,borderRadius:"50%",bgcolor:"primary.lighter",color:"primary.main",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(a,{sx:{fontSize:56}})}),e.jsx(n,{variant:"h3",sx:{fontWeight:700,color:"grey.800"},children:"Under Construction"}),e.jsx(n,{variant:"body1",color:"text.secondary",sx:{maxWidth:460},children:"Hey! Please check out this site later. We are doing some maintenance on it right now."}),e.jsx(u,{variant:"contained",size:"large",startIcon:e.jsx(d,{}),onClick:()=>i("/dashboard"),sx:{mt:1},children:"Back To Home"})]})})}export{j as default}; +import{r as o,j as e,i as s,aq as c,B as r,S as l,T as n}from"./index-D7LVXeIK.js";import{d}from"./HomeOutlined-Bb25CBrJ.js";import{B as u}from"./Button-Bqp5awT1.js";var t={},x=s;Object.defineProperty(t,"__esModule",{value:!0});var a=t.default=void 0,h=x(o()),m=e;a=t.default=(0,h.default)((0,m.jsx)("path",{d:"m13.7826 15.1719 2.1213-2.1213 5.9963 5.9962-2.1213 2.1213zM17.5 10c1.93 0 3.5-1.57 3.5-3.5 0-.58-.16-1.12-.41-1.6l-2.7 2.7-1.49-1.49 2.7-2.7c-.48-.25-1.02-.41-1.6-.41C15.57 3 14 4.57 14 6.5c0 .41.08.8.21 1.16l-1.85 1.85-1.78-1.78.71-.71-1.41-1.41L12 3.49c-1.17-1.17-3.07-1.17-4.24 0L4.22 7.03l1.41 1.41H2.81l-.71.71 3.54 3.54.71-.71V9.15l1.41 1.41.71-.71 1.78 1.78-7.41 7.41 2.12 2.12L16.34 9.79c.36.13.75.21 1.16.21"}),"ConstructionOutlined");function j(){const i=c();return e.jsx(r,{sx:{minHeight:"100vh",display:"flex",alignItems:"center",justifyContent:"center",p:3,textAlign:"center"},children:e.jsxs(l,{spacing:2.5,alignItems:"center",children:[e.jsx(r,{sx:{width:110,height:110,borderRadius:"50%",bgcolor:"primary.lighter",color:"primary.main",display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(a,{sx:{fontSize:56}})}),e.jsx(n,{variant:"h3",sx:{fontWeight:700,color:"grey.800"},children:"Under Construction"}),e.jsx(n,{variant:"body1",color:"text.secondary",sx:{maxWidth:460},children:"Hey! Please check out this site later. We are doing some maintenance on it right now."}),e.jsx(u,{variant:"contained",size:"large",startIcon:e.jsx(d,{}),onClick:()=>i("/dashboard"),sx:{mt:1},children:"Back To Home"})]})})}export{j as default}; diff --git a/dist/assets/VisibilityOff-DwiupP03.js b/dist/assets/VisibilityOff-DxGE-YKE.js similarity index 94% rename from dist/assets/VisibilityOff-DwiupP03.js rename to dist/assets/VisibilityOff-DxGE-YKE.js index 2f6d0c0..784b9db 100644 --- a/dist/assets/VisibilityOff-DwiupP03.js +++ b/dist/assets/VisibilityOff-DxGE-YKE.js @@ -1 +1 @@ -import{r as a,j as r,i}from"./index-DpAn5wLF.js";var e={},l=i;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,s=l(a()),f=r;u=e.default=(0,s.default)((0,f.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility");var t={},c=i;Object.defineProperty(t,"__esModule",{value:!0});var d=t.default=void 0,o=c(a()),v=r;d=t.default=(0,o.default)((0,v.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff");export{u as a,d}; +import{r as a,j as r,i}from"./index-D7LVXeIK.js";var e={},l=i;Object.defineProperty(e,"__esModule",{value:!0});var u=e.default=void 0,s=l(a()),f=r;u=e.default=(0,s.default)((0,f.jsx)("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility");var t={},c=i;Object.defineProperty(t,"__esModule",{value:!0});var d=t.default=void 0,o=c(a()),v=r;d=t.default=(0,o.default)((0,v.jsx)("path",{d:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z"}),"VisibilityOff");export{u as a,d}; diff --git a/dist/assets/index-DpAn5wLF.js b/dist/assets/index-D7LVXeIK.js similarity index 99% rename from dist/assets/index-DpAn5wLF.js rename to dist/assets/index-D7LVXeIK.js index 35fb8bc..d6728a0 100644 --- a/dist/assets/index-DpAn5wLF.js +++ b/dist/assets/index-D7LVXeIK.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-DO4SnFU-.js","assets/Refresh-B8qCgQHN.js","assets/StatusChip-C72vLAK4.js","assets/PageHeader-CEew5Fw4.js","assets/Link-Bme8npFv.js","assets/StatCard-Nzv53jX8.js","assets/EmptyState-BsjYeVAX.js","assets/Button-BGNvVfej.js","assets/TableRow-BcqnvRn2.js","assets/TableCell-PEGz6qo_.js","assets/LinearProgress-CwfnEpKL.js","assets/Tenants-nHqVcNog.js","assets/Close-BdNf_RlN.js","assets/EditOutlined-B2ltVbl8.js","assets/DeleteOutline-BVDDlNca.js","assets/TextField-C0dUZvW0.js","assets/StorefrontOutlined-B0ka2NHy.js","assets/PhoneOutlined-CDgMDTyj.js","assets/LocalShippingOutlined-Ds2yAonP.js","assets/MapOutlined-QidbDh4A.js","assets/TabLabelCount-C_C4hO8i.js","assets/ClientFormDialog-K7w_VS5d.js","assets/Snackbar-B0wJYiYQ.js","assets/InputAdornment-BWnl4jqW.js","assets/Tabs-Cp4sZXyZ.js","assets/Survey-DnRJ0EJJ.js","assets/Pricing-CttgMHSv.js","assets/Bookings-BLIHHfA5.js","assets/FormControlLabel-DwXmo7ko.js","assets/SwitchBase-1TkNOx4a.js","assets/TeamUsers-BPLTRPAZ.js","assets/Settings-5wBismGd.js","assets/VisibilityOff-DwiupP03.js","assets/Login-yAAi8q2k.js","assets/UnderConstruction-D702AE0F.js","assets/HomeOutlined-DE-nKXdW.js","assets/ComingSoon-CX1ajblG.js","assets/Error500-DApcbPUH.js","assets/Error404-BKXchBZ5.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-BLe4n5eQ.js","assets/Refresh-DA6RLQV4.js","assets/StatusChip-B_YdJiMW.js","assets/PageHeader-naLAT9xr.js","assets/Link-BEif5YS2.js","assets/EmptyState-B9FcYx_n.js","assets/Button-Bqp5awT1.js","assets/TableRow-jBgitpDf.js","assets/TableCell-DreGbAeW.js","assets/LinearProgress-yV9HNsZU.js","assets/Tenants-pp9mqXyF.js","assets/Close-D3HB9j5y.js","assets/EditOutlined-DS7hq7Cq.js","assets/DeleteOutline-Dhk3Cr2d.js","assets/TextField-Sd_pshci.js","assets/StorefrontOutlined-Be07_1-Y.js","assets/PhoneOutlined-Uvrb40S4.js","assets/LocalShippingOutlined-C1uYlQnS.js","assets/MapOutlined-CMNX914Q.js","assets/TabLabelCount-1dep75sI.js","assets/ClientFormDialog-Clwkcvac.js","assets/Snackbar-DOheZfWW.js","assets/InputAdornment-CMIlL2rx.js","assets/Tabs-BUgAhQiL.js","assets/Survey-CP7wVFIm.js","assets/Pricing-DDTUtTRz.js","assets/Bookings-BbGscC3O.js","assets/FormControlLabel-Bp5Li47e.js","assets/SwitchBase-CWj2k0Bo.js","assets/TeamUsers-Djs_f-Bi.js","assets/Settings-Cp4ure_x.js","assets/VisibilityOff-DxGE-YKE.js","assets/Login-_QJq_Cs6.js","assets/UnderConstruction-BIaq8IYK.js","assets/HomeOutlined-Bb25CBrJ.js","assets/ComingSoon-CRbMapOp.js","assets/Error500-C7U9zgDa.js","assets/Error404-C6jWFP53.js"])))=>i.map(i=>d[i]); function B1(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var ds=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Kr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Yn(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var gg={exports:{}},cl={},vg={exports:{}},ie={};/** * @license React * react.production.min.js @@ -185,4 +185,4 @@ Error generating stack: `+i.message+` `));return m},[u,h,c,d,i]),S=v.useMemo(()=>g?{minDate:g.date("1900-01-01T00:00:00.000"),maxDate:g.date("2099-12-31T00:00:00.000")}:null,[g]),p=v.useMemo(()=>({utils:g,defaultDates:S,localeText:y}),[S,g,y]);return b.jsx(ug.Provider,{value:p,children:l})},K_=(e,t="warning")=>{let n=!1;const r=Array.isArray(e)?e.join(` `):e;return()=>{n||(n=!0,t==="error"?console.error(r):console.warn(r))}};var h1={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(ds,function(){var n=1e3,r=6e4,o=36e5,i="millisecond",s="second",a="minute",l="hour",u="day",c="week",d="month",h="quarter",x="year",y="date",g="Invalid Date",S=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(j){var O=["th","st","nd","rd"],$=j%100;return"["+j+(O[($-20)%10]||O[$]||O[0])+"]"}},f=function(j,O,$){var I=String(j);return!I||I.length>=O?j:""+Array(O+1-I.length).join($)+j},w={s:f,z:function(j){var O=-j.utcOffset(),$=Math.abs(O),I=Math.floor($/60),T=$%60;return(O<=0?"+":"-")+f(I,2,"0")+":"+f(T,2,"0")},m:function j(O,$){if(O.date()<$.date())return-j($,O);var I=12*($.year()-O.year())+($.month()-O.month()),T=O.clone().add(I,d),L=$-T<0,N=O.clone().add(I+(L?-1:1),d);return+(-(I+($-T)/(L?T-N:N-T))||0)},a:function(j){return j<0?Math.ceil(j)||0:Math.floor(j)},p:function(j){return{M:d,y:x,w:c,d:u,D:y,h:l,m:a,s,ms:i,Q:h}[j]||String(j||"").toLowerCase().replace(/s$/,"")},u:function(j){return j===void 0}},P="en",E={};E[P]=m;var k="$isDayjsObject",_=function(j){return j instanceof A||!(!j||!j[k])},D=function j(O,$,I){var T;if(!O)return P;if(typeof O=="string"){var L=O.toLowerCase();E[L]&&(T=L),$&&(E[L]=$,T=L);var N=O.split("-");if(!T&&N.length>1)return j(N[0])}else{var B=O.name;E[B]=O,T=B}return!I&&T&&(P=T),T||!I&&P},R=function(j,O){if(_(j))return j.clone();var $=typeof O=="object"?O:{};return $.date=j,$.args=arguments,new A($)},M=w;M.l=D,M.i=_,M.w=function(j,O){return R(j,{locale:O.$L,utc:O.$u,x:O.$x,$offset:O.$offset})};var A=function(){function j($){this.$L=D($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[k]=!0}var O=j.prototype;return O.parse=function($){this.$d=function(I){var T=I.date,L=I.utc;if(T===null)return new Date(NaN);if(M.u(T))return new Date;if(T instanceof Date)return new Date(T);if(typeof T=="string"&&!/Z$/i.test(T)){var N=T.match(S);if(N){var B=N[2]-1||0,U=(N[7]||"0").substring(0,3);return L?new Date(Date.UTC(N[1],B,N[3]||1,N[4]||0,N[5]||0,N[6]||0,U)):new Date(N[1],B,N[3]||1,N[4]||0,N[5]||0,N[6]||0,U)}}return new Date(T)}($),this.init()},O.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},O.$utils=function(){return M},O.isValid=function(){return this.$d.toString()!==g},O.isSame=function($,I){var T=R($);return this.startOf(I)<=T&&T<=this.endOf(I)},O.isAfter=function($,I){return R($)25){var c=s(this).startOf(r).add(1,r).date(u),d=s(this).endOf(n);if(c.isBefore(d))return 1}var h=s(this).startOf(r).date(u).startOf(n).subtract(1,"millisecond"),x=this.diff(h,n,!0);return x<0?s(this).startOf("week").week():Math.ceil(x)},a.weeks=function(l){return l===void 0&&(l=null),this.week(l)}}})})(m1);var Q_=m1.exports;const X_=Kr(Q_);var g1={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(ds,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,o=/\d/,i=/\d\d/,s=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,l={},u=function(S){return(S=+S)+(S>68?1900:2e3)},c=function(S){return function(p){this[S]=+p}},d=[/[+-]\d\d:?(\d\d)?|Z/,function(S){(this.zone||(this.zone={})).offset=function(p){if(!p||p==="Z")return 0;var m=p.match(/([+-]|\d\d)/g),f=60*m[1]+(+m[2]||0);return f===0?0:m[0]==="+"?-f:f}(S)}],h=function(S){var p=l[S];return p&&(p.indexOf?p:p.s.concat(p.f))},x=function(S,p){var m,f=l.meridiem;if(f){for(var w=1;w<=24;w+=1)if(S.indexOf(f(w,0,p))>-1){m=w>12;break}}else m=S===(p?"pm":"PM");return m},y={A:[a,function(S){this.afternoon=x(S,!1)}],a:[a,function(S){this.afternoon=x(S,!0)}],Q:[o,function(S){this.month=3*(S-1)+1}],S:[o,function(S){this.milliseconds=100*+S}],SS:[i,function(S){this.milliseconds=10*+S}],SSS:[/\d{3}/,function(S){this.milliseconds=+S}],s:[s,c("seconds")],ss:[s,c("seconds")],m:[s,c("minutes")],mm:[s,c("minutes")],H:[s,c("hours")],h:[s,c("hours")],HH:[s,c("hours")],hh:[s,c("hours")],D:[s,c("day")],DD:[i,c("day")],Do:[a,function(S){var p=l.ordinal,m=S.match(/\d+/);if(this.day=m[0],p)for(var f=1;f<=31;f+=1)p(f).replace(/\[|\]/g,"")===S&&(this.day=f)}],w:[s,c("week")],ww:[i,c("week")],M:[s,c("month")],MM:[i,c("month")],MMM:[a,function(S){var p=h("months"),m=(h("monthsShort")||p.map(function(f){return f.slice(0,3)})).indexOf(S)+1;if(m<1)throw new Error;this.month=m%12||m}],MMMM:[a,function(S){var p=h("months").indexOf(S)+1;if(p<1)throw new Error;this.month=p%12||p}],Y:[/[+-]?\d+/,c("year")],YY:[i,function(S){this.year=u(S)}],YYYY:[/\d{4}/,c("year")],Z:d,ZZ:d};function g(S){var p,m;p=S,m=l&&l.formats;for(var f=(S=p.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(R,M,A){var z=A&&A.toUpperCase();return M||m[A]||n[A]||m[z].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(j,O,$){return O||$.slice(1)})})).match(r),w=f.length,P=0;P-1)return new Date((T==="X"?1e3:1)*I);var B=g(T)(I),U=B.year,q=B.month,V=B.day,G=B.hours,W=B.minutes,Z=B.seconds,te=B.milliseconds,Q=B.zone,re=B.week,K=new Date,ce=V||(U||q?1:K.getDate()),X=U||K.getFullYear(),se=0;U&&!q||(se=q>0?q-1:K.getMonth());var oe,rt=G||0,Ve=W||0,Le=Z||0,ft=te||0;return Q?new Date(Date.UTC(X,se,ce,rt,Ve,Le,ft+60*Q.offset*1e3)):L?new Date(Date.UTC(X,se,ce,rt,Ve,Le,ft)):(oe=new Date(X,se,ce,rt,Ve,Le,ft),re&&(oe=N(oe).week(re).toDate()),oe)}catch{return new Date("")}}(E,D,k,m),this.init(),z&&z!==!0&&(this.$L=this.locale(z).$L),A&&E!=this.format(D)&&(this.$d=new Date("")),l={}}else if(D instanceof Array)for(var j=D.length,O=1;O<=j;O+=1){_[1]=D[O-1];var $=m.apply(this,_);if($.isValid()){this.$d=$.$d,this.$L=$.$L,this.init();break}O===j&&(this.$d=new Date(""))}else w.call(this,P)}}})})(g1);var q_=g1.exports;const Z_=Kr(q_);var v1={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(ds,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,o,i){var s=o.prototype,a=s.format;i.en.formats=n,s.format=function(l){l===void 0&&(l="YYYY-MM-DDTHH:mm:ssZ");var u=this.$locale().formats,c=function(d,h){return d.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(x,y,g){var S=g&&g.toUpperCase();return y||h[g]||n[g]||h[S].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(p,m,f){return m||f.slice(1)})})}(l,u===void 0?{}:u);return a.call(this,c)}}})})(v1);var J_=v1.exports;const eM=Kr(J_);var y1={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(ds,function(){return function(n,r,o){r.prototype.isBetween=function(i,s,a,l){var u=o(i),c=o(s),d=(l=l||"()")[0]==="(",h=l[1]===")";return(d?this.isAfter(u,a):!this.isBefore(u,a))&&(h?this.isBefore(c,a):!this.isAfter(c,a))||(d?this.isBefore(u,a):!this.isAfter(u,a))&&(h?this.isAfter(c,a):!this.isBefore(c,a))}}})})(y1);var tM=y1.exports;const nM=Kr(tM);lt.extend(Z_);lt.extend(eM);lt.extend(nM);const rM=K_(["Your locale has not been found.","Either the locale key is not a supported one. Locales supported by dayjs are available here: https://github.com/iamkun/dayjs/tree/dev/src/locale","Or you forget to import the locale from 'dayjs/locale/{localeUsed}'","fallback on English locale"]),oM={YY:"year",YYYY:{sectionType:"year",contentType:"digit",maxLength:4},M:{sectionType:"month",contentType:"digit",maxLength:2},MM:"month",MMM:{sectionType:"month",contentType:"letter"},MMMM:{sectionType:"month",contentType:"letter"},D:{sectionType:"day",contentType:"digit",maxLength:2},DD:"day",Do:{sectionType:"day",contentType:"digit-with-letter"},d:{sectionType:"weekDay",contentType:"digit",maxLength:2},dd:{sectionType:"weekDay",contentType:"letter"},ddd:{sectionType:"weekDay",contentType:"letter"},dddd:{sectionType:"weekDay",contentType:"letter"},A:"meridiem",a:"meridiem",H:{sectionType:"hours",contentType:"digit",maxLength:2},HH:"hours",h:{sectionType:"hours",contentType:"digit",maxLength:2},hh:"hours",m:{sectionType:"minutes",contentType:"digit",maxLength:2},mm:"minutes",s:{sectionType:"seconds",contentType:"digit",maxLength:2},ss:"seconds"},iM={year:"YYYY",month:"MMMM",monthShort:"MMM",dayOfMonth:"D",weekday:"dddd",weekdayShort:"dd",hours24h:"HH",hours12h:"hh",meridiem:"A",minutes:"mm",seconds:"ss",fullDate:"ll",fullDateWithWeekday:"dddd, LL",keyboardDate:"L",shortDate:"MMM D",normalDate:"D MMMM",normalDateWithWeekday:"ddd, MMM D",monthAndYear:"MMMM YYYY",monthAndDate:"MMMM D",fullTime:"LT",fullTime12h:"hh:mm A",fullTime24h:"HH:mm",fullDateTime:"lll",fullDateTime12h:"ll hh:mm A",fullDateTime24h:"ll HH:mm",keyboardDateTime:"L LT",keyboardDateTime12h:"L hh:mm A",keyboardDateTime24h:"L HH:mm"},rc=["Missing UTC plugin","To be able to use UTC or timezones, you have to enable the `utc` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-utc"].join(` `),cg=["Missing timezone plugin","To be able to use timezones, you have to enable both the `utc` and the `timezone` plugin","Find more information on https://mui.com/x/react-date-pickers/timezone/#day-js-and-timezone"].join(` -`),sM=(e,t)=>t?(...n)=>e(...n).locale(t):e;class aM{constructor({locale:t,formats:n,instance:r}={}){var o;this.isMUIAdapter=!0,this.isTimezoneCompatible=!0,this.lib="dayjs",this.rawDayJsInstance=void 0,this.dayjs=void 0,this.locale=void 0,this.formats=void 0,this.escapedCharacters={start:"[",end:"]"},this.formatTokenMap=oM,this.setLocaleToValue=i=>{const s=this.getCurrentLocaleCode();return s===i.locale()?i:i.locale(s)},this.hasUTCPlugin=()=>typeof lt.utc<"u",this.hasTimezonePlugin=()=>typeof lt.tz<"u",this.isSame=(i,s,a)=>{const l=this.setTimezone(s,this.getTimezone(i));return i.format(a)===l.format(a)},this.cleanTimezone=i=>{switch(i){case"default":return;case"system":return lt.tz.guess();default:return i}},this.createSystemDate=i=>{if(this.rawDayJsInstance)return this.rawDayJsInstance(i);if(this.hasUTCPlugin()&&this.hasTimezonePlugin()){const s=lt.tz.guess();return s!=="UTC"?lt.tz(i,s):lt(i)}return lt(i)},this.createUTCDate=i=>{if(!this.hasUTCPlugin())throw new Error(rc);return lt.utc(i)},this.createTZDate=(i,s)=>{if(!this.hasUTCPlugin())throw new Error(rc);if(!this.hasTimezonePlugin())throw new Error(cg);const a=i!==void 0&&!i.endsWith("Z");return lt(i).tz(this.cleanTimezone(s),a)},this.getLocaleFormats=()=>{const i=lt.Ls,s=this.locale||"en";let a=i[s];return a===void 0&&(rM(),a=i.en),a.formats},this.adjustOffset=i=>{if(!this.hasTimezonePlugin())return i;const s=this.getTimezone(i);if(s!=="UTC"){var a,l;const u=i.tz(this.cleanTimezone(s),!0);if(((a=u.$offset)!=null?a:0)===((l=i.$offset)!=null?l:0))return i;i.$offset=u.$offset}return i},this.date=i=>i===null?null:this.dayjs(i),this.dateWithTimezone=(i,s)=>{if(i===null)return null;let a;return s==="UTC"?a=this.createUTCDate(i):s==="system"||s==="default"&&!this.hasTimezonePlugin()?a=this.createSystemDate(i):a=this.createTZDate(i,s),this.locale===void 0?a:a.locale(this.locale)},this.getTimezone=i=>{if(this.hasTimezonePlugin()){var s;const a=(s=i.$x)==null?void 0:s.$timezone;if(a)return a}return this.hasUTCPlugin()&&i.isUTC()?"UTC":"system"},this.setTimezone=(i,s)=>{if(this.getTimezone(i)===s)return i;if(s==="UTC"){if(!this.hasUTCPlugin())throw new Error(rc);return i.utc()}if(s==="system")return i.local();if(!this.hasTimezonePlugin()){if(s==="default")return i;throw new Error(cg)}return lt.tz(i,this.cleanTimezone(s))},this.toJsDate=i=>i.toDate(),this.parseISO=i=>this.dayjs(i),this.toISO=i=>i.toISOString(),this.parse=(i,s)=>i===""?null:this.dayjs(i,s,this.locale,!0),this.getCurrentLocaleCode=()=>this.locale||"en",this.is12HourCycleInCurrentLocale=()=>/A|a/.test(this.getLocaleFormats().LT||""),this.expandFormat=i=>{const s=this.getLocaleFormats(),a=l=>l.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(u,c,d)=>c||d.slice(1));return i.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(l,u,c)=>{const d=c&&c.toUpperCase();return u||s[c]||a(s[d])})},this.getFormatHelperText=i=>this.expandFormat(i).replace(/a/gi,"(a|p)m").toLocaleLowerCase(),this.isNull=i=>i===null,this.isValid=i=>this.dayjs(i).isValid(),this.format=(i,s)=>this.formatByString(i,this.formats[s]),this.formatByString=(i,s)=>this.dayjs(i).format(s),this.formatNumber=i=>i,this.getDiff=(i,s,a)=>i.diff(s,a),this.isEqual=(i,s)=>i===null&&s===null?!0:this.dayjs(i).toDate().getTime()===this.dayjs(s).toDate().getTime(),this.isSameYear=(i,s)=>this.isSame(i,s,"YYYY"),this.isSameMonth=(i,s)=>this.isSame(i,s,"YYYY-MM"),this.isSameDay=(i,s)=>this.isSame(i,s,"YYYY-MM-DD"),this.isSameHour=(i,s)=>i.isSame(s,"hour"),this.isAfter=(i,s)=>i>s,this.isAfterYear=(i,s)=>this.hasUTCPlugin()?!this.isSameYear(i,s)&&i.utc()>s.utc():i.isAfter(s,"year"),this.isAfterDay=(i,s)=>this.hasUTCPlugin()?!this.isSameDay(i,s)&&i.utc()>s.utc():i.isAfter(s,"day"),this.isBefore=(i,s)=>ithis.hasUTCPlugin()?!this.isSameYear(i,s)&&i.utc()this.hasUTCPlugin()?!this.isSameDay(i,s)&&i.utc()i>=s&&i<=a,this.startOfYear=i=>this.adjustOffset(i.startOf("year")),this.startOfMonth=i=>this.adjustOffset(i.startOf("month")),this.startOfWeek=i=>this.adjustOffset(i.startOf("week")),this.startOfDay=i=>this.adjustOffset(i.startOf("day")),this.endOfYear=i=>this.adjustOffset(i.endOf("year")),this.endOfMonth=i=>this.adjustOffset(i.endOf("month")),this.endOfWeek=i=>this.adjustOffset(i.endOf("week")),this.endOfDay=i=>this.adjustOffset(i.endOf("day")),this.addYears=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"year"):i.add(s,"year")),this.addMonths=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"month"):i.add(s,"month")),this.addWeeks=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"week"):i.add(s,"week")),this.addDays=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"day"):i.add(s,"day")),this.addHours=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"hour"):i.add(s,"hour")),this.addMinutes=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"minute"):i.add(s,"minute")),this.addSeconds=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"second"):i.add(s,"second")),this.getYear=i=>i.year(),this.getMonth=i=>i.month(),this.getDate=i=>i.date(),this.getHours=i=>i.hour(),this.getMinutes=i=>i.minute(),this.getSeconds=i=>i.second(),this.getMilliseconds=i=>i.millisecond(),this.setYear=(i,s)=>this.adjustOffset(i.set("year",s)),this.setMonth=(i,s)=>this.adjustOffset(i.set("month",s)),this.setDate=(i,s)=>this.adjustOffset(i.set("date",s)),this.setHours=(i,s)=>this.adjustOffset(i.set("hour",s)),this.setMinutes=(i,s)=>this.adjustOffset(i.set("minute",s)),this.setSeconds=(i,s)=>this.adjustOffset(i.set("second",s)),this.setMilliseconds=(i,s)=>this.adjustOffset(i.set("millisecond",s)),this.getDaysInMonth=i=>i.daysInMonth(),this.getNextMonth=i=>this.addMonths(i,1),this.getPreviousMonth=i=>this.addMonths(i,-1),this.getMonthArray=i=>{const a=[i.startOf("year")];for(;a.length<12;){const l=a[a.length-1];a.push(this.addMonths(l,1))}return a},this.mergeDateAndTime=(i,s)=>i.hour(s.hour()).minute(s.minute()).second(s.second()),this.getWeekdays=()=>{const i=this.dayjs().startOf("week");return[0,1,2,3,4,5,6].map(s=>this.formatByString(this.addDays(i,s),"dd"))},this.getWeekArray=i=>{const s=this.setLocaleToValue(i),a=s.startOf("month").startOf("week"),l=s.endOf("month").endOf("week");let u=0,c=a;const d=[];for(;ci.week(),this.getYearRange=(i,s)=>{const a=i.startOf("year"),l=s.endOf("year"),u=[];let c=a;for(;ci==="am"?"AM":"PM",this.rawDayJsInstance=r,this.dayjs=sM((o=this.rawDayJsInstance)!=null?o:lt,t),this.locale=t,this.formats=C({},iM,n),lt.extend(X_)}}const Ne={0:"#FFFFFF",50:"#FAFAFA",100:"#F5F5F5",200:"#F0F0F0",300:"#D9D9D9",400:"#BFBFBF",500:"#8C8C8C",600:"#595959",700:"#434343",800:"#262626",900:"#141414",A50:"#FAFAFB",A100:"#E6EBF1"},lM={mode:"light",common:{black:"#000000",white:"#FFFFFF"},primary:{lighter:"#F8E0E3",100:"#EFBBC1",200:"#E08A92",light:"#D6515C",400:"#CC2E3C",main:"#C01227",dark:"#9E0E20",700:"#870C1B",darker:"#7E0B17",900:"#520710",contrastText:"#FFFFFF"},secondary:{lighter:Ne[100],100:Ne[100],200:Ne[200],light:Ne[300],400:Ne[400],main:Ne[500],600:Ne[600],dark:Ne[700],800:Ne[800],darker:Ne[900],A100:Ne[0],A200:Ne[400],A300:Ne[700],contrastText:Ne[0]},error:{lighter:"#FEEAE9",light:"#F88078",main:"#F04134",dark:"#A82216",darker:"#7A150C",contrastText:"#FFFFFF"},warning:{lighter:"#FFF7E0",light:"#FFD666",main:"#FFBF00",dark:"#B38600",darker:"#805F00",contrastText:"#262626"},info:{lighter:"#E0F7F8",light:"#66CBD2",main:"#00A2AE",dark:"#00727B",darker:"#005159",contrastText:"#FFFFFF"},success:{lighter:"#E3F6EC",light:"#5CC98C",main:"#00A854",dark:"#00773B",darker:"#00552A",contrastText:"#FFFFFF"},grey:Ne,text:{primary:Ne[800],secondary:Ne[600],disabled:Ne[400]},action:{disabled:Ne[300],hover:"rgba(192, 18, 39, 0.04)",selected:"rgba(192, 18, 39, 0.08)"},divider:Ne[200],background:{paper:"#FFFFFF",default:Ne.A50}},uM={fontFamily:'"Public Sans", "Inter", "Helvetica", "Arial", sans-serif',htmlFontSize:16,fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:600,h1:{fontWeight:700,fontSize:"2.375rem",lineHeight:1.21},h2:{fontWeight:700,fontSize:"1.875rem",lineHeight:1.27},h3:{fontWeight:600,fontSize:"1.5rem",lineHeight:1.33},h4:{fontWeight:600,fontSize:"1.25rem",lineHeight:1.4},h5:{fontWeight:600,fontSize:"1rem",lineHeight:1.5},h6:{fontWeight:500,fontSize:"0.875rem",lineHeight:1.57},caption:{fontWeight:400,fontSize:"0.75rem",lineHeight:1.66},body1:{fontSize:"0.875rem",lineHeight:1.57},body2:{fontSize:"0.75rem",lineHeight:1.66},subtitle1:{fontSize:"0.875rem",fontWeight:600,lineHeight:1.57},subtitle2:{fontSize:"0.75rem",fontWeight:500,lineHeight:1.66},overline:{fontSize:"0.6875rem",fontWeight:600,letterSpacing:"0.08em",textTransform:"uppercase"},button:{textTransform:"capitalize",fontWeight:600}},bi={card:"0px 1px 4px rgba(0, 0, 0, 0.08)",cardHover:"0px 4px 16px rgba(0, 0, 0, 0.10)",widget:"0px 2px 14px rgba(38, 38, 38, 0.06)",dropdown:"0px 8px 24px rgba(38, 38, 38, 0.12)",primaryGlow:"0px 6px 16px rgba(192, 18, 39, 0.28)",primaryGlowHover:"0px 8px 20px rgba(192, 18, 39, 0.36)",header:"0px 1px 0px rgba(0, 0, 0, 0.06)"};function cM(e){const{palette:t}=e;return{MuiCssBaseline:{styleOverrides:{body:{backgroundColor:t.background.default},"*::-webkit-scrollbar":{width:8,height:8},"*::-webkit-scrollbar-thumb":{background:t.grey[300],borderRadius:8},"*::-webkit-scrollbar-thumb:hover":{background:t.grey[400]}}},MuiButton:{defaultProps:{disableElevation:!0},styleOverrides:{root:{borderRadius:6,fontWeight:600,padding:"7px 18px"},containedPrimary:{boxShadow:bi.primaryGlow,"&:hover":{boxShadow:bi.primaryGlowHover,backgroundColor:t.primary.dark}},outlined:{borderColor:t.grey[300]},sizeLarge:{padding:"10px 22px",fontSize:"0.9375rem"}}},MuiIconButton:{styleOverrides:{root:{borderRadius:8}}},MuiCard:{styleOverrides:{root:{borderRadius:10,border:`1px solid ${t.grey[200]}`,boxShadow:bi.card,backgroundImage:"none"}}},MuiCardHeader:{defaultProps:{titleTypographyProps:{variant:"h5"},subheaderTypographyProps:{variant:"caption"}},styleOverrides:{root:{padding:20}}},MuiCardContent:{styleOverrides:{root:{padding:20,"&:last-child":{paddingBottom:20}}}},MuiPaper:{defaultProps:{elevation:0},styleOverrides:{rounded:{borderRadius:10}}},MuiChip:{styleOverrides:{root:{borderRadius:6,fontWeight:600,fontSize:"0.75rem"},sizeSmall:{height:22},label:{paddingLeft:8,paddingRight:8}}},MuiTableCell:{styleOverrides:{root:{borderColor:t.grey[200],padding:"12px 16px",fontSize:"0.8125rem"},head:{fontWeight:600,color:t.grey[600],backgroundColor:t.grey[50],textTransform:"none",whiteSpace:"nowrap"}}},MuiTableRow:{styleOverrides:{root:{"&:hover":{backgroundColor:t.primary.lighter+"66"}}}},MuiOutlinedInput:{styleOverrides:{root:{borderRadius:8,backgroundColor:t.background.paper,"& .MuiOutlinedInput-notchedOutline":{borderColor:t.grey[300]},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:t.grey[400]}},input:{padding:"11px 14px"}}},MuiInputLabel:{styleOverrides:{root:{color:t.grey[600],fontSize:"0.875rem"}}},MuiTab:{styleOverrides:{root:{textTransform:"none",fontWeight:600,minHeight:46,fontSize:"0.875rem"}}},MuiTabs:{styleOverrides:{indicator:{height:3,borderRadius:3}}},MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:t.grey[800],borderRadius:6,fontSize:"0.75rem",padding:"6px 10px"}}},MuiDialog:{styleOverrides:{paper:{borderRadius:12}}},MuiAvatar:{styleOverrides:{root:{fontWeight:600,fontSize:"0.875rem"}}},MuiListItemButton:{styleOverrides:{root:{borderRadius:8}}},MuiLinearProgress:{styleOverrides:{root:{borderRadius:8,height:6,backgroundColor:t.grey[200]}}},MuiMenu:{styleOverrides:{paper:{borderRadius:10,boxShadow:bi.dropdown,marginTop:4}}}}}let wd=Xf({palette:lM,typography:uM,shape:{borderRadius:6},customShadows:bi,mixins:{toolbar:{minHeight:64}}});wd.components=cM(wd);const dM="modulepreload",fM=function(e){return"/"+e},dg={},Ot=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.allSettled(n.map(l=>{if(l=fM(l),l in dg)return;dg[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":dM,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((h,x)=>{d.addEventListener("load",h),d.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};var dp={},oc={};const pM=Yn(Hb);var fg;function En(){return fg||(fg=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=pM}(oc)),oc}var hM=Vt;Object.defineProperty(dp,"__esModule",{value:!0});var x1=dp.default=void 0,mM=hM(En()),gM=b;x1=dp.default=(0,mM.default)((0,gM.jsx)("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu");var fp={},vM=Vt;Object.defineProperty(fp,"__esModule",{value:!0});var Sd=fp.default=void 0,yM=vM(En()),xM=b;Sd=fp.default=(0,yM.default)((0,xM.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search");var pp={},wM=Vt;Object.defineProperty(pp,"__esModule",{value:!0});var hp=pp.default=void 0,SM=wM(En()),EM=b;hp=pp.default=(0,SM.default)((0,EM.jsx)("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.09-.16-.26-.25-.44-.25-.06 0-.12.01-.17.03l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.06-.02-.12-.03-.18-.03-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.09.16.26.25.44.25.06 0 .12-.01.17-.03l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"SettingsOutlined");var mp={},CM=Vt;Object.defineProperty(mp,"__esModule",{value:!0});var w1=mp.default=void 0,kM=CM(En()),bM=b;w1=mp.default=(0,kM.default)((0,bM.jsx)("path",{d:"m17 7-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4z"}),"Logout");const PM="/Doormile-logo.png";function S1({onDark:e=!1,compact:t=!1,height:n=26,sx:r}){if(t){const o=e?"#FFFFFF":"#C01227",i=e?"#C01227":"#FFFFFF";return b.jsx(Ce,{sx:{display:"flex",alignItems:"center",...r},children:b.jsx(Ce,{sx:{width:34,height:34,borderRadius:2,bgcolor:o,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxShadow:e?"none":"0 4px 10px rgba(192, 18, 39,0.30)"},children:b.jsx(jt,{sx:{color:i,fontWeight:800,fontSize:"1.25rem",lineHeight:1},children:"D"})})})}return b.jsx(Ce,{sx:{display:"flex",alignItems:"center",...r},children:b.jsx(Ce,{component:"img",src:PM,alt:"Doormile",sx:{height:n,width:"auto",display:"block",filter:e?"none":"brightness(0) saturate(100%) invert(15%) sepia(93%) saturate(5437%) hue-rotate(346deg) brightness(81%) contrast(92%)"}})})}const fO=e=>String(e||"").replace(/[_-]+/g," ").replace(/([a-z\d])([A-Z])/g,"$1 $2").replace(/\s+/g," ").replace(/\b\w/g,t=>t.toUpperCase()).trim(),TM=(e="")=>{let t=0;for(let r=0;re.split(" ").filter(Boolean).slice(0,2).map(t=>t[0]).join("").toUpperCase();function $M({name:e="",size:t=32,sx:n}){return b.jsx(yd,{sx:{width:t,height:t,bgcolor:TM(e),fontSize:t*.42,...n},children:RM(e)})}const In="https://api.doormile.com/api/v1",Qn=()=>{const e=localStorage.getItem("auth_token");return{"Content-Type":"application/json",...e?{Authorization:`Bearer ${e}`}:{}}},Jr=e=>e.status===204?{}:e.json().catch(()=>({})),E1=e=>Array.isArray(e)?e:Array.isArray(e==null?void 0:e.data)?e.data:[];async function _M(){const e=await fetch(`${In}/crm/clients?limit=1000`,{headers:Qn()});if(!e.ok)throw new Error("Failed to fetch clients");const t=await e.json();return E1(t)}async function pO(e,t){const n=await fetch(`${In}/admin/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:t})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||"Failed to login")}return n.json()}async function hO(e){const t=await fetch(`${In}/crm/clients`,{method:"POST",headers:Qn(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Error(n.error||n.message||"Failed to create client")}return Jr(t)}async function mO(e,t){const n=await fetch(`${In}/crm/clients/${e}`,{method:"PUT",headers:Qn(),body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||r.message||"Failed to update client")}return Jr(n)}async function gO(e){const t=await fetch(`${In}/crm/clients/${e}`,{method:"DELETE",headers:Qn()});if(!t.ok)throw new Error("Failed to delete client");return Jr(t)}async function MM(){const e=await fetch(`${In}/admin/users?limit=1000`,{headers:Qn()});if(!e.ok)throw new Error("Failed to fetch users");const t=await e.json();return E1(t)}async function vO(e){const t=await fetch(`${In}/admin/users`,{method:"POST",headers:Qn(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Error(n.error||n.message||"Failed to create user")}return Jr(t)}async function yO(e,t){const n=await fetch(`${In}/admin/users/${e}`,{method:"PUT",headers:Qn(),body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||r.message||"Failed to update user")}return Jr(n)}async function xO(e){const t=await fetch(`${In}/admin/users/${e}`,{method:"DELETE",headers:Qn()});if(!t.ok)throw new Error("Failed to delete user");return Jr(t)}async function wO(e){const t=await fetch(`${In}/admin/competitor-branches/${e}`,{method:"DELETE",headers:Qn()});if(!t.ok)throw new Error("Failed to delete survey record");return Jr(t)}const OM=e=>"CLI-"+String(e).replace(/[^a-zA-Z0-9]/g,"").toUpperCase().substring(0,6).padStart(6,"0");function LM(e){const t=e.payload??e,n=t.id??e.id,r=OM(n);return{id:n,logicalId:r,clientId:r,name:t.first_name?`${t.first_name} ${t.last_name||""}`.trim():t.name||"—",email:t.email||"",phone:t.phone||"",city:t.city||"",businessState:t.businessState||"",businessType:t.businessType||"",status:t.status||"unknown",parcelVolume:Number(t.parcelVolume)||0,activeContracts:Number(t.activeContracts)||0,frequency:t.frequency||"",provider:t.provider||"",efficiency:t.efficiency||"",logisticsSegment:t.logisticsSegment||"",transitFrom:t.transitFrom||"",transitTo:t.transitTo||"",neighbourhood:t.neighbourhood||t.surveyZone||"",surveyAddress:t.surveyAddress||t.address||"",surveyLat:t.survey_lat??t.surveyLat??"",surveyLng:t.survey_long??t.surveyLng??"",dataConsent:t.dataConsent||"",lastUpdated:t.lastUpdated||"",pincode:t.pincode||t.postal_code||"",notes:t.notes||""}}function SO(e){const t=e.payload??e;return{id:t.id??e.id,name:t.first_name?`${t.first_name} ${t.last_name||""}`.trim():t.name||"—",email:t.email||"",phone:t.phone||"",role:t.role||"unknown",pin:t.pin||""}}const pg="#C01227";function IM({onToggle:e}){var R;const t=Ko(),[n,r]=v.useState(null),[o,i]=v.useState("");let s={name:"Admin",role:"Operations Admin",id:0};try{const M=localStorage.getItem("user");M&&(s=JSON.parse(M))}catch{}const[a,l]=v.useState(s.name||"Admin"),u=s.role==="admin"?"Administrator":s.role==="manager"?"Manager":s.role==="executive"?"Executive":"Operations Admin",c=a.charAt(0).toUpperCase(),d=v.useRef(null),[h,x]=v.useState([]),[y,g]=v.useState(!1),[S,p]=v.useState(!1),[m,f]=v.useState(!1);v.useEffect(()=>{MM().then(M=>{if(s.email){const A=M.find(z=>z.email===s.email);if(A&&A.first_name){l(A.first_name);const z={...s,name:A.first_name};localStorage.setItem("user",JSON.stringify(z))}}}).catch(console.error)},[]);const w=()=>{y||S||(p(!0),_M().then(M=>x(M.map(LM))).catch(()=>{}).finally(()=>{g(!0),p(!1)}))},P=o.trim().toLowerCase(),E=P?h.filter(M=>[M.name,M.city,M.businessType,M.phone].join(" ").toLowerCase().includes(P)).slice(0,6):[],k=M=>{i(M.target.value),w(),f(!0)},_=M=>{t(`/tenants?q=${encodeURIComponent(M)}`),i(""),f(!1)},D=M=>{M.preventDefault();const A=o.trim();A&&_(A)};return b.jsx(WP,{position:"fixed",elevation:0,sx:{bgcolor:"#fff",color:"grey.800",zIndex:M=>M.zIndex.drawer+1,borderBottom:1,borderColor:"divider"},children:b.jsxs(cp,{sx:{minHeight:64,px:{xs:1.5,sm:2.5},gap:1},children:[b.jsx(MP,{color:"inherit",edge:"start",onClick:e,sx:{mr:.5},children:b.jsx(x1,{})}),b.jsx(Ce,{onClick:()=>t("/dashboard"),sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:b.jsx(S1,{height:22})}),b.jsx(Ce,{sx:{flexGrow:1}}),b.jsx(t$,{onClickAway:()=>f(!1),children:b.jsxs(Ce,{sx:{display:{xs:"none",sm:"block"},position:"relative"},children:[b.jsxs(Ce,{ref:d,component:"form",onSubmit:D,sx:{display:"flex",alignItems:"center",bgcolor:"grey.100",borderRadius:2,px:1.5,py:.5,width:{sm:240,md:320},"&:hover":{bgcolor:"grey.200"},"&:focus-within":{bgcolor:"grey.200"}},children:[b.jsx(Sd,{sx:{fontSize:20,mr:1,color:"grey.500"}}),b.jsx(TR,{value:o,onChange:k,onFocus:()=>{w(),o.trim()&&f(!0)},placeholder:"Search clients…",sx:{color:"grey.800",fontSize:"0.875rem",flex:1,"&::placeholder":{color:"grey.500"}},inputProps:{"aria-label":"search"}})]}),b.jsx(up,{open:m&&!!P,anchorEl:d.current,placement:"bottom-start",style:{zIndex:1400,width:(R=d.current)==null?void 0:R.offsetWidth},children:b.jsx(uu,{sx:{mt:1,borderRadius:2,overflow:"hidden",boxShadow:"0 8px 24px rgba(0,0,0,0.18)"},children:S&&E.length===0?b.jsx(Ce,{sx:{display:"flex",justifyContent:"center",py:2.5},children:b.jsx(o1,{size:20})}):E.length===0?b.jsx(Ce,{sx:{px:2,py:2},children:b.jsxs(jt,{variant:"body2",color:"text.secondary",children:["No clients match “",o.trim(),"”."]})}):b.jsxs(b.Fragment,{children:[E.map(M=>b.jsxs(ea,{onClick:()=>_(M.name),sx:{py:1,gap:1.25},children:[b.jsx($M,{name:M.name,size:30}),b.jsxs(Ce,{sx:{minWidth:0},children:[b.jsx(jt,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},noWrap:!0,children:M.name}),b.jsx(jt,{variant:"caption",color:"text.secondary",noWrap:!0,children:[M.businessType,M.city].filter(Boolean).join(" · ")||M.phone})]})]},M.id)),b.jsx(Ea,{}),b.jsxs(ea,{onClick:()=>_(o.trim()),sx:{py:1.25,color:"primary.main",fontWeight:600},children:[b.jsx(Sd,{fontSize:"small",sx:{mr:1}}),"See all results for “",o.trim(),"”"]})]})})})]})}),b.jsxs(Ce,{onClick:M=>r(M.currentTarget),sx:{display:"flex",alignItems:"center",gap:1,ml:.5,cursor:"pointer",py:.5,px:.5,borderRadius:2,"&:hover":{bgcolor:"grey.100"}},children:[b.jsx(yd,{sx:{width:34,height:34,bgcolor:pg,color:"#fff",fontWeight:700},children:c}),b.jsxs(Ce,{sx:{display:{xs:"none",md:"block"},lineHeight:1.1},children:[b.jsx(jt,{variant:"subtitle2",sx:{color:"grey.800",fontWeight:600},children:a}),b.jsx(jt,{variant:"caption",sx:{color:"text.secondary",textTransform:"capitalize"},children:u})]})]}),b.jsxs(R_,{anchorEl:n,open:!!n,onClose:()=>r(null),transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},PaperProps:{sx:{mt:1,minWidth:220}},children:[b.jsx(Ce,{sx:{px:2,py:1.5},children:b.jsxs(H$,{direction:"row",spacing:1.5,alignItems:"center",children:[b.jsx(yd,{sx:{width:38,height:38,bgcolor:pg,color:"#fff",fontWeight:700},children:c}),b.jsxs(Ce,{sx:{lineHeight:1.2},children:[b.jsx(jt,{variant:"subtitle2",sx:{fontWeight:700},children:a}),b.jsx(jt,{variant:"caption",color:"text.secondary",sx:{textTransform:"capitalize"},children:u})]})]})}),b.jsx(Ea,{}),b.jsxs(ea,{onClick:()=>{r(null),t("/settings")},children:[b.jsx(ll,{children:b.jsx(hp,{fontSize:"small"})}),"Settings"]}),b.jsx(Ea,{}),b.jsxs(ea,{onClick:()=>{r(null),localStorage.removeItem("auth_token"),t("/login")},sx:{color:"error.main"},children:[b.jsx(ll,{children:b.jsx(w1,{fontSize:"small",color:"error"})}),"Logout"]})]})]})})}var gp={},jM=Vt;Object.defineProperty(gp,"__esModule",{value:!0});var C1=gp.default=void 0,DM=jM(En()),AM=b;C1=gp.default=(0,DM.default)((0,AM.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");var vp={},NM=Vt;Object.defineProperty(vp,"__esModule",{value:!0});var k1=vp.default=void 0,zM=NM(En()),FM=b;k1=vp.default=(0,zM.default)((0,FM.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");var yp={},BM=Vt;Object.defineProperty(yp,"__esModule",{value:!0});var b1=yp.default=void 0,WM=BM(En()),UM=b;b1=yp.default=(0,WM.default)((0,UM.jsx)("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord");var xp={},HM=Vt;Object.defineProperty(xp,"__esModule",{value:!0});var Ca=xp.default=void 0,VM=HM(En()),YM=b;Ca=xp.default=(0,VM.default)((0,YM.jsx)("path",{d:"M19 5v2h-4V5zM9 5v6H5V5zm10 8v6h-4v-6zM9 17v2H5v-2zM21 3h-8v6h8zM11 3H3v10h8zm10 8h-8v10h8zm-10 4H3v6h8z"}),"DashboardOutlined");var wp={},KM=Vt;Object.defineProperty(wp,"__esModule",{value:!0});var P1=wp.default=void 0,GM=KM(En()),QM=b;P1=wp.default=(0,GM.default)((0,QM.jsx)("path",{d:"M17 11V3H7v4H3v14h8v-4h2v4h8V11zM7 19H5v-2h2zm0-4H5v-2h2zm0-4H5V9h2zm4 4H9v-2h2zm0-4H9V9h2zm0-4H9V5h2zm4 8h-2v-2h2zm0-4h-2V9h2zm0-4h-2V5h2zm4 12h-2v-2h2zm0-4h-2v-2h2z"}),"ApartmentOutlined");var Sp={},XM=Vt;Object.defineProperty(Sp,"__esModule",{value:!0});var T1=Sp.default=void 0,qM=XM(En()),ZM=b;T1=Sp.default=(0,qM.default)((0,ZM.jsx)("path",{d:"M4 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m1.13 1.1c-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58C.48 14.9 0 15.62 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29M20 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m4 3.43c0-.81-.48-1.53-1.22-1.85-.85-.37-1.79-.58-2.78-.58-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24zm-7.76-2.78c-1.17-.52-2.61-.9-4.24-.9-1.63 0-3.07.39-4.24.9C6.68 14.13 6 15.21 6 16.39V18h12v-1.61c0-1.18-.68-2.26-1.76-2.74M8.07 16c.09-.23.13-.39.91-.69.97-.38 1.99-.56 3.02-.56s2.05.18 3.02.56c.77.3.81.46.91.69zM12 8c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m0-2c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"GroupsOutlined");var Ep={},JM=Vt;Object.defineProperty(Ep,"__esModule",{value:!0});var R1=Ep.default=void 0,eO=JM(En()),tO=b;R1=Ep.default=(0,eO.default)((0,tO.jsx)("path",{d:"M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4"}),"AttachMoneyOutlined");const hg=[{group:"CRM",items:[{id:"dashboard",title:"Dashboard",url:"/dashboard",icon:Ca},{id:"tenants",title:"Clients",url:"/tenants",icon:P1},{id:"survey",title:"Providers",url:"/survey",icon:Ca},{id:"pricing",title:"Pricing Matrix",url:"/pricing",icon:R1},{id:"bookings",title:"Bookings",url:"/bookings",icon:Ca},{id:"team-users",title:"App Users",url:"/app-users",icon:T1}]},{group:"System",items:[{id:"settings",title:"Settings",url:"/settings",icon:hp}]}],ka=264,Ed=78,ut="#C01227";function mg({item:e,open:t,active:n,depth:r=0,onClick:o}){const i=e.icon,s=b.jsxs(u1,{selected:n,onClick:o,sx:{minHeight:44,my:.25,mx:t?1:.75,px:t?1.5:0,justifyContent:t?"flex-start":"center",borderRadius:2,color:n?ut:"grey.700","& .MuiListItemIcon-root":{color:n?ut:"grey.500"},"&:hover":{bgcolor:Di(ut,.04),color:ut,"& .MuiListItemIcon-root":{color:ut}},"&.Mui-selected":{bgcolor:Di(ut,.08),color:ut,"& .MuiListItemIcon-root":{color:ut},borderLeft:t?`4px solid ${ut}`:"none","&:hover":{bgcolor:Di(ut,.12)}}},children:[b.jsx(ll,{sx:{minWidth:t?34:"auto",justifyContent:"center"},children:r>0&&!i?b.jsx(b1,{sx:{fontSize:8}}):i?b.jsx(i,{fontSize:"small"}):null}),t&&b.jsx(c1,{primary:e.title,primaryTypographyProps:{fontSize:"0.875rem",fontWeight:n?700:500}})]});return t?s:b.jsx(p1,{title:e.title,placement:"right",children:s})}function nO({open:e,mobileOpen:t,onMobileClose:n,isMobile:r}){const o=Xr(),i=Ko(),s=x=>x&&o.pathname.startsWith(x),a=e||r,l=hg.flatMap(x=>x.items).filter(x=>x.children&&x.children.some(y=>s(y.url))).map(x=>x.id),[u,c]=v.useState(l),d=x=>{i(x),r&&n()},h=b.jsxs(Ce,{sx:{bgcolor:"#fff",height:"100%",color:"grey.800",display:"flex",flexDirection:"column",borderRight:1,borderColor:"divider"},children:[b.jsx(cp,{sx:{px:a?2.5:0,justifyContent:a?"flex-start":"center",minHeight:64},children:b.jsx(S1,{compact:!a})}),b.jsx(Ce,{sx:{overflowY:"auto",overflowX:"hidden",flexGrow:1,pb:2},children:hg.map(x=>b.jsxs(Ce,{sx:{mt:1},children:[a&&b.jsx(jt,{variant:"overline",sx:{px:2.5,color:"#A06060",fontSize:"0.6875rem",letterSpacing:"0.08em",fontWeight:700},children:x.group}),b.jsx(l1,{disablePadding:!0,sx:{mt:.5},children:x.items.map(y=>{if(y.children){const g=u.includes(y.id),S=y.children.some(f=>s(f.url)),p=y.icon,m=b.jsxs(u1,{onClick:()=>a?c(f=>f.includes(y.id)?f.filter(w=>w!==y.id):[...f,y.id]):d(y.children[0].url),sx:{minHeight:44,my:.25,mx:a?1:.75,px:a?1.5:0,justifyContent:a?"flex-start":"center",borderRadius:2,color:S?ut:"grey.700",bgcolor:S&&!g?Di(ut,.08):"transparent","& .MuiListItemIcon-root":{color:S?ut:"grey.500"},"&:hover":{bgcolor:Di(ut,.04),color:ut,"& .MuiListItemIcon-root":{color:ut}}},children:[b.jsx(ll,{sx:{minWidth:a?34:"auto",justifyContent:"center"},children:b.jsx(p,{fontSize:"small"})}),a&&b.jsxs(b.Fragment,{children:[b.jsx(c1,{primary:y.title,primaryTypographyProps:{fontSize:"0.875rem",fontWeight:500}}),g?b.jsx(C1,{fontSize:"small"}):b.jsx(k1,{fontSize:"small"})]})]});return b.jsxs(Ce,{children:[a?m:b.jsx(p1,{title:y.title,placement:"right",children:m}),a&&b.jsx(U0,{in:g,timeout:"auto",unmountOnExit:!0,children:b.jsx(Ce,{sx:{pl:1.5},children:y.children.map(f=>b.jsx(mg,{item:f,open:!0,depth:1,active:s(f.url),onClick:()=>d(f.url)},f.id))})})]},y.id)}return b.jsx(mg,{item:y,open:a,active:s(y.url),onClick:()=>d(y.url)},y.id)})})]},x.group))})]});return r?b.jsx(ng,{variant:"temporary",open:t,onClose:n,ModalProps:{keepMounted:!0},sx:{"& .MuiDrawer-paper":{width:ka,border:"none"}},children:h}):b.jsx(ng,{variant:"permanent",sx:{width:e?ka:Ed,flexShrink:0,whiteSpace:"nowrap","& .MuiDrawer-paper":{width:e?ka:Ed,border:"none",overflowX:"hidden",transition:x=>x.transitions.create("width",{duration:x.transitions.duration.standard})}},open:e,children:h})}function rO(){const e=Zr(),t=YC(e.breakpoints.down("lg")),[n,r]=v.useState(!0),[o,i]=v.useState(!1),s=()=>{t?i(a=>!a):r(a=>!a)};return b.jsxs(Ce,{sx:{display:"flex",bgcolor:"background.default",minHeight:"100vh"},children:[b.jsx(IM,{onToggle:s}),b.jsx(nO,{open:n,isMobile:t,mobileOpen:o,onMobileClose:()=>i(!1)}),b.jsxs(Ce,{component:"main",sx:{flexGrow:1,width:{lg:`calc(100% - ${n?ka:Ed}px)`},minHeight:"100vh",transition:e.transitions.create("width",{duration:e.transitions.duration.standard})},children:[b.jsx(cp,{sx:{minHeight:64}}),b.jsx(Ce,{sx:{p:{xs:2,sm:3}},children:b.jsx(kf,{})})]})]})}function oO(){return b.jsx(Ce,{sx:{minHeight:"100vh",bgcolor:"background.default"},children:b.jsx(kf,{})})}const iO=10*60*1e3;function sO({children:e}){const t=Ko(),n=localStorage.getItem("logged_in"),r=v.useRef(null);return v.useEffect(()=>{if(!n)return;const o=()=>{localStorage.removeItem("logged_in"),localStorage.removeItem("auth_token"),localStorage.removeItem("user_data"),t("/login",{replace:!0})},i=()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(o,iO)},s=["mousemove","keydown","scroll","click"];return s.forEach(a=>window.addEventListener(a,i)),i(),()=>{r.current&&clearTimeout(r.current),s.forEach(a=>window.removeEventListener(a,i))}},[n,t]),n?e||b.jsx(kf,{}):b.jsx(Ny,{to:"/login",replace:!0})}const Lt=e=>{const t=v.lazy(e);return b.jsx(v.Suspense,{fallback:b.jsx(Ce,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"60vh"},children:b.jsx(o1,{color:"primary"})}),children:b.jsx(t,{})})};function aO(){return b.jsxs(s2,{children:[b.jsxs(Ze,{element:b.jsx(sO,{children:b.jsx(rO,{})}),children:[b.jsx(Ze,{path:"/dashboard",element:Lt(()=>Ot(()=>import("./Dashboard-DO4SnFU-.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])))}),b.jsx(Ze,{path:"/tenants",element:Lt(()=>Ot(()=>import("./Tenants-nHqVcNog.js"),__vite__mapDeps([11,12,1,13,14,9,15,16,2,3,4,17,18,19,20,5,6,21,22,7,23,24,8])))}),b.jsx(Ze,{path:"/survey",element:Lt(()=>Ot(()=>import("./Survey-DnRJ0EJJ.js"),__vite__mapDeps([25,13,14,9,15,17,16,18,19,12,3,4,5,6,23,7,22])))}),b.jsx(Ze,{path:"/pricing",element:Lt(()=>Ot(()=>import("./Pricing-CttgMHSv.js"),__vite__mapDeps([26,12,13,16,3,4,15,23,7,8,9,22])))}),b.jsx(Ze,{path:"/bookings",element:Lt(()=>Ot(()=>import("./Bookings-BLIHHfA5.js"),__vite__mapDeps([27,12,14,9,15,18,3,4,5,6,21,22,7,23,24,8,28,29])))}),b.jsx(Ze,{path:"/app-users",element:Lt(()=>Ot(()=>import("./TeamUsers-BPLTRPAZ.js"),__vite__mapDeps([30,12,1,13,14,9,15,17,20,3,4,6,7,23,24,8])))}),b.jsx(Ze,{path:"/settings",element:Lt(()=>Ot(()=>import("./Settings-5wBismGd.js"),__vite__mapDeps([31,32,3,4,7,15,29,10,22,23])))})]}),b.jsxs(Ze,{element:b.jsx(oO,{}),children:[b.jsx(Ze,{path:"/login",element:Lt(()=>Ot(()=>import("./Login-yAAi8q2k.js"),__vite__mapDeps([33,32,4,15,23,28,29,7])))}),b.jsx(Ze,{path:"/under-construction",element:Lt(()=>Ot(()=>import("./UnderConstruction-D702AE0F.js"),__vite__mapDeps([34,35,7])))}),b.jsx(Ze,{path:"/coming-soon",element:Lt(()=>Ot(()=>import("./ComingSoon-CX1ajblG.js"),__vite__mapDeps([36,15,7])))}),b.jsx(Ze,{path:"/500",element:Lt(()=>Ot(()=>import("./Error500-DApcbPUH.js"),__vite__mapDeps([37,35,7])))}),b.jsx(Ze,{path:"/404",element:Lt(()=>Ot(()=>import("./Error404-BKXchBZ5.js"),__vite__mapDeps([38,35,7])))})]}),b.jsx(Ze,{path:"/",element:b.jsx(Ny,{to:"/dashboard",replace:!0})}),b.jsx(Ze,{path:"*",element:Lt(()=>Ot(()=>import("./Error404-BKXchBZ5.js"),__vite__mapDeps([38,35,7])))})]})}ic.createRoot(document.getElementById("root")).render(b.jsx(gn.StrictMode,{children:b.jsxs(Nb,{theme:wd,children:[b.jsx(i$,{}),b.jsx(Y_,{dateAdapter:aM,children:b.jsx(h2,{children:b.jsx(aO,{})})})]})}));export{$t as $,yd as A,Ce as B,o1 as C,Ea as D,Y as E,J as F,ue as G,be as H,MP as I,ne as J,up as K,Ae as L,ea as M,vd as N,gt as O,uu as P,mO as Q,hO as R,H$ as S,jt as T,$M as U,yO as V,vO as W,xO as X,ks as Y,ep as Z,C as _,YC as a,su as a0,On as a1,Yf as a2,Hr as a3,Xe as a4,B0 as a5,TR as a6,nl as a7,cp as a8,NR as a9,SR as aA,bR as aB,ER as aC,ZC as aD,dO as aE,yR as aF,yr as aG,R_ as aH,Db as aI,qr as aJ,el as aK,i1 as aa,UR as ab,Ak as ac,jk as ad,Fl as ae,Xo as af,Or as ag,k0 as ah,cO as ai,al as aj,t$ as ak,dP as al,Ql as am,Ku as an,Sn as ao,lO as ap,Ko as aq,S1 as ar,pO as as,vR as at,gR as au,n1 as av,Bl as aw,Vf as ax,Jt as ay,kR as az,v as b,T1 as c,P1 as d,MM as e,_M as f,LM as g,SO as h,Vt as i,b as j,uO as k,Sd as l,gO as m,U0 as n,p1 as o,wO as p,Hf as q,En as r,E0 as s,fO as t,Zr as u,vn as v,tl as w,we as x,Se as y,ve as z}; +`),sM=(e,t)=>t?(...n)=>e(...n).locale(t):e;class aM{constructor({locale:t,formats:n,instance:r}={}){var o;this.isMUIAdapter=!0,this.isTimezoneCompatible=!0,this.lib="dayjs",this.rawDayJsInstance=void 0,this.dayjs=void 0,this.locale=void 0,this.formats=void 0,this.escapedCharacters={start:"[",end:"]"},this.formatTokenMap=oM,this.setLocaleToValue=i=>{const s=this.getCurrentLocaleCode();return s===i.locale()?i:i.locale(s)},this.hasUTCPlugin=()=>typeof lt.utc<"u",this.hasTimezonePlugin=()=>typeof lt.tz<"u",this.isSame=(i,s,a)=>{const l=this.setTimezone(s,this.getTimezone(i));return i.format(a)===l.format(a)},this.cleanTimezone=i=>{switch(i){case"default":return;case"system":return lt.tz.guess();default:return i}},this.createSystemDate=i=>{if(this.rawDayJsInstance)return this.rawDayJsInstance(i);if(this.hasUTCPlugin()&&this.hasTimezonePlugin()){const s=lt.tz.guess();return s!=="UTC"?lt.tz(i,s):lt(i)}return lt(i)},this.createUTCDate=i=>{if(!this.hasUTCPlugin())throw new Error(rc);return lt.utc(i)},this.createTZDate=(i,s)=>{if(!this.hasUTCPlugin())throw new Error(rc);if(!this.hasTimezonePlugin())throw new Error(cg);const a=i!==void 0&&!i.endsWith("Z");return lt(i).tz(this.cleanTimezone(s),a)},this.getLocaleFormats=()=>{const i=lt.Ls,s=this.locale||"en";let a=i[s];return a===void 0&&(rM(),a=i.en),a.formats},this.adjustOffset=i=>{if(!this.hasTimezonePlugin())return i;const s=this.getTimezone(i);if(s!=="UTC"){var a,l;const u=i.tz(this.cleanTimezone(s),!0);if(((a=u.$offset)!=null?a:0)===((l=i.$offset)!=null?l:0))return i;i.$offset=u.$offset}return i},this.date=i=>i===null?null:this.dayjs(i),this.dateWithTimezone=(i,s)=>{if(i===null)return null;let a;return s==="UTC"?a=this.createUTCDate(i):s==="system"||s==="default"&&!this.hasTimezonePlugin()?a=this.createSystemDate(i):a=this.createTZDate(i,s),this.locale===void 0?a:a.locale(this.locale)},this.getTimezone=i=>{if(this.hasTimezonePlugin()){var s;const a=(s=i.$x)==null?void 0:s.$timezone;if(a)return a}return this.hasUTCPlugin()&&i.isUTC()?"UTC":"system"},this.setTimezone=(i,s)=>{if(this.getTimezone(i)===s)return i;if(s==="UTC"){if(!this.hasUTCPlugin())throw new Error(rc);return i.utc()}if(s==="system")return i.local();if(!this.hasTimezonePlugin()){if(s==="default")return i;throw new Error(cg)}return lt.tz(i,this.cleanTimezone(s))},this.toJsDate=i=>i.toDate(),this.parseISO=i=>this.dayjs(i),this.toISO=i=>i.toISOString(),this.parse=(i,s)=>i===""?null:this.dayjs(i,s,this.locale,!0),this.getCurrentLocaleCode=()=>this.locale||"en",this.is12HourCycleInCurrentLocale=()=>/A|a/.test(this.getLocaleFormats().LT||""),this.expandFormat=i=>{const s=this.getLocaleFormats(),a=l=>l.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(u,c,d)=>c||d.slice(1));return i.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(l,u,c)=>{const d=c&&c.toUpperCase();return u||s[c]||a(s[d])})},this.getFormatHelperText=i=>this.expandFormat(i).replace(/a/gi,"(a|p)m").toLocaleLowerCase(),this.isNull=i=>i===null,this.isValid=i=>this.dayjs(i).isValid(),this.format=(i,s)=>this.formatByString(i,this.formats[s]),this.formatByString=(i,s)=>this.dayjs(i).format(s),this.formatNumber=i=>i,this.getDiff=(i,s,a)=>i.diff(s,a),this.isEqual=(i,s)=>i===null&&s===null?!0:this.dayjs(i).toDate().getTime()===this.dayjs(s).toDate().getTime(),this.isSameYear=(i,s)=>this.isSame(i,s,"YYYY"),this.isSameMonth=(i,s)=>this.isSame(i,s,"YYYY-MM"),this.isSameDay=(i,s)=>this.isSame(i,s,"YYYY-MM-DD"),this.isSameHour=(i,s)=>i.isSame(s,"hour"),this.isAfter=(i,s)=>i>s,this.isAfterYear=(i,s)=>this.hasUTCPlugin()?!this.isSameYear(i,s)&&i.utc()>s.utc():i.isAfter(s,"year"),this.isAfterDay=(i,s)=>this.hasUTCPlugin()?!this.isSameDay(i,s)&&i.utc()>s.utc():i.isAfter(s,"day"),this.isBefore=(i,s)=>ithis.hasUTCPlugin()?!this.isSameYear(i,s)&&i.utc()this.hasUTCPlugin()?!this.isSameDay(i,s)&&i.utc()i>=s&&i<=a,this.startOfYear=i=>this.adjustOffset(i.startOf("year")),this.startOfMonth=i=>this.adjustOffset(i.startOf("month")),this.startOfWeek=i=>this.adjustOffset(i.startOf("week")),this.startOfDay=i=>this.adjustOffset(i.startOf("day")),this.endOfYear=i=>this.adjustOffset(i.endOf("year")),this.endOfMonth=i=>this.adjustOffset(i.endOf("month")),this.endOfWeek=i=>this.adjustOffset(i.endOf("week")),this.endOfDay=i=>this.adjustOffset(i.endOf("day")),this.addYears=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"year"):i.add(s,"year")),this.addMonths=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"month"):i.add(s,"month")),this.addWeeks=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"week"):i.add(s,"week")),this.addDays=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"day"):i.add(s,"day")),this.addHours=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"hour"):i.add(s,"hour")),this.addMinutes=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"minute"):i.add(s,"minute")),this.addSeconds=(i,s)=>this.adjustOffset(s<0?i.subtract(Math.abs(s),"second"):i.add(s,"second")),this.getYear=i=>i.year(),this.getMonth=i=>i.month(),this.getDate=i=>i.date(),this.getHours=i=>i.hour(),this.getMinutes=i=>i.minute(),this.getSeconds=i=>i.second(),this.getMilliseconds=i=>i.millisecond(),this.setYear=(i,s)=>this.adjustOffset(i.set("year",s)),this.setMonth=(i,s)=>this.adjustOffset(i.set("month",s)),this.setDate=(i,s)=>this.adjustOffset(i.set("date",s)),this.setHours=(i,s)=>this.adjustOffset(i.set("hour",s)),this.setMinutes=(i,s)=>this.adjustOffset(i.set("minute",s)),this.setSeconds=(i,s)=>this.adjustOffset(i.set("second",s)),this.setMilliseconds=(i,s)=>this.adjustOffset(i.set("millisecond",s)),this.getDaysInMonth=i=>i.daysInMonth(),this.getNextMonth=i=>this.addMonths(i,1),this.getPreviousMonth=i=>this.addMonths(i,-1),this.getMonthArray=i=>{const a=[i.startOf("year")];for(;a.length<12;){const l=a[a.length-1];a.push(this.addMonths(l,1))}return a},this.mergeDateAndTime=(i,s)=>i.hour(s.hour()).minute(s.minute()).second(s.second()),this.getWeekdays=()=>{const i=this.dayjs().startOf("week");return[0,1,2,3,4,5,6].map(s=>this.formatByString(this.addDays(i,s),"dd"))},this.getWeekArray=i=>{const s=this.setLocaleToValue(i),a=s.startOf("month").startOf("week"),l=s.endOf("month").endOf("week");let u=0,c=a;const d=[];for(;ci.week(),this.getYearRange=(i,s)=>{const a=i.startOf("year"),l=s.endOf("year"),u=[];let c=a;for(;ci==="am"?"AM":"PM",this.rawDayJsInstance=r,this.dayjs=sM((o=this.rawDayJsInstance)!=null?o:lt,t),this.locale=t,this.formats=C({},iM,n),lt.extend(X_)}}const Ne={0:"#FFFFFF",50:"#FAFAFA",100:"#F5F5F5",200:"#F0F0F0",300:"#D9D9D9",400:"#BFBFBF",500:"#8C8C8C",600:"#595959",700:"#434343",800:"#262626",900:"#141414",A50:"#FAFAFB",A100:"#E6EBF1"},lM={mode:"light",common:{black:"#000000",white:"#FFFFFF"},primary:{lighter:"#F8E0E3",100:"#EFBBC1",200:"#E08A92",light:"#D6515C",400:"#CC2E3C",main:"#C01227",dark:"#9E0E20",700:"#870C1B",darker:"#7E0B17",900:"#520710",contrastText:"#FFFFFF"},secondary:{lighter:Ne[100],100:Ne[100],200:Ne[200],light:Ne[300],400:Ne[400],main:Ne[500],600:Ne[600],dark:Ne[700],800:Ne[800],darker:Ne[900],A100:Ne[0],A200:Ne[400],A300:Ne[700],contrastText:Ne[0]},error:{lighter:"#FEEAE9",light:"#F88078",main:"#F04134",dark:"#A82216",darker:"#7A150C",contrastText:"#FFFFFF"},warning:{lighter:"#FFF7E0",light:"#FFD666",main:"#FFBF00",dark:"#B38600",darker:"#805F00",contrastText:"#262626"},info:{lighter:"#E0F7F8",light:"#66CBD2",main:"#00A2AE",dark:"#00727B",darker:"#005159",contrastText:"#FFFFFF"},success:{lighter:"#E3F6EC",light:"#5CC98C",main:"#00A854",dark:"#00773B",darker:"#00552A",contrastText:"#FFFFFF"},grey:Ne,text:{primary:Ne[800],secondary:Ne[600],disabled:Ne[400]},action:{disabled:Ne[300],hover:"rgba(192, 18, 39, 0.04)",selected:"rgba(192, 18, 39, 0.08)"},divider:Ne[200],background:{paper:"#FFFFFF",default:Ne.A50}},uM={fontFamily:'"Public Sans", "Inter", "Helvetica", "Arial", sans-serif',htmlFontSize:16,fontWeightLight:300,fontWeightRegular:400,fontWeightMedium:500,fontWeightBold:600,h1:{fontWeight:700,fontSize:"2.375rem",lineHeight:1.21},h2:{fontWeight:700,fontSize:"1.875rem",lineHeight:1.27},h3:{fontWeight:600,fontSize:"1.5rem",lineHeight:1.33},h4:{fontWeight:600,fontSize:"1.25rem",lineHeight:1.4},h5:{fontWeight:600,fontSize:"1rem",lineHeight:1.5},h6:{fontWeight:500,fontSize:"0.875rem",lineHeight:1.57},caption:{fontWeight:400,fontSize:"0.75rem",lineHeight:1.66},body1:{fontSize:"0.875rem",lineHeight:1.57},body2:{fontSize:"0.75rem",lineHeight:1.66},subtitle1:{fontSize:"0.875rem",fontWeight:600,lineHeight:1.57},subtitle2:{fontSize:"0.75rem",fontWeight:500,lineHeight:1.66},overline:{fontSize:"0.6875rem",fontWeight:600,letterSpacing:"0.08em",textTransform:"uppercase"},button:{textTransform:"capitalize",fontWeight:600}},bi={card:"0px 1px 4px rgba(0, 0, 0, 0.08)",cardHover:"0px 4px 16px rgba(0, 0, 0, 0.10)",widget:"0px 2px 14px rgba(38, 38, 38, 0.06)",dropdown:"0px 8px 24px rgba(38, 38, 38, 0.12)",primaryGlow:"0px 6px 16px rgba(192, 18, 39, 0.28)",primaryGlowHover:"0px 8px 20px rgba(192, 18, 39, 0.36)",header:"0px 1px 0px rgba(0, 0, 0, 0.06)"};function cM(e){const{palette:t}=e;return{MuiCssBaseline:{styleOverrides:{body:{backgroundColor:t.background.default},"*::-webkit-scrollbar":{width:8,height:8},"*::-webkit-scrollbar-thumb":{background:t.grey[300],borderRadius:8},"*::-webkit-scrollbar-thumb:hover":{background:t.grey[400]}}},MuiButton:{defaultProps:{disableElevation:!0},styleOverrides:{root:{borderRadius:6,fontWeight:600,padding:"7px 18px"},containedPrimary:{boxShadow:bi.primaryGlow,"&:hover":{boxShadow:bi.primaryGlowHover,backgroundColor:t.primary.dark}},outlined:{borderColor:t.grey[300]},sizeLarge:{padding:"10px 22px",fontSize:"0.9375rem"}}},MuiIconButton:{styleOverrides:{root:{borderRadius:8}}},MuiCard:{styleOverrides:{root:{borderRadius:10,border:`1px solid ${t.grey[200]}`,boxShadow:bi.card,backgroundImage:"none"}}},MuiCardHeader:{defaultProps:{titleTypographyProps:{variant:"h5"},subheaderTypographyProps:{variant:"caption"}},styleOverrides:{root:{padding:20}}},MuiCardContent:{styleOverrides:{root:{padding:20,"&:last-child":{paddingBottom:20}}}},MuiPaper:{defaultProps:{elevation:0},styleOverrides:{rounded:{borderRadius:10}}},MuiChip:{styleOverrides:{root:{borderRadius:6,fontWeight:600,fontSize:"0.75rem"},sizeSmall:{height:22},label:{paddingLeft:8,paddingRight:8}}},MuiTableCell:{styleOverrides:{root:{borderColor:t.grey[200],padding:"12px 16px",fontSize:"0.8125rem"},head:{fontWeight:600,color:t.grey[600],backgroundColor:t.grey[50],textTransform:"none",whiteSpace:"nowrap"}}},MuiTableRow:{styleOverrides:{root:{"&:hover":{backgroundColor:t.primary.lighter+"66"}}}},MuiOutlinedInput:{styleOverrides:{root:{borderRadius:8,backgroundColor:t.background.paper,"& .MuiOutlinedInput-notchedOutline":{borderColor:t.grey[300]},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:t.grey[400]}},input:{padding:"11px 14px"}}},MuiInputLabel:{styleOverrides:{root:{color:t.grey[600],fontSize:"0.875rem"}}},MuiTab:{styleOverrides:{root:{textTransform:"none",fontWeight:600,minHeight:46,fontSize:"0.875rem"}}},MuiTabs:{styleOverrides:{indicator:{height:3,borderRadius:3}}},MuiTooltip:{styleOverrides:{tooltip:{backgroundColor:t.grey[800],borderRadius:6,fontSize:"0.75rem",padding:"6px 10px"}}},MuiDialog:{styleOverrides:{paper:{borderRadius:12}}},MuiAvatar:{styleOverrides:{root:{fontWeight:600,fontSize:"0.875rem"}}},MuiListItemButton:{styleOverrides:{root:{borderRadius:8}}},MuiLinearProgress:{styleOverrides:{root:{borderRadius:8,height:6,backgroundColor:t.grey[200]}}},MuiMenu:{styleOverrides:{paper:{borderRadius:10,boxShadow:bi.dropdown,marginTop:4}}}}}let wd=Xf({palette:lM,typography:uM,shape:{borderRadius:6},customShadows:bi,mixins:{toolbar:{minHeight:64}}});wd.components=cM(wd);const dM="modulepreload",fM=function(e){return"/"+e},dg={},Ot=function(t,n,r){let o=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),a=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));o=Promise.allSettled(n.map(l=>{if(l=fM(l),l in dg)return;dg[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":dM,u||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((h,x)=>{d.addEventListener("load",h),d.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};var dp={},oc={};const pM=Yn(Hb);var fg;function En(){return fg||(fg=1,function(e){"use client";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t.createSvgIcon}});var t=pM}(oc)),oc}var hM=Vt;Object.defineProperty(dp,"__esModule",{value:!0});var x1=dp.default=void 0,mM=hM(En()),gM=b;x1=dp.default=(0,mM.default)((0,gM.jsx)("path",{d:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z"}),"Menu");var fp={},vM=Vt;Object.defineProperty(fp,"__esModule",{value:!0});var Sd=fp.default=void 0,yM=vM(En()),xM=b;Sd=fp.default=(0,yM.default)((0,xM.jsx)("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14"}),"Search");var pp={},wM=Vt;Object.defineProperty(pp,"__esModule",{value:!0});var hp=pp.default=void 0,SM=wM(En()),EM=b;hp=pp.default=(0,SM.default)((0,EM.jsx)("path",{d:"M19.43 12.98c.04-.32.07-.64.07-.98 0-.34-.03-.66-.07-.98l2.11-1.65c.19-.15.24-.42.12-.64l-2-3.46c-.09-.16-.26-.25-.44-.25-.06 0-.12.01-.17.03l-2.49 1c-.52-.4-1.08-.73-1.69-.98l-.38-2.65C14.46 2.18 14.25 2 14 2h-4c-.25 0-.46.18-.49.42l-.38 2.65c-.61.25-1.17.59-1.69.98l-2.49-1c-.06-.02-.12-.03-.18-.03-.17 0-.34.09-.43.25l-2 3.46c-.13.22-.07.49.12.64l2.11 1.65c-.04.32-.07.65-.07.98 0 .33.03.66.07.98l-2.11 1.65c-.19.15-.24.42-.12.64l2 3.46c.09.16.26.25.44.25.06 0 .12-.01.17-.03l2.49-1c.52.4 1.08.73 1.69.98l.38 2.65c.03.24.24.42.49.42h4c.25 0 .46-.18.49-.42l.38-2.65c.61-.25 1.17-.59 1.69-.98l2.49 1c.06.02.12.03.18.03.17 0 .34-.09.43-.25l2-3.46c.12-.22.07-.49-.12-.64zm-1.98-1.71c.04.31.05.52.05.73 0 .21-.02.43-.05.73l-.14 1.13.89.7 1.08.84-.7 1.21-1.27-.51-1.04-.42-.9.68c-.43.32-.84.56-1.25.73l-1.06.43-.16 1.13-.2 1.35h-1.4l-.19-1.35-.16-1.13-1.06-.43c-.43-.18-.83-.41-1.23-.71l-.91-.7-1.06.43-1.27.51-.7-1.21 1.08-.84.89-.7-.14-1.13c-.03-.31-.05-.54-.05-.74s.02-.43.05-.73l.14-1.13-.89-.7-1.08-.84.7-1.21 1.27.51 1.04.42.9-.68c.43-.32.84-.56 1.25-.73l1.06-.43.16-1.13.2-1.35h1.39l.19 1.35.16 1.13 1.06.43c.43.18.83.41 1.23.71l.91.7 1.06-.43 1.27-.51.7 1.21-1.07.85-.89.7zM12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 6c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2"}),"SettingsOutlined");var mp={},CM=Vt;Object.defineProperty(mp,"__esModule",{value:!0});var w1=mp.default=void 0,kM=CM(En()),bM=b;w1=mp.default=(0,kM.default)((0,bM.jsx)("path",{d:"m17 7-1.41 1.41L18.17 11H8v2h10.17l-2.58 2.58L17 17l5-5zM4 5h8V3H4c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h8v-2H4z"}),"Logout");const PM="/Doormile-logo.png";function S1({onDark:e=!1,compact:t=!1,height:n=26,sx:r}){if(t){const o=e?"#FFFFFF":"#C01227",i=e?"#C01227":"#FFFFFF";return b.jsx(Ce,{sx:{display:"flex",alignItems:"center",...r},children:b.jsx(Ce,{sx:{width:34,height:34,borderRadius:2,bgcolor:o,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxShadow:e?"none":"0 4px 10px rgba(192, 18, 39,0.30)"},children:b.jsx(jt,{sx:{color:i,fontWeight:800,fontSize:"1.25rem",lineHeight:1},children:"D"})})})}return b.jsx(Ce,{sx:{display:"flex",alignItems:"center",...r},children:b.jsx(Ce,{component:"img",src:PM,alt:"Doormile",sx:{height:n,width:"auto",display:"block",filter:e?"none":"brightness(0) saturate(100%) invert(15%) sepia(93%) saturate(5437%) hue-rotate(346deg) brightness(81%) contrast(92%)"}})})}const fO=e=>String(e||"").replace(/[_-]+/g," ").replace(/([a-z\d])([A-Z])/g,"$1 $2").replace(/\s+/g," ").replace(/\b\w/g,t=>t.toUpperCase()).trim(),TM=(e="")=>{let t=0;for(let r=0;re.split(" ").filter(Boolean).slice(0,2).map(t=>t[0]).join("").toUpperCase();function $M({name:e="",size:t=32,sx:n}){return b.jsx(yd,{sx:{width:t,height:t,bgcolor:TM(e),fontSize:t*.42,...n},children:RM(e)})}const In="https://api.doormile.com/api/v1",Qn=()=>{const e=localStorage.getItem("auth_token");return{"Content-Type":"application/json",...e?{Authorization:`Bearer ${e}`}:{}}},Jr=e=>e.status===204?{}:e.json().catch(()=>({})),E1=e=>Array.isArray(e)?e:Array.isArray(e==null?void 0:e.data)?e.data:[];async function _M(){const e=await fetch(`${In}/crm/clients?limit=1000`,{headers:Qn()});if(!e.ok)throw new Error("Failed to fetch clients");const t=await e.json();return E1(t)}async function pO(e,t){const n=await fetch(`${In}/admin/login`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e,password:t})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||"Failed to login")}return n.json()}async function hO(e){const t=await fetch(`${In}/crm/clients`,{method:"POST",headers:Qn(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Error(n.error||n.message||"Failed to create client")}return Jr(t)}async function mO(e,t){const n=await fetch(`${In}/crm/clients/${e}`,{method:"PUT",headers:Qn(),body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||r.message||"Failed to update client")}return Jr(n)}async function gO(e){const t=await fetch(`${In}/crm/clients/${e}`,{method:"DELETE",headers:Qn()});if(!t.ok)throw new Error("Failed to delete client");return Jr(t)}async function MM(){const e=await fetch(`${In}/admin/users?limit=1000`,{headers:Qn()});if(!e.ok)throw new Error("Failed to fetch users");const t=await e.json();return E1(t)}async function vO(e){const t=await fetch(`${In}/admin/users`,{method:"POST",headers:Qn(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json().catch(()=>({}));throw new Error(n.error||n.message||"Failed to create user")}return Jr(t)}async function yO(e,t){const n=await fetch(`${In}/admin/users/${e}`,{method:"PUT",headers:Qn(),body:JSON.stringify(t)});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||r.message||"Failed to update user")}return Jr(n)}async function xO(e){const t=await fetch(`${In}/admin/users/${e}`,{method:"DELETE",headers:Qn()});if(!t.ok)throw new Error("Failed to delete user");return Jr(t)}async function wO(e){const t=await fetch(`${In}/admin/competitor-branches/${e}`,{method:"DELETE",headers:Qn()});if(!t.ok)throw new Error("Failed to delete survey record");return Jr(t)}const OM=e=>"CLI-"+String(e).replace(/[^a-zA-Z0-9]/g,"").toUpperCase().substring(0,6).padStart(6,"0");function LM(e){const t=e.payload??e,n=t.id??e.id,r=OM(n);return{id:n,logicalId:r,clientId:r,name:t.first_name?`${t.first_name} ${t.last_name||""}`.trim():t.name||"—",email:t.email||"",phone:t.phone||"",city:t.city||"",businessState:t.businessState||"",businessType:t.businessType||"",status:t.status||"unknown",parcelVolume:Number(t.parcelVolume)||0,activeContracts:Number(t.activeContracts)||0,frequency:t.frequency||"",provider:t.provider||"",efficiency:t.efficiency||"",logisticsSegment:t.logisticsSegment||"",transitFrom:t.transitFrom||"",transitTo:t.transitTo||"",neighbourhood:t.neighbourhood||t.surveyZone||"",surveyAddress:t.surveyAddress||t.address||"",surveyLat:t.survey_lat??t.surveyLat??"",surveyLng:t.survey_long??t.surveyLng??"",dataConsent:t.dataConsent||"",lastUpdated:t.lastUpdated||"",pincode:t.pincode||t.postal_code||"",notes:t.notes||""}}function SO(e){const t=e.payload??e;return{id:t.id??e.id,name:t.first_name?`${t.first_name} ${t.last_name||""}`.trim():t.name||"—",email:t.email||"",phone:t.phone||"",role:t.role||"unknown",pin:t.pin||""}}const pg="#C01227";function IM({onToggle:e}){var R;const t=Ko(),[n,r]=v.useState(null),[o,i]=v.useState("");let s={name:"Admin",role:"Operations Admin",id:0};try{const M=localStorage.getItem("user");M&&(s=JSON.parse(M))}catch{}const[a,l]=v.useState(s.name||"Admin"),u=s.role==="admin"?"Administrator":s.role==="manager"?"Manager":s.role==="executive"?"Executive":"Operations Admin",c=a.charAt(0).toUpperCase(),d=v.useRef(null),[h,x]=v.useState([]),[y,g]=v.useState(!1),[S,p]=v.useState(!1),[m,f]=v.useState(!1);v.useEffect(()=>{MM().then(M=>{if(s.email){const A=M.find(z=>z.email===s.email);if(A&&A.first_name){l(A.first_name);const z={...s,name:A.first_name};localStorage.setItem("user",JSON.stringify(z))}}}).catch(console.error)},[]);const w=()=>{y||S||(p(!0),_M().then(M=>x(M.map(LM))).catch(()=>{}).finally(()=>{g(!0),p(!1)}))},P=o.trim().toLowerCase(),E=P?h.filter(M=>[M.name,M.city,M.businessType,M.phone].join(" ").toLowerCase().includes(P)).slice(0,6):[],k=M=>{i(M.target.value),w(),f(!0)},_=M=>{t(`/tenants?q=${encodeURIComponent(M)}`),i(""),f(!1)},D=M=>{M.preventDefault();const A=o.trim();A&&_(A)};return b.jsx(WP,{position:"fixed",elevation:0,sx:{bgcolor:"#fff",color:"grey.800",zIndex:M=>M.zIndex.drawer+1,borderBottom:1,borderColor:"divider"},children:b.jsxs(cp,{sx:{minHeight:64,px:{xs:1.5,sm:2.5},gap:1},children:[b.jsx(MP,{color:"inherit",edge:"start",onClick:e,sx:{mr:.5},children:b.jsx(x1,{})}),b.jsx(Ce,{onClick:()=>t("/dashboard"),sx:{display:"flex",alignItems:"center",cursor:"pointer"},children:b.jsx(S1,{height:22})}),b.jsx(Ce,{sx:{flexGrow:1}}),b.jsx(t$,{onClickAway:()=>f(!1),children:b.jsxs(Ce,{sx:{display:{xs:"none",sm:"block"},position:"relative"},children:[b.jsxs(Ce,{ref:d,component:"form",onSubmit:D,sx:{display:"flex",alignItems:"center",bgcolor:"grey.100",borderRadius:2,px:1.5,py:.5,width:{sm:240,md:320},"&:hover":{bgcolor:"grey.200"},"&:focus-within":{bgcolor:"grey.200"}},children:[b.jsx(Sd,{sx:{fontSize:20,mr:1,color:"grey.500"}}),b.jsx(TR,{value:o,onChange:k,onFocus:()=>{w(),o.trim()&&f(!0)},placeholder:"Search clients…",sx:{color:"grey.800",fontSize:"0.875rem",flex:1,"&::placeholder":{color:"grey.500"}},inputProps:{"aria-label":"search"}})]}),b.jsx(up,{open:m&&!!P,anchorEl:d.current,placement:"bottom-start",style:{zIndex:1400,width:(R=d.current)==null?void 0:R.offsetWidth},children:b.jsx(uu,{sx:{mt:1,borderRadius:2,overflow:"hidden",boxShadow:"0 8px 24px rgba(0,0,0,0.18)"},children:S&&E.length===0?b.jsx(Ce,{sx:{display:"flex",justifyContent:"center",py:2.5},children:b.jsx(o1,{size:20})}):E.length===0?b.jsx(Ce,{sx:{px:2,py:2},children:b.jsxs(jt,{variant:"body2",color:"text.secondary",children:["No clients match “",o.trim(),"”."]})}):b.jsxs(b.Fragment,{children:[E.map(M=>b.jsxs(ea,{onClick:()=>_(M.name),sx:{py:1,gap:1.25},children:[b.jsx($M,{name:M.name,size:30}),b.jsxs(Ce,{sx:{minWidth:0},children:[b.jsx(jt,{variant:"body2",sx:{fontWeight:600,color:"grey.800"},noWrap:!0,children:M.name}),b.jsx(jt,{variant:"caption",color:"text.secondary",noWrap:!0,children:[M.businessType,M.city].filter(Boolean).join(" · ")||M.phone})]})]},M.id)),b.jsx(Ea,{}),b.jsxs(ea,{onClick:()=>_(o.trim()),sx:{py:1.25,color:"primary.main",fontWeight:600},children:[b.jsx(Sd,{fontSize:"small",sx:{mr:1}}),"See all results for “",o.trim(),"”"]})]})})})]})}),b.jsxs(Ce,{onClick:M=>r(M.currentTarget),sx:{display:"flex",alignItems:"center",gap:1,ml:.5,cursor:"pointer",py:.5,px:.5,borderRadius:2,"&:hover":{bgcolor:"grey.100"}},children:[b.jsx(yd,{sx:{width:34,height:34,bgcolor:pg,color:"#fff",fontWeight:700},children:c}),b.jsxs(Ce,{sx:{display:{xs:"none",md:"block"},lineHeight:1.1},children:[b.jsx(jt,{variant:"subtitle2",sx:{color:"grey.800",fontWeight:600},children:a}),b.jsx(jt,{variant:"caption",sx:{color:"text.secondary",textTransform:"capitalize"},children:u})]})]}),b.jsxs(R_,{anchorEl:n,open:!!n,onClose:()=>r(null),transformOrigin:{horizontal:"right",vertical:"top"},anchorOrigin:{horizontal:"right",vertical:"bottom"},PaperProps:{sx:{mt:1,minWidth:220}},children:[b.jsx(Ce,{sx:{px:2,py:1.5},children:b.jsxs(H$,{direction:"row",spacing:1.5,alignItems:"center",children:[b.jsx(yd,{sx:{width:38,height:38,bgcolor:pg,color:"#fff",fontWeight:700},children:c}),b.jsxs(Ce,{sx:{lineHeight:1.2},children:[b.jsx(jt,{variant:"subtitle2",sx:{fontWeight:700},children:a}),b.jsx(jt,{variant:"caption",color:"text.secondary",sx:{textTransform:"capitalize"},children:u})]})]})}),b.jsx(Ea,{}),b.jsxs(ea,{onClick:()=>{r(null),t("/settings")},children:[b.jsx(ll,{children:b.jsx(hp,{fontSize:"small"})}),"Settings"]}),b.jsx(Ea,{}),b.jsxs(ea,{onClick:()=>{r(null),localStorage.removeItem("auth_token"),t("/login")},sx:{color:"error.main"},children:[b.jsx(ll,{children:b.jsx(w1,{fontSize:"small",color:"error"})}),"Logout"]})]})]})})}var gp={},jM=Vt;Object.defineProperty(gp,"__esModule",{value:!0});var C1=gp.default=void 0,DM=jM(En()),AM=b;C1=gp.default=(0,DM.default)((0,AM.jsx)("path",{d:"m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z"}),"ExpandLess");var vp={},NM=Vt;Object.defineProperty(vp,"__esModule",{value:!0});var k1=vp.default=void 0,zM=NM(En()),FM=b;k1=vp.default=(0,zM.default)((0,FM.jsx)("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore");var yp={},BM=Vt;Object.defineProperty(yp,"__esModule",{value:!0});var b1=yp.default=void 0,WM=BM(En()),UM=b;b1=yp.default=(0,WM.default)((0,UM.jsx)("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord");var xp={},HM=Vt;Object.defineProperty(xp,"__esModule",{value:!0});var Ca=xp.default=void 0,VM=HM(En()),YM=b;Ca=xp.default=(0,VM.default)((0,YM.jsx)("path",{d:"M19 5v2h-4V5zM9 5v6H5V5zm10 8v6h-4v-6zM9 17v2H5v-2zM21 3h-8v6h8zM11 3H3v10h8zm10 8h-8v10h8zm-10 4H3v6h8z"}),"DashboardOutlined");var wp={},KM=Vt;Object.defineProperty(wp,"__esModule",{value:!0});var P1=wp.default=void 0,GM=KM(En()),QM=b;P1=wp.default=(0,GM.default)((0,QM.jsx)("path",{d:"M17 11V3H7v4H3v14h8v-4h2v4h8V11zM7 19H5v-2h2zm0-4H5v-2h2zm0-4H5V9h2zm4 4H9v-2h2zm0-4H9V9h2zm0-4H9V5h2zm4 8h-2v-2h2zm0-4h-2V9h2zm0-4h-2V5h2zm4 12h-2v-2h2zm0-4h-2v-2h2z"}),"ApartmentOutlined");var Sp={},XM=Vt;Object.defineProperty(Sp,"__esModule",{value:!0});var T1=Sp.default=void 0,qM=XM(En()),ZM=b;T1=Sp.default=(0,qM.default)((0,ZM.jsx)("path",{d:"M4 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m1.13 1.1c-.37-.06-.74-.1-1.13-.1-.99 0-1.93.21-2.78.58C.48 14.9 0 15.62 0 16.43V18h4.5v-1.61c0-.83.23-1.61.63-2.29M20 13c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m4 3.43c0-.81-.48-1.53-1.22-1.85-.85-.37-1.79-.58-2.78-.58-.39 0-.76.04-1.13.1.4.68.63 1.46.63 2.29V18H24zm-7.76-2.78c-1.17-.52-2.61-.9-4.24-.9-1.63 0-3.07.39-4.24.9C6.68 14.13 6 15.21 6 16.39V18h12v-1.61c0-1.18-.68-2.26-1.76-2.74M8.07 16c.09-.23.13-.39.91-.69.97-.38 1.99-.56 3.02-.56s2.05.18 3.02.56c.77.3.81.46.91.69zM12 8c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1m0-2c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"GroupsOutlined");var Ep={},JM=Vt;Object.defineProperty(Ep,"__esModule",{value:!0});var R1=Ep.default=void 0,eO=JM(En()),tO=b;R1=Ep.default=(0,eO.default)((0,tO.jsx)("path",{d:"M11.8 10.9c-2.27-.59-3-1.2-3-2.15 0-1.09 1.01-1.85 2.7-1.85 1.78 0 2.44.85 2.5 2.1h2.21c-.07-1.72-1.12-3.3-3.21-3.81V3h-3v2.16c-1.94.42-3.5 1.68-3.5 3.61 0 2.31 1.91 3.46 4.7 4.13 2.5.6 3 1.48 3 2.41 0 .69-.49 1.79-2.7 1.79-2.06 0-2.87-.92-2.98-2.1h-2.2c.12 2.19 1.76 3.42 3.68 3.83V21h3v-2.15c1.95-.37 3.5-1.5 3.5-3.55 0-2.84-2.43-3.81-4.7-4.4"}),"AttachMoneyOutlined");const hg=[{group:"CRM",items:[{id:"dashboard",title:"Dashboard",url:"/dashboard",icon:Ca},{id:"tenants",title:"Clients",url:"/tenants",icon:P1},{id:"survey",title:"Providers",url:"/survey",icon:Ca},{id:"pricing",title:"Pricing Matrix",url:"/pricing",icon:R1},{id:"bookings",title:"Bookings",url:"/bookings",icon:Ca},{id:"team-users",title:"App Users",url:"/app-users",icon:T1}]},{group:"System",items:[{id:"settings",title:"Settings",url:"/settings",icon:hp}]}],ka=264,Ed=78,ut="#C01227";function mg({item:e,open:t,active:n,depth:r=0,onClick:o}){const i=e.icon,s=b.jsxs(u1,{selected:n,onClick:o,sx:{minHeight:44,my:.25,mx:t?1:.75,px:t?1.5:0,justifyContent:t?"flex-start":"center",borderRadius:2,color:n?ut:"grey.700","& .MuiListItemIcon-root":{color:n?ut:"grey.500"},"&:hover":{bgcolor:Di(ut,.04),color:ut,"& .MuiListItemIcon-root":{color:ut}},"&.Mui-selected":{bgcolor:Di(ut,.08),color:ut,"& .MuiListItemIcon-root":{color:ut},borderLeft:t?`4px solid ${ut}`:"none","&:hover":{bgcolor:Di(ut,.12)}}},children:[b.jsx(ll,{sx:{minWidth:t?34:"auto",justifyContent:"center"},children:r>0&&!i?b.jsx(b1,{sx:{fontSize:8}}):i?b.jsx(i,{fontSize:"small"}):null}),t&&b.jsx(c1,{primary:e.title,primaryTypographyProps:{fontSize:"0.875rem",fontWeight:n?700:500}})]});return t?s:b.jsx(p1,{title:e.title,placement:"right",children:s})}function nO({open:e,mobileOpen:t,onMobileClose:n,isMobile:r}){const o=Xr(),i=Ko(),s=x=>x&&o.pathname.startsWith(x),a=e||r,l=hg.flatMap(x=>x.items).filter(x=>x.children&&x.children.some(y=>s(y.url))).map(x=>x.id),[u,c]=v.useState(l),d=x=>{i(x),r&&n()},h=b.jsxs(Ce,{sx:{bgcolor:"#fff",height:"100%",color:"grey.800",display:"flex",flexDirection:"column",borderRight:1,borderColor:"divider"},children:[b.jsx(cp,{sx:{px:a?2.5:0,justifyContent:a?"flex-start":"center",minHeight:64},children:b.jsx(S1,{compact:!a})}),b.jsx(Ce,{sx:{overflowY:"auto",overflowX:"hidden",flexGrow:1,pb:2},children:hg.map(x=>b.jsxs(Ce,{sx:{mt:1},children:[a&&b.jsx(jt,{variant:"overline",sx:{px:2.5,color:"#A06060",fontSize:"0.6875rem",letterSpacing:"0.08em",fontWeight:700},children:x.group}),b.jsx(l1,{disablePadding:!0,sx:{mt:.5},children:x.items.map(y=>{if(y.children){const g=u.includes(y.id),S=y.children.some(f=>s(f.url)),p=y.icon,m=b.jsxs(u1,{onClick:()=>a?c(f=>f.includes(y.id)?f.filter(w=>w!==y.id):[...f,y.id]):d(y.children[0].url),sx:{minHeight:44,my:.25,mx:a?1:.75,px:a?1.5:0,justifyContent:a?"flex-start":"center",borderRadius:2,color:S?ut:"grey.700",bgcolor:S&&!g?Di(ut,.08):"transparent","& .MuiListItemIcon-root":{color:S?ut:"grey.500"},"&:hover":{bgcolor:Di(ut,.04),color:ut,"& .MuiListItemIcon-root":{color:ut}}},children:[b.jsx(ll,{sx:{minWidth:a?34:"auto",justifyContent:"center"},children:b.jsx(p,{fontSize:"small"})}),a&&b.jsxs(b.Fragment,{children:[b.jsx(c1,{primary:y.title,primaryTypographyProps:{fontSize:"0.875rem",fontWeight:500}}),g?b.jsx(C1,{fontSize:"small"}):b.jsx(k1,{fontSize:"small"})]})]});return b.jsxs(Ce,{children:[a?m:b.jsx(p1,{title:y.title,placement:"right",children:m}),a&&b.jsx(U0,{in:g,timeout:"auto",unmountOnExit:!0,children:b.jsx(Ce,{sx:{pl:1.5},children:y.children.map(f=>b.jsx(mg,{item:f,open:!0,depth:1,active:s(f.url),onClick:()=>d(f.url)},f.id))})})]},y.id)}return b.jsx(mg,{item:y,open:a,active:s(y.url),onClick:()=>d(y.url)},y.id)})})]},x.group))})]});return r?b.jsx(ng,{variant:"temporary",open:t,onClose:n,ModalProps:{keepMounted:!0},sx:{"& .MuiDrawer-paper":{width:ka,border:"none"}},children:h}):b.jsx(ng,{variant:"permanent",sx:{width:e?ka:Ed,flexShrink:0,whiteSpace:"nowrap","& .MuiDrawer-paper":{width:e?ka:Ed,border:"none",overflowX:"hidden",transition:x=>x.transitions.create("width",{duration:x.transitions.duration.standard})}},open:e,children:h})}function rO(){const e=Zr(),t=YC(e.breakpoints.down("lg")),[n,r]=v.useState(!0),[o,i]=v.useState(!1),s=()=>{t?i(a=>!a):r(a=>!a)};return b.jsxs(Ce,{sx:{display:"flex",bgcolor:"background.default",minHeight:"100vh"},children:[b.jsx(IM,{onToggle:s}),b.jsx(nO,{open:n,isMobile:t,mobileOpen:o,onMobileClose:()=>i(!1)}),b.jsxs(Ce,{component:"main",sx:{flexGrow:1,width:{lg:`calc(100% - ${n?ka:Ed}px)`},minHeight:"100vh",transition:e.transitions.create("width",{duration:e.transitions.duration.standard})},children:[b.jsx(cp,{sx:{minHeight:64}}),b.jsx(Ce,{sx:{p:{xs:2,sm:3}},children:b.jsx(kf,{})})]})]})}function oO(){return b.jsx(Ce,{sx:{minHeight:"100vh",bgcolor:"background.default"},children:b.jsx(kf,{})})}const iO=10*60*1e3;function sO({children:e}){const t=Ko(),n=localStorage.getItem("logged_in"),r=v.useRef(null);return v.useEffect(()=>{if(!n)return;const o=()=>{localStorage.removeItem("logged_in"),localStorage.removeItem("auth_token"),localStorage.removeItem("user_data"),t("/login",{replace:!0})},i=()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(o,iO)},s=["mousemove","keydown","scroll","click"];return s.forEach(a=>window.addEventListener(a,i)),i(),()=>{r.current&&clearTimeout(r.current),s.forEach(a=>window.removeEventListener(a,i))}},[n,t]),n?e||b.jsx(kf,{}):b.jsx(Ny,{to:"/login",replace:!0})}const Lt=e=>{const t=v.lazy(e);return b.jsx(v.Suspense,{fallback:b.jsx(Ce,{sx:{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"60vh"},children:b.jsx(o1,{color:"primary"})}),children:b.jsx(t,{})})};function aO(){return b.jsxs(s2,{children:[b.jsxs(Ze,{element:b.jsx(sO,{children:b.jsx(rO,{})}),children:[b.jsx(Ze,{path:"/dashboard",element:Lt(()=>Ot(()=>import("./Dashboard-BLe4n5eQ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])))}),b.jsx(Ze,{path:"/tenants",element:Lt(()=>Ot(()=>import("./Tenants-pp9mqXyF.js"),__vite__mapDeps([10,11,1,12,13,8,14,15,2,3,4,16,17,18,19,5,20,21,6,22,23,7])))}),b.jsx(Ze,{path:"/survey",element:Lt(()=>Ot(()=>import("./Survey-CP7wVFIm.js"),__vite__mapDeps([24,12,13,8,14,16,15,17,18,11,3,4,5,22,6,21])))}),b.jsx(Ze,{path:"/pricing",element:Lt(()=>Ot(()=>import("./Pricing-DDTUtTRz.js"),__vite__mapDeps([25,11,12,15,3,4,14,22,6,7,8,21])))}),b.jsx(Ze,{path:"/bookings",element:Lt(()=>Ot(()=>import("./Bookings-BbGscC3O.js"),__vite__mapDeps([26,11,13,8,14,17,3,4,5,20,21,6,22,23,7,27,28])))}),b.jsx(Ze,{path:"/app-users",element:Lt(()=>Ot(()=>import("./TeamUsers-Djs_f-Bi.js"),__vite__mapDeps([29,11,1,12,13,8,14,16,19,3,4,5,6,22,23,7])))}),b.jsx(Ze,{path:"/settings",element:Lt(()=>Ot(()=>import("./Settings-Cp4ure_x.js"),__vite__mapDeps([30,31,3,4,6,14,28,9,21,22])))})]}),b.jsxs(Ze,{element:b.jsx(oO,{}),children:[b.jsx(Ze,{path:"/login",element:Lt(()=>Ot(()=>import("./Login-_QJq_Cs6.js"),__vite__mapDeps([32,31,4,14,22,27,28,6])))}),b.jsx(Ze,{path:"/under-construction",element:Lt(()=>Ot(()=>import("./UnderConstruction-BIaq8IYK.js"),__vite__mapDeps([33,34,6])))}),b.jsx(Ze,{path:"/coming-soon",element:Lt(()=>Ot(()=>import("./ComingSoon-CRbMapOp.js"),__vite__mapDeps([35,14,6])))}),b.jsx(Ze,{path:"/500",element:Lt(()=>Ot(()=>import("./Error500-C7U9zgDa.js"),__vite__mapDeps([36,34,6])))}),b.jsx(Ze,{path:"/404",element:Lt(()=>Ot(()=>import("./Error404-C6jWFP53.js"),__vite__mapDeps([37,34,6])))})]}),b.jsx(Ze,{path:"/",element:b.jsx(Ny,{to:"/dashboard",replace:!0})}),b.jsx(Ze,{path:"*",element:Lt(()=>Ot(()=>import("./Error404-C6jWFP53.js"),__vite__mapDeps([37,34,6])))})]})}ic.createRoot(document.getElementById("root")).render(b.jsx(gn.StrictMode,{children:b.jsxs(Nb,{theme:wd,children:[b.jsx(i$,{}),b.jsx(Y_,{dateAdapter:aM,children:b.jsx(h2,{children:b.jsx(aO,{})})})]})}));export{$t as $,yd as A,Ce as B,o1 as C,Ea as D,Y as E,J as F,ue as G,be as H,MP as I,ne as J,up as K,Ae as L,ea as M,vd as N,gt as O,uu as P,mO as Q,hO as R,H$ as S,jt as T,$M as U,yO as V,vO as W,xO as X,ks as Y,ep as Z,C as _,YC as a,su as a0,On as a1,Yf as a2,Hr as a3,Xe as a4,B0 as a5,TR as a6,nl as a7,cp as a8,NR as a9,SR as aA,bR as aB,ER as aC,ZC as aD,dO as aE,yR as aF,yr as aG,R_ as aH,Db as aI,qr as aJ,el as aK,i1 as aa,UR as ab,Ak as ac,jk as ad,Fl as ae,Xo as af,Or as ag,k0 as ah,cO as ai,al as aj,t$ as ak,dP as al,Ql as am,Ku as an,Sn as ao,lO as ap,Ko as aq,S1 as ar,pO as as,vR as at,gR as au,n1 as av,Bl as aw,Vf as ax,Jt as ay,kR as az,v as b,T1 as c,P1 as d,MM as e,_M as f,LM as g,SO as h,Vt as i,b as j,uO as k,Sd as l,gO as m,U0 as n,p1 as o,wO as p,Hf as q,En as r,E0 as s,fO as t,Zr as u,vn as v,tl as w,we as x,Se as y,ve as z}; diff --git a/dist/index.html b/dist/index.html index ba9fdde..417bf06 100644 --- a/dist/index.html +++ b/dist/index.html @@ -13,7 +13,7 @@ rel="stylesheet" /> Doormile CRM - +