Files
Express_console_build/build/static/js/1504.1fb0366f.chunk.js

1 line
39 KiB
JavaScript

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