"use strict";(self.webpackChunkunifiNetworkUi=self.webpackChunkunifiNetworkUi||[]).push([[4158],{713331:(e,t,n)=>{n.r(t),n.d(t,{NoContentWrapper:()=>D,default:()=>B});var a=n(296540),r=n(963070),l=n(469733),i=n(71479),s=n(845030),c=n(294303),o=n(249304),T=n(582724),u=n(517994),m=n(592510),E=n(905410),d=n(398300),S=n(412808),O=n(775699),_=n(566723),h=n(596441),A=n(610783),C=n(200826),p=n(338307),g=n(261686),f=n(424226),H=n(838738),M=n(758649),b=n(881716),y=n(459449),U=n(59308),v=n(458973),P=n(269672),w=n(113294),k=n(912955);const N=({data:e,searchTags:t,handleSearchReset:n,handleResetDisplayOptions:r})=>{switch(!0){case Boolean(e.length&&t.length):return a.createElement(b.A,{icon:a.createElement(H.A,{variant:"fill"}),title:a.createElement(y.sA,{id:"COMMON_NO_MATCH"}),description:a.createElement(y.sA,{id:"HOTSPOT_EMPTY_SEARCH_DETAILS",values:{button:a.createElement(M.A,{type:"button",variant:"inline",onClick:n},a.createElement(y.sA,{id:"COMMON_REMOVE_SEARCH_BUTTON_TEXT"})),target:a.createElement("span",{style:{textTransform:"lowercase"}},a.createElement(y.sA,{id:"COMMON_GUESTS"}))}})});case Boolean(e.length):return a.createElement(b.A,{icon:a.createElement(H.A,{variant:"fill"}),title:a.createElement(y.sA,{id:"COMMON_NO_MATCH"}),description:a.createElement(y.sA,{id:"HOTSPOT_GUESTS_EMPTY_FILTER_DETAILS",values:{button:a.createElement(M.A,{type:"button",variant:"inline",onClick:r},a.createElement(y.sA,{id:"COMMON_RESET_THEM_BUTTON_TEXT"}))}})});default:return a.createElement(b.A,{icon:a.createElement(f.A,{variant:"fill"}),title:a.createElement(y.sA,{id:"HOTSPOT_GUESTS_TABLE_EMPTY_HEADER"})})}},G=()=>{const e=(0,l.useDispatch)(),t=(0,l.useSelector)(w.v),n=(0,l.useSelector)((0,a.useMemo)(()=>(0,U.f)(P.U4.HOTSPOT_GUESTS),[])),r=(0,a.useCallback)(()=>{e((0,k.P_)(p.cD)),e((0,O.yT)(o.l.HOTSPOT_GUESTS,{filters:p.cD,initialColumns:p.tT}))},[e]);return a.createElement(c.A,{width:"100%",flexDirection:"column"},a.createElement(N,{data:t,searchTags:n,handleSearchReset:()=>{document.querySelector("input[role=combobox]")?.focus?.(),e((0,v.sV)(P.U4.HOTSPOT_GUESTS))},handleResetDisplayOptions:r}))};var R=n(464088);const D=(0,i.A)(c.A)`
  margin: ${_.vl} auto 0;
  > div {
    position: absolute;
  }
`,B=()=>{const e=(0,l.useDispatch)(),t=(0,l.useSelector)(R.Rj),n=(0,l.useSelector)(g.F),{sortBy:i,isAscending:c,initialColumns:_}=(0,C.A)(o.l.HOTSPOT_GUESTS),{startDate:f,endDate:H}=(0,l.useSelector)(R.K5),M=(0,a.useCallback)(({mac:t})=>{e((0,s.XP)({type:d.H.HOTSPOT_GUEST,id:t}))},[e]),b=(0,a.useCallback)(n=>{n!==t&&e((0,k.Vu)(n))},[e,t]),y=(0,a.useCallback)(({id:t},n)=>e((0,O.yT)(o.l.HOTSPOT_GUESTS,{sortBy:t,isAscending:n})),[e]),U=(0,a.useCallback)(({from:e,rowsPerPage:t})=>a.createElement(a.Fragment,null,a.createElement(r.A,{items:_.length?n:[],idField:"_id",rowLimit:t,rowOffset:e,truncateHeaderCells:!0,columns:p.wJ,disableColumnFilters:!0,columnOverride:_,initialSortBy:i,initiallySortAscending:c,rowHeight:h.I.ROW_HEIGHT,onSort:y,onRowClick:M}),n.length&&_?.length?null:a.createElement(D,{justifyContent:"center",alignItems:"center"},a.createElement(G,null))),[M,y,n,_,c,i]);return(0,a.useEffect)(()=>{e((0,A.s)(void 0,{crudCacheStrategy:{type:m.e.CACHE}}))},[e]),(0,T.A)([(0,u.ne)({start:f.getTime(),end:H.getTime()},void 0,{crudCacheStrategy:{type:m.e.CACHE}})],a.createElement(E.A,{section:"COMMON_GUESTS",tableType:o.l.HOTSPOT_GUESTS,itemCount:_.length?n.length:0,onRenderTable:U,onPageChanged:b,rowOptions:p.Kr,pageNumber:t,wrapperFlexProps:{padding:"0"}}),{trackingName:S.z.GUESTS})}},261686:(e,t,n)=>{n.d(t,{F:()=>T,a:()=>u});var a=n(801081),r=n(113294),l=n(59308),i=n(269672),s=n(878490),c=n(90757),o=n(546391);const T=(0,a.Mz)(r.v,s.e,(0,l.U)(i.U4.HOTSPOT_GUESTS),(e,t,n)=>e.filter(({_id:e})=>!n||n.has(e)).map(e=>({...e,hotspotClient:t.find(({mac:t})=>t===e.mac)||{}}))),u=(e,t)=>(0,a.Mz)(r.v,n=>n.map(({_id:n,name:a,hostname:r,ip:l,authorized_by:i,voucher_code:s,start:T,end:u,is_returning:m})=>({id:n,name:a,hostname:r,ip:l,authorized_by:i,voucher_code:s,formattedVoucher:s?.replace(o.fe,"$&-"),startTime:t.format((0,c.gH)(T)),endTime:t.format((0,c.gH)(u)),returning:m?e.returning:e.newLabel})))}}]);