talkweb 3.50.39 → 3.50.41-snapshot.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/README.md +68 -51
  2. package/dist/assets/sounds/ringtone.mp3 +0 -0
  3. package/dist/assets/sounds/waitingTone.mp3 +0 -0
  4. package/dist/index.es.js +1 -1
  5. package/dist/index.umd.js +1 -1
  6. package/dist/js/{AddContact-geFB5uZu.js → AddContact-BUZaW62t.js} +1 -1
  7. package/dist/js/{HamburgerMenu-Dnty8L_J.js → HamburgerMenu-CD_oXKjE.js} +1 -1
  8. package/dist/js/{ImageEditorModal-BE-kPsJd.js → ImageEditorModal-C3AxlNH3.js} +1 -1
  9. package/dist/js/{LoadingDots-CSbpS1Hq.js → LoadingDots-BCHF8LdO.js} +1 -1
  10. package/dist/js/{SearchContactBox-DCxa7Tq6.js → SearchContactBox-BiSVlLzI.js} +1 -1
  11. package/dist/js/{StartCall-BAc3hBgQ.js → StartCall-CcQ5P7hM.js} +1 -1
  12. package/dist/js/{TypingView-Cwu2sFsn.js → TypingView-CC7bSaPG.js} +1 -1
  13. package/dist/js/{boredGif-Bu2KwA3Z.js → boredGif-CpIevNTo.js} +1 -1
  14. package/dist/js/{index-CdrvmdU9.js → index-B12mfnzO.js} +1 -1
  15. package/dist/js/{index-tunuUxJO.js → index-Bsx5zvm7.js} +6 -6
  16. package/dist/js/{index-BartosUC.js → index-CIPRe_IQ.js} +10 -10
  17. package/dist/js/{index-Cb9BgC6O.js → index-CQdtLR2k.js} +1 -1
  18. package/dist/js/{index-EIjPjN5k.js → index-Dmr1r_ie.js} +2 -2
  19. package/dist/js/{index-vkicj3Qw.js → index-UH8FQi7b.js} +1 -1
  20. package/dist/js/{index-BQxCMtTe.js → index-trXsI3W8.js} +1 -1
  21. package/dist/js/{main-BiSoVrq9.js → main-zRgi4xWO.js} +2 -2
  22. package/dist/js/{mic-Zn5tfKRn.js → mic-kKnADQki.js} +1 -1
  23. package/dist/js/{unescapeHtml-Cw65I-c4.js → unescapeHtml-DLzkPRj4.js} +1 -1
  24. package/dist/js/{useContactThread-DFlOxXGB.js → useContactThread-DHLgloYG.js} +1 -1
  25. package/dist/js/{useCopyToClipboard-CBpknd-Y.js → useCopyToClipboard-YimoFCPU.js} +1 -1
  26. package/dist/talkweb.css +1 -1
  27. package/package.json +3 -1
@@ -1,4 +1,4 @@
1
- import*as e from"react";import{ap as r,j as o,aq as n,dO as a,ar as d,at as t,cU as p}from"./main-BiSoVrq9.js";import{j as s,k as i,l as u,P as l,m as w,n as c,v as f,G as g,o as m,q as x,r as h,s as D,t as v,S as M,w as _,x as y}from"./LoadingDots-CSbpS1Hq.js";var b="DropdownMenu",[j]=n(b,[s]),R=s(),[N,I]=j(b),C=n=>{const{__scopeDropdownMenu:d,children:t,dir:p,open:s,defaultOpen:u,onOpenChange:l,modal:w=!0}=n,c=R(d),f=e.useRef(null),[g,m]=r({prop:s,defaultProp:u??!1,onChange:l,caller:b});/* @__PURE__ */
1
+ import*as e from"react";import{ap as r,j as o,aq as n,dO as a,ar as d,at as t,cU as p}from"./main-zRgi4xWO.js";import{j as s,k as i,l as u,P as l,m as w,n as c,v as f,G as g,o as m,q as x,r as h,s as D,t as v,S as M,w as _,x as y}from"./LoadingDots-BCHF8LdO.js";var b="DropdownMenu",[j]=n(b,[s]),R=s(),[N,I]=j(b),C=n=>{const{__scopeDropdownMenu:d,children:t,dir:p,open:s,defaultOpen:u,onOpenChange:l,modal:w=!0}=n,c=R(d),f=e.useRef(null),[g,m]=r({prop:s,defaultProp:u??!1,onChange:l,caller:b});/* @__PURE__ */
2
2
  return o.jsx(N,{scope:d,triggerId:a(),triggerRef:f,contentId:a(),open:g,onOpenChange:m,onOpenToggle:e.useCallback(()=>m(e=>!e),[m]),modal:w,children:/* @__PURE__ */o.jsx(i,{...c,open:g,onOpenChange:m,dir:p,modal:w,children:t})})};C.displayName=b;var O="DropdownMenuTrigger",k=e.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,disabled:a=!1,...s}=e,i=I(O,n),l=R(n);/* @__PURE__ */
3
3
  return o.jsx(u,{asChild:!0,...l,children:/* @__PURE__ */o.jsx(d.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":a?"":void 0,disabled:a,...s,ref:p(r,i.triggerRef),onPointerDown:t(e.onPointerDown,e=>{a||0!==e.button||!1!==e.ctrlKey||(i.onOpenToggle(),i.open||e.preventDefault())}),onKeyDown:t(e.onKeyDown,e=>{a||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});k.displayName=O;var A=e=>{const{__scopeDropdownMenu:r,...n}=e,a=R(r);/* @__PURE__ */
4
4
  return o.jsx(l,{...a,...n})};A.displayName="DropdownMenuPortal";var P="DropdownMenuContent",T=e.forwardRef((r,n)=>{const{__scopeDropdownMenu:a,...d}=r,p=I(P,a),s=R(a),i=e.useRef(!1);/* @__PURE__ */
@@ -1,4 +1,4 @@
1
- import{e,H as t,g as s,Y as a,j as n,C as i,dP as l,q as r,x as c,l as d,Z as o,dQ as x,dR as h,dS as m,dT as p,b$ as u,dU as j,_ as f,a0 as g,a3 as v,c0 as N,dV as b,I as y,cD as w,dW as C,dX as I,ad as k,dY as S,dZ as P,d_ as T,d$ as O,k as B,e0 as D,p as L,e1 as F,cB as E,cf as W,e2 as R,e3 as _,e4 as M,e5 as U,e6 as G,bL as z,e7 as A,e8 as H,c3 as $,e9 as q,ea as V,eb as Z,bc as Q,ec as X,ed as Y,ee as K,aA as J,cC as ee,aE as te,o as se,ef as ae,eg as ne,by as ie,eh as le,b4 as re,ei as ce,ej as de,ek as oe,b2 as xe,W as he,el as me,em as pe,en as ue,eo as je,v as fe,ep as ge,al as ve,eq as Ne,er as be,cR as ye,cS as we,es as Ce,et as Ie,eu as ke,ev as Se,ew as Pe,ex as Te,cg as Oe,ey as Be,ez as De,eA as Le,eB as Fe,eC as Ee,cG as We,eD as Re,bP as _e,aj as Me}from"./main-BiSoVrq9.js";import Ue,{memo as Ge,useRef as ze,useEffect as Ae,useState as He,useLayoutEffect as $e,useMemo as qe,useCallback as Ve}from"react";import{g as Ze,a as Qe,u as Xe,$ as Ye,d as Ke,p as Je,e as et,D as tt,C as st,b as at,c as nt}from"./useContactThread-DFlOxXGB.js";import{S as it,C as lt}from"./SearchContactBox-DCxa7Tq6.js";import{A as rt,Z as ct,p as dt,f as ot,L as xt,Y as ht,u as mt,_ as pt}from"./LoadingDots-CSbpS1Hq.js";import{C as ut,u as jt}from"./unescapeHtml-Cw65I-c4.js";import{o as ft,C as gt,D as vt,Z as Nt,q as bt,L as yt,c as wt,h as Ct,r as It,F as kt,d as St,s as Pt,e as Tt,S as Ot}from"./StartCall-BAc3hBgQ.js";import{u as Bt}from"./useCopyToClipboard-CBpknd-Y.js";import{R as Dt,T as Lt,P as Ft,C as Et,I as Wt}from"./index-CdrvmdU9.js";import{A as Rt}from"./AddContact-geFB5uZu.js";import{u as _t}from"./useBreakpoint-C4Ybxj8D.js";import{A as Mt}from"./index-vkicj3Qw.js";import{I as Ut}from"./ImageEditorModal-BE-kPsJd.js";const Gt=({title:c,onClose:d,showEdit:o,viewMode:x})=>{const h=e(),{isMobile:m}=t(),{thread:p}=s(e=>e.threads),u=Ze(p).includes(a.P2P);/* @__PURE__ */
1
+ import{e,H as t,g as s,Y as a,j as n,C as i,dP as l,q as r,x as c,l as d,Z as o,dQ as x,dR as h,dS as m,dT as p,b$ as u,dU as j,_ as f,a0 as g,a3 as v,c0 as N,dV as b,I as y,cD as w,dW as C,dX as I,ad as k,dY as S,dZ as P,d_ as T,d$ as O,k as B,e0 as D,p as L,e1 as F,cB as E,cf as W,e2 as R,e3 as _,e4 as M,e5 as U,e6 as G,bL as z,e7 as A,e8 as H,c3 as $,e9 as q,ea as V,eb as Z,bc as Q,ec as X,ed as Y,ee as K,aA as J,cC as ee,aE as te,o as se,ef as ae,eg as ne,by as ie,eh as le,b4 as re,ei as ce,ej as de,ek as oe,b2 as xe,W as he,el as me,em as pe,en as ue,eo as je,v as fe,ep as ge,al as ve,eq as Ne,er as be,cR as ye,cS as we,es as Ce,et as Ie,eu as ke,ev as Se,ew as Pe,ex as Te,cg as Oe,ey as Be,ez as De,eA as Le,eB as Fe,eC as Ee,cG as We,eD as Re,bP as _e,aj as Me}from"./main-zRgi4xWO.js";import Ue,{memo as Ge,useRef as ze,useEffect as Ae,useState as He,useLayoutEffect as $e,useMemo as qe,useCallback as Ve}from"react";import{g as Ze,a as Qe,u as Xe,$ as Ye,d as Ke,p as Je,e as et,D as tt,C as st,b as at,c as nt}from"./useContactThread-DHLgloYG.js";import{S as it,C as lt}from"./SearchContactBox-BiSVlLzI.js";import{A as rt,Z as ct,p as dt,f as ot,L as xt,Y as ht,u as mt,_ as pt}from"./LoadingDots-BCHF8LdO.js";import{C as ut,u as jt}from"./unescapeHtml-DLzkPRj4.js";import{o as ft,C as gt,D as vt,Z as Nt,q as bt,L as yt,c as wt,h as Ct,r as It,F as kt,d as St,s as Pt,e as Tt,S as Ot}from"./StartCall-CcQ5P7hM.js";import{u as Bt}from"./useCopyToClipboard-YimoFCPU.js";import{R as Dt,T as Lt,P as Ft,C as Et,I as Wt}from"./index-B12mfnzO.js";import{A as Rt}from"./AddContact-BUZaW62t.js";import{u as _t}from"./useBreakpoint-C4Ybxj8D.js";import{A as Mt}from"./index-UH8FQi7b.js";import{I as Ut}from"./ImageEditorModal-C3AxlNH3.js";const Gt=({title:c,onClose:d,showEdit:o,viewMode:x})=>{const h=e(),{isMobile:m}=t(),{thread:p}=s(e=>e.threads),u=Ze(p).includes(a.P2P);/* @__PURE__ */
2
2
  return n.jsxs("div",{className:"flex flex-col",children:[
3
3
  /* @__PURE__ */n.jsxs("div",{className:"py-5 px-5 border-b bg-bgColor border-borderHead h-[60px] flex justify-between items-center",children:[
4
4
  /* @__PURE__ */n.jsxs("div",{className:"flex items-center gap-4",children:[
@@ -23,12 +23,12 @@ return n.jsxs("div",{className:"p-4 flex items-center justify-center w-full flex
23
23
  /* @__PURE__ */n.jsx(rt,{onClick:()=>{e?.image&&s(!0)},size:"lg",firstName:i,image:e?.image,inbox:e?.type===f.SELF})]}),
24
24
  /* @__PURE__ */n.jsxs("div",{className:"text-invertBlackWhite mb-[10px] text-[14px] flex items-center",children:[
25
25
  /* @__PURE__ */n.jsxs("span",{className:"text-center",children:[" ",i]}),g(e)&&/* @__PURE__ */n.jsx("span",{children:v()})]}),
26
- /* @__PURE__ */n.jsx("div",{className:"text-accent text-xs ",children:c.lastSeen(N.prettifySince(e?.notSeenDuration))})]})},Vt=({thread:e})=>{const[t,s]=Ue.useState(!1),a=j(e?.image)?.replace("http://","https://"),i=ct(a,"ACTUAL_IMAGE_SIZE");if(e)/* @__PURE__ */
26
+ /* @__PURE__ */n.jsx("div",{className:"text-accent text-xs select-text ",children:c.lastSeen(N.prettifySince(e?.notSeenDuration))})]})},Vt=({thread:e})=>{const[t,s]=Ue.useState(!1),a=j(e?.image)?.replace("http://","https://"),i=ct(a,"ACTUAL_IMAGE_SIZE");if(e)/* @__PURE__ */
27
27
  return n.jsxs("div",{className:"flex items-center gap-3 px-4 py-[15px] bg-bgSpacer",children:[
28
28
  /* @__PURE__ */n.jsx($t,{open:t,onClose:()=>s(!1),slides:[{src:i||"",description:/* @__PURE__ */n.jsxs("span",{children:[dt(e?.title?.trim()+"",{parentClassName:"overflow-hidden text-ellipsis whitespace-nowrap"})," "]})}]}),
29
29
  /* @__PURE__ */n.jsx(rt,{onClick:()=>{e?.image&&s(!0)},size:"md",firstName:e?.title,image:e?.image,inbox:e?.type===f.SELF}),
30
30
  /* @__PURE__ */n.jsxs("div",{className:"font-bold text-sm text-text mb-[7px] whitespace-pre-line leading-1 truncate w-full max-w-[350px]",children:[dt(e?.title?.trim()+"",{parentClassName:"overflow-hidden text-ellipsis whitespace-nowrap"}),
31
- /* @__PURE__ */n.jsxs("div",{className:"text-xs py-1 text-secondary font-thin",children:[e?.participantCount," عضو"]})]})]})},Zt=()=>{const[t,a]=He(null),{copyText:i}=Bt(),l=e(),r=s(e=>e.threadParticipant.threadParticipants),c=s(e=>e.threads.thread),d=r.find(e=>e.id===c?.partner);return Ae(()=>{d?.contactId&&l(b(d.contactId)).unwrap().then(e=>{e.contacts[0]?.cellphoneNumber&&a(e?.contacts[0]?.cellphoneNumber)})},[l,d?.contactId]),t?/* @__PURE__ */n.jsxs(n.Fragment,{children:[
31
+ /* @__PURE__ */n.jsxs("div",{className:"text-xs py-1 text-secondary font-thin select-text",children:[e?.participantCount," عضو"]})]})]})},Zt=()=>{const[t,a]=He(null),{copyText:i}=Bt(),l=e(),r=s(e=>e.threadParticipant.threadParticipants),c=s(e=>e.threads.thread),d=r.find(e=>e.id===c?.partner);return Ae(()=>{d?.contactId&&l(b(d.contactId)).unwrap().then(e=>{e.contacts[0]?.cellphoneNumber&&a(e?.contacts[0]?.cellphoneNumber)})},[l,d?.contactId]),t?/* @__PURE__ */n.jsxs(n.Fragment,{children:[
32
32
  /* @__PURE__ */n.jsxs("div",{className:"p-2 cursor-pointer",onClick:()=>i(t,"شماره همراه مورد نظر کپی شد"),children:[
33
33
  /* @__PURE__ */n.jsx("div",{className:"text-xs mb-2 text-secondary",children:"شماره همراه"}),
34
34
  /* @__PURE__ */n.jsx("div",{className:"text-sm text-text whitespace-pre-line leading-7",children:t})]}),
@@ -36,15 +36,15 @@ return n.jsxs("div",{className:"flex items-center gap-3 px-4 py-[15px] bg-bgSpac
36
36
  return n.jsxs("div",{className:"bg-bgColor",children:[
37
37
  /* @__PURE__ */n.jsxs("div",{className:"p-2 cursor-pointer",onClick:()=>{i(t?.username||e?.title,"نام کاربری مورد نظر کپی شد")},children:[
38
38
  /* @__PURE__ */n.jsx("div",{className:"text-xs mb-2 text-secondary ",children:"نام کاربری"}),
39
- /* @__PURE__ */n.jsx("div",{className:"text-sm text-text",children:t?.username||e?.title})]}),
39
+ /* @__PURE__ */n.jsx("div",{className:"text-sm text-text select-text",children:t?.username||e?.title})]}),
40
40
  /* @__PURE__ */n.jsx(tt,{height:"h-[0.75px]"}),
41
41
  /* @__PURE__ */n.jsx(Zt,{}),t?.chatProfileVO?.bio?/* @__PURE__ */n.jsxs("div",{className:"p-2",children:[
42
42
  /* @__PURE__ */n.jsx("div",{className:"text-xs mb-2 text-secondary ",children:"درباره من"}),
43
- /* @__PURE__ */n.jsx("div",{className:"text-sm text-text whitespace-pre-line leading-7",children:t?.chatProfileVO?.bio})]}):""]})},Xt=({thread:e})=>{const{copyText:t}=Bt(),s="https://"+window.location.host+"/join?tn="+e?.uniqueName;/* @__PURE__ */
43
+ /* @__PURE__ */n.jsx("div",{className:"text-sm text-text whitespace-pre-line leading-7 select-text",children:t?.chatProfileVO?.bio})]}):""]})},Xt=({thread:e})=>{const{copyText:t}=Bt(),s="https://"+window.location.host+"/join?tn="+e?.uniqueName;/* @__PURE__ */
44
44
  return n.jsxs("div",{className:"bg-bgColor ",children:[
45
45
  /* @__PURE__ */n.jsxs("div",{className:"p-3",children:[
46
46
  /* @__PURE__ */n.jsx("div",{className:"text-xs mb-3 text-secondary ",children:"توضیحات"}),
47
- /* @__PURE__ */n.jsx("div",{className:"text-sm text-text whitespace-pre-line leading-7",children:e?.description?.trim()?dt(e?.description?.trim()+""):"بدون توضیحات!"})]}),
47
+ /* @__PURE__ */n.jsx("div",{className:"text-sm text-text whitespace-pre-line leading-7 select-text",children:e?.description?.trim()?dt(e?.description?.trim()+""):"بدون توضیحات!"})]}),
48
48
  /* @__PURE__ */n.jsx(tt,{height:"h-[0.75px]"}),["64","2"].includes(e?.type+"")&&/* @__PURE__ */n.jsxs("div",{className:"p-3",children:[
49
49
  /* @__PURE__ */n.jsx("div",{className:"text-xs mb-3 text-secondary min-w-0",children:"لینک دعوت"}),
50
50
  /* @__PURE__ */n.jsx("div",{dir:"ltr",className:"text-sm text-text cursor-pointer text-left truncate w-full",onClick:()=>t(s,"لینک مورد نظر کپی شد"),children:s})]})]})},Yt=({thread:e})=>/* @__PURE__ */n.jsxs("div",{style:{boxShadow:"0 5px 10px rgba(0,0,0,0.1)"},children:[Ze(e).includes("P2P")&&/* @__PURE__ */n.jsxs("div",{className:"",children:[
@@ -1,4 +1,4 @@
1
- import{c as t,g as e,j as i,aj as a,ak as n,al as s,am as o,I as r,an as l,V as c,ao as h,Q as d,ap as u,aq as p,ar as m,as as x,at as f,au as y,Y as g,av as k,l as v,aw as _,ax as b,ay as w,az as P,aA as A,_ as j,e as E,aB as C,G as T,v as S,R as I,aC as M,p as D,aD as B,aE as N,aF as O,aG as F,aH as R,aI as G,aJ as z,aK as V,aL as Z,aM as W,q as H,aN as $,aO as U,aP as q,aQ as Y,aR as X,aS as K,aT as J,aU as Q,ae as tt,aV as et,aW as it,aX as at,aY as nt,aZ as st,a_ as ot,a$ as rt,b0 as lt,b1 as ct,b2 as ht,b3 as dt,b4 as ut,b5 as pt,b6 as mt,H as xt,b7 as ft,b8 as yt,a4 as gt,a5 as kt,b9 as vt,ba as _t,bb as bt,bc as wt,bd as Pt,be as At,bf as jt,bg as Et,bh as Ct,bi as Tt,bj as St,bk as It,bl as Mt,bm as Lt,bn as Dt,bo as Bt,bp as Nt,bq as Ot,br as Ft,bs as Rt,bt as Gt,bu as zt,bv as Vt,bw as Zt,bx as Wt,by as Ht,bz as $t,bA as Ut,bB as qt,bC as Yt,bD as Xt,bE as Kt,bF as Jt,bG as Qt,bH as te,bI as ee,bJ as ie,bK as ae,bL as ne,bM as se,bN as oe,bO as re,r as le,bP as ce,ac as he,bQ as de,bR as ue,bS as pe,bT as me,bU as xe,bV as fe,bW as ye,bX as ge,bY as ke,o as ve,bZ as _e,b_ as be,b$ as we,a0 as Pe,a3 as Ae,x as je,c0 as Ee,c1 as Ce,c2 as Te,k as Se,c3 as Ie,S as Me,ah as Le,c4 as De,c5 as Be,c6 as Ne,c7 as Oe,c8 as Fe,c9 as Re,ca as Ge,cb as ze,ag as Ve,cc as Ze,cd as We,ce as He,ad as $e,cf as Ue,cg as qe,ch as Ye,ci as Xe,cj as Ke,ck as Je,cl as Qe,cm as ti,cn as ei,co as ii,cp as ai,cq as ni,cr as si,cs as oi,ct as ri,cu as li,cv as ci,cw as hi,cx as di,cy as ui,cz as pi,cA as mi,cB as xi,cC as fi,cD as yi,Z as gi,cE as ki,cF as vi,cG as _i,cH as bi,cI as wi,cJ as Pi,cK as Ai,cL as ji,cM as Ei,cN as Ci,cO as Ti,cP as Si,cQ as Ii,cR as Mi,cS as Li}from"./main-BiSoVrq9.js";import*as Di from"react";import Bi,{memo as Ni,useMemo as Oi,forwardRef as Fi,useRef as Ri,useReducer as Gi,useLayoutEffect as zi,useEffect as Vi,useImperativeHandle as Zi,useState as Wi,useCallback as Hi,createContext as $i,use as Ui,PureComponent as qi,createRef as Yi}from"react";import{L as Xi,a as Ki,c as Ji,b as Qi,R as ta,I as ea,d as ia,e as aa,A as na,p as sa,u as oa,Y as ra,f as la,g as ca,h as ha,i as da,T as ua,O as pa}from"./LoadingDots-CSbpS1Hq.js";import{flushSync as ma}from"react-dom";import{g as xa,b as fa,D as ya,u as ga,C as ka,a as va,c as _a}from"./useContactThread-DFlOxXGB.js";import{S as ba,I as wa,g as Pa,f as Aa,a as ja,e as Ea,i as Ca,b as Ta,m as Sa,c as Ia,R as Ma,d as La,F as Da,L as Ba,h as Na,p as Oa,j as Fa,k as Ra,l as Ga,n as za}from"./StartCall-BAc3hBgQ.js";import{u as Va}from"./useCopyToClipboard-CBpknd-Y.js";import{T as Za,R as Wa,L as Ha,C as $a,b as Ua,p as qa,a as Ya,h as Xa,r as Ka,c as Ja,d as Qa,l as tn}from"./boredGif-Bu2KwA3Z.js";import{P as en,C as an,I as nn,R as sn,a as on,T as rn,X as ln}from"./TypingView-Cwu2sFsn.js";import{R as cn,T as hn,I as dn,P as un,C as pn}from"./index-CdrvmdU9.js";import{M as mn}from"./mic-Zn5tfKRn.js";const xn=t("mic-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]),fn=t("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),yn=Ni(()=>e(t=>t.history.loadingFromDown)?/* @__PURE__ */i.jsx("div",{className:"relative",children:/* @__PURE__ */i.jsx("div",{className:"bottom-[5px] flex justify-center z-10 py-2 text-xs text-muted-foreground absolute w-full",children:/* @__PURE__ */i.jsx(Xi,{})})}):null),gn=Ni(()=>e(t=>t.history.loadingFromUp,a)?/* @__PURE__ */i.jsx("div",{className:"relative",children:/* @__PURE__ */i.jsx("div",{className:" flex justify-center z-10 py-2 text-xs text-muted-foreground absolute w-full",children:/* @__PURE__ */i.jsx(Xi,{})})}):null),kn=t=>Oi(()=>(t=>{const e=[],i=[];let a="";const n=/* @__PURE__ */new Date;return[...new Map(t.map(t=>[t.uniqueId,t])).values()].forEach(t=>{n.setTime(t.time/1e6);const s=n.toLocaleDateString("fa-IR",{year:"numeric",month:"long",day:"numeric",calendar:"persian"});s!==a&&(a=s,e.push({type:"date",data:s}),i.push(e.length-1)),e.push({type:"message",data:t})}),{groupMessages:e,headerIndexes:i}})(t),[t]),vn=null,{min:_n,max:bn,abs:wn,floor:Pn}=Math,An=(t,e,i)=>_n(i,bn(e,t)),jn=t=>[...t].sort((t,e)=>t-e),En="function"==typeof queueMicrotask?queueMicrotask:t=>{Promise.resolve().then(t)},Cn=()=>{let t;return[new Promise(e=>{t=e}),t]},Tn=t=>{let e;return()=>(t&&(e=t(),t=void 0),e)},Sn=(t,e,i)=>{const a=i?"unshift":"push";for(let n=0;n<e;n++)t[a](-1);return t},In=(t,e)=>{const i=t.t[e];return-1===i?t.o:i},Mn=(t,e,i)=>{const a=-1===t.t[e];return t.t[e]=i,t.i=_n(e,t.i),a},Ln=(t,e)=>{if(!t.l)return 0;if(t.i>=e)return t.u[e];t.i<0&&(t.u[0]=0,t.i=0);let i=t.i,a=t.u[i];for(;i<e;)a+=In(t,i),t.u[++i]=a;return t.i=e,a},Dn=(t,e,i=0,a=t.l-1)=>{let n=i;for(;i<=a;){const s=Pn((i+a)/2);Ln(t,s)<=e?(n=s,i=s+1):a=s-1}return An(n,0,t.l-1)},Bn=(t,e,i)=>{const a=e-t.l;return t.i=i?-1:_n(e-1,t.i),t.l=e,a>0?(Sn(t.u,a),Sn(t.t,a,i),t.o*a):(t.u.splice(a),(i?t.t.splice(0,-a):t.t.splice(a)).reduce((e,i)=>e-(-1===i?t.o:i),0))},Nn="undefined"!=typeof window,On=()=>document.documentElement,Fn=/* @__PURE__ */Tn(()=>!!Nn&&"rtl"===getComputedStyle(On()).direction),Rn=/* @__PURE__ */Tn(()=>!!/iP(hone|od|ad)/.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>0),Gn=/* @__PURE__ */Tn(()=>"scrollBehavior"in On().style),zn=setTimeout,Vn=(t,e)=>e&&Fn()?-t:t,Zn=(t,e)=>{let i,a,n=Cn();const s=e?"scrollLeft":"scrollTop",o=e?"overflowX":"overflowY",[r,l]=((t,e,i)=>{let a;return[async(n,s)=>{if(!(await e()))return;a&&a();const o=()=>{const[e,i]=Cn();return a=()=>{i(!1)},t.p()&&zn(a,150),[e,t.W(2,()=>{i(!0)})]};if(s&&Gn())t.B(8,n()),En(async()=>{for(;;){let e=!0;for(let[n,s]=t.S();n<=s;n++)if(t.I(n)){e=!1;break}if(e)break;const[i,a]=o();try{if(!(await i))return}finally{a()}}t.B(7),i(n(),s)});else for(;;){const[e,a]=o();try{if(t.B(7),i(n()),!(await e))return}finally{a()}}},()=>{a&&a()}]})(t,()=>n[0],(t,a)=>{t=Vn(t,e),a?i.scrollTo({[e?"left":"top"]:t,behavior:"smooth"}):i[s]=t});return{D(r){i=r,a=((t,e,i,a,n)=>{const s=Date.now;let o=0,r=!1,l=!1,c=!1,h=!1;const d=(()=>{let e;const i=()=>{e!=vn&&clearTimeout(e)},a=()=>{i(),e=zn(()=>{e=vn,(()=>{if(r||l)return r=!1,void d();c=!1,t.B(2)})()},150)};return a.J=i,a})(),u=()=>{o=s(),c&&(h=!0),t.B(1,a()),d()},p=e=>{if(r||!t.M()||e.ctrlKey)return;const a=s()-o;150>a&&50<a&&(i?e.deltaX:e.deltaY)&&(r=!0)},m=()=>{l=!0,c=h=!1},x=()=>{l=!1,Rn()&&(c=!0)};return e.addEventListener("scroll",u),e.addEventListener("wheel",p,{passive:!0}),e.addEventListener("touchstart",m,{passive:!0}),e.addEventListener("touchend",x,{passive:!0}),{A:()=>{e.removeEventListener("scroll",u),e.removeEventListener("wheel",p),e.removeEventListener("touchstart",m),e.removeEventListener("touchend",x),d.J()},L:()=>{const[e,i]=t.O();e&&(n(e,i,h),h=!1,i&&t.p()>t.h()&&t.B(1,a()))}}})(t,r,e,()=>Vn(r[s],e),(i,a,n)=>{if(n){const t=r.style,e=t[o];t[o]="hidden",zn(()=>{t[o]=e})}r[s]=Vn(t.C()+i,e),a&&l()}),n[1](!0)},v(){a&&a.A(),n[1](!1),n=Cn()},P(t){r(()=>t)},V(e){e+=t.C(),r(()=>e)},X(e,{align:i,smooth:a,offset:n=0}={}){if(e=An(e,0,t.T()-1),"nearest"===i){const a=t.k(e),n=t.C();if(a<n)i="start";else{if(!(a+t.R(e)>n+t.p()))return;i="end"}}r(()=>n+t.H()+t.k(e)+("end"===i?t.R(e)-t.p():"center"===i?(t.R(e)-t.p())/2:0),a)},Y:()=>{a&&a.L()}}},Wn=(t,e)=>{let i;const a=e?"width":"height",n=/* @__PURE__ */new WeakMap,s=(t=>{let e;return{j(i){(e||(e=new((t=>t.defaultView)((t=>t.ownerDocument)(i)).ResizeObserver)(t))).observe(i)},q(t){e.unobserve(t)},A(){e&&e.disconnect()}}})(e=>{const s=[];for(const{target:o,contentRect:r}of e)if(o.offsetParent)if(o===i)t.B(4,r[a]);else{const t=n.get(o);t!=vn&&s.push([t,r[a]])}s.length&&t.B(3,s)});return{G(t){s.j(i=t)},U:(t,e)=>(n.set(t,e),s.j(t),()=>{n.delete(t),s.q(t)}),v:s.A}},Hn=Nn?zi:Vi,$n="current",Un=(t,e)=>{if(Array.isArray(t))for(const i of t)Un(i,e);else null==t||"boolean"==typeof t||e.push(t)},qn=t=>{const e=Ri(t);return Hn(()=>{e[$n]=t},[t]),e},Yn=/* @__PURE__ */Ni(({N:t,Z:e,ee:a,te:n,oe:s,ne:o,re:r,ie:l})=>{const c=Ri(null);Hn(()=>e(c[$n],a),[a]);const h=Oi(()=>{const t={contain:"layout style",position:s&&l?void 0:"absolute",[r?"height":"width"]:"100%",[r?"top":"left"]:0,[r?Fn()?"right":"left":"top"]:n,visibility:!s||l?void 0:"hidden"};return r&&(t.display="inline-flex"),t},[n,s,l,r]);return i.jsx(o,"string"==typeof o?{ref:c,style:h,children:t}:{ref:c,style:h,index:a,children:t})}),Xn=/* @__PURE__ */Fi(({children:t,data:e,bufferSize:a,itemSize:n,shift:s,horizontal:o,keepMounted:r,cache:l,startMargin:c=0,ssrCount:h,as:d="div",item:u="div",scrollRef:p,onScroll:m,onScrollEnd:x},f)=>{const[y,g]=((t,e)=>Oi(()=>{if("function"==typeof t)return[i=>t(e[i],i),e.length];const i=(t=>{const e=[];return Un(t,e),e})(t);return[t=>i[t],i.length]},[t,e]))(t,e),k=Ri(null),v=Ri(!!h),_=qn(m),b=qn(x),[w,P,A,j]=(()=>{const t=Ri(null);return t[$n]||(t[$n]=(()=>{const t=!!o,e=((t,e=40,i=0,a,n=!1)=>{let s=!!i,o=1,r=0,l=0,c=0,h=0,d=0,u=0,p=0,m=0,x=vn,f=[0,s?bn(i-1,0):-1],y=0,g=!1;const k=(T=t,{o:a?a[1]:e,t:(S=a&&a[0])?Sn(S.slice(0,_n(T,S.length)),bn(0,T-S.length)):Sn([],T),l:T,i:-1,u:Sn([],T+1)}),v=/* @__PURE__ */new Set,_=()=>c-l,b=()=>_()+d+h,w=(t,e)=>((t,e,i,a)=>{if(a=_n(a,t.l-1),Ln(t,a)<=e){const n=Dn(t,i,a);return[Dn(t,e,a,n),n]}{const n=Dn(t,e,void 0,a);return[n,Dn(t,i,n)]}})(k,t,e,f[0]),P=()=>Ln(k,k.l),A=t=>Ln(k,t)-d,j=t=>In(k,t),E=(t,e=-1)=>k.t[t]===e,C=t=>{t&&(Rn()&&0!==p||x&&1===m?d+=t:h+=t)};var T,S;return{v:()=>{v.clear()},m:()=>o,_:()=>(t=>[t.t.slice(),t.o])(k),S:(t=200)=>{if(!g||s)return f;let e,i;if(u)[e,i]=f;else{let a=bn(0,b()),s=a+r;n||(t=bn(0,t),1!==p&&(a-=t),2!==p&&(s+=t)),[e,i]=f=w(bn(0,a),bn(0,s)),x&&(e=_n(e,x[0]),i=bn(i,x[1]))}return[bn(e,0),_n(i,k.l-1)]},$:t=>Dn(k,t-l),I:E,k:A,R:j,T:()=>k.l,C:()=>c,M:()=>0!==p,p:()=>r,H:()=>l,h:P,O:()=>(u=h,h=0,[u,2===m]),W:(t,e)=>{const i=[t,e];return v.add(i),()=>{v.delete(i)}},B:(t,e)=>{let i,a,f=0;switch(t){case 1:{if(e===c&&0===m)break;const t=u;u=0;const i=e-c,n=wn(i);t&&n<wn(t)+1||0!==m||(p=i<0?2:1),s&&(s=!1),c=e,f=4;const o=_();o>=-r&&o<=P()&&(f+=1,a=n>r);break}case 2:f=8,0!==p&&(i=!0,f+=1),p=0,m=0,x=vn;break;case 3:{const t=e.filter(([t,e])=>!E(t,e));if(!t.length)break;C(t.reduce((t,[e,i])=>((2===m||(x&&1===m?e<x[0]:A(e+(0===p&&0===m?1:0))<_()))&&(t+=i-j(e)),t),0));for(const[e,i]of t){const t=j(e),a=Mn(k,e,i);n&&(y+=a?i:i-t)}n&&r&&y>r&&(C(((t,e)=>{let i=0;const a=[];t.t.forEach((t,n)=>{-1!==t&&(a.push(t),n<e&&i++)}),t.i=-1;const n=jn(a),s=n.length,o=s/2|0,r=s%2==0?(n[o-1]+n[o])/2:n[o],l=t.o;return((t.o=r)-l)*bn(e-i,0)})(k,Dn(k,b()))),n=!1),f=3,a=!0;break}case 4:r!==e&&(r||(g=a=!0),r=e,f=3);break;case 5:e[1]?(C(Bn(k,e[0],!0)),m=2,f=1):(Bn(k,e[0]),f=1);break;case 6:l=e;break;case 7:m=1;break;case 8:x=w(e,e+r),f=1}f&&(o=1+(2147483647&o),i&&d&&(h+=d,d=0),v.forEach(([t,e])=>{f&t&&e(a)}))}}})(g,n,h,l,!n);return[e,Wn(e,t),Zn(e,t),t]})())})();g!==w.T()&&w.B(5,[g,s]),c!==w.H()&&w.B(6,c);const[E,C]=Gi(w.m,void 0,w.m),T=w.M(),S=w.h(),I=[],M=t=>{const e=y(t);return i.jsx(Yn,{Z:P.U,ee:t,te:w.k(t),oe:w.I(t),ne:u,N:e,re:j,ie:v[$n]},((t,e)=>{const i=t.key;return null!=i?i:"_"+e})(e,t))};if(Hn(()=>{v[$n]=!1,w.W(1,t=>{t?ma(C):C()}),w.W(4,()=>{_[$n]&&_[$n](w.C())}),w.W(8,()=>{b[$n]&&b[$n]()});const t=t=>{P.G(t),A.D(t)};return p?En(()=>{p[$n]&&t(p[$n])}):t(k[$n].parentElement),()=>{w.v(),P.v(),A.v()}},[]),Hn(()=>{A.Y()},[E]),Zi(f,()=>({get cache(){return w._()},get scrollOffset(){return w.C()},get scrollSize(){return bn((t=w).h(),t.p());var t},get viewportSize(){return w.p()},findItemIndex:w.$,getItemOffset:w.k,getItemSize:w.R,scrollToIndex:A.X,scrollTo:A.P,scrollBy:A.V}),[]),r){const t=new Set(r);for(let[e,i]=w.S(a);e<=i;e++)t.add(e);jn([...t]).forEach(t=>{I.push(M(t))})}else for(let[i,L]=w.S(a);i<=L;i++)I.push(M(i));return i.jsx(d,{ref:k,style:{contain:"size style",overflowAnchor:"none",flex:"none",position:"relative",width:j?S:"100%",height:j?"100%":S,pointerEvents:T?"none":void 0},children:I})}),Kn=/* @__PURE__ */Fi(({children:t,data:e,bufferSize:a,itemSize:n,shift:s,horizontal:o,keepMounted:r,reverse:l,cache:c,ssrCount:h,item:d,onScroll:u,onScrollEnd:p,style:m,...x},f)=>{const y=Ri(null),g=l&&!o;let k=i.jsx(Xn,{ref:f,scrollRef:g?y:void 0,data:e,bufferSize:a,itemSize:n,shift:s,horizontal:o,keepMounted:r,cache:c,ssrCount:h,item:d,onScroll:u,onScrollEnd:p,children:t});return g&&(k=i.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"flex-end",minHeight:"100%",overflow:"clip"},children:k})),i.jsx("div",{ref:y,...x,style:{display:o?"inline-block":"block",[o?"overflowX":"overflowY"]:"auto",contain:"strict",width:"100%",height:"100%",...m},children:k})}),Jn=({visibleJumpButton:t,topLoader:e,bottomLoader:a,messages:n,headerIndexes:s,onEndReach:o,isScrolling:r,onStartReach:l,onStartIndex:c,onEndIndex:h,onScroll:d,shift:u=!1,skipInitialReach:p=!1,children:m,vlistRef:x})=>{const[f,y]=Wi(-1),g=Ri(!1),k=Ri(0),v=Ri(0),_=Ri(!1),b=Ri(null),w=Ri(!1),P=Hi(e=>{const i=x.current,a=i?.viewportSize??0,u=i?.scrollOffset??e;w.current||(w.current=!0,r?.(!0)),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{w.current=!1,r?.(!1),b.current=null},150);const m=i?.findItemIndex(u)??0,P=[...s].reverse().find(t=>m>=t)??-1;P!==f&&y(P),d?.(e,P);const A=i?.findItemIndex(u+a)??n.length-1;k.current!==m&&(k.current=m,c?.(m)),v.current!==A&&(v.current=A,h?.(A));const j=i?.scrollSize??0;p&&!_.current?_.current=!0:(e+a+1e3>j&&o(),e+a+70>j?g.current||(g.current=!0,t?.(!1)):g.current&&(g.current=!1,t?.(!0)),e<500&&0!==e&&l())},[s,f,o,l,d,c,h,n.length,p,x,t]);/* @__PURE__ */
1
+ import{c as t,g as e,j as i,aj as a,ak as n,al as s,am as o,I as r,an as l,V as c,ao as h,Q as d,ap as u,aq as p,ar as m,as as x,at as f,au as y,Y as g,av as k,l as v,aw as _,ax as b,ay as w,az as P,aA as A,_ as j,e as E,aB as C,G as T,v as S,R as I,aC as M,p as D,aD as B,aE as N,aF as O,aG as F,aH as R,aI as G,aJ as z,aK as V,aL as Z,aM as W,q as H,aN as $,aO as U,aP as q,aQ as Y,aR as X,aS as K,aT as J,aU as Q,ae as tt,aV as et,aW as it,aX as at,aY as nt,aZ as st,a_ as ot,a$ as rt,b0 as lt,b1 as ct,b2 as ht,b3 as dt,b4 as ut,b5 as pt,b6 as mt,H as xt,b7 as ft,b8 as yt,a4 as gt,a5 as kt,b9 as vt,ba as _t,bb as bt,bc as wt,bd as Pt,be as At,bf as jt,bg as Et,bh as Ct,bi as Tt,bj as St,bk as It,bl as Mt,bm as Lt,bn as Dt,bo as Bt,bp as Nt,bq as Ot,br as Ft,bs as Rt,bt as Gt,bu as zt,bv as Vt,bw as Zt,bx as Wt,by as Ht,bz as $t,bA as Ut,bB as qt,bC as Yt,bD as Xt,bE as Kt,bF as Jt,bG as Qt,bH as te,bI as ee,bJ as ie,bK as ae,bL as ne,bM as se,bN as oe,bO as re,r as le,bP as ce,ac as he,bQ as de,bR as ue,bS as pe,bT as me,bU as xe,bV as fe,bW as ye,bX as ge,bY as ke,o as ve,bZ as _e,b_ as be,b$ as we,a0 as Pe,a3 as Ae,x as je,c0 as Ee,c1 as Ce,c2 as Te,k as Se,c3 as Ie,S as Me,ah as Le,c4 as De,c5 as Be,c6 as Ne,c7 as Oe,c8 as Fe,c9 as Re,ca as Ge,cb as ze,ag as Ve,cc as Ze,cd as We,ce as He,ad as $e,cf as Ue,cg as qe,ch as Ye,ci as Xe,cj as Ke,ck as Je,cl as Qe,cm as ti,cn as ei,co as ii,cp as ai,cq as ni,cr as si,cs as oi,ct as ri,cu as li,cv as ci,cw as hi,cx as di,cy as ui,cz as pi,cA as mi,cB as xi,cC as fi,cD as yi,Z as gi,cE as ki,cF as vi,cG as _i,cH as bi,cI as wi,cJ as Pi,cK as Ai,cL as ji,cM as Ei,cN as Ci,cO as Ti,cP as Si,cQ as Ii,cR as Mi,cS as Li}from"./main-zRgi4xWO.js";import*as Di from"react";import Bi,{memo as Ni,useMemo as Oi,forwardRef as Fi,useRef as Ri,useReducer as Gi,useLayoutEffect as zi,useEffect as Vi,useImperativeHandle as Zi,useState as Wi,useCallback as Hi,createContext as $i,use as Ui,PureComponent as qi,createRef as Yi}from"react";import{L as Xi,a as Ki,c as Ji,b as Qi,R as ta,I as ea,d as ia,e as aa,A as na,p as sa,u as oa,Y as ra,f as la,g as ca,h as ha,i as da,T as ua,O as pa}from"./LoadingDots-BCHF8LdO.js";import{flushSync as ma}from"react-dom";import{g as xa,b as fa,D as ya,u as ga,C as ka,a as va,c as _a}from"./useContactThread-DHLgloYG.js";import{S as ba,I as wa,g as Pa,f as Aa,a as ja,e as Ea,i as Ca,b as Ta,m as Sa,c as Ia,R as Ma,d as La,F as Da,L as Ba,h as Na,p as Oa,j as Fa,k as Ra,l as Ga,n as za}from"./StartCall-CcQ5P7hM.js";import{u as Va}from"./useCopyToClipboard-YimoFCPU.js";import{T as Za,R as Wa,L as Ha,C as $a,b as Ua,p as qa,a as Ya,h as Xa,r as Ka,c as Ja,d as Qa,l as tn}from"./boredGif-CpIevNTo.js";import{P as en,C as an,I as nn,R as sn,a as on,T as rn,X as ln}from"./TypingView-CC7bSaPG.js";import{R as cn,T as hn,I as dn,P as un,C as pn}from"./index-B12mfnzO.js";import{M as mn}from"./mic-kKnADQki.js";const xn=t("mic-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",key:"80xlxr"}],["path",{d:"M5 10v2a7 7 0 0 0 12 5",key:"p2k8kg"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]),fn=t("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),yn=Ni(()=>e(t=>t.history.loadingFromDown)?/* @__PURE__ */i.jsx("div",{className:"relative",children:/* @__PURE__ */i.jsx("div",{className:"bottom-[5px] flex justify-center z-10 py-2 text-xs text-muted-foreground absolute w-full",children:/* @__PURE__ */i.jsx(Xi,{})})}):null),gn=Ni(()=>e(t=>t.history.loadingFromUp,a)?/* @__PURE__ */i.jsx("div",{className:"relative",children:/* @__PURE__ */i.jsx("div",{className:" flex justify-center z-10 py-2 text-xs text-muted-foreground absolute w-full",children:/* @__PURE__ */i.jsx(Xi,{})})}):null),kn=t=>Oi(()=>(t=>{const e=[],i=[];let a="";const n=/* @__PURE__ */new Date;return[...new Map(t.map(t=>[t.uniqueId,t])).values()].forEach(t=>{n.setTime(t.time/1e6);const s=n.toLocaleDateString("fa-IR",{year:"numeric",month:"long",day:"numeric",calendar:"persian"});s!==a&&(a=s,e.push({type:"date",data:s}),i.push(e.length-1)),e.push({type:"message",data:t})}),{groupMessages:e,headerIndexes:i}})(t),[t]),vn=null,{min:_n,max:bn,abs:wn,floor:Pn}=Math,An=(t,e,i)=>_n(i,bn(e,t)),jn=t=>[...t].sort((t,e)=>t-e),En="function"==typeof queueMicrotask?queueMicrotask:t=>{Promise.resolve().then(t)},Cn=()=>{let t;return[new Promise(e=>{t=e}),t]},Tn=t=>{let e;return()=>(t&&(e=t(),t=void 0),e)},Sn=(t,e,i)=>{const a=i?"unshift":"push";for(let n=0;n<e;n++)t[a](-1);return t},In=(t,e)=>{const i=t.t[e];return-1===i?t.o:i},Mn=(t,e,i)=>{const a=-1===t.t[e];return t.t[e]=i,t.i=_n(e,t.i),a},Ln=(t,e)=>{if(!t.l)return 0;if(t.i>=e)return t.u[e];t.i<0&&(t.u[0]=0,t.i=0);let i=t.i,a=t.u[i];for(;i<e;)a+=In(t,i),t.u[++i]=a;return t.i=e,a},Dn=(t,e,i=0,a=t.l-1)=>{let n=i;for(;i<=a;){const s=Pn((i+a)/2);Ln(t,s)<=e?(n=s,i=s+1):a=s-1}return An(n,0,t.l-1)},Bn=(t,e,i)=>{const a=e-t.l;return t.i=i?-1:_n(e-1,t.i),t.l=e,a>0?(Sn(t.u,a),Sn(t.t,a,i),t.o*a):(t.u.splice(a),(i?t.t.splice(0,-a):t.t.splice(a)).reduce((e,i)=>e-(-1===i?t.o:i),0))},Nn="undefined"!=typeof window,On=()=>document.documentElement,Fn=/* @__PURE__ */Tn(()=>!!Nn&&"rtl"===getComputedStyle(On()).direction),Rn=/* @__PURE__ */Tn(()=>!!/iP(hone|od|ad)/.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>0),Gn=/* @__PURE__ */Tn(()=>"scrollBehavior"in On().style),zn=setTimeout,Vn=(t,e)=>e&&Fn()?-t:t,Zn=(t,e)=>{let i,a,n=Cn();const s=e?"scrollLeft":"scrollTop",o=e?"overflowX":"overflowY",[r,l]=((t,e,i)=>{let a;return[async(n,s)=>{if(!(await e()))return;a&&a();const o=()=>{const[e,i]=Cn();return a=()=>{i(!1)},t.p()&&zn(a,150),[e,t.W(2,()=>{i(!0)})]};if(s&&Gn())t.B(8,n()),En(async()=>{for(;;){let e=!0;for(let[n,s]=t.S();n<=s;n++)if(t.I(n)){e=!1;break}if(e)break;const[i,a]=o();try{if(!(await i))return}finally{a()}}t.B(7),i(n(),s)});else for(;;){const[e,a]=o();try{if(t.B(7),i(n()),!(await e))return}finally{a()}}},()=>{a&&a()}]})(t,()=>n[0],(t,a)=>{t=Vn(t,e),a?i.scrollTo({[e?"left":"top"]:t,behavior:"smooth"}):i[s]=t});return{D(r){i=r,a=((t,e,i,a,n)=>{const s=Date.now;let o=0,r=!1,l=!1,c=!1,h=!1;const d=(()=>{let e;const i=()=>{e!=vn&&clearTimeout(e)},a=()=>{i(),e=zn(()=>{e=vn,(()=>{if(r||l)return r=!1,void d();c=!1,t.B(2)})()},150)};return a.J=i,a})(),u=()=>{o=s(),c&&(h=!0),t.B(1,a()),d()},p=e=>{if(r||!t.M()||e.ctrlKey)return;const a=s()-o;150>a&&50<a&&(i?e.deltaX:e.deltaY)&&(r=!0)},m=()=>{l=!0,c=h=!1},x=()=>{l=!1,Rn()&&(c=!0)};return e.addEventListener("scroll",u),e.addEventListener("wheel",p,{passive:!0}),e.addEventListener("touchstart",m,{passive:!0}),e.addEventListener("touchend",x,{passive:!0}),{A:()=>{e.removeEventListener("scroll",u),e.removeEventListener("wheel",p),e.removeEventListener("touchstart",m),e.removeEventListener("touchend",x),d.J()},L:()=>{const[e,i]=t.O();e&&(n(e,i,h),h=!1,i&&t.p()>t.h()&&t.B(1,a()))}}})(t,r,e,()=>Vn(r[s],e),(i,a,n)=>{if(n){const t=r.style,e=t[o];t[o]="hidden",zn(()=>{t[o]=e})}r[s]=Vn(t.C()+i,e),a&&l()}),n[1](!0)},v(){a&&a.A(),n[1](!1),n=Cn()},P(t){r(()=>t)},V(e){e+=t.C(),r(()=>e)},X(e,{align:i,smooth:a,offset:n=0}={}){if(e=An(e,0,t.T()-1),"nearest"===i){const a=t.k(e),n=t.C();if(a<n)i="start";else{if(!(a+t.R(e)>n+t.p()))return;i="end"}}r(()=>n+t.H()+t.k(e)+("end"===i?t.R(e)-t.p():"center"===i?(t.R(e)-t.p())/2:0),a)},Y:()=>{a&&a.L()}}},Wn=(t,e)=>{let i;const a=e?"width":"height",n=/* @__PURE__ */new WeakMap,s=(t=>{let e;return{j(i){(e||(e=new((t=>t.defaultView)((t=>t.ownerDocument)(i)).ResizeObserver)(t))).observe(i)},q(t){e.unobserve(t)},A(){e&&e.disconnect()}}})(e=>{const s=[];for(const{target:o,contentRect:r}of e)if(o.offsetParent)if(o===i)t.B(4,r[a]);else{const t=n.get(o);t!=vn&&s.push([t,r[a]])}s.length&&t.B(3,s)});return{G(t){s.j(i=t)},U:(t,e)=>(n.set(t,e),s.j(t),()=>{n.delete(t),s.q(t)}),v:s.A}},Hn=Nn?zi:Vi,$n="current",Un=(t,e)=>{if(Array.isArray(t))for(const i of t)Un(i,e);else null==t||"boolean"==typeof t||e.push(t)},qn=t=>{const e=Ri(t);return Hn(()=>{e[$n]=t},[t]),e},Yn=/* @__PURE__ */Ni(({N:t,Z:e,ee:a,te:n,oe:s,ne:o,re:r,ie:l})=>{const c=Ri(null);Hn(()=>e(c[$n],a),[a]);const h=Oi(()=>{const t={contain:"layout style",position:s&&l?void 0:"absolute",[r?"height":"width"]:"100%",[r?"top":"left"]:0,[r?Fn()?"right":"left":"top"]:n,visibility:!s||l?void 0:"hidden"};return r&&(t.display="inline-flex"),t},[n,s,l,r]);return i.jsx(o,"string"==typeof o?{ref:c,style:h,children:t}:{ref:c,style:h,index:a,children:t})}),Xn=/* @__PURE__ */Fi(({children:t,data:e,bufferSize:a,itemSize:n,shift:s,horizontal:o,keepMounted:r,cache:l,startMargin:c=0,ssrCount:h,as:d="div",item:u="div",scrollRef:p,onScroll:m,onScrollEnd:x},f)=>{const[y,g]=((t,e)=>Oi(()=>{if("function"==typeof t)return[i=>t(e[i],i),e.length];const i=(t=>{const e=[];return Un(t,e),e})(t);return[t=>i[t],i.length]},[t,e]))(t,e),k=Ri(null),v=Ri(!!h),_=qn(m),b=qn(x),[w,P,A,j]=(()=>{const t=Ri(null);return t[$n]||(t[$n]=(()=>{const t=!!o,e=((t,e=40,i=0,a,n=!1)=>{let s=!!i,o=1,r=0,l=0,c=0,h=0,d=0,u=0,p=0,m=0,x=vn,f=[0,s?bn(i-1,0):-1],y=0,g=!1;const k=(T=t,{o:a?a[1]:e,t:(S=a&&a[0])?Sn(S.slice(0,_n(T,S.length)),bn(0,T-S.length)):Sn([],T),l:T,i:-1,u:Sn([],T+1)}),v=/* @__PURE__ */new Set,_=()=>c-l,b=()=>_()+d+h,w=(t,e)=>((t,e,i,a)=>{if(a=_n(a,t.l-1),Ln(t,a)<=e){const n=Dn(t,i,a);return[Dn(t,e,a,n),n]}{const n=Dn(t,e,void 0,a);return[n,Dn(t,i,n)]}})(k,t,e,f[0]),P=()=>Ln(k,k.l),A=t=>Ln(k,t)-d,j=t=>In(k,t),E=(t,e=-1)=>k.t[t]===e,C=t=>{t&&(Rn()&&0!==p||x&&1===m?d+=t:h+=t)};var T,S;return{v:()=>{v.clear()},m:()=>o,_:()=>(t=>[t.t.slice(),t.o])(k),S:(t=200)=>{if(!g||s)return f;let e,i;if(u)[e,i]=f;else{let a=bn(0,b()),s=a+r;n||(t=bn(0,t),1!==p&&(a-=t),2!==p&&(s+=t)),[e,i]=f=w(bn(0,a),bn(0,s)),x&&(e=_n(e,x[0]),i=bn(i,x[1]))}return[bn(e,0),_n(i,k.l-1)]},$:t=>Dn(k,t-l),I:E,k:A,R:j,T:()=>k.l,C:()=>c,M:()=>0!==p,p:()=>r,H:()=>l,h:P,O:()=>(u=h,h=0,[u,2===m]),W:(t,e)=>{const i=[t,e];return v.add(i),()=>{v.delete(i)}},B:(t,e)=>{let i,a,f=0;switch(t){case 1:{if(e===c&&0===m)break;const t=u;u=0;const i=e-c,n=wn(i);t&&n<wn(t)+1||0!==m||(p=i<0?2:1),s&&(s=!1),c=e,f=4;const o=_();o>=-r&&o<=P()&&(f+=1,a=n>r);break}case 2:f=8,0!==p&&(i=!0,f+=1),p=0,m=0,x=vn;break;case 3:{const t=e.filter(([t,e])=>!E(t,e));if(!t.length)break;C(t.reduce((t,[e,i])=>((2===m||(x&&1===m?e<x[0]:A(e+(0===p&&0===m?1:0))<_()))&&(t+=i-j(e)),t),0));for(const[e,i]of t){const t=j(e),a=Mn(k,e,i);n&&(y+=a?i:i-t)}n&&r&&y>r&&(C(((t,e)=>{let i=0;const a=[];t.t.forEach((t,n)=>{-1!==t&&(a.push(t),n<e&&i++)}),t.i=-1;const n=jn(a),s=n.length,o=s/2|0,r=s%2==0?(n[o-1]+n[o])/2:n[o],l=t.o;return((t.o=r)-l)*bn(e-i,0)})(k,Dn(k,b()))),n=!1),f=3,a=!0;break}case 4:r!==e&&(r||(g=a=!0),r=e,f=3);break;case 5:e[1]?(C(Bn(k,e[0],!0)),m=2,f=1):(Bn(k,e[0]),f=1);break;case 6:l=e;break;case 7:m=1;break;case 8:x=w(e,e+r),f=1}f&&(o=1+(2147483647&o),i&&d&&(h+=d,d=0),v.forEach(([t,e])=>{f&t&&e(a)}))}}})(g,n,h,l,!n);return[e,Wn(e,t),Zn(e,t),t]})())})();g!==w.T()&&w.B(5,[g,s]),c!==w.H()&&w.B(6,c);const[E,C]=Gi(w.m,void 0,w.m),T=w.M(),S=w.h(),I=[],M=t=>{const e=y(t);return i.jsx(Yn,{Z:P.U,ee:t,te:w.k(t),oe:w.I(t),ne:u,N:e,re:j,ie:v[$n]},((t,e)=>{const i=t.key;return null!=i?i:"_"+e})(e,t))};if(Hn(()=>{v[$n]=!1,w.W(1,t=>{t?ma(C):C()}),w.W(4,()=>{_[$n]&&_[$n](w.C())}),w.W(8,()=>{b[$n]&&b[$n]()});const t=t=>{P.G(t),A.D(t)};return p?En(()=>{p[$n]&&t(p[$n])}):t(k[$n].parentElement),()=>{w.v(),P.v(),A.v()}},[]),Hn(()=>{A.Y()},[E]),Zi(f,()=>({get cache(){return w._()},get scrollOffset(){return w.C()},get scrollSize(){return bn((t=w).h(),t.p());var t},get viewportSize(){return w.p()},findItemIndex:w.$,getItemOffset:w.k,getItemSize:w.R,scrollToIndex:A.X,scrollTo:A.P,scrollBy:A.V}),[]),r){const t=new Set(r);for(let[e,i]=w.S(a);e<=i;e++)t.add(e);jn([...t]).forEach(t=>{I.push(M(t))})}else for(let[i,L]=w.S(a);i<=L;i++)I.push(M(i));return i.jsx(d,{ref:k,style:{contain:"size style",overflowAnchor:"none",flex:"none",position:"relative",width:j?S:"100%",height:j?"100%":S,pointerEvents:T?"none":void 0},children:I})}),Kn=/* @__PURE__ */Fi(({children:t,data:e,bufferSize:a,itemSize:n,shift:s,horizontal:o,keepMounted:r,reverse:l,cache:c,ssrCount:h,item:d,onScroll:u,onScrollEnd:p,style:m,...x},f)=>{const y=Ri(null),g=l&&!o;let k=i.jsx(Xn,{ref:f,scrollRef:g?y:void 0,data:e,bufferSize:a,itemSize:n,shift:s,horizontal:o,keepMounted:r,cache:c,ssrCount:h,item:d,onScroll:u,onScrollEnd:p,children:t});return g&&(k=i.jsx("div",{style:{display:"flex",flexDirection:"column",justifyContent:"flex-end",minHeight:"100%",overflow:"clip"},children:k})),i.jsx("div",{ref:y,...x,style:{display:o?"inline-block":"block",[o?"overflowX":"overflowY"]:"auto",contain:"strict",width:"100%",height:"100%",...m},children:k})}),Jn=({visibleJumpButton:t,topLoader:e,bottomLoader:a,messages:n,headerIndexes:s,onEndReach:o,isScrolling:r,onStartReach:l,onStartIndex:c,onEndIndex:h,onScroll:d,shift:u=!1,skipInitialReach:p=!1,children:m,vlistRef:x})=>{const[f,y]=Wi(-1),g=Ri(!1),k=Ri(0),v=Ri(0),_=Ri(!1),b=Ri(null),w=Ri(!1),P=Hi(e=>{const i=x.current,a=i?.viewportSize??0,u=i?.scrollOffset??e;w.current||(w.current=!0,r?.(!0)),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{w.current=!1,r?.(!1),b.current=null},150);const m=i?.findItemIndex(u)??0,P=[...s].reverse().find(t=>m>=t)??-1;P!==f&&y(P),d?.(e,P);const A=i?.findItemIndex(u+a)??n.length-1;k.current!==m&&(k.current=m,c?.(m)),v.current!==A&&(v.current=A,h?.(A));const j=i?.scrollSize??0;p&&!_.current?_.current=!0:(e+a+1e3>j&&o(),e+a+70>j?g.current||(g.current=!0,t?.(!1)):g.current&&(g.current=!1,t?.(!0)),e<500&&0!==e&&l())},[s,f,o,l,d,c,h,n.length,p,x,t]);/* @__PURE__ */
2
2
  return i.jsxs(i.Fragment,{children:[e&&e(),
3
3
  /* @__PURE__ */i.jsx(Kn,{className:"scroll-container thin-scroll",id:"vlist-container",ref:x,reverse:!0,shift:u,keepMounted:s.length>0&&f>-1?[f]:[],bufferSize:1e3,onScroll:P,children:n.map((t,e)=>/* @__PURE__ */i.jsx(Bi.Fragment,{children:m(t,e,f===e)},"string"!=typeof t.data?"vlist-"+t.data?.id+t.data?.uniqueId:t.data??e))}),a&&a()]})};Jn.displayName="VirtualMessageList";const Qn=Ni(Jn,(t,e)=>t.messages===e.messages&&t.headerIndexes===e.headerIndexes&&t.shift===e.shift&&t.onEndReach===e.onEndReach&&t.onStartReach===e.onStartReach&&t.onScroll===e.onScroll&&t.onStartIndex===e.onStartIndex&&t.onEndIndex===e.onEndIndex&&t.children===e.children&&t.skipInitialReach===e.skipInitialReach),ts=({unreadCount:t,onClick:a})=>{if(e(t=>t.setting.showJumpButton))/* @__PURE__ */
4
4
  return i.jsxs("button",{onClick:a,className:" relative w-10 h-10 bg-accent rounded-full shadow-lg flex items-center justify-center hover:bg-hoverBtn transition-colors active:scale-95","aria-label":"Jump to bottom",children:[
@@ -30,7 +30,7 @@ return i.jsx(v,{open:a,onOpenChange:n,titleStyle:"!text-[13px] !mb-2 mt-3",title
30
30
  /* @__PURE__ */i.jsx(Ns,{searchValue:o,onSelected:i=>{n(!1),s(M({thread:i,forwardItems:t,threadId:i.id,inputMode:{id:t[0],message:e,type:"forwarding"}})),s(P()),s(D(!1))}})]})})},Rs=({message:t})=>{const e=E(),a=Pa(t.metadata).originName||t.message,n=Hi(()=>{e(M({threadId:t.threadId,inputMode:{id:t.id,message:a,time:t.time,type:"replying"}})),Aa()},[t.threadId,t.message,t.id]);/* @__PURE__ */
31
31
  return i.jsx("div",{children:/* @__PURE__ */i.jsx(Is,{onClick:n,icon:/* @__PURE__ */i.jsx(ja,{size:24}),title:"پاسخ"})})},Gs=({message:t,messageId:e,messageType:a,coreUserId:n,participant:s,username:o,time:c,ownerId:h,timeMiliSeconds:d})=>{const u=r();/* @__PURE__ */
32
32
  return i.jsx("div",{onClick:function(){u(w(!0)),u(l({timeMiliSeconds:d,id:e,message:t,coreUserId:n,participant:s,username:o,messageType:a,time:c,isOwner:h===N()}))},children:/* @__PURE__ */i.jsx(Is,{icon:/* @__PURE__ */i.jsx(B,{}),title:"انتخاب پیامها"})})};var zs,Vs,Zs,Ws={exports:{}};const Hs=/* @__PURE__ */F((zs||(zs=1,Vs=Ws,Zs=function(t){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,i=0,a={},n={manual:t.Prism&&t.Prism.manual,disableWorkerMessageHandler:t.Prism&&t.Prism.disableWorkerMessageHandler,util:{encode:function t(e){return e instanceof s?new s(e.type,t(e.content),e.alias):Array.isArray(e)?e.map(t):e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(t){return Object.prototype.toString.call(t).slice(8,-1)},objId:function(t){return t.__id||Object.defineProperty(t,"__id",{value:++i}),t.__id},clone:function t(e,i){var a,s;switch(i=i||{},n.util.type(e)){case"Object":if(s=n.util.objId(e),i[s])return i[s];for(var o in a={},i[s]=a,e)e.hasOwnProperty(o)&&(a[o]=t(e[o],i));return a;case"Array":return s=n.util.objId(e),i[s]?i[s]:(a=[],i[s]=a,e.forEach(function(e,n){a[n]=t(e,i)}),a);default:return e}},getLanguage:function(t){for(;t;){var i=e.exec(t.className);if(i)return i[1].toLowerCase();t=t.parentElement}return"none"},setLanguage:function(t,i){t.className=t.className.replace(RegExp(e,"gi"),""),t.classList.add("language-"+i)},currentScript:function(){if("undefined"==typeof document)return null;if(document.currentScript&&"SCRIPT"===document.currentScript.tagName)return document.currentScript;try{throw Error()}catch(a){var t=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(a.stack)||[])[1];if(t){var e=document.getElementsByTagName("script");for(var i in e)if(e[i].src==t)return e[i]}return null}},isActive:function(t,e,i){for(var a="no-"+e;t;){var n=t.classList;if(n.contains(e))return!0;if(n.contains(a))return!1;t=t.parentElement}return!!i}},languages:{plain:a,plaintext:a,text:a,txt:a,extend:function(t,e){var i=n.util.clone(n.languages[t]);for(var a in e)i[a]=e[a];return i},insertBefore:function(t,e,i,a){var s=(a=a||n.languages)[t],o={};for(var r in s)if(s.hasOwnProperty(r)){if(r==e)for(var l in i)i.hasOwnProperty(l)&&(o[l]=i[l]);i.hasOwnProperty(r)||(o[r]=s[r])}var c=a[t];return a[t]=o,n.languages.DFS(n.languages,function(e,i){i===c&&e!=t&&(this[e]=o)}),o},DFS:function t(e,i,a,s){s=s||{};var o=n.util.objId;for(var r in e)if(e.hasOwnProperty(r)){i.call(e,r,e[r],a||r);var l=e[r],c=n.util.type(l);"Object"!==c||s[o(l)]?"Array"!==c||s[o(l)]||(s[o(l)]=!0,t(l,i,r,s)):(s[o(l)]=!0,t(l,i,null,s))}}},plugins:{},highlightAll:function(t,e){n.highlightAllUnder(document,t,e)},highlightAllUnder:function(t,e,i){var a={callback:i,container:t,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};n.hooks.run("before-highlightall",a),a.elements=Array.prototype.slice.apply(a.container.querySelectorAll(a.selector)),n.hooks.run("before-all-elements-highlight",a);for(var s,o=0;s=a.elements[o++];)n.highlightElement(s,!0===e,a.callback)},highlightElement:function(e,i,a){var s=n.util.getLanguage(e),o=n.languages[s];n.util.setLanguage(e,s);var r=e.parentElement;r&&"pre"===r.nodeName.toLowerCase()&&n.util.setLanguage(r,s);var l={element:e,language:s,grammar:o,code:e.textContent};function c(t){l.highlightedCode=t,n.hooks.run("before-insert",l),l.element.innerHTML=l.highlightedCode,n.hooks.run("after-highlight",l),n.hooks.run("complete",l),a&&a.call(l.element)}if(n.hooks.run("before-sanity-check",l),(r=l.element.parentElement)&&"pre"===r.nodeName.toLowerCase()&&!r.hasAttribute("tabindex")&&r.setAttribute("tabindex","0"),!l.code)return n.hooks.run("complete",l),void(a&&a.call(l.element));if(n.hooks.run("before-highlight",l),l.grammar)if(i&&t.Worker){var h=new Worker(n.filename);h.onmessage=function(t){c(t.data)},h.postMessage(JSON.stringify({language:l.language,code:l.code,immediateClose:!0}))}else c(n.highlight(l.code,l.grammar,l.language));else c(n.util.encode(l.code))},highlight:function(t,e,i){var a={code:t,grammar:e,language:i};if(n.hooks.run("before-tokenize",a),!a.grammar)throw Error('The language "'+a.language+'" has no grammar.');return a.tokens=n.tokenize(a.code,a.grammar),n.hooks.run("after-tokenize",a),s.stringify(n.util.encode(a.tokens),a.language)},tokenize:function(t,e){var i=e.rest;if(i){for(var a in i)e[a]=i[a];delete e.rest}var n=new l;return c(n,n.head,t),r(t,n,e,n.head,0),function(t){for(var e=[],i=t.head.next;i!==t.tail;)e.push(i.value),i=i.next;return e}(n)},hooks:{all:{},add:function(t,e){var i=n.hooks.all;i[t]=i[t]||[],i[t].push(e)},run:function(t,e){var i=n.hooks.all[t];if(i&&i.length)for(var a,s=0;a=i[s++];)a(e)}},Token:s};function s(t,e,i,a){this.type=t,this.content=e,this.alias=i,this.length=0|(a||"").length}function o(t,e,i,a){t.lastIndex=e;var n=t.exec(i);if(n&&a&&n[1]){var s=n[1].length;n.index+=s,n[0]=n[0].slice(s)}return n}function r(t,e,i,a,l,d){for(var u in i)if(i.hasOwnProperty(u)&&i[u]){var p=i[u];p=Array.isArray(p)?p:[p];for(var m=0;m<p.length;++m){if(d&&d.cause==u+","+m)return;var x=p[m],f=x.inside,y=!!x.lookbehind,g=!!x.greedy,k=x.alias;if(g&&!x.pattern.global){var v=x.pattern.toString().match(/[imsuy]*$/)[0];x.pattern=RegExp(x.pattern.source,v+"g")}for(var _=x.pattern||x,b=a.next,w=l;b!==e.tail&&!(d&&w>=d.reach);w+=b.value.length,b=b.next){var P=b.value;if(e.length>t.length)return;if(!(P instanceof s)){var A,j=1;if(g){if(!(A=o(_,w,t,y))||A.index>=t.length)break;var E=A.index,C=A.index+A[0].length,T=w;for(T+=b.value.length;E>=T;)T+=(b=b.next).value.length;if(w=T-=b.value.length,b.value instanceof s)continue;for(var S=b;S!==e.tail&&(T<C||"string"==typeof S.value);S=S.next)j++,T+=S.value.length;j--,P=t.slice(w,T),A.index-=w}else if(!(A=o(_,0,P,y)))continue;E=A.index;var I=A[0],M=P.slice(0,E),L=P.slice(E+I.length),D=w+P.length;d&&D>d.reach&&(d.reach=D);var B=b.prev;if(M&&(B=c(e,B,M),w+=M.length),h(e,B,j),b=c(e,B,new s(u,f?n.tokenize(I,f):I,k,I)),L&&c(e,b,L),j>1){var N={cause:u+","+m,reach:D};r(t,e,i,b.prev,w,N),d&&N.reach>d.reach&&(d.reach=N.reach)}}}}}}function l(){var t={value:null,prev:null,next:null},e={value:null,prev:t,next:null};t.next=e,this.head=t,this.tail=e,this.length=0}function c(t,e,i){var a=e.next,n={value:i,prev:e,next:a};return e.next=n,a.prev=n,t.length++,n}function h(t,e,i){for(var a=e.next,n=0;n<i&&a!==t.tail;n++)a=a.next;e.next=a,a.prev=e,t.length-=n}if(t.Prism=n,s.stringify=function t(e,i){if("string"==typeof e)return e;if(Array.isArray(e)){var a="";return e.forEach(function(e){a+=t(e,i)}),a}var s={type:e.type,content:t(e.content,i),tag:"span",classes:["token",e.type],attributes:{},language:i},o=e.alias;o&&(Array.isArray(o)?Array.prototype.push.apply(s.classes,o):s.classes.push(o)),n.hooks.run("wrap",s);var r="";for(var l in s.attributes)r+=" "+l+'="'+(s.attributes[l]||"").replace(/"/g,"&quot;")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'"'+r+">"+s.content+"</"+s.tag+">"},!t.document)return t.addEventListener?(n.disableWorkerMessageHandler||t.addEventListener("message",function(e){var i=JSON.parse(e.data),a=i.language,s=i.code,o=i.immediateClose;t.postMessage(n.highlight(s,n.languages[a],a)),o&&t.close()},!1),n):n;var d=n.util.currentScript();function u(){n.manual||n.highlightAll()}if(d&&(n.filename=d.src,d.hasAttribute("data-manual")&&(n.manual=!0)),!n.manual){var p=document.readyState;"loading"===p||"interactive"===p&&d&&d.defer?document.addEventListener("DOMContentLoaded",u):window.requestAnimationFrame?window.requestAnimationFrame(u):window.setTimeout(u,16)}return n}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{}),Vs.exports&&(Vs.exports=Zs),void 0!==O&&(O.Prism=Zs),Zs.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Zs.languages.markup.tag.inside["attr-value"].inside.entity=Zs.languages.markup.entity,Zs.languages.markup.doctype.inside["internal-subset"].inside=Zs.languages.markup,Zs.hooks.add("wrap",function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&amp;/,"&"))}),Object.defineProperty(Zs.languages.markup.tag,"addInlined",{value:function(t,e){var i={};i["language-"+e]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Zs.languages[e]},i.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}};a["language-"+e]={pattern:/[\s\S]+/,inside:Zs.languages[e]};var n={};n[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:a},Zs.languages.insertBefore("markup","cdata",n)}}),Object.defineProperty(Zs.languages.markup.tag,"addAttribute",{value:function(t,e){Zs.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Zs.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Zs.languages.html=Zs.languages.markup,Zs.languages.mathml=Zs.languages.markup,Zs.languages.svg=Zs.languages.markup,Zs.languages.xml=Zs.languages.extend("markup",{}),Zs.languages.ssml=Zs.languages.xml,Zs.languages.atom=Zs.languages.xml,Zs.languages.rss=Zs.languages.xml,function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var i=t.languages.markup;i&&(i.tag.addInlined("style","css"),i.tag.addAttribute("style","css"))}(Zs),Zs.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Zs.languages.javascript=Zs.languages.extend("clike",{"class-name":[Zs.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp("(^|[^\\w$])(?:NaN|Infinity|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Zs.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Zs.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+"\\/(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Zs.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Zs.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Zs.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Zs.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Zs.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Zs.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Zs.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Zs.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Zs.languages.markup&&(Zs.languages.markup.tag.addInlined("script","javascript"),Zs.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Zs.languages.js=Zs.languages.javascript,function(){if(void 0!==Zs&&"undefined"!=typeof document){Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var t={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},e="data-src-status",i="loading",a="loaded",n="pre[data-src]:not(["+e+'="'+a+'"]):not(['+e+'="'+i+'"])';Zs.hooks.add("before-highlightall",function(t){t.selector+=", "+n}),Zs.hooks.add("before-sanity-check",function(s){var o=s.element;if(o.matches(n)){s.code="",o.setAttribute(e,i);var r=o.appendChild(document.createElement("CODE"));r.textContent="Loading…";var l=o.getAttribute("data-src"),c=s.language;if("none"===c){var h=(/\.(\w+)$/.exec(l)||[,"none"])[1];c=t[h]||h}Zs.util.setLanguage(r,c),Zs.util.setLanguage(o,c);var d=Zs.plugins.autoloader;d&&d.loadLanguages(c),function(t,i,n){var s=new XMLHttpRequest;s.open("GET",t,!0),s.onreadystatechange=function(){4==s.readyState&&(s.status<400&&s.responseText?function(t){o.setAttribute(e,a);var i=function(t){var e=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(t||"");if(e){var i=Number(e[1]),a=e[2],n=e[3];return a?n?[i,Number(n)]:[i,void 0]:[i,i]}}(o.getAttribute("data-range"));if(i){var n=t.split(/\r\n?|\n/g),s=i[0],l=null==i[1]?n.length:i[1];s<0&&(s+=n.length),s=Math.max(0,Math.min(s-1,n.length)),l<0&&(l+=n.length),l=Math.max(0,Math.min(l,n.length)),t=n.slice(s,l).join("\n"),o.hasAttribute("data-start")||o.setAttribute("data-start",s+1+"")}r.textContent=t,Zs.highlightElement(r)}(s.responseText):s.status>=400?n("✖ Error "+s.status+" while fetching file: "+s.statusText):n("✖ Error: File does not exist or is empty"))},s.send(null)}(l,0,function(t){o.setAttribute(e,"failed"),r.textContent=t})}}),Zs.plugins.fileHighlight={highlight:function(t){for(var e,i=(t||document).querySelectorAll(n),a=0;e=i[a++];)Zs.highlightElement(e)}};var s=!1;Zs.fileHighlight=function(){s||(s=!0),Zs.plugins.fileHighlight.highlight.apply(this,arguments)}}}()),Ws.exports)),$s={doctypeHtml:/^\s*<!doctype\s+html/i,htmlRoot:/^\s*<html[\s>]/i,xmlDecl:/^\s*<\?xml/i,svg:/<svg[\s>]/i,mathml:/<math[\s>]/i,ssml:/<speak[\s>]/i,rss:/<rss[\s>]/i,atom:/<feed[\s>]/i,htmlTagsStrong:/<(?:body|head|script|style|div|span|p|h[1-6])[\s>]|<\/[a-z][\w:-]*>/i,jsonCandidate:/^\s*[\{\[][\s\S]*[\}\]]\s*$/m,jsonDisqualifiers:/\b(function|let|const|=>|class|<\w+)/,cssRules:/\b[a-zA-Z0-9#.*\[\]_:,-\s>+~]+{[^{}]*:[^{}]*}/m,tsSigils:/:\s*(string|number|boolean|any|unknown|void|null|undefined)\b|(?:\binterface\s+\w+|\btype\s+\w+\s*=)/,jsxTags:/<([A-Z][A-Za-z0-9]*)(\s[^>]*)?>[\s\S]*<\/\1>|<([A-Z][A-Za-z0-9]*)(\s[^>]*)?\/>/m,jsCore:/\b(?:function|async\s+function|const|let|var|=>|import\s+|export\s+)/,clike:/#include\s*<|std::|using\s+namespace|namespace\s+\w+;|\bpublic\s+(?:class|interface|enum)\b|using\s+System;/,genericXmlPair:/<([a-zA-Z][\w:-]*)(\s[^>]*)?>[\s\S]*<\/\1>/m};var Us;function qs(t){return t.replaceAll(/&lt;/g,"<").replaceAll(/&gt;/g,">").replaceAll(/&amp;/g,"&").replaceAll(/&quot;/g,'"').replaceAll(/&#39;/g,"'")}function Ys(t){return t.replaceAll(/>lt</g,"><<").replaceAll(/>gt</g,">><").replaceAll(/;</g,"<").replaceAll(/&/g,"").replaceAll(/>amp</g,"><").replaceAll(/&quot;/g,'"').replaceAll(/&#39;/g,"'")}function Xs({code:t,wrap:e,showLineNumbers:a=!0,className:n="",dir:s="ltr",style:o}){const[r,l]=Wi(!1),[c,h]=Wi(!1),d=function(t){const e=t.slice(0,4e3),i=$s.jsCore.test(e),a=$s.tsSigils.test(e),n=$s.jsxTags.test(e);return n&&a?"tsx":n?"jsx":a?"typescript":i?"javascript":$s.doctypeHtml.test(e)||$s.htmlRoot.test(e)?"markup":$s.mathml.test(e)?"mathml":$s.svg.test(e)?"svg":$s.ssml.test(e)?"ssml":$s.rss.test(e)?"rss":$s.atom.test(e)?"atom":$s.xmlDecl.test(e)?"xml":$s.htmlTagsStrong.test(e)||$s.genericXmlPair.test(e)?"markup":$s.jsonCandidate.test(e)&&!$s.jsonDisqualifiers.test(e)&&/^[\s\S]*$/m.test(e)&&!/[;]|\/\/|\/\*|\bfunction\b|\bundefined\b/.test(e)?"json":$s.cssRules.test(e)?"css":$s.clike.test(e)?"clike":/[<>]/.test(e)&&/<\/?[a-zA-Z]/.test(e)?"markup":"plain"}(qs(t)),u=d.toLowerCase(),p=Hs.languages[u],m=Oi(()=>{const e=t;return R.sanitize(e)},[t,p,u]);Oi(()=>t.replace(/\n$/,"").split("\n"),[t]).length;const x=Oi(()=>{const e=Hs.languages[d]||Hs.languages.javascript;return Hs.highlight(t,e,d)},[t,d,r]);/* @__PURE__ */
33
- return i.jsxs("figure",{dir:s,className:["relative my-3 rounded-lg overflow-hidden shadow-sm max-w-[240px] md:max-w-[460px] bg-[#2b2b2b] text-invertBlackWhite border-l-[3.5px] border-l-solid border-l-accent bg-messageBoxReplyColor ",n].join(" "),style:o,children:[
33
+ return i.jsxs("figure",{dir:s,className:["relative my-3 rounded-lg overflow-hidden shadow-sm max-w-[240px] md:max-w-full bg-[#2b2b2b] text-invertBlackWhite border-l-[3.5px] border-l-solid border-l-accent bg-messageBoxReplyColor ",n].join(" "),style:o,children:[
34
34
  /* @__PURE__ */i.jsx("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-white/10",children:/* @__PURE__ */i.jsx("button",{onClick:async function(){try{await navigator.clipboard.writeText(qs(t)),h(!0),setTimeout(()=>h(!1),1200)}catch{}},className:"text-xs px-2 py-1 rounded-md bg-white/10 hover:bg-white/15 text-invertBlackWhite transition","aria-label":"Copy code",children:c?"Copied":"Copy"})}),
35
35
  /* @__PURE__ */i.jsx("div",{className:["font-mono text-[13px] leading-6",e?"whitespace-pre-wrap break-words overflow-visible":"whitespace-pre overflow-x-auto","p-3"].join(" "),children:a?/* @__PURE__ */i.jsx("div",{className:"grid grid-cols-[auto,1fr] gap-x-3",children:/* @__PURE__ */i.jsx("pre",{className:"m-0 p-0",children:/* @__PURE__ */i.jsx("code",{dangerouslySetInnerHTML:{__html:Ys(m)}})})}):/* @__PURE__ */i.jsx("pre",{className:"m-0 p-0",children:/* @__PURE__ */i.jsx("code",{dangerouslySetInnerHTML:{__html:Ys(x)}})})})]})}Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},Prism.languages.webmanifest=Prism.languages.json,Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},Prism.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.languages.markup.doctype.inside["internal-subset"].inside=Prism.languages.markup,Prism.hooks.add("wrap",function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&amp;/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(t,e){var i={};i["language-"+e]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:Prism.languages[e]},i.cdata=/^<!\[CDATA\[|\]\]>$/i;var a={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:i}};a["language-"+e]={pattern:/[\s\S]+/,inside:Prism.languages[e]};var n={};n[t]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return t}),"i"),lookbehind:!0,greedy:!0,inside:a},Prism.languages.insertBefore("markup","cdata",n)}}),Object.defineProperty(Prism.languages.markup.tag,"addAttribute",{value:function(t,e){Prism.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+t+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[e,"language-"+e],inside:Prism.languages[e]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup,Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.ssml=Prism.languages.xml,Prism.languages.atom=Prism.languages.xml,Prism.languages.rss=Prism.languages.xml,function(t){var e=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;t.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+e.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+e.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+e.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+e.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:e,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},t.languages.css.atrule.inside.rest=t.languages.css;var i=t.languages.markup;i&&(i.tag.addInlined("style","css"),i.tag.addAttribute("style","css"))}(Prism),Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp("(^|[^\\w$])(?:NaN|Infinity|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+"\\/(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:Prism.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),Prism.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),Prism.languages.markup&&(Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),Prism.languages.js=Prism.languages.javascript,function(t){var e=t.util.clone(t.languages.javascript),i=/(?:\s|\/\/.*(?!.)|\/\*(?:[^*]|\*(?!\/))\*\/)/.source,a=/(?:\{(?:\{(?:\{[^{}]*\}|[^{}])*\}|[^{}])*\})/.source,n=/(?:\{<S>*\.{3}(?:[^{}]|<BRACES>)*\})/.source;function s(t,e){return t=t.replace(/<S>/g,function(){return i}).replace(/<BRACES>/g,function(){return a}).replace(/<SPREAD>/g,function(){return n}),RegExp(t,e)}n=s(n).source,t.languages.jsx=t.languages.extend("markup",e),t.languages.jsx.tag.pattern=s(/<\/?(?:[\w.:-]+(?:<S>+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|<BRACES>))?|<SPREAD>))*<S>*\/?)?>/.source),t.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,t.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,t.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,t.languages.jsx.tag.inside.comment=e.comment,t.languages.insertBefore("inside","attr-name",{spread:{pattern:s(/<SPREAD>/.source),inside:t.languages.jsx}},t.languages.jsx.tag),t.languages.insertBefore("inside","special-attr",{script:{pattern:s(/=<BRACES>/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:t.languages.jsx}}},t.languages.jsx.tag);var o=function(t){return t?"string"==typeof t?t:"string"==typeof t.content?t.content:t.content.map(o).join(""):""},r=function(e){for(var i=[],a=0;a<e.length;a++){var n=e[a],s=!1;if("string"!=typeof n&&("tag"===n.type&&n.content[0]&&"tag"===n.content[0].type?"</"===n.content[0].content[0].content?i.length>0&&i[i.length-1].tagName===o(n.content[0].content[1])&&i.pop():"/>"===n.content[n.content.length-1].content||i.push({tagName:o(n.content[0].content[1]),openedBraces:0}):i.length>0&&"punctuation"===n.type&&"{"===n.content?i[i.length-1].openedBraces++:i.length>0&&i[i.length-1].openedBraces>0&&"punctuation"===n.type&&"}"===n.content?i[i.length-1].openedBraces--:s=!0),(s||"string"==typeof n)&&i.length>0&&0===i[i.length-1].openedBraces){var l=o(n);a<e.length-1&&("string"==typeof e[a+1]||"plain-text"===e[a+1].type)&&(l+=o(e[a+1]),e.splice(a+1,1)),a>0&&("string"==typeof e[a-1]||"plain-text"===e[a-1].type)&&(l=o(e[a-1])+l,e.splice(a-1,1),a--),e[a]=new t.Token("plain-text",l,null,l)}n.content&&"string"!=typeof n.content&&r(n.content)}};t.hooks.add("after-tokenize",function(t){"jsx"!==t.language&&"tsx"!==t.language||r(t.tokens)})}(Prism),Us||(Us=1,function(t){t.languages.typescript=t.languages.extend("javascript",{"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),t.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete t.languages.typescript.parameter,delete t.languages.typescript["literal-property"];var e=t.languages.extend("typescript",{});delete e["class-name"],t.languages.typescript["class-name"].inside=e,t.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e}}}}),t.languages.ts=t.languages.typescript}(Prism)),function(t){var e=t.util.clone(t.languages.typescript);t.languages.tsx=t.languages.extend("jsx",e),delete t.languages.tsx.parameter,delete t.languages.tsx["literal-property"];var i=t.languages.tsx.tag;i.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+i.pattern.source+")",i.pattern.flags),i.lookbehind=!0}(Prism);const Ks=({message:t})=>{const{copyText:e}=Va(),a=window.getSelection();/* @__PURE__ */
36
36
  return i.jsxs(Bi.Fragment,{children:[
@@ -112,7 +112,7 @@ return i.jsx(Xs,{code:t.value,wrap:!1,showLineNumbers:!0,dir:"ltr"},"bc-"+e);con
112
112
  return i.jsx("code",{className:"bg-messageBoxReplyColor text-invertBlackWhite px-1.5 py-0.5 rounded font-mono text-sm",children:qs(t.value)},`ic-${e}-${o}`);const r=function(t){const e=[];let i=0;const a=[{re:Vo,type:"mention"},{re:zo,type:"url"},{re:Zo,type:"bold"},{re:Ho,type:"line-through"},{re:Wo,type:"italic"}].map(({re:e,type:i})=>({re:e,type:i,match:e.exec(t)}));for(;;){let n=null;for(const t of a)t.match&&(!n||t.match.index<n.index)&&(n={index:t.match.index,source:t,match:t.match});if(!n)break;n.index>i&&e.push({type:"text",raw:t.slice(i,n.index)});const{source:s,match:o}=n,r=o[0],l=["italic","bold","line-through"].includes(s.type)?o[1]:void 0;e.push({type:s.type,raw:r,content:l}),i=n.index+r.length,s.match=s.re.exec(t)}return i<t.length&&e.push({type:"text",raw:t.slice(i)}),e}(t.value);/* @__PURE__ */
113
113
  return i.jsx("div",{dir:Fo(t.value)?"ltr":"rtl",children:/* @__PURE__ */i.jsx(Go,{linkClassName:a,mentionClassName:n,hashtagClassName:s,tokens:r})},`tx-${e}-${o}`)});/* @__PURE__ */
114
114
  return i.jsx(Bi.Fragment,{children:o},"t-"+e)}),[t,a,n,s]);/* @__PURE__ */
115
- return i.jsx("div",{id:"message-content",onDoubleClick:t=>t.stopPropagation(),className:"whitespace-pre-wrap min-w-[240px] max-w-[400px] \n text-wrap break-all sm:break-words leading-[2] font-normal \n text-invertBlackWhite text-[14px] "+e,children:o})}),Uo=({onChangeSpeed:t,speed:e})=>/* @__PURE__ */i.jsx("button",{className:"cursor-pointer h-[18px] rounded-lg p-[1px] bg-[#33323226] text-invertBlackWhite min-w-[35px] text-[10px] flex justify-center items-center opacity-50",onClick:t,children:/* @__PURE__ */i.jsx("span",{children:"x"+e})}),qo=({message:t})=>{const a=Oi(()=>{try{return JSON.parse(t.metadata??"{}")}catch{return{}}},[t.metadata]),n=a.fileHash??"",s=a.file?.originalName??a.name??"file",o=a.file?.size??0,l=r(),c=e(t=>X(t,n)),h=e(e=>St(e,t.uniqueId)),d=c?.uniqueId??"",u=c?.url??null,{speed:p,isPlaying:m,playMode:x,currentMessageId:f}=e(t=>t.voice),y=Hi(()=>{l(Nt())},[l]),g=Hi(()=>{if(!n)return;const e=e=>{l(Rt({threadId:t.threadId,messageTime:t.time,messageId:t.id,audioUrl:e,audioName:s}))};u?m?l(Ot()):e(c?.url+""):l(J({messageId:t.id,threadId:t.threadId,fileHash:n})).unwrap().then(({url:t,hasError:i})=>{!i&&t&&e(t)})},[m,n,u,s,l,t.id,t.threadId]),k=c?.progress??h?.progress??-1,v=!!c&&k>=0&&k<99,_=!!h&&k>=0&&k<99,b=Hi(()=>{v&&c&&l(It({uniqueId:c.uniqueId||"",threadId:c.threadId})),_&&h&&(l(Mt({uniqueId:h.uniqueId,threadId:h.threadId})),l(Lt(h.message.id)))},[l,v,_,c,h]);/* @__PURE__ */
115
+ return i.jsx("div",{id:"message-content",onDoubleClick:t=>t.stopPropagation(),className:"whitespace-pre-wrap \n min-w-[240px]\n text-wrap break-all sm:break-words leading-[2] font-normal \n text-invertBlackWhite text-[14px] "+e,children:o})}),Uo=({onChangeSpeed:t,speed:e})=>/* @__PURE__ */i.jsx("button",{className:"cursor-pointer h-[18px] rounded-lg p-[1px] bg-[#33323226] text-invertBlackWhite min-w-[35px] text-[10px] flex justify-center items-center opacity-50",onClick:t,children:/* @__PURE__ */i.jsx("span",{children:"x"+e})}),qo=({message:t})=>{const a=Oi(()=>{try{return JSON.parse(t.metadata??"{}")}catch{return{}}},[t.metadata]),n=a.fileHash??"",s=a.file?.originalName??a.name??"file",o=a.file?.size??0,l=r(),c=e(t=>X(t,n)),h=e(e=>St(e,t.uniqueId)),d=c?.uniqueId??"",u=c?.url??null,{speed:p,isPlaying:m,playMode:x,currentMessageId:f}=e(t=>t.voice),y=Hi(()=>{l(Nt())},[l]),g=Hi(()=>{if(!n)return;const e=e=>{l(Rt({threadId:t.threadId,messageTime:t.time,messageId:t.id,audioUrl:e,audioName:s}))};u?m?l(Ot()):e(c?.url+""):l(J({messageId:t.id,threadId:t.threadId,fileHash:n})).unwrap().then(({url:t,hasError:i})=>{!i&&t&&e(t)})},[m,n,u,s,l,t.id,t.threadId]),k=c?.progress??h?.progress??-1,v=!!c&&k>=0&&k<99,_=!!h&&k>=0&&k<99,b=Hi(()=>{v&&c&&l(It({uniqueId:c.uniqueId||"",threadId:c.threadId})),_&&h&&(l(Mt({uniqueId:h.uniqueId,threadId:h.threadId})),l(Lt(h.message.id)))},[l,v,_,c,h]);/* @__PURE__ */
116
116
  return i.jsxs("div",{className:"flex items-start p-[2px_0px] justify-end min-w-[180px] ",children:[
117
117
  /* @__PURE__ */i.jsxs("div",{className:"flex flex-col items-end p-[4px] gap-2 w-full",children:[
118
118
  /* @__PURE__ */i.jsx("div",{className:"w-full flex flex-col gap-1",children:x&&t.id===f?/* @__PURE__ */i.jsx("div",{id:"voice-"+t.id,className:"w-full h-[20px] waveContainer min-w-[160px] "}):/* @__PURE__ */i.jsx("div",{className:"flex items-center justify-end",children:/* @__PURE__ */i.jsx(Ft,{className:m?"animate-pulse":""})})}),
@@ -231,15 +231,15 @@ return Fi(e)}(Jr(Kr(function({url:t,...e},i){return Xr(new qr.TileLayer(t,Hr(e,i
231
231
  return i.jsx(el,{draggable:!0,eventHandlers:o(),position:n,ref:a,icon:al})},sl=({onSelect:t})=>{const[e,a]=Wi(null),n=function(t){const e=Wr().map;return Vi(function(){return e.on(t),function(){e.off(t)}},[e,t]),e}({click(e){e.originalEvent.stopPropagation();const{lat:i,lng:n}=e.latlng;a([i,n]),t(i,n)}});return Vi(()=>{const t=n.getContainer();return t.addEventListener("mousedown",t=>t.stopPropagation()),t.addEventListener("touchstart",t=>t.stopPropagation()),t.addEventListener("pointerdown",t=>t.stopPropagation()),()=>{t.removeEventListener("mousedown",t=>t.stopPropagation()),t.removeEventListener("touchstart",t=>t.stopPropagation()),t.removeEventListener("pointerdown",t=>t.stopPropagation())}},[n]),e?/* @__PURE__ */i.jsx(nl,{position:e,onChange:t}):null},ol=({open:t,setOpen:a})=>{const[n,s]=Wi(null),{thread:o}=e(t=>t.threads),r=E();/* @__PURE__ */
232
232
  return i.jsx(v,{open:t,onOpenChange:a,title:/* @__PURE__ */i.jsx("div",{className:"flex items-center justify-between p-4",children:/* @__PURE__ */i.jsx("p",{className:"text-base font-bold text-text",children:"انتخاب موقعیت مکانی"})}),size:"sm",onConfirm:()=>{r(ti({threadId:o?.id??0,lat:n?.lat||0,lng:n?.lng||0,userGroupHash:o?.userGroupHash??""})),a(!1)},onCancel:()=>a(!1),confirmText:"ثبت",cancelText:"انصراف",hasNotPadding:!0,children:/* @__PURE__ */i.jsx("div",{onMouseDown:t=>t.stopPropagation(),onTouchStart:t=>t.stopPropagation(),className:"w-full h-[400px]",children:/* @__PURE__ */i.jsxs(tl,{center:[35.6892,51.389],zoom:13,scrollWheelZoom:!0,dragging:!0,className:"w-full h-full rounded-b-2xl ",children:[
233
233
  /* @__PURE__ */i.jsx(il,{attribution:'© <a href="https://osm.org">OpenStreetMap</a> contributors',url:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"}),
234
- /* @__PURE__ */i.jsx(sl,{onSelect:(t,e)=>s({lat:t,lng:e})})]})})})},rl=({type:t})=>{const[e,a]=Wi(!1),[n,s]=Wi(!1);/* @__PURE__ */
234
+ /* @__PURE__ */i.jsx(sl,{onSelect:(t,e)=>s({lat:t,lng:e})})]})})})},rl=({type:t,disabled:e=!1})=>{const[a,n]=Wi(!1),[s,o]=Wi(!1);/* @__PURE__ */
235
235
  return i.jsxs(i.Fragment,{children:[
236
- /* @__PURE__ */i.jsx(ol,{open:n,setOpen:s}),
237
- /* @__PURE__ */i.jsxs(cn,{open:e,onOpenChange:a,children:[
238
- /* @__PURE__ */i.jsx(hn,{children:"plusIcon"===t?/* @__PURE__ */i.jsx("div",{className:"text-white bg-accent hover:bg-accent rounded-full w-[36px] h-[36px] flex items-center justify-center",children:/* @__PURE__ */i.jsx(fn,{size:15})}):/* @__PURE__ */i.jsx(ei,{size:24,className:"text-accent"})}),
236
+ /* @__PURE__ */i.jsx(ol,{open:s,setOpen:o}),
237
+ /* @__PURE__ */i.jsxs(cn,{open:a,onOpenChange:n,children:[
238
+ /* @__PURE__ */i.jsx(hn,{disabled:e,children:"plusIcon"===t?/* @__PURE__ */i.jsx("div",{className:"text-white bg-accent hover:bg-accent rounded-full w-[36px] h-[36px] flex items-center justify-center",children:/* @__PURE__ */i.jsx(fn,{size:15})}):/* @__PURE__ */i.jsx(ei,{size:24,className:e?"text-iconSecondary":"text-accent"})}),
239
239
  /* @__PURE__ */i.jsx(un,{children:/* @__PURE__ */i.jsx(pn,{sideOffset:4,align:"end",side:"top",onInteractOutside:()=>{},onPointerDown:t=>t.preventDefault(),className:"bg-bgColor p-4 overflow-y-auto rounded-[12px] text-right mb-[30px] shadow-lg z-chatDropDown",children:/* @__PURE__ */i.jsxs("div",{className:"flex flex-col py-3 pl-3 gap-3",children:[
240
- /* @__PURE__ */i.jsx(Vr,{setOpen:a}),
241
- /* @__PURE__ */i.jsx(zr,{setOpen:a,setOpenLocationModal:s})]})})})]})]})},ll=({hasMicAccess:t,onOpenRecord:a})=>{const n=e(t=>t.input.inputTextMessage);/* @__PURE__ */
242
- return i.jsx("div",{className:"cursor-pointer",children:n.trim()?/* @__PURE__ */i.jsx(rl,{type:"attach"}):/* @__PURE__ */i.jsx("div",{onClick:a,children:"granted"===t?/* @__PURE__ */i.jsx(mn,{className:"text-iconSecondary"}):/* @__PURE__ */i.jsx(xn,{className:"text-iconSecondary"})})})},cl=({onSend:t})=>{const a=e(t=>t.input.inputTextMessage),s=e(t=>t.input.inputAttachments),o=e(t=>t.threads.thread?.inputMode??null),{type:r}=o??{},l="forwarding"===r;return a.trim()||l||s.length>0?/* @__PURE__ */i.jsx("button",{type:"button",onMouseDown:t=>{t.preventDefault()},onClick:()=>{t()},className:"text-white bg-accent hover:bg-accent rounded-full w-[36px] h-[36px] flex items-center justify-center transition-colors",children:/* @__PURE__ */i.jsx(n,{className:"rotate-90 scale-y-[-1] text-white min-w-[36px]"})}):/* @__PURE__ */i.jsx(rl,{type:"plusIcon"})};var hl=Object.defineProperty,dl=(t,e,i)=>((t,e,i)=>e in t?hl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);const ul={x:0,y:0,width:0,height:0,unit:"px"},pl=(t,e,i)=>Math.min(Math.max(t,e),i),ml=(t,e)=>t===e||t.width===e.width&&t.height===e.height&&t.x===e.x&&t.y===e.y&&t.unit===e.unit;function xl(t,e,i){return"%"===t.unit?{...ul,...t,unit:"%"}:{unit:"%",x:t.x?t.x/e*100:0,y:t.y?t.y/i*100:0,width:t.width?t.width/e*100:0,height:t.height?t.height/i*100:0}}function fl(t,e,i){return t.unit?"px"===t.unit?{...ul,...t,unit:"px"}:{unit:"px",x:t.x?t.x*e/100:0,y:t.y?t.y*i/100:0,width:t.width?t.width*e/100:0,height:t.height?t.height*i/100:0}:{...ul,...t,unit:"px"}}function yl(t,e,i,a,n,s=0,o=0,r=a,l=n){const c={...t};let h=Math.min(s,a),d=Math.min(o,n),u=Math.min(r,a),p=Math.min(l,n);e&&(e>1?(h=o?o*e:h,d=h/e,u=r*e):(d=s?s/e:d,h=d*e,p=l/e)),c.y<0&&(c.height=Math.max(c.height+c.y,d),c.y=0),c.x<0&&(c.width=Math.max(c.width+c.x,h),c.x=0);const m=a-(c.x+c.width);m<0&&(c.x=Math.min(c.x,a-h),c.width+=m);const x=n-(c.y+c.height);if(x<0&&(c.y=Math.min(c.y,n-d),c.height+=x),c.width<h&&(("sw"===i||"nw"==i)&&(c.x-=h-c.width),c.width=h),c.height<d&&(("nw"===i||"ne"==i)&&(c.y-=d-c.height),c.height=d),c.width>u&&(("sw"===i||"nw"==i)&&(c.x-=u-c.width),c.width=u),c.height>p&&(("nw"===i||"ne"==i)&&(c.y-=p-c.height),c.height=p),e){const t=c.width/c.height;if(t<e){const t=Math.max(c.width/e,d);("nw"===i||"ne"==i)&&(c.y-=t-c.height),c.height=t}else if(t>e){const t=Math.max(c.height*e,h);("sw"===i||"nw"==i)&&(c.x-=t-c.width),c.width=t}}return c}const gl={capture:!0,passive:!1};let kl=0;const vl=class t extends qi{constructor(){super(...arguments),dl(this,"docMoveBound",!1),dl(this,"mouseDownOnCrop",!1),dl(this,"dragStarted",!1),dl(this,"evData",{startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0}),dl(this,"componentRef",Yi()),dl(this,"mediaRef",Yi()),dl(this,"resizeObserver"),dl(this,"initChangeCalled",!1),dl(this,"instanceId","rc-"+kl++),dl(this,"state",{cropIsActive:!1,newCropIsBeingDrawn:!1}),dl(this,"onCropPointerDown",t=>{const{crop:e,disabled:i}=this.props,a=this.getBox();if(!e)return;const n=fl(e,a.width,a.height);if(i)return;t.cancelable&&t.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const s=t.target.dataset.ord,o=!!s;let r=t.clientX,l=t.clientY,c=n.x,h=n.y;if(s){const e=t.clientX-a.x,i=t.clientY-a.y;let o=0,d=0;"ne"===s||"e"==s?(o=e-(n.x+n.width),d=i-n.y,c=n.x,h=n.y+n.height):"se"===s||"s"===s?(o=e-(n.x+n.width),d=i-(n.y+n.height),c=n.x,h=n.y):"sw"===s||"w"==s?(o=e-n.x,d=i-(n.y+n.height),c=n.x+n.width,h=n.y):("nw"===s||"n"==s)&&(o=e-n.x,d=i-n.y,c=n.x+n.width,h=n.y+n.height),r=c+a.x+o,l=h+a.y+d}this.evData={startClientX:r,startClientY:l,startCropX:c,startCropY:h,clientX:t.clientX,clientY:t.clientY,isResize:o,ord:s},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})}),dl(this,"onComponentPointerDown",t=>{const{crop:e,disabled:i,locked:a,keepSelection:n,onChange:s}=this.props,o=this.getBox();if(i||a||n&&e)return;t.cancelable&&t.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const r=t.clientX-o.x,l=t.clientY-o.y,c={unit:"px",x:r,y:l,width:0,height:0};this.evData={startClientX:t.clientX,startClientY:t.clientY,startCropX:r,startCropY:l,clientX:t.clientX,clientY:t.clientY,isResize:!0},this.mouseDownOnCrop=!0,s(fl(c,o.width,o.height),xl(c,o.width,o.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})}),dl(this,"onDocPointerMove",t=>{const{crop:e,disabled:i,onChange:a,onDragStart:n}=this.props,s=this.getBox();if(i||!e||!this.mouseDownOnCrop)return;t.cancelable&&t.preventDefault(),this.dragStarted||(this.dragStarted=!0,n&&n(t));const{evData:o}=this;let r;o.clientX=t.clientX,o.clientY=t.clientY,r=o.isResize?this.resizeCrop():this.dragCrop(),ml(e,r)||a(fl(r,s.width,s.height),xl(r,s.width,s.height))}),dl(this,"onComponentKeyDown",e=>{const{crop:i,disabled:a,onChange:n,onComplete:s}=this.props;if(a)return;const o=e.key;let r=!1;if(!i)return;const l=this.getBox(),c=this.makePixelCrop(l),h=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?t.nudgeStepLarge:e.shiftKey?t.nudgeStepMedium:t.nudgeStep;if("ArrowLeft"===o?(c.x-=h,r=!0):"ArrowRight"===o?(c.x+=h,r=!0):"ArrowUp"===o?(c.y-=h,r=!0):"ArrowDown"===o&&(c.y+=h,r=!0),r){e.cancelable&&e.preventDefault(),c.x=pl(c.x,0,l.width-c.width),c.y=pl(c.y,0,l.height-c.height);const t=fl(c,l.width,l.height),i=xl(c,l.width,l.height);n(t,i),s&&s(t,i)}}),dl(this,"onHandlerKeyDown",(e,i)=>{const{aspect:a=0,crop:n,disabled:s,minWidth:o=0,minHeight:r=0,maxWidth:l,maxHeight:c,onChange:h,onComplete:d}=this.props,u=this.getBox();if(s||!n)return;if("ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.stopPropagation(),e.preventDefault();const p=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?t.nudgeStepLarge:e.shiftKey?t.nudgeStepMedium:t.nudgeStep,m=function(t,e,i,a){const n={...t};return"ArrowLeft"===e?"nw"===a?(n.x-=i,n.y-=i,n.width+=i,n.height+=i):"w"===a?(n.x-=i,n.width+=i):"sw"===a?(n.x-=i,n.width+=i,n.height+=i):"ne"===a?(n.y+=i,n.width-=i,n.height-=i):"e"===a?n.width-=i:"se"===a&&(n.width-=i,n.height-=i):"ArrowRight"===e&&("nw"===a?(n.x+=i,n.y+=i,n.width-=i,n.height-=i):"w"===a?(n.x+=i,n.width-=i):"sw"===a?(n.x+=i,n.width-=i,n.height-=i):"ne"===a?(n.y-=i,n.width+=i,n.height+=i):"e"===a?n.width+=i:"se"===a&&(n.width+=i,n.height+=i)),"ArrowUp"===e?"nw"===a?(n.x-=i,n.y-=i,n.width+=i,n.height+=i):"n"===a?(n.y-=i,n.height+=i):"ne"===a?(n.y-=i,n.width+=i,n.height+=i):"sw"===a?(n.x+=i,n.width-=i,n.height-=i):"s"===a?n.height-=i:"se"===a&&(n.width-=i,n.height-=i):"ArrowDown"===e&&("nw"===a?(n.x+=i,n.y+=i,n.width-=i,n.height-=i):"n"===a?(n.y+=i,n.height-=i):"ne"===a?(n.y+=i,n.width-=i,n.height-=i):"sw"===a?(n.x-=i,n.width+=i,n.height+=i):"s"===a?n.height+=i:"se"===a&&(n.width+=i,n.height+=i)),n}(fl(n,u.width,u.height),e.key,p,i),x=yl(m,a,i,u.width,u.height,o,r,l,c);if(!ml(n,x)){const t=xl(x,u.width,u.height);h(x,t),d&&d(x,t)}}),dl(this,"onDocPointerDone",t=>{const{crop:e,disabled:i,onComplete:a,onDragEnd:n}=this.props,s=this.getBox();this.unbindDocMove(),!i&&e&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,n&&n(t),a&&a(fl(e,s.width,s.height),xl(e,s.width,s.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))}),dl(this,"onDragFocus",()=>{var t;null==(t=this.componentRef.current)||t.scrollTo(0,0)})}get document(){return document}getBox(){const t=this.mediaRef.current;if(!t)return{x:0,y:0,width:0,height:0};const{x:e,y:i,width:a,height:n}=t.getBoundingClientRect();return{x:e,y:i,width:a,height:n}}componentDidUpdate(t){const{crop:e,onComplete:i}=this.props;if(i&&!t.crop&&e){const{width:t,height:a}=this.getBox();t&&a&&i(fl(e,t,a),xl(e,t,a))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,gl),this.document.addEventListener("pointerup",this.onDocPointerDone,gl),this.document.addEventListener("pointercancel",this.onDocPointerDone,gl),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,gl),this.document.removeEventListener("pointerup",this.onDocPointerDone,gl),this.document.removeEventListener("pointercancel",this.onDocPointerDone,gl),this.docMoveBound=!1)}getCropStyle(){const{crop:t}=this.props;if(t)return{top:`${t.y}${t.unit}`,left:`${t.x}${t.unit}`,width:`${t.width}${t.unit}`,height:`${t.height}${t.unit}`}}dragCrop(){const{evData:t}=this,e=this.getBox(),i=this.makePixelCrop(e),a=t.clientX-t.startClientX,n=t.clientY-t.startClientY;return i.x=pl(t.startCropX+a,0,e.width-i.width),i.y=pl(t.startCropY+n,0,e.height-i.height),i}getPointRegion(t,e,i,a){const{evData:n}=this,s=n.clientX-t.x,o=n.clientY-t.y;let r,l;return r=a&&e?"nw"===e||"n"===e||"ne"===e:o<n.startCropY,l=i&&e?"nw"===e||"w"===e||"sw"===e:s<n.startCropX,l?r?"nw":"sw":r?"ne":"se"}resolveMinDimensions(t,e,i=0,a=0){const n=Math.min(i,t.width),s=Math.min(a,t.height);return e&&(n||s)?e>1?n?[n,n/e]:[s*e,s]:s?[s*e,s]:[n,n/e]:[n,s]}resizeCrop(){const{evData:e}=this,{aspect:i=0,maxWidth:a,maxHeight:n}=this.props,s=this.getBox(),[o,r]=this.resolveMinDimensions(s,i,this.props.minWidth,this.props.minHeight);let l=this.makePixelCrop(s);const c=this.getPointRegion(s,e.ord,o,r),h=e.ord||c;let d=e.clientX-e.startClientX,u=e.clientY-e.startClientY;(o&&"nw"===h||"w"===h||"sw"===h)&&(d=Math.min(d,-o)),(r&&"nw"===h||"n"===h||"ne"===h)&&(u=Math.min(u,-r));const p={unit:"px",x:0,y:0,width:0,height:0};"ne"===c?(p.x=e.startCropX,p.width=d,i?(p.height=p.width/i,p.y=e.startCropY-p.height):(p.height=Math.abs(u),p.y=e.startCropY-p.height)):"se"===c?(p.x=e.startCropX,p.y=e.startCropY,p.width=d,p.height=i?p.width/i:u):"sw"===c?(p.x=e.startCropX+d,p.y=e.startCropY,p.width=Math.abs(d),p.height=i?p.width/i:u):"nw"===c&&(p.x=e.startCropX+d,p.width=Math.abs(d),i?(p.height=p.width/i,p.y=e.startCropY-p.height):(p.height=Math.abs(u),p.y=e.startCropY+u));const m=yl(p,i,c,s.width,s.height,o,r,a,n);return i||t.xyOrds.indexOf(h)>-1?l=m:t.xOrds.indexOf(h)>-1?(l.x=m.x,l.width=m.width):t.yOrds.indexOf(h)>-1&&(l.y=m.y,l.height=m.height),l.x=pl(l.x,0,s.width-l.width),l.y=pl(l.y,0,s.height-l.height),l}renderCropSelection(){const{ariaLabels:e=t.defaultProps.ariaLabels,disabled:i,locked:a,renderSelectionAddon:n,ruleOfThirds:s,crop:o}=this.props,r=this.getCropStyle();if(o)/* @__PURE__ */
240
+ /* @__PURE__ */i.jsx(Vr,{setOpen:n}),
241
+ /* @__PURE__ */i.jsx(zr,{setOpen:n,setOpenLocationModal:o})]})})})]})]})},ll=({hasMicAccess:t,onOpenRecord:a})=>{const n=e(t=>t.input.inputTextMessage),s=e(t=>t.threads.thread?.inputMode),o=!!s&&["editing","forwarding"].includes(s.type);/* @__PURE__ */
242
+ return i.jsx("div",{className:"cursor-pointer",children:n.trim()?/* @__PURE__ */i.jsx(rl,{disabled:o,type:"attach"}):/* @__PURE__ */i.jsx("div",{onClick:a,children:"granted"===t?/* @__PURE__ */i.jsx(mn,{className:"text-iconSecondary"}):/* @__PURE__ */i.jsx(xn,{className:"text-iconSecondary"})})})},cl=({onSend:t})=>{const a=e(t=>t.input.inputTextMessage),s=e(t=>t.input.inputAttachments),o=e(t=>t.threads.thread?.inputMode??null),{type:r}=o??{},l="forwarding"===r;return a.trim()||l||s.length>0?/* @__PURE__ */i.jsx("button",{type:"button",onMouseDown:t=>{t.preventDefault()},onClick:()=>{t()},className:"text-white bg-accent hover:bg-accent rounded-full w-[36px] h-[36px] flex items-center justify-center transition-colors",children:/* @__PURE__ */i.jsx(n,{className:"rotate-90 scale-y-[-1] text-white min-w-[36px]"})}):/* @__PURE__ */i.jsx(rl,{type:"plusIcon"})};var hl=Object.defineProperty,dl=(t,e,i)=>((t,e,i)=>e in t?hl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i)(t,"symbol"!=typeof e?e+"":e,i);const ul={x:0,y:0,width:0,height:0,unit:"px"},pl=(t,e,i)=>Math.min(Math.max(t,e),i),ml=(t,e)=>t===e||t.width===e.width&&t.height===e.height&&t.x===e.x&&t.y===e.y&&t.unit===e.unit;function xl(t,e,i){return"%"===t.unit?{...ul,...t,unit:"%"}:{unit:"%",x:t.x?t.x/e*100:0,y:t.y?t.y/i*100:0,width:t.width?t.width/e*100:0,height:t.height?t.height/i*100:0}}function fl(t,e,i){return t.unit?"px"===t.unit?{...ul,...t,unit:"px"}:{unit:"px",x:t.x?t.x*e/100:0,y:t.y?t.y*i/100:0,width:t.width?t.width*e/100:0,height:t.height?t.height*i/100:0}:{...ul,...t,unit:"px"}}function yl(t,e,i,a,n,s=0,o=0,r=a,l=n){const c={...t};let h=Math.min(s,a),d=Math.min(o,n),u=Math.min(r,a),p=Math.min(l,n);e&&(e>1?(h=o?o*e:h,d=h/e,u=r*e):(d=s?s/e:d,h=d*e,p=l/e)),c.y<0&&(c.height=Math.max(c.height+c.y,d),c.y=0),c.x<0&&(c.width=Math.max(c.width+c.x,h),c.x=0);const m=a-(c.x+c.width);m<0&&(c.x=Math.min(c.x,a-h),c.width+=m);const x=n-(c.y+c.height);if(x<0&&(c.y=Math.min(c.y,n-d),c.height+=x),c.width<h&&(("sw"===i||"nw"==i)&&(c.x-=h-c.width),c.width=h),c.height<d&&(("nw"===i||"ne"==i)&&(c.y-=d-c.height),c.height=d),c.width>u&&(("sw"===i||"nw"==i)&&(c.x-=u-c.width),c.width=u),c.height>p&&(("nw"===i||"ne"==i)&&(c.y-=p-c.height),c.height=p),e){const t=c.width/c.height;if(t<e){const t=Math.max(c.width/e,d);("nw"===i||"ne"==i)&&(c.y-=t-c.height),c.height=t}else if(t>e){const t=Math.max(c.height*e,h);("sw"===i||"nw"==i)&&(c.x-=t-c.width),c.width=t}}return c}const gl={capture:!0,passive:!1};let kl=0;const vl=class t extends qi{constructor(){super(...arguments),dl(this,"docMoveBound",!1),dl(this,"mouseDownOnCrop",!1),dl(this,"dragStarted",!1),dl(this,"evData",{startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0}),dl(this,"componentRef",Yi()),dl(this,"mediaRef",Yi()),dl(this,"resizeObserver"),dl(this,"initChangeCalled",!1),dl(this,"instanceId","rc-"+kl++),dl(this,"state",{cropIsActive:!1,newCropIsBeingDrawn:!1}),dl(this,"onCropPointerDown",t=>{const{crop:e,disabled:i}=this.props,a=this.getBox();if(!e)return;const n=fl(e,a.width,a.height);if(i)return;t.cancelable&&t.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const s=t.target.dataset.ord,o=!!s;let r=t.clientX,l=t.clientY,c=n.x,h=n.y;if(s){const e=t.clientX-a.x,i=t.clientY-a.y;let o=0,d=0;"ne"===s||"e"==s?(o=e-(n.x+n.width),d=i-n.y,c=n.x,h=n.y+n.height):"se"===s||"s"===s?(o=e-(n.x+n.width),d=i-(n.y+n.height),c=n.x,h=n.y):"sw"===s||"w"==s?(o=e-n.x,d=i-(n.y+n.height),c=n.x+n.width,h=n.y):("nw"===s||"n"==s)&&(o=e-n.x,d=i-n.y,c=n.x+n.width,h=n.y+n.height),r=c+a.x+o,l=h+a.y+d}this.evData={startClientX:r,startClientY:l,startCropX:c,startCropY:h,clientX:t.clientX,clientY:t.clientY,isResize:o,ord:s},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})}),dl(this,"onComponentPointerDown",t=>{const{crop:e,disabled:i,locked:a,keepSelection:n,onChange:s}=this.props,o=this.getBox();if(i||a||n&&e)return;t.cancelable&&t.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});const r=t.clientX-o.x,l=t.clientY-o.y,c={unit:"px",x:r,y:l,width:0,height:0};this.evData={startClientX:t.clientX,startClientY:t.clientY,startCropX:r,startCropY:l,clientX:t.clientX,clientY:t.clientY,isResize:!0},this.mouseDownOnCrop=!0,s(fl(c,o.width,o.height),xl(c,o.width,o.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})}),dl(this,"onDocPointerMove",t=>{const{crop:e,disabled:i,onChange:a,onDragStart:n}=this.props,s=this.getBox();if(i||!e||!this.mouseDownOnCrop)return;t.cancelable&&t.preventDefault(),this.dragStarted||(this.dragStarted=!0,n&&n(t));const{evData:o}=this;let r;o.clientX=t.clientX,o.clientY=t.clientY,r=o.isResize?this.resizeCrop():this.dragCrop(),ml(e,r)||a(fl(r,s.width,s.height),xl(r,s.width,s.height))}),dl(this,"onComponentKeyDown",e=>{const{crop:i,disabled:a,onChange:n,onComplete:s}=this.props;if(a)return;const o=e.key;let r=!1;if(!i)return;const l=this.getBox(),c=this.makePixelCrop(l),h=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?t.nudgeStepLarge:e.shiftKey?t.nudgeStepMedium:t.nudgeStep;if("ArrowLeft"===o?(c.x-=h,r=!0):"ArrowRight"===o?(c.x+=h,r=!0):"ArrowUp"===o?(c.y-=h,r=!0):"ArrowDown"===o&&(c.y+=h,r=!0),r){e.cancelable&&e.preventDefault(),c.x=pl(c.x,0,l.width-c.width),c.y=pl(c.y,0,l.height-c.height);const t=fl(c,l.width,l.height),i=xl(c,l.width,l.height);n(t,i),s&&s(t,i)}}),dl(this,"onHandlerKeyDown",(e,i)=>{const{aspect:a=0,crop:n,disabled:s,minWidth:o=0,minHeight:r=0,maxWidth:l,maxHeight:c,onChange:h,onComplete:d}=this.props,u=this.getBox();if(s||!n)return;if("ArrowUp"!==e.key&&"ArrowDown"!==e.key&&"ArrowLeft"!==e.key&&"ArrowRight"!==e.key)return;e.stopPropagation(),e.preventDefault();const p=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?t.nudgeStepLarge:e.shiftKey?t.nudgeStepMedium:t.nudgeStep,m=function(t,e,i,a){const n={...t};return"ArrowLeft"===e?"nw"===a?(n.x-=i,n.y-=i,n.width+=i,n.height+=i):"w"===a?(n.x-=i,n.width+=i):"sw"===a?(n.x-=i,n.width+=i,n.height+=i):"ne"===a?(n.y+=i,n.width-=i,n.height-=i):"e"===a?n.width-=i:"se"===a&&(n.width-=i,n.height-=i):"ArrowRight"===e&&("nw"===a?(n.x+=i,n.y+=i,n.width-=i,n.height-=i):"w"===a?(n.x+=i,n.width-=i):"sw"===a?(n.x+=i,n.width-=i,n.height-=i):"ne"===a?(n.y-=i,n.width+=i,n.height+=i):"e"===a?n.width+=i:"se"===a&&(n.width+=i,n.height+=i)),"ArrowUp"===e?"nw"===a?(n.x-=i,n.y-=i,n.width+=i,n.height+=i):"n"===a?(n.y-=i,n.height+=i):"ne"===a?(n.y-=i,n.width+=i,n.height+=i):"sw"===a?(n.x+=i,n.width-=i,n.height-=i):"s"===a?n.height-=i:"se"===a&&(n.width-=i,n.height-=i):"ArrowDown"===e&&("nw"===a?(n.x+=i,n.y+=i,n.width-=i,n.height-=i):"n"===a?(n.y+=i,n.height-=i):"ne"===a?(n.y+=i,n.width-=i,n.height-=i):"sw"===a?(n.x-=i,n.width+=i,n.height+=i):"s"===a?n.height+=i:"se"===a&&(n.width+=i,n.height+=i)),n}(fl(n,u.width,u.height),e.key,p,i),x=yl(m,a,i,u.width,u.height,o,r,l,c);if(!ml(n,x)){const t=xl(x,u.width,u.height);h(x,t),d&&d(x,t)}}),dl(this,"onDocPointerDone",t=>{const{crop:e,disabled:i,onComplete:a,onDragEnd:n}=this.props,s=this.getBox();this.unbindDocMove(),!i&&e&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,n&&n(t),a&&a(fl(e,s.width,s.height),xl(e,s.width,s.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))}),dl(this,"onDragFocus",()=>{var t;null==(t=this.componentRef.current)||t.scrollTo(0,0)})}get document(){return document}getBox(){const t=this.mediaRef.current;if(!t)return{x:0,y:0,width:0,height:0};const{x:e,y:i,width:a,height:n}=t.getBoundingClientRect();return{x:e,y:i,width:a,height:n}}componentDidUpdate(t){const{crop:e,onComplete:i}=this.props;if(i&&!t.crop&&e){const{width:t,height:a}=this.getBox();t&&a&&i(fl(e,t,a),xl(e,t,a))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,gl),this.document.addEventListener("pointerup",this.onDocPointerDone,gl),this.document.addEventListener("pointercancel",this.onDocPointerDone,gl),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,gl),this.document.removeEventListener("pointerup",this.onDocPointerDone,gl),this.document.removeEventListener("pointercancel",this.onDocPointerDone,gl),this.docMoveBound=!1)}getCropStyle(){const{crop:t}=this.props;if(t)return{top:`${t.y}${t.unit}`,left:`${t.x}${t.unit}`,width:`${t.width}${t.unit}`,height:`${t.height}${t.unit}`}}dragCrop(){const{evData:t}=this,e=this.getBox(),i=this.makePixelCrop(e),a=t.clientX-t.startClientX,n=t.clientY-t.startClientY;return i.x=pl(t.startCropX+a,0,e.width-i.width),i.y=pl(t.startCropY+n,0,e.height-i.height),i}getPointRegion(t,e,i,a){const{evData:n}=this,s=n.clientX-t.x,o=n.clientY-t.y;let r,l;return r=a&&e?"nw"===e||"n"===e||"ne"===e:o<n.startCropY,l=i&&e?"nw"===e||"w"===e||"sw"===e:s<n.startCropX,l?r?"nw":"sw":r?"ne":"se"}resolveMinDimensions(t,e,i=0,a=0){const n=Math.min(i,t.width),s=Math.min(a,t.height);return e&&(n||s)?e>1?n?[n,n/e]:[s*e,s]:s?[s*e,s]:[n,n/e]:[n,s]}resizeCrop(){const{evData:e}=this,{aspect:i=0,maxWidth:a,maxHeight:n}=this.props,s=this.getBox(),[o,r]=this.resolveMinDimensions(s,i,this.props.minWidth,this.props.minHeight);let l=this.makePixelCrop(s);const c=this.getPointRegion(s,e.ord,o,r),h=e.ord||c;let d=e.clientX-e.startClientX,u=e.clientY-e.startClientY;(o&&"nw"===h||"w"===h||"sw"===h)&&(d=Math.min(d,-o)),(r&&"nw"===h||"n"===h||"ne"===h)&&(u=Math.min(u,-r));const p={unit:"px",x:0,y:0,width:0,height:0};"ne"===c?(p.x=e.startCropX,p.width=d,i?(p.height=p.width/i,p.y=e.startCropY-p.height):(p.height=Math.abs(u),p.y=e.startCropY-p.height)):"se"===c?(p.x=e.startCropX,p.y=e.startCropY,p.width=d,p.height=i?p.width/i:u):"sw"===c?(p.x=e.startCropX+d,p.y=e.startCropY,p.width=Math.abs(d),p.height=i?p.width/i:u):"nw"===c&&(p.x=e.startCropX+d,p.width=Math.abs(d),i?(p.height=p.width/i,p.y=e.startCropY-p.height):(p.height=Math.abs(u),p.y=e.startCropY+u));const m=yl(p,i,c,s.width,s.height,o,r,a,n);return i||t.xyOrds.indexOf(h)>-1?l=m:t.xOrds.indexOf(h)>-1?(l.x=m.x,l.width=m.width):t.yOrds.indexOf(h)>-1&&(l.y=m.y,l.height=m.height),l.x=pl(l.x,0,s.width-l.width),l.y=pl(l.y,0,s.height-l.height),l}renderCropSelection(){const{ariaLabels:e=t.defaultProps.ariaLabels,disabled:i,locked:a,renderSelectionAddon:n,ruleOfThirds:s,crop:o}=this.props,r=this.getCropStyle();if(o)/* @__PURE__ */
243
243
  return Bi.createElement("div",{style:r,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":e.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!i&&!a&&/* @__PURE__ */Bi.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},/* @__PURE__ */Bi.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),/* @__PURE__ */Bi.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),/* @__PURE__ */Bi.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),/* @__PURE__ */Bi.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),/* @__PURE__ */Bi.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":e.nwDragHandle,onKeyDown:t=>this.onHandlerKeyDown(t,"nw"),role:"button"}),/* @__PURE__ */Bi.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":e.nDragHandle,onKeyDown:t=>this.onHandlerKeyDown(t,"n"),role:"button"}),/* @__PURE__ */Bi.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":e.neDragHandle,onKeyDown:t=>this.onHandlerKeyDown(t,"ne"),role:"button"}),/* @__PURE__ */Bi.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":e.eDragHandle,onKeyDown:t=>this.onHandlerKeyDown(t,"e"),role:"button"}),/* @__PURE__ */Bi.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":e.seDragHandle,onKeyDown:t=>this.onHandlerKeyDown(t,"se"),role:"button"}),/* @__PURE__ */Bi.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":e.sDragHandle,onKeyDown:t=>this.onHandlerKeyDown(t,"s"),role:"button"}),/* @__PURE__ */Bi.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":e.swDragHandle,onKeyDown:t=>this.onHandlerKeyDown(t,"sw"),role:"button"}),/* @__PURE__ */Bi.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":e.wDragHandle,onKeyDown:t=>this.onHandlerKeyDown(t,"w"),role:"button"})),n&&/* @__PURE__ */Bi.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:t=>t.stopPropagation()},n(this.state)),s&&/* @__PURE__ */Bi.createElement(Bi.Fragment,null,/* @__PURE__ */Bi.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),/* @__PURE__ */Bi.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(t){return fl({...ul,...this.props.crop||{}},t.width,t.height)}render(){const{aspect:t,children:e,circularCrop:i,className:a,crop:n,disabled:s,locked:o,style:r,ruleOfThirds:l}=this.props,{cropIsActive:c,newCropIsBeingDrawn:h}=this.state,d=n?this.renderCropSelection():null,u=((...t)=>t.filter(t=>t&&"string"==typeof t).join(" "))("ReactCrop",a,c&&"ReactCrop--active",s&&"ReactCrop--disabled",o&&"ReactCrop--locked",h&&"ReactCrop--new-crop",n&&t&&"ReactCrop--fixed-aspect",n&&i&&"ReactCrop--circular-crop",n&&l&&"ReactCrop--rule-of-thirds",!this.dragStarted&&n&&!n.width&&!n.height&&"ReactCrop--invisible-crop",i&&"ReactCrop--no-animate");/* @__PURE__ */
244
244
  return Bi.createElement("div",{ref:this.componentRef,className:u,style:r},/* @__PURE__ */Bi.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},e),n?/* @__PURE__ */Bi.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},/* @__PURE__ */Bi.createElement("defs",null,/* @__PURE__ */Bi.createElement("mask",{id:"hole-"+this.instanceId},/* @__PURE__ */Bi.createElement("rect",{width:"100%",height:"100%",fill:"white"}),i?/* @__PURE__ */Bi.createElement("ellipse",{cx:`${n.x+n.width/2}${n.unit}`,cy:`${n.y+n.height/2}${n.unit}`,rx:`${n.width/2}${n.unit}`,ry:`${n.height/2}${n.unit}`,fill:"black"}):/* @__PURE__ */Bi.createElement("rect",{x:`${n.x}${n.unit}`,y:`${n.y}${n.unit}`,width:`${n.width}${n.unit}`,height:`${n.height}${n.unit}`,fill:"black"}))),/* @__PURE__ */Bi.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,d)}};dl(vl,"xOrds",["e","w"]),dl(vl,"yOrds",["n","s"]),dl(vl,"xyOrds",["nw","ne","se","sw"]),dl(vl,"nudgeStep",1),dl(vl,"nudgeStepMedium",10),dl(vl,"nudgeStepLarge",100),dl(vl,"defaultProps",{ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}});let _l=vl;const bl=Fi(({image:t,rotate:e,isFlip:a,setCompletedCrop:n},s)=>{const[o,r]=Wi();/* @__PURE__ */
245
245
  return i.jsx(_l,{crop:o,onChange:t=>r(t),onComplete:t=>n(t),children:/* @__PURE__ */i.jsx("img",{src:t??"",onLoad:t=>{const e=t.currentTarget,{width:i,height:a}=e;var n,s;r(function(t,e,i){const a=fl(t,e,i);return a.x=(e-a.width)/2,a.y=(i-a.height)/2,"%"===t.unit?xl(a,e,i):a}(function(t,e,i,a){const n=fl(t,i,a);return t.width&&(n.height=n.width/e),t.height&&(n.width=n.height*e),n.y+n.height>a&&(n.height=a-n.y,n.width=n.height*e),n.x+n.width>i&&(n.width=i-n.x,n.height=n.width/e),"%"===t.unit?xl(n,i,a):n}({unit:"%",width:90},16/9,n=i,s=a),n,s))},ref:s,className:`transition-all duration-100 \n ${0===e?"rotate-0":90===e?"rotate-[-90deg]":180===e?"rotate-[-180deg]":"rotate-[-270deg]"}\n ${a?"scale-x-[-1]":"scale-x-100"}\n lg:!max-w-[900px] !max-h-[75vh] !max-w-[350px]`,alt:"cropped"})})}),wl=Math.PI/180,Pl=({isOpen:t,closeImageEditor:e,selectedImage:a,setEditedImage:n})=>{const[s,o]=Wi("crop"),[r,l]=Wi(!1),[c,h]=Wi(0),[d,u]=Wi(),p=a?.url,m=Ri(null),x=Ri(null),f=Ri("");var y,g;return y=async()=>{d&&m.current&&x.current&&await async function(t,e,i,a=1,n=0){const s=e.getContext("2d");if(!s)throw Error("No 2d context");const o=t.naturalWidth/t.width,r=t.naturalHeight/t.height,l=window.devicePixelRatio;e.width=Math.floor(i.width*o*l),e.height=Math.floor(i.height*r*l),s.scale(l,l),s.imageSmoothingQuality="high";const c=i.x*o,h=i.y*r,d=-n*wl,u=t.naturalWidth/2,p=t.naturalHeight/2;s.save(),s.translate(-c,-h),s.translate(u,p),s.rotate(d),s.scale(a,1),s.translate(-u,-p),s.drawImage(t,0,0),s.restore()}(m.current,x.current,d,r?-1:1,c)},Vi(()=>{const t=setTimeout(()=>{y.apply(void 0,g)},100);return()=>{clearTimeout(t)}},g=[d,c,r]),/* @__PURE__ */i.jsx("div",{className:"z-chatDropDown",children:/* @__PURE__ */i.jsxs(nt,{open:t,children:[