spawn-term 0.2.10 → 1.0.1

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 (65) hide show
  1. package/dist/cjs/components/App.js +1 -1
  2. package/dist/cjs/components/App.js.map +1 -1
  3. package/dist/cjs/components/ChildProcess.js +1 -1
  4. package/dist/cjs/components/ChildProcess.js.map +1 -1
  5. package/dist/cjs/components/Spinner.js +1 -1
  6. package/dist/cjs/components/Spinner.js.map +1 -1
  7. package/dist/cjs/createApp.js +42 -43
  8. package/dist/cjs/createApp.js.map +1 -1
  9. package/dist/cjs/index-cjs.d.cts +4 -5
  10. package/dist/cjs/index-cjs.d.ts +4 -5
  11. package/dist/cjs/index-cjs.js +4 -19
  12. package/dist/cjs/index-cjs.js.map +1 -1
  13. package/dist/cjs/index-esm.d.cts +1 -2
  14. package/dist/cjs/index-esm.d.ts +1 -2
  15. package/dist/cjs/index-esm.js +2 -15
  16. package/dist/cjs/index-esm.js.map +1 -1
  17. package/dist/cjs/lib/addLines.d.cts +1 -1
  18. package/dist/cjs/lib/addLines.d.ts +1 -1
  19. package/dist/cjs/lib/addLines.js +2 -2
  20. package/dist/cjs/lib/addLines.js.map +1 -1
  21. package/dist/cjs/lib/concatWritable.d.cts +1 -1
  22. package/dist/cjs/lib/concatWritable.d.ts +1 -1
  23. package/dist/cjs/lib/concatWritable.js +2 -2
  24. package/dist/cjs/lib/concatWritable.js.map +1 -1
  25. package/dist/cjs/spawnTerminal.d.cts +2 -0
  26. package/dist/cjs/spawnTerminal.d.ts +2 -0
  27. package/dist/cjs/spawnTerminal.js +72 -0
  28. package/dist/cjs/spawnTerminal.js.map +1 -0
  29. package/dist/cjs/worker.js +2 -3
  30. package/dist/cjs/worker.js.map +1 -1
  31. package/dist/esm/components/App.js +1 -1
  32. package/dist/esm/components/App.js.map +1 -1
  33. package/dist/esm/components/ChildProcess.js +1 -1
  34. package/dist/esm/components/ChildProcess.js.map +1 -1
  35. package/dist/esm/components/Spinner.js +1 -1
  36. package/dist/esm/components/Spinner.js.map +1 -1
  37. package/dist/esm/createApp.js +36 -38
  38. package/dist/esm/createApp.js.map +1 -1
  39. package/dist/esm/index-cjs.d.ts +4 -5
  40. package/dist/esm/index-cjs.js +4 -15
  41. package/dist/esm/index-cjs.js.map +1 -1
  42. package/dist/esm/index-esm.d.ts +1 -2
  43. package/dist/esm/index-esm.js +3 -14
  44. package/dist/esm/index-esm.js.map +1 -1
  45. package/dist/esm/lib/addLines.d.ts +1 -1
  46. package/dist/esm/lib/addLines.js +1 -1
  47. package/dist/esm/lib/addLines.js.map +1 -1
  48. package/dist/esm/lib/concatWritable.d.ts +1 -1
  49. package/dist/esm/lib/concatWritable.js +1 -1
  50. package/dist/esm/lib/concatWritable.js.map +1 -1
  51. package/dist/esm/spawnTerminal.d.ts +2 -0
  52. package/dist/esm/spawnTerminal.js +16 -0
  53. package/dist/esm/spawnTerminal.js.map +1 -0
  54. package/dist/esm/worker.js +2 -3
  55. package/dist/esm/worker.js.map +1 -1
  56. package/package.json +5 -8
  57. package/assets/ink.cjs +0 -31107
  58. package/assets/intl-adapter.cjs +0 -968
  59. package/dist/cjs/ink.d.cts +0 -7
  60. package/dist/cjs/ink.d.ts +0 -7
  61. package/dist/cjs/ink.js +0 -115
  62. package/dist/cjs/ink.js.map +0 -1
  63. package/dist/esm/ink.d.ts +0 -7
  64. package/dist/esm/ink.js +0 -11
  65. package/dist/esm/ink.js.map +0 -1
@@ -1,968 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "default", {
6
- enumerable: true,
7
- get: function() {
8
- return intlAdapter;
9
- }
10
- });
11
- function _class_call_check(instance, Constructor) {
12
- if (!(instance instanceof Constructor)) {
13
- throw new TypeError("Cannot call a class as a function");
14
- }
15
- }
16
- function _ts_generator(thisArg, body) {
17
- var f, y, t, _ = {
18
- label: 0,
19
- sent: function() {
20
- if (t[0] & 1) throw t[1];
21
- return t[1];
22
- },
23
- trys: [],
24
- ops: []
25
- }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
26
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
27
- return this;
28
- }), g;
29
- function verb(n) {
30
- return function(v) {
31
- return step([
32
- n,
33
- v
34
- ]);
35
- };
36
- }
37
- function step(op) {
38
- if (f) throw new TypeError("Generator is already executing.");
39
- while(g && (g = 0, op[0] && (_ = 0)), _)try {
40
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
41
- if (y = 0, t) op = [
42
- op[0] & 2,
43
- t.value
44
- ];
45
- switch(op[0]){
46
- case 0:
47
- case 1:
48
- t = op;
49
- break;
50
- case 4:
51
- _.label++;
52
- return {
53
- value: op[1],
54
- done: false
55
- };
56
- case 5:
57
- _.label++;
58
- y = op[1];
59
- op = [
60
- 0
61
- ];
62
- continue;
63
- case 7:
64
- op = _.ops.pop();
65
- _.trys.pop();
66
- continue;
67
- default:
68
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
69
- _ = 0;
70
- continue;
71
- }
72
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
73
- _.label = op[1];
74
- break;
75
- }
76
- if (op[0] === 6 && _.label < t[1]) {
77
- _.label = t[1];
78
- t = op;
79
- break;
80
- }
81
- if (t && _.label < t[2]) {
82
- _.label = t[2];
83
- _.ops.push(op);
84
- break;
85
- }
86
- if (t[2]) _.ops.pop();
87
- _.trys.pop();
88
- continue;
89
- }
90
- op = body.call(thisArg, _);
91
- } catch (e) {
92
- op = [
93
- 6,
94
- e
95
- ];
96
- y = 0;
97
- } finally{
98
- f = t = 0;
99
- }
100
- if (op[0] & 5) throw op[1];
101
- return {
102
- value: op[0] ? op[1] : void 0,
103
- done: true
104
- };
105
- }
106
- }
107
- function getDefaultExportFromCjs(x) {
108
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
109
- }
110
- var intlAdapter$1 = {};
111
- var grapheme = {};
112
- var core = {};
113
- var hasRequiredCore;
114
- function requireCore() {
115
- if (hasRequiredCore) return core;
116
- hasRequiredCore = 1;
117
- core.decodeUnicodeData = decodeUnicodeData;
118
- core.findUnicodeRangeIndex = findUnicodeRangeIndex;
119
- // @ts-check
120
- /**
121
- * @template {number} [T=number]
122
- * @typedef {[from: number, to: number, category: T]} CategorizedUnicodeRange
123
- */ /**
124
- * @typedef {CategorizedUnicodeRange<0>} UnicodeRange
125
- */ /**
126
- * @typedef {string & { __tag: 'UnicodeDataEncoding' }} UnicodeDataEncoding
127
- *
128
- * Encoding for array of {@link UnicodeRange}, items separated by comma.
129
- *
130
- * Each {@link UnicodeDataRow} packed as a base36 integer:
131
- *
132
- * padding = to - from
133
- * encoding = base36(from) + ',' + base36(padding)
134
- *
135
- * Notes:
136
- * - base36 can hold surprisingly large numbers in a few characters.
137
- * - The biggest codepoint is 0xE01F0 (918,000) at this point
138
- * - The max value of a category is 23; https://www.unicode.org/reports/tr29/tr29-45.html#Table_Word_Break_Property_Values
139
- * - The longest range is 42,720; CJK UNIFIED IDEOGRAPH-20000..CJK UNIFIED IDEOGRAPH-2A6DF
140
- */ /**
141
- * @template {number} [T=number]
142
- * @param {UnicodeDataEncoding} data
143
- * @param {string} [cats='']
144
- * @returns {Array<CategorizedUnicodeRange<T>>}
145
- */ function decodeUnicodeData(data) {
146
- var cats = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : '';
147
- var buf = /** @type {Array<CategorizedUnicodeRange<T>>} */ [], nums = data.split(',').map(function(s) {
148
- return s ? parseInt(s, 36) : 0;
149
- }), n = 0;
150
- for(var i = 0; i < nums.length; i++)i % 2 ? buf.push([
151
- n,
152
- n + nums[i],
153
- /** @type {T} */ cats ? parseInt(cats[i >> 1], 36) : 0
154
- ]) : n = nums[i];
155
- return buf;
156
- }
157
- /**
158
- * @template {object} Ext
159
- * @typedef {{
160
- * segment: string,
161
- * index: number,
162
- * input: string,
163
- * } & Ext} SegmentOutput
164
- */ /**
165
- * @template {object} T
166
- * @typedef {IterableIterator<SegmentOutput<T>>} Segmenter
167
- */ /**
168
- * @template {number} [T=number]
169
- * @param {number} cp
170
- * @param {CategorizedUnicodeRange<T>[]} ranges
171
- * @return {number} index of matched unicode range, or -1 if no match
172
- */ function findUnicodeRangeIndex(cp, ranges) {
173
- var lo = 0, hi = ranges.length - 1;
174
- while(lo <= hi){
175
- var mid = lo + hi >> 1, range = ranges[mid], l = range[0], h = range[1];
176
- if (l <= cp && cp <= h) return mid;
177
- else if (cp > h) lo = mid + 1;
178
- else hi = mid - 1;
179
- }
180
- return -1;
181
- }
182
- return core;
183
- }
184
- var utils = {};
185
- var hasRequiredUtils;
186
- function requireUtils() {
187
- if (hasRequiredUtils) return utils;
188
- hasRequiredUtils = 1;
189
- utils.isBMP = isBMP;
190
- utils.isHighSurrogate = isHighSurrogate;
191
- utils.isLowSurrogate = isLowSurrogate;
192
- utils.isSIP = isSIP;
193
- utils.isSMP = isSMP;
194
- utils.isSSP = isSSP;
195
- utils.isTIP = isTIP;
196
- utils.surrogatePairToCodePoint = surrogatePairToCodePoint;
197
- // @ts-check
198
- /**
199
- * @param {number} c UTF-16 code point
200
- */ function isHighSurrogate(c) {
201
- return 0xd800 <= c && c <= 0xdbff;
202
- }
203
- /**
204
- * @param {number} c UTF-16 code point
205
- */ function isLowSurrogate(c) {
206
- return 0xdc00 <= c && c <= 0xdfff;
207
- }
208
- /**
209
- * @param {number} hi high surrogate
210
- * @param {number} lo low surrogate
211
- */ function surrogatePairToCodePoint(hi, lo) {
212
- return (hi - 0xd800 << 10) + (lo - 0xdc00) + 0x10000;
213
- }
214
- /**
215
- * Check if given code point is within the BMP(Basic Multilingual Plane)
216
- *
217
- * @param {number} c Unicode code point
218
- * @return {boolean}
219
- */ function isBMP(c) {
220
- return c <= 0xffff;
221
- }
222
- /**
223
- * Check if given code point is within the SMP(Supplementary Multilingual Plane)
224
- *
225
- * @param {number} c Unicode code point
226
- * @return {boolean}
227
- */ function isSMP(c) {
228
- return 0x10000 <= c && c <= 0x1ffff;
229
- }
230
- /**
231
- * Check if given code point is within the SIP(Supplementary Ideographic Plane)
232
- *
233
- * @param {number} c Unicode code point
234
- * @return {boolean}
235
- */ function isSIP(c) {
236
- return 0x20000 <= c && c <= 0x2ffff;
237
- }
238
- /**
239
- * Check if given code point is within the TIP(Tertiary Ideographic Plane)
240
- *
241
- * @param {number} c Unicode code point
242
- * @return {boolean}
243
- */ function isTIP(c) {
244
- return 0x30000 <= c && c <= 0x3ffff;
245
- }
246
- /**
247
- * Check if given code point is within the SSP(Supplementary Special-purpose Plane)
248
- *
249
- * @param {number} c Unicode code point
250
- * @return {boolean}
251
- */ function isSSP(c) {
252
- return 0xe0000 <= c && c <= 0xeffff;
253
- }
254
- return utils;
255
- }
256
- var _grapheme_data = {};
257
- var hasRequired_grapheme_data;
258
- function require_grapheme_data() {
259
- if (hasRequired_grapheme_data) return _grapheme_data;
260
- hasRequired_grapheme_data = 1;
261
- _grapheme_data.grapheme_ranges = _grapheme_data.GraphemeCategory = void 0;
262
- var _core = /*@__PURE__*/ requireCore();
263
- // The following code was generated by "scripts/unicode.js",
264
- // DO NOT EDIT DIRECTLY.
265
- //
266
- // @ts-check
267
- /**
268
- * @typedef {import('./core.js').UnicodeDataEncoding} UnicodeDataEncoding
269
- */ /**
270
- * @typedef {0} GC_Any
271
- * @typedef {1} GC_CR
272
- * @typedef {2} GC_Control
273
- * @typedef {3} GC_Extend
274
- * @typedef {4} GC_Extended_Pictographic
275
- * @typedef {5} GC_L
276
- * @typedef {6} GC_LF
277
- * @typedef {7} GC_LV
278
- * @typedef {8} GC_LVT
279
- * @typedef {9} GC_Prepend
280
- * @typedef {10} GC_Regional_Indicator
281
- * @typedef {11} GC_SpacingMark
282
- * @typedef {12} GC_T
283
- * @typedef {13} GC_V
284
- * @typedef {14} GC_ZWJ
285
- * @typedef {(
286
- * | GC_Any
287
- * | GC_CR
288
- * | GC_Control
289
- * | GC_Extend
290
- * | GC_Extended_Pictographic
291
- * | GC_L
292
- * | GC_LF
293
- * | GC_LV
294
- * | GC_LVT
295
- * | GC_Prepend
296
- * | GC_Regional_Indicator
297
- * | GC_SpacingMark
298
- * | GC_T
299
- * | GC_V
300
- * | GC_ZWJ
301
- * )} GraphemeCategoryNum
302
- */ /**
303
- * @typedef {import('./core.js').CategorizedUnicodeRange<GraphemeCategoryNum>} GraphemeCategoryRange
304
- */ /**
305
- * @typedef {(
306
- * | 'Any'
307
- * | 'CR'
308
- * | 'Control'
309
- * | 'Extend'
310
- * | 'Extended_Pictographic'
311
- * | 'L'
312
- * | 'LF'
313
- * | 'LV'
314
- * | 'LVT'
315
- * | 'Prepend'
316
- * | 'Regional_Indicator'
317
- * | 'SpacingMark'
318
- * | 'T'
319
- * | 'V'
320
- * | 'ZWJ'
321
- * )} GraphemeCategoryKey
322
- */ /**
323
- * Grapheme category enum
324
- *
325
- * Note:
326
- * The object isn't actually frozen
327
- * because using `Object.freeze` increases 800 bytes on Brotli compression.
328
- *
329
- * @type {Readonly<Record<GraphemeCategoryKey, GraphemeCategoryNum>>}
330
- */ _grapheme_data.GraphemeCategory = {
331
- Any: 0,
332
- CR: 1,
333
- Control: 2,
334
- Extend: 3,
335
- Extended_Pictographic: 4,
336
- L: 5,
337
- LF: 6,
338
- LV: 7,
339
- LVT: 8,
340
- Prepend: 9,
341
- Regional_Indicator: 10,
342
- SpacingMark: 11,
343
- T: 12,
344
- V: 13,
345
- ZWJ: 14
346
- };
347
- /**
348
- * @type {GraphemeCategoryRange[]}
349
- */ _grapheme_data.grapheme_ranges = (0, _core.decodeUnicodeData)(/** @type {UnicodeDataEncoding} */ ',9,a,,b,1,d,,e,h,3j,w,4p,,4t,,4u,,lc,33,w3,6,13l,18,14v,,14x,1,150,1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10f0,,10f1,q,10fs,,10ft,q,10gk,,10gl,q,10hc,,10hd,q,10i4,,10i5,q,10iw,,10ix,q,10jo,,10jp,q,10kg,,10kh,q,10l8,,10l9,q,10m0,,10m1,q,10ms,,10mt,q,10nk,,10nl,q,10oc,,10od,q,10p4,,10p5,q,10pw,,10px,q,10qo,,10qp,q,10rg,,10rh,q,10s8,,10s9,q,10t0,,10t1,q,10ts,,10tt,q,10uk,,10ul,q,10vc,,10vd,q,10w4,,10w5,q,10ww,,10wx,q,10xo,,10xp,q,10yg,,10yh,q,10z8,,10z9,q,1100,,1101,q,110s,,110t,q,111k,,111l,q,112c,,112d,q,1134,,1135,q,113w,,113x,q,114o,,114p,q,115g,,115h,q,1168,,1169,q,1170,,1171,q,117s,,117t,q,118k,,118l,q,119c,,119d,q,11a4,,11a5,q,11aw,,11ax,q,11bo,,11bp,q,11cg,,11ch,q,11d8,,11d9,q,11e0,,11e1,q,11es,,11et,q,11fk,,11fl,q,11gc,,11gd,q,11h4,,11h5,q,11hw,,11hx,q,11io,,11ip,q,11jg,,11jh,q,11k8,,11k9,q,11l0,,11l1,q,11ls,,11lt,q,11mk,,11ml,q,11nc,,11nd,q,11o4,,11o5,q,11ow,,11ox,q,11po,,11pp,q,11qg,,11qh,q,11r8,,11r9,q,11s0,,11s1,q,11ss,,11st,q,11tk,,11tl,q,11uc,,11ud,q,11v4,,11v5,q,11vw,,11vx,q,11wo,,11wp,q,11xg,,11xh,q,11y8,,11y9,q,11z0,,11z1,q,11zs,,11zt,q,120k,,120l,q,121c,,121d,q,1224,,1225,q,122w,,122x,q,123o,,123p,q,124g,,124h,q,1258,,1259,q,1260,,1261,q,126s,,126t,q,127k,,127l,q,128c,,128d,q,1294,,1295,q,129w,,129x,q,12ao,,12ap,q,12bg,,12bh,q,12c8,,12c9,q,12d0,,12d1,q,12ds,,12dt,q,12ek,,12el,q,12fc,,12fd,q,12g4,,12g5,q,12gw,,12gx,q,12ho,,12hp,q,12ig,,12ih,q,12j8,,12j9,q,12k0,,12k1,q,12ks,,12kt,q,12lk,,12ll,q,12mc,,12md,q,12n4,,12n5,q,12nw,,12nx,q,12oo,,12op,q,12pg,,12ph,q,12q8,,12q9,q,12r0,,12r1,q,12rs,,12rt,q,12sk,,12sl,q,12tc,,12td,q,12u4,,12u5,q,12uw,,12ux,q,12vo,,12vp,q,12wg,,12wh,q,12x8,,12x9,q,12y0,,12y1,q,12ys,,12yt,q,12zk,,12zl,q,130c,,130d,q,1314,,1315,q,131w,,131x,q,132o,,132p,q,133g,,133h,q,1348,,1349,q,1350,,1351,q,135s,,135t,q,136k,,136l,q,137c,,137d,q,1384,,1385,q,138w,,138x,q,139o,,139p,q,13ag,,13ah,q,13b8,,13b9,q,13c0,,13c1,q,13cs,,13ct,q,13dk,,13dl,q,13ec,,13ed,q,13f4,,13f5,q,13fw,,13fx,q,13go,,13gp,q,13hg,,13hh,q,13i8,,13i9,q,13j0,,13j1,q,13js,,13jt,q,13kk,,13kl,q,13lc,,13ld,q,13m4,,13m5,q,13mw,,13mx,q,13no,,13np,q,13og,,13oh,q,13p8,,13p9,q,13q0,,13q1,q,13qs,,13qt,q,13rk,,13rl,q,13sc,,13sd,q,13t4,,13t5,q,13tw,,13tx,q,13uo,,13up,q,13vg,,13vh,q,13w8,,13w9,q,13x0,,13x1,q,13xs,,13xt,q,13yk,,13yl,q,13zc,,13zd,q,1404,,1405,q,140w,,140x,q,141o,,141p,q,142g,,142h,q,1438,,1439,q,1440,,1441,q,144s,,144t,q,145k,,145l,q,146c,,146d,q,1474,,1475,q,147w,,147x,q,148o,,148p,q,149g,,149h,q,14a8,,14a9,q,14b0,,14b1,q,14bs,,14bt,q,14ck,,14cl,q,14dc,,14dd,q,14e4,,14e5,q,14ew,,14ex,q,14fo,,14fp,q,14gg,,14gh,q,14h8,,14h9,q,14i0,,14i1,q,14is,,14it,q,14jk,,14jl,q,14kc,,14kd,q,14l4,,14l5,q,14lw,,14lx,q,14mo,,14mp,q,14ng,,14nh,q,14o8,,14o9,q,14p0,,14p1,q,14ps,,14pt,q,14qk,,14ql,q,14rc,,14rd,q,14s4,,14s5,q,14sw,,14sx,q,14to,,14tp,q,14ug,,14uh,q,14v8,,14v9,q,14w0,,14w1,q,14ws,,14wt,q,14xk,,14xl,q,14yc,,14yd,q,14z4,,14z5,q,14zw,,14zx,q,150o,,150p,q,151g,,151h,q,1528,,1529,q,1530,,1531,q,153s,,153t,q,154k,,154l,q,155c,,155d,q,1564,,1565,q,156w,,156x,q,157o,,157p,q,158g,,158h,q,1598,,1599,q,15a0,,15a1,q,15as,,15at,q,15bk,,15bl,q,15cc,,15cd,q,15d4,,15d5,q,15dw,,15dx,q,15eo,,15ep,q,15fg,,15fh,q,15g8,,15g9,q,15h0,,15h1,q,15hs,,15ht,q,15ik,,15il,q,15jc,,15jd,q,15k4,,15k5,q,15kw,,15kx,q,15lo,,15lp,q,15mg,,15mh,q,15n8,,15n9,q,15o0,,15o1,q,15os,,15ot,q,15pk,,15pl,q,15qc,,15qd,q,15r4,,15r5,q,15rw,,15rx,q,15so,,15sp,q,15tg,,15th,q,15u8,,15u9,q,15v0,,15v1,q,15vs,,15vt,q,15wk,,15wl,q,15xc,,15xd,q,15y4,,15y5,q,15yw,,15yx,q,15zo,,15zp,q,160g,,160h,q,1618,,1619,q,1620,,1621,q,162s,,162t,q,163k,,163l,q,164c,,164d,q,1654,,1655,q,165w,,165x,q,166o,,166p,q,167g,,167h,q,1688,,1689,q,1690,,1691,q,169s,,169t,q,16ak,,16al,q,16bc,,16bd,q,16c4,,16c5,q,16cw,,16cx,q,16do,,16dp,q,16eg,,16eh,q,16f8,,16f9,q,16g0,,16g1,q,16gs,,16gt,q,16hk,,16hl,q,16ic,,16id,q,16j4,,16j5,q,16jw,,16jx,q,16ko,,16kp,q,16ls,m,16mj,1c,1dlq,,1e68,f,1e74,f,1edb,,1ehq,1,1ek0,b,1eyl,,1f4w,,1f92,4,1gjl,2,1gjp,1,1gjw,3,1gl4,2,1glb,,1gpx,1,1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kcn,,1kei,4,1keo,1,1ker,1,1ket,,1keu,,1kev,,1koj,1,1kol,1,1kow,1,1koy,,1koz,,1kqc,1,1kqe,4,1kqm,1,1kqo,2,1kre,,1ovk,f,1ow0,,1ow7,e,1xr2,b,1xre,2,1xrh,2,1zow,4,1zqo,6,206b,,206f,3,20jz,,20k1,1i,20lr,3,20o4,,20og,1,2ftp,1,2fts,3,2jgg,19,2jhs,m,2jxh,4,2jxp,5,2jxv,7,2jy3,7,2jyd,6,2jze,3,2k3m,2,2lmo,1i,2lob,1d,2lpx,,2lqc,,2lqz,4,2lr5,e,2mtc,6,2mtk,g,2mu3,6,2mub,1,2mue,4,2mxb,,2n1s,6,2nce,,2ne4,3,2nsc,3,2nzi,1,2ok0,6,2on8,6,2pz4,73,2q6l,2,2q7j,,2q98,5,2q9q,1,2qa6,,2qa9,9,2qb1,1k,2qcm,p,2qdd,e,2qe2,,2qen,,2qeq,8,2qf0,3,2qfd,c1,2qrf,4,2qrk,8t,2r0m,7d,2r9c,3j,2rg4,b,2rit,16,2rkc,3,2rm0,7,2rmi,5,2rns,7,2rou,29,2rrg,1a,2rss,9,2rt3,c8,2scg,sd,jny8,v,jnz4,2n,jo1s,3j,jo5c,6n,joc0,2rz', '262122424333333393233393339333333333393393b3b3b3b3b333b33b3bb33333b3b3333333b3b33bb3333b33b3bb33333b3bbb333b333b33333b3b3b3b3333b3b33b3bb39333b33b33b3b3b333b333333b3b333333b33b3b3333b3335dc333333b3b3b33323333b3bb3b33b3b3b3333b3333b3b333bb3b33b3b3b3b3b333b333b3323e2244234444444444444444444444444444444444444444443333443443333333b3b3bb33333b353b3b3b3b333b3b333b333333b3bb3b3b3bb3787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878787878dc333232333333333333333b3b3333bb3b393933b3b33bb3b393b3b3b3333b33b33b3bbb33b333b3333bb3933b3b3b333b3b3b3b3b33b3b3b33b3b3b33b3b33b33b3b3b33bb39b9b3b33b3b33b9333b393b3b33b33b3b3b3333393b3b3b33b39bb3b332333b333dd3b33332333323333333333333333333333344444444a44444434444444444444423232');
350
- return _grapheme_data;
351
- }
352
- var _incb_data = {};
353
- var hasRequired_incb_data;
354
- function require_incb_data() {
355
- if (hasRequired_incb_data) return _incb_data;
356
- hasRequired_incb_data = 1;
357
- _incb_data.consonant_ranges = void 0;
358
- var _core = /*@__PURE__*/ requireCore();
359
- // The following code was generated by "scripts/unicode.js",
360
- // DO NOT EDIT DIRECTLY.
361
- //
362
- // @ts-check
363
- /**
364
- * @typedef {import('./core.js').UnicodeRange} UnicodeRange
365
- * @typedef {import('./core.js').UnicodeDataEncoding} UnicodeDataEncoding
366
- */ /**
367
- * The Unicode `Indic_Conjunct_Break=Consonant` derived property table
368
- *
369
- * @type {UnicodeRange[]}
370
- */ _incb_data.consonant_ranges = (0, _core.decodeUnicodeData)(/** @type {UnicodeDataEncoding} */ '1sl,10,1ug,7,1vc,7,1w5,j,1wq,6,1wy,,1x2,3,1y4,1,1y7,,1yo,1,239,j,23u,6,242,1,245,4,261,,26t,j,27e,6,27m,1,27p,4,28s,1,28v,,29d,,2dx,j,2ei,f,2fs,2,2l1,11');
371
- return _incb_data;
372
- }
373
- var hasRequiredGrapheme;
374
- function requireGrapheme() {
375
- if (hasRequiredGrapheme) return grapheme;
376
- hasRequiredGrapheme = 1;
377
- grapheme.countGrapheme = grapheme.countGraphemes = countGraphemes;
378
- grapheme.graphemeSegments = graphemeSegments;
379
- grapheme.splitGraphemes = splitGraphemes;
380
- var _core = /*@__PURE__*/ requireCore();
381
- var _utils = /*@__PURE__*/ requireUtils();
382
- var _grapheme_data = /*@__PURE__*/ require_grapheme_data();
383
- grapheme.GraphemeCategory = _grapheme_data.GraphemeCategory;
384
- var _incb_data = /*@__PURE__*/ require_incb_data();
385
- // Copyright 2012-2018 The Rust Project Developers. See the COPYRIGHT
386
- // file at the top-level directory of this distribution and at
387
- // http://rust-lang.org/COPYRIGHT.
388
- //
389
- // Licensed under the MIT license
390
- // <LICENSE-MIT or http://opensource.org/licenses/MIT>.
391
- //
392
- // Modified original Rust library [source code]
393
- // (https://github.com/unicode-rs/unicode-segmentation/blob/1f88570/src/grapheme.rs)
394
- //
395
- // to create JavaScript library [unicode-segmenter]
396
- // (https://github.com/cometkim/unicode-segmenter)
397
- // @ts-check
398
- /**
399
- * @typedef {import('./_grapheme_data.js').GC_Any} GC_Any
400
- *
401
- * @typedef {import('./_grapheme_data.js').GraphemeCategoryNum} GraphemeCategoryNum
402
- * @typedef {import('./_grapheme_data.js').GraphemeCategoryRange} GraphemeCategoryRange
403
- *
404
- * @typedef {object} GraphemeSegmentExtra
405
- * @property {number} _hd The first code point of the segment
406
- * @property {GraphemeCategoryNum} _catBegin Beginning Grapheme_Cluster_Break category of the segment
407
- * @property {GraphemeCategoryNum} _catEnd Ending Grapheme_Cluster_Break category of the segment
408
- *
409
- * @typedef {import('./core.js').Segmenter<GraphemeSegmentExtra>} GraphemeSegmenter
410
- */ /**
411
- * Unicode segmentation by extended grapheme rules.
412
- *
413
- * This is fully compatible with the {@link IntlSegmenter.segment} API
414
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment
415
- *
416
- * @param {string} input
417
- * @return {GraphemeSegmenter} iterator for grapheme cluster segments
418
- */ function graphemeSegments(input) {
419
- var cursor, len, catBefore, catAfter, catBegin, cache, risCount, emoji, consonant, linker, incb, cp, _hd, index, segment;
420
- return _ts_generator(this, function(_state) {
421
- switch(_state.label){
422
- case 0:
423
- // do nothing on empty string
424
- if (input === '') {
425
- return [
426
- 2
427
- ];
428
- }
429
- /** @type {number} Current cursor position. */ cursor = 0;
430
- /** @type {number} Total length of the input string. */ len = input.length;
431
- /** @type {GraphemeCategoryNum | null} Category of codepoint immediately preceding cursor, if known. */ catBefore = null;
432
- /** @type {GraphemeCategoryNum | null} Category of codepoint immediately preceding cursor, if known. */ catAfter = null;
433
- /** @type {GraphemeCategoryNum | null} Beginning category of a segment */ catBegin = null;
434
- /** @type {import('./_grapheme_data.js').GraphemeCategoryRange} */ cache = [
435
- 0,
436
- 0,
437
- 2 /* GC_Control */
438
- ];
439
- /** @type {number} The number of RIS codepoints preceding `cursor`. */ risCount = 0;
440
- /** Emoji state */ emoji = false;
441
- /** InCB=Consonant */ consonant = false;
442
- /** InCB=Linker */ linker = false;
443
- /** InCB=Consonant InCB=Linker x InCB=Consonant */ incb = false;
444
- cp = /** @type {number} */ input.codePointAt(cursor);
445
- /** Memoize the beginnig code point a the segment. */ _hd = cp;
446
- index = 0;
447
- segment = '';
448
- _state.label = 1;
449
- case 1:
450
- if (!true) return [
451
- 3,
452
- 7
453
- ];
454
- segment += input[cursor++];
455
- if (!(0, _utils.isBMP)(cp)) {
456
- segment += input[cursor++];
457
- }
458
- // Note: Of course the nullish coalescing is useful here,
459
- // but avoid it for aggressive compatibility and perf claim
460
- catBefore = catAfter;
461
- if (catBefore === null) {
462
- catBefore = cat(cp, cache);
463
- catBegin = catBefore;
464
- }
465
- // Note: Lazily update `consonant` and `linker` state
466
- // which is a extra overhead only for Hindi text.
467
- if (!consonant && catBefore === 0) {
468
- consonant = isIndicConjunctCosonant(cp);
469
- } else if (catBefore === 3 /* Extend */ ) {
470
- // Note: \p{InCB=Linker} is a subset of \p{Extend}
471
- linker = isIndicConjunctLinker(cp);
472
- }
473
- if (!(cursor < len)) return [
474
- 3,
475
- 2
476
- ];
477
- cp = /** @type {number} */ input.codePointAt(cursor);
478
- catAfter = cat(cp, cache);
479
- return [
480
- 3,
481
- 4
482
- ];
483
- case 2:
484
- return [
485
- 4,
486
- {
487
- segment: segment,
488
- index: index,
489
- input: input,
490
- _hd: _hd,
491
- _catBegin: /** @type {typeof catBefore} */ catBegin,
492
- _catEnd: catBefore
493
- }
494
- ];
495
- case 3:
496
- _state.sent();
497
- return [
498
- 2
499
- ];
500
- case 4:
501
- if (catBefore === 10 /* Regional_Indicator */ ) {
502
- risCount += 1;
503
- } else {
504
- risCount = 0;
505
- if (catAfter === 14 /* ZWJ */ && (catBefore === 3 /* Extend */ || catBefore === 4 /* Extended_Pictographic */ )) {
506
- emoji = true;
507
- } else if (catAfter === 0 /* Any */ ) {
508
- // Note: Put GB9c rule checking here to reduce.
509
- incb = consonant && linker && (consonant = isIndicConjunctCosonant(cp));
510
- // It cannot be both a linker and a consonant.
511
- linker = linker && !consonant;
512
- }
513
- }
514
- if (!isBoundary(catBefore, catAfter, risCount, emoji, incb)) return [
515
- 3,
516
- 6
517
- ];
518
- return [
519
- 4,
520
- {
521
- segment: segment,
522
- index: index,
523
- input: input,
524
- _hd: _hd,
525
- _catBegin: /** @type {typeof catBefore} */ catBegin,
526
- _catEnd: catBefore
527
- }
528
- ];
529
- case 5:
530
- _state.sent();
531
- // flush
532
- index = cursor;
533
- segment = '';
534
- emoji = false;
535
- incb = false;
536
- catBegin = catAfter;
537
- _hd = cp;
538
- _state.label = 6;
539
- case 6:
540
- return [
541
- 3,
542
- 1
543
- ];
544
- case 7:
545
- return [
546
- 2
547
- ];
548
- }
549
- });
550
- }
551
- /**
552
- * Count number of extended grapheme clusters in given text.
553
- *
554
- * NOTE:
555
- *
556
- * This function is a small wrapper around {@link graphemeSegments}.
557
- *
558
- * If you call it more than once at a time, consider memoization
559
- * or use {@link graphemeSegments} or {@link splitGraphemes} once instead
560
- *
561
- * @param {string} text
562
- * @return {number} count of grapheme clusters
563
- */ function countGraphemes(text) {
564
- var count = 0;
565
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
566
- try {
567
- for(var _iterator = graphemeSegments(text)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
568
- var _ = _step.value;
569
- count += 1;
570
- }
571
- } catch (err) {
572
- _didIteratorError = true;
573
- _iteratorError = err;
574
- } finally{
575
- try {
576
- if (!_iteratorNormalCompletion && _iterator.return != null) {
577
- _iterator.return();
578
- }
579
- } finally{
580
- if (_didIteratorError) {
581
- throw _iteratorError;
582
- }
583
- }
584
- }
585
- return count;
586
- }
587
- /**
588
- * Split given text into extended grapheme clusters.
589
- *
590
- * @param {string} text
591
- * @return {IterableIterator<string>} iterator for grapheme clusters
592
- *
593
- * @see {@link graphemeSegments} if you need extra information.
594
- *
595
- * @example
596
- * [...splitGraphemes('abc')] // => ['a', 'b', 'c']
597
- */ function splitGraphemes(text) {
598
- var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, s, err;
599
- return _ts_generator(this, function(_state) {
600
- switch(_state.label){
601
- case 0:
602
- _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
603
- _state.label = 1;
604
- case 1:
605
- _state.trys.push([
606
- 1,
607
- 6,
608
- 7,
609
- 8
610
- ]);
611
- _iterator = graphemeSegments(text)[Symbol.iterator]();
612
- _state.label = 2;
613
- case 2:
614
- if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
615
- 3,
616
- 5
617
- ];
618
- s = _step.value;
619
- return [
620
- 4,
621
- s.segment
622
- ];
623
- case 3:
624
- _state.sent();
625
- _state.label = 4;
626
- case 4:
627
- _iteratorNormalCompletion = true;
628
- return [
629
- 3,
630
- 2
631
- ];
632
- case 5:
633
- return [
634
- 3,
635
- 8
636
- ];
637
- case 6:
638
- err = _state.sent();
639
- _didIteratorError = true;
640
- _iteratorError = err;
641
- return [
642
- 3,
643
- 8
644
- ];
645
- case 7:
646
- try {
647
- if (!_iteratorNormalCompletion && _iterator.return != null) {
648
- _iterator.return();
649
- }
650
- } finally{
651
- if (_didIteratorError) {
652
- throw _iteratorError;
653
- }
654
- }
655
- return [
656
- 7
657
- ];
658
- case 8:
659
- return [
660
- 2
661
- ];
662
- }
663
- });
664
- }
665
- /**
666
- * `Grapheme_Cluster_Break` property value of a given codepoint
667
- *
668
- * @see https://www.unicode.org/reports/tr29/tr29-43.html#Default_Grapheme_Cluster_Table
669
- *
670
- * @param {number} cp
671
- * @param {import('./_grapheme_data.js').GraphemeCategoryRange} cache
672
- * @return {GraphemeCategoryNum}
673
- */ function cat(cp, cache) {
674
- if (cp < 127) {
675
- // Special-case optimization for ascii, except U+007F. This
676
- // improves performance even for many primarily non-ascii texts,
677
- // due to use of punctuation and white space characters from the
678
- // ascii range.
679
- if (cp >= 32) {
680
- return 0 /* GC_Any */ ;
681
- } else if (cp === 10) {
682
- return 6 /* GC_LF */ ;
683
- } else if (cp === 13) {
684
- return 1 /* GC_CR */ ;
685
- } else {
686
- return 2 /* GC_Control */ ;
687
- }
688
- } else {
689
- // If this char isn't within the cached range, update the cache to the
690
- // range that includes it.
691
- if (cp < cache[0] || cp > cache[1]) {
692
- var index = (0, _core.findUnicodeRangeIndex)(cp, _grapheme_data.grapheme_ranges);
693
- if (index < 0) {
694
- return 0;
695
- }
696
- var range = _grapheme_data.grapheme_ranges[index];
697
- cache[0] = range[0];
698
- cache[1] = range[1];
699
- cache[2] = range[2];
700
- }
701
- return cache[2];
702
- }
703
- }
704
- /**
705
- * @param {number} cp
706
- * @return {boolean}
707
- */ function isIndicConjunctCosonant(cp) {
708
- return (0, _core.findUnicodeRangeIndex)(cp, _incb_data.consonant_ranges) >= 0;
709
- }
710
- /**
711
- * @param {number} cp
712
- * @return {boolean}
713
- */ function isIndicConjunctLinker(cp) {
714
- return cp === 2381 /* 0x094D */ || cp === 2509 /* 0x09CD */ || cp === 2765 /* 0x0ACD */ || cp === 2893 /* 0x0B4D */ || cp === 3149 /* 0x0C4D */ || cp === 3405 /* 0x0D4D */ ;
715
- }
716
- /**
717
- * @param {GraphemeCategoryNum} catBefore
718
- * @param {GraphemeCategoryNum} catAfter
719
- * @param {number} risCount Regional_Indicator state
720
- * @param {boolean} emoji Extended_Pictographic state
721
- * @param {boolean} incb Indic_Conjunct_Break state
722
- * @return {boolean}
723
- *
724
- * @see https://www.unicode.org/reports/tr29/tr29-43.html#Grapheme_Cluster_Boundary_Rules
725
- */ function isBoundary(catBefore, catAfter, risCount, emoji, incb) {
726
- // GB3
727
- if (catBefore === 1 && catAfter === 6) {
728
- return false;
729
- }
730
- // GB4
731
- if (catBefore === 1 || catBefore === 2 || catBefore === 6) {
732
- return true;
733
- }
734
- // GB5
735
- if (catAfter === 1 || catAfter === 2 || catAfter === 6) {
736
- return true;
737
- }
738
- // GB6
739
- if (catBefore === 5 && (catAfter === 5 || catAfter === 7 || catAfter === 8 || catAfter === 13)) {
740
- return false;
741
- }
742
- // GB7
743
- if ((catBefore === 7 || catBefore === 13) && (catAfter === 12 || catAfter === 13)) {
744
- return false;
745
- }
746
- // GB8
747
- if (catAfter === 12 && (catBefore === 8 || catBefore === 12)) {
748
- return false;
749
- }
750
- // GB9
751
- if (catAfter === 3 || catAfter === 14) {
752
- return false;
753
- }
754
- // GB9a
755
- if (catAfter === 11) {
756
- return false;
757
- }
758
- // GB9b
759
- if (catBefore === 9) {
760
- return false;
761
- }
762
- // GB9c
763
- if (catAfter === 0 && incb) {
764
- return false;
765
- }
766
- // GB11
767
- if (catBefore === 14 && catAfter === 4) {
768
- return !emoji;
769
- }
770
- // GB12, GB13
771
- if (catBefore === 10 && catAfter === 10) {
772
- return risCount % 2 === 0;
773
- }
774
- // GB999
775
- return true;
776
- }
777
- return grapheme;
778
- }
779
- var hasRequiredIntlAdapter;
780
- function requireIntlAdapter() {
781
- if (hasRequiredIntlAdapter) return intlAdapter$1;
782
- hasRequiredIntlAdapter = 1;
783
- intlAdapter$1.Segmenter = void 0;
784
- var _grapheme = /*@__PURE__*/ requireGrapheme();
785
- // @ts-check
786
- var p_locale = Symbol();
787
- var p_granularity = Symbol();
788
- /**
789
- * Adapter for `IntlSegmenter` API
790
- *
791
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter
792
- *
793
- * @implements {IntlSegmenter}
794
- */ var Segmenter = /*#__PURE__*/ function() {
795
- "use strict";
796
- function Segmenter(locale) {
797
- var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
798
- _class_call_check(this, Segmenter);
799
- var _options_granularity = options.granularity, granularity = _options_granularity === void 0 ? 'grapheme' : _options_granularity;
800
- switch(granularity){
801
- case 'grapheme':
802
- break;
803
- case 'word':
804
- throw new TypeError('Unicode "word" segmenter is currently not implemented');
805
- case 'sentence':
806
- throw new TypeError('Unicode "sentence" segmenter is currently not implemented');
807
- default:
808
- throw new RangeError("Value ".concat(granularity, " out of range for IntlSegmenter options property granularity"));
809
- }
810
- /** @type {string} */ this[p_locale] = locale || 'en';
811
- /** @type {Intl.ResolvedSegmenterOptions["granularity"]} */ this[p_granularity] = granularity;
812
- }
813
- var _proto = Segmenter.prototype;
814
- /**
815
- * Impelements {@link IntlSegmenter.segment}
816
- *
817
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment
818
- *
819
- * @param {string} input
820
- * @return {SegmentsAdapter}
821
- */ _proto.segment = function segment(input) {
822
- return new SegmentsAdapter(input);
823
- };
824
- /**
825
- * Impelements {@link IntlSegmenter.resolvedOptions}
826
- *
827
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/resolvedOptions
828
- * @return {Intl.ResolvedSegmenterOptions}
829
- */ _proto.resolvedOptions = function resolvedOptions() {
830
- return {
831
- locale: this[p_locale],
832
- granularity: this[p_granularity]
833
- };
834
- };
835
- return Segmenter;
836
- }();
837
- /**
838
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment/Segments
839
- * @implements {Intl.Segments}
840
- */ intlAdapter$1.Segmenter = Segmenter;
841
- var SegmentsAdapter = /*#__PURE__*/ function() {
842
- "use strict";
843
- function SegmentsAdapter(input) {
844
- _class_call_check(this, SegmentsAdapter);
845
- /** @type {string} */ this.input = input;
846
- }
847
- var _proto = SegmentsAdapter.prototype;
848
- /**
849
- * @return {Intl.SegmentIterator<Intl.SegmentData>}
850
- */ _proto[Symbol.iterator] = function() {
851
- var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _step_value, segment, index, input, err;
852
- return _ts_generator(this, function(_state) {
853
- switch(_state.label){
854
- case 0:
855
- _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
856
- _state.label = 1;
857
- case 1:
858
- _state.trys.push([
859
- 1,
860
- 6,
861
- 7,
862
- 8
863
- ]);
864
- _iterator = (0, _grapheme.graphemeSegments)(this.input)[Symbol.iterator]();
865
- _state.label = 2;
866
- case 2:
867
- if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
868
- 3,
869
- 5
870
- ];
871
- _step_value = _step.value, segment = _step_value.segment, index = _step_value.index, input = _step_value.input;
872
- return [
873
- 4,
874
- {
875
- segment: segment,
876
- index: index,
877
- input: input
878
- }
879
- ];
880
- case 3:
881
- _state.sent();
882
- _state.label = 4;
883
- case 4:
884
- _iteratorNormalCompletion = true;
885
- return [
886
- 3,
887
- 2
888
- ];
889
- case 5:
890
- return [
891
- 3,
892
- 8
893
- ];
894
- case 6:
895
- err = _state.sent();
896
- _didIteratorError = true;
897
- _iteratorError = err;
898
- return [
899
- 3,
900
- 8
901
- ];
902
- case 7:
903
- try {
904
- if (!_iteratorNormalCompletion && _iterator.return != null) {
905
- _iterator.return();
906
- }
907
- } finally{
908
- if (_didIteratorError) {
909
- throw _iteratorError;
910
- }
911
- }
912
- return [
913
- 7
914
- ];
915
- case 8:
916
- return [
917
- 2
918
- ];
919
- }
920
- });
921
- };
922
- /**
923
- * Impelements {@link Intl.Segments.containing}
924
- *
925
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Segmenter/segment/Segments/containing
926
- *
927
- * @param {number} [codeUnitIndex=0]
928
- * @return {Intl.SegmentData} A resolved segment data
929
- */ _proto.containing = function containing() {
930
- var codeUnitIndex = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
931
- var offset = 0;
932
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
933
- try {
934
- // only grapheme segmenter is currently provided
935
- for(var _iterator = (0, _grapheme.graphemeSegments)(this.input)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
936
- var x = _step.value;
937
- offset += x.segment.length;
938
- if (codeUnitIndex < offset) {
939
- return x;
940
- }
941
- }
942
- } catch (err) {
943
- _didIteratorError = true;
944
- _iteratorError = err;
945
- } finally{
946
- try {
947
- if (!_iteratorNormalCompletion && _iterator.return != null) {
948
- _iterator.return();
949
- }
950
- } finally{
951
- if (_didIteratorError) {
952
- throw _iteratorError;
953
- }
954
- }
955
- }
956
- // FIXME mistyped upstream
957
- // See https://github.com/microsoft/TypeScript/pull/58084
958
- // @ts-ignore `Segments.prototype.containing()` can actually returns `undefined`.
959
- return undefined;
960
- };
961
- return SegmentsAdapter;
962
- }();
963
- return intlAdapter$1;
964
- }
965
- var intlAdapterExports = requireIntlAdapter();
966
- var intlAdapter = /*@__PURE__*/ getDefaultExportFromCjs(intlAdapterExports);
967
-
968
- /* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) { }; module.exports = exports.default; }