1"use strict";(self.webpackChunkmts_react=self.webpackChunkmts_react||[]).push([[6706],{2046:(e,t,a)=>{a.d(t,{A:()=>f});var i=a(98587),s=a(58168),o=a(9950),n=a(60533),l=a(88465),d=a(61676),r=a(82053),c=a(15866),u=a(39766),p=a(59254),m=a(1763),v=a(423);function h(e){return(0,v.Ay)("MuiInputAdornment",e)}const g=(0,m.A)("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var _,x=a(18463),y=a(44414);const A=["children","className","component","disablePointerEvents","disableTypography","position","variant"],b=(0,p.Ay)("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,t[`position${(0,d.A)(a.position)}`],!0===a.disablePointerEvents&&t.disablePointerEvents,t[a.variant]]}})((e=>{let{theme:t,ownerState:a}=e;return(0,s.A)({display:"flex",height:"0.01em",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(t.vars||t).palette.action.active},"filled"===a.variant&&{[`&.${g.positionStart}&:not(.${g.hiddenLabel})`]:{marginTop:16}},"start"===a.position&&{marginRight:8},"end"===a.position&&{marginLeft:8},!0===a.disablePointerEvents&&{pointerEvents:"none"})})),f=o.forwardRef((function(e,t){const a=(0,x.b)({props:e,name:"MuiInputAdornment"}),{children:p,className:m,component:v="div",disablePointerEvents:g=!1,disableTypography:f=!1,position:j,variant:I}=a,S=(0,i.A)(a,A),k=(0,u.A)()||{};let C=I;I&&k.variant,k&&!C&&(C=k.variant);const E=(0,s.A)({},a,{hiddenLabel:k.hiddenLabel,size:k.size,disablePointerEvents:g,position:j,variant:C}),N=(e=>{const{classes:t,disablePointerEvents:a,hiddenLabel:i,position:s,size:o,variant:n}=e,r={root:["root",a&&"disablePointerEvents",s&&`position${(0,d.A)(s)}`,n,i&&"hiddenLabel",o&&`size${(0,d.A)(o)}`]};return(0,l.A)(r,h,t)})(E);return(0,y.jsx)(c.A.Provider,{value:null,children:(0,y.jsx)(b,(0,s.A)({as:v,ownerState:E,className:(0,n.A)(N.root,m),ref:t},S,{children:"string"!==typeof p||f?(0,y.jsxs)(o.Fragment,{children:["start"===j?_||(_=(0,y.jsx)("span",{className:"notranslate",children:"\u200b"})):null,p]}):(0,y.jsx)(r.A,{color:"text.secondary",children:p})}))})}))},8658:(e,t,a)=>{a.d(t,{A:()=>o});var i=a(65471),s=a(44414);const o=(0,i.A)((0,s.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 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox")},10895:(e,t,a)=>{a.d(t,{T1:()=>d,lH:()=>r,Ay:()=>u});var i=a(48383),s=a.n(i),o=(a(9950),a(89288)),n=a(22240),l=(a(445),a(44414));const d="1",r=5,c=e=>{let{countryCode:t="",disabled:a=!1,isFullPhone:i=!1,isSubmitted:d,isValid:r,name:c,setPhone:u,phone:p="",labelId:m="empty"}=e;const v=(0,o.A)(),h=s()("phone-input__input",{"phone-input__input--valid":d&&r,"phone-input__input--invalid":d&&!r});return(0,l.jsxs)("div",{className:h,children:[(0,l.jsx)("label",{htmlFor:c,children:v.formatMessage({id:m})}),(0,l.jsx)(n.Ay,{defaultCountry:"US",disabled:a,international:!1,placeholder:"(###) ###-####",value:i?`+${p}`:t?`+${t} ${p}`:p,onChange:u})]})};c.displayName="PhoneInputForm";const u=c},13569:(e,t,a)=>{a.d(t,{A:()=>x});var i=a(98587),s=a(58168),o=a(9950),n=a(60533),l=a(88465),d=a(18463),r=a(59254),c=a(1763),u=a(423);function p(e){return(0,u.Ay)("MuiCardMedia",e)}(0,c.A)("MuiCardMedia",["root","media","img"]);var m=a(44414);const v=["children","className","component","image","src","style"],h=(0,r.Ay)("div",{name:"MuiCardMedia",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e,{isMediaComponent:i,isImageComponent:s}=a;return[t.root,i&&t.media,s&&t.img]}})((e=>{let{ownerState:t}=e;return(0,s.A)({display:"block",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"},t.isMediaComponent&&{width:"100%"},t.isImageComponent&&{objectFit:"cover"})})),g=["video","audio","picture","iframe","img"],_=["picture","img"],x=o.forwardRef((function(e,t){const a=(0,d.b)({props:e,name:"MuiCardMedia"}),{children:o,className:r,component:c="div",image:u,src:x,style:y}=a,A=(0,i.A)(a,v),b=-1!==g.indexOf(c),f=!b&&u?(0,s.A)({backgroundImage:`url("${u}")`},y):y,j=(0,s.A)({},a,{component:c,isMediaComponent:b,isImageComponent:-1!==_.indexOf(c)}),I=(e=>{const{classes:t,isMediaComponent:a,isImageComponent:i}=e,s={root:["root",a&&"media",i&&"img"]};return(0,l.A)(s,p,t)})(j);return(0,m.jsx)(h,(0,s.A)({className:(0,n.A)(I.root,r),as:c,role:!b&&u?"img":void 0,ref:t,style:f,ownerState:j,src:b?u||x:void 0},A,{children:o}))}))},14195:(e,t,a)=>{a.d(t,{A:()=>h});var i=a(98587),s=a(58168),o=a(9950),n=a(60533),l=a(88465),d=a(59254),r=a(18463),c=a(92455),u=a(13372),p=a(44414);const m=["className"],v=(0,d.Ay)("div",{name:"MuiListItemIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:a}=e;return[t.root,"flex-start"===a.alignItems&&t.alignItemsFlexStart]}})((e=>{let{theme:t,ownerState:a}=e;return(0,s.A)({minWidth:56,color:(t.vars||t).palette.action.active,flexShrink:0,display:"inline-flex"},"flex-start"===a.alignItems&&{marginTop:8})})),h=o.forwardRef((function(e,t){const a=(0,r.b)({props:e,name:"MuiListItemIcon"}),{className:d}=a,h=(0,i.A)(a,m),g=o.useContext(u.A),_=(0,s.A)({},a,{alignItems:g.alignItems}),x=(e=>{const{alignItems:t,classes:a}=e,i={root:["root","flex-start"===t&&"alignItemsFlexStart"]};return(0,l.A)(i,c.f,a)})(_);return(0,p.jsx)(v,(0,s.A)({className:(0,n.A)(x.root,d),ownerState:_,ref:t},h))}))},15896:(e,t,a)=>{a.d(t,{A:()=>
1o});var i=a(65471),s=a(44414);const o=(0,i.A)((0,s.jsx)("path",{d:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm3.3 14.71L11 12.41V7h2v4.59l3.71 3.71-1.42 1.41z"}),"AccessTimeFilled")},22551:(e,t,a)=>{a.d(t,{XK:()=>l,Y7:()=>u,aE:()=>r,bH:()=>d,lU:()=>c});var i=a(44254),s=a(25624),o=a(40338),n=a(45574);const l=async e=>{const{data:t}=await i.FH.post(`${i.C1}/sandbox/sync/companies/${e}`);if(!t.success)throw s.Ay.from(t);return{user:(0,o.xU)(t.data.user),company:(0,n.x)(t.data.company)}},d=async e=>{let{companyId:t,scaleId:a,payload:o}=e;const{data:n}=await i.FH.post(`${i.C1}/sandbox/copy/companies/${t}/scales/${a}`,{data:o});if(!n.success)throw s.Ay.from(n);return n.data},r=async e=>{let{companyId:t,payload:a}=e;const{data:o}=await i.FH.post(`${i.C1}/sandbox/copy/companies/${t}/kiosks`,{data:a});if(!o.success)throw s.Ay.from(o);return o.data},c=async e=>{let{companyId:t,siteId:a,payload:o}=e;const{data:n}=await i.FH.post(`${i.C1}/sandbox/copy/companies/${t}/sites/${a}`,{data:o});if(!n.success)throw s.Ay.from(n);return!0},u=async e=>{let{companyId:t,payload:a}=e;const{data:o}=await i.FH.post(`${i.C1}/sandbox/copy/companies/${t}/trucks`,{data:a});if(!o.success)throw s.Ay.from(o);return o.data}},22997:(e,t,a)=>{a.d(t,{A:()=>b});var i=a(9950),s=a(60899),o=a(23266),n=a(22634),l=a(89288),d=a(63027),r=a(27081),c=a(89268),u=a(68579),p=a(86318),m=a(35029),v=a(6349),h=a(36688),g=a(37838),_=a(4763),x=a(56915),y=a(33568),A=a(44414);const b=e=>{var t,a,b,f,j,I,S,k,C,E,N;let{location:w,onLocationUpdated:P,oneLineAddress:T=!1,closeModal:$,open:L,hideFields:M={country:!1,city:!1},optionalFields:R={province:!1,postalCode:!1},provinceIsFreeform:D=!0}=e;(0,n.MW)();const O=(0,l.A)(),U=(0,r.wA)(),F=(0,u.N)((e=>e.selectedCompany.data)),W=(0,u.N)((e=>e.countries)),K=(0,u.N)((e=>e.provinces)),B=(0,i.useRef)(!1),[V,H]=(0,i.useState)({address:null!==(t=null===w||void 0===w?void 0:w.address)&&void 0!==t?t:"",addressLine1:null!==(a=null===w||void 0===w?void 0:w.addressLine1)&&void 0!==a?a:"",city:null!==(b=null===w||void 0===w?void 0:w.city)&&void 0!==b?b:"",province:null!==(f=null===w||void 0===w?void 0:w.province)&&void 0!==f?f:"",postalCode:null!==(j=null===w||void 0===w?void 0:w.postalCode)&&void 0!==j?j:"",country_id:null!==(I=null===w||void 0===w||null===(S=w.country_id)||void 0===S?void 0:S.toString())&&void 0!==I?I:"",latitude:null!==(k=null===w||void 0===w?void 0:w.latitude)&&void 0!==k?k:"",longitude:null!==(C=null===w||void 0===w?void 0:w.longitude)&&void 0!==C?C:""}),z=e=>{var t;const a=W.ids.find((t=>{var a;const i=null===(a=W.entities[t])||void 0===a?void 0:a.code;return!!i&&i===e}));return a&&(null===(t=W.entities[a])||void 0===t?void 0:t.id)||null},G=async e=>{console.log("onPlaceWritten",e),B.current=!1;let t=V.country_id;if(null!==e&&void 0!==e&&e.country){const a=z(e.country);a&&(t=a.toString())}H((a=>{var i;return{...a,address:e.fullAddress,addressLine1:e.addressLine1||a.addressLine1,city:e.city||a.city,province:e.province||a.province,postalCode:e.postalCode||a.postalCode,latitude:e.lat,longitude:e.lng,country_id:null!==(i=t)&&void 0!==i?i:a.country_id}}))};(0,i.useEffect)((()=>{W.ids.length||U((0,x.E)()),null!==w&&void 0!==w&&w.latitude&&w.longitude&&(async()=>{})(w.latitude,w.longitude)}),[]);const q=async()=>{var e,t,a,i,s;let o;if((!V.latitude||!V.longitude||B.current)&&(o=await(async()=>await(0,m.j9)({addressLine1:T?V.address:V.addressLine1,city:T?"":V.city,province:T?"":V.province,postalCode:T?"":V.postalCode,useLongName:!1}))(),console.log("manualAddress",o),null===o))return void U((0,y.Ds)({type:"error",title:O.formatMessage({id:"alert.error"}),message:O.formatMessage({id:"input.location.address_not_verified"})}));if(!D&&!K.codeToProvinceIdMap[V.province]&&(!o||!K.codeToProvinceIdMap[o.province]))return void U((0,y.Ds)({type:"error",title:O.formatMessage({id:"alert.error"}),message:O.formatMessage({id:"input.location.province_not_determined"})}));let n=V.province;const l=V.country_id;!D&&o&&K.codeToProvinceIdMap[o.province]&&(n=o.province),P({address:V.address,addressLine1:(null===(e=o)||void 0===e?void 0:e.addressLine1)||V.addressLine1,city:(null===(t=o)||void 0===t?void 0:t.city)||V.city,province:n,postalCode:(null===(a=o)||void 0===a?void 0:a.postalCode)||V.postalCode,country_id:Number.parseFloat(l)||void 0,latitude:Number.parseFloat(((null===(i=o)||void 0===i?void 0:i.latitude)||V.latitude||"").toString()),longitude:Number.parseFloat(((null===(s=o)||void 0===s?void 0:s.longitude)||V.longitude||"").toString())}),$()};return(0,A.jsx)(p.A,{open:L,closeModal:$,headerOptions:{headerText:"Update Location"},children:(0,A.jsxs)("form",{onSubmit:e=>{e.preventDefault(),q()},children:[(0,A.jsxs)("div",{className:"scale-popup__map",children:[(0,A.jsx)("div",{className:"scale-popup__title",children:(0,A.jsx)(d.A,{id:"dashboard.scales.popup.click_to_drop_pin"})}),(0,A.jsx)(c.Ay,{addMarkerOnClick:!0,lat:Number.parseFloat(V.latitude)||(null===(E=F.address)||void 0===E?void 0:E.location.coordinates[0])||null,lng:Number.parseFloat(V.longitude)||(null===(N=F.address)||void 0===N?void 0:N.location.coordinates[1])||null,onPlaceSelected:(e,t,a,i)=>{console.log(i),B.current=!1;let s=V.country_id;if(null!==i&&void 0!==i&&i.country){const e=z(i.country);e&&(s=e.toString())}H((o=>{var n;return{...o,address:a,addressLine1:(null===i||void 0===i?void 0:i.addressLine1)||o.addressLine1,city:(null===i||void 0===i?void 0:i.city)||o.city,province:(null===i||void 0===i?void 0:i.province)||o.province,postalCode:(null===i||void 0===i?void 0:i.postalCode)||o.postalCode,latitude:e,longitude:t,country_id:null!==(n=s)&&void 0!==n?n:o.country_id}}))}})]}),(0,A.jsxs)(s.Ay,{container:!0,spacing:2,my:0,children:[!M.country&&(0,A.jsx)(s.Ay,{item:!0,xs:12,children:(0,A.jsx)(_.A,{label:"Country",value:V.country_id||"",onChange:e=>H((t=>({...t,country_id:e.target.value}))),children:W.ids.map((e=>(0,A.jsx)(o.A,{value:e,children:W.entities[e].name},e)))})}),T?(0,A.jsx)(A.Fragment,{children:(0,A.jsx)(s.Ay,{item:!0,xs:12,children:(0,A.jsx)(g.A,{label:"Address",value:V.address,onChange:e=>{H((t=>({...t,address:e.target.value}))),B.current=!0},onPlaceSelected:e=>G(e),textfieldProps:{inputProps:{onKeyDown:e=>{"Enter"===e.key&&e.preventDefault()}}}})})}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(s.Ay,{item:!0,xs:12,children:(0,A.jsx)(g.A,{label:"Address",value:V.addressLine1,onChange:e=>{H((t=>({...t,addressLine1:e.target.value}))),B.current=!0},onPlaceSelected:e=>G(e),textfieldProps:{inputProps:{onKeyDown:e=>{"Enter"===e.key&&e.preventDefault()}}}})}),!M.city&&(0,A.jsx)(s.Ay,{item:!0,xs:12,md:!0,children:(0,A.jsx)(h.A,{label:"City",value:V.city,required:!0,onChange:e=>{H((t=>({...t,city:e.target.value}))),B.current=!0}})}),D?(0,A.jsx)(s.Ay,{item:!0,xs:12,md:!0,children:(0,A.jsx)(h.A,{label:"State/Province",value:V.province,onChange:e=>{H((t=>({...t,province:e.target.value}))),B.current=!0},required:!R.province})}):(0,A.jsx)(s.Ay,{item:!0,xs:12,md:6,children:(0,A.jsx)(_.A,{label:"State/Province",value:V.province,onChange:e=>{H((t=>({...t,province:e.target.value}))),B.current=!0},required:!R.province,children:K.ids.map((e=>{const t=K.entities[e];return(0,A.jsx)(o.A,{value:t.code,children:t.code},t.code)}))})}),(0,A.jsx)(s.Ay,{item:!0,xs:12,md:!0,children:(0,A.jsx)(h.A,{label:"Postal Code",value:V.postalCode,required:!R.postalCode,onChange:e=>{H((t=>({...t,postalCode:e.target.value}))),B.current=!0}})})]})]}),(0,A.jsxs)(s.Ay,{container:!0,spacing:2,my:0,children:[(0,A.jsx)(s.Ay,{item:!0,xs:6,children:(0,A.jsx)(v.$n,{fullWidth:!0,type:"button",variant:"outlined",color:"primary",onClick:()=>$(),children:O.formatMessage({id:"dashboard.popup.cancel"})})}),(0,A.jsx)(s.Ay,{item:!0,xs:6,children:(0,A.jsx)(v.$n,{fullWidth:!0,type:"submit",variant:"contained",color:"primary",children:O.formatMessage({id:"dashboard.popup.confirm"})})})]})]})})}},25671:(e,t,a)=>{a.d(t,{A:()=>g});var i=a(9950),s=a(60899),o=a(82053),n=a(83274),l=a(16497),d=a(93038),r=a(37324),c=a(25979),u=a(29277),p=a(96557),m=a(89299),v=a(41397),h=a(44414);const g=e=>{const{label:t,checked:a,onChange:g,type:_,variant:x="stacked",info:y,disabled:A=!1,spaced:b}=e,f={margin:"0px",...b?{width:"100%",justifyContent:"space-between"}:{}},j=(0,i.useMemo)((()=>(0,h.jsxs)(s.Ay,{container:!0,direction:"row",spacing:1,alignItems:"center",children:[(0,h.jsx)(s.Ay,{item:!0,children:(0,v.isString)(t)?(0,h.jsx)(o.A,{children:t}):t}),y&&(0,h.jsx)(s.Ay,{item:!0,alignItems:"center",children:(0,h.jsx)(n.A,{title:y,children:(0,h.jsx)(m.A,{color:"disabled",fontSize:"small",sx:{marginBottom:"3px"}})})})]})),[t]);if("checkbox"===_){const{labelPlacement:t,sx:i}=e;return(0,h.jsx)(l.A,{control:(0,h.jsx)(d.A,{checked:a,onChange:(e,t)=>
1g(t),color:"primary",disabled:A,size:"small"}),label:j,labelPlacement:t,style:{...f,margin:i?void 0:f.margin},sx:i})}return"inline"===x?(0,h.jsx)(l.A,{control:(0,h.jsx)(r.A,{checked:a,onChange:(e,t)=>g(t),color:"primary",disabled:A,size:"small"}),label:j,labelPlacement:"start",style:f}):(0,h.jsxs)(c.A,{component:"fieldset",children:[(0,h.jsx)(u.A,{component:"legend",children:j}),(0,h.jsx)(l.A,{control:(0,h.jsx)(r.A,{checked:a,onChange:(e,t)=>g(t),color:"primary",disabled:A,size:"small"}),label:"",style:f}),(0,h.jsx)(p.A,{})]})}},34727:(e,t,a)=>{a.d(t,{Az:()=>h,Gy:()=>c,Hk:()=>r,Ic:()=>u,UX:()=>d,ns:()=>m,vd:()=>p,wK:()=>l,yG:()=>v});var i=a(44254),s=a(25624),o=a(47511),n=a(27927);const l=async e=>{let{companyId:t,cancelToken:a,fromOtherEnvironment:l,...d}=e;const r=(0,o.yC)(d);let c;l&&(c={[i.Tr]:"1"});const{data:u}=await i.FH.get(`${i.C1}/companies/${t}/sites?${r}`,{cancelToken:a,headers:c});if(!u.success)throw s.Ay.from(u);return{total:u.data.total,numberOfPages:u.data.last_page,nextPageURL:u.data.next_page_url,data:u.data.data.map((e=>n.k.toState(e)))}},d=async e=>{let{companyId:t,siteId:a,cancelToken:o,...l}=e;const{data:d}=await i.FH.get(`${i.C1}/companies/${t}/sites/${a}`,{params:l,cancelToken:o});if(!d.success)throw s.Ay.from(d);return n.k.toState(d.data)},r=async e=>{let{companyId:t,payload:a}=e;const{data:o}=await i.FH.post(`${i.C1}/companies/${t}/sites`,{data:a});if(!o.success)throw s.Ay.from(o);return n.k.toState(o.data)},c=async e=>{let{companyId:t,siteId:a,payload:o}=e;const{data:l}=await i.FH.put(`${i.C1}/companies/${t}/sites/${a}`,{data:o});if(!l.success)throw s.Ay.from(l);return n.k.toState(l.data)},u=async e=>{let{companyId:t,siteId:a}=e;const{data:s}=await i.FH.delete(`${i.C1}/companies/${t}/sites/${a}`);return s},p=async e=>{let{companyId:t,siteId:a,payload:o}=e;const{data:l}=await i.FH.put(`${i.C1}/companies/${t}/sites/${a}/additional-info`,{data:{additional_info:o}});if(!l.success)throw s.Ay.newInstance(l.error);return n.k.toState(l.data)},m=async e=>{let{companyId:t,siteId:a,cancelToken:o,...n}=e;const{data:l}=await i.FH.get(`${i.C1}/companies/${t}/sites/${a}/highest-ticket-number`,{params:n,cancelToken:o});if(!l.success)throw s.Ay.from(l);return l.data},v=async e=>{let{companyId:t,siteId:a,cancelToken:o,...n}=e;const{data:l}=await i.FH.get(`${i.C1}/companies/${t}/sites/${a}/highest-workflow-number`,{params:n,cancelToken:o});if(!l.success)throw s.Ay.from(l);return l.data},h=async e=>{let{cancelToken:t,...a}=e;const l=(0,o.yC)(a),{data:d}=await i.FH.get(`${i.C1}/sites/nearby?${l}`,{cancelToken:t});if(!d.success)throw s.Ay.from(d);return{total:d.data.total,numberOfPages:d.data.last_page,nextPageURL:d.data.next_page_url,data:d.data.data.map((e=>n.k.toState(e)))}}},35117:(e,t,a)=>{a.d(t,{$R:()=>o,bS:()=>d,f4:()=>n,kF:()=>r,qA:()=>s,yE:()=>l});var i=a(41397);const s={currentPage:1,lastPage:1,total:-1,pages:{}},o={currentPage:1,lastPage:1,total:0,pages:{1:[]}},n=e=>{var t;let{state:a,itemId:s}=e;var o;if(null!==(t=a.pages[a.currentPage])&&void 0!==t&&t.some((e=>e.id===s)))return{...a,total:a.total-1,pages:{...a.pages,[a.currentPage]:null===(o=a.pages[a.currentPage])||void 0===o?void 0:o.filter((e=>e.id!==s))}};const n={...a,pages:{}};let l=!1,d=1;for(;!l;){var r;if((0,i.isNil)(a.pages[d]))break;null!==(r=a.pages[d])&&void 0!==r&&r.some((e=>e.id===s))?(l=!0,n.pages[d]=a.pages[d].filter((e=>e.id!==s)),n.total-=1):n.pages[d]=a.pages[d],d+=1}return n},l=e=>{let{state:t,paginationCount:a,item:i}=e;const s={...t};if(0===t.lastPage)return s.lastPage=1,s.total=1,s.pages={0:[i]},s;console.log("state",t);const o=t.pages[t.lastPage];return void 0!==o&&o.length<a&&(s.pages[t.lastPage]=[...s.pages[t.lastPage]||[],i]),s},d=e=>{var t;let{state:a,entity:i}=e;return a.pages[a.currentPage],{...a,pages:{...a.pages,[a.currentPage]:null===(t=a.pages[a.currentPage])||void 0===t?void 0:t.map((e=>e.id!==i.id?e:{...e,...i}))}}},r={currentPage:1,hasNextPage:!0,lastPage:2,lastFetchedPage:0,total:-1,data:[]}},37838:(e,t,a)=>{a.d(t,{A:()=>c});var i=a(10523),s=a(41397),o=a(9950),n=a(36688),l=a(35029),d=a(44414);const r=e=>{let{onPlaceSelected:t,...a}=e;const[r,c]=(0,o.useState)(null);return(0,d.jsx)(i.jT,{onLoad:e=>c((()=>e)),onPlaceChanged:()=>{(0,s.isNil)(r)||(async e=>{console.log("place",e);const a=(0,l.jP)(e.address_components,!1);a&&t({fullAddress:e.formatted_address||"",addressLine1:null===a||void 0===a?void 0:a.addressLine1,city:null===a||void 0===a?void 0:a.city,province:null===a||void 0===a?void 0:a.province,postalCode:a.postalCode,country:a.country,lat:e.geometry.location.lat(),lng:e.geometry.location.lng()})})(r.getPlace())},children:(0,d.jsx)(n.A,{...a})})};r.displayName="LocationAutoComplete";const c=r},53256:(e,t,a)=>{a.d(t,{A:()=>
1o});var i=a(65471),s=a(44414);const o=(0,i.A)((0,s.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add")},56915:(e,t,a)=>{a.d(t,{E:()=>l});var i=a(48851),s=a(61112),o=a(55998),n=a(12766);const l=(0,i.zD)(`${o.J.countries}/getAllCountriesStatus`,(async(e,t)=>{let{dispatch:a}=t;const i=await(0,s.o)();a((0,n.e)(i))}))},61112:(e,t,a)=>{a.d(t,{o:()=>l,v:()=>d});var i=a(65734),s=a(47511);var o=a(44254),n=a(25624);const l=async()=>{const{data:e}=await o.FH.get(`${o.C1}/countries`);if(e.success)return e.data.filter((e=>e.is_supported)).map((e=>({...e,has_province_bound_license_plates:!("GB"===e.code||"NZ"===e.code)}))).map((e=>(0,i.B)(e)));throw n.Ay.newInstance(e.error)},d=async()=>{const{data:e}=await o.FH.get(`${o.C1}/provinces`);if(!e.success)throw n.Ay.newInstance(e.error);return e.data.map((e=>(e=>({...(0,s.fL)(e)}))(e)))}},64320:(e,t,a)=>{a.d(t,{A:()=>o});var i=a(65471),s=a(44414);const o=(0,i.A)([(0,s.jsx)("path",{d:"M11.99 2C6.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"},"0"),(0,s.jsx)("path",{d:"M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"},"1")],"AccessTime")},65640:(e,t,a)=>{a.r(t),a.d(t,{default:()=>Oa});var i=a(9950),s=a(27081),o=a(15288),n=a(39159),l=a(41397),d=a(16673),r=a(22698),c=a(36175),u=a(33304),p=a(23656),m=a(22634),v=a(89288),h=a(63027),g=a(24097),_=a(68048),x=a(71286),y=a(66410),A=a(75737),b=a(57136),f=a(38234),j=a(32139),I=a(73729),S=a(85710),k=a(84883);let C;!function(e){e[e.MODIFY_SCALE=0]="MODIFY_SCALE",e[e.DUPLICATE_SCALE=1]="DUPLICATE_SCALE",e[e.CREATE_AXLE_SPEC=2]="CREATE_AXLE_SPEC",e[e.MODIFY_AXLE_SPEC=3]="MODIFY_AXLE_SPEC",e[e.CREATE_KIOSK=4]="CREATE_KIOSK",e[e.DELETE_KIOSK=5]="DELETE_KIOSK",e[e.ASK_FOR_RECEIVABLE=6]="ASK_FOR_RECEIVABLE",e[e.UPDATE_SCALE_RELATIONS=7]="UPDATE_SCALE_RELATIONS"}(C||(C={}));var E=a(60899),N=a(96583),w=a(40033),P=a(28170),T=a(79739),$=a(10226),L=a(67079),M=a(47937),R=a(33568),D=a(34414),O=a(44414);(0,L.Ay)(E.Ay)(M.Ay);const U=e=>{let{setModalOpen:t,scaleID:a,kioskID:o,handleRemoveKiosk:n}=e;(0,m.MW)();const l=(0,s.wA)(),d=(0,v.A)(),{setIsLoading:r}=(0,i.useContext)(S.Y),{data:c}=(0,s.d4)((e=>e.selectedCompany)),u=c;return(0,O.jsxs)(N.A,{open:!0,fullWidth:!0,onClose:()=>t(!1),children:[(0,O.jsx)(w.A,{children:"Remove Kiosk"}),(0,O.jsxs)(P.A,{children:["Would you like to remove the kiosk from the scale? ",(0,O.jsx)("br",{}),"Or delete the kiosk entirely?"]}),(0,O.jsxs)(T.A,{children:[(0,O.jsx)($.A,{variant:"outlined",color:"error",style:{borderColor:"#FF6600",color:"#FF6600"},onClick:async()=>{r(!0);try{await(0,g.hY)(u.id,o),n(o),t(!1),l((0,R.Ds)({type:"success",title:d.formatMessage({id:"alert.success"}),message:d.formatMessage({id:"dashboard.popup.deleted_successfully"})}))}catch(e){l((0,R.Ds)({type:"error",title:d.formatMessage({id:"alert.error"}),message:(0,D.u$)(e)}))}finally{r(!1)}},children:"Delete"}),(0,O.jsx)($.A,{variant:"contained",color:"error",style:{borderColor:"#FF6600",backgroundColor:"#FF6600"},onClick:async()=>{r(!0);try{await(0,g.Xv)(u.id,a,o),n(o),t(!1),l((0,R.Ds)({type:"success",title:d.formatMessage({id:"alert.success"}),message:"Removed kiosk from scale"}))}catch(e){l((0,R.Ds)({type:"error",title:d.formatMessage({id:"alert.error"}),message:(0,D.u$)(e)}))}finally{r(!1)}},children:"Remove from Scale"})]})]})};U.displayName="RemoveKioskModal";const F=U;var W=a(68579),K=a(35117),B=a(16491),V=a(8145),H=a(70006),z=a(23266),G=a(46639),q=a(82053),Y=a(1320),X=a(15769),Z=a(69780),J=a(9213),Q=a(21671),ee=a(83274),te=a(25333),ae=a(34075),ie=a(25277),se=a(91434),oe=a(29240),ne=a(20760),le=a(24609);const de=e=>{let{companyId:t,defaultKioskId:a,scaleId:o,showPopUp:n}=e;const[c,u]=(0,i.useState)(!0),[p,E]=(0,i.useState)(K.qA),[N,w]=(0,i.useState)(!1),[P,T]=(0,i.useState)(0),[$,L]=(0,i.useState)("all"),[M,R]=(0,i.useState)(""),[D,U]=(0,i.useState)(""),[de,re]=(0,i.useState)("created_at-asc"),ce=(0,W.N)((e=>e.companyTypes)),ue=(0,W.N)((e=>e.session.permissions)),{data:pe}=(0,s.d4)((e=>e.selectedCompany)),me=pe,ve=(0,v.A)(),he=(0,m.MW)(),ge=(0,s.wA)(),_e=(0,d.W6)(),{setIsLoading:xe}=(0,i.useContext)(S.Y),[ye,Ae]=(0,i.useState)(!1);(0,i.useEffect)((()=>{(async()=>
1{if(p.pages[p.currentPage])return;const[e,a]=de.split("-"),i=D.trim();try{Ae(!0);const s=await(0,g.tt)({companyId:t,scaleId:o,page:p.currentPage,..."all"!==$?{is_published:"true"===$}:{},sort_by:[[e,a]],...i?{search:[["name",_.t.CONTAINS,i]]}:{}});E((e=>({...e,total:s.total,lastPage:s.numberOfPages,pages:{...e.pages,[e.currentPage]:s.data}})))}catch(s){(0,j.l)(he,s)}finally{Ae(!1)}})()}),[p]),(0,i.useEffect)((()=>{E(K.qA)}),[$,de,D]),(0,i.useEffect)((()=>{const e=(0,l.debounce)((e=>U(e)),350,{leading:!1,trailing:!0});return e(M),()=>e.cancel()}),[M]);const be=async e=>{try{E((t=>(0,K.yE)({state:t,item:e,paginationCount:20})))}catch(t){(0,j.l)(he,t)}},fe=async e=>{e?_e.push(r.BV.PAYMENT_METHODS):(console.log("on has payable"),n({scaleId:o,companyId:t,popUpType:C.CREATE_KIOSK,isAllowedToCreatePayToWeightScale:!1,onKioskAdded:be,titleId:"dashboard.kiosks.popup.add_new_kiosk"}))},je=p.pages[p.currentPage];return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)("section",{className:"scale-info__kiosk-header-container",children:[(0,O.jsxs)("div",{className:"scale-info__kiosk-header-title-and-button-container",children:[(0,O.jsx)("h1",{className:"scale-info__kiosk-header-title",children:(0,O.jsx)(h.A,{id:"dashboard.scale_info.kiosks"})}),(0,O.jsx)("div",{className:"scale-info__kiosk-header-button-container",children:ue[le.aX.CREATE_KIOSK]&&(0,O.jsx)(I.A,{isBold:!0,titleId:"dashboard.scale_info.create_kiosk",onClick:()=>{var e;const a=null===(e=ce.entities[me.companyTypeId])||void 0===e?void 0:e.type;if(!(0,x.wZ)(a)||c)return console.log("before handle create",!(0,x.wZ)(a),c),void n({scaleId:o,companyId:t,popUpType:C.CREATE_KIOSK,isAllowedToCreatePayToWeightScale:!0,onKioskAdded:be,titleId:"dashboard.kiosks.popup.add_new_kiosk"});console.log("after handle create"),n({companyId:t,titleId:"dashboard.kiosks.popup.do_you_have_any_payable_scale",popUpType:C.ASK_FOR_RECEIVABLE,onHasPayableScale:fe})}})})]}),(0,O.jsx)(k.A,{titleId:"dashboard.scale_info.what_is_a_kiosk"})]}),(0,O.jsxs)(B.A,{display:"flex",flexWrap:"wrap",gap:2,alignItems:"center",mt:2,mb:2,children:[(0,O.jsx)(V.A,{label:"Search by name",size:"small",value:M,variant:"outlined",onChange:e=>R(e.target.value)}),(0,O.jsxs)(B.A,{display:"flex",alignItems:"center",gap:1,children:[(0,O.jsx)("span",{children:"Show:"}),(0,O.jsxs)(H.A,{size:"small",value:$,onChange:e=>L(e.target.value),children:[(0,O.jsx)(z.A,{value:"all",children:"All"}),(0,O.jsx)(z.A,{value:"true",children:"Published only"}),(0,O.jsx)(z.A,{value:"false",children:"Unpublished only"})]})]}),(0,O.jsxs)(B.A,{display:"flex",alignItems:"center",gap:1,children:[(0,O.jsx)("span",{children:"Sort by:"}),(0,O.jsxs)(H.A,{size:"small",value:de,onChange:e=>re(e.target.value),children:[(0,O.jsx)(z.A,{value:"created_at-desc",children:"Newest first"}),(0,O.jsx)(z.A,{value:"created_at-asc",children:"Oldest first"}),(0,O.jsx)(z.A,{value:"name-asc",children:"Name (A \u2192 Z)"}),(0,O.jsx)(z.A,{value:"name-desc",children:"Name (Z \u2192 A)"}),(0,O.jsx)(z.A,{value:"is_published-desc",children:"Published first"}),(0,O.jsx)(z.A,{value:"is_published-asc",children:"Unpublished first"})]})]})]}),(0,O.jsx)(B.A,{bgcolor:"white",p:2,children:ye?(0,O.jsx)(B.A,{display:"flex",justifyContent:"center",p:4,children:(0,O.jsx)(G.A,{})}):je&&0===je.length?(0,O.jsx)(q.A,{color:"textSecondary",textAlign:"center",py:4,variant:"body2",children:"No kiosks found."}):je?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Y.A,{children:(0,O.jsxs)(X.A,{size:"small",children:[(0,O.jsx)(Z.A,{children:(0,O.jsxs)(J.A,{children:[(0,O.jsx)(Q.A,{children:(0,O.jsx)(q.A,{fontWeight:"bold",variant:"body2",children:"Name"})}),(0,O.jsx)(Q.A,{children:(0,O.jsx)(q.A,{fontWeight:"bold",variant:"body2",children:"Weighing Method"})}),(0,O.jsx)(Q.A,{children:(0,O.jsx)(q.A,{fontWeight:"bold",variant:"body2",children:"Weight Units"})}),(0,O.jsx)(Q.A,{children:(0,O.jsx)(q.A,{fontWeight:"bold",variant:"body2",children:"Payment Type"})}),(0,O.jsx)(Q.A,{align:"center",children:(0,O.jsx)(q.A,{fontWeight:"bold",variant:"body2",children:"Status"})}),(0,O.jsx)(Q.A,{align:"center",children:(0,O.jsx)(ee.A,{arrow:!0,title:"Refresh",children:(0,O.jsx)(te.A,{size:"small",onClick:()=>{E((e=>({...e,pages:{}})))},children:(0,O.jsx)(oe.A,{fontSize:"small"})})})})]})}),(0,O.jsx)(ae.A,{children:je.map((e=>{var a,i,s,o,n,l;const c=null!==(a=null===(i=(0,y.uz)(e.paymentType))||void 0===i?void 0:i.stringId)&&void 0!==a?a:"empty",u=ve.formatMessage({id:c}),p=null!==(s=null===(o=(0,b.uz)(e.weightUnits))||void 0===o?void 0:o.stringId)&&void 0!==s?s:"empty",m=ve.formatMessage({id:p}),v=null!==(n=null===(l=(0,A.uz)(e.weighingMethod))||void 0===l?void 0:l.stringId)&&void 0!==n?n:"empty",h=ve.formatMessage({id:v}),_=!1===e.isPublished;return(0,O.jsxs)(J.A,{hover:!0,sx:{cursor:"pointer",opacity:_?.6:1},onClick:()=>(async e=>{try{xe(!0);const a=await(0,g.ce)(e);ge((0,f.$j)(a));const i=(0,d.tW)(r.BV.KIOSK_INFO,{companyId:t,kioskId:e});_e.push(i)}catch(a){(0,j.l)(he,a)}finally{xe(!1)}})(e.id),children:[(0,O.jsx)(Q.A,{children:e.name}),(0,O.jsx)(Q.A,{children:h}),(0,O.jsx)(Q.A,{children:m}),(0,O.jsx)(Q.A,{children:u}),(0,O.jsx)(Q.A,{align:"center",children:(0,O.jsx)(ie.A,{color:_?"default":"success",label:_?"Unpublished":"Published",size:"small"})}),(0,O.jsx)(Q.A,{align:"center",onClick:e=>e.stopPropagation(),children:ue[le.aX.DELETE_KIOSK]&&(0,O.jsx)(te.A,{size:"small",onClick:()=>{return t=e.id,T(t),void w(!0);var t},children:(0,O.jsx)(ne.A,{fontSize:"small"})})})]},e.id)}))})]})}),(0,O.jsx)(se.A,{component:"div",count:p.total,onPageChange:(e,t)=>
1E((e=>({...e,currentPage:t+1}))),page:p.currentPage-1,rowsPerPage:20,rowsPerPageOptions:[20]})]}):null}),Boolean(P&&N)&&(0,O.jsx)(F,{setModalOpen:w,kioskID:P,scaleID:o,handleRemoveKiosk:e=>{E((t=>(0,K.f4)({state:t,itemId:e})))}})]})};de.displayName="KiosksList";const re=de;let ce;!function(e){e.LANDSCAPE_LEFT="landscape-left",e.LANDSCAPE_RIGHT="landscape-right"}(ce||(ce={}));const ue=[ce.LANDSCAPE_LEFT,ce.LANDSCAPE_RIGHT];var pe=a(90030);const me="tablet_kiosk_enable_user_login",ve="tablet_kiosk_enable_one_login",he="tablet_kiosk_default_locale",ge="tablet_kiosk_admin_password",_e="change_admin_password",xe="deliver_tablet_kiosk_weighment_through_sms",ye="deliver_tablet_kiosk_weighment_through_email",Ae="tablet_kiosk_distributor_email",be="isEdited",fe="hasOriginalData",je="tablet_display_orientation";var Ie=a(6349),Se=a(4763),ke=a(36688),Ce=a(25671);const Ee=e=>{var t,a,o,n,d,r;let{companyId:c,scaleId:u}=e;const[p,_]=(0,i.useState)(),[x,y]=(0,i.useState)(!1),A=((0,i.useRef)(null),(0,m.MW)()),b=(0,v.A)(),f=(0,s.wA)(),{setIsLoading:k}=(0,i.useContext)(S.Y),[C,E]=(0,i.useState)({[ge]:"",[_e]:!1,[he]:null,[ve]:!1,[me]:!1,[fe]:!1,[be]:!1,[xe]:!1,[ye]:!1,[Ae]:"",[je]:ce.LANDSCAPE_LEFT,only_send_completed_workflows:!0});(0,i.useEffect)((()=>{(async()=>{try{const e=await(0,g.QG)(u);if((0,l.isNil)(e))return void E((e=>({...e,[_e]:!0})));_((()=>({...e,tabletKioskDistributorEmail:e.tabletKioskDistributorEmail||""}))),y(e.tabletKioskEnabled),E((t=>{var a,i;return{...t,[he]:null!==(a=null===(i=(0,pe.Bq)(e.tabletKioskDefaultLocale))||void 0===i?void 0:i.locale)&&void 0!==a?a:"",[ve]:e.tabletKioskEnableOneLogin,[me]:e.tabletKioskEnableUserLogin,[xe]:e.deliverTabletKioskWeighmentThroughSms,[ye]:e.deliverTabletKioskWeighmentThroughEmail,[Ae]:e.tabletKioskDistributorEmail||"",[fe]:!0,[je]:e.tabletDisplayOrientation.includes("landscape")?e.tabletDisplayOrientation:ce.LANDSCAPE_LEFT,only_send_completed_workflows:e.onlySendCompletedWorkflows}}))}catch(e){(0,j.l)(A,e)}})()}),[u]);const N=((e,t,a)=>{if((0,l.isNil)(e))return!0;const i=e.deliverTabletKioskWeighmentThroughEmail!==t.deliverTabletKioskWeighmentThroughEmail,s=e.deliverTabletKioskWeighmentThroughSms!==t.deliverTabletKioskWeighmentThroughSms,o=e.tabletKioskEnableUserLogin!==t.tabletKioskEnableUserLogin,n=e.tabletKioskEnableOneLogin!==t.tabletKioskEnableOneLogin,d=e.tabletKioskDefaultLocale!==t.tabletKioskDefaultLocale,r=e.tabletKioskDistributorEmail!==t.tabletKioskDistributorEmail,c=e.tabletDisplayOrientation!==t.tabletDisplayOrientation,u=e.onlySendCompletedWorkflows!==t.onlySendCompletedWorkflows;return i||s||o||n||d||r||c||u||!(0,l.isEmpty)(a||"")})(p,{scaleId:(null===p||void 0===p?void 0:p.scaleId)||"",scaleLocationCode:(null===p||void 0===p?void 0:p.scaleLocationCode)||"",tabletKioskEnabled:(null===p||void 0===p?void 0:p.tabletKioskEnabled)||!1,tabletDisplayOrientation:C[je],deliverTabletKioskWeighmentThroughEmail:C[ye],deliverTabletKioskWeighmentThroughSms:C[xe],tabletKioskEnableUserLogin:C[me],tabletKioskEnableOneLogin:C[ve],tabletKioskDefaultLocale:null!==(t=C[he])&&void 0!==t?t:"",tabletKioskDistributorEmail:C[Ae]||"",onlySendCompletedWorkflows:C.only_send_completed_workflows},C[ge])&&x;return(0,O.jsxs)("form",{className:"tablet-kiosk__header-container",onSubmit:e=>{e.preventDefault(),(async()=>{try{var e,t,a,i,s;k(!0);const o=await(0,g.yz)(c,u,{alreadyCreatedSettings:!(0,l.isNil)(p),changedSettings:N,deliver_tablet_kiosk_weighment_through_email:null!==(e=C[ye])&&void 0!==e&&e,deliver_tablet_kiosk_weighment_through_sms:null!==(t=C[xe])&&void 0!==t&&t,tablet_display_orientation:C[je],tablet_kiosk_admin_password:C[ge],tablet_kiosk_default_locale:null!==(a=C[he])&&void 0!==a?a:"",tablet_kiosk_enable_one_login:null!==(i=C[ve])&&void 0!==i&&i,tablet_kiosk_enable_user_login:null!==(s=C[me])&&void 0!==s&&s,tablet_kiosk_distributor_email:C[Ae]||null,tablet_kiosk_enabled:!0,only_send_completed_workflows:C.only_send_completed_workflows});_((()=>o));const n=b.formatMessage({id:"dashboard.tablet_kiosk.you_have_successfully_enabled_kiosk_mode"});A.success(n),E((e=>({...e,[ge]:"",[_e]:!1})))}catch(o){f((0,R.Ds)({type:"error",title:b.formatMessage({id:"alert.error"}),message:(0,D.u$)(o)}))}finally{k(!1)}})()},children:[(0,O.jsxs)("div",{className:"tablet-kiosk__header-title-and-button-container",children:[(0,O.jsx)("h1",{className:"tablet-kiosk__header-title",children:(0,O.jsx)(h.A,{id:"dashboard.tablet_kiosk.tablet_kiosk_enabled"})}),(0,O.jsx)("div",{className:"tablet-kiosk__header-button-container",children:(0,O.jsx)(I.A,{isBold:!0,isGreen:!x,isRed:x,titleId:x?"dashboard.tablet_kiosk.disable_kiosk_mode":"dashboard.tablet_kiosk.enable_kiosk_mode",onClick:async()=>
1{if((0,l.isNil)(p))y((e=>!e));else try{k(!0),await(0,g.mB)(c,u,{tablet_kiosk_enabled:!x});const e=b.formatMessage({id:x?"dashboard.tablet_kiosk.you_have_successfully_disable_kiosk_mode":"dashboard.tablet_kiosk.you_have_successfully_enabled_kiosk_mode"});A.success(e),y((e=>!e))}catch(e){(0,j.l)(A,e)}finally{k(!1)}}})}),N&&(0,O.jsx)("div",{className:"tablet-kiosk__header-button-container",children:(0,O.jsx)(I.A,{isBold:!0,isSubmit:!0,titleId:"dashboard.tablet_kiosk.save_changes"})})]}),x&&(0,O.jsx)(O.Fragment,{children:(0,O.jsxs)(Ie.xA,{container:!0,spacing:1,mt:2,alignItems:"center",children:[(0,O.jsx)(Ie.xA,{item:!0,xs:12,md:4,children:(0,O.jsx)(Se.A,{label:b.formatMessage({id:"dashboard.tablet_kiosk.default_language"}),onChange:e=>E((t=>({...t,[he]:e.target.value}))),value:C[he]||"",children:pe.Ay.map((e=>(0,O.jsx)(z.A,{value:e.locale.toString(),children:b.formatMessage({id:e.stringId})},e.locale.toString())))})}),(0,O.jsx)(Ie.xA,{item:!0,xs:12,md:4,children:(0,O.jsx)(Se.A,{label:"Tablet Orientation",onChange:e=>E((t=>({...t,[je]:e.target.value}))),value:C[je]||"",children:ue.map((e=>(0,O.jsx)(z.A,{value:e.toString(),children:e},e.toString())))})}),(0,O.jsx)(Ie.xA,{item:!0,xs:12,md:4,children:(0,O.jsx)(ke.A,{label:b.formatMessage({id:"dashboard.tablet_kiosk.tablet_kiosk_distributor_email"}),value:C[Ae]||"",onChange:e=>E((t=>({...t,[Ae]:e.target.value}))),textfieldProps:{type:"email"}})}),(0,O.jsx)(Ie.xA,{item:!0,xs:12,md:C[_e]?"auto":12,children:(0,O.jsx)(Ce.A,{label:b.formatMessage({id:"dashboard.tablet_kiosk.change_admin_password"}),checked:C[_e],onChange:e=>E((t=>({...t,[_e]:e}))),type:"checkbox",disabled:(0,l.isNil)(p)})}),C[_e]&&(0,O.jsx)(Ie.xA,{item:!0,xs:12,md:6,children:(0,O.jsx)(ke.A,{label:b.formatMessage({id:"dashboard.tablet_kiosk.admin_password"}),value:C[ge]||"",onChange:e=>E((t=>({...t,[ge]:e.target.value}))),required:!0})}),(0,O.jsx)(Ie.xA,{item:!0,xs:12,children:(0,O.jsx)(Ie.cG,{})}),(0,O.jsx)(Ie.xA,{item:!0,xs:12,children:(0,O.jsx)(Ce.A,{label:b.formatMessage({id:"dashboard.tablet_kiosk.enable_user_login"}),checked:null!==(a=C[me])&&void 0!==a&&a,onChange:e=>E((t=>({...t,[me]:e}))),type:"checkbox"})}),(0,O.jsx)(Ie.xA,{item:!0,xs:12,md:4,children:(0,O.jsx)(Ce.A,{label:b.formatMessage({id:"dashboard.tablet_kiosk.enable_single_login"}),checked:null!==(o=C[ve])&&void 0!==o&&o,onChange:e=>E((t=>({...t,[ve]:e}))),type:"checkbox"})}),C[ve]&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Ie.xA,{item:!0,xs:12,children:(0,O.jsx)(Ce.A,{label:b.formatMessage({id:"dashboard.tablet_kiosk.send_tickets_through_sms"}),checked:null!==(n=C[xe])&&void 0!==n&&n,onChange:e=>E((t=>({...t,[xe]:e}))),type:"checkbox",sx:{ml:3}})}),(0,O.jsx)(Ie.xA,{item:!0,xs:12,children:(0,O.jsx)(Ce.A,{label:b.formatMessage({id:"dashboard.tablet_kiosk.send_tickets_to_email"}),checked:null!==(d=C[ye])&&void 0!==d&&d,onChange:e=>E((t=>({...t,[ye]:e}))),type:"checkbox",sx:{ml:3}})}),(0,O.jsx)(Ie.xA,{item:!0,xs:12,children:(0,O.jsx)(Ce.A,{label:"Only Send Completed Workflows",checked:null!==(r=C.only_send_completed_workflows)&&void 0!==r&&r,onChange:e=>E((t=>({...t,only_send_completed_workflows:e}))),type:"checkbox",sx:{ml:3}})})]})]})})]})};Ee.displayName="TabletKiosk";const Ne=Ee;var we=a(10895),Pe=a(68446),Te=a(93528),$e=a(5765),Le=a(22240),Me=a(87491);const Re=e=>{let{scale:t,onClose:a}=e;(0,m.MW)();const o=(0,v.A)(),n=(0,s.wA)(),{setIsLoading:r}=((0,d.W6)(),(0,i.useContext)(S.Y)),c=(0,W.N)((e=>e.selectedCompany.data)),[u,p]=(0,i.useState)(t.name),[h,g]=(0,i.useState)(!1),{id:_,axleSpec:x,location:y,ssid:A,name:b,port:f,hardwareSpecs:j,backCamera:I,decryptedBackCameraUrl:k,frontCamera:C,decryptedFrontCameraUrl:T,overheadCamera:$,decryptedOverheadCameraUrl:L,geoFence:M,distanceUnits:U,divisionList:F,currentDivision:K,wifiName:B,wifiPassword:V,weighmasterRequired:H,supportEmail:z,supportPhone:G,weightUnits:q,stringFormat:Y,startingTicketNumber:X,commandString:Z,localScaleCompanyName:J,province:Q,weighmasterCertificationWaitSeconds:ee,liveViewMessage:te,siteId:ae}=t,ie=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=(0,Le.lq)(`+${G}`);try{var i,s,d,p;r(!0);const m=await(0,Me.Qb)(c.id,!1,{allow_duplicate_name:e,scale_hardware_specs_id:j.id,name:u,geo_fence:M,distance_units:U,weighmaster_required:H,ssid:A,port:f.toString(),support_email:z,support_phone:null!==(i=null===t||void 0===t||null===(s=t.nationalNumber)||void 0===s?void 0:s.toString())&&void 0!==i?i:"",support_phone_country_code:null!==(d=null===t||void 0===t||null===(p=t.countryCallingCode)||void 0===p?void 0:p.toString())&&void 0!==d?d:we.T1,latitude:y.coordinates[0].toString(),longitude:y.coordinates[1].toString(),back_camera_spec_id:null===I||void 0===I?void 0:I.id,back_camera_url:k,front_camera_spec_id:null===C||void 0===C?void 0:C.id,front_camera_url:T,overhead_camera_spec_id:null===$||void 0===$?void 0:$.id,overhead_camera_url:L,wifi_name:B||void 0,wifi_password:V||void 0,weight_units:q,string_format:Y,starting_ticket_number:X,command_string:Z,local_scale_company_name:J,province:Q,weighmaster_certification_wait_seconds:ee,live_view_message:te||"",site_id:ae},null);(0,l.isEmpty)(F)||(0,l.isNil)(K)||await(0,Me.zX)(c.id,m.id,{divisions:F,current:K});const v=o.formatMessage({id:"dashboard.scale_info.you_have_successfully_duplicated"});n((0,R.Ds)({type:"success",title:o.formatMessage({id:"alert.success"}),message:v})),a()}catch(m){n((0,R.Ds)({type:"error",title:o.formatMessage({id:"alert.error"}),message:(0,D.u$)(m)}))}finally{r(!1)}};return(0,O.jsxs)(N.A,{open:!0,onClose:a,children:[(0,O.jsx)(w.A,{children:"Duplicate Scale"}),(0,O.jsxs)(P.A,{style:{overflow:"visible"},children:[(0,O.jsx)("form",{onSubmit:e=>{e.preventDefault(),r(!0),(async()=>{try{if(!await(0,$e.a)({companyId:c.id,item:"scales",name:u}))throw new Error("Name not in use");g(!0),r(!1)}catch(e){console.log("error",e),ie()}})()},children:(0,O.jsxs)(E.Ay,{container:!0,spacing:1,children:[(0,O.jsx)(E.Ay,{item:!0,xs:12,children:(0,O.jsx)(ke.A,{label:"New Scale Name",value:u,required:!0,onChange:e=>p(e.target.value)})}),(0,O.jsx)(E.Ay,{item:!0,xs:6,children:(0,O.jsx)(Ie.$n,{fullWidth:!0,variant:"outlined",color:"primary",type:"button",onClick:()=>a(),children:o.formatMessage({id:"dashboard.popup.cancel"})})}),(0,O.jsx)(E.Ay,{item:!0,xs:6,children:(0,O.jsx)(Ie.$n,{fullWidth:!0,variant:"contained",color:"primary",type:"submit",children:o.formatMessage({id:"dashboard.popup.confirm"})})})]})}),h&&(0,O.jsx)(Te.A,{name:u,onClose:()=>g(!1),onConfirm:e=>ie(e)})]})]})},De=e=>
1{let{companyId:t,currentDivision:a,distanceUnits:s,geoFence:o,scale:n,showPopUp:d,onScaleModified:r}=e;const{setIsLoading:c}=(0,i.useContext)(S.Y),u=(0,v.A)(),p=((0,m.MW)(),(0,W.N)((e=>e.session.permissions))),[g,_]=(0,i.useState)(!1),{id:x,axleSpec:y,location:A,ssid:b,name:f,port:j,hardwareSpecs:k,backCamera:E,backCameraUrl:N,decryptedBackCameraUrl:w,frontCamera:P,frontCameraUrl:T,decryptedFrontCameraUrl:$,overheadCamera:L,overheadCameraUrl:M,decryptedOverheadCameraUrl:R,wifiName:D,wifiPassword:U,weighmasterRequired:F,supportEmail:K,supportPhone:B,weightUnits:V,stringFormat:H,startingTicketNumber:z,commandString:G,localScaleCompanyName:q,province:Y,weighmasterCertificationWaitSeconds:X,liveViewMessage:Z,siteId:J}=n,Q=V.toLowerCase(),ee=`${o} ${s.toLowerCase()}`,te=F?u.formatMessage({id:"yes"}):u.formatMessage({id:"no"}),ae=(A.coordinates[0],A.coordinates[1],`${a} ${Q}`);return(0,O.jsxs)("section",{className:"scale-info__info-container",children:[(0,O.jsx)("div",{className:"scale-info__info-title-container",children:(0,O.jsx)("h5",{className:"scale-info__info-title",children:(0,O.jsx)(h.A,{id:"dashboard.scale_info.scale_information"})})}),(0,O.jsxs)("div",{className:"scale-info__info-scale-container",children:[(0,O.jsx)(Pe.A,{info:ee,titleId:"dashboard.scale_info.geo_fence"}),(0,O.jsx)(Pe.A,{info:te,titleId:"dashboard.scale_info.weighmaster_required"}),(0,O.jsx)(Pe.A,{info:K,titleId:"dashboard.scale_info.support_email"}),(0,O.jsx)(we.Ay,{disabled:!0,isFullPhone:!0,isValid:!0,isSubmitted:!1,labelId:"dashboard.scale_info.support_phone",name:"",phone:B,setPhone:l.noop}),(0,O.jsx)(Pe.A,{info:ae,titleId:"dashboard.scale_info.active_scale_division"})]}),(0,O.jsxs)("div",{className:"scale-info__info-buttons-container",children:[p[le.aX.UPDATE_SCALE]&&(0,O.jsx)(I.A,{isBold:!0,titleId:"dashboard.scale_info.modify_scale",onClick:()=>{d({titleId:"dashboard.scales.popup.modify_scale",companyId:t,popUpType:C.MODIFY_SCALE,scale:n,scaleId:x,onScaleAdded:r})}}),p[le.aX.CREATE_SCALE]&&(0,O.jsx)(I.A,{isBlue:!0,isBold:!0,titleId:"dashboard.scale_info.duplicate_scale",onClick:async()=>{_(!0)}}),p[le.aX.UPDATE_SCALE]&&(0,O.jsx)(I.A,{isBlue:!0,isBold:!0,titleId:"dashboard.scale_info.linked_scales",onClick:()=>{d({companyId:t,titleId:"dashboard.scale_info.linked_scales",popUpType:C.UPDATE_SCALE_RELATIONS,scale:n})}}),p[le.aX.UPDATE_SCALE]&&(0,O.jsx)(I.A,{isBold:!0,isGreen:!0,titleId:(0,l.isNil)(y)?"dashboard.scale_info.create_axle_spec":"dashboard.scale_info.modify_axle_spec",onClick:()=>{const e=(0,l.isNil)(y)?C.CREATE_AXLE_SPEC:C.MODIFY_AXLE_SPEC,a=(0,l.isNil)(y)?void 0:y;d({companyId:t,titleId:"dashboard.scale_info.popup.create_axle_spec",popUpType:e,scale:n,axleSpec:a,onScaleModified:r})}})]}),g&&(0,O.jsx)(Re,{onClose:()=>_(!1),scale:n})]})};De.displayName="ScaleInfoContentInfo";const Oe=De;var Ue=a(99459),Fe=a(73823),We=a(89268);const Ke=e=>{let{distanceUnits:t,geoFence:a,lat:s,lng:o,location:n,locationCode:l,scale:d}=e;const[r,c]=(0,i.useState)(""),u=(0,m.MW)();(0,i.useEffect)((()=>{(async()=>{try{const e=await Ue.A.fromLatLng(n.coordinates[0].toString(),n.coordinates[1].toString());c((()=>e.results[0].formatted_address))}catch(e){(0,j.l)(u,e)}})()}),[n.coordinates,u]);const p=`${s}, ${o}`,v=(0,Fe.LC)(a,(0,Fe.kP)(t),Fe.k7.METER);return(0,O.jsxs)("section",{className:"scale-info__map-container",children:[(0,O.jsx)("div",{className:"scale-info__map-title-container",children:(0,O.jsx)("h5",{className:"scale-info__map-title",children:(0,O.jsx)(h.A,{id:"dashboard.scale_info.location"})})}),(0,O.jsx)("div",{className:"scale-info__map",children:(0,O.jsx)(We.Ay,{hasRadius:!0,lat:s,lng:o,radiusLengthInMeters:v})}),(d.siteName||d.siteEpaId||d.siteFacilityId)&&(0,O.jsxs)("div",{className:"scale-info__map-scale-info-container",children:[d.siteName&&(0,O.jsx)(Pe.A,{info:d.siteName,title:"Site"}),d.siteEpaId&&(0,O.jsx)(Pe.A,{info:d.siteEpaId,title:"EPA ID"}),d.siteFacilityId&&(0,O.jsx)(Pe.A,{info:d.siteFacilityId,title:"Facility ID"})]}),(0,O.jsxs)("div",{className:"scale-info__map-info-container",children:[(0,O.jsx)(Pe.A,{info:r,titleId:"dashboard.scale_info.scale_address"}),(0,O.jsx)(Pe.A,{info:p,titleId:"dashboard.scale_info.coordinates"}),(0,O.jsx)(Pe.A,{info:l,titleId:"dashboard.scale_info.location_code"})]})]})};Ke.displayName="ScaleInfoContentLocation";const Be=Ke;var Ve=a(45180),He=a(50704),ze=a(43188);const Ge=e=>{let{companyId:t,scale:a,onScaleModified:i}=e;return(0,O.jsxs)(Ie.Zp,{mt:2,children:[(0,O.jsx)(Ve.A,{action:(0,O.jsx)(ee.A,{title:"Refresh lock status",children:(0,O.jsx)(te.A,{onClick:()=>i(a),children:(0,O.jsx)(oe.A,{})})}),title:"Scale Lock",titleTypographyProps:{variant:"h6",fontWeight:"bold"}}),(0,O.jsx)(He.A,{children:(0,O.jsx)(ze.A,{companyId:t,scale:a,onScaleModified:i})})]})};var qe=a(4753),Ye=a(85421),Xe=a(25941),Ze=a(71766),Je=a(50618),Qe=a(53256);const et=e=>{let{scale:t}=e;(0,m.MW)(),(0,v.A)(),(0,s.wA)();const a=(0,W.N)((e=>e.selectedCompany.data)),o=(0,W.N)((e=>e.session.permissions)),[n,l]=(0,i.useState)(K.qA),[d,r]=(0,i.useState)(!1),c=()=>
1{l({...K.qA})};return(0,i.useEffect)((()=>{(async()=>{if(!n.pages[n.currentPage])try{const e=await(0,Xe.ZM)({companyId:a.id,page:n.currentPage,scale_ids:[t.id]});l((t=>({...t,count:e.total,pages:{...t.pages,[t.currentPage]:e.data}})))}catch(e){console.log("error",e)}})()}),[n]),(0,i.useEffect)((()=>{c()}),[t]),(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Ye.A,{headerOptions:{title:"Weighmasters",action:o[le.aX.VIEW_EMPLOYEES]?(0,O.jsx)($.A,{color:"primary",variant:"contained",onClick:()=>r(!0),children:(0,O.jsx)(Qe.A,{})}):void 0},children:(0,O.jsx)(He.A,{children:(0,O.jsx)(E.Ay,{container:!0,spacing:1,children:(0,O.jsx)(E.Ay,{item:!0,xs:12,children:(0,O.jsx)(Ze.lp,{weighmasters:n.pages[n.currentPage],tableFooterContent:(0,O.jsx)(qe.A,{count:n.lastPage,page:n.currentPage,onChange:(e,t)=>l((e=>({...e,currentPage:t})))}),onWeighmasterUpdated:e=>{l((t=>({...t,pages:{...t.pages,[t.currentPage]:t.pages[t.currentPage].map((t=>t.id!==e.id?t:{...t,...e}))}})))},onWeighmasterDeleted:c})})})})}),d&&(0,O.jsx)(Je.A,{scale:t,closeModal:()=>r(!1),onWeighmasterCreated:c})]})};var tt=a(49244),at=a(25979),it=a(20544),st=a(22551),ot=a(34727),nt=a(88599),lt=a(75654),dt=a(50687);const rt=e=>{var t,a,n,m,h,g;let{data:_,showPopUp:x}=e;const y=(0,v.A)(),{data:A}=(0,s.d4)((e=>e.selectedScale)),b=A,f=(0,i.useRef)(null),j=(0,s.wA)(),I=(0,d.W6)(),k=(0,d.g)(),{setIsLoading:C}=(0,i.useContext)(S.Y),E=(0,W.N)((e=>e.session.permissions)),N=(0,W.N)((e=>e.selectedCompany.data)),w=N.id,P=(0,W.N)((e=>e.selectedCompany.existsInLive)),T=(0,W.N)((e=>e.session.isInSandbox)),L=T?"live environment":"sandbox environment";(0,u.A)({focus:()=>{var e;return null===(e=f.current)||void 0===e?void 0:e.focus()}});const[M,U]=(0,i.useState)(!1),[F,K]=(0,i.useState)(!1),[B,H]=(0,i.useState)(!0),[z,G]=(0,i.useState)(!1),[q,Y]=(0,i.useState)(null),[X,Z]=(0,i.useState)(null),J=!b||(0,l.isEmpty)(b);if((0,i.useEffect)((()=>{const e=Number.parseInt(k.scaleId||"",10);e&&(J||(null===b||void 0===b?void 0:b.id)!==e)&&(C(!0),(async()=>{try{const t=await(0,Me.X_)(w||k.companyId&&Number.parseInt(k.companyId,10)||w,e);j((0,o.Ux)(t))}catch(t){j((0,R.Ds)({type:"error",title:y.formatMessage({id:"alert.error"}),message:(0,D.u$)(t)}))}finally{C(!1)}})())}),[b,k]),J)return(0,O.jsx)(Ie.xA,{container:!0,spacing:1,alignItems:"center",justifyContent:"center",children:(0,O.jsx)(Ie.xA,{item:!0,children:(0,O.jsx)(tt.A,{})})});const{id:Q,name:ee,hardwareSpecs:te,ssid:ae,port:ie,location:se,locationCode:oe,geoFence:ne,distanceUnits:de,currentDivision:ce,weighmasterRequired:ue,defaultKioskId:pe,stringFormat:me}=b,{make:ve,model:he}=te||{make:"",model:""};console.log("ScaleInfoContent",b);const ge=[`${ve} ${he}`,me,`${ae}:${ie}`].join(" | "),_e=se.coordinates[0],xe=se.coordinates[1];return(0,O.jsxs)("div",{className:"scale-info__container",children:[(0,O.jsxs)("section",{className:"scale-info__header-container",children:[(0,O.jsx)("div",{className:"scale-info__header-button-container",children:(0,O.jsxs)(Ie.xA,{container:!0,spacing:2,children:[(0,O.jsx)(Ie.xA,{item:!0,children:(0,O.jsx)(p.A,{iconId:"fa-arrow-circle-left",isPrimaryColor:!1,ref:f,titleId:"dashboard.scale_info.back_to_all_scales",onClick:()=>{var e;j((0,o.ju)());const t=(0,d.tW)(r.BV.SCALES,{companyId:null!==(e=null===_||void 0===_?void 0:_.companyId)&&void 0!==e?e:c.a});I.push(t)}})}),E[le.aX.CREATE_SCALE]&&(!T||P)&&(0,O.jsx)(Ie.xA,{item:!0,children:(0,O.jsxs)($.A,{onClick:()=>{K(!0)},children:["Copy to ",L]})})]})}),(0,O.jsx)("h1",{className:"scale-info__header-name",children:ee}),(0,O.jsx)("span",{className:"scale-info__header-info",children:ge})]}),(0,O.jsxs)(Ie.xA,{container:!0,spacing:2,mt:2,children:[(0,O.jsxs)(Ie.xA,{item:!0,xs:12,md:!0,children:[(0,O.jsx)(Be,{distanceUnits:de,geoFence:ne,lat:_e,lng:xe,location:se,locationCode:oe,scale:b}),(0,O.jsx)(Ge,{companyId:null!==(t=null===_||void 0===_?void 0:_.companyId)&&void 0!==t?t:c.a,scale:b,onScaleModified:null!==(a=null===_||void 0===_?void 0:_.onScaleModified)&&void 0!==a?a:l.noop})]}),(0,O.jsx)(Ie.xA,{item:!0,xs:12,md:3,children:(0,O.jsx)(Oe,{companyId:null!==(n=null===_||void 0===_?void 0:_.companyId)&&void 0!==n?n:c.a,currentDivision:ce,distanceUnits:de,geoFence:ne,scale:b,showPopUp:x,onScaleModified:null!==(m=null===_||void 0===_?void 0:_.onScaleModified)&&void 0!==m?m:l.noop})}),ue&&E[le.aX.MANAGE_WEIGHMASTERS]&&(0,O.jsx)(Ie.xA,{item:!0,xs:12,children:(0,O.jsx)(et,{scale:b})})]}),E[le.aX.UPDATE_SCALE]&&(0,O.jsx)(O.Fragment,{children:(0,O.jsx)(Ne,{companyId:null!==(h=null===_||void 0===_?void 0:_.companyId)&&void 0!==h?h:c.a,scaleId:Q})}
1),E[le.aX.VIEW_KIOSKS]&&(0,O.jsx)(O.Fragment,{children:(0,O.jsx)(re,{companyId:null!==(g=null===_||void 0===_?void 0:_.companyId)&&void 0!==g?g:c.a,defaultKioskId:pe,scaleId:Q,showPopUp:x})}),F&&(0,O.jsx)(lt.A,{open:!0,loading:M,title:`Sync to ${(0,dt.Zr)(L)}`,message:`Are you sure you want to sync this scale to the ${L}?`,additionalContent:(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Ce.A,{label:"Copy kiosks",type:"checkbox",checked:B,onChange:e=>H(e)}),E[le.aX.VIEW_SITES]&&(0,O.jsx)(Ce.A,{checked:z,label:"Link to Site",onChange:e=>{G(e),e&&!q&&(async()=>{try{const e=(await(0,nt.U_)({fromOtherEnvironment:!0})).find((e=>e.email===N.email));if(!e)return;const t=[];let a=1;for(;;){const i=await(0,ot.wK)({companyId:e.id,page:a,fromOtherEnvironment:!0});if(t.push(...i.data),!i.nextPageURL)break;a+=1}Y(t)}catch(e){console.log("error loading destination sites",e),Y([])}})()},type:"checkbox"}),z&&(0,O.jsx)(at.A,{fullWidth:!0,sx:{mt:2},children:(0,O.jsx)(it.A,{clearOnBlur:!1,getOptionLabel:e=>e.name,isOptionEqualToValue:(e,t)=>e.id===(null===t||void 0===t?void 0:t.id),loading:null===q,onChange:(e,t)=>
1Z(t),options:q||[],renderInput:e=>(0,O.jsx)(V.A,{...e,label:"Destination Site",type:"text",variant:"outlined"}),value:X||void 0})})]}),onCancel:()=>K(!1),onConfirm:()=>{U(!0),(async()=>{try{const e={copy_kiosks:B};X&&(e.attach_to_destination_site_id=X.id),await(0,st.bH)({companyId:w,scaleId:Q,payload:e}),j((0,R.Ds)({type:"success",title:y.formatMessage({id:"alert.success"}),message:`Scale ${B?"and kiosks ":""}copied to ${L}!`})),K(!1)}catch(e){j((0,R.Ds)({type:"error",title:y.formatMessage({id:"alert.error"}),message:(0,D.u$)(e)}))}finally{U(!1)}})()}})]})};rt.displayName="ScaleInfoContent";const ct=rt;var ut=a(88005),pt=a(7068),mt=a(7663),vt=a(46108),ht=a(26473),gt=a(9449),_t=a(60666),xt=a(44254),yt=a(25624),At=a(93605);const bt=`${nt.k4}`;let ft;!function(e){e.STRING="string",e.SET="set",e.VARIABLE_NUMBER="variable_num",e.FIXED_NUMBER="fixed_num"}(ft||(ft={}));const jt=[{id:"string",type:ft.STRING,stringId:"section_type.string"},{id:"set",type:ft.SET,stringId:"section_type.set"},{id:"variable_num",type:ft.VARIABLE_NUMBER,stringId:"section_type.variable_number"},{id:"fixed_num",type:ft.FIXED_NUMBER,stringId:"section_type.fixed_number"}],It=e=>jt.find((t=>t.id===e));let St;!function(e){e.CONDEC_CONTINUOUS_STRING="CCS",e.NEW_STRING="NS"}(St||(St={}));const kt=[{id:"CCS",type:St.CONDEC_CONTINUOUS_STRING,stringId:"string_notation.condec_continuous_string"},{id:"NS",type:St.NEW_STRING,stringId:"string_notation.new_string"}],Ct=e=>kt.find((t=>t.id===e)),Et=e=>{const t=(0,i.useRef)(e),a=(0,i.useRef)([]);return JSON.stringify(t.current)!==JSON.stringify(e)&&(a.current=t.current,t.current=e),a.current};var Nt=a(59100),wt=a(14664);let Pt;!function(e){e.EMPTY_SPACE=" ",e.ZEROS="0",e.NO_SELECTED="-1"}(Pt||(Pt={}));const Tt=Pt.EMPTY_SPACE,$t=[{id:" ",type:Pt.EMPTY_SPACE,stringId:"dashboard.axle.popup.empty_space"},{id:"0",type:Pt.ZEROS,stringId:"dashboard.axle.popup.zeros"}];let Lt;!function(e){e.WEIGHT_UNITS="weight_units",e.ERROR="error"}(Lt||(Lt={}));const Mt=[{id:"weight_units",type:Lt.WEIGHT_UNITS,stringId:"dashboard.axle.popup.weight_units"},{id:"error",type:Lt.ERROR,stringId:"dashboard.axle.popup.error"}],Rt="name",Dt="numPorts",Ot="default_weight_units",Ut="ports",Ft="port_name",Wt="ssid_check",Kt="ssid",Bt="port_number",Vt="string_notation",Ht="numSections",zt="sections",Gt="section_type",qt="representation",Yt="string",Xt="length",Zt="min_length",Jt="max_length",Qt="set_options",ea="padding",ta="is_set",aa="meaning",ia="value",sa=e=>{var t,a,i,s,o,n;return e?{[Ft]:"",[Kt]:"",[Wt]:!1,[Vt]:St.NEW_STRING,[Ht]:1,[zt]:[{[Gt]:ft.STRING,[Yt]:""}]}:{[Ft]:"",[Kt]:"",[Wt]:!1,[Vt]:St.CONDEC_CONTINUOUS_STRING,[Ht]:3,[zt]:[{[Gt]:ft.FIXED_NUMBER,[ea]:Pt.EMPTY_SPACE,[Xt]:7},{[Gt]:ft.SET,[qt]:Lt.WEIGHT_UNITS,[Qt]:[{[ta]:!1,[ia]:b.tL.POUND,[aa]:null!==(t=null===(a=(0,b.uz)(b.tL.POUND))||void 0===a?void 0:a.stringId)&&void 0!==t?t:"empty"},{[ta]:!1,[ia]:b.tL.KILOGRAM,[aa]:null!==(i=null===(s=(0,b.uz)(b.tL.KILOGRAM))||void 0===s?void 0:s.stringId)&&void 0!==i?i:"empty"},{[ta]:!1,[ia]:b.tL.TON,[aa]:null!==(o=null===(n=(0,b.uz)(b.tL.TON))||void 0===n?void 0:n.stringId)&&void 0!==o?o:"empty"}]},{[Gt]:ft.SET,[qt]:Lt.ERROR,[Qt]:[{[ta]:!1,[ia]:"",[aa]:"dashboard.axle.popup.no_error"},{[ta]:!1,[ia]:"M",[aa]:"dashboard.axle.popup.motion"},{[ta]:!1,[ia]:"O",[aa]:"dashboard.axle.popup.over_under_range"}]}]}};var oa=a(86038);a(93092);const na=e=>{let{titleId:t}=e;return(0,O.jsx)("div",{className:"info__pop-up",children:(0,O.jsx)(h.A,{id:t,values:{linebreak:(0,O.jsx)("br",{})}})})};na.displayName="InfoPopUp";const la=na;let da;!function(e){e.STEER_WEIGHT="steer_weight",e.DRIVE_WEIGHT="drive_weight",e.TRAILER_WEIGHT="trailer_weight",e.TOTAL_WEIGHT="total_weight"}(da||(da={}));const ra=[{id:"steer_weight",type:da.STEER_WEIGHT,stringId:"dashboard.axle.popup.steer_weight"},{id:"drive_weight",type:da.DRIVE_WEIGHT,stringId:"dashboard.axle.popup.drive_weight"},{id:"trailer_weight",type:da.TRAILER_WEIGHT,stringId:"dashboard.axle.popup.trailer_weight"},{id:"total_weight",type:da.TOTAL_WEIGHT,stringId:"dashboard.axle.popup.total_weight"}],ca=e=>{var t,a,i,s,o,n,l,d,r,c,u,p,m,h,g,_;let{errors:x,portIndex:y,isSubmitted:A,register:b,section:f,sectionIndex:j}=e;const I=(0,v.A)();return(0,O.jsxs)("div",{children:[(0,O.jsxs)("div",{className:"port-section-spec__row",children:[(0,O.jsx)(wt.A,{isSubmitted:A,isValid:void 0===(null===(t=x[Ut])||void 0===t||null===(a=t[y])||void 0===a||null===(i=a[zt])||void 0===i||null===(s=i[j])||void 0===s?void 0:s[Gt]),labelId:"dashboard.axle.popup.section_type",name:`${Ut}.${y}.${zt}.${j}.${Gt}`,options:jt.map((e=>({id:e.id.toString(),value:e.type.toString(),label:I.formatMessage({id:e.stringId})}))),register:b}),(0,O.jsx)(wt.A,{isSubmitted:A,isValid:void 0===(null===(o=x[Ut])||void 0===o||null===(n=o[y])||void 0===n||null===(l=n[zt])||void 0===l||null===(d=l[j])||void 0===d?void 0:d[qt]),labelId:"dashboard.axle.popup.representation",name:`${Ut}.${y}.${zt}.${j}.${qt}`,options:ra.map((e=>({id:e.id.toString(),value:e.type.toString(),label:I.formatMessage({id:e.stringId})}))),register:b,validations:{required:f[Gt]===ft.FIXED_NUMBER}})]}),(0,O.jsxs)("div",{className:"port-section-spec__row",children:[(0,O.jsx)(Nt.A,{onlyPositivesWithoutZero:!0,isSubmitted:A,isValid:void 0===(null===(r=x[Ut])||void 0===r||null===(c=r[
1y])||void 0===c||null===(u=c[zt])||void 0===u||null===(p=u[j])||void 0===p?void 0:p[Xt]),labelId:"dashboard.axle.popup.length",name:`${Ut}.${y}.${zt}.${j}.${Xt}`,placeHolder:"5",register:b,type:"number",validations:{required:f[Gt]===ft.FIXED_NUMBER},value:f[Xt]}),(0,O.jsx)(wt.A,{isSubmitted:A,isValid:void 0===(null===(m=x[Ut])||void 0===m||null===(h=m[y])||void 0===h||null===(g=h[zt])||void 0===g||null===(_=g[j])||void 0===_?void 0:_[ea]),labelId:"dashboard.axle.popup.padding",name:`${Ut}.${y}.${zt}.${j}.${ea}`,options:$t.map((e=>({id:e.id.toString(),value:e.type.toString(),label:I.formatMessage({id:e.stringId})}))),register:b,validations:{required:f[Gt]===ft.FIXED_NUMBER}})]})]})};ca.displayName="FixedNumberSection";const ua=ca,pa=e=>{var t,a,i,s,o,n,l,d,r;let{errors:c,isSubmitted:u,onAddOption:p,onDeleteOption:m,onSwapCheck:h,portIndex:g,register:_,section:x,sectionIndex:y}=e;const A=(0,v.A)();return(0,O.jsxs)("div",{children:[(0,O.jsxs)("div",{className:"port-section-spec__row",children:[(0,O.jsx)(wt.A,{isSubmitted:u,isValid:void 0===(null===(t=c[Ut])||void 0===t||null===(a=t[g])||void 0===a||null===(i=a[zt])||void 0===i||null===(s=i[y])||void 0===s?void 0:s[Gt]),labelId:"dashboard.axle.popup.section_type",name:`${Ut}.${g}.${zt}.${y}.${Gt}`,options:jt.map((e=>({id:e.id.toString(),value:e.type.toString(),label:A.formatMessage({id:e.stringId})}))),register:_}),(0,O.jsx)(wt.A,{isSubmitted:u,isValid:void 0===(null===(o=c[Ut])||void 0===o||null===(n=o[g])||void 0===n||null===(l=n[zt])||void 0===l||null===(d=l[y])||void 0===d?void 0:d[qt]),labelId:"dashboard.axle.popup.representation",name:`${Ut}.${g}.${zt}.${y}.${qt}`,options:Mt.map((e=>({id:e.id.toString(),value:e.type.toString(),label:A.formatMessage({id:e.stringId})}))),register:_,validations:{required:x[Gt]===ft.SET}})]}),null===(r=x[Qt])||void 0===r?void 0:r.map(((e,t)=>{var a,i,s,o,n,l,d,r,p,v,f,j,S,k,C,E,N,w;return(0,O.jsxs)("div",{className:"port-section-spec__row",children:[(0,O.jsxs)("div",{children:[(0,O.jsx)(oa.A,{isChecked:e[ta],labelId:"dashboard.axle.popup.value_empty_space",onClick:()=>h(g,y,t)}),(0,O.jsx)(Nt.A,{isSubmitted:u,isValid:void 0===(null===(a=c[Ut])||void 0===a||null===(i=a[g])||void 0===i||null===(s=i[zt])||void 0===s||null===(o=s[y])||void 0===o||null===(n=o[Qt])||void 0===n||null===(l=n[t])||void 0===l?void 0:l[ia]),name:`${Ut}.${g}.${zt}.${y}.${Qt}.${t}.${ia}`,placeHolderId:"dashboard.axle.popup.empty",register:_,validations:{required:x[Gt]===ft.SET},value:e[ia]})]}),x[qt]===Lt.WEIGHT_UNITS?(0,O.jsx)(wt.A,{isSubmitted:u,isValid:void 0===(null===(d=c[Ut])||void 0===d||null===(r=d[g])||void 0===r||null===(p=r[zt])||void 0===p||null===(v=p[y])||void 0===v||null===(f=v[Qt])||void 0===f||null===(j=f[t])||void 0===j?void 0:j[aa]),labelId:"dashboard.axle.popup.meaning",name:`${Ut}.${g}.${zt}.${y}.${Qt}.${t}.${aa}`,options:b.Wu.map((e=>({id:e.id.toString(),value:e.id,label:A.formatMessage({id:e.stringId})}))),register:_,validations:{required:x[Gt]===ft.SET}}):(0,O.jsx)(Nt.A,{isSubmitted:u,isValid:void 0===(null===(S=c[Ut])||void 0===S||null===(k=S[g])||void 0===k||null===(C=k[zt])||void 0===C||null===(E=C[y])||void 0===E||null===(N=E[Qt])||void 0===N||null===(w=N[t])||void 0===w?void 0:w[aa]),labelId:"dashboard.axle.popup.meaning",name:`${Ut}.${g}.${zt}.${y}.${Qt}.${t}.${aa}`,register:_,validations:{required:x[Gt]===ft.SET},value:e[aa]}),(0,O.jsx)("div",{className:"port-section-spec__button",children:(0,O.jsx)(I.A,{isBold:!0,titleId:"dashboard.axle.popup.delete_option",onClick:()=>m(g,y,t)})})]})})),(0,O.jsx)("div",{className:"port-section-spec__button",children:(0,O.jsx)(I.A,{isBold:!0,titleId:"dashboard.axle.popup.add_option",onClick:()=>p(g,y)})})]})};pa.displayName="SetSection";const ma=pa,va=e=>{var t,a,i,s,o,n,l,d;let{errors:r,isSubmitted:c,portIndex:u,register:p,section:m,sectionIndex:h}=e;const g=(0,v.A)();return(0,O.jsx)("div",{children:(0,O.jsxs)("div",{className:"port-section-spec__row",children:[(0,O.jsx)(wt.A,{isSubmitted:c,isValid:void 0===(null===(t=r[Ut])||void 0===t||null===(a=t[u])||void 0===a||null===(i=a[zt])||void 0===i||null===(s=i[h])||void 0===s?void 0:s[Gt]),labelId:"dashboard.axle.popup.section_type",name:`${Ut}.${u}.${zt}.${h}.${Gt}`,options:jt.map((e=>({id:e.id.toString(),value:e.type.toString(),label:g.formatMessage({id:e.stringId})}))),register:p}),(0,O.jsx)(Nt.A,{isSubmitted:c,isValid:void 0===(null===(o=r[Ut])||void 0===o||null===(n=o[u])||void 0===n||null===(l=n[zt])||void 0===l||null===(d=l[h])||void 0===d?void 0:d[Yt]),labelId:"dashboard.axle.popup.string",name:`${Ut}.${u}.${zt}.${h}.${Yt}`,placeHolder:"\\x02, \\r, ;, etc.'",register:p,validations:{required:m[Gt]===ft.STRING}})]})})};va.displayName="StringSection";const ha=va,ga=e=>{var t,a,i,s,o,n,d,r,c,u,p,m,h;let{errors:g,isSubmitted:_,portIndex:x,register:y,section:A,sectionIndex:b}=e;const f=(0,v.A)();return(0,O.jsxs)("div",{children:[(0,O.jsxs)("div",{className:"port-section-spec__row",children:[(0,O.jsx)(wt.A,{isSubmitted:_,isValid:void 0===(null===(t=g[Ut])||void 0===t||null===(a=t[x])||void 0===a||null===(i=a[zt])||void 0===i||null===(s=i[b])||void 0===s?void 0:s[Gt]),labelId:"dashboard.axle.popup.section_type",name:`${Ut}.${x}.${zt}.${b}.${Gt}`,options:jt.map((e=>({id:e.id.toString(),value:e.type.toString(),label:f.formatMessage({id:e.stringId})}))),register:y}
1),(0,O.jsx)(wt.A,{isSubmitted:_,isValid:void 0===(null===(o=g[Ut])||void 0===o||null===(n=o[x])||void 0===n||null===(d=n[zt])||void 0===d||null===(r=d[b])||void 0===r?void 0:r[qt]),labelId:"dashboard.axle.popup.representation",name:`${Ut}.${x}.${zt}.${b}.${qt}`,options:ra.map((e=>({id:e.id.toString(),value:e.type.toString(),label:f.formatMessage({id:e.stringId})}))),register:y,validations:{required:A[Gt]===ft.VARIABLE_NUMBER}})]}),(0,O.jsxs)("div",{className:"port-section-spec__row",children:[(0,O.jsx)(Nt.A,{onlyPositivesWithoutZero:!0,isSubmitted:_,isValid:void 0===(null===(c=g[Ut])||void 0===c||null===(u=c[x])||void 0===u||null===(p=u[zt])||void 0===p||null===(m=p[b])||void 0===m?void 0:m[Zt]),labelId:"dashboard.axle.popup.min_length",name:`${Ut}.${x}.${zt}.${b}.${Zt}`,placeHolder:"5",register:y,type:"number",validations:{required:A[Gt]===ft.VARIABLE_NUMBER},value:A[Zt]}),(0,O.jsx)(Nt.A,{onlyPositivesWithoutZero:!0,isSubmitted:_,isValid:!(0,l.isNil)(A[Jt])&&A[Jt]>=(null!==(h=A[Zt])&&void 0!==h?h:-1),labelId:"dashboard.axle.popup.max_length",name:`${Ut}.${x}.${zt}.${b}.${Jt}`,placeHolder:"8",register:y,type:"number",validations:{required:A[Gt]===ft.VARIABLE_NUMBER,validate:e=>{var t;return e>=(null!==(t=A[Zt])&&void 0!==t?t:-1)}},value:A[Jt]})]})]})};ga.displayName="VariableNumberSection";const _a=ga,xa=e=>{let{errors:t,isSubmitted:a,onAddOption:i,onDeleteOption:s,onSwapCheck:o,portIndex:n,register:d,sections:r}=e;const c=(0,v.A)(),u=c.formatMessage({id:"dashboard.axle.popup.port"}),p=c.formatMessage({id:"dashboard.axle.popup.section"}),m=(e,r)=>{const c={[ft.STRING]:(0,O.jsx)(ha,{errors:t,isSubmitted:a,portIndex:n,register:d,section:e,sectionIndex:r}),[ft.FIXED_NUMBER]:(0,O.jsx)(ua,{errors:t,isSubmitted:a,portIndex:n,register:d,section:e,sectionIndex:r}),[ft.VARIABLE_NUMBER]:(0,O.jsx)(_a,{errors:t,isSubmitted:a,portIndex:n,register:d,section:e,sectionIndex:r}),[ft.SET]:(0,O.jsx)(ma,{errors:t,isSubmitted:a,portIndex:n,register:d,section:e,sectionIndex:r,onAddOption:i,onDeleteOption:s,onSwapCheck:o})},u=It(e[Gt].toString());return(0,l.isNil)(u)?null:c[u.type]};return(0,O.jsx)("div",{children:(0,O.jsx)("div",{className:"port-section-spec__container",children:null===r||void 0===r?void 0:r.map(((e,t)=>{var a;return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("h1",{className:"port-section-spec__title",children:`${u} ${n+1} - ${p} ${t+1}`}),null!==(a=m(e,t))&&void 0!==a?a:null]})}))})})};xa.displayName="PortSections";const ya=xa,Aa=e=>{var t,a,s,o,n,l,d,r,c,u,p,m;let{errors:g,isNewString:_,isSubmitted:x,onAddOption:y,onDeleteOption:A,onPortSSIDChange:b,onSwapCheck:f,port:j,portIndex:I,portSSIDCheck:S,register:k,scales:C,sections:E}=e;const[N,w]=(0,i.useState)(!1),P=(0,v.A)(),T=P.formatMessage({id:"dashboard.axle.popup.port"});return(0,O.jsxs)("section",{className:"port-spec__container",children:[(0,O.jsx)("h1",{className:"port-spec__title",children:`${T} ${I+1}`}),!_&&(0,O.jsx)("h3",{className:"port-spec__subtitle",children:E.map((e=>(e=>{var t,a,i,s;return{[ft.STRING]:P.formatMessage({id:null===(t=It(ft.STRING))||void 0===t?void 0:t.stringId}),[ft.FIXED_NUMBER]:P.formatMessage({id:null===(a=It(ft.FIXED_NUMBER))||void 0===a?void 0:a.stringId}),[ft.VARIABLE_NUMBER]:P.formatMessage({id:null===(i=It(ft.VARIABLE_NUMBER))||void 0===i?void 0:i.stringId}),[ft.SET]:`${null===(s=e[Qt])||void 0===s?void 0:s.map((e=>e[ia])).join("/")}`}[e[Gt]]})(e))).map((e=>`<${e}>`)).join()}),(0,O.jsxs)("div",{className:"port-spec__input-container",children:[(0,O.jsx)("div",{className:"port-spec__row",children:(0,O.jsx)(Nt.A,{isSubmitted:x,isValid:void 0===(null===(t=g[Ut])||void 0===t||null===(a=t[I])||void 0===a?void 0:a[Ft]),labelId:"dashboard.axle.popup.port_name",name:`${Ut}.${I}.${Ft}`,placeHolderId:"dashboard.axle.popup.steer_weight_drive_weight_etc",register:k})}),(0,O.jsxs)("div",{className:"port-spec__row",children:[(0,O.jsxs)("div",{children:[(0,O.jsx)(oa.A,{isChecked:S,labelId:"dashboard.axle.popup.port_ssid",onClick:()=>b(I,!S)}),S?(0,O.jsx)(wt.A,{isSubmitted:x,isValid:void 0===(null===(s=g[Ut])||void 0===s||null===(o=s[I])||void 0===o?void 0:o[Kt]),name:`${Ut}.${I}.${Kt}`,options:C.map((e=>({id:e.name,value:e.name,label:e.name}))),register:k}):(0,O.jsx)(Nt.A,{isSubmitted:x,isValid:void 0===(null===(n=g[Ut])||void 0===n||null===(l=n[I])||void 0===l?void 0:l[Kt]),name:`${Ut}.${I}.${Kt}`,placeHolder:"192.1.1.16",register:k})]}),(0,O.jsx)(Nt.A,{isSubmitted:x,isValid:void 0===(null===(d=g[Ut])||void 0===d||null===(r=d[I])||void 0===r?void 0:r[Bt]),labelId:"dashboard.axle.popup.port_number",name:`${Ut}.${I}.${Bt}`,placeHolder:"8080",register:k,type:"number"})]}),(0,O.jsxs)("div",{className:"port-spec__row",children:[(0,O.jsx)(wt.A,{isSubmitted:x,isValid:void 0===(null===(c=g[Ut])||void 0===c||null===(u=c[I])||void 0===u?void 0:u[Vt]),labelId:"dashboard.axle.popup.port_string_notation",name:`${Ut}.${I}.${Vt}`,options:kt.map((e=>({id:e.id.toString(),value:e.type.toString(),label:P.formatMessage({id:e.stringId})}))),register:k}),(0,O.jsxs)("div",{children:[(0,O.jsxs)("div",{className:"port-spec__number-of-sections",children:[(0,O.jsx)(h.A,{id:"dashboard.axle.popup.number_of_sections"}),(0,O.jsx)("i",{className:"fas fa-info-circle",onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1)}),N&&(0,O.jsx)("div",{className:"port-spec__info-container",children:(0,O.jsx)(la,{titleId:"dashboard.axle.popup.sections_are_divided"})})]}),(0,O.jsx)(Nt.A,{disabled:!0,onlyPositivesWithoutZero:!0,isSubmitted:x,isValid:void 0===(null===(p=g[Ut])||void 0===p||null===(m=p[I]
1)||void 0===m?void 0:m[Ht]),name:`${Ut}.${I}.${Ht}`,placeHolder:1..toString(),register:k,type:"number",value:j[Ht]})]})]})]}),(0,O.jsx)(ya,{errors:g,isSubmitted:x,portIndex:I,register:k,sections:E,onAddOption:y,onDeleteOption:A,onSwapCheck:f})]})};Aa.displayName="PortSpec";const ba=Aa,fa="1",ja=(e,t)=>{var a,i,s,o;const n={...sa(!0),[zt]:sa(!0)[zt].map((t=>{var a;return{...t,...t[Qt]&&{[Qt]:null===(a=t[Qt])||void 0===a?void 0:a.map((t=>({...t,[aa]:e.formatMessage({id:t[aa]})})))}}}))};return(0,l.isNil)(t)?{[Dt]:Number.parseInt(fa,10),[Ut]:[n]}:{[Ot]:t.defaultWeightUnits,[Dt]:null!==(a=null===(i=t.ports)||void 0===i?void 0:i.length)&&void 0!==a?a:Number.parseInt(fa,10),[Rt]:t.name,[Ut]:null!==(s=null===(o=t.ports)||void 0===o?void 0:o.map(((e,t)=>{var a,i,s,o;return{[Ft]:e.name,[Kt]:e.ssid,[Wt]:!(0,l.isEmpty)(e.ssid),[Vt]:St.NEW_STRING,[Ht]:null!==(a=null===(i=e.sections)||void 0===i?void 0:i.length)&&void 0!==a?a:Number.parseInt("1",10),[zt]:null!==(s=null===(o=e.sections)||void 0===o?void 0:o.map((e=>({[Gt]:e.type,[Xt]:e.length,[Jt]:e.maxLength,[Zt]:e.minLength,[ea]:e.padding}))))&&void 0!==s?s:[]}})))&&void 0!==s?s:[]}},Ia=e=>{let{axleSpec:t,closePopUp:a,data:s}=e;const[o,n]=(0,i.useState)([]),d=(0,v.A)(),r=(0,m.MW)(),{setIsLoading:p}=(0,i.useContext)(S.Y);(0,i.useEffect)((()=>{const e=async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;try{var a;p(!0);const i=await(0,Me.kp)({companyId:null!==(a=null===s||void 0===s?void 0:s.companyId)&&void 0!==a?a:c.a,page:t});n((e=>[...e,...i.data])),i.nextPageURL?e(t+1):p(!1)}catch(i){(0,j.l)(r,i),p(!1)}};e()}),[null===s||void 0===s?void 0:s.companyId,p,r]);const h=_t.Ik().shape({[Ot]:_t.gl().oneOf(Object.values(b.tL)),[Dt]:_t.ai().min(Number.parseInt(fa,10)).required(),[Ut]:_t.YO().of(_t.Ik().shape({[Ht]:_t.ai().min(Number.parseInt("1",10)).required(),[Ft]:_t.Yj().required(),[Bt]:_t.ai().positive().required(),[Kt]:_t.Yj().required(),[Wt]:_t.lc().required(),[Vt]:_t.gl().oneOf(Object.values(St)),[zt]:_t.YO().of(_t.Ik().shape({[Xt]:_t.ai().positive().nullable().transform((e=>(0,l.isNaN)(e)?null:e)),[Jt]:_t.ai().positive().nullable().transform((e=>(0,l.isNaN)(e)?null:e)),[Zt]:_t.ai().positive().nullable().transform((e=>(0,l.isNaN)(e)?null:e)),[ea]:_t.gl().nullable().oneOf(Object.values(Pt)),[qt]:_t.gl().oneOf([...Object.values(Lt),...Object.values(da)]),[Qt]:_t.YO().of(_t.Ik().nullable().shape({[ta]:_t.lc(),[aa]:_t.Yj(),[ia]:_t.Yj()})),[Yt]:_t.Yj(),[Gt]:_t.gl().oneOf(Object.values(ft))}))})),[Rt]:_t.Yj().required()}),{control:g,register:_,handleSubmit:x,watch:y,setValue:A,getValues:f,setError:C,setFocus:E,formState:{errors:N,isSubmitted:w}}=(0,gt.mN)({defaultValues:ja(d,t),resolver:(0,ht.t)(h)});(0,u.A)({focus:()=>E(Rt)});const{append:P,remove:T}=(0,gt.jz)({control:g,name:Ut}),$=y(Ut),L=y(Dt),M=(0,l.range)(L+1).map((e=>f(`${Ut}.${e}.${Ht}`))).map((e=>null===e||void 0===e?void 0:e.toString())),R=Et(M);(0,i.useEffect)((()=>{const e=$.map(((e,t)=>{return e[Vt]===St.NEW_STRING&&1===e[Ht]||e[Vt]===St.CONDEC_CONTINUOUS_STRING&&3===e[Ht]?e:e[Ht]>R[t]?{...e,[Ht]:e[zt].length+1,[zt]:[...e[zt],...sa(!0)[zt]]}:e[Ht]<R[t]?{...e,[Ht]:(null===(a=e[zt])||void 0===a?void 0:a.length)-1,[zt]:[...null===(i=e[zt])||void 0===i?void 0:i.filter(((t,a)=>a!==e[Ht]-1))]}:e;var a,i}));A(Ut,e)}),[R]);const U=(0,l.range)(L+1).map((e=>f(`${Ut}.${e}.${Vt}`))),F=Et(U);(0,i.useEffect)((()=>{const e=$.map(((e,t)=>{if(((0,l.isNil)(e[Vt])?"":e[Vt].toString())!==((0,l.isNil)(F[t])?"":F[t].toString())){var a;const t=null===(a=Ct(e[Vt]))||void 0===a?void 0:a.type,i=t===St.NEW_STRING||(0,l.isNil)(t),s=[...sa(i)[zt].map((e=>{var t;return{...e,...e[Qt]&&{[Qt]:null===(t=e[Qt])||void 0===t?void 0:t.map((e=>({...e,[aa]:d.formatMessage({id:e[aa]})})))}}}))];return{...e,[Ht]:i?1:3,[zt]:s}}return e}));A(Ut,e)}),[F]),(0,i.useEffect)((()=>{L>$.length?P(sa(!0)):L<$.length&&T($.length-1)}),[L,A,P,T]);const W=(e,t)=>{const a=$.map(((a,i)=>i!==e?a:{...a,[Wt]:t}));A(Ut,a)},K=(e,t,a)=>{const i=$.map(((i,s)=>{if(s!==e)return i;const o=i[zt].map(((e,i)=>{var s;return i!==t?e:{...e,[Qt]:null===e||void 0===e||null===(s=e[Qt])||void 0===s?void 0:s.map(((e,t)=>t!==a?e:{...e,[ia]:e[ta]?e[ia]:"",[ta]:!e[ta]}))}}));return{...i,[zt]:o}}));A(Ut,i)},B=(e,t,a)=>{const i=$.map(((i,s)=>{if(s!==e)return i;const o=i[zt].map(((e,i)=>{var s,o;if(i!==t)return e;const n=null!==(s=null===e||void 0===e||null===(o=e[Qt])||void 0===o?void 0:o.filter(((e,t)=>t!==a)))&&void 0!==s?s:[];return{...e,[Qt]:n}}));return{...i,[zt]:o}}));A(Ut,i)},V=(e,t)=>{const a=$.map(((a,i)=>{if(i!==e)return a;const s=a[zt].map(((e,a)=>{var i;return a!==t?e:{...e,[Qt]:[...null!==(i=null===e||void 0===e?void 0:e[Qt])&&void 0!==i?i:[],{[ia]:"",[aa]:"",[ta]:!1}]}}));return{...a,[zt]:s}}));A(Ut,a)};return(0,O.jsxs)("form",{className:"axle-popup__container",onSubmit:x((async e=>{if(!s)return;const t=e=>{var t,a;return e[Gt]!==ft.SET?{}:null!==(t=null===(a=e[Qt])||void 0===a?void 0:a.map((e=>({[e[ia]]:e[aa]}))).reduce(((e,t)=>({...e,...t})),{}))&&void 0!==t?t:{}},i=e=>{var t,a;return e[Gt]!==ft.SET?[]:null!==(t=null===(a=e[Qt])||void 0===a?void 0:a.map((e=>e[ia])))&&void 0!==t?t:[]},n=e=>e[zt].map((e=>{var a,s,o,n,l;return{type:e[Gt],representation_mapping:t(e),strings:i(e),...{[ft.STRING]:{string:null!==(a=e[Yt])&&void 0!==a?a:""},[ft.SET]:{represents:e[qt]},[ft.FIXED_NUMBER]:{represents:e[qt],length:null!==(s=e[Xt])&&void 0!==s?s:-1,padding:null!==(o=e[ea])&&void 0!==o?o:Tt},[ft.VARIABLE_NUMBER]:{represents:e[qt],min_length:null!==(n=e[Zt])&&void 0!==n?n:-1,max_length:null!==(l=e[Jt])&&void 0!==l?l:-1}}[e[Gt]]}}));try{var c,u;p(!0);const t=await(async(e,t)=>{const a={data:t},{data:i}=await xt.FH.post(`${bt}/${e}/axle-specs`,a);if(i.success)return(0,At.x)(i.data);throw yt.Ay.newInstance(i.error)})(s.companyId,{name:e[Rt],ports:e[Ut].map((e=>{var t,a,i;return{name:e[Ft],ssid:e[Wt]?null!==(t=null===(a=o.find((t=>t.name===e[Kt])))||void 0===a?void 0:a.ssid)&&void 0!==t?t:"":e[Kt],numSections:e[Ht],port:null!==(i=e[Bt])&&void 0!==i?i:-1,sections:n(e)}})),default_weight_units:null===(c=(0,b.uz)(e[Ot]))||void 0===c?void 0:c.type}),{scale:i,companyId:m}=s;if((0,l.isNil)(i))return void a();await(0,Me.q3)(m,i.id,{axle_spec_id:t.id}),null===(u=s.onScaleModified)||void 0===u||u.call(s,{...i,axleSpec:t,axleSpecId:t.id});const v=d.formatMessage({id:"dashboard.axle.popup.you_have_successfully_added_a_new_axle_spec"});r.success(v),a()}catch(m){(0,D.U6)(m,C,r)}finally{p(!1)}})),children:[(0,O.jsx)(k.A,{titleId:"dashboard.scales.what_is_an_axle_spec"}),(0,O.jsx)("div",{className:"axle-popup__row",children:(0,O.jsx)(Nt.A,{isSubmitted:w,isValid:void 0===N[Rt],labelId:"dashboard.axle.popup.name_of_spec",name:Rt,placeHolderId:"dashboard.axle.popup.spec_name",register:_})}),(0,O.jsxs)("div",{className:"axle-popup__row",children:[(0,O.jsx)(Nt.A,{disabled:!0,onlyPositivesWithoutZero:!0,isSubmitted:w,isValid:void 0===N[Dt],labelId:"dashboard.axle.popup.number_of_ports",name:Dt,placeHolder:fa,register:_,type:"number",value:L}),(0,O.jsx)(wt.A,{isSubmitted:w,isValid:void 0===N[Ot],labelId:"dashboard.axle.popup.default_weight_unit",name:Ot,options:b.Wu.map((e=>({id:e.id.toString(),value:e.id.toString(),labelId:e.stringId}))),register:_})]}),$.map(((e,t)=>{var a;const i=null===(a=Ct(e[Vt]))||void 0===a?void 0:a.type,s=i===St.NEW_STRING||(0,l.isNil)(i);return(0,O.jsx)(ba,{errors:N,isNewString:s,isSubmitted:w,port:e,portIndex:t,portSSIDCheck:e[Wt],register:_,scales:o,sections:e[zt],onAddOption:V,onDeleteOption:B,onPortSSIDChange:W,onSwapCheck:K})})),(0,O.jsx)("div",{className:"axle-popup__button",children:(0,O.jsx)(I.A,{isBold:!0,isSubmit:!0,titleId:"dashboard.axle.popup.save"})})]})};Ia.displayName="CreateAxleSpecPopUp";const Sa=Ia;var ka=a(74337);const Ca=e=>{let{closePopUp:t,data:a}=e;const s=(0,i.useRef)(null);return(0,u.A)({focus:()=>{var e;return null===(e=s.current)||void 0===e?void 0:e.focus()}}),(0,O.jsxs)("div",{className:"payment-method__ask-container",children:[(0,O.jsx)("div",{className:"payment-method__message",children:(0,O.jsx)(h.A,{id:"dashboard.kiosks.popup.if_you_want_to_add_a_payable_scale_please_add_a_receivable_account"})}),(0,O.jsxs)("div",{className:"payment-method__ask-button-container",children:[(0,O.jsx)(I.A,{ref:s,titleId:"yes",onClick:()=>{var e;return null===a||void 0===a||null===(e=a.onHasPayableScale)||void 0===e?void 0:e.call(a,!0)}}),(0,O.jsx)(I.A,{isPrimaryColor:!1,ref:s,titleId:"no",onClick:()=>{var e;return null===a||void 0===a||null===(e=a.onHasPayableScale)||void 0===e?void 0:e.call(a,!1)}})]})]})};Ca.displayName="AskForReceivablePopUp";const Ea=Ca;var Na=a(93038),wa=a(72595);a(59498);const Pa=(0,L.Ay)(E.Ay)(M.Ay);var Ta;!function(e){e[e.UNLINK_SCALES=0]="UNLINK_SCALES",e[e.LINK_SCALES=1]="LINK_SCALES"}(Ta||(Ta={}));const $a=e=>{let{closePopUp:t,data:a}=e;(0,v.A)();const s=(0,m.MW)(),{setIsLoading:o}=(0,i.useContext)(S.Y),n=(0,W.N)((e=>e.selectedCompany.data)),[l,d]=(0,i.useState)({}),[r,c]=(0,i.useState)({currentPage:1,count:-1,pages:{}}),u=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r.currentPage;if(!r.pages[e])try{o(!0);const t=await(0,Me.kp)({companyId:n.id,page:e});c((a=>({...a,currentPage:e,count:t.total,pages:{...a.pages,[e]:t.data}})))}catch(t){(0,j.l)(s,t)}finally{o(!1)}};(0,i.useEffect)((()=>{(async()=>{try{var e;o(!0),null!==a&&void 0!==a&&a.companyId&&null!==a&&void 0!==a&&null!==(e=a.scale)&&void 0!==e&&e.id&&await(0,Me.FU)(a.companyId,a.scale.id).then((e=>{const t={};e.data.forEach((e=>{t[e.id.toString()]=!0})),d({...l,...t})}))}catch(t){(0,j.l)(s,t)}finally{o(!1)}})(),u()}),[]);const p=e=>async t=>{t.target.checked?(async e=>{var t;const i=(null===e||void 0===e?void 0:e.id)||0;if((null===e||void 0===e?void 0:e.currentDivision)===(null===a||void 0===a||null===(t=a.scale)||void 0===t?void 0:t.currentDivision))try{var n;o(!0),null!==a&&void 0!==a&&a.companyId&&null!==a&&void 0!==a&&null!==(n=a.scale)&&void 0!==n&&n.id&&(await(0,Me.Dy)(a.companyId,a.scale.id,{relatedScaleIDs:[i],createRelations:!1}
1),s.success("Linked scales"),d({...l,[i]:!0}))}catch(r){(0,j.l)(s,r)}finally{o(!1)}else s.info("The scale that you want to relate to this one has a different scale division and therefore, net weighments might not be consistent. Please adjust one of the scales' divisions to make them the same.")})(e):async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;try{var t;o(!0),null!==a&&void 0!==a&&a.companyId&&null!==a&&void 0!==a&&null!==(t=a.scale)&&void 0!==t&&t.id&&(await(0,Me.m3)(a.companyId,a.scale.id,{scaleIDs:[e]}),s.success("Unlinked scales"),d({...l,[e]:!1}))}catch(i){(0,j.l)(s,i)}finally{o(!1)}}(e.id)};(0,i.useEffect)((()=>{u(r.currentPage)}),[r.currentPage]);const g=r.pages[r.currentPage];return(0,O.jsxs)("form",{className:"scale-popup__container",onSubmit:async e=>{e.preventDefault(),t()},children:[(0,O.jsx)(k.A,{titleId:"dashboard.scales.what_is_a_linked_scale"}),(0,O.jsx)(Pa,{container:!0,spacing:0,children:(0,O.jsx)(Pa,{item:!0,xs:12,children:(0,O.jsx)(Y.A,{children:(0,O.jsxs)(X.A,{children:[(0,O.jsx)(ae.A,{children:void 0===g?(0,O.jsx)(Pa,{container:!0,spacing:5,alignItems:"center",justifyContent:"center",children:(0,O.jsx)(Pa,{item:!0,children:(0,O.jsx)(Ie.P,{})})}):(0,O.jsxs)(O.Fragment,{children:[0===g.length&&(0,O.jsx)("span",{className:"scales-results__no-results",children:(0,O.jsx)(h.A,{id:"dashboard.scales.you_do_not_have_any_scales"})}),g.length>0&&(0,O.jsx)(O.Fragment,{children:g.filter((e=>{var t;return e.id!==(null===a||void 0===a||null===(t=a.scale)||void 0===t?void 0:t.id)})).map((e=>(0,O.jsxs)(J.A,{children:[(0,O.jsx)(Q.A,{padding:"checkbox",children:(0,O.jsx)(Na.A,{checked:l[e.id]||!1,onChange:p(e)})}),(0,O.jsx)(Q.A,{children:(0,O.jsx)(q.A,{children:e.name})})]},e.id)))})]})}),(0,O.jsx)(wa.A,{children:(0,O.jsx)(J.A,{children:(0,O.jsx)(se.A,{component:"td",colSpan:2,rowsPerPage:20,rowsPerPageOptions:[20],count:r.count,onPageChange:(e,t)=>
1c((e=>({...e,currentPage:t+1}))),page:r.currentPage-1})})})]})})})}),(0,O.jsxs)(Pa,{container:!0,spacing:3,pt:3,children:[(0,O.jsx)(Pa,{item:!0,xs:12,md:6,children:(0,O.jsx)($.A,{variant:"outlined",color:"error",style:{borderColor:"#FF6600",color:"#FF6600"},fullWidth:!0,type:"button",onClick:async()=>{const e=[];Object.keys(l).forEach((t=>{l[t]&&e.push(Number(t))}));try{var t;o(!0),null!==a&&void 0!==a&&a.companyId&&null!==a&&void 0!==a&&null!==(t=a.scale)&&void 0!==t&&t.id&&(await(0,Me.Dy)(a.companyId,a.scale.id,{relatedScaleIDs:e,createRelations:!0}),s.success("Linked all scales to each other"))}catch(i){(0,j.l)(s,i)}finally{o(!1)}},children:"Relate All Selected Scales"})}),(0,O.jsx)(Pa,{item:!0,xs:12,md:6,children:(0,O.jsx)($.A,{variant:"contained",color:"error",style:{backgroundColor:"#FF6600"},fullWidth:!0,type:"submit",children:"Close"})})]})]})};$a.displayName="UpdateScaleRelations";const La=$a,Ma=e=>{var t;let{closePopUp:a,data:i}=e;return i?{[C.MODIFY_SCALE]:(0,O.jsx)(vt.A,{closePopUp:a,data:{...i,popUpType:ka.T.ADD_OR_MODIFY_SCALE}}),[C.CREATE_KIOSK]:(0,O.jsx)(pt.A,{closePopUp:a,data:{...i,popUpType:mt.g.CREATE_KIOSK}}),[C.DELETE_KIOSK]:(0,O.jsx)(pt.A,{closePopUp:a,data:{...i,popUpType:mt.g.DELETE_KIOSK}}),[C.DUPLICATE_SCALE]:(0,O.jsx)(ut.A,{closePopUp:a,onDuplicateItem:null!==(t=i.onScaleDuplicated)&&void 0!==t?t:l.noop}),[C.CREATE_AXLE_SPEC]:(0,O.jsx)(Sa,{closePopUp:a,data:{...i,popUpType:null}}),[C.MODIFY_AXLE_SPEC]:(0,O.jsx)(Sa,{axleSpec:i.axleSpec,closePopUp:a,data:{...i,popUpType:null}}),[C.ASK_FOR_RECEIVABLE]:(0,O.jsx)(Ea,{closePopUp:a,data:{...i}}),[C.UPDATE_SCALE_RELATIONS]:(0,O.jsx)(La,{closePopUp:a,data:{...i}})}[i.popUpType]:null};Ma.displayName="ScaleInfoPopUp";const Ra=Ma,Da=()=>{const[e,t]=(0,i.useState)(),a=(0,s.wA)(),l=(0,W.N)((e=>e.selectedCompany.data));return(0,O.jsx)(n.A,{main:{MainContent:ct,data:{onScaleModified:async e=>{try{const t=await(0,Me.X_)(l.id,e.id);a((0,o.bN)(t))}catch(t){console.log("onScaleModified error",t)}}}},popUp:{PopUpContent:Ra,data:e,setData:t}})};Da.displayName="ScaleInfoScreen";const Oa=Da},74337:(e,t,a)=>{let i;a.d(t,{T:()=>i}),function(e){e[e.ADD_OR_MODIFY_SCALE=0]="ADD_OR_MODIFY_SCALE",e[e.DELETE_SCALE=1]="DELETE_SCALE"}(i||(i={}))},76281:(e,t,a)=>{a.d(t,{A:()=>o});var i=a(65471),s=a(44414);const o=(0,i.A)((0,s.jsx)("path",{d:"M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"}),"MoreVert")},77991:(e,t,a)=>{a.d(t,{c:()=>i});const i=(e,t)=>({total:e.total,numberOfPages:e.last_page,currentPage:e.current_page,nextPageURL:e.next_page_url,data:e.data.map((e=>t(e)))})},79326:(e,t,a)=>{a.d(t,{A:()=>o});var i=a(65471),s=a(44414);const o=(0,i.A)((0,s.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")},85421:(e,t,a)=>{a.d(t,{A:()=>d});a(9950);var i=a(45180),s=a(82053),o=a(13569),n=a(6349),l=a(44414);const d=e=>{let{headerOptions:t,mediaLink:a,children:d,...r}=e;return(0,l.jsxs)(n.Zp,{...r,children:[!!t&&(0,l.jsx)(i.A,{title:(0,l.jsxs)(l.Fragment,{children:[!(null===t||void 0===t||!t.supertext)&&(0,l.jsx)(s.A,{variant:"subtitle1",color:"GrayText",children:t.supertext}),(0,l.jsx)(s.A,{variant:"h6",fontWeight:"bold",children:t.title})]}),subheader:!(null===t||void 0===t||!t.subtext)&&(0,l.jsx)(s.A,{variant:"subtitle2",children:t.subtext}),action:t.action}),!!a&&(0,l.jsx)(o.A,{component:"img",height:"250",image:a,alt:"Click to view image",style:{objectFit:"contain"},onClick:()=>window.open(a,"_blank")}),d]})}},86318:(e,t,a)=>{a.d(t,{A:()=>I,Q:()=>j});var i=a(9950),s=a(2235),o=a(60899),n=a(74745),l=a(16491),d=a(29120),r=a(82053),c=a(25333),u=a(86835),p=a(67079),m=a(47937),v=a(6349),h=a(85162),g=a(75654),_=a(44414);const x=(0,p.Ay)(s.A)(m.Ay),y=(0,p.Ay)(o.Ay)(m.Ay),A=(0,p.Ay)(n.A)(m.Ay),b=(0,p.Ay)(l.A)(m.Ay),f=p.Ay.div` 2 position: absolute; 3 top: 0; 4 left: 0; 5 right: 0; 6 bottom: 0; 7 background-color: rgba(255, 255, 255, 0.8); 8 display: flex; 9 justify-content: center; 10 align-items: center; 11 z-index: 10; 12 /* Prevent click events from reaching elements behind the overlay */ 13 pointer-events: all; 14`,j={MEDIUM:{sm:12,md:8,lg:7},LARGE:{sm:12,md:9,lg:9}};function I(e){var t,a;let{open:s=!0,children:o,xs:n=12,sm:l=9,md:p=7,lg:m=5,setModalOpen:j,closeModal:I,headerOptions:S={headerText:""},isLoading:k=!1,bodyOptions:C={padding:2},confirmBeforeClose:E=!1,zIndex:N,...w}=e;const P="TPModal-Grid-Container",T=(0,i.useRef)(),[$,L]=(0,i.useState)(!1),M=()=>{null===j||void 0===j||j(!1),null===I||void 0===I||I()},R=()=>{E?L(!0):M()};return(0,_.jsx)(d.A,{open:s,style:{overflowY:"scroll",...null!=N?{zIndex:N}:{}},children:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(y,{container:!0,spacing:5,direction:"row",alignItems:"center",justifyContent:"center",mt:3,pt:3,id:P,onMouseDown:e=>{T.current=e.target},onMouseUp:e=>{var t,a;null===(t=e.stopPropagation)||void 0===t||t.call(e),T.current&&T.current.id===P&&(null===(a=e.target)||void 0===a?void 0:a.id)===P&&R()},children:(0,_.jsx)(y,{item:!0,xs:n,sm:l,md:p,lg:m,children:(0,_.jsxs)(x,{my:6,style:{position:"relative"},children:[!(null===S||void 0===S||!S.headerText)&&(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)(y,{container:!0,alignItems:"center",p:2,children:[(0,_.jsxs)(y,{item:!0,xs:!0,children:[(0,_.jsx)(r.A,{variant:"h5",style:{fontWeight:"bold"},gutterBottom:!1,children:S.headerText}),!!S.subheaderText&&(0,_.jsx)(r.A,{color:"GrayText",variant:"h6",style:{fontWeight:"bold"},children:S.subheaderText}),null===(t=S.subheaderTexts)||void 0===t?void 0:t.map((e=>{var t;return(0,_.jsx)(r.A,{color:"GrayText",variant:((null===(t=S.subheaderTexts)||void 0===t?void 0:t.length)||0)>
142?"subtitle1":"h6",style:{fontWeight:"bold"},children:e},e)}))]}),!!S.headerActions&&(0,_.jsx)(y,{item:!0,children:S.headerActions}),(0,_.jsx)(y,{item:!0,children:(0,_.jsx)(c.A,{onClick:()=>R(),"aria-label":"Close popup",children:(0,_.jsx)(u.A,{})})})]}),(0,_.jsx)(A,{})]}),C.banner&&C.banner,(0,_.jsxs)(b,{p:null!==(a=C.padding)&&void 0!==a?a:2,style:{position:"relative"},children:[(0,_.jsx)("div",{"aria-hidden":k,style:{pointerEvents:k?"none":"auto",opacity:k?.6:1,transition:"opacity 0.2s"},children:o}),k&&(0,_.jsx)(f,{role:"status","aria-label":"Loading",children:(0,_.jsx)(v.P,{my:0})})]})]})})}),(0,_.jsx)(h.A,{}),(0,_.jsx)(g.A,{open:$,title:"Leave Site Management",message:"Are you sure you want to leave? All data will be lost.",onConfirm:()=>M(),onCancel:()=>{L(!1)}})]})})}},86835:(e,t,a)=>{a.d(t,{A:()=>o});var i=a(65471),s=a(44414);const o=(0,i.A)((0,s.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")},88005:(e,t,a)=>{a.d(t,{A:()=>c});var i=a(9950),s=a(22634),o=a(33304),n=a(32139),l=a(73729),d=a(44414);const r=e=>{let{closePopUp:t,onDuplicateItem:a}=e;const r=(0,i.useRef)(null),c=(0,s.MW)();return(0,o.A)({focus:()=>{var e;return null===(e=r.current)||void 0===e?void 0:e.focus()}}),(0,d.jsxs)("div",{className:"duplicate-popup__container",children:[(0,d.jsx)(l.A,{isBold:!0,isPrimaryColor:!1,titleId:"dashboard.popup.cancel",onClick:t}),(0,d.jsx)(l.A,{isBold:!0,ref:r,titleId:"dashboard.popup.confirm",onClick:async()=>{try{await(null===a||void 0===a?void 0:a()),t()}catch(e){(0,n.l)(c,e)}}})]})};r.displayName="DuplicatePopUp";const c=r},92176:(e,t,a)=>{a.d(t,{p:()=>l});var i=a(48851),s=a(61112),o=a(55998),n=a(75049);const l=(0,i.zD)(`${o.J.countries}/getAllProvincesStatus`,(async(e,t)=>{let{dispatch:a}=t;const i=await(0,s.v)();a((0,n.p)({provinces:i}))}))},92745:(e,t,a)=>{a.d(t,{A:()=>o});var i=a(65471),s=a(44414);const o=(0,i.A)((0,s.jsx)("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"}),"DeleteForever")},93092:()=>{}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.