@nons-dev/uikit 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.
package/dist/index.js ADDED
@@ -0,0 +1,3685 @@
1
+ var Ge = Object.defineProperty;
2
+ var Ye = (e, l, t) => l in e ? Ge(e, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[l] = t;
3
+ var Se = (e, l, t) => Ye(e, typeof l != "symbol" ? l + "" : l, t);
4
+ import { defineComponent as A, computed as g, openBlock as a, createElementBlock as n, normalizeClass as I, createBlock as E, resolveDynamicComponent as me, reactive as De, withCtx as F, renderSlot as j, createTextVNode as X, toDisplayString as x, useSlots as Xe, createCommentVNode as v, createVNode as C, createElementVNode as m, ref as M, watch as se, onMounted as ee, onUnmounted as ne, withModifiers as Y, Transition as te, Fragment as U, renderList as H, withDirectives as ce, vModelText as Ae, normalizeStyle as Q, unref as K, mergeProps as Le, h as Ie, onBeforeUnmount as Ze, nextTick as Je, vShow as Ve, useCssVars as Qe } from "vue";
5
+ import { Tag as et, Folder as tt, Globe as at, Minimize2 as Te, Maximize2 as Ee, Clock as st, Bell as lt, Info as nt, HelpCircle as ot, AlertCircle as Be, X as Me, ChartPie as it, Moon as rt, Sun as ct, Check as dt, MoreHorizontal as ut, ArrowRight as mt, ArrowLeft as vt, Edit2 as ft, Trash2 as pt, Filter as bt, ChevronDown as Pe, Search as ht, Plus as gt, Menu as _t, Bolt as yt, Terminal as kt, Settings as wt, Fingerprint as $t, BarChart3 as Ct, Flag as xt, MessageSquare as St, Archive as It, Package as Vt, ShoppingBag as Bt, Users as zt, LayoutDashboard as ze, ChevronUp as Dt, ChevronsUpDown as At } from "@lucide/vue";
6
+ class Lt {
7
+ constructor() {
8
+ Se(this, "registry", /* @__PURE__ */ new Map());
9
+ }
10
+ register(l, t) {
11
+ this.registry.set(l, t);
12
+ }
13
+ get(l) {
14
+ return this.registry.get(l);
15
+ }
16
+ has(l) {
17
+ return this.registry.has(l);
18
+ }
19
+ }
20
+ const T = new Lt(), Tt = /* @__PURE__ */ A({
21
+ __name: "Icon",
22
+ props: {
23
+ name: {},
24
+ size: { default: "md" },
25
+ variant: { default: "default" }
26
+ },
27
+ setup(e) {
28
+ const l = {
29
+ "layout-dashboard": ze,
30
+ dashboard: ze,
31
+ users: zt,
32
+ "shopping-bag": Bt,
33
+ package: Vt,
34
+ archive: It,
35
+ "message-square": St,
36
+ flag: xt,
37
+ "bar-chart": Ct,
38
+ fingerprint: $t,
39
+ settings: wt,
40
+ terminal: kt,
41
+ bolt: yt,
42
+ menu: _t,
43
+ plus: gt,
44
+ search: ht,
45
+ "chevron-down": Pe,
46
+ filter: bt,
47
+ trash: pt,
48
+ edit: ft,
49
+ "arrow-left": vt,
50
+ "arrow-right": mt,
51
+ more: ut,
52
+ check: dt,
53
+ sun: ct,
54
+ moon: rt,
55
+ "chart-pie": it,
56
+ x: Me,
57
+ "alert-circle": Be,
58
+ attention: Be,
59
+ help: ot,
60
+ info: nt,
61
+ bell: lt,
62
+ clock: st,
63
+ "maximize-2": Ee,
64
+ "minimize-2": Te,
65
+ globe: at,
66
+ folder: tt,
67
+ tag: et
68
+ }, t = e, s = g(() => t.name.startsWith("ti-") || t.name.startsWith("ti ") || t.name.includes(" ")), i = g(() => l[t.name.toLowerCase()]), o = g(() => [
69
+ "ds-icon",
70
+ `ds-icon--size-${t.size}`,
71
+ `ds-icon--variant-${t.variant}`
72
+ ]);
73
+ return (c, r) => s.value ? (a(), n("i", {
74
+ key: 0,
75
+ class: I([e.name, o.value])
76
+ }, null, 2)) : i.value ? (a(), E(me(i.value), {
77
+ key: 1,
78
+ class: I(o.value),
79
+ "aria-hidden": "true"
80
+ }, null, 8, ["class"])) : (a(), n("span", {
81
+ key: 2,
82
+ class: I(o.value)
83
+ }, "?", 2));
84
+ }
85
+ }), L = (e, l) => {
86
+ const t = e.__vccOpts || e;
87
+ for (const [s, i] of l)
88
+ t[s] = i;
89
+ return t;
90
+ }, R = /* @__PURE__ */ L(Tt, [["__scopeId", "data-v-3b88d7f1"]]), Et = { name: "نونز", footer: "پنل مدیریت" }, Mt = { dashboard: "دکمه‌ها (Buttons)", users: "آیکون‌ها (Icons)", stores: "تایپوگرافی (Text)", products: "فیلدهای فرم (Forms)", orders: "چیدمان (Layouts)", chat: "نشان و آواتار (Badges)", reports: "جداکننده (Divider)", stats: "رندر اسکیما (Schema)", components: "کامپوننت‌ها" }, Pt = { name: "بهروز", email: "admin@Nons.ir" }, Ot = { search: "جستجو کنید...", child_panel: "پنل فروشنده", child_finance: "امور مالی", child_content: "مدیریت محتوا", panel_finance: "مالی", panel_seller: "فروشنده", panel_support: "پشتیبانی", theme_toggle: "تغییر پوسته", settings: "تنظیمات", reports: "گزارش", add: "افزودن", lang_fa: "فارسی", lang_en: "English" }, Rt = { title: "فهرست نقش‌ها", subtitle: "فهرست کاربران خود را در اینجا مدیریت کنید", add_new: "افزودن جدید", search: "جستجو...", filter: "فیلتر", filter_all: "همه نقش‌ها", filter_admin: "ادمین", filter_seller: "فروشنده", filter_viewer: "بازدیدکننده", next: "بعدی", prev: "قبلی", delete: "حذف", edit: "ویرایش", cancel: "انصراف", save: "ذخیره", add_role: "افزودن نقش جدید", edit_role: "ویرایش نقش", no_data: "هیچ داده‌ای یافت نشد." }, Nt = { name: "نقش", key: "شناسه", capabilities: "توانایی‌ها", count: "تعداد", actions: "اقدام", name_placeholder: "مثال: فروشنده", key_placeholder: "مثال: SELLER", name_label: "نام نقش", key_label: "شناسه نقش", access_type: "نوع دسترسی", access_placeholder: "انتخاب کنید...", access_full: "دسترسی کامل", access_limited: "دسترسی محدود", access_readonly: "فقط مشاهده", cap_full_access: "دسترسی کامل", cap_shop: "فروشگاه", cap_support: "پشتیبانی", cap_products: "محصولات", cap_report: "گزارش", cap_buy: "خرید", cap_sell: "فروش", cap_view: "مشاهده", cap_limited: "محدود", error_name_required: "نام نقش الزامی است", error_key_required: "شناسه نقش الزامی است", error_key_exists: "نقشی با این شناسه قبلاً ثبت شده است" }, Ft = { title: "کاوشگر کامپوننت‌ها", subtitle: "مرور و پیش‌نمایش تمام کامپوننت‌های سیستم طراحی", categories: { actions: "عملیات (Actions)", forms: "فرم‌ها (Forms)", feedback: "بازخورد (Feedback)", base: "پایه (Base)", layouts: "چیدمان (Layouts)", components: "کامپوننت‌ها (Components)", navigation: "ناوبری (Navigation)", "data-display": "نمایش داده (Data Display)", disclosure: "نمایش انتخابی (Disclosure)" }, tabs: { preview: "پیش‌نمایش", props: "مشخصات (Props)", schema: "اسکیما (Schema)", usage: "نحوه استفاده" }, components: { button: { name: "دکمه (Button)", desc: "دکمه‌های تعاملی با انواع، اندازه‌ها و حالت‌های مختلف" }, "icon-button": { name: "دکمه آیکونی (IconButton)", desc: "دکمه مربعی فقط با آیکون برای عملیات فشرده" }, icon: { name: "آیکون (Icon)", desc: "سیستم آیکون یکپارچه با اندازه‌های توکن و رنگ‌های معنایی" }, text: { name: "متن (Text)", desc: "کامپوننت تایپوگرافی با مقیاس‌ها و وزن‌های از پیش تعریف شده" }, input: { name: "ورودی (Input)", desc: "فیلد ورودی متن با پشتیبانی از آیکون و حالت خطا" }, spacer: { name: "فاصله‌انداز (Spacer)", desc: "ایجاد فضا و فواصل یکنواخت و استاندارد در چیدمان لایه‌ها" }, textarea: { name: "ورودی چندخطی (Textarea)", desc: "فیلد ورودی متن چند خطی با پشتیبانی از شمارشگر کاراکتر و کلمه" }, select: { name: "انتخاب (Select)", desc: "منوی کشویی انتخاب با گزینه‌های سفارشی" }, "multi-select": { name: "انتخاب چندگانه (MultiSelect)", desc: "منوی کشویی انتخاب چندگانه با قابلیت جستجو، چک‌لیست و نمایش تگ‌ها" }, "search-box": { name: "جعبه جستجو (SearchBox)", desc: "ترکیب فیلد ورودی و آیکون جستجو همراه با دکمه پاک‌سازی" }, dropdown: { name: "منوی کشویی (Dropdown)", desc: "منوی انتخابی با پشتیبانی از گزینه‌های ثابت و فراخوانی API" }, autocomplete: { name: "تکمیل خودکار (AsyncAutocomplete)", desc: "ورودی متن با قابلیت بارگذاری پویا و غیرهمزمان اطلاعات از سرور" }, menu: { name: "منو (Menu)", desc: "منوی عمومی حاوی گزینه‌ها برای سایدبار یا منوهای بازشو" }, "menu-item": { name: "آیتم منو (MenuItem)", desc: "گزینه تکی داخل منو با پشتیبانی از آیکون و وضعیت فعال" }, tooltip: { name: "تولتیپ (Tooltip)", desc: "نمایش اطلاعات کمکی بر روی عناصر با نگه‌داشتن موس" }, popover: { name: "پاپ‌اور (Popover)", desc: "نمایش محتوای شناور و تعاملی در جریان صفحه" }, tabs: { name: "تب‌ها (Tabs)", desc: "ابزار ناوبری و جابجایی بین بخش‌های مختلف محتوا" }, checkbox: { name: "کادر انتخاب (Checkbox)", desc: "کادر انتخاب با طراحی سفارشی و پشتیبانی از حالت غیرفعال" }, switch: { name: "سوئیچ (Switch)", desc: "سوئیچ دوحالته با انیمیشن و پشتیبانی از حالت غیرفعال" }, badge: { name: "نشان (Badge)", desc: "نشان‌های رنگی با انواع معنایی و آیکون" }, avatar: { name: "آواتار (Avatar)", desc: "تصویر پروفایل کاربر با تصویر یا حروف اول نام" }, divider: { name: "جداکننده (Divider)", desc: "خط جداکننده افقی با ضخامت توکن" }, card: { name: "کارت (Card)", desc: "کارت محتوا شامل بخش‌های سربرگ، بدنه و پاورقی" }, table: { name: "جدول (SchemaTable)", desc: "جدول Schema-Driven با قابلیت sort، انتخاب سطر و یکپارچه‌سازی TableCell" }, "table-cell": { name: "سلول جدول (TableCell)", desc: "سلول جدول مبتنی بر اسکیما با ۶ نوع مختلف (text, date, profile, tag, checkbox, actions)" }, "filter-bar": { name: "نوار فیلتر (FilterBar)", desc: "ترکیبی از فیلدها برای فیلتر و جستجوی داده‌ها" }, pagination: { name: "صفحه‌بندی (Pagination)", desc: "کنترل صفحه‌بندی داده‌ها با اطلاعات صفحه فعلی" }, "empty-state": { name: "وضعیت خالی (EmptyState)", desc: "نمایش پیام استاندارد در صورت عدم وجود داده‌ها" }, "loading-state": { name: "وضعیت بارگذاری (LoadingState)", desc: "نمایش انیمیشن بارگذاری، اسپینر یا اسکلتون" }, sidepanel: { name: "پنل جانبی (SidePanel)", desc: "پنل کشویی جانبی با سربرگ و پاورقی" }, stack: { name: "پشته (Stack)", desc: "چیدمان عمودی یا افقی با فاصله و جداکننده" }, row: { name: "ردیف (Row)", desc: "چیدمان افقی انعطاف‌پذیر با گزینه‌های تراز" }, grid: { name: "شبکه (Grid)", desc: "سیستم شبکه پاسخگوی ۱۲ ستونی" }, section: { name: "بخش (Section)", desc: "بخش صفحه همراه با عنوان و زیرعنوان" }, accordion: { name: "آکاردئون (Accordion)", desc: "نمایش محتوای گروه‌بندی شده با قابلیت باز و بسته شدن" }, alert: { name: "اعلان (Alert)", desc: "نمایش پیام‌های سیستمی و هشدارهای درون صفحه‌ای" }, progress: { name: "پیشرفت (Progress)", desc: "نمایش درصد پیشرفت عملیات جاری" }, breadcrumb: { name: "مسیر راهنما (Breadcrumb)", desc: "نمایش مسیر جاری کاربر در صفحات برنامه" }, chip: { name: "چیپ (Chip)", desc: "برچسب‌های کوچک تعاملی با قابلیت حذف" }, "command-menu": { name: "منوی دستورات (CommandMenu)", desc: "منوی جستجوی سریع و اجرای عملیات با کلیدهای میانبر" }, "swipe-item": { name: "آیتم کشویی (SwipeItem)", desc: "آیتم لیست با قابلیت کشیدن برای نمایش دکمه‌های عملیات" }, sidebar: { name: "سایدبار (SidebarNav)", desc: "سایدبار ناوبری مبتنی بر اسکیما با حالت باز/بسته" }, "user-card": { name: "کاربر (UserCard)", desc: "کارت پروفایل کاربر برای فوتر سایدبار با آواتار، نام، نقش و آیکون عملیات" }, "page-title": { name: "عنوان صفحه (PageTitle)", desc: "هدر صفحه با عنوان، زیرعنوان و دکمه عملیات اختیاری" }, "notification-bell": { name: "زنگ اعلان (NotificationBell)", desc: "دکمه زنگ با نشانگر اعلان خوانده نشده" }, "notification-panel": { name: "پنل اعلان (NotificationPanel)", desc: "پنل کشویی لیست اعلان‌ها با ردیف‌های SwipeItem" }, "toggle-button": { name: "دکمه تغییر حالت (ToggleButton)", desc: "دکمه دو حالته با آیکون و برچسب مجزا برای هر حالت" }, "action-toggle": { name: "تغییردهنده عملیات (ActionToggle)", desc: "تغییردهنده قطعه‌بندی‌شده با ۲ یا ۳ گزینه و لغزنده" } } }, Ut = { previous: "قبلی", next: "بعدی", page_of: "صفحه {page} از {total}" }, qt = { text: "در حال بارگذاری..." }, jt = { empty: "هیچ داده‌ای یافت نشد." }, Kt = { no_results: "نتیجه‌ای یافت نشد", remove: "حذف", go: "برو", run: "اجرا", transfer: "انتقال" }, Ht = { words: "کلمه" }, Wt = { demo_title: "تست رندر پویا از روی اسکیما (Schema UI Engine)", demo_subtitle: "این کادر به طور کامل از یک مشخصات JSON رندر شده است و عملکرد واقعی دارد.", input_placeholder: "ورودی اسکیما...", submit: "ثبت از اسکیما" }, Gt = {
91
+ app: Et,
92
+ nav: Mt,
93
+ profile: Pt,
94
+ header: Ot,
95
+ home: Rt,
96
+ role: Nt,
97
+ explorer: Ft,
98
+ pagination: Ut,
99
+ loading: qt,
100
+ table: jt,
101
+ common: Kt,
102
+ textarea: Ht,
103
+ schema: Wt
104
+ }, Yt = { name: "Nons", footer: "Admin Panel" }, Xt = { dashboard: "Buttons", users: "Icons", stores: "Typography", products: "Form Fields", orders: "Layouts", chat: "Badges & Avatars", reports: "Dividers", stats: "Schema Renderer", components: "Components" }, Zt = { name: "Behrouz", email: "admin@Nons.ir" }, Jt = { search: "Search...", child_panel: "Seller Panel", child_finance: "Finance", child_content: "Content Management", panel_finance: "Finance", panel_seller: "Seller", panel_support: "Support", theme_toggle: "Toggle Theme", settings: "Settings", reports: "Reports", add: "Add", lang_fa: "Persian", lang_en: "English" }, Qt = { title: "Roles List", subtitle: "Manage your users here", add_new: "Add New", search: "Search...", filter: "Filter", filter_all: "All Roles", filter_admin: "Admin", filter_seller: "Seller", filter_viewer: "Viewer", next: "Next", prev: "Previous", delete: "Delete", edit: "Edit", cancel: "Cancel", save: "Save", add_role: "Add New Role", edit_role: "Edit Role", no_data: "No data found." }, ea = { name: "Role", key: "Key", capabilities: "Capabilities", count: "Count", actions: "Actions", name_placeholder: "e.g. Seller", key_placeholder: "e.g. SELLER", name_label: "Role Name", key_label: "Role Key", access_type: "Access Type", access_placeholder: "Select...", access_full: "Full Access", access_limited: "Limited Access", access_readonly: "Read Only", cap_full_access: "Full Access", cap_shop: "Shop", cap_support: "Support", cap_products: "Products", cap_report: "Report", cap_buy: "Buy", cap_sell: "Sell", cap_view: "View", cap_limited: "Limited", error_name_required: "Role name is required", error_key_required: "Role key is required", error_key_exists: "A role with this key already exists" }, ta = { title: "Component Explorer", subtitle: "Browse and preview all design system components", categories: { actions: "Actions", forms: "Forms", feedback: "Feedback", base: "Base", layouts: "Layouts", components: "Components", navigation: "Navigation", "data-display": "Data Display", disclosure: "Disclosure" }, tabs: { preview: "Preview", props: "Props", schema: "Schema", usage: "Usage" }, components: { button: { name: "Button", desc: "Interactive buttons with variants, sizes and states" }, "icon-button": { name: "IconButton", desc: "Icon-only square button for compact actions" }, icon: { name: "Icon", desc: "Unified icon system with token sizes and semantic colors" }, text: { name: "Text", desc: "Typography component with predefined scales and weights" }, input: { name: "Input", desc: "Text input field with icon and error state support" }, spacer: { name: "Spacer", desc: "Fixed token-based layout spacer for spacing sections" }, textarea: { name: "Textarea", desc: "Multiline text input with character and word limits support" }, select: { name: "Select", desc: "Dropdown select menu with custom options" }, "multi-select": { name: "MultiSelect", desc: "Dropdown select menu with multiple checkable options and display tags" }, "search-box": { name: "SearchBox", desc: "Text input combined with search icon and clear actions" }, dropdown: { name: "Dropdown", desc: "General selection dropdown with static items and API source loading" }, autocomplete: { name: "AsyncAutocomplete", desc: "Text input with dynamic and asynchronous suggestion loading from server" }, menu: { name: "Menu", desc: "Structured menu layout with dynamic options" }, "menu-item": { name: "MenuItem", desc: "Individual choice element in a Menu block" }, tooltip: { name: "Tooltip", desc: "Helpful overlay text displaying on mouse-over" }, popover: { name: "Popover", desc: "Floating interactive content panel mapping to logical flow" }, tabs: { name: "Tabs", desc: "Navigation controls for switching between content sections" }, checkbox: { name: "Checkbox", desc: "Custom styled checkbox with disabled state" }, switch: { name: "Switch", desc: "Toggle switch with animation and disabled state" }, badge: { name: "Badge", desc: "Colored badges with semantic variants and icon" }, avatar: { name: "Avatar", desc: "User avatar with image or fallback initials" }, divider: { name: "Divider", desc: "Horizontal divider line with token thickness" }, card: { name: "Card", desc: "Content card with header, body and footer sections" }, table: { name: "SchemaTable", desc: "Schema-driven table with sort, row selection, and TableCell integration" }, "table-cell": { name: "TableCell", desc: "Schema-driven table cell with 6 type variants (text, date, profile, tag, checkbox, actions)" }, "filter-bar": { name: "FilterBar", desc: "Composed search and filter controls for datasets" }, pagination: { name: "Pagination", desc: "Navigation controls for datasets pages" }, "empty-state": { name: "EmptyState", desc: "Informational banner when zero records are returned" }, "loading-state": { name: "LoadingState", desc: "Spinner, shimmering skeletons or placeholders for pending processes" }, sidepanel: { name: "SidePanel", desc: "Slide-in side panel with header and footer" }, stack: { name: "Stack", desc: "Vertical or horizontal layout with gap and separator" }, row: { name: "Row", desc: "Flexible horizontal layout with alignment options" }, grid: { name: "Grid", desc: "12-column responsive grid system" }, section: { name: "Section", desc: "Page section with title and subtitle" }, accordion: { name: "Accordion", desc: "Collapsible content panels for grouping related information" }, alert: { name: "Alert", desc: "Inline message panels for notifications and confirmation actions" }, progress: { name: "Progress", desc: "Visual progress indicators for ongoing operations" }, breadcrumb: { name: "Breadcrumb", desc: "Navigation trail for displaying current page hierarchy" }, chip: { name: "Chip", desc: "Compact, interactive tags with delete action buttons" }, "command-menu": { name: "CommandMenu", desc: "Keyboard-navigable search and action command palette" }, "swipe-item": { name: "SwipeItem", desc: "Swipeable list item that reveals action buttons on swipe" }, sidebar: { name: "SidebarNav", desc: "Schema-driven navigation sidebar with collapsed/expanded modes" }, "user-card": { name: "UserCard", desc: "Compact user profile card for sidebar footers with avatar, name, role and action icon" }, "page-title": { name: "PageTitle", desc: "Page header with title, subtitle and optional action button" }, "notification-bell": { name: "NotificationBell", desc: "Bell button with unread notification dot indicator" }, "notification-panel": { name: "NotificationPanel", desc: "Dropdown panel listing notification items with SwipeItem rows" }, "toggle-button": { name: "ToggleButton", desc: "Two-state button with separate icon and label for each state" }, "action-toggle": { name: "ActionToggle", desc: "Segmented toggle with 2 or 3 options and sliding thumb" } } }, aa = { previous: "Previous", next: "Next", page_of: "Page {page} of {total}" }, sa = { text: "Loading..." }, la = { empty: "No data found." }, na = { no_results: "No results found", remove: "Remove", go: "Go", run: "Run", transfer: "Transfer" }, oa = { words: "words" }, ia = { demo_title: "Dynamic Schema Rendering Test (Schema UI Engine)", demo_subtitle: "This card is fully rendered from a JSON specification and has real functionality.", input_placeholder: "Schema input...", submit: "Submit from Schema" }, ra = {
105
+ app: Yt,
106
+ nav: Xt,
107
+ profile: Zt,
108
+ header: Jt,
109
+ home: Qt,
110
+ role: ea,
111
+ explorer: ta,
112
+ pagination: aa,
113
+ loading: sa,
114
+ table: la,
115
+ common: na,
116
+ textarea: oa,
117
+ schema: ia
118
+ }, ca = { fa: Gt, en: ra }, $e = De({
119
+ locale: "fa"
120
+ });
121
+ function da(e, l) {
122
+ const t = l.split(".");
123
+ let s = e;
124
+ for (const i of t)
125
+ if (s && typeof s == "object" && i in s)
126
+ s = s[i];
127
+ else
128
+ return l;
129
+ return typeof s == "string" ? s : l;
130
+ }
131
+ function Oe(e) {
132
+ $e.locale = e, document.documentElement.lang = e;
133
+ }
134
+ function W(e, l) {
135
+ const t = ca[$e.locale];
136
+ if (!t) return e;
137
+ let s = da(t, e);
138
+ if (l)
139
+ for (const [i, o] of Object.entries(l))
140
+ s = s.replace(`{${i}}`, o);
141
+ return s;
142
+ }
143
+ function Re() {
144
+ return {
145
+ locale: g(() => $e.locale),
146
+ t: (e, l) => W(e, l),
147
+ setLocale: Oe
148
+ };
149
+ }
150
+ const ua = /* @__PURE__ */ A({
151
+ __name: "Text",
152
+ props: {
153
+ variant: { default: "body-md" },
154
+ value: {},
155
+ truncate: { type: Boolean, default: !1 },
156
+ tag: {}
157
+ },
158
+ setup(e) {
159
+ const l = e, t = g(() => l.value ? W(l.value) : ""), s = g(() => [
160
+ "ds-text",
161
+ `ds-text--${l.variant}`,
162
+ {
163
+ "ds-text--truncate": l.truncate
164
+ }
165
+ ]), i = g(() => {
166
+ if (l.tag) return l.tag;
167
+ switch (l.variant) {
168
+ case "heading-2xl":
169
+ return "h1";
170
+ case "heading-xl":
171
+ return "h2";
172
+ case "heading-lg":
173
+ return "h3";
174
+ case "title":
175
+ return "h3";
176
+ case "subtitle":
177
+ return "p";
178
+ case "body-md":
179
+ return "p";
180
+ case "body-sm":
181
+ return "span";
182
+ case "caption":
183
+ return "span";
184
+ default:
185
+ return "span";
186
+ }
187
+ });
188
+ return (o, c) => (a(), E(me(i.value), {
189
+ class: I(s.value)
190
+ }, {
191
+ default: F(() => [
192
+ j(o.$slots, "default", {}, () => [
193
+ X(x(t.value), 1)
194
+ ], !0)
195
+ ]),
196
+ _: 3
197
+ }, 8, ["class"]));
198
+ }
199
+ }), G = /* @__PURE__ */ L(ua, [["__scopeId", "data-v-a0656bf0"]]), ma = ["type", "disabled"], va = {
200
+ key: 0,
201
+ class: "ds-button__spinner"
202
+ }, fa = {
203
+ key: 2,
204
+ class: "ds-button__content"
205
+ }, pa = /* @__PURE__ */ A({
206
+ __name: "Button",
207
+ props: {
208
+ variant: { default: "primary" },
209
+ size: { default: "md" },
210
+ disabled: { type: Boolean, default: !1 },
211
+ loading: { type: Boolean, default: !1 },
212
+ type: { default: "button" },
213
+ icon: {},
214
+ iconPosition: { default: "start" },
215
+ label: {}
216
+ },
217
+ emits: ["click"],
218
+ setup(e, { emit: l }) {
219
+ const t = e, s = l, i = Xe(), o = g(() => [
220
+ "ds-button",
221
+ `ds-button--${t.variant}`,
222
+ `ds-button--${t.size}`,
223
+ {
224
+ "ds-button--disabled": t.disabled,
225
+ "ds-button--loading": t.loading,
226
+ "ds-button--icon-only": t.icon && !t.label && !i.default
227
+ }
228
+ ]);
229
+ function c(r) {
230
+ !t.disabled && !t.loading && s("click", r);
231
+ }
232
+ return (r, d) => (a(), n("button", {
233
+ type: e.type,
234
+ class: I(o.value),
235
+ disabled: e.disabled || e.loading,
236
+ onClick: c
237
+ }, [
238
+ e.loading ? (a(), n("span", va)) : v("", !0),
239
+ e.icon && e.iconPosition === "start" && !e.loading ? (a(), E(R, {
240
+ key: 1,
241
+ name: e.icon,
242
+ size: "sm",
243
+ variant: "default"
244
+ }, null, 8, ["name"])) : v("", !0),
245
+ r.$slots.default || e.label ? (a(), n("span", fa, [
246
+ j(r.$slots, "default", {}, () => [
247
+ C(G, {
248
+ variant: "body-md",
249
+ value: e.label
250
+ }, null, 8, ["value"])
251
+ ], !0)
252
+ ])) : v("", !0),
253
+ e.icon && e.iconPosition === "end" && !e.loading ? (a(), E(R, {
254
+ key: 3,
255
+ name: e.icon,
256
+ size: "sm",
257
+ variant: "default"
258
+ }, null, 8, ["name"])) : v("", !0)
259
+ ], 10, ma));
260
+ }
261
+ }), J = /* @__PURE__ */ L(pa, [["__scopeId", "data-v-d35f9b75"]]), ba = { class: "ds-input__container" }, ha = ["id", "type", "value", "placeholder", "disabled", "readonly"], ga = /* @__PURE__ */ A({
262
+ __name: "Input",
263
+ props: {
264
+ modelValue: { default: "" },
265
+ placeholder: { default: "" },
266
+ disabled: { type: Boolean, default: !1 },
267
+ readonly: { type: Boolean, default: !1 },
268
+ error: { type: [Boolean, String], default: !1 },
269
+ type: { default: "text" },
270
+ icon: {},
271
+ id: {},
272
+ state: { default: "default" },
273
+ hint: { default: "" }
274
+ },
275
+ emits: ["update:modelValue", "focus", "blur", "input", "keydown"],
276
+ setup(e, { emit: l }) {
277
+ const t = e, s = l, i = g(() => [
278
+ "ds-input",
279
+ {
280
+ "ds-input--disabled": t.disabled,
281
+ "ds-input--readonly": t.readonly,
282
+ "ds-input--error": !!t.error,
283
+ "ds-input--has-icon": !!t.icon
284
+ }
285
+ ]);
286
+ function o(c) {
287
+ const r = c.target;
288
+ s("update:modelValue", r.value), s("input", c);
289
+ }
290
+ return (c, r) => (a(), n("div", {
291
+ class: I(i.value)
292
+ }, [
293
+ m("div", ba, [
294
+ e.icon ? (a(), E(R, {
295
+ key: 0,
296
+ name: e.icon,
297
+ size: "sm",
298
+ class: "ds-input__icon"
299
+ }, null, 8, ["name"])) : v("", !0),
300
+ m("input", {
301
+ id: e.id,
302
+ type: e.type,
303
+ value: e.modelValue,
304
+ placeholder: e.placeholder,
305
+ disabled: e.disabled,
306
+ readonly: e.readonly,
307
+ class: "ds-input__field",
308
+ onInput: o,
309
+ onFocus: r[0] || (r[0] = (d) => s("focus", d)),
310
+ onBlur: r[1] || (r[1] = (d) => s("blur", d)),
311
+ onKeydown: r[2] || (r[2] = (d) => s("keydown", d))
312
+ }, null, 40, ha)
313
+ ])
314
+ ], 2));
315
+ }
316
+ }), ve = /* @__PURE__ */ L(ga, [["__scopeId", "data-v-87de59e7"]]), _a = {
317
+ class: "ds-divider",
318
+ role: "separator"
319
+ }, ya = /* @__PURE__ */ A({
320
+ __name: "Divider",
321
+ setup(e) {
322
+ return (l, t) => (a(), n("hr", _a));
323
+ }
324
+ }), Ne = /* @__PURE__ */ L(ya, [["__scopeId", "data-v-eed27970"]]), ka = /* @__PURE__ */ A({
325
+ __name: "Badge",
326
+ props: {
327
+ variant: { default: "default" },
328
+ text: {},
329
+ icon: {}
330
+ },
331
+ setup(e) {
332
+ const l = e, t = g(() => [
333
+ "ds-badge",
334
+ `ds-badge--${l.variant}`
335
+ ]);
336
+ return (s, i) => (a(), n("span", {
337
+ class: I(t.value)
338
+ }, [
339
+ e.icon ? (a(), E(R, {
340
+ key: 0,
341
+ name: e.icon,
342
+ size: "xs",
343
+ variant: "default",
344
+ class: "ds-badge__icon"
345
+ }, null, 8, ["name"])) : v("", !0),
346
+ j(s.$slots, "default", {}, () => [
347
+ C(G, {
348
+ variant: "caption",
349
+ value: e.text,
350
+ class: "ds-badge__text"
351
+ }, null, 8, ["value"])
352
+ ], !0)
353
+ ], 2));
354
+ }
355
+ }), wa = /* @__PURE__ */ L(ka, [["__scopeId", "data-v-c82975a6"]]), $a = ["src", "alt"], Ca = {
356
+ key: 1,
357
+ class: "ds-avatar__fallback"
358
+ }, xa = /* @__PURE__ */ A({
359
+ __name: "Avatar",
360
+ props: {
361
+ src: {},
362
+ name: { default: "" },
363
+ size: { default: "md" },
364
+ fallback: {},
365
+ square: { type: Boolean, default: !1 }
366
+ },
367
+ setup(e) {
368
+ const l = e, t = M(!1);
369
+ se(() => l.src, () => {
370
+ t.value = !1;
371
+ });
372
+ const s = g(() => {
373
+ var d, f;
374
+ if (l.fallback) return l.fallback;
375
+ if (!l.name) return "?";
376
+ const o = l.name.trim().split(/\s+/);
377
+ if (o.length === 0) return "?";
378
+ if (o.length === 1) {
379
+ const u = o[0];
380
+ return u ? u.charAt(0).toUpperCase() : "?";
381
+ }
382
+ const c = ((d = o[0]) == null ? void 0 : d.charAt(0)) || "", r = ((f = o[o.length - 1]) == null ? void 0 : f.charAt(0)) || "";
383
+ return (c + r).toUpperCase();
384
+ }), i = g(() => [
385
+ "ds-avatar",
386
+ `ds-avatar--${l.size}`,
387
+ { "ds-avatar--square": l.square }
388
+ ]);
389
+ return (o, c) => (a(), n("div", {
390
+ class: I(i.value)
391
+ }, [
392
+ e.src && !t.value ? (a(), n("img", {
393
+ key: 0,
394
+ src: e.src,
395
+ alt: e.name,
396
+ class: "ds-avatar__image",
397
+ onError: c[0] || (c[0] = (r) => t.value = !0)
398
+ }, null, 40, $a)) : (a(), n("div", Ca, x(s.value), 1))
399
+ ], 2));
400
+ }
401
+ }), re = /* @__PURE__ */ L(xa, [["__scopeId", "data-v-6c2614a9"]]), Sa = { class: "ds-select__wrapper" }, Ia = ["id", "aria-expanded", "aria-controls"], Va = {
402
+ key: 0,
403
+ class: "ds-select__value"
404
+ }, Ba = {
405
+ key: 1,
406
+ class: "ds-select__placeholder"
407
+ }, za = ["id"], Da = ["aria-selected", "onClick", "onMouseenter"], Aa = /* @__PURE__ */ A({
408
+ __name: "Select",
409
+ props: {
410
+ modelValue: { type: [String, Number, Boolean], default: "" },
411
+ options: { default: () => [] },
412
+ placeholder: { default: "" },
413
+ disabled: { type: Boolean, default: !1 },
414
+ error: { type: [Boolean, String], default: !1 },
415
+ id: {}
416
+ },
417
+ emits: ["update:modelValue", "change"],
418
+ setup(e, { emit: l }) {
419
+ const t = e, s = l;
420
+ function i(p) {
421
+ return typeof p == "object" && p !== null ? p : { label: String(p), value: p };
422
+ }
423
+ function o(p) {
424
+ return i(p).value;
425
+ }
426
+ function c(p) {
427
+ return i(p).label;
428
+ }
429
+ const r = g(() => {
430
+ const p = t.modelValue;
431
+ if (p === "" || p === void 0) return "";
432
+ const V = t.options.find((_) => o(_) === p);
433
+ return V ? c(V) : "";
434
+ }), d = M(!1), f = M(null), u = M(null), h = M(-1);
435
+ function y() {
436
+ t.disabled || (d.value = !d.value, P());
437
+ }
438
+ function $() {
439
+ t.disabled || d.value || (d.value = !0, P());
440
+ }
441
+ function P() {
442
+ const p = t.modelValue;
443
+ h.value = t.options.findIndex((V) => o(V) === p);
444
+ }
445
+ function D() {
446
+ var p;
447
+ d.value = !1, h.value = -1, (p = f.value) == null || p.focus();
448
+ }
449
+ function B(p) {
450
+ const V = o(p);
451
+ if (V === t.modelValue) {
452
+ D();
453
+ return;
454
+ }
455
+ s("update:modelValue", V), s("change", V), D();
456
+ }
457
+ function q(p) {
458
+ if (!t.disabled) {
459
+ if (!d.value) {
460
+ (p.key === "Enter" || p.key === "ArrowDown" || p.key === " ") && (p.preventDefault(), $());
461
+ return;
462
+ }
463
+ switch (p.key) {
464
+ case "Escape":
465
+ p.preventDefault(), D();
466
+ break;
467
+ case "ArrowDown":
468
+ p.preventDefault(), h.value = h.value < t.options.length - 1 ? h.value + 1 : 0;
469
+ break;
470
+ case "ArrowUp":
471
+ p.preventDefault(), h.value = h.value > 0 ? h.value - 1 : t.options.length - 1;
472
+ break;
473
+ case "Enter":
474
+ p.preventDefault(), h.value >= 0 && h.value < t.options.length && B(t.options[h.value]);
475
+ break;
476
+ }
477
+ }
478
+ }
479
+ function k(p) {
480
+ const V = p.target, _ = f.value, w = u.value;
481
+ !_ && !w || _ && _.contains(V) || w && w.contains(V) || d.value && D();
482
+ }
483
+ ee(() => {
484
+ document.addEventListener("click", k);
485
+ }), ne(() => {
486
+ document.removeEventListener("click", k);
487
+ });
488
+ const S = g(() => [
489
+ "ds-select",
490
+ {
491
+ "ds-select--disabled": t.disabled,
492
+ "ds-select--error": !!t.error,
493
+ "ds-select--open": d.value
494
+ }
495
+ ]), O = g(() => t.id ? `${t.id}-listbox` : void 0);
496
+ return (p, V) => (a(), n("div", {
497
+ class: I(S.value)
498
+ }, [
499
+ m("div", Sa, [
500
+ m("div", {
501
+ id: e.id,
502
+ ref_key: "triggerRef",
503
+ ref: f,
504
+ role: "combobox",
505
+ "aria-expanded": d.value,
506
+ "aria-controls": O.value,
507
+ "aria-haspopup": "listbox",
508
+ tabindex: "0",
509
+ class: I(["ds-select__trigger", { "ds-select__trigger--open": d.value }]),
510
+ onClick: Y(y, ["stop"]),
511
+ onKeydown: q
512
+ }, [
513
+ r.value ? (a(), n("span", Va, x(r.value), 1)) : (a(), n("span", Ba, x(e.placeholder), 1)),
514
+ C(R, {
515
+ name: "chevron-down",
516
+ class: "ds-select__chevron",
517
+ size: "sm"
518
+ })
519
+ ], 42, Ia),
520
+ C(te, { name: "ds-select-drop" }, {
521
+ default: F(() => [
522
+ d.value ? (a(), n("div", {
523
+ key: 0,
524
+ id: O.value,
525
+ ref_key: "dropdownRef",
526
+ ref: u,
527
+ role: "listbox",
528
+ class: "ds-select__dropdown",
529
+ onClick: V[0] || (V[0] = Y(() => {
530
+ }, ["stop"]))
531
+ }, [
532
+ (a(!0), n(U, null, H(t.options, (_, w) => (a(), n("div", {
533
+ key: String(o(_)),
534
+ role: "option",
535
+ "aria-selected": o(_) === e.modelValue,
536
+ class: I(["ds-select__option", {
537
+ "ds-select__option--selected": o(_) === e.modelValue,
538
+ "ds-select__option--focused": w === h.value
539
+ }]),
540
+ onClick: Y((b) => B(_), ["stop"]),
541
+ onMouseenter: (b) => h.value = w
542
+ }, x(c(_)), 43, Da))), 128))
543
+ ], 8, za)) : v("", !0)
544
+ ]),
545
+ _: 1
546
+ })
547
+ ])
548
+ ], 2));
549
+ }
550
+ }), ye = /* @__PURE__ */ L(Aa, [["__scopeId", "data-v-25bdbd32"]]), La = { class: "ds-multi-select__wrapper" }, Ta = ["id", "placeholder", "disabled"], Ea = {
551
+ key: 0,
552
+ class: "ds-multi-select__no-results"
553
+ }, Ma = ["aria-selected", "onClick", "onMouseenter"], Pa = { class: "ds-multi-select__option-label" }, Oa = {
554
+ key: 0,
555
+ class: "ds-multi-select__tags"
556
+ }, Ra = { class: "ds-multi-select__tag-label" }, Na = ["disabled", "onClick"], Fa = /* @__PURE__ */ A({
557
+ __name: "MultiSelect",
558
+ props: {
559
+ modelValue: { default: () => [] },
560
+ options: { default: () => [] },
561
+ placeholder: { default: "" },
562
+ disabled: { type: Boolean, default: !1 },
563
+ error: { type: [Boolean, String], default: !1 },
564
+ id: {}
565
+ },
566
+ emits: ["update:modelValue", "change"],
567
+ setup(e, { emit: l }) {
568
+ const t = e, s = l, i = M(""), o = M(!1), c = M(null), r = M(null), d = M(-1);
569
+ function f(p) {
570
+ return typeof p == "object" && p !== null ? p : { label: String(p), value: p };
571
+ }
572
+ const u = g(() => t.options.map(f)), h = g(() => {
573
+ const p = i.value.toLowerCase().trim();
574
+ return p ? u.value.filter(
575
+ (V) => V.label.toLowerCase().includes(p)
576
+ ) : u.value;
577
+ }), y = g(() => u.value.filter(
578
+ (p) => t.modelValue.includes(p.value)
579
+ ));
580
+ function $(p) {
581
+ return t.modelValue.includes(p);
582
+ }
583
+ function P() {
584
+ t.disabled || o.value || (o.value = !0, d.value = -1);
585
+ }
586
+ function D() {
587
+ o.value = !1, d.value = -1;
588
+ }
589
+ function B(p) {
590
+ const V = [...t.modelValue], _ = V.indexOf(p.value);
591
+ _ > -1 ? V.splice(_, 1) : V.push(p.value), s("update:modelValue", V), s("change", V), i.value = "";
592
+ }
593
+ function q(p) {
594
+ if (t.disabled) return;
595
+ const V = t.modelValue.filter((_) => _ !== p);
596
+ s("update:modelValue", V), s("change", V);
597
+ }
598
+ function k(p) {
599
+ if (!t.disabled) {
600
+ if (!o.value) {
601
+ (p.key === "Enter" || p.key === "ArrowDown" || p.key === " ") && (p.preventDefault(), P());
602
+ return;
603
+ }
604
+ switch (p.key) {
605
+ case "Escape":
606
+ p.preventDefault(), D();
607
+ break;
608
+ case "ArrowDown":
609
+ if (p.preventDefault(), h.value.length === 0) return;
610
+ d.value = d.value < h.value.length - 1 ? d.value + 1 : 0;
611
+ break;
612
+ case "ArrowUp":
613
+ if (p.preventDefault(), h.value.length === 0) return;
614
+ d.value = d.value > 0 ? d.value - 1 : h.value.length - 1;
615
+ break;
616
+ case "Enter":
617
+ if (p.preventDefault(), d.value >= 0 && d.value < h.value.length) {
618
+ const V = h.value[d.value];
619
+ V && B(V);
620
+ }
621
+ break;
622
+ }
623
+ }
624
+ }
625
+ function S(p) {
626
+ const V = p.target, _ = c.value, w = r.value;
627
+ !_ && !w || _ && _.contains(V) || w && w.contains(V) || o.value && D();
628
+ }
629
+ ee(() => {
630
+ document.addEventListener("click", S);
631
+ }), ne(() => {
632
+ document.removeEventListener("click", S);
633
+ });
634
+ const O = g(() => [
635
+ "ds-multi-select",
636
+ {
637
+ "ds-multi-select--disabled": t.disabled,
638
+ "ds-multi-select--error": !!t.error,
639
+ "ds-multi-select--open": o.value
640
+ }
641
+ ]);
642
+ return (p, V) => (a(), n("div", {
643
+ class: I(O.value)
644
+ }, [
645
+ m("div", La, [
646
+ m("div", {
647
+ ref_key: "triggerRef",
648
+ ref: c,
649
+ class: I(["ds-multi-select__trigger", { "ds-multi-select__trigger--open": o.value }]),
650
+ onClick: P
651
+ }, [
652
+ ce(m("input", {
653
+ id: e.id,
654
+ "onUpdate:modelValue": V[0] || (V[0] = (_) => i.value = _),
655
+ type: "text",
656
+ placeholder: e.placeholder,
657
+ disabled: e.disabled,
658
+ class: "ds-multi-select__input",
659
+ onKeydown: k,
660
+ onFocus: P
661
+ }, null, 40, Ta), [
662
+ [Ae, i.value]
663
+ ]),
664
+ C(R, {
665
+ name: "chevron-down",
666
+ class: "ds-multi-select__chevron",
667
+ size: "sm"
668
+ })
669
+ ], 2),
670
+ C(te, { name: "ds-multi-select-drop" }, {
671
+ default: F(() => [
672
+ o.value ? (a(), n("div", {
673
+ key: 0,
674
+ ref_key: "dropdownRef",
675
+ ref: r,
676
+ role: "listbox",
677
+ class: "ds-multi-select__dropdown",
678
+ onClick: V[1] || (V[1] = Y(() => {
679
+ }, ["stop"]))
680
+ }, [
681
+ h.value.length === 0 ? (a(), n("div", Ea, x(i.value ? "نتیجه‌ای یافت نشد" : "گزینه‌ای وجود ندارد"), 1)) : v("", !0),
682
+ (a(!0), n(U, null, H(h.value, (_, w) => (a(), n("div", {
683
+ key: String(_.value),
684
+ role: "option",
685
+ "aria-selected": $(_.value),
686
+ class: I(["ds-multi-select__option", {
687
+ "ds-multi-select__option--selected": $(_.value),
688
+ "ds-multi-select__option--focused": w === d.value
689
+ }]),
690
+ onClick: Y((b) => B(_), ["stop"]),
691
+ onMouseenter: (b) => d.value = w
692
+ }, [
693
+ m("span", Pa, x(_.label), 1),
694
+ $(_.value) ? (a(), E(R, {
695
+ key: 0,
696
+ name: "check",
697
+ class: "ds-multi-select__check-icon",
698
+ size: "sm"
699
+ })) : v("", !0)
700
+ ], 42, Ma))), 128))
701
+ ], 512)) : v("", !0)
702
+ ]),
703
+ _: 1
704
+ })
705
+ ]),
706
+ y.value.length > 0 ? (a(), n("div", Oa, [
707
+ (a(!0), n(U, null, H(y.value, (_) => (a(), n("div", {
708
+ key: String(_.value),
709
+ class: "ds-multi-select__tag"
710
+ }, [
711
+ m("span", Ra, x(_.label), 1),
712
+ m("button", {
713
+ type: "button",
714
+ disabled: e.disabled,
715
+ class: "ds-multi-select__tag-remove",
716
+ onClick: Y((w) => q(_.value), ["stop"])
717
+ }, [
718
+ C(R, {
719
+ name: "x",
720
+ size: "xs"
721
+ })
722
+ ], 8, Na)
723
+ ]))), 128))
724
+ ])) : v("", !0)
725
+ ], 2));
726
+ }
727
+ }), Ua = /* @__PURE__ */ L(Fa, [["__scopeId", "data-v-0954eb25"]]), qa = ["id", "checked", "disabled"], ja = { class: "ds-checkbox__box" }, Ka = {
728
+ key: 0,
729
+ class: "ds-checkbox__label"
730
+ }, Ha = /* @__PURE__ */ A({
731
+ __name: "Checkbox",
732
+ props: {
733
+ modelValue: { type: Boolean, default: !1 },
734
+ label: {},
735
+ disabled: { type: Boolean, default: !1 },
736
+ error: { type: [Boolean, String], default: !1 },
737
+ id: {}
738
+ },
739
+ emits: ["update:modelValue", "change"],
740
+ setup(e, { emit: l }) {
741
+ const t = e, s = l, i = g(() => !!t.modelValue), o = g(() => [
742
+ "ds-checkbox",
743
+ {
744
+ "ds-checkbox--checked": i.value,
745
+ "ds-checkbox--disabled": t.disabled,
746
+ "ds-checkbox--error": !!t.error
747
+ }
748
+ ]);
749
+ function c() {
750
+ if (t.disabled) return;
751
+ const r = !i.value;
752
+ s("update:modelValue", r), s("change", r);
753
+ }
754
+ return (r, d) => (a(), n("div", {
755
+ class: I(o.value),
756
+ onClick: c
757
+ }, [
758
+ m("input", {
759
+ id: e.id,
760
+ type: "checkbox",
761
+ checked: i.value,
762
+ disabled: e.disabled,
763
+ class: "ds-checkbox__input",
764
+ onClick: d[0] || (d[0] = Y(() => {
765
+ }, ["stop"])),
766
+ onChange: c
767
+ }, null, 40, qa),
768
+ m("div", ja, [
769
+ i.value ? (a(), E(R, {
770
+ key: 0,
771
+ name: "check",
772
+ size: "xs",
773
+ variant: "default",
774
+ class: "ds-checkbox__check-icon"
775
+ })) : v("", !0)
776
+ ]),
777
+ e.label || r.$slots.default ? (a(), n("span", Ka, [
778
+ j(r.$slots, "default", {}, () => [
779
+ C(G, {
780
+ variant: "body-sm",
781
+ value: e.label
782
+ }, null, 8, ["value"])
783
+ ], !0)
784
+ ])) : v("", !0)
785
+ ], 2));
786
+ }
787
+ }), de = /* @__PURE__ */ L(Ha, [["__scopeId", "data-v-e748bf17"]]), Wa = ["id", "aria-checked", "checked", "disabled"], Ga = {
788
+ key: 0,
789
+ class: "ds-switch__label"
790
+ }, Ya = /* @__PURE__ */ A({
791
+ __name: "Switch",
792
+ props: {
793
+ modelValue: { type: Boolean, default: !1 },
794
+ label: {},
795
+ disabled: { type: Boolean, default: !1 },
796
+ id: {}
797
+ },
798
+ emits: ["update:modelValue", "change"],
799
+ setup(e, { emit: l }) {
800
+ const t = e, s = l, i = g(() => !!t.modelValue), o = g(() => [
801
+ "ds-switch",
802
+ {
803
+ "ds-switch--checked": i.value,
804
+ "ds-switch--disabled": t.disabled
805
+ }
806
+ ]);
807
+ function c() {
808
+ if (t.disabled) return;
809
+ const r = !i.value;
810
+ s("update:modelValue", r), s("change", r);
811
+ }
812
+ return (r, d) => (a(), n("div", {
813
+ class: I(o.value),
814
+ onClick: c
815
+ }, [
816
+ m("input", {
817
+ id: e.id,
818
+ type: "checkbox",
819
+ role: "switch",
820
+ "aria-checked": i.value,
821
+ checked: i.value,
822
+ disabled: e.disabled,
823
+ class: "ds-switch__input",
824
+ onClick: d[0] || (d[0] = Y(() => {
825
+ }, ["stop"])),
826
+ onChange: c
827
+ }, null, 40, Wa),
828
+ d[1] || (d[1] = m("div", { class: "ds-switch__track" }, [
829
+ m("div", { class: "ds-switch__thumb" })
830
+ ], -1)),
831
+ e.label || r.$slots.default ? (a(), n("span", Ga, [
832
+ j(r.$slots, "default", {}, () => [
833
+ C(G, {
834
+ variant: "body-sm",
835
+ value: e.label
836
+ }, null, 8, ["value"])
837
+ ], !0)
838
+ ])) : v("", !0)
839
+ ], 2));
840
+ }
841
+ }), Xa = /* @__PURE__ */ L(Ya, [["__scopeId", "data-v-9517e4a7"]]), Za = ["for"], Ja = {
842
+ key: 0,
843
+ class: "ds-form-field__required"
844
+ }, Qa = { class: "ds-form-field__control" }, es = {
845
+ key: 1,
846
+ class: "ds-form-field__hint"
847
+ }, ts = {
848
+ key: 2,
849
+ class: "ds-form-field__error"
850
+ }, as = /* @__PURE__ */ A({
851
+ __name: "FormField",
852
+ props: {
853
+ label: {},
854
+ hint: {},
855
+ error: { type: [String, Boolean] },
856
+ required: { type: Boolean, default: !1 },
857
+ disabled: { type: Boolean, default: !1 },
858
+ id: {}
859
+ },
860
+ setup(e) {
861
+ const l = e, t = g(() => (typeof l.error == "string", !!l.error));
862
+ return (s, i) => (a(), n("div", {
863
+ class: I(["ds-form-field", { "ds-form-field--error": t.value, "ds-form-field--disabled": e.disabled }])
864
+ }, [
865
+ e.label ? (a(), n("label", {
866
+ key: 0,
867
+ for: e.id,
868
+ class: "ds-form-field__label"
869
+ }, [
870
+ C(G, {
871
+ variant: "body-sm",
872
+ value: e.label
873
+ }, null, 8, ["value"]),
874
+ e.required ? (a(), n("span", Ja, "*")) : v("", !0)
875
+ ], 8, Za)) : v("", !0),
876
+ m("div", Qa, [
877
+ j(s.$slots, "default", {}, void 0, !0)
878
+ ]),
879
+ e.hint && !t.value ? (a(), n("span", es, [
880
+ C(G, {
881
+ variant: "caption",
882
+ value: e.hint
883
+ }, null, 8, ["value"])
884
+ ])) : v("", !0),
885
+ typeof e.error == "string" && e.error ? (a(), n("span", ts, [
886
+ C(G, {
887
+ variant: "caption",
888
+ value: e.error
889
+ }, null, 8, ["value"])
890
+ ])) : v("", !0)
891
+ ], 2));
892
+ }
893
+ }), ss = /* @__PURE__ */ L(as, [["__scopeId", "data-v-99227112"]]), ls = /* @__PURE__ */ A({
894
+ __name: "Spacer",
895
+ props: {
896
+ size: { default: "md" },
897
+ orientation: { default: "vertical" },
898
+ mobile: {},
899
+ desktop: {}
900
+ },
901
+ setup(e) {
902
+ const l = e, t = (o) => {
903
+ if (!o) return "var(--space-4)";
904
+ const r = {
905
+ xs: "1",
906
+ sm: "2",
907
+ md: "4",
908
+ lg: "6",
909
+ xl: "8"
910
+ }[o];
911
+ return r ? `var(--space-${r})` : /^\d+(-\d+)?$/.test(o) ? `var(--space-${o})` : o;
912
+ }, s = g(() => {
913
+ const o = {}, c = t(l.size), r = l.mobile ? t(l.mobile) : void 0, d = l.desktop ? t(l.desktop) : void 0;
914
+ return l.orientation === "vertical" ? (o["--spacer-height"] = c, r && (o["--spacer-mobile-height"] = r), d && (o["--spacer-desktop-height"] = d)) : (o["--spacer-width"] = c, r && (o["--spacer-mobile-width"] = r), d && (o["--spacer-desktop-width"] = d)), o;
915
+ }), i = g(() => [
916
+ "ds-spacer",
917
+ `ds-spacer--${l.orientation}`
918
+ ]);
919
+ return (o, c) => (a(), n("div", {
920
+ class: I(i.value),
921
+ style: Q(s.value),
922
+ role: "presentation"
923
+ }, null, 6));
924
+ }
925
+ }), ns = /* @__PURE__ */ L(ls, [["__scopeId", "data-v-6e8de98d"]]), os = ["id", "value", "placeholder", "disabled", "readonly", "rows", "maxlength", "minlength"], is = {
926
+ key: 0,
927
+ class: "ds-textarea__footer"
928
+ }, rs = {
929
+ key: 0,
930
+ class: "ds-textarea__counter"
931
+ }, cs = {
932
+ key: 1,
933
+ class: "ds-textarea__counter"
934
+ }, ds = /* @__PURE__ */ A({
935
+ __name: "Textarea",
936
+ props: {
937
+ modelValue: { default: "" },
938
+ placeholder: { default: "" },
939
+ disabled: { type: Boolean, default: !1 },
940
+ readonly: { type: Boolean, default: !1 },
941
+ rows: { default: 4 },
942
+ maxlength: {},
943
+ minlength: {},
944
+ resize: { default: "vertical" },
945
+ showCounter: { type: Boolean, default: !1 },
946
+ showWordCount: { type: Boolean, default: !1 },
947
+ maxWords: {},
948
+ error: { type: [Boolean, String], default: !1 },
949
+ id: {}
950
+ },
951
+ emits: ["update:modelValue", "focus", "blur", "input"],
952
+ setup(e, { emit: l }) {
953
+ const t = e, s = l, { t: i } = Re(), o = g(() => {
954
+ const d = (t.modelValue || "").trim();
955
+ return d ? d.split(/\s+/).filter(Boolean).length : 0;
956
+ }), c = g(() => [
957
+ "ds-textarea",
958
+ `ds-textarea--resize-${t.resize}`,
959
+ {
960
+ "ds-textarea--disabled": t.disabled,
961
+ "ds-textarea--readonly": t.readonly,
962
+ "ds-textarea--error": !!t.error
963
+ }
964
+ ]);
965
+ function r(d) {
966
+ const f = d.target;
967
+ s("update:modelValue", f.value), s("input", d);
968
+ }
969
+ return (d, f) => (a(), n("div", {
970
+ class: I(c.value)
971
+ }, [
972
+ m("textarea", {
973
+ id: e.id,
974
+ value: e.modelValue,
975
+ placeholder: e.placeholder,
976
+ disabled: e.disabled,
977
+ readonly: e.readonly,
978
+ rows: e.rows,
979
+ maxlength: e.maxlength,
980
+ minlength: e.minlength,
981
+ class: "ds-textarea__field",
982
+ onInput: r,
983
+ onFocus: f[0] || (f[0] = (u) => s("focus", u)),
984
+ onBlur: f[1] || (f[1] = (u) => s("blur", u))
985
+ }, null, 40, os),
986
+ e.showCounter && e.maxlength || e.showWordCount && e.maxWords ? (a(), n("div", is, [
987
+ e.showCounter && e.maxlength ? (a(), n("span", rs, x((e.modelValue || "").length) + " / " + x(e.maxlength), 1)) : v("", !0),
988
+ e.showWordCount && e.maxWords ? (a(), n("span", cs, x(o.value) + " / " + x(e.maxWords) + " " + x(K(i)("textarea.words")), 1)) : v("", !0)
989
+ ])) : v("", !0)
990
+ ], 2));
991
+ }
992
+ }), us = /* @__PURE__ */ L(ds, [["__scopeId", "data-v-f0c356a8"]]), ms = /* @__PURE__ */ A({
993
+ __name: "Stack",
994
+ props: {
995
+ direction: { default: "column" },
996
+ align: {},
997
+ justify: {},
998
+ gap: { default: "md" },
999
+ separator: { type: Boolean, default: !1 }
1000
+ },
1001
+ setup(e) {
1002
+ const l = e, t = g(() => [
1003
+ "ds-stack",
1004
+ `ds-stack--dir-${l.direction}`,
1005
+ `ds-stack--align-${l.align || "stretch"}`,
1006
+ `ds-stack--justify-${l.justify || "start"}`,
1007
+ `ds-stack--gap-${l.gap}`,
1008
+ {
1009
+ "ds-stack--separator": l.separator
1010
+ }
1011
+ ]);
1012
+ return (s, i) => (a(), n("div", {
1013
+ class: I(t.value)
1014
+ }, [
1015
+ j(s.$slots, "default", {}, void 0, !0)
1016
+ ], 2));
1017
+ }
1018
+ }), vs = /* @__PURE__ */ L(ms, [["__scopeId", "data-v-4137efcc"]]), fs = /* @__PURE__ */ A({
1019
+ __name: "Row",
1020
+ props: {
1021
+ align: { default: "center" },
1022
+ justify: { default: "start" },
1023
+ wrap: { type: Boolean, default: !0 },
1024
+ gap: { default: "md" }
1025
+ },
1026
+ setup(e) {
1027
+ const l = e, t = g(() => [
1028
+ "ds-row",
1029
+ `ds-row--align-${l.align}`,
1030
+ `ds-row--justify-${l.justify}`,
1031
+ `ds-row--gap-${l.gap}`,
1032
+ {
1033
+ "ds-row--wrap": l.wrap
1034
+ }
1035
+ ]);
1036
+ return (s, i) => (a(), n("div", {
1037
+ class: I(t.value)
1038
+ }, [
1039
+ j(s.$slots, "default", {}, void 0, !0)
1040
+ ], 2));
1041
+ }
1042
+ }), ps = /* @__PURE__ */ L(fs, [["__scopeId", "data-v-1f34e039"]]), bs = /* @__PURE__ */ A({
1043
+ __name: "Grid",
1044
+ props: {
1045
+ cols: { default: 12 },
1046
+ sm: {},
1047
+ md: {},
1048
+ lg: {},
1049
+ gap: { default: "md" }
1050
+ },
1051
+ setup(e) {
1052
+ const l = e, t = g(() => ({
1053
+ "--grid-cols": l.cols,
1054
+ "--grid-cols-sm": l.sm || l.cols,
1055
+ "--grid-cols-md": l.md || l.sm || l.cols,
1056
+ "--grid-cols-lg": l.lg || l.md || l.sm || l.cols
1057
+ })), s = g(() => [
1058
+ "ds-grid",
1059
+ `ds-grid--gap-${l.gap}`
1060
+ ]);
1061
+ return (i, o) => (a(), n("div", {
1062
+ class: I(s.value),
1063
+ style: Q(t.value)
1064
+ }, [
1065
+ j(i.$slots, "default", {}, void 0, !0)
1066
+ ], 6));
1067
+ }
1068
+ }), hs = /* @__PURE__ */ L(bs, [["__scopeId", "data-v-2763535f"]]), gs = {
1069
+ key: 0,
1070
+ class: "ds-section__header"
1071
+ }, _s = { class: "ds-section__title-group" }, ys = {
1072
+ key: 0,
1073
+ class: "ds-section__actions"
1074
+ }, ks = { class: "ds-section__content" }, ws = /* @__PURE__ */ A({
1075
+ __name: "Section",
1076
+ props: {
1077
+ title: {},
1078
+ subtitle: {},
1079
+ bordered: { type: Boolean, default: !0 }
1080
+ },
1081
+ setup(e) {
1082
+ const l = e, t = g(() => [
1083
+ "ds-section",
1084
+ {
1085
+ "ds-section--bordered": l.bordered
1086
+ }
1087
+ ]);
1088
+ return (s, i) => (a(), n("section", {
1089
+ class: I(t.value)
1090
+ }, [
1091
+ e.title || e.subtitle || s.$slots.actions ? (a(), n("div", gs, [
1092
+ m("div", _s, [
1093
+ e.title ? (a(), E(G, {
1094
+ key: 0,
1095
+ variant: "title",
1096
+ value: e.title,
1097
+ class: "ds-section__title"
1098
+ }, null, 8, ["value"])) : v("", !0),
1099
+ e.subtitle ? (a(), E(G, {
1100
+ key: 1,
1101
+ variant: "subtitle",
1102
+ value: e.subtitle,
1103
+ class: "ds-section__subtitle"
1104
+ }, null, 8, ["value"])) : v("", !0)
1105
+ ]),
1106
+ s.$slots.actions ? (a(), n("div", ys, [
1107
+ j(s.$slots, "actions", {}, void 0, !0)
1108
+ ])) : v("", !0)
1109
+ ])) : v("", !0),
1110
+ m("div", ks, [
1111
+ j(s.$slots, "default", {}, void 0, !0)
1112
+ ])
1113
+ ], 2));
1114
+ }
1115
+ }), $s = /* @__PURE__ */ L(ws, [["__scopeId", "data-v-fbb8d011"]]), Cs = { class: "ds-card" }, xs = {
1116
+ key: 0,
1117
+ class: "ds-card__header"
1118
+ }, Ss = {
1119
+ key: 0,
1120
+ class: "ds-card__title-group"
1121
+ }, Is = {
1122
+ key: 0,
1123
+ class: "ds-card__title"
1124
+ }, Vs = {
1125
+ key: 1,
1126
+ class: "ds-card__subtitle"
1127
+ }, Bs = {
1128
+ key: 1,
1129
+ class: "ds-card__header-actions"
1130
+ }, zs = {
1131
+ key: 1,
1132
+ class: "ds-card__footer"
1133
+ }, Ds = /* @__PURE__ */ A({
1134
+ __name: "Card",
1135
+ props: {
1136
+ title: {},
1137
+ subtitle: {},
1138
+ padding: { type: Boolean, default: !0 }
1139
+ },
1140
+ setup(e) {
1141
+ return (l, t) => (a(), n("div", Cs, [
1142
+ e.title || l.$slots.header ? (a(), n("div", xs, [
1143
+ e.title || e.subtitle ? (a(), n("div", Ss, [
1144
+ e.title ? (a(), n("h3", Is, x(e.title), 1)) : v("", !0),
1145
+ e.subtitle ? (a(), n("p", Vs, x(e.subtitle), 1)) : v("", !0)
1146
+ ])) : v("", !0),
1147
+ l.$slots.header ? (a(), n("div", Bs, [
1148
+ j(l.$slots, "header", {}, void 0, !0)
1149
+ ])) : v("", !0)
1150
+ ])) : v("", !0),
1151
+ m("div", {
1152
+ class: I(["ds-card__body", { "ds-card__body--no-padding": !e.padding }])
1153
+ }, [
1154
+ j(l.$slots, "default", {}, void 0, !0)
1155
+ ], 2),
1156
+ l.$slots.footer ? (a(), n("div", zs, [
1157
+ j(l.$slots, "footer", {}, void 0, !0)
1158
+ ])) : v("", !0)
1159
+ ]));
1160
+ }
1161
+ }), As = /* @__PURE__ */ L(Ds, [["__scopeId", "data-v-c684db6b"]]), Ls = { class: "sp-head" }, Ts = { class: "sp-title" }, Es = { key: 0 }, Ms = {
1162
+ key: 1,
1163
+ class: "sp-meta"
1164
+ }, Ps = { key: 0 }, Os = { key: 0 }, Rs = { class: "sp-actions" }, Ns = ["aria-label"], Fs = { class: "sp-content" }, Us = {
1165
+ key: 0,
1166
+ class: "sp-footer"
1167
+ }, qs = /* @__PURE__ */ A({
1168
+ __name: "SidePanel",
1169
+ props: {
1170
+ modelValue: { type: Boolean, default: !1 },
1171
+ title: {},
1172
+ subtitle: {},
1173
+ metaItems: {},
1174
+ cancelLabel: {},
1175
+ confirmLabel: {},
1176
+ confirmIcon: {},
1177
+ width: { default: "410px" },
1178
+ closeOnOverlayClick: { type: Boolean, default: !0 },
1179
+ maximizable: { type: Boolean, default: !1 },
1180
+ inline: { type: Boolean, default: !1 }
1181
+ },
1182
+ emits: ["update:modelValue", "close", "cancel", "confirm"],
1183
+ setup(e, { emit: l }) {
1184
+ const t = e, s = l, i = M(!1);
1185
+ function o() {
1186
+ i.value = !i.value;
1187
+ }
1188
+ function c() {
1189
+ s("update:modelValue", !1), s("close");
1190
+ }
1191
+ function r(u) {
1192
+ t.closeOnOverlayClick && u.target === u.currentTarget && c();
1193
+ }
1194
+ se(() => t.modelValue, (u) => {
1195
+ u ? document.body.style.overflow = "hidden" : document.body.style.overflow = "";
1196
+ });
1197
+ function d() {
1198
+ s("cancel"), c();
1199
+ }
1200
+ function f() {
1201
+ s("confirm");
1202
+ }
1203
+ return (u, h) => (a(), E(te, { name: "ds-slide" }, {
1204
+ default: F(() => {
1205
+ var y;
1206
+ return [
1207
+ e.modelValue ? (a(), n("div", {
1208
+ key: 0,
1209
+ class: I(["ds-panel-overlay", { "sp-overlay--inline": e.inline }]),
1210
+ onClick: r
1211
+ }, [
1212
+ m("div", {
1213
+ class: I(["sp", { "sp--maximized": i.value }]),
1214
+ style: Q({ width: i.value ? "100%" : e.width }),
1215
+ role: "dialog",
1216
+ "aria-modal": "true"
1217
+ }, [
1218
+ m("div", Ls, [
1219
+ m("div", Ts, [
1220
+ e.title ? (a(), n("h2", Es, x(e.title), 1)) : v("", !0),
1221
+ e.subtitle || u.$slots.subtitle || (y = e.metaItems) != null && y.length ? (a(), n("div", Ms, [
1222
+ j(u.$slots, "subtitle", {}, () => {
1223
+ var $;
1224
+ return [
1225
+ e.subtitle ? (a(), n("span", Ps, x(e.subtitle), 1)) : ($ = e.metaItems) != null && $.length ? (a(!0), n(U, { key: 1 }, H(e.metaItems, (P, D) => (a(), n(U, { key: D }, [
1226
+ m("span", null, x(P), 1),
1227
+ D < e.metaItems.length - 1 ? (a(), n("span", Os, "·")) : v("", !0)
1228
+ ], 64))), 128)) : v("", !0)
1229
+ ];
1230
+ }, !0)
1231
+ ])) : v("", !0)
1232
+ ]),
1233
+ m("div", Rs, [
1234
+ e.maximizable ? (a(), n("button", {
1235
+ key: 0,
1236
+ class: "sp-icon-btn",
1237
+ onClick: o,
1238
+ "aria-label": i.value ? "کوچک‌نمایی" : "بزرگ‌نمایی"
1239
+ }, [
1240
+ i.value ? (a(), E(K(Te), {
1241
+ key: 0,
1242
+ size: 18
1243
+ })) : (a(), E(K(Ee), {
1244
+ key: 1,
1245
+ size: 18
1246
+ }))
1247
+ ], 8, Ns)) : v("", !0),
1248
+ m("button", {
1249
+ class: "sp-icon-btn",
1250
+ onClick: c,
1251
+ "aria-label": "بستن"
1252
+ }, [
1253
+ C(K(Me), { size: 18 })
1254
+ ])
1255
+ ])
1256
+ ]),
1257
+ m("div", Fs, [
1258
+ j(u.$slots, "default", {}, void 0, !0)
1259
+ ]),
1260
+ u.$slots.footer || e.cancelLabel || e.confirmLabel ? (a(), n("div", Us, [
1261
+ j(u.$slots, "footer", {}, () => [
1262
+ C(J, {
1263
+ variant: "secondary",
1264
+ onClick: d
1265
+ }, {
1266
+ default: F(() => [
1267
+ X(x(e.cancelLabel ?? "انصراف"), 1)
1268
+ ]),
1269
+ _: 1
1270
+ }),
1271
+ C(J, {
1272
+ variant: "primary",
1273
+ onClick: f
1274
+ }, {
1275
+ default: F(() => [
1276
+ X(x(e.confirmLabel ?? "ذخیره") + " ", 1),
1277
+ e.confirmIcon ? (a(), E(me(e.confirmIcon), { key: 0 })) : v("", !0)
1278
+ ]),
1279
+ _: 1
1280
+ })
1281
+ ], !0)
1282
+ ])) : v("", !0)
1283
+ ], 6)
1284
+ ], 2)) : v("", !0)
1285
+ ];
1286
+ }),
1287
+ _: 3
1288
+ }));
1289
+ }
1290
+ }), js = /* @__PURE__ */ L(qs, [["__scopeId", "data-v-1a7ec7c9"]]), Ks = { class: "ds-search-box__wrapper" }, Hs = {
1291
+ key: 0,
1292
+ class: "ds-search-box__action-container"
1293
+ }, Ws = {
1294
+ key: 0,
1295
+ class: "ds-search-box__spinner"
1296
+ }, Gs = {
1297
+ key: 0,
1298
+ class: "ds-search-box__dropdown"
1299
+ }, Ys = ["onClick", "onMouseenter"], Xs = /* @__PURE__ */ A({
1300
+ __name: "SearchBox",
1301
+ props: {
1302
+ modelValue: { default: "" },
1303
+ placeholder: { default: "Search..." },
1304
+ loading: { type: Boolean, default: !1 },
1305
+ disabled: { type: Boolean, default: !1 },
1306
+ clearable: { type: Boolean, default: !1 },
1307
+ options: { default: () => [] }
1308
+ },
1309
+ emits: ["update:modelValue", "clear", "select"],
1310
+ setup(e, { emit: l }) {
1311
+ const t = e, s = l, i = g(() => t.modelValue), o = M(!1), c = M(null), r = M(-1), d = g(() => t.options.map((B) => typeof B == "object" && B !== null ? B : { label: String(B), value: String(B) })), f = g(() => {
1312
+ const B = i.value.toLowerCase().trim();
1313
+ return B ? d.value.filter(
1314
+ (q) => q.label.toLowerCase().includes(B)
1315
+ ) : [];
1316
+ }), u = g(() => o.value && f.value.length > 0 && !t.disabled);
1317
+ se(f, () => {
1318
+ r.value = -1;
1319
+ });
1320
+ function h(B) {
1321
+ s("update:modelValue", B);
1322
+ }
1323
+ function y() {
1324
+ t.disabled || (s("update:modelValue", ""), s("clear"));
1325
+ }
1326
+ function $(B) {
1327
+ s("update:modelValue", B.value), s("select", B.value), o.value = !1, r.value = -1;
1328
+ }
1329
+ function P(B) {
1330
+ if (!t.disabled) {
1331
+ if (!u.value) {
1332
+ B.key === "ArrowDown" && (o.value = !0);
1333
+ return;
1334
+ }
1335
+ switch (B.key) {
1336
+ case "Escape":
1337
+ B.preventDefault(), o.value = !1, r.value = -1;
1338
+ break;
1339
+ case "ArrowDown":
1340
+ B.preventDefault(), r.value = r.value < f.value.length - 1 ? r.value + 1 : 0;
1341
+ break;
1342
+ case "ArrowUp":
1343
+ B.preventDefault(), r.value = r.value > 0 ? r.value - 1 : f.value.length - 1;
1344
+ break;
1345
+ case "Enter":
1346
+ if (r.value >= 0 && r.value < f.value.length) {
1347
+ B.preventDefault();
1348
+ const q = f.value[r.value];
1349
+ q && $(q);
1350
+ }
1351
+ break;
1352
+ }
1353
+ }
1354
+ }
1355
+ function D(B) {
1356
+ const q = B.target;
1357
+ c.value && !c.value.contains(q) && (o.value = !1);
1358
+ }
1359
+ return ee(() => {
1360
+ document.addEventListener("click", D);
1361
+ }), ne(() => {
1362
+ document.removeEventListener("click", D);
1363
+ }), (B, q) => (a(), n("div", {
1364
+ ref_key: "containerRef",
1365
+ ref: c,
1366
+ class: "ds-search-box"
1367
+ }, [
1368
+ m("div", Ks, [
1369
+ C(ve, {
1370
+ "model-value": i.value,
1371
+ placeholder: e.placeholder,
1372
+ disabled: e.disabled,
1373
+ icon: "search",
1374
+ class: "ds-search-box__input",
1375
+ "onUpdate:modelValue": h,
1376
+ onFocus: q[0] || (q[0] = (k) => o.value = !0),
1377
+ onKeydown: P
1378
+ }, null, 8, ["model-value", "placeholder", "disabled"]),
1379
+ e.loading || e.clearable && i.value ? (a(), n("div", Hs, [
1380
+ e.loading ? (a(), n("span", Ws)) : e.clearable && i.value ? (a(), n("button", {
1381
+ key: 1,
1382
+ type: "button",
1383
+ class: "ds-search-box__clear",
1384
+ onClick: y
1385
+ }, [
1386
+ C(R, {
1387
+ name: "x",
1388
+ size: "xs"
1389
+ })
1390
+ ])) : v("", !0)
1391
+ ])) : v("", !0),
1392
+ C(te, { name: "ds-search-box-drop" }, {
1393
+ default: F(() => [
1394
+ u.value ? (a(), n("div", Gs, [
1395
+ (a(!0), n(U, null, H(f.value, (k, S) => (a(), n("div", {
1396
+ key: k.value,
1397
+ class: I(["ds-search-box__option", {
1398
+ "ds-search-box__option--focused": S === r.value
1399
+ }]),
1400
+ onClick: Y((O) => $(k), ["stop"]),
1401
+ onMouseenter: (O) => r.value = S
1402
+ }, x(k.label), 43, Ys))), 128))
1403
+ ])) : v("", !0)
1404
+ ]),
1405
+ _: 1
1406
+ })
1407
+ ])
1408
+ ], 512));
1409
+ }
1410
+ }), Zs = /* @__PURE__ */ L(Xs, [["__scopeId", "data-v-ea6771d0"]]), Js = {
1411
+ key: 0,
1412
+ class: "ds-dropdown__empty"
1413
+ }, Qs = ["onClick", "onMouseenter"], el = { class: "ds-dropdown__item-content" }, tl = { class: "ds-dropdown__item-label" }, al = /* @__PURE__ */ A({
1414
+ __name: "Dropdown",
1415
+ props: {
1416
+ modelValue: { default: "" },
1417
+ placeholder: { default: "Select..." },
1418
+ items: { default: () => [] },
1419
+ source: {},
1420
+ disabled: { type: Boolean, default: !1 },
1421
+ label: {},
1422
+ icon: {},
1423
+ loading: { type: Boolean, default: !1 },
1424
+ emptyState: { default: "" }
1425
+ },
1426
+ emits: ["update:modelValue", "change", "select"],
1427
+ setup(e, { expose: l, emit: t }) {
1428
+ const s = e, i = t, o = {
1429
+ users: [
1430
+ { id: "1", label: "کاربر ۱ (مدیر)", value: "user1", icon: "users" },
1431
+ { id: "2", label: "کاربر ۲ (نویسنده)", value: "user2", icon: "users" },
1432
+ { id: "3", label: "کاربر ۳ (پشتیبان)", value: "user3", icon: "users", disabled: !0 }
1433
+ ],
1434
+ actions: [
1435
+ { id: "edit", label: "ویرایش", value: "edit", icon: "edit" },
1436
+ { id: "delete", label: "حذف", value: "delete", icon: "trash" }
1437
+ ]
1438
+ }, c = g(() => s.source && o[s.source] ? o[s.source] : s.items), r = g(() => s.modelValue || ""), d = g(() => c.value.find((S) => S.value === r.value)), f = g(() => s.label ? s.label : d.value ? d.value.label : s.placeholder), u = M(!1), h = M(null), y = M(null), $ = M(-1);
1439
+ function P() {
1440
+ s.disabled || (u.value = !u.value);
1441
+ }
1442
+ function D() {
1443
+ u.value = !1, $.value = -1;
1444
+ }
1445
+ function B(S) {
1446
+ S.disabled || (i("update:modelValue", S.value), i("change", S.value), i("select", S), D());
1447
+ }
1448
+ function q(S) {
1449
+ if (!s.disabled) {
1450
+ if (!u.value) {
1451
+ (S.key === "Enter" || S.key === "ArrowDown" || S.key === " ") && (S.preventDefault(), u.value = !0);
1452
+ return;
1453
+ }
1454
+ switch (S.key) {
1455
+ case "Escape":
1456
+ S.preventDefault(), D();
1457
+ break;
1458
+ case "ArrowDown":
1459
+ S.preventDefault(), $.value = $.value < c.value.length - 1 ? $.value + 1 : 0;
1460
+ break;
1461
+ case "ArrowUp":
1462
+ S.preventDefault(), $.value = $.value > 0 ? $.value - 1 : c.value.length - 1;
1463
+ break;
1464
+ case "Enter":
1465
+ if (S.preventDefault(), $.value >= 0 && $.value < c.value.length) {
1466
+ const O = c.value[$.value];
1467
+ O && B(O);
1468
+ }
1469
+ break;
1470
+ }
1471
+ }
1472
+ }
1473
+ function k(S) {
1474
+ const O = S.target, p = h.value, V = y.value;
1475
+ !p && !V || p && p.contains(O) || V && V.contains(O) || u.value && D();
1476
+ }
1477
+ return ee(() => {
1478
+ document.addEventListener("click", k);
1479
+ }), ne(() => {
1480
+ document.removeEventListener("click", k);
1481
+ }), l({
1482
+ isOpen: u,
1483
+ open: () => u.value = !0,
1484
+ close: () => u.value = !1,
1485
+ toggle: () => u.value = !u.value
1486
+ }), (S, O) => (a(), n("div", {
1487
+ class: I(["ds-dropdown", { "ds-dropdown--open": u.value, "ds-dropdown--disabled": e.disabled }])
1488
+ }, [
1489
+ m("div", {
1490
+ ref_key: "triggerRef",
1491
+ ref: h,
1492
+ class: "ds-dropdown__trigger",
1493
+ onClick: Y(P, ["stop"]),
1494
+ onKeydown: q,
1495
+ tabindex: "0"
1496
+ }, [
1497
+ j(S.$slots, "trigger", {}, () => [
1498
+ C(J, {
1499
+ variant: "secondary",
1500
+ disabled: e.disabled,
1501
+ icon: e.icon || "chevron-down",
1502
+ "icon-position": "end",
1503
+ loading: e.loading,
1504
+ class: "ds-dropdown__btn"
1505
+ }, {
1506
+ default: F(() => [
1507
+ X(x(f.value), 1)
1508
+ ]),
1509
+ _: 1
1510
+ }, 8, ["disabled", "icon", "loading"])
1511
+ ], !0)
1512
+ ], 544),
1513
+ C(te, { name: "ds-dropdown-drop" }, {
1514
+ default: F(() => [
1515
+ u.value ? (a(), n("div", {
1516
+ key: 0,
1517
+ ref_key: "dropdownRef",
1518
+ ref: y,
1519
+ class: "ds-dropdown__menu"
1520
+ }, [
1521
+ j(S.$slots, "default", {}, () => [
1522
+ c.value.length === 0 ? (a(), n("div", Js, x(e.emptyState ? e.emptyState.includes(".") ? K(W)(e.emptyState) : e.emptyState : "گزینه‌ای وجود ندارد"), 1)) : v("", !0),
1523
+ (a(!0), n(U, null, H(c.value, (p, V) => (a(), n("div", {
1524
+ key: p.id,
1525
+ class: I(["ds-dropdown__item", {
1526
+ "ds-dropdown__item--selected": p.value === r.value,
1527
+ "ds-dropdown__item--disabled": p.disabled,
1528
+ "ds-dropdown__item--focused": V === $.value
1529
+ }]),
1530
+ onClick: Y((_) => B(p), ["stop"]),
1531
+ onMouseenter: (_) => $.value = V
1532
+ }, [
1533
+ m("div", el, [
1534
+ p.icon ? (a(), E(R, {
1535
+ key: 0,
1536
+ name: p.icon,
1537
+ size: "sm",
1538
+ class: "ds-dropdown__item-icon"
1539
+ }, null, 8, ["name"])) : v("", !0),
1540
+ m("span", tl, x(p.label), 1)
1541
+ ])
1542
+ ], 42, Qs))), 128))
1543
+ ], !0)
1544
+ ], 512)) : v("", !0)
1545
+ ]),
1546
+ _: 3
1547
+ })
1548
+ ], 2));
1549
+ }
1550
+ }), Ce = /* @__PURE__ */ L(al, [["__scopeId", "data-v-78d6d497"]]), sl = /* @__PURE__ */ A({
1551
+ __name: "Menu",
1552
+ props: {
1553
+ variant: { default: "vertical" }
1554
+ },
1555
+ setup(e) {
1556
+ return (l, t) => (a(), n("div", {
1557
+ class: I(["ds-menu", `ds-menu--${e.variant}`])
1558
+ }, [
1559
+ j(l.$slots, "default", {}, void 0, !0)
1560
+ ], 2));
1561
+ }
1562
+ }), Fe = /* @__PURE__ */ L(sl, [["__scopeId", "data-v-80d256c4"]]), ll = ["aria-disabled"], nl = { class: "ds-menu-item__content" }, ol = { class: "ds-menu-item__label" }, il = /* @__PURE__ */ A({
1563
+ __name: "MenuItem",
1564
+ props: {
1565
+ label: {},
1566
+ icon: {},
1567
+ disabled: { type: Boolean, default: !1 },
1568
+ active: { type: Boolean, default: !1 }
1569
+ },
1570
+ emits: ["click"],
1571
+ setup(e, { emit: l }) {
1572
+ const t = e, s = l;
1573
+ function i(o) {
1574
+ if (t.disabled) {
1575
+ o.preventDefault(), o.stopPropagation();
1576
+ return;
1577
+ }
1578
+ s("click", o);
1579
+ }
1580
+ return (o, c) => (a(), n("div", {
1581
+ class: I(["ds-menu-item", {
1582
+ "ds-menu-item--active": e.active,
1583
+ "ds-menu-item--disabled": e.disabled
1584
+ }]),
1585
+ role: "menuitem",
1586
+ "aria-disabled": e.disabled,
1587
+ onClick: i
1588
+ }, [
1589
+ m("div", nl, [
1590
+ e.icon ? (a(), E(R, {
1591
+ key: 0,
1592
+ name: e.icon,
1593
+ size: "sm",
1594
+ class: "ds-menu-item__icon"
1595
+ }, null, 8, ["name"])) : v("", !0),
1596
+ m("span", ol, [
1597
+ j(o.$slots, "default", {}, () => [
1598
+ C(G, {
1599
+ variant: "body-md",
1600
+ value: e.label
1601
+ }, null, 8, ["value"])
1602
+ ], !0)
1603
+ ])
1604
+ ])
1605
+ ], 10, ll));
1606
+ }
1607
+ }), ue = /* @__PURE__ */ L(il, [["__scopeId", "data-v-e6776c8a"]]), rl = /* @__PURE__ */ A({
1608
+ __name: "Tooltip",
1609
+ props: {
1610
+ text: {},
1611
+ position: { default: "top" },
1612
+ delay: { default: 200 },
1613
+ icon: { default: "attention" },
1614
+ disabled: { type: Boolean, default: !1 }
1615
+ },
1616
+ setup(e) {
1617
+ const l = e, t = M(!1);
1618
+ let s = null;
1619
+ function i() {
1620
+ l.disabled || (s && clearTimeout(s), s = window.setTimeout(() => {
1621
+ t.value = !0;
1622
+ }, l.delay));
1623
+ }
1624
+ function o() {
1625
+ s && clearTimeout(s), t.value = !1;
1626
+ }
1627
+ return (c, r) => (a(), n("div", {
1628
+ class: "ds-tooltip-container",
1629
+ onMouseenter: i,
1630
+ onMouseleave: o,
1631
+ onFocusin: i,
1632
+ onFocusout: o
1633
+ }, [
1634
+ j(c.$slots, "default", {}, () => [
1635
+ e.icon ? (a(), E(R, {
1636
+ key: 0,
1637
+ name: e.icon,
1638
+ class: "ds-tooltip__icon"
1639
+ }, null, 8, ["name"])) : v("", !0)
1640
+ ], !0),
1641
+ C(te, { name: "ds-tooltip-fade" }, {
1642
+ default: F(() => [
1643
+ t.value ? (a(), n("div", {
1644
+ key: 0,
1645
+ class: I(["ds-tooltip", `ds-tooltip--${e.position}`]),
1646
+ role: "tooltip"
1647
+ }, [
1648
+ C(G, {
1649
+ variant: "caption",
1650
+ value: e.text,
1651
+ class: "ds-tooltip__text"
1652
+ }, null, 8, ["value"])
1653
+ ], 2)) : v("", !0)
1654
+ ]),
1655
+ _: 1
1656
+ })
1657
+ ], 32));
1658
+ }
1659
+ }), ke = /* @__PURE__ */ L(rl, [["__scopeId", "data-v-f7e5aca3"]]), cl = /* @__PURE__ */ A({
1660
+ __name: "Popover",
1661
+ props: {
1662
+ disabled: { type: Boolean, default: !1 },
1663
+ position: { default: "bottom-start" }
1664
+ },
1665
+ setup(e) {
1666
+ const l = e, t = M(!1), s = M(null), i = M(null);
1667
+ function o() {
1668
+ l.disabled || (t.value = !t.value);
1669
+ }
1670
+ function c() {
1671
+ t.value = !1;
1672
+ }
1673
+ function r(d) {
1674
+ const f = d.target, u = s.value, h = i.value;
1675
+ !u && !h || u && u.contains(f) || h && h.contains(f) || t.value && c();
1676
+ }
1677
+ return ee(() => {
1678
+ document.addEventListener("click", r);
1679
+ }), ne(() => {
1680
+ document.removeEventListener("click", r);
1681
+ }), (d, f) => (a(), n("div", {
1682
+ class: I(["ds-popover-container", { "ds-popover-container--disabled": e.disabled }])
1683
+ }, [
1684
+ m("div", {
1685
+ ref_key: "triggerRef",
1686
+ ref: s,
1687
+ class: "ds-popover-trigger",
1688
+ onClick: Y(o, ["stop"])
1689
+ }, [
1690
+ j(d.$slots, "trigger", {}, void 0, !0)
1691
+ ], 512),
1692
+ C(te, { name: "ds-popover-fade" }, {
1693
+ default: F(() => [
1694
+ t.value ? (a(), n("div", {
1695
+ key: 0,
1696
+ ref_key: "popoverRef",
1697
+ ref: i,
1698
+ class: I(["ds-popover", `ds-popover--${e.position}`])
1699
+ }, [
1700
+ j(d.$slots, "default", {}, void 0, !0)
1701
+ ], 2)) : v("", !0)
1702
+ ]),
1703
+ _: 3
1704
+ })
1705
+ ], 2));
1706
+ }
1707
+ }), dl = /* @__PURE__ */ L(cl, [["__scopeId", "data-v-ad6010ef"]]), ul = {
1708
+ class: "ds-tabs__header",
1709
+ role: "tablist"
1710
+ }, ml = ["aria-selected", "disabled", "onClick"], vl = { class: "ds-tabs__content" }, fl = /* @__PURE__ */ A({
1711
+ __name: "Tabs",
1712
+ props: {
1713
+ modelValue: { default: "" },
1714
+ items: { default: () => [] },
1715
+ disabled: { type: Boolean, default: !1 }
1716
+ },
1717
+ emits: ["update:modelValue", "change"],
1718
+ setup(e, { emit: l }) {
1719
+ const t = e, s = l;
1720
+ function i(o, c) {
1721
+ t.disabled || c || (s("update:modelValue", o), s("change", o));
1722
+ }
1723
+ return (o, c) => (a(), n("div", {
1724
+ class: I(["ds-tabs", { "ds-tabs--disabled": e.disabled }])
1725
+ }, [
1726
+ m("div", ul, [
1727
+ (a(!0), n(U, null, H(e.items, (r) => (a(), n("button", {
1728
+ key: r.value,
1729
+ type: "button",
1730
+ role: "tab",
1731
+ "aria-selected": r.value === e.modelValue,
1732
+ disabled: r.disabled,
1733
+ class: I(["ds-tabs__tab-btn", {
1734
+ "ds-tabs__tab-btn--active": r.value === e.modelValue,
1735
+ "ds-tabs__tab-btn--disabled": r.disabled
1736
+ }]),
1737
+ onClick: (d) => i(r.value, r.disabled)
1738
+ }, [
1739
+ r.icon ? (a(), E(R, {
1740
+ key: 0,
1741
+ name: r.icon,
1742
+ size: "sm",
1743
+ class: "ds-tabs__tab-icon"
1744
+ }, null, 8, ["name"])) : v("", !0),
1745
+ C(G, {
1746
+ variant: "body-md",
1747
+ value: r.label,
1748
+ class: "ds-tabs__tab-label"
1749
+ }, null, 8, ["value"])
1750
+ ], 10, ml))), 128))
1751
+ ]),
1752
+ m("div", vl, [
1753
+ j(o.$slots, "default", {}, void 0, !0)
1754
+ ])
1755
+ ], 2));
1756
+ }
1757
+ }), pl = /* @__PURE__ */ L(fl, [["__scopeId", "data-v-1f6abab4"]]), bl = ["disabled", "aria-label"], hl = {
1758
+ key: 0,
1759
+ class: "ds-icon-button__spinner"
1760
+ }, gl = /* @__PURE__ */ A({
1761
+ __name: "IconButton",
1762
+ props: {
1763
+ icon: {},
1764
+ size: { default: "md" },
1765
+ variant: { default: "ghost" },
1766
+ disabled: { type: Boolean, default: !1 },
1767
+ loading: { type: Boolean, default: !1 },
1768
+ ariaLabel: {}
1769
+ },
1770
+ emits: ["click"],
1771
+ setup(e, { emit: l }) {
1772
+ const t = e, s = l, i = g(() => [
1773
+ "ds-icon-button",
1774
+ `ds-icon-button--${t.variant}`,
1775
+ `ds-icon-button--${t.size}`,
1776
+ {
1777
+ "ds-icon-button--disabled": t.disabled,
1778
+ "ds-icon-button--loading": t.loading
1779
+ }
1780
+ ]), o = g(() => {
1781
+ switch (t.size) {
1782
+ case "sm":
1783
+ return "sm";
1784
+ case "md":
1785
+ return "md";
1786
+ case "lg":
1787
+ return "button-lg";
1788
+ default:
1789
+ return "md";
1790
+ }
1791
+ });
1792
+ function c(r) {
1793
+ !t.disabled && !t.loading && s("click", r);
1794
+ }
1795
+ return (r, d) => (a(), n("button", {
1796
+ class: I(i.value),
1797
+ disabled: e.disabled || e.loading,
1798
+ "aria-label": e.ariaLabel,
1799
+ onClick: c
1800
+ }, [
1801
+ e.loading ? (a(), n("span", hl)) : (a(), E(R, {
1802
+ key: 1,
1803
+ name: e.icon,
1804
+ size: o.value
1805
+ }, null, 8, ["name", "size"]))
1806
+ ], 10, bl));
1807
+ }
1808
+ }), Ue = /* @__PURE__ */ L(gl, [["__scopeId", "data-v-c88fb09c"]]), _l = {
1809
+ key: 0,
1810
+ class: "ds-table-cell ds-table-cell--text"
1811
+ }, yl = {
1812
+ key: 1,
1813
+ class: "ds-table-cell ds-table-cell--date"
1814
+ }, kl = {
1815
+ key: 2,
1816
+ class: "ds-table-cell ds-table-cell--profile"
1817
+ }, wl = ["href"], $l = { class: "ds-table-cell__profile-text" }, Cl = { class: "ds-table-cell__profile-name" }, xl = {
1818
+ key: 0,
1819
+ class: "ds-table-cell__profile-email"
1820
+ }, Sl = {
1821
+ key: 3,
1822
+ class: "ds-table-cell ds-table-cell--tag"
1823
+ }, Il = {
1824
+ key: 4,
1825
+ class: "ds-table-cell ds-table-cell--checkbox"
1826
+ }, Vl = {
1827
+ key: 5,
1828
+ class: "ds-table-cell ds-table-cell--actions"
1829
+ }, Bl = /* @__PURE__ */ A({
1830
+ __name: "TableCell",
1831
+ props: {
1832
+ type: {},
1833
+ value: {},
1834
+ format: {},
1835
+ name: {},
1836
+ email: {},
1837
+ avatarUrl: {},
1838
+ profileLink: {},
1839
+ variant: {},
1840
+ modelValue: { type: Boolean, default: !1 },
1841
+ disabled: { type: Boolean, default: !1 },
1842
+ actions: {},
1843
+ tags: { default: () => [] }
1844
+ },
1845
+ emits: ["update:modelValue", "action-click"],
1846
+ setup(e, { emit: l }) {
1847
+ const t = e, s = l;
1848
+ function i(f, u) {
1849
+ if (f == null) return "";
1850
+ const h = typeof f == "string" || typeof f == "number" ? new Date(f) : f instanceof Date ? f : null;
1851
+ if (!h || isNaN(h.getTime())) return String(f ?? "");
1852
+ if (u) {
1853
+ const y = {
1854
+ YYYY: String(h.getFullYear()),
1855
+ MM: String(h.getMonth() + 1).padStart(2, "0"),
1856
+ DD: String(h.getDate()).padStart(2, "0"),
1857
+ HH: String(h.getHours()).padStart(2, "0"),
1858
+ mm: String(h.getMinutes()).padStart(2, "0"),
1859
+ ss: String(h.getSeconds()).padStart(2, "0")
1860
+ };
1861
+ return u.replace(/YYYY|MM|DD|HH|mm|ss/g, ($) => y[$] ?? $);
1862
+ }
1863
+ return new Intl.DateTimeFormat("fa-IR", {
1864
+ year: "numeric",
1865
+ month: "2-digit",
1866
+ day: "2-digit"
1867
+ }).format(h);
1868
+ }
1869
+ function o(f) {
1870
+ return f == null ? "" : String(f);
1871
+ }
1872
+ function c(f) {
1873
+ s("update:modelValue", f);
1874
+ }
1875
+ function r(f) {
1876
+ s("action-click", f), f.onClick();
1877
+ }
1878
+ const d = g(() => {
1879
+ if (t.tags && t.tags.length > 0) return t.tags;
1880
+ const f = t.value;
1881
+ return Array.isArray(f) ? f.map((u) => ({ value: o(u), variant: t.variant })) : f != null ? [{ value: o(f), variant: t.variant }] : [];
1882
+ });
1883
+ return (f, u) => e.type === "text" ? (a(), n("span", _l, x(o(e.value)), 1)) : e.type === "date" ? (a(), n("span", yl, x(i(e.value, e.format)), 1)) : e.type === "profile" ? (a(), n("span", kl, [
1884
+ e.profileLink ? (a(), n("a", {
1885
+ key: 0,
1886
+ href: e.profileLink,
1887
+ class: "ds-table-cell__profile-avatar-link"
1888
+ }, [
1889
+ C(re, {
1890
+ src: e.avatarUrl,
1891
+ name: e.name,
1892
+ size: "sm"
1893
+ }, null, 8, ["src", "name"])
1894
+ ], 8, wl)) : (a(), E(re, {
1895
+ key: 1,
1896
+ src: e.avatarUrl,
1897
+ name: e.name,
1898
+ size: "sm"
1899
+ }, null, 8, ["src", "name"])),
1900
+ m("span", $l, [
1901
+ m("span", Cl, x(e.name), 1),
1902
+ e.email ? (a(), n("span", xl, x(e.email), 1)) : v("", !0)
1903
+ ])
1904
+ ])) : e.type === "tag" ? (a(), n("span", Sl, [
1905
+ (a(!0), n(U, null, H(d.value, (h, y) => (a(), n("span", {
1906
+ key: y,
1907
+ class: I(["ds-table-cell__tag", h.variant ? `ds-table-cell__tag--${h.variant}` : ""])
1908
+ }, x(h.value), 3))), 128))
1909
+ ])) : e.type === "checkbox" ? (a(), n("span", Il, [
1910
+ C(de, {
1911
+ "model-value": e.modelValue,
1912
+ disabled: e.disabled,
1913
+ "onUpdate:modelValue": c
1914
+ }, null, 8, ["model-value", "disabled"])
1915
+ ])) : e.type === "actions" ? (a(), n("span", Vl, [
1916
+ (a(!0), n(U, null, H(e.actions, (h, y) => (a(), E(Ue, {
1917
+ key: y,
1918
+ icon: h.icon ?? "more",
1919
+ variant: h.variant ?? "ghost",
1920
+ size: "sm",
1921
+ "aria-label": h.label,
1922
+ onClick: ($) => r(h)
1923
+ }, null, 8, ["icon", "variant", "aria-label", "onClick"]))), 128))
1924
+ ])) : v("", !0);
1925
+ }
1926
+ }), qe = /* @__PURE__ */ L(Bl, [["__scopeId", "data-v-f1043cef"]]), zl = { class: "ds-bulk-edit-bar" }, Dl = { class: "ds-bulk-edit-bar__count" }, Al = { class: "ds-bulk-edit-bar__controls" }, Ll = { class: "ds-bulk-edit-bar__actions" }, Tl = /* @__PURE__ */ A({
1927
+ __name: "BulkEditBar",
1928
+ props: {
1929
+ columns: { default: () => [] },
1930
+ selectedCount: { default: 0 }
1931
+ },
1932
+ emits: ["apply", "cancel"],
1933
+ setup(e, { emit: l }) {
1934
+ const t = e, s = l, i = g(() => t.columns.filter((f) => f.editable)), o = M(""), c = M("");
1935
+ se(o, () => {
1936
+ c.value = "";
1937
+ });
1938
+ const r = g(() => i.value.find((f) => f.id === o.value));
1939
+ function d() {
1940
+ o.value && (s("apply", { field: o.value, value: c.value }), o.value = "", c.value = "");
1941
+ }
1942
+ return (f, u) => {
1943
+ var h, y;
1944
+ return a(), n("div", zl, [
1945
+ m("span", Dl, x(e.selectedCount) + " selected", 1),
1946
+ m("div", Al, [
1947
+ C(ye, {
1948
+ modelValue: o.value,
1949
+ "onUpdate:modelValue": u[0] || (u[0] = ($) => o.value = $),
1950
+ options: i.value.map(($) => ({ label: $.label, value: $.id })),
1951
+ placeholder: "Select field...",
1952
+ class: "ds-bulk-edit-bar__field-select"
1953
+ }, null, 8, ["modelValue", "options"]),
1954
+ r.value ? (a(), n(U, { key: 0 }, [
1955
+ ((h = r.value.editorOptions) == null ? void 0 : h.type) === "input" ? (a(), E(ve, {
1956
+ key: 0,
1957
+ modelValue: c.value,
1958
+ "onUpdate:modelValue": u[1] || (u[1] = ($) => c.value = $),
1959
+ type: r.value.editorOptions.inputType || "text",
1960
+ placeholder: "New value...",
1961
+ class: "ds-bulk-edit-bar__editor"
1962
+ }, null, 8, ["modelValue", "type"])) : v("", !0),
1963
+ ((y = r.value.editorOptions) == null ? void 0 : y.type) === "select" ? (a(), E(ye, {
1964
+ key: 1,
1965
+ modelValue: c.value,
1966
+ "onUpdate:modelValue": u[2] || (u[2] = ($) => c.value = $),
1967
+ options: r.value.editorOptions.options || [],
1968
+ placeholder: "Select value...",
1969
+ class: "ds-bulk-edit-bar__editor"
1970
+ }, null, 8, ["modelValue", "options"])) : v("", !0)
1971
+ ], 64)) : v("", !0)
1972
+ ]),
1973
+ m("div", Ll, [
1974
+ C(J, {
1975
+ variant: "ghost",
1976
+ size: "sm",
1977
+ onClick: u[3] || (u[3] = ($) => s("cancel"))
1978
+ }, {
1979
+ default: F(() => [...u[4] || (u[4] = [
1980
+ X("Cancel", -1)
1981
+ ])]),
1982
+ _: 1
1983
+ }),
1984
+ C(J, {
1985
+ variant: "primary",
1986
+ size: "sm",
1987
+ disabled: !o.value,
1988
+ onClick: d
1989
+ }, {
1990
+ default: F(() => [...u[5] || (u[5] = [
1991
+ X("Apply", -1)
1992
+ ])]),
1993
+ _: 1
1994
+ }, 8, ["disabled"])
1995
+ ])
1996
+ ]);
1997
+ };
1998
+ }
1999
+ }), El = /* @__PURE__ */ L(Tl, [["__scopeId", "data-v-e0d8ac5a"]]), Ml = { class: "ds-table-container" }, Pl = { class: "ds-table" }, Ol = { class: "ds-table__thead" }, Rl = { class: "ds-table__row" }, Nl = ["onClick"], Fl = {
2000
+ key: 1,
2001
+ class: "ds-table__header-content"
2002
+ }, Ul = { class: "ds-table__header-label" }, ql = { class: "ds-table__tbody" }, jl = ["onClick"], Kl = {
2003
+ key: 0,
2004
+ class: "ds-table__row ds-table__row--empty"
2005
+ }, Hl = ["colspan"], Wl = /* @__PURE__ */ A({
2006
+ __name: "SchemaTable",
2007
+ props: {
2008
+ columns: { default: () => [] },
2009
+ items: { default: () => [] },
2010
+ selectable: { type: Boolean, default: !1 },
2011
+ sortable: { type: Boolean, default: !1 },
2012
+ bulkEdit: { type: Boolean, default: !1 },
2013
+ modelValue: { default: () => [] }
2014
+ },
2015
+ emits: ["row-click", "update:modelValue", "update:modelValue-cell", "action-click", "update:sort", "bulk-update"],
2016
+ setup(e, { emit: l }) {
2017
+ const t = e, s = l, i = M({}), o = g(() => t.items.length > 0), c = g(() => t.selectable ? [{ id: "__selection", label: "", cell: "checkbox", align: "center" }, ...t.columns] : t.columns), r = g(() => {
2018
+ var b;
2019
+ let _ = [...t.items];
2020
+ const w = Object.entries(i.value).filter(([, z]) => z !== null);
2021
+ if (w.length === 0) return _;
2022
+ for (const [z, N] of w) {
2023
+ if (!N) continue;
2024
+ const Z = t.columns.find((le) => le.id === z);
2025
+ if (!Z) continue;
2026
+ const ae = ((b = Z.fields) == null ? void 0 : b.value) || z;
2027
+ _.sort((le, We) => {
2028
+ const oe = le[ae], ie = We[ae];
2029
+ if (oe == null) return 1;
2030
+ if (ie == null) return -1;
2031
+ if (typeof oe == "number" && typeof ie == "number")
2032
+ return N === "asc" ? oe - ie : ie - oe;
2033
+ const pe = String(oe), be = String(ie), he = Number(pe), ge = Number(be);
2034
+ return !isNaN(he) && !isNaN(ge) ? N === "asc" ? he - ge : ge - he : N === "asc" ? pe.localeCompare(be) : be.localeCompare(pe);
2035
+ });
2036
+ }
2037
+ return _;
2038
+ });
2039
+ function d(_, w) {
2040
+ const b = {};
2041
+ if (_.fields)
2042
+ for (const [z, N] of Object.entries(_.fields))
2043
+ b[z] = w[N];
2044
+ if (_.staticProps)
2045
+ for (const [z, N] of Object.entries(_.staticProps))
2046
+ b[z] = N;
2047
+ return b;
2048
+ }
2049
+ function f(_, w) {
2050
+ s("row-click", _, w);
2051
+ }
2052
+ function u(_, w, b) {
2053
+ s("action-click", { action: _, item: w, index: b });
2054
+ }
2055
+ function h(_) {
2056
+ const w = [...t.modelValue], b = w.indexOf(_);
2057
+ b > -1 ? w.splice(b, 1) : w.push(_), s("update:modelValue", w);
2058
+ }
2059
+ function y() {
2060
+ $.value ? s("update:modelValue", []) : s("update:modelValue", r.value.map((_, w) => String(w)));
2061
+ }
2062
+ const $ = g(() => o.value && t.modelValue.length === r.value.length), P = g(() => t.modelValue.length > 0 && !$.value);
2063
+ function D(_, w) {
2064
+ return String(w);
2065
+ }
2066
+ function B(_) {
2067
+ if (!t.sortable) return;
2068
+ const w = i.value[_];
2069
+ let b;
2070
+ w == null ? b = "asc" : w === "asc" ? b = "desc" : b = null, i.value = { ...i.value, [_]: b }, s("update:sort", _, b);
2071
+ }
2072
+ function q(_) {
2073
+ const w = i.value[_];
2074
+ return w === "asc" ? Dt : w === "desc" ? Pe : At;
2075
+ }
2076
+ function k(_) {
2077
+ return i.value[_] != null;
2078
+ }
2079
+ function S() {
2080
+ const _ = t.columns.length;
2081
+ return t.selectable ? _ + 1 : _;
2082
+ }
2083
+ const O = g(() => t.modelValue.length > 0), p = g(() => t.bulkEdit && O.value);
2084
+ function V(_) {
2085
+ s("bulk-update", { ..._, rows: [...t.modelValue] }), s("update:modelValue", []);
2086
+ }
2087
+ return (_, w) => (a(), n("div", Ml, [
2088
+ e.bulkEdit ? (a(), n("div", {
2089
+ key: 0,
2090
+ class: I([{ "ds-table__bulk-edit-wrapper--hidden": !p.value }, "ds-table__bulk-edit-wrapper"])
2091
+ }, [
2092
+ C(El, {
2093
+ columns: e.columns,
2094
+ "selected-count": e.modelValue.length,
2095
+ onApply: V,
2096
+ onCancel: w[0] || (w[0] = (b) => s("update:modelValue", []))
2097
+ }, null, 8, ["columns", "selected-count"])
2098
+ ], 2)) : v("", !0),
2099
+ m("table", Pl, [
2100
+ m("thead", Ol, [
2101
+ m("tr", Rl, [
2102
+ (a(!0), n(U, null, H(c.value, (b) => (a(), n("th", {
2103
+ key: b.id,
2104
+ class: I([
2105
+ "ds-table__header-cell",
2106
+ b.align ? `ds-table__header-cell--align-${b.align}` : "",
2107
+ { "ds-table__header-cell--sortable": e.sortable && b.id !== "__selection" },
2108
+ { "ds-table__header-cell--selection": b.id === "__selection" }
2109
+ ]),
2110
+ onClick: (z) => b.id !== "__selection" ? B(b.id) : void 0
2111
+ }, [
2112
+ b.id === "__selection" ? (a(), E(de, {
2113
+ key: 0,
2114
+ "model-value": $.value,
2115
+ indeterminate: P.value,
2116
+ "onUpdate:modelValue": y
2117
+ }, null, 8, ["model-value", "indeterminate"])) : (a(), n("span", Fl, [
2118
+ m("span", Ul, x(b.label), 1),
2119
+ e.sortable ? (a(), n("span", {
2120
+ key: 0,
2121
+ class: I(["ds-table__sort-icon", { "ds-table__sort-icon--active": k(b.id) }])
2122
+ }, [
2123
+ (a(), E(me(q(b.id)), { class: "ds-table__sort-icon-svg" }))
2124
+ ], 2)) : v("", !0)
2125
+ ]))
2126
+ ], 10, Nl))), 128))
2127
+ ])
2128
+ ]),
2129
+ m("tbody", ql, [
2130
+ (a(!0), n(U, null, H(r.value, (b, z) => (a(), n("tr", {
2131
+ key: z,
2132
+ class: I(["ds-table__row ds-table__row--body", { "ds-table__row--selected": t.selectable && t.modelValue.includes(D(b, z)) }]),
2133
+ onClick: (N) => f(b, z)
2134
+ }, [
2135
+ (a(!0), n(U, null, H(c.value, (N) => (a(), n("td", {
2136
+ key: N.id,
2137
+ class: I(["ds-table__data-cell", N.align ? `ds-table__data-cell--align-${N.align}` : "", { "ds-table__data-cell--selection": N.id === "__selection" }]),
2138
+ onClick: w[1] || (w[1] = Y(() => {
2139
+ }, ["stop"]))
2140
+ }, [
2141
+ N.id === "__selection" ? (a(), E(de, {
2142
+ key: 0,
2143
+ "model-value": t.selectable ? t.modelValue.includes(D(b, z)) : !1,
2144
+ "onUpdate:modelValue": (Z) => h(D(b, z))
2145
+ }, null, 8, ["model-value", "onUpdate:modelValue"])) : (a(), E(qe, Le({
2146
+ key: 1,
2147
+ type: N.cell
2148
+ }, { ref_for: !0 }, d(N, b), {
2149
+ onActionClick: (Z) => u(Z, b, z)
2150
+ }), null, 16, ["type", "onActionClick"]))
2151
+ ], 2))), 128))
2152
+ ], 10, jl))), 128)),
2153
+ o.value ? v("", !0) : (a(), n("tr", Kl, [
2154
+ m("td", {
2155
+ colspan: S(),
2156
+ class: "ds-table__empty-cell"
2157
+ }, " هیچ داده‌ای یافت نشد. ", 8, Hl)
2158
+ ]))
2159
+ ])
2160
+ ])
2161
+ ]));
2162
+ }
2163
+ }), Gl = /* @__PURE__ */ L(Wl, [["__scopeId", "data-v-9121ca66"]]), Yl = { class: "ds-filter-bar" }, Xl = { class: "ds-filter-bar__filters" }, Zl = {
2164
+ key: 0,
2165
+ class: "ds-filter-bar__actions"
2166
+ }, Jl = /* @__PURE__ */ A({
2167
+ __name: "FilterBar",
2168
+ props: {
2169
+ showClear: { type: Boolean, default: !1 }
2170
+ },
2171
+ emits: ["clear"],
2172
+ setup(e, { emit: l }) {
2173
+ const t = l;
2174
+ return (s, i) => (a(), n("div", Yl, [
2175
+ m("div", Xl, [
2176
+ j(s.$slots, "default", {}, void 0, !0)
2177
+ ]),
2178
+ e.showClear ? (a(), n("div", Zl, [
2179
+ C(J, {
2180
+ variant: "ghost",
2181
+ size: "sm",
2182
+ onClick: i[0] || (i[0] = (o) => t("clear"))
2183
+ }, {
2184
+ default: F(() => [...i[1] || (i[1] = [
2185
+ X(" پاک کردن فیلترها ", -1)
2186
+ ])]),
2187
+ _: 1
2188
+ })
2189
+ ])) : v("", !0)
2190
+ ]));
2191
+ }
2192
+ }), Ql = /* @__PURE__ */ L(Jl, [["__scopeId", "data-v-c9fe14a3"]]), en = {
2193
+ class: "ds-pagination",
2194
+ role: "navigation",
2195
+ "aria-label": "Pagination"
2196
+ }, tn = { class: "ds-pagination__info" }, an = /* @__PURE__ */ A({
2197
+ __name: "Pagination",
2198
+ props: {
2199
+ page: { default: 1 },
2200
+ total: { default: 0 },
2201
+ pageSize: { default: 10 }
2202
+ },
2203
+ emits: ["update:page", "update:value", "change"],
2204
+ setup(e, { emit: l }) {
2205
+ const t = e, s = l, i = g(() => Math.max(1, Math.ceil(t.total / t.pageSize))), o = g(() => t.page <= 1), c = g(() => t.page >= i.value), r = g(() => "arrow-right"), d = g(() => "arrow-left");
2206
+ function f(u) {
2207
+ u < 1 || u > i.value || (s("update:page", u), s("update:value", u), s("change", u));
2208
+ }
2209
+ return (u, h) => (a(), n("div", en, [
2210
+ C(J, {
2211
+ variant: "secondary",
2212
+ size: "sm",
2213
+ icon: r.value,
2214
+ disabled: o.value,
2215
+ onClick: h[0] || (h[0] = (y) => f(e.page - 1))
2216
+ }, {
2217
+ default: F(() => [
2218
+ X(x(K(W)("pagination.previous")), 1)
2219
+ ]),
2220
+ _: 1
2221
+ }, 8, ["icon", "disabled"]),
2222
+ m("div", tn, [
2223
+ C(G, { variant: "body-sm" }, {
2224
+ default: F(() => [
2225
+ X(x(K(W)("pagination.page_of", { page: String(e.page), total: String(i.value) })), 1)
2226
+ ]),
2227
+ _: 1
2228
+ })
2229
+ ]),
2230
+ C(J, {
2231
+ variant: "secondary",
2232
+ size: "sm",
2233
+ icon: d.value,
2234
+ "icon-position": "end",
2235
+ disabled: c.value,
2236
+ onClick: h[1] || (h[1] = (y) => f(e.page + 1))
2237
+ }, {
2238
+ default: F(() => [
2239
+ X(x(K(W)("pagination.next")), 1)
2240
+ ]),
2241
+ _: 1
2242
+ }, 8, ["icon", "disabled"])
2243
+ ]));
2244
+ }
2245
+ }), sn = /* @__PURE__ */ L(an, [["__scopeId", "data-v-051c701a"]]), ln = { class: "ds-empty-state" }, nn = { class: "ds-empty-state__icon-wrapper" }, on = {
2246
+ key: 1,
2247
+ class: "ds-empty-state__action"
2248
+ }, rn = /* @__PURE__ */ A({
2249
+ __name: "EmptyState",
2250
+ props: {
2251
+ title: { default: W("table.empty") },
2252
+ description: {},
2253
+ icon: { default: "archive" },
2254
+ actionLabel: {}
2255
+ },
2256
+ emits: ["action"],
2257
+ setup(e, { emit: l }) {
2258
+ const t = l;
2259
+ return (s, i) => (a(), n("div", ln, [
2260
+ m("div", nn, [
2261
+ C(R, {
2262
+ name: e.icon,
2263
+ size: "lg",
2264
+ class: "ds-empty-state__icon"
2265
+ }, null, 8, ["name"])
2266
+ ]),
2267
+ C(G, {
2268
+ variant: "heading-lg",
2269
+ value: e.title,
2270
+ class: "ds-empty-state__title"
2271
+ }, null, 8, ["value"]),
2272
+ e.description ? (a(), E(G, {
2273
+ key: 0,
2274
+ variant: "body-md",
2275
+ value: e.description,
2276
+ class: "ds-empty-state__desc"
2277
+ }, null, 8, ["value"])) : v("", !0),
2278
+ e.actionLabel ? (a(), n("div", on, [
2279
+ C(J, {
2280
+ variant: "primary",
2281
+ size: "md",
2282
+ onClick: i[0] || (i[0] = (o) => t("action"))
2283
+ }, {
2284
+ default: F(() => [
2285
+ X(x(e.actionLabel), 1)
2286
+ ]),
2287
+ _: 1
2288
+ })
2289
+ ])) : v("", !0)
2290
+ ]));
2291
+ }
2292
+ }), cn = /* @__PURE__ */ L(rn, [["__scopeId", "data-v-02a8578f"]]), dn = {
2293
+ key: 1,
2294
+ class: "ds-loading-state__skeleton-wrapper"
2295
+ }, un = {
2296
+ key: 2,
2297
+ class: "ds-loading-state__placeholder-wrapper"
2298
+ }, mn = /* @__PURE__ */ A({
2299
+ __name: "LoadingState",
2300
+ props: {
2301
+ variant: { default: "spinner" },
2302
+ text: { default: W("loading.text") }
2303
+ },
2304
+ setup(e) {
2305
+ return (l, t) => (a(), n("div", {
2306
+ class: I(["ds-loading-state", [`ds-loading-state--${e.variant}`]])
2307
+ }, [
2308
+ e.variant === "spinner" ? (a(), n(U, { key: 0 }, [
2309
+ t[0] || (t[0] = m("div", { class: "ds-loading-state__spinner" }, null, -1)),
2310
+ e.text ? (a(), E(G, {
2311
+ key: 0,
2312
+ variant: "body-sm",
2313
+ value: e.text,
2314
+ class: "ds-loading-state__text"
2315
+ }, null, 8, ["value"])) : v("", !0)
2316
+ ], 64)) : e.variant === "skeleton" ? (a(), n("div", dn, [...t[1] || (t[1] = [
2317
+ m("div", { class: "ds-loading-state__skeleton-line ds-loading-state__skeleton-line--title" }, null, -1),
2318
+ m("div", { class: "ds-loading-state__skeleton-line" }, null, -1),
2319
+ m("div", { class: "ds-loading-state__skeleton-line ds-loading-state__skeleton-line--short" }, null, -1)
2320
+ ])])) : e.variant === "placeholder" ? (a(), n("div", un, [...t[2] || (t[2] = [
2321
+ m("div", { class: "ds-loading-state__placeholder-circle" }, null, -1),
2322
+ m("div", { class: "ds-loading-state__skeleton-line ds-loading-state__skeleton-line--title" }, null, -1)
2323
+ ])])) : v("", !0)
2324
+ ], 2));
2325
+ }
2326
+ }), je = /* @__PURE__ */ L(mn, [["__scopeId", "data-v-872ace3e"]]), vn = {
2327
+ users: [
2328
+ { id: "1", name: "علیرضا علوی", email: "alireza@example.com", role: "مدیر کل" },
2329
+ { id: "2", name: "سارا رضایی", email: "sara@example.com", role: "نویسنده" },
2330
+ { id: "3", name: "محمد محمدی", email: "mohammad@example.com", role: "پشتیبان" },
2331
+ { id: "4", name: "علی حسینی", email: "ali@example.com", role: "مدیر مالی" },
2332
+ { id: "5", name: "رضا احمدی", email: "reza@example.com", role: "کارشناس فنی" }
2333
+ ],
2334
+ products: [
2335
+ { id: "p1", name: "لپ‌تاپ ایسوس", price: "45,000,000" },
2336
+ { id: "p2", name: "موبایل سامسونگ", price: "25,000,000" },
2337
+ { id: "p3", name: "تبلت لنوو", price: "12,000,000" }
2338
+ ]
2339
+ };
2340
+ function fn(e, l = "") {
2341
+ return new Promise((t) => {
2342
+ setTimeout(() => {
2343
+ const s = vn[e] || [];
2344
+ if (!l.trim()) {
2345
+ t(s);
2346
+ return;
2347
+ }
2348
+ const i = l.toLowerCase().trim(), o = s.filter((c) => Object.values(c).some(
2349
+ (r) => String(r).toLowerCase().includes(i)
2350
+ ));
2351
+ t(o);
2352
+ }, 200);
2353
+ });
2354
+ }
2355
+ const pn = { class: "ds-autocomplete" }, bn = { class: "ds-autocomplete__trigger-wrapper" }, hn = {
2356
+ key: 0,
2357
+ class: "ds-autocomplete__loading"
2358
+ }, gn = {
2359
+ key: 1,
2360
+ class: "ds-autocomplete__empty"
2361
+ }, _n = /* @__PURE__ */ A({
2362
+ __name: "AsyncAutocomplete",
2363
+ props: {
2364
+ modelValue: { default: void 0 },
2365
+ placeholder: { default: "Search..." },
2366
+ loading: { type: Boolean, default: !1 },
2367
+ disabled: { type: Boolean, default: !1 },
2368
+ clearable: { type: Boolean, default: !1 },
2369
+ searchable: { type: Boolean, default: !0 },
2370
+ source: {},
2371
+ items: { default: () => [] },
2372
+ labelKey: { default: "label" },
2373
+ valueKey: { default: "value" },
2374
+ error: { type: [Boolean, String], default: !1 }
2375
+ },
2376
+ emits: ["update:modelValue", "change", "clear"],
2377
+ setup(e, { emit: l }) {
2378
+ const t = e, s = l, i = g(() => t.modelValue), o = M(null), c = M(""), r = M(!1), d = M(!1), f = M([]), u = M(-1), h = g(() => t.loading || d.value);
2379
+ function y(b) {
2380
+ if (typeof b == "string" || typeof b == "number") return String(b);
2381
+ if (!b || typeof b != "object") return "";
2382
+ const z = b;
2383
+ return String(z[t.labelKey] ?? z.label ?? "");
2384
+ }
2385
+ function $(b) {
2386
+ if (typeof b == "string" || typeof b == "number") return b;
2387
+ if (!b || typeof b != "object") return null;
2388
+ const z = b;
2389
+ return z[t.valueKey] ?? z.value ?? null;
2390
+ }
2391
+ const P = g(() => {
2392
+ if (!c.value.trim()) return f.value;
2393
+ const b = c.value.toLowerCase().trim();
2394
+ return f.value.filter(
2395
+ (z) => y(z).toLowerCase().includes(b)
2396
+ );
2397
+ }), D = g(() => {
2398
+ if (t.source)
2399
+ return P.value;
2400
+ if (!c.value.trim()) return t.items;
2401
+ const b = c.value.toLowerCase().trim();
2402
+ return t.items.filter(
2403
+ (z) => y(z).toLowerCase().includes(b)
2404
+ );
2405
+ }), B = g(() => {
2406
+ const b = /* @__PURE__ */ new Map();
2407
+ return t.items.forEach((z) => b.set($(z), z)), f.value.forEach((z) => b.set($(z), z)), Array.from(b.values());
2408
+ }), q = g(() => {
2409
+ if (r.value)
2410
+ return c.value;
2411
+ const b = B.value.find((z) => $(z) === i.value);
2412
+ return b ? y(b) : "";
2413
+ });
2414
+ async function k(b) {
2415
+ if (t.source) {
2416
+ d.value = !0;
2417
+ try {
2418
+ const z = await fn(t.source, b);
2419
+ f.value = z;
2420
+ } catch (z) {
2421
+ console.error(z), f.value = [];
2422
+ } finally {
2423
+ d.value = !1;
2424
+ }
2425
+ }
2426
+ }
2427
+ let S = null;
2428
+ function O(b) {
2429
+ t.searchable && (c.value = b, r.value = !0, o.value && !o.value.isOpen && o.value.open(), S && clearTimeout(S), S = window.setTimeout(() => {
2430
+ t.source && k(b);
2431
+ }, 200));
2432
+ }
2433
+ function p() {
2434
+ t.disabled || (r.value = !0, c.value = "", u.value = -1, o.value && !o.value.isOpen && o.value.open(), t.source && f.value.length === 0 && k(""));
2435
+ }
2436
+ function V(b) {
2437
+ const z = $(b);
2438
+ s("update:modelValue", z), s("change", z), r.value = !1, c.value = y(b), u.value = -1, o.value && o.value.close();
2439
+ }
2440
+ function _() {
2441
+ t.disabled || (s("update:modelValue", null), s("change", null), s("clear"), c.value = "", r.value = !1, u.value = -1);
2442
+ }
2443
+ function w(b) {
2444
+ var N, Z, ae;
2445
+ if (t.disabled) return;
2446
+ if (!((N = o.value) == null ? void 0 : N.isOpen)) {
2447
+ b.key === "ArrowDown" && (b.preventDefault(), (Z = o.value) == null || Z.open());
2448
+ return;
2449
+ }
2450
+ switch (b.key) {
2451
+ case "Escape":
2452
+ b.preventDefault(), (ae = o.value) == null || ae.close(), r.value = !1;
2453
+ break;
2454
+ case "ArrowDown":
2455
+ b.preventDefault(), u.value = u.value < D.value.length - 1 ? u.value + 1 : 0;
2456
+ break;
2457
+ case "ArrowUp":
2458
+ b.preventDefault(), u.value = u.value > 0 ? u.value - 1 : D.value.length - 1;
2459
+ break;
2460
+ case "Enter":
2461
+ if (u.value >= 0 && u.value < D.value.length) {
2462
+ b.preventDefault();
2463
+ const le = D.value[u.value];
2464
+ le && V(le);
2465
+ }
2466
+ break;
2467
+ }
2468
+ }
2469
+ return se(() => {
2470
+ var b;
2471
+ return (b = o.value) == null ? void 0 : b.isOpen;
2472
+ }, (b) => {
2473
+ b || setTimeout(() => {
2474
+ r.value = !1;
2475
+ }, 100);
2476
+ }), (b, z) => (a(), n("div", pn, [
2477
+ C(Ce, {
2478
+ ref_key: "dropdownRef",
2479
+ ref: o,
2480
+ class: "ds-autocomplete__dropdown"
2481
+ }, {
2482
+ trigger: F(() => [
2483
+ m("div", bn, [
2484
+ C(ve, {
2485
+ "model-value": q.value,
2486
+ placeholder: e.placeholder,
2487
+ disabled: e.disabled,
2488
+ icon: "search",
2489
+ error: e.error,
2490
+ class: "ds-autocomplete__input",
2491
+ "onUpdate:modelValue": O,
2492
+ onFocus: p,
2493
+ onKeydown: w
2494
+ }, null, 8, ["model-value", "placeholder", "disabled", "error"]),
2495
+ e.clearable && i.value ? (a(), n("button", {
2496
+ key: 0,
2497
+ type: "button",
2498
+ class: "ds-autocomplete__clear",
2499
+ onClick: Y(_, ["stop"])
2500
+ }, [
2501
+ C(R, {
2502
+ name: "x",
2503
+ size: "xs"
2504
+ })
2505
+ ])) : v("", !0)
2506
+ ])
2507
+ ]),
2508
+ default: F(() => [
2509
+ C(Fe, {
2510
+ variant: "vertical",
2511
+ class: "ds-autocomplete__menu-container"
2512
+ }, {
2513
+ default: F(() => [
2514
+ h.value ? (a(), n("div", hn, [
2515
+ C(je, {
2516
+ variant: "spinner",
2517
+ text: "در حال بارگذاری..."
2518
+ })
2519
+ ])) : D.value.length === 0 ? (a(), n("div", gn, " نتیجه‌ای یافت نشد ")) : (a(!0), n(U, { key: 2 }, H(D.value, (N, Z) => (a(), E(ue, {
2520
+ key: String($(N)),
2521
+ label: y(N),
2522
+ active: $(N) === i.value || Z === u.value,
2523
+ onClick: (ae) => V(N),
2524
+ onMouseenter: (ae) => u.value = Z
2525
+ }, null, 8, ["label", "active", "onClick", "onMouseenter"]))), 128))
2526
+ ]),
2527
+ _: 1
2528
+ })
2529
+ ]),
2530
+ _: 1
2531
+ }, 512)
2532
+ ]));
2533
+ }
2534
+ }), yn = /* @__PURE__ */ L(_n, [["__scopeId", "data-v-16547be0"]]), xe = De({
2535
+ theme: "dark",
2536
+ locale: "fa",
2537
+ direction: "rtl",
2538
+ permissions: ["finance.view", "roles.manage"],
2539
+ data: {}
2540
+ });
2541
+ function kn(e) {
2542
+ return e ? xe.permissions.includes(e) : !0;
2543
+ }
2544
+ function ki(e) {
2545
+ xe.locale = e, Oe(e);
2546
+ }
2547
+ function wi(e) {
2548
+ xe.direction = e, document.documentElement.dir = e;
2549
+ }
2550
+ const Ke = A({
2551
+ name: "SchemaRenderer",
2552
+ props: {
2553
+ schema: {
2554
+ type: Object,
2555
+ required: !0
2556
+ }
2557
+ },
2558
+ emits: ["event"],
2559
+ setup(e, { emit: l }) {
2560
+ const t = (s) => {
2561
+ var u;
2562
+ if (s.permission && !kn(s.permission))
2563
+ return null;
2564
+ if (s.type === "text" && !(s.props && Object.keys(s.props).some((y) => y !== "value"))) {
2565
+ const y = ((u = s.props) == null ? void 0 : u.value) || "";
2566
+ return y.includes(".") ? W(y) : y;
2567
+ }
2568
+ const o = T.get(s.type) || s.type, c = s.type === "accordion", r = s.children && !c ? s.children.map((h) => t(h)).filter(Boolean) : void 0, d = { ...s.props };
2569
+ return c && s.children && (d.items = s.children), s.events && Object.entries(s.events).forEach(([h, y]) => {
2570
+ const $ = `on${h.charAt(0).toUpperCase()}${h.slice(1)}`;
2571
+ d[$] = (P) => {
2572
+ l("event", { name: y, event: P, node: s });
2573
+ };
2574
+ }), Ie(o, d, r ? { default: () => r } : void 0);
2575
+ };
2576
+ return () => Array.isArray(e.schema) ? Ie("div", { class: "schema-tree" }, e.schema.map((s) => t(s)).filter(Boolean)) : t(e.schema);
2577
+ }
2578
+ }), wn = {
2579
+ class: "ds-accordion",
2580
+ role: "presentation"
2581
+ }, $n = ["aria-expanded", "disabled", "onClick"], Cn = { class: "ds-accordion__title" }, xn = { class: "ds-accordion__content" }, Sn = { class: "ds-accordion__content-inner" }, In = /* @__PURE__ */ A({
2582
+ __name: "Accordion",
2583
+ props: {
2584
+ items: { default: () => [] },
2585
+ multiple: { type: Boolean, default: !1 },
2586
+ defaultOpen: { type: Boolean, default: !1 },
2587
+ disabled: { type: Boolean, default: !1 }
2588
+ },
2589
+ setup(e) {
2590
+ const l = e, t = M([]), s = (o) => {
2591
+ if (l.disabled) return;
2592
+ t.value.indexOf(o) > -1 ? t.value = t.value.filter((r) => r !== o) : l.multiple ? t.value.push(o) : t.value = [o];
2593
+ }, i = (o) => t.value.includes(o);
2594
+ return ee(() => {
2595
+ l.defaultOpen && l.items.length > 0 && (l.multiple ? t.value = l.items.map((o, c) => c) : t.value = [0]);
2596
+ }), (o, c) => (a(), n("div", wn, [
2597
+ (a(!0), n(U, null, H(e.items, (r, d) => (a(), n("div", {
2598
+ key: d,
2599
+ class: I([
2600
+ "ds-accordion__item",
2601
+ { "ds-accordion__item--open": i(d) },
2602
+ { "ds-accordion__item--disabled": e.disabled }
2603
+ ])
2604
+ }, [
2605
+ m("button", {
2606
+ type: "button",
2607
+ class: "ds-accordion__header",
2608
+ "aria-expanded": i(d),
2609
+ disabled: e.disabled,
2610
+ onClick: (f) => s(d)
2611
+ }, [
2612
+ m("span", Cn, x(r.title.includes(".") ? K(W)(r.title) : r.title), 1),
2613
+ C(R, {
2614
+ name: "chevron-down",
2615
+ size: "sm",
2616
+ class: "ds-accordion__chevron"
2617
+ })
2618
+ ], 8, $n),
2619
+ m("div", {
2620
+ class: I([
2621
+ "ds-accordion__content-wrapper",
2622
+ { "ds-accordion__content-wrapper--open": i(d) }
2623
+ ])
2624
+ }, [
2625
+ m("div", xn, [
2626
+ m("div", Sn, [
2627
+ C(Ke, {
2628
+ schema: r.content
2629
+ }, null, 8, ["schema"])
2630
+ ])
2631
+ ])
2632
+ ], 2)
2633
+ ], 2))), 128))
2634
+ ]));
2635
+ }
2636
+ }), Vn = /* @__PURE__ */ L(In, [["__scopeId", "data-v-b19dcd03"]]), Bn = { class: "ds-alert__main" }, zn = { class: "ds-alert__icon-container" }, Dn = { class: "ds-alert__content" }, An = { class: "ds-alert__text-group" }, Ln = {
2637
+ key: 0,
2638
+ class: "ds-alert__title"
2639
+ }, Tn = {
2640
+ key: 1,
2641
+ class: "ds-alert__description"
2642
+ }, En = {
2643
+ key: 0,
2644
+ class: "ds-alert__actions"
2645
+ }, Mn = ["aria-label"], Pn = /* @__PURE__ */ A({
2646
+ __name: "Alert",
2647
+ props: {
2648
+ variant: { default: "info" },
2649
+ title: {},
2650
+ description: {},
2651
+ dismissible: { type: Boolean, default: !1 },
2652
+ actions: { default: () => [] },
2653
+ layout: { default: "column" }
2654
+ },
2655
+ setup(e) {
2656
+ const l = e, t = M(!1), s = () => {
2657
+ t.value = !0;
2658
+ }, i = g(() => {
2659
+ switch (l.variant) {
2660
+ case "success":
2661
+ return "check";
2662
+ case "warning":
2663
+ case "danger":
2664
+ return "alert-circle";
2665
+ case "info":
2666
+ case "primary":
2667
+ case "secondary":
2668
+ default:
2669
+ return "info";
2670
+ }
2671
+ }), o = g(() => [
2672
+ "ds-alert",
2673
+ `ds-alert--${l.variant}`,
2674
+ `ds-alert--layout-${l.layout}`
2675
+ ]);
2676
+ return (c, r) => t.value ? v("", !0) : (a(), n("div", {
2677
+ key: 0,
2678
+ class: I(o.value),
2679
+ role: "alert"
2680
+ }, [
2681
+ m("div", Bn, [
2682
+ m("div", zn, [
2683
+ C(R, {
2684
+ name: i.value,
2685
+ size: "lg"
2686
+ }, null, 8, ["name"])
2687
+ ]),
2688
+ m("div", Dn, [
2689
+ m("div", An, [
2690
+ e.title ? (a(), n("h4", Ln, x(e.title.includes(".") ? K(W)(e.title) : e.title), 1)) : v("", !0),
2691
+ e.description ? (a(), n("p", Tn, x(e.description.includes(".") ? K(W)(e.description) : e.description), 1)) : v("", !0)
2692
+ ]),
2693
+ e.actions && e.actions.length > 0 ? (a(), n("div", En, [
2694
+ (a(!0), n(U, null, H(e.actions, (d, f) => (a(), E(Ke, {
2695
+ key: f,
2696
+ schema: d
2697
+ }, null, 8, ["schema"]))), 128))
2698
+ ])) : v("", !0)
2699
+ ]),
2700
+ e.dismissible ? (a(), n("button", {
2701
+ key: 0,
2702
+ type: "button",
2703
+ class: "ds-alert__dismiss-btn",
2704
+ onClick: s,
2705
+ "aria-label": K(W)("common.close") || "Close"
2706
+ }, [
2707
+ C(R, {
2708
+ name: "x",
2709
+ size: "lg"
2710
+ })
2711
+ ], 8, Mn)) : v("", !0)
2712
+ ])
2713
+ ], 2));
2714
+ }
2715
+ }), On = /* @__PURE__ */ L(Pn, [["__scopeId", "data-v-6a1f2796"]]), Rn = ["aria-valuenow", "aria-valuemax"], Nn = {
2716
+ key: 0,
2717
+ class: "ds-progress__header"
2718
+ }, Fn = {
2719
+ key: 0,
2720
+ class: "ds-progress__label"
2721
+ }, Un = {
2722
+ key: 1,
2723
+ class: "ds-progress__value"
2724
+ }, qn = { class: "ds-progress__track" }, jn = /* @__PURE__ */ A({
2725
+ __name: "Progress",
2726
+ props: {
2727
+ value: { default: 0 },
2728
+ max: { default: 100 },
2729
+ label: {},
2730
+ showValue: { type: Boolean, default: !1 }
2731
+ },
2732
+ setup(e) {
2733
+ const l = e, t = g(() => {
2734
+ const s = Math.max(0, Math.min(l.value, l.max));
2735
+ return Math.round(s / l.max * 100);
2736
+ });
2737
+ return (s, i) => (a(), n("div", {
2738
+ class: "ds-progress",
2739
+ role: "progressbar",
2740
+ "aria-valuenow": e.value,
2741
+ "aria-valuemin": 0,
2742
+ "aria-valuemax": e.max
2743
+ }, [
2744
+ e.label || e.showValue ? (a(), n("div", Nn, [
2745
+ e.label ? (a(), n("span", Fn, x(e.label.includes(".") ? K(W)(e.label) : e.label), 1)) : v("", !0),
2746
+ e.showValue ? (a(), n("span", Un, x(t.value) + "% ", 1)) : v("", !0)
2747
+ ])) : v("", !0),
2748
+ m("div", qn, [
2749
+ m("div", {
2750
+ class: "ds-progress__bar",
2751
+ style: Q({ width: `${t.value}%` })
2752
+ }, null, 4)
2753
+ ])
2754
+ ], 8, Rn));
2755
+ }
2756
+ }), Kn = /* @__PURE__ */ L(jn, [["__scopeId", "data-v-24d1420d"]]), Hn = {
2757
+ class: "ds-breadcrumb",
2758
+ "aria-label": "Breadcrumb"
2759
+ }, Wn = { class: "ds-breadcrumb__list" }, Gn = {
2760
+ key: 0,
2761
+ class: "ds-breadcrumb__separator",
2762
+ "aria-hidden": "true"
2763
+ }, Yn = {
2764
+ key: 1,
2765
+ class: "ds-breadcrumb__current",
2766
+ "aria-current": "page"
2767
+ }, Xn = ["href", "onClick"], Zn = /* @__PURE__ */ A({
2768
+ __name: "Breadcrumb",
2769
+ props: {
2770
+ items: { default: () => [] },
2771
+ separator: { default: "/" }
2772
+ },
2773
+ emits: ["navigate"],
2774
+ setup(e, { emit: l }) {
2775
+ const t = l, s = (i) => {
2776
+ i && t("navigate", i);
2777
+ };
2778
+ return (i, o) => (a(), n("nav", Hn, [
2779
+ m("ol", Wn, [
2780
+ (a(!0), n(U, null, H(e.items, (c, r) => (a(), n("li", {
2781
+ key: r,
2782
+ class: "ds-breadcrumb__item"
2783
+ }, [
2784
+ r > 0 ? (a(), n("span", Gn, x(e.separator), 1)) : v("", !0),
2785
+ r === e.items.length - 1 ? (a(), n("span", Yn, x(c.label.includes(".") ? K(W)(c.label) : c.label), 1)) : (a(), n("a", {
2786
+ key: 2,
2787
+ href: c.path || "#",
2788
+ class: "ds-breadcrumb__link",
2789
+ onClick: Y((d) => s(c.path), ["prevent"])
2790
+ }, x(c.label.includes(".") ? K(W)(c.label) : c.label), 9, Xn))
2791
+ ]))), 128))
2792
+ ])
2793
+ ]));
2794
+ }
2795
+ }), Jn = /* @__PURE__ */ L(Zn, [["__scopeId", "data-v-3500518b"]]), Qn = ["tabindex"], eo = { class: "ds-chip__label" }, to = ["disabled", "aria-label"], ao = /* @__PURE__ */ A({
2796
+ __name: "Chip",
2797
+ props: {
2798
+ label: {},
2799
+ icon: {},
2800
+ closable: { type: Boolean, default: !1 },
2801
+ disabled: { type: Boolean, default: !1 }
2802
+ },
2803
+ emits: ["close", "click"],
2804
+ setup(e, { emit: l }) {
2805
+ const t = e, s = l, i = (r) => {
2806
+ r.stopPropagation(), !t.disabled && s("close");
2807
+ }, o = () => {
2808
+ t.disabled || s("click");
2809
+ }, c = g(() => [
2810
+ "ds-chip",
2811
+ { "ds-chip--disabled": t.disabled },
2812
+ { "ds-chip--interactive": !t.disabled }
2813
+ ]);
2814
+ return (r, d) => (a(), n("div", {
2815
+ class: I(c.value),
2816
+ onClick: o,
2817
+ role: "button",
2818
+ tabindex: e.disabled ? -1 : 0
2819
+ }, [
2820
+ e.icon ? (a(), E(R, {
2821
+ key: 0,
2822
+ name: e.icon,
2823
+ size: "xs",
2824
+ class: "ds-chip__icon"
2825
+ }, null, 8, ["name"])) : v("", !0),
2826
+ m("span", eo, x(e.label.includes(".") ? K(W)(e.label) : e.label), 1),
2827
+ e.closable ? (a(), n("button", {
2828
+ key: 1,
2829
+ type: "button",
2830
+ class: "ds-chip__close-btn",
2831
+ disabled: e.disabled,
2832
+ onClick: i,
2833
+ "aria-label": K(W)("common.remove") || "Remove"
2834
+ }, [
2835
+ C(R, {
2836
+ name: "x",
2837
+ size: "xs"
2838
+ })
2839
+ ], 8, to)) : v("", !0)
2840
+ ], 10, Qn));
2841
+ }
2842
+ }), so = /* @__PURE__ */ L(ao, [["__scopeId", "data-v-6f58d89d"]]), lo = { class: "ds-command-trigger__left" }, no = { class: "ds-command-trigger__shortcut-group" }, oo = { class: "ds-command-key" }, io = {
2843
+ key: 0,
2844
+ class: "ds-command-key-separator"
2845
+ }, ro = {
2846
+ class: "ds-command-dialog",
2847
+ role: "dialog",
2848
+ "aria-modal": "true"
2849
+ }, co = { class: "ds-command-dialog__header" }, uo = ["placeholder"], mo = { class: "ds-command-dialog__body" }, vo = {
2850
+ key: 0,
2851
+ class: "ds-command-list"
2852
+ }, fo = ["onClick", "onMouseenter"], po = { class: "ds-command-item__left" }, bo = { class: "ds-command-item__label" }, ho = { class: "ds-command-item__action-hint" }, go = { class: "ds-command-item__action-text" }, _o = {
2853
+ key: 1,
2854
+ class: "ds-command-empty"
2855
+ }, yo = /* @__PURE__ */ A({
2856
+ __name: "CommandMenu",
2857
+ props: {
2858
+ items: { default: () => [] },
2859
+ searchable: { type: Boolean, default: !0 },
2860
+ shortcut: { default: "Ctrl+K" },
2861
+ placeholder: { default: "Search" }
2862
+ },
2863
+ emits: ["select", "navigate"],
2864
+ setup(e, { emit: l }) {
2865
+ const t = e, s = l, { locale: i } = Re(), o = g(() => t.shortcut ? t.shortcut.split("+") : []), c = M(!1), r = M(""), d = M(0), f = M(null), u = (k) => {
2866
+ const S = t.shortcut.toLowerCase().split("+"), O = S[S.length - 1], p = S.includes("ctrl") || S.includes("control"), V = S.includes("meta") || S.includes("cmd") || S.includes("⌘"), _ = S.includes("alt"), w = S.includes("shift");
2867
+ return O && k.key.toLowerCase() === O ? !(p && !k.ctrlKey || V && !k.metaKey || _ && !k.altKey || w && !k.shiftKey) : !1;
2868
+ }, h = (k) => {
2869
+ u(k) ? (k.preventDefault(), y()) : c.value && (k.key === "Escape" ? (k.preventDefault(), P()) : k.key === "ArrowDown" ? (k.preventDefault(), d.value = (d.value + 1) % B.value.length) : k.key === "ArrowUp" ? (k.preventDefault(), d.value = (d.value - 1 + B.value.length) % B.value.length) : k.key === "Enter" && (k.preventDefault(), B.value[d.value] && D(B.value[d.value])));
2870
+ };
2871
+ ee(() => {
2872
+ window.addEventListener("keydown", h);
2873
+ }), Ze(() => {
2874
+ window.removeEventListener("keydown", h), document.body.style.overflow = "";
2875
+ });
2876
+ const y = () => {
2877
+ c.value ? P() : $();
2878
+ }, $ = () => {
2879
+ c.value = !0, r.value = "", d.value = 0, document.body.style.overflow = "hidden", Je(() => {
2880
+ var k;
2881
+ (k = f.value) == null || k.focus();
2882
+ });
2883
+ }, P = () => {
2884
+ c.value = !1, document.body.style.overflow = "";
2885
+ }, D = (k) => {
2886
+ if (s("select", k), k.action.startsWith("navigate:")) {
2887
+ const S = k.action.replace("navigate:", "");
2888
+ s("navigate", S);
2889
+ }
2890
+ P();
2891
+ }, B = g(() => {
2892
+ const k = r.value.trim().toLowerCase();
2893
+ return k ? t.items.filter((S) => {
2894
+ const O = W(S.label).toLowerCase(), p = S.label.toLowerCase();
2895
+ return O.includes(k) || p.includes(k);
2896
+ }) : t.items;
2897
+ });
2898
+ se(B, () => {
2899
+ d.value = 0;
2900
+ });
2901
+ const q = (k) => {
2902
+ k.target === k.currentTarget && P();
2903
+ };
2904
+ return (k, S) => (a(), n("div", null, [
2905
+ m("button", {
2906
+ type: "button",
2907
+ class: "ds-command-trigger",
2908
+ onClick: $
2909
+ }, [
2910
+ m("span", lo, [
2911
+ C(R, {
2912
+ name: "search",
2913
+ size: "sm"
2914
+ }),
2915
+ m("span", null, x(e.placeholder.includes(".") ? K(W)(e.placeholder) : e.placeholder), 1)
2916
+ ]),
2917
+ m("span", no, [
2918
+ (a(!0), n(U, null, H(o.value, (O, p) => (a(), n(U, { key: p }, [
2919
+ m("kbd", oo, x(O), 1),
2920
+ p < o.value.length - 1 ? (a(), n("span", io, "+")) : v("", !0)
2921
+ ], 64))), 128))
2922
+ ])
2923
+ ]),
2924
+ C(te, { name: "ds-command-fade" }, {
2925
+ default: F(() => [
2926
+ c.value ? (a(), n("div", {
2927
+ key: 0,
2928
+ class: "ds-command-overlay",
2929
+ onClick: q
2930
+ }, [
2931
+ m("div", ro, [
2932
+ m("div", co, [
2933
+ C(R, {
2934
+ name: "search",
2935
+ size: "md",
2936
+ class: "ds-command-dialog__search-icon"
2937
+ }),
2938
+ ce(m("input", {
2939
+ ref_key: "searchInput",
2940
+ ref: f,
2941
+ type: "text",
2942
+ "onUpdate:modelValue": S[0] || (S[0] = (O) => r.value = O),
2943
+ class: "ds-command-dialog__input",
2944
+ placeholder: e.placeholder.includes(".") ? K(W)(e.placeholder) : e.placeholder,
2945
+ "aria-label": "Search commands"
2946
+ }, null, 8, uo), [
2947
+ [Ae, r.value]
2948
+ ]),
2949
+ S[1] || (S[1] = m("kbd", { class: "ds-command-dialog__escape-kbd" }, "ESC", -1))
2950
+ ]),
2951
+ m("div", mo, [
2952
+ B.value.length > 0 ? (a(), n("ul", vo, [
2953
+ (a(!0), n(U, null, H(B.value, (O, p) => (a(), n("li", {
2954
+ key: O.id,
2955
+ class: I([
2956
+ "ds-command-item",
2957
+ { "ds-command-item--active": p === d.value }
2958
+ ]),
2959
+ onClick: (V) => D(O),
2960
+ onMouseenter: (V) => d.value = p
2961
+ }, [
2962
+ m("div", po, [
2963
+ O.icon ? (a(), E(R, {
2964
+ key: 0,
2965
+ name: O.icon,
2966
+ size: "sm",
2967
+ class: "ds-command-item__icon"
2968
+ }, null, 8, ["name"])) : v("", !0),
2969
+ m("span", bo, x(O.label.includes(".") ? K(W)(O.label) : O.label), 1)
2970
+ ]),
2971
+ m("span", ho, [
2972
+ m("span", go, x(O.action.startsWith("navigate:") ? K(i) === "fa" ? "انتقال" : "Go" : K(i) === "fa" ? "اجرا" : "Run"), 1),
2973
+ C(R, {
2974
+ name: K(i) === "fa" ? "arrow-left" : "arrow-right",
2975
+ size: "xs",
2976
+ class: "ds-command-item__action-icon"
2977
+ }, null, 8, ["name"])
2978
+ ])
2979
+ ], 42, fo))), 128))
2980
+ ])) : (a(), n("div", _o, x(K(W)("common.no_results") || "نتیجه‌ای یافت نشد (No results found)"), 1))
2981
+ ])
2982
+ ])
2983
+ ])) : v("", !0)
2984
+ ]),
2985
+ _: 1
2986
+ })
2987
+ ]));
2988
+ }
2989
+ }), ko = /* @__PURE__ */ L(yo, [["__scopeId", "data-v-f884cb60"]]), wo = { class: "ds-user-card__info" }, $o = /* @__PURE__ */ A({
2990
+ __name: "UserCard",
2991
+ props: {
2992
+ name: { default: "User" },
2993
+ role: { default: "Admin" },
2994
+ avatar: { default: "" },
2995
+ collapsed: { type: Boolean, default: !1 },
2996
+ icon: { default: "more" },
2997
+ squareAvatar: { type: Boolean, default: !1 }
2998
+ },
2999
+ setup(e) {
3000
+ return (l, t) => (a(), n("div", {
3001
+ class: I(["ds-user-card", { "ds-user-card--collapsed": e.collapsed }])
3002
+ }, [
3003
+ e.avatar ? (a(), E(re, {
3004
+ key: 0,
3005
+ src: e.avatar,
3006
+ size: "sm",
3007
+ square: e.squareAvatar
3008
+ }, null, 8, ["src", "square"])) : (a(), E(re, {
3009
+ key: 1,
3010
+ name: e.name,
3011
+ size: "sm",
3012
+ square: e.squareAvatar
3013
+ }, null, 8, ["name", "square"])),
3014
+ ce(m("div", wo, [
3015
+ C(G, {
3016
+ variant: "body-sm",
3017
+ class: "ds-user-card__name"
3018
+ }, {
3019
+ default: F(() => [
3020
+ X(x(e.name), 1)
3021
+ ]),
3022
+ _: 1
3023
+ }),
3024
+ C(G, {
3025
+ variant: "caption",
3026
+ class: "ds-user-card__role"
3027
+ }, {
3028
+ default: F(() => [
3029
+ X(x(e.role), 1)
3030
+ ]),
3031
+ _: 1
3032
+ })
3033
+ ], 512), [
3034
+ [Ve, !e.collapsed]
3035
+ ]),
3036
+ ce(C(R, {
3037
+ name: e.icon,
3038
+ size: "sm",
3039
+ class: "ds-user-card__action"
3040
+ }, null, 8, ["name"]), [
3041
+ [Ve, !e.collapsed]
3042
+ ])
3043
+ ], 2));
3044
+ }
3045
+ }), He = /* @__PURE__ */ L($o, [["__scopeId", "data-v-0c875206"]]), Co = ["width", "height"], xo = /* @__PURE__ */ A({
3046
+ __name: "Logo",
3047
+ props: {
3048
+ size: { default: 24 }
3049
+ },
3050
+ setup(e) {
3051
+ return (l, t) => (a(), n("svg", {
3052
+ width: e.size,
3053
+ height: e.size,
3054
+ viewBox: "0 0 350 350",
3055
+ fill: "none",
3056
+ xmlns: "http://www.w3.org/2000/svg",
3057
+ class: "ds-logo"
3058
+ }, [...t[0] || (t[0] = [
3059
+ m("path", {
3060
+ d: "M230.086 142.387C230.183 142.388 230.279 142.388 230.376 142.391C247.378 142.805 261.194 156.063 262.493 172.831C262.501 172.828 262.509 172.824 262.517 172.82C262.583 173.678 262.619 174.544 262.619 175.419C262.619 193.666 247.828 208.457 229.581 208.457C211.334 208.457 196.543 193.666 196.543 175.419C196.543 157.177 211.328 142.388 229.568 142.381C229.741 142.381 229.914 142.384 230.086 142.387Z",
3061
+ fill: "currentColor"
3062
+ }, null, -1),
3063
+ m("path", {
3064
+ d: "M83.709 160.57C91.9096 160.57 98.5576 167.218 98.5576 175.419C98.5576 183.62 91.9096 190.268 83.709 190.268C75.5086 190.267 68.8614 183.619 68.8613 175.419C68.8613 167.218 75.5085 160.571 83.709 160.57Z",
3065
+ fill: "currentColor"
3066
+ }, null, -1),
3067
+ m("path", {
3068
+ "fill-rule": "evenodd",
3069
+ "clip-rule": "evenodd",
3070
+ d: "M305 0C329.853 4.18769e-06 350 20.1472 350 45V305C350 329.853 329.853 350 305 350H45C20.1472 350 1.36923e-06 329.853 0 305V45C4.18824e-06 20.1472 20.1472 1.36905e-06 45 0H305ZM229.557 102C229.438 102 229.32 102.001 229.201 102.002C228.932 102.003 228.663 102.005 228.395 102.009C228.071 102.014 227.748 102.023 227.425 102.032C227.368 102.034 227.312 102.034 227.256 102.036C226.948 102.046 226.64 102.058 226.333 102.071C226.251 102.075 226.168 102.077 226.086 102.081C225.723 102.098 225.36 102.118 224.998 102.141C224.986 102.141 224.974 102.142 224.962 102.143C202.145 103.552 182.149 115.382 169.675 132.932C169.679 132.925 169.683 132.919 169.687 132.913C146.755 157.756 135.638 168.421 105.954 146.218C105.799 146.1 105.644 145.982 105.487 145.866C105.314 145.735 105.137 145.605 104.962 145.472C104.986 145.493 105.011 145.516 105.035 145.537C99.0239 141.239 91.6619 138.709 83.709 138.709C63.4351 138.709 47 155.145 47 175.419C47 195.693 63.4352 212.128 83.709 212.128C91.6626 212.128 99.0246 209.597 105.036 205.299C105.011 205.321 104.987 205.344 104.962 205.366C105.148 205.224 105.336 205.085 105.521 204.945C105.652 204.848 105.782 204.75 105.912 204.651C135.627 182.407 146.744 193.071 169.687 217.925C169.646 217.855 169.605 217.785 169.564 217.716C182.857 236.542 204.783 248.838 229.581 248.838C270.129 248.838 303 215.967 303 175.419C303 136.241 272.312 104.23 233.663 102.112C233.656 102.112 233.649 102.112 233.643 102.111C232.784 102.065 231.921 102.033 231.055 102.016C230.981 102.014 230.908 102.013 230.834 102.012C230.417 102.005 230 102 229.581 102H229.557Z",
3071
+ fill: "currentColor"
3072
+ }, null, -1)
3073
+ ])], 8, Co));
3074
+ }
3075
+ }), So = /* @__PURE__ */ L(xo, [["__scopeId", "data-v-a8066800"]]), Io = { class: "ds-sidebar__header" }, Vo = { class: "ds-sidebar__nav" }, Bo = { class: "ds-sidebar__footer" }, zo = {
3076
+ key: 0,
3077
+ class: "ds-sidebar__divider-line"
3078
+ }, Do = {
3079
+ key: 1,
3080
+ class: "ds-sidebar__child"
3081
+ }, Ao = { class: "ds-sidebar__child-dropdown" }, Lo = { class: "ds-sidebar__child-items" }, To = ["onClick"], Eo = /* @__PURE__ */ A({
3082
+ __name: "SidebarNav",
3083
+ props: {
3084
+ navigation: { default: () => [] },
3085
+ activeId: { default: "" },
3086
+ brand: { default: () => ({ icon: "logo", title: "" }) },
3087
+ userName: { default: "User" },
3088
+ userRole: { default: "Admin" },
3089
+ userAvatar: { default: "" },
3090
+ footer: { default: () => [] },
3091
+ collapsed: { type: Boolean, default: !0 },
3092
+ profile: { default: () => ({ enabled: !0 }) }
3093
+ },
3094
+ emits: ["navigate"],
3095
+ setup(e, { emit: l }) {
3096
+ const t = e, s = l, i = M(""), o = M(!1);
3097
+ se(() => t.activeId, (y) => {
3098
+ var $, P;
3099
+ if (y) {
3100
+ for (const D of t.navigation) {
3101
+ if (D.id === y) {
3102
+ i.value = D.id, o.value = !!(D.children && D.children.length > 0);
3103
+ return;
3104
+ }
3105
+ if (($ = D.children) != null && $.some((B) => B.id === y)) {
3106
+ i.value = D.id, o.value = !0;
3107
+ return;
3108
+ }
3109
+ }
3110
+ for (const D of t.footer) {
3111
+ if (D.id === y) {
3112
+ i.value = D.id, o.value = !!(D.children && D.children.length > 0);
3113
+ return;
3114
+ }
3115
+ if ((P = D.children) != null && P.some((B) => B.id === y)) {
3116
+ i.value = D.id, o.value = !0;
3117
+ return;
3118
+ }
3119
+ }
3120
+ }
3121
+ }, { immediate: !0 });
3122
+ const c = g(() => i.value && (t.navigation.find((y) => y.id === i.value) || t.footer.find((y) => y.id === i.value)) || null);
3123
+ function r(y) {
3124
+ if (t.navigation.some((P) => P.id === y) || t.footer.some((P) => P.id === y)) {
3125
+ i.value = y;
3126
+ const P = [...t.navigation, ...t.footer].find((D) => D.id === y);
3127
+ o.value = !!(P != null && P.children && P.children.length > 0);
3128
+ }
3129
+ s("navigate", y);
3130
+ }
3131
+ function d(y) {
3132
+ r(y.value);
3133
+ }
3134
+ function f() {
3135
+ o.value = !o.value;
3136
+ }
3137
+ function u(y) {
3138
+ var $;
3139
+ return !!(y.id === t.activeId || ($ = y.children) != null && $.some((P) => P.id === t.activeId));
3140
+ }
3141
+ const h = g(() => (t.navigation || []).map((y) => ({
3142
+ id: y.id,
3143
+ label: y.label,
3144
+ value: y.id
3145
+ })));
3146
+ return (y, $) => {
3147
+ var P, D, B, q;
3148
+ return a(), n("div", {
3149
+ class: I(["ds-sidebar-container", { "ds-sidebar-container--child-closed": !o.value }])
3150
+ }, [
3151
+ m("aside", {
3152
+ class: I(["ds-sidebar", { "ds-sidebar--collapsed": e.collapsed }])
3153
+ }, [
3154
+ m("div", Io, [
3155
+ e.brand.icon ? (a(), E(So, {
3156
+ key: 0,
3157
+ size: 24,
3158
+ class: "ds-sidebar__logo-icon"
3159
+ })) : v("", !0),
3160
+ e.brand.title ? (a(), E(G, {
3161
+ key: 1,
3162
+ variant: "body-md",
3163
+ class: "ds-sidebar__brand-title"
3164
+ }, {
3165
+ default: F(() => [
3166
+ X(x(e.brand.title), 1)
3167
+ ]),
3168
+ _: 1
3169
+ })) : v("", !0)
3170
+ ]),
3171
+ m("nav", Vo, [
3172
+ (a(!0), n(U, null, H(e.navigation, (k) => (a(), E(ke, {
3173
+ key: k.id,
3174
+ text: k.label,
3175
+ position: "end"
3176
+ }, {
3177
+ default: F(() => [
3178
+ C(ue, {
3179
+ label: k.label,
3180
+ icon: k.icon || "menu",
3181
+ active: u(k),
3182
+ onClick: (S) => r(k.id)
3183
+ }, null, 8, ["label", "icon", "active", "onClick"])
3184
+ ]),
3185
+ _: 2
3186
+ }, 1032, ["text"]))), 128))
3187
+ ]),
3188
+ m("div", Bo, [
3189
+ (a(!0), n(U, null, H(e.footer, (k) => (a(), E(ke, {
3190
+ key: k.id,
3191
+ text: k.label,
3192
+ position: "end"
3193
+ }, {
3194
+ default: F(() => [
3195
+ C(ue, {
3196
+ label: k.label,
3197
+ icon: k.icon || "settings",
3198
+ active: u(k),
3199
+ onClick: (S) => r(k.id)
3200
+ }, null, 8, ["label", "icon", "active", "onClick"])
3201
+ ]),
3202
+ _: 2
3203
+ }, 1032, ["text"]))), 128)),
3204
+ (P = e.profile) != null && P.enabled ? (a(), E(Ne, {
3205
+ key: 0,
3206
+ class: "ds-sidebar__divider"
3207
+ })) : v("", !0),
3208
+ (D = e.profile) != null && D.enabled ? (a(), E(He, {
3209
+ key: 1,
3210
+ name: e.userName,
3211
+ role: e.userRole,
3212
+ avatar: e.userAvatar,
3213
+ collapsed: !0,
3214
+ icon: "more"
3215
+ }, null, 8, ["name", "role", "avatar"])) : v("", !0),
3216
+ C(Ue, {
3217
+ icon: o.value ? "minimize-2" : "maximize-2",
3218
+ variant: "ghost",
3219
+ class: "ds-sidebar__child-toggle",
3220
+ onClick: f
3221
+ }, null, 8, ["icon"])
3222
+ ])
3223
+ ], 2),
3224
+ o.value ? (a(), n("div", zo)) : v("", !0),
3225
+ o.value ? (a(), n("div", Do, [
3226
+ m("div", Ao, [
3227
+ C(Ce, {
3228
+ items: h.value,
3229
+ label: ((B = c.value) == null ? void 0 : B.label) || "",
3230
+ icon: "chevron-down",
3231
+ onSelect: d
3232
+ }, null, 8, ["items", "label"])
3233
+ ]),
3234
+ m("div", Lo, [
3235
+ (a(!0), n(U, null, H((q = c.value) == null ? void 0 : q.children, (k) => (a(), n("div", {
3236
+ key: k.id,
3237
+ class: I(["ds-sidebar__child-item", { "ds-sidebar__child-item--active": e.activeId === k.id }]),
3238
+ onClick: (S) => r(k.id)
3239
+ }, [
3240
+ C(R, {
3241
+ name: k.icon || "menu",
3242
+ size: "sm",
3243
+ class: "ds-sidebar__child-item-icon"
3244
+ }, null, 8, ["name"]),
3245
+ C(G, {
3246
+ variant: "body-md",
3247
+ class: "ds-sidebar__child-item-label"
3248
+ }, {
3249
+ default: F(() => [
3250
+ X(x(k.label), 1)
3251
+ ]),
3252
+ _: 2
3253
+ }, 1024)
3254
+ ], 10, To))), 128))
3255
+ ])
3256
+ ])) : v("", !0)
3257
+ ], 2);
3258
+ };
3259
+ }
3260
+ }), Mo = /* @__PURE__ */ L(Eo, [["__scopeId", "data-v-3db29d1e"]]), Po = ["aria-checked", "onClick"], Oo = { key: 1 }, Ro = /* @__PURE__ */ A({
3261
+ __name: "ActionToggle",
3262
+ props: {
3263
+ options: {},
3264
+ modelValue: {}
3265
+ },
3266
+ emits: ["update:modelValue"],
3267
+ setup(e, { emit: l }) {
3268
+ Qe((c) => ({
3269
+ e93204aa: c.options.length,
3270
+ v5dcfebbd: c.modelValue
3271
+ }));
3272
+ const t = e, s = l;
3273
+ function i(c) {
3274
+ s("update:modelValue", c);
3275
+ }
3276
+ function o(c) {
3277
+ c.key === "ArrowRight" || c.key === "ArrowDown" ? (c.preventDefault(), i((t.modelValue + 1) % t.options.length)) : (c.key === "ArrowLeft" || c.key === "ArrowUp") && (c.preventDefault(), i((t.modelValue - 1 + t.options.length) % t.options.length));
3278
+ }
3279
+ return (c, r) => (a(), n("div", {
3280
+ class: "ds-action-toggle",
3281
+ tabindex: "0",
3282
+ role: "radiogroup",
3283
+ onKeydown: o
3284
+ }, [
3285
+ r[0] || (r[0] = m("div", { class: "ds-action-toggle__thumb" }, null, -1)),
3286
+ (a(!0), n(U, null, H(e.options, (d, f) => (a(), n("div", {
3287
+ key: f,
3288
+ class: I(["ds-action-toggle__option", { "ds-action-toggle__option--active": e.modelValue === f }]),
3289
+ role: "radio",
3290
+ "aria-checked": e.modelValue === f,
3291
+ onClick: Y((u) => i(f), ["stop"])
3292
+ }, [
3293
+ d.icon ? (a(), E(R, {
3294
+ key: 0,
3295
+ name: d.icon,
3296
+ size: "md"
3297
+ }, null, 8, ["name"])) : v("", !0),
3298
+ d.label ? (a(), n("span", Oo, x(d.label), 1)) : v("", !0)
3299
+ ], 10, Po))), 128))
3300
+ ], 32));
3301
+ }
3302
+ }), No = /* @__PURE__ */ L(Ro, [["__scopeId", "data-v-b0cca134"]]), Fo = ["disabled"], Uo = { key: 1 }, qo = /* @__PURE__ */ A({
3303
+ __name: "ToggleButton",
3304
+ props: {
3305
+ offLabel: {},
3306
+ onLabel: {},
3307
+ offIcon: {},
3308
+ onIcon: {},
3309
+ modelValue: { type: Boolean },
3310
+ size: { default: "md" },
3311
+ disabled: { type: Boolean, default: !1 }
3312
+ },
3313
+ emits: ["update:modelValue"],
3314
+ setup(e, { emit: l }) {
3315
+ const t = e, s = l, i = g(() => t.modelValue ? t.onLabel : t.offLabel), o = g(() => t.modelValue ? t.onIcon : t.offIcon), c = g(() => {
3316
+ switch (t.size) {
3317
+ case "sm":
3318
+ return "sm";
3319
+ case "md":
3320
+ return "md";
3321
+ case "lg":
3322
+ return "button-lg";
3323
+ default:
3324
+ return "md";
3325
+ }
3326
+ }), r = g(() => [
3327
+ "ds-toggle-btn",
3328
+ `ds-toggle-btn--${t.size}`,
3329
+ {
3330
+ "ds-toggle-btn--on": t.modelValue,
3331
+ "ds-toggle-btn--disabled": t.disabled,
3332
+ "ds-toggle-btn--icon-only": !i.value && !!o.value
3333
+ }
3334
+ ]);
3335
+ function d() {
3336
+ t.disabled || s("update:modelValue", !t.modelValue);
3337
+ }
3338
+ return (f, u) => (a(), n("button", {
3339
+ class: I(r.value),
3340
+ disabled: e.disabled,
3341
+ onClick: d
3342
+ }, [
3343
+ o.value ? (a(), E(R, {
3344
+ key: 0,
3345
+ name: o.value,
3346
+ size: c.value
3347
+ }, null, 8, ["name", "size"])) : v("", !0),
3348
+ i.value ? (a(), n("span", Uo, x(i.value), 1)) : v("", !0)
3349
+ ], 10, Fo));
3350
+ }
3351
+ }), jo = /* @__PURE__ */ L(qo, [["__scopeId", "data-v-e197f8b7"]]), Ko = ["aria-label", "onClick"], Ho = { key: 1 }, Wo = ["aria-label", "aria-pressed"], Go = ["src", "alt"], Yo = { class: "ds-swipe-item__body" }, Xo = {
3352
+ key: 0,
3353
+ class: "ds-swipe-item__title"
3354
+ }, Zo = {
3355
+ key: 1,
3356
+ class: "ds-swipe-item__description"
3357
+ }, Jo = {
3358
+ key: 2,
3359
+ class: "ds-swipe-item__timestamp"
3360
+ }, _e = 92, Qo = 0.3, ei = /* @__PURE__ */ A({
3361
+ __name: "SwipeItem",
3362
+ props: {
3363
+ id: {},
3364
+ variant: { default: "secondary" },
3365
+ icon: { default: "" },
3366
+ image: { default: "" },
3367
+ title: {},
3368
+ description: {},
3369
+ timestamp: {},
3370
+ actions: { default: () => [{ id: "delete", label: "Delete", icon: "trash", variant: "danger" }] },
3371
+ disabled: { type: Boolean, default: !1 },
3372
+ unread: { type: Boolean, default: !1 },
3373
+ read: { type: Boolean, default: !1 }
3374
+ },
3375
+ emits: ["action"],
3376
+ setup(e, { emit: l }) {
3377
+ const t = e, s = l, i = M(0), o = M(0), c = M(!1), r = M(!1), d = M(0), f = g(
3378
+ () => r.value ? 0 : Math.min(0, i.value + o.value)
3379
+ ), u = g(() => r.value ? { transform: "translateX(-100%)" } : {
3380
+ transform: `translateX(${f.value}px)`,
3381
+ transition: c.value ? "none" : void 0
3382
+ }), h = g(
3383
+ () => r.value ? { maxHeight: "0", marginBottom: "0", overflow: "hidden", pointerEvents: "none", opacity: "0" } : {}
3384
+ ), y = g(() => `${t.actions.length * _e}px`), $ = {
3385
+ default: { bg: "var(--alert-default-bg)", fg: "var(--alert-default-icon)" },
3386
+ primary: { bg: "var(--color-primary-bg)", fg: "var(--color-primary)" },
3387
+ secondary: { bg: "var(--alert-secondary-bg)", fg: "var(--alert-secondary-icon)" },
3388
+ success: { bg: "var(--alert-success-bg)", fg: "var(--alert-success-icon)" },
3389
+ warning: { bg: "var(--alert-warning-bg)", fg: "var(--alert-warning-icon)" },
3390
+ danger: { bg: "var(--alert-danger-bg)", fg: "var(--alert-danger-icon)" }
3391
+ }, P = g(() => $[t.variant].bg), D = g(() => $[t.variant].fg), B = g(() => $[t.variant].fg);
3392
+ function q(w) {
3393
+ t.disabled || r.value || (c.value = !0, d.value = w.clientX, o.value = 0, w.currentTarget.setPointerCapture(w.pointerId));
3394
+ }
3395
+ function k(w) {
3396
+ !c.value || t.disabled || (o.value = w.clientX - d.value);
3397
+ }
3398
+ function S(w) {
3399
+ var N;
3400
+ if (!c.value) return;
3401
+ c.value = !1, w.currentTarget.releasePointerCapture(w.pointerId);
3402
+ const b = Math.abs(f.value), z = ((N = w.currentTarget.parentElement) == null ? void 0 : N.offsetWidth) || 300;
3403
+ if (b > z * Qo) {
3404
+ i.value = -z, setTimeout(() => {
3405
+ r.value = !0, setTimeout(() => s("action", t.id, "__delete"), 300);
3406
+ }, 150);
3407
+ return;
3408
+ }
3409
+ i.value = b > _e / 2 ? -_e * t.actions.length : 0, o.value = 0;
3410
+ }
3411
+ function O() {
3412
+ c.value = !1, i.value = 0, o.value = 0;
3413
+ }
3414
+ function p(w) {
3415
+ t.disabled || ((w.key === "Delete" || w.key === "Backspace") && V(), w.key === "Escape" && (i.value = 0, o.value = 0));
3416
+ }
3417
+ function V() {
3418
+ r.value = !0, setTimeout(() => s("action", t.id, "__delete"), 300);
3419
+ }
3420
+ function _(w) {
3421
+ if (w === "__delete" || w === "delete") {
3422
+ V();
3423
+ return;
3424
+ }
3425
+ i.value = 0, s("action", t.id, w);
3426
+ }
3427
+ return (w, b) => (a(), n("div", {
3428
+ class: I([
3429
+ "ds-swipe-item",
3430
+ `ds-swipe-item--${e.variant}`,
3431
+ e.unread && !e.read && "ds-swipe-item--unread",
3432
+ e.read && "ds-swipe-item--read",
3433
+ r.value && "ds-swipe-item--deleting"
3434
+ ]),
3435
+ style: Q(h.value)
3436
+ }, [
3437
+ e.unread ? (a(), n("span", {
3438
+ key: 0,
3439
+ class: "ds-swipe-item__unread-bar",
3440
+ style: Q({ backgroundColor: B.value, opacity: e.read ? 0.3 : 1 }),
3441
+ "aria-hidden": "true"
3442
+ }, null, 4)) : v("", !0),
3443
+ e.actions.length > 0 ? (a(), n("div", {
3444
+ key: 1,
3445
+ class: "ds-swipe-item__actions",
3446
+ style: Q({ width: y.value })
3447
+ }, [
3448
+ (a(!0), n(U, null, H(e.actions, (z) => (a(), n("button", {
3449
+ key: z.id,
3450
+ class: I(["ds-swipe-item__action-btn", `ds-swipe-item__action-btn--${z.variant || "secondary"}`]),
3451
+ "aria-label": z.label,
3452
+ onClick: (N) => _(z.id)
3453
+ }, [
3454
+ z.icon ? (a(), E(R, {
3455
+ key: 0,
3456
+ name: z.icon,
3457
+ size: "sm"
3458
+ }, null, 8, ["name"])) : (a(), n("span", Ho, x(z.label), 1))
3459
+ ], 10, Ko))), 128))
3460
+ ], 4)) : v("", !0),
3461
+ m("div", {
3462
+ class: I(["ds-swipe-item__content", c.value && "ds-swipe-item__content--dragging"]),
3463
+ style: Q(u.value),
3464
+ tabindex: "0",
3465
+ role: "button",
3466
+ "aria-label": e.title,
3467
+ "aria-pressed": !e.unread || e.read,
3468
+ onPointerdown: q,
3469
+ onPointermove: k,
3470
+ onPointerup: S,
3471
+ onPointercancel: O,
3472
+ onKeydown: p
3473
+ }, [
3474
+ m("span", {
3475
+ class: "ds-swipe-item__icon-bg",
3476
+ style: Q({ backgroundColor: P.value, color: D.value })
3477
+ }, [
3478
+ e.image ? (a(), n("img", {
3479
+ key: 0,
3480
+ src: e.image,
3481
+ alt: e.title || "",
3482
+ class: "ds-swipe-item__image",
3483
+ loading: "lazy"
3484
+ }, null, 8, Go)) : e.icon ? (a(), E(R, {
3485
+ key: 1,
3486
+ name: e.icon,
3487
+ size: "sm",
3488
+ class: "ds-swipe-item__icon"
3489
+ }, null, 8, ["name"])) : v("", !0)
3490
+ ], 4),
3491
+ m("span", Yo, [
3492
+ e.title ? (a(), n("span", Xo, x(e.title), 1)) : v("", !0),
3493
+ e.description ? (a(), n("span", Zo, x(e.description), 1)) : v("", !0),
3494
+ e.timestamp ? (a(), n("span", Jo, [
3495
+ C(R, {
3496
+ name: "clock",
3497
+ size: "xs"
3498
+ }),
3499
+ X(" " + x(e.timestamp), 1)
3500
+ ])) : v("", !0)
3501
+ ])
3502
+ ], 46, Wo)
3503
+ ], 6));
3504
+ }
3505
+ }), ti = /* @__PURE__ */ L(ei, [["__scopeId", "data-v-89954b5e"]]), ai = { class: "ds-notification-panel" }, si = { class: "ds-notification-panel__list" }, li = /* @__PURE__ */ A({
3506
+ __name: "NotificationPanel",
3507
+ props: {
3508
+ items: {},
3509
+ viewMoreLabel: { default: "مشاهده بیشتر" }
3510
+ },
3511
+ emits: ["action", "view-more"],
3512
+ setup(e) {
3513
+ return (l, t) => (a(), n("div", ai, [
3514
+ m("div", si, [
3515
+ (a(!0), n(U, null, H(e.items, (s) => (a(), E(ti, Le({
3516
+ key: s.id
3517
+ }, { ref_for: !0 }, s, {
3518
+ onAction: t[0] || (t[0] = (i, o) => l.$emit("action", i, o))
3519
+ }), null, 16))), 128))
3520
+ ]),
3521
+ e.viewMoreLabel ? (a(), n("button", {
3522
+ key: 0,
3523
+ class: "ds-notification-panel__view-more",
3524
+ onClick: t[1] || (t[1] = (s) => l.$emit("view-more"))
3525
+ }, [
3526
+ m("span", null, x(e.viewMoreLabel), 1)
3527
+ ])) : v("", !0)
3528
+ ]));
3529
+ }
3530
+ }), ni = /* @__PURE__ */ L(li, [["__scopeId", "data-v-27533156"]]), oi = { class: "ds-notification-bell__inner" }, ii = {
3531
+ key: 0,
3532
+ class: "ds-notification-bell__dot"
3533
+ }, ri = {
3534
+ key: 0,
3535
+ class: "ds-notification-bell__panel"
3536
+ }, ci = /* @__PURE__ */ A({
3537
+ __name: "NotificationBell",
3538
+ props: {
3539
+ unread: { type: Boolean, default: !1 },
3540
+ size: { default: "md" },
3541
+ items: { default: () => [] },
3542
+ viewMoreLabel: { default: "مشاهده بیشتر" }
3543
+ },
3544
+ emits: ["read", "action", "view-more"],
3545
+ setup(e, { emit: l }) {
3546
+ const t = e, s = l, i = M(!1), o = M(null), c = g(() => {
3547
+ switch (t.size) {
3548
+ case "sm":
3549
+ return "sm";
3550
+ case "md":
3551
+ return "md";
3552
+ case "lg":
3553
+ return "button-lg";
3554
+ default:
3555
+ return "md";
3556
+ }
3557
+ });
3558
+ function r() {
3559
+ i.value = !i.value, i.value && s("read");
3560
+ }
3561
+ function d(u, h) {
3562
+ s("action", u, h);
3563
+ }
3564
+ function f(u) {
3565
+ const h = o.value;
3566
+ if (!h) return;
3567
+ const y = u.target;
3568
+ h.contains(y) || (i.value = !1);
3569
+ }
3570
+ return ee(() => {
3571
+ document.addEventListener("click", f);
3572
+ }), ne(() => {
3573
+ document.removeEventListener("click", f);
3574
+ }), (u, h) => (a(), n("div", {
3575
+ ref_key: "panelRef",
3576
+ ref: o,
3577
+ class: "ds-notification-bell"
3578
+ }, [
3579
+ m("button", {
3580
+ class: I(["ds-notification-bell__btn", `ds-notification-bell__btn--${e.size}`]),
3581
+ onClick: Y(r, ["stop"])
3582
+ }, [
3583
+ m("span", oi, [
3584
+ C(R, {
3585
+ name: "bell",
3586
+ size: c.value
3587
+ }, null, 8, ["size"]),
3588
+ e.unread ? (a(), n("span", ii)) : v("", !0)
3589
+ ])
3590
+ ], 2),
3591
+ i.value && e.items.length ? (a(), n("div", ri, [
3592
+ C(ni, {
3593
+ items: e.items,
3594
+ "view-more-label": e.viewMoreLabel,
3595
+ onAction: d,
3596
+ onViewMore: h[0] || (h[0] = (y) => u.$emit("view-more"))
3597
+ }, null, 8, ["items", "view-more-label"])
3598
+ ])) : v("", !0)
3599
+ ], 512));
3600
+ }
3601
+ }), di = /* @__PURE__ */ L(ci, [["__scopeId", "data-v-9020d9f1"]]), ui = { class: "ds-page-title" }, mi = { class: "ds-page-title__info" }, vi = { class: "ds-page-title__title" }, fi = {
3602
+ key: 0,
3603
+ class: "ds-page-title__subtitle"
3604
+ }, pi = /* @__PURE__ */ A({
3605
+ __name: "PageTitle",
3606
+ props: {
3607
+ title: {},
3608
+ subtitle: {},
3609
+ btnLabel: {},
3610
+ btnIcon: {}
3611
+ },
3612
+ emits: ["action"],
3613
+ setup(e) {
3614
+ return (l, t) => (a(), n("div", ui, [
3615
+ m("div", mi, [
3616
+ m("h1", vi, x(e.title), 1),
3617
+ e.subtitle ? (a(), n("p", fi, x(e.subtitle), 1)) : v("", !0)
3618
+ ]),
3619
+ e.btnLabel ? (a(), E(J, {
3620
+ key: 0,
3621
+ variant: "primary",
3622
+ icon: e.btnIcon,
3623
+ "icon-position": "start",
3624
+ label: e.btnLabel,
3625
+ onClick: t[0] || (t[0] = (s) => l.$emit("action"))
3626
+ }, null, 8, ["icon", "label"])) : v("", !0)
3627
+ ]));
3628
+ }
3629
+ }), bi = /* @__PURE__ */ L(pi, [["__scopeId", "data-v-b62aaf80"]]);
3630
+ function $i() {
3631
+ T.register("button", J), T.register("input", ve), T.register("icon", R), T.register("text", G), T.register("divider", Ne), T.register("badge", wa), T.register("avatar", re), T.register("select", ye), T.register("multi-select", Ua), T.register("checkbox", de), T.register("switch", Xa), T.register("form-field", ss), T.register("spacer", ns), T.register("textarea", us), T.register("stack", vs), T.register("row", ps), T.register("grid", hs), T.register("section", $s), T.register("card", As), T.register("table", Gl), T.register("table-cell", qe), T.register("side-panel", js), T.register("search-box", Zs), T.register("dropdown", Ce), T.register("menu", Fe), T.register("menu-item", ue), T.register("tooltip", ke), T.register("popover", dl), T.register("tabs", pl), T.register("filter-bar", Ql), T.register("pagination", sn), T.register("empty-state", cn), T.register("loading-state", je), T.register("autocomplete", yn), T.register("accordion", Vn), T.register("alert", On), T.register("progress", Kn), T.register("breadcrumb", Jn), T.register("chip", so), T.register("command-menu", ko), T.register("sidebar", Mo), T.register("user-card", He), T.register("action-toggle", No), T.register("toggle-button", jo), T.register("notification-bell", di), T.register("page-title", bi);
3632
+ }
3633
+ let we = null;
3634
+ function Ci(e) {
3635
+ we = e;
3636
+ }
3637
+ function fe() {
3638
+ if (!we)
3639
+ throw new Error("Config not loaded. Call loadConfig() first.");
3640
+ return we;
3641
+ }
3642
+ function xi() {
3643
+ return fe().direction.default;
3644
+ }
3645
+ function Si() {
3646
+ return fe().locale.default;
3647
+ }
3648
+ function Ii() {
3649
+ return fe().locale.supported;
3650
+ }
3651
+ function Vi(e) {
3652
+ var t, s;
3653
+ const l = fe().font;
3654
+ return e === "fa" && ((t = l.fa) != null && t.family) ? l.fa.family : (s = l.en) != null && s.family ? l.en.family : "IRANSansX";
3655
+ }
3656
+ function Bi(e) {
3657
+ return !e || typeof e != "object" ? !1 : typeof e.type == "string";
3658
+ }
3659
+ function hi(e) {
3660
+ return {
3661
+ ...e,
3662
+ props: e.props || {},
3663
+ children: e.children ? e.children.map(hi) : void 0,
3664
+ events: e.events || {}
3665
+ };
3666
+ }
3667
+ export {
3668
+ $i as bootstrapRegistry,
3669
+ fe as getConfig,
3670
+ Si as getDefaultLocale,
3671
+ xi as getDirection,
3672
+ Vi as getFontFamily,
3673
+ Ii as getSupportedLocales,
3674
+ kn as hasPermission,
3675
+ Ci as loadConfig,
3676
+ hi as normalizeSchema,
3677
+ T as registry,
3678
+ xe as runtimeContext,
3679
+ Oe as setLocale,
3680
+ wi as setUIDirection,
3681
+ ki as setUILocale,
3682
+ W as t,
3683
+ Re as useI18n,
3684
+ Bi as validateSchema
3685
+ };