PrinterLocationsPage-D2AqeJ9i.js 18 KB

1
  1. import{i as e}from"./chunk-aKtaBQYM.js";import{C as t,D as n,a as r,w as i}from"./client-BdOyoZJz.js";import{n as a}from"./QueryClientProvider-Clbyr4Jg.js";import{t as o}from"./useQuery-CCy0EwsM.js";import{t as s}from"./useMutation-qh3Iyscy.js";import{t as c}from"./useQueries-C87lFrjE.js";import{t as l}from"./createLucideIcon-Yo2YoYjm.js";import{t as u}from"./arrow-left-MSgMxOFV.js";import{t as d}from"./box-BIRPxdgi.js";import{a as f}from"./info-DcT0QU8O.js";import{n as p}from"./ToastContext-VFOrCCoA.js";import{t as m}from"./loader-circle-CB4leTZa.js";import{t as ee}from"./move-CEngqF8v.js";import{t as te}from"./search-BpAJdxRw.js";import{t as h}from"./x-Dctff5l9.js";import{n as g,t as _}from"./Card-OUAj0Ayh.js";import{t as v}from"./Button-pwVKPiYn.js";import{$t as ne,At as re,Lt as y,Rn as ie,Rt as b,Zt as ae,_t as oe,ht as x,mt as se,yt as ce}from"./index-BoVbGTav.js";var S=l(`user-minus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),C=e(n(),1),w=t(),le=100,T=[`#ef4444`,`#f97316`,`#eab308`,`#22c55e`,`#14b8a6`,`#3b82f6`,`#8b5cf6`,`#ec4899`,`#6b7280`],ue=[`name-asc`,`name-desc`,`count-asc`,`count-desc`],de=`printerLocations.hideEmpty`,fe=`printerLocations.sort`;function pe(e,t,n){try{let r=localStorage.getItem(e);return t.includes(r)?r:n}catch{return n}}function me(e,t){try{localStorage.setItem(e,t)}catch{}}var he=e=>e.location?.trim()||``;function ge({location:e}){return(0,w.jsxs)(`div`,{className:`p-2 rounded-lg bg-bambu-dark relative overflow-hidden flex-shrink-0`,children:[(0,w.jsx)(se.find(t=>t.name===e.icon)?.icon??d,{className:`w-[25px] h-[25px] text-bambu-gray`}),e.color&&(0,w.jsx)(`div`,{className:`absolute top-0 left-0 w-1 h-full`,style:{backgroundColor:e.color}})]})}function _e({printer:e,status:t,selected:n,canEdit:r,busy:a,onToggle:o,onMove:s,onRemove:c}){let{t:l}=i(),u=t?.state,d=t?.connected,f=l(d?u===`RUNNING`?`printers.status.printing`:u===`PAUSE`?`printers.status.paused`:u===`FINISH`?`printers.status.finished`:`printers.status.idle`:`printers.status.offline`),p=d?u===`RUNNING`?`bg-orange-500/20 text-orange-400`:u===`PAUSE`?`bg-yellow-500/20 text-yellow-400`:u===`FINISH`?`bg-bambu-green/20 text-bambu-green`:`bg-bambu-dark text-bambu-gray`:`bg-gray-500/20 text-gray-400`;return(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-2 py-2 px-3 rounded-lg transition-colors ${n?`bg-bambu-green/10 border border-bambu-green/30`:`bg-bambu-dark-secondary hover:bg-bambu-dark`}`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[r&&(0,w.jsx)(`button`,{type:`button`,onClick:o,className:`text-bambu-gray hover:text-bambu-green transition-colors`,title:l(`printers.locations.selectPrinter`),"aria-label":l(`printers.locations.selectPrinter`),"aria-pressed":n,children:n?(0,w.jsx)(b,{className:`w-4 h-4 text-bambu-green`}):(0,w.jsx)(y,{className:`w-4 h-4`})}),(0,w.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-full flex-shrink-0 ${d?u===`RUNNING`||u===`PAUSE`?`bg-orange-500`:`bg-bambu-green`:`bg-gray-500`}`}),(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`p`,{className:`text-white text-sm font-medium truncate`,children:e.name}),(0,w.jsx)(`p`,{className:`text-xs text-bambu-gray`,children:e.model||l(`printers.status.unknown`)})]})]}),(0,w.jsxs)(`div`,{className:`flex items-center gap-2 flex-shrink-0`,children:[(0,w.jsx)(`span`,{className:`text-xs px-2 py-1 rounded-full ${p}`,children:f}),r&&(0,w.jsx)(v,{variant:`ghost`,size:`sm`,onClick:s,disabled:a,className:`text-bambu-gray hover:text-bambu-green hover:bg-bambu-green/10`,title:l(`printers.locations.move`),"aria-label":l(`printers.locations.move`),children:(0,w.jsx)(ee,{className:`w-3.5 h-3.5`})}),r&&c&&(0,w.jsx)(v,{variant:`ghost`,size:`sm`,onClick:c,disabled:a,className:`text-bambu-gray hover:text-red-400 hover:bg-red-500/10`,title:l(`printers.locations.removeFromLocation`),"aria-label":l(`printers.locations.removeFromLocation`),children:(0,w.jsx)(S,{className:`w-3.5 h-3.5`})})]})]})}function ve({initial:e,saving:t,onSave:n,onCancel:r}){let{t:a}=i(),[o,s]=(0,C.useState)(e?.name??``),[c,l]=(0,C.useState)(e?.icon??``),[u,d]=(0,C.useState)(e?.color??``),f=o.trim().length>0&&!t,p=()=>f&&n({name:o.trim(),icon:c,color:u});return(0,w.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4`,children:(0,w.jsx)(_,{className:`w-full max-w-md`,children:(0,w.jsxs)(g,{className:`space-y-4`,children:[(0,w.jsx)(`h2`,{className:`text-lg font-semibold text-white`,children:a(e?`printers.locations.editTitle`:`printers.locations.createTitle`)}),(0,w.jsx)(`input`,{type:`text`,value:o,maxLength:le,onChange:e=>s(e.target.value),placeholder:a(`printers.locations.namePlaceholder`),"aria-label":a(`printers.locations.namePlaceholder`),className:`w-full px-4 py-2 text-sm bg-bambu-dark-secondary border border-bambu-dark-tertiary rounded-lg text-white placeholder-bambu-gray focus:outline-none focus:ring-2 focus:ring-bambu-green/50 focus:border-bambu-green transition-colors`,autoFocus:!0,onKeyDown:e=>{e.key===`Enter`&&p(),e.key===`Escape`&&r()}}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-sm text-bambu-gray mb-2`,children:a(`printers.locations.icon`)}),(0,w.jsx)(x,{value:c,onChange:l})]}),(0,w.jsxs)(`div`,{children:[(0,w.jsx)(`p`,{className:`text-sm text-bambu-gray mb-2`,children:a(`printers.locations.color`)}),(0,w.jsxs)(`div`,{className:`flex gap-2 flex-wrap`,children:[T.map(e=>(0,w.jsx)(`button`,{type:`button`,onClick:()=>d(u===e?``:e),className:`w-8 h-8 rounded-lg transition-all ${u===e?`ring-2 ring-white ring-offset-2 ring-offset-bambu-dark-secondary scale-110`:`hover:scale-105`}`,style:{backgroundColor:e},title:e,"aria-label":e,"aria-pressed":u===e},e)),u&&(0,w.jsx)(`button`,{type:`button`,onClick:()=>d(``),className:`w-8 h-8 rounded-lg border-2 border-bambu-dark-tertiary bg-bambu-dark-secondary text-bambu-gray hover:text-white hover:border-bambu-gray transition-all flex items-center justify-center`,title:a(`printers.locations.noColor`),"aria-label":a(`printers.locations.noColor`),children:(0,w.jsx)(h,{className:`w-3.5 h-3.5`})})]})]}),(0,w.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,w.jsx)(v,{variant:`secondary`,onClick:r,disabled:t,children:a(`common.cancel`)}),(0,w.jsx)(v,{onClick:p,disabled:!f,children:t?(0,w.jsx)(m,{className:`w-4 h-4 animate-spin`}):a(e?`common.save`:`printers.locations.create`)})]})]})})})}var E=`__none__`;function ye({count:e,printerName:t,locations:n,saving:r,onMove:a,onCancel:o}){let{t:s}=i(),[c,l]=(0,C.useState)(``);return(0,w.jsx)(`div`,{className:`fixed inset-0 bg-black/50 flex items-center justify-center z-50 p-4`,children:(0,w.jsx)(_,{className:`w-full max-w-md`,children:(0,w.jsxs)(g,{className:`space-y-4`,children:[(0,w.jsx)(`h2`,{className:`text-lg font-semibold text-white`,children:e===1?s(`printers.locations.moveTitle`):s(`printers.locations.moveTitleMany`,{count:e})}),t&&(0,w.jsx)(`p`,{className:`text-sm text-bambu-gray`,children:t}),(0,w.jsxs)(`select`,{value:c,onChange:e=>l(e.target.value),"aria-label":s(`printers.locations.targetPlaceholder`),className:`w-full px-4 py-2 text-sm bg-bambu-dark-secondary border border-bambu-dark-tertiary rounded-lg text-white focus:outline-none focus:ring-2 focus:ring-bambu-green/50 focus:border-bambu-green transition-colors`,disabled:r,autoFocus:!0,children:[(0,w.jsx)(`option`,{value:``,disabled:!0,children:s(`printers.locations.targetPlaceholder`)}),n.map(e=>(0,w.jsx)(`option`,{value:e.name,children:e.name},e.name)),(0,w.jsx)(`option`,{value:E,children:s(`printers.locations.noLocation`)})]}),(0,w.jsxs)(`div`,{className:`flex gap-2 justify-end`,children:[(0,w.jsx)(v,{variant:`secondary`,onClick:o,disabled:r,children:s(`common.cancel`)}),(0,w.jsx)(v,{onClick:()=>a(c===E?null:c),disabled:r||!c,children:r?(0,w.jsx)(m,{className:`w-4 h-4 animate-spin`}):s(`printers.locations.moveButton`)})]})]})})})}function D(){let e=a(),{t}=i(),{showToast:n}=p(),{hasPermission:l}=ce(),h=l(`printers:update`),[x,se]=(0,C.useState)(``),[S,le]=(0,C.useState)(()=>pe(de,[`true`,`false`],`false`)===`true`),[T,E]=(0,C.useState)(()=>pe(fe,ue,`name-asc`)),[D,O]=(0,C.useState)(!1),[k,A]=(0,C.useState)(null),[j,M]=(0,C.useState)(!1),[N,P]=(0,C.useState)(new Set),[F,I]=(0,C.useState)(new Set),[L,R]=(0,C.useState)(null),[z,B]=(0,C.useState)(null),[V,H]=(0,C.useState)(null);(0,C.useEffect)(()=>me(de,String(S)),[S]),(0,C.useEffect)(()=>me(fe,T),[T]),(0,C.useEffect)(()=>{j&&A(null)},[j]);let{data:U,isLoading:be}=o({queryKey:[`printers`],queryFn:r.getPrinters}),{data:W,isLoading:xe}=o({queryKey:[`printer-locations`],queryFn:r.getPrinterLocations}),Se=c({queries:(U??[]).map(e=>({queryKey:[`printerStatus`,e.id],queryFn:()=>r.getPrinterStatus(e.id),refetchInterval:3e4}))}),Ce=new Map((U??[]).map((e,t)=>[e.id,Se[t]?.data])),G=(0,C.useMemo)(()=>{let e=new Map;for(let t of U??[]){let n=he(t);e.set(n,[...e.get(n)??[],t])}return e},[U]),K=G.get(``)??[],we=(U?.length??0)-K.length,Te=(0,C.useMemo)(()=>{let e=x.trim().toLowerCase(),t=(W??[]).filter(t=>(!e||t.name.toLowerCase().includes(e))&&(!S||t.printer_count>0)),n=(e,t)=>e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:`base`});return[...t].sort((e,t)=>{switch(T){case`name-desc`:return n(t,e);case`count-asc`:return e.printer_count-t.printer_count||n(e,t);case`count-desc`:return t.printer_count-e.printer_count||n(e,t);default:return n(e,t)}})},[W,x,S,T]),q=()=>{e.invalidateQueries({queryKey:[`printer-locations`]}),e.invalidateQueries({queryKey:[`printers`]})},J=e=>n(t(`printers.locations.failed`,{error:e instanceof Error?e.message:String(e)}),`error`),Y=s({mutationFn:({value:e,location:t})=>t?r.updatePrinterLocation({name:t.name,...e.name===t.name?{}:{new_name:e.name},icon:e.icon||null,color:e.color||null}):r.createPrinterLocation({name:e.name,icon:e.icon||null,color:e.color||null}),onSuccess:(e,{location:r})=>{q(),r&&k===r.name&&A(e.name),n(t(r?`printers.locations.saved`:`printers.locations.created`)),R(null)},onError:J}),X=s({mutationFn:({ids:e,location:t})=>r.assignPrinterLocation(e,t),onSuccess:({moved:e})=>{q(),n(t(`printers.locations.moved`,{count:e})),I(new Set),B(null)},onError:J}),Z=s({mutationFn:e=>r.deletePrinterLocations(e),onSuccess:({deleted:e})=>{q(),n(t(`printers.locations.deleted`,{count:e})),P(new Set),M(!1),H(null)},onError:e=>{J(e),H(null)}}),Q=X.isPending||Z.isPending||Y.isPending,Ee=(e,t)=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n};if(be||xe)return(0,w.jsx)(`div`,{className:`flex items-center justify-center h-64`,children:(0,w.jsx)(m,{className:`w-8 h-8 text-bambu-green animate-spin`})});let De=(V??[]).reduce((e,t)=>e+(W?.find(e=>e.name===t)?.printer_count??0),0),Oe=e=>({"name-asc":t(`printers.locations.sortNameAsc`),"name-desc":t(`printers.locations.sortNameDesc`),"count-asc":t(`printers.locations.sortCountAsc`),"count-desc":t(`printers.locations.sortCountDesc`)})[e],ke=(e,t)=>(0,w.jsx)(_e,{printer:e,status:Ce.get(e.id),selected:F.has(e.id),canEdit:h&&!j,busy:Q,onToggle:()=>I(Ee(F,e.id)),onMove:()=>B({ids:[e.id],printerName:e.name}),onRemove:t?()=>X.mutate({ids:[e.id],location:null}):void 0},e.id),$=K.length>0&&K.every(e=>F.has(e.id));return(0,w.jsxs)(`div`,{className:`p-4 md:p-8 pb-28`,children:[(0,w.jsxs)(ie,{to:`/`,className:`inline-flex items-center gap-1 mb-3 text-sm text-bambu-gray hover:text-white transition-colors`,children:[(0,w.jsx)(u,{className:`w-4 h-4`}),` `,t(`printers.locations.backToPrinters`)]}),(0,w.jsxs)(`div`,{className:`mb-4`,children:[(0,w.jsxs)(`div`,{className:`flex items-center gap-3 mb-1`,children:[(0,w.jsx)(d,{className:`w-[25px] h-[25px] text-bambu-green`}),(0,w.jsx)(`h1`,{className:`text-2xl font-bold text-white`,children:t(`printers.locations.title`)})]}),(0,w.jsx)(`p`,{className:`text-sm text-bambu-gray`,children:t(`printers.locations.subtitle`,{grouped:we,ungrouped:K.length})})]}),(0,w.jsxs)(`div`,{className:`flex flex-wrap gap-3 mb-6`,children:[(0,w.jsxs)(`div`,{className:`relative flex-1 min-w-[12rem]`,children:[(0,w.jsx)(te,{className:`w-4 h-4 absolute left-3 top-1/2 -translate-y-1/2 text-bambu-gray`}),(0,w.jsx)(`input`,{type:`text`,value:x,onChange:e=>se(e.target.value),placeholder:t(`printers.locations.search`),"aria-label":t(`printers.locations.search`),className:`w-full pl-9 pr-4 py-2 text-sm bg-bambu-dark-secondary border border-bambu-dark-tertiary rounded-lg text-white placeholder-bambu-gray focus:outline-none focus:ring-2 focus:ring-bambu-green/50 focus:border-bambu-green transition-colors`})]}),(0,w.jsx)(v,{onClick:()=>le(!S),variant:S?`primary`:`secondary`,children:t(S?`printers.locations.showEmpty`:`printers.locations.hideEmpty`)}),h&&(0,w.jsxs)(v,{onClick:()=>{P(new Set),M(!j)},variant:j?`primary`:`secondary`,children:[(0,w.jsx)(b,{className:`w-4 h-4 mr-1`}),t(j?`printers.locations.done`:`printers.locations.select`)]}),(0,w.jsxs)(`div`,{className:`relative`,children:[(0,w.jsxs)(v,{onClick:()=>O(!D),variant:`secondary`,"aria-haspopup":`menu`,children:[(0,w.jsx)(f,{className:`w-4 h-4 mr-1 transition-transform ${D?`rotate-180`:``}`}),Oe(T)]}),D&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(`div`,{className:`fixed inset-0 z-40`,onClick:()=>O(!1)}),(0,w.jsx)(`div`,{role:`menu`,className:`absolute right-0 top-full mt-1 z-50 bg-bambu-dark-secondary border border-bambu-dark-tertiary rounded-lg shadow-lg p-1 min-w-[10rem]`,children:ue.map(e=>(0,w.jsx)(`button`,{role:`menuitem`,onClick:()=>{E(e),O(!1)},className:`w-full text-left px-3 py-2 text-sm rounded transition-colors ${T===e?`bg-bambu-green text-white`:`text-bambu-gray hover:bg-bambu-dark-tertiary hover:text-white`}`,children:Oe(e)},e))})]})]}),h&&(0,w.jsxs)(v,{onClick:()=>R({mode:`create`}),children:[(0,w.jsx)(ae,{className:`w-4 h-4 mr-1`}),t(`printers.locations.create`)]})]}),Te.length===0&&K.length===0?(0,w.jsx)(_,{children:(0,w.jsx)(g,{className:`text-center py-12 text-bambu-gray`,children:t(x?`printers.locations.noResults`:`printers.locations.none`)})}):(0,w.jsxs)(`div`,{className:`space-y-3`,children:[Te.map(e=>{let n=k===e.name,r=N.has(e.name);return(0,w.jsx)(_,{children:(0,w.jsxs)(g,{className:`p-4`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,w.jsxs)(`button`,{type:`button`,onClick:()=>j?P(Ee(N,e.name)):A(n?null:e.name),className:`flex items-center gap-3 flex-1 min-w-0 text-left`,"aria-expanded":j?void 0:n,"aria-pressed":j?r:void 0,children:[j?r?(0,w.jsx)(b,{className:`w-4 h-4 text-bambu-green flex-shrink-0`}):(0,w.jsx)(y,{className:`w-4 h-4 text-bambu-gray flex-shrink-0`}):(0,w.jsx)(f,{className:`w-4 h-4 text-bambu-gray flex-shrink-0 transition-transform ${n?`rotate-180`:``}`}),(0,w.jsx)(ge,{location:e}),(0,w.jsxs)(`div`,{className:`min-w-0`,children:[(0,w.jsx)(`p`,{className:`text-white font-medium truncate`,children:e.name}),(0,w.jsx)(`p`,{className:`text-sm text-bambu-gray`,children:t(`printers.locations.printerCount`,{count:e.printer_count})})]})]}),h&&!j&&(0,w.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,w.jsx)(v,{variant:`ghost`,size:`sm`,onClick:()=>R({mode:`edit`,location:e}),disabled:Q,className:`text-bambu-gray hover:text-blue-400 hover:bg-blue-500/10`,title:t(`common.edit`),"aria-label":t(`common.edit`),children:(0,w.jsx)(ne,{className:`w-4 h-4`})}),(0,w.jsx)(v,{variant:`ghost`,size:`sm`,onClick:()=>H([e.name]),disabled:Q,className:`text-red-500 hover:text-red-400 hover:bg-red-500/10`,title:t(`common.delete`),"aria-label":t(`common.delete`),children:(0,w.jsx)(re,{className:`w-4 h-4`})})]})]}),n&&(0,w.jsx)(`div`,{className:`border-t border-bambu-dark-tertiary pt-3 mt-3 space-y-2`,children:(G.get(e.name)??[]).length===0?(0,w.jsx)(`p`,{className:`text-sm text-bambu-gray text-center py-4`,children:t(`printers.locations.noPrinters`)}):(G.get(e.name)??[]).map(e=>ke(e,!0))})]})},e.name)}),K.length>0&&(0,w.jsxs)(`div`,{className:`pt-4 border-t border-bambu-dark-tertiary`,children:[(0,w.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,w.jsx)(`h3`,{className:`text-sm font-medium text-bambu-gray`,children:t(`printers.locations.ungroupedPrinters`,{count:K.length})}),h&&!j&&(0,w.jsx)(`button`,{type:`button`,onClick:()=>{let e=new Set(F);K.forEach(t=>$?e.delete(t.id):e.add(t.id)),I(e)},className:`text-xs text-bambu-green hover:text-bambu-green-light transition-colors`,children:t($?`common.deselectAll`:`common.selectAll`)})]}),(0,w.jsx)(`div`,{className:`space-y-2`,children:K.map(e=>ke(e,!1))})]})]}),h&&!j&&F.size>0&&(0,w.jsxs)(`div`,{className:`fixed bottom-6 left-1/2 -translate-x-1/2 bg-bambu-dark border border-bambu-dark-tertiary rounded-xl shadow-2xl px-6 py-4 flex items-center gap-4 z-40`,children:[(0,w.jsx)(`span`,{className:`text-white text-sm`,children:t(`printers.locations.selected`,{count:F.size})}),(0,w.jsxs)(v,{onClick:()=>B({ids:Array.from(F)}),disabled:Q,children:[(0,w.jsx)(ee,{className:`w-4 h-4 mr-1`}),t(`printers.locations.moveButton`)]}),(0,w.jsx)(v,{variant:`ghost`,onClick:()=>I(new Set),disabled:Q,children:t(`common.cancel`)})]}),j&&N.size>0&&(0,w.jsxs)(`div`,{className:`fixed bottom-6 left-1/2 -translate-x-1/2 bg-bambu-dark border border-bambu-dark-tertiary rounded-xl shadow-2xl px-6 py-4 flex items-center gap-4 z-40`,children:[(0,w.jsx)(`span`,{className:`text-white text-sm`,children:t(`printers.locations.selected`,{count:N.size})}),(0,w.jsxs)(v,{variant:`danger`,onClick:()=>H(Array.from(N)),disabled:Q,children:[(0,w.jsx)(re,{className:`w-4 h-4 mr-1`}),t(`printers.locations.deleteSelected`)]}),(0,w.jsx)(v,{variant:`ghost`,onClick:()=>P(new Set),disabled:Q,children:t(`common.cancel`)})]}),L&&(0,w.jsx)(ve,{initial:L.mode===`edit`?L.location:void 0,saving:Y.isPending,onSave:e=>Y.mutate({value:e,location:L.mode===`edit`?L.location:void 0}),onCancel:()=>R(null)}),z&&(0,w.jsx)(ye,{count:z.ids.length,printerName:z.printerName,locations:W??[],saving:X.isPending,onMove:e=>X.mutate({ids:z.ids,location:e}),onCancel:()=>B(null)}),V&&(0,w.jsx)(oe,{title:V.length===1?t(`printers.locations.deleteTitle`):t(`printers.locations.deleteTitleMany`,{count:V.length}),message:t(`printers.locations.deleteMessage`,{count:De,names:V.join(`, `)}),confirmText:t(`common.delete`),variant:`danger`,isLoading:Z.isPending,onConfirm:()=>Z.mutate(V),onCancel:()=>H(null)})]})}export{D as PrinterLocationsPage};