@connectycube/react-ui-kit 0.0.20 → 0.1.0

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 (69) hide show
  1. package/README.md +31 -4
  2. package/configs/dependencies.json +19 -4
  3. package/configs/imports.json +7 -2
  4. package/dist/index.cjs +1 -1
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.js +1 -1
  7. package/dist/index.js.map +1 -1
  8. package/dist/types/components/attachment.d.ts +5 -6
  9. package/dist/types/components/attachment.d.ts.map +1 -1
  10. package/dist/types/components/chat-bubble.d.ts +32 -0
  11. package/dist/types/components/chat-bubble.d.ts.map +1 -0
  12. package/dist/types/components/chat-input.d.ts +27 -0
  13. package/dist/types/components/chat-input.d.ts.map +1 -0
  14. package/dist/types/components/chat-list.d.ts +30 -0
  15. package/dist/types/components/chat-list.d.ts.map +1 -0
  16. package/dist/types/components/checkbox.d.ts +11 -0
  17. package/dist/types/components/checkbox.d.ts.map +1 -0
  18. package/dist/types/components/dialogs-list.d.ts +14 -0
  19. package/dist/types/components/dialogs-list.d.ts.map +1 -0
  20. package/dist/types/components/file-picker.d.ts +1 -1
  21. package/dist/types/components/file-picker.d.ts.map +1 -1
  22. package/dist/types/components/placeholder-text.d.ts.map +1 -1
  23. package/dist/types/components/quick-actions.d.ts +14 -0
  24. package/dist/types/components/quick-actions.d.ts.map +1 -0
  25. package/dist/types/components/status-call.d.ts +8 -0
  26. package/dist/types/components/status-call.d.ts.map +1 -0
  27. package/dist/types/index.d.ts +7 -2
  28. package/dist/types/index.d.ts.map +1 -1
  29. package/gen/components/attachment.jsx +6 -6
  30. package/gen/components/button.jsx +1 -1
  31. package/gen/components/{chat-message.jsx → chat-bubble.jsx} +69 -48
  32. package/gen/components/chat-input.jsx +152 -0
  33. package/gen/components/chat-list.jsx +151 -0
  34. package/gen/components/checkbox.jsx +30 -0
  35. package/gen/components/dialog-item.jsx +1 -1
  36. package/gen/components/dialogs-list.jsx +73 -0
  37. package/gen/components/dismiss-layer.jsx +1 -1
  38. package/gen/components/file-picker.jsx +2 -2
  39. package/gen/components/placeholder-text.jsx +5 -1
  40. package/gen/components/quick-actions.jsx +62 -0
  41. package/gen/components/search.jsx +1 -1
  42. package/gen/components/status-call.jsx +18 -0
  43. package/gen/components/stream-view.jsx +8 -8
  44. package/gen/index.js +14 -2
  45. package/package.json +11 -8
  46. package/src/components/attachment.tsx +16 -14
  47. package/src/components/button.tsx +1 -1
  48. package/src/components/chat-bubble.tsx +176 -0
  49. package/src/components/chat-input.tsx +172 -0
  50. package/src/components/chat-list.tsx +164 -0
  51. package/src/components/checkbox.tsx +40 -0
  52. package/src/components/connectycube-ui/chat-input.tsx +174 -0
  53. package/src/components/dialog-item.tsx +1 -1
  54. package/src/components/dialogs-list.tsx +84 -0
  55. package/src/components/dismiss-layer.tsx +1 -1
  56. package/src/components/file-picker.tsx +3 -3
  57. package/src/components/placeholder-text.tsx +5 -1
  58. package/src/components/quick-actions.tsx +74 -0
  59. package/src/components/search.tsx +1 -1
  60. package/src/components/status-call.tsx +23 -0
  61. package/src/components/stream-view.tsx +8 -8
  62. package/src/index.ts +17 -2
  63. package/dist/types/components/call-message.d.ts +0 -17
  64. package/dist/types/components/call-message.d.ts.map +0 -1
  65. package/dist/types/components/chat-message.d.ts +0 -30
  66. package/dist/types/components/chat-message.d.ts.map +0 -1
  67. package/gen/components/call-message.jsx +0 -62
  68. package/src/components/call-message.tsx +0 -75
  69. package/src/components/chat-message.tsx +0 -138
package/README.md CHANGED
@@ -51,7 +51,7 @@ This will:
51
51
 
52
52
  - Prompt prefer TypeScript or JavaScript language
53
53
  - Copy components and utilities to `src/components/connectycube-ui`
54
- - Install specified dependencies automatically
54
+ - Ask to install specified dependencies if needed
55
55
 
56
56
  ---
57
57
 
@@ -59,9 +59,36 @@ This will:
59
59
 
60
60
  Coming soon...
61
61
 
62
- | Component | Description |
63
- | --------- | ----------- |
64
- | | |
62
+ | Component | Description |
63
+ | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
64
+ | alert-dialog | gets "triggerElement" prop to call dialog with title, description, and confirm/cancel buttons |
65
+ | attachment | defines a URL with mimeType to show image/video/audio/file/failed content; has onReady callback to notify about video/image size measurement is ready |
66
+ | avatar | with online and presence statuses, has fallback icon/text |
67
+ | badge | a badge with variants; similar to shadcn-ui badge |
68
+ | button | a button with variants; the same as shadcn-ui button |
69
+ | chat-bubble | includes <ChatBubbleMessage .../> that is a left/right-sided wrapper with/without avatar, with/without title, includes last sent status and time, usually obtains "attachment", "linkify-text", "link-preview" as children; and includes <ChatBubbleInfo .../> for system/information text with icon |
70
+ | chat-input | auto-size textarea with onSend, onDraft, onTyping, onHeightGrow callbacks and pending state |
71
+ | chat-list | from "virtua" for chat history; has file-picker wrapper for drag-and-drop files; supports quick-actions before a messaging starts; has onScrollStartReached, onScrollEndReached, onListCreate, onListGrow, onListReset callbacks; can react on the chat-input's onHeightGrow with "textareaMeasurement" prop; supports prepending batch messages with loading state |
72
+ | checkbox | the same as shadcn-ui checkbox |
73
+ | dialog-item | basically, it's an element for "dialog-list"; has avatar, name, last-message text, unread badge count, last message status, last message time, and visual selection |
74
+ | dialog-list | from "virtua" for dialog-items; has onScrollStartReached and onScrollEndReached callbacks, loading state, and pending state with skeletons of dialog-items |
75
+ | dismiss-layer | to manage the open/close state of any modal by clicking outside or pressing Esc |
76
+ | file-picker | to chose accepted files, and wrapper component for drag-and-drop accepted files; has onSelectFile and onInvalidFile callbacks |
77
+ | formatted-date | displays the date in a readable format; simple to use "distanceToNow" for message in chat history; supports "language" prop with English (en), Ukrainian (ua), and Greek (el) |
78
+ | input | the same as shadcn-ui input |
79
+ | label | the same as shadcn-ui label |
80
+ | link-preview | displays favicon, title, description, and banner image; uses "thin" prop to be smaller; has onReady callback to notify about image size measurement is ready |
81
+ | linkify-text | displays text with highlighted links; can display skeleton rows in pending state; switching the pending from "true" to "false" calls onReady callback |
82
+ | placeholder-text | renders title or titles in rows in the center of any view; has absolute position |
83
+ | presence | presence status with badge icon and label; can be 'available', 'busy', 'away', 'unknown' |
84
+ | quick-actions | title, description, and an array of strings (actions display as buttons); click on any action calls onAction callback with own text |
85
+ | search | a styled and animated input component with onSearch and onCancel callbacks |
86
+ | spinner | animated-loader; has "loader" and "circle" types (default is "loader"); the "layout" prop (absolute/centered/overlay/flow) defines its position in a view |
87
+ | status-call | define a colorized icon related to call status ('reject', 'notAnswer', 'hungUp', or 'cancel') |
88
+ | status-indicator | displays colorized statuses; statuses and colors defines by config; shows tooltip on mouse over a status |
89
+ | status-sent | shows message's status icon that defines from status like 'wait', 'sent', 'read', or 'lost' |
90
+ | stream-view | local-stream-view, remote-stream-view and fullscreen-stream-view with pip stream |
91
+ | switch | the same as shadcn-ui switch |
65
92
 
66
93
  ---
67
94
 
@@ -16,15 +16,26 @@
16
16
  "@radix-ui/react-slot": "latest",
17
17
  "class-variance-authority": "latest"
18
18
  },
19
- "call-message": {
20
- "lucide-react": "latest"
21
- },
22
- "chat-message": {
19
+ "chat-bubble": {
23
20
  "react-intersection-observer": "latest"
24
21
  },
22
+ "chat-input": {
23
+ "virtua": "latest"
24
+ },
25
+ "chat-list": {
26
+ "lucide-react": "latest",
27
+ "react-textarea-autosize": "latest"
28
+ },
29
+ "checkbox": {
30
+ "@radix-ui/react-checkbox": "latest",
31
+ "lucide-react": "latest"
32
+ },
25
33
  "dialog-item": {
26
34
  "lucide-react": "latest"
27
35
  },
36
+ "dialogs-list": {
37
+ "virtua": "latest"
38
+ },
28
39
  "dismiss-layer": {},
29
40
  "file-picker": {
30
41
  "lucide-react": "latest"
@@ -44,12 +55,16 @@
44
55
  },
45
56
  "placeholder-text": {},
46
57
  "presence": {},
58
+ "quick-actions": {},
47
59
  "search": {
48
60
  "lucide-react": "latest"
49
61
  },
50
62
  "spinner": {
51
63
  "lucide-react": "latest"
52
64
  },
65
+ "status-call": {
66
+ "lucide-react": "latest"
67
+ },
53
68
  "status-indicator": {
54
69
  "@radix-ui/react-tooltip": "latest"
55
70
  },
@@ -4,8 +4,11 @@
4
4
  "avatar": ["utils", "presence"],
5
5
  "badge": ["utils"],
6
6
  "button": ["utils"],
7
- "call-message": ["utils", "formatted-date"],
8
- "chat-message": ["utils", "attachment", "avatar", "formatted-date", "linkify-text", "link-preview", "status-sent"],
7
+ "chat-bubble": ["utils", "avatar", "formatted-date", "status-sent"],
8
+ "chat-input": ["utils", "label"],
9
+ "chat-list": ["utils", "file-picker", "quick-actions", "spinner"],
10
+ "checkbox": ["utils"],
11
+ "dialogs-list": ["utils", "placeholder-text"],
9
12
  "dialog-item": ["utils", "avatar", "presence", "status-sent", "formatted-date", "badge"],
10
13
  "dismiss-layer": ["utils"],
11
14
  "file-picker": ["utils", "label"],
@@ -16,8 +19,10 @@
16
19
  "linkify-text": ["utils"],
17
20
  "placeholder-text": ["utils"],
18
21
  "presence": ["utils"],
22
+ "quick-actions": ["utils"],
19
23
  "search": ["utils", "input"],
20
24
  "spinner": ["utils"],
25
+ "status-call": ["utils"],
21
26
  "status-indicator": ["utils"],
22
27
  "status-sent": ["utils"],
23
28
  "stream-view": ["utils"],
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react"),a=require("@radix-ui/react-alert-dialog"),n=require("@radix-ui/react-slot"),r=require("class-variance-authority"),i=require("clsx"),s=require("tailwind-merge"),o=require("lucide-react"),l=require("@radix-ui/react-avatar"),c=require("date-fns"),d=require("react-intersection-observer"),u=require("linkify-react"),m=require("@radix-ui/react-label"),f=require("@radix-ui/react-tooltip"),h=require("@radix-ui/react-switch");function p(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(a){if("default"!==a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:function(){return e[a]}})}}),t.default=e,Object.freeze(t)}var g=p(a),v=p(l),x=p(f),b=p(h);function w(...e){return s.twMerge(i.clsx(e))}function y(e=8){return(Date.now()/Math.random()).toString(36).replace(".","").slice(0,e)}function N(e){return"string"==typeof e&&e.length>0?`${e[0]?.toUpperCase()}${e.slice(1)}`:""}const P=r.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});const j=t.forwardRef(function({asChild:t=!1,variant:a,size:r,className:i,...s},o){const l=t?n.Slot:"button";return e.jsx(l,{ref:o,...s,className:w(P({variant:a,size:r,className:i}),"transition-all ease-in-out duration-300")})});j.displayName="Button";const k=t.forwardRef(function({title:t="",description:a="",cancelTitle:n="Cancel",actionTitle:r="Confirm",onCancel:i=()=>{},onConfirm:s=()=>{},rootProps:o,triggerElement:l,triggerProps:c,portalProps:d,overlayProps:u,contentProps:m,headerProps:f,titleProps:h,descriptionProps:p,footerProps:v,cancelProps:x,cancelButtonProps:b,actionProps:y,actionButtonProps:N,...P},k){return e.jsx("div",{ref:k,...P,children:e.jsxs(g.Root,{...o,children:[e.jsx(g.Trigger,{asChild:!0,...c,children:l}),e.jsxs(g.Portal,{...d,children:[e.jsx(g.Overlay,{...u,className:w("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",u?.className)}),e.jsxs(g.Content,{...m,className:w("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2em)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",m?.className),children:[e.jsxs("div",{...f,className:w("flex flex-col gap-2 text-center sm:text-left",f?.className),children:[e.jsx(g.Title,{...h,className:w("text-lg font-semibold",h?.className),children:t}),e.jsx(g.Description,{...p,className:w("text-muted-foreground text-sm",p?.className),children:a})]}),e.jsxs("div",{...v,className:w("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",v?.className),children:[e.jsx(g.Cancel,{...x,onClick:i,children:e.jsx(j,{variant:"outline",...b,children:n})}),e.jsx(g.Action,{...y,onClick:s,children:e.jsx(j,{...N,children:r})})]})]})]})]})})});function M({loading:t=!1,layout:a="flow",type:n="default",...r}){const i="circle"===n?o.LoaderCircle:o.Loader;if(!t)return null;const s=e.jsx(i,{strokeWidth:2.5,...r,className:w("animate-spin text-ring","flow"===a&&"mx-auto",r?.className)});switch(a){case"absolute":return e.jsx("div",{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2",children:s});case"centered":return e.jsx("div",{className:"flex items-center justify-center size-full",children:s});case"overlay":return e.jsx("div",{className:"flex items-center justify-center size-full absolute bg-muted/50",children:s});default:return s}}k.displayName="AlertDialog",M.displayName="Spinner";const W=t.forwardRef(function({url:t,pending:a=!1,children:n,...r},i){return e.jsxs("a",{ref:i,target:"_blank",rel:"noopener noreferrer",...r,href:t,className:w("group relative min-h-8 min-w-8 w-full flex items-center justify-center rounded-md overflow-hidden bg-ring/10 hover:bg-ring/20 transition-color duration-300 ease-out cursor-pointer",r?.className),children:[n,e.jsx(M,{loading:a,layout:"overlay"})]})});W.displayName="AttachmentLink";const S=t.forwardRef(function({uid:t,url:a,pending:n=!1,containerProps:r,...i},s){const o=`attachment_audio_${t||y()}`;return e.jsxs("div",{...r,className:w("relative min-h-8 min-w-8 w-full rounded-md overflow-hidden",r?.className),children:[e.jsx("audio",{ref:s,src:a,id:o,controls:!0,...i}),e.jsx(M,{loading:n,layout:"overlay"})]})});const C=t.forwardRef(function({uid:a,url:n,maxSize:r=360,pending:i=!1,onReady:s=()=>{},containerProps:o,...l},c){const d=`attachment_video_${a||y()}`,u=`${r}px`,m=t.useRef(null),[f,h]=t.useState({maxHeight:u,maxWidth:u});return t.useImperativeHandle(c,()=>m.current,[]),e.jsxs("div",{...o,className:w("relative min-h-20 w-full rounded-md overflow-hidden",o?.className),children:[e.jsx("video",{id:d,ref:m,src:n,controls:!0,preload:"metadata",style:f,...l,onCanPlay:e=>{const t=m.current;if(t){const{videoWidth:a,videoHeight:n}=t,i=a/n||1,o=i<1?u:`${Math.round(r/i)}px`,c=i<1?`${Math.round(r*i)}px`:u;h({height:o,width:c,maxHeight:o,maxWidth:c}),l.onCanPlay?.(e),s()}},className:w("size-full",l?.className)}),e.jsx(M,{loading:i,layout:"overlay"})]})});C.displayName="AttachmentVideo";const z=t.forwardRef(function({uid:t,url:a,pending:n=!1,onReady:r=()=>{},linkProps:i,...s},o){const l=`attachment_image_${t||y()}`;return e.jsx(W,{href:a,pending:n,...i,children:e.jsx("img",{ref:o,src:a,id:l,alt:"attachment",...s,className:w("rounded-md object-cover min-h-8 min-w-8 max-h-[360px] group-hover:scale-102 transition-transform duration-300 ease-out",s?.className),onLoad:e=>{s.onLoad?.(e),r()}})})});function G({url:t,name:a,pending:n=!1,iconElement:r,linkProps:i,...s}){const l=`attachment_file_${s.id||y()}`;return e.jsxs(W,{href:t,pending:n,...i,className:w("flex-row gap-1.5 p-2 hover:shadow",i?.className),children:[r||e.jsx(o.File,{id:l,...s,className:w("size-5 shrink-0 text-foreground/80 group-hover:text-foreground duration-300 ease-out",s?.className)}),a&&e.jsx("span",{className:"font-medium line-clamp-1 break-all text-foreground/80 group-hover:text-foreground duration-300 ease-out",children:a})]})}function D({name:t="Unknown file",pending:a=!1,iconElement:n,containerProps:r,...i}){const s=`attachment_failed_${i.id||y()}`;return e.jsxs("div",{...r,className:w("relative min-h-8 min-w-8 w-full flex flex-row items-center justify-center gap-2 px-2 bg-red-600/10 rounded-md overflow-hidden",r?.className),children:[n||e.jsx(o.FileXCorner,{id:s,...i,className:w("size-6 shrink-0 text-red-600",i?.className)}),e.jsx("span",{className:"font-medium line-clamp-1 break-all text-red-600",children:t}),e.jsx(M,{loading:a,layout:"overlay"})]})}z.displayName="AttachmentImage",G.displayName="AttachmentFile",D.displayName="AttachmentFailed";const E=t.memo(function({mimeType:t,...a}){const[n=""]=t?.split("/")||[];if(!a.url)return e.jsx(D,{...a});switch(n){case"image":return e.jsx(z,{...a});case"video":return e.jsx(C,{...a});case"audio":return e.jsx(S,{...a});default:return e.jsx(G,{name:t,...a})}});function R({status:t,...a}){switch(t){case"available":return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...a,className:w("rounded-full size-4.5 text-green-600 bg-white",a?.className),children:e.jsx("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"})});case"busy":return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...a,className:w("rounded-full size-4.5 text-red-600 bg-white",a?.className),children:e.jsx("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M4.5 7.5a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1z"})});case"away":return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...a,className:w("rounded-full size-4.5 text-yellow-500 bg-white",a?.className),children:e.jsx("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71z"})});case"unknown":return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...a,className:w("rounded-full size-4.5 text-gray-500 bg-white",a?.className),children:e.jsx("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M5.496 6.033h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286a.237.237 0 0 0 .241.247m2.325 6.443c.61 0 1.029-.394 1.029-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94 0 .533.425.927 1.01.927z"})});default:return null}}function T({badge:t=!0,status:a,label:n,badgeProps:r,labelProps:i,...s}){const o=N(n||a);return e.jsxs("div",{...s,className:w("flex items-center gap-2",s?.className),children:[t&&e.jsx(R,{status:a,...r}),e.jsx("span",{...i,children:o})]})}E.displayName="Attachment",R.displayName="PresenceBadge",T.displayName="Presence";const A=t.memo(t.forwardRef(function({src:t,name:a="NA",fallbackIconElement:n,online:r,presence:i,className:s,onlineProps:o,presenceProps:l,imageProps:c,fallbackProps:d,...u},m){const f=function(e){const t=e?.trim().split(/\s+/).filter(Boolean)??[];return(t.length>1?`${t[0]?.[0]}${t[1]?.[0]}`:t[0]?.slice(0,2)??"NA").toUpperCase()}(a);return e.jsxs(v.Root,{ref:m,...u,className:w("relative flex size-8 shrink-0 rounded-full",s),children:[e.jsx(v.Image,{...c,src:t,className:w("aspect-square size-full rounded-full overflow-hidden object-cover",c?.className)}),e.jsx(v.Fallback,{...d,className:w("bg-muted size-full rounded-full flex items-center justify-center",d?.className),children:n||f}),r&&e.jsx("div",{...o,className:w("absolute top-0 right-0 rounded-full border-2 bg-green-600 border-green-200 size-3.5",o?.className)}),e.jsx(R,{status:i,...l,className:w("absolute bottom-0 right-0",l?.className)})]})}));A.displayName="Avatar";const F=r.cva("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});const I=t.forwardRef(function({className:t,variant:a,asChild:r=!1,...i},s){const o=r?n.Slot:"span";return e.jsx(o,{ref:s,...i,className:w(F({variant:a}),t)})});function L(e){return(t={})=>{const a=t.width?String(t.width):e.defaultWidth;return e.formats[a]||e.formats[e.defaultWidth]}}function q(e){return(t,a)=>{let n;if("formatting"===(a?.context?String(a.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,r=a?.width?String(a.width):t;n=e.formattingValues[r]||e.formattingValues[t]}else{const t=e.defaultWidth,r=a?.width?String(a.width):e.defaultWidth;n=e.values[r]||e.values[t]}return n[e.argumentCallback?e.argumentCallback(t):t]}}function B(e){return(t,a={})=>{const n=a.width,r=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],i=t.match(r);if(!i)return null;const s=i[0],o=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?function(e,t){for(let a=0;a<e.length;a++)if(t(e[a]))return a;return}(o,e=>e.test(s)):function(e,t){for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t(e[a]))return a;return}(o,e=>e.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=a.valueCallback?a.valueCallback(c):c;return{value:c,rest:t.slice(s.length)}}}function O(e){return(t,a={})=>{const n=t.match(e.matchPattern);if(!n)return null;const r=n[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=a.valueCallback?a.valueCallback(s):s;return{value:s,rest:t.slice(r.length)}}}I.displayName="Badge";const X=Symbol.for("constructDateFrom");function $(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&X in e?e[X](t):e instanceof Date?new e.constructor(t):new Date(t)}let V={};function H(){return V}function _(e,t){return $(t||e,e)}function Y(e,t){const a=H(),n=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,r=_(e,t?.in),i=r.getDay(),s=(i<n?7:0)+i-n;return r.setDate(r.getDate()-s),r.setHours(0,0,0,0),r}function J(e,t,a){const[n,r]=function(e,...t){const a=$.bind(null,e||t.find(e=>"object"==typeof e));return t.map(a)}(a?.in,e,t);return+Y(n,a)===+Y(r,a)}const U={lessThanXSeconds:{one:"λιγότερο από ένα δευτερόλεπτο",other:"λιγότερο από {{count}} δευτερόλεπτα"},xSeconds:{one:"1 δευτερόλεπτο",other:"{{count}} δευτερόλεπτα"},halfAMinute:"μισό λεπτό",lessThanXMinutes:{one:"λιγότερο από ένα λεπτό",other:"λιγότερο από {{count}} λεπτά"},xMinutes:{one:"1 λεπτό",other:"{{count}} λεπτά"},aboutXHours:{one:"περίπου 1 ώρα",other:"περίπου {{count}} ώρες"},xHours:{one:"1 ώρα",other:"{{count}} ώρες"},xDays:{one:"1 ημέρα",other:"{{count}} ημέρες"},aboutXWeeks:{one:"περίπου 1 εβδομάδα",other:"περίπου {{count}} εβδομάδες"},xWeeks:{one:"1 εβδομάδα",other:"{{count}} εβδομάδες"},aboutXMonths:{one:"περίπου 1 μήνας",other:"περίπου {{count}} μήνες"},xMonths:{one:"1 μήνας",other:"{{count}} μήνες"},aboutXYears:{one:"περίπου 1 χρόνο",other:"περίπου {{count}} χρόνια"},xYears:{one:"1 χρόνο",other:"{{count}} χρόνια"},overXYears:{one:"πάνω από 1 χρόνο",other:"πάνω από {{count}} χρόνια"},almostXYears:{one:"περίπου 1 χρόνο",other:"περίπου {{count}} χρόνια"}},Q={date:L({formats:{full:"EEEE, d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"d/M/yy"},defaultWidth:"full"}),time:L({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:L({formats:{full:"{{date}} - {{time}}",long:"{{date}} - {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},K={lastWeek:e=>6===e.getDay()?"'το προηγούμενο' eeee 'στις' p":"'την προηγούμενη' eeee 'στις' p",yesterday:"'χθες στις' p",today:"'σήμερα στις' p",tomorrow:"'αύριο στις' p",nextWeek:"eeee 'στις' p",other:"P"},Z={code:"el",formatDistance:(e,t,a)=>{let n;const r=U[e];return n="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",String(t)),a?.addSuffix?a.comparison&&a.comparison>0?"σε "+n:n+" πριν":n},formatLong:Q,formatRelative:(e,t)=>{const a=K[e];return"function"==typeof a?a(t):a},localize:{ordinalNumber:(e,t)=>{const a=Number(e),n=t?.unit;let r;return r="year"===n||"month"===n?"ος":"week"===n||"dayOfYear"===n||"day"===n||"hour"===n||"date"===n?"η":"ο",a+r},era:q({values:{narrow:["πΧ","μΧ"],abbreviated:["π.Χ.","μ.Χ."],wide:["προ Χριστού","μετά Χριστόν"]},defaultWidth:"wide"}),quarter:q({values:{narrow:["1","2","3","4"],abbreviated:["Τ1","Τ2","Τ3","Τ4"],wide:["1ο τρίμηνο","2ο τρίμηνο","3ο τρίμηνο","4ο τρίμηνο"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:q({values:{narrow:["Ι","Φ","Μ","Α","Μ","Ι","Ι","Α","Σ","Ο","Ν","Δ"],abbreviated:["Ιαν","Φεβ","Μάρ","Απρ","Μάι","Ιούν","Ιούλ","Αύγ","Σεπ","Οκτ","Νοέ","Δεκ"],wide:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"]},defaultWidth:"wide",formattingValues:{narrow:["Ι","Φ","Μ","Α","Μ","Ι","Ι","Α","Σ","Ο","Ν","Δ"],abbreviated:["Ιαν","Φεβ","Μαρ","Απρ","Μαΐ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],wide:["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου"]},defaultFormattingWidth:"wide"}),day:q({values:{narrow:["Κ","Δ","T","Τ","Π","Π","Σ"],short:["Κυ","Δε","Τρ","Τε","Πέ","Πα","Σά"],abbreviated:["Κυρ","Δευ","Τρί","Τετ","Πέμ","Παρ","Σάβ"],wide:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"]},defaultWidth:"wide"}),dayPeriod:q({values:{narrow:{am:"πμ",pm:"μμ",midnight:"μεσάνυχτα",noon:"μεσημέρι",morning:"πρωί",afternoon:"απόγευμα",evening:"βράδυ",night:"νύχτα"},abbreviated:{am:"π.μ.",pm:"μ.μ.",midnight:"μεσάνυχτα",noon:"μεσημέρι",morning:"πρωί",afternoon:"απόγευμα",evening:"βράδυ",night:"νύχτα"},wide:{am:"π.μ.",pm:"μ.μ.",midnight:"μεσάνυχτα",noon:"μεσημέρι",morning:"πρωί",afternoon:"απόγευμα",evening:"βράδυ",night:"νύχτα"}},defaultWidth:"wide"})},match:{ordinalNumber:O({matchPattern:/^(\d+)(ος|η|ο)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:B({matchPatterns:{narrow:/^(πΧ|μΧ)/i,abbreviated:/^(π\.?\s?χ\.?|π\.?\s?κ\.?\s?χ\.?|μ\.?\s?χ\.?|κ\.?\s?χ\.?)/i,wide:/^(προ Χριστο(ύ|υ)|πριν απ(ό|ο) την Κοιν(ή|η) Χρονολογ(ί|ι)α|μετ(ά|α) Χριστ(ό|ο)ν|Κοιν(ή|η) Χρονολογ(ί|ι)α)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^π/i,/^(μ|κ)/i]},defaultParseWidth:"any"}),quarter:B({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^τ[1234]/i,wide:/^[1234]ο? τρ(ί|ι)μηνο/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:B({matchPatterns:{narrow:/^[ιφμαμιιασονδ]/i,abbreviated:/^(ιαν|φεβ|μ[άα]ρ|απρ|μ[άα][ιΐ]|ιο[ύυ]ν|ιο[ύυ]λ|α[ύυ]γ|σεπ|οκτ|νο[έε]|δεκ)/i,wide:/^(μ[άα][ιΐ]|α[ύυ]γο[υύ]στ)(ος|ου)|(ιανου[άα]ρ|φεβρου[άα]ρ|μ[άα]ρτ|απρ[ίι]λ|ιο[ύυ]ν|ιο[ύυ]λ|σεπτ[έε]μβρ|οκτ[ώω]βρ|νο[έε]μβρ|δεκ[έε]μβρ)(ιος|ίου)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^ι/i,/^φ/i,/^μ/i,/^α/i,/^μ/i,/^ι/i,/^ι/i,/^α/i,/^σ/i,/^ο/i,/^ν/i,/^δ/i],any:[/^ια/i,/^φ/i,/^μ[άα]ρ/i,/^απ/i,/^μ[άα][ιΐ]/i,/^ιο[ύυ]ν/i,/^ιο[ύυ]λ/i,/^α[ύυ]/i,/^σ/i,/^ο/i,/^ν/i,/^δ/i]},defaultParseWidth:"any"}),day:B({matchPatterns:{narrow:/^[κδτπσ]/i,short:/^(κυ|δε|τρ|τε|π[εέ]|π[αά]|σ[αά])/i,abbreviated:/^(κυρ|δευ|τρι|τετ|πεμ|παρ|σαβ)/i,wide:/^(κυριακ(ή|η)|δευτ(έ|ε)ρα|τρ(ί|ι)τη|τετ(ά|α)ρτη|π(έ|ε)μπτη|παρασκευ(ή|η)|σ(ά|α)ββατο)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^κ/i,/^δ/i,/^τ/i,/^τ/i,/^π/i,/^π/i,/^σ/i],any:[/^κ/i,/^δ/i,/^τρ/i,/^τε/i,/^π[εέ]/i,/^π[αά]/i,/^σ/i]},defaultParseWidth:"any"}),dayPeriod:B({matchPatterns:{narrow:/^(πμ|μμ|μεσ(ά|α)νυχτα|μεσημ(έ|ε)ρι|πρω(ί|ι)|απ(ό|ο)γευμα|βρ(ά|α)δυ|ν(ύ|υ)χτα)/i,any:/^([πμ]\.?\s?μ\.?|μεσ(ά|α)νυχτα|μεσημ(έ|ε)ρι|πρω(ί|ι)|απ(ό|ο)γευμα|βρ(ά|α)δυ|ν(ύ|υ)χτα)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^πμ|π\.\s?μ\./i,pm:/^μμ|μ\.\s?μ\./i,midnight:/^μεσάν/i,noon:/^μεσημ(έ|ε)/i,morning:/πρω(ί|ι)/i,afternoon:/απ(ό|ο)γευμα/i,evening:/βρ(ά|α)δυ/i,night:/ν(ύ|υ)χτα/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:4}},ee={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},te={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ae={ordinalNumber:(e,t)=>{const a=Number(e),n=a%100;if(n>20||n<10)switch(n%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},era:q({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:q({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:q({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:q({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:q({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},ne={ordinalNumber:O({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:B({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:B({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:B({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:B({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:B({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},re={code:"en-US",formatDistance:(e,t,a)=>{let n;const r=ee[e];return n="string"==typeof r?r:1===t?r.one:r.other.replace("{{count}}",t.toString()),a?.addSuffix?a.comparison&&a.comparison>0?"in "+n:n+" ago":n},formatLong:{date:L({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:L({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:L({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},formatRelative:(e,t,a,n)=>te[e],localize:ae,match:ne,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ie(e,t){if(void 0!==e.one&&1===t)return e.one;const a=t%10,n=t%100;return 1===a&&11!==n?e.singularNominative.replace("{{count}}",String(t)):a>=2&&a<=4&&(n<10||n>20)?e.singularGenitive.replace("{{count}}",String(t)):e.pluralGenitive.replace("{{count}}",String(t))}function se(e){return(t,a)=>a&&a.addSuffix?a.comparison&&a.comparison>0?e.future?ie(e.future,t):"за "+ie(e.regular,t):e.past?ie(e.past,t):ie(e.regular,t)+" тому":ie(e.regular,t)}const oe={lessThanXSeconds:se({regular:{one:"менше секунди",singularNominative:"менше {{count}} секунди",singularGenitive:"менше {{count}} секунд",pluralGenitive:"менше {{count}} секунд"},future:{one:"менше, ніж за секунду",singularNominative:"менше, ніж за {{count}} секунду",singularGenitive:"менше, ніж за {{count}} секунди",pluralGenitive:"менше, ніж за {{count}} секунд"}}),xSeconds:se({regular:{singularNominative:"{{count}} секунда",singularGenitive:"{{count}} секунди",pluralGenitive:"{{count}} секунд"},past:{singularNominative:"{{count}} секунду тому",singularGenitive:"{{count}} секунди тому",pluralGenitive:"{{count}} секунд тому"},future:{singularNominative:"за {{count}} секунду",singularGenitive:"за {{count}} секунди",pluralGenitive:"за {{count}} секунд"}}),halfAMinute:(e,t)=>t&&t.addSuffix?t.comparison&&t.comparison>0?"за півхвилини":"півхвилини тому":"півхвилини",lessThanXMinutes:se({regular:{one:"менше хвилини",singularNominative:"менше {{count}} хвилини",singularGenitive:"менше {{count}} хвилин",pluralGenitive:"менше {{count}} хвилин"},future:{one:"менше, ніж за хвилину",singularNominative:"менше, ніж за {{count}} хвилину",singularGenitive:"менше, ніж за {{count}} хвилини",pluralGenitive:"менше, ніж за {{count}} хвилин"}}),xMinutes:se({regular:{singularNominative:"{{count}} хвилина",singularGenitive:"{{count}} хвилини",pluralGenitive:"{{count}} хвилин"},past:{singularNominative:"{{count}} хвилину тому",singularGenitive:"{{count}} хвилини тому",pluralGenitive:"{{count}} хвилин тому"},future:{singularNominative:"за {{count}} хвилину",singularGenitive:"за {{count}} хвилини",pluralGenitive:"за {{count}} хвилин"}}),aboutXHours:se({regular:{singularNominative:"близько {{count}} години",singularGenitive:"близько {{count}} годин",pluralGenitive:"близько {{count}} годин"},future:{singularNominative:"приблизно за {{count}} годину",singularGenitive:"приблизно за {{count}} години",pluralGenitive:"приблизно за {{count}} годин"}}),xHours:se({regular:{singularNominative:"{{count}} годину",singularGenitive:"{{count}} години",pluralGenitive:"{{count}} годин"}}),xDays:se({regular:{singularNominative:"{{count}} день",singularGenitive:"{{count}} днi",pluralGenitive:"{{count}} днів"}}),aboutXWeeks:se({regular:{singularNominative:"близько {{count}} тижня",singularGenitive:"близько {{count}} тижнів",pluralGenitive:"близько {{count}} тижнів"},future:{singularNominative:"приблизно за {{count}} тиждень",singularGenitive:"приблизно за {{count}} тижні",pluralGenitive:"приблизно за {{count}} тижнів"}}),xWeeks:se({regular:{singularNominative:"{{count}} тиждень",singularGenitive:"{{count}} тижні",pluralGenitive:"{{count}} тижнів"}}),aboutXMonths:se({regular:{singularNominative:"близько {{count}} місяця",singularGenitive:"близько {{count}} місяців",pluralGenitive:"близько {{count}} місяців"},future:{singularNominative:"приблизно за {{count}} місяць",singularGenitive:"приблизно за {{count}} місяці",pluralGenitive:"приблизно за {{count}} місяців"}}),xMonths:se({regular:{singularNominative:"{{count}} місяць",singularGenitive:"{{count}} місяці",pluralGenitive:"{{count}} місяців"}}),aboutXYears:se({regular:{singularNominative:"близько {{count}} року",singularGenitive:"близько {{count}} років",pluralGenitive:"близько {{count}} років"},future:{singularNominative:"приблизно за {{count}} рік",singularGenitive:"приблизно за {{count}} роки",pluralGenitive:"приблизно за {{count}} років"}}),xYears:se({regular:{singularNominative:"{{count}} рік",singularGenitive:"{{count}} роки",pluralGenitive:"{{count}} років"}}),overXYears:se({regular:{singularNominative:"більше {{count}} року",singularGenitive:"більше {{count}} років",pluralGenitive:"більше {{count}} років"},future:{singularNominative:"більше, ніж за {{count}} рік",singularGenitive:"більше, ніж за {{count}} роки",pluralGenitive:"більше, ніж за {{count}} років"}}),almostXYears:se({regular:{singularNominative:"майже {{count}} рік",singularGenitive:"майже {{count}} роки",pluralGenitive:"майже {{count}} років"},future:{singularNominative:"майже за {{count}} рік",singularGenitive:"майже за {{count}} роки",pluralGenitive:"майже за {{count}} років"}})},le={date:L({formats:{full:"EEEE, do MMMM y 'р.'",long:"do MMMM y 'р.'",medium:"d MMM y 'р.'",short:"dd.MM.y"},defaultWidth:"full"}),time:L({formats:{full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},defaultWidth:"full"}),dateTime:L({formats:{full:"{{date}} 'о' {{time}}",long:"{{date}} 'о' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ce=["неділю","понеділок","вівторок","середу","четвер","п’ятницю","суботу"];function de(e){return"'у "+ce[e]+" о' p"}const ue={lastWeek:(e,t,a)=>{const n=_(e),r=n.getDay();return J(n,t,a)?de(r):function(e){const t=ce[e];switch(e){case 0:case 3:case 5:case 6:return"'у минулу "+t+" о' p";case 1:case 2:case 4:return"'у минулий "+t+" о' p"}}(r)},yesterday:"'вчора о' p",today:"'сьогодні о' p",tomorrow:"'завтра о' p",nextWeek:(e,t,a)=>{const n=_(e),r=n.getDay();return J(n,t,a)?de(r):function(e){const t=ce[e];switch(e){case 0:case 3:case 5:case 6:return"'у наступну "+t+" о' p";case 1:case 2:case 4:return"'у наступний "+t+" о' p"}}(r)},other:"P"},me={ordinalNumber:(e,t)=>{const a=String(t?.unit),n=Number(e);let r;return r="date"===a?3===n||23===n?"-є":"-е":"minute"===a||"second"===a||"hour"===a?"-а":"-й",n+r},era:q({values:{narrow:["до н.е.","н.е."],abbreviated:["до н. е.","н. е."],wide:["до нашої ери","нашої ери"]},defaultWidth:"wide"}),quarter:q({values:{narrow:["1","2","3","4"],abbreviated:["1-й кв.","2-й кв.","3-й кв.","4-й кв."],wide:["1-й квартал","2-й квартал","3-й квартал","4-й квартал"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:q({values:{narrow:["С","Л","Б","К","Т","Ч","Л","С","В","Ж","Л","Г"],abbreviated:["січ.","лют.","берез.","квіт.","трав.","черв.","лип.","серп.","верес.","жовт.","листоп.","груд."],wide:["січень","лютий","березень","квітень","травень","червень","липень","серпень","вересень","жовтень","листопад","грудень"]},defaultWidth:"wide",formattingValues:{narrow:["С","Л","Б","К","Т","Ч","Л","С","В","Ж","Л","Г"],abbreviated:["січ.","лют.","берез.","квіт.","трав.","черв.","лип.","серп.","верес.","жовт.","листоп.","груд."],wide:["січня","лютого","березня","квітня","травня","червня","липня","серпня","вересня","жовтня","листопада","грудня"]},defaultFormattingWidth:"wide"}),day:q({values:{narrow:["Н","П","В","С","Ч","П","С"],short:["нд","пн","вт","ср","чт","пт","сб"],abbreviated:["нед","пон","вів","сер","чтв","птн","суб"],wide:["неділя","понеділок","вівторок","середа","четвер","п’ятниця","субота"]},defaultWidth:"wide"}),dayPeriod:q({values:{narrow:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранок",afternoon:"день",evening:"веч.",night:"ніч"},abbreviated:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранок",afternoon:"день",evening:"веч.",night:"ніч"},wide:{am:"ДП",pm:"ПП",midnight:"північ",noon:"полудень",morning:"ранок",afternoon:"день",evening:"вечір",night:"ніч"}},defaultWidth:"any",formattingValues:{narrow:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранку",afternoon:"дня",evening:"веч.",night:"ночі"},abbreviated:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранку",afternoon:"дня",evening:"веч.",night:"ночі"},wide:{am:"ДП",pm:"ПП",midnight:"північ",noon:"полудень",morning:"ранку",afternoon:"дня",evening:"веч.",night:"ночі"}},defaultFormattingWidth:"wide"})},fe={ordinalNumber:O({matchPattern:/^(\d+)(-?(е|й|є|а|я))?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:B({matchPatterns:{narrow:/^((до )?н\.?\s?е\.?)/i,abbreviated:/^((до )?н\.?\s?е\.?)/i,wide:/^(до нашої ери|нашої ери|наша ера)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^д/i,/^н/i]},defaultParseWidth:"any"}),quarter:B({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^[1234](-?[иі]?й?)? кв.?/i,wide:/^[1234](-?[иі]?й?)? квартал/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:B({matchPatterns:{narrow:/^[слбктчвжг]/i,abbreviated:/^(січ|лют|бер(ез)?|квіт|трав|черв|лип|серп|вер(ес)?|жовт|лис(топ)?|груд)\.?/i,wide:/^(січень|січня|лютий|лютого|березень|березня|квітень|квітня|травень|травня|червня|червень|липень|липня|серпень|серпня|вересень|вересня|жовтень|жовтня|листопад[а]?|грудень|грудня)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^с/i,/^л/i,/^б/i,/^к/i,/^т/i,/^ч/i,/^л/i,/^с/i,/^в/i,/^ж/i,/^л/i,/^г/i],any:[/^сі/i,/^лю/i,/^б/i,/^к/i,/^т/i,/^ч/i,/^лип/i,/^се/i,/^в/i,/^ж/i,/^лис/i,/^г/i]},defaultParseWidth:"any"}),day:B({matchPatterns:{narrow:/^[нпвсч]/i,short:/^(нд|пн|вт|ср|чт|пт|сб)\.?/i,abbreviated:/^(нед|пон|вів|сер|че?тв|птн?|суб)\.?/i,wide:/^(неділ[яі]|понеділ[ок][ка]|вівтор[ок][ка]|серед[аи]|четвер(га)?|п\W*?ятниц[яі]|субот[аи])/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^н/i,/^п/i,/^в/i,/^с/i,/^ч/i,/^п/i,/^с/i],any:[/^н/i,/^п[он]/i,/^в/i,/^с[ер]/i,/^ч/i,/^п\W*?[ят]/i,/^с[уб]/i]},defaultParseWidth:"any"}),dayPeriod:B({matchPatterns:{narrow:/^([дп]п|півн\.?|пол\.?|ранок|ранку|день|дня|веч\.?|ніч|ночі)/i,abbreviated:/^([дп]п|півн\.?|пол\.?|ранок|ранку|день|дня|веч\.?|ніч|ночі)/i,wide:/^([дп]п|північ|полудень|ранок|ранку|день|дня|вечір|вечора|ніч|ночі)/i},defaultMatchWidth:"wide",parsePatterns:{any:{am:/^дп/i,pm:/^пп/i,midnight:/^півн/i,noon:/^пол/i,morning:/^р/i,afternoon:/^д[ен]/i,evening:/^в/i,night:/^н/i}},defaultParseWidth:"any"})},he={en:re,el:Z,ua:{code:"uk",formatDistance:(e,t,a)=>(a=a||{},oe[e](t,a)),formatLong:le,formatRelative:(e,t,a,n)=>{const r=ue[e];return"function"==typeof r?r(t,a,n):r},localize:me,match:fe,options:{weekStartsOn:1,firstWeekContainsDate:1}}};function pe(e,t="en",a=!1){const n=he[t]??re;if(a)return c.formatDistanceToNow(e,{locale:n,addSuffix:!0});return c.isToday(e)?c.format(e,"p",{locale:n}):(e=>{const t=c.differenceInCalendarDays(new Date,e);return t>=0&&t<=6})(e)?c.format(e,"eeee",{locale:n}):c.format(e,"P",{locale:n})}const ge=t.memo(t.forwardRef(function({date:t,language:a,distanceToNow:n,...r},i){return t?e.jsx("span",{ref:i,...r,className:w("text-xs text-muted-foreground",r?.className),children:pe(t,a,n)}):null}));function ve(e){const t=Math.floor(e/3600),a=Math.floor(e%3600/60),n=e%60,r=e=>String(e).padStart(2,"0");return t>0?`${t}:${r(a)}:${r(n)}`:`${r(a)}:${r(n)}`}ge.displayName="FormattedDate";const xe=t.memo(t.forwardRef(function({signal:t,info:a,duration:n=0,fromMe:r=!1,isLast:i=!1,iconElement:s,iconProps:l,infoProps:c,formattedDateProps:d,...u},m){const f="hungUp"===t?o.Phone:r?"reject"===t?o.PhoneIncoming:o.PhoneOutgoing:o.PhoneMissed;return e.jsxs("div",{ref:m,...u,className:w("flex items-center justify-center gap-2 rounded-full w-fit bg-ring/20 mx-auto px-3 py-1.5",i?"my-2":"mt-2",u?.className),children:[s||e.jsx(f,{...l,className:w("size-4","hungUp"===t?"text-green-500":"text-red-500",l?.className)}),e.jsx("span",{...c,className:w("text-sm mb-px",c?.className),children:`${a}${n?` - ${ve(n)}`:""}`}),e.jsx(ge,{distanceToNow:!0,...d})]})}));xe.displayName="CallMessage";const be={target:"_blank",rel:"noopener noreferrer"},we=["w-full","w-3/4","w-1/2"];const ye=t.memo(t.forwardRef(function({text:a,pending:n=!1,onReady:r=()=>{},linkifyProps:i,skeletonContainerProps:s,skeletonLineProps:o,skeletonLinesClassNames:l=we,...c},d){const m=t.useRef(n),f=t.useMemo(()=>({...be,...i,className:w("text-blue-500 hover:text-blue-600 hover:underline",i?.className)}),[i]);return t.useEffect(()=>{m.current&&!n&&r(),m.current=n},[n,r]),n?e.jsx("div",{...s,className:w("flex items-start flex-col size-full",s?.className),children:l.map((e,a)=>t.createElement("span",{...o,key:`${e}_${a}`,className:w("bg-muted-foreground animate-pulse rounded-md my-1 h-4",o?.className,e)}))}):e.jsx("p",{ref:d,...c,className:w("wrap-break-word text-base",c?.className),children:e.jsx(u,{options:f,children:a})})}));ye.displayName="LinkifyText";const Ne=e=>{if(0===e.length)return e;const t=document.createElement("div");return t.innerHTML=e,t.textContent.trim()};const Pe=t.memo(t.forwardRef(function({thin:a=!1,title:n="",description:r="",icon:i,iconFallbackElement:s,image:l,onReady:c=()=>{},titleContainerProps:d,iconProps:u,iconFallbackProps:m,titleProps:f,descriptionProps:h,imageContainerProps:p,imageProps:g,...v},x){const[b,y]=t.useState(i),[N,P]=t.useState(l),j=t.useCallback(e=>{g?.onLoad?.(e),c()},[c,g]),k=t.useCallback(e=>{u?.onError?.(e),y(void 0)},[u]),M=t.useCallback(e=>{g?.onError?.(e),P(void 0)},[g]);return e.jsxs("a",{ref:x,target:"_blank",rel:"noopener noreferrer",...v,className:w("transition-color duration-300 ease-out","grid items-start gap-2 p-2 mt-1 overflow-hidden rounded border-l-4 border-l-ring bg-white hover:bg-ring/20",a?"grid-cols-3":"grid-cols-1",v?.className),children:[e.jsxs("div",{...d,className:w("flex items-start gap-2",a?"col-span-3":"col-span-1",d?.className),children:[b?e.jsx("img",{alt:"icon",src:b,...u,onError:k,className:w("size-5",u?.className)}):s||e.jsx(o.Globe,{...m,className:w("size-5",m?.className)}),e.jsx("span",{...f,className:w("text-sm font-bold",a?"line-clamp-1":"line-clamp-2",f?.className),children:Ne(n)})]}),r&&e.jsx("span",{...h,className:w("text-sm line-clamp-5",a?N?"col-span-2":"col-span-3":"col-span-1",h?.className),children:Ne(r)}),N&&e.jsx("div",{...p,className:w("flex items-center justify-center",p?.className),children:e.jsx("img",{alt:"banner",src:N,...g,onLoad:j,onError:M,className:w("rounded max-w-full object-contain",a?"max-h-25":"max-h-60",g?.className)})})]})}));Pe.displayName="LinkPreview";const je=({status:t,...a})=>{switch(t){case"wait":return e.jsx(o.Clock,{...a,className:w("text-gray-500 size-4",a?.className)});case"sent":return e.jsx(o.Check,{...a,className:w("text-gray-500 size-4",a?.className)});case"read":return e.jsx(o.CheckCheck,{...a,className:w("text-gray-500 size-4",a?.className)});case"lost":return e.jsx(o.Ban,{...a,className:w("text-red-500 size-4",a?.className)});default:return null}};je.displayName="StatusSent";const ke=t.memo(t.forwardRef(function({isLast:a,fromMe:n,sameSenderAbove:r,title:i,senderName:s,senderAvatar:o,attachmentElement:l,linkifyTextElement:c,linkPreviewElement:u,onView:m=()=>{},avatarProps:f,bubbleProps:h,titleProps:p,formattedDateProps:g,statusSentProps:v,attachmentProps:x,linkifyTextProps:b,linkPreviewProps:y,children:N,...P},j){const[k,M]=d.useInView(),W=t.useRef(null),S=t.useCallback(e=>{W.current=e,k(e)},[k]),C=Boolean((f||o)&&!r),z=Boolean((f||o)&&r),G=z||Boolean(n&&r);return t.useEffect(()=>{M&&m()},[M,m]),t.useImperativeHandle(j,()=>W.current,[]),e.jsxs("div",{ref:S,...P,className:w("flex relative text-left whitespace-pre-wrap",n?"self-end flex-row-reverse ml-12":"self-start mr-12",a&&"mb-2",G?"mt-1":"mt-2",M&&"view",P?.className),children:[C&&e.jsx(A,{name:s,src:o,imageProps:{className:"bg-ring/30"},fallbackProps:{className:"bg-ring/30"},...f,className:w("mt-1 mr-1",f?.className)}),e.jsxs("div",{className:w("relative flex flex-col min-w-42 max-w-120 rounded-xl px-2 pt-2 pb-6",n?"bg-blue-200":"bg-gray-200",z&&"ml-9",h?.className),children:[(i||s)&&e.jsx("span",{...p,className:w("font-semibold",i&&"mb-1 py-1.5 text-xs text-muted-foreground italic border-b",p?.className),children:i||s}),N,l||(x?e.jsx(E,{...x}):null),c||(b?e.jsx(ye,{...b}):null),u||(y?e.jsx(Pe,{...y}):null),e.jsxs("div",{className:"absolute bottom-1 right-2 flex items-center gap-1 italic",children:[e.jsx(ge,{distanceToNow:!0,...g}),e.jsx(je,{...v})]})]})]})}));const Me=t.memo(t.forwardRef(function({index:t=-1,isPrivateDialog:a,selected:n,onSelect:r=()=>{},name:i,photo:s,userOnline:l,userPresence:c,hasGroupIcon:d,lastSentStatus:u,lastSentDate:m,lastSenderName:f,lastMessage:h,typingStatusText:p,draft:g,draftLabel:v="Draft",unreadCount:x=0,language:b="en",divider:y="bottom",avatarProps:N,contentProps:P,headerProps:j,headerLeftProps:k,groupIconProps:M,nameProps:W,headerRightProps:S,statusSentIconProps:C,formattedDateProps:z,footerProps:G,lastMessageProps:D,draftLabelProps:E,lastSenderNameProps:R,unreadBadgeProps:T,dividerProps:F,...L},q){const B=s||N?.src,O=i||N?.name,X=!!a&&(l||N?.online),$=a?c||N?.presence:void 0,V="top"===y||"both"===y&&0===t,H="bottom"===y||"both"===y;return e.jsxs("div",{ref:q,...L,onClick:r,className:w("flex items-start gap-2 px-2 flex-1 cursor-pointer","transition-colors duration-200 ease-linear",""+(n?"border-l-[0.25em] pl-1 border-l-ring bg-ring/20":"hover:bg-ring/5"),L?.className),children:[e.jsx(A,{src:B,name:O,online:X,presence:$,...N,className:w("size-13 my-2 "+(s?"bg-ring/10":"bg-ring/30"),N?.className)}),e.jsxs("div",{...P,className:w("relative self-stretch flex-1 flex-col text-foreground",P?.className),children:[e.jsxs("div",{...j,className:w("flex items-center justify-between gap-1",j?.className),children:[e.jsxs("div",{...k,className:w("flex items-center gap-1",k?.className),children:[!a&&d&&e.jsx(o.Users,{...M,className:w("text-muted-foreground size-4 min-w-4",M?.className)}),e.jsx("span",{...W,className:w("font-medium text-left line-clamp-1",W?.className),children:i})]}),e.jsxs("div",{...S,className:w("flex items-center gap-1",S?.className),children:[e.jsx(je,{status:u,...C}),e.jsx(ge,{date:m,language:b,...z})]})]}),e.jsxs("div",{...G,className:w("flex items-start justify-between gap-1",G?.className),children:[e.jsx("span",{...D,className:w("text-sm text-left text-muted-foreground break-all line-clamp-2",D?.className),children:p||(g?e.jsxs("span",{children:[e.jsx("span",{...E,className:w("text-red-500 font-medium",E?.className),children:`${v}: `}),g]}):e.jsxs("span",{children:[f&&e.jsx("span",{...R,className:w("font-semibold",R?.className),children:`${f}: `}),h]}))}),x>0&&e.jsx(I,{...T,className:w("bg-ring text-background text-xs rounded-full p-1 h-6 min-w-6 mt-0.5",T?.className),children:x})]}),V&&e.jsx("div",{...F,className:w("absolute -top-px left-0 right-0 border-t",F?.className)}),H&&e.jsx("div",{className:"absolute bottom-0 left-0 right-0 border-b"})]})]})}));Me.displayName="DialogItem";const We=t.forwardRef(function({active:a,onDismiss:n,disableClickOutside:r=!1,disableEscKeyPress:i=!1,disabled:s,...o},l){const c=t.useRef(null);t.useImperativeHandle(l,()=>c.current,[]);const d=t.useCallback(e=>{!r&&a&&e.target===c.current&&n()},[r,a,n]),u=t.useCallback(e=>{!i&&a&&"Escape"===e.key&&n()},[i,a,n]);return t.useEffect(()=>{if(!i&&a)return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[i,a,u]),s||!a?null:e.jsx("div",{ref:c,"aria-hidden":!0,...o,onClick:d,onTouchStart:d,className:w("fixed top-0 left-0 size-full bg-black/20",o?.className)})});We.displayName="DismissLayer";const Se=t.forwardRef(function({...t},a){return e.jsx(m.Root,{ref:a,...t,className:w("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t?.className)})});Se.displayName="Label";const Ce=(e,t,a,n,r)=>{const i=Array.from(e||[]).filter(Boolean);if(0===i.length)return;const s=((e,t)=>{if(0===e.length)return!1;const a="string"==typeof t?t.split(/\s*,\s*|\s+/).map(e=>e.toLowerCase().trim()):null;return null!==a&&0!==a.length&&e.every(e=>{const{type:t,size:n}=e;if("string"!=typeof t||"number"!=typeof n||n<=0||0===t.length)return!1;const r=t.toLowerCase(),[i,s]=r.split("/");return a.some(e=>e.startsWith("*")||e===r||i&&e.endsWith("/*")&&e.startsWith(i)||e.startsWith(".")&&e.slice(1)===s)})})(i,t);s?n(a?i:i[0]?[i[0]]:[]):r()};const ze=t.forwardRef(function({onSelectFile:t=()=>{},onInvalidFile:a=()=>{},multiple:n=!1,accept:r="*/*",iconElement:i,labelProps:s,iconProps:l,...c},d){return e.jsxs(Se,{...s,htmlFor:"file-uploader",className:w("group p-2 rounded-full hover:bg-ring/10 transition-all duration-200 ease-in-out cursor-pointer",s?.className),children:[i||e.jsx(o.Paperclip,{...l,className:w("text-foreground group-hover:scale-110 transition-all duration-200 ease-in-out",l?.className)}),e.jsx("input",{ref:d,id:"file-uploader",type:"file",multiple:n,accept:r,onChange:e=>{Ce(e.currentTarget.files,r,n,t,a),e.currentTarget.value=""},...c,className:w("hidden",c?.className)})]})});ze.displayName="FilePickerInput";const Ge=t.forwardRef(function({onSelectFile:a=()=>{},onInvalidFile:n=()=>{},multiple:r=!1,accept:i="*/*",children:s,iconElement:l,placeholder:c,dropZoneProps:d,placeholderContainerProps:u,iconProps:m,placeholderProps:f,...h},p){const[g,v]=t.useState(!1),x=e=>{e.preventDefault(),e.stopPropagation()};return e.jsxs("div",{ref:p,onDragEnter:e=>{x(e),e.dataTransfer.items&&e.dataTransfer.items.length>0&&v(!0)},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||v(!1)},onDragOver:x,...h,className:w("relative size-full min-h-0",h?.className),children:[s,e.jsx("div",{onDrop:e=>{x(e),v(!1),Ce(e.dataTransfer.files,i,r,a,n),e.dataTransfer.clearData()},...d,className:w("absolute top-0 left-0 size-full","flex items-center justify-center","transition-all duration-300 ease-out","border-2 border-dashed border-ring bg-ring/25 rounded-md",g?"opacity-100 pointer-events-auto visible scale-100":"opacity-0 pointer-events-none invisible scale-98",d?.className),children:e.jsxs("div",{...u,className:w("bg-muted flex flex-row items-center gap-2 rounded-full py-2 px-4 transition-all",g?"scale-100":"scale-90",u?.className),children:[l||e.jsx(o.FilePlusCorner,{absoluteStrokeWidth:!0,...m,className:w("text-ring size-6",m?.className)}),e.jsx("span",{...f,className:w("text-ring text-md font-bold",f?.className),children:c||"Drop files here"})]})})]})});Ge.displayName="FilePickerDropzone";const De=t.forwardRef(function(t,a){return e.jsx("input",{ref:a,...t,className:w("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-10 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t?.className)})});De.displayName="Input";const Ee=t.forwardRef(function({title:t,titles:a=[],rowProps:n,...r},i){const s="string"==typeof t?[t,...a]:a;return e.jsx("div",{ref:i,...r,className:w("absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2",r?.className),children:s.map((t,a)=>e.jsx("div",{...n,className:w("text-center",n?.className),children:t},`placeholder-text-${a}`))})});Ee.displayName="PlaceholderText";const Re=t.forwardRef(function({onSearch:a=()=>{},onCancel:n=()=>{},hasSearchIcon:r=!0,hasCancelIcon:i=!0,searchIconProps:s,cancelIconProps:l,containerProps:c,...d},u){const[m,f]=t.useState("");return e.jsxs("div",{...c,className:w("group relative",c?.className),children:[r&&e.jsx(o.Search,{...s,className:w("absolute top-1/2 left-2 transform -translate-y-1/2 size-5 text-muted-foreground group-focus-within:text-ring",s?.className)}),e.jsx(De,{ref:u,name:"search",placeholder:d?.placeholder||"Search...",value:m,onChange:e=>{const t=e.target.value;f(t),a(t.toLowerCase())},...d,className:w("placeholder:text-muted-foreground focus-visible:ring-ring/50 focus-visible:ring flex",r?"pl-10":"pl-3",i?"pr-10":"pr-3",d?.className)}),i&&e.jsx(o.X,{onClick:()=>{f(""),n()},...l,className:w("absolute top-1/2 right-2 transform -translate-y-1/2 size-5 text-muted-foreground cursor-pointer hover:text-ring transition-all duration-300 ease-in-out",m.length>0?"opacity-100 scale-100":"opacity-0 scale-75 pointer-events-none",l?.className)})]})});Re.displayName="Search";const Te=t.forwardRef(function({status:t="unknown",statusColorConfig:a={unknown:"bg-gray-500 border-gray-600"},statusProps:n,tooltipProviderProps:r,tooltipProps:i,tooltipTriggerProps:s,tooltipPortalProps:o,tooltipContentProps:l,tooltipArrowProps:c,tooltip:d,disabled:u,className:m,...f},h){return u?null:e.jsx("div",{ref:h,...f,className:w("absolute top-0 left-0",m),children:e.jsx(x.Provider,{...r,children:e.jsxs(x.Root,{...i,children:[e.jsx(x.Trigger,{asChild:!0,...s,children:e.jsx("div",{...n,className:w("rounded-full size-4 border border-primary-foreground",a[t],n?.className)})}),e.jsx(x.Portal,{...o,children:e.jsxs(x.Content,{...l,className:w("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",l?.className),children:[e.jsx("span",{children:d||t||"unknown"}),e.jsx(x.Arrow,{...c,className:w("bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px]",c?.className)})]})})]})})})});Te.displayName="StatusIndicator";const Ae=t.forwardRef(function({id:a,stream:n,mirror:r,className:i,muted:s,...o},l){const c=t.useRef(null),d=t.useMemo(()=>a??`stream-${y()}`,[a]),u="boolean"==typeof s&&s,m=r?"scale-x-[-1]":"";return t.useImperativeHandle(l,()=>c.current),t.useEffect(()=>{if(c.current&&n){c.current.srcObject=n;const e=()=>{try{c.current?.play()}catch(e){console.error("Error playing video:",e)}};c.current.onloadedmetadata=()=>{queueMicrotask(e)}}},[n]),n?e.jsx("video",{ref:c,id:d,autoPlay:!0,playsInline:!0,muted:u,...o,className:w("size-full object-contain",m,i)}):null});Ae.displayName="StreamView";const Fe=t.forwardRef(function({muted:t,mirror:a,...n},r){const i="boolean"!=typeof t||t,s="boolean"!=typeof a||a;return e.jsx(Ae,{ref:r,muted:i,mirror:s,...n})});Fe.displayName="LocalStreamView";const Ie=t.forwardRef(function({muted:t,mirror:a,...n},r){const i="boolean"==typeof t&&t,s="boolean"==typeof a&&a;return e.jsx(Ae,{ref:r,muted:i,mirror:s,...n})});Ie.displayName="RemoteStreamView";const Le=t.forwardRef(function({element:a,pipElement:n,navElement:r,hideIconElement:i,showIconElement:s,fullscreenButtonProps:l,fullscreenButtonIconProps:c,pipProps:d,pipButtonProps:u,pipButtonIconProps:m,...f},h){const p=t.useRef(null),[g,v]=t.useState(!1),[x,b]=t.useState(!1),y=t.useCallback(async()=>{const e=p.current;if(e)try{document.fullscreenElement?(await document.exitFullscreen(),v(!1),b(!1)):(await e.requestFullscreen(),v(!0),b(!0))}catch(e){console.error("Fullscreen error:",e)}},[]),N=t.useCallback(()=>{n&&b(e=>!e)},[n]);return t.useImperativeHandle(h,()=>Object.assign(p.current,{isFullscreen:g,isPictureInPicture:x,toggleFullscreen:y,togglePictureInPicture:N}),[g,x,y,N]),t.useEffect(()=>{const e=()=>{v(!!document.fullscreenElement),b(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]),e.jsxs("div",{ref:p,...f,className:w("relative flex items-center justify-center size-full",f?.className),children:[a,e.jsx("button",{onClick:y,...l,className:w("absolute top-2 right-2 p-1 rounded-md bg-black/50 text-white hover:bg-black/80 z-10 shadow-xs shadow-white/25",l?.className),children:g?i||e.jsx(o.Minimize,{...c}):s||e.jsx(o.Maximize,{...c})}),e.jsxs("div",{className:"absolute size-full p-2 flex flex-col justify-end items-center",children:[g&&n&&e.jsxs("div",{className:"relative size-full flex items-end justify-end",children:[x&&e.jsx("div",{...d,className:w("max-w-1/4 max-h-1/4 aspect-4/3 overflow-hidden rounded-md shadow-md shadow-white/25",d?.className),children:n}),e.jsx("button",{onClick:N,...u,className:w("absolute bottom-2 right-2 p-1 rounded-md bg-black/50 text-white hover:bg-black/80 z-10 shadow-xs shadow-white/25",u?.className),children:e.jsx(o.PictureInPicture2,{...m})})]}),g&&r]})]})});Le.displayName="FullscreenStreamView",exports.AlertDialog=k,exports.Attachment=E,exports.AttachmentAudio=S,exports.AttachmentFailed=D,exports.AttachmentFile=G,exports.AttachmentImage=z,exports.AttachmentLink=W,exports.AttachmentVideo=C,exports.Avatar=A,exports.Badge=I,exports.Button=j,exports.CallMessage=xe,exports.ChatMessage=ke,exports.DialogItem=Me,exports.DismissLayer=We,exports.FilePickerDropzone=Ge,exports.FilePickerInput=ze,exports.FormattedDate=ge,exports.FullscreenStreamView=Le,exports.Input=De,exports.Label=Se,exports.LinkPreview=Pe,exports.LinkifyText=ye,exports.LocalStreamView=Fe,exports.PlaceholderText=Ee,exports.Presence=T,exports.PresenceBadge=R,exports.RemoteStreamView=Ie,exports.Search=Re,exports.Spinner=M,exports.StatusIndicator=Te,exports.StatusSent=je,exports.StreamView=Ae,exports.Switch=function(t){return e.jsx(b.Root,{...t,className:w("peer data-[state=checked]:bg-ring data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15em] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring disabled:cursor-not-allowed disabled:opacity-50",t?.className),children:e.jsx(b.Thumb,{className:w("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})},exports.capitalize=N,exports.cn=w,exports.getRandomString=y;
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react"),a=require("@radix-ui/react-alert-dialog"),r=require("@radix-ui/react-slot"),n=require("class-variance-authority"),i=require("clsx"),s=require("tailwind-merge"),o=require("lucide-react"),l=require("@radix-ui/react-avatar"),c=require("react-intersection-observer"),u=require("date-fns"),d=require("react-textarea-autosize"),m=require("@radix-ui/react-label"),f=require("virtua"),h=require("@radix-ui/react-checkbox"),p=require("linkify-react"),g=require("@radix-ui/react-tooltip"),x=require("@radix-ui/react-switch");function v(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(a){if("default"!==a){var r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:function(){return e[a]}})}}),t.default=e,Object.freeze(t)}var b=v(a),w=v(l),y=v(h),N=v(g),j=v(x);function P(...e){return s.twMerge(i.clsx(e))}function k(e=8){return(Date.now()/Math.random()).toString(36).replace(".","").slice(0,e)}function S(e){return"string"==typeof e&&e.length>0?`${e[0]?.toUpperCase()}${e.slice(1)}`:""}const M=n.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*=size-])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});const C=t.forwardRef(function({asChild:t=!1,variant:a,size:n,className:i,...s},o){const l=t?r.Slot:"button";return e.jsx(l,{ref:o,...s,className:P(M({variant:a,size:n,className:i}),"transition-all ease-out duration-300")})});C.displayName="Button";const z=t.forwardRef(function({title:t="",description:a="",cancelTitle:r="Cancel",actionTitle:n="Confirm",onCancel:i=()=>{},onConfirm:s=()=>{},rootProps:o,triggerElement:l,triggerProps:c,portalProps:u,overlayProps:d,contentProps:m,headerProps:f,titleProps:h,descriptionProps:p,footerProps:g,cancelProps:x,cancelButtonProps:v,actionProps:w,actionButtonProps:y,...N},j){return e.jsx("div",{ref:j,...N,children:e.jsxs(b.Root,{...o,children:[e.jsx(b.Trigger,{asChild:!0,...c,children:l}),e.jsxs(b.Portal,{...u,children:[e.jsx(b.Overlay,{...d,className:P("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",d?.className)}),e.jsxs(b.Content,{...m,className:P("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2em)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",m?.className),children:[e.jsxs("div",{...f,className:P("flex flex-col gap-2 text-center sm:text-left",f?.className),children:[e.jsx(b.Title,{...h,className:P("text-lg font-semibold",h?.className),children:t}),e.jsx(b.Description,{...p,className:P("text-muted-foreground text-sm",p?.className),children:a})]}),e.jsxs("div",{...g,className:P("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",g?.className),children:[e.jsx(b.Cancel,{...x,onClick:i,children:e.jsx(C,{variant:"outline",...v,children:r})}),e.jsx(b.Action,{...w,onClick:s,children:e.jsx(C,{...y,children:n})})]})]})]})]})})});function W({loading:t=!1,layout:a="flow",type:r="default",...n}){const i="circle"===r?o.LoaderCircle:o.Loader;if(!t)return null;const s=e.jsx(i,{strokeWidth:2.5,...n,className:P("animate-spin text-ring","flow"===a&&"mx-auto",n?.className)});switch(a){case"absolute":return e.jsx("div",{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2",children:s});case"centered":return e.jsx("div",{className:"flex items-center justify-center size-full",children:s});case"overlay":return e.jsx("div",{className:"flex items-center justify-center size-full absolute bg-muted/50",children:s});default:return s}}z.displayName="AlertDialog",W.displayName="Spinner";const R=t.forwardRef(function({url:t,pending:a=!1,children:r,...n},i){return e.jsxs("a",{ref:i,target:"_blank",rel:"noopener noreferrer",...n,href:t,className:P("group relative min-h-8 min-w-8 w-full flex items-center justify-center rounded-md overflow-hidden bg-ring/10 hover:bg-ring/20 transition-color duration-300 ease-out cursor-pointer",n?.className),children:[r,e.jsx(W,{loading:a,layout:"overlay"})]})});R.displayName="AttachmentLink";const D=t.forwardRef(function({uid:t,url:a,pending:r=!1,containerProps:n,...i},s){const o=`attachment_audio_${t||k()}`;return e.jsxs("div",{...n,className:P("relative min-h-8 min-w-8 w-full rounded-md overflow-hidden",n?.className),children:[e.jsx("audio",{ref:s,src:a,id:o,controls:!0,...i}),e.jsx(W,{loading:r,layout:"overlay"})]})});const G=t.forwardRef(function({uid:a,url:r,maxSize:n=360,pending:i=!1,onReady:s=()=>{},containerProps:o,...l},c){const u=`attachment_video_${a||k()}`,d=`${n}px`,m=t.useRef(null),[f,h]=t.useState({maxHeight:d,maxWidth:d});return t.useImperativeHandle(c,()=>m.current||{},[]),e.jsxs("div",{...o,className:P("relative min-h-20 w-full rounded-md overflow-hidden",o?.className),children:[e.jsx("video",{id:u,ref:m,src:r,controls:!0,preload:"metadata",style:f,...l,onCanPlay:e=>{const t=m.current;if(t){const{videoWidth:a,videoHeight:r}=t,i=a/r||1,o=i<1?d:`${Math.round(n/i)}px`,c=i<1?`${Math.round(n*i)}px`:d;h({height:o,width:c,maxHeight:o,maxWidth:c}),l.onCanPlay?.(e),s()}},className:P("size-full",l?.className)}),e.jsx(W,{loading:i,layout:"overlay"})]})});G.displayName="AttachmentVideo";const E=t.forwardRef(function({uid:t,url:a,pending:r=!1,onReady:n=()=>{},linkProps:i,...s},o){const l=`attachment_image_${t||k()}`;return e.jsx(R,{href:a,pending:r,...i,children:e.jsx("img",{ref:o,src:a,id:l,alt:"attachment",...s,className:P("rounded-md object-cover min-h-8 min-w-8 max-h-[360px] group-hover:scale-102 transition-transform duration-300 ease-out",s?.className),onLoad:e=>{s.onLoad?.(e),n()}})})});function A({url:t,name:a,pending:r=!1,iconElement:n,linkProps:i,...s}){const l=`attachment_file_${s.id||k()}`;return e.jsxs(R,{href:t,pending:r,...i,className:P("flex-row gap-1.5 p-2 hover:shadow",i?.className),children:[n||e.jsx(o.File,{id:l,...s,className:P("size-5 shrink-0 text-foreground/80 group-hover:text-foreground duration-300 ease-out",s?.className)}),a&&e.jsx("span",{className:"font-medium line-clamp-1 break-all text-foreground/80 group-hover:text-foreground duration-300 ease-out",children:a})]})}function T({name:t="Unknown file",pending:a=!1,iconElement:r,containerProps:n,...i}){const s=`attachment_failed_${i.id||k()}`;return e.jsxs("div",{...n,className:P("relative min-h-8 min-w-8 w-full flex flex-row items-center justify-center gap-2 px-2 bg-red-600/10 rounded-md overflow-hidden",n?.className),children:[r||e.jsx(o.FileXCorner,{id:s,...i,className:P("size-6 shrink-0 text-red-600",i?.className)}),e.jsx("span",{className:"font-medium line-clamp-1 break-all text-red-600",children:t}),e.jsx(W,{loading:a,layout:"overlay"})]})}E.displayName="AttachmentImage",A.displayName="AttachmentFile",T.displayName="AttachmentFailed";const I=t.memo(function({mimeType:t,onReady:a=()=>{},containerProps:r={},linkProps:n={},...i}){const[s=""]=t?.split("/")||[];if(!i.url)return e.jsx(T,{...i});switch(s){case"image":return e.jsx(E,{onReady:a,linkProps:n,...i});case"video":return e.jsx(G,{onReady:a,containerProps:r,...i});case"audio":return e.jsx(D,{containerProps:r,...i});default:return e.jsx(A,{name:t,containerProps:r,...i})}});function L({status:t,...a}){switch(t){case"available":return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...a,className:P("rounded-full size-4.5 text-green-600 bg-white",a?.className),children:e.jsx("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"})});case"busy":return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...a,className:P("rounded-full size-4.5 text-red-600 bg-white",a?.className),children:e.jsx("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M4.5 7.5a.5.5 0 0 0 0 1h7a.5.5 0 0 0 0-1z"})});case"away":return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...a,className:P("rounded-full size-4.5 text-yellow-500 bg-white",a?.className),children:e.jsx("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M8 3.5a.5.5 0 0 0-1 0V9a.5.5 0 0 0 .252.434l3.5 2a.5.5 0 0 0 .496-.868L8 8.71z"})});case"unknown":return e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16",...a,className:P("rounded-full size-4.5 text-gray-500 bg-white",a?.className),children:e.jsx("path",{d:"M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0M5.496 6.033h.825c.138 0 .248-.113.266-.25.09-.656.54-1.134 1.342-1.134.686 0 1.314.343 1.314 1.168 0 .635-.374.927-.965 1.371-.673.489-1.206 1.06-1.168 1.987l.003.217a.25.25 0 0 0 .25.246h.811a.25.25 0 0 0 .25-.25v-.105c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.267 0-2.655.59-2.75 2.286a.237.237 0 0 0 .241.247m2.325 6.443c.61 0 1.029-.394 1.029-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94 0 .533.425.927 1.01.927z"})});default:return null}}function F({badge:t=!0,status:a,label:r,badgeProps:n,labelProps:i,...s}){const o=S(r||a);return e.jsxs("div",{...s,className:P("flex items-center gap-2",s?.className),children:[t&&e.jsx(L,{status:a,...n}),e.jsx("span",{...i,children:o})]})}I.displayName="Attachment",L.displayName="PresenceBadge",F.displayName="Presence";const q=t.memo(t.forwardRef(function({src:t,name:a="NA",fallbackIconElement:r,online:n,presence:i,className:s,onlineProps:o,presenceProps:l,imageProps:c,fallbackProps:u,...d},m){const f=function(e){const t=e?.trim().split(/\s+/).filter(Boolean)??[];return(t.length>1?`${t[0]?.[0]}${t[1]?.[0]}`:t[0]?.slice(0,2)??"NA").toUpperCase()}(a);return e.jsxs(w.Root,{ref:m,...d,className:P("relative flex size-8 shrink-0 rounded-full",s),children:[e.jsx(w.Image,{...c,src:t,className:P("aspect-square size-full rounded-full overflow-hidden object-cover",c?.className)}),e.jsx(w.Fallback,{...u,className:P("bg-muted size-full rounded-full flex items-center justify-center",u?.className),children:r||f}),n&&e.jsx("div",{...o,className:P("absolute top-0 right-0 rounded-full border-2 bg-green-600 border-green-200 size-3.5",o?.className)}),e.jsx(L,{status:i,...l,className:P("absolute bottom-0 right-0",l?.className)})]})}));q.displayName="Avatar";const B=n.cva("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});const H=t.forwardRef(function({className:t,variant:a,asChild:n=!1,...i},s){const o=n?r.Slot:"span";return e.jsx(o,{ref:s,...i,className:P(B({variant:a}),t)})});function O(e){return(t={})=>{const a=t.width?String(t.width):e.defaultWidth;return e.formats[a]||e.formats[e.defaultWidth]}}function V(e){return(t,a)=>{let r;if("formatting"===(a?.context?String(a.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,n=a?.width?String(a.width):t;r=e.formattingValues[n]||e.formattingValues[t]}else{const t=e.defaultWidth,n=a?.width?String(a.width):e.defaultWidth;r=e.values[n]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}function X(e){return(t,a={})=>{const r=a.width,n=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(n);if(!i)return null;const s=i[0],o=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(o)?function(e,t){for(let a=0;a<e.length;a++)if(t(e[a]))return a;return}(o,e=>e.test(s)):function(e,t){for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&t(e[a]))return a;return}(o,e=>e.test(s));let c;c=e.valueCallback?e.valueCallback(l):l,c=a.valueCallback?a.valueCallback(c):c;return{value:c,rest:t.slice(s.length)}}}function _(e){return(t,a={})=>{const r=t.match(e.matchPattern);if(!r)return null;const n=r[0],i=t.match(e.parsePattern);if(!i)return null;let s=e.valueCallback?e.valueCallback(i[0]):i[0];s=a.valueCallback?a.valueCallback(s):s;return{value:s,rest:t.slice(n.length)}}}H.displayName="Badge";const $=Symbol.for("constructDateFrom");function Y(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&$ in e?e[$](t):e instanceof Date?new e.constructor(t):new Date(t)}let J={};function U(){return J}function Q(e,t){return Y(t||e,e)}function K(e,t){const a=U(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,n=Q(e,t?.in),i=n.getDay(),s=(i<r?7:0)+i-r;return n.setDate(n.getDate()-s),n.setHours(0,0,0,0),n}function Z(e,t,a){const[r,n]=function(e,...t){const a=Y.bind(null,e||t.find(e=>"object"==typeof e));return t.map(a)}(a?.in,e,t);return+K(r,a)===+K(n,a)}const ee={lessThanXSeconds:{one:"λιγότερο από ένα δευτερόλεπτο",other:"λιγότερο από {{count}} δευτερόλεπτα"},xSeconds:{one:"1 δευτερόλεπτο",other:"{{count}} δευτερόλεπτα"},halfAMinute:"μισό λεπτό",lessThanXMinutes:{one:"λιγότερο από ένα λεπτό",other:"λιγότερο από {{count}} λεπτά"},xMinutes:{one:"1 λεπτό",other:"{{count}} λεπτά"},aboutXHours:{one:"περίπου 1 ώρα",other:"περίπου {{count}} ώρες"},xHours:{one:"1 ώρα",other:"{{count}} ώρες"},xDays:{one:"1 ημέρα",other:"{{count}} ημέρες"},aboutXWeeks:{one:"περίπου 1 εβδομάδα",other:"περίπου {{count}} εβδομάδες"},xWeeks:{one:"1 εβδομάδα",other:"{{count}} εβδομάδες"},aboutXMonths:{one:"περίπου 1 μήνας",other:"περίπου {{count}} μήνες"},xMonths:{one:"1 μήνας",other:"{{count}} μήνες"},aboutXYears:{one:"περίπου 1 χρόνο",other:"περίπου {{count}} χρόνια"},xYears:{one:"1 χρόνο",other:"{{count}} χρόνια"},overXYears:{one:"πάνω από 1 χρόνο",other:"πάνω από {{count}} χρόνια"},almostXYears:{one:"περίπου 1 χρόνο",other:"περίπου {{count}} χρόνια"}},te={date:O({formats:{full:"EEEE, d MMMM y",long:"d MMMM y",medium:"d MMM y",short:"d/M/yy"},defaultWidth:"full"}),time:O({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:O({formats:{full:"{{date}} - {{time}}",long:"{{date}} - {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ae={lastWeek:e=>6===e.getDay()?"'το προηγούμενο' eeee 'στις' p":"'την προηγούμενη' eeee 'στις' p",yesterday:"'χθες στις' p",today:"'σήμερα στις' p",tomorrow:"'αύριο στις' p",nextWeek:"eeee 'στις' p",other:"P"},re={code:"el",formatDistance:(e,t,a)=>{let r;const n=ee[e];return r="string"==typeof n?n:1===t?n.one:n.other.replace("{{count}}",String(t)),a?.addSuffix?a.comparison&&a.comparison>0?"σε "+r:r+" πριν":r},formatLong:te,formatRelative:(e,t)=>{const a=ae[e];return"function"==typeof a?a(t):a},localize:{ordinalNumber:(e,t)=>{const a=Number(e),r=t?.unit;let n;return n="year"===r||"month"===r?"ος":"week"===r||"dayOfYear"===r||"day"===r||"hour"===r||"date"===r?"η":"ο",a+n},era:V({values:{narrow:["πΧ","μΧ"],abbreviated:["π.Χ.","μ.Χ."],wide:["προ Χριστού","μετά Χριστόν"]},defaultWidth:"wide"}),quarter:V({values:{narrow:["1","2","3","4"],abbreviated:["Τ1","Τ2","Τ3","Τ4"],wide:["1ο τρίμηνο","2ο τρίμηνο","3ο τρίμηνο","4ο τρίμηνο"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:V({values:{narrow:["Ι","Φ","Μ","Α","Μ","Ι","Ι","Α","Σ","Ο","Ν","Δ"],abbreviated:["Ιαν","Φεβ","Μάρ","Απρ","Μάι","Ιούν","Ιούλ","Αύγ","Σεπ","Οκτ","Νοέ","Δεκ"],wide:["Ιανουάριος","Φεβρουάριος","Μάρτιος","Απρίλιος","Μάιος","Ιούνιος","Ιούλιος","Αύγουστος","Σεπτέμβριος","Οκτώβριος","Νοέμβριος","Δεκέμβριος"]},defaultWidth:"wide",formattingValues:{narrow:["Ι","Φ","Μ","Α","Μ","Ι","Ι","Α","Σ","Ο","Ν","Δ"],abbreviated:["Ιαν","Φεβ","Μαρ","Απρ","Μαΐ","Ιουν","Ιουλ","Αυγ","Σεπ","Οκτ","Νοε","Δεκ"],wide:["Ιανουαρίου","Φεβρουαρίου","Μαρτίου","Απριλίου","Μαΐου","Ιουνίου","Ιουλίου","Αυγούστου","Σεπτεμβρίου","Οκτωβρίου","Νοεμβρίου","Δεκεμβρίου"]},defaultFormattingWidth:"wide"}),day:V({values:{narrow:["Κ","Δ","T","Τ","Π","Π","Σ"],short:["Κυ","Δε","Τρ","Τε","Πέ","Πα","Σά"],abbreviated:["Κυρ","Δευ","Τρί","Τετ","Πέμ","Παρ","Σάβ"],wide:["Κυριακή","Δευτέρα","Τρίτη","Τετάρτη","Πέμπτη","Παρασκευή","Σάββατο"]},defaultWidth:"wide"}),dayPeriod:V({values:{narrow:{am:"πμ",pm:"μμ",midnight:"μεσάνυχτα",noon:"μεσημέρι",morning:"πρωί",afternoon:"απόγευμα",evening:"βράδυ",night:"νύχτα"},abbreviated:{am:"π.μ.",pm:"μ.μ.",midnight:"μεσάνυχτα",noon:"μεσημέρι",morning:"πρωί",afternoon:"απόγευμα",evening:"βράδυ",night:"νύχτα"},wide:{am:"π.μ.",pm:"μ.μ.",midnight:"μεσάνυχτα",noon:"μεσημέρι",morning:"πρωί",afternoon:"απόγευμα",evening:"βράδυ",night:"νύχτα"}},defaultWidth:"wide"})},match:{ordinalNumber:_({matchPattern:/^(\d+)(ος|η|ο)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:X({matchPatterns:{narrow:/^(πΧ|μΧ)/i,abbreviated:/^(π\.?\s?χ\.?|π\.?\s?κ\.?\s?χ\.?|μ\.?\s?χ\.?|κ\.?\s?χ\.?)/i,wide:/^(προ Χριστο(ύ|υ)|πριν απ(ό|ο) την Κοιν(ή|η) Χρονολογ(ί|ι)α|μετ(ά|α) Χριστ(ό|ο)ν|Κοιν(ή|η) Χρονολογ(ί|ι)α)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^π/i,/^(μ|κ)/i]},defaultParseWidth:"any"}),quarter:X({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^τ[1234]/i,wide:/^[1234]ο? τρ(ί|ι)μηνο/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:X({matchPatterns:{narrow:/^[ιφμαμιιασονδ]/i,abbreviated:/^(ιαν|φεβ|μ[άα]ρ|απρ|μ[άα][ιΐ]|ιο[ύυ]ν|ιο[ύυ]λ|α[ύυ]γ|σεπ|οκτ|νο[έε]|δεκ)/i,wide:/^(μ[άα][ιΐ]|α[ύυ]γο[υύ]στ)(ος|ου)|(ιανου[άα]ρ|φεβρου[άα]ρ|μ[άα]ρτ|απρ[ίι]λ|ιο[ύυ]ν|ιο[ύυ]λ|σεπτ[έε]μβρ|οκτ[ώω]βρ|νο[έε]μβρ|δεκ[έε]μβρ)(ιος|ίου)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^ι/i,/^φ/i,/^μ/i,/^α/i,/^μ/i,/^ι/i,/^ι/i,/^α/i,/^σ/i,/^ο/i,/^ν/i,/^δ/i],any:[/^ια/i,/^φ/i,/^μ[άα]ρ/i,/^απ/i,/^μ[άα][ιΐ]/i,/^ιο[ύυ]ν/i,/^ιο[ύυ]λ/i,/^α[ύυ]/i,/^σ/i,/^ο/i,/^ν/i,/^δ/i]},defaultParseWidth:"any"}),day:X({matchPatterns:{narrow:/^[κδτπσ]/i,short:/^(κυ|δε|τρ|τε|π[εέ]|π[αά]|σ[αά])/i,abbreviated:/^(κυρ|δευ|τρι|τετ|πεμ|παρ|σαβ)/i,wide:/^(κυριακ(ή|η)|δευτ(έ|ε)ρα|τρ(ί|ι)τη|τετ(ά|α)ρτη|π(έ|ε)μπτη|παρασκευ(ή|η)|σ(ά|α)ββατο)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^κ/i,/^δ/i,/^τ/i,/^τ/i,/^π/i,/^π/i,/^σ/i],any:[/^κ/i,/^δ/i,/^τρ/i,/^τε/i,/^π[εέ]/i,/^π[αά]/i,/^σ/i]},defaultParseWidth:"any"}),dayPeriod:X({matchPatterns:{narrow:/^(πμ|μμ|μεσ(ά|α)νυχτα|μεσημ(έ|ε)ρι|πρω(ί|ι)|απ(ό|ο)γευμα|βρ(ά|α)δυ|ν(ύ|υ)χτα)/i,any:/^([πμ]\.?\s?μ\.?|μεσ(ά|α)νυχτα|μεσημ(έ|ε)ρι|πρω(ί|ι)|απ(ό|ο)γευμα|βρ(ά|α)δυ|ν(ύ|υ)χτα)/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^πμ|π\.\s?μ\./i,pm:/^μμ|μ\.\s?μ\./i,midnight:/^μεσάν/i,noon:/^μεσημ(έ|ε)/i,morning:/πρω(ί|ι)/i,afternoon:/απ(ό|ο)γευμα/i,evening:/βρ(ά|α)δυ/i,night:/ν(ύ|υ)χτα/i}},defaultParseWidth:"any"})},options:{weekStartsOn:1,firstWeekContainsDate:4}},ne={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},ie={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},se={ordinalNumber:(e,t)=>{const a=Number(e),r=a%100;if(r>20||r<10)switch(r%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd"}return a+"th"},era:V({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:V({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:V({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:V({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:V({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},oe={ordinalNumber:_({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:X({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:X({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:X({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:X({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:X({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},le={code:"en-US",formatDistance:(e,t,a)=>{let r;const n=ne[e];return r="string"==typeof n?n:1===t?n.one:n.other.replace("{{count}}",t.toString()),a?.addSuffix?a.comparison&&a.comparison>0?"in "+r:r+" ago":r},formatLong:{date:O({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:O({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:O({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},formatRelative:(e,t,a,r)=>ie[e],localize:se,match:oe,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ce(e,t){if(void 0!==e.one&&1===t)return e.one;const a=t%10,r=t%100;return 1===a&&11!==r?e.singularNominative.replace("{{count}}",String(t)):a>=2&&a<=4&&(r<10||r>20)?e.singularGenitive.replace("{{count}}",String(t)):e.pluralGenitive.replace("{{count}}",String(t))}function ue(e){return(t,a)=>a&&a.addSuffix?a.comparison&&a.comparison>0?e.future?ce(e.future,t):"за "+ce(e.regular,t):e.past?ce(e.past,t):ce(e.regular,t)+" тому":ce(e.regular,t)}const de={lessThanXSeconds:ue({regular:{one:"менше секунди",singularNominative:"менше {{count}} секунди",singularGenitive:"менше {{count}} секунд",pluralGenitive:"менше {{count}} секунд"},future:{one:"менше, ніж за секунду",singularNominative:"менше, ніж за {{count}} секунду",singularGenitive:"менше, ніж за {{count}} секунди",pluralGenitive:"менше, ніж за {{count}} секунд"}}),xSeconds:ue({regular:{singularNominative:"{{count}} секунда",singularGenitive:"{{count}} секунди",pluralGenitive:"{{count}} секунд"},past:{singularNominative:"{{count}} секунду тому",singularGenitive:"{{count}} секунди тому",pluralGenitive:"{{count}} секунд тому"},future:{singularNominative:"за {{count}} секунду",singularGenitive:"за {{count}} секунди",pluralGenitive:"за {{count}} секунд"}}),halfAMinute:(e,t)=>t&&t.addSuffix?t.comparison&&t.comparison>0?"за півхвилини":"півхвилини тому":"півхвилини",lessThanXMinutes:ue({regular:{one:"менше хвилини",singularNominative:"менше {{count}} хвилини",singularGenitive:"менше {{count}} хвилин",pluralGenitive:"менше {{count}} хвилин"},future:{one:"менше, ніж за хвилину",singularNominative:"менше, ніж за {{count}} хвилину",singularGenitive:"менше, ніж за {{count}} хвилини",pluralGenitive:"менше, ніж за {{count}} хвилин"}}),xMinutes:ue({regular:{singularNominative:"{{count}} хвилина",singularGenitive:"{{count}} хвилини",pluralGenitive:"{{count}} хвилин"},past:{singularNominative:"{{count}} хвилину тому",singularGenitive:"{{count}} хвилини тому",pluralGenitive:"{{count}} хвилин тому"},future:{singularNominative:"за {{count}} хвилину",singularGenitive:"за {{count}} хвилини",pluralGenitive:"за {{count}} хвилин"}}),aboutXHours:ue({regular:{singularNominative:"близько {{count}} години",singularGenitive:"близько {{count}} годин",pluralGenitive:"близько {{count}} годин"},future:{singularNominative:"приблизно за {{count}} годину",singularGenitive:"приблизно за {{count}} години",pluralGenitive:"приблизно за {{count}} годин"}}),xHours:ue({regular:{singularNominative:"{{count}} годину",singularGenitive:"{{count}} години",pluralGenitive:"{{count}} годин"}}),xDays:ue({regular:{singularNominative:"{{count}} день",singularGenitive:"{{count}} днi",pluralGenitive:"{{count}} днів"}}),aboutXWeeks:ue({regular:{singularNominative:"близько {{count}} тижня",singularGenitive:"близько {{count}} тижнів",pluralGenitive:"близько {{count}} тижнів"},future:{singularNominative:"приблизно за {{count}} тиждень",singularGenitive:"приблизно за {{count}} тижні",pluralGenitive:"приблизно за {{count}} тижнів"}}),xWeeks:ue({regular:{singularNominative:"{{count}} тиждень",singularGenitive:"{{count}} тижні",pluralGenitive:"{{count}} тижнів"}}),aboutXMonths:ue({regular:{singularNominative:"близько {{count}} місяця",singularGenitive:"близько {{count}} місяців",pluralGenitive:"близько {{count}} місяців"},future:{singularNominative:"приблизно за {{count}} місяць",singularGenitive:"приблизно за {{count}} місяці",pluralGenitive:"приблизно за {{count}} місяців"}}),xMonths:ue({regular:{singularNominative:"{{count}} місяць",singularGenitive:"{{count}} місяці",pluralGenitive:"{{count}} місяців"}}),aboutXYears:ue({regular:{singularNominative:"близько {{count}} року",singularGenitive:"близько {{count}} років",pluralGenitive:"близько {{count}} років"},future:{singularNominative:"приблизно за {{count}} рік",singularGenitive:"приблизно за {{count}} роки",pluralGenitive:"приблизно за {{count}} років"}}),xYears:ue({regular:{singularNominative:"{{count}} рік",singularGenitive:"{{count}} роки",pluralGenitive:"{{count}} років"}}),overXYears:ue({regular:{singularNominative:"більше {{count}} року",singularGenitive:"більше {{count}} років",pluralGenitive:"більше {{count}} років"},future:{singularNominative:"більше, ніж за {{count}} рік",singularGenitive:"більше, ніж за {{count}} роки",pluralGenitive:"більше, ніж за {{count}} років"}}),almostXYears:ue({regular:{singularNominative:"майже {{count}} рік",singularGenitive:"майже {{count}} роки",pluralGenitive:"майже {{count}} років"},future:{singularNominative:"майже за {{count}} рік",singularGenitive:"майже за {{count}} роки",pluralGenitive:"майже за {{count}} років"}})},me={date:O({formats:{full:"EEEE, do MMMM y 'р.'",long:"do MMMM y 'р.'",medium:"d MMM y 'р.'",short:"dd.MM.y"},defaultWidth:"full"}),time:O({formats:{full:"H:mm:ss zzzz",long:"H:mm:ss z",medium:"H:mm:ss",short:"H:mm"},defaultWidth:"full"}),dateTime:O({formats:{full:"{{date}} 'о' {{time}}",long:"{{date}} 'о' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},fe=["неділю","понеділок","вівторок","середу","четвер","п’ятницю","суботу"];function he(e){return"'у "+fe[e]+" о' p"}const pe={lastWeek:(e,t,a)=>{const r=Q(e),n=r.getDay();return Z(r,t,a)?he(n):function(e){const t=fe[e];switch(e){case 0:case 3:case 5:case 6:return"'у минулу "+t+" о' p";case 1:case 2:case 4:return"'у минулий "+t+" о' p"}}(n)},yesterday:"'вчора о' p",today:"'сьогодні о' p",tomorrow:"'завтра о' p",nextWeek:(e,t,a)=>{const r=Q(e),n=r.getDay();return Z(r,t,a)?he(n):function(e){const t=fe[e];switch(e){case 0:case 3:case 5:case 6:return"'у наступну "+t+" о' p";case 1:case 2:case 4:return"'у наступний "+t+" о' p"}}(n)},other:"P"},ge={ordinalNumber:(e,t)=>{const a=String(t?.unit),r=Number(e);let n;return n="date"===a?3===r||23===r?"-є":"-е":"minute"===a||"second"===a||"hour"===a?"-а":"-й",r+n},era:V({values:{narrow:["до н.е.","н.е."],abbreviated:["до н. е.","н. е."],wide:["до нашої ери","нашої ери"]},defaultWidth:"wide"}),quarter:V({values:{narrow:["1","2","3","4"],abbreviated:["1-й кв.","2-й кв.","3-й кв.","4-й кв."],wide:["1-й квартал","2-й квартал","3-й квартал","4-й квартал"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:V({values:{narrow:["С","Л","Б","К","Т","Ч","Л","С","В","Ж","Л","Г"],abbreviated:["січ.","лют.","берез.","квіт.","трав.","черв.","лип.","серп.","верес.","жовт.","листоп.","груд."],wide:["січень","лютий","березень","квітень","травень","червень","липень","серпень","вересень","жовтень","листопад","грудень"]},defaultWidth:"wide",formattingValues:{narrow:["С","Л","Б","К","Т","Ч","Л","С","В","Ж","Л","Г"],abbreviated:["січ.","лют.","берез.","квіт.","трав.","черв.","лип.","серп.","верес.","жовт.","листоп.","груд."],wide:["січня","лютого","березня","квітня","травня","червня","липня","серпня","вересня","жовтня","листопада","грудня"]},defaultFormattingWidth:"wide"}),day:V({values:{narrow:["Н","П","В","С","Ч","П","С"],short:["нд","пн","вт","ср","чт","пт","сб"],abbreviated:["нед","пон","вів","сер","чтв","птн","суб"],wide:["неділя","понеділок","вівторок","середа","четвер","п’ятниця","субота"]},defaultWidth:"wide"}),dayPeriod:V({values:{narrow:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранок",afternoon:"день",evening:"веч.",night:"ніч"},abbreviated:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранок",afternoon:"день",evening:"веч.",night:"ніч"},wide:{am:"ДП",pm:"ПП",midnight:"північ",noon:"полудень",morning:"ранок",afternoon:"день",evening:"вечір",night:"ніч"}},defaultWidth:"any",formattingValues:{narrow:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранку",afternoon:"дня",evening:"веч.",night:"ночі"},abbreviated:{am:"ДП",pm:"ПП",midnight:"півн.",noon:"пол.",morning:"ранку",afternoon:"дня",evening:"веч.",night:"ночі"},wide:{am:"ДП",pm:"ПП",midnight:"північ",noon:"полудень",morning:"ранку",afternoon:"дня",evening:"веч.",night:"ночі"}},defaultFormattingWidth:"wide"})},xe={ordinalNumber:_({matchPattern:/^(\d+)(-?(е|й|є|а|я))?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:X({matchPatterns:{narrow:/^((до )?н\.?\s?е\.?)/i,abbreviated:/^((до )?н\.?\s?е\.?)/i,wide:/^(до нашої ери|нашої ери|наша ера)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^д/i,/^н/i]},defaultParseWidth:"any"}),quarter:X({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^[1234](-?[иі]?й?)? кв.?/i,wide:/^[1234](-?[иі]?й?)? квартал/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:X({matchPatterns:{narrow:/^[слбктчвжг]/i,abbreviated:/^(січ|лют|бер(ез)?|квіт|трав|черв|лип|серп|вер(ес)?|жовт|лис(топ)?|груд)\.?/i,wide:/^(січень|січня|лютий|лютого|березень|березня|квітень|квітня|травень|травня|червня|червень|липень|липня|серпень|серпня|вересень|вересня|жовтень|жовтня|листопад[а]?|грудень|грудня)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^с/i,/^л/i,/^б/i,/^к/i,/^т/i,/^ч/i,/^л/i,/^с/i,/^в/i,/^ж/i,/^л/i,/^г/i],any:[/^сі/i,/^лю/i,/^б/i,/^к/i,/^т/i,/^ч/i,/^лип/i,/^се/i,/^в/i,/^ж/i,/^лис/i,/^г/i]},defaultParseWidth:"any"}),day:X({matchPatterns:{narrow:/^[нпвсч]/i,short:/^(нд|пн|вт|ср|чт|пт|сб)\.?/i,abbreviated:/^(нед|пон|вів|сер|че?тв|птн?|суб)\.?/i,wide:/^(неділ[яі]|понеділ[ок][ка]|вівтор[ок][ка]|серед[аи]|четвер(га)?|п\W*?ятниц[яі]|субот[аи])/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^н/i,/^п/i,/^в/i,/^с/i,/^ч/i,/^п/i,/^с/i],any:[/^н/i,/^п[он]/i,/^в/i,/^с[ер]/i,/^ч/i,/^п\W*?[ят]/i,/^с[уб]/i]},defaultParseWidth:"any"}),dayPeriod:X({matchPatterns:{narrow:/^([дп]п|півн\.?|пол\.?|ранок|ранку|день|дня|веч\.?|ніч|ночі)/i,abbreviated:/^([дп]п|півн\.?|пол\.?|ранок|ранку|день|дня|веч\.?|ніч|ночі)/i,wide:/^([дп]п|північ|полудень|ранок|ранку|день|дня|вечір|вечора|ніч|ночі)/i},defaultMatchWidth:"wide",parsePatterns:{any:{am:/^дп/i,pm:/^пп/i,midnight:/^півн/i,noon:/^пол/i,morning:/^р/i,afternoon:/^д[ен]/i,evening:/^в/i,night:/^н/i}},defaultParseWidth:"any"})},ve={en:le,el:re,ua:{code:"uk",formatDistance:(e,t,a)=>(a=a||{},de[e](t,a)),formatLong:me,formatRelative:(e,t,a,r)=>{const n=pe[e];return"function"==typeof n?n(t,a,r):n},localize:ge,match:xe,options:{weekStartsOn:1,firstWeekContainsDate:1}}};function be(e,t="en",a=!1){const r=ve[t]??le;if(a)return u.formatDistanceToNow(e,{locale:r,addSuffix:!0});return u.isToday(e)?u.format(e,"p",{locale:r}):(e=>{const t=u.differenceInCalendarDays(new Date,e);return t>=0&&t<=6})(e)?u.format(e,"eeee",{locale:r}):u.format(e,"P",{locale:r})}const we=t.memo(t.forwardRef(function({date:t,language:a,distanceToNow:r,...n},i){return t?e.jsx("span",{ref:i,...n,className:P("text-xs text-muted-foreground",n?.className),children:be(t,a,r)}):null}));we.displayName="FormattedDate";const ye=({status:t,...a})=>{switch(t){case"wait":return e.jsx(o.Clock,{...a,className:P("text-gray-500 size-4",a?.className)});case"sent":return e.jsx(o.Check,{...a,className:P("text-gray-500 size-4",a?.className)});case"read":return e.jsx(o.CheckCheck,{...a,className:P("text-gray-500 size-4",a?.className)});case"lost":return e.jsx(o.Ban,{...a,className:P("text-red-500 size-4",a?.className)});default:return null}};ye.displayName="StatusSent";const Ne=t.forwardRef(function({onView:a=()=>{},isLast:r,children:n,...i},s){const[o,l]=c.useInView(),u=t.useRef(null),d=t.useCallback(e=>{u.current=e,o(e)},[o]);return t.useEffect(()=>{l&&a()},[l,a]),t.useImperativeHandle(s,()=>u.current||{},[]),e.jsx("div",{ref:d,...i,className:P("mt-2",r&&"mb-2",l&&"view",i?.className),children:n})});const je=t.memo(t.forwardRef(function({fromMe:t,sameSenderAbove:a,title:r,senderName:n,senderAvatar:i,date:s=new Date,language:o="en",statusSent:l,avatarProps:c,bubbleProps:u,titleProps:d,formattedDateProps:m,statusSentProps:f,children:h,...p},g){const x=Boolean((c||i)&&!a),v=Boolean((c||i)&&a);return e.jsxs(Ne,{ref:g,...p,className:P("flex relative text-left whitespace-pre-wrap",t?"self-end flex-row-reverse ml-12":"self-start mr-12",a&&"mt-1"),children:[x&&e.jsx(q,{name:n,src:i,imageProps:{className:"bg-blue-200"},fallbackProps:{className:"bg-blue-200"},...c,className:P("mt-1 mr-1",c?.className)}),e.jsxs("div",{className:P("relative flex flex-col min-w-42 max-w-120 rounded-xl px-2 pt-2 pb-6 shadow-sm",t?"bg-gray-200":"bg-blue-200",v&&"ml-9",u?.className),children:[(r||n)&&e.jsx("span",{...d,className:P("font-semibold",r&&"mb-1 py-1.5 text-xs text-muted-foreground italic border-b",d?.className),children:r||n}),h,e.jsxs("div",{className:"absolute bottom-1 right-2 flex items-center gap-1 italic",children:[e.jsx(we,{date:s,language:o,distanceToNow:!0,...m}),e.jsx(ye,{status:l,...f})]})]})]})}));je.displayName="ChatBubbleMessage";const Pe=t.memo(t.forwardRef(function({info:t="",iconElement:a,date:r=new Date,language:n="en",infoProps:i,formattedDateProps:s,...o},l){return e.jsxs(Ne,{ref:l,...o,className:P("flex items-center justify-center gap-2 rounded-full w-fit bg-ring/20 mx-auto px-3 py-1.5 mt-2"),children:[a,e.jsx("span",{...i,className:P("text-sm mb-px",i?.className),children:t}),e.jsx(we,{date:r,language:n,distanceToNow:!0,...s})]})}));Pe.displayName="ChatBubbleInfo";const ke=t.forwardRef(function({...t},a){return e.jsx(m.Root,{ref:a,...t,className:P("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t?.className)})});ke.displayName="Label";const Se=t.forwardRef(function({onSend:t=()=>{},iconElement:a,iconProps:r,...n},i){return e.jsx(ke,{ref:i,...n,onClick:t,className:P("group rounded-full py-2 pl-2.5 pr-1.5 cursor-pointer bg-ring/90 hover:bg-ring",n?.className),children:a||e.jsx(o.SendHorizontal,{...r,className:P("text-background group-hover:scale-110 transition-all duration-200 ease-out",r?.className)})})});Se.displayName="ChatInputSend";const Me=t.forwardRef(function({pending:a=!1,draft:r,onSend:n=()=>{},onDraft:i=()=>{},onTyping:s=()=>{},onHeightGrow:o=()=>{},hideChatInputSend:l=!1,chatInputSendProps:c,containerProps:u,children:m,...f},h){const[p,g]=t.useState(),x=t.useRef(null),v=t.useRef(0),b=t.useRef(!1),w=t.useRef(void 0),y=()=>{b.current=!1,s(!1),w.current&&(clearTimeout(w.current),w.current=void 0)},N=async()=>{y(),"string"==typeof p&&p.length>0&&(n(p.trim()),g(""),x.current?.focus())};return t.useEffect(()=>{const e=x.current;return y(),queueMicrotask(()=>g(r)),e?.focus(),()=>{i(e?.value)}},[f.key]),t.useImperativeHandle(h,()=>x.current||{},[]),e.jsxs("div",{...u,className:P("flex items-end gap-2",u?.className),children:[e.jsx(d,{name:"textarea-autosize",ref:x,autoFocus:!0,minRows:1,maxRows:8,...f,value:p,onChange:e=>{const{data:t}=e.nativeEvent;g(e.target.value),!b.current&&"string"==typeof t&&t.length>0&&(b.current=!0,s(!0)),clearTimeout(w.current),w.current=setTimeout(y,5e3)},onKeyDown:e=>{"Enter"===e.key&&!1===e.shiftKey&&(e.preventDefault(),f.onKeyDown?.(e),N())},onHeightChange:(e,t)=>{if(e||t){if(e!==v.current){const a=e>v.current?t.rowHeight:-t.rowHeight;o({height:e,shift:a})}v.current=e}},className:P("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-11 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive","resize-none py-2.5",a&&"pointer-events-none bg-muted-foreground border-ring ring-ring/50 animate-pulse",f?.className)}),!l&&e.jsx(Se,{onSend:N,...c}),m]})});Me.displayName="ChatInput";const Ce=(e,t,a,r,n)=>{const i=Array.from(e||[]).filter(Boolean);if(0===i.length)return;const s=((e,t)=>{if(0===e.length)return!1;const a="string"==typeof t?t.split(/\s*,\s*|\s+/).map(e=>e.toLowerCase().trim()):null;return null!==a&&0!==a.length&&e.every(e=>{const{type:t,size:r}=e;if("string"!=typeof t||"number"!=typeof r||r<=0||0===t.length)return!1;const n=t.toLowerCase(),[i,s]=n.split("/");return a.some(e=>e.startsWith("*")||e===n||i&&e.endsWith("/*")&&e.startsWith(i)||e.startsWith(".")&&e.slice(1)===s)})})(i,t);s?r(a?i:i[0]?[i[0]]:[]):n()};const ze=t.forwardRef(function({onSelectFile:t=()=>{},onInvalidFile:a=()=>{},multiple:r=!1,accept:n="*/*",iconElement:i,labelProps:s,iconProps:l,...c},u){return e.jsxs(ke,{...s,htmlFor:"file-uploader",className:P("group p-2 rounded-full hover:bg-ring/10 transition-all duration-200 ease-out cursor-pointer",s?.className),children:[i||e.jsx(o.Paperclip,{...l,className:P("text-foreground group-hover:scale-110 transition-all duration-200 ease-out",l?.className)}),e.jsx("input",{ref:u,id:"file-uploader",type:"file",multiple:r,accept:n,onChange:e=>{Ce(e.currentTarget.files,n,r,t,a),e.currentTarget.value=""},...c,className:P("hidden",c?.className)})]})});ze.displayName="FilePickerInput";const We=t.forwardRef(function({onSelectFile:a=()=>{},onInvalidFile:r=()=>{},multiple:n=!1,accept:i="*/*",children:s,iconElement:l,placeholder:c,dropZoneProps:u,placeholderContainerProps:d,iconProps:m,placeholderProps:f,...h},p){const[g,x]=t.useState(!1),v=e=>{e.preventDefault(),e.stopPropagation()};return e.jsxs("div",{ref:p,onDragEnter:e=>{v(e),e.dataTransfer.items&&e.dataTransfer.items.length>0&&x(!0)},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||x(!1)},onDragOver:v,...h,className:P("relative size-full min-h-0",h?.className),children:[s,e.jsx("div",{onDrop:e=>{v(e),x(!1),Ce(e.dataTransfer.files,i,n,a,r),e.dataTransfer.clearData()},...u,className:P("absolute top-0 left-0 size-full","flex items-center justify-center","transition-all duration-300 ease-out","border-2 border-dashed border-ring bg-ring/25 rounded-md",g?"opacity-100 pointer-events-auto visible scale-100":"opacity-0 pointer-events-none invisible scale-98",u?.className),children:e.jsxs("div",{...d,className:P("bg-muted flex flex-row items-center gap-2 rounded-full py-2 px-4 transition-all",g?"scale-100":"scale-90",d?.className),children:[l||e.jsx(o.FilePlusCorner,{absoluteStrokeWidth:!0,...m,className:P("text-ring size-6",m?.className)}),e.jsx("span",{...f,className:P("text-ring text-md font-bold",f?.className),children:c||"Drop files here"})]})})]})});We.displayName="FilePickerDropzone";const Re=t.forwardRef(function({title:t,description:a,actions:r=[],onAction:n=()=>{},containerProps:i,titleProps:s,descriptionProps:o,actionProps:l,...c},u){return r.length?e.jsxs("div",{ref:u,...i,className:P("flex flex-col h-full overflow-y-auto py-2",i?.className),children:[e.jsx("div",{className:"grow"}),e.jsxs("div",{...c,className:P("grid gap-2 m-4",c?.className),children:[t&&e.jsx("h2",{...s,className:P("font-medium text-foreground text-lg",s?.className),children:t}),a&&e.jsx("span",{...o,className:P("text-sm text-muted-foreground mb-4",o?.className),children:a}),r.map((t,a)=>e.jsx("div",{...l,className:P("w-full border p-2 rounded-md wrap-break-word cursor-pointer overflow-hidden text-ellipsis bg-ring/5 hover:bg-ring/20 transition-colors duration-200 ease-out",l?.className),onClick:()=>n(t),children:t},a))]})]}):null});function De({children:t,...a}){return e.jsx("div",{...a,className:P("relative size-full min-h-0",a?.className),children:t})}Re.displayName="QuickActions";const Ge=t.forwardRef(function({key:a,loading:r=!1,textareaMeasurement:n,offsetToReach:i=200,onScrollStartReached:s,onScrollEndReached:o,onListReset:l,onListCreate:c,onListGrow:u,enableFilePickerDropzone:d=!0,containerProps:m,filePickerDropzoneProps:h,quickActionsProps:p,children:g,quickActionsVisible:x,minItemsCount:v=1,...b},w){const y=d?We:De,N=d?h:m,j=Array.isArray(g)?g.length:Array.isArray(b.data)?b.data.length:0,P=t.useRef(0),k=t.useRef(void 0),[S,M]=t.useState(!1),[C,z]=t.useState(!1),R=t.useRef(null),D=()=>{queueMicrotask(()=>{z(!0),queueMicrotask(()=>z(!1))})},G=t.useCallback((e=!1)=>{R.current&&(e||R.current.scrollSize-R.current.scrollOffset<2*R.current.viewportSize)&&queueMicrotask(()=>R.current?.scrollToIndex(j-1,{align:"start"}))},[j]);return t.useEffect(()=>{a!==k.current&&(D(),l?.(k.current,a),k.current=a,P.current=0)},[a,l]),t.useEffect(()=>{0===P.current&&j>0&&(D(),c?.(),P.current=j,G(!0)),j>P.current&&(u?.(),P.current=j,S&&queueMicrotask(()=>M(!1)),G())},[j,S,c,u,G]),t.useEffect(()=>{R.current?.scrollBy(n.shift)},[n]),t.useImperativeHandle(w,()=>({...R.current||{},scrollToBottom:G}),[G]),C?null:v>=j?x?e.jsx(Re,{...p}):e.jsx(W,{loading:!0,layout:"centered"}):e.jsxs(y,{...N,children:[e.jsx(W,{loading:r,className:"my-5"}),e.jsxs("div",{className:"flex flex-col h-full overflow-y-auto px-2",children:[e.jsx("div",{className:"grow"}),e.jsx(f.Virtualizer,{ref:R,onScroll:async e=>{b.onScroll?.(e),R.current&&("function"==typeof s&&e<i&&(M(!0),s()),"function"==typeof o&&R.current.viewportSize+e+i>R.current.scrollSize&&o())},shift:S,...b,children:g})]})]})});Ge.displayName="ChatList";const Ee=t.forwardRef(function({iconElement:t,iconProps:a,indicatorProps:r,...n},i){return e.jsx(y.Root,{ref:i,...n,className:P("peer border-input dark:bg-input/30 data-[state=checked]:bg-ring data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-ring data-[state=checked]:border-ring focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",n?.className),children:e.jsx(y.Indicator,{...r,className:P("flex items-center justify-center text-current transition-none",r?.className),children:t||e.jsx(o.CheckIcon,{...a,className:P("size-3.5",a?.className)})})})});Ee.displayName="Checkbox";const Ae=t.memo(t.forwardRef(function({index:t=-1,isPrivateDialog:a,selected:r,onSelect:n=()=>{},name:i,photo:s,userOnline:l,userPresence:c,hasGroupIcon:u,lastSentStatus:d,lastSentDate:m,lastSenderName:f,lastMessage:h,typingStatusText:p,draft:g,draftLabel:x="Draft",unreadCount:v=0,language:b="en",divider:w="bottom",avatarProps:y,contentProps:N,headerProps:j,headerLeftProps:k,groupIconProps:S,nameProps:M,headerRightProps:C,statusSentIconProps:z,formattedDateProps:W,footerProps:R,lastMessageProps:D,draftLabelProps:G,lastSenderNameProps:E,unreadBadgeProps:A,dividerProps:T,...I},L){const F=s||y?.src,B=i||y?.name,O=!!a&&(l||y?.online),V=a?c||y?.presence:void 0,X="top"===w||"both"===w&&0===t,_="bottom"===w||"both"===w;return e.jsxs("div",{ref:L,...I,onClick:n,className:P("flex items-start gap-2 px-2 flex-1 cursor-pointer","transition-colors duration-200 ease-out",""+(r?"border-l-[0.25em] pl-1 border-l-ring bg-ring/20":"hover:bg-ring/5"),I?.className),children:[e.jsx(q,{src:F,name:B,online:O,presence:V,...y,className:P("size-13 my-2 "+(s?"bg-ring/10":"bg-ring/30"),y?.className)}),e.jsxs("div",{...N,className:P("relative self-stretch flex-1 flex-col text-foreground",N?.className),children:[e.jsxs("div",{...j,className:P("flex items-center justify-between gap-1",j?.className),children:[e.jsxs("div",{...k,className:P("flex items-center gap-1",k?.className),children:[!a&&u&&e.jsx(o.Users,{...S,className:P("text-muted-foreground size-4 min-w-4",S?.className)}),e.jsx("span",{...M,className:P("font-medium text-left line-clamp-1",M?.className),children:i})]}),e.jsxs("div",{...C,className:P("flex items-center gap-1",C?.className),children:[e.jsx(ye,{status:d,...z}),e.jsx(we,{date:m,language:b,...W})]})]}),e.jsxs("div",{...R,className:P("flex items-start justify-between gap-1",R?.className),children:[e.jsx("span",{...D,className:P("text-sm text-left text-muted-foreground break-all line-clamp-2",D?.className),children:p||(g?e.jsxs("span",{children:[e.jsx("span",{...G,className:P("text-red-500 font-medium",G?.className),children:`${x}: `}),g]}):e.jsxs("span",{children:[f&&e.jsx("span",{...E,className:P("font-semibold",E?.className),children:`${f}: `}),h]}))}),v>0&&e.jsx(H,{...A,className:P("bg-ring text-background text-xs rounded-full p-1 h-6 min-w-6 mt-0.5",A?.className),children:v})]}),X&&e.jsx("div",{...T,className:P("absolute -top-px left-0 right-0 border-t",T?.className)}),_&&e.jsx("div",{className:"absolute bottom-0 left-0 right-0 border-b"})]})]})}));Ae.displayName="DialogItem";const Te=t.forwardRef(function({title:t,titles:a=[],rowProps:r,...n},i){const s="string"==typeof t?[t,...a]:a;return e.jsx("div",{ref:i,...n,className:P("absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2",n?.className),children:s.map((t,a)=>e.jsx("div",{...r,className:P("text-center text-muted-foreground",r?.className),children:t},`placeholder-text-${a}`))})});Te.displayName="PlaceholderText";const Ie=()=>e.jsxs("div",{className:"flex flex-row gap-2 mx-2 border-b",children:[e.jsx("div",{className:"size-13 my-2 rounded-full bg-muted animate-pulse"}),e.jsxs("div",{className:"flex-1 text-muted",children:[e.jsxs("div",{className:"flex flex-row items-center justify-between h-6",children:[e.jsx("div",{className:"w-2/3 h-4 rounded-full bg-muted animate-pulse"}),e.jsx("div",{className:"w-1/6 h-3.5 rounded-full bg-muted animate-pulse"})]}),e.jsxs("div",{className:"flex flex-col items-start justify-around h-10",children:[e.jsx("div",{className:"w-7/8 h-3.5 rounded-full bg-muted animate-pulse"}),e.jsx("div",{className:"w-5/6 h-3.5 rounded-full bg-muted animate-pulse"})]})]})]});const Le=t.forwardRef(function({children:a,pending:r,pendingListLength:n=5,offsetToReach:i=50,placeholderVisible:s,placeholderTitles:o=["No dialogs yet.","Start a conversation!"],onScrollStartReached:l,onScrollEndReached:c,...u},d){const m=t.useRef(null),h=Array.from({length:n}).map((t,a)=>e.jsx(Ie,{},`pending_dialog_item_${a}`));return t.useImperativeHandle(d,()=>m.current||{},[]),s?e.jsx(Te,{titles:o,className:"text-base text-muted"}):e.jsx(f.VList,{ref:m,onScroll:async e=>{u.onScroll?.(e),m.current&&("function"==typeof l&&e<i&&l(),"function"==typeof c&&m.current.viewportSize+e+i>m.current.scrollSize&&c())},className:"size-full overflow-y-scroll",...u,children:r?h:a})});Le.displayName="DialogsList";const Fe=t.forwardRef(function({active:a,onDismiss:r,disableClickOutside:n=!1,disableEscKeyPress:i=!1,disabled:s,...o},l){const c=t.useRef(null);t.useImperativeHandle(l,()=>c.current||{},[]);const u=t.useCallback(e=>{!n&&a&&e.target===c.current&&r()},[n,a,r]),d=t.useCallback(e=>{!i&&a&&"Escape"===e.key&&r()},[i,a,r]);return t.useEffect(()=>{if(!i&&a)return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[i,a,d]),s||!a?null:e.jsx("div",{ref:c,"aria-hidden":!0,...o,onClick:u,onTouchStart:u,className:P("fixed top-0 left-0 size-full bg-black/20",o?.className)})});Fe.displayName="DismissLayer";const qe=t.forwardRef(function(t,a){return e.jsx("input",{ref:a,...t,className:P("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-10 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t?.className)})});qe.displayName="Input";const Be=e=>{if(0===e.length)return e;const t=document.createElement("div");return t.innerHTML=e,t.textContent.trim()};const He=t.memo(t.forwardRef(function({thin:a=!1,title:r="",description:n="",icon:i,iconFallbackElement:s,image:l,onReady:c=()=>{},titleContainerProps:u,iconProps:d,iconFallbackProps:m,titleProps:f,descriptionProps:h,imageContainerProps:p,imageProps:g,...x},v){const[b,w]=t.useState(i),[y,N]=t.useState(l),j=t.useCallback(e=>{g?.onLoad?.(e),c()},[c,g]),k=t.useCallback(e=>{d?.onError?.(e),w(void 0)},[d]),S=t.useCallback(e=>{g?.onError?.(e),N(void 0)},[g]);return e.jsxs("a",{ref:v,target:"_blank",rel:"noopener noreferrer",...x,className:P("transition-color duration-300 ease-out","grid items-start gap-2 p-2 mt-1 overflow-hidden rounded border-l-4 border-l-ring bg-white hover:bg-ring/20",a?"grid-cols-3":"grid-cols-1",x?.className),children:[e.jsxs("div",{...u,className:P("flex items-start gap-2",a?"col-span-3":"col-span-1",u?.className),children:[b?e.jsx("img",{alt:"icon",src:b,...d,onError:k,className:P("size-5",d?.className)}):s||e.jsx(o.Globe,{...m,className:P("size-5",m?.className)}),e.jsx("span",{...f,className:P("text-sm font-bold",a?"line-clamp-1":"line-clamp-2",f?.className),children:Be(r)})]}),n&&e.jsx("span",{...h,className:P("text-sm line-clamp-5",a?y?"col-span-2":"col-span-3":"col-span-1",h?.className),children:Be(n)}),y&&e.jsx("div",{...p,className:P("flex items-center justify-center",p?.className),children:e.jsx("img",{alt:"banner",src:y,...g,onLoad:j,onError:S,className:P("rounded max-w-full object-contain",a?"max-h-25":"max-h-60",g?.className)})})]})}));He.displayName="LinkPreview";const Oe={target:"_blank",rel:"noopener noreferrer"},Ve=["w-full","w-3/4","w-1/2"];const Xe=t.memo(t.forwardRef(function({text:a,pending:r=!1,onReady:n=()=>{},linkifyProps:i,skeletonContainerProps:s,skeletonLineProps:o,skeletonLinesClassNames:l=Ve,...c},u){const d=t.useRef(r),m=t.useMemo(()=>({...Oe,...i,className:P("text-blue-500 hover:text-blue-600 hover:underline",i?.className)}),[i]);return t.useEffect(()=>{d.current&&!r&&n(),d.current=r},[r,n]),r?e.jsx("div",{...s,className:P("flex items-start flex-col size-full",s?.className),children:l.map((e,a)=>t.createElement("span",{...o,key:`${e}_${a}`,className:P("bg-muted-foreground animate-pulse rounded-md my-1 h-4",o?.className,e)}))}):e.jsx("p",{ref:u,...c,className:P("wrap-break-word text-base",c?.className),children:e.jsx(p,{options:m,children:a})})}));Xe.displayName="LinkifyText";const _e=t.forwardRef(function({onSearch:a=()=>{},onCancel:r=()=>{},hasSearchIcon:n=!0,hasCancelIcon:i=!0,searchIconProps:s,cancelIconProps:l,containerProps:c,...u},d){const[m,f]=t.useState("");return e.jsxs("div",{...c,className:P("group relative",c?.className),children:[n&&e.jsx(o.Search,{...s,className:P("absolute top-1/2 left-2 transform -translate-y-1/2 size-5 text-muted-foreground group-focus-within:text-ring",s?.className)}),e.jsx(qe,{ref:d,name:"search",placeholder:u?.placeholder||"Search...",value:m,onChange:e=>{const t=e.target.value;f(t),a(t.toLowerCase())},...u,className:P("placeholder:text-muted-foreground focus-visible:ring-ring/50 focus-visible:ring flex",n?"pl-10":"pl-3",i?"pr-10":"pr-3",u?.className)}),i&&e.jsx(o.X,{onClick:()=>{f(""),r()},...l,className:P("absolute top-1/2 right-2 transform -translate-y-1/2 size-5 text-muted-foreground cursor-pointer hover:text-ring transition-all duration-300 ease-out",m.length>0?"opacity-100 scale-100":"opacity-0 scale-75 pointer-events-none",l?.className)})]})});_e.displayName="Search";const $e=({fromMe:t,status:a,...r})=>{const n="hungUp"===a?o.Phone:t?o.PhoneOutgoing:"reject"===a?o.PhoneIncoming:o.PhoneMissed;return e.jsx(n,{...r,className:P("size-4","hungUp"===a?"text-green-500":"text-red-500",r?.className)})};$e.displayName="StatusCall";const Ye=t.forwardRef(function({status:t="unknown",statusColorConfig:a={unknown:"bg-gray-500 border-gray-600"},statusProps:r,tooltipProviderProps:n,tooltipProps:i,tooltipTriggerProps:s,tooltipPortalProps:o,tooltipContentProps:l,tooltipArrowProps:c,tooltip:u,disabled:d,className:m,...f},h){return d?null:e.jsx("div",{ref:h,...f,className:P("absolute top-0 left-0",m),children:e.jsx(N.Provider,{...n,children:e.jsxs(N.Root,{...i,children:[e.jsx(N.Trigger,{asChild:!0,...s,children:e.jsx("div",{...r,className:P("rounded-full size-4 border border-primary-foreground",a[t],r?.className)})}),e.jsx(N.Portal,{...o,children:e.jsxs(N.Content,{...l,className:P("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",l?.className),children:[e.jsx("span",{children:u||t||"unknown"}),e.jsx(N.Arrow,{...c,className:P("bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px]",c?.className)})]})})]})})})});Ye.displayName="StatusIndicator";const Je=t.forwardRef(function({id:a,stream:r,mirror:n,className:i,muted:s,...o},l){const c=t.useRef(null),u=t.useMemo(()=>a??`stream-${k()}`,[a]),d="boolean"==typeof s&&s,m=n?"scale-x-[-1]":"";return t.useImperativeHandle(l,()=>c.current||{},[]),t.useEffect(()=>{if(c.current&&r){c.current.srcObject=r;const e=()=>{try{c.current?.play()}catch(e){console.error("Error playing video:",e)}};c.current.onloadedmetadata=()=>{queueMicrotask(e)}}},[r]),r?e.jsx("video",{ref:c,id:u,autoPlay:!0,playsInline:!0,muted:d,...o,className:P("size-full object-contain",m,i)}):null});Je.displayName="StreamView";const Ue=t.forwardRef(function({muted:t,mirror:a,...r},n){const i="boolean"!=typeof t||t,s="boolean"!=typeof a||a;return e.jsx(Je,{ref:n,muted:i,mirror:s,...r})});Ue.displayName="LocalStreamView";const Qe=t.forwardRef(function({muted:t,mirror:a,...r},n){const i="boolean"==typeof t&&t,s="boolean"==typeof a&&a;return e.jsx(Je,{ref:n,muted:i,mirror:s,...r})});Qe.displayName="RemoteStreamView";const Ke=t.forwardRef(function({element:a,pipElement:r,navElement:n,hideIconElement:i,showIconElement:s,fullscreenButtonProps:l,fullscreenButtonIconProps:c,pipProps:u,pipButtonProps:d,pipButtonIconProps:m,...f},h){const p=t.useRef(null),[g,x]=t.useState(!1),[v,b]=t.useState(!1),w=t.useCallback(async()=>{const e=p.current;if(e)try{document.fullscreenElement?(await document.exitFullscreen(),x(!1),b(!1)):(await e.requestFullscreen(),x(!0),b(!0))}catch(e){console.error("Fullscreen error:",e)}},[]),y=t.useCallback(()=>{r&&b(e=>!e)},[r]);return t.useImperativeHandle(h,()=>({...p.current||{},isFullscreen:g,isPictureInPicture:v,toggleFullscreen:w,togglePictureInPicture:y}),[g,v,w,y]),t.useEffect(()=>{const e=()=>{x(!!document.fullscreenElement),b(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",e),()=>document.removeEventListener("fullscreenchange",e)},[]),e.jsxs("div",{ref:p,...f,className:P("relative flex items-center justify-center size-full",f?.className),children:[a,e.jsx("button",{onClick:w,...l,className:P("absolute top-2 right-2 p-1 rounded-md bg-black/50 text-white hover:bg-black/80 z-10 shadow-xs shadow-white/25",l?.className),children:g?i||e.jsx(o.Minimize,{...c}):s||e.jsx(o.Maximize,{...c})}),e.jsxs("div",{className:"absolute size-full p-2 flex flex-col justify-end items-center",children:[g&&r&&e.jsxs("div",{className:"relative size-full flex items-end justify-end",children:[v&&e.jsx("div",{...u,className:P("max-w-1/4 max-h-1/4 aspect-4/3 overflow-hidden rounded-md shadow-md shadow-white/25",u?.className),children:r}),e.jsx("button",{onClick:y,...d,className:P("absolute bottom-2 right-2 p-1 rounded-md bg-black/50 text-white hover:bg-black/80 z-10 shadow-xs shadow-white/25",d?.className),children:e.jsx(o.PictureInPicture2,{...m})})]}),g&&n]})]})});Ke.displayName="FullscreenStreamView",exports.AlertDialog=z,exports.Attachment=I,exports.AttachmentAudio=D,exports.AttachmentFailed=T,exports.AttachmentFile=A,exports.AttachmentImage=E,exports.AttachmentLink=R,exports.AttachmentVideo=G,exports.Avatar=q,exports.Badge=H,exports.Button=C,exports.ChatBubbleInfo=Pe,exports.ChatBubbleMessage=je,exports.ChatInput=Me,exports.ChatList=Ge,exports.Checkbox=Ee,exports.DialogItem=Ae,exports.DialogsList=Le,exports.DismissLayer=Fe,exports.FilePickerDropzone=We,exports.FilePickerInput=ze,exports.FormattedDate=we,exports.FullscreenStreamView=Ke,exports.Input=qe,exports.Label=ke,exports.LinkPreview=He,exports.LinkifyText=Xe,exports.LocalStreamView=Ue,exports.PlaceholderText=Te,exports.Presence=F,exports.PresenceBadge=L,exports.QuickActions=Re,exports.RemoteStreamView=Qe,exports.Search=_e,exports.Spinner=W,exports.StatusCall=$e,exports.StatusIndicator=Ye,exports.StatusSent=ye,exports.StreamView=Je,exports.Switch=function(t){return e.jsx(j.Root,{...t,className:P("peer data-[state=checked]:bg-ring data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15em] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring disabled:cursor-not-allowed disabled:opacity-50",t?.className),children:e.jsx(j.Thumb,{className:P("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})},exports.capitalize=S,exports.cn=P,exports.getRandomString=k;
2
2
  //# sourceMappingURL=index.cjs.map