@flux-ui/application 3.0.0-next.67 → 3.0.0-next.68

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 CHANGED
@@ -2,8 +2,8 @@ import { Fragment, TransitionGroup, computed, createBlock, createCommentVNode, c
2
2
  import { FluxFadeTransition, FluxFlyout, FluxIcon, FluxMenu, FluxMenuItem, FluxPane, FluxRouteTransition, FluxSecondaryButton, FluxSpacer, FluxTabBar, useBreakpoints } from "@flux-ui/components";
3
3
  import { DateTime } from "luxon";
4
4
  import { RouterView, matchedRouteKey, useRoute, viewDepthKey } from "vue-router";
5
- //#region ../../node_modules/.bun/@basmilius+utils@3.30.0/node_modules/@basmilius/utils/dist/index.mjs
6
- function x$1(e) {
5
+ //#region ../../node_modules/.bun/@basmilius+utils@3.33.0/node_modules/@basmilius/utils/dist/index.mjs
6
+ function x(e) {
7
7
  let t = {};
8
8
  do {
9
9
  if (e.name === ``) break;
@@ -15,10 +15,10 @@ function x$1(e) {
15
15
  } while (e = Object.getPrototypeOf(e));
16
16
  return t;
17
17
  }
18
- function G$1(e, t, n) {
18
+ function G(e, t, n) {
19
19
  e.prototype[t] = n;
20
20
  }
21
- function K$1(e, t, n) {
21
+ function K(e, t, n) {
22
22
  Object.defineProperty(e, t, { value: n });
23
23
  }
24
24
  //#endregion
@@ -226,12 +226,12 @@ var num_per = `(?:${num$1}%|${num$1})`;
226
226
  var num_per_none = `(?:${num$1}%|${num$1}|none)`;
227
227
  var hue$1 = `(?:${num$1}(deg|grad|rad|turn)|${num$1})`;
228
228
  `${num$1}${num$1}`;
229
- var c$1 = `\\s*,\\s*`;
229
+ var c = `\\s*,\\s*`;
230
230
  new RegExp("^" + num_per_none + "$");
231
231
  //#endregion
232
232
  //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/rgb/parseRgbLegacy.js
233
- var rgb_num_old = new RegExp(`^rgba?\\(\\s*${num$1}${c$1}${num$1}${c$1}${num$1}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
234
- var rgb_per_old = new RegExp(`^rgba?\\(\\s*${per}${c$1}${per}${c$1}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
233
+ var rgb_num_old = new RegExp(`^rgba?\\(\\s*${num$1}${c}${num$1}${c}${num$1}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
234
+ var rgb_per_old = new RegExp(`^rgba?\\(\\s*${per}${c}${per}${c}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
235
235
  var parseRgbLegacy = (color) => {
236
236
  let res = { mode: "rgb" };
237
237
  let match;
@@ -933,7 +933,7 @@ var convertLchToLab = ({ l, c, h, alpha }, mode = "lab") => {
933
933
  };
934
934
  //#endregion
935
935
  //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/xyz65/constants.js
936
- var k$5 = Math.pow(29, 3) / Math.pow(3, 3);
936
+ var k$4 = Math.pow(29, 3) / Math.pow(3, 3);
937
937
  var e$2 = Math.pow(6, 3) / Math.pow(29, 3);
938
938
  //#endregion
939
939
  //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/constants.js
@@ -951,7 +951,7 @@ Math.pow(29, 3) / Math.pow(3, 3);
951
951
  Math.pow(6, 3) / Math.pow(29, 3);
952
952
  //#endregion
953
953
  //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lab65/convertLab65ToXyz65.js
954
- var fn$1 = (v) => Math.pow(v, 3) > e$2 ? Math.pow(v, 3) : (116 * v - 16) / k$5;
954
+ var fn$1 = (v) => Math.pow(v, 3) > e$2 ? Math.pow(v, 3) : (116 * v - 16) / k$4;
955
955
  var convertLab65ToXyz65 = ({ l, a, b, alpha }) => {
956
956
  if (l === void 0) l = 0;
957
957
  if (a === void 0) a = 0;
@@ -973,14 +973,14 @@ var convertLab65ToXyz65 = ({ l, a, b, alpha }) => {
973
973
  var convertLab65ToRgb = (lab) => convertXyz65ToRgb(convertLab65ToXyz65(lab));
974
974
  //#endregion
975
975
  //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lab65/convertXyz65ToLab65.js
976
- var f$2 = (value) => value > e$2 ? Math.cbrt(value) : (k$5 * value + 16) / 116;
976
+ var f$1 = (value) => value > e$2 ? Math.cbrt(value) : (k$4 * value + 16) / 116;
977
977
  var convertXyz65ToLab65 = ({ x, y, z, alpha }) => {
978
978
  if (x === void 0) x = 0;
979
979
  if (y === void 0) y = 0;
980
980
  if (z === void 0) z = 0;
981
- let f0 = f$2(x / D65.X);
982
- let f1 = f$2(y / D65.Y);
983
- let f2 = f$2(z / D65.Z);
981
+ let f0 = f$1(x / D65.X);
982
+ let f1 = f$1(y / D65.Y);
983
+ let f2 = f$1(z / D65.Z);
984
984
  let res = {
985
985
  mode: "lab65",
986
986
  l: 116 * f1 - 16,
@@ -1316,7 +1316,7 @@ var hueToDeg = (val, unit) => {
1316
1316
  };
1317
1317
  //#endregion
1318
1318
  //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/hsl/parseHslLegacy.js
1319
- var hsl_old = new RegExp(`^hsla?\\(\\s*${hue$1}${c$1}${per}${c$1}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
1319
+ var hsl_old = new RegExp(`^hsla?\\(\\s*${hue$1}${c}${per}${c}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
1320
1320
  var parseHslLegacy = (color) => {
1321
1321
  let match = color.match(hsl_old);
1322
1322
  if (!match) return;
@@ -1666,12 +1666,12 @@ var definition$18 = {
1666
1666
  };
1667
1667
  //#endregion
1668
1668
  //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/jab/convertXyz65ToJab.js
1669
- var p$2 = 134.03437499999998;
1669
+ var p$1 = 134.03437499999998;
1670
1670
  var d0$1 = 16295499532821565e-27;
1671
1671
  var jabPqEncode = (v) => {
1672
1672
  if (v < 0) return 0;
1673
1673
  let vn = Math.pow(v / 1e4, M1);
1674
- return Math.pow((C1 + C2 * vn) / (1 + C3 * vn), p$2);
1674
+ return Math.pow((C1 + C2 * vn) / (1 + C3 * vn), p$1);
1675
1675
  };
1676
1676
  var abs = (v = 0) => Math.max(v * 203, 0);
1677
1677
  var convertXyz65ToJab = ({ x, y, z, alpha }) => {
@@ -1695,11 +1695,11 @@ var convertXyz65ToJab = ({ x, y, z, alpha }) => {
1695
1695
  };
1696
1696
  //#endregion
1697
1697
  //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/jab/convertJabToXyz65.js
1698
- var p$1 = 134.03437499999998;
1698
+ var p = 134.03437499999998;
1699
1699
  var d0 = 16295499532821565e-27;
1700
1700
  var jabPqDecode = (v) => {
1701
1701
  if (v < 0) return 0;
1702
- let vp = Math.pow(v, 1 / p$1);
1702
+ let vp = Math.pow(v, 1 / p);
1703
1703
  return 1e4 * Math.pow((C1 - vp) / (C3 * vp - C2), 1 / M1);
1704
1704
  };
1705
1705
  var rel = (v) => v / 203;
@@ -1835,11 +1835,11 @@ var definition$16 = {
1835
1835
  };
1836
1836
  //#endregion
1837
1837
  //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/xyz50/constants.js
1838
- var k$3 = Math.pow(29, 3) / Math.pow(3, 3);
1838
+ var k$2 = Math.pow(29, 3) / Math.pow(3, 3);
1839
1839
  var e = Math.pow(6, 3) / Math.pow(29, 3);
1840
1840
  //#endregion
1841
1841
  //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lab/convertLabToXyz50.js
1842
- var fn = (v) => Math.pow(v, 3) > e ? Math.pow(v, 3) : (116 * v - 16) / k$3;
1842
+ var fn = (v) => Math.pow(v, 3) > e ? Math.pow(v, 3) : (116 * v - 16) / k$2;
1843
1843
  var convertLabToXyz50 = ({ l, a, b, alpha }) => {
1844
1844
  if (l === void 0) l = 0;
1845
1845
  if (a === void 0) a = 0;
@@ -1888,14 +1888,14 @@ var convertRgbToXyz50 = (rgb) => {
1888
1888
  };
1889
1889
  //#endregion
1890
1890
  //#region ../../node_modules/.bun/culori@4.0.2/node_modules/culori/src/lab/convertXyz50ToLab.js
1891
- var f$1 = (value) => value > e ? Math.cbrt(value) : (k$3 * value + 16) / 116;
1891
+ var f = (value) => value > e ? Math.cbrt(value) : (k$2 * value + 16) / 116;
1892
1892
  var convertXyz50ToLab = ({ x, y, z, alpha }) => {
1893
1893
  if (x === void 0) x = 0;
1894
1894
  if (y === void 0) y = 0;
1895
1895
  if (z === void 0) z = 0;
1896
- let f0 = f$1(x / D50.X);
1897
- let f1 = f$1(y / D50.Y);
1898
- let f2 = f$1(z / D50.Z);
1896
+ let f0 = f(x / D50.X);
1897
+ let f1 = f(y / D50.Y);
1898
+ let f2 = f(z / D50.Z);
1899
1899
  let res = {
1900
1900
  mode: "lab",
1901
1901
  l: 116 * f1 - 16,
@@ -2094,7 +2094,7 @@ var u_fn$1 = (x, y, z) => 4 * x / (x + 15 * y + 3 * z);
2094
2094
  var v_fn$1 = (x, y, z) => 9 * y / (x + 15 * y + 3 * z);
2095
2095
  var un$1 = u_fn$1(D50.X, D50.Y, D50.Z);
2096
2096
  var vn$1 = v_fn$1(D50.X, D50.Y, D50.Z);
2097
- var l_fn = (value) => value <= e ? k$3 * value : 116 * Math.cbrt(value) - 16;
2097
+ var l_fn = (value) => value <= e ? k$2 * value : 116 * Math.cbrt(value) - 16;
2098
2098
  var convertXyz50ToLuv = ({ x, y, z, alpha }) => {
2099
2099
  if (x === void 0) x = 0;
2100
2100
  if (y === void 0) y = 0;
@@ -2134,7 +2134,7 @@ var convertLuvToXyz50 = ({ l, u, v, alpha }) => {
2134
2134
  if (v === void 0) v = 0;
2135
2135
  let up = u / (13 * l) + un;
2136
2136
  let vp = v / (13 * l) + vn;
2137
- let y = D50.Y * (l <= 8 ? l / k$3 : Math.pow((l + 16) / 116, 3));
2137
+ let y = D50.Y * (l <= 8 ? l / k$2 : Math.pow((l + 16) / 116, 3));
2138
2138
  let res = {
2139
2139
  mode: "xyz50",
2140
2140
  x: y * (9 * up) / (4 * vp),
@@ -3103,304 +3103,514 @@ useMode(definition$2);
3103
3103
  useMode(definition$1);
3104
3104
  useMode(definition);
3105
3105
  //#endregion
3106
- //#region ../../node_modules/.bun/@basmilius+http-client@3.30.0+638c9d1214a588db/node_modules/@basmilius/http-client/dist/index.mjs
3107
- function c(e) {
3108
- return class extends e {
3109
- constructor(...e) {
3110
- throw Error(`@adapter: cannot create instance of class.`);
3106
+ //#region ../../node_modules/.bun/@basmilius+http-client@3.33.0+ceec7979b6f4ef20/node_modules/@basmilius/http-client/dist/index.mjs
3107
+ function adapter_default(Parent) {
3108
+ return class extends Parent {
3109
+ constructor(...args) {
3110
+ throw new Error("@adapter: cannot create instance of class.");
3111
3111
  }
3112
3112
  };
3113
3113
  }
3114
- function ne(e, t) {
3115
- return e === t ? !0 : e === t;
3114
+ /**
3115
+ * Checks if the two given values are equal. When both values are a
3116
+ * dto, the check is done by firstly converthing them to JSON.
3117
+ */
3118
+ function areEqual_default(a, b) {
3119
+ if (a === b) return true;
3120
+ return a === b;
3116
3121
  }
3117
- var l = Symbol(), u = Symbol(), d = Symbol(), f = Symbol(), p = Symbol(), m = Symbol(), h$1 = Symbol(), g = Symbol(), _ = Symbol(), re = Symbol(), ie$1 = Symbol();
3118
- function v(e) {
3119
- return e && typeof e == `object` && !!e[p];
3122
+ var ARGS = Symbol();
3123
+ var CHILDREN = Symbol();
3124
+ var DESCRIPTORS = Symbol();
3125
+ var DIRTY = Symbol();
3126
+ var NAME = Symbol();
3127
+ var PARENT = Symbol();
3128
+ var PARENT_KEY = Symbol();
3129
+ var PROPERTIES = Symbol();
3130
+ var PROXY = Symbol();
3131
+ var TRACK = Symbol();
3132
+ var TRIGGER = Symbol();
3133
+ /**
3134
+ * Checks if the given object is a dto.
3135
+ */
3136
+ function isDto_default(obj) {
3137
+ return obj && typeof obj === "object" && !!obj[NAME];
3120
3138
  }
3121
- function y(e) {
3122
- if (!v(e)) throw Error(`@dto assert given object is not a class decorated with @Dto.`);
3139
+ /**
3140
+ * Asserts that the given object is a dto.
3141
+ */
3142
+ function assertDto_default(obj) {
3143
+ if (!isDto_default(obj)) throw new Error("@dto assert given object is not a class decorated with @Dto.");
3123
3144
  }
3124
- var ae$1 = Symbol();
3125
- function b(e, t = 0, n) {
3126
- return function(...r) {
3127
- let i = e[ae$1] ??= /* @__PURE__ */ new WeakMap(), a = r[t], o = n === void 0 ? `self` : r[n];
3128
- if (typeof a != `object` || !a) return e.call(this, ...r);
3129
- i.has(a) || i.set(a, []);
3130
- let s = i.get(a);
3131
- if (!s.includes(o)) {
3132
- s.push(o);
3133
- try {
3134
- return e.call(this, ...r);
3135
- } finally {
3136
- let e = s.lastIndexOf(o);
3137
- e !== -1 && s.splice(e, 1), s.length === 0 && i.delete(a);
3138
- }
3145
+ var CIRCULAR_MAP = Symbol();
3146
+ function circularProtect_default(fn, arg1 = 0, arg2) {
3147
+ return function(...args) {
3148
+ const map = fn[CIRCULAR_MAP] ??= /* @__PURE__ */ new WeakMap();
3149
+ const primary = args[arg1];
3150
+ const secondary = arg2 !== void 0 ? args[arg2] : "self";
3151
+ if (typeof primary !== "object" || primary === null) return fn.call(this, ...args);
3152
+ if (!map.has(primary)) map.set(primary, []);
3153
+ const visited = map.get(primary);
3154
+ if (visited.includes(secondary)) return;
3155
+ visited.push(secondary);
3156
+ try {
3157
+ return fn.call(this, ...args);
3158
+ } finally {
3159
+ const index = visited.lastIndexOf(secondary);
3160
+ if (index !== -1) visited.splice(index, 1);
3161
+ if (visited.length === 0) map.delete(primary);
3139
3162
  }
3140
3163
  };
3141
3164
  }
3142
- function x(e) {
3143
- return y(e), e[f];
3165
+ /**
3166
+ * Checks if the given dto is dirty.
3167
+ */
3168
+ function isDtoDirty_default(obj) {
3169
+ assertDto_default(obj);
3170
+ return obj[DIRTY];
3144
3171
  }
3145
- var S = b(function(e, t, n, r) {
3146
- let i = e[ie$1];
3147
- i(e, t, n, r), e[m] && S(e[m], e[h$1], e[m][e[h$1]]);
3148
- }, 0, 1), C = b(function(e) {
3149
- y(e), e[f] && (e[f] = !1, S(e, f, !1, !0)), !(!e[u] || e[u].length === 0) && e[u].filter(x).forEach(C);
3172
+ /**
3173
+ * Trigger for when a dto property is being updated.
3174
+ */
3175
+ var triggerDto = circularProtect_default(function(dto, key, value, oldValue) {
3176
+ const trigger = dto[TRIGGER];
3177
+ trigger(dto, key, value, oldValue);
3178
+ dto[PARENT] && triggerDto(dto[PARENT], dto[PARENT_KEY], dto[PARENT][dto[PARENT_KEY]]);
3179
+ }, 0, 1);
3180
+ /**
3181
+ * Marks the given dto clean.
3182
+ */
3183
+ var markDtoClean = circularProtect_default(function(obj) {
3184
+ assertDto_default(obj);
3185
+ if (obj[DIRTY]) {
3186
+ obj[DIRTY] = false;
3187
+ triggerDto(obj, DIRTY, false, true);
3188
+ }
3189
+ if (!obj[CHILDREN] || obj[CHILDREN].length === 0) return;
3190
+ obj[CHILDREN].filter(isDtoDirty_default).forEach(markDtoClean);
3150
3191
  });
3151
- var w = b(function(e, t) {
3152
- y(e), e[f] || (e[f] = !0, S(e, f, !0, !1)), e[m] && w(e[m], e[h$1]);
3192
+ /**
3193
+ * Marks the given dto dirty.
3194
+ */
3195
+ var markDtoDirty = circularProtect_default(function(obj, key) {
3196
+ assertDto_default(obj);
3197
+ if (!obj[DIRTY]) {
3198
+ obj[DIRTY] = true;
3199
+ triggerDto(obj, DIRTY, true, false);
3200
+ }
3201
+ if (!obj[PARENT]) return;
3202
+ markDtoDirty(obj[PARENT], obj[PARENT_KEY]);
3153
3203
  });
3154
- function T(e, t, n) {
3155
- t[u] ??= [], !t[u].includes(e) && t[u].push(e), e[m] !== t && (e[m] = t), e[h$1] !== n && (e[h$1] = n);
3204
+ /**
3205
+ * Creates a parent-child relationship between the given two dtos.
3206
+ */
3207
+ function relateDtoTo_default(dto, parent, key) {
3208
+ parent[CHILDREN] ??= [];
3209
+ !parent[CHILDREN].includes(dto) && parent[CHILDREN].push(dto);
3210
+ dto[PARENT] !== parent && (dto[PARENT] = parent);
3211
+ dto[PARENT_KEY] !== key && (dto[PARENT_KEY] = key);
3156
3212
  }
3157
- function E(e, t, n) {
3158
- if (v(n)) T(n, e, t);
3159
- else if (Array.isArray(n)) {
3160
- for (let r of n) v(r) && T(r, e, t);
3161
- n[m] = e, n[h$1] = t;
3213
+ /**
3214
+ * Creates relationships between the given value and dto.
3215
+ */
3216
+ function relateValueTo_default(dto, key, value) {
3217
+ if (isDto_default(value)) relateDtoTo_default(value, dto, key);
3218
+ else if (Array.isArray(value)) {
3219
+ for (const item of value) {
3220
+ if (!isDto_default(item)) continue;
3221
+ relateDtoTo_default(item, dto, key);
3222
+ }
3223
+ value[PARENT] = dto;
3224
+ value[PARENT_KEY] = key;
3162
3225
  }
3163
3226
  }
3164
- function le(e, t) {
3165
- let n = e[re];
3166
- n(e, t);
3227
+ /**
3228
+ * Tracking for when a dto property is being accessed.
3229
+ */
3230
+ function trackDto(dto, key) {
3231
+ const track = dto[TRACK];
3232
+ track(dto, key);
3167
3233
  }
3168
- function D$1(e, t) {
3169
- if (u in t) {
3170
- let n = t[u].indexOf(e);
3171
- n !== -1 && t[u].splice(n, 1);
3234
+ /**
3235
+ * Removes a parent-child relationship between the given two dtos.
3236
+ */
3237
+ function unrelateDtoFrom_default(dto, parent) {
3238
+ if (CHILDREN in parent) {
3239
+ const index = parent[CHILDREN].indexOf(dto);
3240
+ if (index !== -1) parent[CHILDREN].splice(index, 1);
3172
3241
  }
3173
- e[m] = void 0, e[h$1] = void 0;
3242
+ dto[PARENT] = void 0;
3243
+ dto[PARENT_KEY] = void 0;
3174
3244
  }
3175
- function ue(e, t) {
3176
- if (v(t)) D$1(t, e);
3177
- else if (Array.isArray(t)) {
3178
- for (let n of t) v(n) && D$1(n, e);
3179
- t[m] = void 0, t[h$1] = void 0;
3245
+ /**
3246
+ * Removes relationships between the given value and dto.
3247
+ */
3248
+ function unrelateValueFrom_default(dto, value) {
3249
+ if (isDto_default(value)) unrelateDtoFrom_default(value, dto);
3250
+ else if (Array.isArray(value)) {
3251
+ for (const item of value) if (isDto_default(item)) unrelateDtoFrom_default(item, dto);
3252
+ value[PARENT] = void 0;
3253
+ value[PARENT_KEY] = void 0;
3180
3254
  }
3181
3255
  }
3182
- var O = {};
3183
- var k$2 = {
3184
- deleteProperty(e, t) {
3185
- if (Reflect.deleteProperty(e, t), A(e, t)) return !0;
3186
- let n = e[m];
3187
- return n && S(n, e[h$1], n[e[h$1]]), n && w(n, e[h$1]), !0;
3256
+ var DTO_CLASS_MAP = {};
3257
+ var arrayProxy_default = {
3258
+ /**
3259
+ * Trap for when a property is deleted from the target. This
3260
+ * will mark the parent dto as dirty and trigger an update.
3261
+ */
3262
+ deleteProperty(target, key) {
3263
+ Reflect.deleteProperty(target, key);
3264
+ if (ignored(target, key)) return true;
3265
+ const dto = target[PARENT];
3266
+ dto && triggerDto(dto, target[PARENT_KEY], dto[target[PARENT_KEY]]);
3267
+ dto && markDtoDirty(dto, target[PARENT_KEY]);
3268
+ return true;
3188
3269
  },
3189
- get(e, t, n) {
3190
- if (t === _) return !0;
3191
- if (A(e, t)) return Reflect.get(e, t, n);
3192
- let r = e[m];
3193
- return r && le(r, e[h$1]), Reflect.get(e, t);
3270
+ /**
3271
+ * Trap for when a property of the target is being accessed. The
3272
+ * property access is being tracked for further updates.
3273
+ */
3274
+ get(target, key, receiver) {
3275
+ if (key === PROXY) return true;
3276
+ if (ignored(target, key)) return Reflect.get(target, key, receiver);
3277
+ const dto = target[PARENT];
3278
+ dto && trackDto(dto, target[PARENT_KEY]);
3279
+ return Reflect.get(target, key);
3194
3280
  },
3195
- set(e, t, n, r) {
3196
- if (A(e, t)) return Reflect.set(e, t, n, r);
3197
- let i = e[m];
3198
- return i && S(i, e[h$1], i[e[h$1]]), i && w(i, e[h$1]), Reflect.set(e, t, n);
3281
+ /**
3282
+ * Trap for when a property of the target is being updated. This
3283
+ * will mark the parent dto as dirty and trigger an update.
3284
+ */
3285
+ set(target, key, value, receiver) {
3286
+ if (ignored(target, key)) return Reflect.set(target, key, value, receiver);
3287
+ const dto = target[PARENT];
3288
+ dto && triggerDto(dto, target[PARENT_KEY], dto[target[PARENT_KEY]]);
3289
+ dto && markDtoDirty(dto, target[PARENT_KEY]);
3290
+ return Reflect.set(target, key, value);
3199
3291
  }
3200
3292
  };
3201
- function A(e, t) {
3202
- return typeof t == `symbol` || typeof e[t] == `function` || t === `length`;
3293
+ /**
3294
+ * Checks if the given key should be ignored by the proxy.
3295
+ */
3296
+ function ignored(target, key) {
3297
+ return typeof key === "symbol" || typeof target[key] === "function" || key === "length";
3203
3298
  }
3204
- var de = {
3205
- get(e, t, n) {
3206
- if (t === _) return !0;
3207
- if (typeof t == `symbol`) return Reflect.get(e, t, n);
3208
- let r = e[d][t];
3209
- if (!r || !r.get) return Reflect.get(e, t, n);
3210
- let i = r.get.call(e);
3211
- return le(e, t), E(e, t, i), i;
3299
+ var instanceProxy_default = {
3300
+ /**
3301
+ * Trap for when a dto property is being accessed. The property
3302
+ * access is being tracked for further updates. If the dto has
3303
+ * any child dtos, a relationship will be added between them.
3304
+ */
3305
+ get(target, key, receiver) {
3306
+ if (key === PROXY) return true;
3307
+ if (typeof key === "symbol") return Reflect.get(target, key, receiver);
3308
+ const descriptor = target[DESCRIPTORS][key];
3309
+ if (!descriptor || !descriptor.get) return Reflect.get(target, key, receiver);
3310
+ const value = descriptor.get.call(target);
3311
+ trackDto(target, key);
3312
+ relateValueTo_default(target, key, value);
3313
+ return value;
3212
3314
  },
3213
- getOwnPropertyDescriptor(e, t) {
3214
- return e[d][t];
3315
+ /**
3316
+ * Trap for when a descriptor of a dto property is requested.
3317
+ */
3318
+ getOwnPropertyDescriptor(target, key) {
3319
+ return target[DESCRIPTORS][key];
3215
3320
  },
3216
- ownKeys(e) {
3217
- return e[g];
3321
+ /**
3322
+ * Trap for when the keys of a dto are requested.
3323
+ */
3324
+ ownKeys(target) {
3325
+ return target[PROPERTIES];
3218
3326
  },
3219
- set(e, t, n, r) {
3220
- if (typeof t == `symbol`) return Reflect.set(e, t, n, r);
3221
- let i = e[d][t];
3222
- if (!i || !i.set) return Reflect.set(e, t, n, r);
3223
- let a = i.get?.call(e) ?? void 0;
3224
- return ne(n, a) ? !0 : (ue(e, a), Array.isArray(n) && !n[_] && (n = new Proxy(n, k$2)), i.set.call(e, n), E(e, t, n), w(e, t), S(e, t, n, a), !0);
3327
+ /**
3328
+ * Trap for when a dto property is being updated. This will
3329
+ * mark the dto dirty and trigger an update. If an array is
3330
+ * passed, that array will be made reactive as well.
3331
+ */
3332
+ set(target, key, value, receiver) {
3333
+ if (typeof key === "symbol") return Reflect.set(target, key, value, receiver);
3334
+ const descriptor = target[DESCRIPTORS][key];
3335
+ if (!descriptor || !descriptor.set) return Reflect.set(target, key, value, receiver);
3336
+ const oldValue = descriptor.get?.call(target) ?? void 0;
3337
+ if (areEqual_default(value, oldValue)) return true;
3338
+ unrelateValueFrom_default(target, oldValue);
3339
+ if (Array.isArray(value) && !value[PROXY]) value = new Proxy(value, arrayProxy_default);
3340
+ descriptor.set.call(target, value);
3341
+ relateValueTo_default(target, key, value);
3342
+ markDtoDirty(target, key);
3343
+ triggerDto(target, key, value, oldValue);
3344
+ return true;
3225
3345
  }
3226
- }, fe = {
3227
- get(e, t, n) {
3228
- return t === `__v_isRef` ? !1 : t === _ ? !0 : t in e ? Reflect.get(e, t, n) : Reflect.get(e.value, t);
3346
+ };
3347
+ var refProxy_default = {
3348
+ /**
3349
+ * Trap for when a ref property is being accessed. The property
3350
+ * access is being tracked for further updates. If the requested
3351
+ * property is not a part of {Ref}, the get is proxied to the
3352
+ * underlying dto instance.
3353
+ *
3354
+ * A little trick with __v_isRef is done here, all the features
3355
+ * of refs are used by our dto, but we don't want Vue to treat
3356
+ * it as a ref. We return false here to trick Vue.
3357
+ */
3358
+ get(target, key, receiver) {
3359
+ if (key === "__v_isRef") return false;
3360
+ if (key === PROXY) return true;
3361
+ if (key in target) return Reflect.get(target, key, receiver);
3362
+ return Reflect.get(target.value, key);
3229
3363
  },
3230
- getOwnPropertyDescriptor(e, t) {
3231
- return Reflect.getOwnPropertyDescriptor(e.value, t);
3364
+ /**
3365
+ * Trap for when a descriptor of a property is requested, that
3366
+ * request is proxied to the underlying dto.
3367
+ */
3368
+ getOwnPropertyDescriptor(target, key) {
3369
+ return Reflect.getOwnPropertyDescriptor(target.value, key);
3232
3370
  },
3233
- ownKeys(e) {
3234
- return Reflect.ownKeys(e.value);
3371
+ /**
3372
+ * Trap for when the keys of the ref are requested, that request
3373
+ * is proxied to the underlying dto.
3374
+ */
3375
+ ownKeys(target) {
3376
+ return Reflect.ownKeys(target.value);
3235
3377
  },
3236
- set(e, t, n, r) {
3237
- return t in e ? Reflect.set(e, t, n, r) : Reflect.set(e.value, t, n);
3378
+ /**
3379
+ * Trap for when a ref property is being updated. If the property
3380
+ * is not part of {Ref}, the set is proxied to the underlying dto
3381
+ * instance. In that proxy, the dto will be marked dirty and an
3382
+ * update is triggered.
3383
+ */
3384
+ set(target, key, value, receiver) {
3385
+ if (key in target) return Reflect.set(target, key, value, receiver);
3386
+ return Reflect.set(target.value, key, value);
3238
3387
  }
3239
- }, pe = { construct(e, t, n) {
3240
- t = t.map((e) => Array.isArray(e) ? new Proxy(e, k$2) : e);
3241
- let r = customRef((r, i) => {
3242
- let a = markRaw(Reflect.construct(e, t, n));
3243
- a[l] = t, a[f] = !1, a[re] = r, a[ie$1] = i;
3244
- let s = new Proxy(a, de);
3388
+ };
3389
+ var classProxy_default = {
3390
+ /**
3391
+ * Trap for when a dto is being constructed. Reactivity is provided
3392
+ * to all arguments and a proxied custom ref is returned that references
3393
+ * the actual dto instance.
3394
+ */
3395
+ construct(target, argsArray, newTarget) {
3396
+ argsArray = argsArray.map((arg) => {
3397
+ if (!Array.isArray(arg)) return arg;
3398
+ return new Proxy(arg, arrayProxy_default);
3399
+ });
3400
+ const ref = customRef((track, trigger) => {
3401
+ const instance = markRaw(Reflect.construct(target, argsArray, newTarget));
3402
+ instance[ARGS] = argsArray;
3403
+ instance[DIRTY] = false;
3404
+ instance[TRACK] = track;
3405
+ instance[TRIGGER] = trigger;
3406
+ const proxied = new Proxy(instance, instanceProxy_default);
3245
3407
  return {
3246
- get: () => (r(), s),
3408
+ get: () => {
3409
+ track();
3410
+ return proxied;
3411
+ },
3247
3412
  set: () => void 0
3248
3413
  };
3249
3414
  });
3250
- return new Proxy(r, fe);
3415
+ return new Proxy(ref, refProxy_default);
3251
3416
  } };
3252
- function me() {
3253
- let e = this;
3254
- y(e);
3255
- let t = O[e[p]], n = new t(...e[l]);
3256
- for (let [e, t] of Object.entries(this[d])) t.set && (n[e] = v(this[e]) ? this[e].clone() : this[e]);
3257
- return n;
3417
+ /**
3418
+ * Returns a clone of the dto.
3419
+ */
3420
+ function clone_default() {
3421
+ const instance = this;
3422
+ assertDto_default(instance);
3423
+ const clazz = DTO_CLASS_MAP[instance[NAME]];
3424
+ const clone = new clazz(...instance[ARGS]);
3425
+ for (const [key, descriptor] of Object.entries(this[DESCRIPTORS])) {
3426
+ if (!descriptor.set) continue;
3427
+ clone[key] = isDto_default(this[key]) ? this[key].clone() : this[key];
3428
+ }
3429
+ return clone;
3258
3430
  }
3259
- function he(e) {
3260
- for (let t in e) {
3261
- let n = this[d][t];
3262
- v(this[t]) && typeof e[t] == `object` ? this[t].fill(e[t]) : n && n.set && (this[t] = e[t]);
3431
+ /**
3432
+ * Fills the dto with the given data.
3433
+ */
3434
+ function fill_default(data) {
3435
+ for (let key in data) {
3436
+ const descriptor = this[DESCRIPTORS][key];
3437
+ if (isDto_default(this[key]) && typeof data[key] === "object") this[key].fill(data[key]);
3438
+ else if (descriptor && descriptor.set) this[key] = data[key];
3263
3439
  }
3264
3440
  }
3265
- function ge$1() {
3266
- let e = {};
3267
- for (let t of this[g]) {
3268
- let n = this[t];
3269
- v(n) && (n = n.toJSON()), e[t] = n;
3441
+ /**
3442
+ * Returns the json object representation of the dto.
3443
+ */
3444
+ function toJSON_default() {
3445
+ const result = {};
3446
+ for (const property of this[PROPERTIES]) {
3447
+ let value = this[property];
3448
+ if (isDto_default(value)) value = value.toJSON();
3449
+ result[property] = value;
3270
3450
  }
3271
- return e;
3451
+ return result;
3272
3452
  }
3273
- function j$1(e) {
3274
- ve(e);
3275
- let t = Object.freeze(x$1(e)), a = Object.keys(t);
3276
- return K$1(e.prototype, d, t), K$1(e.prototype, p, e.name), K$1(e.prototype, g, a), K$1(e, Symbol.hasInstance, (t) => typeof t == `object` && t?.[p] === e.name), G$1(e, `clone`, me), G$1(e, `fill`, he), G$1(e, `toJSON`, ge$1), _e$1(e);
3453
+ /**
3454
+ * Provides reactivity to the decorated class.
3455
+ */
3456
+ function dto_default(clazz) {
3457
+ validate(clazz);
3458
+ const descriptors = Object.freeze(x(clazz));
3459
+ const properties = Object.keys(descriptors);
3460
+ K(clazz.prototype, DESCRIPTORS, descriptors);
3461
+ K(clazz.prototype, NAME, clazz.name);
3462
+ K(clazz.prototype, PROPERTIES, properties);
3463
+ K(clazz, Symbol.hasInstance, (instance) => typeof instance === "object" && instance?.[NAME] === clazz.name);
3464
+ G(clazz, "clone", clone_default);
3465
+ G(clazz, "fill", fill_default);
3466
+ G(clazz, "toJSON", toJSON_default);
3467
+ return proxy(clazz);
3277
3468
  }
3278
- function _e$1(e) {
3279
- let t = new Proxy(e, pe);
3280
- return O[e.name] = t, t;
3469
+ function proxy(clazz) {
3470
+ const proxied = new Proxy(clazz, classProxy_default);
3471
+ DTO_CLASS_MAP[clazz.name] = proxied;
3472
+ return proxied;
3281
3473
  }
3282
- function ve(e) {
3283
- let t = Object.getPrototypeOf(e.prototype);
3284
- if (p in t) throw Error(`⛔️ @dto ${e.name} cannot extend parent class which is also decorated with @dto ${t[p]}.`);
3474
+ function validate(clazz) {
3475
+ const parent = Object.getPrototypeOf(clazz.prototype);
3476
+ if (NAME in parent) throw new Error(`⛔️ @dto ${clazz.name} cannot extend parent class which is also decorated with @dto ${parent[NAME]}.`);
3285
3477
  }
3286
- function B(e, t, n, r) {
3287
- var i = arguments.length, a = i < 3 ? t : r === null ? r = Object.getOwnPropertyDescriptor(t, n) : r, o;
3288
- if (typeof Reflect == `object` && typeof Reflect.decorate == `function`) a = Reflect.decorate(e, t, n, r);
3289
- else for (var s = e.length - 1; s >= 0; s--) (o = e[s]) && (a = (i < 3 ? o(a) : i > 3 ? o(t, n, a) : o(t, n)) || a);
3290
- return i > 3 && a && Object.defineProperty(t, n, a), a;
3478
+ function __decorate(decorators, target, key, desc) {
3479
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3480
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3481
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
3482
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
3291
3483
  }
3292
- var V = class {
3484
+ var BlobResponse = class BlobResponse {
3293
3485
  get blob() {
3294
- return this.#e;
3486
+ return this.#blob;
3295
3487
  }
3296
3488
  get name() {
3297
- return this.#t;
3489
+ return this.#name;
3298
3490
  }
3299
- #e;
3300
- #t;
3301
- constructor(e, t) {
3302
- this.#e = e, this.#t = t;
3491
+ #blob;
3492
+ #name;
3493
+ constructor(blob, name) {
3494
+ this.#blob = blob;
3495
+ this.#name = name;
3303
3496
  }
3304
3497
  };
3305
- V = B([j$1], V);
3306
- var U = class {
3498
+ BlobResponse = __decorate([dto_default], BlobResponse);
3499
+ var Paginated = class Paginated {
3307
3500
  get items() {
3308
- return this.#e;
3501
+ return this.#items;
3309
3502
  }
3310
3503
  get page() {
3311
- return this.#t;
3504
+ return this.#page;
3312
3505
  }
3313
3506
  get pageSize() {
3314
- return this.#n;
3507
+ return this.#pageSize;
3315
3508
  }
3316
3509
  get pages() {
3317
- return this.#r;
3510
+ return this.#pages;
3318
3511
  }
3319
3512
  get total() {
3320
- return this.#i;
3513
+ return this.#total;
3321
3514
  }
3322
- #e;
3323
- #t;
3324
- #n;
3325
- #r;
3326
- #i;
3327
- constructor(e, t, n, r, i) {
3328
- this.#e = e, this.#t = t, this.#n = n, this.#r = r, this.#i = i;
3515
+ #items;
3516
+ #page;
3517
+ #pageSize;
3518
+ #pages;
3519
+ #total;
3520
+ constructor(items, page, pageSize, pages, total) {
3521
+ this.#items = items;
3522
+ this.#page = page;
3523
+ this.#pageSize = pageSize;
3524
+ this.#pages = pages;
3525
+ this.#total = total;
3329
3526
  }
3330
3527
  };
3331
- U = B([j$1], U);
3332
- var W = U;
3333
- var G = class {
3528
+ Paginated = __decorate([dto_default], Paginated);
3529
+ var Paginated_default = Paginated;
3530
+ var RequestError = class RequestError {
3334
3531
  get code() {
3335
- return this.#e;
3532
+ return this.#code;
3336
3533
  }
3337
3534
  get error() {
3338
- return this.#t;
3535
+ return this.#error;
3339
3536
  }
3340
3537
  get errorDescription() {
3341
- return this.#n;
3538
+ return this.#errorDescription;
3342
3539
  }
3343
3540
  get statusCode() {
3344
- return this.#r;
3541
+ return this.#statusCode;
3345
3542
  }
3346
- #e;
3347
- #t;
3348
- #n;
3349
- #r;
3350
- constructor(e, t, n, r) {
3351
- this.#e = e, this.#t = t, this.#n = n, this.#r = r;
3543
+ #code;
3544
+ #error;
3545
+ #errorDescription;
3546
+ #statusCode;
3547
+ constructor(code, error, errorDescription, statusCode) {
3548
+ this.#code = code;
3549
+ this.#error = error;
3550
+ this.#errorDescription = errorDescription;
3551
+ this.#statusCode = statusCode;
3352
3552
  }
3353
3553
  };
3354
- G = B([j$1], G);
3355
- var K = G;
3356
- var q = class {
3554
+ RequestError = __decorate([dto_default], RequestError);
3555
+ var RequestError_default = RequestError;
3556
+ var ValidationError = class ValidationError {
3357
3557
  get code() {
3358
- return this.#e;
3558
+ return this.#code;
3359
3559
  }
3360
3560
  get error() {
3361
- return this.#t;
3561
+ return this.#error;
3362
3562
  }
3363
3563
  get errorDescription() {
3364
- return this.#n;
3564
+ return this.#errorDescription;
3365
3565
  }
3366
3566
  get errors() {
3367
- return this.#r;
3567
+ return this.#errors;
3368
3568
  }
3369
3569
  get params() {
3370
- return this.#i;
3570
+ return this.#params;
3371
3571
  }
3372
- #e;
3373
- #t;
3374
- #n;
3375
- #r;
3376
- #i;
3377
- constructor(e, t, n, r, i) {
3378
- this.#e = e, this.#t = t, this.#n = n, this.#r = r, this.#i = i;
3572
+ #code;
3573
+ #error;
3574
+ #errorDescription;
3575
+ #errors;
3576
+ #params;
3577
+ constructor(code, error, errorDescription, errors, params) {
3578
+ this.#code = code;
3579
+ this.#error = error;
3580
+ this.#errorDescription = errorDescription;
3581
+ this.#errors = errors;
3582
+ this.#params = params;
3379
3583
  }
3380
3584
  };
3381
- q = B([j$1], q);
3382
- var J = q, Y;
3383
- var X = Y = class {
3384
- static parsePaginatedAdapter(e, t) {
3385
- return new W(e.items.map(t), e.page, e.page_size, e.pages, e.total);
3585
+ ValidationError = __decorate([dto_default], ValidationError);
3586
+ var ValidationError_default = ValidationError;
3587
+ var _HttpAdapter;
3588
+ var HttpAdapter = _HttpAdapter = class HttpAdapter {
3589
+ static parsePaginatedAdapter(data, adapterMethod) {
3590
+ return new Paginated_default(data.items.map(adapterMethod), data.page, data.page_size, data.pages, data.total);
3386
3591
  }
3387
- static parseFileNameFromContentDispositionHeader(t) {
3388
- let n = `download-${DateTime.now().toFormat(`yyyy-MM-dd HH-mm-ss`)}`;
3389
- if (!t.startsWith(`attachment`)) return n;
3390
- let r = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(t);
3391
- return (r?.length || 0) < 2 ? n : r[1].replaceAll(`'`, ``).replaceAll(`"`, ``).replaceAll(`/`, `-`).replaceAll(`:`, `-`);
3592
+ static parseFileNameFromContentDispositionHeader(header) {
3593
+ const defaultFilename = `download-${DateTime.now().toFormat("yyyy-MM-dd HH-mm-ss")}`;
3594
+ if (!header.startsWith("attachment")) return defaultFilename;
3595
+ const matches = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(header);
3596
+ if ((matches?.length || 0) < 2) return defaultFilename;
3597
+ return matches[1].replaceAll("'", "").replaceAll("\"", "").replaceAll("/", "-").replaceAll(":", "-");
3392
3598
  }
3393
- static parseRequestError(e, t) {
3394
- return new K(e.code, e.error, e.error_description, t);
3599
+ static parseRequestError(data, statusCode) {
3600
+ return new RequestError_default(data.code, data.error, data.error_description, statusCode);
3395
3601
  }
3396
- static parseValidationError(e) {
3397
- let t;
3398
- return e.errors && (t = {}, Object.entries(e.errors).forEach(([e, n]) => {
3399
- t[e] = Y.parseValidationError(n);
3400
- })), new J(e.code, e.error, e.error_description, t, e.params);
3602
+ static parseValidationError(data) {
3603
+ let errors;
3604
+ if (data.errors) {
3605
+ errors = {};
3606
+ Object.entries(data.errors).forEach(([key, value]) => {
3607
+ errors[key] = _HttpAdapter.parseValidationError(value);
3608
+ });
3609
+ }
3610
+ return new ValidationError_default(data.code, data.error, data.error_description, errors, data.params);
3401
3611
  }
3402
3612
  };
3403
- X = Y = B([c], X);
3613
+ HttpAdapter = _HttpAdapter = __decorate([adapter_default], HttpAdapter);
3404
3614
  RegExp(`[a-z]`), RegExp(`[A-Z]`), RegExp(`[0-9]`), RegExp(`[!"#$%&'()*+,-./:;<=>?@[\\\\\\]^_\`{|}~]`);
3405
3615
  //#endregion
3406
3616
  //#region ../internals/dist/composable-5ooZTjm_.js