@dso-toolkit/core 58.3.1 → 59.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/cjs/_commonjsHelpers-68cdf74f.js +7 -0
  2. package/dist/cjs/_commonjsHelpers-68cdf74f.js.map +1 -0
  3. package/dist/cjs/dso-alert_5.cjs.entry.js +497 -46
  4. package/dist/cjs/dso-alert_5.cjs.entry.js.map +1 -1
  5. package/dist/cjs/dso-annotation-output_3.cjs.entry.js +6 -2
  6. package/dist/cjs/dso-annotation-output_3.cjs.entry.js.map +1 -1
  7. package/dist/cjs/dso-modal.cjs.entry.js +1 -1
  8. package/dist/cjs/dso-modal.cjs.entry.js.map +1 -1
  9. package/dist/cjs/dso-table.cjs.entry.js +1 -1
  10. package/dist/cjs/dso-table.cjs.entry.js.map +1 -1
  11. package/dist/cjs/dso-toolkit.cjs.js +1 -1
  12. package/dist/cjs/dso-tooltip.cjs.entry.js +1 -1
  13. package/dist/cjs/dso-tooltip.cjs.entry.js.map +1 -1
  14. package/dist/cjs/dsot-document-component-demo.cjs.entry.js +1688 -41
  15. package/dist/cjs/dsot-document-component-demo.cjs.entry.js.map +1 -1
  16. package/dist/cjs/loader.cjs.js +1 -1
  17. package/dist/collection/collection-manifest.json +1 -1
  18. package/dist/collection/components/document-component/document-component.css +687 -13
  19. package/dist/collection/components/document-component/document-component.js +31 -7
  20. package/dist/collection/components/document-component/document-component.js.map +1 -1
  21. package/dist/collection/components/document-component/document-component.models.js +2 -0
  22. package/dist/collection/components/document-component/document-component.models.js.map +1 -0
  23. package/dist/collection/components/document-component-demo/document-component.demo.css +11 -0
  24. package/dist/collection/components/document-component-demo/document-component.demo.js +235 -0
  25. package/dist/collection/components/document-component-demo/document-component.demo.js.map +1 -0
  26. package/dist/collection/components/modal/modal.css +3 -3
  27. package/dist/collection/components/ozon-content/nodes/al.node.js +24 -7
  28. package/dist/collection/components/ozon-content/nodes/al.node.js.map +1 -1
  29. package/dist/collection/components/ozon-content/nodes/ext-ref.node.js +3 -1
  30. package/dist/collection/components/ozon-content/nodes/ext-ref.node.js.map +1 -1
  31. package/dist/collection/components/ozon-content/nodes/nieuwe-tekst.node.js +1 -1
  32. package/dist/collection/components/ozon-content/nodes/nieuwe-tekst.node.js.map +1 -1
  33. package/dist/collection/components/ozon-content/nodes/opschrift.node.js +9 -1
  34. package/dist/collection/components/ozon-content/nodes/opschrift.node.js.map +1 -1
  35. package/dist/collection/components/ozon-content/nodes/table.node/table.node.js +1 -2
  36. package/dist/collection/components/ozon-content/nodes/table.node/table.node.js.map +1 -1
  37. package/dist/collection/components/ozon-content/nodes/verwijderde-tekst.node.js +1 -1
  38. package/dist/collection/components/ozon-content/nodes/verwijderde-tekst.node.js.map +1 -1
  39. package/dist/collection/components/ozon-content/ozon-content-context.interface.js.map +1 -1
  40. package/dist/collection/components/ozon-content/ozon-content-mapper.js +11 -9
  41. package/dist/collection/components/ozon-content/ozon-content-mapper.js.map +1 -1
  42. package/dist/collection/components/ozon-content/ozon-content-node-context.interface.js.map +1 -1
  43. package/dist/collection/components/ozon-content/ozon-content.css +1100 -35
  44. package/dist/collection/components/ozon-content/ozon-content.interfaces.js.map +1 -1
  45. package/dist/collection/components/ozon-content/ozon-content.js +17 -83
  46. package/dist/collection/components/ozon-content/ozon-content.js.map +1 -1
  47. package/dist/collection/components/table/table.css +669 -97
  48. package/dist/collection/components/tooltip/tooltip.css +0 -8
  49. package/dist/components/document-component.js +6 -2
  50. package/dist/components/document-component.js.map +1 -1
  51. package/dist/components/dso-modal.js +1 -1
  52. package/dist/components/dso-modal.js.map +1 -1
  53. package/dist/components/dso-table.js +1 -1
  54. package/dist/components/dso-table.js.map +1 -1
  55. package/dist/components/dsot-document-component-demo.js +1694 -45
  56. package/dist/components/dsot-document-component-demo.js.map +1 -1
  57. package/dist/components/index.d.ts +1 -1
  58. package/dist/components/ozon-content.js +500 -50
  59. package/dist/components/ozon-content.js.map +1 -1
  60. package/dist/components/tooltip.js +1 -1
  61. package/dist/components/tooltip.js.map +1 -1
  62. package/dist/dso-toolkit/dso-toolkit.esm.js +1 -1
  63. package/dist/dso-toolkit/dso-toolkit.esm.js.map +1 -1
  64. package/dist/dso-toolkit/p-2401e7f9.entry.js +2 -0
  65. package/dist/dso-toolkit/p-2401e7f9.entry.js.map +1 -0
  66. package/dist/dso-toolkit/p-2ab99812.entry.js +2 -0
  67. package/dist/dso-toolkit/{p-a63c82a4.entry.js.map → p-2ab99812.entry.js.map} +1 -1
  68. package/dist/dso-toolkit/p-432df09a.entry.js +2 -0
  69. package/dist/dso-toolkit/p-432df09a.entry.js.map +1 -0
  70. package/dist/dso-toolkit/p-4573c419.js +2 -0
  71. package/dist/dso-toolkit/p-4573c419.js.map +1 -0
  72. package/dist/dso-toolkit/p-47e77e24.entry.js +2 -0
  73. package/dist/dso-toolkit/p-47e77e24.entry.js.map +1 -0
  74. package/dist/dso-toolkit/p-ab1f0511.entry.js +2 -0
  75. package/dist/dso-toolkit/p-ab1f0511.entry.js.map +1 -0
  76. package/dist/dso-toolkit/p-ad44136d.entry.js +2 -0
  77. package/dist/dso-toolkit/p-ad44136d.entry.js.map +1 -0
  78. package/dist/esm/_commonjsHelpers-1c8beb5f.js +5 -0
  79. package/dist/esm/_commonjsHelpers-1c8beb5f.js.map +1 -0
  80. package/dist/esm/dso-alert_5.entry.js +498 -47
  81. package/dist/esm/dso-alert_5.entry.js.map +1 -1
  82. package/dist/esm/dso-annotation-output_3.entry.js +6 -2
  83. package/dist/esm/dso-annotation-output_3.entry.js.map +1 -1
  84. package/dist/esm/dso-modal.entry.js +1 -1
  85. package/dist/esm/dso-modal.entry.js.map +1 -1
  86. package/dist/esm/dso-table.entry.js +1 -1
  87. package/dist/esm/dso-table.entry.js.map +1 -1
  88. package/dist/esm/dso-toolkit.js +1 -1
  89. package/dist/esm/dso-tooltip.entry.js +1 -1
  90. package/dist/esm/dso-tooltip.entry.js.map +1 -1
  91. package/dist/esm/dsot-document-component-demo.entry.js +1689 -42
  92. package/dist/esm/dsot-document-component-demo.entry.js.map +1 -1
  93. package/dist/esm/loader.js +1 -1
  94. package/dist/types/components/document-component/document-component.d.ts +6 -1
  95. package/dist/types/components/document-component/document-component.models.d.ts +14 -0
  96. package/dist/types/components/document-component-demo/document-component.demo.d.ts +64 -0
  97. package/dist/types/components/ozon-content/nodes/al.node.d.ts +1 -1
  98. package/dist/types/components/ozon-content/ozon-content-context.interface.d.ts +3 -2
  99. package/dist/types/components/ozon-content/ozon-content-mapper.d.ts +0 -1
  100. package/dist/types/components/ozon-content/ozon-content-node-context.interface.d.ts +3 -2
  101. package/dist/types/components/ozon-content/ozon-content.d.ts +4 -25
  102. package/dist/types/components/ozon-content/ozon-content.interfaces.d.ts +1 -4
  103. package/dist/types/components.d.ts +41 -25
  104. package/package.json +8 -2
  105. package/dist/collection/components/document-component/document-component.demo.js +0 -112
  106. package/dist/collection/components/document-component/document-component.demo.js.map +0 -1
  107. package/dist/collection/components/document-component/document-component.types.js +0 -2
  108. package/dist/collection/components/document-component/document-component.types.js.map +0 -1
  109. package/dist/dso-toolkit/p-42ba2c81.entry.js +0 -2
  110. package/dist/dso-toolkit/p-42ba2c81.entry.js.map +0 -1
  111. package/dist/dso-toolkit/p-48d76094.entry.js +0 -2
  112. package/dist/dso-toolkit/p-48d76094.entry.js.map +0 -1
  113. package/dist/dso-toolkit/p-5c5e43d3.entry.js +0 -2
  114. package/dist/dso-toolkit/p-5c5e43d3.entry.js.map +0 -1
  115. package/dist/dso-toolkit/p-8af61320.entry.js +0 -2
  116. package/dist/dso-toolkit/p-8af61320.entry.js.map +0 -1
  117. package/dist/dso-toolkit/p-9a3f154b.entry.js +0 -2
  118. package/dist/dso-toolkit/p-9a3f154b.entry.js.map +0 -1
  119. package/dist/dso-toolkit/p-a63c82a4.entry.js +0 -2
  120. package/dist/types/components/document-component/document-component.demo.d.ts +0 -40
  121. package/dist/types/components/document-component/document-component.types.d.ts +0 -8
@@ -3,65 +3,1703 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d46ec033.js');
6
+ const _commonjsHelpers = require('./_commonjsHelpers-68cdf74f.js');
7
+
8
+ /**
9
+ * lodash (Custom Build) <https://lodash.com/>
10
+ * Build: `lodash modularize exports="npm" -o ./`
11
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
12
+ * Released under MIT license <https://lodash.com/license>
13
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
14
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
15
+ */
16
+
17
+ /** Used as references for various `Number` constants. */
18
+ var INFINITY$1 = 1 / 0,
19
+ MAX_SAFE_INTEGER$1 = 9007199254740991,
20
+ MAX_INTEGER$1 = 1.7976931348623157e+308,
21
+ NAN$1 = 0 / 0;
22
+
23
+ /** `Object#toString` result references. */
24
+ var argsTag = '[object Arguments]',
25
+ funcTag$1 = '[object Function]',
26
+ genTag$1 = '[object GeneratorFunction]',
27
+ mapTag = '[object Map]',
28
+ objectTag = '[object Object]',
29
+ promiseTag = '[object Promise]',
30
+ setTag = '[object Set]',
31
+ stringTag = '[object String]',
32
+ symbolTag$1 = '[object Symbol]',
33
+ weakMapTag = '[object WeakMap]';
34
+
35
+ var dataViewTag = '[object DataView]';
36
+
37
+ /**
38
+ * Used to match `RegExp`
39
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
40
+ */
41
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
42
+
43
+ /** Used to match leading and trailing whitespace. */
44
+ var reTrim$1 = /^\s+|\s+$/g;
45
+
46
+ /** Used to detect bad signed hexadecimal string values. */
47
+ var reIsBadHex$1 = /^[-+]0x[0-9a-f]+$/i;
48
+
49
+ /** Used to detect binary string values. */
50
+ var reIsBinary$1 = /^0b[01]+$/i;
51
+
52
+ /** Used to detect host constructors (Safari). */
53
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
54
+
55
+ /** Used to detect octal string values. */
56
+ var reIsOctal$1 = /^0o[0-7]+$/i;
57
+
58
+ /** Used to detect unsigned integer values. */
59
+ var reIsUint$1 = /^(?:0|[1-9]\d*)$/;
60
+
61
+ /** Used to compose unicode character classes. */
62
+ var rsAstralRange = '\\ud800-\\udfff',
63
+ rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
64
+ rsComboSymbolsRange = '\\u20d0-\\u20f0',
65
+ rsVarRange = '\\ufe0e\\ufe0f';
66
+
67
+ /** Used to compose unicode capture groups. */
68
+ var rsAstral = '[' + rsAstralRange + ']',
69
+ rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',
70
+ rsFitz = '\\ud83c[\\udffb-\\udfff]',
71
+ rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
72
+ rsNonAstral = '[^' + rsAstralRange + ']',
73
+ rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
74
+ rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
75
+ rsZWJ = '\\u200d';
76
+
77
+ /** Used to compose unicode regexes. */
78
+ var reOptMod = rsModifier + '?',
79
+ rsOptVar = '[' + rsVarRange + ']?',
80
+ rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
81
+ rsSeq = rsOptVar + reOptMod + rsOptJoin,
82
+ rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
83
+
84
+ /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
85
+ var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
86
+
87
+ /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
88
+ var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
89
+
90
+ /** Built-in method references without a dependency on `root`. */
91
+ var freeParseInt$1 = parseInt;
92
+
93
+ /** Detect free variable `global` from Node.js. */
94
+ var freeGlobal = typeof _commonjsHelpers.commonjsGlobal == 'object' && _commonjsHelpers.commonjsGlobal && _commonjsHelpers.commonjsGlobal.Object === Object && _commonjsHelpers.commonjsGlobal;
95
+
96
+ /** Detect free variable `self`. */
97
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
98
+
99
+ /** Used as a reference to the global object. */
100
+ var root = freeGlobal || freeSelf || Function('return this')();
101
+
102
+ /**
103
+ * A specialized version of `_.map` for arrays without support for iteratee
104
+ * shorthands.
105
+ *
106
+ * @private
107
+ * @param {Array} [array] The array to iterate over.
108
+ * @param {Function} iteratee The function invoked per iteration.
109
+ * @returns {Array} Returns the new mapped array.
110
+ */
111
+ function arrayMap(array, iteratee) {
112
+ var index = -1,
113
+ length = array ? array.length : 0,
114
+ result = Array(length);
115
+
116
+ while (++index < length) {
117
+ result[index] = iteratee(array[index], index, array);
118
+ }
119
+ return result;
120
+ }
121
+
122
+ /**
123
+ * Converts an ASCII `string` to an array.
124
+ *
125
+ * @private
126
+ * @param {string} string The string to convert.
127
+ * @returns {Array} Returns the converted array.
128
+ */
129
+ function asciiToArray(string) {
130
+ return string.split('');
131
+ }
132
+
133
+ /**
134
+ * The base implementation of `_.times` without support for iteratee shorthands
135
+ * or max array length checks.
136
+ *
137
+ * @private
138
+ * @param {number} n The number of times to invoke `iteratee`.
139
+ * @param {Function} iteratee The function invoked per iteration.
140
+ * @returns {Array} Returns the array of results.
141
+ */
142
+ function baseTimes(n, iteratee) {
143
+ var index = -1,
144
+ result = Array(n);
145
+
146
+ while (++index < n) {
147
+ result[index] = iteratee(index);
148
+ }
149
+ return result;
150
+ }
151
+
152
+ /**
153
+ * The base implementation of `_.values` and `_.valuesIn` which creates an
154
+ * array of `object` property values corresponding to the property names
155
+ * of `props`.
156
+ *
157
+ * @private
158
+ * @param {Object} object The object to query.
159
+ * @param {Array} props The property names to get values for.
160
+ * @returns {Object} Returns the array of property values.
161
+ */
162
+ function baseValues(object, props) {
163
+ return arrayMap(props, function(key) {
164
+ return object[key];
165
+ });
166
+ }
167
+
168
+ /**
169
+ * Gets the value at `key` of `object`.
170
+ *
171
+ * @private
172
+ * @param {Object} [object] The object to query.
173
+ * @param {string} key The key of the property to get.
174
+ * @returns {*} Returns the property value.
175
+ */
176
+ function getValue(object, key) {
177
+ return object == null ? undefined : object[key];
178
+ }
179
+
180
+ /**
181
+ * Checks if `string` contains Unicode symbols.
182
+ *
183
+ * @private
184
+ * @param {string} string The string to inspect.
185
+ * @returns {boolean} Returns `true` if a symbol is found, else `false`.
186
+ */
187
+ function hasUnicode(string) {
188
+ return reHasUnicode.test(string);
189
+ }
190
+
191
+ /**
192
+ * Checks if `value` is a host object in IE < 9.
193
+ *
194
+ * @private
195
+ * @param {*} value The value to check.
196
+ * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
197
+ */
198
+ function isHostObject(value) {
199
+ // Many host objects are `Object` objects that can coerce to strings
200
+ // despite having improperly defined `toString` methods.
201
+ var result = false;
202
+ if (value != null && typeof value.toString != 'function') {
203
+ try {
204
+ result = !!(value + '');
205
+ } catch (e) {}
206
+ }
207
+ return result;
208
+ }
209
+
210
+ /**
211
+ * Converts `iterator` to an array.
212
+ *
213
+ * @private
214
+ * @param {Object} iterator The iterator to convert.
215
+ * @returns {Array} Returns the converted array.
216
+ */
217
+ function iteratorToArray(iterator) {
218
+ var data,
219
+ result = [];
220
+
221
+ while (!(data = iterator.next()).done) {
222
+ result.push(data.value);
223
+ }
224
+ return result;
225
+ }
226
+
227
+ /**
228
+ * Converts `map` to its key-value pairs.
229
+ *
230
+ * @private
231
+ * @param {Object} map The map to convert.
232
+ * @returns {Array} Returns the key-value pairs.
233
+ */
234
+ function mapToArray(map) {
235
+ var index = -1,
236
+ result = Array(map.size);
237
+
238
+ map.forEach(function(value, key) {
239
+ result[++index] = [key, value];
240
+ });
241
+ return result;
242
+ }
243
+
244
+ /**
245
+ * Creates a unary function that invokes `func` with its argument transformed.
246
+ *
247
+ * @private
248
+ * @param {Function} func The function to wrap.
249
+ * @param {Function} transform The argument transform.
250
+ * @returns {Function} Returns the new function.
251
+ */
252
+ function overArg(func, transform) {
253
+ return function(arg) {
254
+ return func(transform(arg));
255
+ };
256
+ }
257
+
258
+ /**
259
+ * Converts `set` to an array of its values.
260
+ *
261
+ * @private
262
+ * @param {Object} set The set to convert.
263
+ * @returns {Array} Returns the values.
264
+ */
265
+ function setToArray(set) {
266
+ var index = -1,
267
+ result = Array(set.size);
268
+
269
+ set.forEach(function(value) {
270
+ result[++index] = value;
271
+ });
272
+ return result;
273
+ }
274
+
275
+ /**
276
+ * Converts `string` to an array.
277
+ *
278
+ * @private
279
+ * @param {string} string The string to convert.
280
+ * @returns {Array} Returns the converted array.
281
+ */
282
+ function stringToArray(string) {
283
+ return hasUnicode(string)
284
+ ? unicodeToArray(string)
285
+ : asciiToArray(string);
286
+ }
287
+
288
+ /**
289
+ * Converts a Unicode `string` to an array.
290
+ *
291
+ * @private
292
+ * @param {string} string The string to convert.
293
+ * @returns {Array} Returns the converted array.
294
+ */
295
+ function unicodeToArray(string) {
296
+ return string.match(reUnicode) || [];
297
+ }
298
+
299
+ /** Used for built-in method references. */
300
+ var funcProto = Function.prototype,
301
+ objectProto$1 = Object.prototype;
302
+
303
+ /** Used to detect overreaching core-js shims. */
304
+ var coreJsData = root['__core-js_shared__'];
305
+
306
+ /** Used to detect methods masquerading as native. */
307
+ var maskSrcKey = (function() {
308
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
309
+ return uid ? ('Symbol(src)_1.' + uid) : '';
310
+ }());
311
+
312
+ /** Used to resolve the decompiled source of functions. */
313
+ var funcToString = funcProto.toString;
314
+
315
+ /** Used to check objects for own properties. */
316
+ var hasOwnProperty = objectProto$1.hasOwnProperty;
317
+
318
+ /**
319
+ * Used to resolve the
320
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
321
+ * of values.
322
+ */
323
+ var objectToString$1 = objectProto$1.toString;
324
+
325
+ /** Used to detect if a method is native. */
326
+ var reIsNative = RegExp('^' +
327
+ funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
328
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
329
+ );
330
+
331
+ /** Built-in value references. */
332
+ var Symbol = root.Symbol,
333
+ iteratorSymbol = Symbol ? Symbol.iterator : undefined,
334
+ propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
335
+
336
+ /* Built-in method references for those with the same name as other `lodash` methods. */
337
+ var nativeFloor$1 = Math.floor,
338
+ nativeKeys = overArg(Object.keys, Object),
339
+ nativeRandom$1 = Math.random;
340
+
341
+ /* Built-in method references that are verified to be native. */
342
+ var DataView = getNative(root, 'DataView'),
343
+ Map = getNative(root, 'Map'),
344
+ Promise$1 = getNative(root, 'Promise'),
345
+ Set = getNative(root, 'Set'),
346
+ WeakMap = getNative(root, 'WeakMap');
347
+
348
+ /** Used to detect maps, sets, and weakmaps. */
349
+ var dataViewCtorString = toSource(DataView),
350
+ mapCtorString = toSource(Map),
351
+ promiseCtorString = toSource(Promise$1),
352
+ setCtorString = toSource(Set),
353
+ weakMapCtorString = toSource(WeakMap);
354
+
355
+ /**
356
+ * Creates an array of the enumerable property names of the array-like `value`.
357
+ *
358
+ * @private
359
+ * @param {*} value The value to query.
360
+ * @param {boolean} inherited Specify returning inherited property names.
361
+ * @returns {Array} Returns the array of property names.
362
+ */
363
+ function arrayLikeKeys(value, inherited) {
364
+ // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
365
+ // Safari 9 makes `arguments.length` enumerable in strict mode.
366
+ var result = (isArray(value) || isArguments(value))
367
+ ? baseTimes(value.length, String)
368
+ : [];
369
+
370
+ var length = result.length,
371
+ skipIndexes = !!length;
372
+
373
+ for (var key in value) {
374
+ if ((inherited || hasOwnProperty.call(value, key)) &&
375
+ !(skipIndexes && (key == 'length' || isIndex$1(key, length)))) {
376
+ result.push(key);
377
+ }
378
+ }
379
+ return result;
380
+ }
381
+
382
+ /**
383
+ * The base implementation of `_.clamp` which doesn't coerce arguments.
384
+ *
385
+ * @private
386
+ * @param {number} number The number to clamp.
387
+ * @param {number} [lower] The lower bound.
388
+ * @param {number} upper The upper bound.
389
+ * @returns {number} Returns the clamped number.
390
+ */
391
+ function baseClamp(number, lower, upper) {
392
+ if (number === number) {
393
+ if (upper !== undefined) {
394
+ number = number <= upper ? number : upper;
395
+ }
396
+ if (lower !== undefined) {
397
+ number = number >= lower ? number : lower;
398
+ }
399
+ }
400
+ return number;
401
+ }
402
+
403
+ /**
404
+ * The base implementation of `getTag`.
405
+ *
406
+ * @private
407
+ * @param {*} value The value to query.
408
+ * @returns {string} Returns the `toStringTag`.
409
+ */
410
+ function baseGetTag(value) {
411
+ return objectToString$1.call(value);
412
+ }
413
+
414
+ /**
415
+ * The base implementation of `_.isNative` without bad shim checks.
416
+ *
417
+ * @private
418
+ * @param {*} value The value to check.
419
+ * @returns {boolean} Returns `true` if `value` is a native function,
420
+ * else `false`.
421
+ */
422
+ function baseIsNative(value) {
423
+ if (!isObject$1(value) || isMasked(value)) {
424
+ return false;
425
+ }
426
+ var pattern = (isFunction$1(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
427
+ return pattern.test(toSource(value));
428
+ }
429
+
430
+ /**
431
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
432
+ *
433
+ * @private
434
+ * @param {Object} object The object to query.
435
+ * @returns {Array} Returns the array of property names.
436
+ */
437
+ function baseKeys(object) {
438
+ if (!isPrototype(object)) {
439
+ return nativeKeys(object);
440
+ }
441
+ var result = [];
442
+ for (var key in Object(object)) {
443
+ if (hasOwnProperty.call(object, key) && key != 'constructor') {
444
+ result.push(key);
445
+ }
446
+ }
447
+ return result;
448
+ }
449
+
450
+ /**
451
+ * The base implementation of `_.random` without support for returning
452
+ * floating-point numbers.
453
+ *
454
+ * @private
455
+ * @param {number} lower The lower bound.
456
+ * @param {number} upper The upper bound.
457
+ * @returns {number} Returns the random number.
458
+ */
459
+ function baseRandom$1(lower, upper) {
460
+ return lower + nativeFloor$1(nativeRandom$1() * (upper - lower + 1));
461
+ }
462
+
463
+ /**
464
+ * Copies the values of `source` to `array`.
465
+ *
466
+ * @private
467
+ * @param {Array} source The array to copy values from.
468
+ * @param {Array} [array=[]] The array to copy values to.
469
+ * @returns {Array} Returns `array`.
470
+ */
471
+ function copyArray(source, array) {
472
+ var index = -1,
473
+ length = source.length;
474
+
475
+ array || (array = Array(length));
476
+ while (++index < length) {
477
+ array[index] = source[index];
478
+ }
479
+ return array;
480
+ }
481
+
482
+ /**
483
+ * Gets the native function at `key` of `object`.
484
+ *
485
+ * @private
486
+ * @param {Object} object The object to query.
487
+ * @param {string} key The key of the method to get.
488
+ * @returns {*} Returns the function if it's native, else `undefined`.
489
+ */
490
+ function getNative(object, key) {
491
+ var value = getValue(object, key);
492
+ return baseIsNative(value) ? value : undefined;
493
+ }
494
+
495
+ /**
496
+ * Gets the `toStringTag` of `value`.
497
+ *
498
+ * @private
499
+ * @param {*} value The value to query.
500
+ * @returns {string} Returns the `toStringTag`.
501
+ */
502
+ var getTag = baseGetTag;
503
+
504
+ // Fallback for data views, maps, sets, and weak maps in IE 11,
505
+ // for data views in Edge < 14, and promises in Node.js.
506
+ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
507
+ (Map && getTag(new Map) != mapTag) ||
508
+ (Promise$1 && getTag(Promise$1.resolve()) != promiseTag) ||
509
+ (Set && getTag(new Set) != setTag) ||
510
+ (WeakMap && getTag(new WeakMap) != weakMapTag)) {
511
+ getTag = function(value) {
512
+ var result = objectToString$1.call(value),
513
+ Ctor = result == objectTag ? value.constructor : undefined,
514
+ ctorString = Ctor ? toSource(Ctor) : undefined;
515
+
516
+ if (ctorString) {
517
+ switch (ctorString) {
518
+ case dataViewCtorString: return dataViewTag;
519
+ case mapCtorString: return mapTag;
520
+ case promiseCtorString: return promiseTag;
521
+ case setCtorString: return setTag;
522
+ case weakMapCtorString: return weakMapTag;
523
+ }
524
+ }
525
+ return result;
526
+ };
527
+ }
528
+
529
+ /**
530
+ * Checks if `value` is a valid array-like index.
531
+ *
532
+ * @private
533
+ * @param {*} value The value to check.
534
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
535
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
536
+ */
537
+ function isIndex$1(value, length) {
538
+ length = length == null ? MAX_SAFE_INTEGER$1 : length;
539
+ return !!length &&
540
+ (typeof value == 'number' || reIsUint$1.test(value)) &&
541
+ (value > -1 && value % 1 == 0 && value < length);
542
+ }
543
+
544
+ /**
545
+ * Checks if the given arguments are from an iteratee call.
546
+ *
547
+ * @private
548
+ * @param {*} value The potential iteratee value argument.
549
+ * @param {*} index The potential iteratee index or key argument.
550
+ * @param {*} object The potential iteratee object argument.
551
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
552
+ * else `false`.
553
+ */
554
+ function isIterateeCall$1(value, index, object) {
555
+ if (!isObject$1(object)) {
556
+ return false;
557
+ }
558
+ var type = typeof index;
559
+ if (type == 'number'
560
+ ? (isArrayLike$1(object) && isIndex$1(index, object.length))
561
+ : (type == 'string' && index in object)
562
+ ) {
563
+ return eq$1(object[index], value);
564
+ }
565
+ return false;
566
+ }
567
+
568
+ /**
569
+ * Checks if `func` has its source masked.
570
+ *
571
+ * @private
572
+ * @param {Function} func The function to check.
573
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
574
+ */
575
+ function isMasked(func) {
576
+ return !!maskSrcKey && (maskSrcKey in func);
577
+ }
578
+
579
+ /**
580
+ * Checks if `value` is likely a prototype object.
581
+ *
582
+ * @private
583
+ * @param {*} value The value to check.
584
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
585
+ */
586
+ function isPrototype(value) {
587
+ var Ctor = value && value.constructor,
588
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$1;
589
+
590
+ return value === proto;
591
+ }
592
+
593
+ /**
594
+ * Converts `func` to its source code.
595
+ *
596
+ * @private
597
+ * @param {Function} func The function to process.
598
+ * @returns {string} Returns the source code.
599
+ */
600
+ function toSource(func) {
601
+ if (func != null) {
602
+ try {
603
+ return funcToString.call(func);
604
+ } catch (e) {}
605
+ try {
606
+ return (func + '');
607
+ } catch (e) {}
608
+ }
609
+ return '';
610
+ }
611
+
612
+ /**
613
+ * Gets `n` random elements at unique keys from `collection` up to the
614
+ * size of `collection`.
615
+ *
616
+ * @static
617
+ * @memberOf _
618
+ * @since 4.0.0
619
+ * @category Collection
620
+ * @param {Array|Object} collection The collection to sample.
621
+ * @param {number} [n=1] The number of elements to sample.
622
+ * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
623
+ * @returns {Array} Returns the random elements.
624
+ * @example
625
+ *
626
+ * _.sampleSize([1, 2, 3], 2);
627
+ * // => [3, 1]
628
+ *
629
+ * _.sampleSize([1, 2, 3], 4);
630
+ * // => [2, 3, 1]
631
+ */
632
+ function sampleSize(collection, n, guard) {
633
+ var index = -1,
634
+ result = toArray(collection),
635
+ length = result.length,
636
+ lastIndex = length - 1;
637
+
638
+ if ((guard ? isIterateeCall$1(collection, n, guard) : n === undefined)) {
639
+ n = 1;
640
+ } else {
641
+ n = baseClamp(toInteger(n), 0, length);
642
+ }
643
+ while (++index < n) {
644
+ var rand = baseRandom$1(index, lastIndex),
645
+ value = result[rand];
646
+
647
+ result[rand] = result[index];
648
+ result[index] = value;
649
+ }
650
+ result.length = n;
651
+ return result;
652
+ }
653
+
654
+ /**
655
+ * Performs a
656
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
657
+ * comparison between two values to determine if they are equivalent.
658
+ *
659
+ * @static
660
+ * @memberOf _
661
+ * @since 4.0.0
662
+ * @category Lang
663
+ * @param {*} value The value to compare.
664
+ * @param {*} other The other value to compare.
665
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
666
+ * @example
667
+ *
668
+ * var object = { 'a': 1 };
669
+ * var other = { 'a': 1 };
670
+ *
671
+ * _.eq(object, object);
672
+ * // => true
673
+ *
674
+ * _.eq(object, other);
675
+ * // => false
676
+ *
677
+ * _.eq('a', 'a');
678
+ * // => true
679
+ *
680
+ * _.eq('a', Object('a'));
681
+ * // => false
682
+ *
683
+ * _.eq(NaN, NaN);
684
+ * // => true
685
+ */
686
+ function eq$1(value, other) {
687
+ return value === other || (value !== value && other !== other);
688
+ }
689
+
690
+ /**
691
+ * Checks if `value` is likely an `arguments` object.
692
+ *
693
+ * @static
694
+ * @memberOf _
695
+ * @since 0.1.0
696
+ * @category Lang
697
+ * @param {*} value The value to check.
698
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
699
+ * else `false`.
700
+ * @example
701
+ *
702
+ * _.isArguments(function() { return arguments; }());
703
+ * // => true
704
+ *
705
+ * _.isArguments([1, 2, 3]);
706
+ * // => false
707
+ */
708
+ function isArguments(value) {
709
+ // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
710
+ return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
711
+ (!propertyIsEnumerable.call(value, 'callee') || objectToString$1.call(value) == argsTag);
712
+ }
713
+
714
+ /**
715
+ * Checks if `value` is classified as an `Array` object.
716
+ *
717
+ * @static
718
+ * @memberOf _
719
+ * @since 0.1.0
720
+ * @category Lang
721
+ * @param {*} value The value to check.
722
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
723
+ * @example
724
+ *
725
+ * _.isArray([1, 2, 3]);
726
+ * // => true
727
+ *
728
+ * _.isArray(document.body.children);
729
+ * // => false
730
+ *
731
+ * _.isArray('abc');
732
+ * // => false
733
+ *
734
+ * _.isArray(_.noop);
735
+ * // => false
736
+ */
737
+ var isArray = Array.isArray;
738
+
739
+ /**
740
+ * Checks if `value` is array-like. A value is considered array-like if it's
741
+ * not a function and has a `value.length` that's an integer greater than or
742
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
743
+ *
744
+ * @static
745
+ * @memberOf _
746
+ * @since 4.0.0
747
+ * @category Lang
748
+ * @param {*} value The value to check.
749
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
750
+ * @example
751
+ *
752
+ * _.isArrayLike([1, 2, 3]);
753
+ * // => true
754
+ *
755
+ * _.isArrayLike(document.body.children);
756
+ * // => true
757
+ *
758
+ * _.isArrayLike('abc');
759
+ * // => true
760
+ *
761
+ * _.isArrayLike(_.noop);
762
+ * // => false
763
+ */
764
+ function isArrayLike$1(value) {
765
+ return value != null && isLength$1(value.length) && !isFunction$1(value);
766
+ }
767
+
768
+ /**
769
+ * This method is like `_.isArrayLike` except that it also checks if `value`
770
+ * is an object.
771
+ *
772
+ * @static
773
+ * @memberOf _
774
+ * @since 4.0.0
775
+ * @category Lang
776
+ * @param {*} value The value to check.
777
+ * @returns {boolean} Returns `true` if `value` is an array-like object,
778
+ * else `false`.
779
+ * @example
780
+ *
781
+ * _.isArrayLikeObject([1, 2, 3]);
782
+ * // => true
783
+ *
784
+ * _.isArrayLikeObject(document.body.children);
785
+ * // => true
786
+ *
787
+ * _.isArrayLikeObject('abc');
788
+ * // => false
789
+ *
790
+ * _.isArrayLikeObject(_.noop);
791
+ * // => false
792
+ */
793
+ function isArrayLikeObject(value) {
794
+ return isObjectLike$1(value) && isArrayLike$1(value);
795
+ }
796
+
797
+ /**
798
+ * Checks if `value` is classified as a `Function` object.
799
+ *
800
+ * @static
801
+ * @memberOf _
802
+ * @since 0.1.0
803
+ * @category Lang
804
+ * @param {*} value The value to check.
805
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
806
+ * @example
807
+ *
808
+ * _.isFunction(_);
809
+ * // => true
810
+ *
811
+ * _.isFunction(/abc/);
812
+ * // => false
813
+ */
814
+ function isFunction$1(value) {
815
+ // The use of `Object#toString` avoids issues with the `typeof` operator
816
+ // in Safari 8-9 which returns 'object' for typed array and other constructors.
817
+ var tag = isObject$1(value) ? objectToString$1.call(value) : '';
818
+ return tag == funcTag$1 || tag == genTag$1;
819
+ }
820
+
821
+ /**
822
+ * Checks if `value` is a valid array-like length.
823
+ *
824
+ * **Note:** This method is loosely based on
825
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
826
+ *
827
+ * @static
828
+ * @memberOf _
829
+ * @since 4.0.0
830
+ * @category Lang
831
+ * @param {*} value The value to check.
832
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
833
+ * @example
834
+ *
835
+ * _.isLength(3);
836
+ * // => true
837
+ *
838
+ * _.isLength(Number.MIN_VALUE);
839
+ * // => false
840
+ *
841
+ * _.isLength(Infinity);
842
+ * // => false
843
+ *
844
+ * _.isLength('3');
845
+ * // => false
846
+ */
847
+ function isLength$1(value) {
848
+ return typeof value == 'number' &&
849
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
850
+ }
851
+
852
+ /**
853
+ * Checks if `value` is the
854
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
855
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
856
+ *
857
+ * @static
858
+ * @memberOf _
859
+ * @since 0.1.0
860
+ * @category Lang
861
+ * @param {*} value The value to check.
862
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
863
+ * @example
864
+ *
865
+ * _.isObject({});
866
+ * // => true
867
+ *
868
+ * _.isObject([1, 2, 3]);
869
+ * // => true
870
+ *
871
+ * _.isObject(_.noop);
872
+ * // => true
873
+ *
874
+ * _.isObject(null);
875
+ * // => false
876
+ */
877
+ function isObject$1(value) {
878
+ var type = typeof value;
879
+ return !!value && (type == 'object' || type == 'function');
880
+ }
881
+
882
+ /**
883
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
884
+ * and has a `typeof` result of "object".
885
+ *
886
+ * @static
887
+ * @memberOf _
888
+ * @since 4.0.0
889
+ * @category Lang
890
+ * @param {*} value The value to check.
891
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
892
+ * @example
893
+ *
894
+ * _.isObjectLike({});
895
+ * // => true
896
+ *
897
+ * _.isObjectLike([1, 2, 3]);
898
+ * // => true
899
+ *
900
+ * _.isObjectLike(_.noop);
901
+ * // => false
902
+ *
903
+ * _.isObjectLike(null);
904
+ * // => false
905
+ */
906
+ function isObjectLike$1(value) {
907
+ return !!value && typeof value == 'object';
908
+ }
909
+
910
+ /**
911
+ * Checks if `value` is classified as a `String` primitive or object.
912
+ *
913
+ * @static
914
+ * @since 0.1.0
915
+ * @memberOf _
916
+ * @category Lang
917
+ * @param {*} value The value to check.
918
+ * @returns {boolean} Returns `true` if `value` is a string, else `false`.
919
+ * @example
920
+ *
921
+ * _.isString('abc');
922
+ * // => true
923
+ *
924
+ * _.isString(1);
925
+ * // => false
926
+ */
927
+ function isString(value) {
928
+ return typeof value == 'string' ||
929
+ (!isArray(value) && isObjectLike$1(value) && objectToString$1.call(value) == stringTag);
930
+ }
931
+
932
+ /**
933
+ * Checks if `value` is classified as a `Symbol` primitive or object.
934
+ *
935
+ * @static
936
+ * @memberOf _
937
+ * @since 4.0.0
938
+ * @category Lang
939
+ * @param {*} value The value to check.
940
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
941
+ * @example
942
+ *
943
+ * _.isSymbol(Symbol.iterator);
944
+ * // => true
945
+ *
946
+ * _.isSymbol('abc');
947
+ * // => false
948
+ */
949
+ function isSymbol$1(value) {
950
+ return typeof value == 'symbol' ||
951
+ (isObjectLike$1(value) && objectToString$1.call(value) == symbolTag$1);
952
+ }
953
+
954
+ /**
955
+ * Converts `value` to an array.
956
+ *
957
+ * @static
958
+ * @since 0.1.0
959
+ * @memberOf _
960
+ * @category Lang
961
+ * @param {*} value The value to convert.
962
+ * @returns {Array} Returns the converted array.
963
+ * @example
964
+ *
965
+ * _.toArray({ 'a': 1, 'b': 2 });
966
+ * // => [1, 2]
967
+ *
968
+ * _.toArray('abc');
969
+ * // => ['a', 'b', 'c']
970
+ *
971
+ * _.toArray(1);
972
+ * // => []
973
+ *
974
+ * _.toArray(null);
975
+ * // => []
976
+ */
977
+ function toArray(value) {
978
+ if (!value) {
979
+ return [];
980
+ }
981
+ if (isArrayLike$1(value)) {
982
+ return isString(value) ? stringToArray(value) : copyArray(value);
983
+ }
984
+ if (iteratorSymbol && value[iteratorSymbol]) {
985
+ return iteratorToArray(value[iteratorSymbol]());
986
+ }
987
+ var tag = getTag(value),
988
+ func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
989
+
990
+ return func(value);
991
+ }
992
+
993
+ /**
994
+ * Converts `value` to a finite number.
995
+ *
996
+ * @static
997
+ * @memberOf _
998
+ * @since 4.12.0
999
+ * @category Lang
1000
+ * @param {*} value The value to convert.
1001
+ * @returns {number} Returns the converted number.
1002
+ * @example
1003
+ *
1004
+ * _.toFinite(3.2);
1005
+ * // => 3.2
1006
+ *
1007
+ * _.toFinite(Number.MIN_VALUE);
1008
+ * // => 5e-324
1009
+ *
1010
+ * _.toFinite(Infinity);
1011
+ * // => 1.7976931348623157e+308
1012
+ *
1013
+ * _.toFinite('3.2');
1014
+ * // => 3.2
1015
+ */
1016
+ function toFinite$1(value) {
1017
+ if (!value) {
1018
+ return value === 0 ? value : 0;
1019
+ }
1020
+ value = toNumber$1(value);
1021
+ if (value === INFINITY$1 || value === -INFINITY$1) {
1022
+ var sign = (value < 0 ? -1 : 1);
1023
+ return sign * MAX_INTEGER$1;
1024
+ }
1025
+ return value === value ? value : 0;
1026
+ }
1027
+
1028
+ /**
1029
+ * Converts `value` to an integer.
1030
+ *
1031
+ * **Note:** This method is loosely based on
1032
+ * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
1033
+ *
1034
+ * @static
1035
+ * @memberOf _
1036
+ * @since 4.0.0
1037
+ * @category Lang
1038
+ * @param {*} value The value to convert.
1039
+ * @returns {number} Returns the converted integer.
1040
+ * @example
1041
+ *
1042
+ * _.toInteger(3.2);
1043
+ * // => 3
1044
+ *
1045
+ * _.toInteger(Number.MIN_VALUE);
1046
+ * // => 0
1047
+ *
1048
+ * _.toInteger(Infinity);
1049
+ * // => 1.7976931348623157e+308
1050
+ *
1051
+ * _.toInteger('3.2');
1052
+ * // => 3
1053
+ */
1054
+ function toInteger(value) {
1055
+ var result = toFinite$1(value),
1056
+ remainder = result % 1;
1057
+
1058
+ return result === result ? (remainder ? result - remainder : result) : 0;
1059
+ }
1060
+
1061
+ /**
1062
+ * Converts `value` to a number.
1063
+ *
1064
+ * @static
1065
+ * @memberOf _
1066
+ * @since 4.0.0
1067
+ * @category Lang
1068
+ * @param {*} value The value to process.
1069
+ * @returns {number} Returns the number.
1070
+ * @example
1071
+ *
1072
+ * _.toNumber(3.2);
1073
+ * // => 3.2
1074
+ *
1075
+ * _.toNumber(Number.MIN_VALUE);
1076
+ * // => 5e-324
1077
+ *
1078
+ * _.toNumber(Infinity);
1079
+ * // => Infinity
1080
+ *
1081
+ * _.toNumber('3.2');
1082
+ * // => 3.2
1083
+ */
1084
+ function toNumber$1(value) {
1085
+ if (typeof value == 'number') {
1086
+ return value;
1087
+ }
1088
+ if (isSymbol$1(value)) {
1089
+ return NAN$1;
1090
+ }
1091
+ if (isObject$1(value)) {
1092
+ var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
1093
+ value = isObject$1(other) ? (other + '') : other;
1094
+ }
1095
+ if (typeof value != 'string') {
1096
+ return value === 0 ? value : +value;
1097
+ }
1098
+ value = value.replace(reTrim$1, '');
1099
+ var isBinary = reIsBinary$1.test(value);
1100
+ return (isBinary || reIsOctal$1.test(value))
1101
+ ? freeParseInt$1(value.slice(2), isBinary ? 2 : 8)
1102
+ : (reIsBadHex$1.test(value) ? NAN$1 : +value);
1103
+ }
1104
+
1105
+ /**
1106
+ * Creates an array of the own enumerable property names of `object`.
1107
+ *
1108
+ * **Note:** Non-object values are coerced to objects. See the
1109
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1110
+ * for more details.
1111
+ *
1112
+ * @static
1113
+ * @since 0.1.0
1114
+ * @memberOf _
1115
+ * @category Object
1116
+ * @param {Object} object The object to query.
1117
+ * @returns {Array} Returns the array of property names.
1118
+ * @example
1119
+ *
1120
+ * function Foo() {
1121
+ * this.a = 1;
1122
+ * this.b = 2;
1123
+ * }
1124
+ *
1125
+ * Foo.prototype.c = 3;
1126
+ *
1127
+ * _.keys(new Foo);
1128
+ * // => ['a', 'b'] (iteration order is not guaranteed)
1129
+ *
1130
+ * _.keys('hi');
1131
+ * // => ['0', '1']
1132
+ */
1133
+ function keys(object) {
1134
+ return isArrayLike$1(object) ? arrayLikeKeys(object) : baseKeys(object);
1135
+ }
1136
+
1137
+ /**
1138
+ * Creates an array of the own enumerable string keyed property values of `object`.
1139
+ *
1140
+ * **Note:** Non-object values are coerced to objects.
1141
+ *
1142
+ * @static
1143
+ * @since 0.1.0
1144
+ * @memberOf _
1145
+ * @category Object
1146
+ * @param {Object} object The object to query.
1147
+ * @returns {Array} Returns the array of property values.
1148
+ * @example
1149
+ *
1150
+ * function Foo() {
1151
+ * this.a = 1;
1152
+ * this.b = 2;
1153
+ * }
1154
+ *
1155
+ * Foo.prototype.c = 3;
1156
+ *
1157
+ * _.values(new Foo);
1158
+ * // => [1, 2] (iteration order is not guaranteed)
1159
+ *
1160
+ * _.values('hi');
1161
+ * // => ['h', 'i']
1162
+ */
1163
+ function values(object) {
1164
+ return object ? baseValues(object, keys(object)) : [];
1165
+ }
1166
+
1167
+ var lodash_samplesize = sampleSize;
1168
+
1169
+ /**
1170
+ * lodash (Custom Build) <https://lodash.com/>
1171
+ * Build: `lodash modularize exports="npm" -o ./`
1172
+ * Copyright jQuery Foundation and other contributors <https://jquery.org/>
1173
+ * Released under MIT license <https://lodash.com/license>
1174
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
1175
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
1176
+ */
1177
+
1178
+ /** Used as references for various `Number` constants. */
1179
+ var INFINITY = 1 / 0,
1180
+ MAX_SAFE_INTEGER = 9007199254740991,
1181
+ MAX_INTEGER = 1.7976931348623157e+308,
1182
+ NAN = 0 / 0;
1183
+
1184
+ /** `Object#toString` result references. */
1185
+ var funcTag = '[object Function]',
1186
+ genTag = '[object GeneratorFunction]',
1187
+ symbolTag = '[object Symbol]';
1188
+
1189
+ /** Used to match leading and trailing whitespace. */
1190
+ var reTrim = /^\s+|\s+$/g;
1191
+
1192
+ /** Used to detect bad signed hexadecimal string values. */
1193
+ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
1194
+
1195
+ /** Used to detect binary string values. */
1196
+ var reIsBinary = /^0b[01]+$/i;
1197
+
1198
+ /** Used to detect octal string values. */
1199
+ var reIsOctal = /^0o[0-7]+$/i;
1200
+
1201
+ /** Used to detect unsigned integer values. */
1202
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
1203
+
1204
+ /** Built-in method references without a dependency on `root`. */
1205
+ var freeParseFloat = parseFloat,
1206
+ freeParseInt = parseInt;
1207
+
1208
+ /** Used for built-in method references. */
1209
+ var objectProto = Object.prototype;
1210
+
1211
+ /**
1212
+ * Used to resolve the
1213
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
1214
+ * of values.
1215
+ */
1216
+ var objectToString = objectProto.toString;
1217
+
1218
+ /* Built-in method references for those with the same name as other `lodash` methods. */
1219
+ var nativeFloor = Math.floor,
1220
+ nativeMin = Math.min,
1221
+ nativeRandom = Math.random;
1222
+
1223
+ /**
1224
+ * The base implementation of `_.random` without support for returning
1225
+ * floating-point numbers.
1226
+ *
1227
+ * @private
1228
+ * @param {number} lower The lower bound.
1229
+ * @param {number} upper The upper bound.
1230
+ * @returns {number} Returns the random number.
1231
+ */
1232
+ function baseRandom(lower, upper) {
1233
+ return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
1234
+ }
1235
+
1236
+ /**
1237
+ * Checks if `value` is a valid array-like index.
1238
+ *
1239
+ * @private
1240
+ * @param {*} value The value to check.
1241
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1242
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1243
+ */
1244
+ function isIndex(value, length) {
1245
+ length = length == null ? MAX_SAFE_INTEGER : length;
1246
+ return !!length &&
1247
+ (typeof value == 'number' || reIsUint.test(value)) &&
1248
+ (value > -1 && value % 1 == 0 && value < length);
1249
+ }
1250
+
1251
+ /**
1252
+ * Checks if the given arguments are from an iteratee call.
1253
+ *
1254
+ * @private
1255
+ * @param {*} value The potential iteratee value argument.
1256
+ * @param {*} index The potential iteratee index or key argument.
1257
+ * @param {*} object The potential iteratee object argument.
1258
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
1259
+ * else `false`.
1260
+ */
1261
+ function isIterateeCall(value, index, object) {
1262
+ if (!isObject(object)) {
1263
+ return false;
1264
+ }
1265
+ var type = typeof index;
1266
+ if (type == 'number'
1267
+ ? (isArrayLike(object) && isIndex(index, object.length))
1268
+ : (type == 'string' && index in object)
1269
+ ) {
1270
+ return eq(object[index], value);
1271
+ }
1272
+ return false;
1273
+ }
1274
+
1275
+ /**
1276
+ * Performs a
1277
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1278
+ * comparison between two values to determine if they are equivalent.
1279
+ *
1280
+ * @static
1281
+ * @memberOf _
1282
+ * @since 4.0.0
1283
+ * @category Lang
1284
+ * @param {*} value The value to compare.
1285
+ * @param {*} other The other value to compare.
1286
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1287
+ * @example
1288
+ *
1289
+ * var object = { 'a': 1 };
1290
+ * var other = { 'a': 1 };
1291
+ *
1292
+ * _.eq(object, object);
1293
+ * // => true
1294
+ *
1295
+ * _.eq(object, other);
1296
+ * // => false
1297
+ *
1298
+ * _.eq('a', 'a');
1299
+ * // => true
1300
+ *
1301
+ * _.eq('a', Object('a'));
1302
+ * // => false
1303
+ *
1304
+ * _.eq(NaN, NaN);
1305
+ * // => true
1306
+ */
1307
+ function eq(value, other) {
1308
+ return value === other || (value !== value && other !== other);
1309
+ }
1310
+
1311
+ /**
1312
+ * Checks if `value` is array-like. A value is considered array-like if it's
1313
+ * not a function and has a `value.length` that's an integer greater than or
1314
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1315
+ *
1316
+ * @static
1317
+ * @memberOf _
1318
+ * @since 4.0.0
1319
+ * @category Lang
1320
+ * @param {*} value The value to check.
1321
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1322
+ * @example
1323
+ *
1324
+ * _.isArrayLike([1, 2, 3]);
1325
+ * // => true
1326
+ *
1327
+ * _.isArrayLike(document.body.children);
1328
+ * // => true
1329
+ *
1330
+ * _.isArrayLike('abc');
1331
+ * // => true
1332
+ *
1333
+ * _.isArrayLike(_.noop);
1334
+ * // => false
1335
+ */
1336
+ function isArrayLike(value) {
1337
+ return value != null && isLength(value.length) && !isFunction(value);
1338
+ }
1339
+
1340
+ /**
1341
+ * Checks if `value` is classified as a `Function` object.
1342
+ *
1343
+ * @static
1344
+ * @memberOf _
1345
+ * @since 0.1.0
1346
+ * @category Lang
1347
+ * @param {*} value The value to check.
1348
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
1349
+ * @example
1350
+ *
1351
+ * _.isFunction(_);
1352
+ * // => true
1353
+ *
1354
+ * _.isFunction(/abc/);
1355
+ * // => false
1356
+ */
1357
+ function isFunction(value) {
1358
+ // The use of `Object#toString` avoids issues with the `typeof` operator
1359
+ // in Safari 8-9 which returns 'object' for typed array and other constructors.
1360
+ var tag = isObject(value) ? objectToString.call(value) : '';
1361
+ return tag == funcTag || tag == genTag;
1362
+ }
1363
+
1364
+ /**
1365
+ * Checks if `value` is a valid array-like length.
1366
+ *
1367
+ * **Note:** This method is loosely based on
1368
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1369
+ *
1370
+ * @static
1371
+ * @memberOf _
1372
+ * @since 4.0.0
1373
+ * @category Lang
1374
+ * @param {*} value The value to check.
1375
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1376
+ * @example
1377
+ *
1378
+ * _.isLength(3);
1379
+ * // => true
1380
+ *
1381
+ * _.isLength(Number.MIN_VALUE);
1382
+ * // => false
1383
+ *
1384
+ * _.isLength(Infinity);
1385
+ * // => false
1386
+ *
1387
+ * _.isLength('3');
1388
+ * // => false
1389
+ */
1390
+ function isLength(value) {
1391
+ return typeof value == 'number' &&
1392
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1393
+ }
1394
+
1395
+ /**
1396
+ * Checks if `value` is the
1397
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1398
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1399
+ *
1400
+ * @static
1401
+ * @memberOf _
1402
+ * @since 0.1.0
1403
+ * @category Lang
1404
+ * @param {*} value The value to check.
1405
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1406
+ * @example
1407
+ *
1408
+ * _.isObject({});
1409
+ * // => true
1410
+ *
1411
+ * _.isObject([1, 2, 3]);
1412
+ * // => true
1413
+ *
1414
+ * _.isObject(_.noop);
1415
+ * // => true
1416
+ *
1417
+ * _.isObject(null);
1418
+ * // => false
1419
+ */
1420
+ function isObject(value) {
1421
+ var type = typeof value;
1422
+ return !!value && (type == 'object' || type == 'function');
1423
+ }
1424
+
1425
+ /**
1426
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
1427
+ * and has a `typeof` result of "object".
1428
+ *
1429
+ * @static
1430
+ * @memberOf _
1431
+ * @since 4.0.0
1432
+ * @category Lang
1433
+ * @param {*} value The value to check.
1434
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1435
+ * @example
1436
+ *
1437
+ * _.isObjectLike({});
1438
+ * // => true
1439
+ *
1440
+ * _.isObjectLike([1, 2, 3]);
1441
+ * // => true
1442
+ *
1443
+ * _.isObjectLike(_.noop);
1444
+ * // => false
1445
+ *
1446
+ * _.isObjectLike(null);
1447
+ * // => false
1448
+ */
1449
+ function isObjectLike(value) {
1450
+ return !!value && typeof value == 'object';
1451
+ }
1452
+
1453
+ /**
1454
+ * Checks if `value` is classified as a `Symbol` primitive or object.
1455
+ *
1456
+ * @static
1457
+ * @memberOf _
1458
+ * @since 4.0.0
1459
+ * @category Lang
1460
+ * @param {*} value The value to check.
1461
+ * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
1462
+ * @example
1463
+ *
1464
+ * _.isSymbol(Symbol.iterator);
1465
+ * // => true
1466
+ *
1467
+ * _.isSymbol('abc');
1468
+ * // => false
1469
+ */
1470
+ function isSymbol(value) {
1471
+ return typeof value == 'symbol' ||
1472
+ (isObjectLike(value) && objectToString.call(value) == symbolTag);
1473
+ }
1474
+
1475
+ /**
1476
+ * Converts `value` to a finite number.
1477
+ *
1478
+ * @static
1479
+ * @memberOf _
1480
+ * @since 4.12.0
1481
+ * @category Lang
1482
+ * @param {*} value The value to convert.
1483
+ * @returns {number} Returns the converted number.
1484
+ * @example
1485
+ *
1486
+ * _.toFinite(3.2);
1487
+ * // => 3.2
1488
+ *
1489
+ * _.toFinite(Number.MIN_VALUE);
1490
+ * // => 5e-324
1491
+ *
1492
+ * _.toFinite(Infinity);
1493
+ * // => 1.7976931348623157e+308
1494
+ *
1495
+ * _.toFinite('3.2');
1496
+ * // => 3.2
1497
+ */
1498
+ function toFinite(value) {
1499
+ if (!value) {
1500
+ return value === 0 ? value : 0;
1501
+ }
1502
+ value = toNumber(value);
1503
+ if (value === INFINITY || value === -INFINITY) {
1504
+ var sign = (value < 0 ? -1 : 1);
1505
+ return sign * MAX_INTEGER;
1506
+ }
1507
+ return value === value ? value : 0;
1508
+ }
1509
+
1510
+ /**
1511
+ * Converts `value` to a number.
1512
+ *
1513
+ * @static
1514
+ * @memberOf _
1515
+ * @since 4.0.0
1516
+ * @category Lang
1517
+ * @param {*} value The value to process.
1518
+ * @returns {number} Returns the number.
1519
+ * @example
1520
+ *
1521
+ * _.toNumber(3.2);
1522
+ * // => 3.2
1523
+ *
1524
+ * _.toNumber(Number.MIN_VALUE);
1525
+ * // => 5e-324
1526
+ *
1527
+ * _.toNumber(Infinity);
1528
+ * // => Infinity
1529
+ *
1530
+ * _.toNumber('3.2');
1531
+ * // => 3.2
1532
+ */
1533
+ function toNumber(value) {
1534
+ if (typeof value == 'number') {
1535
+ return value;
1536
+ }
1537
+ if (isSymbol(value)) {
1538
+ return NAN;
1539
+ }
1540
+ if (isObject(value)) {
1541
+ var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
1542
+ value = isObject(other) ? (other + '') : other;
1543
+ }
1544
+ if (typeof value != 'string') {
1545
+ return value === 0 ? value : +value;
1546
+ }
1547
+ value = value.replace(reTrim, '');
1548
+ var isBinary = reIsBinary.test(value);
1549
+ return (isBinary || reIsOctal.test(value))
1550
+ ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
1551
+ : (reIsBadHex.test(value) ? NAN : +value);
1552
+ }
1553
+
1554
+ /**
1555
+ * Produces a random number between the inclusive `lower` and `upper` bounds.
1556
+ * If only one argument is provided a number between `0` and the given number
1557
+ * is returned. If `floating` is `true`, or either `lower` or `upper` are
1558
+ * floats, a floating-point number is returned instead of an integer.
1559
+ *
1560
+ * **Note:** JavaScript follows the IEEE-754 standard for resolving
1561
+ * floating-point values which can produce unexpected results.
1562
+ *
1563
+ * @static
1564
+ * @memberOf _
1565
+ * @since 0.7.0
1566
+ * @category Number
1567
+ * @param {number} [lower=0] The lower bound.
1568
+ * @param {number} [upper=1] The upper bound.
1569
+ * @param {boolean} [floating] Specify returning a floating-point number.
1570
+ * @returns {number} Returns the random number.
1571
+ * @example
1572
+ *
1573
+ * _.random(0, 5);
1574
+ * // => an integer between 0 and 5
1575
+ *
1576
+ * _.random(5);
1577
+ * // => also an integer between 0 and 5
1578
+ *
1579
+ * _.random(5, true);
1580
+ * // => a floating-point number between 0 and 5
1581
+ *
1582
+ * _.random(1.2, 5.2);
1583
+ * // => a floating-point number between 1.2 and 5.2
1584
+ */
1585
+ function random(lower, upper, floating) {
1586
+ if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
1587
+ upper = floating = undefined;
1588
+ }
1589
+ if (floating === undefined) {
1590
+ if (typeof upper == 'boolean') {
1591
+ floating = upper;
1592
+ upper = undefined;
1593
+ }
1594
+ else if (typeof lower == 'boolean') {
1595
+ floating = lower;
1596
+ lower = undefined;
1597
+ }
1598
+ }
1599
+ if (lower === undefined && upper === undefined) {
1600
+ lower = 0;
1601
+ upper = 1;
1602
+ }
1603
+ else {
1604
+ lower = toFinite(lower);
1605
+ if (upper === undefined) {
1606
+ upper = lower;
1607
+ lower = 0;
1608
+ } else {
1609
+ upper = toFinite(upper);
1610
+ }
1611
+ }
1612
+ if (lower > upper) {
1613
+ var temp = lower;
1614
+ lower = upper;
1615
+ upper = temp;
1616
+ }
1617
+ if (floating || lower % 1 || upper % 1) {
1618
+ var rand = nativeRandom();
1619
+ return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
1620
+ }
1621
+ return baseRandom(lower, upper);
1622
+ }
1623
+
1624
+ var lodash_random = random;
1625
+
1626
+ const documentComponentDemoCss = ".sc-dsot-document-component-demo-h{display:block;margin:0 8px;border-left:1px dashed transparent;border-right:1px dashed transparent}[show-canvas].sc-dsot-document-component-demo-h{border-left:1px dashed pink;border-right:1px dashed pink}";
6
1627
 
7
1628
  const DocumentComponentDemo = class {
8
1629
  constructor(hostRef) {
9
1630
  index.registerInstance(this, hostRef);
1631
+ this.dsotOzonContentAnchorClick = index.createEvent(this, "dsotOzonContentAnchorClick", 7);
10
1632
  this.DocumentComponent = ({ path }) => {
11
1633
  var _a;
12
1634
  const documentComponent = path.at(-1);
13
1635
  const { DocumentComponent } = this;
14
- return (index.h("ul", null, (_a = documentComponent === null || documentComponent === void 0 ? void 0 : documentComponent._embedded) === null || _a === void 0 ? void 0 : _a.ontwerpTekststructuurDocumentComponenten.map((d, i) => (index.h("li", { key: d.documentTechnischId }, index.h("dso-document-component", { annotated: i % 3 === 2, bevatOntwerpInformatie: !!d.bevatOntwerpInformatie, filtered: this.isOpen(d) ? this.isFiltered(d) : this.hasFilteredChildren(d), genesteOntwerpInformatie: this.hasNestedDraft(d), gereserveerd: d.gereserveerd, heading: "h2", inhoud: d.inhoud, label: d.labelXml, openAnnotation: this.isOpenedAnnotation(d), notApplicable: this.isNotApplicable(d) || path.some((p) => this.isNotApplicable(p)), nummer: d.nummerXml, onDsoAnnotationToggle: () => this.handleAnnotationToggle(d), onDsoOpenToggle: (e) => this.handleOpenToggle(e, d), open: this.isOpen(d), opschrift: d.opschrift, type: d.type, vervallen: d.vervallen, wijzigactie: d.wijzigactie }, this.isOpenedAnnotation(d) && (index.h("dso-annotation-output", { slot: "annotation", open: true, identifier: "test", onDsoClose: () => this.handleAnnotationToggle(d) }, index.h("span", { slot: "title" }, "Annotaties"), index.h("dso-slide-toggle", { checked: this.isCheckedSlideToggle(d), onDsoActiveChange: () => this.handleSelectableChange(d) }, "Delfzijl"))), this.showContent(d) && index.h(DocumentComponent, { path: [...path, d] })))))));
1636
+ return (index.h("ul", null, documentComponent &&
1637
+ ((_a = this.getEmbeddedDocumentComponents(documentComponent)) === null || _a === void 0 ? void 0 : _a.map((d, i) => (index.h("li", { key: d.documentTechnischId }, index.h("dso-document-component", { annotated: i % 3 === 2, bevatOntwerpInformatie: !!d.bevatOntwerpInformatie, filtered: this.isOpen(d) ? this.isFiltered(d) : this.hasFilteredChildren(d), genesteOntwerpInformatie: this.hasNestedDraft(d), gereserveerd: d.gereserveerd, heading: "h2", inhoud: d.inhoud, label: d.labelXml, openAnnotation: this.isOpenedAnnotation(d), notApplicable: this.isNotApplicable(d) || path.some((p) => this.isNotApplicable(p)), nummer: d.nummerXml, onDsoAnnotationToggle: () => this.handleAnnotationToggle(d), onDsoOpenToggle: (e) => this.handleOpenToggle(e, d), onDsoOzonContentAnchorClick: (e) => this.handleOzonContentAnchorClick(e), open: this.isOpen(d), opschrift: d.opschrift, type: d.type, vervallen: d.vervallen, wijzigactie: d.wijzigactie }, this.isOpenedAnnotation(d) && (index.h("dso-annotation-output", { slot: "annotation", open: true, identifier: "test", onDsoClose: () => this.handleAnnotationToggle(d) }, index.h("span", { slot: "title" }, "Annotaties"), index.h("dso-slide-toggle", { checked: this.isCheckedSlideToggle(d), onDsoActiveChange: () => this.handleSelectableChange(d) }, "Delfzijl"))), this.showContent(d) && index.h(DocumentComponent, { path: [...path, d] }))))))));
15
1638
  };
1639
+ this.showCanvas = false;
1640
+ this.jsonFile = undefined;
1641
+ this.openDefault = false;
16
1642
  this.response = undefined;
17
- this.open = [];
1643
+ this.openOrClosed = [];
18
1644
  this.openedAnnotation = [];
19
1645
  this.filtered = [];
20
1646
  this.notApplicable = [];
21
1647
  this.activeAnnotationSelectables = [];
22
1648
  }
23
- fixData(documentComponent) {
1649
+ async jsonFileWatcher() {
1650
+ this.openOrClosed = [];
1651
+ await this.loadData();
1652
+ }
1653
+ async openDefaultWatcher() {
1654
+ this.openOrClosed = [];
1655
+ await this.loadData();
1656
+ }
1657
+ async componentDidLoad() {
1658
+ await this.loadData();
1659
+ }
1660
+ getEmbeddedDocumentComponents(documentComponent) {
1661
+ var _a, _b, _c;
1662
+ return ((_b = (_a = documentComponent === null || documentComponent === void 0 ? void 0 : documentComponent._embedded) === null || _a === void 0 ? void 0 : _a.ontwerpTekststructuurDocumentComponenten) !== null && _b !== void 0 ? _b : (_c = documentComponent === null || documentComponent === void 0 ? void 0 : documentComponent._embedded) === null || _c === void 0 ? void 0 : _c.tekststructuurDocumentComponenten);
1663
+ }
1664
+ concatEmbeddedDocumentComponents(documentComponent) {
24
1665
  var _a;
25
- return Object.assign(Object.assign({}, documentComponent), { nummerXml: documentComponent.type === "LID" && !((_a = documentComponent.nummerXml) === null || _a === void 0 ? void 0 : _a.startsWith("<?"))
26
- ? `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Nummer xmlns="https://standaarden.overheid.nl/stop/imop/tekst/">${documentComponent.nummerXml}</Nummer>`
27
- : documentComponent.nummerXml, _embedded: documentComponent._embedded && {
28
- ontwerpTekststructuurDocumentComponenten: documentComponent._embedded.ontwerpTekststructuurDocumentComponenten.map((d) => this.fixData(d)),
29
- } });
30
- }
31
- componentDidLoad() {
32
- fetch("ozon-response.json")
33
- .then((response) => response.json())
34
- .then((result) => {
35
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
36
- this.response = this.fixData(result);
37
- /* eslint-disable @typescript-eslint/no-non-null-asserted-optional-chain */
38
- this.filtered = [
39
- (_e = (_d = (_c = (_b = (_a = this.response) === null || _a === void 0 ? void 0 : _a._embedded) === null || _b === void 0 ? void 0 : _b.ontwerpTekststructuurDocumentComponenten[0]._embedded) === null || _c === void 0 ? void 0 : _c.ontwerpTekststructuurDocumentComponenten[10]._embedded) === null || _d === void 0 ? void 0 : _d.ontwerpTekststructuurDocumentComponenten[2]._embedded) === null || _e === void 0 ? void 0 : _e.ontwerpTekststructuurDocumentComponenten[0],
40
- (_j = (_h = (_g = (_f = this.response) === null || _f === void 0 ? void 0 : _f._embedded) === null || _g === void 0 ? void 0 : _g.ontwerpTekststructuurDocumentComponenten[0]._embedded) === null || _h === void 0 ? void 0 : _h.ontwerpTekststructuurDocumentComponenten[10]._embedded) === null || _j === void 0 ? void 0 : _j.ontwerpTekststructuurDocumentComponenten[0],
41
- ];
42
- this.notApplicable = [
43
- (_m = (_l = (_k = this.response) === null || _k === void 0 ? void 0 : _k._embedded) === null || _l === void 0 ? void 0 : _l.ontwerpTekststructuurDocumentComponenten[0]._embedded) === null || _m === void 0 ? void 0 : _m.ontwerpTekststructuurDocumentComponenten[4],
44
- (_r = (_q = (_p = (_o = this.response) === null || _o === void 0 ? void 0 : _o._embedded) === null || _p === void 0 ? void 0 : _p.ontwerpTekststructuurDocumentComponenten[0]._embedded) === null || _q === void 0 ? void 0 : _q.ontwerpTekststructuurDocumentComponenten[4]._embedded) === null || _r === void 0 ? void 0 : _r.ontwerpTekststructuurDocumentComponenten[0],
45
- (_v = (_u = (_t = (_s = this.response) === null || _s === void 0 ? void 0 : _s._embedded) === null || _t === void 0 ? void 0 : _t.ontwerpTekststructuurDocumentComponenten[0]._embedded) === null || _u === void 0 ? void 0 : _u.ontwerpTekststructuurDocumentComponenten[9]._embedded) === null || _v === void 0 ? void 0 : _v.ontwerpTekststructuurDocumentComponenten[1],
46
- ];
47
- /* eslint-enable @typescript-eslint/no-non-null-asserted-optional-chain */
48
- });
49
- }
50
- handleOpenToggle(e, documentComponent) {
51
- const isOpen = this.isOpen(documentComponent);
52
- if (e.detail.open && !isOpen) {
53
- this.open = [...this.open, documentComponent];
1666
+ const embeddedDocuments = [...((_a = this.getEmbeddedDocumentComponents(documentComponent)) !== null && _a !== void 0 ? _a : [])];
1667
+ for (const d of embeddedDocuments) {
1668
+ embeddedDocuments.push(...this.concatEmbeddedDocumentComponents(d));
54
1669
  }
55
- else if (!e.detail.open && isOpen) {
56
- this.open = this.open.filter((d) => d !== documentComponent);
1670
+ return embeddedDocuments;
1671
+ }
1672
+ selectRandomDocumentComponents(documentComponent, exclude = []) {
1673
+ const documentComponents = this.concatEmbeddedDocumentComponents(documentComponent).filter((d) => !exclude.includes(d));
1674
+ const size = lodash_random(0, Math.floor(documentComponents.length / 10));
1675
+ return lodash_samplesize(documentComponents, size);
1676
+ }
1677
+ async loadData() {
1678
+ var _a;
1679
+ if (!this.jsonFile) {
1680
+ this.response = undefined;
1681
+ return;
1682
+ }
1683
+ const data = await fetch(this.jsonFile).then((r) => r.json());
1684
+ const lichaam = (_a = this.getEmbeddedDocumentComponents(data)) === null || _a === void 0 ? void 0 : _a.find((documentComponent) => documentComponent.type === "LICHAAM");
1685
+ if (lichaam) {
1686
+ this.response = lichaam;
1687
+ this.notApplicable = this.selectRandomDocumentComponents(lichaam);
1688
+ this.filtered = this.selectRandomDocumentComponents(lichaam, this.notApplicable);
57
1689
  }
58
1690
  }
1691
+ handleOpenToggle(_e, documentComponent) {
1692
+ const isOpenOrClosed = this.openOrClosed.includes(documentComponent);
1693
+ this.openOrClosed = !isOpenOrClosed
1694
+ ? [...this.openOrClosed, documentComponent]
1695
+ : this.openOrClosed.filter((d) => d !== documentComponent);
1696
+ }
59
1697
  handleAnnotationToggle(documentComponent) {
60
1698
  this.openedAnnotation = this.isOpenedAnnotation(documentComponent)
61
1699
  ? this.openedAnnotation.filter((d) => d !== documentComponent)
62
1700
  : [...this.openedAnnotation, documentComponent];
63
1701
  if (!this.isOpen(documentComponent)) {
64
- this.open = [...this.open, documentComponent];
1702
+ this.openOrClosed = [...this.openOrClosed, documentComponent];
65
1703
  }
66
1704
  }
67
1705
  handleSelectableChange(documentComponent) {
@@ -69,16 +1707,21 @@ const DocumentComponentDemo = class {
69
1707
  ? this.activeAnnotationSelectables.filter((d) => d !== documentComponent)
70
1708
  : [...this.activeAnnotationSelectables, documentComponent];
71
1709
  }
1710
+ handleOzonContentAnchorClick(e) {
1711
+ this.dsotOzonContentAnchorClick.emit(e.detail);
1712
+ }
72
1713
  isCheckedSlideToggle(documentComponent) {
73
1714
  return this.activeAnnotationSelectables.includes(documentComponent);
74
1715
  }
75
1716
  hasFilteredChildren(documentComponent) {
76
1717
  var _a, _b;
77
1718
  return (this.filtered.includes(documentComponent) ||
78
- ((_b = (_a = documentComponent._embedded) === null || _a === void 0 ? void 0 : _a.ontwerpTekststructuurDocumentComponenten.some((d) => this.hasFilteredChildren(d))) !== null && _b !== void 0 ? _b : false));
1719
+ ((_b = (_a = this.getEmbeddedDocumentComponents(documentComponent)) === null || _a === void 0 ? void 0 : _a.some((d) => this.hasFilteredChildren(d))) !== null && _b !== void 0 ? _b : false));
79
1720
  }
80
1721
  isOpen(documentComponent) {
81
- return documentComponent.type === "LID" || this.open.includes(documentComponent);
1722
+ return documentComponent.type === "LID" || this.openDefault
1723
+ ? !this.openOrClosed.includes(documentComponent)
1724
+ : this.openOrClosed.includes(documentComponent);
82
1725
  }
83
1726
  isOpenedAnnotation(documentComponent) {
84
1727
  return this.openedAnnotation.includes(documentComponent);
@@ -91,19 +1734,23 @@ const DocumentComponentDemo = class {
91
1734
  }
92
1735
  hasNestedDraft(documentComponent) {
93
1736
  var _a, _b;
94
- return ((_b = (_a = documentComponent._embedded) === null || _a === void 0 ? void 0 : _a.ontwerpTekststructuurDocumentComponenten.some((d) => !!d.bevatOntwerpInformatie || this.hasNestedDraft(d))) !== null && _b !== void 0 ? _b : false);
1737
+ return ((_b = (_a = this.getEmbeddedDocumentComponents(documentComponent)) === null || _a === void 0 ? void 0 : _a.some((d) => !!d.bevatOntwerpInformatie || this.hasNestedDraft(d))) !== null && _b !== void 0 ? _b : false);
95
1738
  }
96
1739
  showContent(documentComponent) {
97
1740
  var _a;
98
1741
  return (this.isOpen(documentComponent) &&
99
- !!(((_a = documentComponent._embedded) === null || _a === void 0 ? void 0 : _a.ontwerpTekststructuurDocumentComponenten.length) || documentComponent.inhoud));
1742
+ !!(((_a = this.getEmbeddedDocumentComponents(documentComponent)) === null || _a === void 0 ? void 0 : _a.length) || documentComponent.inhoud));
100
1743
  }
101
1744
  render() {
102
- var _a, _b;
103
1745
  const { DocumentComponent } = this;
104
- return (index.h("div", { style: { margin: "0 8px", borderLeft: "1px dashed pink", borderRight: "1px dashed pink" } }, index.h("dso-responsive-element", { class: "dso-document-components" }, (_b = (_a = this.response) === null || _a === void 0 ? void 0 : _a._embedded) === null || _b === void 0 ? void 0 : _b.ontwerpTekststructuurDocumentComponenten.map((d) => (index.h(index.Fragment, null, index.h(DocumentComponent, { path: [d] }), index.h("hr", null)))))));
1746
+ return (index.h("dso-responsive-element", { class: "dso-document-components" }, this.response && index.h(DocumentComponent, { path: [this.response] })));
105
1747
  }
1748
+ static get watchers() { return {
1749
+ "jsonFile": ["jsonFileWatcher"],
1750
+ "openDefault": ["openDefaultWatcher"]
1751
+ }; }
106
1752
  };
1753
+ DocumentComponentDemo.style = documentComponentDemoCss;
107
1754
 
108
1755
  exports.dsot_document_component_demo = DocumentComponentDemo;
109
1756