import{c as Q,r as W,a as ee,N as te,u as se,bX as le,b as ne,bM as ae,j as l,T as G,a1 as ie,am as Z,bY as L,bZ as oe,b_ as ce,Z as V,V as re,b$ as de,B as X,c0 as ue,$ as pe}from"./index-BSsexBJO.js";const he=Y=>{var z;const e=Q.c(59),{applyChangeOwner:A,closeOwnedModal:n,event:t}=Y;let O;e[0]===Symbol.for("react.memo_cache_sentinel")?(O={Id:0},e[0]=O):O=e[0];const[a,$]=W.useState(O),T=ee(),{t:s,i18n:i}=te(),{isMobile:q}=se(),E=le(t.resource),M=ne(ae),{start:B,end:P}=t;let _;e[1]===Symbol.for("react.memo_cache_sentinel")?(_=K=>{$({Id:K.userId})},e[1]=_):_=e[1];const H=_;let y;e[2]!==A||e[3]!==T||e[4]!==t.id||e[5]!==a.Id?(y=()=>{A(),T(oe({eventId:Number(t.id),userId:Number(a.Id)})),T(ce())},e[2]=A,e[3]=T,e[4]=t.id,e[5]=a.Id,e[6]=y):y=e[6];const D=y;let k;e[7]===Symbol.for("react.memo_cache_sentinel")?(k=()=>{$({Id:0})},e[7]=k):k=e[7];const J=k,F=!q;let o;e[8]!==s?(o=s("eventOptions.changeOwner"),e[8]=s,e[9]=o):o=e[9];const R=((z=t.title)==null?void 0:z.length)<59;let C,S;e[10]===Symbol.for("react.memo_cache_sentinel")?(C={duration:200},S={tooltip:{whiteSpace:"pre-wrap",wordBreak:"break-word"}},e[10]=C,e[11]=S):(C=e[10],S=e[11]);let c;e[12]!==t.title?(c=l.jsx(G,{truncate:!0,fz:16,children:t.title}),e[12]=t.title,e[13]=c):c=e[13];let r;e[14]!==t.title||e[15]!==c||e[16]!==R?(r=l.jsx(ie,{label:t.title,position:"top",multiline:!0,disabled:R,maw:500,withArrow:!0,transitionProps:C,styles:S,children:c}),e[14]=t.title,e[15]=c,e[16]=R,e[17]=r):r=e[17];let d;e[18]!==i.language||e[19]!==B?(d=Z(B,L,!1,i.language),e[18]=i.language,e[19]=B,e[20]=d):d=e[20];let u;e[21]!==P||e[22]!==i.language?(u=Z(P,L,!1,i.language),e[21]=P,e[22]=i.language,e[23]=u):u=e[23];let p;e[24]!==d||e[25]!==u?(p=l.jsx(V,{gap:"xs",children:l.jsxs(G,{fz:15,c:"gray.5",children:[d," -"," ",u]})}),e[24]=d,e[25]=u,e[26]=p):p=e[26];let f;e[27]!==r||e[28]!==p?(f=l.jsxs(re,{mb:20,children:[r,p]}),e[27]=r,e[28]=p,e[29]=f):f=e[29];let h;e[30]!==s?(h=s("placeholders.newOwner"),e[30]=s,e[31]=h):h=e[31];let m;e[32]!==E||e[33]!==h?(m=l.jsx(de,{accessType:E,handlePickContact:H,resetContact:J,placeholder:h,isFillInputOnPick:!0}),e[32]=E,e[33]=h,e[34]=m):m=e[34];const U=!!a.Id;let g;e[35]!==s?(g=s("buttons.cancel"),e[35]=s,e[36]=g):g=e[36];let b;e[37]!==n||e[38]!==g?(b=l.jsx(X,{variant:"outline",onClick:n,children:g}),e[37]=n,e[38]=g,e[39]=b):b=e[39];const N=!a.Id||a.Id===(M==null?void 0:M.Id);let x;e[40]!==s?(x=s("eventOptions.changeOwner"),e[40]=s,e[41]=x):x=e[41];let w;e[42]!==D||e[43]!==N||e[44]!==x?(w=l.jsx(X,{"data-autofocus":!0,onClick:D,disabled:N,children:x}),e[42]=D,e[43]=N,e[44]=x,e[45]=w):w=e[45];let I;e[46]!==b||e[47]!==w?(I=l.jsxs(V,{justify:"flex-end",mt:"lg",gap:10,children:[b,w]}),e[46]=b,e[47]=w,e[48]=I):I=e[48];let j;e[49]!==U||e[50]!==I?(j=l.jsx(ue,{opened:U,children:I}),e[49]=U,e[50]=I,e[51]=j):j=e[51];let v;return e[52]!==n||e[53]!==f||e[54]!==m||e[55]!==j||e[56]!==F||e[57]!==o?(v=l.jsxs(pe,{centered:F,opened:!0,onClose:n,title:o,children:[f,m,j]}),e[52]=n,e[53]=f,e[54]=m,e[55]=j,e[56]=F,e[57]=o,e[58]=v):v=e[58],v};export{he as default};
