@pnkx-lib/ui 1.9.537 → 1.9.540

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/es/index.js CHANGED
@@ -3,7 +3,7 @@ export { FloatButton } from './ui/FloatButton.js';
3
3
  export { CascaderField } from './ui/Cascader.js';
4
4
  export { ErrorMessage } from './ui/ErrorMessage.js';
5
5
  export { Typography } from './ui/Typography.js';
6
- export { ActionRowTable, BulkActions, Clock, CustomeBulkActions, Table, TableCategory, TableForm } from './ui/index.js';
6
+ export { Table } from './ui/Table/index.js';
7
7
  export { Modal } from './ui/Modal.js';
8
8
  export { Tooltip } from './ui/Tooltip.js';
9
9
  export { Tabs } from './ui/Tabs.js';
@@ -50,8 +50,10 @@ export { Image } from './ui/Image.js';
50
50
  export { ConfirmModal } from './ui/ConfirmModal.js';
51
51
  export { ErrorBoundary } from './ui/ErrorBoundary.js';
52
52
  export { CATEGORY_LIST_ENUM, CATEGORY_PRICE_LIST_ENUM, COUNT_LEVEL, CategoryStatus, badgeStatusCategoryConfig } from './ui/CategoryStatus.js';
53
+ export { ActionRowTable } from './ui/index.js';
53
54
  export { I as ID_TABLE_WRAPPER, a as MAX_TAG_COUNT, M as MAX_TAG_TEXT_LENGTH, T as TINY_API } from './chunks/common-BcURBmQ-.js';
54
- export { ListStatusApproved, PAGE_NUMBER, PAGE_SIZE, RemoveIconColor, SORT, START_PAGE, START_PAGE_SIZE, TypeActionRowTable, TypeBulkActions, TypeCategoryBulkActions, TypeStatusTable } from './constants/index.js';
55
+ export { L as ListStatusApproved, P as PAGE_NUMBER, b as PAGE_SIZE, R as RemoveIconColor, c as SORT, S as START_PAGE, a as START_PAGE_SIZE, T as TypeActionRowTable, d as TypeBulkActions, e as TypeCategoryBulkActions, f as TypeStatusTable } from './chunks/table-Btvh90Co.js';
56
+ export { BulkActions } from './ui/BulkActions/index.js';
55
57
  export { BreadcrumbHeading } from './ui/BreadcrumbHeading.js';
56
58
  export { Card } from './ui/Card.js';
57
59
  export { ConfigProvider } from './ui/ConfigProvider.js';
@@ -67,7 +69,11 @@ export { Sidebar } from './ui/Sidebar/index.js';
67
69
  export { SelectTable } from './ui/SelectTable.js';
68
70
  export { SelectSingleTable } from './ui/SelectSingleTable.js';
69
71
  export { GenericUploadModal } from './ui/GenericUploadModal.js';
72
+ export { TableCategory } from './ui/TableCategory/index.js';
73
+ export { TableForm } from './ui/TableForm/index.js';
70
74
  export { Descriptions } from './ui/Descriptions.js';
75
+ export { CustomeBulkActions } from './ui/CustomeBulkActions/index.js';
76
+ export { Clock } from './ui/Clock/index.js';
71
77
  export { Input } from './fields/Input.js';
72
78
  export { PnkxField } from './fields/PnkxField.js';
73
79
  export { Select } from './fields/Select.js';
@@ -0,0 +1,314 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import { useState } from 'react';
3
+ import { Tooltip } from '../Tooltip.js';
4
+ import { isEmpty, isBoolean } from 'lodash';
5
+ import { ConfirmModal } from '../ConfirmModal.js';
6
+ import { useToggle } from '@pnkx-lib/core';
7
+ import { CATEGORY_LIST_ENUM } from '../CategoryStatus.js';
8
+ import { t as twMerge } from '../../chunks/bundle-mjs-BME7zF0Z.js';
9
+ import { Popover } from '../Popover.js';
10
+ import { Tooltip as Tooltip$1 } from 'antd';
11
+ import { M as MoreIcon, R as RestoreIcon, S as SendApprovalIcon, C as CancelSendApprovalIcon, a as RefuseApprovalIcon, b as RefuseApprovalDropListIcon, A as ApprovalIcon, c as CancelApprovalIcon, D as DeleteIcon, d as ActivateIcon, I as InActiveIcon } from '../../chunks/RefuseApprovalDropListIcon-DkyYANWt.js';
12
+ import { d as TypeBulkActions } from '../../chunks/table-Btvh90Co.js';
13
+
14
+ const BulkAction = ({
15
+ quantity = 0,
16
+ listIcon,
17
+ status,
18
+ setNotifyContent,
19
+ toggle
20
+ }) => {
21
+ //! State
22
+ //! Function
23
+ const IsShow = (arrStatus) => {
24
+ return arrStatus.includes(status);
25
+ };
26
+ //! Render
27
+ return /* @__PURE__ */ jsx("div", { className: "w-full flex justify-center items-center", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 px-[10px] py-3 bg-[#2561ED] rounded-lg w-fit", children: [
28
+ /* @__PURE__ */ jsxs("div", { className: "text-white px-3", children: [
29
+ "Đã chọn: ",
30
+ quantity
31
+ ] }),
32
+ /* @__PURE__ */ jsx("div", { className: "h-5 border-l border-white mx-1" }),
33
+ /* @__PURE__ */ jsx("div", { className: "flex items-center space-x-3", children: !isEmpty(listIcon) && listIcon?.map(
34
+ (item, index) => IsShow(item?.arrShow) && /* @__PURE__ */ jsx(Tooltip, { title: item?.name, children: /* @__PURE__ */ jsx(
35
+ "button",
36
+ {
37
+ className: "p-1 rounded-sm transition duration-200 cursor-pointer hover:bg-[#1B4ACB] hover:rounded-sm",
38
+ onClick: () => {
39
+ toggle();
40
+ setNotifyContent({
41
+ title: item?.title || "",
42
+ content: item?.content || "",
43
+ typeIcon: item?.typeIcon,
44
+ handleCancel: () => {
45
+ toggle();
46
+ },
47
+ handleSubmit: () => {
48
+ if (item?.action) {
49
+ item?.action();
50
+ }
51
+ toggle();
52
+ }
53
+ });
54
+ },
55
+ children: item.icon
56
+ },
57
+ index
58
+ ) })
59
+ ) })
60
+ ] }) });
61
+ };
62
+
63
+ const DropListActions = ({
64
+ listIcon,
65
+ status,
66
+ setNotifyContent,
67
+ toggle,
68
+ contentDropList
69
+ }) => {
70
+ //! State
71
+ //! Function
72
+ const IsShow = (arrStatus) => {
73
+ return arrStatus.includes(status);
74
+ };
75
+ const renderContentPopover = () => {
76
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-col", children: !isEmpty(listIcon) && listIcon?.map(
77
+ (item, index) => item?.showTitle && IsShow(item?.arrShow) && /* @__PURE__ */ jsxs(
78
+ "button",
79
+ {
80
+ className: twMerge(
81
+ "flex gap-4 px-3 py-2 rounded-sm transition duration-200 hover:rounded-sm",
82
+ IsShow(item?.arrShow) ? "hover:bg-[#F5F6F7] cursor-pointer" : "text-[#B2B7C2] cursor-not-allowed"
83
+ ),
84
+ disabled: IsShow(item?.arrShow) ? false : true,
85
+ onClick: () => {
86
+ toggle();
87
+ setNotifyContent({
88
+ title: item?.title || "",
89
+ content: item?.content || "",
90
+ typeIcon: item?.typeIcon,
91
+ handleCancel: () => {
92
+ toggle();
93
+ },
94
+ handleSubmit: () => {
95
+ if (item?.action) {
96
+ item?.action();
97
+ }
98
+ toggle();
99
+ }
100
+ });
101
+ },
102
+ children: [
103
+ item.iconDropList,
104
+ /* @__PURE__ */ jsx("span", { children: item.name || "" })
105
+ ]
106
+ },
107
+ index
108
+ )
109
+ ) });
110
+ };
111
+ //! Render
112
+ return /* @__PURE__ */ jsx("div", { className: "w-full flex justify-center items-center", children: /* @__PURE__ */ jsx(Tooltip$1, { title: "Thao tác khác", children: /* @__PURE__ */ jsx(
113
+ Popover,
114
+ {
115
+ placement: "bottom",
116
+ content: renderContentPopover(),
117
+ trigger: "click",
118
+ children: contentDropList ? contentDropList : /* @__PURE__ */ jsx("div", { className: "p-1 border-[#BDE3FF] rounded-full border cursor-pointer", children: /* @__PURE__ */ jsx(MoreIcon, { fill: "#007BE5" }) })
119
+ }
120
+ ) }) });
121
+ };
122
+
123
+ const BulkActions = ({
124
+ quantity = 0,
125
+ handleDelete,
126
+ handleSubmitForApproval,
127
+ handleCancelSubmission,
128
+ handleApprove,
129
+ handleCancelApproval,
130
+ handleReject,
131
+ handleDeactivate,
132
+ handleActivate,
133
+ handleRestore,
134
+ status,
135
+ typeBulkaction,
136
+ isApproved,
137
+ // Chỉ sử dụng khi là danh sách icon
138
+ isShowDelete = false
139
+ }) => {
140
+ //! State
141
+ const listIcon = [
142
+ {
143
+ icon: /* @__PURE__ */ jsx(RestoreIcon, { stroke: "white" }),
144
+ iconDropList: /* @__PURE__ */ jsx(RestoreIcon, { stroke: "#0F1D40" }),
145
+ iconDisable: /* @__PURE__ */ jsx(RestoreIcon, { stroke: "#B2B7C2" }),
146
+ action: handleRestore,
147
+ name: "Khôi phục",
148
+ typeIcon: "info",
149
+ title: "Xác nhận khôi phục",
150
+ content: "Bạn có chắc chắn muốn khôi phục không?",
151
+ arrShow: [CATEGORY_LIST_ENUM?.DELETE, CATEGORY_LIST_ENUM?.REJECT],
152
+ showTitle: true
153
+ },
154
+ {
155
+ icon: /* @__PURE__ */ jsx(SendApprovalIcon, { stroke: "white" }),
156
+ iconDropList: /* @__PURE__ */ jsx(SendApprovalIcon, { stroke: "#0F1D40" }),
157
+ iconDisable: /* @__PURE__ */ jsx(SendApprovalIcon, { stroke: "#B2B7C2" }),
158
+ action: handleSubmitForApproval,
159
+ name: "Gửi duyệt",
160
+ typeIcon: "info",
161
+ title: "Xác nhận gửi duyệt",
162
+ content: "Bạn có chắc chắn muốn gửi duyệt không?",
163
+ arrShow: [CATEGORY_LIST_ENUM?.DRAFT],
164
+ showTitle: true
165
+ },
166
+ {
167
+ icon: /* @__PURE__ */ jsx(CancelSendApprovalIcon, { stroke: "white" }),
168
+ iconDropList: /* @__PURE__ */ jsx(CancelSendApprovalIcon, { stroke: "#0F1D40" }),
169
+ iconDisable: /* @__PURE__ */ jsx(CancelSendApprovalIcon, { stroke: "#B2B7C2" }),
170
+ action: handleCancelSubmission,
171
+ name: "Huỷ gửi duyệt",
172
+ typeIcon: "error",
173
+ title: "Xác nhận hủy gửi duyệt",
174
+ content: "Bạn có chắc chắn muốn hủy gửi duyệt không?",
175
+ arrShow: [CATEGORY_LIST_ENUM?.WATING_APPROVAL],
176
+ showTitle: true
177
+ },
178
+ {
179
+ icon: /* @__PURE__ */ jsx(RefuseApprovalIcon, { stroke: "white" }),
180
+ iconDropList: /* @__PURE__ */ jsx(RefuseApprovalDropListIcon, {}),
181
+ iconDisable: /* @__PURE__ */ jsx(RefuseApprovalIcon, { stroke: "#B2B7C2" }),
182
+ action: handleReject,
183
+ name: "Từ chối duyệt",
184
+ typeIcon: "error",
185
+ title: "Xác nhận từ chối duyệt",
186
+ content: "Bạn có chắc chắn muốn từ chối duyệt không? Hành động này không thể hoàn tác.",
187
+ arrShow: [CATEGORY_LIST_ENUM?.WATING_APPROVAL],
188
+ showTitle: true
189
+ },
190
+ {
191
+ icon: /* @__PURE__ */ jsx(ApprovalIcon, { stroke: "white" }),
192
+ iconDropList: /* @__PURE__ */ jsx(ApprovalIcon, { stroke: "#0F1D40" }),
193
+ iconDisable: /* @__PURE__ */ jsx(ApprovalIcon, { stroke: "#B2B7C2" }),
194
+ action: handleApprove,
195
+ name: "Duyệt",
196
+ typeIcon: "info",
197
+ title: "Xác nhận duyệt",
198
+ content: "Bạn có chắc chắn muốn duyệt không?",
199
+ arrShow: [CATEGORY_LIST_ENUM?.WATING_APPROVAL],
200
+ showTitle: true
201
+ },
202
+ {
203
+ icon: /* @__PURE__ */ jsx(CancelApprovalIcon, { stroke: "white" }),
204
+ iconDropList: /* @__PURE__ */ jsx(CancelApprovalIcon, { stroke: "#0F1D40" }),
205
+ iconDisable: /* @__PURE__ */ jsx(CancelApprovalIcon, { stroke: "#B2B7C2" }),
206
+ action: handleCancelApproval,
207
+ typeIcon: "error",
208
+ name: "Hủy duyệt",
209
+ title: "Xác nhận hủy duyệt",
210
+ content: "Bạn có chắc chắn muốn hủy duyệt không?",
211
+ arrShow: isBoolean(isApproved) && !isApproved ? [] : [CATEGORY_LIST_ENUM?.ACTIVE],
212
+ showTitle: true
213
+ },
214
+ {
215
+ icon: /* @__PURE__ */ jsx(DeleteIcon, { fill: "white" }),
216
+ iconDropList: /* @__PURE__ */ jsx(DeleteIcon, { fill: "#0F1D40" }),
217
+ iconDisable: /* @__PURE__ */ jsx(DeleteIcon, { fill: "#B2B7C2" }),
218
+ action: handleDelete,
219
+ typeIcon: "error",
220
+ name: "Xoá",
221
+ title: "Xác nhận xóa",
222
+ content: "Bạn có chắc chắn muốn xóa không? Hành động này không thể hoàn tác.",
223
+ arrShow: isShowDelete ? [
224
+ CATEGORY_LIST_ENUM?.DRAFT,
225
+ CATEGORY_LIST_ENUM?.ACTIVE,
226
+ CATEGORY_LIST_ENUM?.INACTIVE,
227
+ CATEGORY_LIST_ENUM?.REJECT,
228
+ CATEGORY_LIST_ENUM?.WATING_APPROVAL
229
+ ] : isBoolean(isApproved) && !isApproved ? [
230
+ CATEGORY_LIST_ENUM?.DRAFT,
231
+ CATEGORY_LIST_ENUM?.ACTIVE,
232
+ CATEGORY_LIST_ENUM?.INACTIVE
233
+ ] : [CATEGORY_LIST_ENUM?.DRAFT],
234
+ showTitle: isShowDelete
235
+ },
236
+ {
237
+ icon: /* @__PURE__ */ jsx(ActivateIcon, { stroke: "white" }),
238
+ iconDropList: /* @__PURE__ */ jsx(ActivateIcon, { stroke: "#0F1D40" }),
239
+ iconDisable: /* @__PURE__ */ jsx(ActivateIcon, { stroke: "#B2B7C2" }),
240
+ action: handleActivate,
241
+ typeIcon: "info",
242
+ name: "Kích hoạt",
243
+ title: "Xác nhận kích hoạt",
244
+ content: "Bạn có chắc chắn muốn kích hoạt không?",
245
+ arrShow: [CATEGORY_LIST_ENUM?.INACTIVE],
246
+ showTitle: true
247
+ },
248
+ {
249
+ icon: /* @__PURE__ */ jsx(InActiveIcon, { stroke: "white" }),
250
+ iconDropList: /* @__PURE__ */ jsx(InActiveIcon, { stroke: "#0F1D40" }),
251
+ iconDisable: /* @__PURE__ */ jsx(InActiveIcon, { stroke: "#B2B7C2" }),
252
+ action: handleDeactivate,
253
+ name: "Vô hiệu hóa",
254
+ typeIcon: "error",
255
+ title: "Xác nhận vô hiệu hóa",
256
+ content: "Bạn có chắc chắn muốn vô hiệu hóa không?",
257
+ arrShow: [CATEGORY_LIST_ENUM?.ACTIVE],
258
+ showTitle: true
259
+ }
260
+ ];
261
+ const { open, shouldRender, toggle } = useToggle();
262
+ const [notifyContent, setNotifyContent] = useState({
263
+ title: "",
264
+ content: "",
265
+ typeIcon: "info",
266
+ handleCancel: () => {
267
+ },
268
+ handleSubmit: () => {
269
+ }
270
+ });
271
+ //! Function
272
+ const renderBulkActions = () => {
273
+ switch (typeBulkaction) {
274
+ case TypeBulkActions.BULKACTION:
275
+ return /* @__PURE__ */ jsx(
276
+ BulkAction,
277
+ {
278
+ listIcon,
279
+ quantity,
280
+ setNotifyContent,
281
+ toggle,
282
+ status
283
+ }
284
+ );
285
+ case TypeBulkActions.DROPLIST:
286
+ return /* @__PURE__ */ jsx(
287
+ DropListActions,
288
+ {
289
+ listIcon,
290
+ setNotifyContent,
291
+ toggle,
292
+ status
293
+ }
294
+ );
295
+ }
296
+ };
297
+ //! Render
298
+ return /* @__PURE__ */ jsxs("div", { children: [
299
+ renderBulkActions(),
300
+ shouldRender && /* @__PURE__ */ jsx(
301
+ ConfirmModal,
302
+ {
303
+ title: notifyContent?.title,
304
+ content: notifyContent?.content,
305
+ typeIcon: notifyContent?.typeIcon,
306
+ open,
307
+ handleCancel: notifyContent?.handleCancel,
308
+ handleSubmit: notifyContent?.handleSubmit
309
+ }
310
+ )
311
+ ] });
312
+ };
313
+
314
+ export { BulkActions };
@@ -0,0 +1,67 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import { useEffect } from 'react';
3
+ import { g as getDefaultExportFromCjs } from '../../chunks/_commonjsHelpers-D5KtpA0t.js';
4
+ import { t as twMerge } from '../../chunks/bundle-mjs-BME7zF0Z.js';
5
+
6
+ var dayjs_min$1 = {exports: {}};
7
+
8
+ var dayjs_min = dayjs_min$1.exports;
9
+
10
+ var hasRequiredDayjs_min;
11
+
12
+ function requireDayjs_min () {
13
+ if (hasRequiredDayjs_min) return dayjs_min$1.exports;
14
+ hasRequiredDayjs_min = 1;
15
+ (function (module, exports) {
16
+ !function(t,e){module.exports=e();}(dayjs_min,(function(){var t=1e3,e=6e4,n=36e5,r="millisecond",i="second",s="minute",u="hour",a="day",o="week",c="month",f="quarter",h="year",d="date",l="Invalid Date",$=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return "["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return !r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return (e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return -t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,c),s=n-i<0,u=e.clone().add(r+(s?-1:1),c);return +(-(r+(n-i)/(s?i-u:u-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return {M:c,y:h,w:o,d:a,D:d,h:u,m:s,s:i,ms:r,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},g="en",D={};D[g]=M;var p="$isDayjsObject",S=function(t){return t instanceof _||!(!t||!t[p])},w=function t(e,n,r){var i;if(!e)return g;if("string"==typeof e){var s=e.toLowerCase();D[s]&&(i=s),n&&(D[s]=n,i=s);var u=e.split("-");if(!i&&u.length>1)return t(u[0])}else {var a=e.name;D[a]=e,i=a;}return !r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,true),this.parse(t),this.$x=this.$x||t.x||{},this[p]=true;}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init();},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds();},m.$utils=function(){return b},m.isValid=function(){return !(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<O(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,r=!!b.u(e)||e,f=b.p(t),l=function(t,e){var i=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return r?i:i.endOf(a)},$=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(r?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},y=this.$W,M=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(f){case h:return r?l(1,0):l(31,11);case c:return r?l(1,M):l(0,M+1);case o:var g=this.$locale().weekStart||0,D=(y<g?y+7:y)-g;return l(r?m-D:m+(6-D),M);case a:case d:return $(v+"Hours",0);case u:return $(v+"Minutes",1);case s:return $(v+"Seconds",2);case i:return $(v+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,false)},m.$set=function(t,e){var n,o=b.p(t),f="set"+(this.$u?"UTC":""),l=(n={},n[a]=f+"Date",n[d]=f+"Date",n[c]=f+"Month",n[h]=f+"FullYear",n[u]=f+"Hours",n[s]=f+"Minutes",n[i]=f+"Seconds",n[r]=f+"Milliseconds",n)[o],$=o===a?this.$D+(e-this.$W):e;if(o===c||o===h){var y=this.clone().set(d,1);y.$d[l]($),y.init(),this.$d=y.set(d,Math.min(this.$D,y.daysInMonth())).$d;}else l&&this.$d[l]($);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(r,f){var d,l=this;r=Number(r);var $=b.p(f),y=function(t){var e=O(l);return b.w(e.date(e.date()+Math.round(t*r)),l)};if($===c)return this.set(c,this.$M+r);if($===h)return this.set(h,this.$y+r);if($===a)return y(1);if($===o)return y(7);var M=(d={},d[s]=e,d[u]=n,d[i]=t,d)[$]||1,m=this.$d.getTime()+r*M;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,u=this.$m,a=this.$M,o=n.weekdays,c=n.months,f=n.meridiem,h=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},$=f||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r};return r.replace(y,(function(t,r){return r||function(t){switch(t){case "YY":return String(e.$y).slice(-2);case "YYYY":return b.s(e.$y,4,"0");case "M":return a+1;case "MM":return b.s(a+1,2,"0");case "MMM":return h(n.monthsShort,a,c,3);case "MMMM":return h(c,a);case "D":return e.$D;case "DD":return b.s(e.$D,2,"0");case "d":return String(e.$W);case "dd":return h(n.weekdaysMin,e.$W,o,2);case "ddd":return h(n.weekdaysShort,e.$W,o,3);case "dddd":return o[e.$W];case "H":return String(s);case "HH":return b.s(s,2,"0");case "h":return d(1);case "hh":return d(2);case "a":return $(s,u,true);case "A":return $(s,u,false);case "m":return String(u);case "mm":return b.s(u,2,"0");case "s":return String(e.$s);case "ss":return b.s(e.$s,2,"0");case "SSS":return b.s(e.$ms,3,"0");case "Z":return i}return null}(t)||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(r,d,l){var $,y=this,M=b.p(d),m=O(r),v=(m.utcOffset()-this.utcOffset())*e,g=this-m,D=function(){return b.m(y,m)};switch(M){case h:$=D()/12;break;case c:$=D();break;case f:$=D()/3;break;case o:$=(g-v)/6048e5;break;case a:$=(g-v)/864e5;break;case u:$=g/n;break;case s:$=g/e;break;case i:$=g/t;break;default:$=g;}return l?$:b.a($)},m.daysInMonth=function(){return this.endOf(c).$D},m.$locale=function(){return D[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,true);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},M}(),k=_.prototype;return O.prototype=k,[["$ms",r],["$s",i],["$m",s],["$H",u],["$W",a],["$M",c],["$y",h],["$D",d]].forEach((function(t){k[t[1]]=function(e){return this.$g(e,t[0],t[1])};})),O.extend=function(t,e){return t.$i||(t(e,_,O),t.$i=true),O},O.locale=w,O.isDayjs=S,O.unix=function(t){return O(1e3*t)},O.en=D[g],O.Ls=D,O.p={},O}));
17
+ } (dayjs_min$1));
18
+ return dayjs_min$1.exports;
19
+ }
20
+
21
+ var dayjs_minExports = /*@__PURE__*/ requireDayjs_min();
22
+ const dayjs = /*@__PURE__*/getDefaultExportFromCjs(dayjs_minExports);
23
+
24
+ const Clock = (props) => {
25
+ const { className } = props;
26
+ useEffect(() => {
27
+ const updateTime = () => {
28
+ const now = dayjs();
29
+ document.documentElement.style.setProperty(
30
+ "--timer-day",
31
+ `'${now.format("DD")}'`
32
+ );
33
+ document.documentElement.style.setProperty(
34
+ "--timer-months",
35
+ `'${now.format("MM")}'`
36
+ );
37
+ document.documentElement.style.setProperty(
38
+ "--timer-year",
39
+ `'${now.format("YYYY")}'`
40
+ );
41
+ document.documentElement.style.setProperty(
42
+ "--timer-hours",
43
+ `'${now.format("H")}'`
44
+ );
45
+ document.documentElement.style.setProperty(
46
+ "--timer-minutes",
47
+ `'${now.format("mm")}'`
48
+ );
49
+ document.documentElement.style.setProperty(
50
+ "--timer-seconds",
51
+ `'${now.format("ss")}'`
52
+ );
53
+ requestAnimationFrame(updateTime);
54
+ };
55
+ updateTime();
56
+ }, []);
57
+ return /* @__PURE__ */ jsxs("div", { className: twMerge("clock-container clock-container2", className), children: [
58
+ /* @__PURE__ */ jsx("div", { className: "clock-col", children: /* @__PURE__ */ jsx("p", { className: "clock-day", children: /* @__PURE__ */ jsx("span", { children: "/" }) }) }),
59
+ /* @__PURE__ */ jsx("div", { className: "clock-col", children: /* @__PURE__ */ jsx("p", { className: "clock-months", children: /* @__PURE__ */ jsx("span", { children: "/" }) }) }),
60
+ /* @__PURE__ */ jsx("div", { className: "clock-col", children: /* @__PURE__ */ jsx("p", { className: "clock-year !w-[85px]", children: /* @__PURE__ */ jsx("span", { children: " -- " }) }) }),
61
+ /* @__PURE__ */ jsx("div", { className: "clock-col", children: /* @__PURE__ */ jsx("p", { className: "clock-hours ", children: /* @__PURE__ */ jsx("span", { children: ":" }) }) }),
62
+ /* @__PURE__ */ jsx("div", { className: "clock-col", children: /* @__PURE__ */ jsx("p", { className: "clock-minutes ", children: /* @__PURE__ */ jsx("span", { children: ":" }) }) }),
63
+ /* @__PURE__ */ jsx("div", { className: "clock-col", children: /* @__PURE__ */ jsx("p", { className: "clock-seconds !w-[30px]" }) })
64
+ ] });
65
+ };
66
+
67
+ export { Clock };