1import{d as j,H as J,o as i,f as g,g as r,h as a,e as s,Y as z,x as b,j as t,z as I,m,A as V,l as v,V as W,i as x,T as N,ab as A,ad as E,au as R,t as w,C as h,n as Y,bk as D,O as F,S as G,r as k,c as H,cy as L,E as M}from"./index63916.js";import{r as O}from"./FolderIcon63916.js";const q={class:"fixed inset-0 z-10 overflow-y-auto"},K={class:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"},P={key:0,class:"absolute right-0 top-0 hidden pr-4 pt-4 sm:block"},Q={class:"text-center sm:mt-2"},U={class:"space-y-4 py-8"},X={class:"mt-1 max-h-40 divide-y overflow-y-auto rounded-md bg-gray-100 shadow-inner"},Z={class:"flex-0 mr-3"},ee={class:"flex-1 truncate pr-4"},te={class:"text-sm font-medium text-gray-900"},se={class:"truncate text-xs text-gray-500"},oe=["onClick"],ae={class:"sm:grid sm:grid-flow-row-dense sm:grid-cols-2 sm:gap-3"},ie=j({__name:"transferJobToWorkspaceModal.component",props:{open:{type:Boolean},closeIcon:{type:Boolean},persistent:{type:Boolean},selectedJobIds:{}},emits:["close","confirmAction"],setup(_,{emit:C}){const S=J(),d=_,c=C;let T=k(!1),n=k();const u=H(()=>l=>{var e;return((e=n.value)==null?void 0:e.id)===l.id}),B=async()=>{var l;try{(await L.transferJobsToWorkspace({workspaceId:(l=n.value)==null?void 0:l.id,jobIds:d.selectedJobIds})).data.success&&c("confirmAction")}catch(e){M.info(e)}};return(l,e)=>(i(),g(s(G),{as:"template",show:d.open},{default:r(()=>[a(s(z),{as:"div",class:"relative z-10",onClose:e[2]||(e[2]=o=>d.persistent?null:c("close"))},{default:r(()=>[a(s(b),{as:"template",enter:"ease-out duration-300","enter-from":"opacity-0","enter-to":"opacity-100",leave:"ease-in duration-200","leave-from":"opacity-100","leave-to":"opacity-0"},{default:r(()=>[...e[3]||(e[3]=[t("div",{class:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"},null,-1)])]),_:1}),t("div",q,[t("div",K,[a(s(b),{as:"template",enter:"ease-out duration-300","enter-from":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to":"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200","leave-from":"opacity-100 translate-y-0 sm:scale-100","leave-to":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:r(()=>[a(s(I),{class:"relative transform overflow-hidden rounded-lg bg-white px-4 pb-4 pt-5 text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-xl sm:p-6"},{default:r(()=>[d.closeIcon?(i(),m("div",P,[t("button",{type:"button",class:"rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none",onClick:e[0]||(e[0]=o=>c("close"))},[e[4]||(e[4]=t("span",{class:"sr-only"},"Close",-1)),a(s(V),{class:"h-6 w-6","aria-hidden":"true"})])])):v("",!0),t("div",null,[a(s(O),{class:"mx-auto h-10 w-10 text-gray-400","aria-hidden":"true"}),t("div",Q,[a(s(W),{as:"h3",class:"text-lg font-medium leading-6 text-gray-900"},{default:r(()=>[...e[5]||(e[5]=[x(" Transfer Job ",-1)])]),_:1}),e[6]||(e[6]=t("div",{class:"mt-2"},[t("p",{class:"text-sm text-gray-500"}," Stay organized by categorizing your jobs into specific workspaces. ")],-1))])]),t("div",U,[e[8]||(e[8]=t("div",null,[t("label",{for:"visibility",class:"block truncate text-sm font-medium tracking-wide text-gray-700"}," Choose Workspace "),t("p",{class:"text-sm text-gray-500"},"Select the workspace to transfer this job too.")],-1)),a(N,{name:"fade",mode:"out-in"},{default:r(()=>[t("div",null,[t("ul",X,[(i(!0),m(A,null,E(s(S).workspaces,(o,$)=>{var p,f,y;return i(),m("li",{key:$,class:"flex w-full items-center px-4 py-2"},[t("div",Z,[a(s(R),{url:void 0,initials:(p=o.workspace)==null?void 0:p.name,for:"avatar",height:"h-9",width:"w-9",borderWidth:"border-0",shadow:"shadow-md"},null,8,["initials"])]),t("div",ee,[t("h4",te,w((f=o.workspace)==null?void 0:f.name),1),t("p",se,w((y=o.workspace)==null?void 0:y.description),1)]),t("div",null,[t("button",{type:"button",class:Y([u.value(o.workspace)?"bg-blue-500":"bg-white hover:bg-gray-200","flex h-5 w-5 items-center justify-center rounded border border-gray-200 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2"]),onClick:ne=>u.value(o.workspace)?h(n)?n.value=void 0:n=void 0:h(n)?n.value=o.workspace:n=o.workspace},[e[7]||(e[7]=t("span",{class:"sr-only"},"Select",-1)),u.value(o.workspace)?(i(),g(s(D),{key:0,class:"h-4 w-4 text-white","aria-hidden":"true"})):v("",!0)],10,oe)])])}),128))])])]),_:1})]),t("div",ae,[a(s(F),{type:"button",class:"btn-primary sm:col-start-2",busy:s(T),loadingText:"Creating workspace...",onClick:()=>B()},{default:r(()=>[...e[9]||(e[9]=[x(" Transfer Job ",-1)])]),_:1},8,["busy","onClick"]),t("button",{type:"button",class:"mt-3 inline-flex w-full justify-center rounded-md border border-gray-300 bg-white px-4 py-2 text-base font-medium text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-pink-500 focus:ring-offset-2 sm:col-start-1 sm:mt-0 sm:text-sm",onClick:e[1]||(e[1]=o=>c("close")),ref:"cancelButtonRef"}
1," Cancel ",512)])]),_:1})]),_:1})])])]),_:1})]),_:1},8,["show"]))}});export{ie 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.