1 line
44 KiB
JavaScript
1 line
44 KiB
JavaScript
"use strict";(self.webpackChunkmantis_material_react=self.webpackChunkmantis_material_react||[]).push([[1504],{23787:(e,t,i)=>{i.d(t,{FG:()=>p,nV:()=>x,pY:()=>g,pg:()=>h});var n=i(89379),o=i(80045),s=i(93230),r=i(2235),l=i(16491),a=i(82053),c=i(44414);const d=["children","scroll","onScroll","sx"],x=e=>{let{children:t,scroll:i=!1,onScroll:r,sx:l}=e,a=(0,o.A)(e,d);return(0,c.jsx)(s.A,(0,n.A)((0,n.A)({spacing:1.25,onScroll:r,sx:(0,n.A)((0,n.A)({p:1.5},i&&{maxHeight:"calc(100vh - 220px)",overflowY:"auto",overflowX:"hidden"}),l)},a),{},{children:t}))},h=e=>{let{accent:t="#662582",header:i,footer:o,selected:s=!1,onClick:a,children:d,sx:x}=e;return(0,c.jsxs)(r.A,{elevation:0,onClick:a,sx:(0,n.A)({position:"relative",overflow:"hidden",flexShrink:0,borderRadius:2.5,border:"1px solid",borderColor:s?t:"#e2e8f0",background:s?"".concat(t,"0a"):"#fff",boxShadow:"0 4px 14px rgba(15,23,42,0.05)",transition:"border-color 0.15s, box-shadow 0.15s"},x),children:[(0,c.jsx)(l.A,{sx:{position:"absolute",left:0,top:0,bottom:0,width:3,bgcolor:t}}),(0,c.jsxs)(l.A,{sx:{p:1.5,pl:2},children:[i,d,o]})]})},p=e=>{let{children:t,columns:i=2,sx:o}=e;return(0,c.jsx)(l.A,{sx:(0,n.A)({display:"grid",gridTemplateColumns:"repeat(".concat(i,", minmax(0, 1fr))"),gap:1,mt:1.25},o),children:t})},g=e=>{let{label:t,value:i,children:n,full:o=!1,align:s="left"}=e;return(0,c.jsxs)(l.A,{sx:{gridColumn:o?"1 / -1":"auto",minWidth:0,textAlign:s},children:[(0,c.jsx)(a.A,{sx:{fontSize:9.5,fontWeight:800,letterSpacing:.5,textTransform:"uppercase",color:"#94a3b8",lineHeight:1.4},children:t}),(0,c.jsx)(l.A,{sx:{mt:.25,minWidth:0},children:void 0!==n?n:(0,c.jsx)(a.A,{sx:{fontSize:13,fontWeight:600,color:"#0f172a"},noWrap:!0,children:null!==i&&void 0!==i?i:"\u2014"})})]})}},56311:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(89379),o=i(9950),s=i(2660),r=i(2046),l=i(83274),a=i(25333),c=i(97125),d=i(7762),x=i(52097),h=i(44414);const p=e=>{let{value:t,onChange:i,onDebouncedChange:p,debounceTime:g=500,placeholder:u="Search (ctrl+k)",sx:A}=e;const m=(0,o.useRef)(null),[f]=(0,x.d7)(t,g);return(0,o.useEffect)((()=>{p&&p(f)}),[f,p]),(0,o.useEffect)((()=>{const e=e=>{var t;"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),null===(t=m.current)||void 0===t||t.focus());"Escape"===e.key&&document.activeElement===m.current&&m.current.blur()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),[]),(0,h.jsx)(s.A,{sx:(0,n.A)({},A),inputRef:m,placeholder:u,autoComplete:"off",value:t,fullWidth:!0,onChange:e=>i(e.target.value),startAdornment:(0,h.jsx)(r.A,{position:"start",sx:{mr:-.5},children:(0,h.jsx)(c.A,{})}),endAdornment:(0,h.jsx)(l.A,{title:"Clear",children:(0,h.jsx)(a.A,{sx:{visibility:t?"visible":"hidden"},onClick:()=>i(""),children:(0,h.jsx)(d.A,{})})})})}},59212:(e,t,i)=>{i.d(t,{A:()=>h});var n=i(89379),o=i(9950),s=i(93230),r=i(41413),l=i(77922),a=i(29925),c=i(26910),d=i(31222),x=i(44414);const h=(0,o.forwardRef)(((e,t)=>{let{setAppId:i,setLocoName:h,setPage:p,sx:g,textfeildSx:u,textfieldSx:A,pill:m=!1,accentColor:f="#6366f1",icon:j,placeholder:b="Select Zone",paperComponent:v}=e;const[y,S]=(0,o.useState)(JSON.parse(localStorage.getItem("applocations")||"[]"));(0,o.useEffect)((()=>{0===y.length&&(async()=>{try{const e=localStorage.getItem("userid");if(!e)return;const t=await c.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/partners/getlocations/?userid=").concat(e));if(t.data.status){const e=[...t.data.details,{locationname:"All",applocationid:0}];localStorage.setItem("applocations",JSON.stringify(e)),S(e)}}catch(e){console.error("Error fetching locations in LocationAutocomplete:",e)}})()}),[y.length]);const w=e=>"".concat(f).concat(e),C=w("08"),z=w("26"),k=w("55"),W=w("18"),I=m?{cursor:"pointer","& .MuiOutlinedInput-root":{borderRadius:"999px",bgcolor:C,fontWeight:600,color:"#0f172a",paddingRight:"8px",cursor:"pointer",transition:"border-color 0.15s, box-shadow 0.15s, background-color 0.2s","& fieldset":{borderColor:k,borderWidth:1.5},"&:hover fieldset":{borderColor:f},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(z)},"&.Mui-focused fieldset":{borderColor:f,borderWidth:2}},"& .MuiAutocomplete-endAdornment .MuiSvgIcon-root":{color:f}}:{},P=m&&(0,x.jsx)(s.A,{direction:"row",alignItems:"center",spacing:.75,sx:{pl:.5,mr:.25,flexShrink:0},children:(0,x.jsx)(r.A,{sx:{width:24,height:24,bgcolor:W,color:f,transition:"background-color 0.15s, color 0.15s"},children:j||(0,x.jsx)(d.HPi,{size:14})})});return(0,x.jsx)(l.A,{id:"location-autocomplete",options:y||[],getOptionLabel:e=>{var t;return null!==(t=null===e||void 0===e?void 0:e.locationname)&&void 0!==t?t:""},PaperComponent:v,sx:(0,n.A)({},g),onChange:(e,t,n)=>{"clear"===n?(null===i||void 0===i||i(0),null===h||void 0===h||h(""),null===p||void 0===p||p(0)):t&&(null===i||void 0===i||i(t.applocationid),null===h||void 0===h||h(t.locationname),null===p||void 0===p||p(0))},renderInput:e=>m?(0,x.jsx)(a.A,(0,n.A)((0,n.A)({},e),{},{inputRef:t,placeholder:b,InputProps:(0,n.A)((0,n.A)({},e.InputProps),{},{startAdornment:P}),sx:(0,n.A)((0,n.A)({},I),A||u||{})})):(0,x.jsx)(a.A,(0,n.A)((0,n.A)({},e),{},{inputRef:t,label:"Select Zones",sx:(0,n.A)({},A||u||{})}))})}))},71504:(e,t,i)=>{i.r(t),i.d(t,{default:()=>_e});var n=i(89379),o=i(9950),s=i(50027),r=i(26910),l=i(14857),a=i(52351),c=i(13838),d=i(4159),x=i.n(d),h=i(8881),p=i(99459),g=i(28217),u=i(55471),A=i.n(u),m=i(21209),f=i(2235),j=i(41413),b=i(47223),v=i(93230),y=i(82053),S=i(16491),w=i(60899),C=i(82917),z=i(1320),k=i(15769),W=i(69780),I=i(9213),P=i(21671),M=i(34075),R=i(83274),Y=i(25333),K=i(33738),L=i(48159),_=i(84142),E=i(48089),T=i(82223),D=i(50704),O=i(29925),H=i(77922),B=i(25713),F=i(74745),N=i(6258),V=i(96583),q=i(40033),X=i(28170),J=i(29277),U=i(79739),Z=i(23787),G=i(9083),Q=i(8203),$=i(4729),ee=i(12678),te=i(94118),ie=i(24513),ne=i(37476),oe=i(54826),se=i(63057),re=i(85527),le=i(74930),ae=i(31222),ce=i(21636),de=i(39174),xe=i(59212),he=i(56311),pe=i(36150),ge=i(81425),ue=i(96646),Ae=i(44414);const me=16,fe="0 8px 24px rgba(15, 23, 42, 0.08)",je="0 18px 50px rgba(15, 23, 42, 0.18)",be="#0f172a",ve="#64748b",ye="#94a3b8",Se="#e2e8f0",we="#f1f5f9",Ce="#f8fafc",ze=(e,t)=>"".concat(e).concat(t),ke=e=>ze(e,"08"),We=e=>ze(e,"18"),Ie=e=>ze(e,"26"),Pe=e=>ze(e,"55"),Me={active:{label:"Active",color:"#10b981",icon:ae.mU9,statusKey:"active"},pending:{label:"Pending",color:"#f59e0b",icon:ae.tX0,statusKey:"pending"},inactive:{label:"Inactive",color:"#ef4444",icon:ae.uDv,statusKey:"inactive"}},Re=[{status:"active",countKey:"active",tabStatus:"Active"},{status:"pending",countKey:"pending",tabStatus:"Pending"},{status:"inactive",countKey:"inactive",tabStatus:"InActive"}],Ye=[{key:"active",label:"Active Tenants",color:"#10b981",icon:ae.mU9,countKey:"active"},{key:"pending",label:"Pending Approval",color:"#f59e0b",icon:ae.tX0,countKey:"pending"},{key:"inactive",label:"Inactive Tenants",color:"#ef4444",icon:ae.uDv,countKey:"inactive"}],Ke=e=>(0,Ae.jsx)(f.A,(0,n.A)((0,n.A)({},e),{},{sx:{mt:.75,borderRadius:2,boxShadow:je,border:"1px solid",borderColor:"divider",overflow:"hidden"}})),Le=e=>{let{color:t,selected:i,size:n=24,children:o}=e;return(0,Ae.jsx)(j.A,{sx:{width:n,height:n,bgcolor:i?t:We(t),color:i?"#fff":t,transition:"background-color 0.15s, color 0.15s"},children:o})},_e=()=>{var e;const t=(0,o.useRef)(null),[i,d]=(0,o.useState)(""),[u,je]=(0,o.useState)(""),[ze,_e]=o.useState(10),Ee=(0,l.A)(),Te=(0,b.A)(Ee.breakpoints.down("md")),[De,Oe]=(0,o.useState)(!1),[He,Be]=(0,o.useState)(0),[Fe,Ne]=(0,o.useState)(""),[Ve]=(0,o.useState)("All"),[qe,Xe]=o.useState(null),[Je,Ue]=(0,o.useState)(0),[Ze,Ge]=(0,o.useState)(0),[Qe,$e]=(0,o.useState)(0),[et,tt]=(0,o.useState)(null),[it,nt]=(0,o.useState)([]),[ot,st]=(0,o.useState)("active"),[rt,lt]=(0,o.useState)({}),[at,ct]=(0,o.useState)(!1),[dt,xt]=(0,o.useState)([]),[ht,pt]=(0,o.useState)({}),[gt,ut]=(0,o.useState)(!0),[At,mt]=(0,o.useState)(""),[ft,jt]=(0,o.useState)(""),[bt,vt]=(0,o.useState)(""),[yt,St]=(0,o.useState)({}),[wt,Ct]=(0,o.useState)({}),[zt,kt]=(0,o.useState)(0),[Wt,It]=(0,o.useState)("Active"),Pt=()=>{ct(!1)},Mt=(e,t)=>{It(0==t?"Active":1==t?"Pending":"InActive"),Ue(t),d(""),kt(0)},Rt=(e,t)=>{console.log("newValue1",t),Ge(t)},Yt=(e,t)=>{console.log("newValue2",t),$e(t)},[Kt,Lt]=(0,o.useState)(null),[_t,Et]=(0,o.useState)(null),Tt=e=>{Lt((t=>t===e?null:e))};(0,o.useEffect)((()=>{console.log("selectedCustomer",rt)}),[rt]),(0,o.useEffect)((()=>{Lt(-1),Et(-1)}),[Je]);const Dt=(e,t,i)=>{(0,h.M8)(e,{variant:t,anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:i})};const Ot={current:null},[Ht,Bt]=(0,o.useState)(""),[Ft,Nt]=(0,o.useState)([]),Vt=(0,o.useRef)(!1);"undefined"===typeof window||Vt.current||(document.querySelector("#google-maps")||function(e,t,i){if(!t)return;const n=document.createElement("script");n.setAttribute("async",""),n.setAttribute("id",i),n.src=e,t.appendChild(n)}("https://maps.googleapis.com/maps/api/js?key=".concat("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8","&libraries=places"),document.querySelector("head"),"google-maps"),Vt.current=!0);const qt=(0,o.useMemo)((()=>(0,m.A)(((e,t)=>{Ot.current.getPlacePredictions(e,t)}),400)),[]);(0,o.useEffect)((()=>{let e=!0;if(!Ot.current&&window.google&&(Ot.current=new window.google.maps.places.AutocompleteService),Ot.current){if(""!==Ht)return qt({input:Ht},(t=>{if(e){let e=[];qe&&(e=[qe]),t&&(e=[...e,...t]),Nt(e)}})),()=>{e=!1};Nt(qe?[qe]:[])}}),[qe,Ht,qt]),p.A.setApiKey("AIzaSyCF4KatYCI3vqz1_H3kiHeyS3yCMfYToh8"),(0,o.useEffect)((()=>{try{console.log("selected address =>",At),p.A.fromAddress(At).then((e=>{if(console.log("lat long response =>",e.results[0]),"OK"==e.status){const{lat:t,lng:i}=e.results[0].geometry.location;if(St({lat:t,lng:i}),Ct((0,n.A)((0,n.A)({},wt),{},{latitude:t.toString(),longitude:i.toString()})),e.results[0].address_components){let t,i,o,s,r=e.results[0];for(let e=0;e<r.address_components.length;e++)for(let n=0;n<r.address_components[e].types.length;n++)switch(r.address_components[e].types[n]){case"locality":t=r.address_components[e].long_name;break;case"administrative_area_level_1":o=r.address_components[e].long_name;break;case"postal_code":i=r.address_components[e].long_name;break;case"sublocality":s=r.address_components[e].long_name}jt(t||""),setState(o||""),vt(i||""),setSuburb(s||""),Ct((0,n.A)((0,n.A)({},wt),{},{city:t||"",state:o||"",postcode:bt||"",suburb:s||""}))}}}),(e=>{console.log(e)}))}catch(e){console.log(e)}}),[At]),(0,o.useEffect)((()=>{rt&&St({lat:rt.latitude,lng:rt.longitude})}),[rt]),(0,o.useEffect)((()=>{const e=e=>{"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),t.current.focus()),"Escape"===e.key&&document.activeElement===t.current&&t.current.blur()};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}),[]);const{data:Xt,isLoading:Jt,refetch:Ut}=(0,pe.I)({queryKey:["tenantList",He,u,ot,zt,ze],queryFn:ge.ry}),{data:Zt=[],isLoading:Gt,refetch:Qt}=(0,pe.I)({queryKey:["gettenantsummary",He,ot],queryFn:ge.bd}),$t=async()=>{await r.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/getpricinglist/?tenantid=").concat(et)).then((e=>{console.log("getpricinglist",e),e.data.status&&nt(e.data.details)})).catch((e=>{console.log(e)}))};(0,o.useEffect)((()=>{et&&$t()}),[et]);(0,o.useEffect)((()=>{et&&(async e=>{try{let t=await r.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/gettenantpricing/?tenantid=").concat(e));console.log("tenantPricing",t.data.details),setTenanatPricing(t.data.details)}catch(t){console.log("fetchTenanatPricing",t)}})(et)}),[et]);const ei=async e=>{let t;Oe(!0),t=-1==e?{tenantid:et,approved:1}:{tenantid:e,status:"active"===ot?"InActive":"Active"},await r.A.put("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/update"),t).then((e=>{e.data.status&&(Dt(0==Je?"Inactivated Successfully":1==Je?"Approved Successfully":"Activate Successfully","success",2e3),Ut(),Qt(),Oe(!1))})).catch((e=>{console.log(e),Dt(e.message,"error",1500),Oe(!1)}))},ti=async e=>{console.log("id",e);try{let t=await r.A.get("".concat("https://jupiter.nearle.app/live/api/v1","/utils/getapppricing/?applocationid=").concat(e));console.log("appPricingRes",t.data.details),xt(t.data.details)}catch(t){console.log("appPricingRes",t)}},ii=async()=>{Oe(!0),await r.A.post("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/createpricing"),{tenantpricingid:0,applocationid:He,pricingid:ht.pricingid,tenantid:et,pricingdate:x()().format("YYYY-MM-DD HH:mm:ss"),configid:ht.configid,pricingtypeid:ht.pricingtypeid,slab:ht.slab,baseprice:+ht.baseprice,priceperkm:+ht.priceperkm,minkm:+ht.minkm,maxkm:+ht.maxkm,orders:+ht.minorder,othercharges:0}).then((e=>{e.data.status&&((0,h.M8)("Price Created Successfully",{variant:"success",anchorOrigin:{vertical:"top",horizontal:"right"},autoHideDuration:2e3}),Pt(),pt({}),ei(-1),$t())})).catch((e=>{console.log(e)}))},ni=Me[null===(e=Re[Je])||void 0===e?void 0:e.status]||Me.active;return(0,Ae.jsxs)(Ae.Fragment,{children:[(Jt||Gt||De)&&(0,Ae.jsx)(a.A,{}),(0,Ae.jsx)(f.A,{elevation:0,sx:{mb:{xs:1.5,md:2},p:{xs:1.5,sm:2,md:2.5},borderRadius:me/8,border:"1px solid",borderColor:Se,background:"linear-gradient(135deg, ".concat(ke("#6366f1")," 0%, ").concat(ke("#0ea5e9")," 100%)"),boxShadow:fe},children:(0,Ae.jsxs)(v.A,{direction:{xs:"column",sm:"row"},alignItems:{xs:"flex-start",sm:"center"},justifyContent:"space-between",spacing:{xs:1.5,sm:2},children:[(0,Ae.jsxs)(v.A,{direction:"row",alignItems:"center",spacing:{xs:1.25,sm:1.75},children:[(0,Ae.jsx)(j.A,{sx:{width:{xs:40,sm:48},height:{xs:40,sm:48},bgcolor:"#6366f1",color:"#fff",boxShadow:"0 6px 18px rgba(99,102,241,0.32)"},children:(0,Ae.jsx)(ae.Itr,{size:22})}),(0,Ae.jsxs)(v.A,{children:[(0,Ae.jsx)(y.A,{variant:"h3",sx:{fontWeight:800,color:be,lineHeight:1.1,fontSize:{xs:"1.25rem",sm:"1.5rem",md:"1.75rem"}},children:"Tenants"}),(0,Ae.jsxs)(v.A,{direction:"row",alignItems:"center",spacing:.75,sx:{mt:.5},children:[(0,Ae.jsx)(S.A,{sx:{width:8,height:8,borderRadius:"50%",bgcolor:"#10b981",boxShadow:"0 0 0 4px rgba(16,185,129,0.18)"}}),(0,Ae.jsxs)(y.A,{variant:"caption",sx:{color:ve,fontWeight:600},children:["Live \xb7 ",Fe||"All Zones"]})]})]})]}),(0,Ae.jsx)(xe.A,{locations:Ve,locaName:Fe,setAppId:Be,setLocoName:Ne,setPage:kt,pill:!0,accentColor:"#6366f1",icon:(0,Ae.jsx)(ae.HPi,{size:14}),placeholder:"Select Zone",paperComponent:Ke,sx:{width:{xs:"100%",sm:280},zIndex:100}})]})}),(0,Ae.jsx)(w.Ay,{container:!0,spacing:{xs:1.25,sm:1.5,md:2},sx:{mt:"1px"},children:Ye.map((e=>{var t;const i=e.icon,n=null!==(t=null===Zt||void 0===Zt?void 0:Zt[e.countKey])&&void 0!==t?t:0;return(0,Ae.jsx)(w.Ay,{item:!0,xs:12,sm:4,children:(0,Ae.jsxs)(f.A,{elevation:0,sx:{position:"relative",overflow:"hidden",p:{xs:1.25,sm:1.75,md:2.25},borderRadius:me/8,border:"1px solid",borderColor:Se,background:"#fff",transition:"transform 0.2s, box-shadow 0.2s, border-color 0.2s",cursor:"pointer","&:hover":{transform:"translateY(-3px)",boxShadow:fe,borderColor:Pe(e.color)}},onClick:()=>{const t=Re.findIndex((t=>t.countKey===e.countKey));t>=0&&Mt(0,t)},children:[(0,Ae.jsx)(S.A,{sx:{position:"absolute",top:0,left:0,right:0,height:3,background:"linear-gradient(90deg, ".concat(e.color," 0%, ").concat(We(e.color)," 100%)")}}),(0,Ae.jsxs)(v.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,Ae.jsxs)(v.A,{spacing:.5,sx:{minWidth:0,flex:1},children:[(0,Ae.jsx)(y.A,{variant:"caption",sx:{color:ve,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",fontSize:{xs:10,sm:11},whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.label}),Gt?(0,Ae.jsx)(C.A,{sx:{width:70,height:{xs:28,md:36}},animation:"wave"}):(0,Ae.jsx)(y.A,{sx:{fontWeight:800,color:be,lineHeight:1.1,fontSize:{xs:"1.5rem",sm:"1.75rem",md:"2rem"}},children:n})]}),(0,Ae.jsx)(j.A,{sx:{width:{xs:36,sm:42,md:48},height:{xs:36,sm:42,md:48},bgcolor:We(e.color),color:e.color,boxShadow:"inset 0 0 0 1px ".concat(Pe(e.color)),flexShrink:0},children:(0,Ae.jsx)(i,{size:20})})]})]})},e.key)}))}),(0,Ae.jsx)(f.A,{elevation:0,sx:{mt:{xs:1.5,md:2},p:{xs:1,md:1.5},borderTopLeftRadius:me/8,borderTopRightRadius:me/8,borderBottomLeftRadius:0,borderBottomRightRadius:0,border:"1px solid",borderColor:Se,borderBottom:0,background:"#fff"},children:(0,Ae.jsxs)(v.A,{direction:"row",alignItems:"center",justifyContent:"space-between",gap:1.5,sx:{flexWrap:"wrap-reverse"},children:[(0,Ae.jsx)(v.A,{direction:"row",spacing:.75,sx:{flex:1,overflowX:"auto",py:.5,px:.25,"&::-webkit-scrollbar":{height:6},"&::-webkit-scrollbar-thumb":{backgroundColor:Se,borderRadius:4}},children:Re.map(((e,t)=>{var i;const n=Me[e.status],o=n.icon,s=Je===t,r=null!==(i=null===Zt||void 0===Zt?void 0:Zt[e.countKey])&&void 0!==i?i:0;return(0,Ae.jsxs)(S.A,{onClick:()=>{st(e.status),Mt(0,t)},sx:{display:"inline-flex",alignItems:"center",gap:{xs:.625,md:.875},pl:.5,pr:{xs:1,md:1.25},py:.5,flexShrink:0,cursor:"pointer",borderRadius:999,border:"1.5px solid ".concat(s?n.color:Pe(n.color)),bgcolor:s?n.color:ke(n.color),color:s?"#fff":n.color,fontWeight:700,boxShadow:s?"0 6px 18px ".concat(Ie(n.color)):"none",transition:"all 0.18s","&:hover":{borderColor:n.color,boxShadow:s?"0 6px 18px ".concat(Ie(n.color)):"0 0 0 3px ".concat(Ie(n.color))}},children:[(0,Ae.jsx)(j.A,{sx:{width:{xs:22,md:26},height:{xs:22,md:26},bgcolor:s?"rgba(255,255,255,0.22)":We(n.color),color:s?"#fff":n.color},children:(0,Ae.jsx)(o,{size:13})}),(0,Ae.jsx)(y.A,{variant:"caption",sx:{fontWeight:800,fontSize:{xs:11.5,md:13},lineHeight:1},children:n.label}),(0,Ae.jsx)(S.A,{sx:{minWidth:{xs:22,md:26},height:{xs:18,md:22},px:.625,display:"inline-flex",alignItems:"center",justifyContent:"center",borderRadius:999,fontSize:{xs:10,md:11},fontWeight:800,bgcolor:s?"rgba(255,255,255,0.22)":"#fff",color:s?"#fff":n.color,border:s?"none":"1px solid ".concat(Pe(n.color))},children:Gt?(0,Ae.jsx)(C.A,{variant:"text",width:14,height:10}):r})]},e.status)}))}),(0,Ae.jsx)(S.A,{sx:{width:{xs:"100%",sm:240,lg:280},flex:{xs:"1 1 100%",sm:"0 0 auto"}},children:(0,Ae.jsx)(he.A,{value:i,onChange:d,onDebouncedChange:je,sx:{m:0,width:"100%",borderRadius:999,bgcolor:ke("#6366f1"),"& fieldset":{borderColor:Pe("#6366f1"),borderWidth:1.5},"&:hover fieldset":{borderColor:"#6366f1"},"&.Mui-focused fieldset":{borderColor:"#6366f1",borderWidth:2},"&.Mui-focused":{boxShadow:"0 0 0 3px ".concat(Ie("#6366f1"))}}})})]})}),(0,Ae.jsxs)(f.A,{elevation:0,sx:{borderTopLeftRadius:0,borderTopRightRadius:0,borderBottomLeftRadius:me/8,borderBottomRightRadius:me/8,border:"1px solid",borderColor:Se,overflow:"hidden",background:"#fff"},children:[(0,Ae.jsx)(z.A,{sx:{display:{xs:"none",md:"block"},maxHeight:{xs:"calc(100vh - 220px)",md:"calc(100vh - 190px)"},"&::-webkit-scrollbar":{width:"10px",height:"10px"},"&::-webkit-scrollbar-thumb":{backgroundColor:Pe("#6366f1"),borderRadius:"8px","&:hover":{backgroundColor:"#6366f1"}},"&::-webkit-scrollbar-track":{backgroundColor:Ce}},children:(0,Ae.jsxs)(k.A,{stickyHeader:!0,sx:{minWidth:{xs:720,md:960}},children:[(0,Ae.jsx)(W.A,{children:(0,Ae.jsxs)(I.A,{sx:{"& th":{backgroundColor:Ce,color:ve,fontSize:{xs:10,md:11},fontWeight:800,letterSpacing:.6,textTransform:"uppercase",whiteSpace:"nowrap",borderBottom:"1px solid ".concat(Se),py:{xs:1,md:1.25},px:{xs:1,md:2}}},children:[(0,Ae.jsx)(P.A,{children:"#"}),(0,Ae.jsx)(P.A,{children:"Status"}),(0,Ae.jsx)(P.A,{children:"Client"}),(0,Ae.jsx)(P.A,{children:"Contact"}),(0,Ae.jsx)(P.A,{children:"Address"}),(0,Ae.jsx)(P.A,{align:"right",children:"Actions"})]})}),(0,Ae.jsxs)(M.A,{children:[Jt&&(0,Ae.jsx)(ue.r,{}),0!=(null===Xt||void 0===Xt?void 0:Xt.length)||De?null===Xt||void 0===Xt?void 0:Xt.map(((e,t)=>{var i;const l=Me[0===Je?"active":1===Je?"pending":"inactive"],a=l.icon;return(0,Ae.jsxs)(o.Fragment,{children:[(0,Ae.jsxs)(I.A,{sx:{cursor:"pointer",transition:"background-color 0.15s","& td":{borderBottom:"1px solid ".concat(we),py:{xs:1,md:1.5},px:{xs:1,md:2}},"&:hover":{backgroundColor:Ce}},children:[(0,Ae.jsx)(P.A,{children:(0,Ae.jsx)(y.A,{variant:"caption",sx:{fontWeight:700,color:ye},children:String(t+1+zt*ze).padStart(2,"0")})}),(0,Ae.jsx)(P.A,{children:(0,Ae.jsxs)(v.A,{direction:"row",alignItems:"center",spacing:.5,sx:{display:"inline-flex",pl:.5,pr:1,py:.25,borderRadius:999,bgcolor:ke(l.color),border:"1px solid ".concat(Pe(l.color)),color:l.color},children:[(0,Ae.jsx)(Le,{color:l.color,size:20,children:(0,Ae.jsx)(a,{size:12})}),(0,Ae.jsx)(y.A,{variant:"caption",sx:{fontWeight:800,fontSize:11,lineHeight:1},children:l.label})]})}),(0,Ae.jsx)(P.A,{children:(0,Ae.jsxs)(v.A,{direction:"row",alignItems:"center",spacing:1,children:[(0,Ae.jsx)(Le,{color:"#6366f1",size:32,children:(0,Ae.jsx)(ae.Azs,{size:16})}),(0,Ae.jsxs)(v.A,{children:[(0,Ae.jsx)(y.A,{variant:"subtitle2",sx:{fontWeight:700,color:be,whiteSpace:"nowrap"},children:e.tenantname}),(0,Ae.jsxs)(y.A,{variant:"caption",sx:{color:ve},children:["ID #",e.tenantid]})]})]})}),(0,Ae.jsx)(P.A,{children:(0,Ae.jsxs)(v.A,{children:[(0,Ae.jsx)(y.A,{variant:"subtitle2",sx:{fontWeight:700,color:be,whiteSpace:"nowrap"},children:e.primarycontact||"\u2014"}),(0,Ae.jsx)(y.A,{variant:"caption",sx:{color:ve},children:e.primaryemail||"\u2014"})]})}),(0,Ae.jsx)(P.A,{sx:{maxWidth:280},children:(0,Ae.jsx)(R.A,{title:e.address||"",placement:"top",children:(0,Ae.jsx)(y.A,{variant:"caption",sx:{color:ve,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.address||"\u2014"})})}),(0,Ae.jsx)(P.A,{align:"right",children:(0,Ae.jsxs)(v.A,{direction:"row",spacing:.75,justifyContent:"flex-end",children:[0==Je&&(0,Ae.jsx)(R.A,{title:"Inactivate",placement:"top",children:(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:We("#ef4444"),color:"#ef4444",border:"1px solid ".concat(Pe("#ef4444")),"&:hover":{bgcolor:"#ef4444",color:"#fff"}},onClick:()=>{lt(e),tt(e.tenantid),Be(e.applocationid),setTimeout((()=>{ei(e.tenantid)}),100)},children:(0,Ae.jsx)(G.A,{style:{fontSize:14}})})}),1==Je&&(0,Ae.jsx)(R.A,{title:"Approve",placement:"top",children:(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:We("#f59e0b"),color:"#f59e0b",border:"1px solid ".concat(Pe("#f59e0b")),"&:hover":{bgcolor:"#f59e0b",color:"#fff"}},onClick:()=>{lt(e),ct(!0),tt(e.tenantid),Be(e.applocationid),ti(e.applolcationid)},children:(0,Ae.jsx)(Q.A,{style:{fontSize:14}})})}),2==Je&&(0,Ae.jsx)(R.A,{title:"Activate",placement:"top",children:(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:We("#10b981"),color:"#10b981",border:"1px solid ".concat(Pe("#10b981")),"&:hover":{bgcolor:"#10b981",color:"#fff"}},onClick:()=>{lt(e),tt(e.tenantid),Be(e.applocationid),setTimeout((()=>{ei(e.tenantid)}),100)},children:(0,Ae.jsx)(oe.yjt,{style:{fontSize:14}})})}),(0,Ae.jsx)(R.A,{title:Kt===t?"Hide details":"View details",placement:"top",children:(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:Kt===t?"#6366f1":We("#6366f1"),color:Kt===t?"#fff":"#6366f1",border:"1px solid ".concat(Pe("#6366f1")),"&:hover":{bgcolor:"#6366f1",color:"#fff"}},onClick:()=>{lt(e),Tt(t),Et(-1),tt(e.tenantid)},children:Kt===t?(0,Ae.jsx)($.A,{style:{fontSize:14}}):(0,Ae.jsx)(ee.A,{style:{fontSize:14}})})}),1!==Je&&(0,Ae.jsx)(R.A,{title:_t===t?"Close":"Edit",placement:"top",children:(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:_t===t?"#8b5cf6":We("#8b5cf6"),color:_t===t?"#fff":"#8b5cf6",border:"1px solid ".concat(Pe("#8b5cf6")),"&:hover":{bgcolor:"#8b5cf6",color:"#fff"}},onClick:()=>{var i;lt(e),i=t,Et((e=>e===i?null:i)),Lt(-1),tt(e.tenantid),Be(e.applocationid)},children:_t===t?(0,Ae.jsx)(te.A,{style:{fontSize:14}}):(0,Ae.jsx)(ie.A,{style:{fontSize:14}})})})]})})]}),Kt===t&&(0,Ae.jsx)(I.A,{children:(0,Ae.jsx)(P.A,{sx:{"&:hover":{backgroundColor:"white !important"}},colSpan:15,children:(0,Ae.jsx)(K.A,{in:open,timeout:800,easing:"ease-in-out",mountOnEnter:!0,unmountOnExit:!1,sx:{"& .MuiCollapse-wrapperInner":{transition:"transform 800ms ease, opacity 800ms ease"}},children:(0,Ae.jsxs)(s.A,{content:!1,sx:{transform:open?"translateY(0)":"translateY(-8px)",opacity:open?1:0},title:(0,Ae.jsxs)(L.A,{sx:{bgcolor:"primary.lighter"},value:Ze,onChange:Rt,"aria-label":"basic tabs example",children:[(0,Ae.jsx)(_.A,{label:" Details",icon:(0,Ae.jsx)(se.gA5,{style:{marginRight:5,fontSize:"20px",marginBottom:-1}}),sx:{alignItems:"center",flexDirection:"row"}}),(0,Ae.jsx)(_.A,{label:"Pricing",icon:(0,Ae.jsx)(re.FA6,{style:{marginRight:5,fontSize:"20px",marginBottom:-1}}),sx:{alignItems:"center",flexDirection:"row"}})]}),children:[0==Ze&&(0,Ae.jsxs)(w.Ay,{container:!0,sx:{m:1},spacing:2.5,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,xs:6,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(le.JXP,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,Ae.jsx)(y.A,{align:"left",children:e.tenantname}),(0,Ae.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"Tenant"})]})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:6,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(le.JXP,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,Ae.jsx)(y.A,{align:"left",children:e.firstname}),(0,Ae.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"Contact Person"})]})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:6,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(le.wnV,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,Ae.jsx)(y.A,{align:"left",children:e.primarycontact}),(0,Ae.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"Phone"})]})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:6,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(ce.h2r,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,Ae.jsx)(y.A,{align:"left",children:e.primaryemail}),(0,Ae.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"E-Mail"})]})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:12,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(oe.Y9o,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,Ae.jsx)(y.A,{align:"left",children:e.address}),(0,Ae.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"Address"})]})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:12,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(re.BUW,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,Ae.jsx)(y.A,{align:"left",children:e.city}),(0,Ae.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"City"})]}),(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(ae.kci,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,Ae.jsx)(y.A,{align:"left",variant:"subtitle1",children:e.postcode}),(0,Ae.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"PostCode"})]})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:12,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(se.J0X,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,Ae.jsx)(y.A,{align:"left",children:e.latitude}),(0,Ae.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"Latitude"})]}),(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(se.u3h,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:[(0,Ae.jsx)(y.A,{align:"left",variant:"subtitle1",children:e.longitude}),(0,Ae.jsx)(y.A,{align:"left",variant:"caption",color:"secondary",children:"Longitude"})]})]})})]}),1==Ze&&(0,Ae.jsx)(E.A,{variant:"outlined",sx:{},children:(0,Ae.jsx)(z.A,{children:(0,Ae.jsxs)(k.A,{children:[(0,Ae.jsx)(W.A,{children:(0,Ae.jsxs)(I.A,{children:[(0,Ae.jsx)(P.A,{children:"#"}),(0,Ae.jsx)(P.A,{children:"Date"}),(0,Ae.jsx)(P.A,{children:"Slab"}),(0,Ae.jsx)(P.A,{children:"Base Price"}),(0,Ae.jsx)(P.A,{children:"Min Kms"}),(0,Ae.jsx)(P.A,{children:"Price/Km"}),(0,Ae.jsx)(P.A,{children:"Other Charges"})]})}),(0,Ae.jsx)(M.A,{children:0===(null===it||void 0===it?void 0:it.length)?(0,Ae.jsx)(I.A,{children:(0,Ae.jsx)(P.A,{colSpan:7,align:"center",children:(0,Ae.jsx)(c.A,{description:"No Pricing List"})})}):it.map(((e,t)=>(0,Ae.jsxs)(I.A,{sx:{bgcolor:"white"},children:[(0,Ae.jsx)(P.A,{children:t+1}),(0,Ae.jsx)(P.A,{children:x()(e.pricingdate).format("DD-MM-YYYY")}),(0,Ae.jsx)(P.A,{children:e.slab}),(0,Ae.jsx)(P.A,{children:e.baseprice}),(0,Ae.jsx)(P.A,{children:e.minkm}),(0,Ae.jsx)(P.A,{children:e.priceperkm}),(0,Ae.jsx)(P.A,{children:e.othercharges})]},e.id||t)))})]})})},"left - card")]})})})}),_t===t&&(0,Ae.jsx)(I.A,{children:(0,Ae.jsx)(P.A,{sx:{backgroundColor:"white!important","&:hover":{backgroundColor:"white!important"}},colSpan:15,children:(0,Ae.jsxs)(s.A,{content:!1,title:(0,Ae.jsxs)(S.A,{sx:{bgcolor:"primary.lighter",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,Ae.jsxs)(L.A,{value:Qe,onChange:Yt,"aria-label":"basic tabs example",children:[(0,Ae.jsx)(_.A,{label:"Edit Details",icon:(0,Ae.jsx)(se.gA5,{style:{marginRight:5,fontSize:"20px",marginBottom:-1}}),sx:{alignItems:"center",flexDirection:"row"}}),1!==Je&&(0,Ae.jsx)(_.A,{label:"Edit Pricing",icon:(0,Ae.jsx)(re.FA6,{style:{marginRight:5,fontSize:"20px",marginBottom:-1}}),sx:{alignItems:"center",flexDirection:"row"},onClick:()=>{ti(rt.applolcationid)}})]}),1==Qe&&(0,Ae.jsx)(T.A,{variant:"contained",color:"error",size:"smaller",startIcon:(0,Ae.jsx)(ie.A,{size:"small"}),sx:{mr:1.8,height:"30px"},onClick:()=>{ct(!0)},children:"Add Pricing"})]}),children:[0==Qe&&(0,Ae.jsx)(E.A,{variant:"outlined",sx:{m:2},children:(0,Ae.jsx)(w.Ay,{container:!0,spacing:0,children:(0,Ae.jsx)(w.Ay,{item:!0,xs:12,children:(0,Ae.jsxs)(E.A,{variant:"outlined",children:[(0,Ae.jsx)(D.A,{children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:2.5,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,xs:6,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(de.PY8,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,Ae.jsx)(O.A,{fullWidth:!0,id:"outlined-basic",label:"Tenant Name",defaultValue:rt.tenantname,variant:"outlined",onChange:e=>{Ct((0,n.A)((0,n.A)({},wt),{},{tenantname:e.target.value}))},sx:{mt:2}})})]})})," ",(0,Ae.jsx)(w.Ay,{item:!0,xs:6,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(le.JXP,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,Ae.jsx)(O.A,{fullWidth:!0,id:"outlined-basic",label:"Contact Person",defaultValue:e.firstname,variant:"outlined",onChange:e=>{Ct((0,n.A)((0,n.A)({},wt),{},{firstname:e.target.value}))},sx:{mt:2}})})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:6,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(le.wnV,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,Ae.jsx)(O.A,{inputProps:{maxLength:10},fullWidth:!0,id:"outlined-basic",label:"Contact Number",defaultValue:rt.primarycontact,variant:"outlined",onChange:e=>{Ct((0,n.A)((0,n.A)({},wt),{},{primarycontact:e.target.value}))},sx:{mt:2}})})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:6,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(ce.h2r,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,Ae.jsx)(O.A,{fullWidth:!0,id:"outlined-basic",label:"E-Mail",defaultValue:rt.primaryemail,variant:"outlined",onChange:e=>{Ct((0,n.A)((0,n.A)({},wt),{},{primaryemail:e.target.value}))},sx:{mt:2}})})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:12,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(oe.Y9o,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,Ae.jsx)(H.A,{id:"google-map-demo",sx:{},fullWidth:!0,label:"Address",getOptionLabel:e=>"string"===typeof e?e:e.description,filterOptions:e=>e,options:Ft,autoComplete:!0,includeInputInList:!0,filterSelectedOptions:!0,defaultValue:rt.address,noOptionsText:"No locations",onChange:(e,t)=>{Nt(t?[t,...Ft]:Ft),Xe(t||""),console.log("newValue",t),mt((null===t||void 0===t?void 0:t.description)||""),Ct((0,n.A)((0,n.A)({},wt),{},{address:(null===t||void 0===t?void 0:t.description)||""}))},onInputChange:(e,t)=>{Bt(t)},renderInput:e=>(0,Ae.jsx)(O.A,(0,n.A)((0,n.A)({},e),{},{fullWidth:!0,label:"Address",variant:"outlined"})),renderOption:(e,t)=>{const i=t.structured_formatting.main_text_matched_substrings||[],o=A()(t.structured_formatting.main_text,i.map((e=>[e.offset,e.offset+e.length])));return(0,Ae.jsx)("li",(0,n.A)((0,n.A)({},e),{},{children:(0,Ae.jsxs)(w.Ay,{container:!0,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,sx:{display:"flex",width:44},children:(0,Ae.jsx)(g.A,{sx:{color:"text.secondary"}})}),(0,Ae.jsxs)(w.Ay,{item:!0,sx:{width:"calc(100% - 44px)",wordWrap:"break-word"},children:[o.map(((e,t)=>(0,Ae.jsx)(S.A,{component:"span",sx:{fontWeight:e.highlight?"bold":"regular"},children:e.text},t))),(0,Ae.jsx)(y.A,{variant:"body2",color:"text.secondary",children:t.structured_formatting.secondary_text})]})]})}))}})})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:12,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(re.BUW,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,Ae.jsx)(O.A,{fullWidth:!0,required:!0,id:"outlined-required",label:"City",onChange:e=>{Ct((0,n.A)((0,n.A)({},wt),{},{city:e.target.value}))},value:""==ft?rt.city:ft})}),(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(ae.kci,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,Ae.jsx)(O.A,{fullWidth:!0,required:!0,label:" PostCode",id:"outlined-required",onChange:e=>{Ct((0,n.A)((0,n.A)({},wt),{},{postcode:e.target.value}))},value:""==bt?rt.postcode:bt})})]})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:12,children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:4,alignItems:"center",children:[(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(se.J0X,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,Ae.jsx)(O.A,{variant:"outlined",readonly:!0,label:"Latitude",fullWidth:!0,value:yt.lat,sx:{cursor:"not-allowed"}})}),(0,Ae.jsx)(w.Ay,{item:!0,children:(0,Ae.jsx)(se.u3h,{style:{fontSize:"20px",fontWeight:"lighter"}})}),(0,Ae.jsx)(w.Ay,{item:!0,xs:!0,zeroMinWidth:!0,children:(0,Ae.jsx)(O.A,{label:"Longitude",readonly:!0,variant:"outlined",fullWidth:!0,value:yt.lng})})]})})]})}),(0,Ae.jsx)(B.A,{sx:{display:"flex",justifyContent:"end",mr:3,mb:2},children:(0,Ae.jsx)(T.A,{variant:"contained",size:"medium",onClick:()=>{(async()=>{try{const e=(0,n.A)((0,n.A)({},wt),{},{tenantid:et});console.log("updateClient",e);const t=await r.A.put("".concat("https://jupiter.nearle.app/live/api/v1","/tenants/update"),e);console.log("updateClient",t.data.message),t.data.status&&Dt(t.data.message,"success",1500),Ut(),Qt()}catch(e){console.log("updateClient",e)}})()},children:"Update Client"})})]})})})},"left - card"),1==Qe&&(0,Ae.jsx)(E.A,{variant:"outlined",sx:{},children:(0,Ae.jsx)(z.A,{children:(0,Ae.jsxs)(k.A,{children:[(0,Ae.jsx)(W.A,{children:(0,Ae.jsxs)(I.A,{children:[(0,Ae.jsx)(P.A,{children:"#"}),(0,Ae.jsx)(P.A,{children:"Date"}),(0,Ae.jsx)(P.A,{children:"Slab"}),(0,Ae.jsx)(P.A,{children:"Base Price"}),(0,Ae.jsx)(P.A,{children:"Min Kms"}),(0,Ae.jsx)(P.A,{children:"Price/Km"}),(0,Ae.jsx)(P.A,{children:"Other Charges"})]})}),(0,Ae.jsx)(M.A,{children:0===(null===it||void 0===it?void 0:it.length)?(0,Ae.jsx)(I.A,{children:(0,Ae.jsx)(P.A,{colSpan:7,align:"center",children:(0,Ae.jsx)(c.A,{})})}):it.map(((e,t)=>(0,Ae.jsxs)(I.A,{sx:{bgcolor:"white"},children:[(0,Ae.jsx)(P.A,{children:t+1}),(0,Ae.jsx)(P.A,{children:x()(e.pricingdate).format("DD-MM-YYYY")}),(0,Ae.jsx)(P.A,{children:e.slab}),(0,Ae.jsx)(P.A,{children:e.baseprice}),(0,Ae.jsx)(P.A,{children:e.minkm}),(0,Ae.jsx)(P.A,{children:e.priceperkm}),(0,Ae.jsx)(P.A,{children:e.othercharges})]},e.id||t)))})]})})},"left - card")]})})})]},null!==(i=e.tenantid)&&void 0!==i?i:t)})):(0,Ae.jsx)(I.A,{children:(0,Ae.jsx)(P.A,{colSpan:6,sx:{py:6},children:(0,Ae.jsxs)(v.A,{alignItems:"center",spacing:1.5,children:[(0,Ae.jsx)(j.A,{sx:{width:64,height:64,bgcolor:We("#94a3b8"),color:ye},children:(0,Ae.jsx)(ae.Itr,{size:28})}),(0,Ae.jsx)(y.A,{variant:"subtitle1",sx:{fontWeight:700,color:be},children:"No tenants to show"}),(0,Ae.jsx)(y.A,{variant:"caption",sx:{color:ve},children:"No ".concat(ni.label.toLowerCase()," tenants for this filter.")})]})})})]})]})}),Te&&(0,Ae.jsxs)(Z.nV,{scroll:!0,sx:{display:{xs:"flex",md:"none"}},children:[Jt&&(0,Ae.jsxs)(v.A,{alignItems:"center",sx:{py:4},children:[(0,Ae.jsx)(C.A,{variant:"rounded",width:"100%",height:96,animation:"wave"}),(0,Ae.jsx)(C.A,{variant:"rounded",width:"100%",height:96,animation:"wave",sx:{mt:1.25}})]}),0!=(null===Xt||void 0===Xt?void 0:Xt.length)||De?null===Xt||void 0===Xt?void 0:Xt.map(((e,t)=>{var i;const n=Me[0===Je?"active":1===Je?"pending":"inactive"],o=n.icon,s=Kt===t;return(0,Ae.jsxs)(Z.pg,{accent:n.color,header:(0,Ae.jsxs)(v.A,{direction:"row",alignItems:"flex-start",justifyContent:"space-between",spacing:1,children:[(0,Ae.jsxs)(v.A,{direction:"row",alignItems:"center",spacing:1,sx:{minWidth:0},children:[(0,Ae.jsx)(Le,{color:"#6366f1",size:36,children:(0,Ae.jsx)(ae.Azs,{size:18})}),(0,Ae.jsxs)(v.A,{sx:{minWidth:0},children:[(0,Ae.jsx)(y.A,{variant:"subtitle2",sx:{fontWeight:800,color:be},noWrap:!0,children:e.tenantname}),(0,Ae.jsxs)(v.A,{direction:"row",alignItems:"center",spacing:.5,sx:{display:"inline-flex",mt:.25,pl:.25,pr:.875,py:.125,borderRadius:999,bgcolor:ke(n.color),border:"1px solid ".concat(Pe(n.color)),color:n.color,alignSelf:"flex-start"},children:[(0,Ae.jsx)(Le,{color:n.color,size:16,children:(0,Ae.jsx)(o,{size:10})}),(0,Ae.jsx)(y.A,{sx:{fontWeight:800,fontSize:10,lineHeight:1},children:n.label})]})]})]}),(0,Ae.jsxs)(v.A,{direction:"row",spacing:.5,sx:{flexShrink:0},children:[0==Je&&(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:We("#ef4444"),color:"#ef4444",border:"1px solid ".concat(Pe("#ef4444")),"&:hover":{bgcolor:"#ef4444",color:"#fff"}},onClick:()=>{lt(e),tt(e.tenantid),Be(e.applocationid),setTimeout((()=>{ei(e.tenantid)}),100)},children:(0,Ae.jsx)(G.A,{style:{fontSize:14}})}),1==Je&&(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:We("#f59e0b"),color:"#f59e0b",border:"1px solid ".concat(Pe("#f59e0b")),"&:hover":{bgcolor:"#f59e0b",color:"#fff"}},onClick:()=>{lt(e),ct(!0),tt(e.tenantid),Be(e.applocationid),ti(e.applolcationid)},children:(0,Ae.jsx)(Q.A,{style:{fontSize:14}})}),2==Je&&(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:We("#10b981"),color:"#10b981",border:"1px solid ".concat(Pe("#10b981")),"&:hover":{bgcolor:"#10b981",color:"#fff"}},onClick:()=>{lt(e),tt(e.tenantid),Be(e.applocationid),setTimeout((()=>{ei(e.tenantid)}),100)},children:(0,Ae.jsx)(oe.yjt,{style:{fontSize:14}})}),(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:s?"#6366f1":We("#6366f1"),color:s?"#fff":"#6366f1",border:"1px solid ".concat(Pe("#6366f1")),"&:hover":{bgcolor:"#6366f1",color:"#fff"}},onClick:()=>{lt(e),Tt(t),Et(-1),tt(e.tenantid)},children:s?(0,Ae.jsx)($.A,{style:{fontSize:14}}):(0,Ae.jsx)(ee.A,{style:{fontSize:14}})}),1!==Je&&(0,Ae.jsx)(Y.A,{size:"small",sx:{bgcolor:We("#8b5cf6"),color:"#8b5cf6",border:"1px solid ".concat(Pe("#8b5cf6")),"&:hover":{bgcolor:"#8b5cf6",color:"#fff"}},onClick:()=>{lt(e),tt(e.tenantid),Be(e.applocationid),ti(e.applolcationid),ct(!0)},children:(0,Ae.jsx)(ie.A,{style:{fontSize:14}})})]})]}),children:[(0,Ae.jsxs)(Z.FG,{children:[(0,Ae.jsx)(Z.pY,{label:"Tenant ID",value:"#".concat(e.tenantid)}),(0,Ae.jsx)(Z.pY,{label:"Contact",value:e.primarycontact||"\u2014"}),(0,Ae.jsx)(Z.pY,{label:"Email",value:e.primaryemail||"\u2014",full:!0}),(0,Ae.jsx)(Z.pY,{label:"Address",full:!0,children:(0,Ae.jsx)(y.A,{sx:{fontSize:13,fontWeight:600,color:be},children:e.address||"\u2014"})})]}),s&&(0,Ae.jsx)(S.A,{sx:{mt:1.25,pt:1.25,borderTop:"1px solid ".concat(we)},children:(0,Ae.jsxs)(Z.FG,{children:[(0,Ae.jsx)(Z.pY,{label:"Contact Person",value:e.firstname||"\u2014"}),(0,Ae.jsx)(Z.pY,{label:"City",value:e.city||"\u2014"}),(0,Ae.jsx)(Z.pY,{label:"Postcode",value:e.postcode||"\u2014"}),(0,Ae.jsx)(Z.pY,{label:"Latitude",value:e.latitude||"\u2014"}),(0,Ae.jsx)(Z.pY,{label:"Longitude",value:e.longitude||"\u2014"})]})})]},null!==(i=e.tenantid)&&void 0!==i?i:t)})):(0,Ae.jsxs)(v.A,{alignItems:"center",spacing:1.5,sx:{py:6},children:[(0,Ae.jsx)(j.A,{sx:{width:64,height:64,bgcolor:We("#94a3b8"),color:ye},children:(0,Ae.jsx)(ae.Itr,{size:28})}),(0,Ae.jsx)(y.A,{variant:"subtitle1",sx:{fontWeight:700,color:be},children:"No tenants to show"}),(0,Ae.jsx)(y.A,{variant:"caption",sx:{color:ve,textAlign:"center"},children:"No ".concat(ni.label.toLowerCase()," tenants for this filter.")})]})]}),!i&&(null===Xt||void 0===Xt?void 0:Xt.length)>0&&(0,Ae.jsxs)(Ae.Fragment,{children:[(0,Ae.jsx)(F.A,{sx:{borderColor:Se}}),(0,Ae.jsx)(N.A,{rowsPerPageOptions:[5,10,25,50,100],component:"div",count:0==Je?null===Zt||void 0===Zt?void 0:Zt.active:1==Je?null===Zt||void 0===Zt?void 0:Zt.pending:2==Je?null===Zt||void 0===Zt?void 0:Zt.inactive:0,rowsPerPage:ze,page:zt,onPageChange:(e,t)=>{kt(t)},onRowsPerPageChange:e=>{_e(parseInt(e.target.value,10)),kt(0)}})]})]}),(0,Ae.jsxs)(V.A,{fullWidth:!0,fullScreen:Te,open:at,onClose:Pt,scroll:"paper",maxWidth:"sm",TransitionComponent:ne.s,PaperProps:{sx:{borderRadius:{xs:0,sm:3}}},children:[(0,Ae.jsx)(q.A,{sx:{bgcolor:"#662582",color:"#fff",fontSize:"20px"},children:"Client Pricing - (".concat(rt.tenantname,")")}),(0,Ae.jsx)(X.A,{dividers:!0,children:(0,Ae.jsx)(s.A,{sx:{height:"100%"},children:(0,Ae.jsxs)(w.Ay,{container:!0,spacing:2.5,alignItems:"center",children:[(0,Ae.jsxs)(w.Ay,{item:!0,xs:12,sm:6,children:[(0,Ae.jsx)(J.A,{children:"Select Slab"}),(0,Ae.jsx)(H.A,{disablePortal:!0,id:"combo-box-demo",options:dt,getOptionLabel:e=>"".concat(e.slab),fullWidth:!0,selectOnFocus:!0,renderInput:e=>(0,Ae.jsx)(O.A,(0,n.A)((0,n.A)({},e),{},{label:"Slab"})),onChange:(e,t,i)=>{pt(t),console.log("pricing",t),ut(!1),"clear"===i&&ut(!0)}})]}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:12,sm:6,children:[(0,Ae.jsx)(J.A,{children:"Base Price"}),(0,Ae.jsx)(O.A,{type:"number",fullWidth:!0,value:gt?0:ht.baseprice,onChange:e=>{pt((0,n.A)((0,n.A)({},ht),{},{baseprice:e.target.value}))}})]}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:12,sm:6,children:[(0,Ae.jsx)(J.A,{children:"Price/Km"}),(0,Ae.jsx)(O.A,{type:"number",fullWidth:!0,value:gt?0:ht.priceperkm,onChange:e=>{pt((0,n.A)((0,n.A)({},ht),{},{priceperkm:e.target.value}))}})]}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:12,sm:6,children:[(0,Ae.jsx)(J.A,{children:"Min Kms"}),(0,Ae.jsx)(O.A,{type:"number",fullWidth:!0,value:gt?0:ht.minkm,onChange:e=>{pt((0,n.A)((0,n.A)({},ht),{},{minkm:e.target.value}))}})]}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:12,sm:6,children:[(0,Ae.jsx)(J.A,{children:"Max Kms"}),(0,Ae.jsx)(O.A,{type:"number",fullWidth:!0,value:gt?0:ht.maxkm,onChange:e=>{pt((0,n.A)((0,n.A)({},ht),{},{maxkm:e.target.value}))}})]}),(0,Ae.jsxs)(w.Ay,{item:!0,xs:12,sm:6,children:[(0,Ae.jsx)(J.A,{children:"Min Orders"}),(0,Ae.jsx)(O.A,{type:"number",fullWidth:!0,value:gt?0:ht.minorder,onChange:e=>{pt((0,n.A)((0,n.A)({},ht),{},{minorder:e.target.value}))}})]})]})})}),(0,Ae.jsx)(U.A,{children:(0,Ae.jsx)(w.Ay,{container:!0,children:(0,Ae.jsx)(w.Ay,{item:!0,xs:12,children:(0,Ae.jsxs)(v.A,{direction:"row",justifyContent:"flex-end",spacing:2,sx:{p:2},children:[1==Qe&&(0,Ae.jsx)(T.A,{disabled:gt,variant:"contained",onClick:()=>{ii()},children:"Update Pricing"}),1==Je&&(0,Ae.jsx)(T.A,{disabled:gt,variant:"contained",onClick:()=>{ii()},children:"Save"}),(0,Ae.jsx)(T.A,{variant:"contained",onClick:()=>{ut(!0),setTimeout((()=>{Pt()}),100),pt({})},color:"error",children:"Cancel"})]})})})})]})]})}},96646:(e,t,i)=>{i.d(t,{r:()=>a});var n=i(9213),o=i(21671),s=i(82917),r=i(93230),l=i(44414);const a=e=>{let{rowsPerPage:t=5,col:i=1}=e;return(0,l.jsx)(l.Fragment,{children:Array.from(new Array(t)).map(((e,t)=>(0,l.jsxs)(n.A,{children:[(0,l.jsx)(o.A,{children:(0,l.jsx)(s.A,{variant:"circular",width:24,height:24})}),(0,l.jsx)(o.A,{children:(0,l.jsx)(s.A,{variant:"text",width:30})}),Array.from({length:i}).map(((e,t)=>(0,l.jsx)(o.A,{children:(0,l.jsxs)(r.A,{spacing:.5,children:[(0,l.jsx)(s.A,{variant:"text",width:100}),(0,l.jsx)(s.A,{variant:"text",width:80})]})},t))),(0,l.jsx)(o.A,{children:(0,l.jsx)(s.A,{variant:"text",width:150})}),(0,l.jsx)(o.A,{children:(0,l.jsx)(s.A,{variant:"rounded",width:60,height:24})}),(0,l.jsx)(o.A,{align:"center",children:(0,l.jsxs)(r.A,{direction:"row",spacing:1,justifyContent:"flex-end",children:[(0,l.jsx)(s.A,{variant:"circular",width:28,height:28}),(0,l.jsx)(s.A,{variant:"circular",width:28,height:28})]})})]},t)))})}}}]); |