@bynder/compact-view 5.2.2 → 5.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/AccessToken2.js +1 -1
  2. package/ActiveFilters.js +49 -50
  3. package/AddMedia.js +19 -18
  4. package/Advanced.js +13 -13
  5. package/App.js +60 -59
  6. package/Arrow.js +1 -1
  7. package/AssetFilter.js +38 -38
  8. package/AssetItem.js +10 -17
  9. package/AssetList.js +5 -5
  10. package/AssetTypeItem.js +21 -21
  11. package/AssetsView.js +13 -13
  12. package/Axios2.js +82 -76
  13. package/AxiosError.js +36 -35
  14. package/ButtonAction.js +1 -1
  15. package/CanceledError.js +15 -8
  16. package/Card.js +1 -1
  17. package/Chip.js +1 -1
  18. package/CollectionCard.js +22 -22
  19. package/CollectionItem.js +9 -9
  20. package/CollectionList.js +5 -5
  21. package/CollectionView.js +11 -11
  22. package/ColorPicker.js +1 -1
  23. package/ColorPickerSolid.js +3 -3
  24. package/ColorPickerWithOpacity.js +3 -3
  25. package/Component.js +158 -0
  26. package/Component2.js +4 -0
  27. package/ConfigContext.js +7 -8
  28. package/Container.js +1 -1
  29. package/ContextAction.js +1 -1
  30. package/ControlGroup.js +6 -6
  31. package/Dat.js +33 -32
  32. package/DatDropdownItem.js +1 -1
  33. package/DesignSystemProvider.js +7 -7
  34. package/DirectionSelect.js +11 -10
  35. package/DomainInput.js +19 -11
  36. package/Draggable.js +337 -0
  37. package/Draggable2.js +4 -0
  38. package/DraggableCore.js +312 -0
  39. package/DraggableCore2.js +4 -0
  40. package/Dropdown.js +37 -37
  41. package/Dropdown2.js +1 -1
  42. package/DropdownListItem.js +1 -1
  43. package/FieldSelect.js +19 -17
  44. package/FileSelector.js +38 -37
  45. package/FontPicker.js +1 -1
  46. package/Form.js +1 -1
  47. package/Header.js +5 -4
  48. package/HttpStatusCode.js +7 -1
  49. package/InfiniteScroll.js +1 -1
  50. package/InlineBanner.js +1 -1
  51. package/Input.js +1 -1
  52. package/InterceptorManager.js +2 -1
  53. package/Item.js +8 -8
  54. package/Item4.js +2 -2
  55. package/LeftArrow.js +1 -1
  56. package/ListItem2.js +1 -1
  57. package/ModalBase.js +15 -15
  58. package/NoResults.js +1 -1
  59. package/Option_new.js +36 -29
  60. package/ReactPropTypesSecret.js +10 -0
  61. package/RightArrow.js +1 -1
  62. package/SearchInput.js +1 -1
  63. package/SearchInput2.js +1 -1
  64. package/SelectionFooter.js +41 -31
  65. package/Shield.js +2 -2
  66. package/Smartfilters_new.js +107 -98
  67. package/StatefulAssetList.js +50 -50
  68. package/StoreInitializer.js +32 -16
  69. package/SwitchNLS.js +1 -1
  70. package/TagItem.js +15 -15
  71. package/Tags.js +1 -1
  72. package/Toolbar.js +23 -20
  73. package/Tooltip2.js +1 -1
  74. package/ViewSwitch.js +17 -15
  75. package/_commonjsHelpers.js +28 -3
  76. package/adapters.js +54 -42
  77. package/api/filterAssets.d.ts +1 -1
  78. package/api/getAssets.d.ts +1 -1
  79. package/api/getFilters.d.ts +1 -1
  80. package/api/rest/index.d.ts +1 -1
  81. package/api/rest/types.d.ts +1 -1
  82. package/api2.js +1 -1
  83. package/asset.type.js +1 -1
  84. package/axios.js +1 -1
  85. package/bodyScrollLock.esm.js +68 -0
  86. package/buildURL.js +13 -15
  87. package/checkGlobals.js +1 -1
  88. package/cjs.js +7 -0
  89. package/cjs2.js +15 -0
  90. package/cjs3.js +4 -0
  91. package/clsx.m.js +6 -0
  92. package/clsx.m2.js +15 -0
  93. package/combineMetaproperties.js +3 -1
  94. package/composeSignals.js +1 -1
  95. package/cookieStore.js +1 -1
  96. package/cookies.js +13 -11
  97. package/currentScopes.js +1 -1
  98. package/data.js +1 -1
  99. package/devUtils.js +1 -1
  100. package/dispatchRequest.js +5 -5
  101. package/domFns.js +151 -0
  102. package/domFns2.js +4 -0
  103. package/factoryWithThrowingShims.js +52 -0
  104. package/fetch2.js +156 -128
  105. package/filter/AssetFilterContext.d.ts +3 -3
  106. package/getPrefix.js +35 -0
  107. package/getPrefix2.js +4 -0
  108. package/goober.modern.js +75 -0
  109. package/handlers.js +1 -1
  110. package/iconBase.js +56 -0
  111. package/iconContext.js +12 -0
  112. package/iconsManifest.js +222 -0
  113. package/index-esm.js +1 -4
  114. package/index.browser.js +1 -1
  115. package/index.m.js +9 -0
  116. package/index.m2.js +17 -0
  117. package/index10.js +1 -1
  118. package/index11.js +181 -15
  119. package/index112.js +1 -1
  120. package/index12.js +313 -36
  121. package/index13.js +5 -2430
  122. package/index14.js +3 -557
  123. package/index15.js +15 -55
  124. package/index16.js +3 -2
  125. package/index17.js +3 -87
  126. package/index18.js +36 -7
  127. package/index19.js +3 -60
  128. package/index20.js +2429 -12
  129. package/index21.js +557 -10
  130. package/index22.js +1 -1
  131. package/index23.js +119 -6
  132. package/index24.js +39 -7
  133. package/index25.js +2 -5
  134. package/index26.js +86 -9
  135. package/index27.js +55 -8
  136. package/index28.js +6 -636
  137. package/index29.js +8692 -74
  138. package/index3.js +1684 -5
  139. package/index30.js +2 -5
  140. package/index31.js +4 -20
  141. package/index310.js +2 -0
  142. package/index32.js +11 -2
  143. package/index33.js +5083 -4
  144. package/index34.js +2 -18
  145. package/index35.js +59 -5
  146. package/index36.js +2 -2
  147. package/index37.js +13 -11
  148. package/index38.js +46 -10
  149. package/index39.js +6 -12
  150. package/index4.js +5 -1684
  151. package/index40.js +8 -11
  152. package/index41.js +26 -18
  153. package/index42.js +2 -64
  154. package/index43.js +63 -5
  155. package/index44.js +9 -55
  156. package/index45.js +7 -67
  157. package/index46.js +8 -31
  158. package/index47.js +5 -11
  159. package/index48.js +10 -121
  160. package/index49.js +9 -86
  161. package/index5.js +215 -23
  162. package/index50.js +636 -7
  163. package/index51.js +74 -11
  164. package/index52.js +4 -13
  165. package/index53.js +19 -13
  166. package/index54.js +4 -6
  167. package/index55.js +18 -7
  168. package/index56.js +5 -14
  169. package/index57.js +10 -28
  170. package/index58.js +10 -15
  171. package/index59.js +15 -0
  172. package/index6.js +250 -299
  173. package/index60.js +13 -0
  174. package/index61.js +21 -0
  175. package/index62.js +8 -0
  176. package/index63.js +57 -0
  177. package/index64.js +4 -0
  178. package/index65.js +69 -0
  179. package/index66.js +33 -0
  180. package/index67.js +13 -0
  181. package/index68.js +123 -0
  182. package/index69.js +88 -0
  183. package/index7.js +25 -2
  184. package/index70.js +10 -0
  185. package/index71.js +13 -0
  186. package/index72.js +13 -225
  187. package/index73.js +16 -0
  188. package/index74.js +9 -0
  189. package/index75.js +228 -0
  190. package/index76.js +9 -0
  191. package/index77.js +17 -0
  192. package/index78.js +31 -0
  193. package/index79.js +18 -0
  194. package/index8.js +1537 -1536
  195. package/index9.js +1 -1
  196. package/isAbsoluteURL.js +1 -1
  197. package/isURLSameOrigin.js +1 -1
  198. package/localization.js +15 -15
  199. package/log.js +14 -0
  200. package/log2.js +4 -0
  201. package/matchRequestUrl.js +1 -1
  202. package/mergeConfig.js +37 -32
  203. package/notify.js +2 -2
  204. package/package.json +1 -1
  205. package/positionFns.js +101 -0
  206. package/positionFns2.js +4 -0
  207. package/react-laag.esm.js +957 -0
  208. package/react.js +8 -8
  209. package/react2.js +9 -9
  210. package/resolveConfig.js +23 -23
  211. package/select/add-media/AddMedia.d.ts +3 -1
  212. package/select/current-selection/SelectedItems.d.ts +1 -1
  213. package/shims.js +29 -0
  214. package/shims2.js +4 -0
  215. package/store/StoreInitializer.d.ts +5 -1
  216. package/store/useAssetFilterStore.d.ts +55 -0
  217. package/store/useSelectionStore.d.ts +47 -0
  218. package/styled-components.browser.esm.js +2 -2
  219. package/throttle.js +1 -1
  220. package/toURLEncodedForm.js +11 -10
  221. package/tokenExpirationHelper.js +1 -1
  222. package/transformData.js +1 -1
  223. package/transitional.js +4 -3
  224. package/useAssetFilterStore.js +152 -0
  225. package/useDatStore.js +1 -1
  226. package/useEffectEvent.js +7 -7
  227. package/useFonts.js +1 -1
  228. package/useOrderingStore.js +1 -1
  229. package/useRouterStore.js +1 -1
  230. package/useSearchStore.js +1 -1
  231. package/useSelectionStore.js +131 -0
  232. package/useSimilaritySearchStore.js +1 -1
  233. package/useTranslate.js +1 -1
  234. package/utils/combineMetaproperties.d.ts +2 -0
  235. package/utils6.js +160 -118
  236. package/xhr.js +47 -46
  237. package/AssetFilterContext.js +0 -161
  238. package/Middleware.js +0 -49
  239. package/SelectionContext.js +0 -143
  240. package/middleware2.js +0 -177
  241. package/select/SelectionContext.d.ts +0 -30
package/index6.js CHANGED
@@ -1,315 +1,266 @@
1
- import { A as w } from "./AccessToken.js";
2
- import c, { useState as g, useEffect as x, useContext as E } from "react";
3
- class v {
4
- constructor(e) {
5
- this.input = e, this.index = 0, this.done = !1, this.value = "", this.value = this.input.charAt(0);
6
- }
7
- next() {
8
- return ++this.index >= this.input.length && (this.done = !0), this.value = this.input.charAt(this.index);
9
- }
10
- croak() {
11
- throw new Error(`[${this.input}]. Unexpected character "${this.value}" on position ${this.index}.`);
1
+ import * as i from "react";
2
+ import { keyframes as c, css as x, styled as l, setup as v } from "./goober.modern.js";
3
+ var w = (t) => typeof t == "function", u = (t, e) => w(t) ? t(e) : t, $ = /* @__PURE__ */ (() => {
4
+ let t = 0;
5
+ return () => (++t).toString();
6
+ })(), E = /* @__PURE__ */ (() => {
7
+ let t;
8
+ return () => {
9
+ if (t === void 0 && typeof window < "u") {
10
+ let e = matchMedia("(prefers-reduced-motion: reduce)");
11
+ t = !e || e.matches;
12
+ }
13
+ return t;
14
+ };
15
+ })(), k = 20, y = "default", b = (t, e) => {
16
+ let { toastLimit: a } = t.settings;
17
+ switch (e.type) {
18
+ case 0:
19
+ return { ...t, toasts: [e.toast, ...t.toasts].slice(0, a) };
20
+ case 1:
21
+ return { ...t, toasts: t.toasts.map((r) => r.id === e.toast.id ? { ...r, ...e.toast } : r) };
22
+ case 2:
23
+ let { toast: o } = e;
24
+ return b(t, { type: t.toasts.find((r) => r.id === o.id) ? 1 : 0, toast: o });
25
+ case 3:
26
+ let { toastId: n } = e;
27
+ return { ...t, toasts: t.toasts.map((r) => r.id === n || n === void 0 ? { ...r, dismissed: !0, visible: !1 } : r) };
28
+ case 4:
29
+ return e.toastId === void 0 ? { ...t, toasts: [] } : { ...t, toasts: t.toasts.filter((r) => r.id !== e.toastId) };
30
+ case 5:
31
+ return { ...t, pausedAt: e.time };
32
+ case 6:
33
+ let d = e.time - (t.pausedAt || 0);
34
+ return { ...t, pausedAt: void 0, toasts: t.toasts.map((r) => ({ ...r, pauseDuration: r.pauseDuration + d })) };
12
35
  }
36
+ }, I = [], z = { toasts: [], pausedAt: void 0, settings: { toastLimit: k } }, p = {}, g = (t, e = y) => {
37
+ p[e] = b(p[e] || z, t), I.forEach(([a, o]) => {
38
+ a === e && o(p[e]);
39
+ });
40
+ }, h = (t) => Object.keys(p).forEach((e) => g(t, e)), A = (t) => Object.keys(p).find((e) => p[e].toasts.some((a) => a.id === t)), f = (t = y) => (e) => {
41
+ g(e, t);
42
+ }, j = (t, e = "blank", a) => ({ createdAt: Date.now(), visible: !0, dismissed: !1, type: e, ariaProps: { role: "status", "aria-live": "polite" }, message: t, pauseDuration: 0, ...a, id: a?.id || $() }), m = (t) => (e, a) => {
43
+ let o = j(e, t, a);
44
+ return f(o.toasterId || A(o.id))({ type: 2, toast: o }), o.id;
45
+ }, s = (t, e) => m("blank")(t, e);
46
+ s.error = m("error");
47
+ s.success = m("success");
48
+ s.loading = m("loading");
49
+ s.custom = m("custom");
50
+ s.dismiss = (t, e) => {
51
+ let a = { type: 3, toastId: t };
52
+ e ? f(e)(a) : h(a);
53
+ };
54
+ s.dismissAll = (t) => s.dismiss(void 0, t);
55
+ s.remove = (t, e) => {
56
+ let a = { type: 4, toastId: t };
57
+ e ? f(e)(a) : h(a);
58
+ };
59
+ s.removeAll = (t) => s.remove(void 0, t);
60
+ s.promise = (t, e, a) => {
61
+ let o = s.loading(e.loading, { ...a, ...a?.loading });
62
+ return typeof t == "function" && (t = t()), t.then((n) => {
63
+ let d = e.success ? u(e.success, n) : void 0;
64
+ return d ? s.success(d, { id: o, ...a, ...a?.success }) : s.dismiss(o), n;
65
+ }).catch((n) => {
66
+ let d = e.error ? u(e.error, n) : void 0;
67
+ d ? s.error(d, { id: o, ...a, ...a?.error }) : s.dismiss(o);
68
+ }), t;
69
+ };
70
+ var D = c`
71
+ from {
72
+ transform: scale(0) rotate(45deg);
73
+ opacity: 0;
13
74
  }
14
- var u;
15
- (function(t) {
16
- t[t.Plural = 0] = "Plural", t[t.Select = 1] = "Select", t[t.Text = 2] = "Text", t[t.Variable = 3] = "Variable";
17
- })(u || (u = {}));
18
- const f = "{", l = "}", p = ",", y = [f, l, p], L = "plural", C = "select";
19
- class P {
20
- constructor(e) {
21
- this.input = new v(e);
22
- }
23
- next() {
24
- return this.input.value === f ? this.readVariable() : this.readText();
25
- }
26
- skip(e) {
27
- e !== this.input.value && this.input.croak(), this.input.next();
28
- }
29
- readWhile(e) {
30
- let n = "";
31
- for (; !this.input.done && e(this.input.value); )
32
- n += this.input.value, this.input.next();
33
- return n;
34
- }
35
- readVariable() {
36
- this.skip(f);
37
- const e = this.readWhile((r) => !S(r)).trim();
38
- if (e.length === 0 && this.input.croak(), this.input.value === l)
39
- return this.skip(l), {
40
- type: u.Variable,
41
- value: e
42
- };
43
- this.skip(p);
44
- const n = this.readVariableType();
45
- return {
46
- options: this.readVariableOptions(),
47
- type: n,
48
- value: e
49
- };
50
- }
51
- readText() {
52
- return {
53
- type: u.Text,
54
- value: this.readWhile((e) => e !== f && e !== l)
55
- };
56
- }
57
- readVariableType() {
58
- const e = this.readWhile((n) => n !== p).trim();
59
- if (e === L)
60
- return u.Plural;
61
- if (e === C)
62
- return u.Select;
63
- this.input.croak();
64
- }
65
- readVariableOptions() {
66
- this.skip(p);
67
- const e = {};
68
- for (; this.input.value !== l; )
69
- e[this.readText().value.trim()] = this.readExpression();
70
- return this.skip(l), e;
71
- }
72
- readExpression() {
73
- const e = [];
74
- for (this.skip(f); this.input.value !== l; )
75
- e.push(this.next());
76
- return this.skip(l), e;
77
- }
75
+ to {
76
+ transform: scale(1) rotate(45deg);
77
+ opacity: 1;
78
+ }`, L = c`
79
+ from {
80
+ transform: scale(0);
81
+ opacity: 0;
78
82
  }
79
- function S(t) {
80
- return y.includes(t);
83
+ to {
84
+ transform: scale(1);
85
+ opacity: 1;
86
+ }`, P = c`
87
+ from {
88
+ transform: scale(0) rotate(90deg);
89
+ opacity: 0;
81
90
  }
82
- const R = [
83
- "campaigns",
84
- "Campaigns",
85
- "Campaign",
86
- "campaign",
87
- "Collection",
88
- "collections",
89
- "collection",
90
- "Collections",
91
- "limitedUsage",
92
- "LIMITED",
93
- "jobs",
94
- "Jobs",
95
- "job",
96
- "Job",
97
- "Guidelines",
98
- "WorkflowCalendar",
99
- "AssetBank",
100
- "Brandstore",
101
- "Reporter",
102
- "Brand",
103
- "brands",
104
- "categories",
105
- "Brands",
106
- "brand",
107
- "Asset",
108
- "Subbrand",
109
- "subbrands",
110
- "Assets",
111
- "assets",
112
- "asset",
113
- "subbrand",
114
- "Subbrands",
115
- "category",
116
- "task",
117
- "Stage",
118
- "accountable",
119
- "tasks",
120
- "stage",
121
- "Categories",
122
- "Category",
123
- "stages",
124
- "Task",
125
- "Stages",
126
- "Tasks",
127
- "Accountable"
128
- ];
129
- function I({ locale: t, translation: e, values: n, wordReplacements: r }) {
130
- const s = new P(e), a = [];
131
- for (; !s.input.done; )
132
- o(s.next());
133
- return a;
134
- function o({ options: h, type: d, value: i }) {
135
- if (d === u.Variable) {
136
- if (R.includes(i)) {
137
- r[i] ? a.push(r[i]) : a.push(i);
138
- return;
139
- }
140
- a.push(n[i]);
141
- return;
142
- }
143
- if (!h) {
144
- a.push(i);
145
- return;
146
- }
147
- if (d === u.Select) {
148
- h[n[i]].map(o);
149
- return;
150
- }
151
- const m = t.replace("_", "-");
152
- h[new Intl.PluralRules(m).select(n[i])].map(o);
91
+ to {
92
+ transform: scale(1) rotate(90deg);
93
+ opacity: 1;
94
+ }`, O = l("div")`
95
+ width: 20px;
96
+ opacity: 0;
97
+ height: 20px;
98
+ border-radius: 10px;
99
+ background: ${(t) => t.primary || "#ff4b4b"};
100
+ position: relative;
101
+ transform: rotate(45deg);
102
+
103
+ animation: ${D} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
104
+ forwards;
105
+ animation-delay: 100ms;
106
+
107
+ &:after,
108
+ &:before {
109
+ content: '';
110
+ animation: ${L} 0.15s ease-out forwards;
111
+ animation-delay: 150ms;
112
+ position: absolute;
113
+ border-radius: 3px;
114
+ opacity: 0;
115
+ background: ${(t) => t.secondary || "#fff"};
116
+ bottom: 9px;
117
+ left: 4px;
118
+ height: 2px;
119
+ width: 12px;
153
120
  }
154
- }
155
- function k(t) {
156
- return t || "en_US";
157
- }
158
- class z {
159
- constructor(e, n, r) {
160
- this.memo = {}, this.onError = console.error, this.translateParts = (s, a) => {
161
- const o = this.getTranslationById(s);
162
- try {
163
- return I({
164
- locale: this.locale,
165
- translation: o,
166
- values: a,
167
- wordReplacements: this.wordReplacements
168
- });
169
- } catch (h) {
170
- return this.onError(h), [o];
171
- }
172
- }, this.translate = (s, a = {}) => this.translateParts(s, a).join(""), this.getTranslationById = (s) => {
173
- if (!this.memo[s]) {
174
- let a = this.translations[s];
175
- typeof a != "string" && (this.onError(new Error(`Localization: Missing translation with ID "${s}"`)), a = s), this.memo[s] = a;
176
- }
177
- return this.memo[s];
178
- }, this.locale = k(n), r ? (this.translations = {
179
- ...e,
180
- ...r.translations
181
- }, this.wordReplacements = r.wordReplacements) : (this.translations = {
182
- ...e
183
- }, this.wordReplacements = {});
121
+
122
+ &:before {
123
+ animation: ${P} 0.15s ease-out forwards;
124
+ animation-delay: 180ms;
125
+ transform: rotate(90deg);
184
126
  }
185
- }
186
- const j = (t) => Object.entries(t);
187
- async function F(t) {
188
- const e = {
189
- translations: {},
190
- wordReplacements: {}
191
- };
192
- if (!t.addCustomTranslations)
193
- return e;
194
- try {
195
- const n = await V(), r = _(n), s = await fetch(r, {
196
- method: "GET",
197
- headers: {
198
- "Content-Type": "application/json"
199
- }
200
- });
201
- if (s.ok) {
202
- const o = await s.json();
203
- return U(o, k(t.locale));
204
- }
205
- const a = await s.text();
206
- throw new Error(a);
207
- } catch (n) {
208
- return console.error("Localization: Failed to fetch custom translations.", n), e;
127
+ `, S = c`
128
+ from {
129
+ transform: rotate(0deg);
209
130
  }
210
- }
211
- function _(t) {
212
- return `/v7/portal/portals/${t}/custom-translations`;
213
- }
214
- async function V() {
215
- try {
216
- const t = await w.getJWT();
217
- return w.decodeJWT(t).account_id;
218
- } catch {
219
- const e = await fetch("/v7/idp/access-tokens/userless-by-session").then((r) => r.json()).then((r) => r.access_token);
220
- return w.decodeJWT(e).account_id;
131
+ to {
132
+ transform: rotate(360deg);
221
133
  }
134
+ `, T = l("div")`
135
+ width: 12px;
136
+ height: 12px;
137
+ box-sizing: border-box;
138
+ border: 2px solid;
139
+ border-radius: 100%;
140
+ border-color: ${(t) => t.secondary || "#e0e0e0"};
141
+ border-right-color: ${(t) => t.primary || "#616161"};
142
+ animation: ${S} 1s linear infinite;
143
+ `, _ = c`
144
+ from {
145
+ transform: scale(0) rotate(45deg);
146
+ opacity: 0;
222
147
  }
223
- function U(t, e) {
224
- var n;
225
- const r = {
226
- translations: ((n = t.customTranslations) === null || n === void 0 ? void 0 : n[e]) || {},
227
- wordReplacements: {}
228
- };
229
- for (const [s, a] of j(t.wordReplacements))
230
- typeof a == "string" && a.trim().length > 0 && (r.wordReplacements[s] = a);
231
- return r;
148
+ to {
149
+ transform: scale(1) rotate(45deg);
150
+ opacity: 1;
151
+ }`, C = c`
152
+ 0% {
153
+ height: 0;
154
+ width: 0;
155
+ opacity: 0;
232
156
  }
233
- async function A(t) {
234
- if (!t.forceFallback) {
235
- if (t.locale === "en_US")
236
- return b(t.fetchFallback);
237
- const [e, n] = await Promise.all([
238
- b(t.fetchFallback),
239
- W(t)
240
- ]);
241
- return {
242
- ...e,
243
- ...n
244
- };
245
- }
246
- return b(t.fetchFallback);
157
+ 40% {
158
+ height: 0;
159
+ width: 6px;
160
+ opacity: 1;
247
161
  }
248
- function b(t) {
249
- try {
250
- return t();
251
- } catch (e) {
252
- return console.error("Localization: Failed to fetch fallback.", e), Promise.resolve({});
162
+ 100% {
163
+ opacity: 1;
164
+ height: 10px;
165
+ }`, F = l("div")`
166
+ width: 20px;
167
+ opacity: 0;
168
+ height: 20px;
169
+ border-radius: 10px;
170
+ background: ${(t) => t.primary || "#61d345"};
171
+ position: relative;
172
+ transform: rotate(45deg);
173
+
174
+ animation: ${_} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
175
+ forwards;
176
+ animation-delay: 100ms;
177
+ &:after {
178
+ content: '';
179
+ box-sizing: border-box;
180
+ animation: ${C} 0.2s ease-out forwards;
181
+ opacity: 0;
182
+ animation-delay: 200ms;
183
+ position: absolute;
184
+ border-right: 2px solid;
185
+ border-bottom: 2px solid;
186
+ border-color: ${(t) => t.secondary || "#fff"};
187
+ bottom: 6px;
188
+ left: 6px;
189
+ height: 10px;
190
+ width: 6px;
253
191
  }
192
+ `, N = l("div")`
193
+ position: absolute;
194
+ `, R = l("div")`
195
+ position: relative;
196
+ display: flex;
197
+ justify-content: center;
198
+ align-items: center;
199
+ min-width: 20px;
200
+ min-height: 20px;
201
+ `, H = c`
202
+ from {
203
+ transform: scale(0.6);
204
+ opacity: 0.4;
254
205
  }
255
- async function W(t) {
256
- try {
257
- const e = B(t), r = await fetch(e, {
258
- method: "GET",
259
- headers: {
260
- "Content-Type": "application/json"
261
- }
262
- });
263
- if (r.ok)
264
- return r.json();
265
- const s = await r.text();
266
- throw new Error(s);
267
- } catch (e) {
268
- return console.error("Localization: Failed to fetch from the service.", e), {};
206
+ to {
207
+ transform: scale(1);
208
+ opacity: 1;
209
+ }`, M = l("div")`
210
+ position: relative;
211
+ transform: scale(0.6);
212
+ opacity: 0.4;
213
+ min-width: 20px;
214
+ animation: ${H} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
215
+ forwards;
216
+ `, Q = ({ toast: t }) => {
217
+ let { icon: e, type: a, iconTheme: o } = t;
218
+ return e !== void 0 ? typeof e == "string" ? i.createElement(M, null, e) : e : a === "blank" ? null : i.createElement(R, null, i.createElement(T, { ...o }), a !== "loading" && i.createElement(N, null, a === "error" ? i.createElement(O, { ...o }) : i.createElement(F, { ...o })));
219
+ }, V = (t) => `
220
+ 0% {transform: translate3d(0,${t * -200}%,0) scale(.6); opacity:.5;}
221
+ 100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
222
+ `, W = (t) => `
223
+ 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
224
+ 100% {transform: translate3d(0,${t * -150}%,-1px) scale(.6); opacity:0;}
225
+ `, Y = "0%{opacity:0;} 100%{opacity:1;}", Z = "0%{opacity:1;} 100%{opacity:0;}", q = l("div")`
226
+ display: flex;
227
+ align-items: center;
228
+ background: #fff;
229
+ color: #363636;
230
+ line-height: 1.3;
231
+ will-change: transform;
232
+ box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
233
+ max-width: 350px;
234
+ pointer-events: auto;
235
+ padding: 8px 10px;
236
+ border-radius: 8px;
237
+ `, B = l("div")`
238
+ display: flex;
239
+ justify-content: center;
240
+ margin: 4px 10px;
241
+ color: inherit;
242
+ flex: 1 1 auto;
243
+ white-space: pre-line;
244
+ `, G = (t, e) => {
245
+ let a = t.includes("top") ? 1 : -1, [o, n] = E() ? [Y, Z] : [V(a), W(a)];
246
+ return { animation: e ? `${c(o)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards` : `${c(n)} 0.4s forwards cubic-bezier(.06,.71,.55,1)` };
247
+ };
248
+ i.memo(({ toast: t, position: e, style: a, children: o }) => {
249
+ let n = t.height ? G(t.position || e || "top-center", t.visible) : { opacity: 0 }, d = i.createElement(Q, { toast: t }), r = i.createElement(B, { ...t.ariaProps }, u(t.message, t));
250
+ return i.createElement(q, { className: t.className, style: { ...n, ...a, ...t.style } }, typeof o == "function" ? o({ icon: d, message: r }) : i.createElement(i.Fragment, null, d, r));
251
+ });
252
+ v(i.createElement);
253
+ x`
254
+ z-index: 9999;
255
+ > * {
256
+ pointer-events: auto;
269
257
  }
270
- }
271
- function B(t) {
272
- var e;
273
- const n = new URLSearchParams({
274
- module: t.project,
275
- locale: k(t.locale)
276
- });
277
- return !((e = t.features) === null || e === void 0) && e.length && n.append("features", t.features.join(",")), "/v7/localization/keys/?" + n;
278
- }
279
- const T = c.createContext(void 0);
280
- function O({ children: t, translations: e, onError: n, ...r }) {
281
- const [s, a] = g(e), [o, h] = g({
282
- translations: {},
283
- wordReplacements: {}
284
- });
285
- if (x(() => {
286
- s || Promise.all([A(r), F(r)]).then(([i, m]) => {
287
- a(i), h(m);
288
- });
289
- }, [s, r]), !s)
290
- return null;
291
- const d = new z(s, r.locale, o);
292
- return n && (d.onError = n), c.createElement(T.Provider, { value: d }, t);
293
- }
294
- function D({ id: t, ...e }) {
295
- const n = E(T);
296
- if (!n)
297
- throw new Error("Localization: <Translate /> cannot be used without <LocalizationProvider />");
298
- return c.createElement(c.Fragment, null, n.translateParts(t, e).map((r, s) => c.isValidElement(r) ? c.cloneElement(r, {
299
- key: s
300
- }) : c.createElement(c.Fragment, { key: s }, r)));
301
- }
302
- function N() {
303
- const t = E(T);
304
- if (!t)
305
- throw new Error("Localization: useTranslate() cannot be used without <LocalizationProvider />");
306
- return {
307
- translate: t.translate
308
- };
309
- }
258
+ `;
310
259
  export {
311
- z as Localization,
312
- O as LocalizationProvider,
313
- D as Translate,
314
- N as useTranslate
260
+ F as CheckmarkIcon,
261
+ O as ErrorIcon,
262
+ T as LoaderIcon,
263
+ Q as ToastIcon,
264
+ u as resolveValue,
265
+ s as toast
315
266
  };
package/index60.js ADDED
@@ -0,0 +1,13 @@
1
+ import m from "./index46.js";
2
+ import f from "./index72.js";
3
+ import o from "./index73.js";
4
+ import i from "./index47.js";
5
+ var u = 6048e5;
6
+ function p(t, r) {
7
+ i(1, arguments);
8
+ var e = m(t), a = f(e, r).getTime() - o(e, r).getTime();
9
+ return Math.round(a / u) + 1;
10
+ }
11
+ export {
12
+ p as default
13
+ };
package/index61.js ADDED
@@ -0,0 +1,21 @@
1
+ import D from "./index46.js";
2
+ import p from "./index47.js";
3
+ import T from "./index72.js";
4
+ import O from "./index45.js";
5
+ import { getDefaultOptions as c } from "./index54.js";
6
+ function h(g, e) {
7
+ var a, i, o, l, n, s, f, u;
8
+ p(1, arguments);
9
+ var v = D(g), t = v.getUTCFullYear(), C = c(), r = O((a = (i = (o = (l = e?.firstWeekContainsDate) !== null && l !== void 0 ? l : e == null || (n = e.locale) === null || n === void 0 || (s = n.options) === null || s === void 0 ? void 0 : s.firstWeekContainsDate) !== null && o !== void 0 ? o : C.firstWeekContainsDate) !== null && i !== void 0 ? i : (f = C.locale) === null || f === void 0 || (u = f.options) === null || u === void 0 ? void 0 : u.firstWeekContainsDate) !== null && a !== void 0 ? a : 1);
10
+ if (!(r >= 1 && r <= 7))
11
+ throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
12
+ var d = /* @__PURE__ */ new Date(0);
13
+ d.setUTCFullYear(t + 1, 0, r), d.setUTCHours(0, 0, 0, 0);
14
+ var k = T(d, e), m = /* @__PURE__ */ new Date(0);
15
+ m.setUTCFullYear(t, 0, r), m.setUTCHours(0, 0, 0, 0);
16
+ var W = T(m, e);
17
+ return v.getTime() >= k.getTime() ? t + 1 : v.getTime() >= W.getTime() ? t : t - 1;
18
+ }
19
+ export {
20
+ h as default
21
+ };
package/index62.js ADDED
@@ -0,0 +1,8 @@
1
+ function r(a, e) {
2
+ for (var n = a < 0 ? "-" : "", t = Math.abs(a).toString(); t.length < e; )
3
+ t = "0" + t;
4
+ return n + t;
5
+ }
6
+ export {
7
+ r as default
8
+ };
package/index63.js ADDED
@@ -0,0 +1,57 @@
1
+ import n from "./index62.js";
2
+ var i = {
3
+ // Year
4
+ y: function(t, e) {
5
+ var a = t.getUTCFullYear(), u = a > 0 ? a : 1 - a;
6
+ return n(e === "yy" ? u % 100 : u, e.length);
7
+ },
8
+ // Month
9
+ M: function(t, e) {
10
+ var a = t.getUTCMonth();
11
+ return e === "M" ? String(a + 1) : n(a + 1, 2);
12
+ },
13
+ // Day of the month
14
+ d: function(t, e) {
15
+ return n(t.getUTCDate(), e.length);
16
+ },
17
+ // AM or PM
18
+ a: function(t, e) {
19
+ var a = t.getUTCHours() / 12 >= 1 ? "pm" : "am";
20
+ switch (e) {
21
+ case "a":
22
+ case "aa":
23
+ return a.toUpperCase();
24
+ case "aaa":
25
+ return a;
26
+ case "aaaaa":
27
+ return a[0];
28
+ case "aaaa":
29
+ default:
30
+ return a === "am" ? "a.m." : "p.m.";
31
+ }
32
+ },
33
+ // Hour [1-12]
34
+ h: function(t, e) {
35
+ return n(t.getUTCHours() % 12 || 12, e.length);
36
+ },
37
+ // Hour [0-23]
38
+ H: function(t, e) {
39
+ return n(t.getUTCHours(), e.length);
40
+ },
41
+ // Minute
42
+ m: function(t, e) {
43
+ return n(t.getUTCMinutes(), e.length);
44
+ },
45
+ // Second
46
+ s: function(t, e) {
47
+ return n(t.getUTCSeconds(), e.length);
48
+ },
49
+ // Fraction of second
50
+ S: function(t, e) {
51
+ var a = e.length, u = t.getUTCMilliseconds(), o = Math.floor(u * Math.pow(10, a - 3));
52
+ return n(o, e.length);
53
+ }
54
+ };
55
+ export {
56
+ i as default
57
+ };
package/index64.js ADDED
@@ -0,0 +1,4 @@
1
+ import a from "./index55.js";
2
+ export {
3
+ a as default
4
+ };