@hanzo/docs-tailwind 0.0.2

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.
@@ -0,0 +1,2066 @@
1
+ import plugin from "tailwindcss/plugin";
2
+ import parser from "postcss-selector-parser";
3
+
4
+ //#region \0rolldown/runtime.js
5
+ var __create = Object.create;
6
+ var __defProp = Object.defineProperty;
7
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
8
+ var __getOwnPropNames = Object.getOwnPropertyNames;
9
+ var __getProtoOf = Object.getPrototypeOf;
10
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
11
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
15
+ key = keys[i];
16
+ if (!__hasOwnProp.call(to, key) && key !== except) {
17
+ __defProp(to, key, {
18
+ get: ((k) => from[k]).bind(null, key),
19
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
+ });
21
+ }
22
+ }
23
+ }
24
+ return to;
25
+ };
26
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
27
+ value: mod,
28
+ enumerable: true
29
+ }) : target, mod));
30
+
31
+ //#endregion
32
+ //#region src/typography/styles.ts
33
+ function round(num) {
34
+ return num.toFixed(7).replace(/(\.[0-9]+?)0+$/, "$1").replace(/\.0$/, "");
35
+ }
36
+ function rem(px) {
37
+ return `${round(px / 16)}rem`;
38
+ }
39
+ function em(px, base) {
40
+ return `${round(px / base)}em`;
41
+ }
42
+ const colors = {
43
+ "--tw-prose-body": "color-mix(in oklab, var(--color-fd-foreground) 90%, transparent)",
44
+ "--tw-prose-headings": "var(--color-fd-foreground)",
45
+ "--tw-prose-lead": `var(--color-fd-foreground)`,
46
+ "--tw-prose-links": `var(--color-fd-foreground)`,
47
+ "--tw-prose-bold": `var(--color-fd-foreground)`,
48
+ "--tw-prose-counters": `var(--color-fd-muted-foreground)`,
49
+ "--tw-prose-bullets": `var(--color-fd-muted-foreground)`,
50
+ "--tw-prose-hr": `var(--color-fd-border)`,
51
+ "--tw-prose-quotes": `var(--color-fd-foreground)`,
52
+ "--tw-prose-quote-borders": `var(--color-fd-border)`,
53
+ "--tw-prose-captions": `var(--color-fd-foreground)`,
54
+ "--tw-prose-code": `var(--color-fd-foreground)`,
55
+ "--tw-prose-th-borders": `var(--color-fd-border)`,
56
+ "--tw-prose-td-borders": `var(--color-fd-border)`,
57
+ "--tw-prose-kbd": `var(--color-fd-foreground)`,
58
+ "--tw-prose-kbd-shadows": `color-mix(in oklab, var(--color-fd-primary) 50%, transparent)`
59
+ };
60
+ const roundedTable = {
61
+ table: {
62
+ borderCollapse: "separate",
63
+ borderSpacing: "0",
64
+ background: "var(--color-fd-card)",
65
+ borderRadius: "var(--radius-lg)",
66
+ border: "1px solid var(--color-fd-border)",
67
+ overflow: "hidden"
68
+ },
69
+ th: {
70
+ textAlign: "start",
71
+ padding: "calc(var(--spacing) * 2.5)",
72
+ "border-inline-start": "1px solid var(--color-fd-border)",
73
+ background: "var(--color-fd-muted)"
74
+ },
75
+ "th:first-child": { "border-inline-start": "none" },
76
+ "th:not(tr:last-child *), td:not(tr:last-child *)": { "border-bottom": "1px solid var(--color-fd-border)" },
77
+ td: {
78
+ textAlign: "start",
79
+ "border-inline-start": "1px solid var(--color-fd-border)",
80
+ padding: "calc(var(--spacing) * 2.5)"
81
+ },
82
+ "td:first-child": { "border-inline-start": "none" },
83
+ "tfoot th, tfoot td": {
84
+ borderTopWidth: "1px",
85
+ borderTopColor: "var(--tw-prose-th-borders)"
86
+ },
87
+ "thead th, thead td": {
88
+ borderBottomWidth: "1px",
89
+ borderBottomColor: "var(--tw-prose-th-borders)"
90
+ }
91
+ };
92
+ const normalTable = {
93
+ thead: {
94
+ borderBottomWidth: "1px",
95
+ borderBottomColor: "var(--tw-prose-th-borders)"
96
+ },
97
+ "thead th": {
98
+ verticalAlign: "bottom",
99
+ paddingInlineEnd: em(8, 14),
100
+ paddingBottom: em(8, 14),
101
+ paddingInlineStart: em(8, 14)
102
+ },
103
+ "thead th:first-child": { paddingInlineStart: "0" },
104
+ "thead th:last-child": { paddingInlineEnd: "0" },
105
+ "tbody td, tfoot td": {
106
+ paddingTop: em(8, 14),
107
+ paddingInlineEnd: em(8, 14),
108
+ paddingBottom: em(8, 14),
109
+ paddingInlineStart: em(8, 14)
110
+ },
111
+ "tbody td:first-child, tfoot td:first-child": { paddingInlineStart: "0" },
112
+ "tbody td:last-child, tfoot td:last-child": { paddingInlineEnd: "0" },
113
+ "tbody tr": {
114
+ borderBottomWidth: "1px",
115
+ borderBottomColor: "var(--tw-prose-td-borders)"
116
+ },
117
+ "tbody tr:last-child": { borderBottomWidth: "0" },
118
+ "tbody td": { verticalAlign: "baseline" },
119
+ tfoot: {
120
+ borderTopWidth: "1px",
121
+ borderTopColor: "var(--tw-prose-th-borders)"
122
+ },
123
+ "tfoot td": { verticalAlign: "top" },
124
+ "th, td": { textAlign: "start" }
125
+ };
126
+ const DEFAULT = { css: [
127
+ {
128
+ color: "var(--tw-prose-body)",
129
+ maxWidth: "none",
130
+ fontSize: rem(16),
131
+ lineHeight: "1.75rem",
132
+ "[class~=\"lead\"]": {
133
+ fontSize: em(20, 16),
134
+ lineHeight: round(32 / 20),
135
+ marginTop: em(24, 20),
136
+ marginBottom: em(24, 20),
137
+ color: "var(--tw-prose-lead)"
138
+ },
139
+ ul: {
140
+ paddingInlineStart: "1rem",
141
+ listStyleType: "disc",
142
+ marginTop: em(20, 16),
143
+ marginBottom: em(20, 16)
144
+ },
145
+ li: {
146
+ marginTop: em(8, 16),
147
+ marginBottom: em(8, 16)
148
+ },
149
+ "ol > li": { paddingInlineStart: em(6, 16) },
150
+ "ul > li": { paddingInlineStart: "0" },
151
+ "> ul > li p": {
152
+ marginTop: em(12, 16),
153
+ marginBottom: em(12, 16)
154
+ },
155
+ "> ul > li > p:first-child": { marginTop: em(20, 16) },
156
+ "> ul > li > p:last-child": { marginBottom: em(20, 16) },
157
+ "> ol > li > p:first-child": { marginTop: em(20, 16) },
158
+ "> ol > li > p:last-child": { marginBottom: em(20, 16) },
159
+ "ul ul, ul ol, ol ul, ol ol": {
160
+ marginTop: em(12, 16),
161
+ marginBottom: em(12, 16)
162
+ },
163
+ dl: {
164
+ marginTop: em(20, 16),
165
+ marginBottom: em(20, 16)
166
+ },
167
+ dt: {
168
+ color: "var(--tw-prose-headings)",
169
+ fontWeight: "600",
170
+ marginTop: em(20, 16)
171
+ },
172
+ dd: {
173
+ marginTop: em(8, 16),
174
+ paddingInlineStart: em(26, 16)
175
+ },
176
+ hr: {
177
+ borderColor: "var(--tw-prose-hr)",
178
+ borderTopWidth: "1px",
179
+ marginTop: em(48, 16),
180
+ marginBottom: em(48, 16)
181
+ },
182
+ p: {
183
+ marginTop: em(20, 16),
184
+ marginBottom: em(20, 16)
185
+ },
186
+ strong: {
187
+ color: "var(--tw-prose-bold)",
188
+ fontWeight: "500"
189
+ },
190
+ "a strong": { color: "inherit" },
191
+ "blockquote strong": { color: "inherit" },
192
+ "thead th strong": { color: "inherit" },
193
+ ol: {
194
+ listStyleType: "decimal",
195
+ marginTop: em(20, 16),
196
+ marginBottom: em(20, 16),
197
+ paddingInlineStart: em(26, 16)
198
+ },
199
+ "ol[type=\"A\"]": { listStyleType: "upper-alpha" },
200
+ "ol[type=\"a\"]": { listStyleType: "lower-alpha" },
201
+ "ol[type=\"A\" s]": { listStyleType: "upper-alpha" },
202
+ "ol[type=\"a\" s]": { listStyleType: "lower-alpha" },
203
+ "ol[type=\"I\"]": { listStyleType: "upper-roman" },
204
+ "ol[type=\"i\"]": { listStyleType: "lower-roman" },
205
+ "ol[type=\"I\" s]": { listStyleType: "upper-roman" },
206
+ "ol[type=\"i\" s]": { listStyleType: "lower-roman" },
207
+ "ol[type=\"1\"]": { listStyleType: "decimal" },
208
+ "ol > li::marker": {
209
+ fontWeight: "400",
210
+ color: "var(--tw-prose-counters)"
211
+ },
212
+ "ul > li::marker": { color: "var(--tw-prose-bullets)" },
213
+ blockquote: {
214
+ marginTop: em(32, 20),
215
+ marginBottom: em(32, 20),
216
+ paddingInlineStart: em(20, 20),
217
+ fontWeight: "500",
218
+ fontStyle: "italic",
219
+ color: "var(--tw-prose-quotes)",
220
+ borderInlineStartWidth: "0.25rem",
221
+ borderInlineStartColor: "var(--tw-prose-quote-borders)",
222
+ quotes: "\"\\201C\"\"\\201D\"\"\\2018\"\"\\2019\""
223
+ },
224
+ "blockquote p:first-of-type::before": { content: "open-quote" },
225
+ "blockquote p:last-of-type::after": { content: "close-quote" },
226
+ h1: {
227
+ color: "var(--tw-prose-headings)",
228
+ fontWeight: "800",
229
+ fontSize: "var(--text-3xl)",
230
+ marginTop: "0",
231
+ marginBottom: em(32, 36),
232
+ lineHeight: round(40 / 36)
233
+ },
234
+ "h1 strong": {
235
+ fontWeight: "900",
236
+ color: "inherit"
237
+ },
238
+ h2: {
239
+ color: "var(--tw-prose-headings)",
240
+ fontSize: em(24, 16),
241
+ marginTop: em(48, 24),
242
+ marginBottom: em(24, 24),
243
+ lineHeight: round(32 / 24),
244
+ fontWeight: "600"
245
+ },
246
+ "h2 strong": {
247
+ fontWeight: "800",
248
+ color: "inherit"
249
+ },
250
+ h3: {
251
+ color: "var(--tw-prose-headings)",
252
+ fontWeight: "600",
253
+ fontSize: em(20, 16),
254
+ marginTop: em(32, 20),
255
+ marginBottom: em(12, 20),
256
+ lineHeight: round(32 / 20)
257
+ },
258
+ "h3 strong": {
259
+ fontWeight: "700",
260
+ color: "inherit"
261
+ },
262
+ h4: {
263
+ color: "var(--tw-prose-headings)",
264
+ fontWeight: "600",
265
+ marginTop: em(24, 16),
266
+ marginBottom: em(8, 16),
267
+ lineHeight: round(24 / 16)
268
+ },
269
+ "h4 strong": {
270
+ fontWeight: "700",
271
+ color: "inherit"
272
+ },
273
+ "hr + *": { marginTop: "0" },
274
+ "h2 + *": { marginTop: "0" },
275
+ "h3 + *": { marginTop: "0" },
276
+ "h4 + *": { marginTop: "0" },
277
+ img: {
278
+ marginTop: em(32, 16),
279
+ marginBottom: em(32, 16)
280
+ },
281
+ picture: {
282
+ display: "block",
283
+ marginTop: em(32, 16),
284
+ marginBottom: em(32, 16)
285
+ },
286
+ "picture > img": {
287
+ marginTop: "0",
288
+ marginBottom: "0"
289
+ },
290
+ video: {
291
+ marginTop: em(32, 16),
292
+ marginBottom: em(32, 16)
293
+ },
294
+ kbd: {
295
+ fontSize: em(14, 16),
296
+ borderRadius: rem(5),
297
+ paddingTop: em(3, 16),
298
+ paddingInlineEnd: em(6, 16),
299
+ paddingBottom: em(3, 16),
300
+ paddingInlineStart: em(6, 16),
301
+ fontWeight: "500",
302
+ fontFamily: "inherit",
303
+ color: "var(--tw-prose-kbd)",
304
+ boxShadow: "0 0 0 1px var(--tw-prose-kbd-shadows),0 3px 0 var(--tw-prose-kbd-shadows)"
305
+ },
306
+ code: {
307
+ padding: "3px",
308
+ border: "solid 1px",
309
+ fontSize: "13px",
310
+ borderColor: `var(--color-fd-border)`,
311
+ borderRadius: "5px",
312
+ fontWeight: "400",
313
+ background: `var(--color-fd-muted)`,
314
+ color: "var(--tw-prose-code)"
315
+ },
316
+ "a code": { color: "inherit" },
317
+ "h1 code": {
318
+ color: "inherit",
319
+ fontSize: "var(--text-2xl)"
320
+ },
321
+ "h2 code": {
322
+ color: "inherit",
323
+ fontSize: em(21, 24)
324
+ },
325
+ "h3 code": {
326
+ color: "inherit",
327
+ fontSize: em(18, 20)
328
+ },
329
+ "h4 code": { color: "inherit" },
330
+ "blockquote code": { color: "inherit" },
331
+ "thead th code": { color: "inherit" },
332
+ table: {
333
+ fontSize: em(14, 16),
334
+ lineHeight: round(24 / 14),
335
+ width: "100%",
336
+ tableLayout: "auto",
337
+ marginTop: em(32, 16),
338
+ marginBottom: em(32, 16)
339
+ },
340
+ "thead th": {
341
+ color: "var(--tw-prose-headings)",
342
+ fontWeight: "600"
343
+ },
344
+ figure: {
345
+ marginTop: em(32, 16),
346
+ marginBottom: em(32, 16)
347
+ },
348
+ "figure > *": {
349
+ marginTop: "0",
350
+ marginBottom: "0"
351
+ },
352
+ figcaption: {
353
+ color: "var(--tw-prose-captions)",
354
+ fontSize: em(14, 16),
355
+ lineHeight: round(20 / 14),
356
+ marginTop: em(12, 14)
357
+ },
358
+ "a:not([data-card])": {
359
+ color: "var(--tw-prose-links)",
360
+ transition: "opacity .2s",
361
+ fontWeight: "500",
362
+ textDecoration: "underline",
363
+ textUnderlineOffset: "3.5px",
364
+ textDecorationColor: "var(--color-fd-primary)",
365
+ textDecorationThickness: "1.5px"
366
+ },
367
+ "a:not([data-card]):hover": { opacity: "80%" }
368
+ },
369
+ colors,
370
+ {
371
+ "> :first-child": { marginTop: "0" },
372
+ "> :last-child": { marginBottom: "0" }
373
+ }
374
+ ] };
375
+
376
+ //#endregion
377
+ //#region ../../node_modules/.pnpm/lodash.merge@4.6.2/node_modules/lodash.merge/index.js
378
+ var require_lodash_merge = /* @__PURE__ */ __commonJSMin(((exports, module) => {
379
+ /**
380
+ * Lodash (Custom Build) <https://lodash.com/>
381
+ * Build: `lodash modularize exports="npm" -o ./`
382
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
383
+ * Released under MIT license <https://lodash.com/license>
384
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
385
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
386
+ */
387
+ /** Used as the size to enable large array optimizations. */
388
+ var LARGE_ARRAY_SIZE = 200;
389
+ /** Used to stand-in for `undefined` hash values. */
390
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
391
+ /** Used to detect hot functions by number of calls within a span of milliseconds. */
392
+ var HOT_COUNT = 800, HOT_SPAN = 16;
393
+ /** Used as references for various `Number` constants. */
394
+ var MAX_SAFE_INTEGER = 9007199254740991;
395
+ /** `Object#toString` result references. */
396
+ var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]";
397
+ var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
398
+ /**
399
+ * Used to match `RegExp`
400
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
401
+ */
402
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
403
+ /** Used to detect host constructors (Safari). */
404
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
405
+ /** Used to detect unsigned integer values. */
406
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
407
+ /** Used to identify `toStringTag` values of typed arrays. */
408
+ var typedArrayTags = {};
409
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
410
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
411
+ /** Detect free variable `global` from Node.js. */
412
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
413
+ /** Detect free variable `self`. */
414
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
415
+ /** Used as a reference to the global object. */
416
+ var root = freeGlobal || freeSelf || Function("return this")();
417
+ /** Detect free variable `exports`. */
418
+ var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
419
+ /** Detect free variable `module`. */
420
+ var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module;
421
+ /** Detect the popular CommonJS extension `module.exports`. */
422
+ var moduleExports = freeModule && freeModule.exports === freeExports;
423
+ /** Detect free variable `process` from Node.js. */
424
+ var freeProcess = moduleExports && freeGlobal.process;
425
+ /** Used to access faster Node.js helpers. */
426
+ var nodeUtil = function() {
427
+ try {
428
+ var types = freeModule && freeModule.require && freeModule.require("util").types;
429
+ if (types) return types;
430
+ return freeProcess && freeProcess.binding && freeProcess.binding("util");
431
+ } catch (e) {}
432
+ }();
433
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
434
+ /**
435
+ * A faster alternative to `Function#apply`, this function invokes `func`
436
+ * with the `this` binding of `thisArg` and the arguments of `args`.
437
+ *
438
+ * @private
439
+ * @param {Function} func The function to invoke.
440
+ * @param {*} thisArg The `this` binding of `func`.
441
+ * @param {Array} args The arguments to invoke `func` with.
442
+ * @returns {*} Returns the result of `func`.
443
+ */
444
+ function apply(func, thisArg, args) {
445
+ switch (args.length) {
446
+ case 0: return func.call(thisArg);
447
+ case 1: return func.call(thisArg, args[0]);
448
+ case 2: return func.call(thisArg, args[0], args[1]);
449
+ case 3: return func.call(thisArg, args[0], args[1], args[2]);
450
+ }
451
+ return func.apply(thisArg, args);
452
+ }
453
+ /**
454
+ * The base implementation of `_.times` without support for iteratee shorthands
455
+ * or max array length checks.
456
+ *
457
+ * @private
458
+ * @param {number} n The number of times to invoke `iteratee`.
459
+ * @param {Function} iteratee The function invoked per iteration.
460
+ * @returns {Array} Returns the array of results.
461
+ */
462
+ function baseTimes(n, iteratee) {
463
+ var index = -1, result = Array(n);
464
+ while (++index < n) result[index] = iteratee(index);
465
+ return result;
466
+ }
467
+ /**
468
+ * The base implementation of `_.unary` without support for storing metadata.
469
+ *
470
+ * @private
471
+ * @param {Function} func The function to cap arguments for.
472
+ * @returns {Function} Returns the new capped function.
473
+ */
474
+ function baseUnary(func) {
475
+ return function(value) {
476
+ return func(value);
477
+ };
478
+ }
479
+ /**
480
+ * Gets the value at `key` of `object`.
481
+ *
482
+ * @private
483
+ * @param {Object} [object] The object to query.
484
+ * @param {string} key The key of the property to get.
485
+ * @returns {*} Returns the property value.
486
+ */
487
+ function getValue(object, key) {
488
+ return object == null ? void 0 : object[key];
489
+ }
490
+ /**
491
+ * Creates a unary function that invokes `func` with its argument transformed.
492
+ *
493
+ * @private
494
+ * @param {Function} func The function to wrap.
495
+ * @param {Function} transform The argument transform.
496
+ * @returns {Function} Returns the new function.
497
+ */
498
+ function overArg(func, transform) {
499
+ return function(arg) {
500
+ return func(transform(arg));
501
+ };
502
+ }
503
+ /** Used for built-in method references. */
504
+ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
505
+ /** Used to detect overreaching core-js shims. */
506
+ var coreJsData = root["__core-js_shared__"];
507
+ /** Used to resolve the decompiled source of functions. */
508
+ var funcToString = funcProto.toString;
509
+ /** Used to check objects for own properties. */
510
+ var hasOwnProperty = objectProto.hasOwnProperty;
511
+ /** Used to detect methods masquerading as native. */
512
+ var maskSrcKey = function() {
513
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
514
+ return uid ? "Symbol(src)_1." + uid : "";
515
+ }();
516
+ /**
517
+ * Used to resolve the
518
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
519
+ * of values.
520
+ */
521
+ var nativeObjectToString = objectProto.toString;
522
+ /** Used to infer the `Object` constructor. */
523
+ var objectCtorString = funcToString.call(Object);
524
+ /** Used to detect if a method is native. */
525
+ var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
526
+ /** Built-in value references. */
527
+ var Buffer = moduleExports ? root.Buffer : void 0, Symbol = root.Symbol, Uint8Array = root.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : void 0, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, symToStringTag = Symbol ? Symbol.toStringTag : void 0;
528
+ var defineProperty = function() {
529
+ try {
530
+ var func = getNative(Object, "defineProperty");
531
+ func({}, "", {});
532
+ return func;
533
+ } catch (e) {}
534
+ }();
535
+ var nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0, nativeMax = Math.max, nativeNow = Date.now;
536
+ var Map = getNative(root, "Map"), nativeCreate = getNative(Object, "create");
537
+ /**
538
+ * The base implementation of `_.create` without support for assigning
539
+ * properties to the created object.
540
+ *
541
+ * @private
542
+ * @param {Object} proto The object to inherit from.
543
+ * @returns {Object} Returns the new object.
544
+ */
545
+ var baseCreate = function() {
546
+ function object() {}
547
+ return function(proto) {
548
+ if (!isObject(proto)) return {};
549
+ if (objectCreate) return objectCreate(proto);
550
+ object.prototype = proto;
551
+ var result = new object();
552
+ object.prototype = void 0;
553
+ return result;
554
+ };
555
+ }();
556
+ /**
557
+ * Creates a hash object.
558
+ *
559
+ * @private
560
+ * @constructor
561
+ * @param {Array} [entries] The key-value pairs to cache.
562
+ */
563
+ function Hash(entries) {
564
+ var index = -1, length = entries == null ? 0 : entries.length;
565
+ this.clear();
566
+ while (++index < length) {
567
+ var entry = entries[index];
568
+ this.set(entry[0], entry[1]);
569
+ }
570
+ }
571
+ /**
572
+ * Removes all key-value entries from the hash.
573
+ *
574
+ * @private
575
+ * @name clear
576
+ * @memberOf Hash
577
+ */
578
+ function hashClear() {
579
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
580
+ this.size = 0;
581
+ }
582
+ /**
583
+ * Removes `key` and its value from the hash.
584
+ *
585
+ * @private
586
+ * @name delete
587
+ * @memberOf Hash
588
+ * @param {Object} hash The hash to modify.
589
+ * @param {string} key The key of the value to remove.
590
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
591
+ */
592
+ function hashDelete(key) {
593
+ var result = this.has(key) && delete this.__data__[key];
594
+ this.size -= result ? 1 : 0;
595
+ return result;
596
+ }
597
+ /**
598
+ * Gets the hash value for `key`.
599
+ *
600
+ * @private
601
+ * @name get
602
+ * @memberOf Hash
603
+ * @param {string} key The key of the value to get.
604
+ * @returns {*} Returns the entry value.
605
+ */
606
+ function hashGet(key) {
607
+ var data = this.__data__;
608
+ if (nativeCreate) {
609
+ var result = data[key];
610
+ return result === HASH_UNDEFINED ? void 0 : result;
611
+ }
612
+ return hasOwnProperty.call(data, key) ? data[key] : void 0;
613
+ }
614
+ /**
615
+ * Checks if a hash value for `key` exists.
616
+ *
617
+ * @private
618
+ * @name has
619
+ * @memberOf Hash
620
+ * @param {string} key The key of the entry to check.
621
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
622
+ */
623
+ function hashHas(key) {
624
+ var data = this.__data__;
625
+ return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
626
+ }
627
+ /**
628
+ * Sets the hash `key` to `value`.
629
+ *
630
+ * @private
631
+ * @name set
632
+ * @memberOf Hash
633
+ * @param {string} key The key of the value to set.
634
+ * @param {*} value The value to set.
635
+ * @returns {Object} Returns the hash instance.
636
+ */
637
+ function hashSet(key, value) {
638
+ var data = this.__data__;
639
+ this.size += this.has(key) ? 0 : 1;
640
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
641
+ return this;
642
+ }
643
+ Hash.prototype.clear = hashClear;
644
+ Hash.prototype["delete"] = hashDelete;
645
+ Hash.prototype.get = hashGet;
646
+ Hash.prototype.has = hashHas;
647
+ Hash.prototype.set = hashSet;
648
+ /**
649
+ * Creates an list cache object.
650
+ *
651
+ * @private
652
+ * @constructor
653
+ * @param {Array} [entries] The key-value pairs to cache.
654
+ */
655
+ function ListCache(entries) {
656
+ var index = -1, length = entries == null ? 0 : entries.length;
657
+ this.clear();
658
+ while (++index < length) {
659
+ var entry = entries[index];
660
+ this.set(entry[0], entry[1]);
661
+ }
662
+ }
663
+ /**
664
+ * Removes all key-value entries from the list cache.
665
+ *
666
+ * @private
667
+ * @name clear
668
+ * @memberOf ListCache
669
+ */
670
+ function listCacheClear() {
671
+ this.__data__ = [];
672
+ this.size = 0;
673
+ }
674
+ /**
675
+ * Removes `key` and its value from the list cache.
676
+ *
677
+ * @private
678
+ * @name delete
679
+ * @memberOf ListCache
680
+ * @param {string} key The key of the value to remove.
681
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
682
+ */
683
+ function listCacheDelete(key) {
684
+ var data = this.__data__, index = assocIndexOf(data, key);
685
+ if (index < 0) return false;
686
+ if (index == data.length - 1) data.pop();
687
+ else splice.call(data, index, 1);
688
+ --this.size;
689
+ return true;
690
+ }
691
+ /**
692
+ * Gets the list cache value for `key`.
693
+ *
694
+ * @private
695
+ * @name get
696
+ * @memberOf ListCache
697
+ * @param {string} key The key of the value to get.
698
+ * @returns {*} Returns the entry value.
699
+ */
700
+ function listCacheGet(key) {
701
+ var data = this.__data__, index = assocIndexOf(data, key);
702
+ return index < 0 ? void 0 : data[index][1];
703
+ }
704
+ /**
705
+ * Checks if a list cache value for `key` exists.
706
+ *
707
+ * @private
708
+ * @name has
709
+ * @memberOf ListCache
710
+ * @param {string} key The key of the entry to check.
711
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
712
+ */
713
+ function listCacheHas(key) {
714
+ return assocIndexOf(this.__data__, key) > -1;
715
+ }
716
+ /**
717
+ * Sets the list cache `key` to `value`.
718
+ *
719
+ * @private
720
+ * @name set
721
+ * @memberOf ListCache
722
+ * @param {string} key The key of the value to set.
723
+ * @param {*} value The value to set.
724
+ * @returns {Object} Returns the list cache instance.
725
+ */
726
+ function listCacheSet(key, value) {
727
+ var data = this.__data__, index = assocIndexOf(data, key);
728
+ if (index < 0) {
729
+ ++this.size;
730
+ data.push([key, value]);
731
+ } else data[index][1] = value;
732
+ return this;
733
+ }
734
+ ListCache.prototype.clear = listCacheClear;
735
+ ListCache.prototype["delete"] = listCacheDelete;
736
+ ListCache.prototype.get = listCacheGet;
737
+ ListCache.prototype.has = listCacheHas;
738
+ ListCache.prototype.set = listCacheSet;
739
+ /**
740
+ * Creates a map cache object to store key-value pairs.
741
+ *
742
+ * @private
743
+ * @constructor
744
+ * @param {Array} [entries] The key-value pairs to cache.
745
+ */
746
+ function MapCache(entries) {
747
+ var index = -1, length = entries == null ? 0 : entries.length;
748
+ this.clear();
749
+ while (++index < length) {
750
+ var entry = entries[index];
751
+ this.set(entry[0], entry[1]);
752
+ }
753
+ }
754
+ /**
755
+ * Removes all key-value entries from the map.
756
+ *
757
+ * @private
758
+ * @name clear
759
+ * @memberOf MapCache
760
+ */
761
+ function mapCacheClear() {
762
+ this.size = 0;
763
+ this.__data__ = {
764
+ "hash": new Hash(),
765
+ "map": new (Map || ListCache)(),
766
+ "string": new Hash()
767
+ };
768
+ }
769
+ /**
770
+ * Removes `key` and its value from the map.
771
+ *
772
+ * @private
773
+ * @name delete
774
+ * @memberOf MapCache
775
+ * @param {string} key The key of the value to remove.
776
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
777
+ */
778
+ function mapCacheDelete(key) {
779
+ var result = getMapData(this, key)["delete"](key);
780
+ this.size -= result ? 1 : 0;
781
+ return result;
782
+ }
783
+ /**
784
+ * Gets the map value for `key`.
785
+ *
786
+ * @private
787
+ * @name get
788
+ * @memberOf MapCache
789
+ * @param {string} key The key of the value to get.
790
+ * @returns {*} Returns the entry value.
791
+ */
792
+ function mapCacheGet(key) {
793
+ return getMapData(this, key).get(key);
794
+ }
795
+ /**
796
+ * Checks if a map value for `key` exists.
797
+ *
798
+ * @private
799
+ * @name has
800
+ * @memberOf MapCache
801
+ * @param {string} key The key of the entry to check.
802
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
803
+ */
804
+ function mapCacheHas(key) {
805
+ return getMapData(this, key).has(key);
806
+ }
807
+ /**
808
+ * Sets the map `key` to `value`.
809
+ *
810
+ * @private
811
+ * @name set
812
+ * @memberOf MapCache
813
+ * @param {string} key The key of the value to set.
814
+ * @param {*} value The value to set.
815
+ * @returns {Object} Returns the map cache instance.
816
+ */
817
+ function mapCacheSet(key, value) {
818
+ var data = getMapData(this, key), size = data.size;
819
+ data.set(key, value);
820
+ this.size += data.size == size ? 0 : 1;
821
+ return this;
822
+ }
823
+ MapCache.prototype.clear = mapCacheClear;
824
+ MapCache.prototype["delete"] = mapCacheDelete;
825
+ MapCache.prototype.get = mapCacheGet;
826
+ MapCache.prototype.has = mapCacheHas;
827
+ MapCache.prototype.set = mapCacheSet;
828
+ /**
829
+ * Creates a stack cache object to store key-value pairs.
830
+ *
831
+ * @private
832
+ * @constructor
833
+ * @param {Array} [entries] The key-value pairs to cache.
834
+ */
835
+ function Stack(entries) {
836
+ this.size = (this.__data__ = new ListCache(entries)).size;
837
+ }
838
+ /**
839
+ * Removes all key-value entries from the stack.
840
+ *
841
+ * @private
842
+ * @name clear
843
+ * @memberOf Stack
844
+ */
845
+ function stackClear() {
846
+ this.__data__ = new ListCache();
847
+ this.size = 0;
848
+ }
849
+ /**
850
+ * Removes `key` and its value from the stack.
851
+ *
852
+ * @private
853
+ * @name delete
854
+ * @memberOf Stack
855
+ * @param {string} key The key of the value to remove.
856
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
857
+ */
858
+ function stackDelete(key) {
859
+ var data = this.__data__, result = data["delete"](key);
860
+ this.size = data.size;
861
+ return result;
862
+ }
863
+ /**
864
+ * Gets the stack value for `key`.
865
+ *
866
+ * @private
867
+ * @name get
868
+ * @memberOf Stack
869
+ * @param {string} key The key of the value to get.
870
+ * @returns {*} Returns the entry value.
871
+ */
872
+ function stackGet(key) {
873
+ return this.__data__.get(key);
874
+ }
875
+ /**
876
+ * Checks if a stack value for `key` exists.
877
+ *
878
+ * @private
879
+ * @name has
880
+ * @memberOf Stack
881
+ * @param {string} key The key of the entry to check.
882
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
883
+ */
884
+ function stackHas(key) {
885
+ return this.__data__.has(key);
886
+ }
887
+ /**
888
+ * Sets the stack `key` to `value`.
889
+ *
890
+ * @private
891
+ * @name set
892
+ * @memberOf Stack
893
+ * @param {string} key The key of the value to set.
894
+ * @param {*} value The value to set.
895
+ * @returns {Object} Returns the stack cache instance.
896
+ */
897
+ function stackSet(key, value) {
898
+ var data = this.__data__;
899
+ if (data instanceof ListCache) {
900
+ var pairs = data.__data__;
901
+ if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
902
+ pairs.push([key, value]);
903
+ this.size = ++data.size;
904
+ return this;
905
+ }
906
+ data = this.__data__ = new MapCache(pairs);
907
+ }
908
+ data.set(key, value);
909
+ this.size = data.size;
910
+ return this;
911
+ }
912
+ Stack.prototype.clear = stackClear;
913
+ Stack.prototype["delete"] = stackDelete;
914
+ Stack.prototype.get = stackGet;
915
+ Stack.prototype.has = stackHas;
916
+ Stack.prototype.set = stackSet;
917
+ /**
918
+ * Creates an array of the enumerable property names of the array-like `value`.
919
+ *
920
+ * @private
921
+ * @param {*} value The value to query.
922
+ * @param {boolean} inherited Specify returning inherited property names.
923
+ * @returns {Array} Returns the array of property names.
924
+ */
925
+ function arrayLikeKeys(value, inherited) {
926
+ var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
927
+ for (var key in value) if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isBuff && (key == "offset" || key == "parent") || isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || isIndex(key, length)))) result.push(key);
928
+ return result;
929
+ }
930
+ /**
931
+ * This function is like `assignValue` except that it doesn't assign
932
+ * `undefined` values.
933
+ *
934
+ * @private
935
+ * @param {Object} object The object to modify.
936
+ * @param {string} key The key of the property to assign.
937
+ * @param {*} value The value to assign.
938
+ */
939
+ function assignMergeValue(object, key, value) {
940
+ if (value !== void 0 && !eq(object[key], value) || value === void 0 && !(key in object)) baseAssignValue(object, key, value);
941
+ }
942
+ /**
943
+ * Assigns `value` to `key` of `object` if the existing value is not equivalent
944
+ * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
945
+ * for equality comparisons.
946
+ *
947
+ * @private
948
+ * @param {Object} object The object to modify.
949
+ * @param {string} key The key of the property to assign.
950
+ * @param {*} value The value to assign.
951
+ */
952
+ function assignValue(object, key, value) {
953
+ var objValue = object[key];
954
+ if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) baseAssignValue(object, key, value);
955
+ }
956
+ /**
957
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
958
+ *
959
+ * @private
960
+ * @param {Array} array The array to inspect.
961
+ * @param {*} key The key to search for.
962
+ * @returns {number} Returns the index of the matched value, else `-1`.
963
+ */
964
+ function assocIndexOf(array, key) {
965
+ var length = array.length;
966
+ while (length--) if (eq(array[length][0], key)) return length;
967
+ return -1;
968
+ }
969
+ /**
970
+ * The base implementation of `assignValue` and `assignMergeValue` without
971
+ * value checks.
972
+ *
973
+ * @private
974
+ * @param {Object} object The object to modify.
975
+ * @param {string} key The key of the property to assign.
976
+ * @param {*} value The value to assign.
977
+ */
978
+ function baseAssignValue(object, key, value) {
979
+ if (key == "__proto__" && defineProperty) defineProperty(object, key, {
980
+ "configurable": true,
981
+ "enumerable": true,
982
+ "value": value,
983
+ "writable": true
984
+ });
985
+ else object[key] = value;
986
+ }
987
+ /**
988
+ * The base implementation of `baseForOwn` which iterates over `object`
989
+ * properties returned by `keysFunc` and invokes `iteratee` for each property.
990
+ * Iteratee functions may exit iteration early by explicitly returning `false`.
991
+ *
992
+ * @private
993
+ * @param {Object} object The object to iterate over.
994
+ * @param {Function} iteratee The function invoked per iteration.
995
+ * @param {Function} keysFunc The function to get the keys of `object`.
996
+ * @returns {Object} Returns `object`.
997
+ */
998
+ var baseFor = createBaseFor();
999
+ /**
1000
+ * The base implementation of `getTag` without fallbacks for buggy environments.
1001
+ *
1002
+ * @private
1003
+ * @param {*} value The value to query.
1004
+ * @returns {string} Returns the `toStringTag`.
1005
+ */
1006
+ function baseGetTag(value) {
1007
+ if (value == null) return value === void 0 ? undefinedTag : nullTag;
1008
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
1009
+ }
1010
+ /**
1011
+ * The base implementation of `_.isArguments`.
1012
+ *
1013
+ * @private
1014
+ * @param {*} value The value to check.
1015
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1016
+ */
1017
+ function baseIsArguments(value) {
1018
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
1019
+ }
1020
+ /**
1021
+ * The base implementation of `_.isNative` without bad shim checks.
1022
+ *
1023
+ * @private
1024
+ * @param {*} value The value to check.
1025
+ * @returns {boolean} Returns `true` if `value` is a native function,
1026
+ * else `false`.
1027
+ */
1028
+ function baseIsNative(value) {
1029
+ if (!isObject(value) || isMasked(value)) return false;
1030
+ return (isFunction(value) ? reIsNative : reIsHostCtor).test(toSource(value));
1031
+ }
1032
+ /**
1033
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
1034
+ *
1035
+ * @private
1036
+ * @param {*} value The value to check.
1037
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1038
+ */
1039
+ function baseIsTypedArray(value) {
1040
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
1041
+ }
1042
+ /**
1043
+ * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
1044
+ *
1045
+ * @private
1046
+ * @param {Object} object The object to query.
1047
+ * @returns {Array} Returns the array of property names.
1048
+ */
1049
+ function baseKeysIn(object) {
1050
+ if (!isObject(object)) return nativeKeysIn(object);
1051
+ var isProto = isPrototype(object), result = [];
1052
+ for (var key in object) if (!(key == "constructor" && (isProto || !hasOwnProperty.call(object, key)))) result.push(key);
1053
+ return result;
1054
+ }
1055
+ /**
1056
+ * The base implementation of `_.merge` without support for multiple sources.
1057
+ *
1058
+ * @private
1059
+ * @param {Object} object The destination object.
1060
+ * @param {Object} source The source object.
1061
+ * @param {number} srcIndex The index of `source`.
1062
+ * @param {Function} [customizer] The function to customize merged values.
1063
+ * @param {Object} [stack] Tracks traversed source values and their merged
1064
+ * counterparts.
1065
+ */
1066
+ function baseMerge(object, source, srcIndex, customizer, stack) {
1067
+ if (object === source) return;
1068
+ baseFor(source, function(srcValue, key) {
1069
+ stack || (stack = new Stack());
1070
+ if (isObject(srcValue)) baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
1071
+ else {
1072
+ var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : void 0;
1073
+ if (newValue === void 0) newValue = srcValue;
1074
+ assignMergeValue(object, key, newValue);
1075
+ }
1076
+ }, keysIn);
1077
+ }
1078
+ /**
1079
+ * A specialized version of `baseMerge` for arrays and objects which performs
1080
+ * deep merges and tracks traversed objects enabling objects with circular
1081
+ * references to be merged.
1082
+ *
1083
+ * @private
1084
+ * @param {Object} object The destination object.
1085
+ * @param {Object} source The source object.
1086
+ * @param {string} key The key of the value to merge.
1087
+ * @param {number} srcIndex The index of `source`.
1088
+ * @param {Function} mergeFunc The function to merge values.
1089
+ * @param {Function} [customizer] The function to customize assigned values.
1090
+ * @param {Object} [stack] Tracks traversed source values and their merged
1091
+ * counterparts.
1092
+ */
1093
+ function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
1094
+ var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue);
1095
+ if (stacked) {
1096
+ assignMergeValue(object, key, stacked);
1097
+ return;
1098
+ }
1099
+ var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : void 0;
1100
+ var isCommon = newValue === void 0;
1101
+ if (isCommon) {
1102
+ var isArr = isArray(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue);
1103
+ newValue = srcValue;
1104
+ if (isArr || isBuff || isTyped) if (isArray(objValue)) newValue = objValue;
1105
+ else if (isArrayLikeObject(objValue)) newValue = copyArray(objValue);
1106
+ else if (isBuff) {
1107
+ isCommon = false;
1108
+ newValue = cloneBuffer(srcValue, true);
1109
+ } else if (isTyped) {
1110
+ isCommon = false;
1111
+ newValue = cloneTypedArray(srcValue, true);
1112
+ } else newValue = [];
1113
+ else if (isPlainObject(srcValue) || isArguments(srcValue)) {
1114
+ newValue = objValue;
1115
+ if (isArguments(objValue)) newValue = toPlainObject(objValue);
1116
+ else if (!isObject(objValue) || isFunction(objValue)) newValue = initCloneObject(srcValue);
1117
+ } else isCommon = false;
1118
+ }
1119
+ if (isCommon) {
1120
+ stack.set(srcValue, newValue);
1121
+ mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
1122
+ stack["delete"](srcValue);
1123
+ }
1124
+ assignMergeValue(object, key, newValue);
1125
+ }
1126
+ /**
1127
+ * The base implementation of `_.rest` which doesn't validate or coerce arguments.
1128
+ *
1129
+ * @private
1130
+ * @param {Function} func The function to apply a rest parameter to.
1131
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
1132
+ * @returns {Function} Returns the new function.
1133
+ */
1134
+ function baseRest(func, start) {
1135
+ return setToString(overRest(func, start, identity), func + "");
1136
+ }
1137
+ /**
1138
+ * The base implementation of `setToString` without support for hot loop shorting.
1139
+ *
1140
+ * @private
1141
+ * @param {Function} func The function to modify.
1142
+ * @param {Function} string The `toString` result.
1143
+ * @returns {Function} Returns `func`.
1144
+ */
1145
+ var baseSetToString = !defineProperty ? identity : function(func, string) {
1146
+ return defineProperty(func, "toString", {
1147
+ "configurable": true,
1148
+ "enumerable": false,
1149
+ "value": constant(string),
1150
+ "writable": true
1151
+ });
1152
+ };
1153
+ /**
1154
+ * Creates a clone of `buffer`.
1155
+ *
1156
+ * @private
1157
+ * @param {Buffer} buffer The buffer to clone.
1158
+ * @param {boolean} [isDeep] Specify a deep clone.
1159
+ * @returns {Buffer} Returns the cloned buffer.
1160
+ */
1161
+ function cloneBuffer(buffer, isDeep) {
1162
+ if (isDeep) return buffer.slice();
1163
+ var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
1164
+ buffer.copy(result);
1165
+ return result;
1166
+ }
1167
+ /**
1168
+ * Creates a clone of `arrayBuffer`.
1169
+ *
1170
+ * @private
1171
+ * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
1172
+ * @returns {ArrayBuffer} Returns the cloned array buffer.
1173
+ */
1174
+ function cloneArrayBuffer(arrayBuffer) {
1175
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
1176
+ new Uint8Array(result).set(new Uint8Array(arrayBuffer));
1177
+ return result;
1178
+ }
1179
+ /**
1180
+ * Creates a clone of `typedArray`.
1181
+ *
1182
+ * @private
1183
+ * @param {Object} typedArray The typed array to clone.
1184
+ * @param {boolean} [isDeep] Specify a deep clone.
1185
+ * @returns {Object} Returns the cloned typed array.
1186
+ */
1187
+ function cloneTypedArray(typedArray, isDeep) {
1188
+ var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
1189
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
1190
+ }
1191
+ /**
1192
+ * Copies the values of `source` to `array`.
1193
+ *
1194
+ * @private
1195
+ * @param {Array} source The array to copy values from.
1196
+ * @param {Array} [array=[]] The array to copy values to.
1197
+ * @returns {Array} Returns `array`.
1198
+ */
1199
+ function copyArray(source, array) {
1200
+ var index = -1, length = source.length;
1201
+ array || (array = Array(length));
1202
+ while (++index < length) array[index] = source[index];
1203
+ return array;
1204
+ }
1205
+ /**
1206
+ * Copies properties of `source` to `object`.
1207
+ *
1208
+ * @private
1209
+ * @param {Object} source The object to copy properties from.
1210
+ * @param {Array} props The property identifiers to copy.
1211
+ * @param {Object} [object={}] The object to copy properties to.
1212
+ * @param {Function} [customizer] The function to customize copied values.
1213
+ * @returns {Object} Returns `object`.
1214
+ */
1215
+ function copyObject(source, props, object, customizer) {
1216
+ var isNew = !object;
1217
+ object || (object = {});
1218
+ var index = -1, length = props.length;
1219
+ while (++index < length) {
1220
+ var key = props[index];
1221
+ var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
1222
+ if (newValue === void 0) newValue = source[key];
1223
+ if (isNew) baseAssignValue(object, key, newValue);
1224
+ else assignValue(object, key, newValue);
1225
+ }
1226
+ return object;
1227
+ }
1228
+ /**
1229
+ * Creates a function like `_.assign`.
1230
+ *
1231
+ * @private
1232
+ * @param {Function} assigner The function to assign values.
1233
+ * @returns {Function} Returns the new assigner function.
1234
+ */
1235
+ function createAssigner(assigner) {
1236
+ return baseRest(function(object, sources) {
1237
+ var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
1238
+ customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
1239
+ if (guard && isIterateeCall(sources[0], sources[1], guard)) {
1240
+ customizer = length < 3 ? void 0 : customizer;
1241
+ length = 1;
1242
+ }
1243
+ object = Object(object);
1244
+ while (++index < length) {
1245
+ var source = sources[index];
1246
+ if (source) assigner(object, source, index, customizer);
1247
+ }
1248
+ return object;
1249
+ });
1250
+ }
1251
+ /**
1252
+ * Creates a base function for methods like `_.forIn` and `_.forOwn`.
1253
+ *
1254
+ * @private
1255
+ * @param {boolean} [fromRight] Specify iterating from right to left.
1256
+ * @returns {Function} Returns the new base function.
1257
+ */
1258
+ function createBaseFor(fromRight) {
1259
+ return function(object, iteratee, keysFunc) {
1260
+ var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length;
1261
+ while (length--) {
1262
+ var key = props[fromRight ? length : ++index];
1263
+ if (iteratee(iterable[key], key, iterable) === false) break;
1264
+ }
1265
+ return object;
1266
+ };
1267
+ }
1268
+ /**
1269
+ * Gets the data for `map`.
1270
+ *
1271
+ * @private
1272
+ * @param {Object} map The map to query.
1273
+ * @param {string} key The reference key.
1274
+ * @returns {*} Returns the map data.
1275
+ */
1276
+ function getMapData(map, key) {
1277
+ var data = map.__data__;
1278
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
1279
+ }
1280
+ /**
1281
+ * Gets the native function at `key` of `object`.
1282
+ *
1283
+ * @private
1284
+ * @param {Object} object The object to query.
1285
+ * @param {string} key The key of the method to get.
1286
+ * @returns {*} Returns the function if it's native, else `undefined`.
1287
+ */
1288
+ function getNative(object, key) {
1289
+ var value = getValue(object, key);
1290
+ return baseIsNative(value) ? value : void 0;
1291
+ }
1292
+ /**
1293
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
1294
+ *
1295
+ * @private
1296
+ * @param {*} value The value to query.
1297
+ * @returns {string} Returns the raw `toStringTag`.
1298
+ */
1299
+ function getRawTag(value) {
1300
+ var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
1301
+ try {
1302
+ value[symToStringTag] = void 0;
1303
+ var unmasked = true;
1304
+ } catch (e) {}
1305
+ var result = nativeObjectToString.call(value);
1306
+ if (unmasked) if (isOwn) value[symToStringTag] = tag;
1307
+ else delete value[symToStringTag];
1308
+ return result;
1309
+ }
1310
+ /**
1311
+ * Initializes an object clone.
1312
+ *
1313
+ * @private
1314
+ * @param {Object} object The object to clone.
1315
+ * @returns {Object} Returns the initialized clone.
1316
+ */
1317
+ function initCloneObject(object) {
1318
+ return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
1319
+ }
1320
+ /**
1321
+ * Checks if `value` is a valid array-like index.
1322
+ *
1323
+ * @private
1324
+ * @param {*} value The value to check.
1325
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1326
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1327
+ */
1328
+ function isIndex(value, length) {
1329
+ var type = typeof value;
1330
+ length = length == null ? MAX_SAFE_INTEGER : length;
1331
+ return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
1332
+ }
1333
+ /**
1334
+ * Checks if the given arguments are from an iteratee call.
1335
+ *
1336
+ * @private
1337
+ * @param {*} value The potential iteratee value argument.
1338
+ * @param {*} index The potential iteratee index or key argument.
1339
+ * @param {*} object The potential iteratee object argument.
1340
+ * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
1341
+ * else `false`.
1342
+ */
1343
+ function isIterateeCall(value, index, object) {
1344
+ if (!isObject(object)) return false;
1345
+ var type = typeof index;
1346
+ if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) return eq(object[index], value);
1347
+ return false;
1348
+ }
1349
+ /**
1350
+ * Checks if `value` is suitable for use as unique object key.
1351
+ *
1352
+ * @private
1353
+ * @param {*} value The value to check.
1354
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1355
+ */
1356
+ function isKeyable(value) {
1357
+ var type = typeof value;
1358
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
1359
+ }
1360
+ /**
1361
+ * Checks if `func` has its source masked.
1362
+ *
1363
+ * @private
1364
+ * @param {Function} func The function to check.
1365
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1366
+ */
1367
+ function isMasked(func) {
1368
+ return !!maskSrcKey && maskSrcKey in func;
1369
+ }
1370
+ /**
1371
+ * Checks if `value` is likely a prototype object.
1372
+ *
1373
+ * @private
1374
+ * @param {*} value The value to check.
1375
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1376
+ */
1377
+ function isPrototype(value) {
1378
+ var Ctor = value && value.constructor;
1379
+ return value === (typeof Ctor == "function" && Ctor.prototype || objectProto);
1380
+ }
1381
+ /**
1382
+ * This function is like
1383
+ * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1384
+ * except that it includes inherited enumerable properties.
1385
+ *
1386
+ * @private
1387
+ * @param {Object} object The object to query.
1388
+ * @returns {Array} Returns the array of property names.
1389
+ */
1390
+ function nativeKeysIn(object) {
1391
+ var result = [];
1392
+ if (object != null) for (var key in Object(object)) result.push(key);
1393
+ return result;
1394
+ }
1395
+ /**
1396
+ * Converts `value` to a string using `Object.prototype.toString`.
1397
+ *
1398
+ * @private
1399
+ * @param {*} value The value to convert.
1400
+ * @returns {string} Returns the converted string.
1401
+ */
1402
+ function objectToString(value) {
1403
+ return nativeObjectToString.call(value);
1404
+ }
1405
+ /**
1406
+ * A specialized version of `baseRest` which transforms the rest array.
1407
+ *
1408
+ * @private
1409
+ * @param {Function} func The function to apply a rest parameter to.
1410
+ * @param {number} [start=func.length-1] The start position of the rest parameter.
1411
+ * @param {Function} transform The rest array transform.
1412
+ * @returns {Function} Returns the new function.
1413
+ */
1414
+ function overRest(func, start, transform) {
1415
+ start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
1416
+ return function() {
1417
+ var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
1418
+ while (++index < length) array[index] = args[start + index];
1419
+ index = -1;
1420
+ var otherArgs = Array(start + 1);
1421
+ while (++index < start) otherArgs[index] = args[index];
1422
+ otherArgs[start] = transform(array);
1423
+ return apply(func, this, otherArgs);
1424
+ };
1425
+ }
1426
+ /**
1427
+ * Gets the value at `key`, unless `key` is "__proto__" or "constructor".
1428
+ *
1429
+ * @private
1430
+ * @param {Object} object The object to query.
1431
+ * @param {string} key The key of the property to get.
1432
+ * @returns {*} Returns the property value.
1433
+ */
1434
+ function safeGet(object, key) {
1435
+ if (key === "constructor" && typeof object[key] === "function") return;
1436
+ if (key == "__proto__") return;
1437
+ return object[key];
1438
+ }
1439
+ /**
1440
+ * Sets the `toString` method of `func` to return `string`.
1441
+ *
1442
+ * @private
1443
+ * @param {Function} func The function to modify.
1444
+ * @param {Function} string The `toString` result.
1445
+ * @returns {Function} Returns `func`.
1446
+ */
1447
+ var setToString = shortOut(baseSetToString);
1448
+ /**
1449
+ * Creates a function that'll short out and invoke `identity` instead
1450
+ * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
1451
+ * milliseconds.
1452
+ *
1453
+ * @private
1454
+ * @param {Function} func The function to restrict.
1455
+ * @returns {Function} Returns the new shortable function.
1456
+ */
1457
+ function shortOut(func) {
1458
+ var count = 0, lastCalled = 0;
1459
+ return function() {
1460
+ var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
1461
+ lastCalled = stamp;
1462
+ if (remaining > 0) {
1463
+ if (++count >= HOT_COUNT) return arguments[0];
1464
+ } else count = 0;
1465
+ return func.apply(void 0, arguments);
1466
+ };
1467
+ }
1468
+ /**
1469
+ * Converts `func` to its source code.
1470
+ *
1471
+ * @private
1472
+ * @param {Function} func The function to convert.
1473
+ * @returns {string} Returns the source code.
1474
+ */
1475
+ function toSource(func) {
1476
+ if (func != null) {
1477
+ try {
1478
+ return funcToString.call(func);
1479
+ } catch (e) {}
1480
+ try {
1481
+ return func + "";
1482
+ } catch (e) {}
1483
+ }
1484
+ return "";
1485
+ }
1486
+ /**
1487
+ * Performs a
1488
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1489
+ * comparison between two values to determine if they are equivalent.
1490
+ *
1491
+ * @static
1492
+ * @memberOf _
1493
+ * @since 4.0.0
1494
+ * @category Lang
1495
+ * @param {*} value The value to compare.
1496
+ * @param {*} other The other value to compare.
1497
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1498
+ * @example
1499
+ *
1500
+ * var object = { 'a': 1 };
1501
+ * var other = { 'a': 1 };
1502
+ *
1503
+ * _.eq(object, object);
1504
+ * // => true
1505
+ *
1506
+ * _.eq(object, other);
1507
+ * // => false
1508
+ *
1509
+ * _.eq('a', 'a');
1510
+ * // => true
1511
+ *
1512
+ * _.eq('a', Object('a'));
1513
+ * // => false
1514
+ *
1515
+ * _.eq(NaN, NaN);
1516
+ * // => true
1517
+ */
1518
+ function eq(value, other) {
1519
+ return value === other || value !== value && other !== other;
1520
+ }
1521
+ /**
1522
+ * Checks if `value` is likely an `arguments` object.
1523
+ *
1524
+ * @static
1525
+ * @memberOf _
1526
+ * @since 0.1.0
1527
+ * @category Lang
1528
+ * @param {*} value The value to check.
1529
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1530
+ * else `false`.
1531
+ * @example
1532
+ *
1533
+ * _.isArguments(function() { return arguments; }());
1534
+ * // => true
1535
+ *
1536
+ * _.isArguments([1, 2, 3]);
1537
+ * // => false
1538
+ */
1539
+ var isArguments = baseIsArguments(function() {
1540
+ return arguments;
1541
+ }()) ? baseIsArguments : function(value) {
1542
+ return isObjectLike(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
1543
+ };
1544
+ /**
1545
+ * Checks if `value` is classified as an `Array` object.
1546
+ *
1547
+ * @static
1548
+ * @memberOf _
1549
+ * @since 0.1.0
1550
+ * @category Lang
1551
+ * @param {*} value The value to check.
1552
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1553
+ * @example
1554
+ *
1555
+ * _.isArray([1, 2, 3]);
1556
+ * // => true
1557
+ *
1558
+ * _.isArray(document.body.children);
1559
+ * // => false
1560
+ *
1561
+ * _.isArray('abc');
1562
+ * // => false
1563
+ *
1564
+ * _.isArray(_.noop);
1565
+ * // => false
1566
+ */
1567
+ var isArray = Array.isArray;
1568
+ /**
1569
+ * Checks if `value` is array-like. A value is considered array-like if it's
1570
+ * not a function and has a `value.length` that's an integer greater than or
1571
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1572
+ *
1573
+ * @static
1574
+ * @memberOf _
1575
+ * @since 4.0.0
1576
+ * @category Lang
1577
+ * @param {*} value The value to check.
1578
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1579
+ * @example
1580
+ *
1581
+ * _.isArrayLike([1, 2, 3]);
1582
+ * // => true
1583
+ *
1584
+ * _.isArrayLike(document.body.children);
1585
+ * // => true
1586
+ *
1587
+ * _.isArrayLike('abc');
1588
+ * // => true
1589
+ *
1590
+ * _.isArrayLike(_.noop);
1591
+ * // => false
1592
+ */
1593
+ function isArrayLike(value) {
1594
+ return value != null && isLength(value.length) && !isFunction(value);
1595
+ }
1596
+ /**
1597
+ * This method is like `_.isArrayLike` except that it also checks if `value`
1598
+ * is an object.
1599
+ *
1600
+ * @static
1601
+ * @memberOf _
1602
+ * @since 4.0.0
1603
+ * @category Lang
1604
+ * @param {*} value The value to check.
1605
+ * @returns {boolean} Returns `true` if `value` is an array-like object,
1606
+ * else `false`.
1607
+ * @example
1608
+ *
1609
+ * _.isArrayLikeObject([1, 2, 3]);
1610
+ * // => true
1611
+ *
1612
+ * _.isArrayLikeObject(document.body.children);
1613
+ * // => true
1614
+ *
1615
+ * _.isArrayLikeObject('abc');
1616
+ * // => false
1617
+ *
1618
+ * _.isArrayLikeObject(_.noop);
1619
+ * // => false
1620
+ */
1621
+ function isArrayLikeObject(value) {
1622
+ return isObjectLike(value) && isArrayLike(value);
1623
+ }
1624
+ /**
1625
+ * Checks if `value` is a buffer.
1626
+ *
1627
+ * @static
1628
+ * @memberOf _
1629
+ * @since 4.3.0
1630
+ * @category Lang
1631
+ * @param {*} value The value to check.
1632
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1633
+ * @example
1634
+ *
1635
+ * _.isBuffer(new Buffer(2));
1636
+ * // => true
1637
+ *
1638
+ * _.isBuffer(new Uint8Array(2));
1639
+ * // => false
1640
+ */
1641
+ var isBuffer = nativeIsBuffer || stubFalse;
1642
+ /**
1643
+ * Checks if `value` is classified as a `Function` object.
1644
+ *
1645
+ * @static
1646
+ * @memberOf _
1647
+ * @since 0.1.0
1648
+ * @category Lang
1649
+ * @param {*} value The value to check.
1650
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
1651
+ * @example
1652
+ *
1653
+ * _.isFunction(_);
1654
+ * // => true
1655
+ *
1656
+ * _.isFunction(/abc/);
1657
+ * // => false
1658
+ */
1659
+ function isFunction(value) {
1660
+ if (!isObject(value)) return false;
1661
+ var tag = baseGetTag(value);
1662
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
1663
+ }
1664
+ /**
1665
+ * Checks if `value` is a valid array-like length.
1666
+ *
1667
+ * **Note:** This method is loosely based on
1668
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1669
+ *
1670
+ * @static
1671
+ * @memberOf _
1672
+ * @since 4.0.0
1673
+ * @category Lang
1674
+ * @param {*} value The value to check.
1675
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1676
+ * @example
1677
+ *
1678
+ * _.isLength(3);
1679
+ * // => true
1680
+ *
1681
+ * _.isLength(Number.MIN_VALUE);
1682
+ * // => false
1683
+ *
1684
+ * _.isLength(Infinity);
1685
+ * // => false
1686
+ *
1687
+ * _.isLength('3');
1688
+ * // => false
1689
+ */
1690
+ function isLength(value) {
1691
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1692
+ }
1693
+ /**
1694
+ * Checks if `value` is the
1695
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1696
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1697
+ *
1698
+ * @static
1699
+ * @memberOf _
1700
+ * @since 0.1.0
1701
+ * @category Lang
1702
+ * @param {*} value The value to check.
1703
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1704
+ * @example
1705
+ *
1706
+ * _.isObject({});
1707
+ * // => true
1708
+ *
1709
+ * _.isObject([1, 2, 3]);
1710
+ * // => true
1711
+ *
1712
+ * _.isObject(_.noop);
1713
+ * // => true
1714
+ *
1715
+ * _.isObject(null);
1716
+ * // => false
1717
+ */
1718
+ function isObject(value) {
1719
+ var type = typeof value;
1720
+ return value != null && (type == "object" || type == "function");
1721
+ }
1722
+ /**
1723
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
1724
+ * and has a `typeof` result of "object".
1725
+ *
1726
+ * @static
1727
+ * @memberOf _
1728
+ * @since 4.0.0
1729
+ * @category Lang
1730
+ * @param {*} value The value to check.
1731
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1732
+ * @example
1733
+ *
1734
+ * _.isObjectLike({});
1735
+ * // => true
1736
+ *
1737
+ * _.isObjectLike([1, 2, 3]);
1738
+ * // => true
1739
+ *
1740
+ * _.isObjectLike(_.noop);
1741
+ * // => false
1742
+ *
1743
+ * _.isObjectLike(null);
1744
+ * // => false
1745
+ */
1746
+ function isObjectLike(value) {
1747
+ return value != null && typeof value == "object";
1748
+ }
1749
+ /**
1750
+ * Checks if `value` is a plain object, that is, an object created by the
1751
+ * `Object` constructor or one with a `[[Prototype]]` of `null`.
1752
+ *
1753
+ * @static
1754
+ * @memberOf _
1755
+ * @since 0.8.0
1756
+ * @category Lang
1757
+ * @param {*} value The value to check.
1758
+ * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
1759
+ * @example
1760
+ *
1761
+ * function Foo() {
1762
+ * this.a = 1;
1763
+ * }
1764
+ *
1765
+ * _.isPlainObject(new Foo);
1766
+ * // => false
1767
+ *
1768
+ * _.isPlainObject([1, 2, 3]);
1769
+ * // => false
1770
+ *
1771
+ * _.isPlainObject({ 'x': 0, 'y': 0 });
1772
+ * // => true
1773
+ *
1774
+ * _.isPlainObject(Object.create(null));
1775
+ * // => true
1776
+ */
1777
+ function isPlainObject(value) {
1778
+ if (!isObjectLike(value) || baseGetTag(value) != objectTag) return false;
1779
+ var proto = getPrototype(value);
1780
+ if (proto === null) return true;
1781
+ var Ctor = hasOwnProperty.call(proto, "constructor") && proto.constructor;
1782
+ return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
1783
+ }
1784
+ /**
1785
+ * Checks if `value` is classified as a typed array.
1786
+ *
1787
+ * @static
1788
+ * @memberOf _
1789
+ * @since 3.0.0
1790
+ * @category Lang
1791
+ * @param {*} value The value to check.
1792
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1793
+ * @example
1794
+ *
1795
+ * _.isTypedArray(new Uint8Array);
1796
+ * // => true
1797
+ *
1798
+ * _.isTypedArray([]);
1799
+ * // => false
1800
+ */
1801
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
1802
+ /**
1803
+ * Converts `value` to a plain object flattening inherited enumerable string
1804
+ * keyed properties of `value` to own properties of the plain object.
1805
+ *
1806
+ * @static
1807
+ * @memberOf _
1808
+ * @since 3.0.0
1809
+ * @category Lang
1810
+ * @param {*} value The value to convert.
1811
+ * @returns {Object} Returns the converted plain object.
1812
+ * @example
1813
+ *
1814
+ * function Foo() {
1815
+ * this.b = 2;
1816
+ * }
1817
+ *
1818
+ * Foo.prototype.c = 3;
1819
+ *
1820
+ * _.assign({ 'a': 1 }, new Foo);
1821
+ * // => { 'a': 1, 'b': 2 }
1822
+ *
1823
+ * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
1824
+ * // => { 'a': 1, 'b': 2, 'c': 3 }
1825
+ */
1826
+ function toPlainObject(value) {
1827
+ return copyObject(value, keysIn(value));
1828
+ }
1829
+ /**
1830
+ * Creates an array of the own and inherited enumerable property names of `object`.
1831
+ *
1832
+ * **Note:** Non-object values are coerced to objects.
1833
+ *
1834
+ * @static
1835
+ * @memberOf _
1836
+ * @since 3.0.0
1837
+ * @category Object
1838
+ * @param {Object} object The object to query.
1839
+ * @returns {Array} Returns the array of property names.
1840
+ * @example
1841
+ *
1842
+ * function Foo() {
1843
+ * this.a = 1;
1844
+ * this.b = 2;
1845
+ * }
1846
+ *
1847
+ * Foo.prototype.c = 3;
1848
+ *
1849
+ * _.keysIn(new Foo);
1850
+ * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
1851
+ */
1852
+ function keysIn(object) {
1853
+ return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
1854
+ }
1855
+ /**
1856
+ * This method is like `_.assign` except that it recursively merges own and
1857
+ * inherited enumerable string keyed properties of source objects into the
1858
+ * destination object. Source properties that resolve to `undefined` are
1859
+ * skipped if a destination value exists. Array and plain object properties
1860
+ * are merged recursively. Other objects and value types are overridden by
1861
+ * assignment. Source objects are applied from left to right. Subsequent
1862
+ * sources overwrite property assignments of previous sources.
1863
+ *
1864
+ * **Note:** This method mutates `object`.
1865
+ *
1866
+ * @static
1867
+ * @memberOf _
1868
+ * @since 0.5.0
1869
+ * @category Object
1870
+ * @param {Object} object The destination object.
1871
+ * @param {...Object} [sources] The source objects.
1872
+ * @returns {Object} Returns `object`.
1873
+ * @example
1874
+ *
1875
+ * var object = {
1876
+ * 'a': [{ 'b': 2 }, { 'd': 4 }]
1877
+ * };
1878
+ *
1879
+ * var other = {
1880
+ * 'a': [{ 'c': 3 }, { 'e': 5 }]
1881
+ * };
1882
+ *
1883
+ * _.merge(object, other);
1884
+ * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
1885
+ */
1886
+ var merge = createAssigner(function(object, source, srcIndex) {
1887
+ baseMerge(object, source, srcIndex);
1888
+ });
1889
+ /**
1890
+ * Creates a function that returns `value`.
1891
+ *
1892
+ * @static
1893
+ * @memberOf _
1894
+ * @since 2.4.0
1895
+ * @category Util
1896
+ * @param {*} value The value to return from the new function.
1897
+ * @returns {Function} Returns the new constant function.
1898
+ * @example
1899
+ *
1900
+ * var objects = _.times(2, _.constant({ 'a': 1 }));
1901
+ *
1902
+ * console.log(objects);
1903
+ * // => [{ 'a': 1 }, { 'a': 1 }]
1904
+ *
1905
+ * console.log(objects[0] === objects[1]);
1906
+ * // => true
1907
+ */
1908
+ function constant(value) {
1909
+ return function() {
1910
+ return value;
1911
+ };
1912
+ }
1913
+ /**
1914
+ * This method returns the first argument it receives.
1915
+ *
1916
+ * @static
1917
+ * @since 0.1.0
1918
+ * @memberOf _
1919
+ * @category Util
1920
+ * @param {*} value Any value.
1921
+ * @returns {*} Returns `value`.
1922
+ * @example
1923
+ *
1924
+ * var object = { 'a': 1 };
1925
+ *
1926
+ * console.log(_.identity(object) === object);
1927
+ * // => true
1928
+ */
1929
+ function identity(value) {
1930
+ return value;
1931
+ }
1932
+ /**
1933
+ * This method returns `false`.
1934
+ *
1935
+ * @static
1936
+ * @memberOf _
1937
+ * @since 4.13.0
1938
+ * @category Util
1939
+ * @returns {boolean} Returns `false`.
1940
+ * @example
1941
+ *
1942
+ * _.times(2, _.stubFalse);
1943
+ * // => [false, false]
1944
+ */
1945
+ function stubFalse() {
1946
+ return false;
1947
+ }
1948
+ module.exports = merge;
1949
+ }));
1950
+
1951
+ //#endregion
1952
+ //#region src/typography/index.ts
1953
+ var import_lodash_merge = /* @__PURE__ */ __toESM(require_lodash_merge(), 1);
1954
+ function inWhere(selector, { className, prefix, modifier }) {
1955
+ const prefixedNot = prefix(`.not-${className}`).slice(1);
1956
+ const selectorPrefix = selector.startsWith(">") ? `${modifier === "DEFAULT" ? `.${className}` : `.${className}-${modifier}`} ` : "";
1957
+ const [trailingPseudo, rebuiltSelector] = commonTrailingPseudos(selector);
1958
+ if (trailingPseudo) return `:where(${selectorPrefix}${rebuiltSelector}):not(:where([class~="${prefixedNot}"],[class~="${prefixedNot}"] *))${trailingPseudo}`;
1959
+ return `:where(${selectorPrefix}${selector}):not(:where([class~="${prefixedNot}"],[class~="${prefixedNot}"] *))`;
1960
+ }
1961
+ function configToCss(config = {}, { className, modifier, prefix }) {
1962
+ function updateSelector(k, v) {
1963
+ if (Array.isArray(v)) return [k, v];
1964
+ if (typeof v === "object" && v !== null) {
1965
+ if (Object.values(v).some((prop) => typeof prop === "object")) return [
1966
+ inWhere(k, {
1967
+ className,
1968
+ modifier,
1969
+ prefix
1970
+ }),
1971
+ v,
1972
+ Object.fromEntries(Object.entries(v).map(([k, v]) => updateSelector(k, v)))
1973
+ ];
1974
+ return [inWhere(k, {
1975
+ className,
1976
+ modifier,
1977
+ prefix
1978
+ }), v];
1979
+ }
1980
+ return [k, v];
1981
+ }
1982
+ const css = config.css ?? [];
1983
+ return Object.fromEntries(Object.entries((0, import_lodash_merge.default)({}, ...Array.isArray(css) ? css : [css])).map(([k, v]) => updateSelector(k, v)));
1984
+ }
1985
+ const parseSelector = parser();
1986
+ function commonTrailingPseudos(selector) {
1987
+ const ast = parseSelector.astSync(selector);
1988
+ const matrix = [];
1989
+ for (const [i, sel] of ast.nodes.entries()) for (const [j, child] of [...sel.nodes].reverse().entries()) {
1990
+ if (child.type !== "pseudo" || !child.value.startsWith("::")) break;
1991
+ matrix[j] = matrix[j] || [];
1992
+ matrix[j][i] = child;
1993
+ }
1994
+ const trailingPseudos = parser.selector({ value: "" });
1995
+ for (const pseudos of matrix) {
1996
+ if (!pseudos) continue;
1997
+ if (new Set(pseudos.map((p) => p.value)).size > 1) break;
1998
+ pseudos.forEach((pseudo) => pseudo.remove());
1999
+ trailingPseudos.prepend(pseudos[0]);
2000
+ }
2001
+ if (trailingPseudos.nodes.length) return [trailingPseudos.toString(), ast.toString()];
2002
+ return [null, selector];
2003
+ }
2004
+ const SELECTORS = [
2005
+ [
2006
+ "headings",
2007
+ "h1",
2008
+ "h2",
2009
+ "h3",
2010
+ "h4",
2011
+ "h5",
2012
+ "h6",
2013
+ "th"
2014
+ ],
2015
+ ["h1"],
2016
+ ["h2"],
2017
+ ["h3"],
2018
+ ["h4"],
2019
+ ["h5"],
2020
+ ["h6"],
2021
+ ["p"],
2022
+ ["a"],
2023
+ ["blockquote"],
2024
+ ["figure"],
2025
+ ["figcaption"],
2026
+ ["strong"],
2027
+ ["em"],
2028
+ ["kbd"],
2029
+ ["code"],
2030
+ ["pre"],
2031
+ ["ol"],
2032
+ ["ul"],
2033
+ ["li"],
2034
+ ["table"],
2035
+ ["thead"],
2036
+ ["tr"],
2037
+ ["th"],
2038
+ ["td"],
2039
+ ["img"],
2040
+ ["video"],
2041
+ ["hr"],
2042
+ ["lead", "[class~=\"lead\"]"]
2043
+ ];
2044
+ const typography = plugin.withOptions(({ className = "prose", ...styleOptions } = {}) => {
2045
+ return ({ addVariant, addComponents, ...rest }) => {
2046
+ const prefix = rest.prefix;
2047
+ for (const [name, ...values] of SELECTORS) {
2048
+ const selector = (values.length === 0 ? [name] : values).join(", ");
2049
+ addVariant(`${className}-${name}`, `& :is(${inWhere(selector, {
2050
+ prefix,
2051
+ className
2052
+ })})`);
2053
+ }
2054
+ addComponents({ [`.${className}`]: configToCss({
2055
+ ...DEFAULT,
2056
+ css: [...DEFAULT.css ?? [], styleOptions.disableRoundedTable ? normalTable : roundedTable]
2057
+ }, {
2058
+ className,
2059
+ modifier: "DEFAULT",
2060
+ prefix
2061
+ }) });
2062
+ };
2063
+ });
2064
+
2065
+ //#endregion
2066
+ export { typography as default, typography };