@prefabs.tech/vue3-layout 0.13.0 → 0.15.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.
@@ -1,1904 +0,0 @@
1
- import { useI18n as Ke, LocaleSwitcher as re, prependMessages as Ye } from "@prefabs.tech/vue3-i18n";
2
- import { defineComponent as L, computed as N, createElementBlock as m, openBlock as d, createTextVNode as he, createElementVNode as S, toDisplayString as T, unref as b, renderSlot as f, createBlock as I, createCommentVNode as $, h as pe, resolveComponent as Ce, createVNode as C, withCtx as v, ref as j, normalizeClass as O, Transition as Me, Fragment as Ae, renderList as ie, useSlots as Ne, defineAsyncComponent as Je, shallowRef as Xe, markRaw as et, watch as X, resolveDynamicComponent as tt, createSlots as Te, onUnmounted as nt, inject as ot } from "vue";
3
- import { useConfig as le } from "@prefabs.tech/vue3-config";
4
- import { useWindowSize as st } from "@vueuse/core";
5
- import { ResponsiveMenu as rt } from "@prefabs.tech/vue3-ui";
6
- import { useRoute as ae, useRouter as je } from "vue-router";
7
- const it = { class: "copyright" }, lt = ["href"], at = {
8
- name: "Copyright"
9
- }, ct = /* @__PURE__ */ L({
10
- ...at,
11
- props: {
12
- holder: {
13
- required: !0,
14
- type: String
15
- },
16
- showDisclaimer: Boolean,
17
- url: {
18
- required: !0,
19
- type: String
20
- }
21
- },
22
- setup(e) {
23
- const t = e, n = so(), { t: s } = Ke({ messages: n }), o = N(() => t.showDisclaimer ? s("copyright.disclaimer") : null), r = (/* @__PURE__ */ new Date()).getFullYear();
24
- return (i, l) => (d(), m("div", it, [
25
- he(" © " + T(b(r)) + " ", 1),
26
- S("a", {
27
- href: e.url,
28
- target: "_blank"
29
- }, T(e.holder), 9, lt),
30
- he("  " + T(o.value), 1)
31
- ]));
32
- }
33
- }), ut = { class: "version" }, ft = {
34
- name: "AppFooter"
35
- }, ce = /* @__PURE__ */ L({
36
- ...ft,
37
- setup(e) {
38
- const t = le();
39
- return (n, s) => (d(), m("footer", null, [
40
- f(n.$slots, "copyright", {}, () => [
41
- b(t)?.copyright ? (d(), I(ct, {
42
- key: 0,
43
- holder: b(t).copyright.holder,
44
- url: b(t).copyright.url
45
- }, null, 8, ["holder", "url"])) : $("", !0)
46
- ]),
47
- f(n.$slots, "social"),
48
- f(n.$slots, "version", {}, () => [
49
- S("div", ut, T(b(t).appVersion), 1)
50
- ])
51
- ]));
52
- }
53
- }), Pe = /^[a-z0-9]+(-[a-z0-9]+)*$/, W = (e, t, n, s = "") => {
54
- const o = e.split(":");
55
- if (e.slice(0, 1) === "@") {
56
- if (o.length < 2 || o.length > 3)
57
- return null;
58
- s = o.shift().slice(1);
59
- }
60
- if (o.length > 3 || !o.length)
61
- return null;
62
- if (o.length > 1) {
63
- const l = o.pop(), a = o.pop(), u = {
64
- // Allow provider without '@': "provider:prefix:name"
65
- provider: o.length > 0 ? o[0] : s,
66
- prefix: a,
67
- name: l
68
- };
69
- return t && !V(u) ? null : u;
70
- }
71
- const r = o[0], i = r.split("-");
72
- if (i.length > 1) {
73
- const l = {
74
- provider: s,
75
- prefix: i.shift(),
76
- name: i.join("-")
77
- };
78
- return t && !V(l) ? null : l;
79
- }
80
- if (n && s === "") {
81
- const l = {
82
- provider: s,
83
- prefix: "",
84
- name: r
85
- };
86
- return t && !V(l, n) ? null : l;
87
- }
88
- return null;
89
- }, V = (e, t) => e ? !!// Check prefix: cannot be empty, unless allowSimpleName is enabled
90
- // Check name: cannot be empty
91
- ((t && e.prefix === "" || e.prefix) && e.name) : !1, Ee = Object.freeze(
92
- {
93
- left: 0,
94
- top: 0,
95
- width: 16,
96
- height: 16
97
- }
98
- ), G = Object.freeze({
99
- rotate: 0,
100
- vFlip: !1,
101
- hFlip: !1
102
- }), Z = Object.freeze({
103
- ...Ee,
104
- ...G
105
- }), ee = Object.freeze({
106
- ...Z,
107
- body: "",
108
- hidden: !1
109
- });
110
- function dt(e, t) {
111
- const n = {};
112
- !e.hFlip != !t.hFlip && (n.hFlip = !0), !e.vFlip != !t.vFlip && (n.vFlip = !0);
113
- const s = ((e.rotate || 0) + (t.rotate || 0)) % 4;
114
- return s && (n.rotate = s), n;
115
- }
116
- function me(e, t) {
117
- const n = dt(e, t);
118
- for (const s in ee)
119
- s in G ? s in e && !(s in n) && (n[s] = G[s]) : s in t ? n[s] = t[s] : s in e && (n[s] = e[s]);
120
- return n;
121
- }
122
- function ht(e, t) {
123
- const n = e.icons, s = e.aliases || /* @__PURE__ */ Object.create(null), o = /* @__PURE__ */ Object.create(null);
124
- function r(i) {
125
- if (n[i])
126
- return o[i] = [];
127
- if (!(i in o)) {
128
- o[i] = null;
129
- const l = s[i] && s[i].parent, a = l && r(l);
130
- a && (o[i] = [l].concat(a));
131
- }
132
- return o[i];
133
- }
134
- return Object.keys(n).concat(Object.keys(s)).forEach(r), o;
135
- }
136
- function pt(e, t, n) {
137
- const s = e.icons, o = e.aliases || /* @__PURE__ */ Object.create(null);
138
- let r = {};
139
- function i(l) {
140
- r = me(
141
- s[l] || o[l],
142
- r
143
- );
144
- }
145
- return i(t), n.forEach(i), me(e, r);
146
- }
147
- function Fe(e, t) {
148
- const n = [];
149
- if (typeof e != "object" || typeof e.icons != "object")
150
- return n;
151
- e.not_found instanceof Array && e.not_found.forEach((o) => {
152
- t(o, null), n.push(o);
153
- });
154
- const s = ht(e);
155
- for (const o in s) {
156
- const r = s[o];
157
- r && (t(o, pt(e, o, r)), n.push(o));
158
- }
159
- return n;
160
- }
161
- const mt = {
162
- provider: "",
163
- aliases: {},
164
- not_found: {},
165
- ...Ee
166
- };
167
- function Y(e, t) {
168
- for (const n in t)
169
- if (n in e && typeof e[n] != typeof t[n])
170
- return !1;
171
- return !0;
172
- }
173
- function Oe(e) {
174
- if (typeof e != "object" || e === null)
175
- return null;
176
- const t = e;
177
- if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !Y(e, mt))
178
- return null;
179
- const n = t.icons;
180
- for (const o in n) {
181
- const r = n[o];
182
- if (
183
- // Name cannot be empty
184
- !o || // Must have body
185
- typeof r.body != "string" || // Check other props
186
- !Y(
187
- r,
188
- ee
189
- )
190
- )
191
- return null;
192
- }
193
- const s = t.aliases || /* @__PURE__ */ Object.create(null);
194
- for (const o in s) {
195
- const r = s[o], i = r.parent;
196
- if (
197
- // Name cannot be empty
198
- !o || // Parent must be set and point to existing icon
199
- typeof i != "string" || !n[i] && !s[i] || // Check other props
200
- !Y(
201
- r,
202
- ee
203
- )
204
- )
205
- return null;
206
- }
207
- return t;
208
- }
209
- const ge = /* @__PURE__ */ Object.create(null);
210
- function gt(e, t) {
211
- return {
212
- provider: e,
213
- prefix: t,
214
- icons: /* @__PURE__ */ Object.create(null),
215
- missing: /* @__PURE__ */ new Set()
216
- };
217
- }
218
- function R(e, t) {
219
- const n = ge[e] || (ge[e] = /* @__PURE__ */ Object.create(null));
220
- return n[t] || (n[t] = gt(e, t));
221
- }
222
- function Re(e, t) {
223
- return Oe(t) ? Fe(t, (n, s) => {
224
- s ? e.icons[n] = s : e.missing.add(n);
225
- }) : [];
226
- }
227
- function yt(e, t, n) {
228
- try {
229
- if (typeof n.body == "string")
230
- return e.icons[t] = { ...n }, !0;
231
- } catch {
232
- }
233
- return !1;
234
- }
235
- let z = !1;
236
- function Be(e) {
237
- return typeof e == "boolean" && (z = e), z;
238
- }
239
- function vt(e) {
240
- const t = typeof e == "string" ? W(e, !0, z) : e;
241
- if (t) {
242
- const n = R(t.provider, t.prefix), s = t.name;
243
- return n.icons[s] || (n.missing.has(s) ? null : void 0);
244
- }
245
- }
246
- function bt(e, t) {
247
- const n = W(e, !0, z);
248
- if (!n)
249
- return !1;
250
- const s = R(n.provider, n.prefix);
251
- return t ? yt(s, n.name, t) : (s.missing.add(n.name), !0);
252
- }
253
- function wt(e, t) {
254
- if (typeof e != "object")
255
- return !1;
256
- if (typeof t != "string" && (t = e.provider || ""), z && !t && !e.prefix) {
257
- let o = !1;
258
- return Oe(e) && (e.prefix = "", Fe(e, (r, i) => {
259
- bt(r, i) && (o = !0);
260
- })), o;
261
- }
262
- const n = e.prefix;
263
- if (!V({
264
- prefix: n,
265
- name: "a"
266
- }))
267
- return !1;
268
- const s = R(t, n);
269
- return !!Re(s, e);
270
- }
271
- const De = Object.freeze({
272
- width: null,
273
- height: null
274
- }), He = Object.freeze({
275
- // Dimensions
276
- ...De,
277
- // Transformations
278
- ...G
279
- }), kt = /(-?[0-9.]*[0-9]+[0-9.]*)/g, $t = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
280
- function ye(e, t, n) {
281
- if (t === 1)
282
- return e;
283
- if (n = n || 100, typeof e == "number")
284
- return Math.ceil(e * t * n) / n;
285
- if (typeof e != "string")
286
- return e;
287
- const s = e.split(kt);
288
- if (s === null || !s.length)
289
- return e;
290
- const o = [];
291
- let r = s.shift(), i = $t.test(r);
292
- for (; ; ) {
293
- if (i) {
294
- const l = parseFloat(r);
295
- isNaN(l) ? o.push(r) : o.push(Math.ceil(l * t * n) / n);
296
- } else
297
- o.push(r);
298
- if (r = s.shift(), r === void 0)
299
- return o.join("");
300
- i = !i;
301
- }
302
- }
303
- function St(e, t = "defs") {
304
- let n = "";
305
- const s = e.indexOf("<" + t);
306
- for (; s >= 0; ) {
307
- const o = e.indexOf(">", s), r = e.indexOf("</" + t);
308
- if (o === -1 || r === -1)
309
- break;
310
- const i = e.indexOf(">", r);
311
- if (i === -1)
312
- break;
313
- n += e.slice(o + 1, r).trim(), e = e.slice(0, s).trim() + e.slice(i + 1);
314
- }
315
- return {
316
- defs: n,
317
- content: e
318
- };
319
- }
320
- function Lt(e, t) {
321
- return e ? "<defs>" + e + "</defs>" + t : t;
322
- }
323
- function _t(e, t, n) {
324
- const s = St(e);
325
- return Lt(s.defs, t + s.content + n);
326
- }
327
- const xt = (e) => e === "unset" || e === "undefined" || e === "none";
328
- function It(e, t) {
329
- const n = {
330
- ...Z,
331
- ...e
332
- }, s = {
333
- ...He,
334
- ...t
335
- }, o = {
336
- left: n.left,
337
- top: n.top,
338
- width: n.width,
339
- height: n.height
340
- };
341
- let r = n.body;
342
- [n, s].forEach((k) => {
343
- const h = [], F = k.hFlip, P = k.vFlip;
344
- let A = k.rotate;
345
- F ? P ? A += 2 : (h.push(
346
- "translate(" + (o.width + o.left).toString() + " " + (0 - o.top).toString() + ")"
347
- ), h.push("scale(-1 1)"), o.top = o.left = 0) : P && (h.push(
348
- "translate(" + (0 - o.left).toString() + " " + (o.height + o.top).toString() + ")"
349
- ), h.push("scale(1 -1)"), o.top = o.left = 0);
350
- let _;
351
- switch (A < 0 && (A -= Math.floor(A / 4) * 4), A = A % 4, A) {
352
- case 1:
353
- _ = o.height / 2 + o.top, h.unshift(
354
- "rotate(90 " + _.toString() + " " + _.toString() + ")"
355
- );
356
- break;
357
- case 2:
358
- h.unshift(
359
- "rotate(180 " + (o.width / 2 + o.left).toString() + " " + (o.height / 2 + o.top).toString() + ")"
360
- );
361
- break;
362
- case 3:
363
- _ = o.width / 2 + o.left, h.unshift(
364
- "rotate(-90 " + _.toString() + " " + _.toString() + ")"
365
- );
366
- break;
367
- }
368
- A % 2 === 1 && (o.left !== o.top && (_ = o.left, o.left = o.top, o.top = _), o.width !== o.height && (_ = o.width, o.width = o.height, o.height = _)), h.length && (r = _t(
369
- r,
370
- '<g transform="' + h.join(" ") + '">',
371
- "</g>"
372
- ));
373
- });
374
- const i = s.width, l = s.height, a = o.width, u = o.height;
375
- let c, p;
376
- i === null ? (p = l === null ? "1em" : l === "auto" ? u : l, c = ye(p, a / u)) : (c = i === "auto" ? a : i, p = l === null ? ye(c, u / a) : l === "auto" ? u : l);
377
- const g = {}, w = (k, h) => {
378
- xt(h) || (g[k] = h.toString());
379
- };
380
- w("width", c), w("height", p);
381
- const M = [o.left, o.top, a, u];
382
- return g.viewBox = M.join(" "), {
383
- attributes: g,
384
- viewBox: M,
385
- body: r
386
- };
387
- }
388
- const Ct = /\sid="(\S+)"/g, Mt = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
389
- let At = 0;
390
- function Nt(e, t = Mt) {
391
- const n = [];
392
- let s;
393
- for (; s = Ct.exec(e); )
394
- n.push(s[1]);
395
- if (!n.length)
396
- return e;
397
- const o = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
398
- return n.forEach((r) => {
399
- const i = typeof t == "function" ? t(r) : t + (At++).toString(), l = r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
400
- e = e.replace(
401
- // Allowed characters before id: [#;"]
402
- // Allowed characters after id: [)"], .[a-z]
403
- new RegExp('([#;"])(' + l + ')([")]|\\.[a-z])', "g"),
404
- "$1" + i + o + "$3"
405
- );
406
- }), e = e.replace(new RegExp(o, "g"), ""), e;
407
- }
408
- const te = /* @__PURE__ */ Object.create(null);
409
- function Tt(e, t) {
410
- te[e] = t;
411
- }
412
- function ne(e) {
413
- return te[e] || te[""];
414
- }
415
- function ue(e) {
416
- let t;
417
- if (typeof e.resources == "string")
418
- t = [e.resources];
419
- else if (t = e.resources, !(t instanceof Array) || !t.length)
420
- return null;
421
- return {
422
- // API hosts
423
- resources: t,
424
- // Root path
425
- path: e.path || "/",
426
- // URL length limit
427
- maxURL: e.maxURL || 500,
428
- // Timeout before next host is used.
429
- rotate: e.rotate || 750,
430
- // Timeout before failing query.
431
- timeout: e.timeout || 5e3,
432
- // Randomise default API end point.
433
- random: e.random === !0,
434
- // Start index
435
- index: e.index || 0,
436
- // Receive data after time out (used if time out kicks in first, then API module sends data anyway).
437
- dataAfterTimeout: e.dataAfterTimeout !== !1
438
- };
439
- }
440
- const fe = /* @__PURE__ */ Object.create(null), D = [
441
- "https://api.simplesvg.com",
442
- "https://api.unisvg.com"
443
- ], Q = [];
444
- for (; D.length > 0; )
445
- D.length === 1 || Math.random() > 0.5 ? Q.push(D.shift()) : Q.push(D.pop());
446
- fe[""] = ue({
447
- resources: ["https://api.iconify.design"].concat(Q)
448
- });
449
- function jt(e, t) {
450
- const n = ue(t);
451
- return n === null ? !1 : (fe[e] = n, !0);
452
- }
453
- function de(e) {
454
- return fe[e];
455
- }
456
- const Pt = () => {
457
- let e;
458
- try {
459
- if (e = fetch, typeof e == "function")
460
- return e;
461
- } catch {
462
- }
463
- };
464
- let ve = Pt();
465
- function Et(e, t) {
466
- const n = de(e);
467
- if (!n)
468
- return 0;
469
- let s;
470
- if (!n.maxURL)
471
- s = 0;
472
- else {
473
- let o = 0;
474
- n.resources.forEach((i) => {
475
- o = Math.max(o, i.length);
476
- });
477
- const r = t + ".json?icons=";
478
- s = n.maxURL - o - n.path.length - r.length;
479
- }
480
- return s;
481
- }
482
- function Ft(e) {
483
- return e === 404;
484
- }
485
- const Ot = (e, t, n) => {
486
- const s = [], o = Et(e, t), r = "icons";
487
- let i = {
488
- type: r,
489
- provider: e,
490
- prefix: t,
491
- icons: []
492
- }, l = 0;
493
- return n.forEach((a, u) => {
494
- l += a.length + 1, l >= o && u > 0 && (s.push(i), i = {
495
- type: r,
496
- provider: e,
497
- prefix: t,
498
- icons: []
499
- }, l = a.length), i.icons.push(a);
500
- }), s.push(i), s;
501
- };
502
- function Rt(e) {
503
- if (typeof e == "string") {
504
- const t = de(e);
505
- if (t)
506
- return t.path;
507
- }
508
- return "/";
509
- }
510
- const Bt = (e, t, n) => {
511
- if (!ve) {
512
- n("abort", 424);
513
- return;
514
- }
515
- let s = Rt(t.provider);
516
- switch (t.type) {
517
- case "icons": {
518
- const r = t.prefix, l = t.icons.join(","), a = new URLSearchParams({
519
- icons: l
520
- });
521
- s += r + ".json?" + a.toString();
522
- break;
523
- }
524
- case "custom": {
525
- const r = t.uri;
526
- s += r.slice(0, 1) === "/" ? r.slice(1) : r;
527
- break;
528
- }
529
- default:
530
- n("abort", 400);
531
- return;
532
- }
533
- let o = 503;
534
- ve(e + s).then((r) => {
535
- const i = r.status;
536
- if (i !== 200) {
537
- setTimeout(() => {
538
- n(Ft(i) ? "abort" : "next", i);
539
- });
540
- return;
541
- }
542
- return o = 501, r.json();
543
- }).then((r) => {
544
- if (typeof r != "object" || r === null) {
545
- setTimeout(() => {
546
- r === 404 ? n("abort", r) : n("next", o);
547
- });
548
- return;
549
- }
550
- setTimeout(() => {
551
- n("success", r);
552
- });
553
- }).catch(() => {
554
- n("next", o);
555
- });
556
- }, Dt = {
557
- prepare: Ot,
558
- send: Bt
559
- };
560
- function Ht(e) {
561
- const t = {
562
- loaded: [],
563
- missing: [],
564
- pending: []
565
- }, n = /* @__PURE__ */ Object.create(null);
566
- e.sort((o, r) => o.provider !== r.provider ? o.provider.localeCompare(r.provider) : o.prefix !== r.prefix ? o.prefix.localeCompare(r.prefix) : o.name.localeCompare(r.name));
567
- let s = {
568
- provider: "",
569
- prefix: "",
570
- name: ""
571
- };
572
- return e.forEach((o) => {
573
- if (s.name === o.name && s.prefix === o.prefix && s.provider === o.provider)
574
- return;
575
- s = o;
576
- const r = o.provider, i = o.prefix, l = o.name, a = n[r] || (n[r] = /* @__PURE__ */ Object.create(null)), u = a[i] || (a[i] = R(r, i));
577
- let c;
578
- l in u.icons ? c = t.loaded : i === "" || u.missing.has(l) ? c = t.missing : c = t.pending;
579
- const p = {
580
- provider: r,
581
- prefix: i,
582
- name: l
583
- };
584
- c.push(p);
585
- }), t;
586
- }
587
- function ze(e, t) {
588
- e.forEach((n) => {
589
- const s = n.loaderCallbacks;
590
- s && (n.loaderCallbacks = s.filter((o) => o.id !== t));
591
- });
592
- }
593
- function zt(e) {
594
- e.pendingCallbacksFlag || (e.pendingCallbacksFlag = !0, setTimeout(() => {
595
- e.pendingCallbacksFlag = !1;
596
- const t = e.loaderCallbacks ? e.loaderCallbacks.slice(0) : [];
597
- if (!t.length)
598
- return;
599
- let n = !1;
600
- const s = e.provider, o = e.prefix;
601
- t.forEach((r) => {
602
- const i = r.icons, l = i.pending.length;
603
- i.pending = i.pending.filter((a) => {
604
- if (a.prefix !== o)
605
- return !0;
606
- const u = a.name;
607
- if (e.icons[u])
608
- i.loaded.push({
609
- provider: s,
610
- prefix: o,
611
- name: u
612
- });
613
- else if (e.missing.has(u))
614
- i.missing.push({
615
- provider: s,
616
- prefix: o,
617
- name: u
618
- });
619
- else
620
- return n = !0, !0;
621
- return !1;
622
- }), i.pending.length !== l && (n || ze([e], r.id), r.callback(
623
- i.loaded.slice(0),
624
- i.missing.slice(0),
625
- i.pending.slice(0),
626
- r.abort
627
- ));
628
- });
629
- }));
630
- }
631
- let qt = 0;
632
- function Vt(e, t, n) {
633
- const s = qt++, o = ze.bind(null, n, s);
634
- if (!t.pending.length)
635
- return o;
636
- const r = {
637
- id: s,
638
- icons: t,
639
- callback: e,
640
- abort: o
641
- };
642
- return n.forEach((i) => {
643
- (i.loaderCallbacks || (i.loaderCallbacks = [])).push(r);
644
- }), o;
645
- }
646
- function Qt(e, t = !0, n = !1) {
647
- const s = [];
648
- return e.forEach((o) => {
649
- const r = typeof o == "string" ? W(o, t, n) : o;
650
- r && s.push(r);
651
- }), s;
652
- }
653
- var Ut = {
654
- resources: [],
655
- index: 0,
656
- timeout: 2e3,
657
- rotate: 750,
658
- random: !1,
659
- dataAfterTimeout: !1
660
- };
661
- function Gt(e, t, n, s) {
662
- const o = e.resources.length, r = e.random ? Math.floor(Math.random() * o) : e.index;
663
- let i;
664
- if (e.random) {
665
- let y = e.resources.slice(0);
666
- for (i = []; y.length > 1; ) {
667
- const x = Math.floor(Math.random() * y.length);
668
- i.push(y[x]), y = y.slice(0, x).concat(y.slice(x + 1));
669
- }
670
- i = i.concat(y);
671
- } else
672
- i = e.resources.slice(r).concat(e.resources.slice(0, r));
673
- const l = Date.now();
674
- let a = "pending", u = 0, c, p = null, g = [], w = [];
675
- typeof s == "function" && w.push(s);
676
- function M() {
677
- p && (clearTimeout(p), p = null);
678
- }
679
- function k() {
680
- a === "pending" && (a = "aborted"), M(), g.forEach((y) => {
681
- y.status === "pending" && (y.status = "aborted");
682
- }), g = [];
683
- }
684
- function h(y, x) {
685
- x && (w = []), typeof y == "function" && w.push(y);
686
- }
687
- function F() {
688
- return {
689
- startTime: l,
690
- payload: t,
691
- status: a,
692
- queriesSent: u,
693
- queriesPending: g.length,
694
- subscribe: h,
695
- abort: k
696
- };
697
- }
698
- function P() {
699
- a = "failed", w.forEach((y) => {
700
- y(void 0, c);
701
- });
702
- }
703
- function A() {
704
- g.forEach((y) => {
705
- y.status === "pending" && (y.status = "aborted");
706
- }), g = [];
707
- }
708
- function _(y, x, B) {
709
- const q = x !== "success";
710
- switch (g = g.filter((E) => E !== y), a) {
711
- case "pending":
712
- break;
713
- case "failed":
714
- if (q || !e.dataAfterTimeout)
715
- return;
716
- break;
717
- default:
718
- return;
719
- }
720
- if (x === "abort") {
721
- c = B, P();
722
- return;
723
- }
724
- if (q) {
725
- c = B, g.length || (i.length ? K() : P());
726
- return;
727
- }
728
- if (M(), A(), !e.random) {
729
- const E = e.resources.indexOf(y.resource);
730
- E !== -1 && E !== e.index && (e.index = E);
731
- }
732
- a = "completed", w.forEach((E) => {
733
- E(B);
734
- });
735
- }
736
- function K() {
737
- if (a !== "pending")
738
- return;
739
- M();
740
- const y = i.shift();
741
- if (y === void 0) {
742
- if (g.length) {
743
- p = setTimeout(() => {
744
- M(), a === "pending" && (A(), P());
745
- }, e.timeout);
746
- return;
747
- }
748
- P();
749
- return;
750
- }
751
- const x = {
752
- status: "pending",
753
- resource: y,
754
- callback: (B, q) => {
755
- _(x, B, q);
756
- }
757
- };
758
- g.push(x), u++, p = setTimeout(K, e.rotate), n(y, t, x.callback);
759
- }
760
- return setTimeout(K), F;
761
- }
762
- function qe(e) {
763
- const t = {
764
- ...Ut,
765
- ...e
766
- };
767
- let n = [];
768
- function s() {
769
- n = n.filter((l) => l().status === "pending");
770
- }
771
- function o(l, a, u) {
772
- const c = Gt(
773
- t,
774
- l,
775
- a,
776
- (p, g) => {
777
- s(), u && u(p, g);
778
- }
779
- );
780
- return n.push(c), c;
781
- }
782
- function r(l) {
783
- return n.find((a) => l(a)) || null;
784
- }
785
- return {
786
- query: o,
787
- find: r,
788
- setIndex: (l) => {
789
- t.index = l;
790
- },
791
- getIndex: () => t.index,
792
- cleanup: s
793
- };
794
- }
795
- function be() {
796
- }
797
- const J = /* @__PURE__ */ Object.create(null);
798
- function Wt(e) {
799
- if (!J[e]) {
800
- const t = de(e);
801
- if (!t)
802
- return;
803
- const n = qe(t), s = {
804
- config: t,
805
- redundancy: n
806
- };
807
- J[e] = s;
808
- }
809
- return J[e];
810
- }
811
- function Zt(e, t, n) {
812
- let s, o;
813
- if (typeof e == "string") {
814
- const r = ne(e);
815
- if (!r)
816
- return n(void 0, 424), be;
817
- o = r.send;
818
- const i = Wt(e);
819
- i && (s = i.redundancy);
820
- } else {
821
- const r = ue(e);
822
- if (r) {
823
- s = qe(r);
824
- const i = e.resources ? e.resources[0] : "", l = ne(i);
825
- l && (o = l.send);
826
- }
827
- }
828
- return !s || !o ? (n(void 0, 424), be) : s.query(t, o, n)().abort;
829
- }
830
- function we() {
831
- }
832
- function Kt(e) {
833
- e.iconsLoaderFlag || (e.iconsLoaderFlag = !0, setTimeout(() => {
834
- e.iconsLoaderFlag = !1, zt(e);
835
- }));
836
- }
837
- function Yt(e) {
838
- const t = [], n = [];
839
- return e.forEach((s) => {
840
- (s.match(Pe) ? t : n).push(s);
841
- }), {
842
- valid: t,
843
- invalid: n
844
- };
845
- }
846
- function H(e, t, n) {
847
- function s() {
848
- const o = e.pendingIcons;
849
- t.forEach((r) => {
850
- o && o.delete(r), e.icons[r] || e.missing.add(r);
851
- });
852
- }
853
- if (n && typeof n == "object")
854
- try {
855
- if (!Re(e, n).length) {
856
- s();
857
- return;
858
- }
859
- } catch (o) {
860
- console.error(o);
861
- }
862
- s(), Kt(e);
863
- }
864
- function ke(e, t) {
865
- e instanceof Promise ? e.then((n) => {
866
- t(n);
867
- }).catch(() => {
868
- t(null);
869
- }) : t(e);
870
- }
871
- function Jt(e, t) {
872
- e.iconsToLoad ? e.iconsToLoad = e.iconsToLoad.concat(t).sort() : e.iconsToLoad = t, e.iconsQueueFlag || (e.iconsQueueFlag = !0, setTimeout(() => {
873
- e.iconsQueueFlag = !1;
874
- const { provider: n, prefix: s } = e, o = e.iconsToLoad;
875
- if (delete e.iconsToLoad, !o || !o.length)
876
- return;
877
- const r = e.loadIcon;
878
- if (e.loadIcons && (o.length > 1 || !r)) {
879
- ke(
880
- e.loadIcons(o, s, n),
881
- (c) => {
882
- H(e, o, c);
883
- }
884
- );
885
- return;
886
- }
887
- if (r) {
888
- o.forEach((c) => {
889
- const p = r(c, s, n);
890
- ke(p, (g) => {
891
- const w = g ? {
892
- prefix: s,
893
- icons: {
894
- [c]: g
895
- }
896
- } : null;
897
- H(e, [c], w);
898
- });
899
- });
900
- return;
901
- }
902
- const { valid: i, invalid: l } = Yt(o);
903
- if (l.length && H(e, l, null), !i.length)
904
- return;
905
- const a = s.match(Pe) ? ne(n) : null;
906
- if (!a) {
907
- H(e, i, null);
908
- return;
909
- }
910
- a.prepare(n, s, i).forEach((c) => {
911
- Zt(n, c, (p) => {
912
- H(e, c.icons, p);
913
- });
914
- });
915
- }));
916
- }
917
- const Xt = (e, t) => {
918
- const n = Qt(e, !0, Be()), s = Ht(n);
919
- if (!s.pending.length) {
920
- let a = !0;
921
- return t && setTimeout(() => {
922
- a && t(
923
- s.loaded,
924
- s.missing,
925
- s.pending,
926
- we
927
- );
928
- }), () => {
929
- a = !1;
930
- };
931
- }
932
- const o = /* @__PURE__ */ Object.create(null), r = [];
933
- let i, l;
934
- return s.pending.forEach((a) => {
935
- const { provider: u, prefix: c } = a;
936
- if (c === l && u === i)
937
- return;
938
- i = u, l = c, r.push(R(u, c));
939
- const p = o[u] || (o[u] = /* @__PURE__ */ Object.create(null));
940
- p[c] || (p[c] = []);
941
- }), s.pending.forEach((a) => {
942
- const { provider: u, prefix: c, name: p } = a, g = R(u, c), w = g.pendingIcons || (g.pendingIcons = /* @__PURE__ */ new Set());
943
- w.has(p) || (w.add(p), o[u][c].push(p));
944
- }), r.forEach((a) => {
945
- const u = o[a.provider][a.prefix];
946
- u.length && Jt(a, u);
947
- }), t ? Vt(t, s, r) : we;
948
- };
949
- function en(e, t) {
950
- const n = {
951
- ...e
952
- };
953
- for (const s in t) {
954
- const o = t[s], r = typeof o;
955
- s in De ? (o === null || o && (r === "string" || r === "number")) && (n[s] = o) : r === typeof n[s] && (n[s] = s === "rotate" ? o % 4 : o);
956
- }
957
- return n;
958
- }
959
- const tn = /[\s,]+/;
960
- function nn(e, t) {
961
- t.split(tn).forEach((n) => {
962
- switch (n.trim()) {
963
- case "horizontal":
964
- e.hFlip = !0;
965
- break;
966
- case "vertical":
967
- e.vFlip = !0;
968
- break;
969
- }
970
- });
971
- }
972
- function on(e, t = 0) {
973
- const n = e.replace(/^-?[0-9.]*/, "");
974
- function s(o) {
975
- for (; o < 0; )
976
- o += 4;
977
- return o % 4;
978
- }
979
- if (n === "") {
980
- const o = parseInt(e);
981
- return isNaN(o) ? 0 : s(o);
982
- } else if (n !== e) {
983
- let o = 0;
984
- switch (n) {
985
- case "%":
986
- o = 25;
987
- break;
988
- case "deg":
989
- o = 90;
990
- }
991
- if (o) {
992
- let r = parseFloat(e.slice(0, e.length - n.length));
993
- return isNaN(r) ? 0 : (r = r / o, r % 1 === 0 ? s(r) : 0);
994
- }
995
- }
996
- return t;
997
- }
998
- function sn(e, t) {
999
- let n = e.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
1000
- for (const s in t)
1001
- n += " " + s + '="' + t[s] + '"';
1002
- return '<svg xmlns="http://www.w3.org/2000/svg"' + n + ">" + e + "</svg>";
1003
- }
1004
- function rn(e) {
1005
- return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
1006
- }
1007
- function ln(e) {
1008
- return "data:image/svg+xml," + rn(e);
1009
- }
1010
- function an(e) {
1011
- return 'url("' + ln(e) + '")';
1012
- }
1013
- const $e = {
1014
- ...He,
1015
- inline: !1
1016
- }, cn = {
1017
- xmlns: "http://www.w3.org/2000/svg",
1018
- "xmlns:xlink": "http://www.w3.org/1999/xlink",
1019
- "aria-hidden": !0,
1020
- role: "img"
1021
- }, un = {
1022
- display: "inline-block"
1023
- }, oe = {
1024
- backgroundColor: "currentColor"
1025
- }, Ve = {
1026
- backgroundColor: "transparent"
1027
- }, Se = {
1028
- Image: "var(--svg)",
1029
- Repeat: "no-repeat",
1030
- Size: "100% 100%"
1031
- }, Le = {
1032
- webkitMask: oe,
1033
- mask: oe,
1034
- background: Ve
1035
- };
1036
- for (const e in Le) {
1037
- const t = Le[e];
1038
- for (const n in Se)
1039
- t[e + n] = Se[n];
1040
- }
1041
- const U = {};
1042
- ["horizontal", "vertical"].forEach((e) => {
1043
- const t = e.slice(0, 1) + "Flip";
1044
- U[e + "-flip"] = t, U[e.slice(0, 1) + "-flip"] = t, U[e + "Flip"] = t;
1045
- });
1046
- function _e(e) {
1047
- return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
1048
- }
1049
- const xe = (e, t) => {
1050
- const n = en($e, t), s = { ...cn }, o = t.mode || "svg", r = {}, i = t.style, l = typeof i == "object" && !(i instanceof Array) ? i : {};
1051
- for (let k in t) {
1052
- const h = t[k];
1053
- if (h !== void 0)
1054
- switch (k) {
1055
- // Properties to ignore
1056
- case "icon":
1057
- case "style":
1058
- case "onLoad":
1059
- case "mode":
1060
- case "ssr":
1061
- break;
1062
- // Boolean attributes
1063
- case "inline":
1064
- case "hFlip":
1065
- case "vFlip":
1066
- n[k] = h === !0 || h === "true" || h === 1;
1067
- break;
1068
- // Flip as string: 'horizontal,vertical'
1069
- case "flip":
1070
- typeof h == "string" && nn(n, h);
1071
- break;
1072
- // Color: override style
1073
- case "color":
1074
- r.color = h;
1075
- break;
1076
- // Rotation as string
1077
- case "rotate":
1078
- typeof h == "string" ? n[k] = on(h) : typeof h == "number" && (n[k] = h);
1079
- break;
1080
- // Remove aria-hidden
1081
- case "ariaHidden":
1082
- case "aria-hidden":
1083
- h !== !0 && h !== "true" && delete s["aria-hidden"];
1084
- break;
1085
- default: {
1086
- const F = U[k];
1087
- F ? (h === !0 || h === "true" || h === 1) && (n[F] = !0) : $e[k] === void 0 && (s[k] = h);
1088
- }
1089
- }
1090
- }
1091
- const a = It(e, n), u = a.attributes;
1092
- if (n.inline && (r.verticalAlign = "-0.125em"), o === "svg") {
1093
- s.style = {
1094
- ...r,
1095
- ...l
1096
- }, Object.assign(s, u);
1097
- let k = 0, h = t.id;
1098
- return typeof h == "string" && (h = h.replace(/-/g, "_")), s.innerHTML = Nt(a.body, h ? () => h + "ID" + k++ : "iconifyVue"), pe("svg", s);
1099
- }
1100
- const { body: c, width: p, height: g } = e, w = o === "mask" || (o === "bg" ? !1 : c.indexOf("currentColor") !== -1), M = sn(c, {
1101
- ...u,
1102
- width: p + "",
1103
- height: g + ""
1104
- });
1105
- return s.style = {
1106
- ...r,
1107
- "--svg": an(M),
1108
- width: _e(u.width),
1109
- height: _e(u.height),
1110
- ...un,
1111
- ...w ? oe : Ve,
1112
- ...l
1113
- }, pe("span", s);
1114
- };
1115
- Be(!0);
1116
- Tt("", Dt);
1117
- if (typeof document < "u" && typeof window < "u") {
1118
- const e = window;
1119
- if (e.IconifyPreload !== void 0) {
1120
- const t = e.IconifyPreload, n = "Invalid IconifyPreload syntax.";
1121
- typeof t == "object" && t !== null && (t instanceof Array ? t : [t]).forEach((s) => {
1122
- try {
1123
- // Check if item is an object and not null/array
1124
- (typeof s != "object" || s === null || s instanceof Array || // Check for 'icons' and 'prefix'
1125
- typeof s.icons != "object" || typeof s.prefix != "string" || // Add icon set
1126
- !wt(s)) && console.error(n);
1127
- } catch {
1128
- console.error(n);
1129
- }
1130
- });
1131
- }
1132
- if (e.IconifyProviders !== void 0) {
1133
- const t = e.IconifyProviders;
1134
- if (typeof t == "object" && t !== null)
1135
- for (let n in t) {
1136
- const s = "IconifyProviders[" + n + "] is invalid.";
1137
- try {
1138
- const o = t[n];
1139
- if (typeof o != "object" || !o || o.resources === void 0)
1140
- continue;
1141
- jt(n, o) || console.error(s);
1142
- } catch {
1143
- console.error(s);
1144
- }
1145
- }
1146
- }
1147
- }
1148
- const fn = {
1149
- ...Z,
1150
- body: ""
1151
- }, Ie = L({
1152
- // Do not inherit other attributes: it is handled by render()
1153
- inheritAttrs: !1,
1154
- // Set initial data
1155
- data() {
1156
- return {
1157
- // Current icon name
1158
- _name: "",
1159
- // Loading
1160
- _loadingIcon: null,
1161
- // Mounted status
1162
- iconMounted: !1,
1163
- // Callback counter to trigger re-render
1164
- counter: 0
1165
- };
1166
- },
1167
- mounted() {
1168
- this.iconMounted = !0;
1169
- },
1170
- unmounted() {
1171
- this.abortLoading();
1172
- },
1173
- methods: {
1174
- abortLoading() {
1175
- this._loadingIcon && (this._loadingIcon.abort(), this._loadingIcon = null);
1176
- },
1177
- // Get data for icon to render or null
1178
- getIcon(e, t, n) {
1179
- if (typeof e == "object" && e !== null && typeof e.body == "string")
1180
- return this._name = "", this.abortLoading(), {
1181
- data: e
1182
- };
1183
- let s;
1184
- if (typeof e != "string" || (s = W(e, !1, !0)) === null)
1185
- return this.abortLoading(), null;
1186
- let o = vt(s);
1187
- if (!o)
1188
- return (!this._loadingIcon || this._loadingIcon.name !== e) && (this.abortLoading(), this._name = "", o !== null && (this._loadingIcon = {
1189
- name: e,
1190
- abort: Xt([s], () => {
1191
- this.counter++;
1192
- })
1193
- })), null;
1194
- if (this.abortLoading(), this._name !== e && (this._name = e, t && t(e)), n) {
1195
- o = Object.assign({}, o);
1196
- const i = n(o.body, s.name, s.prefix, s.provider);
1197
- typeof i == "string" && (o.body = i);
1198
- }
1199
- const r = ["iconify"];
1200
- return s.prefix !== "" && r.push("iconify--" + s.prefix), s.provider !== "" && r.push("iconify--" + s.provider), { data: o, classes: r };
1201
- }
1202
- },
1203
- // Render icon
1204
- render() {
1205
- this.counter;
1206
- const e = this.$attrs, t = this.iconMounted || e.ssr ? this.getIcon(e.icon, e.onLoad, e.customise) : null;
1207
- if (!t)
1208
- return xe(fn, e);
1209
- let n = e;
1210
- return t.classes && (n = {
1211
- ...e,
1212
- class: (typeof e.class == "string" ? e.class + " " : "") + t.classes.join(" ")
1213
- }), xe({
1214
- ...Z,
1215
- ...t.data
1216
- }, n);
1217
- }
1218
- }), dn = { class: "logo" }, hn = ["alt", "src"], pn = {
1219
- key: 1,
1220
- class: "logo-default"
1221
- }, mn = {
1222
- name: "Logo"
1223
- }, Qe = /* @__PURE__ */ L({
1224
- ...mn,
1225
- props: {
1226
- alt: {
1227
- default: void 0,
1228
- type: String
1229
- },
1230
- route: {
1231
- default: void 0,
1232
- type: String
1233
- },
1234
- src: {
1235
- default: void 0,
1236
- type: String
1237
- }
1238
- },
1239
- setup(e) {
1240
- const t = e, { appName: n, appTitle: s, layout: o } = le(), r = N(() => {
1241
- if (n)
1242
- return n.replace("@", "").replace("/", " ");
1243
- }), i = t.alt || o?.logoAlt || r.value || s || "My App", l = t.src || o?.logo, a = t.route || o?.logoRoute || "home";
1244
- return (u, c) => {
1245
- const p = Ce("router-link");
1246
- return d(), m("div", dn, [
1247
- f(u.$slots, "default", {}, () => [
1248
- C(p, {
1249
- to: { name: b(a) }
1250
- }, {
1251
- default: v(() => [
1252
- b(l) ? (d(), m("img", {
1253
- key: 0,
1254
- alt: b(i),
1255
- src: b(l)
1256
- }, null, 8, hn)) : (d(), m("span", pn, [
1257
- S("span", null, T(b(i)[0]), 1),
1258
- S("span", null, T(b(i)), 1)
1259
- ]))
1260
- ]),
1261
- _: 1
1262
- }, 8, ["to"])
1263
- ])
1264
- ]);
1265
- };
1266
- }
1267
- }), gn = {
1268
- name: "MainMenu"
1269
- }, yn = /* @__PURE__ */ L({
1270
- ...gn,
1271
- props: {
1272
- routes: {
1273
- required: !0,
1274
- type: Array
1275
- }
1276
- },
1277
- emits: ["close"],
1278
- setup(e) {
1279
- const t = e, n = ae(), s = je(), o = N(() => {
1280
- let l = t.routes?.find(
1281
- (a) => a.route === n?.name
1282
- )?.route;
1283
- return l || (l = r.value), l;
1284
- }), r = N(() => {
1285
- const l = n?.matched;
1286
- if (l?.length > 1) {
1287
- const a = l[l.length - 2];
1288
- return i(a?.path);
1289
- }
1290
- return "";
1291
- }), i = (l) => {
1292
- const a = s.getRoutes().find((u) => u.path === l);
1293
- return String(a?.name);
1294
- };
1295
- return (l, a) => (d(), I(b(rt), {
1296
- ref: "mainMenu",
1297
- "active-route": o.value ?? "home",
1298
- routes: e.routes,
1299
- onChangeRoute: a[0] || (a[0] = (u) => l.$emit("close"))
1300
- }, null, 8, ["active-route", "routes"]));
1301
- }
1302
- }), vn = {
1303
- name: "AppHeader"
1304
- }, Ue = /* @__PURE__ */ L({
1305
- ...vn,
1306
- props: {
1307
- noLocaleSwitcher: Boolean,
1308
- noLogo: Boolean,
1309
- noMainMenu: Boolean,
1310
- noToggle: Boolean
1311
- },
1312
- setup(e, { expose: t }) {
1313
- const { layout: n } = le(), { width: s } = st(), o = j(null), r = j(!0), i = n && n?.homeRoute ? n.homeRoute : void 0, l = N(() => s.value > 576), a = () => {
1314
- r.value = !1;
1315
- }, u = () => {
1316
- r.value = !r.value;
1317
- };
1318
- return t({
1319
- expanded: r
1320
- }), (c, p) => (d(), m("header", {
1321
- ref_key: "dzangolabVueAppHeader",
1322
- ref: o
1323
- }, [
1324
- !e.noToggle || !l.value ? (d(), m("div", {
1325
- key: 0,
1326
- class: "toggle",
1327
- onClick: u
1328
- }, [
1329
- f(c.$slots, "toggle", {}, () => [
1330
- r.value && !l.value ? (d(), I(b(Ie), {
1331
- key: 0,
1332
- icon: "prime:times",
1333
- height: "2rem"
1334
- })) : (d(), I(b(Ie), {
1335
- key: 1,
1336
- icon: "prime:bars",
1337
- height: "2rem"
1338
- }))
1339
- ])
1340
- ])) : $("", !0),
1341
- f(c.$slots, "logo", { class: "logo" }, () => [
1342
- e.noLogo ? $("", !0) : (d(), I(Qe, {
1343
- key: 0,
1344
- route: b(i)
1345
- }, null, 8, ["route"]))
1346
- ]),
1347
- S("nav", null, [
1348
- f(c.$slots, "menu", {}, () => [
1349
- b(n)?.mainMenu && !e.noMainMenu ? (d(), I(yn, {
1350
- key: 0,
1351
- class: "main-menu",
1352
- routes: b(n)?.mainMenu,
1353
- onClose: a
1354
- }, null, 8, ["routes"])) : $("", !0)
1355
- ]),
1356
- f(c.$slots, "userMenu"),
1357
- f(c.$slots, "addon"),
1358
- f(c.$slots, "locales", {}, () => [
1359
- e.noLocaleSwitcher ? $("", !0) : (d(), I(b(re), {
1360
- key: 0,
1361
- class: "locales"
1362
- }))
1363
- ])
1364
- ])
1365
- ], 512));
1366
- }
1367
- }), bn = "data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20stroke-width='0'%3e%3c/g%3e%3cg%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3c/g%3e%3cg%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.7071%204.29289C16.0976%204.68342%2016.0976%205.31658%2015.7071%205.70711L9.41421%2012L15.7071%2018.2929C16.0976%2018.6834%2016.0976%2019.3166%2015.7071%2019.7071C15.3166%2020.0976%2014.6834%2020.0976%2014.2929%2019.7071L7.29289%2012.7071C7.10536%2012.5196%207%2012.2652%207%2012C7%2011.7348%207.10536%2011.4804%207.29289%2011.2929L14.2929%204.29289C14.6834%203.90237%2015.3166%203.90237%2015.7071%204.29289Z'%20fill='%23ffffff'%3e%3c/path%3e%3c/g%3e%3c/svg%3e", Ge = "data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20stroke-width='0'%3e%3c/g%3e%3cg%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3c/g%3e%3cg%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M8.29289%204.29289C8.68342%203.90237%209.31658%203.90237%209.70711%204.29289L16.7071%2011.2929C17.0976%2011.6834%2017.0976%2012.3166%2016.7071%2012.7071L9.70711%2019.7071C9.31658%2020.0976%208.68342%2020.0976%208.29289%2019.7071C7.90237%2019.3166%207.90237%2018.6834%208.29289%2018.2929L14.5858%2012L8.29289%205.70711C7.90237%205.31658%207.90237%204.68342%208.29289%204.29289Z'%20fill='%23ffffff'%3e%3c/path%3e%3c/g%3e%3c/svg%3e", wn = { class: "nav-menu-item" }, kn = {
1368
- key: 1,
1369
- class: "item-name"
1370
- }, $n = {
1371
- key: 2,
1372
- class: "item-name"
1373
- }, Sn = {
1374
- key: 3,
1375
- class: "toggle-menu"
1376
- }, Ln = {
1377
- key: 0,
1378
- class: "sub-menu-item"
1379
- }, _n = {
1380
- name: "NavMenuItem",
1381
- components: {
1382
- NavMenuItem: () => import("./NavMenuItem-BPpUBkLh.js")
1383
- }
1384
- }, xn = /* @__PURE__ */ L({
1385
- ..._n,
1386
- props: {
1387
- item: {
1388
- required: !0,
1389
- type: Object
1390
- },
1391
- sidebarActive: {
1392
- default: !0,
1393
- required: !0,
1394
- type: Boolean
1395
- }
1396
- },
1397
- setup(e) {
1398
- const t = e, n = ae(), s = je(), o = j(!1), r = N(() => {
1399
- const c = n?.matched;
1400
- if (c?.length > 1) {
1401
- const p = c[c.length - 2];
1402
- return a(p?.path);
1403
- }
1404
- return "";
1405
- }), i = N(() => {
1406
- let c = n.name === t.item?.routeName;
1407
- return c || (t.item?.routeName ? c = !!r.value && r.value === t.item?.routeName : !t.item?.routeName && !t.item?.children?.length && n.name === r.value && (c = !0)), c;
1408
- }), l = N(() => !t.sidebarActive && t.item.shortName), a = (c) => {
1409
- const p = s.getRoutes().find((g) => g.path === c);
1410
- return String(p?.name);
1411
- }, u = () => {
1412
- t.item.routeName ? s.push({ name: t.item.routeName }) : !t.item.routeName && !t.item.children?.length ? s.push({ name: r.value }) : o.value = !o.value;
1413
- };
1414
- return t.item.children?.length && (o.value = !!t.item.children.find(
1415
- (c) => n.name === c?.routeName
1416
- )), (c, p) => {
1417
- const g = Ce("NavMenuItem", !0);
1418
- return d(), m("div", wn, [
1419
- S("a", {
1420
- class: O([{ active: i.value }, "link"]),
1421
- "aria-label": "open menu",
1422
- onClick: u
1423
- }, [
1424
- e.item.icon ? (d(), m("i", {
1425
- key: 0,
1426
- class: O([
1427
- "icon",
1428
- e.item.icon,
1429
- { "icon-only": !l.value && !e.sidebarActive }
1430
- ])
1431
- }, null, 2)) : $("", !0),
1432
- l.value ? (d(), m("span", kn, T(e.item.shortName), 1)) : $("", !0),
1433
- e.sidebarActive ? (d(), m("span", $n, T(e.item.name), 1)) : $("", !0),
1434
- e.item.children && e.item.children.length ? (d(), m("span", Sn, [
1435
- (d(), m("svg", {
1436
- class: O({ "up-chevron": o.value }),
1437
- viewBox: "0 0 24 24",
1438
- fill: "none",
1439
- xmlns: "http://www.w3.org/2000/svg"
1440
- }, p[0] || (p[0] = [
1441
- S("path", {
1442
- "fill-rule": "evenodd",
1443
- "clip-rule": "evenodd",
1444
- d: "M4.29289 8.29289C4.68342 7.90237 5.31658 7.90237 5.70711 8.29289L12 14.5858L18.2929 8.29289C18.6834 7.90237 19.3166 7.90237 19.7071 8.29289C20.0976 8.68342 20.0976 9.31658 19.7071 9.70711L12.7071 16.7071C12.3166 17.0976 11.6834 17.0976 11.2929 16.7071L4.29289 9.70711C3.90237 9.31658 3.90237 8.68342 4.29289 8.29289Z",
1445
- fill: "currentColor"
1446
- }, null, -1)
1447
- ]), 2))
1448
- ])) : $("", !0)
1449
- ], 2),
1450
- C(Me, { name: "fade" }, {
1451
- default: v(() => [
1452
- e.item.children && e.item.children.length && o.value ? (d(), m("div", Ln, [
1453
- (d(!0), m(Ae, null, ie(e.item.children, (w, M) => (d(), I(g, {
1454
- key: w.name + "-" + M,
1455
- item: w,
1456
- "sidebar-active": e.sidebarActive
1457
- }, null, 8, ["item", "sidebar-active"]))), 128))
1458
- ])) : $("", !0)
1459
- ]),
1460
- _: 1
1461
- })
1462
- ]);
1463
- };
1464
- }
1465
- }), In = { class: "nav-menu" }, Cn = {
1466
- key: 0,
1467
- class: "menu"
1468
- }, Mn = {
1469
- name: "NavMenu"
1470
- }, An = /* @__PURE__ */ L({
1471
- ...Mn,
1472
- props: {
1473
- menu: {
1474
- required: !0,
1475
- type: Array
1476
- },
1477
- sidebarActive: {
1478
- default: !0,
1479
- required: !0,
1480
- type: Boolean
1481
- }
1482
- },
1483
- setup(e) {
1484
- const t = e, n = N(() => t.menu?.map((s) => {
1485
- if (s.hide)
1486
- return null;
1487
- const o = s.children?.filter((r) => !r.hide) || [];
1488
- return s.children?.length && !o.length ? null : {
1489
- ...s,
1490
- children: o.length ? o : void 0
1491
- };
1492
- }).filter(Boolean));
1493
- return (s, o) => (d(), m("nav", In, [
1494
- n.value?.length > 0 ? (d(), m("div", Cn, [
1495
- (d(!0), m(Ae, null, ie(n.value, (r, i) => (d(), I(xn, {
1496
- key: r.name + "-" + i,
1497
- item: r,
1498
- "sidebar-active": e.sidebarActive
1499
- }, null, 8, ["item", "sidebar-active"]))), 128))
1500
- ])) : $("", !0)
1501
- ]));
1502
- }
1503
- }), Nn = {
1504
- key: 0,
1505
- class: "header"
1506
- }, Tn = { class: "logo" }, jn = { class: "title" }, Pn = {
1507
- key: 0,
1508
- alt: "minimize sidebar",
1509
- src: bn
1510
- }, En = {
1511
- key: 1,
1512
- class: "extend",
1513
- alt: "extend sidebar",
1514
- src: Ge
1515
- }, Fn = { class: "sidebar-menu-wrapper" }, On = { class: "nav" }, Rn = {
1516
- key: 1,
1517
- class: "footer"
1518
- }, Bn = {
1519
- key: 0,
1520
- alt: "show sidebar",
1521
- src: Ge
1522
- }, Dn = {
1523
- name: "Sidebar"
1524
- }, We = /* @__PURE__ */ L({
1525
- ...Dn,
1526
- props: {
1527
- collapsible: {
1528
- default: !0,
1529
- type: Boolean
1530
- },
1531
- menu: {
1532
- required: !0,
1533
- type: Array
1534
- },
1535
- noHeader: {
1536
- default: !1,
1537
- type: Boolean
1538
- }
1539
- },
1540
- setup(e, { expose: t }) {
1541
- const n = e, s = N(() => r.value ? !1 : !n.menu?.filter((i) => !!i.shortName)?.length), o = Ne(), r = j(!0);
1542
- return t({
1543
- sidebarActive: r
1544
- }), (i, l) => !s.value || !e.collapsible ? (d(), m("div", {
1545
- key: 0,
1546
- class: O(["sidebar", { collapsible: e.collapsible }])
1547
- }, [
1548
- e.noHeader ? $("", !0) : (d(), m("div", Nn, [
1549
- S("div", Tn, [
1550
- C(Qe)
1551
- ]),
1552
- S("div", jn, [
1553
- f(i.$slots, "title")
1554
- ]),
1555
- f(i.$slots, "toggleIcons", {}, () => [
1556
- S("div", {
1557
- class: "toggle",
1558
- onClick: l[0] || (l[0] = (a) => r.value = !r.value && e.collapsible)
1559
- }, [
1560
- C(Me, { name: "sidebar-toggle" }, {
1561
- default: v(() => [
1562
- r.value ? (d(), m("img", Pn)) : (d(), m("img", En))
1563
- ]),
1564
- _: 1
1565
- })
1566
- ])
1567
- ])
1568
- ])),
1569
- S("div", Fn, [
1570
- f(i.$slots, "default"),
1571
- S("ul", On, [
1572
- f(i.$slots, "links", {}, () => [
1573
- C(An, {
1574
- menu: e.menu,
1575
- "sidebar-active": r.value
1576
- }, null, 8, ["menu", "sidebar-active"])
1577
- ]),
1578
- f(i.$slots, "afterNavLinks")
1579
- ]),
1580
- f(i.$slots, "afterSidebarMenu")
1581
- ]),
1582
- b(o).footer ? (d(), m("div", Rn, [
1583
- f(i.$slots, "footer")
1584
- ])) : $("", !0)
1585
- ], 2)) : (d(), m("div", {
1586
- key: 1,
1587
- class: "no-sidebar",
1588
- onClick: l[1] || (l[1] = (a) => r.value = !0)
1589
- }, [
1590
- r.value ? $("", !0) : (d(), m("img", Bn))
1591
- ]));
1592
- }
1593
- }), Hn = { class: "content" }, zn = {
1594
- name: "StickyCollapsibleFooter"
1595
- }, fo = /* @__PURE__ */ L({
1596
- ...zn,
1597
- props: {
1598
- fixed: {
1599
- default: !0,
1600
- type: Boolean
1601
- }
1602
- },
1603
- setup(e) {
1604
- return (t, n) => (d(), m("footer", {
1605
- class: O(`sticky-collapsible ${e.fixed ? "fixed" : ""}`)
1606
- }, [
1607
- S("div", Hn, [
1608
- f(t.$slots, "default")
1609
- ])
1610
- ], 2));
1611
- }
1612
- }), qn = Je({
1613
- loader: () => Promise.resolve().then(() => Jn),
1614
- timeout: 3e3
1615
- }), Vn = {
1616
- name: "Layout"
1617
- }, Qn = /* @__PURE__ */ L({
1618
- ...Vn,
1619
- props: {
1620
- defaultLayout: {
1621
- default: qn,
1622
- type: Object
1623
- }
1624
- },
1625
- setup(e) {
1626
- const t = e, n = ae(), s = Ne(), o = Object.keys(s);
1627
- let r = Xe(t.defaultLayout);
1628
- const i = N(() => et(r.value));
1629
- return X(
1630
- () => n.meta,
1631
- async (l) => {
1632
- if (l?.layout)
1633
- try {
1634
- r.value = l.layout;
1635
- } catch {
1636
- r.value = t.defaultLayout;
1637
- }
1638
- else
1639
- r.value = t.defaultLayout;
1640
- }
1641
- ), (l, a) => (d(), I(tt(i.value), null, Te({
1642
- default: v(() => [
1643
- f(l.$slots, "default")
1644
- ]),
1645
- _: 2
1646
- }, [
1647
- ie(b(o), (u) => ({
1648
- name: u,
1649
- fn: v(() => [
1650
- f(l.$slots, u)
1651
- ])
1652
- }))
1653
- ]), 1024));
1654
- }
1655
- }), Un = ["aria-expanded"], Gn = {
1656
- name: "BasicLayout"
1657
- }, ho = /* @__PURE__ */ L({
1658
- ...Gn,
1659
- props: {
1660
- noLocaleSwitcher: Boolean
1661
- },
1662
- setup(e) {
1663
- const t = j();
1664
- return (n, s) => (d(), m("div", {
1665
- "aria-expanded": t.value?.expanded,
1666
- class: "layout basic"
1667
- }, [
1668
- f(n.$slots, "header", {}, () => [
1669
- C(Ue, {
1670
- ref_key: "appHeader",
1671
- ref: t,
1672
- "no-locale-switcher": e.noLocaleSwitcher,
1673
- "no-toggle": ""
1674
- }, {
1675
- logo: v(() => [
1676
- f(n.$slots, "logo")
1677
- ]),
1678
- addon: v(() => [
1679
- f(n.$slots, "addon")
1680
- ]),
1681
- menu: v(() => [
1682
- f(n.$slots, "menu")
1683
- ]),
1684
- userMenu: v(() => [
1685
- f(n.$slots, "userMenu")
1686
- ]),
1687
- locales: v(() => [
1688
- f(n.$slots, "locales")
1689
- ]),
1690
- _: 3
1691
- }, 8, ["no-locale-switcher"])
1692
- ]),
1693
- S("main", null, [
1694
- f(n.$slots, "default")
1695
- ]),
1696
- f(n.$slots, "footer", {}, () => [
1697
- C(ce, null, {
1698
- copyright: v(() => [
1699
- f(n.$slots, "copyright")
1700
- ]),
1701
- social: v(() => [
1702
- f(n.$slots, "social")
1703
- ]),
1704
- version: v(() => [
1705
- f(n.$slots, "version")
1706
- ]),
1707
- _: 3
1708
- })
1709
- ])
1710
- ], 8, Un));
1711
- }
1712
- }), Wn = {
1713
- name: "NullLayout"
1714
- }, Zn = (e, t) => {
1715
- const n = e.__vccOpts || e;
1716
- for (const [s, o] of t)
1717
- n[s] = o;
1718
- return n;
1719
- };
1720
- function Kn(e, t, n, s, o, r) {
1721
- return f(e.$slots, "default");
1722
- }
1723
- const Yn = /* @__PURE__ */ Zn(Wn, [["render", Kn]]), Jn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1724
- __proto__: null,
1725
- default: Yn
1726
- }, Symbol.toStringTag, { value: "Module" })), Xn = ["aria-expanded"], po = /* @__PURE__ */ L({
1727
- __name: "SidebarHeaderLayout",
1728
- props: {
1729
- collapsible: {
1730
- default: !0,
1731
- type: Boolean
1732
- },
1733
- menu: {
1734
- required: !0,
1735
- type: Array
1736
- },
1737
- noLocaleSwitcher: Boolean,
1738
- noSidebarHeader: {
1739
- default: !1,
1740
- type: Boolean
1741
- },
1742
- userMenuLocation: {
1743
- default: "sidebar",
1744
- type: String,
1745
- validator: (e) => ["header", "sidebar"].includes(e)
1746
- }
1747
- },
1748
- setup(e) {
1749
- const t = j(), n = j(), s = j(!1);
1750
- X(
1751
- () => t.value?.expanded,
1752
- (r) => {
1753
- r && (n.value.sidebarActive = !0);
1754
- }
1755
- ), X(
1756
- () => n.value?.sidebarActive,
1757
- (r) => {
1758
- r || (t.value.expanded = !1);
1759
- }
1760
- );
1761
- const o = () => {
1762
- window.innerWidth >= 576 ? s.value = !1 : s.value = !0;
1763
- };
1764
- return nt(() => {
1765
- window.removeEventListener("resize", o);
1766
- }), window.addEventListener("resize", o), o(), (r, i) => (d(), m("div", {
1767
- "aria-expanded": t.value?.expanded,
1768
- class: O(["layout sidebar-header-layout", { collapsible: e.collapsible }])
1769
- }, [
1770
- f(r.$slots, "header", {}, () => [
1771
- C(Ue, {
1772
- ref_key: "appHeader",
1773
- ref: t,
1774
- "no-locale-switcher": e.noLocaleSwitcher,
1775
- "no-toggle": !e.collapsible,
1776
- "no-main-menu": ""
1777
- }, Te({
1778
- locales: v(() => [
1779
- f(r.$slots, "locales")
1780
- ]),
1781
- _: 2
1782
- }, [
1783
- e.userMenuLocation === "header" ? {
1784
- name: "userMenu",
1785
- fn: v(() => [
1786
- f(r.$slots, "userMenu")
1787
- ]),
1788
- key: "0"
1789
- } : void 0
1790
- ]), 1032, ["no-locale-switcher", "no-toggle"])
1791
- ]),
1792
- C(We, {
1793
- ref_key: "sidebar",
1794
- ref: n,
1795
- collapsible: e.collapsible,
1796
- menu: e.menu,
1797
- "no-header": e.noSidebarHeader,
1798
- class: "layout-sidebar"
1799
- }, {
1800
- afterNavLinks: v(() => [
1801
- f(r.$slots, "afterNavLinks")
1802
- ]),
1803
- afterSidebarMenu: v(() => [
1804
- f(r.$slots, "afterSidebarMenu"),
1805
- e.userMenuLocation === "sidebar" ? f(r.$slots, "userMenu", { key: 0 }) : $("", !0),
1806
- s.value ? f(r.$slots, "locales", { key: 1 }, () => [
1807
- e.noLocaleSwitcher ? $("", !0) : (d(), I(b(re), {
1808
- key: 0,
1809
- class: "locales"
1810
- }))
1811
- ]) : $("", !0)
1812
- ]),
1813
- footer: v(() => [
1814
- f(r.$slots, "footer", {}, () => [
1815
- C(ce)
1816
- ])
1817
- ]),
1818
- _: 3
1819
- }, 8, ["collapsible", "menu", "no-header"]),
1820
- S("main", null, [
1821
- f(r.$slots, "default")
1822
- ])
1823
- ], 10, Xn));
1824
- }
1825
- }), eo = "data:image/svg+xml,%3csvg%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20stroke-width='0'%3e%3c/g%3e%3cg%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3c/g%3e%3cg%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12%207C12.2652%207%2012.5196%207.10536%2012.7071%207.29289L19.7071%2014.2929C20.0976%2014.6834%2020.0976%2015.3166%2019.7071%2015.7071C19.3166%2016.0976%2018.6834%2016.0976%2018.2929%2015.7071L12%209.41421L5.70711%2015.7071C5.31658%2016.0976%204.68342%2016.0976%204.29289%2015.7071C3.90237%2015.3166%203.90237%2014.6834%204.29289%2014.2929L11.2929%207.29289C11.4804%207.10536%2011.7348%207%2012%207Z'%20fill='%23ffffff'%3e%3c/path%3e%3c/g%3e%3c/svg%3e", to = { class: "layout sidebar-only" }, mo = /* @__PURE__ */ L({
1826
- __name: "SidebarOnlyLayout",
1827
- props: {
1828
- menu: {
1829
- required: !0,
1830
- type: Array
1831
- },
1832
- noLocaleSwitcher: Boolean,
1833
- noHeader: {
1834
- default: !1,
1835
- type: Boolean
1836
- }
1837
- },
1838
- setup(e) {
1839
- return (t, n) => (d(), m("div", to, [
1840
- C(We, {
1841
- menu: e.menu,
1842
- "no-header": e.noHeader,
1843
- class: "layout-sidebar"
1844
- }, {
1845
- afterNavLinks: v(() => [
1846
- f(t.$slots, "afterNavLinks")
1847
- ]),
1848
- afterSidebarMenu: v(() => [
1849
- f(t.$slots, "afterSidebarMenu"),
1850
- f(t.$slots, "userMenu"),
1851
- f(t.$slots, "locales", {}, () => [
1852
- e.noLocaleSwitcher ? $("", !0) : (d(), I(b(re), {
1853
- key: 0,
1854
- class: "locales"
1855
- }, {
1856
- icon: v(() => n[0] || (n[0] = [
1857
- S("img", {
1858
- src: eo,
1859
- alt: "toggle icon"
1860
- }, null, -1)
1861
- ])),
1862
- _: 1
1863
- }))
1864
- ])
1865
- ]),
1866
- footer: v(() => [
1867
- C(ce)
1868
- ]),
1869
- _: 3
1870
- }, 8, ["menu", "no-header"]),
1871
- S("main", null, [
1872
- f(t.$slots, "default")
1873
- ])
1874
- ]));
1875
- }
1876
- }), no = { copyright: { disclaimer: "All rights reserved." } }, oo = { copyright: { disclaimer: "Tous droits réservés." } }, se = {
1877
- en: no,
1878
- fr: oo
1879
- }, Ze = Symbol.for(
1880
- "dzangolab.vue-layout.translations"
1881
- ), so = () => ot(Ze, se), go = {
1882
- install: (e, t) => {
1883
- e.component("Layout", Qn);
1884
- const n = t?.translations ? Ye(se, t.translations) : se;
1885
- e.provide(Ze, n);
1886
- }
1887
- };
1888
- export {
1889
- Yn as N,
1890
- xn as _,
1891
- ce as a,
1892
- Ue as b,
1893
- ho as c,
1894
- ct as d,
1895
- Qn as e,
1896
- Qe as f,
1897
- yn as g,
1898
- We as h,
1899
- po as i,
1900
- mo as j,
1901
- fo as k,
1902
- go as p,
1903
- so as u
1904
- };