@hortiview/shared-components 0.0.11114 → 0.0.11146

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 (165) hide show
  1. package/dist/BigLoadingSpinner-C3wTbTD0.js +17 -0
  2. package/dist/GenericCard-B8x1DMa8.js +81 -0
  3. package/dist/ListAreaService-CRX4eEUJ.js +108 -0
  4. package/dist/_Map-Dtlps7IZ.js +113 -0
  5. package/dist/{_commonjsHelpers-CT_km90n.js → _commonjsHelpers-BkfeUUK-.js} +2 -4
  6. package/dist/_overArg-_0pUmCsX.js +14 -0
  7. package/dist/assets/Filter.css +1 -0
  8. package/dist/assets/GenericTable.css +1 -0
  9. package/dist/assets/main.css +1 -0
  10. package/dist/components/AlertBanner/AlertBanner.js +22 -16
  11. package/dist/components/AlertBanner/AlertBanner.test.js +2 -2
  12. package/dist/components/BaseView/BaseView.js +33 -26
  13. package/dist/components/BaseView/BaseView.test.js +25 -25
  14. package/dist/components/BasicHeading/BasicHeading.js +50 -41
  15. package/dist/components/BasicHeading/BasicHeading.test.js +2 -2
  16. package/dist/components/BlockView/BlockView.js +51 -42
  17. package/dist/components/BlockView/BlockView.test.js +2 -2
  18. package/dist/components/ChipCard/ChipCard.js +12 -10
  19. package/dist/components/ChipCard/ChipCard.test.js +2 -2
  20. package/dist/components/ContextMenu/ContextMenu.js +29 -25
  21. package/dist/components/ContextMenu/ContextMenu.test.js +2 -2
  22. package/dist/components/DeleteModal/DeleteModal.js +58 -53
  23. package/dist/components/DeleteModal/DeleteModal.test.js +2 -2
  24. package/dist/components/Disclaimer/Disclaimer.js +11 -8
  25. package/dist/components/Disclaimer/Disclaimer.test.js +2 -2
  26. package/dist/components/EmptyView/EmptyView.test.js +2 -2
  27. package/dist/components/Filter/Filter.js +107 -125
  28. package/dist/components/Filter/Filter.test.js +2 -2
  29. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.js +19 -19
  30. package/dist/components/FormComponents/FormCheckBox/FormCheckBox.test.js +2 -2
  31. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.d.ts +3 -0
  32. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.js +6081 -7102
  33. package/dist/components/FormComponents/FormDatePicker/FormDatePicker.test.js +2 -2
  34. package/dist/components/FormComponents/FormNumber/CustomTextField.js +16 -14
  35. package/dist/components/FormComponents/FormNumber/FormNumber.js +2 -2
  36. package/dist/components/FormComponents/FormNumber/FormNumber.test.js +4 -4
  37. package/dist/components/FormComponents/FormRadio/FormRadio.test.js +2 -2
  38. package/dist/components/FormComponents/FormSelect/FormSelect.d.ts +1 -1
  39. package/dist/components/FormComponents/FormSelect/FormSelect.js +109 -102
  40. package/dist/components/FormComponents/FormSelect/FormSelect.test.js +3 -3
  41. package/dist/components/FormComponents/FormSelect/SelectTooltipText.js +5 -5
  42. package/dist/components/FormComponents/FormSlider/FormSlider.test.js +2 -2
  43. package/dist/components/FormComponents/FormText/FormText.js +95 -96
  44. package/dist/components/FormComponents/FormText/FormText.test.js +13 -13
  45. package/dist/components/FormComponents/FormToggle/FormToggle.d.ts +31 -0
  46. package/dist/components/FormComponents/FormToggle/FormToggle.js +43 -0
  47. package/dist/components/FormComponents/FormToggle/FormToggle.test.d.ts +1 -0
  48. package/dist/components/FormComponents/FormToggle/FormToggle.test.js +50 -0
  49. package/dist/components/FormattedNumberDisplay/FormattedNumberDisplay.js +1 -1
  50. package/dist/components/GenericTable/GenericTable.js +64 -81
  51. package/dist/components/GenericTable/GenericTable.test.js +2 -2
  52. package/dist/components/GenericTable/GenericTableService.js +41 -43
  53. package/dist/components/GenericTable/Mobile/GenericCard.js +6 -68
  54. package/dist/components/GenericTable/Mobile/GenericCard.test.js +3 -3
  55. package/dist/components/GenericTable/Mobile/GenericCardList.js +8 -9
  56. package/dist/components/GenericTable/Mobile/GenericCardList.test.js +2 -2
  57. package/dist/components/HashTabView/HashTabView.js +62 -52
  58. package/dist/components/HashTabView/HashTabView.test.js +2 -2
  59. package/dist/components/HeaderFilter/HeaderFilter.js +16 -14
  60. package/dist/components/HeaderFilter/HeaderFilter.test.js +2 -2
  61. package/dist/components/HealthCheckFailed/HealthCheckFailed.js +27 -20
  62. package/dist/components/HealthCheckFailed/HealthCheckFailed.test.js +2 -2
  63. package/dist/components/Iconify/Iconify.js +56 -6
  64. package/dist/components/Iconify/Iconify.test.js +3 -3
  65. package/dist/components/InfoGroup/InfoGroup.js +36 -30
  66. package/dist/components/InfoGroup/InfoGroup.test.js +2 -2
  67. package/dist/components/ListArea/ListArea.js +45 -357
  68. package/dist/components/ListArea/ListArea.test.js +4 -4
  69. package/dist/components/ListArea/ListAreaService.js +8 -92
  70. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.js +5 -9
  71. package/dist/components/LoadingSpinner/Big/BigLoadingSpinner.test.js +3 -4
  72. package/dist/components/LoadingSpinner/Default/LoadingSpinner.js +28 -26
  73. package/dist/components/LoadingSpinner/Default/LoadingSpinner.test.js +2 -2
  74. package/dist/components/Modal/Modal.js +6 -4
  75. package/dist/components/OverflowTooltip/OverflowTooltip.js +21 -19
  76. package/dist/components/OverflowTooltip/OverflowTooltip.test.js +3 -3
  77. package/dist/components/OverflowTooltip/OverflowTooltipService.js +1 -2
  78. package/dist/components/Scrollbar/scrollbar.test.js +2 -2
  79. package/dist/components/SearchBar/SearchBar.js +22 -20
  80. package/dist/components/SearchBar/SearchBar.test.js +2 -2
  81. package/dist/components/VerticalDivider/VerticalDivider.js +6 -4
  82. package/dist/components/VerticalDivider/VerticalDivider.test.js +2 -2
  83. package/dist/get-BiqanC9_.js +7 -0
  84. package/dist/get-P-5PYZOE.js +426 -0
  85. package/dist/hooks/useBreakpoints.test.js +2 -2
  86. package/dist/hooks/useHelperText.d.ts +13 -0
  87. package/dist/hooks/useHelperText.js +25 -0
  88. package/dist/index-DzM8o582.js +10881 -0
  89. package/dist/isArray-2zMxXFEr.js +83 -0
  90. package/dist/isArray-C_5XvIlE.js +7 -0
  91. package/dist/isEmpty-BimaZd5G.js +225 -0
  92. package/dist/isString-BOHPtrlm.js +44 -0
  93. package/dist/magic-string.es-D4UQQyt0.js +859 -0
  94. package/dist/main.d.ts +1 -0
  95. package/dist/main.js +33 -31
  96. package/dist/orderBy-BVQIswlJ.js +765 -0
  97. package/dist/{react-number-format.es-BeIT_PM7.js → react-number-format.es-BD3_OvMU.js} +156 -159
  98. package/dist/react-tooltip.min-c2wVkjF2.js +1354 -0
  99. package/dist/react.esm-FR1-H8iU.js +13471 -0
  100. package/dist/services/UtilService.js +12 -19
  101. package/dist/services/services.test.js +1 -1
  102. package/dist/vi.CjhMlMwf-DWv7vrn7.js +12192 -0
  103. package/package.json +8 -6
  104. package/dist/BlockView.module-BPlNT5uh.js +0 -15
  105. package/dist/HashTabView.module-ZhwSfDeQ.js +0 -16
  106. package/dist/HeaderFilter.module-DiBmulr5.js +0 -7
  107. package/dist/Iconify-DoU6pP1o.js +0 -97
  108. package/dist/_Map-DKsHX-kc.js +0 -59
  109. package/dist/_baseToString-dkhmFwqS.js +0 -198
  110. package/dist/_equalByTag-BZEJl6ST.js +0 -158
  111. package/dist/_overArg-BC4qXKbU.js +0 -9
  112. package/dist/alertBanner.module-BPiKN0gh.js +0 -11
  113. package/dist/assets/genericTable.css +0 -1
  114. package/dist/baseView.module-uWbm_a5f.js +0 -12
  115. package/dist/basicHeading.module-BYb8xvuk.js +0 -16
  116. package/dist/bigLoadingSpinner.module-GgbFol8k.js +0 -11
  117. package/dist/chipCard.module-BjpKuf1b.js +0 -7
  118. package/dist/contextMenu.module-vNQHb48g.js +0 -9
  119. package/dist/deleteModal.module-Ds3MDzdl.js +0 -10
  120. package/dist/disclaimer.module-BZydt-Q_.js +0 -8
  121. package/dist/formDatePicker.module-BV3ma_7y.js +0 -11
  122. package/dist/formNumber.module-BA05Gi6_.js +0 -7
  123. package/dist/formSelect.module-PUiLDSD4.js +0 -15
  124. package/dist/formText.module-C0by6_DK.js +0 -12
  125. package/dist/genericCard.module-DrQu86jX.js +0 -15
  126. package/dist/genericTable.module-Dk3yy2S3.js +0 -17
  127. package/dist/get-BJn2Enx7.js +0 -47
  128. package/dist/healthCheckFailed.module-B5P1ogjs.js +0 -12
  129. package/dist/iconify.module-Cru5NS2X.js +0 -80
  130. package/dist/index-IMXII42b.js +0 -11708
  131. package/dist/infoGroup.module-Cxw88dfC.js +0 -12
  132. package/dist/isArray-thIeLpc5.js +0 -35
  133. package/dist/isPlainObject-BlCDf1Kc.js +0 -18
  134. package/dist/listArea.module-BhO_OJ1S.js +0 -20
  135. package/dist/loadingSpinner.module-CLtqSMWA.js +0 -7
  136. package/dist/magic-string.es-irX7syie.js +0 -732
  137. package/dist/modal.module-BlDp1Wiq.js +0 -7
  138. package/dist/overflowTooltip.module-YyRN2MGc.js +0 -7
  139. package/dist/react-tooltip.min-BzHiZW8k.js +0 -1380
  140. package/dist/react.esm-CHvVvf3L.js +0 -12786
  141. package/dist/searchBar.module-9gKyrZRT.js +0 -7
  142. package/dist/verticalDivider.module-C3_GL-fH.js +0 -7
  143. package/dist/vi.JYQecGiw-BpOAB4v6.js +0 -9796
  144. /package/dist/assets/{alertBanner.css → AlertBanner.css} +0 -0
  145. /package/dist/assets/{baseView.css → BaseView.css} +0 -0
  146. /package/dist/assets/{basicHeading.css → BasicHeading.css} +0 -0
  147. /package/dist/assets/{bigLoadingSpinner.css → BigLoadingSpinner.css} +0 -0
  148. /package/dist/assets/{chipCard.css → ChipCard.css} +0 -0
  149. /package/dist/assets/{contextMenu.css → ContextMenu.css} +0 -0
  150. /package/dist/assets/{formNumber.css → CustomTextField.css} +0 -0
  151. /package/dist/assets/{deleteModal.css → DeleteModal.css} +0 -0
  152. /package/dist/assets/{disclaimer.css → Disclaimer.css} +0 -0
  153. /package/dist/assets/{formDatePicker.css → FormDatePicker.css} +0 -0
  154. /package/dist/assets/{formSelect.css → FormSelect.css} +0 -0
  155. /package/dist/assets/{formText.css → FormText.css} +0 -0
  156. /package/dist/assets/{genericCard.css → GenericCard.css} +0 -0
  157. /package/dist/assets/{healthCheckFailed.css → HealthCheckFailed.css} +0 -0
  158. /package/dist/assets/{iconify.css → Iconify.css} +0 -0
  159. /package/dist/assets/{infoGroup.css → InfoGroup.css} +0 -0
  160. /package/dist/assets/{listArea.css → ListAreaService.css} +0 -0
  161. /package/dist/assets/{loadingSpinner.css → LoadingSpinner.css} +0 -0
  162. /package/dist/assets/{modal.css → Modal.css} +0 -0
  163. /package/dist/assets/{overflowTooltip.css → OverflowTooltip.css} +0 -0
  164. /package/dist/assets/{searchBar.css → SearchBar.css} +0 -0
  165. /package/dist/assets/{verticalDivider.css → VerticalDivider.css} +0 -0
@@ -1,732 +0,0 @@
1
- import { c as U } from "./_commonjsHelpers-CT_km90n.js";
2
- var O = { exports: {} };
3
- (function(p, t) {
4
- (function(e, n) {
5
- n(t);
6
- })(U, function(e) {
7
- const r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", s = new Uint8Array(64), h = new Uint8Array(128);
8
- for (let u = 0; u < r.length; u++) {
9
- const l = r.charCodeAt(u);
10
- s[u] = l, h[l] = u;
11
- }
12
- const o = typeof TextDecoder < "u" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer < "u" ? {
13
- decode(u) {
14
- return Buffer.from(u.buffer, u.byteOffset, u.byteLength).toString();
15
- }
16
- } : {
17
- decode(u) {
18
- let l = "";
19
- for (let g = 0; g < u.length; g++)
20
- l += String.fromCharCode(u[g]);
21
- return l;
22
- }
23
- };
24
- function a(u) {
25
- const l = new Int32Array(5), g = [];
26
- let w = 0;
27
- do {
28
- const d = S(u, w), m = [];
29
- let c = !0, b = 0;
30
- l[0] = 0;
31
- for (let f = w; f < d; f++) {
32
- let x;
33
- f = y(u, f, l, 0);
34
- const C = l[0];
35
- C < b && (c = !1), b = C, N(u, f, d) ? (f = y(u, f, l, 1), f = y(u, f, l, 2), f = y(u, f, l, 3), N(u, f, d) ? (f = y(u, f, l, 4), x = [C, l[1], l[2], l[3], l[4]]) : x = [C, l[1], l[2], l[3]]) : x = [C], m.push(x);
36
- }
37
- c || T(m), g.push(m), w = d + 1;
38
- } while (w <= u.length);
39
- return g;
40
- }
41
- function S(u, l) {
42
- const g = u.indexOf(";", l);
43
- return g === -1 ? u.length : g;
44
- }
45
- function y(u, l, g, w) {
46
- let d = 0, m = 0, c = 0;
47
- do {
48
- const f = u.charCodeAt(l++);
49
- c = h[f], d |= (c & 31) << m, m += 5;
50
- } while (c & 32);
51
- const b = d & 1;
52
- return d >>>= 1, b && (d = -2147483648 | -d), g[w] += d, l;
53
- }
54
- function N(u, l, g) {
55
- return l >= g ? !1 : u.charCodeAt(l) !== 44;
56
- }
57
- function T(u) {
58
- u.sort(j);
59
- }
60
- function j(u, l) {
61
- return u[0] - l[0];
62
- }
63
- function $(u) {
64
- const l = new Int32Array(5), g = 1024 * 16, w = g - 36, d = new Uint8Array(g), m = d.subarray(0, w);
65
- let c = 0, b = "";
66
- for (let f = 0; f < u.length; f++) {
67
- const x = u[f];
68
- if (f > 0 && (c === g && (b += o.decode(d), c = 0), d[c++] = 59), x.length !== 0) {
69
- l[0] = 0;
70
- for (let C = 0; C < x.length; C++) {
71
- const v = x[C];
72
- c > w && (b += o.decode(m), d.copyWithin(0, w, c), c -= w), C > 0 && (d[c++] = 44), c = k(d, c, l, v, 0), v.length !== 1 && (c = k(d, c, l, v, 1), c = k(d, c, l, v, 2), c = k(d, c, l, v, 3), v.length !== 4 && (c = k(d, c, l, v, 4)));
73
- }
74
- }
75
- }
76
- return b + o.decode(d.subarray(0, c));
77
- }
78
- function k(u, l, g, w, d) {
79
- const m = w[d];
80
- let c = m - g[d];
81
- g[d] = m, c = c < 0 ? -c << 1 | 1 : c << 1;
82
- do {
83
- let b = c & 31;
84
- c >>>= 5, c > 0 && (b |= 32), u[l++] = s[b];
85
- } while (c > 0);
86
- return l;
87
- }
88
- e.decode = a, e.encode = $, Object.defineProperty(e, "__esModule", { value: !0 });
89
- });
90
- })(O, O.exports);
91
- var M = O.exports;
92
- class R {
93
- constructor(t) {
94
- this.bits = t instanceof R ? t.bits.slice() : [];
95
- }
96
- add(t) {
97
- this.bits[t >> 5] |= 1 << (t & 31);
98
- }
99
- has(t) {
100
- return !!(this.bits[t >> 5] & 1 << (t & 31));
101
- }
102
- }
103
- class _ {
104
- constructor(t, e, n) {
105
- this.start = t, this.end = e, this.original = n, this.intro = "", this.outro = "", this.content = n, this.storeName = !1, this.edited = !1, this.previous = null, this.next = null;
106
- }
107
- appendLeft(t) {
108
- this.outro += t;
109
- }
110
- appendRight(t) {
111
- this.intro = this.intro + t;
112
- }
113
- clone() {
114
- const t = new _(this.start, this.end, this.original);
115
- return t.intro = this.intro, t.outro = this.outro, t.content = this.content, t.storeName = this.storeName, t.edited = this.edited, t;
116
- }
117
- contains(t) {
118
- return this.start < t && t < this.end;
119
- }
120
- eachNext(t) {
121
- let e = this;
122
- for (; e; )
123
- t(e), e = e.next;
124
- }
125
- eachPrevious(t) {
126
- let e = this;
127
- for (; e; )
128
- t(e), e = e.previous;
129
- }
130
- edit(t, e, n) {
131
- return this.content = t, n || (this.intro = "", this.outro = ""), this.storeName = e, this.edited = !0, this;
132
- }
133
- prependLeft(t) {
134
- this.outro = t + this.outro;
135
- }
136
- prependRight(t) {
137
- this.intro = t + this.intro;
138
- }
139
- reset() {
140
- this.intro = "", this.outro = "", this.edited && (this.content = this.original, this.storeName = !1, this.edited = !1);
141
- }
142
- split(t) {
143
- const e = t - this.start, n = this.original.slice(0, e), i = this.original.slice(e);
144
- this.original = n;
145
- const r = new _(t, this.end, i);
146
- return r.outro = this.outro, this.outro = "", this.end = t, this.edited ? (r.edit("", !1), this.content = "") : this.content = n, r.next = this.next, r.next && (r.next.previous = r), r.previous = this, this.next = r, r;
147
- }
148
- toString() {
149
- return this.intro + this.content + this.outro;
150
- }
151
- trimEnd(t) {
152
- if (this.outro = this.outro.replace(t, ""), this.outro.length)
153
- return !0;
154
- const e = this.content.replace(t, "");
155
- if (e.length)
156
- return e !== this.content && (this.split(this.start + e.length).edit("", void 0, !0), this.edited && this.edit(e, this.storeName, !0)), !0;
157
- if (this.edit("", void 0, !0), this.intro = this.intro.replace(t, ""), this.intro.length)
158
- return !0;
159
- }
160
- trimStart(t) {
161
- if (this.intro = this.intro.replace(t, ""), this.intro.length)
162
- return !0;
163
- const e = this.content.replace(t, "");
164
- if (e.length) {
165
- if (e !== this.content) {
166
- const n = this.split(this.end - e.length);
167
- this.edited && n.edit(e, this.storeName, !0), this.edit("", void 0, !0);
168
- }
169
- return !0;
170
- } else if (this.edit("", void 0, !0), this.outro = this.outro.replace(t, ""), this.outro.length)
171
- return !0;
172
- }
173
- }
174
- function B() {
175
- return typeof globalThis < "u" && typeof globalThis.btoa == "function" ? (p) => globalThis.btoa(unescape(encodeURIComponent(p))) : typeof Buffer == "function" ? (p) => Buffer.from(p, "utf-8").toString("base64") : () => {
176
- throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
177
- };
178
- }
179
- const P = /* @__PURE__ */ B();
180
- class D {
181
- constructor(t) {
182
- this.version = 3, this.file = t.file, this.sources = t.sources, this.sourcesContent = t.sourcesContent, this.names = t.names, this.mappings = M.encode(t.mappings), typeof t.x_google_ignoreList < "u" && (this.x_google_ignoreList = t.x_google_ignoreList);
183
- }
184
- toString() {
185
- return JSON.stringify(this);
186
- }
187
- toUrl() {
188
- return "data:application/json;charset=utf-8;base64," + P(this.toString());
189
- }
190
- }
191
- function q(p) {
192
- const t = p.split(`
193
- `), e = t.filter((r) => /^\t+/.test(r)), n = t.filter((r) => /^ {2,}/.test(r));
194
- if (e.length === 0 && n.length === 0)
195
- return null;
196
- if (e.length >= n.length)
197
- return " ";
198
- const i = n.reduce((r, s) => {
199
- const h = /^ +/.exec(s)[0].length;
200
- return Math.min(h, r);
201
- }, 1 / 0);
202
- return new Array(i + 1).join(" ");
203
- }
204
- function z(p, t) {
205
- const e = p.split(/[/\\]/), n = t.split(/[/\\]/);
206
- for (e.pop(); e[0] === n[0]; )
207
- e.shift(), n.shift();
208
- if (e.length) {
209
- let i = e.length;
210
- for (; i--; )
211
- e[i] = "..";
212
- }
213
- return e.concat(n).join("/");
214
- }
215
- const F = Object.prototype.toString;
216
- function G(p) {
217
- return F.call(p) === "[object Object]";
218
- }
219
- function A(p) {
220
- const t = p.split(`
221
- `), e = [];
222
- for (let n = 0, i = 0; n < t.length; n++)
223
- e.push(i), i += t[n].length + 1;
224
- return function(i) {
225
- let r = 0, s = e.length;
226
- for (; r < s; ) {
227
- const a = r + s >> 1;
228
- i < e[a] ? s = a : r = a + 1;
229
- }
230
- const h = r - 1, o = i - e[h];
231
- return { line: h, column: o };
232
- };
233
- }
234
- const H = /\w/;
235
- class J {
236
- constructor(t) {
237
- this.hires = t, this.generatedCodeLine = 0, this.generatedCodeColumn = 0, this.raw = [], this.rawSegments = this.raw[this.generatedCodeLine] = [], this.pending = null;
238
- }
239
- addEdit(t, e, n, i) {
240
- if (e.length) {
241
- const r = e.length - 1;
242
- let s = e.indexOf(`
243
- `, 0), h = -1;
244
- for (; s >= 0 && r > s; ) {
245
- const a = [this.generatedCodeColumn, t, n.line, n.column];
246
- i >= 0 && a.push(i), this.rawSegments.push(a), this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0, h = s, s = e.indexOf(`
247
- `, s + 1);
248
- }
249
- const o = [this.generatedCodeColumn, t, n.line, n.column];
250
- i >= 0 && o.push(i), this.rawSegments.push(o), this.advance(e.slice(h + 1));
251
- } else
252
- this.pending && (this.rawSegments.push(this.pending), this.advance(e));
253
- this.pending = null;
254
- }
255
- addUneditedChunk(t, e, n, i, r) {
256
- let s = e.start, h = !0, o = !1;
257
- for (; s < e.end; ) {
258
- if (this.hires || h || r.has(s)) {
259
- const a = [this.generatedCodeColumn, t, i.line, i.column];
260
- this.hires === "boundary" ? H.test(n[s]) ? o || (this.rawSegments.push(a), o = !0) : (this.rawSegments.push(a), o = !1) : this.rawSegments.push(a);
261
- }
262
- n[s] === `
263
- ` ? (i.line += 1, i.column = 0, this.generatedCodeLine += 1, this.raw[this.generatedCodeLine] = this.rawSegments = [], this.generatedCodeColumn = 0, h = !0) : (i.column += 1, this.generatedCodeColumn += 1, h = !1), s += 1;
264
- }
265
- this.pending = null;
266
- }
267
- advance(t) {
268
- if (!t)
269
- return;
270
- const e = t.split(`
271
- `);
272
- if (e.length > 1) {
273
- for (let n = 0; n < e.length - 1; n++)
274
- this.generatedCodeLine++, this.raw[this.generatedCodeLine] = this.rawSegments = [];
275
- this.generatedCodeColumn = 0;
276
- }
277
- this.generatedCodeColumn += e[e.length - 1].length;
278
- }
279
- }
280
- const L = `
281
- `, E = {
282
- insertLeft: !1,
283
- insertRight: !1,
284
- storeName: !1
285
- };
286
- class I {
287
- constructor(t, e = {}) {
288
- const n = new _(0, t.length, t);
289
- Object.defineProperties(this, {
290
- original: { writable: !0, value: t },
291
- outro: { writable: !0, value: "" },
292
- intro: { writable: !0, value: "" },
293
- firstChunk: { writable: !0, value: n },
294
- lastChunk: { writable: !0, value: n },
295
- lastSearchedChunk: { writable: !0, value: n },
296
- byStart: { writable: !0, value: {} },
297
- byEnd: { writable: !0, value: {} },
298
- filename: { writable: !0, value: e.filename },
299
- indentExclusionRanges: { writable: !0, value: e.indentExclusionRanges },
300
- sourcemapLocations: { writable: !0, value: new R() },
301
- storedNames: { writable: !0, value: {} },
302
- indentStr: { writable: !0, value: void 0 },
303
- ignoreList: { writable: !0, value: e.ignoreList }
304
- }), this.byStart[0] = n, this.byEnd[t.length] = n;
305
- }
306
- addSourcemapLocation(t) {
307
- this.sourcemapLocations.add(t);
308
- }
309
- append(t) {
310
- if (typeof t != "string")
311
- throw new TypeError("outro content must be a string");
312
- return this.outro += t, this;
313
- }
314
- appendLeft(t, e) {
315
- if (typeof e != "string")
316
- throw new TypeError("inserted content must be a string");
317
- this._split(t);
318
- const n = this.byEnd[t];
319
- return n ? n.appendLeft(e) : this.intro += e, this;
320
- }
321
- appendRight(t, e) {
322
- if (typeof e != "string")
323
- throw new TypeError("inserted content must be a string");
324
- this._split(t);
325
- const n = this.byStart[t];
326
- return n ? n.appendRight(e) : this.outro += e, this;
327
- }
328
- clone() {
329
- const t = new I(this.original, { filename: this.filename });
330
- let e = this.firstChunk, n = t.firstChunk = t.lastSearchedChunk = e.clone();
331
- for (; e; ) {
332
- t.byStart[n.start] = n, t.byEnd[n.end] = n;
333
- const i = e.next, r = i && i.clone();
334
- r && (n.next = r, r.previous = n, n = r), e = i;
335
- }
336
- return t.lastChunk = n, this.indentExclusionRanges && (t.indentExclusionRanges = this.indentExclusionRanges.slice()), t.sourcemapLocations = new R(this.sourcemapLocations), t.intro = this.intro, t.outro = this.outro, t;
337
- }
338
- generateDecodedMap(t) {
339
- t = t || {};
340
- const e = 0, n = Object.keys(this.storedNames), i = new J(t.hires), r = A(this.original);
341
- return this.intro && i.advance(this.intro), this.firstChunk.eachNext((s) => {
342
- const h = r(s.start);
343
- s.intro.length && i.advance(s.intro), s.edited ? i.addEdit(
344
- e,
345
- s.content,
346
- h,
347
- s.storeName ? n.indexOf(s.original) : -1
348
- ) : i.addUneditedChunk(e, s, this.original, h, this.sourcemapLocations), s.outro.length && i.advance(s.outro);
349
- }), {
350
- file: t.file ? t.file.split(/[/\\]/).pop() : void 0,
351
- sources: [
352
- t.source ? z(t.file || "", t.source) : t.file || ""
353
- ],
354
- sourcesContent: t.includeContent ? [this.original] : void 0,
355
- names: n,
356
- mappings: i.raw,
357
- x_google_ignoreList: this.ignoreList ? [e] : void 0
358
- };
359
- }
360
- generateMap(t) {
361
- return new D(this.generateDecodedMap(t));
362
- }
363
- _ensureindentStr() {
364
- this.indentStr === void 0 && (this.indentStr = q(this.original));
365
- }
366
- _getRawIndentString() {
367
- return this._ensureindentStr(), this.indentStr;
368
- }
369
- getIndentString() {
370
- return this._ensureindentStr(), this.indentStr === null ? " " : this.indentStr;
371
- }
372
- indent(t, e) {
373
- const n = /^[^\r\n]/gm;
374
- if (G(t) && (e = t, t = void 0), t === void 0 && (this._ensureindentStr(), t = this.indentStr || " "), t === "")
375
- return this;
376
- e = e || {};
377
- const i = {};
378
- e.exclude && (typeof e.exclude[0] == "number" ? [e.exclude] : e.exclude).forEach((S) => {
379
- for (let y = S[0]; y < S[1]; y += 1)
380
- i[y] = !0;
381
- });
382
- let r = e.indentStart !== !1;
383
- const s = (a) => r ? `${t}${a}` : (r = !0, a);
384
- this.intro = this.intro.replace(n, s);
385
- let h = 0, o = this.firstChunk;
386
- for (; o; ) {
387
- const a = o.end;
388
- if (o.edited)
389
- i[h] || (o.content = o.content.replace(n, s), o.content.length && (r = o.content[o.content.length - 1] === `
390
- `));
391
- else
392
- for (h = o.start; h < a; ) {
393
- if (!i[h]) {
394
- const S = this.original[h];
395
- S === `
396
- ` ? r = !0 : S !== "\r" && r && (r = !1, h === o.start || (this._splitChunk(o, h), o = o.next), o.prependRight(t));
397
- }
398
- h += 1;
399
- }
400
- h = o.end, o = o.next;
401
- }
402
- return this.outro = this.outro.replace(n, s), this;
403
- }
404
- insert() {
405
- throw new Error(
406
- "magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)"
407
- );
408
- }
409
- insertLeft(t, e) {
410
- return E.insertLeft || (console.warn(
411
- "magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"
412
- ), E.insertLeft = !0), this.appendLeft(t, e);
413
- }
414
- insertRight(t, e) {
415
- return E.insertRight || (console.warn(
416
- "magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"
417
- ), E.insertRight = !0), this.prependRight(t, e);
418
- }
419
- move(t, e, n) {
420
- if (n >= t && n <= e)
421
- throw new Error("Cannot move a selection inside itself");
422
- this._split(t), this._split(e), this._split(n);
423
- const i = this.byStart[t], r = this.byEnd[e], s = i.previous, h = r.next, o = this.byStart[n];
424
- if (!o && r === this.lastChunk)
425
- return this;
426
- const a = o ? o.previous : this.lastChunk;
427
- return s && (s.next = h), h && (h.previous = s), a && (a.next = i), o && (o.previous = r), i.previous || (this.firstChunk = r.next), r.next || (this.lastChunk = i.previous, this.lastChunk.next = null), i.previous = a, r.next = o || null, a || (this.firstChunk = i), o || (this.lastChunk = r), this;
428
- }
429
- overwrite(t, e, n, i) {
430
- return i = i || {}, this.update(t, e, n, { ...i, overwrite: !i.contentOnly });
431
- }
432
- update(t, e, n, i) {
433
- if (typeof n != "string")
434
- throw new TypeError("replacement content must be a string");
435
- for (; t < 0; )
436
- t += this.original.length;
437
- for (; e < 0; )
438
- e += this.original.length;
439
- if (e > this.original.length)
440
- throw new Error("end is out of bounds");
441
- if (t === e)
442
- throw new Error(
443
- "Cannot overwrite a zero-length range – use appendLeft or prependRight instead"
444
- );
445
- this._split(t), this._split(e), i === !0 && (E.storeName || (console.warn(
446
- "The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"
447
- ), E.storeName = !0), i = { storeName: !0 });
448
- const r = i !== void 0 ? i.storeName : !1, s = i !== void 0 ? i.overwrite : !1;
449
- if (r) {
450
- const a = this.original.slice(t, e);
451
- Object.defineProperty(this.storedNames, a, {
452
- writable: !0,
453
- value: !0,
454
- enumerable: !0
455
- });
456
- }
457
- const h = this.byStart[t], o = this.byEnd[e];
458
- if (h) {
459
- let a = h;
460
- for (; a !== o; ) {
461
- if (a.next !== this.byStart[a.end])
462
- throw new Error("Cannot overwrite across a split point");
463
- a = a.next, a.edit("", !1);
464
- }
465
- h.edit(n, r, !s);
466
- } else {
467
- const a = new _(t, e, "").edit(n, r);
468
- o.next = a, a.previous = o;
469
- }
470
- return this;
471
- }
472
- prepend(t) {
473
- if (typeof t != "string")
474
- throw new TypeError("outro content must be a string");
475
- return this.intro = t + this.intro, this;
476
- }
477
- prependLeft(t, e) {
478
- if (typeof e != "string")
479
- throw new TypeError("inserted content must be a string");
480
- this._split(t);
481
- const n = this.byEnd[t];
482
- return n ? n.prependLeft(e) : this.intro = e + this.intro, this;
483
- }
484
- prependRight(t, e) {
485
- if (typeof e != "string")
486
- throw new TypeError("inserted content must be a string");
487
- this._split(t);
488
- const n = this.byStart[t];
489
- return n ? n.prependRight(e) : this.outro = e + this.outro, this;
490
- }
491
- remove(t, e) {
492
- for (; t < 0; )
493
- t += this.original.length;
494
- for (; e < 0; )
495
- e += this.original.length;
496
- if (t === e)
497
- return this;
498
- if (t < 0 || e > this.original.length)
499
- throw new Error("Character is out of bounds");
500
- if (t > e)
501
- throw new Error("end must be greater than start");
502
- this._split(t), this._split(e);
503
- let n = this.byStart[t];
504
- for (; n; )
505
- n.intro = "", n.outro = "", n.edit(""), n = e > n.end ? this.byStart[n.end] : null;
506
- return this;
507
- }
508
- reset(t, e) {
509
- for (; t < 0; )
510
- t += this.original.length;
511
- for (; e < 0; )
512
- e += this.original.length;
513
- if (t === e)
514
- return this;
515
- if (t < 0 || e > this.original.length)
516
- throw new Error("Character is out of bounds");
517
- if (t > e)
518
- throw new Error("end must be greater than start");
519
- this._split(t), this._split(e);
520
- let n = this.byStart[t];
521
- for (; n; )
522
- n.reset(), n = e > n.end ? this.byStart[n.end] : null;
523
- return this;
524
- }
525
- lastChar() {
526
- if (this.outro.length)
527
- return this.outro[this.outro.length - 1];
528
- let t = this.lastChunk;
529
- do {
530
- if (t.outro.length)
531
- return t.outro[t.outro.length - 1];
532
- if (t.content.length)
533
- return t.content[t.content.length - 1];
534
- if (t.intro.length)
535
- return t.intro[t.intro.length - 1];
536
- } while (t = t.previous);
537
- return this.intro.length ? this.intro[this.intro.length - 1] : "";
538
- }
539
- lastLine() {
540
- let t = this.outro.lastIndexOf(L);
541
- if (t !== -1)
542
- return this.outro.substr(t + 1);
543
- let e = this.outro, n = this.lastChunk;
544
- do {
545
- if (n.outro.length > 0) {
546
- if (t = n.outro.lastIndexOf(L), t !== -1)
547
- return n.outro.substr(t + 1) + e;
548
- e = n.outro + e;
549
- }
550
- if (n.content.length > 0) {
551
- if (t = n.content.lastIndexOf(L), t !== -1)
552
- return n.content.substr(t + 1) + e;
553
- e = n.content + e;
554
- }
555
- if (n.intro.length > 0) {
556
- if (t = n.intro.lastIndexOf(L), t !== -1)
557
- return n.intro.substr(t + 1) + e;
558
- e = n.intro + e;
559
- }
560
- } while (n = n.previous);
561
- return t = this.intro.lastIndexOf(L), t !== -1 ? this.intro.substr(t + 1) + e : this.intro + e;
562
- }
563
- slice(t = 0, e = this.original.length) {
564
- for (; t < 0; )
565
- t += this.original.length;
566
- for (; e < 0; )
567
- e += this.original.length;
568
- let n = "", i = this.firstChunk;
569
- for (; i && (i.start > t || i.end <= t); ) {
570
- if (i.start < e && i.end >= e)
571
- return n;
572
- i = i.next;
573
- }
574
- if (i && i.edited && i.start !== t)
575
- throw new Error(`Cannot use replaced character ${t} as slice start anchor.`);
576
- const r = i;
577
- for (; i; ) {
578
- i.intro && (r !== i || i.start === t) && (n += i.intro);
579
- const s = i.start < e && i.end >= e;
580
- if (s && i.edited && i.end !== e)
581
- throw new Error(`Cannot use replaced character ${e} as slice end anchor.`);
582
- const h = r === i ? t - i.start : 0, o = s ? i.content.length + e - i.end : i.content.length;
583
- if (n += i.content.slice(h, o), i.outro && (!s || i.end === e) && (n += i.outro), s)
584
- break;
585
- i = i.next;
586
- }
587
- return n;
588
- }
589
- // TODO deprecate this? not really very useful
590
- snip(t, e) {
591
- const n = this.clone();
592
- return n.remove(0, t), n.remove(e, n.original.length), n;
593
- }
594
- _split(t) {
595
- if (this.byStart[t] || this.byEnd[t])
596
- return;
597
- let e = this.lastSearchedChunk;
598
- const n = t > e.end;
599
- for (; e; ) {
600
- if (e.contains(t))
601
- return this._splitChunk(e, t);
602
- e = n ? this.byStart[e.end] : this.byEnd[e.start];
603
- }
604
- }
605
- _splitChunk(t, e) {
606
- if (t.edited && t.content.length) {
607
- const i = A(this.original)(e);
608
- throw new Error(
609
- `Cannot split a chunk that has already been edited (${i.line}:${i.column} – "${t.original}")`
610
- );
611
- }
612
- const n = t.split(e);
613
- return this.byEnd[e] = t, this.byStart[e] = n, this.byEnd[n.end] = n, t === this.lastChunk && (this.lastChunk = n), this.lastSearchedChunk = t, !0;
614
- }
615
- toString() {
616
- let t = this.intro, e = this.firstChunk;
617
- for (; e; )
618
- t += e.toString(), e = e.next;
619
- return t + this.outro;
620
- }
621
- isEmpty() {
622
- let t = this.firstChunk;
623
- do
624
- if (t.intro.length && t.intro.trim() || t.content.length && t.content.trim() || t.outro.length && t.outro.trim())
625
- return !1;
626
- while (t = t.next);
627
- return !0;
628
- }
629
- length() {
630
- let t = this.firstChunk, e = 0;
631
- do
632
- e += t.intro.length + t.content.length + t.outro.length;
633
- while (t = t.next);
634
- return e;
635
- }
636
- trimLines() {
637
- return this.trim("[\\r\\n]");
638
- }
639
- trim(t) {
640
- return this.trimStart(t).trimEnd(t);
641
- }
642
- trimEndAborted(t) {
643
- const e = new RegExp((t || "\\s") + "+$");
644
- if (this.outro = this.outro.replace(e, ""), this.outro.length)
645
- return !0;
646
- let n = this.lastChunk;
647
- do {
648
- const i = n.end, r = n.trimEnd(e);
649
- if (n.end !== i && (this.lastChunk === n && (this.lastChunk = n.next), this.byEnd[n.end] = n, this.byStart[n.next.start] = n.next, this.byEnd[n.next.end] = n.next), r)
650
- return !0;
651
- n = n.previous;
652
- } while (n);
653
- return !1;
654
- }
655
- trimEnd(t) {
656
- return this.trimEndAborted(t), this;
657
- }
658
- trimStartAborted(t) {
659
- const e = new RegExp("^" + (t || "\\s") + "+");
660
- if (this.intro = this.intro.replace(e, ""), this.intro.length)
661
- return !0;
662
- let n = this.firstChunk;
663
- do {
664
- const i = n.end, r = n.trimStart(e);
665
- if (n.end !== i && (n === this.lastChunk && (this.lastChunk = n.next), this.byEnd[n.end] = n, this.byStart[n.next.start] = n.next, this.byEnd[n.next.end] = n.next), r)
666
- return !0;
667
- n = n.next;
668
- } while (n);
669
- return !1;
670
- }
671
- trimStart(t) {
672
- return this.trimStartAborted(t), this;
673
- }
674
- hasChanged() {
675
- return this.original !== this.toString();
676
- }
677
- _replaceRegexp(t, e) {
678
- function n(r, s) {
679
- return typeof e == "string" ? e.replace(/\$(\$|&|\d+)/g, (h, o) => o === "$" ? "$" : o === "&" ? r[0] : +o < r.length ? r[+o] : `$${o}`) : e(...r, r.index, s, r.groups);
680
- }
681
- function i(r, s) {
682
- let h;
683
- const o = [];
684
- for (; h = r.exec(s); )
685
- o.push(h);
686
- return o;
687
- }
688
- if (t.global)
689
- i(t, this.original).forEach((s) => {
690
- s.index != null && this.overwrite(
691
- s.index,
692
- s.index + s[0].length,
693
- n(s, this.original)
694
- );
695
- });
696
- else {
697
- const r = this.original.match(t);
698
- r && r.index != null && this.overwrite(
699
- r.index,
700
- r.index + r[0].length,
701
- n(r, this.original)
702
- );
703
- }
704
- return this;
705
- }
706
- _replaceString(t, e) {
707
- const { original: n } = this, i = n.indexOf(t);
708
- return i !== -1 && this.overwrite(i, i + t.length, e), this;
709
- }
710
- replace(t, e) {
711
- return typeof t == "string" ? this._replaceString(t, e) : this._replaceRegexp(t, e);
712
- }
713
- _replaceAllString(t, e) {
714
- const { original: n } = this, i = t.length;
715
- for (let r = n.indexOf(t); r !== -1; r = n.indexOf(t, r + i))
716
- this.overwrite(r, r + i, e);
717
- return this;
718
- }
719
- replaceAll(t, e) {
720
- if (typeof t == "string")
721
- return this._replaceAllString(t, e);
722
- if (!t.global)
723
- throw new TypeError(
724
- "MagicString.prototype.replaceAll called with a non-global RegExp argument"
725
- );
726
- return this._replaceRegexp(t, e);
727
- }
728
- }
729
- export {
730
- D as SourceMap,
731
- I as default
732
- };