PageSourceSearch

https://rsdmrkt.com/assets/AdminStorePage-B0gIZhBn.js

js rsdmrkt.com collected 2026-09-25 04:10:31 UTC 36,494 bytes, 6 lines download raw bytes

1import{r as f,j as e,b as X,e as be}from"./emotion-element-f0de968e.browser.esm-DAcAn3jx.js";import{C as ve}from"./Clear-DwWr0QEX.js";import{C as E,e as Ce}from"./spa-Bes9Hfn3.js";import{E as ae}from"./Edit-DQtX7EYK.js";import{b as le,g as ce,u as de,a as pe,s as ue,d as Se,m as xe,e as we,c as H,B as l,T as a}from"./Box-CdsPgKjk.js";import{u as L,o as N,cr as ke,cs as Be,s as Z,h as ee,ct as Te,aH as Ie,am as O,aG as ze,bo as Pe,cu as $e,cv as De}from"./api-KZNW2Ket.js";import{A as Re}from"./AddressForm-BlRQBxHg.js";import{C as Le,I as We}from"./Favorite-V6xGmSVP.js";import{C as te}from"./Card-QqbP_w_-.js";import{C as Y}from"./CustomerWrapper-DjrlGE5P.js";import{I as W}from"./IconButton-C4bln0zo.js";import{S as _e}from"./Storefront-BvB_OFaK.js";import{B as ne}from"./Badge-YK6_F2uj.js";import{A as G}from"./Avatar-B5Sp_iYB.js";import{P as K}from"./Price-CnfREIyP.js";import{C as Me}from"./CurrencyExchange-Co4gbdCN.js";import{D as J}from"./DefaultButton-EB8kJvev.js";import{D as he,a as me,b as Fe,c as Ae}from"./DialogTitle-BztL3sGR.js";import{T as F}from"./TextField-BKbREhBK.js";import{C as U,B as I,u as oe}from"./Button-KVxmVPcQ.js";import{M as Ee,C as Oe}from"./ItemNotFound-ryDCeKGA.js";import{E as Ne}from"./ExpandLess-ClHjhs_k.js";import{E as Ge}from"./ExpandMore-CdwD6sTR.js";import{P as He}from"./PagingControls-DTElKLL1.js";import{L as Ue}from"./LimitSelect-BqnFz3WB.js";import{D}from"./Divider-DJxQQ4t0.js";import{T as Ve,a as qe,b as Qe,c as ie,d as Ye}from"./TableRow-BP-kuk_B.js";import{T as M}from"./TableCell-CcFNMj2o.js";import{g as Ke,B as Je}from"./ButtonGroup-Cv2iLj9U.js";import{u as re,F as Xe}from"./index-DkVogYJF.js";import{r as Ze,c as fe,i as V}from"./imageUtils-Bv75Hoxq.js";import{R as et}from"./Refresh-CvMXgiuf.js";import{O as tt}from"./OpenInNew-TDNO_guB.js";import{G as ot}from"./GlobalRule-DWzo4if8.js";import{s as rt}from"./appPaths-B9EFiJhW.js";import{L as q}from"./Link-DWmhiRjI.js";import"./preload-helper-ckwbz45p.js";import"./hydrationSignal-CiVg0RVs.js";import"./index-B8xgCRSP.js";import"./CartWrapper-C0ybKg8A.js";import"./Snackbar-BLmOveHA.js";import"./ArrowRight-B4QKvvAX.js";import"./moment-BLMuvzoS.js";import"./Tooltip-BamK8vw1.js";import"./FormControlLabel-gDZUzoP6.js";import"./useId-BOtalUON.js";import"./Skeleton-DSjqnrBB.js";import"./cssUtils-BDukCBHC.js";import"./AnimatedLink-CaZ5Lp4_.js";import"./Drawer-D9kGXRYg.js";import"./HomePage-DtOX3-eA.js";import"./CollectionItems-i54bjIho.js";import"./StorePage-DCZRiikn.js";import"./AtlasSearchProvider-DaJ6clz-.js";import"./FilterDrawer-CGoJp7ei.js";import"./GridView-DBRoP9ri.js";import"./Checkbox-BQKglEA7.js";import"./useThemeProps-DVgs-USV.js";import"./getThemeProps-B4ZF914Q.js";import"./LocationOn-DM2UKiY4.js";import"./Message-Cfmnl7mY.js";import"./seo-N-rINtPA.js";import"./index.esm-CUxG0IsZ.js";import"./FindStorePage-CrM7PmLt.js";import"./SearchPage-BOimhKeM.js";import"./CustomSearchBox-CX5K0f_t.js";import"./StateSelect-BIz--4Cr.js";import"./ColorModeContext-B1mN29UH.js";import"./Chip-BmmJUiHy.js";import"./LocalizationProvider-DSrdV9YK.js";function st(t){return ce("MuiToggleButton",t)}const _=le("MuiToggleButton",["root","disabled","selected","standard","primary","secondary","sizeSmall","sizeMedium","sizeLarge","fullWidth"]),ge=f.createContext({}),ye=f.createContext(void 0);function nt(t,o){return o===void 0||t===void 0?!1:Array.isArray(o)?o.includes(t):t===o}const it=t=>{const{classes:o,fullWidth:n,selected:d,disabled:c,size:s,color:i}=t,r={root:["root",d&&"selected",c&&"disabled",n&&"fullWidth",`size${V(s)}`,i]};return pe(r,st,o)},at=ue(Se,{name:"MuiToggleButton",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:n}=t;return[o.root,o[`size${V(n.size)}`]]}})(xe(({theme:t})=>({...t.typography.button,borderRadius:(t.vars||t).shape.borderRadius,padding:11,border:`1px solid ${(t.vars||t).palette.divider}`,color:(t.vars||t).palette.action.active,[`&.${_.disabled}`]:{color:(t.vars||t).palette.action.disabled,border:`1px solid ${(t.vars||t).palette.action.disabledBackground}`},"&:hover":{textDecoration:"none",backgroundColor:t.alpha((t.vars||t).palette.text.primary,(t.vars||t).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[{props:{color:"standard"},style:{[`&.${_.selected}`]:{color:(t.vars||t).palette.text.primary,backgroundColor:t.alpha((t.vars||t).palette.text.primary,(t.vars||t).palette.action.selectedOpacity),"&:hover":{backgroundColor:t.alpha((t.vars||t).palette.text.primary,`${(t.vars||t).palette.action.selectedOpacity} + ${(t.vars||t).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:t.alpha((t.vars||t).palette.text.primary,(t.vars||t).palette.action.selectedOpacity)}}}}},...Object.entries(t.palette).filter(we()).map(([o])=>({props:{color:o},style:{[`&.${_.selected}`]:{color:(t.vars||t).palette[o].main,backgroundColor:t.alpha((t.vars||t).palette[o].main,(t.vars||t).palette.action.selectedOpacity),"&:hover":{backgroundColor:t.alpha((t.vars||t).palette[o].main,`${(t.vars||t).palette.action.selectedOpacity} + ${(t.vars||t).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:t.alpha((t.vars||t).palette[o].main,(t.vars||t).palette.action.selectedOpacity)}}}}})),{props:{fullWidth:!0},style:{width:"100%"}},{props:{size:"small"},style:{padding:7,fontSize:t.typography.pxToRem(13)}},{props:{size:"large"},style:{padding:15,fontSize:t.typography.pxToRem(15)}}]}))),lt=f.forwardRef(function(o,n){const{value:d,...c}=f.useContext(ge),s=f.useContext(ye),i=Ze({...c,selected:nt(o.value,d)},o),r=de({props:i,name:"MuiToggleButton"}),{children:p,className:m,color:u="standard",disabled:h=!1,disableFocusRipple:j=!1,fullWidth:g=!1,onChange:w,onClick:y,selected:b,size:C="medium",value:B,...$}=r,z={...r,color:u,disabled:h,disableFocusRipple:j,fullWidth:g,size:C},P=it(z),x=S=>{y&&(y(S,B),S.defaultPrevented)||w&&w(S,B)},k=s||"";return e.jsx(at,{className:fe(c.className,P.root,m,k),disabled:h,focusRipple:!j,ref:n,onClick:x,onChange:w,value:B,ownerState:z,"aria-pressed":b,...$,children:p})});function ct(t){return ce("MuiToggleButtonGroup",t)}const v=le("MuiToggleButtonGroup",["root","selected","horizontal","vertical","disabled","grouped","groupedHorizontal","groupedVertical","fullWidth","firstButton","lastButton","middleButton"]),dt=t=>{const{classes:o,orientation:n,fullWidth:d,disabled:c}=t,s={root:["root",n,d&&"fullWidth"],grouped:["grouped",`grouped${V(n)}`,c&&"disabled"],firstButton:["firstButton"],lastButton:["lastButton"],middleButton:["middleButton"]};return pe(s,ct,o)},pt=ue("div",{name:"MuiToggleButtonGroup",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:n}=t;return[{[`& .${v.grouped}`]:o.grouped},{[`& .${v.grouped}`]:o[`grouped${V(n.orientation)}`]},{[`& .${v.firstButton}`]:o.firstButton},{[`& .${v.lastButton}`]:o.lastButton},{[`& .${v.middleButton}`]:o.middleButton},o.root,n.orientation==="vertical"&&o.vertical,n.fullWidth&&o.fullWidth]}})(xe(({theme:t})=>({display:"inline-flex",borderRadius:(t.vars||t).shape.borderRadius,variants:[{props:{orientation:"vertical"},style:{flexDirection:"column",[`& .${v.grouped}`]:{[`&.${v.selected} + .${v.grouped}.${v.selected}`]:{borderTop:0,marginTop:0}},[`& .${v.firstButton},& .${v.middleButton}`]:{borderBottomLeftRadius:0,borderBottomRightRadius:0},[`& .${v.lastButton},& .${v.middleButton}`]:{marginTop:-1,borderTop:"1px solid transparent",borderTopLeftRadius:0,borderTopRightRadius:0},[`& .${v.lastButton}.${_.disabled},& .${v.middleButton}.${_.disabled}`]:{borderTop:"1px solid transparent"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{orientation:"horizontal"},style:{[`& .${v.grouped}`]:{[`&.${v.selected} + .${v.grouped}.${v.selected}`]:{borderLeft:0,marginLeft:0}},[`& .${v.firstButton},& .${v.middleButton}`]:{borderTopRightRadius:0,borderBottomRightRadius:0},[`& .${v.lastButton},& .${v.middleButton}`]:{marginLeft:-1,borderLeft:"1px solid transparent",borderTopLeftRadius:0,borderBottomLeftRadius:0},[`& .${v.lastButton}.${_.disabled},& .${v.middleButton}.${_.disabled}`]:{borderLeft:"1px solid transparent"}}}]}))),ut=f.forwardRef(function(o,n){const d=de({props:o,name:"MuiToggleButtonGroup"}),{children:c,className:s,color:i="standard",disabled:r=!1,exclusive:p=!1,fullWidth:m=!1,onChange:u,orientation:h="horizontal",size:j="medium",value:g,...w}=d,y={...d,disabled:r,fullWidth:m,orientation:h,size:j},b=dt(y),C=f.useCallback((k,S)=>{if(!u)return;const R=g&&g.indexOf(S);let A;g&&R>=0?(A=g.slice(),A.splice(R,1)):A=g?g.concat(S):[S],u(k,A)},[u,g]),B=f.useCallback((k,S)=>{u&&u(k,g===S?null:S)},[u,g]),$=f.useMemo(()=>({className:b.grouped,onChange:p?B:C,value:g,size:j,fullWidth:m,color:i,disabled:r}),[b.grouped,p,B,C,g,j,m,i,r]),z=Ke(c),P=z.length,x=k=>{const S=k===0,R=k===P-1;return S&&R?"":S?b.firstButton:R?b.lastButton:b.middleButton};return e.jsx(pt,{role:"group",className:fe(b.root,s),ref:n,ownerState:y,...w,children:e.jsx(ge.Provider,{value:$,children:z.map((k,S)=>e.jsx(ye.Provider,{value:x(S),children:k},S))})})}),xt=H(e.jsx("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2m0 14H4v-6h16zm0-10H4V6h16z"})),ht=H(e.jsx("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z"})),mt=H(e.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m.88 15.76V19h-1.75v-1.29c-.74-.18-2.39-.77-3.02-2.96l1.65-.67c.06.22.58 2.09 2.4 2.09.93 0 1.98-.48 1.98-1.61 0-.96-.7-1.46-2.28-2.03-1.1-.39-3.35-1.03-3.35-3.31 0-.1.01-2.4 2.62-2.96V5h1.75v1.24c1.84.32 2.51 1.79 2.66 2.23l-1.58.67c-.11-.35-.59-1.34-1.9-1.34-.7 0-1.81.37-1.81 1.39 0 .95.86 1.31 2.64 1.9 2.4.83 3.01 2.05 3.01 3.45 0 2.63-2.5 3.13-3.02 3.22"})),ft=H([e.jsx("path",{d:"M12 3.19 5 6.3V12h7v8.93c3.72-1.15 6.47-4.82 7-8.94h-7z",opacity:".3"}
1,"0"),e.jsx("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm0 19.93V12H5V6.3l7-3.11v8.8h7c-.53 4.12-3.28 7.79-7 8.94"},"1")]),je=({compact:t,forms:o,editable:n,variant:d="elevation",handleOnSubmit:c=()=>{},handleOnCancel:s=()=>{}})=>{const[i,r]=f.useState(!1);return e.jsxs(te,{variant:d,sx:{p:1,width:"100%",minHeight:"50px",position:"relative"},children:[e.jsxs(Y,{in:!i,children:[t,e.jsx(W,{sx:{position:"absolute",bottom:4,right:4},onClick:p=>{p.stopPropagation(),p.preventDefault(),r(!i)},color:"warning",disabled:!n,children:e.jsx(ae,{})})]}),e.jsxs(Y,{in:i,children:[o,e.jsxs(l,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end",alignItems:"center"},children:[e.jsx(W,{onClick:p=>{p.stopPropagation(),p.preventDefault(),r(!i),c()},children:e.jsx(E,{color:"success"})}),e.jsx(W,{onClick:p=>{p.stopPropagation(),p.preventDefault(),r(!i),s()},children:e.jsx(Le,{color:"error"})})]})]})]})},gt=({address:t,editable:o,variant:n="elevation",handleOnSubmit:d=c=>{}})=>{var m,u;const[c,s]=f.useState(t),i=()=>{s(t)};if(!t)return null;let r=(m=t.address)==null?void 0:m.split(`
2`)[0],p=(u=t.address)==null?void 0:u.split(`
3`)[1];return e.jsx(je,{variant:n,compact:[t.name&&e.jsx(a,{variant:"body1",children:t.name},"name"),e.jsxs(a,{variant:"body1",children:[r,p?`, ${p}`:""]},"street"),e.jsxs(a,{variant:"body1",children:[t.city?`${t.city},`:""," ",t.state," ",t.zip]},"city_state_zip"),e.jsx(a,{variant:"body1",children:t.country},"country")],forms:e.jsx(Re,{address:c,setAddress:s}),editable:o,handleOnSubmit:()=>{var h,j;return d({address1:(h=c.address)==null?void 0:h.split(`
4`)[0],address2:(j=c.address)==null?void 0:j.split(`
5`)[1],city:c.city,state:c.state,country:c.country,zip:c.zip})},handleOnCancel:i})};function Q(t,o,n){return t&&o?t[0]+o[0]:n[0]}const yt=({user:t})=>{var o,n,d,c;return((o=t==null?void 0:t.role)==null?void 0:o.roleType)==="merchant"&&((n=t.role)!=null&&n.store)?e.jsx(ne,{overlap:"circular",anchorOrigin:{vertical:"bottom",horizontal:"right"},badgeContent:e.jsx(l,{sx:{borderRadius:"50%",backgroundColor:"white",width:"22px",height:"22px",display:"flex",justifyContent:"center",alignItems:"center",fontSize:"18px",color:"darkRed"},children:e.jsx(_e,{fontSize:"inherit"})}),children:e.jsx(G,{sx:{height:"50px",width:"50px"},children:Q(t.firstName,t.lastName,t.email)})}):((d=t==null?void 0:t.role)==null?void 0:d.roleType)==="superadmin"?e.jsx(ne,{overlap:"circular",anchorOrigin:{vertical:"bottom",horizontal:"right"},badgeContent:e.jsx(l,{sx:{borderRadius:"50%",backgroundColor:"white",width:"22px",height:"22px",display:"flex",justifyContent:"center",alignItems:"center",fontSize:"18px",color:"navy"},children:e.jsx(ft,{fontSize:"inherit"})}),children:e.jsx(G,{sx:{height:"50px",width:"50px"},children:Q(t.firstName,t.lastName,t.email)})}):((c=t==null?void 0:t.role)==null?void 0:c.roleType)==="user"?e.jsx(G,{sx:{height:"50px",width:"50px"},children:Q(t.firstName,t.lastName,t.email)}):e.jsx(G,{sx:{height:"50px",width:"50px"}})},jt=({user:t,variant:o="elevation",sx:n})=>e.jsx(te,{variant:o,sx:{...n,p:1,maxWidth:"600px"},children:t?e.jsxs(l,{sx:{display:"flex",flexDirection:"column",gap:"7px"},children:[e.jsxs(l,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"10px"},children:[e.jsx(yt,{user:t}),e.jsx(l,{sx:{display:"flex",flexDirection:"column"},children:t.firstName&&t.lastName?[e.jsx(a,{sx:{fontSize:"16px",fontWeight:"bold"},children:t.firstName},"firstName"),e.jsx(a,{sx:{fontSize:"16px",fontWeight:"bold"},children:t.lastName},"lastName")]:null})]}),e.jsx(l,{sx:{display:"flex",flexDirection:"column",gap:"5px"},children:t.phone?[e.jsx(a,{sx:{fontSize:"12px"},children:t.email},"email"),e.jsx(l,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between"},children:e.jsx(a,{sx:{fontSize:"12px"},children:t.phone})},"phone")]:e.jsx(l,{sx:{display:"flex",flexDirection:"row",justifyContent:"space-between",gap:"2rem"},children:e.jsx(a,{sx:{fontSize:"12px"},children:t.email})})})]}):e.jsx(l,{children:e.jsxs(a,{sx:{fontSize:"12px"},children:["Could not find the user for this order. They may have deleted their account. ",e.jsx("strong",{children:"This does not affect the order."})]})})}),bt=({storeId:t,open:o,onClose:n})=>{const d=L(N),[c,s]=f.useState(.5),[i,r]=f.useState(""),p=b=>{b.target.value.match(/^[0-9]*\.?[0-9]{0,2}$/)&&s(b.target.value)},[m,{isSuccess:u,data:h,isError:j,error:g,isLoading:w}]=ke();async function y(b){if(b.preventDefault(),!c){console.error("charge amount must exist");return}const C=Math.floor(c*100);if(C<50){console.error("charge amount must be > 50c",C);return}if(C%1!==0){console.error("charge amount must be an integer of cents",C);return}(await m({storeId:t,amount:C,message:i})).data&&(s(.5),r(""))}
5return d?e.jsxs(he,{open:o,onClose:n,children:[e.jsx(me,{children:e.jsx(a,{component:"span",sx:{fontSize:"18px"},children:"Directly charge a connected store"})}),e.jsxs(l,{sx:{p:4},children:[e.jsxs(l,{sx:{display:"flex",flexDirection:"column"},children:[e.jsxs("form",{onSubmit:y,children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",justifyContent:"center",gap:1},children:[e.jsx(F,{required:!0,error:j,InputProps:{startAdornment:e.jsx(We,{position:"start",children:"$"})},sx:{width:"12ch"},size:"small",value:c,onChange:p}),e.jsx(J,{type:"submit",disabled:w,endIcon:w&&e.jsx(U,{color:"warning",size:18}),children:"Charge"})]}),e.jsx(F,{multiline:!0,sx:{width:"100%",mt:1},placeholder:"Message to store...",value:i,onChange:b=>{r(b.target.value)}})]}),j&&e.jsx(a,{color:"error",children:g.data.error.message})]}),h&&e.jsxs(l,{sx:{alignText:"center",pt:2,px:2,fontWeight:600},children:[e.jsx(a,{color:"success.main",children:h.message}),e.jsxs(a,{children:["To view the receipt, click"," ",e.jsx("a",{href:h.receiptLink,target:"_blank",rel:"noopener noreferrer",children:e.jsx(a,{component:"span",color:"primary.main",children:"here"})})]}),e.jsxs(a,{children:["To view the payment in the stripe dashboard, click"," ",e.jsx("a",{href:h.paymentLink,target:"_blank",rel:"noopener noreferrer",children:e.jsx(a,{component:"span",color:"primary.main",children:"here"})})]})]}),e.jsx(l,{sx:{display:"flex"},children:e.jsx(J,{variant:"outlined",color:"error",onClick:n,sx:{ml:"auto",mt:1},children:"Cancel"})})]})]}):null},vt=({storeId:t})=>{const o=L(N),[n,d]=f.useState(!1);return o?e.jsxs(e.Fragment,{children:[e.jsx(J,{startIcon:e.jsx(Me,{}),onClick:()=>{d(!0)},children:"Charge Store"}),e.jsx(bt,{storeId:t,open:n,onClose:()=>{d(!1)}})]}):null},Ct=({storeId:t})=>{const[o,n]=f.useState(!1),[d,c]=f.useState(1),[s,i]=f.useState(10),r=f.useMemo(()=>({page:d,limit:s,storeId:t}),[d,s,t]),{data:p,isFetching:m,isError:u,isSuccess:h}=Be(r,{skip:!t}),j=(p==null?void 0:p.docs)??[],g=(p==null?void 0:p.totalPages)??1,w=h||u;return e.jsxs(l,{sx:{width:"100%",mt:2},children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[e.jsxs(l,{sx:{display:"flex",alignItems:"baseline",gap:.5},children:[e.jsx(a,{variant:"h6",children:"Payment History"}),w&&j.length===0&&e.jsx(a,{color:"warning",variant:"caption",component:"span",children:"(No recent payouts)"})]}),e.jsx(I,{variant:"outlined",color:"warning",disabled:!t,onClick:()=>n(y=>!y),startIcon:o?e.jsx(Ne,{}):e.jsx(Ge,{}),children:o?"Hide":"View"})]}),e.jsx(D,{sx:{mt:1}}),e.jsxs(Y,{in:o,timeout:"auto",unmountOnExit:!0,children:[!t&&e.jsx(a,{variant:"body2",sx:{mt:2},color:"text.secondary",children:"No store selected."}),t&&e.jsxs(e.Fragment,{children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:2,mt:2},children:[e.jsx(He,{page:d,setPage:c,totalPages:g}),e.jsx(Ue,{limit:s,setLimit:i,setPage:c,lsKey:"payoutEventsLimit"})]}),m&&e.jsx(a,{variant:"body2",sx:{mt:2},children:"Loading..."}),u&&e.jsx(a,{variant:"body2",color:"error",sx:{mt:2},children:"Error fetching payout history"}),h&&j.length===0&&e.jsx(a,{variant:"body2",sx:{mt:2},color:"text.secondary",children:"No payout events found."}),j.length>0&&e.jsx(Ve,{sx:{mt:2},children:e.jsxs(qe,{size:"small",children:[e.jsx(Qe,{children:e.jsxs(ie,{children:[e.jsx(M,{children:"Date"}),e.jsx(M,{children:"Requested By"}),e.jsx(M,{align:"right",children:"Amount"})]})}),e.jsx(Ye,{children:j.map((y,b)=>{var C;return e.jsxs(ie,{hover:!0,children:[e.jsx(M,{children:y.createdAt?e.jsx(Ee,{format:"MM/DD/YYYY hh:mm A",children:y.createdAt}):"-"}),e.jsx(M,{children:((C=y.requester)==null?void 0:C.contact)||"-"}),e.jsx(M,{align:"right",children:typeof y.amount=="number"?e.jsx(K,{price:y.amount/100}):"-"})]},`${y.createdAt??"unknown"}-${b}`)})})]})})]})]})]})},St=[{value:"Sunday",label:"Sun"},{value:"Monday",label:"Mon"},{value:"Tuesday",label:"Tue"},{value:"Wednesday",label:"Wed"},{value:"Thursday",label:"Thu"},{value:"Friday",label:"Fri"},{value:"Saturday",label:"Sat"}],wt=({value:t,onChange:o,disabled:n})=>{const d=oe(),c=re(d.breakpoints.down("sm")),s=(i,r)=>{r!==null&&o(r)};return e.jsx(ut,{value:t,exclusive:!0,onChange:s,"aria-label":"day of week",disabled:n,size:c?"small":"medium",sx:{flexWrap:"wrap",gap:.5,"& .MuiToggleButtonGroup-grouped":{border:1,borderColor:"divider",borderRadius:"8px !important","&:not(:first-of-type)":{borderLeft:1,borderColor:"divider",marginLeft:0},"&.Mui-selected":{backgroundColor:"primary.main",color:"primary.contrastText","&:hover":{backgroundColor:"primary.dark"}}}},children:St.map(i=>e.jsx(lt,{value:i.value,"aria-label":i.label,sx:{minWidth:c?40:48},children:i.label},i.value))})},kt=({value:t,onChange:o,disabled:n})=>{const d=oe(),c=re(d.breakpoints.down("sm"));return e.jsxs(l,{sx:{display:"flex",flexDirection:"column",gap:1},children:[e.jsx(l,{sx:{display:"grid",gridTemplateColumns:"repeat(7, minmax(0, 1fr))",gap:.75},children:Array.from({length:31},(s,i)=>i+1).map(s=>{const i=t===s;return e.jsx(I,{variant:i?"contained":"outlined",color:i?"primary":"inherit",disabled:n,onClick:()=>o(s),sx:{minWidth:0,px:0,py:c?.75:1,lineHeight:1},children:s},s)})}),t!=null&&t>28&&e.jsxs(a,{variant:"body2",sx:{fontStyle:"italic"},children:["If a month has fewer than ",t," days, your payout will happen on the last day of that month."]})]})},Bt=()=>
5{const[t,o]=f.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsx(l,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:1},children:e.jsx(I,{variant:"contained",onClick:()=>o(!0),startIcon:e.jsx(Oe,{}),children:"Schedule Automatic Payouts"})}),e.jsx(Tt,{open:t,onClose:()=>o(!1)})]})},Tt=({open:t,onClose:o})=>{var P;const n=L(Z),c=L(N)?X().storeId:n.role.store,{data:s,isLoading:i,isError:r,isSuccess:p}=ee({storeId:c,details:"full"}),[m,{isLoading:u}]=Te(),[h,j]=f.useState("off"),[g,w]=f.useState("Monday"),[y,b]=f.useState(1);f.useEffect(()=>{var S;if(!t)return;const x=(S=s==null?void 0:s.store)==null?void 0:S.payout_config,k=(x==null?void 0:x.schedule)==="weekly"||(x==null?void 0:x.schedule)==="monthly"||(x==null?void 0:x.schedule)==="off"?x.schedule:"off";j(k),x!=null&&x.weekly_payout_day&&w(x.weekly_payout_day),typeof(x==null?void 0:x.monthly_payout_date)=="number"&&b(x.monthly_payout_date)},[t,(P=s==null?void 0:s.store)==null?void 0:P.payout_config]);const C=f.useCallback(x=>{j(x)},[]),B=h==="weekly"?{schedule:"weekly",weekly_payout_day:g}:h==="monthly"?{schedule:"monthly",monthly_payout_date:y}:{schedule:"off"},$=u||h==="weekly"&&!g||h==="monthly"&&(typeof y!="number"||y<1||y>31),z=f.useCallback(async()=>{try{await m({storeId:c,payoutConfig:B}).unwrap(),o()}catch(x){console.error("Failed to update payout schedule:",x)}},[c,B,m,o]);return e.jsxs(he,{open:t,onClose:o,fullWidth:!0,maxWidth:"xs",children:[e.jsx(me,{children:"Schedule Payouts"}),e.jsx(D,{}),e.jsxs(Fe,{sx:{display:"flex",flexDirection:"column",gap:1},children:[e.jsx(a,{variant:"body2",children:"Select a payout schedule"}),e.jsxs(Je,{sx:{gap:.5},children:[e.jsx(I,{variant:"contained",onClick:()=>C("weekly"),startIcon:h==="weekly"?e.jsx(E,{}):null,children:"Weekly"}),e.jsx(I,{variant:"contained",onClick:()=>C("monthly"),startIcon:h==="monthly"?e.jsx(E,{}):null,children:"Monthly"}),e.jsx(I,{variant:"contained",onClick:()=>C("off"),startIcon:h==="off"?e.jsx(E,{}):null,children:"Off"})]}),h==="off"&&e.jsx(a,{variant:"body2",sx:{fontStyle:"italic"},children:"Automatic payouts are disabled."}),h==="weekly"&&e.jsxs(l,{children:[e.jsx(a,{variant:"body2",sx:{mb:1},children:"Select payout day"}),e.jsx(wt,{value:g,onChange:x=>{x&&w(x)},disabled:u}),g&&e.jsxs(a,{variant:"body2",sx:{fontStyle:"italic",mt:.5},children:["Payouts will be processed on ",g," at 11:59 PM."]})]}),h==="monthly"&&e.jsxs(l,{children:[e.jsx(a,{variant:"body2",sx:{mb:1},children:"Select payout day of month"}),e.jsx(kt,{value:y,onChange:x=>{typeof x=="number"&&b(x)},disabled:u})]})]}),e.jsxs(Ae,{children:[e.jsx(I,{onClick:o,children:"Cancel"}),e.jsx(I,{onClick:z,disabled:$,children:"Save"})]})]})};function It(t){return["invalid","pending","active","Error","not_started","in_progress","info_required"].includes(t)}const zt=({currentUser:t,connectStatus:o="invalid"})=>{const[n,{isLoading:d}]=O.useLazyGetStripeConnectLinkQuery(),c=async()=>{await n({storeId:t.role.store}).unwrap().then(s=>{window.open(s.url,"_blank","noopener,noreferrer")}).catch(s=>{console.error(s)})};return e.jsxs(e.Fragment,{children:[e.jsxs(I,{variant:"contained",color:"warning",onClick:c,sx:{width:"100%",display:o==="invalid"||o==="pending"||o==="active"||o==="Error"?"none":"flex",gap:2},disabled:d,children:[o==="not_started"&&"Connect",o==="in_progress"&&"Resume Connect",o==="info_required"&&"Enter Required Info",o==="pending"&&"Connect Pending",o==="active"&&"Connected",d&&e.jsx(U,{color:"warning",size:16})]}),e.jsxs(a,{component:"p",sx:{display:"flex",gap:1},children:["Status:",o==="active"?e.jsx(a,{color:"success",component:"p",children:"Connected"}):null,o==="pending"?e.jsx(a,{component:"p",children:"Your account is pending. This may take up to 24 hours while the Stripe team verifies your store's information."}):null,o==="Error"?e.jsx(a,{component:"p",color:"error",children:"There was a problem collecting your account status."}):null]})]})},Pt=({currentUser:t,connectStatus:o,isSuperAdmin:n})=>{const[d]=O.useLazyGetStripeConnectLoginLinkQuery(),c=async()=>{await d({storeId:t.role.store}).unwrap().then(s=>{window.open(s.url,"_blank","noopener,noreferrer")}).catch(s=>{console.error(s)})};return e.jsx(l,{children:e.jsx(I,{startIcon:e.jsx(tt,{}),variant:"contained",color:"secondary",onClick:c,disabled:n||o==="invalid"||o==="not_started"||o==="in_progress"||o==="info_required"||o==="pending",children:"Stripe Dashboard"})})},$t=({currentUser:t,connectStatus:o,isMerchant:n,isSuperAdmin:d})=>{var g,w,y,b,C,B,$,z,P,x;const[c,s]=O.useCreateStripePayoutMutation(),{data:i,isLoading:r,isError:p,isSuccess:m}=O.useGetStripeConnectBalanceQuery({storeId:t.role.store},{skip:!n}),[u,h]=f.useState(!1),j=async()=>{h(!0);try{const k=await c({storeId:t.role.store}).unwrap();console.log(k)}catch(k){console.error(k)}finally{h(!1)}};return e.jsxs(l,{sx:{display:"flex",flexDirection:"column"},children:[e.jsx(I,{variant:"contained",color:"warning",onClick:j,startIcon:u||s.isLoading?void 0:e.jsx(mt,{}),"aria-busy":u||s.isLoading,disabled:d||u||s.isLoading||r||p||((w=(g=i==null?void 0:i.balance)==null?void 0:g.available[0])==null?void 0:w.amount)<=200||o==="invalid"||o==="not_started"||o==="in_progress"||o==="info_required"||o==="pending",children:u||s.isLoading?e.jsxs(e.Fragment,{children:[e.jsx(U,{size:16,color:"inherit",sx:{mr:1}}),"Processing payout..."]}):e.jsxs(e.Fragment,{children:["Initiate Payout",e.jsxs(l,{sx:{ml:.5},children:["(",e.jsx(K,{price:((b=(y=i==null?void 0:i.balance)==null?void 0:y.available[0])==null?void 0:b.amount)/100}),")"]})]})}),p&&e.jsx(a,{variant:"body2",color:"error",sx:{mt:.5}
5,children:"There was a problem querying your Stripe account balance."}),m&&((B=(C=i==null?void 0:i.balance)==null?void 0:C.available[0])==null?void 0:B.amount)<=200&&e.jsxs(e.Fragment,{children:[e.jsx(a,{variant:"body2",color:"error",sx:{mt:.5},children:"Balance is below the minimum amount of $2.00"}),((z=($=i==null?void 0:i.balance)==null?void 0:$.pending[0])==null?void 0:z.amount)>0&&e.jsxs(a,{variant:"body2",color:"text.secondary",sx:{mt:.5},children:["You have"," ",e.jsx(K,{price:((x=(P=i==null?void 0:i.balance)==null?void 0:P.pending[0])==null?void 0:x.amount)/100})," ","pending. Funds typically become available within 2-7 days."]})]})]})},Dt=({storeId:t})=>{var p;const{data:o,isLoading:n,isError:d,isSuccess:c}=ee({storeId:t}),s=(p=o==null?void 0:o.store)==null?void 0:p.payout_config,i=m=>{const u=m%100;if(u>=11&&u<=13)return`${m}th`;const h=m%10;return h===1?`${m}st`:h===2?`${m}nd`:h===3?`${m}rd`:`${m}th`},r=(s==null?void 0:s.schedule)==="weekly"?`Automatic payouts: Weekly (${s.weekly_payout_day})`:(s==null?void 0:s.schedule)==="monthly"?`Automatic payouts: Monthly (${i(Number(s.monthly_payout_date))} day)`:((s==null?void 0:s.schedule)==="off","Automatic payouts: Off");return e.jsxs(l,{children:[r&&e.jsx(a,{variant:"body2",sx:{mb:1},children:r}),e.jsx(Bt,{})]})},Rt=()=>{const t=L(Z),o=L(Ie),n=L(N),{storeId:d}=X(),[c,s]=O.useLazyGetStripeConnectStatusQuery(),[i,r]=f.useState("invalid"),p=o?t.role.store:n?d:null,m=()=>{if(!p){r("invalid");return}c({storeId:p}).unwrap().then(u=>{const j=(typeof(u==null?void 0:u.status)=="string"?u.status.trim():"invalid").replace(/\s+/g,"_");r(It(j)?j:"invalid")}).catch(u=>{console.error(u),r("Error")})};return f.useEffect(()=>{m()},[t,o,n,p]),o||n?e.jsxs(l,{sx:{display:"flex",flexDirection:"column",gap:2,width:"100%"},children:[e.jsxs(l,{sx:{display:"flex",gap:2},children:[e.jsxs(l,{sx:{display:"flex",flexDirection:"column",gap:1},children:[e.jsx(a,{variant:"h6",children:"Manage Stripe Connection"}),e.jsx(Pt,{currentUser:t,connectStatus:i,isSuperAdmin:n}),e.jsx(zt,{currentUser:t,connectStatus:i}),n&&e.jsxs(I,{variant:"outlined",color:"secondary",startIcon:s.isFetching?e.jsx(U,{size:16,color:"inherit"}):e.jsx(et,{}),onClick:m,disabled:s.isFetching,sx:{textTransform:"none"},children:["Reverify Stripe Status",i!=="invalid"&&` (${i})`]})]}),e.jsx(D,{flexItem:!0,orientation:"vertical",sx:{mx:1}}),e.jsxs(l,{sx:{display:"flex",flexDirection:"column",gap:1},children:[e.jsx(a,{variant:"h6",children:"Manage Payouts"}),e.jsx($t,{currentUser:t,connectStatus:i,isMerchant:o,isSuperAdmin:n}),e.jsx(Dt,{storeId:d??t.role.store}),n&&e.jsx(vt,{storeId:d})]})]}),e.jsx(Ct,{storeId:d??t.role.store})]}):null},Lt=({storeId:t,platformFee:o})=>{const[n,d]=f.useState(o),c=m=>{m.target.value.match(/^[0-9.]*$/)&&d(m.target.value)},s=f.useMemo(()=>n===o||n===""||n==="0"||parseFloat(n)<=0||parseFloat(n)>.5,[n,o]),i=m=>{m.preventDefault(),r({storeId:t,platform_fee:parseFloat(n)})},[r,p]=De();return e.jsxs(Xe,{sx:{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"flex-start",gap:1},children:[e.jsx(a,{variant:"body1",sx:{fontWeight:"bold",fontSize:"12px"},children:"Platform Fee"}),e.jsx(F,{size:"small",variant:"standard",value:n,onChange:c}),e.jsx(I,{disabled:s,onClick:m=>i(m),children:"Submit Change"})]})},Zo=({mystore:t})=>{const o=oe(),n=be(),d=re(o.breakpoints.down("tablet")),c=t?L(Z):null,s=L(N),i=t?c.role.store:X().storeId,{data:r,isLoading:p,isError:m,isSuccess:u}=ee({storeId:i,details:"full"}),{data:h,isLoading:j,isSuccess:g}=ze({storeId:i},{skip:!i}),w=f.useMemo(()=>!g||!h?null:h.find(T=>T.global),[h,g]),[y,b]=f.useState(u?r.store.phone:""),[C,B]=f.useState(u?r.store.support_email:"");f.useEffect(()=>{u&&(b(r.store.phone),B(r.store.support_email))},[u]);const[$,z]=f.useState(""),[P,x]=f.useState(!1),k=()=>{z((r==null?void 0:r.store.name)||""),x(!0)},S=()=>{x(!1)},[R,{isLoading:A}]=Pe(),[se,{isLoading:Wt}]=$e();return p?e.jsx("div",{children:"Loading..."}):e.jsxs(l,{sx:{p:d?2:4,pt:d?8:4,color:o.palette.text.primary,backgroundColor:o.palette.background.parchment},children:[e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:2,flexDirection:d?"column":"row",flexWrap:"wrap",justifyContent:"space-between"},children:[e.jsx(l,{sx:{},children:r.store.icon?e.jsxs(e.Fragment,{children:[e.jsx("img",{src:r.store.icon.medium,style:{height:"124px",objectFit:"cover"}}),e.jsxs(I,{color:"warning",sx:{fontSize:"12px",textTransform:"none"},startIcon:e.jsx(ht,{}),component:"label",children:["Change Logo",e.jsx("input",{type:"file",hidden:!0,accept:".jpg, .jpeg, .png, .webp",onChange:T=>se({storeId:i,logo:T.target.files[0]})})]})]}):e.jsxs(l,{sx:{backgroundColor:o.palette.background.paper,width:"124px",height:"124px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",p:2,border:`1px solid #${o.palette.mode==="light"?"BFBF
5BF":"4F4F4F"}`},children:[e.jsx(a,{sx:{fontWeight:"bold",textAlign:"center",fontSize:"12px"},children:"Upload a logo here"}),e.jsxs(W,{color:"warning",component:"label",children:[e.jsx(Ce,{}),e.jsx("input",{type:"file",hidden:!0,accept:".jpg, .jpeg, .png, .webp",onChange:T=>se({storeId:i,logo:T.target.files[0]})})]})]})}),e.jsxs(l,{sx:{display:"flex",flexDirection:"row",alignItems:"flex-end",justifyContent:"space-between",width:d?"100%":{},mx:"auto"},children:[e.jsxs(l,{sx:{flexBasis:"600px"},children:[P?null:e.jsx(a,{variant:"body1",children:r.store.store_type==="tuneportals_customer"?"Tuneportals Customer":null}),P?e.jsx(l,{children:e.jsx(F,{variant:"standard",value:$,onChange:T=>z(T.target.value)})}):e.jsx(a,{variant:"body1",sx:{fontSize:"40px",fontWeight:600},children:r.store.name})]}),P?e.jsxs(l,{children:[e.jsx(W,{color:"error",onClick:S,children:e.jsx(ve,{})}),e.jsx(W,{color:"success",onClick:()=>{R({storeId:r.store._id,name:$}),x(!1)},children:e.jsx(E,{})})]}):e.jsx(W,{color:"warning",onClick:k,children:e.jsx(ae,{})})]})]}),e.jsxs(te,{sx:{mt:2},children:[e.jsxs(l,{sx:{backgroundColor:"#000",px:2,py:1,display:"flex",alignItems:"flex-start",justifyContent:"flex-start",gap:1},children:[e.jsx(xt,{sx:{color:"#fff"}}),e.jsx(a,{sx:{textAlign:"center",color:"#fff"},children:"Payment Controls"})]}),e.jsx(l,{sx:{p:2,display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",gap:2},children:e.jsx(Rt,{})})]}),e.jsxs(l,{sx:{mt:2,border:`1px solid #${o.palette.mode==="light"?"BFBFBF":"4F4F4F"}`},children:[e.jsx(l,{sx:{backgroundColor:o.palette.background.paper,p:2},children:e.jsx(I,{color:"secondary",sx:{textTransform:"none"},variant:"outlined",onClick:T=>{T.preventDefault(),n(rt(r.store.name))},disabled:p||m,children:"Go to customer-facing store page"})}),e.jsxs(l,{sx:{backgroundColor:o.palette.background.paper,p:2},children:[e.jsx(a,{sx:{fontSize:"14px",fontWeight:800},children:"INFO"}),e.jsxs(l,{sx:{mt:1,display:"grid",gridTemplateColumns:{xs:"1fr",md:"1fr 1fr 1fr"},columnGap:2,rowGap:2},children:[e.jsxs(l,{children:[e.jsx(a,{sx:{fontSize:"14px",fontWeight:600},children:"Admin"}),e.jsx(D,{variant:"fullWidth",sx:{mt:1}}),r.store.admin?e.jsx(jt,{variant:"outlined",user:r.store.admin,sx:{mt:1,p:1}}):null]}),e.jsxs(l,{children:[e.jsx(a,{sx:{fontSize:"14px",fontWeight:600},children:"Contact Info"}),e.jsx(D,{variant:"fullWidth",sx:{my:1}}),e.jsx(je,{compact:[e.jsx(a,{variant:"body1",children:r.store.phone}),e.jsx(a,{variant:"body1",children:r.store.support_email})],forms:[e.jsx(F,{fullWidth:!0,label:"Phone",placeholder:"(555) 555-5555",sx:{pb:2},value:y,onChange:T=>b(T.target.value)}),e.jsx(F,{fullWidth:!0,label:"Email",placeholder:"[email protected]",value:C,onChange:T=>B(T.target.value)})],editable:!0,handleOnSubmit:()=>{R({storeId:r.store._id,phone:y,support_email:C})},handleOnCancel:()=>{b(r.store.phone),B(r.store.support_email)},variant:"outlined"})]}),e.jsxs(l,{children:[e.jsx(a,{sx:{fontSize:"14px",fontWeight:600},children:"Address"}),e.jsx(D,{variant:"fullWidth",sx:{my:1}}),r.store.address?e.jsx(gt,{variant:"outlined",address:{address:`${r.store.address.address1}${r.store.address.address2?`
6${r.store.address.address2}`:""}`,city:r.store.address.city,state:r.store.address.state,country:r.store.address.country||"USA",zip:r.store.address.zip},editable:!0,handleOnSubmit:T=>{R({storeId:r.store._id,address:T})}}):null]})]}),e.jsx(a,{sx:{fontSize:"14px",fontWeight:800,my:1},children:"PRICING"}),e.jsx(l,{sx:{backgroundColor:"#313131",width:"100%",p:1},children:e.jsx(a,{sx:{fontSize:"14px",fontWeight:600,color:o.palette.admin.contrastText},children:"Site-wide"})}),e.jsxs(l,{sx:{width:"100%",p:1},children:[e.jsx(a,{sx:{fontSize:"12px",fontWeight:800},children:"WHAT'S THIS?"}),e.jsxs(a,{sx:{fontSize:"12px",fontWeight:600},children:["These are price settings that apply to all stores, set by the rsdrecordmart.com admins. They are not editable by store admins."," ",e.jsx(q,{href:"#",color:"inherit",children:"Click here"})," ","to learn more about site-wide pricing."]})]}),e.jsx(D,{sx:{my:2}}),e.jsxs(a,{sx:{fontSize:"16px",fontWeight:600},children:["Official RSD Releases maximum markup:"," ",e.jsx("span",{style:{color:o.palette.success.main},children:"20%"})]}),e.jsx(a,{sx:{fontSize:"14px",fontWeight:500,mt:2,ml:1},paragraph:!0,children:"This is the maximum markup that can be applied to any official RSD release item (this excludes RSD Essentials). For example, if an product's MSRP is $10, the maximum markup a store could apply would be $12."}),e.jsx(a,{sx:{fontSize:"14px",fontWeight:500,ml:1},paragraph:!0,children:"If a store applies a flat rate markup that would exceed the maximum of 20% for some products, those products will have the maximum markup of 20% applied to them instead."}),e.jsx(l,{sx:{backgroundColor:"#313131",width:"100%",p:1,mt:3},children:e.jsxs(a,{sx:{fontSize:"14px",fontWeight:500,color:o.palette.admin.contrastText},children:[e.jsx("span",{style:{fontWeight:800},children:r.store.name})," Global Price Rules"]})}),e.jsxs(l,{sx:{width:"100%",p:1},children:[e.jsx(a,{sx:{fontSize:"12px",fontWeight:800,ml:1},children:"WHAT'S THIS?"}),e.jsxs(a,{variant:"body1",sx:{fontSize:"12px",fontWeight:600,mt:1,ml:1},children:["These are price settings that apply to all products sold by"," ",e.jsx("span",{style:{fontWeight:800},children:r.store.name}),". They can be edited on the"," ",e.jsx(q,{href:`/admin/pricing/${r.store._id}`,color:"inherit",children:"Pricing Rules"})," ","page or they can be overridden on a per-product basis. You can do this by editing a product directly from its item page, or by editing a product's price settings on the"," ",e.jsx(q,{href:"/admin/inventory/view",color:"inherit",children:"Manage Inventory"})," ","page."]}),e.jsx(D,{sx:{my:2}}),e.jsx(ot,{isLoading:j,rule:w,storeId:i})]}),s?[e.jsx(D,{sx:{my:2}}),e.jsx(a,{variant:"body1",sx:{mb:1,fontSize:"12px",fontWeight:"bold"},children:"Superadmin Only"}),e.jsx(Lt,{storeId:r.store._id,platformFee:r.store.platform_fee}),e.jsx(D,{sx:{my:2}})]:null]})]})]})};export{Zo as default};

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.