PageSourceSearch

https://www.exploremaricopacountyparks.org/_next/static/chunks/pag…/point-of-sale/readers-5f3c69ac986b2111.js

js exploremaricopacountyparks.org collected 2026-10-10 01:00:51 UTC 14,748 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1184,9310],{24861:(e,l,a)=>{"use strict";a.d(l,{Q:()=>m});var r=a(78488),t=a(48339);a(81204);var n=a(33237),o=a(60766),i=a(72788),s=a(63378),d=a(68513),c=a(3935),u=a(75884);let m=e=>{let{open:l,locations:a,preselectedLocation:m,onClose:p,refetchReaders:f}=e,x=(0,s.xN)(),h=(0,s.qN)(),b=(0,o.d4)(d.Cf),v=(0,n.mN)({resolver:(0,c.uG)(u.E),defaultValues:{label:"",registration_code:"",location:m}}),[j,{loading:g}]=(0,i.X$S)({fetchPolicy:"network-only"}),S=e=>{var l,a;let r=null!=(l=e.registration_code)?l:"";j({variables:{input_object:{organization_id:b,action:i.iFm.CreateReader,data:{label:null!=(a=null==e?void 0:e.label)?a:r,registration_code:r,location_id:e.location}}}}).then(e=>{var l,a,r,t,n,o;if(!(null==(a=e.data)||null==(l=a.manageStripeLocationReader)?void 0:l.ok)&&(null==(t=e.data)||null==(r=t.manageStripeLocationReader)?void 0:r.error))return void h(null==(o=e.data)||null==(n=o.manageStripeLocationReader)?void 0:n.error);x("Reader registered successfully"),null==f||f(),p()})};return(0,r.jsx)(n.Op,{...v,children:(0,r.jsx)("form",{onSubmit:v.handleSubmit(S),children:(0,r.jsx)(t.lG,{open:l,headerProps:{title:"Register reader",onClose:p},contentProps:{content:(0,r.jsx)(u.s,{locations:a})},footerProps:{onCancel:p,onConfirm:v.handleSubmit(S),loading:g,confirmButtonText:"Create",cancelButtonText:"Cancel"}})})})}},39419:(e,l,a)=>{"use strict";a.d(l,{P:()=>t});var r=a(49191);function t(){let{loadingOrganization:e,settings:l}=(0,r.Z5)();return{cannotDetermineIfStripeExpressEnabled:!e&&!l,maybeStripeExpressEnabled:!!(!l||l.stripeExpressAccountEnabled),isStripeExpressEnabled:!!(null==l?void 0:l.stripeExpressAccountEnabled),loading:e}}},40121:(e,l,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/[org]/manager/point-of-sale/readers",function(){return a(80805)}])},62316:(e,l,a)=>{"use strict";a.d(l,{O:()=>F});var r=a(78488),t=a(97912),n=a(35075),o=a(81881),i=a(64314),s=a(81204),d=a(60766),c=a(72788),u=a(65382),m=a(63378),p=a(39419),f=a(68513),x=a(24846),h=a(30066),b=a(39310),v=a(67214),j=a(42756),g=a(59174),S=a(85585),y=a(21845),C=a(33237),_=a(3935),R=a(45439),N=a(75884);let E=e=>{var l,a,t;let{open:n,locations:i,reader:s,onClose:u,refetchReaders:p}=e,x=(0,m.xN)(),h=(0,m.qN)(),E=(0,d.d4)(f.Cf),A=(0,C.mN)({resolver:(0,_.uG)(N.E),defaultValues:{label:null!=(a=null==s?void 0:s.label)?a:"",location:null!=(t=null==s||null==(l=s.location)?void 0:l.id)?t:""}}),[k,{loading:P}]=(0,c.X$S)({fetchPolicy:"network-only"}),B=e=>{var l,a;k({variables:{input_object:{organization_id:E,reader_id:null!=(l=null==s?void 0:s.id)?l:"",action:c.iFm.UpdateReader,data:{label:null!=(a=null==e?void 0:e.label)?a:""}}}}).then(e=>{var l,a,r,t,n,o;if(!(null==(a=e.data)||null==(l=a.manageStripeLocationReader)?void 0:l.ok)&&(null==(t=e.data)||null==(r=t.manageStripeLocationReader)?void 0:r.error))return void h(null==(o=e.data)||null==(n=o.manageStripeLocationReader)?void 0:n.error);x("Reader updated successfully"),null==p||p(),u()})},w=()=>u();return(0,r.jsxs)(v.A,{open:n,onClose:w,maxWidth:"sm",scroll:"paper",children:[(0,r.jsxs)(j.A,{className:"flex items-center justify-between",children:[(0,r.jsx)(g.A,{variant:"h3",className:"text-22 font-semibold",children:"Edit registered reader"}),(0,r.jsx)("div",{role:"button",onClick:w,children:(0,r.jsx)(b.A,{className:"text-[#5A5555]"})})]}),(0,r.jsx)(S.A,{dividers:!0,className:"space-y-4 p-8",children:(0,r.jsx)(C.Op,{...A,children:(0,r.jsx)("form",{onSubmit:A.handleSubmit(B),className:"space-y-4 p-8",children:(0,r.jsx)(N.s,{locations:i,editMode:!0})})})}),(0,r.jsxs)(y.A,{className:"flex justify-between border-t-[1px] border-solid px-8 py-4",children:[(0,r.jsx)(o.A,{variant:"text",color:"primary",type:"button",size:"large",className:"h-[56px] px-5 text-14",onClick:w,children:"Cancel"}),(0,r.jsx)(R.Jh,{loading:P,onClick:A.handleSubmit(B),children:"Update"})]})]})};var A=a(48339),k=a(65754),P=a(86501),B=a(1599),w=a(15410),L=a(74961),T=a(96305);let Y=k.Ik({label:T.Gx});function q(e){let{open:l,onClose:a,reader:t}=e,n=(0,m.qN)(),o=(0,m.xN)(),i=(0,d.d4)(f.Cf),p=(0,C.mN)({resolver:(0,_.uG)(Y),defaultValues:{label:t.label}}),{reset:h}=p;(0,P.h)({open:l,memoizedResetState:(0,s.useCallback)(()=>{h({label:t.label})},[h,t.label])});let[b,{loading:v}]=(0,c.X$S)({...B.D,refetchQueries:[c.$c9],awaitRefetchQueries:!0,onError:(0,w._r)(e=>{let{error:l}=e;x.A.error(l),n(u.h1)}),onCompleted:e=>{var l,r;if(null==e||null==(l=e.manageStripeLocationReader)?void 0:l.ok)o("Reader updated"),a();else{let l=null==e||null==(r=e.manageStripeLocationReader)?void 0:r.error;x.A.error(null!=l?l:"Failed to update reader ".concat(t.id)),n(u.h1);return}}}),j=e=>{b({variables:{input_object:{organization_id:i,reader_id:t.id,action:c.iFm.
1UpdateReader,data:{label:e.label}}}})};return(0,r.jsx)(A.lG,{open:l,headerProps:{title:"Edit reader",onClose:a},contentProps:{content:(0,r.jsx)(C.Op,{...p,children:(0,r.jsx)("form",{onSubmit:p.handleSubmit(j),children:(0,r.jsx)(L.mB,{name:"label",label:"Reader name",required:!0,placeholder:"Front desk 1"})})})},footerProps:{onCancel:a,onConfirm:p.handleSubmit(j),loading:v,confirmButtonText:"Save",cancelButtonText:"Cancel"}})}let F=e=>{let{reader:l,locations:a,refetchReaders:b}=e,[v,j]=s.useState(!1),[g,S]=s.useState(!1),[y,C]=s.useState(null),_=!!y,R=(0,m.xN)(),N=(0,m.qN)(),A=(0,d.d4)(f.Cf),{isStripeExpressEnabled:k,cannotDetermineIfStripeExpressEnabled:P,loading:B}=(0,p.P)(),[w]=(0,c.X$S)({fetchPolicy:"network-only"}),L=()=>{C(null)},T=e=>{w({variables:{input_object:{organization_id:A,reader_id:e,action:c.iFm.DeleteReader}}}).then(e=>{var l,a,r,t,n,o;if(!(null==(a=e.data)||null==(l=a.manageStripeLocationReader)?void 0:l.ok)&&(null==(t=e.data)||null==(r=t.manageStripeLocationReader)?void 0:r.error))return void N(null==(o=e.data)||null==(n=o.manageStripeLocationReader)?void 0:n.error);R("Reader deleted successfully"),null==b||b()})};return(0,r.jsxs)("div",{onClick:e=>e.stopPropagation(),children:[(0,r.jsx)(o.A,{id:"actions-button","aria-controls":_?"actions-menu":void 0,"aria-haspopup":"true","aria-expanded":_?"true":void 0,className:"min-w-0 rounded-full text-secondary",onClick:e=>{e.stopPropagation(),C(e.currentTarget)},children:(0,r.jsx)(t.A,{})}),(0,r.jsxs)(i.A,{id:"actions-menu",anchorEl:y,open:_,onClose:L,onClick:L,MenuListProps:{"aria-labelledby":"actions-button"},children:[(0,r.jsx)(n.A,{disabled:B,onClick:()=>{P?(x.A.error("Could not determine if Stripe Express is enabled for org",{level:"fatal",organization_id:A}),N(u.h1)):S(!0)},children:"Edit reader"}),(0,r.jsx)(n.A,{onClick:()=>j(!0),children:"Delete reader"})]}),(0,r.jsx)(h.A,{open:v,title:"Confirm location delete",header:'Are you sure you want to delete the "'.concat(l.label,'" reader?'),subHeader:"This cannot be undone.",loading:!1,onClose:()=>j(!1),onConfirm:()=>{j(!1),null==T||T(l.id)},confirmButtonIntent:"danger"}),k?(0,r.jsx)(q,{open:g,reader:l,onClose:()=>{S(!1)}}):(0,r.jsx)(E,{open:g,locations:a,refetchReaders:b,reader:l,onClose:()=>{S(!1)}})]})}},75884:(e,l,a)=>{"use strict";a.d(l,{E:()=>o,s:()=>i});var r=a(78488);a(81204);var t=a(65754),n=a(45439);let o=t.Ik({label:t.Yj().min(3,{message:"Must contain at least 3 characters"}).nullish(),registration_code:t.Yj().nullish(),location:t.Yj().nullish()}),i=e=>{let{locations:l,editMode:a=!1}=e,t=(null!=l?l:[]).map(e=>({label:e.display_name,value:e.id}));return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.mB,{label:"Reader name",name:"label",placeholder:"Front-desk 1"}),(0,r.jsx)(n.mB,{label:"Registration code",name:"registration_code",placeholder:"apple-grape-orange",required:!0,disabled:a}),(0,r.jsx)(n.$L,{label:"Assign to location",name:"location",options:t,disabled:a})]})}},80805:(e,l,a)=>{"use strict";a.r(l),a.d(l,{default:()=>C});var r=a(78488),t=a(81204),n=a(58723),o=a(98194),i=a(48339),s=a(60461),d=a(60766),c=a(72788),u=a(65382),m=a(63378),p=a(39419),f=a(68513),x=a(24846),h=a(24861),b=a(96305),v=a(46498),j=a(62316);let g=e=>{let{readers:l,isLoading:a,locations:t,refetchReaders:n}=e,{maybeStripeExpressEnabled:o}=(0,p.P)();return(0,r.jsx)(v.Ay,{loading:a,rows:null!=l?l:[],zeroState:{title:"No readers found"},columns:[{title:"Reader name",cellContent:e=>{let{row:l}=e;return(0,r.jsx)(i.EY.BodySmallSemiBold,{children:l.label})}},{title:"Status",cellContent:e=>{let{row:l}=e;return(0,r.jsx)(i.EY.BodySmallSemiBold,{children:l.status})}},{title:"Serial number",cellContent:e=>{let{row:l}=e;return(0,r.jsx)(i.EY.BodySmallSemiBold,{children:l.serial_number})}}
1,...o?[]:[{title:"Location name",cellContent:e=>{var l,a;let{row:t}=e;return(0,r.jsx)(i.EY.BodySmallSemiBold,{children:null!=(a=null==t||null==(l=t.location)?void 0:l.display_name)?a:""})}}],{title:"IP",cellContent:e=>{let{row:l}=e;return(0,r.jsx)(i.EY.BodySmallSemiBold,{children:l.ip_address})}},{title:"Reader type",cellContent:e=>{let{row:l}=e;return(0,r.jsx)(i.EY.BodySmallSemiBold,{children:l.device_type})}},{title:"Actions",cellContent:e=>{let{row:l}=e;return(0,r.jsx)(j.O,{reader:l,locations:t,refetchReaders:n})}}]})},S=()=>{let e=(0,m.qN)(),l=(0,d.d4)(f.Cf),[a,n]=t.useState(!1),{isStripeExpressEnabled:o,cannotDetermineIfStripeExpressEnabled:v,loading:j}=(0,p.P)(),{data:S,loading:y}=(0,c.snh)({variables:{organization_id:l},onError:l=>{x.A.error("Unable to fetch Stripe locations",l),e(l.message)},fetchPolicy:"network-only"}),{data:C,loading:_,refetch:R}=(0,c.lSD)({variables:{organization_id:l},onError:l=>{x.A.error("Unable to fetch Stripe locations",l),e(l.message)},fetchPolicy:"network-only"}),N=t.useMemo(()=>{var e,l;return y?[]:(null!=(l=null==S||null==(e=S.retrieveStripeLocationsForOrganization)?void 0:e.locations)?l:[]).map(e=>{var l,a,r,t,n,o,i,s,d,c;return{id:e.id,display_name:e.display_name,city:null!=(o=null==e||null==(l=e.address)?void 0:l.city)?o:"",state:null!=(i=null==e||null==(a=e.address)?void 0:a.state)?i:"",postal_code:null!=(s=null==e||null==(r=e.address)?void 0:r.postal_code)?s:"",address_line1:null!=(d=null==e||null==(t=e.address)?void 0:t.line1)?d:"",address_line2:null!=(c=null==e||null==(n=e.address)?void 0:n.line2)?c:""}})},[S,y]),E=t.useMemo(()=>{var e,l;return _?[]:(null!=(l=null==C||null==(e=C.retrieveStripeReadersForOrganization)?void 0:e.readers)?l:[]).map(e=>{var l,a,r,t,n,o;let i=N.find(l=>l.id===e.location_id);return{id:e.id,label:e.label,location:{id:null!=(l=null==i?void 0:i.id)?l:"",display_name:null!=(a=null==i?void 0:i.display_name)?a:""},status:null!=(r=null==e?void 0:e.status)?r:"",serial_number:null!=(t=null==e?void 0:e.serial_number)?t:"",ip_address:null!=(n=null==e?void 0:e.ip_address)?n:"",device_type:null!=(o=null==e?void 0:e.device_type)?o:""}})},[C,_,N]);return(0,r.jsxs)("div",{className:"flex flex-col gap-2 p-0",children:[(0,r.jsx)("div",{className:"flex flex-row items-center justify-between pb-4",children:(0,r.jsxs)(i.$n.Primary,{className:"ml-auto",disabled:j,onClick:()=>{v?(x.A.error("Could not determine if Stripe Express is enabled for org",{level:"fatal",organization_id:l}),e(u.h1)):n(!0)},children:[(0,r.jsx)(s.A,{className:"mr-2",fontSize:"small"}),"Register reader"]})}),(0,r.jsx)(g,{readers:E,locations:N,refetchReaders:R,isLoading:_}),o?(0,r.jsx)(b.uC,{open:a,onClose:()=>{n(!1)}}):(0,r.jsx)(h.Q,{open:a,locations:N,refetchReaders:R,onClose:()=>{n(!1)}})]})},y=()=>(0,r.jsx)(o.A,{selectedTab:"Readers",children:(0,r.jsx)(S,{})});y.PageLayout=n.T;let C=y},86501:(e,l,a)=>{"use strict";a.d(l,{h:()=>t});var r=a(81204);function t(e){let{open:l,memoizedResetState:a}=e,[t,n]=(0,r.useState)(!1);(0,r.useEffect)(()=>{l&&!t&&(a(),n(!0))},[l,t,a]),(0,r.useEffect)(()=>{l||n(!1)},[l])}},96305:(e,l,a)=>{"use strict";a.d(l,{Gx:()=>v,uC:()=>g});var r=a(78488),t=a(48339),n=a(33237),o=a(60766),i=a(65754),s=a(72788),d=a(65382),c=a(63378),u=a(86501),m=a(1599),p=a(68513),f=a(15410),x=a(24846),h=a(3935),b=a(74961);let v=i.Yj().min(3,{message:"Reader name must contain at least 3 characters"}),j=i.Ik({label:v,registration_code:i.Yj().nonempty("Registration code is required")});function g(e){let{open:l,onClose:a}=e,i=(0,c.qN)(),v=(0,c.xN)(),g=(0,o.d4)(p.Cf),S=(0,n.mN)({resolver:(0,h.uG)(j),defaultValues:{label:"",registration_code:""}});(0,u.h)({open:l,memoizedResetState:S.reset});let[y,{loading:C}]=(0,s.a2Z)({...m.D,refetchQueries:[s.$c9],awaitRefetchQueries:!0,onError:(0,f._r)(e=>{let{error:l}=e;x.A.error(l),i(d.h1)}),onCompleted:()=>{v("Reader registered"),a()}}),_=e=>{y({variables:{organization_id:g,registration_code:e.registration_code,label:e.label}})};return(0,r.jsx)(t.lG,{open:l,headerProps:{title:"Register reader",onClose:a},contentProps:{content:(0,r.jsx)(n.Op,{...S,children:(0,r.jsx)("form",{onSubmit:S.handleSubmit(_),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(b.mB,{name:"label",label:"Reader name",required:!0,placeholder:"Front desk 1"}),(0,r.jsx)(b.mB,{name:"registration_code",label:"Registration code",required:!0,placeholder:"apple-grape-orange"})]})})})},footerProps:{onCancel:a,onConfirm:S.handleSubmit(_),loading:C,confirmButtonText:"Register",cancelButtonText:"Cancel"}})}},98194:(e,l,a)=>{"use strict";a.d(l,{A:()=>x});var r=a(78488),t=a(45738),n=a(48339);a(81204);var o=a(10427),i=a(15831),s=a(42804),d=a(40367),c=a(66430),u=a(39419),m=a(84975),p=a(80975);function f(e){let{selectedTab:l}=e,a=(0,d.Tp)(t.sKG.posShiftReporting),{maybeStripeExpressEnabled:o}=(0,u.P)(),i=(0,p.J)(t.vcx.PosManage),f=function(){let{createOrgRoute:e}=(0,m.x)();return[{label:"New sale",href:e(s.J9.terminal)},{label:"Store inventory",href:e(s.J9.stores)},{label:"Items",href:e(s.J9.items)},{label:"Locations",href:e(s.J9.locations)},{label:"Readers",href:e(s.J9.reader)},{label:"Shifts",href:e(s.J9.shifts)}]}();return a||(f=f.filter(e=>"Shifts"!==e.label)),i||(f=f.filter(e=>!["Store inventory","Items","Shifts"].includes(e.label))),o&&(f=f.filter(e=>"Locations"!==e.label)),(0,r.jsx)(n.tU,{value:!!f.find(e=>e.label===l)&&l,className:"border-stroke-soft border-b",children:f.map(e=>{let{label:l,href:a}=e;return(0,r.jsx)(c.A,{value:l,label:l,href:a},l)})})}function x(e){let{selectedTab:l,children:a,isLoading:s,storeName:d}=e;return(0,r.jsxs)("div",{className:"flex flex-1 flex-col gap-y-6 overflow-x-auto",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-y-6 p-6 pb-0",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)(i.A,{routes:[{label:"Point of sale",href:t.J9Z.terminal}]}),d&&(0,r.jsx)(n.EY.BodySmallSemiBold,{color:"secondary",children:d})]}),(0,r.jsx)(f,{selectedTab:l})]}),s?(0,r.jsx)(o.A,{}):(0,r.jsx)("div",{className:"flex flex-1 flex-col px-6 pb-8",children:a})]})}}},e=>{e.O(0,[7643,5214,9869,3661,5799,2599,4105,320,3630,2463,4098,6055,6482,6943,9436,789,8668,7763,4543,1724,4488,2224,8385,3862,2242,3804,3310,8723,636,6593,8792],()=>e(e.s=40121)),_N_E=e.O()}]);

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.