Official MailerLite Sign Up Forms - Version 1.5.0

Version Description

  • Tested with WordPress 5.8.3
  • Update - Gutenberg plugin in plain JS
Download this release

Release Info

Developer mailerlite
Plugin Icon 128x128 Official MailerLite Sign Up Forms
Version 1.5.0
Comparing to
See all releases

Code changes from version 1.4.9 to 1.5.0

assets/css/mailerlite.css CHANGED
File without changes
assets/css/mailerlite_forms.css CHANGED
File without changes
assets/image/icon.png CHANGED
File without changes
assets/image/shortcode.png CHANGED
File without changes
assets/image/widget_logo.svg CHANGED
@@ -1,11 +1,5 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg width="21px" height="21px" viewBox="0 0 21 21" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
- <!-- Generator: Sketch 52.5 (67469) - http://www.bohemiancoding.com/sketch -->
4
- <title>mailerlitelogo</title>
5
- <desc>Created with Sketch.</desc>
6
- <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
7
- <g id="mailerlitelogo" transform="translate(0.198319, 0.325455)" fill="#09C269" fill-rule="nonzero">
8
- <path d="M17.2807581,0.115646258 L2.78853487,0.115646258 C1.28807741,0.115646258 0.0437956203,1.34864717 0.0437956203,2.8355012 L0.0437956203,11.9016843 L0.0437956203,13.6786562 L0.0437956203,20.1156463 L3.83153579,16.3985111 L17.2990564,16.3985111 C18.7995138,16.3985111 20.0437956,15.1655103 20.0437956,13.6786562 L20.0437956,2.8355012 C20.0254974,1.3305148 18.7995138,0.115646258 17.2807581,0.115646258 Z" id="Shape-path"></path>
9
- </g>
10
- </g>
11
- </svg>
1
+ <svg width="256" height="256" viewBox="0 0 256 256" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <rect x="1.23077" y="1.23077" width="253.538" height="253.538" rx="4.92308" fill="#09C269" stroke="#09C269" stroke-width="2.46154"/>
3
+ <path d="M178.619 73H77.2857C69.381 73 63 79.6686 63 87.9296V182.782L82.7143 162.379H178.714C186.619 162.379 193 155.71 193 147.449V87.9296C192.905 79.6686 186.524 73 178.619 73ZM93.3809 139.885C93.3809 142.074 91.6667 143.866 89.5714 143.866C87.4762 143.866 85.7619 142.074 85.7619 139.885V97.5841C85.7619 95.3944 87.4762 93.6029 89.5714 93.6029C91.6667 93.6029 93.3809 95.3944 93.3809 97.5841V139.885ZM111.095 139.885C111.095 142.074 109.381 143.866 107.286 143.866C105.19 143.866 103.476 142.074 103.476 139.885V111.916C103.476 109.727 105.19 107.935 107.286 107.935C109.381 107.935 111.095 109.727 111.095 111.916V139.885ZM111.571 99.1766C111.571 101.565 109.762 103.456 107.476 103.456H107.095C104.81 103.456 103 101.565 103 99.1766V98.878C103 96.4892 104.81 94.5982 107.095 94.5982H107.476C109.762 94.5982 111.571 96.4892 111.571 98.878V99.1766ZM138.429 142.871C136.714 143.766 134.81 144.164 132.81 144.164C126.238 144.164 122.714 140.88 122.714 134.609V115.4H119.286C118.143 115.4 117.19 114.504 117.19 113.31V113.21C117.19 112.514 117.571 111.817 118.143 111.319L126.619 102.66C127.095 102.162 127.667 101.864 128.333 101.764C129.476 101.764 130.524 102.76 130.524 103.954C130.524 103.954 130.524 103.954 130.524 104.054V108.234H136.619C138.524 108.234 140.048 109.826 140.048 111.817C140.048 113.808 138.524 115.4 136.619 115.4H130.524V134.112C130.524 136.799 131.857 136.998 133.667 136.998C134.429 136.998 135.19 136.899 135.857 136.7C136.333 136.501 136.905 136.501 137.381 136.401C139.095 136.401 140.524 137.894 140.619 139.785C140.429 141.079 139.571 142.373 138.429 142.871ZM161.762 136.7C164.524 136.799 167.286 136.102 169.762 134.809C170.238 134.51 170.81 134.41 171.286 134.41C173.19 134.41 174.714 135.903 174.714 137.894C174.714 137.894 174.714 137.894 174.714 137.994C174.619 139.387 173.857 140.681 172.619 141.278C169.952 142.871 167.095 144.264 161.19 144.264C150.524 144.264 144.048 137.396 144.048 125.95C144.048 112.514 152.619 107.637 159.857 107.637C170.714 107.637 175.667 116.694 175.667 125.055C175.762 127.145 174.143 128.936 172.143 129.036C172.048 129.036 171.952 129.036 171.857 129.036H151.857C152.905 134.012 156.333 136.7 161.762 136.7Z" fill="white"/>
4
+ <path d="M160.047 114.703C155.857 114.604 152.333 117.888 151.952 122.268H168.238C167.762 117.888 164.238 114.604 160.047 114.703Z" fill="white"/>
5
+ </svg>
 
 
 
 
 
 
assets/js/block.build.js DELETED
@@ -1,120374 +0,0 @@
1
- /******/ (function(modules) { // webpackBootstrap
2
- /******/ // The module cache
3
- /******/ var installedModules = {};
4
- /******/
5
- /******/ // The require function
6
- /******/ function __webpack_require__(moduleId) {
7
- /******/
8
- /******/ // Check if module is in cache
9
- /******/ if(installedModules[moduleId]) {
10
- /******/ return installedModules[moduleId].exports;
11
- /******/ }
12
- /******/ // Create a new module (and put it into the cache)
13
- /******/ var module = installedModules[moduleId] = {
14
- /******/ i: moduleId,
15
- /******/ l: false,
16
- /******/ exports: {}
17
- /******/ };
18
- /******/
19
- /******/ // Execute the module function
20
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21
- /******/
22
- /******/ // Flag the module as loaded
23
- /******/ module.l = true;
24
- /******/
25
- /******/ // Return the exports of the module
26
- /******/ return module.exports;
27
- /******/ }
28
- /******/
29
- /******/
30
- /******/ // expose the modules object (__webpack_modules__)
31
- /******/ __webpack_require__.m = modules;
32
- /******/
33
- /******/ // expose the module cache
34
- /******/ __webpack_require__.c = installedModules;
35
- /******/
36
- /******/ // define getter function for harmony exports
37
- /******/ __webpack_require__.d = function(exports, name, getter) {
38
- /******/ if(!__webpack_require__.o(exports, name)) {
39
- /******/ Object.defineProperty(exports, name, {
40
- /******/ configurable: false,
41
- /******/ enumerable: true,
42
- /******/ get: getter
43
- /******/ });
44
- /******/ }
45
- /******/ };
46
- /******/
47
- /******/ // getDefaultExport function for compatibility with non-harmony modules
48
- /******/ __webpack_require__.n = function(module) {
49
- /******/ var getter = module && module.__esModule ?
50
- /******/ function getDefault() { return module['default']; } :
51
- /******/ function getModuleExports() { return module; };
52
- /******/ __webpack_require__.d(getter, 'a', getter);
53
- /******/ return getter;
54
- /******/ };
55
- /******/
56
- /******/ // Object.prototype.hasOwnProperty.call
57
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
58
- /******/
59
- /******/ // __webpack_public_path__
60
- /******/ __webpack_require__.p = "";
61
- /******/
62
- /******/ // Load entry module and return exports
63
- /******/ return __webpack_require__(__webpack_require__.s = 444);
64
- /******/ })
65
- /************************************************************************/
66
- /******/ ([
67
- /* 0 */
68
- /***/ (function(module, exports, __webpack_require__) {
69
-
70
- /* WEBPACK VAR INJECTION */(function(module) {var require;//! moment.js
71
- //! version : 2.29.1
72
- //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
73
- //! license : MIT
74
- //! momentjs.com
75
-
76
- ;(function (global, factory) {
77
- true ? module.exports = factory() :
78
- typeof define === 'function' && define.amd ? define(factory) :
79
- global.moment = factory()
80
- }(this, (function () { 'use strict';
81
-
82
- var hookCallback;
83
-
84
- function hooks() {
85
- return hookCallback.apply(null, arguments);
86
- }
87
-
88
- // This is done to register the method called with moment()
89
- // without creating circular dependencies.
90
- function setHookCallback(callback) {
91
- hookCallback = callback;
92
- }
93
-
94
- function isArray(input) {
95
- return (
96
- input instanceof Array ||
97
- Object.prototype.toString.call(input) === '[object Array]'
98
- );
99
- }
100
-
101
- function isObject(input) {
102
- // IE8 will treat undefined and null as object if it wasn't for
103
- // input != null
104
- return (
105
- input != null &&
106
- Object.prototype.toString.call(input) === '[object Object]'
107
- );
108
- }
109
-
110
- function hasOwnProp(a, b) {
111
- return Object.prototype.hasOwnProperty.call(a, b);
112
- }
113
-
114
- function isObjectEmpty(obj) {
115
- if (Object.getOwnPropertyNames) {
116
- return Object.getOwnPropertyNames(obj).length === 0;
117
- } else {
118
- var k;
119
- for (k in obj) {
120
- if (hasOwnProp(obj, k)) {
121
- return false;
122
- }
123
- }
124
- return true;
125
- }
126
- }
127
-
128
- function isUndefined(input) {
129
- return input === void 0;
130
- }
131
-
132
- function isNumber(input) {
133
- return (
134
- typeof input === 'number' ||
135
- Object.prototype.toString.call(input) === '[object Number]'
136
- );
137
- }
138
-
139
- function isDate(input) {
140
- return (
141
- input instanceof Date ||
142
- Object.prototype.toString.call(input) === '[object Date]'
143
- );
144
- }
145
-
146
- function map(arr, fn) {
147
- var res = [],
148
- i;
149
- for (i = 0; i < arr.length; ++i) {
150
- res.push(fn(arr[i], i));
151
- }
152
- return res;
153
- }
154
-
155
- function extend(a, b) {
156
- for (var i in b) {
157
- if (hasOwnProp(b, i)) {
158
- a[i] = b[i];
159
- }
160
- }
161
-
162
- if (hasOwnProp(b, 'toString')) {
163
- a.toString = b.toString;
164
- }
165
-
166
- if (hasOwnProp(b, 'valueOf')) {
167
- a.valueOf = b.valueOf;
168
- }
169
-
170
- return a;
171
- }
172
-
173
- function createUTC(input, format, locale, strict) {
174
- return createLocalOrUTC(input, format, locale, strict, true).utc();
175
- }
176
-
177
- function defaultParsingFlags() {
178
- // We need to deep clone this object.
179
- return {
180
- empty: false,
181
- unusedTokens: [],
182
- unusedInput: [],
183
- overflow: -2,
184
- charsLeftOver: 0,
185
- nullInput: false,
186
- invalidEra: null,
187
- invalidMonth: null,
188
- invalidFormat: false,
189
- userInvalidated: false,
190
- iso: false,
191
- parsedDateParts: [],
192
- era: null,
193
- meridiem: null,
194
- rfc2822: false,
195
- weekdayMismatch: false,
196
- };
197
- }
198
-
199
- function getParsingFlags(m) {
200
- if (m._pf == null) {
201
- m._pf = defaultParsingFlags();
202
- }
203
- return m._pf;
204
- }
205
-
206
- var some;
207
- if (Array.prototype.some) {
208
- some = Array.prototype.some;
209
- } else {
210
- some = function (fun) {
211
- var t = Object(this),
212
- len = t.length >>> 0,
213
- i;
214
-
215
- for (i = 0; i < len; i++) {
216
- if (i in t && fun.call(this, t[i], i, t)) {
217
- return true;
218
- }
219
- }
220
-
221
- return false;
222
- };
223
- }
224
-
225
- function isValid(m) {
226
- if (m._isValid == null) {
227
- var flags = getParsingFlags(m),
228
- parsedParts = some.call(flags.parsedDateParts, function (i) {
229
- return i != null;
230
- }),
231
- isNowValid =
232
- !isNaN(m._d.getTime()) &&
233
- flags.overflow < 0 &&
234
- !flags.empty &&
235
- !flags.invalidEra &&
236
- !flags.invalidMonth &&
237
- !flags.invalidWeekday &&
238
- !flags.weekdayMismatch &&
239
- !flags.nullInput &&
240
- !flags.invalidFormat &&
241
- !flags.userInvalidated &&
242
- (!flags.meridiem || (flags.meridiem && parsedParts));
243
-
244
- if (m._strict) {
245
- isNowValid =
246
- isNowValid &&
247
- flags.charsLeftOver === 0 &&
248
- flags.unusedTokens.length === 0 &&
249
- flags.bigHour === undefined;
250
- }
251
-
252
- if (Object.isFrozen == null || !Object.isFrozen(m)) {
253
- m._isValid = isNowValid;
254
- } else {
255
- return isNowValid;
256
- }
257
- }
258
- return m._isValid;
259
- }
260
-
261
- function createInvalid(flags) {
262
- var m = createUTC(NaN);
263
- if (flags != null) {
264
- extend(getParsingFlags(m), flags);
265
- } else {
266
- getParsingFlags(m).userInvalidated = true;
267
- }
268
-
269
- return m;
270
- }
271
-
272
- // Plugins that add properties should also add the key here (null value),
273
- // so we can properly clone ourselves.
274
- var momentProperties = (hooks.momentProperties = []),
275
- updateInProgress = false;
276
-
277
- function copyConfig(to, from) {
278
- var i, prop, val;
279
-
280
- if (!isUndefined(from._isAMomentObject)) {
281
- to._isAMomentObject = from._isAMomentObject;
282
- }
283
- if (!isUndefined(from._i)) {
284
- to._i = from._i;
285
- }
286
- if (!isUndefined(from._f)) {
287
- to._f = from._f;
288
- }
289
- if (!isUndefined(from._l)) {
290
- to._l = from._l;
291
- }
292
- if (!isUndefined(from._strict)) {
293
- to._strict = from._strict;
294
- }
295
- if (!isUndefined(from._tzm)) {
296
- to._tzm = from._tzm;
297
- }
298
- if (!isUndefined(from._isUTC)) {
299
- to._isUTC = from._isUTC;
300
- }
301
- if (!isUndefined(from._offset)) {
302
- to._offset = from._offset;
303
- }
304
- if (!isUndefined(from._pf)) {
305
- to._pf = getParsingFlags(from);
306
- }
307
- if (!isUndefined(from._locale)) {
308
- to._locale = from._locale;
309
- }
310
-
311
- if (momentProperties.length > 0) {
312
- for (i = 0; i < momentProperties.length; i++) {
313
- prop = momentProperties[i];
314
- val = from[prop];
315
- if (!isUndefined(val)) {
316
- to[prop] = val;
317
- }
318
- }
319
- }
320
-
321
- return to;
322
- }
323
-
324
- // Moment prototype object
325
- function Moment(config) {
326
- copyConfig(this, config);
327
- this._d = new Date(config._d != null ? config._d.getTime() : NaN);
328
- if (!this.isValid()) {
329
- this._d = new Date(NaN);
330
- }
331
- // Prevent infinite loop in case updateOffset creates new moment
332
- // objects.
333
- if (updateInProgress === false) {
334
- updateInProgress = true;
335
- hooks.updateOffset(this);
336
- updateInProgress = false;
337
- }
338
- }
339
-
340
- function isMoment(obj) {
341
- return (
342
- obj instanceof Moment || (obj != null && obj._isAMomentObject != null)
343
- );
344
- }
345
-
346
- function warn(msg) {
347
- if (
348
- hooks.suppressDeprecationWarnings === false &&
349
- typeof console !== 'undefined' &&
350
- console.warn
351
- ) {
352
- console.warn('Deprecation warning: ' + msg);
353
- }
354
- }
355
-
356
- function deprecate(msg, fn) {
357
- var firstTime = true;
358
-
359
- return extend(function () {
360
- if (hooks.deprecationHandler != null) {
361
- hooks.deprecationHandler(null, msg);
362
- }
363
- if (firstTime) {
364
- var args = [],
365
- arg,
366
- i,
367
- key;
368
- for (i = 0; i < arguments.length; i++) {
369
- arg = '';
370
- if (typeof arguments[i] === 'object') {
371
- arg += '\n[' + i + '] ';
372
- for (key in arguments[0]) {
373
- if (hasOwnProp(arguments[0], key)) {
374
- arg += key + ': ' + arguments[0][key] + ', ';
375
- }
376
- }
377
- arg = arg.slice(0, -2); // Remove trailing comma and space
378
- } else {
379
- arg = arguments[i];
380
- }
381
- args.push(arg);
382
- }
383
- warn(
384
- msg +
385
- '\nArguments: ' +
386
- Array.prototype.slice.call(args).join('') +
387
- '\n' +
388
- new Error().stack
389
- );
390
- firstTime = false;
391
- }
392
- return fn.apply(this, arguments);
393
- }, fn);
394
- }
395
-
396
- var deprecations = {};
397
-
398
- function deprecateSimple(name, msg) {
399
- if (hooks.deprecationHandler != null) {
400
- hooks.deprecationHandler(name, msg);
401
- }
402
- if (!deprecations[name]) {
403
- warn(msg);
404
- deprecations[name] = true;
405
- }
406
- }
407
-
408
- hooks.suppressDeprecationWarnings = false;
409
- hooks.deprecationHandler = null;
410
-
411
- function isFunction(input) {
412
- return (
413
- (typeof Function !== 'undefined' && input instanceof Function) ||
414
- Object.prototype.toString.call(input) === '[object Function]'
415
- );
416
- }
417
-
418
- function set(config) {
419
- var prop, i;
420
- for (i in config) {
421
- if (hasOwnProp(config, i)) {
422
- prop = config[i];
423
- if (isFunction(prop)) {
424
- this[i] = prop;
425
- } else {
426
- this['_' + i] = prop;
427
- }
428
- }
429
- }
430
- this._config = config;
431
- // Lenient ordinal parsing accepts just a number in addition to
432
- // number + (possibly) stuff coming from _dayOfMonthOrdinalParse.
433
- // TODO: Remove "ordinalParse" fallback in next major release.
434
- this._dayOfMonthOrdinalParseLenient = new RegExp(
435
- (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) +
436
- '|' +
437
- /\d{1,2}/.source
438
- );
439
- }
440
-
441
- function mergeConfigs(parentConfig, childConfig) {
442
- var res = extend({}, parentConfig),
443
- prop;
444
- for (prop in childConfig) {
445
- if (hasOwnProp(childConfig, prop)) {
446
- if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
447
- res[prop] = {};
448
- extend(res[prop], parentConfig[prop]);
449
- extend(res[prop], childConfig[prop]);
450
- } else if (childConfig[prop] != null) {
451
- res[prop] = childConfig[prop];
452
- } else {
453
- delete res[prop];
454
- }
455
- }
456
- }
457
- for (prop in parentConfig) {
458
- if (
459
- hasOwnProp(parentConfig, prop) &&
460
- !hasOwnProp(childConfig, prop) &&
461
- isObject(parentConfig[prop])
462
- ) {
463
- // make sure changes to properties don't modify parent config
464
- res[prop] = extend({}, res[prop]);
465
- }
466
- }
467
- return res;
468
- }
469
-
470
- function Locale(config) {
471
- if (config != null) {
472
- this.set(config);
473
- }
474
- }
475
-
476
- var keys;
477
-
478
- if (Object.keys) {
479
- keys = Object.keys;
480
- } else {
481
- keys = function (obj) {
482
- var i,
483
- res = [];
484
- for (i in obj) {
485
- if (hasOwnProp(obj, i)) {
486
- res.push(i);
487
- }
488
- }
489
- return res;
490
- };
491
- }
492
-
493
- var defaultCalendar = {
494
- sameDay: '[Today at] LT',
495
- nextDay: '[Tomorrow at] LT',
496
- nextWeek: 'dddd [at] LT',
497
- lastDay: '[Yesterday at] LT',
498
- lastWeek: '[Last] dddd [at] LT',
499
- sameElse: 'L',
500
- };
501
-
502
- function calendar(key, mom, now) {
503
- var output = this._calendar[key] || this._calendar['sameElse'];
504
- return isFunction(output) ? output.call(mom, now) : output;
505
- }
506
-
507
- function zeroFill(number, targetLength, forceSign) {
508
- var absNumber = '' + Math.abs(number),
509
- zerosToFill = targetLength - absNumber.length,
510
- sign = number >= 0;
511
- return (
512
- (sign ? (forceSign ? '+' : '') : '-') +
513
- Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +
514
- absNumber
515
- );
516
- }
517
-
518
- var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,
519
- localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,
520
- formatFunctions = {},
521
- formatTokenFunctions = {};
522
-
523
- // token: 'M'
524
- // padded: ['MM', 2]
525
- // ordinal: 'Mo'
526
- // callback: function () { this.month() + 1 }
527
- function addFormatToken(token, padded, ordinal, callback) {
528
- var func = callback;
529
- if (typeof callback === 'string') {
530
- func = function () {
531
- return this[callback]();
532
- };
533
- }
534
- if (token) {
535
- formatTokenFunctions[token] = func;
536
- }
537
- if (padded) {
538
- formatTokenFunctions[padded[0]] = function () {
539
- return zeroFill(func.apply(this, arguments), padded[1], padded[2]);
540
- };
541
- }
542
- if (ordinal) {
543
- formatTokenFunctions[ordinal] = function () {
544
- return this.localeData().ordinal(
545
- func.apply(this, arguments),
546
- token
547
- );
548
- };
549
- }
550
- }
551
-
552
- function removeFormattingTokens(input) {
553
- if (input.match(/\[[\s\S]/)) {
554
- return input.replace(/^\[|\]$/g, '');
555
- }
556
- return input.replace(/\\/g, '');
557
- }
558
-
559
- function makeFormatFunction(format) {
560
- var array = format.match(formattingTokens),
561
- i,
562
- length;
563
-
564
- for (i = 0, length = array.length; i < length; i++) {
565
- if (formatTokenFunctions[array[i]]) {
566
- array[i] = formatTokenFunctions[array[i]];
567
- } else {
568
- array[i] = removeFormattingTokens(array[i]);
569
- }
570
- }
571
-
572
- return function (mom) {
573
- var output = '',
574
- i;
575
- for (i = 0; i < length; i++) {
576
- output += isFunction(array[i])
577
- ? array[i].call(mom, format)
578
- : array[i];
579
- }
580
- return output;
581
- };
582
- }
583
-
584
- // format date using native date object
585
- function formatMoment(m, format) {
586
- if (!m.isValid()) {
587
- return m.localeData().invalidDate();
588
- }
589
-
590
- format = expandFormat(format, m.localeData());
591
- formatFunctions[format] =
592
- formatFunctions[format] || makeFormatFunction(format);
593
-
594
- return formatFunctions[format](m);
595
- }
596
-
597
- function expandFormat(format, locale) {
598
- var i = 5;
599
-
600
- function replaceLongDateFormatTokens(input) {
601
- return locale.longDateFormat(input) || input;
602
- }
603
-
604
- localFormattingTokens.lastIndex = 0;
605
- while (i >= 0 && localFormattingTokens.test(format)) {
606
- format = format.replace(
607
- localFormattingTokens,
608
- replaceLongDateFormatTokens
609
- );
610
- localFormattingTokens.lastIndex = 0;
611
- i -= 1;
612
- }
613
-
614
- return format;
615
- }
616
-
617
- var defaultLongDateFormat = {
618
- LTS: 'h:mm:ss A',
619
- LT: 'h:mm A',
620
- L: 'MM/DD/YYYY',
621
- LL: 'MMMM D, YYYY',
622
- LLL: 'MMMM D, YYYY h:mm A',
623
- LLLL: 'dddd, MMMM D, YYYY h:mm A',
624
- };
625
-
626
- function longDateFormat(key) {
627
- var format = this._longDateFormat[key],
628
- formatUpper = this._longDateFormat[key.toUpperCase()];
629
-
630
- if (format || !formatUpper) {
631
- return format;
632
- }
633
-
634
- this._longDateFormat[key] = formatUpper
635
- .match(formattingTokens)
636
- .map(function (tok) {
637
- if (
638
- tok === 'MMMM' ||
639
- tok === 'MM' ||
640
- tok === 'DD' ||
641
- tok === 'dddd'
642
- ) {
643
- return tok.slice(1);
644
- }
645
- return tok;
646
- })
647
- .join('');
648
-
649
- return this._longDateFormat[key];
650
- }
651
-
652
- var defaultInvalidDate = 'Invalid date';
653
-
654
- function invalidDate() {
655
- return this._invalidDate;
656
- }
657
-
658
- var defaultOrdinal = '%d',
659
- defaultDayOfMonthOrdinalParse = /\d{1,2}/;
660
-
661
- function ordinal(number) {
662
- return this._ordinal.replace('%d', number);
663
- }
664
-
665
- var defaultRelativeTime = {
666
- future: 'in %s',
667
- past: '%s ago',
668
- s: 'a few seconds',
669
- ss: '%d seconds',
670
- m: 'a minute',
671
- mm: '%d minutes',
672
- h: 'an hour',
673
- hh: '%d hours',
674
- d: 'a day',
675
- dd: '%d days',
676
- w: 'a week',
677
- ww: '%d weeks',
678
- M: 'a month',
679
- MM: '%d months',
680
- y: 'a year',
681
- yy: '%d years',
682
- };
683
-
684
- function relativeTime(number, withoutSuffix, string, isFuture) {
685
- var output = this._relativeTime[string];
686
- return isFunction(output)
687
- ? output(number, withoutSuffix, string, isFuture)
688
- : output.replace(/%d/i, number);
689
- }
690
-
691
- function pastFuture(diff, output) {
692
- var format = this._relativeTime[diff > 0 ? 'future' : 'past'];
693
- return isFunction(format) ? format(output) : format.replace(/%s/i, output);
694
- }
695
-
696
- var aliases = {};
697
-
698
- function addUnitAlias(unit, shorthand) {
699
- var lowerCase = unit.toLowerCase();
700
- aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit;
701
- }
702
-
703
- function normalizeUnits(units) {
704
- return typeof units === 'string'
705
- ? aliases[units] || aliases[units.toLowerCase()]
706
- : undefined;
707
- }
708
-
709
- function normalizeObjectUnits(inputObject) {
710
- var normalizedInput = {},
711
- normalizedProp,
712
- prop;
713
-
714
- for (prop in inputObject) {
715
- if (hasOwnProp(inputObject, prop)) {
716
- normalizedProp = normalizeUnits(prop);
717
- if (normalizedProp) {
718
- normalizedInput[normalizedProp] = inputObject[prop];
719
- }
720
- }
721
- }
722
-
723
- return normalizedInput;
724
- }
725
-
726
- var priorities = {};
727
-
728
- function addUnitPriority(unit, priority) {
729
- priorities[unit] = priority;
730
- }
731
-
732
- function getPrioritizedUnits(unitsObj) {
733
- var units = [],
734
- u;
735
- for (u in unitsObj) {
736
- if (hasOwnProp(unitsObj, u)) {
737
- units.push({ unit: u, priority: priorities[u] });
738
- }
739
- }
740
- units.sort(function (a, b) {
741
- return a.priority - b.priority;
742
- });
743
- return units;
744
- }
745
-
746
- function isLeapYear(year) {
747
- return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
748
- }
749
-
750
- function absFloor(number) {
751
- if (number < 0) {
752
- // -0 -> 0
753
- return Math.ceil(number) || 0;
754
- } else {
755
- return Math.floor(number);
756
- }
757
- }
758
-
759
- function toInt(argumentForCoercion) {
760
- var coercedNumber = +argumentForCoercion,
761
- value = 0;
762
-
763
- if (coercedNumber !== 0 && isFinite(coercedNumber)) {
764
- value = absFloor(coercedNumber);
765
- }
766
-
767
- return value;
768
- }
769
-
770
- function makeGetSet(unit, keepTime) {
771
- return function (value) {
772
- if (value != null) {
773
- set$1(this, unit, value);
774
- hooks.updateOffset(this, keepTime);
775
- return this;
776
- } else {
777
- return get(this, unit);
778
- }
779
- };
780
- }
781
-
782
- function get(mom, unit) {
783
- return mom.isValid()
784
- ? mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]()
785
- : NaN;
786
- }
787
-
788
- function set$1(mom, unit, value) {
789
- if (mom.isValid() && !isNaN(value)) {
790
- if (
791
- unit === 'FullYear' &&
792
- isLeapYear(mom.year()) &&
793
- mom.month() === 1 &&
794
- mom.date() === 29
795
- ) {
796
- value = toInt(value);
797
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](
798
- value,
799
- mom.month(),
800
- daysInMonth(value, mom.month())
801
- );
802
- } else {
803
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value);
804
- }
805
- }
806
- }
807
-
808
- // MOMENTS
809
-
810
- function stringGet(units) {
811
- units = normalizeUnits(units);
812
- if (isFunction(this[units])) {
813
- return this[units]();
814
- }
815
- return this;
816
- }
817
-
818
- function stringSet(units, value) {
819
- if (typeof units === 'object') {
820
- units = normalizeObjectUnits(units);
821
- var prioritized = getPrioritizedUnits(units),
822
- i;
823
- for (i = 0; i < prioritized.length; i++) {
824
- this[prioritized[i].unit](units[prioritized[i].unit]);
825
- }
826
- } else {
827
- units = normalizeUnits(units);
828
- if (isFunction(this[units])) {
829
- return this[units](value);
830
- }
831
- }
832
- return this;
833
- }
834
-
835
- var match1 = /\d/, // 0 - 9
836
- match2 = /\d\d/, // 00 - 99
837
- match3 = /\d{3}/, // 000 - 999
838
- match4 = /\d{4}/, // 0000 - 9999
839
- match6 = /[+-]?\d{6}/, // -999999 - 999999
840
- match1to2 = /\d\d?/, // 0 - 99
841
- match3to4 = /\d\d\d\d?/, // 999 - 9999
842
- match5to6 = /\d\d\d\d\d\d?/, // 99999 - 999999
843
- match1to3 = /\d{1,3}/, // 0 - 999
844
- match1to4 = /\d{1,4}/, // 0 - 9999
845
- match1to6 = /[+-]?\d{1,6}/, // -999999 - 999999
846
- matchUnsigned = /\d+/, // 0 - inf
847
- matchSigned = /[+-]?\d+/, // -inf - inf
848
- matchOffset = /Z|[+-]\d\d:?\d\d/gi, // +00:00 -00:00 +0000 -0000 or Z
849
- matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, // +00 -00 +00:00 -00:00 +0000 -0000 or Z
850
- matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, // 123456789 123456789.123
851
- // any word (or two) characters or numbers including two/three word month in arabic.
852
- // includes scottish gaelic two word and hyphenated months
853
- matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,
854
- regexes;
855
-
856
- regexes = {};
857
-
858
- function addRegexToken(token, regex, strictRegex) {
859
- regexes[token] = isFunction(regex)
860
- ? regex
861
- : function (isStrict, localeData) {
862
- return isStrict && strictRegex ? strictRegex : regex;
863
- };
864
- }
865
-
866
- function getParseRegexForToken(token, config) {
867
- if (!hasOwnProp(regexes, token)) {
868
- return new RegExp(unescapeFormat(token));
869
- }
870
-
871
- return regexes[token](config._strict, config._locale);
872
- }
873
-
874
- // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript
875
- function unescapeFormat(s) {
876
- return regexEscape(
877
- s
878
- .replace('\\', '')
879
- .replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (
880
- matched,
881
- p1,
882
- p2,
883
- p3,
884
- p4
885
- ) {
886
- return p1 || p2 || p3 || p4;
887
- })
888
- );
889
- }
890
-
891
- function regexEscape(s) {
892
- return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
893
- }
894
-
895
- var tokens = {};
896
-
897
- function addParseToken(token, callback) {
898
- var i,
899
- func = callback;
900
- if (typeof token === 'string') {
901
- token = [token];
902
- }
903
- if (isNumber(callback)) {
904
- func = function (input, array) {
905
- array[callback] = toInt(input);
906
- };
907
- }
908
- for (i = 0; i < token.length; i++) {
909
- tokens[token[i]] = func;
910
- }
911
- }
912
-
913
- function addWeekParseToken(token, callback) {
914
- addParseToken(token, function (input, array, config, token) {
915
- config._w = config._w || {};
916
- callback(input, config._w, config, token);
917
- });
918
- }
919
-
920
- function addTimeToArrayFromToken(token, input, config) {
921
- if (input != null && hasOwnProp(tokens, token)) {
922
- tokens[token](input, config._a, config, token);
923
- }
924
- }
925
-
926
- var YEAR = 0,
927
- MONTH = 1,
928
- DATE = 2,
929
- HOUR = 3,
930
- MINUTE = 4,
931
- SECOND = 5,
932
- MILLISECOND = 6,
933
- WEEK = 7,
934
- WEEKDAY = 8;
935
-
936
- function mod(n, x) {
937
- return ((n % x) + x) % x;
938
- }
939
-
940
- var indexOf;
941
-
942
- if (Array.prototype.indexOf) {
943
- indexOf = Array.prototype.indexOf;
944
- } else {
945
- indexOf = function (o) {
946
- // I know
947
- var i;
948
- for (i = 0; i < this.length; ++i) {
949
- if (this[i] === o) {
950
- return i;
951
- }
952
- }
953
- return -1;
954
- };
955
- }
956
-
957
- function daysInMonth(year, month) {
958
- if (isNaN(year) || isNaN(month)) {
959
- return NaN;
960
- }
961
- var modMonth = mod(month, 12);
962
- year += (month - modMonth) / 12;
963
- return modMonth === 1
964
- ? isLeapYear(year)
965
- ? 29
966
- : 28
967
- : 31 - ((modMonth % 7) % 2);
968
- }
969
-
970
- // FORMATTING
971
-
972
- addFormatToken('M', ['MM', 2], 'Mo', function () {
973
- return this.month() + 1;
974
- });
975
-
976
- addFormatToken('MMM', 0, 0, function (format) {
977
- return this.localeData().monthsShort(this, format);
978
- });
979
-
980
- addFormatToken('MMMM', 0, 0, function (format) {
981
- return this.localeData().months(this, format);
982
- });
983
-
984
- // ALIASES
985
-
986
- addUnitAlias('month', 'M');
987
-
988
- // PRIORITY
989
-
990
- addUnitPriority('month', 8);
991
-
992
- // PARSING
993
-
994
- addRegexToken('M', match1to2);
995
- addRegexToken('MM', match1to2, match2);
996
- addRegexToken('MMM', function (isStrict, locale) {
997
- return locale.monthsShortRegex(isStrict);
998
- });
999
- addRegexToken('MMMM', function (isStrict, locale) {
1000
- return locale.monthsRegex(isStrict);
1001
- });
1002
-
1003
- addParseToken(['M', 'MM'], function (input, array) {
1004
- array[MONTH] = toInt(input) - 1;
1005
- });
1006
-
1007
- addParseToken(['MMM', 'MMMM'], function (input, array, config, token) {
1008
- var month = config._locale.monthsParse(input, token, config._strict);
1009
- // if we didn't find a month name, mark the date as invalid.
1010
- if (month != null) {
1011
- array[MONTH] = month;
1012
- } else {
1013
- getParsingFlags(config).invalidMonth = input;
1014
- }
1015
- });
1016
-
1017
- // LOCALES
1018
-
1019
- var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split(
1020
- '_'
1021
- ),
1022
- defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split(
1023
- '_'
1024
- ),
1025
- MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,
1026
- defaultMonthsShortRegex = matchWord,
1027
- defaultMonthsRegex = matchWord;
1028
-
1029
- function localeMonths(m, format) {
1030
- if (!m) {
1031
- return isArray(this._months)
1032
- ? this._months
1033
- : this._months['standalone'];
1034
- }
1035
- return isArray(this._months)
1036
- ? this._months[m.month()]
1037
- : this._months[
1038
- (this._months.isFormat || MONTHS_IN_FORMAT).test(format)
1039
- ? 'format'
1040
- : 'standalone'
1041
- ][m.month()];
1042
- }
1043
-
1044
- function localeMonthsShort(m, format) {
1045
- if (!m) {
1046
- return isArray(this._monthsShort)
1047
- ? this._monthsShort
1048
- : this._monthsShort['standalone'];
1049
- }
1050
- return isArray(this._monthsShort)
1051
- ? this._monthsShort[m.month()]
1052
- : this._monthsShort[
1053
- MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'
1054
- ][m.month()];
1055
- }
1056
-
1057
- function handleStrictParse(monthName, format, strict) {
1058
- var i,
1059
- ii,
1060
- mom,
1061
- llc = monthName.toLocaleLowerCase();
1062
- if (!this._monthsParse) {
1063
- // this is not used
1064
- this._monthsParse = [];
1065
- this._longMonthsParse = [];
1066
- this._shortMonthsParse = [];
1067
- for (i = 0; i < 12; ++i) {
1068
- mom = createUTC([2000, i]);
1069
- this._shortMonthsParse[i] = this.monthsShort(
1070
- mom,
1071
- ''
1072
- ).toLocaleLowerCase();
1073
- this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase();
1074
- }
1075
- }
1076
-
1077
- if (strict) {
1078
- if (format === 'MMM') {
1079
- ii = indexOf.call(this._shortMonthsParse, llc);
1080
- return ii !== -1 ? ii : null;
1081
- } else {
1082
- ii = indexOf.call(this._longMonthsParse, llc);
1083
- return ii !== -1 ? ii : null;
1084
- }
1085
- } else {
1086
- if (format === 'MMM') {
1087
- ii = indexOf.call(this._shortMonthsParse, llc);
1088
- if (ii !== -1) {
1089
- return ii;
1090
- }
1091
- ii = indexOf.call(this._longMonthsParse, llc);
1092
- return ii !== -1 ? ii : null;
1093
- } else {
1094
- ii = indexOf.call(this._longMonthsParse, llc);
1095
- if (ii !== -1) {
1096
- return ii;
1097
- }
1098
- ii = indexOf.call(this._shortMonthsParse, llc);
1099
- return ii !== -1 ? ii : null;
1100
- }
1101
- }
1102
- }
1103
-
1104
- function localeMonthsParse(monthName, format, strict) {
1105
- var i, mom, regex;
1106
-
1107
- if (this._monthsParseExact) {
1108
- return handleStrictParse.call(this, monthName, format, strict);
1109
- }
1110
-
1111
- if (!this._monthsParse) {
1112
- this._monthsParse = [];
1113
- this._longMonthsParse = [];
1114
- this._shortMonthsParse = [];
1115
- }
1116
-
1117
- // TODO: add sorting
1118
- // Sorting makes sure if one month (or abbr) is a prefix of another
1119
- // see sorting in computeMonthsParse
1120
- for (i = 0; i < 12; i++) {
1121
- // make the regex if we don't have it already
1122
- mom = createUTC([2000, i]);
1123
- if (strict && !this._longMonthsParse[i]) {
1124
- this._longMonthsParse[i] = new RegExp(
1125
- '^' + this.months(mom, '').replace('.', '') + '$',
1126
- 'i'
1127
- );
1128
- this._shortMonthsParse[i] = new RegExp(
1129
- '^' + this.monthsShort(mom, '').replace('.', '') + '$',
1130
- 'i'
1131
- );
1132
- }
1133
- if (!strict && !this._monthsParse[i]) {
1134
- regex =
1135
- '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, '');
1136
- this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i');
1137
- }
1138
- // test the regex
1139
- if (
1140
- strict &&
1141
- format === 'MMMM' &&
1142
- this._longMonthsParse[i].test(monthName)
1143
- ) {
1144
- return i;
1145
- } else if (
1146
- strict &&
1147
- format === 'MMM' &&
1148
- this._shortMonthsParse[i].test(monthName)
1149
- ) {
1150
- return i;
1151
- } else if (!strict && this._monthsParse[i].test(monthName)) {
1152
- return i;
1153
- }
1154
- }
1155
- }
1156
-
1157
- // MOMENTS
1158
-
1159
- function setMonth(mom, value) {
1160
- var dayOfMonth;
1161
-
1162
- if (!mom.isValid()) {
1163
- // No op
1164
- return mom;
1165
- }
1166
-
1167
- if (typeof value === 'string') {
1168
- if (/^\d+$/.test(value)) {
1169
- value = toInt(value);
1170
- } else {
1171
- value = mom.localeData().monthsParse(value);
1172
- // TODO: Another silent failure?
1173
- if (!isNumber(value)) {
1174
- return mom;
1175
- }
1176
- }
1177
- }
1178
-
1179
- dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value));
1180
- mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth);
1181
- return mom;
1182
- }
1183
-
1184
- function getSetMonth(value) {
1185
- if (value != null) {
1186
- setMonth(this, value);
1187
- hooks.updateOffset(this, true);
1188
- return this;
1189
- } else {
1190
- return get(this, 'Month');
1191
- }
1192
- }
1193
-
1194
- function getDaysInMonth() {
1195
- return daysInMonth(this.year(), this.month());
1196
- }
1197
-
1198
- function monthsShortRegex(isStrict) {
1199
- if (this._monthsParseExact) {
1200
- if (!hasOwnProp(this, '_monthsRegex')) {
1201
- computeMonthsParse.call(this);
1202
- }
1203
- if (isStrict) {
1204
- return this._monthsShortStrictRegex;
1205
- } else {
1206
- return this._monthsShortRegex;
1207
- }
1208
- } else {
1209
- if (!hasOwnProp(this, '_monthsShortRegex')) {
1210
- this._monthsShortRegex = defaultMonthsShortRegex;
1211
- }
1212
- return this._monthsShortStrictRegex && isStrict
1213
- ? this._monthsShortStrictRegex
1214
- : this._monthsShortRegex;
1215
- }
1216
- }
1217
-
1218
- function monthsRegex(isStrict) {
1219
- if (this._monthsParseExact) {
1220
- if (!hasOwnProp(this, '_monthsRegex')) {
1221
- computeMonthsParse.call(this);
1222
- }
1223
- if (isStrict) {
1224
- return this._monthsStrictRegex;
1225
- } else {
1226
- return this._monthsRegex;
1227
- }
1228
- } else {
1229
- if (!hasOwnProp(this, '_monthsRegex')) {
1230
- this._monthsRegex = defaultMonthsRegex;
1231
- }
1232
- return this._monthsStrictRegex && isStrict
1233
- ? this._monthsStrictRegex
1234
- : this._monthsRegex;
1235
- }
1236
- }
1237
-
1238
- function computeMonthsParse() {
1239
- function cmpLenRev(a, b) {
1240
- return b.length - a.length;
1241
- }
1242
-
1243
- var shortPieces = [],
1244
- longPieces = [],
1245
- mixedPieces = [],
1246
- i,
1247
- mom;
1248
- for (i = 0; i < 12; i++) {
1249
- // make the regex if we don't have it already
1250
- mom = createUTC([2000, i]);
1251
- shortPieces.push(this.monthsShort(mom, ''));
1252
- longPieces.push(this.months(mom, ''));
1253
- mixedPieces.push(this.months(mom, ''));
1254
- mixedPieces.push(this.monthsShort(mom, ''));
1255
- }
1256
- // Sorting makes sure if one month (or abbr) is a prefix of another it
1257
- // will match the longer piece.
1258
- shortPieces.sort(cmpLenRev);
1259
- longPieces.sort(cmpLenRev);
1260
- mixedPieces.sort(cmpLenRev);
1261
- for (i = 0; i < 12; i++) {
1262
- shortPieces[i] = regexEscape(shortPieces[i]);
1263
- longPieces[i] = regexEscape(longPieces[i]);
1264
- }
1265
- for (i = 0; i < 24; i++) {
1266
- mixedPieces[i] = regexEscape(mixedPieces[i]);
1267
- }
1268
-
1269
- this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
1270
- this._monthsShortRegex = this._monthsRegex;
1271
- this._monthsStrictRegex = new RegExp(
1272
- '^(' + longPieces.join('|') + ')',
1273
- 'i'
1274
- );
1275
- this._monthsShortStrictRegex = new RegExp(
1276
- '^(' + shortPieces.join('|') + ')',
1277
- 'i'
1278
- );
1279
- }
1280
-
1281
- // FORMATTING
1282
-
1283
- addFormatToken('Y', 0, 0, function () {
1284
- var y = this.year();
1285
- return y <= 9999 ? zeroFill(y, 4) : '+' + y;
1286
- });
1287
-
1288
- addFormatToken(0, ['YY', 2], 0, function () {
1289
- return this.year() % 100;
1290
- });
1291
-
1292
- addFormatToken(0, ['YYYY', 4], 0, 'year');
1293
- addFormatToken(0, ['YYYYY', 5], 0, 'year');
1294
- addFormatToken(0, ['YYYYYY', 6, true], 0, 'year');
1295
-
1296
- // ALIASES
1297
-
1298
- addUnitAlias('year', 'y');
1299
-
1300
- // PRIORITIES
1301
-
1302
- addUnitPriority('year', 1);
1303
-
1304
- // PARSING
1305
-
1306
- addRegexToken('Y', matchSigned);
1307
- addRegexToken('YY', match1to2, match2);
1308
- addRegexToken('YYYY', match1to4, match4);
1309
- addRegexToken('YYYYY', match1to6, match6);
1310
- addRegexToken('YYYYYY', match1to6, match6);
1311
-
1312
- addParseToken(['YYYYY', 'YYYYYY'], YEAR);
1313
- addParseToken('YYYY', function (input, array) {
1314
- array[YEAR] =
1315
- input.length === 2 ? hooks.parseTwoDigitYear(input) : toInt(input);
1316
- });
1317
- addParseToken('YY', function (input, array) {
1318
- array[YEAR] = hooks.parseTwoDigitYear(input);
1319
- });
1320
- addParseToken('Y', function (input, array) {
1321
- array[YEAR] = parseInt(input, 10);
1322
- });
1323
-
1324
- // HELPERS
1325
-
1326
- function daysInYear(year) {
1327
- return isLeapYear(year) ? 366 : 365;
1328
- }
1329
-
1330
- // HOOKS
1331
-
1332
- hooks.parseTwoDigitYear = function (input) {
1333
- return toInt(input) + (toInt(input) > 68 ? 1900 : 2000);
1334
- };
1335
-
1336
- // MOMENTS
1337
-
1338
- var getSetYear = makeGetSet('FullYear', true);
1339
-
1340
- function getIsLeapYear() {
1341
- return isLeapYear(this.year());
1342
- }
1343
-
1344
- function createDate(y, m, d, h, M, s, ms) {
1345
- // can't just apply() to create a date:
1346
- // https://stackoverflow.com/q/181348
1347
- var date;
1348
- // the date constructor remaps years 0-99 to 1900-1999
1349
- if (y < 100 && y >= 0) {
1350
- // preserve leap years using a full 400 year cycle, then reset
1351
- date = new Date(y + 400, m, d, h, M, s, ms);
1352
- if (isFinite(date.getFullYear())) {
1353
- date.setFullYear(y);
1354
- }
1355
- } else {
1356
- date = new Date(y, m, d, h, M, s, ms);
1357
- }
1358
-
1359
- return date;
1360
- }
1361
-
1362
- function createUTCDate(y) {
1363
- var date, args;
1364
- // the Date.UTC function remaps years 0-99 to 1900-1999
1365
- if (y < 100 && y >= 0) {
1366
- args = Array.prototype.slice.call(arguments);
1367
- // preserve leap years using a full 400 year cycle, then reset
1368
- args[0] = y + 400;
1369
- date = new Date(Date.UTC.apply(null, args));
1370
- if (isFinite(date.getUTCFullYear())) {
1371
- date.setUTCFullYear(y);
1372
- }
1373
- } else {
1374
- date = new Date(Date.UTC.apply(null, arguments));
1375
- }
1376
-
1377
- return date;
1378
- }
1379
-
1380
- // start-of-first-week - start-of-year
1381
- function firstWeekOffset(year, dow, doy) {
1382
- var // first-week day -- which january is always in the first week (4 for iso, 1 for other)
1383
- fwd = 7 + dow - doy,
1384
- // first-week day local weekday -- which local weekday is fwd
1385
- fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
1386
-
1387
- return -fwdlw + fwd - 1;
1388
- }
1389
-
1390
- // https://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday
1391
- function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
1392
- var localWeekday = (7 + weekday - dow) % 7,
1393
- weekOffset = firstWeekOffset(year, dow, doy),
1394
- dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset,
1395
- resYear,
1396
- resDayOfYear;
1397
-
1398
- if (dayOfYear <= 0) {
1399
- resYear = year - 1;
1400
- resDayOfYear = daysInYear(resYear) + dayOfYear;
1401
- } else if (dayOfYear > daysInYear(year)) {
1402
- resYear = year + 1;
1403
- resDayOfYear = dayOfYear - daysInYear(year);
1404
- } else {
1405
- resYear = year;
1406
- resDayOfYear = dayOfYear;
1407
- }
1408
-
1409
- return {
1410
- year: resYear,
1411
- dayOfYear: resDayOfYear,
1412
- };
1413
- }
1414
-
1415
- function weekOfYear(mom, dow, doy) {
1416
- var weekOffset = firstWeekOffset(mom.year(), dow, doy),
1417
- week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1,
1418
- resWeek,
1419
- resYear;
1420
-
1421
- if (week < 1) {
1422
- resYear = mom.year() - 1;
1423
- resWeek = week + weeksInYear(resYear, dow, doy);
1424
- } else if (week > weeksInYear(mom.year(), dow, doy)) {
1425
- resWeek = week - weeksInYear(mom.year(), dow, doy);
1426
- resYear = mom.year() + 1;
1427
- } else {
1428
- resYear = mom.year();
1429
- resWeek = week;
1430
- }
1431
-
1432
- return {
1433
- week: resWeek,
1434
- year: resYear,
1435
- };
1436
- }
1437
-
1438
- function weeksInYear(year, dow, doy) {
1439
- var weekOffset = firstWeekOffset(year, dow, doy),
1440
- weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
1441
- return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
1442
- }
1443
-
1444
- // FORMATTING
1445
-
1446
- addFormatToken('w', ['ww', 2], 'wo', 'week');
1447
- addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek');
1448
-
1449
- // ALIASES
1450
-
1451
- addUnitAlias('week', 'w');
1452
- addUnitAlias('isoWeek', 'W');
1453
-
1454
- // PRIORITIES
1455
-
1456
- addUnitPriority('week', 5);
1457
- addUnitPriority('isoWeek', 5);
1458
-
1459
- // PARSING
1460
-
1461
- addRegexToken('w', match1to2);
1462
- addRegexToken('ww', match1to2, match2);
1463
- addRegexToken('W', match1to2);
1464
- addRegexToken('WW', match1to2, match2);
1465
-
1466
- addWeekParseToken(['w', 'ww', 'W', 'WW'], function (
1467
- input,
1468
- week,
1469
- config,
1470
- token
1471
- ) {
1472
- week[token.substr(0, 1)] = toInt(input);
1473
- });
1474
-
1475
- // HELPERS
1476
-
1477
- // LOCALES
1478
-
1479
- function localeWeek(mom) {
1480
- return weekOfYear(mom, this._week.dow, this._week.doy).week;
1481
- }
1482
-
1483
- var defaultLocaleWeek = {
1484
- dow: 0, // Sunday is the first day of the week.
1485
- doy: 6, // The week that contains Jan 6th is the first week of the year.
1486
- };
1487
-
1488
- function localeFirstDayOfWeek() {
1489
- return this._week.dow;
1490
- }
1491
-
1492
- function localeFirstDayOfYear() {
1493
- return this._week.doy;
1494
- }
1495
-
1496
- // MOMENTS
1497
-
1498
- function getSetWeek(input) {
1499
- var week = this.localeData().week(this);
1500
- return input == null ? week : this.add((input - week) * 7, 'd');
1501
- }
1502
-
1503
- function getSetISOWeek(input) {
1504
- var week = weekOfYear(this, 1, 4).week;
1505
- return input == null ? week : this.add((input - week) * 7, 'd');
1506
- }
1507
-
1508
- // FORMATTING
1509
-
1510
- addFormatToken('d', 0, 'do', 'day');
1511
-
1512
- addFormatToken('dd', 0, 0, function (format) {
1513
- return this.localeData().weekdaysMin(this, format);
1514
- });
1515
-
1516
- addFormatToken('ddd', 0, 0, function (format) {
1517
- return this.localeData().weekdaysShort(this, format);
1518
- });
1519
-
1520
- addFormatToken('dddd', 0, 0, function (format) {
1521
- return this.localeData().weekdays(this, format);
1522
- });
1523
-
1524
- addFormatToken('e', 0, 0, 'weekday');
1525
- addFormatToken('E', 0, 0, 'isoWeekday');
1526
-
1527
- // ALIASES
1528
-
1529
- addUnitAlias('day', 'd');
1530
- addUnitAlias('weekday', 'e');
1531
- addUnitAlias('isoWeekday', 'E');
1532
-
1533
- // PRIORITY
1534
- addUnitPriority('day', 11);
1535
- addUnitPriority('weekday', 11);
1536
- addUnitPriority('isoWeekday', 11);
1537
-
1538
- // PARSING
1539
-
1540
- addRegexToken('d', match1to2);
1541
- addRegexToken('e', match1to2);
1542
- addRegexToken('E', match1to2);
1543
- addRegexToken('dd', function (isStrict, locale) {
1544
- return locale.weekdaysMinRegex(isStrict);
1545
- });
1546
- addRegexToken('ddd', function (isStrict, locale) {
1547
- return locale.weekdaysShortRegex(isStrict);
1548
- });
1549
- addRegexToken('dddd', function (isStrict, locale) {
1550
- return locale.weekdaysRegex(isStrict);
1551
- });
1552
-
1553
- addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) {
1554
- var weekday = config._locale.weekdaysParse(input, token, config._strict);
1555
- // if we didn't get a weekday name, mark the date as invalid
1556
- if (weekday != null) {
1557
- week.d = weekday;
1558
- } else {
1559
- getParsingFlags(config).invalidWeekday = input;
1560
- }
1561
- });
1562
-
1563
- addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) {
1564
- week[token] = toInt(input);
1565
- });
1566
-
1567
- // HELPERS
1568
-
1569
- function parseWeekday(input, locale) {
1570
- if (typeof input !== 'string') {
1571
- return input;
1572
- }
1573
-
1574
- if (!isNaN(input)) {
1575
- return parseInt(input, 10);
1576
- }
1577
-
1578
- input = locale.weekdaysParse(input);
1579
- if (typeof input === 'number') {
1580
- return input;
1581
- }
1582
-
1583
- return null;
1584
- }
1585
-
1586
- function parseIsoWeekday(input, locale) {
1587
- if (typeof input === 'string') {
1588
- return locale.weekdaysParse(input) % 7 || 7;
1589
- }
1590
- return isNaN(input) ? null : input;
1591
- }
1592
-
1593
- // LOCALES
1594
- function shiftWeekdays(ws, n) {
1595
- return ws.slice(n, 7).concat(ws.slice(0, n));
1596
- }
1597
-
1598
- var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split(
1599
- '_'
1600
- ),
1601
- defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
1602
- defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
1603
- defaultWeekdaysRegex = matchWord,
1604
- defaultWeekdaysShortRegex = matchWord,
1605
- defaultWeekdaysMinRegex = matchWord;
1606
-
1607
- function localeWeekdays(m, format) {
1608
- var weekdays = isArray(this._weekdays)
1609
- ? this._weekdays
1610
- : this._weekdays[
1611
- m && m !== true && this._weekdays.isFormat.test(format)
1612
- ? 'format'
1613
- : 'standalone'
1614
- ];
1615
- return m === true
1616
- ? shiftWeekdays(weekdays, this._week.dow)
1617
- : m
1618
- ? weekdays[m.day()]
1619
- : weekdays;
1620
- }
1621
-
1622
- function localeWeekdaysShort(m) {
1623
- return m === true
1624
- ? shiftWeekdays(this._weekdaysShort, this._week.dow)
1625
- : m
1626
- ? this._weekdaysShort[m.day()]
1627
- : this._weekdaysShort;
1628
- }
1629
-
1630
- function localeWeekdaysMin(m) {
1631
- return m === true
1632
- ? shiftWeekdays(this._weekdaysMin, this._week.dow)
1633
- : m
1634
- ? this._weekdaysMin[m.day()]
1635
- : this._weekdaysMin;
1636
- }
1637
-
1638
- function handleStrictParse$1(weekdayName, format, strict) {
1639
- var i,
1640
- ii,
1641
- mom,
1642
- llc = weekdayName.toLocaleLowerCase();
1643
- if (!this._weekdaysParse) {
1644
- this._weekdaysParse = [];
1645
- this._shortWeekdaysParse = [];
1646
- this._minWeekdaysParse = [];
1647
-
1648
- for (i = 0; i < 7; ++i) {
1649
- mom = createUTC([2000, 1]).day(i);
1650
- this._minWeekdaysParse[i] = this.weekdaysMin(
1651
- mom,
1652
- ''
1653
- ).toLocaleLowerCase();
1654
- this._shortWeekdaysParse[i] = this.weekdaysShort(
1655
- mom,
1656
- ''
1657
- ).toLocaleLowerCase();
1658
- this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase();
1659
- }
1660
- }
1661
-
1662
- if (strict) {
1663
- if (format === 'dddd') {
1664
- ii = indexOf.call(this._weekdaysParse, llc);
1665
- return ii !== -1 ? ii : null;
1666
- } else if (format === 'ddd') {
1667
- ii = indexOf.call(this._shortWeekdaysParse, llc);
1668
- return ii !== -1 ? ii : null;
1669
- } else {
1670
- ii = indexOf.call(this._minWeekdaysParse, llc);
1671
- return ii !== -1 ? ii : null;
1672
- }
1673
- } else {
1674
- if (format === 'dddd') {
1675
- ii = indexOf.call(this._weekdaysParse, llc);
1676
- if (ii !== -1) {
1677
- return ii;
1678
- }
1679
- ii = indexOf.call(this._shortWeekdaysParse, llc);
1680
- if (ii !== -1) {
1681
- return ii;
1682
- }
1683
- ii = indexOf.call(this._minWeekdaysParse, llc);
1684
- return ii !== -1 ? ii : null;
1685
- } else if (format === 'ddd') {
1686
- ii = indexOf.call(this._shortWeekdaysParse, llc);
1687
- if (ii !== -1) {
1688
- return ii;
1689
- }
1690
- ii = indexOf.call(this._weekdaysParse, llc);
1691
- if (ii !== -1) {
1692
- return ii;
1693
- }
1694
- ii = indexOf.call(this._minWeekdaysParse, llc);
1695
- return ii !== -1 ? ii : null;
1696
- } else {
1697
- ii = indexOf.call(this._minWeekdaysParse, llc);
1698
- if (ii !== -1) {
1699
- return ii;
1700
- }
1701
- ii = indexOf.call(this._weekdaysParse, llc);
1702
- if (ii !== -1) {
1703
- return ii;
1704
- }
1705
- ii = indexOf.call(this._shortWeekdaysParse, llc);
1706
- return ii !== -1 ? ii : null;
1707
- }
1708
- }
1709
- }
1710
-
1711
- function localeWeekdaysParse(weekdayName, format, strict) {
1712
- var i, mom, regex;
1713
-
1714
- if (this._weekdaysParseExact) {
1715
- return handleStrictParse$1.call(this, weekdayName, format, strict);
1716
- }
1717
-
1718
- if (!this._weekdaysParse) {
1719
- this._weekdaysParse = [];
1720
- this._minWeekdaysParse = [];
1721
- this._shortWeekdaysParse = [];
1722
- this._fullWeekdaysParse = [];
1723
- }
1724
-
1725
- for (i = 0; i < 7; i++) {
1726
- // make the regex if we don't have it already
1727
-
1728
- mom = createUTC([2000, 1]).day(i);
1729
- if (strict && !this._fullWeekdaysParse[i]) {
1730
- this._fullWeekdaysParse[i] = new RegExp(
1731
- '^' + this.weekdays(mom, '').replace('.', '\\.?') + '$',
1732
- 'i'
1733
- );
1734
- this._shortWeekdaysParse[i] = new RegExp(
1735
- '^' + this.weekdaysShort(mom, '').replace('.', '\\.?') + '$',
1736
- 'i'
1737
- );
1738
- this._minWeekdaysParse[i] = new RegExp(
1739
- '^' + this.weekdaysMin(mom, '').replace('.', '\\.?') + '$',
1740
- 'i'
1741
- );
1742
- }
1743
- if (!this._weekdaysParse[i]) {
1744
- regex =
1745
- '^' +
1746
- this.weekdays(mom, '') +
1747
- '|^' +
1748
- this.weekdaysShort(mom, '') +
1749
- '|^' +
1750
- this.weekdaysMin(mom, '');
1751
- this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i');
1752
- }
1753
- // test the regex
1754
- if (
1755
- strict &&
1756
- format === 'dddd' &&
1757
- this._fullWeekdaysParse[i].test(weekdayName)
1758
- ) {
1759
- return i;
1760
- } else if (
1761
- strict &&
1762
- format === 'ddd' &&
1763
- this._shortWeekdaysParse[i].test(weekdayName)
1764
- ) {
1765
- return i;
1766
- } else if (
1767
- strict &&
1768
- format === 'dd' &&
1769
- this._minWeekdaysParse[i].test(weekdayName)
1770
- ) {
1771
- return i;
1772
- } else if (!strict && this._weekdaysParse[i].test(weekdayName)) {
1773
- return i;
1774
- }
1775
- }
1776
- }
1777
-
1778
- // MOMENTS
1779
-
1780
- function getSetDayOfWeek(input) {
1781
- if (!this.isValid()) {
1782
- return input != null ? this : NaN;
1783
- }
1784
- var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay();
1785
- if (input != null) {
1786
- input = parseWeekday(input, this.localeData());
1787
- return this.add(input - day, 'd');
1788
- } else {
1789
- return day;
1790
- }
1791
- }
1792
-
1793
- function getSetLocaleDayOfWeek(input) {
1794
- if (!this.isValid()) {
1795
- return input != null ? this : NaN;
1796
- }
1797
- var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7;
1798
- return input == null ? weekday : this.add(input - weekday, 'd');
1799
- }
1800
-
1801
- function getSetISODayOfWeek(input) {
1802
- if (!this.isValid()) {
1803
- return input != null ? this : NaN;
1804
- }
1805
-
1806
- // behaves the same as moment#day except
1807
- // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6)
1808
- // as a setter, sunday should belong to the previous week.
1809
-
1810
- if (input != null) {
1811
- var weekday = parseIsoWeekday(input, this.localeData());
1812
- return this.day(this.day() % 7 ? weekday : weekday - 7);
1813
- } else {
1814
- return this.day() || 7;
1815
- }
1816
- }
1817
-
1818
- function weekdaysRegex(isStrict) {
1819
- if (this._weekdaysParseExact) {
1820
- if (!hasOwnProp(this, '_weekdaysRegex')) {
1821
- computeWeekdaysParse.call(this);
1822
- }
1823
- if (isStrict) {
1824
- return this._weekdaysStrictRegex;
1825
- } else {
1826
- return this._weekdaysRegex;
1827
- }
1828
- } else {
1829
- if (!hasOwnProp(this, '_weekdaysRegex')) {
1830
- this._weekdaysRegex = defaultWeekdaysRegex;
1831
- }
1832
- return this._weekdaysStrictRegex && isStrict
1833
- ? this._weekdaysStrictRegex
1834
- : this._weekdaysRegex;
1835
- }
1836
- }
1837
-
1838
- function weekdaysShortRegex(isStrict) {
1839
- if (this._weekdaysParseExact) {
1840
- if (!hasOwnProp(this, '_weekdaysRegex')) {
1841
- computeWeekdaysParse.call(this);
1842
- }
1843
- if (isStrict) {
1844
- return this._weekdaysShortStrictRegex;
1845
- } else {
1846
- return this._weekdaysShortRegex;
1847
- }
1848
- } else {
1849
- if (!hasOwnProp(this, '_weekdaysShortRegex')) {
1850
- this._weekdaysShortRegex = defaultWeekdaysShortRegex;
1851
- }
1852
- return this._weekdaysShortStrictRegex && isStrict
1853
- ? this._weekdaysShortStrictRegex
1854
- : this._weekdaysShortRegex;
1855
- }
1856
- }
1857
-
1858
- function weekdaysMinRegex(isStrict) {
1859
- if (this._weekdaysParseExact) {
1860
- if (!hasOwnProp(this, '_weekdaysRegex')) {
1861
- computeWeekdaysParse.call(this);
1862
- }
1863
- if (isStrict) {
1864
- return this._weekdaysMinStrictRegex;
1865
- } else {
1866
- return this._weekdaysMinRegex;
1867
- }
1868
- } else {
1869
- if (!hasOwnProp(this, '_weekdaysMinRegex')) {
1870
- this._weekdaysMinRegex = defaultWeekdaysMinRegex;
1871
- }
1872
- return this._weekdaysMinStrictRegex && isStrict
1873
- ? this._weekdaysMinStrictRegex
1874
- : this._weekdaysMinRegex;
1875
- }
1876
- }
1877
-
1878
- function computeWeekdaysParse() {
1879
- function cmpLenRev(a, b) {
1880
- return b.length - a.length;
1881
- }
1882
-
1883
- var minPieces = [],
1884
- shortPieces = [],
1885
- longPieces = [],
1886
- mixedPieces = [],
1887
- i,
1888
- mom,
1889
- minp,
1890
- shortp,
1891
- longp;
1892
- for (i = 0; i < 7; i++) {
1893
- // make the regex if we don't have it already
1894
- mom = createUTC([2000, 1]).day(i);
1895
- minp = regexEscape(this.weekdaysMin(mom, ''));
1896
- shortp = regexEscape(this.weekdaysShort(mom, ''));
1897
- longp = regexEscape(this.weekdays(mom, ''));
1898
- minPieces.push(minp);
1899
- shortPieces.push(shortp);
1900
- longPieces.push(longp);
1901
- mixedPieces.push(minp);
1902
- mixedPieces.push(shortp);
1903
- mixedPieces.push(longp);
1904
- }
1905
- // Sorting makes sure if one weekday (or abbr) is a prefix of another it
1906
- // will match the longer piece.
1907
- minPieces.sort(cmpLenRev);
1908
- shortPieces.sort(cmpLenRev);
1909
- longPieces.sort(cmpLenRev);
1910
- mixedPieces.sort(cmpLenRev);
1911
-
1912
- this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
1913
- this._weekdaysShortRegex = this._weekdaysRegex;
1914
- this._weekdaysMinRegex = this._weekdaysRegex;
1915
-
1916
- this._weekdaysStrictRegex = new RegExp(
1917
- '^(' + longPieces.join('|') + ')',
1918
- 'i'
1919
- );
1920
- this._weekdaysShortStrictRegex = new RegExp(
1921
- '^(' + shortPieces.join('|') + ')',
1922
- 'i'
1923
- );
1924
- this._weekdaysMinStrictRegex = new RegExp(
1925
- '^(' + minPieces.join('|') + ')',
1926
- 'i'
1927
- );
1928
- }
1929
-
1930
- // FORMATTING
1931
-
1932
- function hFormat() {
1933
- return this.hours() % 12 || 12;
1934
- }
1935
-
1936
- function kFormat() {
1937
- return this.hours() || 24;
1938
- }
1939
-
1940
- addFormatToken('H', ['HH', 2], 0, 'hour');
1941
- addFormatToken('h', ['hh', 2], 0, hFormat);
1942
- addFormatToken('k', ['kk', 2], 0, kFormat);
1943
-
1944
- addFormatToken('hmm', 0, 0, function () {
1945
- return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2);
1946
- });
1947
-
1948
- addFormatToken('hmmss', 0, 0, function () {
1949
- return (
1950
- '' +
1951
- hFormat.apply(this) +
1952
- zeroFill(this.minutes(), 2) +
1953
- zeroFill(this.seconds(), 2)
1954
- );
1955
- });
1956
-
1957
- addFormatToken('Hmm', 0, 0, function () {
1958
- return '' + this.hours() + zeroFill(this.minutes(), 2);
1959
- });
1960
-
1961
- addFormatToken('Hmmss', 0, 0, function () {
1962
- return (
1963
- '' +
1964
- this.hours() +
1965
- zeroFill(this.minutes(), 2) +
1966
- zeroFill(this.seconds(), 2)
1967
- );
1968
- });
1969
-
1970
- function meridiem(token, lowercase) {
1971
- addFormatToken(token, 0, 0, function () {
1972
- return this.localeData().meridiem(
1973
- this.hours(),
1974
- this.minutes(),
1975
- lowercase
1976
- );
1977
- });
1978
- }
1979
-
1980
- meridiem('a', true);
1981
- meridiem('A', false);
1982
-
1983
- // ALIASES
1984
-
1985
- addUnitAlias('hour', 'h');
1986
-
1987
- // PRIORITY
1988
- addUnitPriority('hour', 13);
1989
-
1990
- // PARSING
1991
-
1992
- function matchMeridiem(isStrict, locale) {
1993
- return locale._meridiemParse;
1994
- }
1995
-
1996
- addRegexToken('a', matchMeridiem);
1997
- addRegexToken('A', matchMeridiem);
1998
- addRegexToken('H', match1to2);
1999
- addRegexToken('h', match1to2);
2000
- addRegexToken('k', match1to2);
2001
- addRegexToken('HH', match1to2, match2);
2002
- addRegexToken('hh', match1to2, match2);
2003
- addRegexToken('kk', match1to2, match2);
2004
-
2005
- addRegexToken('hmm', match3to4);
2006
- addRegexToken('hmmss', match5to6);
2007
- addRegexToken('Hmm', match3to4);
2008
- addRegexToken('Hmmss', match5to6);
2009
-
2010
- addParseToken(['H', 'HH'], HOUR);
2011
- addParseToken(['k', 'kk'], function (input, array, config) {
2012
- var kInput = toInt(input);
2013
- array[HOUR] = kInput === 24 ? 0 : kInput;
2014
- });
2015
- addParseToken(['a', 'A'], function (input, array, config) {
2016
- config._isPm = config._locale.isPM(input);
2017
- config._meridiem = input;
2018
- });
2019
- addParseToken(['h', 'hh'], function (input, array, config) {
2020
- array[HOUR] = toInt(input);
2021
- getParsingFlags(config).bigHour = true;
2022
- });
2023
- addParseToken('hmm', function (input, array, config) {
2024
- var pos = input.length - 2;
2025
- array[HOUR] = toInt(input.substr(0, pos));
2026
- array[MINUTE] = toInt(input.substr(pos));
2027
- getParsingFlags(config).bigHour = true;
2028
- });
2029
- addParseToken('hmmss', function (input, array, config) {
2030
- var pos1 = input.length - 4,
2031
- pos2 = input.length - 2;
2032
- array[HOUR] = toInt(input.substr(0, pos1));
2033
- array[MINUTE] = toInt(input.substr(pos1, 2));
2034
- array[SECOND] = toInt(input.substr(pos2));
2035
- getParsingFlags(config).bigHour = true;
2036
- });
2037
- addParseToken('Hmm', function (input, array, config) {
2038
- var pos = input.length - 2;
2039
- array[HOUR] = toInt(input.substr(0, pos));
2040
- array[MINUTE] = toInt(input.substr(pos));
2041
- });
2042
- addParseToken('Hmmss', function (input, array, config) {
2043
- var pos1 = input.length - 4,
2044
- pos2 = input.length - 2;
2045
- array[HOUR] = toInt(input.substr(0, pos1));
2046
- array[MINUTE] = toInt(input.substr(pos1, 2));
2047
- array[SECOND] = toInt(input.substr(pos2));
2048
- });
2049
-
2050
- // LOCALES
2051
-
2052
- function localeIsPM(input) {
2053
- // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays
2054
- // Using charAt should be more compatible.
2055
- return (input + '').toLowerCase().charAt(0) === 'p';
2056
- }
2057
-
2058
- var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i,
2059
- // Setting the hour should keep the time, because the user explicitly
2060
- // specified which hour they want. So trying to maintain the same hour (in
2061
- // a new timezone) makes sense. Adding/subtracting hours does not follow
2062
- // this rule.
2063
- getSetHour = makeGetSet('Hours', true);
2064
-
2065
- function localeMeridiem(hours, minutes, isLower) {
2066
- if (hours > 11) {
2067
- return isLower ? 'pm' : 'PM';
2068
- } else {
2069
- return isLower ? 'am' : 'AM';
2070
- }
2071
- }
2072
-
2073
- var baseConfig = {
2074
- calendar: defaultCalendar,
2075
- longDateFormat: defaultLongDateFormat,
2076
- invalidDate: defaultInvalidDate,
2077
- ordinal: defaultOrdinal,
2078
- dayOfMonthOrdinalParse: defaultDayOfMonthOrdinalParse,
2079
- relativeTime: defaultRelativeTime,
2080
-
2081
- months: defaultLocaleMonths,
2082
- monthsShort: defaultLocaleMonthsShort,
2083
-
2084
- week: defaultLocaleWeek,
2085
-
2086
- weekdays: defaultLocaleWeekdays,
2087
- weekdaysMin: defaultLocaleWeekdaysMin,
2088
- weekdaysShort: defaultLocaleWeekdaysShort,
2089
-
2090
- meridiemParse: defaultLocaleMeridiemParse,
2091
- };
2092
-
2093
- // internal storage for locale config files
2094
- var locales = {},
2095
- localeFamilies = {},
2096
- globalLocale;
2097
-
2098
- function commonPrefix(arr1, arr2) {
2099
- var i,
2100
- minl = Math.min(arr1.length, arr2.length);
2101
- for (i = 0; i < minl; i += 1) {
2102
- if (arr1[i] !== arr2[i]) {
2103
- return i;
2104
- }
2105
- }
2106
- return minl;
2107
- }
2108
-
2109
- function normalizeLocale(key) {
2110
- return key ? key.toLowerCase().replace('_', '-') : key;
2111
- }
2112
-
2113
- // pick the locale from the array
2114
- // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each
2115
- // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root
2116
- function chooseLocale(names) {
2117
- var i = 0,
2118
- j,
2119
- next,
2120
- locale,
2121
- split;
2122
-
2123
- while (i < names.length) {
2124
- split = normalizeLocale(names[i]).split('-');
2125
- j = split.length;
2126
- next = normalizeLocale(names[i + 1]);
2127
- next = next ? next.split('-') : null;
2128
- while (j > 0) {
2129
- locale = loadLocale(split.slice(0, j).join('-'));
2130
- if (locale) {
2131
- return locale;
2132
- }
2133
- if (
2134
- next &&
2135
- next.length >= j &&
2136
- commonPrefix(split, next) >= j - 1
2137
- ) {
2138
- //the next array item is better than a shallower substring of this one
2139
- break;
2140
- }
2141
- j--;
2142
- }
2143
- i++;
2144
- }
2145
- return globalLocale;
2146
- }
2147
-
2148
- function loadLocale(name) {
2149
- var oldLocale = null,
2150
- aliasedRequire;
2151
- // TODO: Find a better way to register and load all the locales in Node
2152
- if (
2153
- locales[name] === undefined &&
2154
- typeof module !== 'undefined' &&
2155
- module &&
2156
- module.exports
2157
- ) {
2158
- try {
2159
- oldLocale = globalLocale._abbr;
2160
- aliasedRequire = require;
2161
- __webpack_require__(679)("./" + name);
2162
- getSetGlobalLocale(oldLocale);
2163
- } catch (e) {
2164
- // mark as not found to avoid repeating expensive file require call causing high CPU
2165
- // when trying to find en-US, en_US, en-us for every format call
2166
- locales[name] = null; // null means not found
2167
- }
2168
- }
2169
- return locales[name];
2170
- }
2171
-
2172
- // This function will load locale and then set the global locale. If
2173
- // no arguments are passed in, it will simply return the current global
2174
- // locale key.
2175
- function getSetGlobalLocale(key, values) {
2176
- var data;
2177
- if (key) {
2178
- if (isUndefined(values)) {
2179
- data = getLocale(key);
2180
- } else {
2181
- data = defineLocale(key, values);
2182
- }
2183
-
2184
- if (data) {
2185
- // moment.duration._locale = moment._locale = data;
2186
- globalLocale = data;
2187
- } else {
2188
- if (typeof console !== 'undefined' && console.warn) {
2189
- //warn user if arguments are passed but the locale could not be set
2190
- console.warn(
2191
- 'Locale ' + key + ' not found. Did you forget to load it?'
2192
- );
2193
- }
2194
- }
2195
- }
2196
-
2197
- return globalLocale._abbr;
2198
- }
2199
-
2200
- function defineLocale(name, config) {
2201
- if (config !== null) {
2202
- var locale,
2203
- parentConfig = baseConfig;
2204
- config.abbr = name;
2205
- if (locales[name] != null) {
2206
- deprecateSimple(
2207
- 'defineLocaleOverride',
2208
- 'use moment.updateLocale(localeName, config) to change ' +
2209
- 'an existing locale. moment.defineLocale(localeName, ' +
2210
- 'config) should only be used for creating a new locale ' +
2211
- 'See http://momentjs.com/guides/#/warnings/define-locale/ for more info.'
2212
- );
2213
- parentConfig = locales[name]._config;
2214
- } else if (config.parentLocale != null) {
2215
- if (locales[config.parentLocale] != null) {
2216
- parentConfig = locales[config.parentLocale]._config;
2217
- } else {
2218
- locale = loadLocale(config.parentLocale);
2219
- if (locale != null) {
2220
- parentConfig = locale._config;
2221
- } else {
2222
- if (!localeFamilies[config.parentLocale]) {
2223
- localeFamilies[config.parentLocale] = [];
2224
- }
2225
- localeFamilies[config.parentLocale].push({
2226
- name: name,
2227
- config: config,
2228
- });
2229
- return null;
2230
- }
2231
- }
2232
- }
2233
- locales[name] = new Locale(mergeConfigs(parentConfig, config));
2234
-
2235
- if (localeFamilies[name]) {
2236
- localeFamilies[name].forEach(function (x) {
2237
- defineLocale(x.name, x.config);
2238
- });
2239
- }
2240
-
2241
- // backwards compat for now: also set the locale
2242
- // make sure we set the locale AFTER all child locales have been
2243
- // created, so we won't end up with the child locale set.
2244
- getSetGlobalLocale(name);
2245
-
2246
- return locales[name];
2247
- } else {
2248
- // useful for testing
2249
- delete locales[name];
2250
- return null;
2251
- }
2252
- }
2253
-
2254
- function updateLocale(name, config) {
2255
- if (config != null) {
2256
- var locale,
2257
- tmpLocale,
2258
- parentConfig = baseConfig;
2259
-
2260
- if (locales[name] != null && locales[name].parentLocale != null) {
2261
- // Update existing child locale in-place to avoid memory-leaks
2262
- locales[name].set(mergeConfigs(locales[name]._config, config));
2263
- } else {
2264
- // MERGE
2265
- tmpLocale = loadLocale(name);
2266
- if (tmpLocale != null) {
2267
- parentConfig = tmpLocale._config;
2268
- }
2269
- config = mergeConfigs(parentConfig, config);
2270
- if (tmpLocale == null) {
2271
- // updateLocale is called for creating a new locale
2272
- // Set abbr so it will have a name (getters return
2273
- // undefined otherwise).
2274
- config.abbr = name;
2275
- }
2276
- locale = new Locale(config);
2277
- locale.parentLocale = locales[name];
2278
- locales[name] = locale;
2279
- }
2280
-
2281
- // backwards compat for now: also set the locale
2282
- getSetGlobalLocale(name);
2283
- } else {
2284
- // pass null for config to unupdate, useful for tests
2285
- if (locales[name] != null) {
2286
- if (locales[name].parentLocale != null) {
2287
- locales[name] = locales[name].parentLocale;
2288
- if (name === getSetGlobalLocale()) {
2289
- getSetGlobalLocale(name);
2290
- }
2291
- } else if (locales[name] != null) {
2292
- delete locales[name];
2293
- }
2294
- }
2295
- }
2296
- return locales[name];
2297
- }
2298
-
2299
- // returns locale data
2300
- function getLocale(key) {
2301
- var locale;
2302
-
2303
- if (key && key._locale && key._locale._abbr) {
2304
- key = key._locale._abbr;
2305
- }
2306
-
2307
- if (!key) {
2308
- return globalLocale;
2309
- }
2310
-
2311
- if (!isArray(key)) {
2312
- //short-circuit everything else
2313
- locale = loadLocale(key);
2314
- if (locale) {
2315
- return locale;
2316
- }
2317
- key = [key];
2318
- }
2319
-
2320
- return chooseLocale(key);
2321
- }
2322
-
2323
- function listLocales() {
2324
- return keys(locales);
2325
- }
2326
-
2327
- function checkOverflow(m) {
2328
- var overflow,
2329
- a = m._a;
2330
-
2331
- if (a && getParsingFlags(m).overflow === -2) {
2332
- overflow =
2333
- a[MONTH] < 0 || a[MONTH] > 11
2334
- ? MONTH
2335
- : a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH])
2336
- ? DATE
2337
- : a[HOUR] < 0 ||
2338
- a[HOUR] > 24 ||
2339
- (a[HOUR] === 24 &&
2340
- (a[MINUTE] !== 0 ||
2341
- a[SECOND] !== 0 ||
2342
- a[MILLISECOND] !== 0))
2343
- ? HOUR
2344
- : a[MINUTE] < 0 || a[MINUTE] > 59
2345
- ? MINUTE
2346
- : a[SECOND] < 0 || a[SECOND] > 59
2347
- ? SECOND
2348
- : a[MILLISECOND] < 0 || a[MILLISECOND] > 999
2349
- ? MILLISECOND
2350
- : -1;
2351
-
2352
- if (
2353
- getParsingFlags(m)._overflowDayOfYear &&
2354
- (overflow < YEAR || overflow > DATE)
2355
- ) {
2356
- overflow = DATE;
2357
- }
2358
- if (getParsingFlags(m)._overflowWeeks && overflow === -1) {
2359
- overflow = WEEK;
2360
- }
2361
- if (getParsingFlags(m)._overflowWeekday && overflow === -1) {
2362
- overflow = WEEKDAY;
2363
- }
2364
-
2365
- getParsingFlags(m).overflow = overflow;
2366
- }
2367
-
2368
- return m;
2369
- }
2370
-
2371
- // iso 8601 regex
2372
- // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00)
2373
- var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
2374
- basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,
2375
- tzRegex = /Z|[+-]\d\d(?::?\d\d)?/,
2376
- isoDates = [
2377
- ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/],
2378
- ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/],
2379
- ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/],
2380
- ['GGGG-[W]WW', /\d{4}-W\d\d/, false],
2381
- ['YYYY-DDD', /\d{4}-\d{3}/],
2382
- ['YYYY-MM', /\d{4}-\d\d/, false],
2383
- ['YYYYYYMMDD', /[+-]\d{10}/],
2384
- ['YYYYMMDD', /\d{8}/],
2385
- ['GGGG[W]WWE', /\d{4}W\d{3}/],
2386
- ['GGGG[W]WW', /\d{4}W\d{2}/, false],
2387
- ['YYYYDDD', /\d{7}/],
2388
- ['YYYYMM', /\d{6}/, false],
2389
- ['YYYY', /\d{4}/, false],
2390
- ],
2391
- // iso time formats and regexes
2392
- isoTimes = [
2393
- ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/],
2394
- ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/],
2395
- ['HH:mm:ss', /\d\d:\d\d:\d\d/],
2396
- ['HH:mm', /\d\d:\d\d/],
2397
- ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/],
2398
- ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/],
2399
- ['HHmmss', /\d\d\d\d\d\d/],
2400
- ['HHmm', /\d\d\d\d/],
2401
- ['HH', /\d\d/],
2402
- ],
2403
- aspNetJsonRegex = /^\/?Date\((-?\d+)/i,
2404
- // RFC 2822 regex: For details see https://tools.ietf.org/html/rfc2822#section-3.3
2405
- rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,
2406
- obsOffsets = {
2407
- UT: 0,
2408
- GMT: 0,
2409
- EDT: -4 * 60,
2410
- EST: -5 * 60,
2411
- CDT: -5 * 60,
2412
- CST: -6 * 60,
2413
- MDT: -6 * 60,
2414
- MST: -7 * 60,
2415
- PDT: -7 * 60,
2416
- PST: -8 * 60,
2417
- };
2418
-
2419
- // date from iso format
2420
- function configFromISO(config) {
2421
- var i,
2422
- l,
2423
- string = config._i,
2424
- match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string),
2425
- allowTime,
2426
- dateFormat,
2427
- timeFormat,
2428
- tzFormat;
2429
-
2430
- if (match) {
2431
- getParsingFlags(config).iso = true;
2432
-
2433
- for (i = 0, l = isoDates.length; i < l; i++) {
2434
- if (isoDates[i][1].exec(match[1])) {
2435
- dateFormat = isoDates[i][0];
2436
- allowTime = isoDates[i][2] !== false;
2437
- break;
2438
- }
2439
- }
2440
- if (dateFormat == null) {
2441
- config._isValid = false;
2442
- return;
2443
- }
2444
- if (match[3]) {
2445
- for (i = 0, l = isoTimes.length; i < l; i++) {
2446
- if (isoTimes[i][1].exec(match[3])) {
2447
- // match[2] should be 'T' or space
2448
- timeFormat = (match[2] || ' ') + isoTimes[i][0];
2449
- break;
2450
- }
2451
- }
2452
- if (timeFormat == null) {
2453
- config._isValid = false;
2454
- return;
2455
- }
2456
- }
2457
- if (!allowTime && timeFormat != null) {
2458
- config._isValid = false;
2459
- return;
2460
- }
2461
- if (match[4]) {
2462
- if (tzRegex.exec(match[4])) {
2463
- tzFormat = 'Z';
2464
- } else {
2465
- config._isValid = false;
2466
- return;
2467
- }
2468
- }
2469
- config._f = dateFormat + (timeFormat || '') + (tzFormat || '');
2470
- configFromStringAndFormat(config);
2471
- } else {
2472
- config._isValid = false;
2473
- }
2474
- }
2475
-
2476
- function extractFromRFC2822Strings(
2477
- yearStr,
2478
- monthStr,
2479
- dayStr,
2480
- hourStr,
2481
- minuteStr,
2482
- secondStr
2483
- ) {
2484
- var result = [
2485
- untruncateYear(yearStr),
2486
- defaultLocaleMonthsShort.indexOf(monthStr),
2487
- parseInt(dayStr, 10),
2488
- parseInt(hourStr, 10),
2489
- parseInt(minuteStr, 10),
2490
- ];
2491
-
2492
- if (secondStr) {
2493
- result.push(parseInt(secondStr, 10));
2494
- }
2495
-
2496
- return result;
2497
- }
2498
-
2499
- function untruncateYear(yearStr) {
2500
- var year = parseInt(yearStr, 10);
2501
- if (year <= 49) {
2502
- return 2000 + year;
2503
- } else if (year <= 999) {
2504
- return 1900 + year;
2505
- }
2506
- return year;
2507
- }
2508
-
2509
- function preprocessRFC2822(s) {
2510
- // Remove comments and folding whitespace and replace multiple-spaces with a single space
2511
- return s
2512
- .replace(/\([^)]*\)|[\n\t]/g, ' ')
2513
- .replace(/(\s\s+)/g, ' ')
2514
- .replace(/^\s\s*/, '')
2515
- .replace(/\s\s*$/, '');
2516
- }
2517
-
2518
- function checkWeekday(weekdayStr, parsedInput, config) {
2519
- if (weekdayStr) {
2520
- // TODO: Replace the vanilla JS Date object with an independent day-of-week check.
2521
- var weekdayProvided = defaultLocaleWeekdaysShort.indexOf(weekdayStr),
2522
- weekdayActual = new Date(
2523
- parsedInput[0],
2524
- parsedInput[1],
2525
- parsedInput[2]
2526
- ).getDay();
2527
- if (weekdayProvided !== weekdayActual) {
2528
- getParsingFlags(config).weekdayMismatch = true;
2529
- config._isValid = false;
2530
- return false;
2531
- }
2532
- }
2533
- return true;
2534
- }
2535
-
2536
- function calculateOffset(obsOffset, militaryOffset, numOffset) {
2537
- if (obsOffset) {
2538
- return obsOffsets[obsOffset];
2539
- } else if (militaryOffset) {
2540
- // the only allowed military tz is Z
2541
- return 0;
2542
- } else {
2543
- var hm = parseInt(numOffset, 10),
2544
- m = hm % 100,
2545
- h = (hm - m) / 100;
2546
- return h * 60 + m;
2547
- }
2548
- }
2549
-
2550
- // date and time from ref 2822 format
2551
- function configFromRFC2822(config) {
2552
- var match = rfc2822.exec(preprocessRFC2822(config._i)),
2553
- parsedArray;
2554
- if (match) {
2555
- parsedArray = extractFromRFC2822Strings(
2556
- match[4],
2557
- match[3],
2558
- match[2],
2559
- match[5],
2560
- match[6],
2561
- match[7]
2562
- );
2563
- if (!checkWeekday(match[1], parsedArray, config)) {
2564
- return;
2565
- }
2566
-
2567
- config._a = parsedArray;
2568
- config._tzm = calculateOffset(match[8], match[9], match[10]);
2569
-
2570
- config._d = createUTCDate.apply(null, config._a);
2571
- config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
2572
-
2573
- getParsingFlags(config).rfc2822 = true;
2574
- } else {
2575
- config._isValid = false;
2576
- }
2577
- }
2578
-
2579
- // date from 1) ASP.NET, 2) ISO, 3) RFC 2822 formats, or 4) optional fallback if parsing isn't strict
2580
- function configFromString(config) {
2581
- var matched = aspNetJsonRegex.exec(config._i);
2582
- if (matched !== null) {
2583
- config._d = new Date(+matched[1]);
2584
- return;
2585
- }
2586
-
2587
- configFromISO(config);
2588
- if (config._isValid === false) {
2589
- delete config._isValid;
2590
- } else {
2591
- return;
2592
- }
2593
-
2594
- configFromRFC2822(config);
2595
- if (config._isValid === false) {
2596
- delete config._isValid;
2597
- } else {
2598
- return;
2599
- }
2600
-
2601
- if (config._strict) {
2602
- config._isValid = false;
2603
- } else {
2604
- // Final attempt, use Input Fallback
2605
- hooks.createFromInputFallback(config);
2606
- }
2607
- }
2608
-
2609
- hooks.createFromInputFallback = deprecate(
2610
- 'value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), ' +
2611
- 'which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are ' +
2612
- 'discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.',
2613
- function (config) {
2614
- config._d = new Date(config._i + (config._useUTC ? ' UTC' : ''));
2615
- }
2616
- );
2617
-
2618
- // Pick the first defined of two or three arguments.
2619
- function defaults(a, b, c) {
2620
- if (a != null) {
2621
- return a;
2622
- }
2623
- if (b != null) {
2624
- return b;
2625
- }
2626
- return c;
2627
- }
2628
-
2629
- function currentDateArray(config) {
2630
- // hooks is actually the exported moment object
2631
- var nowValue = new Date(hooks.now());
2632
- if (config._useUTC) {
2633
- return [
2634
- nowValue.getUTCFullYear(),
2635
- nowValue.getUTCMonth(),
2636
- nowValue.getUTCDate(),
2637
- ];
2638
- }
2639
- return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
2640
- }
2641
-
2642
- // convert an array to a date.
2643
- // the array should mirror the parameters below
2644
- // note: all values past the year are optional and will default to the lowest possible value.
2645
- // [year, month, day , hour, minute, second, millisecond]
2646
- function configFromArray(config) {
2647
- var i,
2648
- date,
2649
- input = [],
2650
- currentDate,
2651
- expectedWeekday,
2652
- yearToUse;
2653
-
2654
- if (config._d) {
2655
- return;
2656
- }
2657
-
2658
- currentDate = currentDateArray(config);
2659
-
2660
- //compute day of the year from weeks and weekdays
2661
- if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
2662
- dayOfYearFromWeekInfo(config);
2663
- }
2664
-
2665
- //if the day of the year is set, figure out what it is
2666
- if (config._dayOfYear != null) {
2667
- yearToUse = defaults(config._a[YEAR], currentDate[YEAR]);
2668
-
2669
- if (
2670
- config._dayOfYear > daysInYear(yearToUse) ||
2671
- config._dayOfYear === 0
2672
- ) {
2673
- getParsingFlags(config)._overflowDayOfYear = true;
2674
- }
2675
-
2676
- date = createUTCDate(yearToUse, 0, config._dayOfYear);
2677
- config._a[MONTH] = date.getUTCMonth();
2678
- config._a[DATE] = date.getUTCDate();
2679
- }
2680
-
2681
- // Default to current date.
2682
- // * if no year, month, day of month are given, default to today
2683
- // * if day of month is given, default month and year
2684
- // * if month is given, default only year
2685
- // * if year is given, don't default anything
2686
- for (i = 0; i < 3 && config._a[i] == null; ++i) {
2687
- config._a[i] = input[i] = currentDate[i];
2688
- }
2689
-
2690
- // Zero out whatever was not defaulted, including time
2691
- for (; i < 7; i++) {
2692
- config._a[i] = input[i] =
2693
- config._a[i] == null ? (i === 2 ? 1 : 0) : config._a[i];
2694
- }
2695
-
2696
- // Check for 24:00:00.000
2697
- if (
2698
- config._a[HOUR] === 24 &&
2699
- config._a[MINUTE] === 0 &&
2700
- config._a[SECOND] === 0 &&
2701
- config._a[MILLISECOND] === 0
2702
- ) {
2703
- config._nextDay = true;
2704
- config._a[HOUR] = 0;
2705
- }
2706
-
2707
- config._d = (config._useUTC ? createUTCDate : createDate).apply(
2708
- null,
2709
- input
2710
- );
2711
- expectedWeekday = config._useUTC
2712
- ? config._d.getUTCDay()
2713
- : config._d.getDay();
2714
-
2715
- // Apply timezone offset from input. The actual utcOffset can be changed
2716
- // with parseZone.
2717
- if (config._tzm != null) {
2718
- config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm);
2719
- }
2720
-
2721
- if (config._nextDay) {
2722
- config._a[HOUR] = 24;
2723
- }
2724
-
2725
- // check for mismatching day of week
2726
- if (
2727
- config._w &&
2728
- typeof config._w.d !== 'undefined' &&
2729
- config._w.d !== expectedWeekday
2730
- ) {
2731
- getParsingFlags(config).weekdayMismatch = true;
2732
- }
2733
- }
2734
-
2735
- function dayOfYearFromWeekInfo(config) {
2736
- var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
2737
-
2738
- w = config._w;
2739
- if (w.GG != null || w.W != null || w.E != null) {
2740
- dow = 1;
2741
- doy = 4;
2742
-
2743
- // TODO: We need to take the current isoWeekYear, but that depends on
2744
- // how we interpret now (local, utc, fixed offset). So create
2745
- // a now version of current config (take local/utc/offset flags, and
2746
- // create now).
2747
- weekYear = defaults(
2748
- w.GG,
2749
- config._a[YEAR],
2750
- weekOfYear(createLocal(), 1, 4).year
2751
- );
2752
- week = defaults(w.W, 1);
2753
- weekday = defaults(w.E, 1);
2754
- if (weekday < 1 || weekday > 7) {
2755
- weekdayOverflow = true;
2756
- }
2757
- } else {
2758
- dow = config._locale._week.dow;
2759
- doy = config._locale._week.doy;
2760
-
2761
- curWeek = weekOfYear(createLocal(), dow, doy);
2762
-
2763
- weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
2764
-
2765
- // Default to current week.
2766
- week = defaults(w.w, curWeek.week);
2767
-
2768
- if (w.d != null) {
2769
- // weekday -- low day numbers are considered next week
2770
- weekday = w.d;
2771
- if (weekday < 0 || weekday > 6) {
2772
- weekdayOverflow = true;
2773
- }
2774
- } else if (w.e != null) {
2775
- // local weekday -- counting starts from beginning of week
2776
- weekday = w.e + dow;
2777
- if (w.e < 0 || w.e > 6) {
2778
- weekdayOverflow = true;
2779
- }
2780
- } else {
2781
- // default to beginning of week
2782
- weekday = dow;
2783
- }
2784
- }
2785
- if (week < 1 || week > weeksInYear(weekYear, dow, doy)) {
2786
- getParsingFlags(config)._overflowWeeks = true;
2787
- } else if (weekdayOverflow != null) {
2788
- getParsingFlags(config)._overflowWeekday = true;
2789
- } else {
2790
- temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy);
2791
- config._a[YEAR] = temp.year;
2792
- config._dayOfYear = temp.dayOfYear;
2793
- }
2794
- }
2795
-
2796
- // constant that refers to the ISO standard
2797
- hooks.ISO_8601 = function () {};
2798
-
2799
- // constant that refers to the RFC 2822 form
2800
- hooks.RFC_2822 = function () {};
2801
-
2802
- // date from string and format string
2803
- function configFromStringAndFormat(config) {
2804
- // TODO: Move this to another part of the creation flow to prevent circular deps
2805
- if (config._f === hooks.ISO_8601) {
2806
- configFromISO(config);
2807
- return;
2808
- }
2809
- if (config._f === hooks.RFC_2822) {
2810
- configFromRFC2822(config);
2811
- return;
2812
- }
2813
- config._a = [];
2814
- getParsingFlags(config).empty = true;
2815
-
2816
- // This array is used to make a Date, either with `new Date` or `Date.UTC`
2817
- var string = '' + config._i,
2818
- i,
2819
- parsedInput,
2820
- tokens,
2821
- token,
2822
- skipped,
2823
- stringLength = string.length,
2824
- totalParsedInputLength = 0,
2825
- era;
2826
-
2827
- tokens =
2828
- expandFormat(config._f, config._locale).match(formattingTokens) || [];
2829
-
2830
- for (i = 0; i < tokens.length; i++) {
2831
- token = tokens[i];
2832
- parsedInput = (string.match(getParseRegexForToken(token, config)) ||
2833
- [])[0];
2834
- if (parsedInput) {
2835
- skipped = string.substr(0, string.indexOf(parsedInput));
2836
- if (skipped.length > 0) {
2837
- getParsingFlags(config).unusedInput.push(skipped);
2838
- }
2839
- string = string.slice(
2840
- string.indexOf(parsedInput) + parsedInput.length
2841
- );
2842
- totalParsedInputLength += parsedInput.length;
2843
- }
2844
- // don't parse if it's not a known token
2845
- if (formatTokenFunctions[token]) {
2846
- if (parsedInput) {
2847
- getParsingFlags(config).empty = false;
2848
- } else {
2849
- getParsingFlags(config).unusedTokens.push(token);
2850
- }
2851
- addTimeToArrayFromToken(token, parsedInput, config);
2852
- } else if (config._strict && !parsedInput) {
2853
- getParsingFlags(config).unusedTokens.push(token);
2854
- }
2855
- }
2856
-
2857
- // add remaining unparsed input length to the string
2858
- getParsingFlags(config).charsLeftOver =
2859
- stringLength - totalParsedInputLength;
2860
- if (string.length > 0) {
2861
- getParsingFlags(config).unusedInput.push(string);
2862
- }
2863
-
2864
- // clear _12h flag if hour is <= 12
2865
- if (
2866
- config._a[HOUR] <= 12 &&
2867
- getParsingFlags(config).bigHour === true &&
2868
- config._a[HOUR] > 0
2869
- ) {
2870
- getParsingFlags(config).bigHour = undefined;
2871
- }
2872
-
2873
- getParsingFlags(config).parsedDateParts = config._a.slice(0);
2874
- getParsingFlags(config).meridiem = config._meridiem;
2875
- // handle meridiem
2876
- config._a[HOUR] = meridiemFixWrap(
2877
- config._locale,
2878
- config._a[HOUR],
2879
- config._meridiem
2880
- );
2881
-
2882
- // handle era
2883
- era = getParsingFlags(config).era;
2884
- if (era !== null) {
2885
- config._a[YEAR] = config._locale.erasConvertYear(era, config._a[YEAR]);
2886
- }
2887
-
2888
- configFromArray(config);
2889
- checkOverflow(config);
2890
- }
2891
-
2892
- function meridiemFixWrap(locale, hour, meridiem) {
2893
- var isPm;
2894
-
2895
- if (meridiem == null) {
2896
- // nothing to do
2897
- return hour;
2898
- }
2899
- if (locale.meridiemHour != null) {
2900
- return locale.meridiemHour(hour, meridiem);
2901
- } else if (locale.isPM != null) {
2902
- // Fallback
2903
- isPm = locale.isPM(meridiem);
2904
- if (isPm && hour < 12) {
2905
- hour += 12;
2906
- }
2907
- if (!isPm && hour === 12) {
2908
- hour = 0;
2909
- }
2910
- return hour;
2911
- } else {
2912
- // this is not supposed to happen
2913
- return hour;
2914
- }
2915
- }
2916
-
2917
- // date from string and array of format strings
2918
- function configFromStringAndArray(config) {
2919
- var tempConfig,
2920
- bestMoment,
2921
- scoreToBeat,
2922
- i,
2923
- currentScore,
2924
- validFormatFound,
2925
- bestFormatIsValid = false;
2926
-
2927
- if (config._f.length === 0) {
2928
- getParsingFlags(config).invalidFormat = true;
2929
- config._d = new Date(NaN);
2930
- return;
2931
- }
2932
-
2933
- for (i = 0; i < config._f.length; i++) {
2934
- currentScore = 0;
2935
- validFormatFound = false;
2936
- tempConfig = copyConfig({}, config);
2937
- if (config._useUTC != null) {
2938
- tempConfig._useUTC = config._useUTC;
2939
- }
2940
- tempConfig._f = config._f[i];
2941
- configFromStringAndFormat(tempConfig);
2942
-
2943
- if (isValid(tempConfig)) {
2944
- validFormatFound = true;
2945
- }
2946
-
2947
- // if there is any input that was not parsed add a penalty for that format
2948
- currentScore += getParsingFlags(tempConfig).charsLeftOver;
2949
-
2950
- //or tokens
2951
- currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10;
2952
-
2953
- getParsingFlags(tempConfig).score = currentScore;
2954
-
2955
- if (!bestFormatIsValid) {
2956
- if (
2957
- scoreToBeat == null ||
2958
- currentScore < scoreToBeat ||
2959
- validFormatFound
2960
- ) {
2961
- scoreToBeat = currentScore;
2962
- bestMoment = tempConfig;
2963
- if (validFormatFound) {
2964
- bestFormatIsValid = true;
2965
- }
2966
- }
2967
- } else {
2968
- if (currentScore < scoreToBeat) {
2969
- scoreToBeat = currentScore;
2970
- bestMoment = tempConfig;
2971
- }
2972
- }
2973
- }
2974
-
2975
- extend(config, bestMoment || tempConfig);
2976
- }
2977
-
2978
- function configFromObject(config) {
2979
- if (config._d) {
2980
- return;
2981
- }
2982
-
2983
- var i = normalizeObjectUnits(config._i),
2984
- dayOrDate = i.day === undefined ? i.date : i.day;
2985
- config._a = map(
2986
- [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],
2987
- function (obj) {
2988
- return obj && parseInt(obj, 10);
2989
- }
2990
- );
2991
-
2992
- configFromArray(config);
2993
- }
2994
-
2995
- function createFromConfig(config) {
2996
- var res = new Moment(checkOverflow(prepareConfig(config)));
2997
- if (res._nextDay) {
2998
- // Adding is smart enough around DST
2999
- res.add(1, 'd');
3000
- res._nextDay = undefined;
3001
- }
3002
-
3003
- return res;
3004
- }
3005
-
3006
- function prepareConfig(config) {
3007
- var input = config._i,
3008
- format = config._f;
3009
-
3010
- config._locale = config._locale || getLocale(config._l);
3011
-
3012
- if (input === null || (format === undefined && input === '')) {
3013
- return createInvalid({ nullInput: true });
3014
- }
3015
-
3016
- if (typeof input === 'string') {
3017
- config._i = input = config._locale.preparse(input);
3018
- }
3019
-
3020
- if (isMoment(input)) {
3021
- return new Moment(checkOverflow(input));
3022
- } else if (isDate(input)) {
3023
- config._d = input;
3024
- } else if (isArray(format)) {
3025
- configFromStringAndArray(config);
3026
- } else if (format) {
3027
- configFromStringAndFormat(config);
3028
- } else {
3029
- configFromInput(config);
3030
- }
3031
-
3032
- if (!isValid(config)) {
3033
- config._d = null;
3034
- }
3035
-
3036
- return config;
3037
- }
3038
-
3039
- function configFromInput(config) {
3040
- var input = config._i;
3041
- if (isUndefined(input)) {
3042
- config._d = new Date(hooks.now());
3043
- } else if (isDate(input)) {
3044
- config._d = new Date(input.valueOf());
3045
- } else if (typeof input === 'string') {
3046
- configFromString(config);
3047
- } else if (isArray(input)) {
3048
- config._a = map(input.slice(0), function (obj) {
3049
- return parseInt(obj, 10);
3050
- });
3051
- configFromArray(config);
3052
- } else if (isObject(input)) {
3053
- configFromObject(config);
3054
- } else if (isNumber(input)) {
3055
- // from milliseconds
3056
- config._d = new Date(input);
3057
- } else {
3058
- hooks.createFromInputFallback(config);
3059
- }
3060
- }
3061
-
3062
- function createLocalOrUTC(input, format, locale, strict, isUTC) {
3063
- var c = {};
3064
-
3065
- if (format === true || format === false) {
3066
- strict = format;
3067
- format = undefined;
3068
- }
3069
-
3070
- if (locale === true || locale === false) {
3071
- strict = locale;
3072
- locale = undefined;
3073
- }
3074
-
3075
- if (
3076
- (isObject(input) && isObjectEmpty(input)) ||
3077
- (isArray(input) && input.length === 0)
3078
- ) {
3079
- input = undefined;
3080
- }
3081
- // object construction must be done this way.
3082
- // https://github.com/moment/moment/issues/1423
3083
- c._isAMomentObject = true;
3084
- c._useUTC = c._isUTC = isUTC;
3085
- c._l = locale;
3086
- c._i = input;
3087
- c._f = format;
3088
- c._strict = strict;
3089
-
3090
- return createFromConfig(c);
3091
- }
3092
-
3093
- function createLocal(input, format, locale, strict) {
3094
- return createLocalOrUTC(input, format, locale, strict, false);
3095
- }
3096
-
3097
- var prototypeMin = deprecate(
3098
- 'moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/',
3099
- function () {
3100
- var other = createLocal.apply(null, arguments);
3101
- if (this.isValid() && other.isValid()) {
3102
- return other < this ? this : other;
3103
- } else {
3104
- return createInvalid();
3105
- }
3106
- }
3107
- ),
3108
- prototypeMax = deprecate(
3109
- 'moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/',
3110
- function () {
3111
- var other = createLocal.apply(null, arguments);
3112
- if (this.isValid() && other.isValid()) {
3113
- return other > this ? this : other;
3114
- } else {
3115
- return createInvalid();
3116
- }
3117
- }
3118
- );
3119
-
3120
- // Pick a moment m from moments so that m[fn](other) is true for all
3121
- // other. This relies on the function fn to be transitive.
3122
- //
3123
- // moments should either be an array of moment objects or an array, whose
3124
- // first element is an array of moment objects.
3125
- function pickBy(fn, moments) {
3126
- var res, i;
3127
- if (moments.length === 1 && isArray(moments[0])) {
3128
- moments = moments[0];
3129
- }
3130
- if (!moments.length) {
3131
- return createLocal();
3132
- }
3133
- res = moments[0];
3134
- for (i = 1; i < moments.length; ++i) {
3135
- if (!moments[i].isValid() || moments[i][fn](res)) {
3136
- res = moments[i];
3137
- }
3138
- }
3139
- return res;
3140
- }
3141
-
3142
- // TODO: Use [].sort instead?
3143
- function min() {
3144
- var args = [].slice.call(arguments, 0);
3145
-
3146
- return pickBy('isBefore', args);
3147
- }
3148
-
3149
- function max() {
3150
- var args = [].slice.call(arguments, 0);
3151
-
3152
- return pickBy('isAfter', args);
3153
- }
3154
-
3155
- var now = function () {
3156
- return Date.now ? Date.now() : +new Date();
3157
- };
3158
-
3159
- var ordering = [
3160
- 'year',
3161
- 'quarter',
3162
- 'month',
3163
- 'week',
3164
- 'day',
3165
- 'hour',
3166
- 'minute',
3167
- 'second',
3168
- 'millisecond',
3169
- ];
3170
-
3171
- function isDurationValid(m) {
3172
- var key,
3173
- unitHasDecimal = false,
3174
- i;
3175
- for (key in m) {
3176
- if (
3177
- hasOwnProp(m, key) &&
3178
- !(
3179
- indexOf.call(ordering, key) !== -1 &&
3180
- (m[key] == null || !isNaN(m[key]))
3181
- )
3182
- ) {
3183
- return false;
3184
- }
3185
- }
3186
-
3187
- for (i = 0; i < ordering.length; ++i) {
3188
- if (m[ordering[i]]) {
3189
- if (unitHasDecimal) {
3190
- return false; // only allow non-integers for smallest unit
3191
- }
3192
- if (parseFloat(m[ordering[i]]) !== toInt(m[ordering[i]])) {
3193
- unitHasDecimal = true;
3194
- }
3195
- }
3196
- }
3197
-
3198
- return true;
3199
- }
3200
-
3201
- function isValid$1() {
3202
- return this._isValid;
3203
- }
3204
-
3205
- function createInvalid$1() {
3206
- return createDuration(NaN);
3207
- }
3208
-
3209
- function Duration(duration) {
3210
- var normalizedInput = normalizeObjectUnits(duration),
3211
- years = normalizedInput.year || 0,
3212
- quarters = normalizedInput.quarter || 0,
3213
- months = normalizedInput.month || 0,
3214
- weeks = normalizedInput.week || normalizedInput.isoWeek || 0,
3215
- days = normalizedInput.day || 0,
3216
- hours = normalizedInput.hour || 0,
3217
- minutes = normalizedInput.minute || 0,
3218
- seconds = normalizedInput.second || 0,
3219
- milliseconds = normalizedInput.millisecond || 0;
3220
-
3221
- this._isValid = isDurationValid(normalizedInput);
3222
-
3223
- // representation for dateAddRemove
3224
- this._milliseconds =
3225
- +milliseconds +
3226
- seconds * 1e3 + // 1000
3227
- minutes * 6e4 + // 1000 * 60
3228
- hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978
3229
- // Because of dateAddRemove treats 24 hours as different from a
3230
- // day when working around DST, we need to store them separately
3231
- this._days = +days + weeks * 7;
3232
- // It is impossible to translate months into days without knowing
3233
- // which months you are are talking about, so we have to store
3234
- // it separately.
3235
- this._months = +months + quarters * 3 + years * 12;
3236
-
3237
- this._data = {};
3238
-
3239
- this._locale = getLocale();
3240
-
3241
- this._bubble();
3242
- }
3243
-
3244
- function isDuration(obj) {
3245
- return obj instanceof Duration;
3246
- }
3247
-
3248
- function absRound(number) {
3249
- if (number < 0) {
3250
- return Math.round(-1 * number) * -1;
3251
- } else {
3252
- return Math.round(number);
3253
- }
3254
- }
3255
-
3256
- // compare two arrays, return the number of differences
3257
- function compareArrays(array1, array2, dontConvert) {
3258
- var len = Math.min(array1.length, array2.length),
3259
- lengthDiff = Math.abs(array1.length - array2.length),
3260
- diffs = 0,
3261
- i;
3262
- for (i = 0; i < len; i++) {
3263
- if (
3264
- (dontConvert && array1[i] !== array2[i]) ||
3265
- (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))
3266
- ) {
3267
- diffs++;
3268
- }
3269
- }
3270
- return diffs + lengthDiff;
3271
- }
3272
-
3273
- // FORMATTING
3274
-
3275
- function offset(token, separator) {
3276
- addFormatToken(token, 0, 0, function () {
3277
- var offset = this.utcOffset(),
3278
- sign = '+';
3279
- if (offset < 0) {
3280
- offset = -offset;
3281
- sign = '-';
3282
- }
3283
- return (
3284
- sign +
3285
- zeroFill(~~(offset / 60), 2) +
3286
- separator +
3287
- zeroFill(~~offset % 60, 2)
3288
- );
3289
- });
3290
- }
3291
-
3292
- offset('Z', ':');
3293
- offset('ZZ', '');
3294
-
3295
- // PARSING
3296
-
3297
- addRegexToken('Z', matchShortOffset);
3298
- addRegexToken('ZZ', matchShortOffset);
3299
- addParseToken(['Z', 'ZZ'], function (input, array, config) {
3300
- config._useUTC = true;
3301
- config._tzm = offsetFromString(matchShortOffset, input);
3302
- });
3303
-
3304
- // HELPERS
3305
-
3306
- // timezone chunker
3307
- // '+10:00' > ['10', '00']
3308
- // '-1530' > ['-15', '30']
3309
- var chunkOffset = /([\+\-]|\d\d)/gi;
3310
-
3311
- function offsetFromString(matcher, string) {
3312
- var matches = (string || '').match(matcher),
3313
- chunk,
3314
- parts,
3315
- minutes;
3316
-
3317
- if (matches === null) {
3318
- return null;
3319
- }
3320
-
3321
- chunk = matches[matches.length - 1] || [];
3322
- parts = (chunk + '').match(chunkOffset) || ['-', 0, 0];
3323
- minutes = +(parts[1] * 60) + toInt(parts[2]);
3324
-
3325
- return minutes === 0 ? 0 : parts[0] === '+' ? minutes : -minutes;
3326
- }
3327
-
3328
- // Return a moment from input, that is local/utc/zone equivalent to model.
3329
- function cloneWithOffset(input, model) {
3330
- var res, diff;
3331
- if (model._isUTC) {
3332
- res = model.clone();
3333
- diff =
3334
- (isMoment(input) || isDate(input)
3335
- ? input.valueOf()
3336
- : createLocal(input).valueOf()) - res.valueOf();
3337
- // Use low-level api, because this fn is low-level api.
3338
- res._d.setTime(res._d.valueOf() + diff);
3339
- hooks.updateOffset(res, false);
3340
- return res;
3341
- } else {
3342
- return createLocal(input).local();
3343
- }
3344
- }
3345
-
3346
- function getDateOffset(m) {
3347
- // On Firefox.24 Date#getTimezoneOffset returns a floating point.
3348
- // https://github.com/moment/moment/pull/1871
3349
- return -Math.round(m._d.getTimezoneOffset());
3350
- }
3351
-
3352
- // HOOKS
3353
-
3354
- // This function will be called whenever a moment is mutated.
3355
- // It is intended to keep the offset in sync with the timezone.
3356
- hooks.updateOffset = function () {};
3357
-
3358
- // MOMENTS
3359
-
3360
- // keepLocalTime = true means only change the timezone, without
3361
- // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]-->
3362
- // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset
3363
- // +0200, so we adjust the time as needed, to be valid.
3364
- //
3365
- // Keeping the time actually adds/subtracts (one hour)
3366
- // from the actual represented time. That is why we call updateOffset
3367
- // a second time. In case it wants us to change the offset again
3368
- // _changeInProgress == true case, then we have to adjust, because
3369
- // there is no such time in the given timezone.
3370
- function getSetOffset(input, keepLocalTime, keepMinutes) {
3371
- var offset = this._offset || 0,
3372
- localAdjust;
3373
- if (!this.isValid()) {
3374
- return input != null ? this : NaN;
3375
- }
3376
- if (input != null) {
3377
- if (typeof input === 'string') {
3378
- input = offsetFromString(matchShortOffset, input);
3379
- if (input === null) {
3380
- return this;
3381
- }
3382
- } else if (Math.abs(input) < 16 && !keepMinutes) {
3383
- input = input * 60;
3384
- }
3385
- if (!this._isUTC && keepLocalTime) {
3386
- localAdjust = getDateOffset(this);
3387
- }
3388
- this._offset = input;
3389
- this._isUTC = true;
3390
- if (localAdjust != null) {
3391
- this.add(localAdjust, 'm');
3392
- }
3393
- if (offset !== input) {
3394
- if (!keepLocalTime || this._changeInProgress) {
3395
- addSubtract(
3396
- this,
3397
- createDuration(input - offset, 'm'),
3398
- 1,
3399
- false
3400
- );
3401
- } else if (!this._changeInProgress) {
3402
- this._changeInProgress = true;
3403
- hooks.updateOffset(this, true);
3404
- this._changeInProgress = null;
3405
- }
3406
- }
3407
- return this;
3408
- } else {
3409
- return this._isUTC ? offset : getDateOffset(this);
3410
- }
3411
- }
3412
-
3413
- function getSetZone(input, keepLocalTime) {
3414
- if (input != null) {
3415
- if (typeof input !== 'string') {
3416
- input = -input;
3417
- }
3418
-
3419
- this.utcOffset(input, keepLocalTime);
3420
-
3421
- return this;
3422
- } else {
3423
- return -this.utcOffset();
3424
- }
3425
- }
3426
-
3427
- function setOffsetToUTC(keepLocalTime) {
3428
- return this.utcOffset(0, keepLocalTime);
3429
- }
3430
-
3431
- function setOffsetToLocal(keepLocalTime) {
3432
- if (this._isUTC) {
3433
- this.utcOffset(0, keepLocalTime);
3434
- this._isUTC = false;
3435
-
3436
- if (keepLocalTime) {
3437
- this.subtract(getDateOffset(this), 'm');
3438
- }
3439
- }
3440
- return this;
3441
- }
3442
-
3443
- function setOffsetToParsedOffset() {
3444
- if (this._tzm != null) {
3445
- this.utcOffset(this._tzm, false, true);
3446
- } else if (typeof this._i === 'string') {
3447
- var tZone = offsetFromString(matchOffset, this._i);
3448
- if (tZone != null) {
3449
- this.utcOffset(tZone);
3450
- } else {
3451
- this.utcOffset(0, true);
3452
- }
3453
- }
3454
- return this;
3455
- }
3456
-
3457
- function hasAlignedHourOffset(input) {
3458
- if (!this.isValid()) {
3459
- return false;
3460
- }
3461
- input = input ? createLocal(input).utcOffset() : 0;
3462
-
3463
- return (this.utcOffset() - input) % 60 === 0;
3464
- }
3465
-
3466
- function isDaylightSavingTime() {
3467
- return (
3468
- this.utcOffset() > this.clone().month(0).utcOffset() ||
3469
- this.utcOffset() > this.clone().month(5).utcOffset()
3470
- );
3471
- }
3472
-
3473
- function isDaylightSavingTimeShifted() {
3474
- if (!isUndefined(this._isDSTShifted)) {
3475
- return this._isDSTShifted;
3476
- }
3477
-
3478
- var c = {},
3479
- other;
3480
-
3481
- copyConfig(c, this);
3482
- c = prepareConfig(c);
3483
-
3484
- if (c._a) {
3485
- other = c._isUTC ? createUTC(c._a) : createLocal(c._a);
3486
- this._isDSTShifted =
3487
- this.isValid() && compareArrays(c._a, other.toArray()) > 0;
3488
- } else {
3489
- this._isDSTShifted = false;
3490
- }
3491
-
3492
- return this._isDSTShifted;
3493
- }
3494
-
3495
- function isLocal() {
3496
- return this.isValid() ? !this._isUTC : false;
3497
- }
3498
-
3499
- function isUtcOffset() {
3500
- return this.isValid() ? this._isUTC : false;
3501
- }
3502
-
3503
- function isUtc() {
3504
- return this.isValid() ? this._isUTC && this._offset === 0 : false;
3505
- }
3506
-
3507
- // ASP.NET json date format regex
3508
- var aspNetRegex = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,
3509
- // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html
3510
- // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere
3511
- // and further modified to allow for strings containing both week and day
3512
- isoRegex = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
3513
-
3514
- function createDuration(input, key) {
3515
- var duration = input,
3516
- // matching against regexp is expensive, do it on demand
3517
- match = null,
3518
- sign,
3519
- ret,
3520
- diffRes;
3521
-
3522
- if (isDuration(input)) {
3523
- duration = {
3524
- ms: input._milliseconds,
3525
- d: input._days,
3526
- M: input._months,
3527
- };
3528
- } else if (isNumber(input) || !isNaN(+input)) {
3529
- duration = {};
3530
- if (key) {
3531
- duration[key] = +input;
3532
- } else {
3533
- duration.milliseconds = +input;
3534
- }
3535
- } else if ((match = aspNetRegex.exec(input))) {
3536
- sign = match[1] === '-' ? -1 : 1;
3537
- duration = {
3538
- y: 0,
3539
- d: toInt(match[DATE]) * sign,
3540
- h: toInt(match[HOUR]) * sign,
3541
- m: toInt(match[MINUTE]) * sign,
3542
- s: toInt(match[SECOND]) * sign,
3543
- ms: toInt(absRound(match[MILLISECOND] * 1000)) * sign, // the millisecond decimal point is included in the match
3544
- };
3545
- } else if ((match = isoRegex.exec(input))) {
3546
- sign = match[1] === '-' ? -1 : 1;
3547
- duration = {
3548
- y: parseIso(match[2], sign),
3549
- M: parseIso(match[3], sign),
3550
- w: parseIso(match[4], sign),
3551
- d: parseIso(match[5], sign),
3552
- h: parseIso(match[6], sign),
3553
- m: parseIso(match[7], sign),
3554
- s: parseIso(match[8], sign),
3555
- };
3556
- } else if (duration == null) {
3557
- // checks for null or undefined
3558
- duration = {};
3559
- } else if (
3560
- typeof duration === 'object' &&
3561
- ('from' in duration || 'to' in duration)
3562
- ) {
3563
- diffRes = momentsDifference(
3564
- createLocal(duration.from),
3565
- createLocal(duration.to)
3566
- );
3567
-
3568
- duration = {};
3569
- duration.ms = diffRes.milliseconds;
3570
- duration.M = diffRes.months;
3571
- }
3572
-
3573
- ret = new Duration(duration);
3574
-
3575
- if (isDuration(input) && hasOwnProp(input, '_locale')) {
3576
- ret._locale = input._locale;
3577
- }
3578
-
3579
- if (isDuration(input) && hasOwnProp(input, '_isValid')) {
3580
- ret._isValid = input._isValid;
3581
- }
3582
-
3583
- return ret;
3584
- }
3585
-
3586
- createDuration.fn = Duration.prototype;
3587
- createDuration.invalid = createInvalid$1;
3588
-
3589
- function parseIso(inp, sign) {
3590
- // We'd normally use ~~inp for this, but unfortunately it also
3591
- // converts floats to ints.
3592
- // inp may be undefined, so careful calling replace on it.
3593
- var res = inp && parseFloat(inp.replace(',', '.'));
3594
- // apply sign while we're at it
3595
- return (isNaN(res) ? 0 : res) * sign;
3596
- }
3597
-
3598
- function positiveMomentsDifference(base, other) {
3599
- var res = {};
3600
-
3601
- res.months =
3602
- other.month() - base.month() + (other.year() - base.year()) * 12;
3603
- if (base.clone().add(res.months, 'M').isAfter(other)) {
3604
- --res.months;
3605
- }
3606
-
3607
- res.milliseconds = +other - +base.clone().add(res.months, 'M');
3608
-
3609
- return res;
3610
- }
3611
-
3612
- function momentsDifference(base, other) {
3613
- var res;
3614
- if (!(base.isValid() && other.isValid())) {
3615
- return { milliseconds: 0, months: 0 };
3616
- }
3617
-
3618
- other = cloneWithOffset(other, base);
3619
- if (base.isBefore(other)) {
3620
- res = positiveMomentsDifference(base, other);
3621
- } else {
3622
- res = positiveMomentsDifference(other, base);
3623
- res.milliseconds = -res.milliseconds;
3624
- res.months = -res.months;
3625
- }
3626
-
3627
- return res;
3628
- }
3629
-
3630
- // TODO: remove 'name' arg after deprecation is removed
3631
- function createAdder(direction, name) {
3632
- return function (val, period) {
3633
- var dur, tmp;
3634
- //invert the arguments, but complain about it
3635
- if (period !== null && !isNaN(+period)) {
3636
- deprecateSimple(
3637
- name,
3638
- 'moment().' +
3639
- name +
3640
- '(period, number) is deprecated. Please use moment().' +
3641
- name +
3642
- '(number, period). ' +
3643
- 'See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info.'
3644
- );
3645
- tmp = val;
3646
- val = period;
3647
- period = tmp;
3648
- }
3649
-
3650
- dur = createDuration(val, period);
3651
- addSubtract(this, dur, direction);
3652
- return this;
3653
- };
3654
- }
3655
-
3656
- function addSubtract(mom, duration, isAdding, updateOffset) {
3657
- var milliseconds = duration._milliseconds,
3658
- days = absRound(duration._days),
3659
- months = absRound(duration._months);
3660
-
3661
- if (!mom.isValid()) {
3662
- // No op
3663
- return;
3664
- }
3665
-
3666
- updateOffset = updateOffset == null ? true : updateOffset;
3667
-
3668
- if (months) {
3669
- setMonth(mom, get(mom, 'Month') + months * isAdding);
3670
- }
3671
- if (days) {
3672
- set$1(mom, 'Date', get(mom, 'Date') + days * isAdding);
3673
- }
3674
- if (milliseconds) {
3675
- mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding);
3676
- }
3677
- if (updateOffset) {
3678
- hooks.updateOffset(mom, days || months);
3679
- }
3680
- }
3681
-
3682
- var add = createAdder(1, 'add'),
3683
- subtract = createAdder(-1, 'subtract');
3684
-
3685
- function isString(input) {
3686
- return typeof input === 'string' || input instanceof String;
3687
- }
3688
-
3689
- // type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined
3690
- function isMomentInput(input) {
3691
- return (
3692
- isMoment(input) ||
3693
- isDate(input) ||
3694
- isString(input) ||
3695
- isNumber(input) ||
3696
- isNumberOrStringArray(input) ||
3697
- isMomentInputObject(input) ||
3698
- input === null ||
3699
- input === undefined
3700
- );
3701
- }
3702
-
3703
- function isMomentInputObject(input) {
3704
- var objectTest = isObject(input) && !isObjectEmpty(input),
3705
- propertyTest = false,
3706
- properties = [
3707
- 'years',
3708
- 'year',
3709
- 'y',
3710
- 'months',
3711
- 'month',
3712
- 'M',
3713
- 'days',
3714
- 'day',
3715
- 'd',
3716
- 'dates',
3717
- 'date',
3718
- 'D',
3719
- 'hours',
3720
- 'hour',
3721
- 'h',
3722
- 'minutes',
3723
- 'minute',
3724
- 'm',
3725
- 'seconds',
3726
- 'second',
3727
- 's',
3728
- 'milliseconds',
3729
- 'millisecond',
3730
- 'ms',
3731
- ],
3732
- i,
3733
- property;
3734
-
3735
- for (i = 0; i < properties.length; i += 1) {
3736
- property = properties[i];
3737
- propertyTest = propertyTest || hasOwnProp(input, property);
3738
- }
3739
-
3740
- return objectTest && propertyTest;
3741
- }
3742
-
3743
- function isNumberOrStringArray(input) {
3744
- var arrayTest = isArray(input),
3745
- dataTypeTest = false;
3746
- if (arrayTest) {
3747
- dataTypeTest =
3748
- input.filter(function (item) {
3749
- return !isNumber(item) && isString(input);
3750
- }).length === 0;
3751
- }
3752
- return arrayTest && dataTypeTest;
3753
- }
3754
-
3755
- function isCalendarSpec(input) {
3756
- var objectTest = isObject(input) && !isObjectEmpty(input),
3757
- propertyTest = false,
3758
- properties = [
3759
- 'sameDay',
3760
- 'nextDay',
3761
- 'lastDay',
3762
- 'nextWeek',
3763
- 'lastWeek',
3764
- 'sameElse',
3765
- ],
3766
- i,
3767
- property;
3768
-
3769
- for (i = 0; i < properties.length; i += 1) {
3770
- property = properties[i];
3771
- propertyTest = propertyTest || hasOwnProp(input, property);
3772
- }
3773
-
3774
- return objectTest && propertyTest;
3775
- }
3776
-
3777
- function getCalendarFormat(myMoment, now) {
3778
- var diff = myMoment.diff(now, 'days', true);
3779
- return diff < -6
3780
- ? 'sameElse'
3781
- : diff < -1
3782
- ? 'lastWeek'
3783
- : diff < 0
3784
- ? 'lastDay'
3785
- : diff < 1
3786
- ? 'sameDay'
3787
- : diff < 2
3788
- ? 'nextDay'
3789
- : diff < 7
3790
- ? 'nextWeek'
3791
- : 'sameElse';
3792
- }
3793
-
3794
- function calendar$1(time, formats) {
3795
- // Support for single parameter, formats only overload to the calendar function
3796
- if (arguments.length === 1) {
3797
- if (!arguments[0]) {
3798
- time = undefined;
3799
- formats = undefined;
3800
- } else if (isMomentInput(arguments[0])) {
3801
- time = arguments[0];
3802
- formats = undefined;
3803
- } else if (isCalendarSpec(arguments[0])) {
3804
- formats = arguments[0];
3805
- time = undefined;
3806
- }
3807
- }
3808
- // We want to compare the start of today, vs this.
3809
- // Getting start-of-today depends on whether we're local/utc/offset or not.
3810
- var now = time || createLocal(),
3811
- sod = cloneWithOffset(now, this).startOf('day'),
3812
- format = hooks.calendarFormat(this, sod) || 'sameElse',
3813
- output =
3814
- formats &&
3815
- (isFunction(formats[format])
3816
- ? formats[format].call(this, now)
3817
- : formats[format]);
3818
-
3819
- return this.format(
3820
- output || this.localeData().calendar(format, this, createLocal(now))
3821
- );
3822
- }
3823
-
3824
- function clone() {
3825
- return new Moment(this);
3826
- }
3827
-
3828
- function isAfter(input, units) {
3829
- var localInput = isMoment(input) ? input : createLocal(input);
3830
- if (!(this.isValid() && localInput.isValid())) {
3831
- return false;
3832
- }
3833
- units = normalizeUnits(units) || 'millisecond';
3834
- if (units === 'millisecond') {
3835
- return this.valueOf() > localInput.valueOf();
3836
- } else {
3837
- return localInput.valueOf() < this.clone().startOf(units).valueOf();
3838
- }
3839
- }
3840
-
3841
- function isBefore(input, units) {
3842
- var localInput = isMoment(input) ? input : createLocal(input);
3843
- if (!(this.isValid() && localInput.isValid())) {
3844
- return false;
3845
- }
3846
- units = normalizeUnits(units) || 'millisecond';
3847
- if (units === 'millisecond') {
3848
- return this.valueOf() < localInput.valueOf();
3849
- } else {
3850
- return this.clone().endOf(units).valueOf() < localInput.valueOf();
3851
- }
3852
- }
3853
-
3854
- function isBetween(from, to, units, inclusivity) {
3855
- var localFrom = isMoment(from) ? from : createLocal(from),
3856
- localTo = isMoment(to) ? to : createLocal(to);
3857
- if (!(this.isValid() && localFrom.isValid() && localTo.isValid())) {
3858
- return false;
3859
- }
3860
- inclusivity = inclusivity || '()';
3861
- return (
3862
- (inclusivity[0] === '('
3863
- ? this.isAfter(localFrom, units)
3864
- : !this.isBefore(localFrom, units)) &&
3865
- (inclusivity[1] === ')'
3866
- ? this.isBefore(localTo, units)
3867
- : !this.isAfter(localTo, units))
3868
- );
3869
- }
3870
-
3871
- function isSame(input, units) {
3872
- var localInput = isMoment(input) ? input : createLocal(input),
3873
- inputMs;
3874
- if (!(this.isValid() && localInput.isValid())) {
3875
- return false;
3876
- }
3877
- units = normalizeUnits(units) || 'millisecond';
3878
- if (units === 'millisecond') {
3879
- return this.valueOf() === localInput.valueOf();
3880
- } else {
3881
- inputMs = localInput.valueOf();
3882
- return (
3883
- this.clone().startOf(units).valueOf() <= inputMs &&
3884
- inputMs <= this.clone().endOf(units).valueOf()
3885
- );
3886
- }
3887
- }
3888
-
3889
- function isSameOrAfter(input, units) {
3890
- return this.isSame(input, units) || this.isAfter(input, units);
3891
- }
3892
-
3893
- function isSameOrBefore(input, units) {
3894
- return this.isSame(input, units) || this.isBefore(input, units);
3895
- }
3896
-
3897
- function diff(input, units, asFloat) {
3898
- var that, zoneDelta, output;
3899
-
3900
- if (!this.isValid()) {
3901
- return NaN;
3902
- }
3903
-
3904
- that = cloneWithOffset(input, this);
3905
-
3906
- if (!that.isValid()) {
3907
- return NaN;
3908
- }
3909
-
3910
- zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4;
3911
-
3912
- units = normalizeUnits(units);
3913
-
3914
- switch (units) {
3915
- case 'year':
3916
- output = monthDiff(this, that) / 12;
3917
- break;
3918
- case 'month':
3919
- output = monthDiff(this, that);
3920
- break;
3921
- case 'quarter':
3922
- output = monthDiff(this, that) / 3;
3923
- break;
3924
- case 'second':
3925
- output = (this - that) / 1e3;
3926
- break; // 1000
3927
- case 'minute':
3928
- output = (this - that) / 6e4;
3929
- break; // 1000 * 60
3930
- case 'hour':
3931
- output = (this - that) / 36e5;
3932
- break; // 1000 * 60 * 60
3933
- case 'day':
3934
- output = (this - that - zoneDelta) / 864e5;
3935
- break; // 1000 * 60 * 60 * 24, negate dst
3936
- case 'week':
3937
- output = (this - that - zoneDelta) / 6048e5;
3938
- break; // 1000 * 60 * 60 * 24 * 7, negate dst
3939
- default:
3940
- output = this - that;
3941
- }
3942
-
3943
- return asFloat ? output : absFloor(output);
3944
- }
3945
-
3946
- function monthDiff(a, b) {
3947
- if (a.date() < b.date()) {
3948
- // end-of-month calculations work correct when the start month has more
3949
- // days than the end month.
3950
- return -monthDiff(b, a);
3951
- }
3952
- // difference in months
3953
- var wholeMonthDiff = (b.year() - a.year()) * 12 + (b.month() - a.month()),
3954
- // b is in (anchor - 1 month, anchor + 1 month)
3955
- anchor = a.clone().add(wholeMonthDiff, 'months'),
3956
- anchor2,
3957
- adjust;
3958
-
3959
- if (b - anchor < 0) {
3960
- anchor2 = a.clone().add(wholeMonthDiff - 1, 'months');
3961
- // linear across the month
3962
- adjust = (b - anchor) / (anchor - anchor2);
3963
- } else {
3964
- anchor2 = a.clone().add(wholeMonthDiff + 1, 'months');
3965
- // linear across the month
3966
- adjust = (b - anchor) / (anchor2 - anchor);
3967
- }
3968
-
3969
- //check for negative zero, return zero if negative zero
3970
- return -(wholeMonthDiff + adjust) || 0;
3971
- }
3972
-
3973
- hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ';
3974
- hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]';
3975
-
3976
- function toString() {
3977
- return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ');
3978
- }
3979
-
3980
- function toISOString(keepOffset) {
3981
- if (!this.isValid()) {
3982
- return null;
3983
- }
3984
- var utc = keepOffset !== true,
3985
- m = utc ? this.clone().utc() : this;
3986
- if (m.year() < 0 || m.year() > 9999) {
3987
- return formatMoment(
3988
- m,
3989
- utc
3990
- ? 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'
3991
- : 'YYYYYY-MM-DD[T]HH:mm:ss.SSSZ'
3992
- );
3993
- }
3994
- if (isFunction(Date.prototype.toISOString)) {
3995
- // native implementation is ~50x faster, use it when we can
3996
- if (utc) {
3997
- return this.toDate().toISOString();
3998
- } else {
3999
- return new Date(this.valueOf() + this.utcOffset() * 60 * 1000)
4000
- .toISOString()
4001
- .replace('Z', formatMoment(m, 'Z'));
4002
- }
4003
- }
4004
- return formatMoment(
4005
- m,
4006
- utc ? 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' : 'YYYY-MM-DD[T]HH:mm:ss.SSSZ'
4007
- );
4008
- }
4009
-
4010
- /**
4011
- * Return a human readable representation of a moment that can
4012
- * also be evaluated to get a new moment which is the same
4013
- *
4014
- * @link https://nodejs.org/dist/latest/docs/api/util.html#util_custom_inspect_function_on_objects
4015
- */
4016
- function inspect() {
4017
- if (!this.isValid()) {
4018
- return 'moment.invalid(/* ' + this._i + ' */)';
4019
- }
4020
- var func = 'moment',
4021
- zone = '',
4022
- prefix,
4023
- year,
4024
- datetime,
4025
- suffix;
4026
- if (!this.isLocal()) {
4027
- func = this.utcOffset() === 0 ? 'moment.utc' : 'moment.parseZone';
4028
- zone = 'Z';
4029
- }
4030
- prefix = '[' + func + '("]';
4031
- year = 0 <= this.year() && this.year() <= 9999 ? 'YYYY' : 'YYYYYY';
4032
- datetime = '-MM-DD[T]HH:mm:ss.SSS';
4033
- suffix = zone + '[")]';
4034
-
4035
- return this.format(prefix + year + datetime + suffix);
4036
- }
4037
-
4038
- function format(inputString) {
4039
- if (!inputString) {
4040
- inputString = this.isUtc()
4041
- ? hooks.defaultFormatUtc
4042
- : hooks.defaultFormat;
4043
- }
4044
- var output = formatMoment(this, inputString);
4045
- return this.localeData().postformat(output);
4046
- }
4047
-
4048
- function from(time, withoutSuffix) {
4049
- if (
4050
- this.isValid() &&
4051
- ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
4052
- ) {
4053
- return createDuration({ to: this, from: time })
4054
- .locale(this.locale())
4055
- .humanize(!withoutSuffix);
4056
- } else {
4057
- return this.localeData().invalidDate();
4058
- }
4059
- }
4060
-
4061
- function fromNow(withoutSuffix) {
4062
- return this.from(createLocal(), withoutSuffix);
4063
- }
4064
-
4065
- function to(time, withoutSuffix) {
4066
- if (
4067
- this.isValid() &&
4068
- ((isMoment(time) && time.isValid()) || createLocal(time).isValid())
4069
- ) {
4070
- return createDuration({ from: this, to: time })
4071
- .locale(this.locale())
4072
- .humanize(!withoutSuffix);
4073
- } else {
4074
- return this.localeData().invalidDate();
4075
- }
4076
- }
4077
-
4078
- function toNow(withoutSuffix) {
4079
- return this.to(createLocal(), withoutSuffix);
4080
- }
4081
-
4082
- // If passed a locale key, it will set the locale for this
4083
- // instance. Otherwise, it will return the locale configuration
4084
- // variables for this instance.
4085
- function locale(key) {
4086
- var newLocaleData;
4087
-
4088
- if (key === undefined) {
4089
- return this._locale._abbr;
4090
- } else {
4091
- newLocaleData = getLocale(key);
4092
- if (newLocaleData != null) {
4093
- this._locale = newLocaleData;
4094
- }
4095
- return this;
4096
- }
4097
- }
4098
-
4099
- var lang = deprecate(
4100
- 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
4101
- function (key) {
4102
- if (key === undefined) {
4103
- return this.localeData();
4104
- } else {
4105
- return this.locale(key);
4106
- }
4107
- }
4108
- );
4109
-
4110
- function localeData() {
4111
- return this._locale;
4112
- }
4113
-
4114
- var MS_PER_SECOND = 1000,
4115
- MS_PER_MINUTE = 60 * MS_PER_SECOND,
4116
- MS_PER_HOUR = 60 * MS_PER_MINUTE,
4117
- MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
4118
-
4119
- // actual modulo - handles negative numbers (for dates before 1970):
4120
- function mod$1(dividend, divisor) {
4121
- return ((dividend % divisor) + divisor) % divisor;
4122
- }
4123
-
4124
- function localStartOfDate(y, m, d) {
4125
- // the date constructor remaps years 0-99 to 1900-1999
4126
- if (y < 100 && y >= 0) {
4127
- // preserve leap years using a full 400 year cycle, then reset
4128
- return new Date(y + 400, m, d) - MS_PER_400_YEARS;
4129
- } else {
4130
- return new Date(y, m, d).valueOf();
4131
- }
4132
- }
4133
-
4134
- function utcStartOfDate(y, m, d) {
4135
- // Date.UTC remaps years 0-99 to 1900-1999
4136
- if (y < 100 && y >= 0) {
4137
- // preserve leap years using a full 400 year cycle, then reset
4138
- return Date.UTC(y + 400, m, d) - MS_PER_400_YEARS;
4139
- } else {
4140
- return Date.UTC(y, m, d);
4141
- }
4142
- }
4143
-
4144
- function startOf(units) {
4145
- var time, startOfDate;
4146
- units = normalizeUnits(units);
4147
- if (units === undefined || units === 'millisecond' || !this.isValid()) {
4148
- return this;
4149
- }
4150
-
4151
- startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
4152
-
4153
- switch (units) {
4154
- case 'year':
4155
- time = startOfDate(this.year(), 0, 1);
4156
- break;
4157
- case 'quarter':
4158
- time = startOfDate(
4159
- this.year(),
4160
- this.month() - (this.month() % 3),
4161
- 1
4162
- );
4163
- break;
4164
- case 'month':
4165
- time = startOfDate(this.year(), this.month(), 1);
4166
- break;
4167
- case 'week':
4168
- time = startOfDate(
4169
- this.year(),
4170
- this.month(),
4171
- this.date() - this.weekday()
4172
- );
4173
- break;
4174
- case 'isoWeek':
4175
- time = startOfDate(
4176
- this.year(),
4177
- this.month(),
4178
- this.date() - (this.isoWeekday() - 1)
4179
- );
4180
- break;
4181
- case 'day':
4182
- case 'date':
4183
- time = startOfDate(this.year(), this.month(), this.date());
4184
- break;
4185
- case 'hour':
4186
- time = this._d.valueOf();
4187
- time -= mod$1(
4188
- time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
4189
- MS_PER_HOUR
4190
- );
4191
- break;
4192
- case 'minute':
4193
- time = this._d.valueOf();
4194
- time -= mod$1(time, MS_PER_MINUTE);
4195
- break;
4196
- case 'second':
4197
- time = this._d.valueOf();
4198
- time -= mod$1(time, MS_PER_SECOND);
4199
- break;
4200
- }
4201
-
4202
- this._d.setTime(time);
4203
- hooks.updateOffset(this, true);
4204
- return this;
4205
- }
4206
-
4207
- function endOf(units) {
4208
- var time, startOfDate;
4209
- units = normalizeUnits(units);
4210
- if (units === undefined || units === 'millisecond' || !this.isValid()) {
4211
- return this;
4212
- }
4213
-
4214
- startOfDate = this._isUTC ? utcStartOfDate : localStartOfDate;
4215
-
4216
- switch (units) {
4217
- case 'year':
4218
- time = startOfDate(this.year() + 1, 0, 1) - 1;
4219
- break;
4220
- case 'quarter':
4221
- time =
4222
- startOfDate(
4223
- this.year(),
4224
- this.month() - (this.month() % 3) + 3,
4225
- 1
4226
- ) - 1;
4227
- break;
4228
- case 'month':
4229
- time = startOfDate(this.year(), this.month() + 1, 1) - 1;
4230
- break;
4231
- case 'week':
4232
- time =
4233
- startOfDate(
4234
- this.year(),
4235
- this.month(),
4236
- this.date() - this.weekday() + 7
4237
- ) - 1;
4238
- break;
4239
- case 'isoWeek':
4240
- time =
4241
- startOfDate(
4242
- this.year(),
4243
- this.month(),
4244
- this.date() - (this.isoWeekday() - 1) + 7
4245
- ) - 1;
4246
- break;
4247
- case 'day':
4248
- case 'date':
4249
- time = startOfDate(this.year(), this.month(), this.date() + 1) - 1;
4250
- break;
4251
- case 'hour':
4252
- time = this._d.valueOf();
4253
- time +=
4254
- MS_PER_HOUR -
4255
- mod$1(
4256
- time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
4257
- MS_PER_HOUR
4258
- ) -
4259
- 1;
4260
- break;
4261
- case 'minute':
4262
- time = this._d.valueOf();
4263
- time += MS_PER_MINUTE - mod$1(time, MS_PER_MINUTE) - 1;
4264
- break;
4265
- case 'second':
4266
- time = this._d.valueOf();
4267
- time += MS_PER_SECOND - mod$1(time, MS_PER_SECOND) - 1;
4268
- break;
4269
- }
4270
-
4271
- this._d.setTime(time);
4272
- hooks.updateOffset(this, true);
4273
- return this;
4274
- }
4275
-
4276
- function valueOf() {
4277
- return this._d.valueOf() - (this._offset || 0) * 60000;
4278
- }
4279
-
4280
- function unix() {
4281
- return Math.floor(this.valueOf() / 1000);
4282
- }
4283
-
4284
- function toDate() {
4285
- return new Date(this.valueOf());
4286
- }
4287
-
4288
- function toArray() {
4289
- var m = this;
4290
- return [
4291
- m.year(),
4292
- m.month(),
4293
- m.date(),
4294
- m.hour(),
4295
- m.minute(),
4296
- m.second(),
4297
- m.millisecond(),
4298
- ];
4299
- }
4300
-
4301
- function toObject() {
4302
- var m = this;
4303
- return {
4304
- years: m.year(),
4305
- months: m.month(),
4306
- date: m.date(),
4307
- hours: m.hours(),
4308
- minutes: m.minutes(),
4309
- seconds: m.seconds(),
4310
- milliseconds: m.milliseconds(),
4311
- };
4312
- }
4313
-
4314
- function toJSON() {
4315
- // new Date(NaN).toJSON() === null
4316
- return this.isValid() ? this.toISOString() : null;
4317
- }
4318
-
4319
- function isValid$2() {
4320
- return isValid(this);
4321
- }
4322
-
4323
- function parsingFlags() {
4324
- return extend({}, getParsingFlags(this));
4325
- }
4326
-
4327
- function invalidAt() {
4328
- return getParsingFlags(this).overflow;
4329
- }
4330
-
4331
- function creationData() {
4332
- return {
4333
- input: this._i,
4334
- format: this._f,
4335
- locale: this._locale,
4336
- isUTC: this._isUTC,
4337
- strict: this._strict,
4338
- };
4339
- }
4340
-
4341
- addFormatToken('N', 0, 0, 'eraAbbr');
4342
- addFormatToken('NN', 0, 0, 'eraAbbr');
4343
- addFormatToken('NNN', 0, 0, 'eraAbbr');
4344
- addFormatToken('NNNN', 0, 0, 'eraName');
4345
- addFormatToken('NNNNN', 0, 0, 'eraNarrow');
4346
-
4347
- addFormatToken('y', ['y', 1], 'yo', 'eraYear');
4348
- addFormatToken('y', ['yy', 2], 0, 'eraYear');
4349
- addFormatToken('y', ['yyy', 3], 0, 'eraYear');
4350
- addFormatToken('y', ['yyyy', 4], 0, 'eraYear');
4351
-
4352
- addRegexToken('N', matchEraAbbr);
4353
- addRegexToken('NN', matchEraAbbr);
4354
- addRegexToken('NNN', matchEraAbbr);
4355
- addRegexToken('NNNN', matchEraName);
4356
- addRegexToken('NNNNN', matchEraNarrow);
4357
-
4358
- addParseToken(['N', 'NN', 'NNN', 'NNNN', 'NNNNN'], function (
4359
- input,
4360
- array,
4361
- config,
4362
- token
4363
- ) {
4364
- var era = config._locale.erasParse(input, token, config._strict);
4365
- if (era) {
4366
- getParsingFlags(config).era = era;
4367
- } else {
4368
- getParsingFlags(config).invalidEra = input;
4369
- }
4370
- });
4371
-
4372
- addRegexToken('y', matchUnsigned);
4373
- addRegexToken('yy', matchUnsigned);
4374
- addRegexToken('yyy', matchUnsigned);
4375
- addRegexToken('yyyy', matchUnsigned);
4376
- addRegexToken('yo', matchEraYearOrdinal);
4377
-
4378
- addParseToken(['y', 'yy', 'yyy', 'yyyy'], YEAR);
4379
- addParseToken(['yo'], function (input, array, config, token) {
4380
- var match;
4381
- if (config._locale._eraYearOrdinalRegex) {
4382
- match = input.match(config._locale._eraYearOrdinalRegex);
4383
- }
4384
-
4385
- if (config._locale.eraYearOrdinalParse) {
4386
- array[YEAR] = config._locale.eraYearOrdinalParse(input, match);
4387
- } else {
4388
- array[YEAR] = parseInt(input, 10);
4389
- }
4390
- });
4391
-
4392
- function localeEras(m, format) {
4393
- var i,
4394
- l,
4395
- date,
4396
- eras = this._eras || getLocale('en')._eras;
4397
- for (i = 0, l = eras.length; i < l; ++i) {
4398
- switch (typeof eras[i].since) {
4399
- case 'string':
4400
- // truncate time
4401
- date = hooks(eras[i].since).startOf('day');
4402
- eras[i].since = date.valueOf();
4403
- break;
4404
- }
4405
-
4406
- switch (typeof eras[i].until) {
4407
- case 'undefined':
4408
- eras[i].until = +Infinity;
4409
- break;
4410
- case 'string':
4411
- // truncate time
4412
- date = hooks(eras[i].until).startOf('day').valueOf();
4413
- eras[i].until = date.valueOf();
4414
- break;
4415
- }
4416
- }
4417
- return eras;
4418
- }
4419
-
4420
- function localeErasParse(eraName, format, strict) {
4421
- var i,
4422
- l,
4423
- eras = this.eras(),
4424
- name,
4425
- abbr,
4426
- narrow;
4427
- eraName = eraName.toUpperCase();
4428
-
4429
- for (i = 0, l = eras.length; i < l; ++i) {
4430
- name = eras[i].name.toUpperCase();
4431
- abbr = eras[i].abbr.toUpperCase();
4432
- narrow = eras[i].narrow.toUpperCase();
4433
-
4434
- if (strict) {
4435
- switch (format) {
4436
- case 'N':
4437
- case 'NN':
4438
- case 'NNN':
4439
- if (abbr === eraName) {
4440
- return eras[i];
4441
- }
4442
- break;
4443
-
4444
- case 'NNNN':
4445
- if (name === eraName) {
4446
- return eras[i];
4447
- }
4448
- break;
4449
-
4450
- case 'NNNNN':
4451
- if (narrow === eraName) {
4452
- return eras[i];
4453
- }
4454
- break;
4455
- }
4456
- } else if ([name, abbr, narrow].indexOf(eraName) >= 0) {
4457
- return eras[i];
4458
- }
4459
- }
4460
- }
4461
-
4462
- function localeErasConvertYear(era, year) {
4463
- var dir = era.since <= era.until ? +1 : -1;
4464
- if (year === undefined) {
4465
- return hooks(era.since).year();
4466
- } else {
4467
- return hooks(era.since).year() + (year - era.offset) * dir;
4468
- }
4469
- }
4470
-
4471
- function getEraName() {
4472
- var i,
4473
- l,
4474
- val,
4475
- eras = this.localeData().eras();
4476
- for (i = 0, l = eras.length; i < l; ++i) {
4477
- // truncate time
4478
- val = this.clone().startOf('day').valueOf();
4479
-
4480
- if (eras[i].since <= val && val <= eras[i].until) {
4481
- return eras[i].name;
4482
- }
4483
- if (eras[i].until <= val && val <= eras[i].since) {
4484
- return eras[i].name;
4485
- }
4486
- }
4487
-
4488
- return '';
4489
- }
4490
-
4491
- function getEraNarrow() {
4492
- var i,
4493
- l,
4494
- val,
4495
- eras = this.localeData().eras();
4496
- for (i = 0, l = eras.length; i < l; ++i) {
4497
- // truncate time
4498
- val = this.clone().startOf('day').valueOf();
4499
-
4500
- if (eras[i].since <= val && val <= eras[i].until) {
4501
- return eras[i].narrow;
4502
- }
4503
- if (eras[i].until <= val && val <= eras[i].since) {
4504
- return eras[i].narrow;
4505
- }
4506
- }
4507
-
4508
- return '';
4509
- }
4510
-
4511
- function getEraAbbr() {
4512
- var i,
4513
- l,
4514
- val,
4515
- eras = this.localeData().eras();
4516
- for (i = 0, l = eras.length; i < l; ++i) {
4517
- // truncate time
4518
- val = this.clone().startOf('day').valueOf();
4519
-
4520
- if (eras[i].since <= val && val <= eras[i].until) {
4521
- return eras[i].abbr;
4522
- }
4523
- if (eras[i].until <= val && val <= eras[i].since) {
4524
- return eras[i].abbr;
4525
- }
4526
- }
4527
-
4528
- return '';
4529
- }
4530
-
4531
- function getEraYear() {
4532
- var i,
4533
- l,
4534
- dir,
4535
- val,
4536
- eras = this.localeData().eras();
4537
- for (i = 0, l = eras.length; i < l; ++i) {
4538
- dir = eras[i].since <= eras[i].until ? +1 : -1;
4539
-
4540
- // truncate time
4541
- val = this.clone().startOf('day').valueOf();
4542
-
4543
- if (
4544
- (eras[i].since <= val && val <= eras[i].until) ||
4545
- (eras[i].until <= val && val <= eras[i].since)
4546
- ) {
4547
- return (
4548
- (this.year() - hooks(eras[i].since).year()) * dir +
4549
- eras[i].offset
4550
- );
4551
- }
4552
- }
4553
-
4554
- return this.year();
4555
- }
4556
-
4557
- function erasNameRegex(isStrict) {
4558
- if (!hasOwnProp(this, '_erasNameRegex')) {
4559
- computeErasParse.call(this);
4560
- }
4561
- return isStrict ? this._erasNameRegex : this._erasRegex;
4562
- }
4563
-
4564
- function erasAbbrRegex(isStrict) {
4565
- if (!hasOwnProp(this, '_erasAbbrRegex')) {
4566
- computeErasParse.call(this);
4567
- }
4568
- return isStrict ? this._erasAbbrRegex : this._erasRegex;
4569
- }
4570
-
4571
- function erasNarrowRegex(isStrict) {
4572
- if (!hasOwnProp(this, '_erasNarrowRegex')) {
4573
- computeErasParse.call(this);
4574
- }
4575
- return isStrict ? this._erasNarrowRegex : this._erasRegex;
4576
- }
4577
-
4578
- function matchEraAbbr(isStrict, locale) {
4579
- return locale.erasAbbrRegex(isStrict);
4580
- }
4581
-
4582
- function matchEraName(isStrict, locale) {
4583
- return locale.erasNameRegex(isStrict);
4584
- }
4585
-
4586
- function matchEraNarrow(isStrict, locale) {
4587
- return locale.erasNarrowRegex(isStrict);
4588
- }
4589
-
4590
- function matchEraYearOrdinal(isStrict, locale) {
4591
- return locale._eraYearOrdinalRegex || matchUnsigned;
4592
- }
4593
-
4594
- function computeErasParse() {
4595
- var abbrPieces = [],
4596
- namePieces = [],
4597
- narrowPieces = [],
4598
- mixedPieces = [],
4599
- i,
4600
- l,
4601
- eras = this.eras();
4602
-
4603
- for (i = 0, l = eras.length; i < l; ++i) {
4604
- namePieces.push(regexEscape(eras[i].name));
4605
- abbrPieces.push(regexEscape(eras[i].abbr));
4606
- narrowPieces.push(regexEscape(eras[i].narrow));
4607
-
4608
- mixedPieces.push(regexEscape(eras[i].name));
4609
- mixedPieces.push(regexEscape(eras[i].abbr));
4610
- mixedPieces.push(regexEscape(eras[i].narrow));
4611
- }
4612
-
4613
- this._erasRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i');
4614
- this._erasNameRegex = new RegExp('^(' + namePieces.join('|') + ')', 'i');
4615
- this._erasAbbrRegex = new RegExp('^(' + abbrPieces.join('|') + ')', 'i');
4616
- this._erasNarrowRegex = new RegExp(
4617
- '^(' + narrowPieces.join('|') + ')',
4618
- 'i'
4619
- );
4620
- }
4621
-
4622
- // FORMATTING
4623
-
4624
- addFormatToken(0, ['gg', 2], 0, function () {
4625
- return this.weekYear() % 100;
4626
- });
4627
-
4628
- addFormatToken(0, ['GG', 2], 0, function () {
4629
- return this.isoWeekYear() % 100;
4630
- });
4631
-
4632
- function addWeekYearFormatToken(token, getter) {
4633
- addFormatToken(0, [token, token.length], 0, getter);
4634
- }
4635
-
4636
- addWeekYearFormatToken('gggg', 'weekYear');
4637
- addWeekYearFormatToken('ggggg', 'weekYear');
4638
- addWeekYearFormatToken('GGGG', 'isoWeekYear');
4639
- addWeekYearFormatToken('GGGGG', 'isoWeekYear');
4640
-
4641
- // ALIASES
4642
-
4643
- addUnitAlias('weekYear', 'gg');
4644
- addUnitAlias('isoWeekYear', 'GG');
4645
-
4646
- // PRIORITY
4647
-
4648
- addUnitPriority('weekYear', 1);
4649
- addUnitPriority('isoWeekYear', 1);
4650
-
4651
- // PARSING
4652
-
4653
- addRegexToken('G', matchSigned);
4654
- addRegexToken('g', matchSigned);
4655
- addRegexToken('GG', match1to2, match2);
4656
- addRegexToken('gg', match1to2, match2);
4657
- addRegexToken('GGGG', match1to4, match4);
4658
- addRegexToken('gggg', match1to4, match4);
4659
- addRegexToken('GGGGG', match1to6, match6);
4660
- addRegexToken('ggggg', match1to6, match6);
4661
-
4662
- addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (
4663
- input,
4664
- week,
4665
- config,
4666
- token
4667
- ) {
4668
- week[token.substr(0, 2)] = toInt(input);
4669
- });
4670
-
4671
- addWeekParseToken(['gg', 'GG'], function (input, week, config, token) {
4672
- week[token] = hooks.parseTwoDigitYear(input);
4673
- });
4674
-
4675
- // MOMENTS
4676
-
4677
- function getSetWeekYear(input) {
4678
- return getSetWeekYearHelper.call(
4679
- this,
4680
- input,
4681
- this.week(),
4682
- this.weekday(),
4683
- this.localeData()._week.dow,
4684
- this.localeData()._week.doy
4685
- );
4686
- }
4687
-
4688
- function getSetISOWeekYear(input) {
4689
- return getSetWeekYearHelper.call(
4690
- this,
4691
- input,
4692
- this.isoWeek(),
4693
- this.isoWeekday(),
4694
- 1,
4695
- 4
4696
- );
4697
- }
4698
-
4699
- function getISOWeeksInYear() {
4700
- return weeksInYear(this.year(), 1, 4);
4701
- }
4702
-
4703
- function getISOWeeksInISOWeekYear() {
4704
- return weeksInYear(this.isoWeekYear(), 1, 4);
4705
- }
4706
-
4707
- function getWeeksInYear() {
4708
- var weekInfo = this.localeData()._week;
4709
- return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy);
4710
- }
4711
-
4712
- function getWeeksInWeekYear() {
4713
- var weekInfo = this.localeData()._week;
4714
- return weeksInYear(this.weekYear(), weekInfo.dow, weekInfo.doy);
4715
- }
4716
-
4717
- function getSetWeekYearHelper(input, week, weekday, dow, doy) {
4718
- var weeksTarget;
4719
- if (input == null) {
4720
- return weekOfYear(this, dow, doy).year;
4721
- } else {
4722
- weeksTarget = weeksInYear(input, dow, doy);
4723
- if (week > weeksTarget) {
4724
- week = weeksTarget;
4725
- }
4726
- return setWeekAll.call(this, input, week, weekday, dow, doy);
4727
- }
4728
- }
4729
-
4730
- function setWeekAll(weekYear, week, weekday, dow, doy) {
4731
- var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy),
4732
- date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear);
4733
-
4734
- this.year(date.getUTCFullYear());
4735
- this.month(date.getUTCMonth());
4736
- this.date(date.getUTCDate());
4737
- return this;
4738
- }
4739
-
4740
- // FORMATTING
4741
-
4742
- addFormatToken('Q', 0, 'Qo', 'quarter');
4743
-
4744
- // ALIASES
4745
-
4746
- addUnitAlias('quarter', 'Q');
4747
-
4748
- // PRIORITY
4749
-
4750
- addUnitPriority('quarter', 7);
4751
-
4752
- // PARSING
4753
-
4754
- addRegexToken('Q', match1);
4755
- addParseToken('Q', function (input, array) {
4756
- array[MONTH] = (toInt(input) - 1) * 3;
4757
- });
4758
-
4759
- // MOMENTS
4760
-
4761
- function getSetQuarter(input) {
4762
- return input == null
4763
- ? Math.ceil((this.month() + 1) / 3)
4764
- : this.month((input - 1) * 3 + (this.month() % 3));
4765
- }
4766
-
4767
- // FORMATTING
4768
-
4769
- addFormatToken('D', ['DD', 2], 'Do', 'date');
4770
-
4771
- // ALIASES
4772
-
4773
- addUnitAlias('date', 'D');
4774
-
4775
- // PRIORITY
4776
- addUnitPriority('date', 9);
4777
-
4778
- // PARSING
4779
-
4780
- addRegexToken('D', match1to2);
4781
- addRegexToken('DD', match1to2, match2);
4782
- addRegexToken('Do', function (isStrict, locale) {
4783
- // TODO: Remove "ordinalParse" fallback in next major release.
4784
- return isStrict
4785
- ? locale._dayOfMonthOrdinalParse || locale._ordinalParse
4786
- : locale._dayOfMonthOrdinalParseLenient;
4787
- });
4788
-
4789
- addParseToken(['D', 'DD'], DATE);
4790
- addParseToken('Do', function (input, array) {
4791
- array[DATE] = toInt(input.match(match1to2)[0]);
4792
- });
4793
-
4794
- // MOMENTS
4795
-
4796
- var getSetDayOfMonth = makeGetSet('Date', true);
4797
-
4798
- // FORMATTING
4799
-
4800
- addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear');
4801
-
4802
- // ALIASES
4803
-
4804
- addUnitAlias('dayOfYear', 'DDD');
4805
-
4806
- // PRIORITY
4807
- addUnitPriority('dayOfYear', 4);
4808
-
4809
- // PARSING
4810
-
4811
- addRegexToken('DDD', match1to3);
4812
- addRegexToken('DDDD', match3);
4813
- addParseToken(['DDD', 'DDDD'], function (input, array, config) {
4814
- config._dayOfYear = toInt(input);
4815
- });
4816
-
4817
- // HELPERS
4818
-
4819
- // MOMENTS
4820
-
4821
- function getSetDayOfYear(input) {
4822
- var dayOfYear =
4823
- Math.round(
4824
- (this.clone().startOf('day') - this.clone().startOf('year')) / 864e5
4825
- ) + 1;
4826
- return input == null ? dayOfYear : this.add(input - dayOfYear, 'd');
4827
- }
4828
-
4829
- // FORMATTING
4830
-
4831
- addFormatToken('m', ['mm', 2], 0, 'minute');
4832
-
4833
- // ALIASES
4834
-
4835
- addUnitAlias('minute', 'm');
4836
-
4837
- // PRIORITY
4838
-
4839
- addUnitPriority('minute', 14);
4840
-
4841
- // PARSING
4842
-
4843
- addRegexToken('m', match1to2);
4844
- addRegexToken('mm', match1to2, match2);
4845
- addParseToken(['m', 'mm'], MINUTE);
4846
-
4847
- // MOMENTS
4848
-
4849
- var getSetMinute = makeGetSet('Minutes', false);
4850
-
4851
- // FORMATTING
4852
-
4853
- addFormatToken('s', ['ss', 2], 0, 'second');
4854
-
4855
- // ALIASES
4856
-
4857
- addUnitAlias('second', 's');
4858
-
4859
- // PRIORITY
4860
-
4861
- addUnitPriority('second', 15);
4862
-
4863
- // PARSING
4864
-
4865
- addRegexToken('s', match1to2);
4866
- addRegexToken('ss', match1to2, match2);
4867
- addParseToken(['s', 'ss'], SECOND);
4868
-
4869
- // MOMENTS
4870
-
4871
- var getSetSecond = makeGetSet('Seconds', false);
4872
-
4873
- // FORMATTING
4874
-
4875
- addFormatToken('S', 0, 0, function () {
4876
- return ~~(this.millisecond() / 100);
4877
- });
4878
-
4879
- addFormatToken(0, ['SS', 2], 0, function () {
4880
- return ~~(this.millisecond() / 10);
4881
- });
4882
-
4883
- addFormatToken(0, ['SSS', 3], 0, 'millisecond');
4884
- addFormatToken(0, ['SSSS', 4], 0, function () {
4885
- return this.millisecond() * 10;
4886
- });
4887
- addFormatToken(0, ['SSSSS', 5], 0, function () {
4888
- return this.millisecond() * 100;
4889
- });
4890
- addFormatToken(0, ['SSSSSS', 6], 0, function () {
4891
- return this.millisecond() * 1000;
4892
- });
4893
- addFormatToken(0, ['SSSSSSS', 7], 0, function () {
4894
- return this.millisecond() * 10000;
4895
- });
4896
- addFormatToken(0, ['SSSSSSSS', 8], 0, function () {
4897
- return this.millisecond() * 100000;
4898
- });
4899
- addFormatToken(0, ['SSSSSSSSS', 9], 0, function () {
4900
- return this.millisecond() * 1000000;
4901
- });
4902
-
4903
- // ALIASES
4904
-
4905
- addUnitAlias('millisecond', 'ms');
4906
-
4907
- // PRIORITY
4908
-
4909
- addUnitPriority('millisecond', 16);
4910
-
4911
- // PARSING
4912
-
4913
- addRegexToken('S', match1to3, match1);
4914
- addRegexToken('SS', match1to3, match2);
4915
- addRegexToken('SSS', match1to3, match3);
4916
-
4917
- var token, getSetMillisecond;
4918
- for (token = 'SSSS'; token.length <= 9; token += 'S') {
4919
- addRegexToken(token, matchUnsigned);
4920
- }
4921
-
4922
- function parseMs(input, array) {
4923
- array[MILLISECOND] = toInt(('0.' + input) * 1000);
4924
- }
4925
-
4926
- for (token = 'S'; token.length <= 9; token += 'S') {
4927
- addParseToken(token, parseMs);
4928
- }
4929
-
4930
- getSetMillisecond = makeGetSet('Milliseconds', false);
4931
-
4932
- // FORMATTING
4933
-
4934
- addFormatToken('z', 0, 0, 'zoneAbbr');
4935
- addFormatToken('zz', 0, 0, 'zoneName');
4936
-
4937
- // MOMENTS
4938
-
4939
- function getZoneAbbr() {
4940
- return this._isUTC ? 'UTC' : '';
4941
- }
4942
-
4943
- function getZoneName() {
4944
- return this._isUTC ? 'Coordinated Universal Time' : '';
4945
- }
4946
-
4947
- var proto = Moment.prototype;
4948
-
4949
- proto.add = add;
4950
- proto.calendar = calendar$1;
4951
- proto.clone = clone;
4952
- proto.diff = diff;
4953
- proto.endOf = endOf;
4954
- proto.format = format;
4955
- proto.from = from;
4956
- proto.fromNow = fromNow;
4957
- proto.to = to;
4958
- proto.toNow = toNow;
4959
- proto.get = stringGet;
4960
- proto.invalidAt = invalidAt;
4961
- proto.isAfter = isAfter;
4962
- proto.isBefore = isBefore;
4963
- proto.isBetween = isBetween;
4964
- proto.isSame = isSame;
4965
- proto.isSameOrAfter = isSameOrAfter;
4966
- proto.isSameOrBefore = isSameOrBefore;
4967
- proto.isValid = isValid$2;
4968
- proto.lang = lang;
4969
- proto.locale = locale;
4970
- proto.localeData = localeData;
4971
- proto.max = prototypeMax;
4972
- proto.min = prototypeMin;
4973
- proto.parsingFlags = parsingFlags;
4974
- proto.set = stringSet;
4975
- proto.startOf = startOf;
4976
- proto.subtract = subtract;
4977
- proto.toArray = toArray;
4978
- proto.toObject = toObject;
4979
- proto.toDate = toDate;
4980
- proto.toISOString = toISOString;
4981
- proto.inspect = inspect;
4982
- if (typeof Symbol !== 'undefined' && Symbol.for != null) {
4983
- proto[Symbol.for('nodejs.util.inspect.custom')] = function () {
4984
- return 'Moment<' + this.format() + '>';
4985
- };
4986
- }
4987
- proto.toJSON = toJSON;
4988
- proto.toString = toString;
4989
- proto.unix = unix;
4990
- proto.valueOf = valueOf;
4991
- proto.creationData = creationData;
4992
- proto.eraName = getEraName;
4993
- proto.eraNarrow = getEraNarrow;
4994
- proto.eraAbbr = getEraAbbr;
4995
- proto.eraYear = getEraYear;
4996
- proto.year = getSetYear;
4997
- proto.isLeapYear = getIsLeapYear;
4998
- proto.weekYear = getSetWeekYear;
4999
- proto.isoWeekYear = getSetISOWeekYear;
5000
- proto.quarter = proto.quarters = getSetQuarter;
5001
- proto.month = getSetMonth;
5002
- proto.daysInMonth = getDaysInMonth;
5003
- proto.week = proto.weeks = getSetWeek;
5004
- proto.isoWeek = proto.isoWeeks = getSetISOWeek;
5005
- proto.weeksInYear = getWeeksInYear;
5006
- proto.weeksInWeekYear = getWeeksInWeekYear;
5007
- proto.isoWeeksInYear = getISOWeeksInYear;
5008
- proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
5009
- proto.date = getSetDayOfMonth;
5010
- proto.day = proto.days = getSetDayOfWeek;
5011
- proto.weekday = getSetLocaleDayOfWeek;
5012
- proto.isoWeekday = getSetISODayOfWeek;
5013
- proto.dayOfYear = getSetDayOfYear;
5014
- proto.hour = proto.hours = getSetHour;
5015
- proto.minute = proto.minutes = getSetMinute;
5016
- proto.second = proto.seconds = getSetSecond;
5017
- proto.millisecond = proto.milliseconds = getSetMillisecond;
5018
- proto.utcOffset = getSetOffset;
5019
- proto.utc = setOffsetToUTC;
5020
- proto.local = setOffsetToLocal;
5021
- proto.parseZone = setOffsetToParsedOffset;
5022
- proto.hasAlignedHourOffset = hasAlignedHourOffset;
5023
- proto.isDST = isDaylightSavingTime;
5024
- proto.isLocal = isLocal;
5025
- proto.isUtcOffset = isUtcOffset;
5026
- proto.isUtc = isUtc;
5027
- proto.isUTC = isUtc;
5028
- proto.zoneAbbr = getZoneAbbr;
5029
- proto.zoneName = getZoneName;
5030
- proto.dates = deprecate(
5031
- 'dates accessor is deprecated. Use date instead.',
5032
- getSetDayOfMonth
5033
- );
5034
- proto.months = deprecate(
5035
- 'months accessor is deprecated. Use month instead',
5036
- getSetMonth
5037
- );
5038
- proto.years = deprecate(
5039
- 'years accessor is deprecated. Use year instead',
5040
- getSetYear
5041
- );
5042
- proto.zone = deprecate(
5043
- 'moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/',
5044
- getSetZone
5045
- );
5046
- proto.isDSTShifted = deprecate(
5047
- 'isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information',
5048
- isDaylightSavingTimeShifted
5049
- );
5050
-
5051
- function createUnix(input) {
5052
- return createLocal(input * 1000);
5053
- }
5054
-
5055
- function createInZone() {
5056
- return createLocal.apply(null, arguments).parseZone();
5057
- }
5058
-
5059
- function preParsePostFormat(string) {
5060
- return string;
5061
- }
5062
-
5063
- var proto$1 = Locale.prototype;
5064
-
5065
- proto$1.calendar = calendar;
5066
- proto$1.longDateFormat = longDateFormat;
5067
- proto$1.invalidDate = invalidDate;
5068
- proto$1.ordinal = ordinal;
5069
- proto$1.preparse = preParsePostFormat;
5070
- proto$1.postformat = preParsePostFormat;
5071
- proto$1.relativeTime = relativeTime;
5072
- proto$1.pastFuture = pastFuture;
5073
- proto$1.set = set;
5074
- proto$1.eras = localeEras;
5075
- proto$1.erasParse = localeErasParse;
5076
- proto$1.erasConvertYear = localeErasConvertYear;
5077
- proto$1.erasAbbrRegex = erasAbbrRegex;
5078
- proto$1.erasNameRegex = erasNameRegex;
5079
- proto$1.erasNarrowRegex = erasNarrowRegex;
5080
-
5081
- proto$1.months = localeMonths;
5082
- proto$1.monthsShort = localeMonthsShort;
5083
- proto$1.monthsParse = localeMonthsParse;
5084
- proto$1.monthsRegex = monthsRegex;
5085
- proto$1.monthsShortRegex = monthsShortRegex;
5086
- proto$1.week = localeWeek;
5087
- proto$1.firstDayOfYear = localeFirstDayOfYear;
5088
- proto$1.firstDayOfWeek = localeFirstDayOfWeek;
5089
-
5090
- proto$1.weekdays = localeWeekdays;
5091
- proto$1.weekdaysMin = localeWeekdaysMin;
5092
- proto$1.weekdaysShort = localeWeekdaysShort;
5093
- proto$1.weekdaysParse = localeWeekdaysParse;
5094
-
5095
- proto$1.weekdaysRegex = weekdaysRegex;
5096
- proto$1.weekdaysShortRegex = weekdaysShortRegex;
5097
- proto$1.weekdaysMinRegex = weekdaysMinRegex;
5098
-
5099
- proto$1.isPM = localeIsPM;
5100
- proto$1.meridiem = localeMeridiem;
5101
-
5102
- function get$1(format, index, field, setter) {
5103
- var locale = getLocale(),
5104
- utc = createUTC().set(setter, index);
5105
- return locale[field](utc, format);
5106
- }
5107
-
5108
- function listMonthsImpl(format, index, field) {
5109
- if (isNumber(format)) {
5110
- index = format;
5111
- format = undefined;
5112
- }
5113
-
5114
- format = format || '';
5115
-
5116
- if (index != null) {
5117
- return get$1(format, index, field, 'month');
5118
- }
5119
-
5120
- var i,
5121
- out = [];
5122
- for (i = 0; i < 12; i++) {
5123
- out[i] = get$1(format, i, field, 'month');
5124
- }
5125
- return out;
5126
- }
5127
-
5128
- // ()
5129
- // (5)
5130
- // (fmt, 5)
5131
- // (fmt)
5132
- // (true)
5133
- // (true, 5)
5134
- // (true, fmt, 5)
5135
- // (true, fmt)
5136
- function listWeekdaysImpl(localeSorted, format, index, field) {
5137
- if (typeof localeSorted === 'boolean') {
5138
- if (isNumber(format)) {
5139
- index = format;
5140
- format = undefined;
5141
- }
5142
-
5143
- format = format || '';
5144
- } else {
5145
- format = localeSorted;
5146
- index = format;
5147
- localeSorted = false;
5148
-
5149
- if (isNumber(format)) {
5150
- index = format;
5151
- format = undefined;
5152
- }
5153
-
5154
- format = format || '';
5155
- }
5156
-
5157
- var locale = getLocale(),
5158
- shift = localeSorted ? locale._week.dow : 0,
5159
- i,
5160
- out = [];
5161
-
5162
- if (index != null) {
5163
- return get$1(format, (index + shift) % 7, field, 'day');
5164
- }
5165
-
5166
- for (i = 0; i < 7; i++) {
5167
- out[i] = get$1(format, (i + shift) % 7, field, 'day');
5168
- }
5169
- return out;
5170
- }
5171
-
5172
- function listMonths(format, index) {
5173
- return listMonthsImpl(format, index, 'months');
5174
- }
5175
-
5176
- function listMonthsShort(format, index) {
5177
- return listMonthsImpl(format, index, 'monthsShort');
5178
- }
5179
-
5180
- function listWeekdays(localeSorted, format, index) {
5181
- return listWeekdaysImpl(localeSorted, format, index, 'weekdays');
5182
- }
5183
-
5184
- function listWeekdaysShort(localeSorted, format, index) {
5185
- return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort');
5186
- }
5187
-
5188
- function listWeekdaysMin(localeSorted, format, index) {
5189
- return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin');
5190
- }
5191
-
5192
- getSetGlobalLocale('en', {
5193
- eras: [
5194
- {
5195
- since: '0001-01-01',
5196
- until: +Infinity,
5197
- offset: 1,
5198
- name: 'Anno Domini',
5199
- narrow: 'AD',
5200
- abbr: 'AD',
5201
- },
5202
- {
5203
- since: '0000-12-31',
5204
- until: -Infinity,
5205
- offset: 1,
5206
- name: 'Before Christ',
5207
- narrow: 'BC',
5208
- abbr: 'BC',
5209
- },
5210
- ],
5211
- dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
5212
- ordinal: function (number) {
5213
- var b = number % 10,
5214
- output =
5215
- toInt((number % 100) / 10) === 1
5216
- ? 'th'
5217
- : b === 1
5218
- ? 'st'
5219
- : b === 2
5220
- ? 'nd'
5221
- : b === 3
5222
- ? 'rd'
5223
- : 'th';
5224
- return number + output;
5225
- },
5226
- });
5227
-
5228
- // Side effect imports
5229
-
5230
- hooks.lang = deprecate(
5231
- 'moment.lang is deprecated. Use moment.locale instead.',
5232
- getSetGlobalLocale
5233
- );
5234
- hooks.langData = deprecate(
5235
- 'moment.langData is deprecated. Use moment.localeData instead.',
5236
- getLocale
5237
- );
5238
-
5239
- var mathAbs = Math.abs;
5240
-
5241
- function abs() {
5242
- var data = this._data;
5243
-
5244
- this._milliseconds = mathAbs(this._milliseconds);
5245
- this._days = mathAbs(this._days);
5246
- this._months = mathAbs(this._months);
5247
-
5248
- data.milliseconds = mathAbs(data.milliseconds);
5249
- data.seconds = mathAbs(data.seconds);
5250
- data.minutes = mathAbs(data.minutes);
5251
- data.hours = mathAbs(data.hours);
5252
- data.months = mathAbs(data.months);
5253
- data.years = mathAbs(data.years);
5254
-
5255
- return this;
5256
- }
5257
-
5258
- function addSubtract$1(duration, input, value, direction) {
5259
- var other = createDuration(input, value);
5260
-
5261
- duration._milliseconds += direction * other._milliseconds;
5262
- duration._days += direction * other._days;
5263
- duration._months += direction * other._months;
5264
-
5265
- return duration._bubble();
5266
- }
5267
-
5268
- // supports only 2.0-style add(1, 's') or add(duration)
5269
- function add$1(input, value) {
5270
- return addSubtract$1(this, input, value, 1);
5271
- }
5272
-
5273
- // supports only 2.0-style subtract(1, 's') or subtract(duration)
5274
- function subtract$1(input, value) {
5275
- return addSubtract$1(this, input, value, -1);
5276
- }
5277
-
5278
- function absCeil(number) {
5279
- if (number < 0) {
5280
- return Math.floor(number);
5281
- } else {
5282
- return Math.ceil(number);
5283
- }
5284
- }
5285
-
5286
- function bubble() {
5287
- var milliseconds = this._milliseconds,
5288
- days = this._days,
5289
- months = this._months,
5290
- data = this._data,
5291
- seconds,
5292
- minutes,
5293
- hours,
5294
- years,
5295
- monthsFromDays;
5296
-
5297
- // if we have a mix of positive and negative values, bubble down first
5298
- // check: https://github.com/moment/moment/issues/2166
5299
- if (
5300
- !(
5301
- (milliseconds >= 0 && days >= 0 && months >= 0) ||
5302
- (milliseconds <= 0 && days <= 0 && months <= 0)
5303
- )
5304
- ) {
5305
- milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
5306
- days = 0;
5307
- months = 0;
5308
- }
5309
-
5310
- // The following code bubbles up values, see the tests for
5311
- // examples of what that means.
5312
- data.milliseconds = milliseconds % 1000;
5313
-
5314
- seconds = absFloor(milliseconds / 1000);
5315
- data.seconds = seconds % 60;
5316
-
5317
- minutes = absFloor(seconds / 60);
5318
- data.minutes = minutes % 60;
5319
-
5320
- hours = absFloor(minutes / 60);
5321
- data.hours = hours % 24;
5322
-
5323
- days += absFloor(hours / 24);
5324
-
5325
- // convert days to months
5326
- monthsFromDays = absFloor(daysToMonths(days));
5327
- months += monthsFromDays;
5328
- days -= absCeil(monthsToDays(monthsFromDays));
5329
-
5330
- // 12 months -> 1 year
5331
- years = absFloor(months / 12);
5332
- months %= 12;
5333
-
5334
- data.days = days;
5335
- data.months = months;
5336
- data.years = years;
5337
-
5338
- return this;
5339
- }
5340
-
5341
- function daysToMonths(days) {
5342
- // 400 years have 146097 days (taking into account leap year rules)
5343
- // 400 years have 12 months === 4800
5344
- return (days * 4800) / 146097;
5345
- }
5346
-
5347
- function monthsToDays(months) {
5348
- // the reverse of daysToMonths
5349
- return (months * 146097) / 4800;
5350
- }
5351
-
5352
- function as(units) {
5353
- if (!this.isValid()) {
5354
- return NaN;
5355
- }
5356
- var days,
5357
- months,
5358
- milliseconds = this._milliseconds;
5359
-
5360
- units = normalizeUnits(units);
5361
-
5362
- if (units === 'month' || units === 'quarter' || units === 'year') {
5363
- days = this._days + milliseconds / 864e5;
5364
- months = this._months + daysToMonths(days);
5365
- switch (units) {
5366
- case 'month':
5367
- return months;
5368
- case 'quarter':
5369
- return months / 3;
5370
- case 'year':
5371
- return months / 12;
5372
- }
5373
- } else {
5374
- // handle milliseconds separately because of floating point math errors (issue #1867)
5375
- days = this._days + Math.round(monthsToDays(this._months));
5376
- switch (units) {
5377
- case 'week':
5378
- return days / 7 + milliseconds / 6048e5;
5379
- case 'day':
5380
- return days + milliseconds / 864e5;
5381
- case 'hour':
5382
- return days * 24 + milliseconds / 36e5;
5383
- case 'minute':
5384
- return days * 1440 + milliseconds / 6e4;
5385
- case 'second':
5386
- return days * 86400 + milliseconds / 1000;
5387
- // Math.floor prevents floating point math errors here
5388
- case 'millisecond':
5389
- return Math.floor(days * 864e5) + milliseconds;
5390
- default:
5391
- throw new Error('Unknown unit ' + units);
5392
- }
5393
- }
5394
- }
5395
-
5396
- // TODO: Use this.as('ms')?
5397
- function valueOf$1() {
5398
- if (!this.isValid()) {
5399
- return NaN;
5400
- }
5401
- return (
5402
- this._milliseconds +
5403
- this._days * 864e5 +
5404
- (this._months % 12) * 2592e6 +
5405
- toInt(this._months / 12) * 31536e6
5406
- );
5407
- }
5408
-
5409
- function makeAs(alias) {
5410
- return function () {
5411
- return this.as(alias);
5412
- };
5413
- }
5414
-
5415
- var asMilliseconds = makeAs('ms'),
5416
- asSeconds = makeAs('s'),
5417
- asMinutes = makeAs('m'),
5418
- asHours = makeAs('h'),
5419
- asDays = makeAs('d'),
5420
- asWeeks = makeAs('w'),
5421
- asMonths = makeAs('M'),
5422
- asQuarters = makeAs('Q'),
5423
- asYears = makeAs('y');
5424
-
5425
- function clone$1() {
5426
- return createDuration(this);
5427
- }
5428
-
5429
- function get$2(units) {
5430
- units = normalizeUnits(units);
5431
- return this.isValid() ? this[units + 's']() : NaN;
5432
- }
5433
-
5434
- function makeGetter(name) {
5435
- return function () {
5436
- return this.isValid() ? this._data[name] : NaN;
5437
- };
5438
- }
5439
-
5440
- var milliseconds = makeGetter('milliseconds'),
5441
- seconds = makeGetter('seconds'),
5442
- minutes = makeGetter('minutes'),
5443
- hours = makeGetter('hours'),
5444
- days = makeGetter('days'),
5445
- months = makeGetter('months'),
5446
- years = makeGetter('years');
5447
-
5448
- function weeks() {
5449
- return absFloor(this.days() / 7);
5450
- }
5451
-
5452
- var round = Math.round,
5453
- thresholds = {
5454
- ss: 44, // a few seconds to seconds
5455
- s: 45, // seconds to minute
5456
- m: 45, // minutes to hour
5457
- h: 22, // hours to day
5458
- d: 26, // days to month/week
5459
- w: null, // weeks to month
5460
- M: 11, // months to year
5461
- };
5462
-
5463
- // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize
5464
- function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) {
5465
- return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture);
5466
- }
5467
-
5468
- function relativeTime$1(posNegDuration, withoutSuffix, thresholds, locale) {
5469
- var duration = createDuration(posNegDuration).abs(),
5470
- seconds = round(duration.as('s')),
5471
- minutes = round(duration.as('m')),
5472
- hours = round(duration.as('h')),
5473
- days = round(duration.as('d')),
5474
- months = round(duration.as('M')),
5475
- weeks = round(duration.as('w')),
5476
- years = round(duration.as('y')),
5477
- a =
5478
- (seconds <= thresholds.ss && ['s', seconds]) ||
5479
- (seconds < thresholds.s && ['ss', seconds]) ||
5480
- (minutes <= 1 && ['m']) ||
5481
- (minutes < thresholds.m && ['mm', minutes]) ||
5482
- (hours <= 1 && ['h']) ||
5483
- (hours < thresholds.h && ['hh', hours]) ||
5484
- (days <= 1 && ['d']) ||
5485
- (days < thresholds.d && ['dd', days]);
5486
-
5487
- if (thresholds.w != null) {
5488
- a =
5489
- a ||
5490
- (weeks <= 1 && ['w']) ||
5491
- (weeks < thresholds.w && ['ww', weeks]);
5492
- }
5493
- a = a ||
5494
- (months <= 1 && ['M']) ||
5495
- (months < thresholds.M && ['MM', months]) ||
5496
- (years <= 1 && ['y']) || ['yy', years];
5497
-
5498
- a[2] = withoutSuffix;
5499
- a[3] = +posNegDuration > 0;
5500
- a[4] = locale;
5501
- return substituteTimeAgo.apply(null, a);
5502
- }
5503
-
5504
- // This function allows you to set the rounding function for relative time strings
5505
- function getSetRelativeTimeRounding(roundingFunction) {
5506
- if (roundingFunction === undefined) {
5507
- return round;
5508
- }
5509
- if (typeof roundingFunction === 'function') {
5510
- round = roundingFunction;
5511
- return true;
5512
- }
5513
- return false;
5514
- }
5515
-
5516
- // This function allows you to set a threshold for relative time strings
5517
- function getSetRelativeTimeThreshold(threshold, limit) {
5518
- if (thresholds[threshold] === undefined) {
5519
- return false;
5520
- }
5521
- if (limit === undefined) {
5522
- return thresholds[threshold];
5523
- }
5524
- thresholds[threshold] = limit;
5525
- if (threshold === 's') {
5526
- thresholds.ss = limit - 1;
5527
- }
5528
- return true;
5529
- }
5530
-
5531
- function humanize(argWithSuffix, argThresholds) {
5532
- if (!this.isValid()) {
5533
- return this.localeData().invalidDate();
5534
- }
5535
-
5536
- var withSuffix = false,
5537
- th = thresholds,
5538
- locale,
5539
- output;
5540
-
5541
- if (typeof argWithSuffix === 'object') {
5542
- argThresholds = argWithSuffix;
5543
- argWithSuffix = false;
5544
- }
5545
- if (typeof argWithSuffix === 'boolean') {
5546
- withSuffix = argWithSuffix;
5547
- }
5548
- if (typeof argThresholds === 'object') {
5549
- th = Object.assign({}, thresholds, argThresholds);
5550
- if (argThresholds.s != null && argThresholds.ss == null) {
5551
- th.ss = argThresholds.s - 1;
5552
- }
5553
- }
5554
-
5555
- locale = this.localeData();
5556
- output = relativeTime$1(this, !withSuffix, th, locale);
5557
-
5558
- if (withSuffix) {
5559
- output = locale.pastFuture(+this, output);
5560
- }
5561
-
5562
- return locale.postformat(output);
5563
- }
5564
-
5565
- var abs$1 = Math.abs;
5566
-
5567
- function sign(x) {
5568
- return (x > 0) - (x < 0) || +x;
5569
- }
5570
-
5571
- function toISOString$1() {
5572
- // for ISO strings we do not use the normal bubbling rules:
5573
- // * milliseconds bubble up until they become hours
5574
- // * days do not bubble at all
5575
- // * months bubble up until they become years
5576
- // This is because there is no context-free conversion between hours and days
5577
- // (think of clock changes)
5578
- // and also not between days and months (28-31 days per month)
5579
- if (!this.isValid()) {
5580
- return this.localeData().invalidDate();
5581
- }
5582
-
5583
- var seconds = abs$1(this._milliseconds) / 1000,
5584
- days = abs$1(this._days),
5585
- months = abs$1(this._months),
5586
- minutes,
5587
- hours,
5588
- years,
5589
- s,
5590
- total = this.asSeconds(),
5591
- totalSign,
5592
- ymSign,
5593
- daysSign,
5594
- hmsSign;
5595
-
5596
- if (!total) {
5597
- // this is the same as C#'s (Noda) and python (isodate)...
5598
- // but not other JS (goog.date)
5599
- return 'P0D';
5600
- }
5601
-
5602
- // 3600 seconds -> 60 minutes -> 1 hour
5603
- minutes = absFloor(seconds / 60);
5604
- hours = absFloor(minutes / 60);
5605
- seconds %= 60;
5606
- minutes %= 60;
5607
-
5608
- // 12 months -> 1 year
5609
- years = absFloor(months / 12);
5610
- months %= 12;
5611
-
5612
- // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js
5613
- s = seconds ? seconds.toFixed(3).replace(/\.?0+$/, '') : '';
5614
-
5615
- totalSign = total < 0 ? '-' : '';
5616
- ymSign = sign(this._months) !== sign(total) ? '-' : '';
5617
- daysSign = sign(this._days) !== sign(total) ? '-' : '';
5618
- hmsSign = sign(this._milliseconds) !== sign(total) ? '-' : '';
5619
-
5620
- return (
5621
- totalSign +
5622
- 'P' +
5623
- (years ? ymSign + years + 'Y' : '') +
5624
- (months ? ymSign + months + 'M' : '') +
5625
- (days ? daysSign + days + 'D' : '') +
5626
- (hours || minutes || seconds ? 'T' : '') +
5627
- (hours ? hmsSign + hours + 'H' : '') +
5628
- (minutes ? hmsSign + minutes + 'M' : '') +
5629
- (seconds ? hmsSign + s + 'S' : '')
5630
- );
5631
- }
5632
-
5633
- var proto$2 = Duration.prototype;
5634
-
5635
- proto$2.isValid = isValid$1;
5636
- proto$2.abs = abs;
5637
- proto$2.add = add$1;
5638
- proto$2.subtract = subtract$1;
5639
- proto$2.as = as;
5640
- proto$2.asMilliseconds = asMilliseconds;
5641
- proto$2.asSeconds = asSeconds;
5642
- proto$2.asMinutes = asMinutes;
5643
- proto$2.asHours = asHours;
5644
- proto$2.asDays = asDays;
5645
- proto$2.asWeeks = asWeeks;
5646
- proto$2.asMonths = asMonths;
5647
- proto$2.asQuarters = asQuarters;
5648
- proto$2.asYears = asYears;
5649
- proto$2.valueOf = valueOf$1;
5650
- proto$2._bubble = bubble;
5651
- proto$2.clone = clone$1;
5652
- proto$2.get = get$2;
5653
- proto$2.milliseconds = milliseconds;
5654
- proto$2.seconds = seconds;
5655
- proto$2.minutes = minutes;
5656
- proto$2.hours = hours;
5657
- proto$2.days = days;
5658
- proto$2.weeks = weeks;
5659
- proto$2.months = months;
5660
- proto$2.years = years;
5661
- proto$2.humanize = humanize;
5662
- proto$2.toISOString = toISOString$1;
5663
- proto$2.toString = toISOString$1;
5664
- proto$2.toJSON = toISOString$1;
5665
- proto$2.locale = locale;
5666
- proto$2.localeData = localeData;
5667
-
5668
- proto$2.toIsoString = deprecate(
5669
- 'toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)',
5670
- toISOString$1
5671
- );
5672
- proto$2.lang = lang;
5673
-
5674
- // FORMATTING
5675
-
5676
- addFormatToken('X', 0, 0, 'unix');
5677
- addFormatToken('x', 0, 0, 'valueOf');
5678
-
5679
- // PARSING
5680
-
5681
- addRegexToken('x', matchSigned);
5682
- addRegexToken('X', matchTimestamp);
5683
- addParseToken('X', function (input, array, config) {
5684
- config._d = new Date(parseFloat(input) * 1000);
5685
- });
5686
- addParseToken('x', function (input, array, config) {
5687
- config._d = new Date(toInt(input));
5688
- });
5689
-
5690
- //! moment.js
5691
-
5692
- hooks.version = '2.29.1';
5693
-
5694
- setHookCallback(createLocal);
5695
-
5696
- hooks.fn = proto;
5697
- hooks.min = min;
5698
- hooks.max = max;
5699
- hooks.now = now;
5700
- hooks.utc = createUTC;
5701
- hooks.unix = createUnix;
5702
- hooks.months = listMonths;
5703
- hooks.isDate = isDate;
5704
- hooks.locale = getSetGlobalLocale;
5705
- hooks.invalid = createInvalid;
5706
- hooks.duration = createDuration;
5707
- hooks.isMoment = isMoment;
5708
- hooks.weekdays = listWeekdays;
5709
- hooks.parseZone = createInZone;
5710
- hooks.localeData = getLocale;
5711
- hooks.isDuration = isDuration;
5712
- hooks.monthsShort = listMonthsShort;
5713
- hooks.weekdaysMin = listWeekdaysMin;
5714
- hooks.defineLocale = defineLocale;
5715
- hooks.updateLocale = updateLocale;
5716
- hooks.locales = listLocales;
5717
- hooks.weekdaysShort = listWeekdaysShort;
5718
- hooks.normalizeUnits = normalizeUnits;
5719
- hooks.relativeTimeRounding = getSetRelativeTimeRounding;
5720
- hooks.relativeTimeThreshold = getSetRelativeTimeThreshold;
5721
- hooks.calendarFormat = getCalendarFormat;
5722
- hooks.prototype = proto;
5723
-
5724
- // currently HTML5 input type only supports 24-hour formats
5725
- hooks.HTML5_FMT = {
5726
- DATETIME_LOCAL: 'YYYY-MM-DDTHH:mm', // <input type="datetime-local" />
5727
- DATETIME_LOCAL_SECONDS: 'YYYY-MM-DDTHH:mm:ss', // <input type="datetime-local" step="1" />
5728
- DATETIME_LOCAL_MS: 'YYYY-MM-DDTHH:mm:ss.SSS', // <input type="datetime-local" step="0.001" />
5729
- DATE: 'YYYY-MM-DD', // <input type="date" />
5730
- TIME: 'HH:mm', // <input type="time" />
5731
- TIME_SECONDS: 'HH:mm:ss', // <input type="time" step="1" />
5732
- TIME_MS: 'HH:mm:ss.SSS', // <input type="time" step="0.001" />
5733
- WEEK: 'GGGG-[W]WW', // <input type="week" />
5734
- MONTH: 'YYYY-MM', // <input type="month" />
5735
- };
5736
-
5737
- return hooks;
5738
-
5739
- })));
5740
-
5741
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(678)(module)))
5742
-
5743
- /***/ }),
5744
- /* 1 */
5745
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
5746
-
5747
- "use strict";
5748
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__react__ = __webpack_require__(94);
5749
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["a"]; });
5750
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["b"]; });
5751
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["c"]; });
5752
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["e"]; });
5753
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["f"]; });
5754
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["g"]; });
5755
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["h"]; });
5756
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["i"]; });
5757
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["j"]; });
5758
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "m", function() { return __WEBPACK_IMPORTED_MODULE_0__react__["k"]; });
5759
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__react_platform__ = __webpack_require__(456);
5760
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_1__react_platform__["a"]; });
5761
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__utils__ = __webpack_require__(464);
5762
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "l", function() { return __WEBPACK_IMPORTED_MODULE_2__utils__["a"]; });
5763
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__serialize__ = __webpack_require__(465);
5764
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "n", function() { return __WEBPACK_IMPORTED_MODULE_3__serialize__["a"]; });
5765
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__raw_html__ = __webpack_require__(148);
5766
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_4__raw_html__["a"]; });
5767
-
5768
-
5769
-
5770
-
5771
-
5772
- //# sourceMappingURL=index.js.map
5773
-
5774
- /***/ }),
5775
- /* 2 */
5776
- /***/ (function(module, exports) {
5777
-
5778
- module.exports = lodash;
5779
-
5780
- /***/ }),
5781
- /* 3 */
5782
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
5783
-
5784
- "use strict";
5785
- /* harmony export (immutable) */ __webpack_exports__["a"] = _classCallCheck;
5786
- function _classCallCheck(instance, Constructor) {
5787
- if (!(instance instanceof Constructor)) {
5788
- throw new TypeError("Cannot call a class as a function");
5789
- }
5790
- }
5791
-
5792
- /***/ }),
5793
- /* 4 */
5794
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
5795
-
5796
- "use strict";
5797
- /* harmony export (immutable) */ __webpack_exports__["a"] = _createClass;
5798
- function _defineProperties(target, props) {
5799
- for (var i = 0; i < props.length; i++) {
5800
- var descriptor = props[i];
5801
- descriptor.enumerable = descriptor.enumerable || false;
5802
- descriptor.configurable = true;
5803
- if ("value" in descriptor) descriptor.writable = true;
5804
- Object.defineProperty(target, descriptor.key, descriptor);
5805
- }
5806
- }
5807
-
5808
- function _createClass(Constructor, protoProps, staticProps) {
5809
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
5810
- if (staticProps) _defineProperties(Constructor, staticProps);
5811
- return Constructor;
5812
- }
5813
-
5814
- /***/ }),
5815
- /* 5 */
5816
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
5817
-
5818
- "use strict";
5819
- /* harmony export (immutable) */ __webpack_exports__["a"] = _possibleConstructorReturn;
5820
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_typeof__ = __webpack_require__(39);
5821
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(10);
5822
-
5823
-
5824
- function _possibleConstructorReturn(self, call) {
5825
- if (call && (Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_typeof__["a" /* default */])(call) === "object" || typeof call === "function")) {
5826
- return call;
5827
- }
5828
-
5829
- return Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(self);
5830
- }
5831
-
5832
- /***/ }),
5833
- /* 6 */
5834
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
5835
-
5836
- "use strict";
5837
- /* harmony export (immutable) */ __webpack_exports__["a"] = _getPrototypeOf;
5838
- function _getPrototypeOf(o) {
5839
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
5840
- return o.__proto__ || Object.getPrototypeOf(o);
5841
- };
5842
- return _getPrototypeOf(o);
5843
- }
5844
-
5845
- /***/ }),
5846
- /* 7 */
5847
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
5848
-
5849
- "use strict";
5850
- /* harmony export (immutable) */ __webpack_exports__["a"] = _inherits;
5851
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_setPrototypeOf__ = __webpack_require__(469);
5852
-
5853
- function _inherits(subClass, superClass) {
5854
- if (typeof superClass !== "function" && superClass !== null) {
5855
- throw new TypeError("Super expression must either be null or a function");
5856
- }
5857
-
5858
- subClass.prototype = Object.create(superClass && superClass.prototype, {
5859
- constructor: {
5860
- value: subClass,
5861
- writable: true,
5862
- configurable: true
5863
- }
5864
- });
5865
- if (superClass) Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_setPrototypeOf__["a" /* default */])(subClass, superClass);
5866
- }
5867
-
5868
- /***/ }),
5869
- /* 8 */
5870
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
5871
-
5872
- "use strict";
5873
- /* harmony export (immutable) */ __webpack_exports__["a"] = _extends;
5874
- function _extends() {
5875
- _extends = Object.assign || function (target) {
5876
- for (var i = 1; i < arguments.length; i++) {
5877
- var source = arguments[i];
5878
-
5879
- for (var key in source) {
5880
- if (Object.prototype.hasOwnProperty.call(source, key)) {
5881
- target[key] = source[key];
5882
- }
5883
- }
5884
- }
5885
-
5886
- return target;
5887
- };
5888
-
5889
- return _extends.apply(this, arguments);
5890
- }
5891
-
5892
- /***/ }),
5893
- /* 9 */
5894
- /***/ (function(module, exports, __webpack_require__) {
5895
-
5896
- "use strict";
5897
- /* WEBPACK VAR INJECTION */(function(process) {
5898
-
5899
- if (process.env.NODE_ENV === 'production') {
5900
- module.exports = __webpack_require__(454);
5901
- } else {
5902
- module.exports = __webpack_require__(455);
5903
- }
5904
-
5905
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))
5906
-
5907
- /***/ }),
5908
- /* 10 */
5909
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
5910
-
5911
- "use strict";
5912
- /* harmony export (immutable) */ __webpack_exports__["a"] = _assertThisInitialized;
5913
- function _assertThisInitialized(self) {
5914
- if (self === void 0) {
5915
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
5916
- }
5917
-
5918
- return self;
5919
- }
5920
-
5921
- /***/ }),
5922
- /* 11 */
5923
- /***/ (function(module, exports, __webpack_require__) {
5924
-
5925
- /* WEBPACK VAR INJECTION */(function(process) {/**
5926
- * Copyright (c) 2013-present, Facebook, Inc.
5927
- *
5928
- * This source code is licensed under the MIT license found in the
5929
- * LICENSE file in the root directory of this source tree.
5930
- */
5931
-
5932
- if (process.env.NODE_ENV !== 'production') {
5933
- var ReactIs = __webpack_require__(70);
5934
-
5935
- // By explicitly using `prop-types` you are opting into new development behavior.
5936
- // http://fb.me/prop-types-in-prod
5937
- var throwOnDirectAccess = true;
5938
- module.exports = __webpack_require__(686)(ReactIs.isElement, throwOnDirectAccess);
5939
- } else {
5940
- // By explicitly using `prop-types` you are opting into new production behavior.
5941
- // http://fb.me/prop-types-in-prod
5942
- module.exports = __webpack_require__(687)();
5943
- }
5944
-
5945
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))
5946
-
5947
- /***/ }),
5948
- /* 12 */
5949
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
5950
-
5951
- "use strict";
5952
- /* harmony export (immutable) */ __webpack_exports__["a"] = _objectWithoutProperties;
5953
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectWithoutPropertiesLoose__ = __webpack_require__(453);
5954
-
5955
- function _objectWithoutProperties(source, excluded) {
5956
- if (source == null) return {};
5957
- var target = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectWithoutPropertiesLoose__["a" /* default */])(source, excluded);
5958
- var key, i;
5959
-
5960
- if (Object.getOwnPropertySymbols) {
5961
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
5962
-
5963
- for (i = 0; i < sourceSymbolKeys.length; i++) {
5964
- key = sourceSymbolKeys[i];
5965
- if (excluded.indexOf(key) >= 0) continue;
5966
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
5967
- target[key] = source[key];
5968
- }
5969
- }
5970
-
5971
- return target;
5972
- }
5973
-
5974
- /***/ }),
5975
- /* 13 */
5976
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
5977
-
5978
- "use strict";
5979
- /* harmony export (immutable) */ __webpack_exports__["a"] = _defineProperty;
5980
- function _defineProperty(obj, key, value) {
5981
- if (key in obj) {
5982
- Object.defineProperty(obj, key, {
5983
- value: value,
5984
- enumerable: true,
5985
- configurable: true,
5986
- writable: true
5987
- });
5988
- } else {
5989
- obj[key] = value;
5990
- }
5991
-
5992
- return obj;
5993
- }
5994
-
5995
- /***/ }),
5996
- /* 14 */
5997
- /***/ (function(module, exports, __webpack_require__) {
5998
-
5999
- var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
6000
- Copyright (c) 2017 Jed Watson.
6001
- Licensed under the MIT License (MIT), see
6002
- http://jedwatson.github.io/classnames
6003
- */
6004
- /* global define */
6005
-
6006
- (function () {
6007
- 'use strict';
6008
-
6009
- var hasOwn = {}.hasOwnProperty;
6010
-
6011
- function classNames () {
6012
- var classes = [];
6013
-
6014
- for (var i = 0; i < arguments.length; i++) {
6015
- var arg = arguments[i];
6016
- if (!arg) continue;
6017
-
6018
- var argType = typeof arg;
6019
-
6020
- if (argType === 'string' || argType === 'number') {
6021
- classes.push(arg);
6022
- } else if (Array.isArray(arg) && arg.length) {
6023
- var inner = classNames.apply(null, arg);
6024
- if (inner) {
6025
- classes.push(inner);
6026
- }
6027
- } else if (argType === 'object') {
6028
- for (var key in arg) {
6029
- if (hasOwn.call(arg, key) && arg[key]) {
6030
- classes.push(key);
6031
- }
6032
- }
6033
- }
6034
- }
6035
-
6036
- return classes.join(' ');
6037
- }
6038
-
6039
- if (typeof module !== 'undefined' && module.exports) {
6040
- classNames.default = classNames;
6041
- module.exports = classNames;
6042
- } else if (true) {
6043
- // register as 'classnames', consistent with npm package name
6044
- !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () {
6045
- return classNames;
6046
- }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
6047
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
6048
- } else {
6049
- window.classNames = classNames;
6050
- }
6051
- }());
6052
-
6053
-
6054
- /***/ }),
6055
- /* 15 */
6056
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
6057
-
6058
- "use strict";
6059
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__create_interpolate_element__ = __webpack_require__(552);
6060
- /* unused harmony reexport createInterpolateElement */
6061
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__react__ = __webpack_require__(106);
6062
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["a"]; });
6063
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["b"]; });
6064
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["d"]; });
6065
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["e"]; });
6066
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["f"]; });
6067
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["g"]; });
6068
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["h"]; });
6069
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["i"]; });
6070
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["j"]; });
6071
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["k"]; });
6072
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["l"]; });
6073
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "l", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["m"]; });
6074
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "m", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["n"]; });
6075
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__react_platform__ = __webpack_require__(553);
6076
- /* unused harmony namespace reexport */
6077
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils__ = __webpack_require__(554);
6078
- /* unused harmony namespace reexport */
6079
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__platform__ = __webpack_require__(555);
6080
- /* unused harmony reexport Platform */
6081
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__serialize__ = __webpack_require__(556);
6082
- /* unused harmony reexport renderToString */
6083
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__raw_html__ = __webpack_require__(166);
6084
- /* unused harmony reexport RawHTML */
6085
-
6086
-
6087
-
6088
-
6089
-
6090
-
6091
-
6092
- //# sourceMappingURL=index.js.map
6093
-
6094
- /***/ }),
6095
- /* 16 */
6096
- /***/ (function(module, exports, __webpack_require__) {
6097
-
6098
- "use strict";
6099
-
6100
-
6101
- Object.defineProperty(exports, "__esModule", {
6102
- value: true
6103
- });
6104
- exports["default"] = wrapValidator;
6105
-
6106
- var _object = _interopRequireDefault(__webpack_require__(25));
6107
-
6108
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
6109
-
6110
- function wrapValidator(validator, typeName) {
6111
- var typeChecker = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
6112
- return (0, _object["default"])(validator.bind(), {
6113
- typeName: typeName,
6114
- typeChecker: typeChecker,
6115
- isRequired: (0, _object["default"])(validator.isRequired.bind(), {
6116
- typeName: typeName,
6117
- typeChecker: typeChecker,
6118
- typeRequired: true
6119
- })
6120
- });
6121
- }
6122
- //# sourceMappingURL=wrapValidator.js.map
6123
-
6124
- /***/ }),
6125
- /* 17 */
6126
- /***/ (function(module, exports, __webpack_require__) {
6127
-
6128
- "use strict";
6129
-
6130
-
6131
- Object.defineProperty(exports, "__esModule", {
6132
- value: true
6133
- });
6134
- var DISPLAY_FORMAT = exports.DISPLAY_FORMAT = 'L';
6135
- var ISO_FORMAT = exports.ISO_FORMAT = 'YYYY-MM-DD';
6136
- var ISO_MONTH_FORMAT = exports.ISO_MONTH_FORMAT = 'YYYY-MM';
6137
-
6138
- var START_DATE = exports.START_DATE = 'startDate';
6139
- var END_DATE = exports.END_DATE = 'endDate';
6140
-
6141
- var HORIZONTAL_ORIENTATION = exports.HORIZONTAL_ORIENTATION = 'horizontal';
6142
- var VERTICAL_ORIENTATION = exports.VERTICAL_ORIENTATION = 'vertical';
6143
- var VERTICAL_SCROLLABLE = exports.VERTICAL_SCROLLABLE = 'verticalScrollable';
6144
-
6145
- var ICON_BEFORE_POSITION = exports.ICON_BEFORE_POSITION = 'before';
6146
- var ICON_AFTER_POSITION = exports.ICON_AFTER_POSITION = 'after';
6147
-
6148
- var INFO_POSITION_TOP = exports.INFO_POSITION_TOP = 'top';
6149
- var INFO_POSITION_BOTTOM = exports.INFO_POSITION_BOTTOM = 'bottom';
6150
- var INFO_POSITION_BEFORE = exports.INFO_POSITION_BEFORE = 'before';
6151
- var INFO_POSITION_AFTER = exports.INFO_POSITION_AFTER = 'after';
6152
-
6153
- var ANCHOR_LEFT = exports.ANCHOR_LEFT = 'left';
6154
- var ANCHOR_RIGHT = exports.ANCHOR_RIGHT = 'right';
6155
-
6156
- var OPEN_DOWN = exports.OPEN_DOWN = 'down';
6157
- var OPEN_UP = exports.OPEN_UP = 'up';
6158
-
6159
- var DAY_SIZE = exports.DAY_SIZE = 39;
6160
- var BLOCKED_MODIFIER = exports.BLOCKED_MODIFIER = 'blocked';
6161
- var WEEKDAYS = exports.WEEKDAYS = [0, 1, 2, 3, 4, 5, 6];
6162
-
6163
- var FANG_WIDTH_PX = exports.FANG_WIDTH_PX = 20;
6164
- var FANG_HEIGHT_PX = exports.FANG_HEIGHT_PX = 10;
6165
- var DEFAULT_VERTICAL_SPACING = exports.DEFAULT_VERTICAL_SPACING = 22;
6166
-
6167
- var MODIFIER_KEY_NAMES = exports.MODIFIER_KEY_NAMES = new Set(['Shift', 'Control', 'Alt', 'Meta']);
6168
-
6169
- /***/ }),
6170
- /* 18 */
6171
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
6172
-
6173
- "use strict";
6174
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_create_higher_order_component__ = __webpack_require__(46);
6175
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_0__utils_create_higher_order_component__["a"]; });
6176
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__higher_order_compose__ = __webpack_require__(481);
6177
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_1__higher_order_compose__["a"]; });
6178
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__higher_order_if_condition__ = __webpack_require__(482);
6179
- /* unused harmony reexport ifCondition */
6180
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__higher_order_pure__ = __webpack_require__(491);
6181
- /* unused harmony reexport pure */
6182
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__higher_order_with_global_events__ = __webpack_require__(495);
6183
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_4__higher_order_with_global_events__["a"]; });
6184
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__higher_order_with_instance_id__ = __webpack_require__(497);
6185
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_5__higher_order_with_instance_id__["a"]; });
6186
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__higher_order_with_safe_timeout__ = __webpack_require__(498);
6187
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_6__higher_order_with_safe_timeout__["a"]; });
6188
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__higher_order_with_state__ = __webpack_require__(499);
6189
- /* unused harmony reexport withState */
6190
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__hooks_use_copy_on_click__ = __webpack_require__(500);
6191
- /* unused harmony reexport useCopyOnClick */
6192
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__hooks_use_dragging__ = __webpack_require__(501);
6193
- /* unused harmony reexport __experimentalUseDragging */
6194
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__hooks_use_instance_id__ = __webpack_require__(153);
6195
- /* unused harmony reexport useInstanceId */
6196
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__hooks_use_keyboard_shortcut__ = __webpack_require__(502);
6197
- /* unused harmony reexport useKeyboardShortcut */
6198
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__hooks_use_media_query__ = __webpack_require__(101);
6199
- /* unused harmony reexport useMediaQuery */
6200
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__hooks_use_previous__ = __webpack_require__(154);
6201
- /* unused harmony reexport usePrevious */
6202
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__hooks_use_reduced_motion__ = __webpack_require__(503);
6203
- /* unused harmony reexport useReducedMotion */
6204
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__hooks_use_viewport_match__ = __webpack_require__(504);
6205
- /* unused harmony reexport useViewportMatch */
6206
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__hooks_use_resize_observer__ = __webpack_require__(505);
6207
- /* unused harmony reexport useResizeObserver */
6208
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__hooks_use_async_list__ = __webpack_require__(506);
6209
- /* unused harmony reexport useAsyncList */
6210
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__hooks_use_warn_on_change__ = __webpack_require__(508);
6211
- /* unused harmony reexport useWarnOnChange */
6212
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__hooks_use_debounce__ = __webpack_require__(509);
6213
- /* unused harmony reexport useDebounce */
6214
- // Utils
6215
- // Compose helper (aliased flowRight from Lodash)
6216
-
6217
- // Higher-order components
6218
-
6219
-
6220
-
6221
-
6222
-
6223
-
6224
- // Hooks
6225
-
6226
-
6227
-
6228
-
6229
-
6230
-
6231
-
6232
-
6233
-
6234
-
6235
-
6236
-
6237
-
6238
- //# sourceMappingURL=index.js.map
6239
-
6240
- /***/ }),
6241
- /* 19 */
6242
- /***/ (function(module, exports, __webpack_require__) {
6243
-
6244
- "use strict";
6245
-
6246
-
6247
- /* globals
6248
- Atomics,
6249
- SharedArrayBuffer,
6250
- */
6251
-
6252
- var undefined;
6253
-
6254
- var $TypeError = TypeError;
6255
-
6256
- var $gOPD = Object.getOwnPropertyDescriptor;
6257
- if ($gOPD) {
6258
- try {
6259
- $gOPD({}, '');
6260
- } catch (e) {
6261
- $gOPD = null; // this is IE 8, which has a broken gOPD
6262
- }
6263
- }
6264
-
6265
- var throwTypeError = function () { throw new $TypeError(); };
6266
- var ThrowTypeError = $gOPD
6267
- ? (function () {
6268
- try {
6269
- // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
6270
- arguments.callee; // IE 8 does not throw here
6271
- return throwTypeError;
6272
- } catch (calleeThrows) {
6273
- try {
6274
- // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
6275
- return $gOPD(arguments, 'callee').get;
6276
- } catch (gOPDthrows) {
6277
- return throwTypeError;
6278
- }
6279
- }
6280
- }())
6281
- : throwTypeError;
6282
-
6283
- var hasSymbols = __webpack_require__(43)();
6284
-
6285
- var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
6286
-
6287
- var generator; // = function * () {};
6288
- var generatorFunction = generator ? getProto(generator) : undefined;
6289
- var asyncFn; // async function() {};
6290
- var asyncFunction = asyncFn ? asyncFn.constructor : undefined;
6291
- var asyncGen; // async function * () {};
6292
- var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined;
6293
- var asyncGenIterator = asyncGen ? asyncGen() : undefined;
6294
-
6295
- var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
6296
-
6297
- var INTRINSICS = {
6298
- '%Array%': Array,
6299
- '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
6300
- '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype,
6301
- '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
6302
- '%ArrayPrototype%': Array.prototype,
6303
- '%ArrayProto_entries%': Array.prototype.entries,
6304
- '%ArrayProto_forEach%': Array.prototype.forEach,
6305
- '%ArrayProto_keys%': Array.prototype.keys,
6306
- '%ArrayProto_values%': Array.prototype.values,
6307
- '%AsyncFromSyncIteratorPrototype%': undefined,
6308
- '%AsyncFunction%': asyncFunction,
6309
- '%AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined,
6310
- '%AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined,
6311
- '%AsyncGeneratorFunction%': asyncGenFunction,
6312
- '%AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined,
6313
- '%AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined,
6314
- '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
6315
- '%Boolean%': Boolean,
6316
- '%BooleanPrototype%': Boolean.prototype,
6317
- '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
6318
- '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype,
6319
- '%Date%': Date,
6320
- '%DatePrototype%': Date.prototype,
6321
- '%decodeURI%': decodeURI,
6322
- '%decodeURIComponent%': decodeURIComponent,
6323
- '%encodeURI%': encodeURI,
6324
- '%encodeURIComponent%': encodeURIComponent,
6325
- '%Error%': Error,
6326
- '%ErrorPrototype%': Error.prototype,
6327
- '%eval%': eval, // eslint-disable-line no-eval
6328
- '%EvalError%': EvalError,
6329
- '%EvalErrorPrototype%': EvalError.prototype,
6330
- '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
6331
- '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype,
6332
- '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
6333
- '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype,
6334
- '%Function%': Function,
6335
- '%FunctionPrototype%': Function.prototype,
6336
- '%Generator%': generator ? getProto(generator()) : undefined,
6337
- '%GeneratorFunction%': generatorFunction,
6338
- '%GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined,
6339
- '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
6340
- '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype,
6341
- '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
6342
- '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype,
6343
- '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
6344
- '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype,
6345
- '%isFinite%': isFinite,
6346
- '%isNaN%': isNaN,
6347
- '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
6348
- '%JSON%': typeof JSON === 'object' ? JSON : undefined,
6349
- '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined,
6350
- '%Map%': typeof Map === 'undefined' ? undefined : Map,
6351
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
6352
- '%MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype,
6353
- '%Math%': Math,
6354
- '%Number%': Number,
6355
- '%NumberPrototype%': Number.prototype,
6356
- '%Object%': Object,
6357
- '%ObjectPrototype%': Object.prototype,
6358
- '%ObjProto_toString%': Object.prototype.toString,
6359
- '%ObjProto_valueOf%': Object.prototype.valueOf,
6360
- '%parseFloat%': parseFloat,
6361
- '%parseInt%': parseInt,
6362
- '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
6363
- '%PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype,
6364
- '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then,
6365
- '%Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all,
6366
- '%Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject,
6367
- '%Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve,
6368
- '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
6369
- '%RangeError%': RangeError,
6370
- '%RangeErrorPrototype%': RangeError.prototype,
6371
- '%ReferenceError%': ReferenceError,
6372
- '%ReferenceErrorPrototype%': ReferenceError.prototype,
6373
- '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
6374
- '%RegExp%': RegExp,
6375
- '%RegExpPrototype%': RegExp.prototype,
6376
- '%Set%': typeof Set === 'undefined' ? undefined : Set,
6377
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
6378
- '%SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype,
6379
- '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
6380
- '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype,
6381
- '%String%': String,
6382
- '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
6383
- '%StringPrototype%': String.prototype,
6384
- '%Symbol%': hasSymbols ? Symbol : undefined,
6385
- '%SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined,
6386
- '%SyntaxError%': SyntaxError,
6387
- '%SyntaxErrorPrototype%': SyntaxError.prototype,
6388
- '%ThrowTypeError%': ThrowTypeError,
6389
- '%TypedArray%': TypedArray,
6390
- '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined,
6391
- '%TypeError%': $TypeError,
6392
- '%TypeErrorPrototype%': $TypeError.prototype,
6393
- '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
6394
- '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype,
6395
- '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
6396
- '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype,
6397
- '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
6398
- '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype,
6399
- '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
6400
- '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype,
6401
- '%URIError%': URIError,
6402
- '%URIErrorPrototype%': URIError.prototype,
6403
- '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
6404
- '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype,
6405
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
6406
- '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype
6407
- };
6408
-
6409
- var bind = __webpack_require__(33);
6410
- var $replace = bind.call(Function.call, String.prototype.replace);
6411
-
6412
- /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
6413
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
6414
- var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
6415
- var stringToPath = function stringToPath(string) {
6416
- var result = [];
6417
- $replace(string, rePropName, function (match, number, quote, subString) {
6418
- result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match);
6419
- });
6420
- return result;
6421
- };
6422
- /* end adaptation */
6423
-
6424
- var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
6425
- if (!(name in INTRINSICS)) {
6426
- throw new SyntaxError('intrinsic ' + name + ' does not exist!');
6427
- }
6428
-
6429
- // istanbul ignore if // hopefully this is impossible to test :-)
6430
- if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) {
6431
- throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
6432
- }
6433
-
6434
- return INTRINSICS[name];
6435
- };
6436
-
6437
- module.exports = function GetIntrinsic(name, allowMissing) {
6438
- if (typeof name !== 'string' || name.length === 0) {
6439
- throw new TypeError('intrinsic name must be a non-empty string');
6440
- }
6441
- if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
6442
- throw new TypeError('"allowMissing" argument must be a boolean');
6443
- }
6444
-
6445
- var parts = stringToPath(name);
6446
-
6447
- var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing);
6448
- for (var i = 1; i < parts.length; i += 1) {
6449
- if (value != null) {
6450
- if ($gOPD && (i + 1) >= parts.length) {
6451
- var desc = $gOPD(value, parts[i]);
6452
- if (!allowMissing && !(parts[i] in value)) {
6453
- throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
6454
- }
6455
- // By convention, when a data property is converted to an accessor
6456
- // property to emulate a data property that does not suffer from
6457
- // the override mistake, that accessor's getter is marked with
6458
- // an `originalValue` property. Here, when we detect this, we
6459
- // uphold the illusion by pretending to see that original data
6460
- // property, i.e., returning the value rather than the getter
6461
- // itself.
6462
- value = desc && 'get' in desc && !('originalValue' in desc.get) ? desc.get : value[parts[i]];
6463
- } else {
6464
- value = value[parts[i]];
6465
- }
6466
- }
6467
- }
6468
- return value;
6469
- };
6470
-
6471
-
6472
- /***/ }),
6473
- /* 20 */
6474
- /***/ (function(module, exports) {
6475
-
6476
- // shim for using process in browser
6477
- var process = module.exports = {};
6478
-
6479
- // cached from whatever global is present so that test runners that stub it
6480
- // don't break things. But we need to wrap it in a try catch in case it is
6481
- // wrapped in strict mode code which doesn't define any globals. It's inside a
6482
- // function because try/catches deoptimize in certain engines.
6483
-
6484
- var cachedSetTimeout;
6485
- var cachedClearTimeout;
6486
-
6487
- function defaultSetTimout() {
6488
- throw new Error('setTimeout has not been defined');
6489
- }
6490
- function defaultClearTimeout () {
6491
- throw new Error('clearTimeout has not been defined');
6492
- }
6493
- (function () {
6494
- try {
6495
- if (typeof setTimeout === 'function') {
6496
- cachedSetTimeout = setTimeout;
6497
- } else {
6498
- cachedSetTimeout = defaultSetTimout;
6499
- }
6500
- } catch (e) {
6501
- cachedSetTimeout = defaultSetTimout;
6502
- }
6503
- try {
6504
- if (typeof clearTimeout === 'function') {
6505
- cachedClearTimeout = clearTimeout;
6506
- } else {
6507
- cachedClearTimeout = defaultClearTimeout;
6508
- }
6509
- } catch (e) {
6510
- cachedClearTimeout = defaultClearTimeout;
6511
- }
6512
- } ())
6513
- function runTimeout(fun) {
6514
- if (cachedSetTimeout === setTimeout) {
6515
- //normal enviroments in sane situations
6516
- return setTimeout(fun, 0);
6517
- }
6518
- // if setTimeout wasn't available but was latter defined
6519
- if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
6520
- cachedSetTimeout = setTimeout;
6521
- return setTimeout(fun, 0);
6522
- }
6523
- try {
6524
- // when when somebody has screwed with setTimeout but no I.E. maddness
6525
- return cachedSetTimeout(fun, 0);
6526
- } catch(e){
6527
- try {
6528
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
6529
- return cachedSetTimeout.call(null, fun, 0);
6530
- } catch(e){
6531
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
6532
- return cachedSetTimeout.call(this, fun, 0);
6533
- }
6534
- }
6535
-
6536
-
6537
- }
6538
- function runClearTimeout(marker) {
6539
- if (cachedClearTimeout === clearTimeout) {
6540
- //normal enviroments in sane situations
6541
- return clearTimeout(marker);
6542
- }
6543
- // if clearTimeout wasn't available but was latter defined
6544
- if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
6545
- cachedClearTimeout = clearTimeout;
6546
- return clearTimeout(marker);
6547
- }
6548
- try {
6549
- // when when somebody has screwed with setTimeout but no I.E. maddness
6550
- return cachedClearTimeout(marker);
6551
- } catch (e){
6552
- try {
6553
- // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
6554
- return cachedClearTimeout.call(null, marker);
6555
- } catch (e){
6556
- // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
6557
- // Some versions of I.E. have different rules for clearTimeout vs setTimeout
6558
- return cachedClearTimeout.call(this, marker);
6559
- }
6560
- }
6561
-
6562
-
6563
-
6564
- }
6565
- var queue = [];
6566
- var draining = false;
6567
- var currentQueue;
6568
- var queueIndex = -1;
6569
-
6570
- function cleanUpNextTick() {
6571
- if (!draining || !currentQueue) {
6572
- return;
6573
- }
6574
- draining = false;
6575
- if (currentQueue.length) {
6576
- queue = currentQueue.concat(queue);
6577
- } else {
6578
- queueIndex = -1;
6579
- }
6580
- if (queue.length) {
6581
- drainQueue();
6582
- }
6583
- }
6584
-
6585
- function drainQueue() {
6586
- if (draining) {
6587
- return;
6588
- }
6589
- var timeout = runTimeout(cleanUpNextTick);
6590
- draining = true;
6591
-
6592
- var len = queue.length;
6593
- while(len) {
6594
- currentQueue = queue;
6595
- queue = [];
6596
- while (++queueIndex < len) {
6597
- if (currentQueue) {
6598
- currentQueue[queueIndex].run();
6599
- }
6600
- }
6601
- queueIndex = -1;
6602
- len = queue.length;
6603
- }
6604
- currentQueue = null;
6605
- draining = false;
6606
- runClearTimeout(timeout);
6607
- }
6608
-
6609
- process.nextTick = function (fun) {
6610
- var args = new Array(arguments.length - 1);
6611
- if (arguments.length > 1) {
6612
- for (var i = 1; i < arguments.length; i++) {
6613
- args[i - 1] = arguments[i];
6614
- }
6615
- }
6616
- queue.push(new Item(fun, args));
6617
- if (queue.length === 1 && !draining) {
6618
- runTimeout(drainQueue);
6619
- }
6620
- };
6621
-
6622
- // v8 likes predictible objects
6623
- function Item(fun, array) {
6624
- this.fun = fun;
6625
- this.array = array;
6626
- }
6627
- Item.prototype.run = function () {
6628
- this.fun.apply(null, this.array);
6629
- };
6630
- process.title = 'browser';
6631
- process.browser = true;
6632
- process.env = {};
6633
- process.argv = [];
6634
- process.version = ''; // empty string to avoid regexp issues
6635
- process.versions = {};
6636
-
6637
- function noop() {}
6638
-
6639
- process.on = noop;
6640
- process.addListener = noop;
6641
- process.once = noop;
6642
- process.off = noop;
6643
- process.removeListener = noop;
6644
- process.removeAllListeners = noop;
6645
- process.emit = noop;
6646
- process.prependListener = noop;
6647
- process.prependOnceListener = noop;
6648
-
6649
- process.listeners = function (name) { return [] }
6650
-
6651
- process.binding = function (name) {
6652
- throw new Error('process.binding is not supported');
6653
- };
6654
-
6655
- process.cwd = function () { return '/' };
6656
- process.chdir = function (dir) {
6657
- throw new Error('process.chdir is not supported');
6658
- };
6659
- process.umask = function() { return 0; };
6660
-
6661
-
6662
- /***/ }),
6663
- /* 21 */
6664
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
6665
-
6666
- "use strict";
6667
- /* harmony export (immutable) */ __webpack_exports__["a"] = _toConsumableArray;
6668
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_arrayWithoutHoles__ = __webpack_require__(470);
6669
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_iterableToArray__ = __webpack_require__(471);
6670
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_unsupportedIterableToArray__ = __webpack_require__(150);
6671
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_nonIterableSpread__ = __webpack_require__(472);
6672
-
6673
-
6674
-
6675
-
6676
- function _toConsumableArray(arr) {
6677
- return Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_arrayWithoutHoles__["a" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_iterableToArray__["a" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_unsupportedIterableToArray__["a" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_nonIterableSpread__["a" /* default */])();
6678
- }
6679
-
6680
- /***/ }),
6681
- /* 22 */
6682
- /***/ (function(module, exports, __webpack_require__) {
6683
-
6684
- /* WEBPACK VAR INJECTION */(function(process) {module.exports = process.env.NODE_ENV === 'production' ? __webpack_require__(691) : __webpack_require__(692);
6685
-
6686
- //# sourceMappingURL=index.js.map
6687
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))
6688
-
6689
- /***/ }),
6690
- /* 23 */
6691
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
6692
-
6693
- "use strict";
6694
- /* harmony export (immutable) */ __webpack_exports__["a"] = _objectSpread;
6695
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(13);
6696
-
6697
- function _objectSpread(target) {
6698
- for (var i = 1; i < arguments.length; i++) {
6699
- var source = arguments[i] != null ? Object(arguments[i]) : {};
6700
- var ownKeys = Object.keys(source);
6701
-
6702
- if (typeof Object.getOwnPropertySymbols === 'function') {
6703
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
6704
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
6705
- }));
6706
- }
6707
-
6708
- ownKeys.forEach(function (key) {
6709
- Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(target, key, source[key]);
6710
- });
6711
- }
6712
-
6713
- return target;
6714
- }
6715
-
6716
- /***/ }),
6717
- /* 24 */
6718
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
6719
-
6720
- "use strict";
6721
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__create_interpolate_element__ = __webpack_require__(483);
6722
- /* unused harmony reexport createInterpolateElement */
6723
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__react__ = __webpack_require__(97);
6724
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["a"]; });
6725
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["d"]; });
6726
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["e"]; });
6727
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["f"]; });
6728
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["g"]; });
6729
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["h"]; });
6730
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["i"]; });
6731
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["j"]; });
6732
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["k"]; });
6733
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["l"]; });
6734
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["m"]; });
6735
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "l", function() { return __WEBPACK_IMPORTED_MODULE_1__react__["n"]; });
6736
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__react_platform__ = __webpack_require__(487);
6737
- /* unused harmony namespace reexport */
6738
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__utils__ = __webpack_require__(488);
6739
- /* unused harmony namespace reexport */
6740
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__platform__ = __webpack_require__(489);
6741
- /* unused harmony reexport Platform */
6742
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__serialize__ = __webpack_require__(490);
6743
- /* unused harmony reexport renderToString */
6744
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__raw_html__ = __webpack_require__(152);
6745
- /* unused harmony reexport RawHTML */
6746
-
6747
-
6748
-
6749
-
6750
-
6751
-
6752
-
6753
- //# sourceMappingURL=index.js.map
6754
-
6755
- /***/ }),
6756
- /* 25 */
6757
- /***/ (function(module, exports, __webpack_require__) {
6758
-
6759
- "use strict";
6760
-
6761
-
6762
- var defineProperties = __webpack_require__(28);
6763
- var callBind = __webpack_require__(128);
6764
-
6765
- var implementation = __webpack_require__(360);
6766
- var getPolyfill = __webpack_require__(361);
6767
- var shim = __webpack_require__(683);
6768
-
6769
- var polyfill = callBind.apply(getPolyfill());
6770
- // eslint-disable-next-line no-unused-vars
6771
- var bound = function assign(target, source1) {
6772
- return polyfill(Object, arguments);
6773
- };
6774
-
6775
- defineProperties(bound, {
6776
- getPolyfill: getPolyfill,
6777
- implementation: implementation,
6778
- shim: shim
6779
- });
6780
-
6781
- module.exports = bound;
6782
-
6783
-
6784
- /***/ }),
6785
- /* 26 */
6786
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
6787
-
6788
- "use strict";
6789
- /* unused harmony export setLocaleData */
6790
- /* harmony export (immutable) */ __webpack_exports__["a"] = __;
6791
- /* harmony export (immutable) */ __webpack_exports__["c"] = _x;
6792
- /* harmony export (immutable) */ __webpack_exports__["b"] = _n;
6793
- /* unused harmony export _nx */
6794
- /* harmony export (immutable) */ __webpack_exports__["d"] = sprintf;
6795
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__ = __webpack_require__(23);
6796
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tannin__ = __webpack_require__(80);
6797
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_memize__ = __webpack_require__(64);
6798
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_memize___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_memize__);
6799
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_sprintf_js__ = __webpack_require__(79);
6800
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_sprintf_js___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_sprintf_js__);
6801
-
6802
-
6803
- /**
6804
- * External dependencies
6805
- */
6806
-
6807
-
6808
-
6809
- /**
6810
- * Default locale data to use for Tannin domain when not otherwise provided.
6811
- * Assumes an English plural forms expression.
6812
- *
6813
- * @type {Object}
6814
- */
6815
-
6816
- var DEFAULT_LOCALE_DATA = {
6817
- '': {
6818
- plural_forms: 'plural=(n!=1)'
6819
- }
6820
- };
6821
- /**
6822
- * Log to console, once per message; or more precisely, per referentially equal
6823
- * argument set. Because Jed throws errors, we log these to the console instead
6824
- * to avoid crashing the application.
6825
- *
6826
- * @param {...*} args Arguments to pass to `console.error`
6827
- */
6828
-
6829
- var logErrorOnce = __WEBPACK_IMPORTED_MODULE_2_memize___default()(console.error); // eslint-disable-line no-console
6830
-
6831
- /**
6832
- * The underlying instance of Tannin to which exported functions interface.
6833
- *
6834
- * @type {Tannin}
6835
- */
6836
-
6837
- var i18n = new __WEBPACK_IMPORTED_MODULE_1_tannin__["a" /* default */]({});
6838
- /**
6839
- * Merges locale data into the Tannin instance by domain. Accepts data in a
6840
- * Jed-formatted JSON object shape.
6841
- *
6842
- * @see http://messageformat.github.io/Jed/
6843
- *
6844
- * @param {?Object} data Locale data configuration.
6845
- * @param {?string} domain Domain for which configuration applies.
6846
- */
6847
-
6848
- function setLocaleData(data) {
6849
- var domain = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
6850
- i18n.data[domain] = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__["a" /* default */])({}, DEFAULT_LOCALE_DATA, i18n.data[domain], data); // Populate default domain configuration (supported locale date which omits
6851
- // a plural forms expression).
6852
-
6853
- i18n.data[domain][''] = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__["a" /* default */])({}, DEFAULT_LOCALE_DATA[''], i18n.data[domain]['']);
6854
- }
6855
- /**
6856
- * Wrapper for Tannin's `dcnpgettext`. Populates default locale data if not
6857
- * otherwise previously assigned.
6858
- *
6859
- * @param {?string} domain Domain to retrieve the translated text.
6860
- * @param {?string} context Context information for the translators.
6861
- * @param {string} single Text to translate if non-plural. Used as fallback
6862
- * return value on a caught error.
6863
- * @param {?string} plural The text to be used if the number is plural.
6864
- * @param {?number} number The number to compare against to use either the
6865
- * singular or plural form.
6866
- *
6867
- * @return {string} The translated string.
6868
- */
6869
-
6870
- function dcnpgettext() {
6871
- var domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
6872
- var context = arguments.length > 1 ? arguments[1] : undefined;
6873
- var single = arguments.length > 2 ? arguments[2] : undefined;
6874
- var plural = arguments.length > 3 ? arguments[3] : undefined;
6875
- var number = arguments.length > 4 ? arguments[4] : undefined;
6876
-
6877
- if (!i18n.data[domain]) {
6878
- setLocaleData(undefined, domain);
6879
- }
6880
-
6881
- return i18n.dcnpgettext(domain, context, single, plural, number);
6882
- }
6883
- /**
6884
- * Retrieve the translation of text.
6885
- *
6886
- * @see https://developer.wordpress.org/reference/functions/__/
6887
- *
6888
- * @param {string} text Text to translate.
6889
- * @param {?string} domain Domain to retrieve the translated text.
6890
- *
6891
- * @return {string} Translated text.
6892
- */
6893
-
6894
-
6895
- function __(text, domain) {
6896
- return dcnpgettext(domain, undefined, text);
6897
- }
6898
- /**
6899
- * Retrieve translated string with gettext context.
6900
- *
6901
- * @see https://developer.wordpress.org/reference/functions/_x/
6902
- *
6903
- * @param {string} text Text to translate.
6904
- * @param {string} context Context information for the translators.
6905
- * @param {?string} domain Domain to retrieve the translated text.
6906
- *
6907
- * @return {string} Translated context string without pipe.
6908
- */
6909
-
6910
- function _x(text, context, domain) {
6911
- return dcnpgettext(domain, context, text);
6912
- }
6913
- /**
6914
- * Translates and retrieves the singular or plural form based on the supplied
6915
- * number.
6916
- *
6917
- * @see https://developer.wordpress.org/reference/functions/_n/
6918
- *
6919
- * @param {string} single The text to be used if the number is singular.
6920
- * @param {string} plural The text to be used if the number is plural.
6921
- * @param {number} number The number to compare against to use either the
6922
- * singular or plural form.
6923
- * @param {?string} domain Domain to retrieve the translated text.
6924
- *
6925
- * @return {string} The translated singular or plural form.
6926
- */
6927
-
6928
- function _n(single, plural, number, domain) {
6929
- return dcnpgettext(domain, undefined, single, plural, number);
6930
- }
6931
- /**
6932
- * Translates and retrieves the singular or plural form based on the supplied
6933
- * number, with gettext context.
6934
- *
6935
- * @see https://developer.wordpress.org/reference/functions/_nx/
6936
- *
6937
- * @param {string} single The text to be used if the number is singular.
6938
- * @param {string} plural The text to be used if the number is plural.
6939
- * @param {number} number The number to compare against to use either the
6940
- * singular or plural form.
6941
- * @param {string} context Context information for the translators.
6942
- * @param {?string} domain Domain to retrieve the translated text.
6943
- *
6944
- * @return {string} The translated singular or plural form.
6945
- */
6946
-
6947
- function _nx(single, plural, number, context, domain) {
6948
- return dcnpgettext(domain, context, single, plural, number);
6949
- }
6950
- /**
6951
- * Returns a formatted string. If an error occurs in applying the format, the
6952
- * original format string is returned.
6953
- *
6954
- * @param {string} format The format of the string to generate.
6955
- * @param {string[]} ...args Arguments to apply to the format.
6956
- *
6957
- * @see http://www.diveintojavascript.com/projects/javascript-sprintf
6958
- *
6959
- * @return {string} The formatted string.
6960
- */
6961
-
6962
- function sprintf(format) {
6963
- try {
6964
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
6965
- args[_key - 1] = arguments[_key];
6966
- }
6967
-
6968
- return __WEBPACK_IMPORTED_MODULE_3_sprintf_js___default.a.sprintf.apply(__WEBPACK_IMPORTED_MODULE_3_sprintf_js___default.a, [format].concat(args));
6969
- } catch (error) {
6970
- logErrorOnce('sprintf error: \n\n' + error.toString());
6971
- return format;
6972
- }
6973
- }
6974
- //# sourceMappingURL=index.js.map
6975
-
6976
- /***/ }),
6977
- /* 27 */
6978
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
6979
-
6980
- "use strict";
6981
- /* harmony export (immutable) */ __webpack_exports__["a"] = _slicedToArray;
6982
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_arrayWithHoles__ = __webpack_require__(484);
6983
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_iterableToArrayLimit__ = __webpack_require__(485);
6984
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_unsupportedIterableToArray__ = __webpack_require__(150);
6985
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_nonIterableRest__ = __webpack_require__(486);
6986
-
6987
-
6988
-
6989
-
6990
- function _slicedToArray(arr, i) {
6991
- return Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_arrayWithHoles__["a" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_iterableToArrayLimit__["a" /* default */])(arr, i) || Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_unsupportedIterableToArray__["a" /* default */])(arr, i) || Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_nonIterableRest__["a" /* default */])();
6992
- }
6993
-
6994
- /***/ }),
6995
- /* 28 */
6996
- /***/ (function(module, exports, __webpack_require__) {
6997
-
6998
- "use strict";
6999
-
7000
-
7001
- var keys = __webpack_require__(203);
7002
- var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
7003
-
7004
- var toStr = Object.prototype.toString;
7005
- var concat = Array.prototype.concat;
7006
- var origDefineProperty = Object.defineProperty;
7007
-
7008
- var isFunction = function (fn) {
7009
- return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
7010
- };
7011
-
7012
- var arePropertyDescriptorsSupported = function () {
7013
- var obj = {};
7014
- try {
7015
- origDefineProperty(obj, 'x', { enumerable: false, value: obj });
7016
- // eslint-disable-next-line no-unused-vars, no-restricted-syntax
7017
- for (var _ in obj) { // jscs:ignore disallowUnusedVariables
7018
- return false;
7019
- }
7020
- return obj.x === obj;
7021
- } catch (e) { /* this is IE 8. */
7022
- return false;
7023
- }
7024
- };
7025
- var supportsDescriptors = origDefineProperty && arePropertyDescriptorsSupported();
7026
-
7027
- var defineProperty = function (object, name, value, predicate) {
7028
- if (name in object && (!isFunction(predicate) || !predicate())) {
7029
- return;
7030
- }
7031
- if (supportsDescriptors) {
7032
- origDefineProperty(object, name, {
7033
- configurable: true,
7034
- enumerable: false,
7035
- value: value,
7036
- writable: true
7037
- });
7038
- } else {
7039
- object[name] = value;
7040
- }
7041
- };
7042
-
7043
- var defineProperties = function (object, map) {
7044
- var predicates = arguments.length > 2 ? arguments[2] : {};
7045
- var props = keys(map);
7046
- if (hasSymbols) {
7047
- props = concat.call(props, Object.getOwnPropertySymbols(map));
7048
- }
7049
- for (var i = 0; i < props.length; i += 1) {
7050
- defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
7051
- }
7052
- };
7053
-
7054
- defineProperties.supportsDescriptors = !!supportsDescriptors;
7055
-
7056
- module.exports = defineProperties;
7057
-
7058
-
7059
- /***/ }),
7060
- /* 29 */
7061
- /***/ (function(module, exports, __webpack_require__) {
7062
-
7063
- "use strict";
7064
-
7065
-
7066
- Object.defineProperty(exports, "__esModule", {
7067
- value: true
7068
- });
7069
- var calendarLabel = 'Calendar';
7070
- var closeDatePicker = 'Close';
7071
- var focusStartDate = 'Interact with the calendar and add the check-in date for your trip.';
7072
- var clearDate = 'Clear Date';
7073
- var clearDates = 'Clear Dates';
7074
- var jumpToPrevMonth = 'Move backward to switch to the previous month.';
7075
- var jumpToNextMonth = 'Move forward to switch to the next month.';
7076
- var keyboardShortcuts = 'Keyboard Shortcuts';
7077
- var showKeyboardShortcutsPanel = 'Open the keyboard shortcuts panel.';
7078
- var hideKeyboardShortcutsPanel = 'Close the shortcuts panel.';
7079
- var openThisPanel = 'Open this panel.';
7080
- var enterKey = 'Enter key';
7081
- var leftArrowRightArrow = 'Right and left arrow keys';
7082
- var upArrowDownArrow = 'up and down arrow keys';
7083
- var pageUpPageDown = 'page up and page down keys';
7084
- var homeEnd = 'Home and end keys';
7085
- var escape = 'Escape key';
7086
- var questionMark = 'Question mark';
7087
- var selectFocusedDate = 'Select the date in focus.';
7088
- var moveFocusByOneDay = 'Move backward (left) and forward (right) by one day.';
7089
- var moveFocusByOneWeek = 'Move backward (up) and forward (down) by one week.';
7090
- var moveFocusByOneMonth = 'Switch months.';
7091
- var moveFocustoStartAndEndOfWeek = 'Go to the first or last day of a week.';
7092
- var returnFocusToInput = 'Return to the date input field.';
7093
- var keyboardNavigationInstructions = 'Press the down arrow key to interact with the calendar and\n select a date. Press the question mark key to get the keyboard shortcuts for changing dates.';
7094
-
7095
- var chooseAvailableStartDate = function chooseAvailableStartDate(_ref) {
7096
- var date = _ref.date;
7097
- return 'Choose ' + String(date) + ' as your check-in date. It\u2019s available.';
7098
- };
7099
- var chooseAvailableEndDate = function chooseAvailableEndDate(_ref2) {
7100
- var date = _ref2.date;
7101
- return 'Choose ' + String(date) + ' as your check-out date. It\u2019s available.';
7102
- };
7103
- var chooseAvailableDate = function chooseAvailableDate(_ref3) {
7104
- var date = _ref3.date;
7105
- return date;
7106
- };
7107
- var dateIsUnavailable = function dateIsUnavailable(_ref4) {
7108
- var date = _ref4.date;
7109
- return 'Not available. ' + String(date);
7110
- };
7111
- var dateIsSelected = function dateIsSelected(_ref5) {
7112
- var date = _ref5.date;
7113
- return 'Selected. ' + String(date);
7114
- };
7115
-
7116
- exports['default'] = {
7117
- calendarLabel: calendarLabel,
7118
- closeDatePicker: closeDatePicker,
7119
- focusStartDate: focusStartDate,
7120
- clearDate: clearDate,
7121
- clearDates: clearDates,
7122
- jumpToPrevMonth: jumpToPrevMonth,
7123
- jumpToNextMonth: jumpToNextMonth,
7124
- keyboardShortcuts: keyboardShortcuts,
7125
- showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
7126
- hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
7127
- openThisPanel: openThisPanel,
7128
- enterKey: enterKey,
7129
- leftArrowRightArrow: leftArrowRightArrow,
7130
- upArrowDownArrow: upArrowDownArrow,
7131
- pageUpPageDown: pageUpPageDown,
7132
- homeEnd: homeEnd,
7133
- escape: escape,
7134
- questionMark: questionMark,
7135
- selectFocusedDate: selectFocusedDate,
7136
- moveFocusByOneDay: moveFocusByOneDay,
7137
- moveFocusByOneWeek: moveFocusByOneWeek,
7138
- moveFocusByOneMonth: moveFocusByOneMonth,
7139
- moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
7140
- returnFocusToInput: returnFocusToInput,
7141
- keyboardNavigationInstructions: keyboardNavigationInstructions,
7142
-
7143
- chooseAvailableStartDate: chooseAvailableStartDate,
7144
- chooseAvailableEndDate: chooseAvailableEndDate,
7145
- dateIsUnavailable: dateIsUnavailable,
7146
- dateIsSelected: dateIsSelected
7147
- };
7148
- var DateRangePickerPhrases = exports.DateRangePickerPhrases = {
7149
- calendarLabel: calendarLabel,
7150
- closeDatePicker: closeDatePicker,
7151
- clearDates: clearDates,
7152
- focusStartDate: focusStartDate,
7153
- jumpToPrevMonth: jumpToPrevMonth,
7154
- jumpToNextMonth: jumpToNextMonth,
7155
- keyboardShortcuts: keyboardShortcuts,
7156
- showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
7157
- hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
7158
- openThisPanel: openThisPanel,
7159
- enterKey: enterKey,
7160
- leftArrowRightArrow: leftArrowRightArrow,
7161
- upArrowDownArrow: upArrowDownArrow,
7162
- pageUpPageDown: pageUpPageDown,
7163
- homeEnd: homeEnd,
7164
- escape: escape,
7165
- questionMark: questionMark,
7166
- selectFocusedDate: selectFocusedDate,
7167
- moveFocusByOneDay: moveFocusByOneDay,
7168
- moveFocusByOneWeek: moveFocusByOneWeek,
7169
- moveFocusByOneMonth: moveFocusByOneMonth,
7170
- moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
7171
- returnFocusToInput: returnFocusToInput,
7172
- keyboardNavigationInstructions: keyboardNavigationInstructions,
7173
- chooseAvailableStartDate: chooseAvailableStartDate,
7174
- chooseAvailableEndDate: chooseAvailableEndDate,
7175
- dateIsUnavailable: dateIsUnavailable,
7176
- dateIsSelected: dateIsSelected
7177
- };
7178
-
7179
- var DateRangePickerInputPhrases = exports.DateRangePickerInputPhrases = {
7180
- focusStartDate: focusStartDate,
7181
- clearDates: clearDates,
7182
- keyboardNavigationInstructions: keyboardNavigationInstructions
7183
- };
7184
-
7185
- var SingleDatePickerPhrases = exports.SingleDatePickerPhrases = {
7186
- calendarLabel: calendarLabel,
7187
- closeDatePicker: closeDatePicker,
7188
- clearDate: clearDate,
7189
- jumpToPrevMonth: jumpToPrevMonth,
7190
- jumpToNextMonth: jumpToNextMonth,
7191
- keyboardShortcuts: keyboardShortcuts,
7192
- showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
7193
- hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
7194
- openThisPanel: openThisPanel,
7195
- enterKey: enterKey,
7196
- leftArrowRightArrow: leftArrowRightArrow,
7197
- upArrowDownArrow: upArrowDownArrow,
7198
- pageUpPageDown: pageUpPageDown,
7199
- homeEnd: homeEnd,
7200
- escape: escape,
7201
- questionMark: questionMark,
7202
- selectFocusedDate: selectFocusedDate,
7203
- moveFocusByOneDay: moveFocusByOneDay,
7204
- moveFocusByOneWeek: moveFocusByOneWeek,
7205
- moveFocusByOneMonth: moveFocusByOneMonth,
7206
- moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
7207
- returnFocusToInput: returnFocusToInput,
7208
- keyboardNavigationInstructions: keyboardNavigationInstructions,
7209
- chooseAvailableDate: chooseAvailableDate,
7210
- dateIsUnavailable: dateIsUnavailable,
7211
- dateIsSelected: dateIsSelected
7212
- };
7213
-
7214
- var SingleDatePickerInputPhrases = exports.SingleDatePickerInputPhrases = {
7215
- clearDate: clearDate,
7216
- keyboardNavigationInstructions: keyboardNavigationInstructions
7217
- };
7218
-
7219
- var DayPickerPhrases = exports.DayPickerPhrases = {
7220
- calendarLabel: calendarLabel,
7221
- jumpToPrevMonth: jumpToPrevMonth,
7222
- jumpToNextMonth: jumpToNextMonth,
7223
- keyboardShortcuts: keyboardShortcuts,
7224
- showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
7225
- hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
7226
- openThisPanel: openThisPanel,
7227
- enterKey: enterKey,
7228
- leftArrowRightArrow: leftArrowRightArrow,
7229
- upArrowDownArrow: upArrowDownArrow,
7230
- pageUpPageDown: pageUpPageDown,
7231
- homeEnd: homeEnd,
7232
- escape: escape,
7233
- questionMark: questionMark,
7234
- selectFocusedDate: selectFocusedDate,
7235
- moveFocusByOneDay: moveFocusByOneDay,
7236
- moveFocusByOneWeek: moveFocusByOneWeek,
7237
- moveFocusByOneMonth: moveFocusByOneMonth,
7238
- moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
7239
- returnFocusToInput: returnFocusToInput,
7240
- chooseAvailableStartDate: chooseAvailableStartDate,
7241
- chooseAvailableEndDate: chooseAvailableEndDate,
7242
- chooseAvailableDate: chooseAvailableDate,
7243
- dateIsUnavailable: dateIsUnavailable,
7244
- dateIsSelected: dateIsSelected
7245
- };
7246
-
7247
- var DayPickerKeyboardShortcutsPhrases = exports.DayPickerKeyboardShortcutsPhrases = {
7248
- keyboardShortcuts: keyboardShortcuts,
7249
- showKeyboardShortcutsPanel: showKeyboardShortcutsPanel,
7250
- hideKeyboardShortcutsPanel: hideKeyboardShortcutsPanel,
7251
- openThisPanel: openThisPanel,
7252
- enterKey: enterKey,
7253
- leftArrowRightArrow: leftArrowRightArrow,
7254
- upArrowDownArrow: upArrowDownArrow,
7255
- pageUpPageDown: pageUpPageDown,
7256
- homeEnd: homeEnd,
7257
- escape: escape,
7258
- questionMark: questionMark,
7259
- selectFocusedDate: selectFocusedDate,
7260
- moveFocusByOneDay: moveFocusByOneDay,
7261
- moveFocusByOneWeek: moveFocusByOneWeek,
7262
- moveFocusByOneMonth: moveFocusByOneMonth,
7263
- moveFocustoStartAndEndOfWeek: moveFocustoStartAndEndOfWeek,
7264
- returnFocusToInput: returnFocusToInput
7265
- };
7266
-
7267
- var DayPickerNavigationPhrases = exports.DayPickerNavigationPhrases = {
7268
- jumpToPrevMonth: jumpToPrevMonth,
7269
- jumpToNextMonth: jumpToNextMonth
7270
- };
7271
-
7272
- var CalendarDayPhrases = exports.CalendarDayPhrases = {
7273
- chooseAvailableDate: chooseAvailableDate,
7274
- dateIsUnavailable: dateIsUnavailable,
7275
- dateIsSelected: dateIsSelected
7276
- };
7277
-
7278
- /***/ }),
7279
- /* 30 */
7280
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
7281
-
7282
- "use strict";
7283
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return LINE_SEPARATOR; });
7284
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return OBJECT_REPLACEMENT_CHARACTER; });
7285
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return ZWNBSP; });
7286
- /**
7287
- * Line separator character, used for multiline text.
7288
- */
7289
- var LINE_SEPARATOR = "\u2028";
7290
- /**
7291
- * Object replacement character, used as a placeholder for objects.
7292
- */
7293
-
7294
- var OBJECT_REPLACEMENT_CHARACTER = "\uFFFC";
7295
- /**
7296
- * Zero width non-breaking space, used as padding in the editable DOM tree when
7297
- * it is empty otherwise.
7298
- */
7299
-
7300
- var ZWNBSP = "\uFEFF";
7301
- //# sourceMappingURL=special-characters.js.map
7302
-
7303
- /***/ }),
7304
- /* 31 */
7305
- /***/ (function(module, exports, __webpack_require__) {
7306
-
7307
- "use strict";
7308
-
7309
-
7310
- Object.defineProperty(exports, "__esModule", {
7311
- value: true
7312
- });
7313
- exports['default'] = getPhrasePropTypes;
7314
-
7315
- var _object = __webpack_require__(25);
7316
-
7317
- var _object2 = _interopRequireDefault(_object);
7318
-
7319
- var _propTypes = __webpack_require__(11);
7320
-
7321
- var _propTypes2 = _interopRequireDefault(_propTypes);
7322
-
7323
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
7324
-
7325
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7326
-
7327
- function getPhrasePropTypes(defaultPhrases) {
7328
- return Object.keys(defaultPhrases).reduce(function (phrases, key) {
7329
- return (0, _object2['default'])({}, phrases, _defineProperty({}, key, _propTypes2['default'].oneOfType([_propTypes2['default'].string, _propTypes2['default'].func, _propTypes2['default'].node])));
7330
- }, {});
7331
- }
7332
-
7333
- /***/ }),
7334
- /* 32 */
7335
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
7336
-
7337
- "use strict";
7338
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BACKSPACE; });
7339
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return TAB; });
7340
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return ENTER; });
7341
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return ESCAPE; });
7342
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return SPACE; });
7343
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return LEFT; });
7344
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return UP; });
7345
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "g", function() { return RIGHT; });
7346
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return DOWN; });
7347
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return DELETE; });
7348
- /* unused harmony export F10 */
7349
- /* unused harmony export ALT */
7350
- /* unused harmony export CTRL */
7351
- /* unused harmony export COMMAND */
7352
- /* unused harmony export SHIFT */
7353
- /* unused harmony export ZERO */
7354
- /* unused harmony export modifiers */
7355
- /* unused harmony export rawShortcut */
7356
- /* unused harmony export displayShortcutList */
7357
- /* unused harmony export displayShortcut */
7358
- /* unused harmony export shortcutAriaLabel */
7359
- /* unused harmony export isKeyboardEvent */
7360
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(13);
7361
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__ = __webpack_require__(21);
7362
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash__ = __webpack_require__(2);
7363
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash__);
7364
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__wordpress_i18n__ = __webpack_require__(473);
7365
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__platform__ = __webpack_require__(480);
7366
-
7367
-
7368
-
7369
- /**
7370
- * Note: The order of the modifier keys in many of the [foo]Shortcut()
7371
- * functions in this file are intentional and should not be changed. They're
7372
- * designed to fit with the standard menu keyboard shortcuts shown in the
7373
- * user's platform.
7374
- *
7375
- * For example, on MacOS menu shortcuts will place Shift before Command, but
7376
- * on Windows Control will usually come first. So don't provide your own
7377
- * shortcut combos directly to keyboardShortcut().
7378
- */
7379
-
7380
- /**
7381
- * External dependencies
7382
- */
7383
-
7384
- /**
7385
- * WordPress dependencies
7386
- */
7387
-
7388
-
7389
- /**
7390
- * Internal dependencies
7391
- */
7392
-
7393
-
7394
- /**
7395
- * @typedef {'primary'|'primaryShift'|'primaryAlt'|'secondary'|'access'|'ctrl'|'alt'|'ctrlShift'|'shift'|'shiftAlt'} WPKeycodeModifier
7396
- */
7397
-
7398
- /**
7399
- * An object of handler functions for each of the possible modifier
7400
- * combinations. A handler will return a value for a given key.
7401
- *
7402
- * @typedef {Record<WPKeycodeModifier, (key:string)=>any>} WPKeycodeHandlerByModifier
7403
- */
7404
-
7405
- /**
7406
- * Keycode for BACKSPACE key.
7407
- */
7408
-
7409
- var BACKSPACE = 8;
7410
- /**
7411
- * Keycode for TAB key.
7412
- */
7413
-
7414
- var TAB = 9;
7415
- /**
7416
- * Keycode for ENTER key.
7417
- */
7418
-
7419
- var ENTER = 13;
7420
- /**
7421
- * Keycode for ESCAPE key.
7422
- */
7423
-
7424
- var ESCAPE = 27;
7425
- /**
7426
- * Keycode for SPACE key.
7427
- */
7428
-
7429
- var SPACE = 32;
7430
- /**
7431
- * Keycode for LEFT key.
7432
- */
7433
-
7434
- var LEFT = 37;
7435
- /**
7436
- * Keycode for UP key.
7437
- */
7438
-
7439
- var UP = 38;
7440
- /**
7441
- * Keycode for RIGHT key.
7442
- */
7443
-
7444
- var RIGHT = 39;
7445
- /**
7446
- * Keycode for DOWN key.
7447
- */
7448
-
7449
- var DOWN = 40;
7450
- /**
7451
- * Keycode for DELETE key.
7452
- */
7453
-
7454
- var DELETE = 46;
7455
- /**
7456
- * Keycode for F10 key.
7457
- */
7458
-
7459
- var F10 = 121;
7460
- /**
7461
- * Keycode for ALT key.
7462
- */
7463
-
7464
- var ALT = 'alt';
7465
- /**
7466
- * Keycode for CTRL key.
7467
- */
7468
-
7469
- var CTRL = 'ctrl';
7470
- /**
7471
- * Keycode for COMMAND/META key.
7472
- */
7473
-
7474
- var COMMAND = 'meta';
7475
- /**
7476
- * Keycode for SHIFT key.
7477
- */
7478
-
7479
- var SHIFT = 'shift';
7480
- /**
7481
- * Keycode for ZERO key.
7482
- */
7483
-
7484
- var ZERO = 48;
7485
- /**
7486
- * Object that contains functions that return the available modifier
7487
- * depending on platform.
7488
- *
7489
- * - `primary`: takes a isApple function as a parameter.
7490
- * - `primaryShift`: takes a isApple function as a parameter.
7491
- * - `primaryAlt`: takes a isApple function as a parameter.
7492
- * - `secondary`: takes a isApple function as a parameter.
7493
- * - `access`: takes a isApple function as a parameter.
7494
- * - `ctrl`
7495
- * - `alt`
7496
- * - `ctrlShift`
7497
- * - `shift`
7498
- * - `shiftAlt`
7499
- */
7500
-
7501
- var modifiers = {
7502
- primary: function primary(_isApple) {
7503
- return _isApple() ? [COMMAND] : [CTRL];
7504
- },
7505
- primaryShift: function primaryShift(_isApple) {
7506
- return _isApple() ? [SHIFT, COMMAND] : [CTRL, SHIFT];
7507
- },
7508
- primaryAlt: function primaryAlt(_isApple) {
7509
- return _isApple() ? [ALT, COMMAND] : [CTRL, ALT];
7510
- },
7511
- secondary: function secondary(_isApple) {
7512
- return _isApple() ? [SHIFT, ALT, COMMAND] : [CTRL, SHIFT, ALT];
7513
- },
7514
- access: function access(_isApple) {
7515
- return _isApple() ? [CTRL, ALT] : [SHIFT, ALT];
7516
- },
7517
- ctrl: function ctrl() {
7518
- return [CTRL];
7519
- },
7520
- alt: function alt() {
7521
- return [ALT];
7522
- },
7523
- ctrlShift: function ctrlShift() {
7524
- return [CTRL, SHIFT];
7525
- },
7526
- shift: function shift() {
7527
- return [SHIFT];
7528
- },
7529
- shiftAlt: function shiftAlt() {
7530
- return [SHIFT, ALT];
7531
- }
7532
- };
7533
- /**
7534
- * An object that contains functions to get raw shortcuts.
7535
- * E.g. rawShortcut.primary( 'm' ) will return 'meta+m' on Mac.
7536
- * These are intended for user with the KeyboardShortcuts component or TinyMCE.
7537
- *
7538
- * @type {WPKeycodeHandlerByModifier} Keyed map of functions to raw shortcuts.
7539
- */
7540
-
7541
- var rawShortcut = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(modifiers, function (modifier) {
7542
- return function (character) {
7543
- var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_4__platform__["a" /* isAppleOS */];
7544
-
7545
- return [].concat(Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(modifier(_isApple)), [character.toLowerCase()]).join('+');
7546
- };
7547
- });
7548
- /**
7549
- * Return an array of the parts of a keyboard shortcut chord for display
7550
- * E.g displayShortcutList.primary( 'm' ) will return [ '⌘', 'M' ] on Mac.
7551
- *
7552
- * @type {WPKeycodeHandlerByModifier} Keyed map of functions to shortcut
7553
- * sequences.
7554
- */
7555
-
7556
- var displayShortcutList = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(modifiers, function (modifier) {
7557
- return function (character) {
7558
- var _replacementKeyMap;
7559
-
7560
- var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_4__platform__["a" /* isAppleOS */];
7561
-
7562
- var isApple = _isApple();
7563
-
7564
- var replacementKeyMap = (_replacementKeyMap = {}, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap, ALT, isApple ? '⌥' : 'Alt'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap, CTRL, isApple ? '⌃' : 'Ctrl'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap, COMMAND, '⌘'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap, SHIFT, isApple ? '⇧' : 'Shift'), _replacementKeyMap);
7565
- var modifierKeys = modifier(_isApple).reduce(function (accumulator, key) {
7566
- var replacementKey = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["get"])(replacementKeyMap, key, key); // If on the Mac, adhere to platform convention and don't show plus between keys.
7567
-
7568
- if (isApple) {
7569
- return [].concat(Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(accumulator), [replacementKey]);
7570
- }
7571
-
7572
- return [].concat(Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(accumulator), [replacementKey, '+']);
7573
- }, []);
7574
- var capitalizedCharacter = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["capitalize"])(character);
7575
- return [].concat(Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(modifierKeys), [capitalizedCharacter]);
7576
- };
7577
- });
7578
- /**
7579
- * An object that contains functions to display shortcuts.
7580
- * E.g. displayShortcut.primary( 'm' ) will return '⌘M' on Mac.
7581
- *
7582
- * @type {WPKeycodeHandlerByModifier} Keyed map of functions to display
7583
- * shortcuts.
7584
- */
7585
-
7586
- var displayShortcut = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(displayShortcutList, function (shortcutList) {
7587
- return function (character) {
7588
- var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_4__platform__["a" /* isAppleOS */];
7589
-
7590
- return shortcutList(character, _isApple).join('');
7591
- };
7592
- });
7593
- /**
7594
- * An object that contains functions to return an aria label for a keyboard shortcut.
7595
- * E.g. shortcutAriaLabel.primary( '.' ) will return 'Command + Period' on Mac.
7596
- *
7597
- * @type {WPKeycodeHandlerByModifier} Keyed map of functions to shortcut ARIA
7598
- * labels.
7599
- */
7600
-
7601
- var shortcutAriaLabel = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(modifiers, function (modifier) {
7602
- return function (character) {
7603
- var _replacementKeyMap2;
7604
-
7605
- var _isApple = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : __WEBPACK_IMPORTED_MODULE_4__platform__["a" /* isAppleOS */];
7606
-
7607
- var isApple = _isApple();
7608
-
7609
- var replacementKeyMap = (_replacementKeyMap2 = {}, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, SHIFT, 'Shift'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, COMMAND, isApple ? 'Command' : 'Control'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, CTRL, 'Control'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, ALT, isApple ? 'Option' : 'Alt'), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, ',', Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_i18n__["a" /* __ */])('Comma')), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, '.', Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_i18n__["a" /* __ */])('Period')), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_replacementKeyMap2, '`', Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_i18n__["a" /* __ */])('Backtick')), _replacementKeyMap2);
7610
- return [].concat(Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(modifier(_isApple)), [character]).map(function (key) {
7611
- return Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["capitalize"])(Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["get"])(replacementKeyMap, key, key));
7612
- }).join(isApple ? ' ' : ' + ');
7613
- };
7614
- });
7615
- /**
7616
- * From a given KeyboardEvent, returns an array of active modifier constants for
7617
- * the event.
7618
- *
7619
- * @param {KeyboardEvent} event Keyboard event.
7620
- *
7621
- * @return {Array<ALT|CTRL|COMMAND|SHIFT>} Active modifier constants.
7622
- */
7623
-
7624
- function getEventModifiers(event) {
7625
- return [ALT, CTRL, COMMAND, SHIFT].filter(function (key) {
7626
- return event["".concat(key, "Key")];
7627
- });
7628
- }
7629
- /**
7630
- * An object that contains functions to check if a keyboard event matches a
7631
- * predefined shortcut combination.
7632
- * E.g. isKeyboardEvent.primary( event, 'm' ) will return true if the event
7633
- * signals pressing ⌘M.
7634
- *
7635
- * @type {WPKeycodeHandlerByModifier} Keyed map of functions to match events.
7636
- */
7637
-
7638
-
7639
- var isKeyboardEvent = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(modifiers, function (getModifiers) {
7640
- return function (event, character) {
7641
- var _isApple = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : __WEBPACK_IMPORTED_MODULE_4__platform__["a" /* isAppleOS */];
7642
-
7643
- var mods = getModifiers(_isApple);
7644
- var eventMods = getEventModifiers(event);
7645
-
7646
- if (Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["xor"])(mods, eventMods).length) {
7647
- return false;
7648
- }
7649
-
7650
- if (!character) {
7651
- return Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["includes"])(mods, event.key.toLowerCase());
7652
- }
7653
-
7654
- return event.key === character;
7655
- };
7656
- });
7657
- //# sourceMappingURL=index.js.map
7658
-
7659
- /***/ }),
7660
- /* 33 */
7661
- /***/ (function(module, exports, __webpack_require__) {
7662
-
7663
- "use strict";
7664
-
7665
-
7666
- var implementation = __webpack_require__(639);
7667
-
7668
- module.exports = Function.prototype.bind || implementation;
7669
-
7670
-
7671
- /***/ }),
7672
- /* 34 */
7673
- /***/ (function(module, exports, __webpack_require__) {
7674
-
7675
- "use strict";
7676
- /* WEBPACK VAR INJECTION */(function(process) {
7677
-
7678
- Object.defineProperty(exports, "__esModule", {
7679
- value: true
7680
- });
7681
- exports.withStylesPropTypes = exports.css = undefined;
7682
-
7683
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
7684
-
7685
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
7686
-
7687
- exports.withStyles = withStyles;
7688
-
7689
- var _object = __webpack_require__(25);
7690
-
7691
- var _object2 = _interopRequireDefault(_object);
7692
-
7693
- var _react = __webpack_require__(9);
7694
-
7695
- var _react2 = _interopRequireDefault(_react);
7696
-
7697
- var _propTypes = __webpack_require__(11);
7698
-
7699
- var _propTypes2 = _interopRequireDefault(_propTypes);
7700
-
7701
- var _hoistNonReactStatics = __webpack_require__(743);
7702
-
7703
- var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
7704
-
7705
- var _constants = __webpack_require__(744);
7706
-
7707
- var _brcast = __webpack_require__(745);
7708
-
7709
- var _brcast2 = _interopRequireDefault(_brcast);
7710
-
7711
- var _ThemedStyleSheet = __webpack_require__(222);
7712
-
7713
- var _ThemedStyleSheet2 = _interopRequireDefault(_ThemedStyleSheet);
7714
-
7715
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
7716
-
7717
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7718
-
7719
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
7720
-
7721
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
7722
-
7723
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } /* eslint react/forbid-foreign-prop-types: off */
7724
-
7725
- // Add some named exports to assist in upgrading and for convenience
7726
- var css = exports.css = _ThemedStyleSheet2['default'].resolveLTR;
7727
- var withStylesPropTypes = exports.withStylesPropTypes = {
7728
- styles: _propTypes2['default'].object.isRequired, // eslint-disable-line react/forbid-prop-types
7729
- theme: _propTypes2['default'].object.isRequired, // eslint-disable-line react/forbid-prop-types
7730
- css: _propTypes2['default'].func.isRequired
7731
- };
7732
-
7733
- var EMPTY_STYLES = {};
7734
- var EMPTY_STYLES_FN = function EMPTY_STYLES_FN() {
7735
- return EMPTY_STYLES;
7736
- };
7737
-
7738
- var START_MARK = 'react-with-styles.createStyles.start';
7739
- var END_MARK = 'react-with-styles.createStyles.end';
7740
-
7741
- function baseClass(pureComponent) {
7742
- if (pureComponent) {
7743
- if (!_react2['default'].PureComponent) {
7744
- throw new ReferenceError('withStyles() pureComponent option requires React 15.3.0 or later');
7745
- }
7746
-
7747
- return _react2['default'].PureComponent;
7748
- }
7749
-
7750
- return _react2['default'].Component;
7751
- }
7752
-
7753
- var contextTypes = _defineProperty({}, _constants.CHANNEL, _brcast2['default']);
7754
-
7755
- var defaultDirection = _constants.DIRECTIONS.LTR;
7756
-
7757
- function withStyles(styleFn) {
7758
- var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
7759
- _ref$stylesPropName = _ref.stylesPropName,
7760
- stylesPropName = _ref$stylesPropName === undefined ? 'styles' : _ref$stylesPropName,
7761
- _ref$themePropName = _ref.themePropName,
7762
- themePropName = _ref$themePropName === undefined ? 'theme' : _ref$themePropName,
7763
- _ref$cssPropName = _ref.cssPropName,
7764
- cssPropName = _ref$cssPropName === undefined ? 'css' : _ref$cssPropName,
7765
- _ref$flushBefore = _ref.flushBefore,
7766
- flushBefore = _ref$flushBefore === undefined ? false : _ref$flushBefore,
7767
- _ref$pureComponent = _ref.pureComponent,
7768
- pureComponent = _ref$pureComponent === undefined ? false : _ref$pureComponent;
7769
-
7770
- var styleDefLTR = void 0;
7771
- var styleDefRTL = void 0;
7772
- var currentThemeLTR = void 0;
7773
- var currentThemeRTL = void 0;
7774
- var BaseClass = baseClass(pureComponent);
7775
-
7776
- function getResolveMethod(direction) {
7777
- return direction === _constants.DIRECTIONS.LTR ? _ThemedStyleSheet2['default'].resolveLTR : _ThemedStyleSheet2['default'].resolveRTL;
7778
- }
7779
-
7780
- function getCurrentTheme(direction) {
7781
- return direction === _constants.DIRECTIONS.LTR ? currentThemeLTR : currentThemeRTL;
7782
- }
7783
-
7784
- function getStyleDef(direction, wrappedComponentName) {
7785
- var currentTheme = getCurrentTheme(direction);
7786
- var styleDef = direction === _constants.DIRECTIONS.LTR ? styleDefLTR : styleDefRTL;
7787
-
7788
- var registeredTheme = _ThemedStyleSheet2['default'].get();
7789
-
7790
- // Return the existing styles if they've already been defined
7791
- // and if the theme used to create them corresponds to the theme
7792
- // registered with ThemedStyleSheet
7793
- if (styleDef && currentTheme === registeredTheme) {
7794
- return styleDef;
7795
- }
7796
-
7797
- if (process.env.NODE_ENV !== 'production' && typeof performance !== 'undefined' && performance.mark !== undefined && typeof performance.clearMarks === 'function') {
7798
- performance.clearMarks(START_MARK);
7799
- performance.mark(START_MARK);
7800
- }
7801
-
7802
- var isRTL = direction === _constants.DIRECTIONS.RTL;
7803
-
7804
- if (isRTL) {
7805
- styleDefRTL = styleFn ? _ThemedStyleSheet2['default'].createRTL(styleFn) : EMPTY_STYLES_FN;
7806
-
7807
- currentThemeRTL = registeredTheme;
7808
- styleDef = styleDefRTL;
7809
- } else {
7810
- styleDefLTR = styleFn ? _ThemedStyleSheet2['default'].createLTR(styleFn) : EMPTY_STYLES_FN;
7811
-
7812
- currentThemeLTR = registeredTheme;
7813
- styleDef = styleDefLTR;
7814
- }
7815
-
7816
- if (process.env.NODE_ENV !== 'production' && typeof performance !== 'undefined' && performance.mark !== undefined && typeof performance.clearMarks === 'function') {
7817
- performance.clearMarks(END_MARK);
7818
- performance.mark(END_MARK);
7819
-
7820
- var measureName = '\uD83D\uDC69\u200D\uD83C\uDFA8 withStyles(' + String(wrappedComponentName) + ') [create styles]';
7821
-
7822
- performance.measure(measureName, START_MARK, END_MARK);
7823
- performance.clearMarks(measureName);
7824
- }
7825
-
7826
- return styleDef;
7827
- }
7828
-
7829
- function getState(direction, wrappedComponentName) {
7830
- return {
7831
- resolveMethod: getResolveMethod(direction),
7832
- styleDef: getStyleDef(direction, wrappedComponentName)
7833
- };
7834
- }
7835
-
7836
- return function () {
7837
- function withStylesHOC(WrappedComponent) {
7838
- var wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
7839
-
7840
- // NOTE: Use a class here so components are ref-able if need be:
7841
- // eslint-disable-next-line react/prefer-stateless-function
7842
-
7843
- var WithStyles = function (_BaseClass) {
7844
- _inherits(WithStyles, _BaseClass);
7845
-
7846
- function WithStyles(props, context) {
7847
- _classCallCheck(this, WithStyles);
7848
-
7849
- var _this = _possibleConstructorReturn(this, (WithStyles.__proto__ || Object.getPrototypeOf(WithStyles)).call(this, props, context));
7850
-
7851
- var direction = _this.context[_constants.CHANNEL] ? _this.context[_constants.CHANNEL].getState() : defaultDirection;
7852
-
7853
- _this.state = getState(direction, wrappedComponentName);
7854
- return _this;
7855
- }
7856
-
7857
- _createClass(WithStyles, [{
7858
- key: 'componentDidMount',
7859
- value: function () {
7860
- function componentDidMount() {
7861
- var _this2 = this;
7862
-
7863
- if (this.context[_constants.CHANNEL]) {
7864
- // subscribe to future direction changes
7865
- this.channelUnsubscribe = this.context[_constants.CHANNEL].subscribe(function (direction) {
7866
- _this2.setState(getState(direction, wrappedComponentName));
7867
- });
7868
- }
7869
- }
7870
-
7871
- return componentDidMount;
7872
- }()
7873
- }, {
7874
- key: 'componentWillUnmount',
7875
- value: function () {
7876
- function componentWillUnmount() {
7877
- if (this.channelUnsubscribe) {
7878
- this.channelUnsubscribe();
7879
- }
7880
- }
7881
-
7882
- return componentWillUnmount;
7883
- }()
7884
- }, {
7885
- key: 'render',
7886
- value: function () {
7887
- function render() {
7888
- var _ref2;
7889
-
7890
- // As some components will depend on previous styles in
7891
- // the component tree, we provide the option of flushing the
7892
- // buffered styles (i.e. to a style tag) **before** the rendering
7893
- // cycle begins.
7894
- //
7895
- // The interfaces provide the optional "flush" method which
7896
- // is run in turn by ThemedStyleSheet.flush.
7897
- if (flushBefore) {
7898
- _ThemedStyleSheet2['default'].flush();
7899
- }
7900
-
7901
- var _state = this.state,
7902
- resolveMethod = _state.resolveMethod,
7903
- styleDef = _state.styleDef;
7904
-
7905
-
7906
- return _react2['default'].createElement(WrappedComponent, _extends({}, this.props, (_ref2 = {}, _defineProperty(_ref2, themePropName, _ThemedStyleSheet2['default'].get()), _defineProperty(_ref2, stylesPropName, styleDef()), _defineProperty(_ref2, cssPropName, resolveMethod), _ref2)));
7907
- }
7908
-
7909
- return render;
7910
- }()
7911
- }]);
7912
-
7913
- return WithStyles;
7914
- }(BaseClass);
7915
-
7916
- WithStyles.WrappedComponent = WrappedComponent;
7917
- WithStyles.displayName = 'withStyles(' + String(wrappedComponentName) + ')';
7918
- WithStyles.contextTypes = contextTypes;
7919
- if (WrappedComponent.propTypes) {
7920
- WithStyles.propTypes = (0, _object2['default'])({}, WrappedComponent.propTypes);
7921
- delete WithStyles.propTypes[stylesPropName];
7922
- delete WithStyles.propTypes[themePropName];
7923
- delete WithStyles.propTypes[cssPropName];
7924
- }
7925
- if (WrappedComponent.defaultProps) {
7926
- WithStyles.defaultProps = (0, _object2['default'])({}, WrappedComponent.defaultProps);
7927
- }
7928
-
7929
- return (0, _hoistNonReactStatics2['default'])(WithStyles, WrappedComponent);
7930
- }
7931
-
7932
- return withStylesHOC;
7933
- }();
7934
- }
7935
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))
7936
-
7937
- /***/ }),
7938
- /* 35 */
7939
- /***/ (function(module, exports, __webpack_require__) {
7940
-
7941
- "use strict";
7942
-
7943
-
7944
- var ES5Type = __webpack_require__(643);
7945
-
7946
- // https://ecma-international.org/ecma-262/6.0/#sec-ecmascript-data-types-and-values
7947
-
7948
- module.exports = function Type(x) {
7949
- if (typeof x === 'symbol') {
7950
- return 'Symbol';
7951
- }
7952
- return ES5Type(x);
7953
- };
7954
-
7955
-
7956
- /***/ }),
7957
- /* 36 */
7958
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
7959
-
7960
- "use strict";
7961
- /* unused harmony export Button */
7962
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__ = __webpack_require__(23);
7963
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
7964
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_classnames__ = __webpack_require__(14);
7965
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_classnames__);
7966
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__wordpress_element__ = __webpack_require__(1);
7967
-
7968
-
7969
-
7970
- /**
7971
- * External dependencies
7972
- */
7973
-
7974
- /**
7975
- * WordPress dependencies
7976
- */
7977
-
7978
-
7979
- function Button(props, ref) {
7980
- var href = props.href,
7981
- target = props.target,
7982
- isPrimary = props.isPrimary,
7983
- isLarge = props.isLarge,
7984
- isSmall = props.isSmall,
7985
- isTertiary = props.isTertiary,
7986
- isToggled = props.isToggled,
7987
- isBusy = props.isBusy,
7988
- isDefault = props.isDefault,
7989
- isLink = props.isLink,
7990
- isDestructive = props.isDestructive,
7991
- className = props.className,
7992
- disabled = props.disabled,
7993
- additionalProps = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(props, ["href", "target", "isPrimary", "isLarge", "isSmall", "isTertiary", "isToggled", "isBusy", "isDefault", "isLink", "isDestructive", "className", "disabled"]);
7994
-
7995
- var classes = __WEBPACK_IMPORTED_MODULE_2_classnames___default()('components-button', className, {
7996
- 'is-button': isDefault || isPrimary || isLarge || isSmall,
7997
- 'is-default': isDefault || isLarge || isSmall,
7998
- 'is-primary': isPrimary,
7999
- 'is-large': isLarge,
8000
- 'is-small': isSmall,
8001
- 'is-tertiary': isTertiary,
8002
- 'is-toggled': isToggled,
8003
- 'is-busy': isBusy,
8004
- 'is-link': isLink,
8005
- 'is-destructive': isDestructive
8006
- });
8007
- var tag = href !== undefined && !disabled ? 'a' : 'button';
8008
- var tagProps = tag === 'a' ? {
8009
- href: href,
8010
- target: target
8011
- } : {
8012
- type: 'button',
8013
- disabled: disabled
8014
- };
8015
- return Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_element__["h" /* createElement */])(tag, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__["a" /* default */])({}, tagProps, additionalProps, {
8016
- className: classes,
8017
- ref: ref
8018
- }));
8019
- }
8020
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_element__["k" /* forwardRef */])(Button));
8021
- //# sourceMappingURL=index.js.map
8022
-
8023
- /***/ }),
8024
- /* 37 */
8025
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
8026
-
8027
- "use strict";
8028
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__ = __webpack_require__(8);
8029
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
8030
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
8031
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
8032
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
8033
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
8034
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
8035
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__wordpress_element__ = __webpack_require__(1);
8036
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_classnames__ = __webpack_require__(14);
8037
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_classnames__);
8038
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_lodash__ = __webpack_require__(2);
8039
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_lodash__);
8040
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__tooltip__ = __webpack_require__(118);
8041
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__button__ = __webpack_require__(36);
8042
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__dashicon__ = __webpack_require__(55);
8043
-
8044
-
8045
-
8046
-
8047
-
8048
-
8049
-
8050
-
8051
-
8052
- /**
8053
- * External dependencies
8054
- */
8055
-
8056
-
8057
- /**
8058
- * WordPress dependencies
8059
- */
8060
-
8061
-
8062
- /**
8063
- * Internal dependencies
8064
- */
8065
-
8066
-
8067
-
8068
- // This is intentionally a Component class, not a function component because it
8069
- // is common to apply a ref to the button element (only supported in class)
8070
-
8071
- var IconButton =
8072
- /*#__PURE__*/
8073
- function (_Component) {
8074
- Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_inherits__["a" /* default */])(IconButton, _Component);
8075
-
8076
- function IconButton() {
8077
- Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, IconButton);
8078
-
8079
- return Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(IconButton).apply(this, arguments));
8080
- }
8081
-
8082
- Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_createClass__["a" /* default */])(IconButton, [{
8083
- key: "render",
8084
- value: function render() {
8085
- var _this$props = this.props,
8086
- icon = _this$props.icon,
8087
- children = _this$props.children,
8088
- label = _this$props.label,
8089
- className = _this$props.className,
8090
- tooltip = _this$props.tooltip,
8091
- shortcut = _this$props.shortcut,
8092
- additionalProps = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(_this$props, ["icon", "children", "label", "className", "tooltip", "shortcut"]);
8093
-
8094
- var classes = __WEBPACK_IMPORTED_MODULE_8_classnames___default()('components-icon-button', className);
8095
- var tooltipText = tooltip || label; // Should show the tooltip if...
8096
-
8097
- var showTooltip = !additionalProps.disabled && ( // an explicit tooltip is passed or...
8098
- tooltip || // there's a shortcut or...
8099
- shortcut || // there's a label and...
8100
- !!label && ( // the children are empty and...
8101
- !children || Object(__WEBPACK_IMPORTED_MODULE_9_lodash__["isArray"])(children) && !children.length) && // the tooltip is not explicitly disabled.
8102
- false !== tooltip);
8103
- var element = Object(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_11__button__["a" /* default */], Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])({
8104
- "aria-label": label
8105
- }, additionalProps, {
8106
- className: classes
8107
- }), Object(__WEBPACK_IMPORTED_MODULE_9_lodash__["isString"])(icon) ? Object(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_12__dashicon__["a" /* default */], {
8108
- icon: icon
8109
- }) : icon, children);
8110
-
8111
- if (showTooltip) {
8112
- element = Object(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_10__tooltip__["a" /* default */], {
8113
- text: tooltipText,
8114
- shortcut: shortcut
8115
- }, element);
8116
- }
8117
-
8118
- return element;
8119
- }
8120
- }]);
8121
-
8122
- return IconButton;
8123
- }(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["b" /* Component */]);
8124
-
8125
- /* harmony default export */ __webpack_exports__["a"] = (IconButton);
8126
- //# sourceMappingURL=index.js.map
8127
-
8128
- /***/ }),
8129
- /* 38 */
8130
- /***/ (function(module, exports, __webpack_require__) {
8131
-
8132
- "use strict";
8133
-
8134
-
8135
- var bind = __webpack_require__(33);
8136
-
8137
- module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
8138
-
8139
-
8140
- /***/ }),
8141
- /* 39 */
8142
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
8143
-
8144
- "use strict";
8145
- /* harmony export (immutable) */ __webpack_exports__["a"] = _typeof;
8146
- function _typeof(obj) {
8147
- "@babel/helpers - typeof";
8148
-
8149
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
8150
- _typeof = function _typeof(obj) {
8151
- return typeof obj;
8152
- };
8153
- } else {
8154
- _typeof = function _typeof(obj) {
8155
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
8156
- };
8157
- }
8158
-
8159
- return _typeof(obj);
8160
- }
8161
-
8162
- /***/ }),
8163
- /* 40 */
8164
- /***/ (function(module, exports, __webpack_require__) {
8165
-
8166
- var moment = __webpack_require__(0);
8167
- var momentValidationWrapper = __webpack_require__(689);
8168
- var core = __webpack_require__(690);
8169
-
8170
- module.exports = {
8171
-
8172
- momentObj : core.createMomentChecker(
8173
- 'object',
8174
- function(obj) {
8175
- return typeof obj === 'object';
8176
- },
8177
- function isValid(value) {
8178
- return momentValidationWrapper.isValidMoment(value);
8179
- },
8180
- 'Moment'
8181
- ),
8182
-
8183
- momentString : core.createMomentChecker(
8184
- 'string',
8185
- function(str) {
8186
- return typeof str === 'string';
8187
- },
8188
- function isValid(value) {
8189
- return momentValidationWrapper.isValidMoment(moment(value));
8190
- },
8191
- 'Moment'
8192
- ),
8193
-
8194
- momentDurationObj : core.createMomentChecker(
8195
- 'object',
8196
- function(obj) {
8197
- return typeof obj === 'object';
8198
- },
8199
- function isValid(value) {
8200
- return moment.isDuration(value);
8201
- },
8202
- 'Duration'
8203
- ),
8204
-
8205
- };
8206
-
8207
-
8208
- /***/ }),
8209
- /* 41 */
8210
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
8211
-
8212
- "use strict";
8213
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return select; });
8214
- /* unused harmony export __experimentalResolveSelect */
8215
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return dispatch; });
8216
- /* unused harmony export subscribe */
8217
- /* unused harmony export registerGenericStore */
8218
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return registerStore; });
8219
- /* unused harmony export use */
8220
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_turbo_combine_reducers__ = __webpack_require__(156);
8221
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_turbo_combine_reducers___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_turbo_combine_reducers__);
8222
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__default_registry__ = __webpack_require__(157);
8223
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__plugins__ = __webpack_require__(538);
8224
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__components_with_select__ = __webpack_require__(551);
8225
- /* unused harmony reexport withSelect */
8226
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__components_with_dispatch__ = __webpack_require__(576);
8227
- /* unused harmony reexport withDispatch */
8228
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__components_with_registry__ = __webpack_require__(579);
8229
- /* unused harmony reexport withRegistry */
8230
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__components_registry_provider__ = __webpack_require__(175);
8231
- /* unused harmony reexport RegistryProvider */
8232
- /* unused harmony reexport RegistryConsumer */
8233
- /* unused harmony reexport useRegistry */
8234
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__components_use_select__ = __webpack_require__(170);
8235
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_7__components_use_select__["a"]; });
8236
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__components_use_dispatch__ = __webpack_require__(174);
8237
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_8__components_use_dispatch__["a"]; });
8238
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__components_async_mode_provider__ = __webpack_require__(580);
8239
- /* unused harmony reexport AsyncModeProvider */
8240
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__registry__ = __webpack_require__(158);
8241
- /* unused harmony reexport createRegistry */
8242
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__factory__ = __webpack_require__(164);
8243
- /* unused harmony reexport createRegistrySelector */
8244
- /* unused harmony reexport createRegistryControl */
8245
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__controls__ = __webpack_require__(163);
8246
- /* unused harmony reexport controls */
8247
- /* unused harmony reexport plugins */
8248
- /* harmony reexport (default from non-hamory) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0_turbo_combine_reducers___default.a; });
8249
- /**
8250
- * External dependencies
8251
- */
8252
-
8253
- /**
8254
- * Internal dependencies
8255
- */
8256
-
8257
-
8258
-
8259
-
8260
-
8261
-
8262
-
8263
-
8264
-
8265
-
8266
-
8267
-
8268
-
8269
- /**
8270
- * Object of available plugins to use with a registry.
8271
- *
8272
- * @see [use](#use)
8273
- *
8274
- * @type {Object}
8275
- */
8276
-
8277
-
8278
- /**
8279
- * The combineReducers helper function turns an object whose values are different
8280
- * reducing functions into a single reducing function you can pass to registerReducer.
8281
- *
8282
- * @param {Object} reducers An object whose values correspond to different reducing
8283
- * functions that need to be combined into one.
8284
- *
8285
- * @example
8286
- * ```js
8287
- * const { combineReducers, registerStore } = wp.data;
8288
- *
8289
- * const prices = ( state = {}, action ) => {
8290
- * return action.type === 'SET_PRICE' ?
8291
- * {
8292
- * ...state,
8293
- * [ action.item ]: action.price,
8294
- * } :
8295
- * state;
8296
- * };
8297
- *
8298
- * const discountPercent = ( state = 0, action ) => {
8299
- * return action.type === 'START_SALE' ?
8300
- * action.discountPercent :
8301
- * state;
8302
- * };
8303
- *
8304
- * registerStore( 'my-shop', {
8305
- * reducer: combineReducers( {
8306
- * prices,
8307
- * discountPercent,
8308
- * } ),
8309
- * } );
8310
- * ```
8311
- *
8312
- * @return {Function} A reducer that invokes every reducer inside the reducers
8313
- * object, and constructs a state object with the same shape.
8314
- */
8315
-
8316
-
8317
- /**
8318
- * Given the name of a registered store, returns an object of the store's selectors.
8319
- * The selector functions are been pre-bound to pass the current state automatically.
8320
- * As a consumer, you need only pass arguments of the selector, if applicable.
8321
- *
8322
- * @param {string} name Store name.
8323
- *
8324
- * @example
8325
- * ```js
8326
- * const { select } = wp.data;
8327
- *
8328
- * select( 'my-shop' ).getPrice( 'hammer' );
8329
- * ```
8330
- *
8331
- * @return {Object} Object containing the store's selectors.
8332
- */
8333
-
8334
- var select = __WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */].select;
8335
- /**
8336
- * Given the name of a registered store, returns an object containing the store's
8337
- * selectors pre-bound to state so that you only need to supply additional arguments,
8338
- * and modified so that they return promises that resolve to their eventual values,
8339
- * after any resolvers have ran.
8340
- *
8341
- * @param {string} name Store name.
8342
- *
8343
- * @example
8344
- * ```js
8345
- * const { __experimentalResolveSelect } = wp.data;
8346
- *
8347
- * __experimentalResolveSelect( 'my-shop' ).getPrice( 'hammer' ).then(console.log)
8348
- * ```
8349
- *
8350
- * @return {Object} Object containing the store's promise-wrapped selectors.
8351
- */
8352
-
8353
- var __experimentalResolveSelect = __WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */].__experimentalResolveSelect;
8354
- /**
8355
- * Given the name of a registered store, returns an object of the store's action creators.
8356
- * Calling an action creator will cause it to be dispatched, updating the state value accordingly.
8357
- *
8358
- * Note: Action creators returned by the dispatch will return a promise when
8359
- * they are called.
8360
- *
8361
- * @param {string} name Store name.
8362
- *
8363
- * @example
8364
- * ```js
8365
- * const { dispatch } = wp.data;
8366
- *
8367
- * dispatch( 'my-shop' ).setPrice( 'hammer', 9.75 );
8368
- * ```
8369
- * @return {Object} Object containing the action creators.
8370
- */
8371
-
8372
- var dispatch = __WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */].dispatch;
8373
- /**
8374
- * Given a listener function, the function will be called any time the state value
8375
- * of one of the registered stores has changed. This function returns a `unsubscribe`
8376
- * function used to stop the subscription.
8377
- *
8378
- * @param {Function} listener Callback function.
8379
- *
8380
- * @example
8381
- * ```js
8382
- * const { subscribe } = wp.data;
8383
- *
8384
- * const unsubscribe = subscribe( () => {
8385
- * // You could use this opportunity to test whether the derived result of a
8386
- * // selector has subsequently changed as the result of a state update.
8387
- * } );
8388
- *
8389
- * // Later, if necessary...
8390
- * unsubscribe();
8391
- * ```
8392
- */
8393
-
8394
- var subscribe = __WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */].subscribe;
8395
- /**
8396
- * Registers a generic store.
8397
- *
8398
- * @param {string} key Store registry key.
8399
- * @param {Object} config Configuration (getSelectors, getActions, subscribe).
8400
- */
8401
-
8402
- var registerGenericStore = __WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */].registerGenericStore;
8403
- /**
8404
- * Registers a standard `@wordpress/data` store.
8405
- *
8406
- * @param {string} reducerKey Reducer key.
8407
- * @param {Object} options Store description (reducer, actions, selectors, resolvers).
8408
- *
8409
- * @return {Object} Registered store object.
8410
- */
8411
-
8412
- var registerStore = __WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */].registerStore;
8413
- /**
8414
- * Extends a registry to inherit functionality provided by a given plugin. A
8415
- * plugin is an object with properties aligning to that of a registry, merged
8416
- * to extend the default registry behavior.
8417
- *
8418
- * @param {Object} plugin Plugin object.
8419
- */
8420
-
8421
- var use = __WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */].use;
8422
- //# sourceMappingURL=index.js.map
8423
-
8424
- /***/ }),
8425
- /* 42 */
8426
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
8427
-
8428
- "use strict";
8429
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(1);
8430
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_classnames__ = __webpack_require__(14);
8431
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_classnames__);
8432
-
8433
-
8434
- /**
8435
- * External dependencies
8436
- */
8437
-
8438
-
8439
- function BaseControl(_ref) {
8440
- var id = _ref.id,
8441
- label = _ref.label,
8442
- help = _ref.help,
8443
- className = _ref.className,
8444
- children = _ref.children;
8445
- return Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["h" /* createElement */])("div", {
8446
- className: __WEBPACK_IMPORTED_MODULE_1_classnames___default()('components-base-control', className)
8447
- }, Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["h" /* createElement */])("div", {
8448
- className: "components-base-control__field"
8449
- }, label && id && Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["h" /* createElement */])("label", {
8450
- className: "components-base-control__label",
8451
- htmlFor: id
8452
- }, label), label && !id && Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["h" /* createElement */])("span", {
8453
- className: "components-base-control__label"
8454
- }, label), children), !!help && Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["h" /* createElement */])("p", {
8455
- id: id + '__help',
8456
- className: "components-base-control__help"
8457
- }, help));
8458
- }
8459
-
8460
- /* harmony default export */ __webpack_exports__["a"] = (BaseControl);
8461
- //# sourceMappingURL=index.js.map
8462
-
8463
- /***/ }),
8464
- /* 43 */
8465
- /***/ (function(module, exports, __webpack_require__) {
8466
-
8467
- "use strict";
8468
- /* WEBPACK VAR INJECTION */(function(global) {
8469
-
8470
- var origSymbol = global.Symbol;
8471
- var hasSymbolSham = __webpack_require__(205);
8472
-
8473
- module.exports = function hasNativeSymbols() {
8474
- if (typeof origSymbol !== 'function') { return false; }
8475
- if (typeof Symbol !== 'function') { return false; }
8476
- if (typeof origSymbol('foo') !== 'symbol') { return false; }
8477
- if (typeof Symbol('bar') !== 'symbol') { return false; }
8478
-
8479
- return hasSymbolSham();
8480
- };
8481
-
8482
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(81)))
8483
-
8484
- /***/ }),
8485
- /* 44 */
8486
- /***/ (function(module, exports, __webpack_require__) {
8487
-
8488
- "use strict";
8489
-
8490
-
8491
- /* globals
8492
- Atomics,
8493
- SharedArrayBuffer,
8494
- */
8495
-
8496
- var undefined;
8497
-
8498
- var $TypeError = TypeError;
8499
-
8500
- var $gOPD = Object.getOwnPropertyDescriptor;
8501
- if ($gOPD) {
8502
- try {
8503
- $gOPD({}, '');
8504
- } catch (e) {
8505
- $gOPD = null; // this is IE 8, which has a broken gOPD
8506
- }
8507
- }
8508
-
8509
- var throwTypeError = function () { throw new $TypeError(); };
8510
- var ThrowTypeError = $gOPD
8511
- ? (function () {
8512
- try {
8513
- // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
8514
- arguments.callee; // IE 8 does not throw here
8515
- return throwTypeError;
8516
- } catch (calleeThrows) {
8517
- try {
8518
- // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
8519
- return $gOPD(arguments, 'callee').get;
8520
- } catch (gOPDthrows) {
8521
- return throwTypeError;
8522
- }
8523
- }
8524
- }())
8525
- : throwTypeError;
8526
-
8527
- var hasSymbols = __webpack_require__(43)();
8528
-
8529
- var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
8530
-
8531
- var generator; // = function * () {};
8532
- var generatorFunction = generator ? getProto(generator) : undefined;
8533
- var asyncFn; // async function() {};
8534
- var asyncFunction = asyncFn ? asyncFn.constructor : undefined;
8535
- var asyncGen; // async function * () {};
8536
- var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined;
8537
- var asyncGenIterator = asyncGen ? asyncGen() : undefined;
8538
-
8539
- var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
8540
-
8541
- var INTRINSICS = {
8542
- '%Array%': Array,
8543
- '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
8544
- '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype,
8545
- '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
8546
- '%ArrayPrototype%': Array.prototype,
8547
- '%ArrayProto_entries%': Array.prototype.entries,
8548
- '%ArrayProto_forEach%': Array.prototype.forEach,
8549
- '%ArrayProto_keys%': Array.prototype.keys,
8550
- '%ArrayProto_values%': Array.prototype.values,
8551
- '%AsyncFromSyncIteratorPrototype%': undefined,
8552
- '%AsyncFunction%': asyncFunction,
8553
- '%AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined,
8554
- '%AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined,
8555
- '%AsyncGeneratorFunction%': asyncGenFunction,
8556
- '%AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined,
8557
- '%AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined,
8558
- '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
8559
- '%Boolean%': Boolean,
8560
- '%BooleanPrototype%': Boolean.prototype,
8561
- '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
8562
- '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype,
8563
- '%Date%': Date,
8564
- '%DatePrototype%': Date.prototype,
8565
- '%decodeURI%': decodeURI,
8566
- '%decodeURIComponent%': decodeURIComponent,
8567
- '%encodeURI%': encodeURI,
8568
- '%encodeURIComponent%': encodeURIComponent,
8569
- '%Error%': Error,
8570
- '%ErrorPrototype%': Error.prototype,
8571
- '%eval%': eval, // eslint-disable-line no-eval
8572
- '%EvalError%': EvalError,
8573
- '%EvalErrorPrototype%': EvalError.prototype,
8574
- '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
8575
- '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype,
8576
- '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
8577
- '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype,
8578
- '%Function%': Function,
8579
- '%FunctionPrototype%': Function.prototype,
8580
- '%Generator%': generator ? getProto(generator()) : undefined,
8581
- '%GeneratorFunction%': generatorFunction,
8582
- '%GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined,
8583
- '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
8584
- '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype,
8585
- '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
8586
- '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype,
8587
- '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
8588
- '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype,
8589
- '%isFinite%': isFinite,
8590
- '%isNaN%': isNaN,
8591
- '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
8592
- '%JSON%': typeof JSON === 'object' ? JSON : undefined,
8593
- '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined,
8594
- '%Map%': typeof Map === 'undefined' ? undefined : Map,
8595
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
8596
- '%MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype,
8597
- '%Math%': Math,
8598
- '%Number%': Number,
8599
- '%NumberPrototype%': Number.prototype,
8600
- '%Object%': Object,
8601
- '%ObjectPrototype%': Object.prototype,
8602
- '%ObjProto_toString%': Object.prototype.toString,
8603
- '%ObjProto_valueOf%': Object.prototype.valueOf,
8604
- '%parseFloat%': parseFloat,
8605
- '%parseInt%': parseInt,
8606
- '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
8607
- '%PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype,
8608
- '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then,
8609
- '%Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all,
8610
- '%Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject,
8611
- '%Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve,
8612
- '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
8613
- '%RangeError%': RangeError,
8614
- '%RangeErrorPrototype%': RangeError.prototype,
8615
- '%ReferenceError%': ReferenceError,
8616
- '%ReferenceErrorPrototype%': ReferenceError.prototype,
8617
- '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
8618
- '%RegExp%': RegExp,
8619
- '%RegExpPrototype%': RegExp.prototype,
8620
- '%Set%': typeof Set === 'undefined' ? undefined : Set,
8621
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
8622
- '%SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype,
8623
- '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
8624
- '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype,
8625
- '%String%': String,
8626
- '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
8627
- '%StringPrototype%': String.prototype,
8628
- '%Symbol%': hasSymbols ? Symbol : undefined,
8629
- '%SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined,
8630
- '%SyntaxError%': SyntaxError,
8631
- '%SyntaxErrorPrototype%': SyntaxError.prototype,
8632
- '%ThrowTypeError%': ThrowTypeError,
8633
- '%TypedArray%': TypedArray,
8634
- '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined,
8635
- '%TypeError%': $TypeError,
8636
- '%TypeErrorPrototype%': $TypeError.prototype,
8637
- '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
8638
- '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype,
8639
- '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
8640
- '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype,
8641
- '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
8642
- '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype,
8643
- '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
8644
- '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype,
8645
- '%URIError%': URIError,
8646
- '%URIErrorPrototype%': URIError.prototype,
8647
- '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
8648
- '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype,
8649
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
8650
- '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype
8651
- };
8652
-
8653
- var bind = __webpack_require__(33);
8654
- var $replace = bind.call(Function.call, String.prototype.replace);
8655
-
8656
- /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
8657
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
8658
- var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
8659
- var stringToPath = function stringToPath(string) {
8660
- var result = [];
8661
- $replace(string, rePropName, function (match, number, quote, subString) {
8662
- result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match);
8663
- });
8664
- return result;
8665
- };
8666
- /* end adaptation */
8667
-
8668
- var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
8669
- if (!(name in INTRINSICS)) {
8670
- throw new SyntaxError('intrinsic ' + name + ' does not exist!');
8671
- }
8672
-
8673
- // istanbul ignore if // hopefully this is impossible to test :-)
8674
- if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) {
8675
- throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
8676
- }
8677
-
8678
- return INTRINSICS[name];
8679
- };
8680
-
8681
- module.exports = function GetIntrinsic(name, allowMissing) {
8682
- if (typeof name !== 'string' || name.length === 0) {
8683
- throw new TypeError('intrinsic name must be a non-empty string');
8684
- }
8685
- if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
8686
- throw new TypeError('"allowMissing" argument must be a boolean');
8687
- }
8688
-
8689
- var parts = stringToPath(name);
8690
-
8691
- var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing);
8692
- for (var i = 1; i < parts.length; i += 1) {
8693
- if (value != null) {
8694
- if ($gOPD && (i + 1) >= parts.length) {
8695
- var desc = $gOPD(value, parts[i]);
8696
- if (!allowMissing && !(parts[i] in value)) {
8697
- throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
8698
- }
8699
- // By convention, when a data property is converted to an accessor
8700
- // property to emulate a data property that does not suffer from
8701
- // the override mistake, that accessor's getter is marked with
8702
- // an `originalValue` property. Here, when we detect this, we
8703
- // uphold the illusion by pretending to see that original data
8704
- // property, i.e., returning the value rather than the getter
8705
- // itself.
8706
- value = desc && 'get' in desc && !('originalValue' in desc.get) ? desc.get : value[parts[i]];
8707
- } else {
8708
- value = value[parts[i]];
8709
- }
8710
- }
8711
- }
8712
- return value;
8713
- };
8714
-
8715
-
8716
- /***/ }),
8717
- /* 45 */
8718
- /***/ (function(module, exports, __webpack_require__) {
8719
-
8720
- "use strict";
8721
- /* WEBPACK VAR INJECTION */(function(process) {
8722
-
8723
- function checkDCE() {
8724
- /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
8725
- if (
8726
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||
8727
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'
8728
- ) {
8729
- return;
8730
- }
8731
- if (process.env.NODE_ENV !== 'production') {
8732
- // This branch is unreachable because this function is only called
8733
- // in production, but the condition is true only in development.
8734
- // Therefore if the branch is still here, dead code elimination wasn't
8735
- // properly applied.
8736
- // Don't change the message. React DevTools relies on it. Also make sure
8737
- // this message doesn't occur elsewhere in this function, or it will cause
8738
- // a false positive.
8739
- throw new Error('^_^');
8740
- }
8741
- try {
8742
- // Verify that the code above has been dead code eliminated (DCE'd).
8743
- __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
8744
- } catch (err) {
8745
- // DevTools shouldn't crash React, no matter what.
8746
- // We should still report in case we break this code.
8747
- console.error(err);
8748
- }
8749
- }
8750
-
8751
- if (process.env.NODE_ENV === 'production') {
8752
- // DCE check should happen before ReactDOM bundle executes so that
8753
- // DevTools can report bad minification during injection.
8754
- checkDCE();
8755
- module.exports = __webpack_require__(457);
8756
- } else {
8757
- module.exports = __webpack_require__(460);
8758
- }
8759
-
8760
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))
8761
-
8762
- /***/ }),
8763
- /* 46 */
8764
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
8765
-
8766
- "use strict";
8767
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(2);
8768
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);
8769
- /**
8770
- * External dependencies
8771
- */
8772
-
8773
- /**
8774
- * Given a function mapping a component to an enhanced component and modifier
8775
- * name, returns the enhanced component augmented with a generated displayName.
8776
- *
8777
- * @param {Function} mapComponentToEnhancedComponent Function mapping component
8778
- * to enhanced component.
8779
- * @param {string} modifierName Seed name from which to
8780
- * generated display name.
8781
- *
8782
- * @return {WPComponent} Component class with generated display name assigned.
8783
- */
8784
-
8785
- function createHigherOrderComponent(mapComponentToEnhancedComponent, modifierName) {
8786
- return function (OriginalComponent) {
8787
- var EnhancedComponent = mapComponentToEnhancedComponent(OriginalComponent);
8788
- var _OriginalComponent$di = OriginalComponent.displayName,
8789
- displayName = _OriginalComponent$di === void 0 ? OriginalComponent.name || 'Component' : _OriginalComponent$di;
8790
- EnhancedComponent.displayName = "".concat(Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["upperFirst"])(Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["camelCase"])(modifierName)), "(").concat(displayName, ")");
8791
- return EnhancedComponent;
8792
- };
8793
- }
8794
-
8795
- /* harmony default export */ __webpack_exports__["a"] = (createHigherOrderComponent);
8796
- //# sourceMappingURL=index.js.map
8797
-
8798
- /***/ }),
8799
- /* 47 */
8800
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
8801
-
8802
- "use strict";
8803
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(2);
8804
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);
8805
- /**
8806
- * External dependencies
8807
- */
8808
-
8809
- /**
8810
- * Given a function mapping a component to an enhanced component and modifier
8811
- * name, returns the enhanced component augmented with a generated displayName.
8812
- *
8813
- * @param {Function} mapComponentToEnhancedComponent Function mapping component
8814
- * to enhanced component.
8815
- * @param {string} modifierName Seed name from which to
8816
- * generated display name.
8817
- *
8818
- * @return {WPComponent} Component class with generated display name assigned.
8819
- */
8820
-
8821
- function createHigherOrderComponent(mapComponentToEnhancedComponent, modifierName) {
8822
- return function (OriginalComponent) {
8823
- var EnhancedComponent = mapComponentToEnhancedComponent(OriginalComponent);
8824
- var _OriginalComponent$di = OriginalComponent.displayName,
8825
- displayName = _OriginalComponent$di === void 0 ? OriginalComponent.name || 'Component' : _OriginalComponent$di;
8826
- EnhancedComponent.displayName = "".concat(Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["upperFirst"])(Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["camelCase"])(modifierName)), "(").concat(displayName, ")");
8827
- return EnhancedComponent;
8828
- };
8829
- }
8830
-
8831
- /* harmony default export */ __webpack_exports__["a"] = (createHigherOrderComponent);
8832
- //# sourceMappingURL=index.js.map
8833
-
8834
- /***/ }),
8835
- /* 48 */
8836
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
8837
-
8838
- "use strict";
8839
- /* harmony export (immutable) */ __webpack_exports__["a"] = getLineIndex;
8840
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__special_characters__ = __webpack_require__(30);
8841
- /**
8842
- * Internal dependencies
8843
- */
8844
-
8845
- /** @typedef {import('./create').RichTextValue} RichTextValue */
8846
-
8847
- /**
8848
- * Gets the currently selected line index, or the first line index if the
8849
- * selection spans over multiple items.
8850
- *
8851
- * @param {RichTextValue} value Value to get the line index from.
8852
- * @param {boolean} startIndex Optional index that should be contained by
8853
- * the line. Defaults to the selection start
8854
- * of the value.
8855
- *
8856
- * @return {number|void} The line index. Undefined if not found.
8857
- */
8858
-
8859
- function getLineIndex(_ref) {
8860
- var start = _ref.start,
8861
- text = _ref.text;
8862
- var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : start;
8863
- var index = startIndex;
8864
-
8865
- while (index--) {
8866
- if (text[index] === __WEBPACK_IMPORTED_MODULE_0__special_characters__["a" /* LINE_SEPARATOR */]) {
8867
- return index;
8868
- }
8869
- }
8870
- }
8871
- //# sourceMappingURL=get-line-index.js.map
8872
-
8873
- /***/ }),
8874
- /* 49 */
8875
- /***/ (function(module, exports, __webpack_require__) {
8876
-
8877
- "use strict";
8878
-
8879
-
8880
- Object.defineProperty(exports, "__esModule", {
8881
- value: true
8882
- });
8883
- exports["default"] = andValidator;
8884
-
8885
- var _wrapValidator = _interopRequireDefault(__webpack_require__(16));
8886
-
8887
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
8888
-
8889
- function andValidator(validators) {
8890
- var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'and';
8891
-
8892
- if (!Array.isArray(validators)) {
8893
- throw new TypeError('and: 2 or more validators are required');
8894
- }
8895
-
8896
- if (validators.length <= 1) {
8897
- throw new RangeError('and: 2 or more validators are required');
8898
- }
8899
-
8900
- var validator = function and() {
8901
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
8902
- args[_key] = arguments[_key];
8903
- }
8904
-
8905
- var firstError = null;
8906
- validators.some(function (validatorFn) {
8907
- firstError = validatorFn.apply(void 0, args);
8908
- return firstError != null;
8909
- });
8910
- return firstError == null ? null : firstError;
8911
- };
8912
-
8913
- validator.isRequired = function andIsRequired() {
8914
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
8915
- args[_key2] = arguments[_key2];
8916
- }
8917
-
8918
- var firstError = null;
8919
- validators.some(function (validatorFn) {
8920
- firstError = validatorFn.isRequired.apply(validatorFn, args);
8921
- return firstError != null;
8922
- });
8923
- return firstError == null ? null : firstError;
8924
- };
8925
-
8926
- return (0, _wrapValidator["default"])(validator, name, validators);
8927
- }
8928
- //# sourceMappingURL=and.js.map
8929
-
8930
- /***/ }),
8931
- /* 50 */
8932
- /***/ (function(module, exports, __webpack_require__) {
8933
-
8934
- "use strict";
8935
-
8936
-
8937
- Object.defineProperty(exports, "__esModule", {
8938
- value: true
8939
- });
8940
-
8941
- var _propTypes = __webpack_require__(11);
8942
-
8943
- var _propTypes2 = _interopRequireDefault(_propTypes);
8944
-
8945
- var _constants = __webpack_require__(17);
8946
-
8947
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
8948
-
8949
- exports['default'] = _propTypes2['default'].oneOf(_constants.WEEKDAYS);
8950
-
8951
- /***/ }),
8952
- /* 51 */
8953
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
8954
-
8955
- "use strict";
8956
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__primitives__ = __webpack_require__(78);
8957
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_0__primitives__["c"]; });
8958
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__autocomplete__ = __webpack_require__(468);
8959
- /* unused harmony reexport Autocomplete */
8960
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__base_control__ = __webpack_require__(42);
8961
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_2__base_control__["a"]; });
8962
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__button__ = __webpack_require__(36);
8963
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_3__button__["a"]; });
8964
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__button_group__ = __webpack_require__(621);
8965
- /* unused harmony reexport ButtonGroup */
8966
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__checkbox_control__ = __webpack_require__(622);
8967
- /* unused harmony reexport CheckboxControl */
8968
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__clipboard_button__ = __webpack_require__(623);
8969
- /* unused harmony reexport ClipboardButton */
8970
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__color_indicator__ = __webpack_require__(624);
8971
- /* unused harmony reexport ColorIndicator */
8972
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__color_palette__ = __webpack_require__(625);
8973
- /* unused harmony reexport ColorPalette */
8974
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__color_picker__ = __webpack_require__(201);
8975
- /* unused harmony reexport ColorPicker */
8976
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__dashicon__ = __webpack_require__(55);
8977
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_10__dashicon__["a"]; });
8978
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__date_time__ = __webpack_require__(631);
8979
- /* unused harmony reexport DateTimePicker */
8980
- /* unused harmony reexport DatePicker */
8981
- /* unused harmony reexport TimePicker */
8982
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__disabled__ = __webpack_require__(787);
8983
- /* unused harmony reexport Disabled */
8984
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__draggable__ = __webpack_require__(788);
8985
- /* unused harmony reexport Draggable */
8986
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__drop_zone__ = __webpack_require__(789);
8987
- /* unused harmony reexport DropZone */
8988
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__drop_zone_provider__ = __webpack_require__(424);
8989
- /* unused harmony reexport DropZoneProvider */
8990
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__dropdown__ = __webpack_require__(85);
8991
- /* unused harmony reexport Dropdown */
8992
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__dropdown_menu__ = __webpack_require__(425);
8993
- /* unused harmony reexport DropdownMenu */
8994
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__external_link__ = __webpack_require__(792);
8995
- /* unused harmony reexport ExternalLink */
8996
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__focusable_iframe__ = __webpack_require__(427);
8997
- /* unused harmony reexport FocusableIframe */
8998
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__font_size_picker__ = __webpack_require__(793);
8999
- /* unused harmony reexport FontSizePicker */
9000
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__form_file_upload__ = __webpack_require__(794);
9001
- /* unused harmony reexport FormFileUpload */
9002
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__form_toggle__ = __webpack_require__(429);
9003
- /* unused harmony reexport FormToggle */
9004
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__form_token_field__ = __webpack_require__(795);
9005
- /* unused harmony reexport FormTokenField */
9006
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__icon__ = __webpack_require__(430);
9007
- /* unused harmony reexport Icon */
9008
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__icon_button__ = __webpack_require__(37);
9009
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_25__icon_button__["a"]; });
9010
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__keyboard_shortcuts__ = __webpack_require__(68);
9011
- /* unused harmony reexport KeyboardShortcuts */
9012
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__menu_group__ = __webpack_require__(802);
9013
- /* unused harmony reexport MenuGroup */
9014
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__menu_item__ = __webpack_require__(431);
9015
- /* unused harmony reexport MenuItem */
9016
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__menu_items_choice__ = __webpack_require__(803);
9017
- /* unused harmony reexport MenuItemsChoice */
9018
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__modal__ = __webpack_require__(804);
9019
- /* unused harmony reexport Modal */
9020
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__scroll_lock__ = __webpack_require__(197);
9021
- /* unused harmony reexport ScrollLock */
9022
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__navigable_container__ = __webpack_require__(76);
9023
- /* unused harmony reexport NavigableMenu */
9024
- /* unused harmony reexport TabbableContainer */
9025
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__notice__ = __webpack_require__(432);
9026
- /* unused harmony reexport Notice */
9027
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__notice_list__ = __webpack_require__(433);
9028
- /* unused harmony reexport NoticeList */
9029
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__panel__ = __webpack_require__(808);
9030
- /* unused harmony reexport Panel */
9031
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__panel_body__ = __webpack_require__(809);
9032
- /* unused harmony reexport PanelBody */
9033
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__panel_header__ = __webpack_require__(434);
9034
- /* unused harmony reexport PanelHeader */
9035
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__panel_row__ = __webpack_require__(810);
9036
- /* unused harmony reexport PanelRow */
9037
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__placeholder__ = __webpack_require__(435);
9038
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_39__placeholder__["a"]; });
9039
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__popover__ = __webpack_require__(84);
9040
- /* unused harmony reexport Popover */
9041
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__query_controls__ = __webpack_require__(811);
9042
- /* unused harmony reexport QueryControls */
9043
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__radio_control__ = __webpack_require__(814);
9044
- /* unused harmony reexport RadioControl */
9045
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__range_control__ = __webpack_require__(428);
9046
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_43__range_control__["a"]; });
9047
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__resizable_box__ = __webpack_require__(815);
9048
- /* unused harmony reexport ResizableBox */
9049
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__responsive_wrapper__ = __webpack_require__(817);
9050
- /* unused harmony reexport ResponsiveWrapper */
9051
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__sandbox__ = __webpack_require__(818);
9052
- /* unused harmony reexport SandBox */
9053
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__select_control__ = __webpack_require__(819);
9054
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_47__select_control__["a"]; });
9055
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__spinner__ = __webpack_require__(437);
9056
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_48__spinner__["a"]; });
9057
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__server_side_render__ = __webpack_require__(820);
9058
- /* unused harmony reexport ServerSideRender */
9059
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__tab_panel__ = __webpack_require__(853);
9060
- /* unused harmony reexport TabPanel */
9061
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__text_control__ = __webpack_require__(202);
9062
- /* unused harmony reexport TextControl */
9063
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__textarea_control__ = __webpack_require__(854);
9064
- /* unused harmony reexport TextareaControl */
9065
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__toggle_control__ = __webpack_require__(855);
9066
- /* unused harmony reexport ToggleControl */
9067
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__toolbar__ = __webpack_require__(856);
9068
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_54__toolbar__["a"]; });
9069
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__toolbar_button__ = __webpack_require__(443);
9070
- /* unused harmony reexport ToolbarButton */
9071
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__tooltip__ = __webpack_require__(118);
9072
- /* unused harmony reexport Tooltip */
9073
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__tree_select__ = __webpack_require__(436);
9074
- /* unused harmony reexport TreeSelect */
9075
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__isolated_event_container__ = __webpack_require__(119);
9076
- /* unused harmony reexport IsolatedEventContainer */
9077
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__slot_fill__ = __webpack_require__(198);
9078
- /* unused harmony reexport createSlotFill */
9079
- /* unused harmony reexport Slot */
9080
- /* unused harmony reexport Fill */
9081
- /* unused harmony reexport SlotFillProvider */
9082
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__higher_order_navigate_regions__ = __webpack_require__(859);
9083
- /* unused harmony reexport navigateRegions */
9084
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__higher_order_with_constrained_tabbing__ = __webpack_require__(117);
9085
- /* unused harmony reexport withConstrainedTabbing */
9086
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__higher_order_with_fallback_styles__ = __webpack_require__(860);
9087
- /* unused harmony reexport withFallbackStyles */
9088
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__higher_order_with_filters__ = __webpack_require__(861);
9089
- /* unused harmony reexport withFilters */
9090
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__higher_order_with_focus_outside__ = __webpack_require__(193);
9091
- /* unused harmony reexport withFocusOutside */
9092
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__higher_order_with_focus_return__ = __webpack_require__(116);
9093
- /* unused harmony reexport withFocusReturn */
9094
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__higher_order_with_notices__ = __webpack_require__(862);
9095
- /* unused harmony reexport withNotices */
9096
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__higher_order_with_spoken_messages__ = __webpack_require__(121);
9097
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_67__higher_order_with_spoken_messages__["a"]; });
9098
- // Components
9099
- // eslint-disable-next-line camelcase
9100
-
9101
-
9102
-
9103
-
9104
-
9105
-
9106
-
9107
-
9108
-
9109
-
9110
-
9111
-
9112
-
9113
-
9114
-
9115
-
9116
-
9117
-
9118
-
9119
-
9120
-
9121
-
9122
-
9123
-
9124
-
9125
-
9126
-
9127
-
9128
-
9129
-
9130
-
9131
-
9132
-
9133
-
9134
-
9135
-
9136
-
9137
-
9138
-
9139
-
9140
-
9141
-
9142
-
9143
-
9144
-
9145
-
9146
-
9147
-
9148
-
9149
-
9150
-
9151
-
9152
-
9153
-
9154
-
9155
-
9156
-
9157
-
9158
-
9159
- // Higher-Order Components
9160
-
9161
-
9162
-
9163
-
9164
-
9165
-
9166
-
9167
-
9168
-
9169
- //# sourceMappingURL=index.js.map
9170
-
9171
- /***/ }),
9172
- /* 52 */
9173
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
9174
-
9175
- "use strict";
9176
- /* harmony export (immutable) */ __webpack_exports__["a"] = normaliseFormats;
9177
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(13);
9178
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_format_equal__ = __webpack_require__(109);
9179
-
9180
-
9181
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
9182
-
9183
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
9184
-
9185
- /**
9186
- * Internal dependencies
9187
- */
9188
-
9189
- /** @typedef {import('./create').RichTextValue} RichTextValue */
9190
-
9191
- /**
9192
- * Normalises formats: ensures subsequent adjacent equal formats have the same
9193
- * reference.
9194
- *
9195
- * @param {RichTextValue} value Value to normalise formats of.
9196
- *
9197
- * @return {RichTextValue} New value with normalised formats.
9198
- */
9199
-
9200
- function normaliseFormats(value) {
9201
- var newFormats = value.formats.slice();
9202
- newFormats.forEach(function (formatsAtIndex, index) {
9203
- var formatsAtPreviousIndex = newFormats[index - 1];
9204
-
9205
- if (formatsAtPreviousIndex) {
9206
- var newFormatsAtIndex = formatsAtIndex.slice();
9207
- newFormatsAtIndex.forEach(function (format, formatIndex) {
9208
- var previousFormat = formatsAtPreviousIndex[formatIndex];
9209
-
9210
- if (Object(__WEBPACK_IMPORTED_MODULE_1__is_format_equal__["a" /* isFormatEqual */])(format, previousFormat)) {
9211
- newFormatsAtIndex[formatIndex] = previousFormat;
9212
- }
9213
- });
9214
- newFormats[index] = newFormatsAtIndex;
9215
- }
9216
- });
9217
- return _objectSpread(_objectSpread({}, value), {}, {
9218
- formats: newFormats
9219
- });
9220
- }
9221
- //# sourceMappingURL=normalise-formats.js.map
9222
-
9223
- /***/ }),
9224
- /* 53 */
9225
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
9226
-
9227
- "use strict";
9228
- /* harmony export (immutable) */ __webpack_exports__["a"] = create;
9229
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(13);
9230
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__ = __webpack_require__(21);
9231
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_typeof__ = __webpack_require__(39);
9232
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__wordpress_data__ = __webpack_require__(41);
9233
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__is_format_equal__ = __webpack_require__(109);
9234
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__create_element__ = __webpack_require__(110);
9235
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__concat__ = __webpack_require__(177);
9236
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__special_characters__ = __webpack_require__(30);
9237
-
9238
-
9239
-
9240
-
9241
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
9242
-
9243
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
9244
-
9245
- /**
9246
- * WordPress dependencies
9247
- */
9248
-
9249
- /**
9250
- * Internal dependencies
9251
- */
9252
-
9253
-
9254
-
9255
-
9256
-
9257
- /**
9258
- * @typedef {Object} RichTextFormat
9259
- *
9260
- * @property {string} type Format type.
9261
- */
9262
-
9263
- /**
9264
- * @typedef {Array<RichTextFormat>} RichTextFormatList
9265
- */
9266
-
9267
- /**
9268
- * @typedef {Object} RichTextValue
9269
- *
9270
- * @property {string} text Text.
9271
- * @property {Array<RichTextFormatList>} formats Formats.
9272
- * @property {Array<RichTextFormat>} replacements Replacements.
9273
- * @property {number|undefined} start Selection start.
9274
- * @property {number|undefined} end Selection end.
9275
- */
9276
-
9277
- function createEmptyValue() {
9278
- return {
9279
- formats: [],
9280
- replacements: [],
9281
- text: ''
9282
- };
9283
- }
9284
-
9285
- function simpleFindKey(object, value) {
9286
- for (var key in object) {
9287
- if (object[key] === value) {
9288
- return key;
9289
- }
9290
- }
9291
- }
9292
-
9293
- function toFormat(_ref) {
9294
- var type = _ref.type,
9295
- attributes = _ref.attributes;
9296
- var formatType;
9297
-
9298
- if (attributes && attributes.class) {
9299
- formatType = Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_data__["d" /* select */])('core/rich-text').getFormatTypeForClassName(attributes.class);
9300
-
9301
- if (formatType) {
9302
- // Preserve any additional classes.
9303
- attributes.class = " ".concat(attributes.class, " ").replace(" ".concat(formatType.className, " "), ' ').trim();
9304
-
9305
- if (!attributes.class) {
9306
- delete attributes.class;
9307
- }
9308
- }
9309
- }
9310
-
9311
- if (!formatType) {
9312
- formatType = Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_data__["d" /* select */])('core/rich-text').getFormatTypeForBareElement(type);
9313
- }
9314
-
9315
- if (!formatType) {
9316
- return attributes ? {
9317
- type: type,
9318
- attributes: attributes
9319
- } : {
9320
- type: type
9321
- };
9322
- }
9323
-
9324
- if (formatType.__experimentalCreatePrepareEditableTree && !formatType.__experimentalCreateOnChangeEditableValue) {
9325
- return null;
9326
- }
9327
-
9328
- if (!attributes) {
9329
- return {
9330
- type: formatType.name
9331
- };
9332
- }
9333
-
9334
- var registeredAttributes = {};
9335
- var unregisteredAttributes = {};
9336
-
9337
- for (var name in attributes) {
9338
- var key = simpleFindKey(formatType.attributes, name);
9339
-
9340
- if (key) {
9341
- registeredAttributes[key] = attributes[name];
9342
- } else {
9343
- unregisteredAttributes[name] = attributes[name];
9344
- }
9345
- }
9346
-
9347
- return {
9348
- type: formatType.name,
9349
- attributes: registeredAttributes,
9350
- unregisteredAttributes: unregisteredAttributes
9351
- };
9352
- }
9353
- /**
9354
- * Create a RichText value from an `Element` tree (DOM), an HTML string or a
9355
- * plain text string, with optionally a `Range` object to set the selection. If
9356
- * called without any input, an empty value will be created. If
9357
- * `multilineTag` is provided, any content of direct children whose type matches
9358
- * `multilineTag` will be separated by two newlines. The optional functions can
9359
- * be used to filter out content.
9360
- *
9361
- * A value will have the following shape, which you are strongly encouraged not
9362
- * to modify without the use of helper functions:
9363
- *
9364
- * ```js
9365
- * {
9366
- * text: string,
9367
- * formats: Array,
9368
- * replacements: Array,
9369
- * ?start: number,
9370
- * ?end: number,
9371
- * }
9372
- * ```
9373
- *
9374
- * As you can see, text and formatting are separated. `text` holds the text,
9375
- * including any replacement characters for objects and lines. `formats`,
9376
- * `objects` and `lines` are all sparse arrays of the same length as `text`. It
9377
- * holds information about the formatting at the relevant text indices. Finally
9378
- * `start` and `end` state which text indices are selected. They are only
9379
- * provided if a `Range` was given.
9380
- *
9381
- * @param {Object} [$1] Optional named arguments.
9382
- * @param {Element} [$1.element] Element to create value from.
9383
- * @param {string} [$1.text] Text to create value from.
9384
- * @param {string} [$1.html] HTML to create value from.
9385
- * @param {Range} [$1.range] Range to create value from.
9386
- * @param {string} [$1.multilineTag] Multiline tag if the structure is
9387
- * multiline.
9388
- * @param {Array} [$1.multilineWrapperTags] Tags where lines can be found if
9389
- * nesting is possible.
9390
- * @param {boolean} [$1.preserveWhiteSpace] Whether or not to collapse white
9391
- * space characters.
9392
- * @param {boolean} [$1.__unstableIsEditableTree]
9393
- *
9394
- * @return {RichTextValue} A rich text value.
9395
- */
9396
-
9397
-
9398
- function create() {
9399
- var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
9400
- element = _ref2.element,
9401
- text = _ref2.text,
9402
- html = _ref2.html,
9403
- range = _ref2.range,
9404
- multilineTag = _ref2.multilineTag,
9405
- multilineWrapperTags = _ref2.multilineWrapperTags,
9406
- isEditableTree = _ref2.__unstableIsEditableTree,
9407
- preserveWhiteSpace = _ref2.preserveWhiteSpace;
9408
-
9409
- if (typeof text === 'string' && text.length > 0) {
9410
- return {
9411
- formats: Array(text.length),
9412
- replacements: Array(text.length),
9413
- text: text
9414
- };
9415
- }
9416
-
9417
- if (typeof html === 'string' && html.length > 0) {
9418
- // It does not matter which document this is, we're just using it to
9419
- // parse.
9420
- element = Object(__WEBPACK_IMPORTED_MODULE_5__create_element__["a" /* createElement */])(document, html);
9421
- }
9422
-
9423
- if (Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_typeof__["a" /* default */])(element) !== 'object') {
9424
- return createEmptyValue();
9425
- }
9426
-
9427
- if (!multilineTag) {
9428
- return createFromElement({
9429
- element: element,
9430
- range: range,
9431
- isEditableTree: isEditableTree,
9432
- preserveWhiteSpace: preserveWhiteSpace
9433
- });
9434
- }
9435
-
9436
- return createFromMultilineElement({
9437
- element: element,
9438
- range: range,
9439
- multilineTag: multilineTag,
9440
- multilineWrapperTags: multilineWrapperTags,
9441
- isEditableTree: isEditableTree,
9442
- preserveWhiteSpace: preserveWhiteSpace
9443
- });
9444
- }
9445
- /**
9446
- * Helper to accumulate the value's selection start and end from the current
9447
- * node and range.
9448
- *
9449
- * @param {Object} accumulator Object to accumulate into.
9450
- * @param {Node} node Node to create value with.
9451
- * @param {Range} range Range to create value with.
9452
- * @param {Object} value Value that is being accumulated.
9453
- */
9454
-
9455
- function accumulateSelection(accumulator, node, range, value) {
9456
- if (!range) {
9457
- return;
9458
- }
9459
-
9460
- var parentNode = node.parentNode;
9461
- var startContainer = range.startContainer,
9462
- startOffset = range.startOffset,
9463
- endContainer = range.endContainer,
9464
- endOffset = range.endOffset;
9465
- var currentLength = accumulator.text.length; // Selection can be extracted from value.
9466
-
9467
- if (value.start !== undefined) {
9468
- accumulator.start = currentLength + value.start; // Range indicates that the current node has selection.
9469
- } else if (node === startContainer && node.nodeType === node.TEXT_NODE) {
9470
- accumulator.start = currentLength + startOffset; // Range indicates that the current node is selected.
9471
- } else if (parentNode === startContainer && node === startContainer.childNodes[startOffset]) {
9472
- accumulator.start = currentLength; // Range indicates that the selection is after the current node.
9473
- } else if (parentNode === startContainer && node === startContainer.childNodes[startOffset - 1]) {
9474
- accumulator.start = currentLength + value.text.length; // Fallback if no child inside handled the selection.
9475
- } else if (node === startContainer) {
9476
- accumulator.start = currentLength;
9477
- } // Selection can be extracted from value.
9478
-
9479
-
9480
- if (value.end !== undefined) {
9481
- accumulator.end = currentLength + value.end; // Range indicates that the current node has selection.
9482
- } else if (node === endContainer && node.nodeType === node.TEXT_NODE) {
9483
- accumulator.end = currentLength + endOffset; // Range indicates that the current node is selected.
9484
- } else if (parentNode === endContainer && node === endContainer.childNodes[endOffset - 1]) {
9485
- accumulator.end = currentLength + value.text.length; // Range indicates that the selection is before the current node.
9486
- } else if (parentNode === endContainer && node === endContainer.childNodes[endOffset]) {
9487
- accumulator.end = currentLength; // Fallback if no child inside handled the selection.
9488
- } else if (node === endContainer) {
9489
- accumulator.end = currentLength + endOffset;
9490
- }
9491
- }
9492
- /**
9493
- * Adjusts the start and end offsets from a range based on a text filter.
9494
- *
9495
- * @param {Node} node Node of which the text should be filtered.
9496
- * @param {Range} range The range to filter.
9497
- * @param {Function} filter Function to use to filter the text.
9498
- *
9499
- * @return {Object|void} Object containing range properties.
9500
- */
9501
-
9502
-
9503
- function filterRange(node, range, filter) {
9504
- if (!range) {
9505
- return;
9506
- }
9507
-
9508
- var startContainer = range.startContainer,
9509
- endContainer = range.endContainer;
9510
- var startOffset = range.startOffset,
9511
- endOffset = range.endOffset;
9512
-
9513
- if (node === startContainer) {
9514
- startOffset = filter(node.nodeValue.slice(0, startOffset)).length;
9515
- }
9516
-
9517
- if (node === endContainer) {
9518
- endOffset = filter(node.nodeValue.slice(0, endOffset)).length;
9519
- }
9520
-
9521
- return {
9522
- startContainer: startContainer,
9523
- startOffset: startOffset,
9524
- endContainer: endContainer,
9525
- endOffset: endOffset
9526
- };
9527
- }
9528
- /**
9529
- * Collapse any whitespace used for HTML formatting to one space character,
9530
- * because it will also be displayed as such by the browser.
9531
- *
9532
- * @param {string} string
9533
- */
9534
-
9535
-
9536
- function collapseWhiteSpace(string) {
9537
- return string.replace(/[\n\r\t]+/g, ' ');
9538
- }
9539
-
9540
- var ZWNBSPRegExp = new RegExp(__WEBPACK_IMPORTED_MODULE_7__special_characters__["c" /* ZWNBSP */], 'g');
9541
- /**
9542
- * Removes padding (zero width non breaking spaces) added by `toTree`.
9543
- *
9544
- * @param {string} string
9545
- */
9546
-
9547
- function removePadding(string) {
9548
- return string.replace(ZWNBSPRegExp, '');
9549
- }
9550
- /**
9551
- * Creates a Rich Text value from a DOM element and range.
9552
- *
9553
- * @param {Object} $1 Named argements.
9554
- * @param {Element} [$1.element] Element to create value from.
9555
- * @param {Range} [$1.range] Range to create value from.
9556
- * @param {string} [$1.multilineTag] Multiline tag if the structure is
9557
- * multiline.
9558
- * @param {Array} [$1.multilineWrapperTags] Tags where lines can be found if
9559
- * nesting is possible.
9560
- * @param {boolean} [$1.preserveWhiteSpace] Whether or not to collapse white
9561
- * space characters.
9562
- * @param {Array} [$1.currentWrapperTags]
9563
- * @param {boolean} [$1.isEditableTree]
9564
- *
9565
- * @return {RichTextValue} A rich text value.
9566
- */
9567
-
9568
-
9569
- function createFromElement(_ref3) {
9570
- var element = _ref3.element,
9571
- range = _ref3.range,
9572
- multilineTag = _ref3.multilineTag,
9573
- multilineWrapperTags = _ref3.multilineWrapperTags,
9574
- _ref3$currentWrapperT = _ref3.currentWrapperTags,
9575
- currentWrapperTags = _ref3$currentWrapperT === void 0 ? [] : _ref3$currentWrapperT,
9576
- isEditableTree = _ref3.isEditableTree,
9577
- preserveWhiteSpace = _ref3.preserveWhiteSpace;
9578
- var accumulator = createEmptyValue();
9579
-
9580
- if (!element) {
9581
- return accumulator;
9582
- }
9583
-
9584
- if (!element.hasChildNodes()) {
9585
- accumulateSelection(accumulator, element, range, createEmptyValue());
9586
- return accumulator;
9587
- }
9588
-
9589
- var length = element.childNodes.length; // Optimise for speed.
9590
-
9591
- var _loop = function _loop(index) {
9592
- var node = element.childNodes[index];
9593
- var type = node.nodeName.toLowerCase();
9594
-
9595
- if (node.nodeType === node.TEXT_NODE) {
9596
- var filter = removePadding;
9597
-
9598
- if (!preserveWhiteSpace) {
9599
- filter = function filter(string) {
9600
- return removePadding(collapseWhiteSpace(string));
9601
- };
9602
- }
9603
-
9604
- var text = filter(node.nodeValue);
9605
- range = filterRange(node, range, filter);
9606
- accumulateSelection(accumulator, node, range, {
9607
- text: text
9608
- }); // Create a sparse array of the same length as `text`, in which
9609
- // formats can be added.
9610
-
9611
- accumulator.formats.length += text.length;
9612
- accumulator.replacements.length += text.length;
9613
- accumulator.text += text;
9614
- return "continue";
9615
- }
9616
-
9617
- if (node.nodeType !== node.ELEMENT_NODE) {
9618
- return "continue";
9619
- }
9620
-
9621
- if (isEditableTree && ( // Ignore any placeholders.
9622
- node.getAttribute('data-rich-text-placeholder') || // Ignore any line breaks that are not inserted by us.
9623
- type === 'br' && !node.getAttribute('data-rich-text-line-break'))) {
9624
- accumulateSelection(accumulator, node, range, createEmptyValue());
9625
- return "continue";
9626
- }
9627
-
9628
- if (type === 'br') {
9629
- accumulateSelection(accumulator, node, range, createEmptyValue());
9630
- Object(__WEBPACK_IMPORTED_MODULE_6__concat__["a" /* mergePair */])(accumulator, create({
9631
- text: '\n'
9632
- }));
9633
- return "continue";
9634
- }
9635
-
9636
- var lastFormats = accumulator.formats[accumulator.formats.length - 1];
9637
- var lastFormat = lastFormats && lastFormats[lastFormats.length - 1];
9638
- var newFormat = toFormat({
9639
- type: type,
9640
- attributes: getAttributes({
9641
- element: node
9642
- })
9643
- });
9644
- var format = Object(__WEBPACK_IMPORTED_MODULE_4__is_format_equal__["a" /* isFormatEqual */])(newFormat, lastFormat) ? lastFormat : newFormat;
9645
-
9646
- if (multilineWrapperTags && multilineWrapperTags.indexOf(type) !== -1) {
9647
- var _value = createFromMultilineElement({
9648
- element: node,
9649
- range: range,
9650
- multilineTag: multilineTag,
9651
- multilineWrapperTags: multilineWrapperTags,
9652
- currentWrapperTags: [].concat(Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(currentWrapperTags), [format]),
9653
- isEditableTree: isEditableTree,
9654
- preserveWhiteSpace: preserveWhiteSpace
9655
- });
9656
-
9657
- accumulateSelection(accumulator, node, range, _value);
9658
- Object(__WEBPACK_IMPORTED_MODULE_6__concat__["a" /* mergePair */])(accumulator, _value);
9659
- return "continue";
9660
- }
9661
-
9662
- var value = createFromElement({
9663
- element: node,
9664
- range: range,
9665
- multilineTag: multilineTag,
9666
- multilineWrapperTags: multilineWrapperTags,
9667
- isEditableTree: isEditableTree,
9668
- preserveWhiteSpace: preserveWhiteSpace
9669
- });
9670
- accumulateSelection(accumulator, node, range, value);
9671
-
9672
- if (!format) {
9673
- Object(__WEBPACK_IMPORTED_MODULE_6__concat__["a" /* mergePair */])(accumulator, value);
9674
- } else if (value.text.length === 0) {
9675
- if (format.attributes) {
9676
- Object(__WEBPACK_IMPORTED_MODULE_6__concat__["a" /* mergePair */])(accumulator, {
9677
- formats: [,],
9678
- replacements: [format],
9679
- text: __WEBPACK_IMPORTED_MODULE_7__special_characters__["b" /* OBJECT_REPLACEMENT_CHARACTER */]
9680
- });
9681
- }
9682
- } else {
9683
- // Indices should share a reference to the same formats array.
9684
- // Only create a new reference if `formats` changes.
9685
- function mergeFormats(formats) {
9686
- if (mergeFormats.formats === formats) {
9687
- return mergeFormats.newFormats;
9688
- }
9689
-
9690
- var newFormats = formats ? [format].concat(Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(formats)) : [format];
9691
- mergeFormats.formats = formats;
9692
- mergeFormats.newFormats = newFormats;
9693
- return newFormats;
9694
- } // Since the formats parameter can be `undefined`, preset
9695
- // `mergeFormats` with a new reference.
9696
-
9697
-
9698
- mergeFormats.newFormats = [format];
9699
- Object(__WEBPACK_IMPORTED_MODULE_6__concat__["a" /* mergePair */])(accumulator, _objectSpread(_objectSpread({}, value), {}, {
9700
- formats: Array.from(value.formats, mergeFormats)
9701
- }));
9702
- }
9703
- };
9704
-
9705
- for (var index = 0; index < length; index++) {
9706
- var _ret = _loop(index);
9707
-
9708
- if (_ret === "continue") continue;
9709
- }
9710
-
9711
- return accumulator;
9712
- }
9713
- /**
9714
- * Creates a rich text value from a DOM element and range that should be
9715
- * multiline.
9716
- *
9717
- * @param {Object} $1 Named argements.
9718
- * @param {Element} [$1.element] Element to create value from.
9719
- * @param {Range} [$1.range] Range to create value from.
9720
- * @param {string} [$1.multilineTag] Multiline tag if the structure is
9721
- * multiline.
9722
- * @param {Array} [$1.multilineWrapperTags] Tags where lines can be found if
9723
- * nesting is possible.
9724
- * @param {boolean} [$1.currentWrapperTags] Whether to prepend a line
9725
- * separator.
9726
- * @param {boolean} [$1.preserveWhiteSpace] Whether or not to collapse white
9727
- * space characters.
9728
- * @param {boolean} [$1.isEditableTree]
9729
- *
9730
- * @return {RichTextValue} A rich text value.
9731
- */
9732
-
9733
-
9734
- function createFromMultilineElement(_ref4) {
9735
- var element = _ref4.element,
9736
- range = _ref4.range,
9737
- multilineTag = _ref4.multilineTag,
9738
- multilineWrapperTags = _ref4.multilineWrapperTags,
9739
- _ref4$currentWrapperT = _ref4.currentWrapperTags,
9740
- currentWrapperTags = _ref4$currentWrapperT === void 0 ? [] : _ref4$currentWrapperT,
9741
- isEditableTree = _ref4.isEditableTree,
9742
- preserveWhiteSpace = _ref4.preserveWhiteSpace;
9743
- var accumulator = createEmptyValue();
9744
-
9745
- if (!element || !element.hasChildNodes()) {
9746
- return accumulator;
9747
- }
9748
-
9749
- var length = element.children.length; // Optimise for speed.
9750
-
9751
- for (var index = 0; index < length; index++) {
9752
- var node = element.children[index];
9753
-
9754
- if (node.nodeName.toLowerCase() !== multilineTag) {
9755
- continue;
9756
- }
9757
-
9758
- var value = createFromElement({
9759
- element: node,
9760
- range: range,
9761
- multilineTag: multilineTag,
9762
- multilineWrapperTags: multilineWrapperTags,
9763
- currentWrapperTags: currentWrapperTags,
9764
- isEditableTree: isEditableTree,
9765
- preserveWhiteSpace: preserveWhiteSpace
9766
- }); // Multiline value text should be separated by a line separator.
9767
-
9768
- if (index !== 0 || currentWrapperTags.length > 0) {
9769
- Object(__WEBPACK_IMPORTED_MODULE_6__concat__["a" /* mergePair */])(accumulator, {
9770
- formats: [,],
9771
- replacements: currentWrapperTags.length > 0 ? [currentWrapperTags] : [,],
9772
- text: __WEBPACK_IMPORTED_MODULE_7__special_characters__["a" /* LINE_SEPARATOR */]
9773
- });
9774
- }
9775
-
9776
- accumulateSelection(accumulator, node, range, value);
9777
- Object(__WEBPACK_IMPORTED_MODULE_6__concat__["a" /* mergePair */])(accumulator, value);
9778
- }
9779
-
9780
- return accumulator;
9781
- }
9782
- /**
9783
- * Gets the attributes of an element in object shape.
9784
- *
9785
- * @param {Object} $1 Named argements.
9786
- * @param {Element} $1.element Element to get attributes from.
9787
- *
9788
- * @return {Object|void} Attribute object or `undefined` if the element has no
9789
- * attributes.
9790
- */
9791
-
9792
-
9793
- function getAttributes(_ref5) {
9794
- var element = _ref5.element;
9795
-
9796
- if (!element.hasAttributes()) {
9797
- return;
9798
- }
9799
-
9800
- var length = element.attributes.length;
9801
- var accumulator; // Optimise for speed.
9802
-
9803
- for (var i = 0; i < length; i++) {
9804
- var _element$attributes$i = element.attributes[i],
9805
- name = _element$attributes$i.name,
9806
- value = _element$attributes$i.value;
9807
-
9808
- if (name.indexOf('data-rich-text-') === 0) {
9809
- continue;
9810
- }
9811
-
9812
- accumulator = accumulator || {};
9813
- accumulator[name] = value;
9814
- }
9815
-
9816
- return accumulator;
9817
- }
9818
- //# sourceMappingURL=create.js.map
9819
-
9820
- /***/ }),
9821
- /* 54 */
9822
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
9823
-
9824
- "use strict";
9825
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return focus; });
9826
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__focusable__ = __webpack_require__(191);
9827
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__tabbable__ = __webpack_require__(604);
9828
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__dom__ = __webpack_require__(605);
9829
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2__dom__["a"]; });
9830
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__phrasing_content__ = __webpack_require__(192);
9831
- /* unused harmony namespace reexport */
9832
- /**
9833
- * Internal dependencies
9834
- */
9835
-
9836
-
9837
- /**
9838
- * Object grouping `focusable` and `tabbable` utils
9839
- * under the keys with the same name.
9840
- */
9841
-
9842
- var focus = {
9843
- focusable: __WEBPACK_IMPORTED_MODULE_0__focusable__,
9844
- tabbable: __WEBPACK_IMPORTED_MODULE_1__tabbable__
9845
- };
9846
-
9847
-
9848
- //# sourceMappingURL=index.js.map
9849
-
9850
- /***/ }),
9851
- /* 55 */
9852
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
9853
-
9854
- "use strict";
9855
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Dashicon; });
9856
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
9857
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
9858
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
9859
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
9860
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
9861
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__wordpress_element__ = __webpack_require__(1);
9862
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__primitives__ = __webpack_require__(78);
9863
-
9864
-
9865
-
9866
-
9867
-
9868
-
9869
-
9870
- /* !!!
9871
- IF YOU ARE EDITING dashicon/index.jsx
9872
- THEN YOU ARE EDITING A FILE THAT GETS OUTPUT FROM THE DASHICONS REPO!
9873
- DO NOT EDIT THAT FILE! EDIT index-header.jsx and index-footer.jsx instead
9874
- OR if you're looking to change now SVGs get output, you'll need to edit strings in the Gruntfile :)
9875
- !!! */
9876
-
9877
- /**
9878
- * WordPress dependencies
9879
- */
9880
-
9881
- /**
9882
- * Internal dependencies
9883
- */
9884
-
9885
-
9886
-
9887
- var Dashicon =
9888
- /*#__PURE__*/
9889
- function (_Component) {
9890
- Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__["a" /* default */])(Dashicon, _Component);
9891
-
9892
- function Dashicon() {
9893
- Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, Dashicon);
9894
-
9895
- return Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(Dashicon).apply(this, arguments));
9896
- }
9897
-
9898
- Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__["a" /* default */])(Dashicon, [{
9899
- key: "shouldComponentUpdate",
9900
- value: function shouldComponentUpdate(nextProps) {
9901
- return this.props.icon !== nextProps.icon || this.props.size !== nextProps.size || this.props.className !== nextProps.className;
9902
- }
9903
- }, {
9904
- key: "render",
9905
- value: function render() {
9906
- var _this$props = this.props,
9907
- icon = _this$props.icon,
9908
- className = _this$props.className,
9909
- _this$props$size = _this$props.size,
9910
- size = _this$props$size === void 0 ? 20 : _this$props$size;
9911
- var path;
9912
-
9913
- switch (icon) {
9914
- case 'admin-appearance':
9915
- path = 'M14.48 11.06L7.41 3.99l1.5-1.5c.5-.56 2.3-.47 3.51.32 1.21.8 1.43 1.28 2.91 2.1 1.18.64 2.45 1.26 4.45.85zm-.71.71L6.7 4.7 4.93 6.47c-.39.39-.39 1.02 0 1.41l1.06 1.06c.39.39.39 1.03 0 1.42-.6.6-1.43 1.11-2.21 1.69-.35.26-.7.53-1.01.84C1.43 14.23.4 16.08 1.4 17.07c.99 1 2.84-.03 4.18-1.36.31-.31.58-.66.85-1.02.57-.78 1.08-1.61 1.69-2.21.39-.39 1.02-.39 1.41 0l1.06 1.06c.39.39 1.02.39 1.41 0z';
9916
- break;
9917
-
9918
- case 'admin-collapse':
9919
- path = 'M10 2.16c4.33 0 7.84 3.51 7.84 7.84s-3.51 7.84-7.84 7.84S2.16 14.33 2.16 10 5.71 2.16 10 2.16zm2 11.72V6.12L6.18 9.97z';
9920
- break;
9921
-
9922
- case 'admin-comments':
9923
- path = 'M5 2h9c1.1 0 2 .9 2 2v7c0 1.1-.9 2-2 2h-2l-5 5v-5H5c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2z';
9924
- break;
9925
-
9926
- case 'admin-customizer':
9927
- path = 'M18.33 3.57s.27-.8-.31-1.36c-.53-.52-1.22-.24-1.22-.24-.61.3-5.76 3.47-7.67 5.57-.86.96-2.06 3.79-1.09 4.82.92.98 3.96-.17 4.79-1 2.06-2.06 5.21-7.17 5.5-7.79zM1.4 17.65c2.37-1.56 1.46-3.41 3.23-4.64.93-.65 2.22-.62 3.08.29.63.67.8 2.57-.16 3.46-1.57 1.45-4 1.55-6.15.89z';
9928
- break;
9929
-
9930
- case 'admin-generic':
9931
- path = 'M18 12h-2.18c-.17.7-.44 1.35-.81 1.93l1.54 1.54-2.1 2.1-1.54-1.54c-.58.36-1.23.63-1.91.79V19H8v-2.18c-.68-.16-1.33-.43-1.91-.79l-1.54 1.54-2.12-2.12 1.54-1.54c-.36-.58-.63-1.23-.79-1.91H1V9.03h2.17c.16-.7.44-1.35.8-1.94L2.43 5.55l2.1-2.1 1.54 1.54c.58-.37 1.24-.64 1.93-.81V2h3v2.18c.68.16 1.33.43 1.91.79l1.54-1.54 2.12 2.12-1.54 1.54c.36.59.64 1.24.8 1.94H18V12zm-8.5 1.5c1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3 1.34 3 3 3z';
9932
- break;
9933
-
9934
- case 'admin-home':
9935
- path = 'M16 8.5l1.53 1.53-1.06 1.06L10 4.62l-6.47 6.47-1.06-1.06L10 2.5l4 4v-2h2v4zm-6-2.46l6 5.99V18H4v-5.97zM12 17v-5H8v5h4z';
9936
- break;
9937
-
9938
- case 'admin-links':
9939
- path = 'M17.74 2.76c1.68 1.69 1.68 4.41 0 6.1l-1.53 1.52c-1.12 1.12-2.7 1.47-4.14 1.09l2.62-2.61.76-.77.76-.76c.84-.84.84-2.2 0-3.04-.84-.85-2.2-.85-3.04 0l-.77.76-3.38 3.38c-.37-1.44-.02-3.02 1.1-4.14l1.52-1.53c1.69-1.68 4.42-1.68 6.1 0zM8.59 13.43l5.34-5.34c.42-.42.42-1.1 0-1.52-.44-.43-1.13-.39-1.53 0l-5.33 5.34c-.42.42-.42 1.1 0 1.52.44.43 1.13.39 1.52 0zm-.76 2.29l4.14-4.15c.38 1.44.03 3.02-1.09 4.14l-1.52 1.53c-1.69 1.68-4.41 1.68-6.1 0-1.68-1.68-1.68-4.42 0-6.1l1.53-1.52c1.12-1.12 2.7-1.47 4.14-1.1l-4.14 4.15c-.85.84-.85 2.2 0 3.05.84.84 2.2.84 3.04 0z';
9940
- break;
9941
-
9942
- case 'admin-media':
9943
- path = 'M13 11V4c0-.55-.45-1-1-1h-1.67L9 1H5L3.67 3H2c-.55 0-1 .45-1 1v7c0 .55.45 1 1 1h10c.55 0 1-.45 1-1zM7 4.5c1.38 0 2.5 1.12 2.5 2.5S8.38 9.5 7 9.5 4.5 8.38 4.5 7 5.62 4.5 7 4.5zM14 6h5v10.5c0 1.38-1.12 2.5-2.5 2.5S14 17.88 14 16.5s1.12-2.5 2.5-2.5c.17 0 .34.02.5.05V9h-3V6zm-4 8.05V13h2v3.5c0 1.38-1.12 2.5-2.5 2.5S7 17.88 7 16.5 8.12 14 9.5 14c.17 0 .34.02.5.05z';
9944
- break;
9945
-
9946
- case 'admin-multisite':
9947
- path = 'M14.27 6.87L10 3.14 5.73 6.87 5 6.14l5-4.38 5 4.38zM14 8.42l-4.05 3.43L6 8.38v-.74l4-3.5 4 3.5v.78zM11 9.7V8H9v1.7h2zm-1.73 4.03L5 10 .73 13.73 0 13l5-4.38L10 13zm10 0L15 10l-4.27 3.73L10 13l5-4.38L20 13zM5 11l4 3.5V18H1v-3.5zm10 0l4 3.5V18h-8v-3.5zm-9 6v-2H4v2h2zm10 0v-2h-2v2h2z';
9948
- break;
9949
-
9950
- case 'admin-network':
9951
- path = 'M16.95 2.58c1.96 1.95 1.96 5.12 0 7.07-1.51 1.51-3.75 1.84-5.59 1.01l-1.87 3.31-2.99.31L5 18H2l-1-2 7.95-7.69c-.92-1.87-.62-4.18.93-5.73 1.95-1.96 5.12-1.96 7.07 0zm-2.51 3.79c.74 0 1.33-.6 1.33-1.34 0-.73-.59-1.33-1.33-1.33-.73 0-1.33.6-1.33 1.33 0 .74.6 1.34 1.33 1.34z';
9952
- break;
9953
-
9954
- case 'admin-page':
9955
- path = 'M6 15V2h10v13H6zm-1 1h8v2H3V5h2v11z';
9956
- break;
9957
-
9958
- case 'admin-plugins':
9959
- path = 'M13.11 4.36L9.87 7.6 8 5.73l3.24-3.24c.35-.34 1.05-.2 1.56.32.52.51.66 1.21.31 1.55zm-8 1.77l.91-1.12 9.01 9.01-1.19.84c-.71.71-2.63 1.16-3.82 1.16H6.14L4.9 17.26c-.59.59-1.54.59-2.12 0-.59-.58-.59-1.53 0-2.12l1.24-1.24v-3.88c0-1.13.4-3.19 1.09-3.89zm7.26 3.97l3.24-3.24c.34-.35 1.04-.21 1.55.31.52.51.66 1.21.31 1.55l-3.24 3.25z';
9960
- break;
9961
-
9962
- case 'admin-post':
9963
- path = 'M10.44 3.02l1.82-1.82 6.36 6.35-1.83 1.82c-1.05-.68-2.48-.57-3.41.36l-.75.75c-.92.93-1.04 2.35-.35 3.41l-1.83 1.82-2.41-2.41-2.8 2.79c-.42.42-3.38 2.71-3.8 2.29s1.86-3.39 2.28-3.81l2.79-2.79L4.1 9.36l1.83-1.82c1.05.69 2.48.57 3.4-.36l.75-.75c.93-.92 1.05-2.35.36-3.41z';
9964
- break;
9965
-
9966
- case 'admin-settings':
9967
- path = 'M18 16V4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h13c.55 0 1-.45 1-1zM8 11h1c.55 0 1 .45 1 1s-.45 1-1 1H8v1.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5V13H6c-.55 0-1-.45-1-1s.45-1 1-1h1V5.5c0-.28.22-.5.5-.5s.5.22.5.5V11zm5-2h-1c-.55 0-1-.45-1-1s.45-1 1-1h1V5.5c0-.28.22-.5.5-.5s.5.22.5.5V7h1c.55 0 1 .45 1 1s-.45 1-1 1h-1v5.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5V9z';
9968
- break;
9969
-
9970
- case 'admin-site-alt':
9971
- path = 'M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zm7.5 6.48c-.274.896-.908 1.64-1.75 2.05-.45-1.69-1.658-3.074-3.27-3.75.13-.444.41-.83.79-1.09-.43-.28-1-.42-1.34.07-.53.69 0 1.61.21 2v.14c-.555-.337-.99-.84-1.24-1.44-.966-.03-1.922.208-2.76.69-.087-.565-.032-1.142.16-1.68.733.07 1.453-.23 1.92-.8.46-.52-.13-1.18-.59-1.58h.36c1.36-.01 2.702.335 3.89 1 1.36 1.005 2.194 2.57 2.27 4.26.24 0 .7-.55.91-.92.172.34.32.69.44 1.05zM9 16.84c-2.05-2.08.25-3.75-1-5.24-.92-.85-2.29-.26-3.11-1.23-.282-1.473.267-2.982 1.43-3.93.52-.44 4-1 5.42.22.83.715 1.415 1.674 1.67 2.74.46.035.918-.066 1.32-.29.41 2.98-3.15 6.74-5.73 7.73zM5.15 2.09c.786-.3 1.676-.028 2.16.66-.42.38-.94.63-1.5.72.02-.294.085-.584.19-.86l-.85-.52z';
9972
- break;
9973
-
9974
- case 'admin-site-alt2':
9975
- path = 'M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zm2.92 12.34c0 .35.14.63.36.66.22.03.47-.22.58-.6l.2.08c.718.384 1.07 1.22.84 2-.15.69-.743 1.198-1.45 1.24-.49-1.21-2.11.06-3.56-.22-.612-.154-1.11-.6-1.33-1.19 1.19-.11 2.85-1.73 4.36-1.97zM8 11.27c.918 0 1.695-.68 1.82-1.59.44.54.41 1.324-.07 1.83-.255.223-.594.325-.93.28-.335-.047-.635-.236-.82-.52zm3-.76c.41.39 3-.06 3.52 1.09-.95-.2-2.95.61-3.47-1.08l-.05-.01zM9.73 5.45v.27c-.65-.77-1.33-1.07-1.61-.57-.28.5 1 1.11.76 1.88-.24.77-1.27.56-1.88 1.61-.61 1.05-.49 2.42 1.24 3.67-1.192-.132-2.19-.962-2.54-2.11-.4-1.2-.09-2.26-.78-2.46C4 7.46 3 8.71 3 9.8c-1.26-1.26.05-2.86-1.2-4.18C3.5 1.998 7.644.223 11.44 1.49c-1.1 1.02-1.722 2.458-1.71 3.96z';
9976
- break;
9977
-
9978
- case 'admin-site-alt3':
9979
- path = 'M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zM1.11 9.68h2.51c.04.91.167 1.814.38 2.7H1.84c-.403-.85-.65-1.764-.73-2.7zm8.57-5.4V1.19c.964.366 1.756 1.08 2.22 2 .205.347.386.708.54 1.08l-2.76.01zm3.22 1.35c.232.883.37 1.788.41 2.7H9.68v-2.7h3.22zM8.32 1.19v3.09H5.56c.154-.372.335-.733.54-1.08.462-.924 1.255-1.64 2.22-2.01zm0 4.44v2.7H4.7c.04-.912.178-1.817.41-2.7h3.21zm-4.7 2.69H1.11c.08-.936.327-1.85.73-2.7H4c-.213.886-.34 1.79-.38 2.7zM4.7 9.68h3.62v2.7H5.11c-.232-.883-.37-1.788-.41-2.7zm3.63 4v3.09c-.964-.366-1.756-1.08-2.22-2-.205-.347-.386-.708-.54-1.08l2.76-.01zm1.35 3.09v-3.04h2.76c-.154.372-.335.733-.54 1.08-.464.92-1.256 1.634-2.22 2v-.04zm0-4.44v-2.7h3.62c-.04.912-.178 1.817-.41 2.7H9.68zm4.71-2.7h2.51c-.08.936-.327 1.85-.73 2.7H14c.21-.87.337-1.757.38-2.65l.01-.05zm0-1.35c-.046-.894-.176-1.78-.39-2.65h2.16c.403.85.65 1.764.73 2.7l-2.5-.05zm1-4H13.6c-.324-.91-.793-1.76-1.39-2.52 1.244.56 2.325 1.426 3.14 2.52h.04zm-9.6-2.52c-.597.76-1.066 1.61-1.39 2.52H2.65c.815-1.094 1.896-1.96 3.14-2.52zm-3.15 12H4.4c.324.91.793 1.76 1.39 2.52-1.248-.567-2.33-1.445-3.14-2.55l-.01.03zm9.56 2.52c.597-.76 1.066-1.61 1.39-2.52h1.76c-.82 1.08-1.9 1.933-3.14 2.48l-.01.04z';
9980
- break;
9981
-
9982
- case 'admin-site':
9983
- path = 'M9 0C4.03 0 0 4.03 0 9s4.03 9 9 9 9-4.03 9-9-4.03-9-9-9zm3.46 11.95c0 1.47-.8 3.3-4.06 4.7.3-4.17-2.52-3.69-3.2-5 .126-1.1.804-2.063 1.8-2.55-1.552-.266-3-.96-4.18-2 .05.47.28.904.64 1.21-.782-.295-1.458-.817-1.94-1.5.977-3.225 3.883-5.482 7.25-5.63-.84 1.38-1.5 4.13 0 5.57C7.23 7 6.26 5 5.41 5.79c-1.13 1.06.33 2.51 3.42 3.08 3.29.59 3.66 1.58 3.63 3.08zm1.34-4c-.32-1.11.62-2.23 1.69-3.14 1.356 1.955 1.67 4.45.84 6.68-.77-1.89-2.17-2.32-2.53-3.57v.03z';
9984
- break;
9985
-
9986
- case 'admin-tools':
9987
- path = 'M16.68 9.77c-1.34 1.34-3.3 1.67-4.95.99l-5.41 6.52c-.99.99-2.59.99-3.58 0s-.99-2.59 0-3.57l6.52-5.42c-.68-1.65-.35-3.61.99-4.95 1.28-1.28 3.12-1.62 4.72-1.06l-2.89 2.89 2.82 2.82 2.86-2.87c.53 1.58.18 3.39-1.08 4.65zM3.81 16.21c.4.39 1.04.39 1.43 0 .4-.4.4-1.04 0-1.43-.39-.4-1.03-.4-1.43 0-.39.39-.39 1.03 0 1.43z';
9988
- break;
9989
-
9990
- case 'admin-users':
9991
- path = 'M10 9.25c-2.27 0-2.73-3.44-2.73-3.44C7 4.02 7.82 2 9.97 2c2.16 0 2.98 2.02 2.71 3.81 0 0-.41 3.44-2.68 3.44zm0 2.57L12.72 10c2.39 0 4.52 2.33 4.52 4.53v2.49s-3.65 1.13-7.24 1.13c-3.65 0-7.24-1.13-7.24-1.13v-2.49c0-2.25 1.94-4.48 4.47-4.48z';
9992
- break;
9993
-
9994
- case 'album':
9995
- path = 'M0 18h10v-.26c1.52.4 3.17.35 4.76-.24 4.14-1.52 6.27-6.12 4.75-10.26-1.43-3.89-5.58-6-9.51-4.98V2H0v16zM9 3v14H1V3h8zm5.45 8.22c-.68 1.35-2.32 1.9-3.67 1.23-.31-.15-.57-.35-.78-.59V8.13c.8-.86 2.11-1.13 3.22-.58 1.35.68 1.9 2.32 1.23 3.67zm-2.75-.82c.22.16.53.12.7-.1.16-.22.12-.53-.1-.7s-.53-.12-.7.1c-.16.21-.12.53.1.7zm3.01 3.67c-1.17.78-2.56.99-3.83.69-.27-.06-.44-.34-.37-.61s.34-.43.62-.36l.17.04c.96.17 1.98-.01 2.86-.59.47-.32.86-.72 1.14-1.18.15-.23.45-.3.69-.16.23.15.3.46.16.69-.36.57-.84 1.08-1.44 1.48zm1.05 1.57c-1.48.99-3.21 1.32-4.84 1.06-.28-.05-.47-.32-.41-.6.05-.27.32-.45.61-.39l.22.04c1.31.15 2.68-.14 3.87-.94.71-.47 1.27-1.07 1.7-1.74.14-.24.45-.31.68-.16.24.14.31.45.16.69-.49.79-1.16 1.49-1.99 2.04z';
9996
- break;
9997
-
9998
- case 'align-center':
9999
- path = 'M3 5h14V3H3v2zm12 8V7H5v6h10zM3 17h14v-2H3v2z';
10000
- break;
10001
-
10002
- case 'align-full-width':
10003
- path = 'M17 13V3H3v10h14zM5 17h10v-2H5v2z';
10004
- break;
10005
-
10006
- case 'align-left':
10007
- path = 'M3 5h14V3H3v2zm9 8V7H3v6h9zm2-4h3V7h-3v2zm0 4h3v-2h-3v2zM3 17h14v-2H3v2z';
10008
- break;
10009
-
10010
- case 'align-none':
10011
- path = 'M3 5h14V3H3v2zm10 8V7H3v6h10zM3 17h14v-2H3v2z';
10012
- break;
10013
-
10014
- case 'align-pull-left':
10015
- path = 'M9 16V4H3v12h6zm2-7h6V7h-6v2zm0 4h6v-2h-6v2z';
10016
- break;
10017
-
10018
- case 'align-pull-right':
10019
- path = 'M17 16V4h-6v12h6zM9 7H3v2h6V7zm0 4H3v2h6v-2z';
10020
- break;
10021
-
10022
- case 'align-right':
10023
- path = 'M3 5h14V3H3v2zm0 4h3V7H3v2zm14 4V7H8v6h9zM3 13h3v-2H3v2zm0 4h14v-2H3v2z';
10024
- break;
10025
-
10026
- case 'align-wide':
10027
- path = 'M5 5h10V3H5v2zm12 8V7H3v6h14zM5 17h10v-2H5v2z';
10028
- break;
10029
-
10030
- case 'analytics':
10031
- path = 'M18 18V2H2v16h16zM16 5H4V4h12v1zM7 7v3h3c0 1.66-1.34 3-3 3s-3-1.34-3-3 1.34-3 3-3zm1 2V7c1.1 0 2 .9 2 2H8zm8-1h-4V7h4v1zm0 3h-4V9h4v2zm0 2h-4v-1h4v1zm0 3H4v-1h12v1z';
10032
- break;
10033
-
10034
- case 'archive':
10035
- path = 'M19 4v2H1V4h18zM2 7h16v10H2V7zm11 3V9H7v1h6z';
10036
- break;
10037
-
10038
- case 'arrow-down-alt':
10039
- path = 'M9 2h2v12l4-4 2 1-7 7-7-7 2-1 4 4V2z';
10040
- break;
10041
-
10042
- case 'arrow-down-alt2':
10043
- path = 'M5 6l5 5 5-5 2 1-7 7-7-7z';
10044
- break;
10045
-
10046
- case 'arrow-down':
10047
- path = 'M15 8l-4.03 6L7 8h8z';
10048
- break;
10049
-
10050
- case 'arrow-left-alt':
10051
- path = 'M18 9v2H6l4 4-1 2-7-7 7-7 1 2-4 4h12z';
10052
- break;
10053
-
10054
- case 'arrow-left-alt2':
10055
- path = 'M14 5l-5 5 5 5-1 2-7-7 7-7z';
10056
- break;
10057
-
10058
- case 'arrow-left':
10059
- path = 'M13 14L7 9.97 13 6v8z';
10060
- break;
10061
-
10062
- case 'arrow-right-alt':
10063
- path = 'M2 11V9h12l-4-4 1-2 7 7-7 7-1-2 4-4H2z';
10064
- break;
10065
-
10066
- case 'arrow-right-alt2':
10067
- path = 'M6 15l5-5-5-5 1-2 7 7-7 7z';
10068
- break;
10069
-
10070
- case 'arrow-right':
10071
- path = 'M8 6l6 4.03L8 14V6z';
10072
- break;
10073
-
10074
- case 'arrow-up-alt':
10075
- path = 'M11 18H9V6l-4 4-2-1 7-7 7 7-2 1-4-4v12z';
10076
- break;
10077
-
10078
- case 'arrow-up-alt2':
10079
- path = 'M15 14l-5-5-5 5-2-1 7-7 7 7z';
10080
- break;
10081
-
10082
- case 'arrow-up':
10083
- path = 'M7 13l4.03-6L15 13H7z';
10084
- break;
10085
-
10086
- case 'art':
10087
- path = 'M8.55 3.06c1.01.34-1.95 2.01-.1 3.13 1.04.63 3.31-2.22 4.45-2.86.97-.54 2.67-.65 3.53 1.23 1.09 2.38.14 8.57-3.79 11.06-3.97 2.5-8.97 1.23-10.7-2.66-2.01-4.53 3.12-11.09 6.61-9.9zm1.21 6.45c.73 1.64 4.7-.5 3.79-2.8-.59-1.49-4.48 1.25-3.79 2.8z';
10088
- break;
10089
-
10090
- case 'awards':
10091
- path = 'M4.46 5.16L5 7.46l-.54 2.29 2.01 1.24L7.7 13l2.3-.54 2.3.54 1.23-2.01 2.01-1.24L15 7.46l.54-2.3-2-1.24-1.24-2.01-2.3.55-2.29-.54-1.25 2zm5.55 6.34C7.79 11.5 6 9.71 6 7.49c0-2.2 1.79-3.99 4.01-3.99 2.2 0 3.99 1.79 3.99 3.99 0 2.22-1.79 4.01-3.99 4.01zm-.02-1C8.33 10.5 7 9.16 7 7.5c0-1.65 1.33-3 2.99-3S13 5.85 13 7.5c0 1.66-1.35 3-3.01 3zm3.84 1.1l-1.28 2.24-2.08-.47L13 19.2l1.4-2.2h2.5zm-7.7.07l1.25 2.25 2.13-.51L7 19.2 5.6 17H3.1z';
10092
- break;
10093
-
10094
- case 'backup':
10095
- path = 'M13.65 2.88c3.93 2.01 5.48 6.84 3.47 10.77s-6.83 5.48-10.77 3.47c-1.87-.96-3.2-2.56-3.86-4.4l1.64-1.03c.45 1.57 1.52 2.95 3.08 3.76 3.01 1.54 6.69.35 8.23-2.66 1.55-3.01.36-6.69-2.65-8.24C9.78 3.01 6.1 4.2 4.56 7.21l1.88.97-4.95 3.08-.39-5.82 1.78.91C4.9 2.4 9.75.89 13.65 2.88zm-4.36 7.83C9.11 10.53 9 10.28 9 10c0-.07.03-.12.04-.19h-.01L10 5l.97 4.81L14 13l-4.5-2.12.02-.02c-.08-.04-.16-.09-.23-.15z';
10096
- break;
10097
-
10098
- case 'block-default':
10099
- path = 'M15 6V4h-3v2H8V4H5v2H4c-.6 0-1 .4-1 1v8h14V7c0-.6-.4-1-1-1h-1z';
10100
- break;
10101
-
10102
- case 'book-alt':
10103
- path = 'M5 17h13v2H5c-1.66 0-3-1.34-3-3V4c0-1.66 1.34-3 3-3h13v14H5c-.55 0-1 .45-1 1s.45 1 1 1zm2-3.5v-11c0-.28-.22-.5-.5-.5s-.5.22-.5.5v11c0 .28.22.5.5.5s.5-.22.5-.5z';
10104
- break;
10105
-
10106
- case 'book':
10107
- path = 'M16 3h2v16H5c-1.66 0-3-1.34-3-3V4c0-1.66 1.34-3 3-3h9v14H5c-.55 0-1 .45-1 1s.45 1 1 1h11V3z';
10108
- break;
10109
-
10110
- case 'buddicons-activity':
10111
- path = 'M8 1v7h2V6c0-1.52 1.45-3 3-3v.86c.55-.52 1.26-.86 2-.86v3h1c1.1 0 2 .9 2 2s-.9 2-2 2h-1v6c0 .55-.45 1-1 1s-1-.45-1-1v-2.18c-.31.11-.65.18-1 .18v2c0 .55-.45 1-1 1s-1-.45-1-1v-2H8v2c0 .55-.45 1-1 1s-1-.45-1-1v-2c-.35 0-.69-.07-1-.18V16c0 .55-.45 1-1 1s-1-.45-1-1v-4H2v-1c0-1.66 1.34-3 3-3h2V1h1zm5 7c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1z';
10112
- break;
10113
-
10114
- case 'buddicons-bbpress-logo':
10115
- path = 'M8.5 12.6c.3-1.3 0-2.3-1.1-2.3-.8 0-1.6.6-1.8 1.5l-.3 1.7c-.3 1 .3 1.5 1 1.5 1.2 0 1.9-1.1 2.2-2.4zm-4-6.4C3.7 7.3 3.3 8.6 3.3 10c0 1 .2 1.9.6 2.8l1-4.6c.3-1.7.4-2-.4-2zm9.3 6.4c.3-1.3 0-2.3-1.1-2.3-.8 0-1.6.6-1.8 1.5l-.4 1.7c-.2 1.1.4 1.6 1.1 1.6 1.1-.1 1.9-1.2 2.2-2.5zM10 3.3c-2 0-3.9.9-5.1 2.3.6-.1 1.4-.2 1.8-.3.2 0 .2.1.2.2 0 .2-1 4.8-1 4.8.5-.3 1.2-.7 1.8-.7.9 0 1.5.4 1.9.9l.5-2.4c.4-1.6.4-1.9-.4-1.9-.4 0-.4-.5 0-.6.6-.1 1.8-.2 2.3-.3.2 0 .2.1.2.2l-1 4.8c.5-.4 1.2-.7 1.9-.7 1.7 0 2.5 1.3 2.1 3-.3 1.7-2 3-3.8 3-1.3 0-2.1-.7-2.3-1.4-.7.8-1.7 1.3-2.8 1.4 1.1.7 2.4 1.1 3.7 1.1 3.7 0 6.7-3 6.7-6.7s-3-6.7-6.7-6.7zM10 2c-4.4 0-8 3.6-8 8s3.6 8 8 8 8-3.6 8-8-3.6-8-8-8zm0 15.5c-2.1 0-4-.8-5.3-2.2-.3-.4-.7-.8-1-1.2-.7-1.2-1.2-2.6-1.2-4.1 0-4.1 3.4-7.5 7.5-7.5s7.5 3.4 7.5 7.5-3.4 7.5-7.5 7.5z';
10116
- break;
10117
-
10118
- case 'buddicons-buddypress-logo':
10119
- path = 'M10 0c5.52 0 10 4.48 10 10s-4.48 10-10 10S0 15.52 0 10 4.48 0 10 0zm0 .5C4.75.5.5 4.75.5 10s4.25 9.5 9.5 9.5 9.5-4.25 9.5-9.5S15.25.5 10 .5zm0 1c4.7 0 8.5 3.8 8.5 8.5s-3.8 8.5-8.5 8.5-8.5-3.8-8.5-8.5S5.3 1.5 10 1.5zm1.8 1.71c-.57 0-1.1.17-1.55.45 1.56.37 2.73 1.77 2.73 3.45 0 .69-.21 1.33-.55 1.87 1.31-.29 2.29-1.45 2.29-2.85 0-1.61-1.31-2.92-2.92-2.92zm-2.38 1c-1.61 0-2.92 1.31-2.92 2.93 0 1.61 1.31 2.92 2.92 2.92 1.62 0 2.93-1.31 2.93-2.92 0-1.62-1.31-2.93-2.93-2.93zm4.25 5.01l-.51.59c2.34.69 2.45 3.61 2.45 3.61h1.28c0-4.71-3.22-4.2-3.22-4.2zm-2.1.8l-2.12 2.09-2.12-2.09C3.12 10.24 3.89 15 3.89 15h11.08c.47-4.98-3.4-4.98-3.4-4.98z';
10120
- break;
10121
-
10122
- case 'buddicons-community':
10123
- path = 'M9 3c0-.67-.47-1.43-1-2-.5.5-1 1.38-1 2 0 .48.45 1 1 1s1-.47 1-1zm4 0c0-.67-.47-1.43-1-2-.5.5-1 1.38-1 2 0 .48.45 1 1 1s1-.47 1-1zM9 9V5.5c0-.55-.45-1-1-1-.57 0-1 .49-1 1V9c0 .55.45 1 1 1 .57 0 1-.49 1-1zm4 0V5.5c0-.55-.45-1-1-1-.57 0-1 .49-1 1V9c0 .55.45 1 1 1 .57 0 1-.49 1-1zm4 1c0-1.48-1.41-2.77-3.5-3.46V9c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5V6.01c-.17 0-.33-.01-.5-.01s-.33.01-.5.01V9c0 .83-.67 1.5-1.5 1.5S6.5 9.83 6.5 9V6.54C4.41 7.23 3 8.52 3 10c0 1.41.95 2.65 3.21 3.37 1.11.35 2.39 1.12 3.79 1.12s2.69-.78 3.79-1.13C16.04 12.65 17 11.41 17 10zm-7 5.43c1.43 0 2.74-.79 3.88-1.11 1.9-.53 2.49-1.34 3.12-2.32v3c0 2.21-3.13 4-7 4s-7-1.79-7-4v-3c.64.99 1.32 1.8 3.15 2.33 1.13.33 2.44 1.1 3.85 1.1z';
10124
- break;
10125
-
10126
- case 'buddicons-forums':
10127
- path = 'M13.5 7h-7C5.67 7 5 6.33 5 5.5S5.67 4 6.5 4h1.59C8.04 3.84 8 3.68 8 3.5 8 2.67 8.67 2 9.5 2h1c.83 0 1.5.67 1.5 1.5 0 .18-.04.34-.09.5h1.59c.83 0 1.5.67 1.5 1.5S14.33 7 13.5 7zM4 8h12c.55 0 1 .45 1 1s-.45 1-1 1H4c-.55 0-1-.45-1-1s.45-1 1-1zm1 3h10c.55 0 1 .45 1 1s-.45 1-1 1H5c-.55 0-1-.45-1-1s.45-1 1-1zm2 3h6c.55 0 1 .45 1 1s-.45 1-1 1h-1.09c.05.16.09.32.09.5 0 .83-.67 1.5-1.5 1.5h-1c-.83 0-1.5-.67-1.5-1.5 0-.18.04-.34.09-.5H7c-.55 0-1-.45-1-1s.45-1 1-1z';
10128
- break;
10129
-
10130
- case 'buddicons-friends':
10131
- path = 'M8.75 5.77C8.75 4.39 7 2 7 2S5.25 4.39 5.25 5.77 5.9 7.5 7 7.5s1.75-.35 1.75-1.73zm6 0C14.75 4.39 13 2 13 2s-1.75 2.39-1.75 3.77S11.9 7.5 13 7.5s1.75-.35 1.75-1.73zM9 17V9c0-.55-.45-1-1-1H6c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h2c.55 0 1-.45 1-1zm6 0V9c0-.55-.45-1-1-1h-2c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1h2c.55 0 1-.45 1-1zm-9-6l2-1v2l-2 1v-2zm6 0l2-1v2l-2 1v-2zm-6 3l2-1v2l-2 1v-2zm6 0l2-1v2l-2 1v-2z';
10132
- break;
10133
-
10134
- case 'buddicons-groups':
10135
- path = 'M15.45 6.25c1.83.94 1.98 3.18.7 4.98-.8 1.12-2.33 1.88-3.46 1.78L10.05 18H9l-2.65-4.99c-1.13.16-2.73-.63-3.55-1.79-1.28-1.8-1.13-4.04.71-4.97.48-.24.96-.33 1.43-.31-.01.4.01.8.07 1.21.26 1.69 1.41 3.53 2.86 4.37-.19.55-.49.99-.88 1.25L9 16.58v-5.66C7.64 10.55 6.26 8.76 6 7c-.4-2.65 1-5 3.5-5s3.9 2.35 3.5 5c-.26 1.76-1.64 3.55-3 3.92v5.77l2.07-3.84c-.44-.23-.77-.71-.99-1.3 1.48-.83 2.65-2.69 2.91-4.4.06-.41.08-.82.07-1.22.46-.01.92.08 1.39.32z';
10136
- break;
10137
-
10138
- case 'buddicons-pm':
10139
- path = 'M10 2c3 0 8 5 8 5v11H2V7s5-5 8-5zm7 14.72l-3.73-2.92L17 11l-.43-.37-2.26 1.3.24-4.31-8.77-.52-.46 4.54-1.99-.95L3 11l3.73 2.8-3.44 2.85.4.43L10 13l6.53 4.15z';
10140
- break;
10141
-
10142
- case 'buddicons-replies':
10143
- path = 'M17.54 10.29c1.17 1.17 1.17 3.08 0 4.25-1.18 1.17-3.08 1.17-4.25 0l-.34-.52c0 3.66-2 4.38-2.95 4.98-.82-.6-2.95-1.28-2.95-4.98l-.34.52c-1.17 1.17-3.07 1.17-4.25 0-1.17-1.17-1.17-3.08 0-4.25 0 0 1.02-.67 2.1-1.3C3.71 7.84 3.2 6.42 3.2 4.88c0-.34.03-.67.08-1C3.53 5.66 4.47 7.22 5.8 8.3c.67-.35 1.85-.83 2.37-.92H8c-1.1 0-2-.9-2-2s.9-2 2-2v-.5c0-.28.22-.5.5-.5s.5.22.5.5v.5h2v-.5c0-.28.22-.5.5-.5s.5.22.5.5v.5c1.1 0 2 .9 2 2s-.9 2-2 2h-.17c.51.09 1.78.61 2.38.92 1.33-1.08 2.27-2.64 2.52-4.42.05.33.08.66.08 1 0 1.54-.51 2.96-1.36 4.11 1.08.63 2.09 1.3 2.09 1.3zM8.5 6.38c.5 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1zm3-2c-.55 0-1 .45-1 1s.45 1 1 1 1-.45 1-1-.45-1-1-1zm-2.3 5.73c-.12.11-.19.26-.19.43.02.25.23.46.49.46h1c.26 0 .47-.21.49-.46 0-.15-.07-.29-.19-.43-.08-.06-.18-.11-.3-.11h-1c-.12 0-.22.05-.3.11zM12 12.5c0-.12-.06-.28-.19-.38-.09-.07-.19-.12-.31-.12h-3c-.12 0-.22.05-.31.12-.11.1-.19.25-.19.38 0 .28.22.5.5.5h3c.28 0 .5-.22.5-.5zM8.5 15h3c.28 0 .5-.22.5-.5s-.22-.5-.5-.5h-3c-.28 0-.5.22-.5.5s.22.5.5.5zm1 2h1c.28 0 .5-.22.5-.5s-.22-.5-.5-.5h-1c-.28 0-.5.22-.5.5s.22.5.5.5z';
10144
- break;
10145
-
10146
- case 'buddicons-topics':
10147
- path = 'M10.44 1.66c-.59-.58-1.54-.58-2.12 0L2.66 7.32c-.58.58-.58 1.53 0 2.12.6.6 1.56.56 2.12 0l5.66-5.66c.58-.58.59-1.53 0-2.12zm2.83 2.83c-.59-.59-1.54-.59-2.12 0l-5.66 5.66c-.59.58-.59 1.53 0 2.12.6.6 1.56.55 2.12 0l5.66-5.66c.58-.58.58-1.53 0-2.12zm1.06 6.72l4.18 4.18c.59.58.59 1.53 0 2.12s-1.54.59-2.12 0l-4.18-4.18-1.77 1.77c-.59.58-1.54.58-2.12 0-.59-.59-.59-1.54 0-2.13l5.66-5.65c.58-.59 1.53-.59 2.12 0 .58.58.58 1.53 0 2.12zM5 15c0-1.59-1.66-4-1.66-4S2 13.78 2 15s.6 2 1.34 2h.32C4.4 17 5 16.59 5 15z';
10148
- break;
10149
-
10150
- case 'buddicons-tracking':
10151
- path = 'M10.98 6.78L15.5 15c-1 2-3.5 3-5.5 3s-4.5-1-5.5-3L9 6.82c-.75-1.23-2.28-1.98-4.29-2.03l2.46-2.92c1.68 1.19 2.46 2.32 2.97 3.31.56-.87 1.2-1.68 2.7-2.12l1.83 2.86c-1.42-.34-2.64.08-3.69.86zM8.17 10.4l-.93 1.69c.49.11 1 .16 1.54.16 1.35 0 2.58-.36 3.55-.95l-1.01-1.82c-.87.53-1.96.86-3.15.92zm.86 5.38c1.99 0 3.73-.74 4.74-1.86l-.98-1.76c-1 1.12-2.74 1.87-4.74 1.87-.62 0-1.21-.08-1.76-.21l-.63 1.15c.94.5 2.1.81 3.37.81z';
10152
- break;
10153
-
10154
- case 'building':
10155
- path = 'M3 20h14V0H3v20zM7 3H5V1h2v2zm4 0H9V1h2v2zm4 0h-2V1h2v2zM7 6H5V4h2v2zm4 0H9V4h2v2zm4 0h-2V4h2v2zM7 9H5V7h2v2zm4 0H9V7h2v2zm4 0h-2V7h2v2zm-8 3H5v-2h2v2zm4 0H9v-2h2v2zm4 0h-2v-2h2v2zm-4 7H5v-6h6v6zm4-4h-2v-2h2v2zm0 3h-2v-2h2v2z';
10156
- break;
10157
-
10158
- case 'businessman':
10159
- path = 'M7.3 6l-.03-.19c-.04-.37-.05-.73-.03-1.08.02-.36.1-.71.25-1.04.14-.32.31-.61.52-.86s.49-.46.83-.6c.34-.15.72-.23 1.13-.23.69 0 1.26.2 1.71.59s.76.87.91 1.44.18 1.16.09 1.78l-.03.19c-.01.09-.05.25-.11.48-.05.24-.12.47-.2.69-.08.21-.19.45-.34.72-.14.27-.3.49-.47.69-.18.19-.4.34-.67.48-.27.13-.55.19-.86.19s-.59-.06-.87-.19c-.26-.13-.49-.29-.67-.5-.18-.2-.34-.42-.49-.66-.15-.25-.26-.49-.34-.73-.09-.25-.16-.47-.21-.67-.06-.21-.1-.37-.12-.5zm9.2 6.24c.41.7.5 1.41.5 2.14v2.49c0 .03-.12.08-.29.13-.18.04-.42.13-.97.27-.55.12-1.1.24-1.65.34s-1.19.19-1.95.27c-.75.08-1.46.12-2.13.12-.68 0-1.39-.04-2.14-.12-.75-.07-1.4-.17-1.98-.27-.58-.11-1.08-.23-1.56-.34-.49-.11-.8-.21-1.06-.29L3 16.87v-2.49c0-.75.07-1.46.46-2.15s.81-1.25 1.5-1.68C5.66 10.12 7.19 10 8 10l1.67 1.67L9 13v3l1.02 1.08L11 16v-3l-.68-1.33L11.97 10c.77 0 2.2.07 2.9.52.71.45 1.21 1.02 1.63 1.72z';
10160
- break;
10161
-
10162
- case 'button':
10163
- path = 'M17 5H3c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm1 7c0 .6-.4 1-1 1H3c-.6 0-1-.4-1-1V7c0-.6.4-1 1-1h14c.6 0 1 .4 1 1v5z';
10164
- break;
10165
-
10166
- case 'calendar-alt':
10167
- path = 'M15 4h3v15H2V4h3V3c0-.41.15-.76.44-1.06.29-.29.65-.44 1.06-.44s.77.15 1.06.44c.29.3.44.65.44 1.06v1h4V3c0-.41.15-.76.44-1.06.29-.29.65-.44 1.06-.44s.77.15 1.06.44c.29.3.44.65.44 1.06v1zM6 3v2.5c0 .14.05.26.15.36.09.09.21.14.35.14s.26-.05.35-.14c.1-.1.15-.22.15-.36V3c0-.14-.05-.26-.15-.35-.09-.1-.21-.15-.35-.15s-.26.05-.35.15c-.1.09-.15.21-.15.35zm7 0v2.5c0 .14.05.26.14.36.1.09.22.14.36.14s.26-.05.36-.14c.09-.1.14-.22.14-.36V3c0-.14-.05-.26-.14-.35-.1-.1-.22-.15-.36-.15s-.26.05-.36.15c-.09.09-.14.21-.14.35zm4 15V8H3v10h14zM7 9v2H5V9h2zm2 0h2v2H9V9zm4 2V9h2v2h-2zm-6 1v2H5v-2h2zm2 0h2v2H9v-2zm4 2v-2h2v2h-2zm-6 1v2H5v-2h2zm4 2H9v-2h2v2zm4 0h-2v-2h2v2z';
10168
- break;
10169
-
10170
- case 'calendar':
10171
- path = 'M15 4h3v14H2V4h3V3c0-.83.67-1.5 1.5-1.5S8 2.17 8 3v1h4V3c0-.83.67-1.5 1.5-1.5S15 2.17 15 3v1zM6 3v2.5c0 .28.22.5.5.5s.5-.22.5-.5V3c0-.28-.22-.5-.5-.5S6 2.72 6 3zm7 0v2.5c0 .28.22.5.5.5s.5-.22.5-.5V3c0-.28-.22-.5-.5-.5s-.5.22-.5.5zm4 14V8H3v9h14zM7 16V9H5v7h2zm4 0V9H9v7h2zm4 0V9h-2v7h2z';
10172
- break;
10173
-
10174
- case 'camera':
10175
- path = 'M6 5V3H3v2h3zm12 10V4H9L7 6H2v9h16zm-7-8c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3 1.34-3 3-3z';
10176
- break;
10177
-
10178
- case 'carrot':
10179
- path = 'M2 18.43c1.51 1.36 11.64-4.67 13.14-7.21.72-1.22-.13-3.01-1.52-4.44C15.2 5.73 16.59 9 17.91 8.31c.6-.32.99-1.31.7-1.92-.52-1.08-2.25-1.08-3.42-1.21.83-.2 2.82-1.05 2.86-2.25.04-.92-1.13-1.97-2.05-1.86-1.21.14-1.65 1.88-2.06 3-.05-.71-.2-2.27-.98-2.95-1.04-.91-2.29-.05-2.32 1.05-.04 1.33 2.82 2.07 1.92 3.67C11.04 4.67 9.25 4.03 8.1 4.7c-.49.31-1.05.91-1.63 1.69.89.94 2.12 2.07 3.09 2.72.2.14.26.42.11.62-.14.21-.42.26-.62.12-.99-.67-2.2-1.78-3.1-2.71-.45.67-.91 1.43-1.34 2.23.85.86 1.93 1.83 2.79 2.41.2.14.25.42.11.62-.14.21-.42.26-.63.12-.85-.58-1.86-1.48-2.71-2.32C2.4 13.69 1.1 17.63 2 18.43z';
10180
- break;
10181
-
10182
- case 'cart':
10183
- path = 'M6 13h9c.55 0 1 .45 1 1s-.45 1-1 1H5c-.55 0-1-.45-1-1V4H2c-.55 0-1-.45-1-1s.45-1 1-1h3c.55 0 1 .45 1 1v2h13l-4 7H6v1zm-.5 3c.83 0 1.5.67 1.5 1.5S6.33 19 5.5 19 4 18.33 4 17.5 4.67 16 5.5 16zm9 0c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5z';
10184
- break;
10185
-
10186
- case 'category':
10187
- path = 'M5 7h13v10H2V4h7l2 2H4v9h1V7z';
10188
- break;
10189
-
10190
- case 'chart-area':
10191
- path = 'M18 18l.01-12.28c.59-.35.99-.99.99-1.72 0-1.1-.9-2-2-2s-2 .9-2 2c0 .8.47 1.48 1.14 1.8l-4.13 6.58c-.33-.24-.73-.38-1.16-.38-.84 0-1.55.51-1.85 1.24l-2.14-1.53c.09-.22.14-.46.14-.71 0-1.11-.89-2-2-2-1.1 0-2 .89-2 2 0 .73.4 1.36.98 1.71L1 18h17zM17 3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM5 10c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm5.85 3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z';
10192
- break;
10193
-
10194
- case 'chart-bar':
10195
- path = 'M18 18V2h-4v16h4zm-6 0V7H8v11h4zm-6 0v-8H2v8h4z';
10196
- break;
10197
-
10198
- case 'chart-line':
10199
- path = 'M18 3.5c0 .62-.38 1.16-.92 1.38v13.11H1.99l4.22-6.73c-.13-.23-.21-.48-.21-.76C6 9.67 6.67 9 7.5 9S9 9.67 9 10.5c0 .13-.02.25-.05.37l1.44.63c.27-.3.67-.5 1.11-.5.18 0 .35.04.51.09l3.58-6.41c-.36-.27-.59-.7-.59-1.18 0-.83.67-1.5 1.5-1.5.19 0 .36.04.53.1l.05-.09v.11c.54.22.92.76.92 1.38zm-1.92 13.49V5.85l-3.29 5.89c.13.23.21.48.21.76 0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5l.01-.07-1.63-.72c-.25.18-.55.29-.88.29-.18 0-.35-.04-.51-.1l-3.2 5.09h12.29z';
10200
- break;
10201
-
10202
- case 'chart-pie':
10203
- path = 'M10 10V3c3.87 0 7 3.13 7 7h-7zM9 4v7h7c0 3.87-3.13 7-7 7s-7-3.13-7-7 3.13-7 7-7z';
10204
- break;
10205
-
10206
- case 'clipboard':
10207
- path = 'M11.9.39l1.4 1.4c1.61.19 3.5-.74 4.61.37s.18 3 .37 4.61l1.4 1.4c.39.39.39 1.02 0 1.41l-9.19 9.2c-.4.39-1.03.39-1.42 0L1.29 11c-.39-.39-.39-1.02 0-1.42l9.2-9.19c.39-.39 1.02-.39 1.41 0zm.58 2.25l-.58.58 4.95 4.95.58-.58c-.19-.6-.2-1.22-.15-1.82.02-.31.05-.62.09-.92.12-1 .18-1.63-.17-1.98s-.98-.29-1.98-.17c-.3.04-.61.07-.92.09-.6.05-1.22.04-1.82-.15zm4.02.93c.39.39.39 1.03 0 1.42s-1.03.39-1.42 0-.39-1.03 0-1.42 1.03-.39 1.42 0zm-6.72.36l-.71.7L15.44 11l.7-.71zM8.36 5.34l-.7.71 6.36 6.36.71-.7zM6.95 6.76l-.71.7 6.37 6.37.7-.71zM5.54 8.17l-.71.71 6.36 6.36.71-.71zM4.12 9.58l-.71.71 6.37 6.37.71-.71z';
10208
- break;
10209
-
10210
- case 'clock':
10211
- path = 'M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm0 14c3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6 2.69 6 6 6zm-.71-5.29c.07.05.14.1.23.15l-.02.02L14 13l-3.03-3.19L10 5l-.97 4.81h.01c0 .02-.01.05-.02.09S9 9.97 9 10c0 .28.1.52.29.71z';
10212
- break;
10213
-
10214
- case 'cloud-saved':
10215
- path = 'M14.8 9c.1-.3.2-.6.2-1 0-2.2-1.8-4-4-4-1.5 0-2.9.9-3.5 2.2-.3-.1-.7-.2-1-.2C5.1 6 4 7.1 4 8.5c0 .2 0 .4.1.5-1.8.3-3.1 1.7-3.1 3.5C1 14.4 2.6 16 4.5 16h10c1.9 0 3.5-1.6 3.5-3.5 0-1.8-1.4-3.3-3.2-3.5zm-6.3 5.9l-3.2-3.2 1.4-1.4 1.8 1.8 3.8-3.8 1.4 1.4-5.2 5.2z';
10216
- break;
10217
-
10218
- case 'cloud-upload':
10219
- path = 'M14.8 9c.1-.3.2-.6.2-1 0-2.2-1.8-4-4-4-1.5 0-2.9.9-3.5 2.2-.3-.1-.7-.2-1-.2C5.1 6 4 7.1 4 8.5c0 .2 0 .4.1.5-1.8.3-3.1 1.7-3.1 3.5C1 14.4 2.6 16 4.5 16H8v-3H5l4.5-4.5L14 13h-3v3h3.5c1.9 0 3.5-1.6 3.5-3.5 0-1.8-1.4-3.3-3.2-3.5z';
10220
- break;
10221
-
10222
- case 'cloud':
10223
- path = 'M14.9 9c1.8.2 3.1 1.7 3.1 3.5 0 1.9-1.6 3.5-3.5 3.5h-10C2.6 16 1 14.4 1 12.5 1 10.7 2.3 9.3 4.1 9 4 8.9 4 8.7 4 8.5 4 7.1 5.1 6 6.5 6c.3 0 .7.1.9.2C8.1 4.9 9.4 4 11 4c2.2 0 4 1.8 4 4 0 .4-.1.7-.1 1z';
10224
- break;
10225
-
10226
- case 'columns':
10227
- path = 'M3 15h6V5H3v10zm8 0h6V5h-6v10z';
10228
- break;
10229
-
10230
- case 'controls-back':
10231
- path = 'M2 10l10-6v3.6L18 4v12l-6-3.6V16z';
10232
- break;
10233
-
10234
- case 'controls-forward':
10235
- path = 'M18 10L8 16v-3.6L2 16V4l6 3.6V4z';
10236
- break;
10237
-
10238
- case 'controls-pause':
10239
- path = 'M5 16V4h3v12H5zm7-12h3v12h-3V4z';
10240
- break;
10241
-
10242
- case 'controls-play':
10243
- path = 'M5 4l10 6-10 6V4z';
10244
- break;
10245
-
10246
- case 'controls-repeat':
10247
- path = 'M5 7v3l-2 1.5V5h11V3l4 3.01L14 9V7H5zm10 6v-3l2-1.5V15H6v2l-4-3.01L6 11v2h9z';
10248
- break;
10249
-
10250
- case 'controls-skipback':
10251
- path = 'M11.98 7.63l6-3.6v12l-6-3.6v3.6l-8-4.8v4.8h-2v-12h2v4.8l8-4.8v3.6z';
10252
- break;
10253
-
10254
- case 'controls-skipforward':
10255
- path = 'M8 12.4L2 16V4l6 3.6V4l8 4.8V4h2v12h-2v-4.8L8 16v-3.6z';
10256
- break;
10257
-
10258
- case 'controls-volumeoff':
10259
- path = 'M2 7h4l5-4v14l-5-4H2V7z';
10260
- break;
10261
-
10262
- case 'controls-volumeon':
10263
- path = 'M2 7h4l5-4v14l-5-4H2V7zm12.69-2.46C14.82 4.59 18 5.92 18 10s-3.18 5.41-3.31 5.46c-.06.03-.13.04-.19.04-.2 0-.39-.12-.46-.31-.11-.26.02-.55.27-.65.11-.05 2.69-1.15 2.69-4.54 0-3.41-2.66-4.53-2.69-4.54-.25-.1-.38-.39-.27-.65.1-.25.39-.38.65-.27zM16 10c0 2.57-2.23 3.43-2.32 3.47-.06.02-.12.03-.18.03-.2 0-.39-.12-.47-.32-.1-.26.04-.55.29-.65.07-.02 1.68-.67 1.68-2.53s-1.61-2.51-1.68-2.53c-.25-.1-.38-.39-.29-.65.1-.25.39-.39.65-.29.09.04 2.32.9 2.32 3.47z';
10264
- break;
10265
-
10266
- case 'cover-image':
10267
- path = 'M2.2 1h15.5c.7 0 1.3.6 1.3 1.2v11.5c0 .7-.6 1.2-1.2 1.2H2.2c-.6.1-1.2-.5-1.2-1.1V2.2C1 1.6 1.6 1 2.2 1zM17 13V3H3v10h14zm-4-4s0-5 3-5v7c0 .6-.4 1-1 1H5c-.6 0-1-.4-1-1V7c2 0 3 4 3 4s1-4 3-4 3 2 3 2zM4 17h12v2H4z';
10268
- break;
10269
-
10270
- case 'dashboard':
10271
- path = 'M3.76 16h12.48c1.1-1.37 1.76-3.11 1.76-5 0-4.42-3.58-8-8-8s-8 3.58-8 8c0 1.89.66 3.63 1.76 5zM10 4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM6 6c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm8 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm-5.37 5.55L12 7v6c0 1.1-.9 2-2 2s-2-.9-2-2c0-.57.24-1.08.63-1.45zM4 10c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm12 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm-5 3c0-.55-.45-1-1-1s-1 .45-1 1 .45 1 1 1 1-.45 1-1z';
10272
- break;
10273
-
10274
- case 'desktop':
10275
- path = 'M3 2h14c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1h-5v2h2c.55 0 1 .45 1 1v1H5v-1c0-.55.45-1 1-1h2v-2H3c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm13 9V4H4v7h12zM5 5h9L5 9V5z';
10276
- break;
10277
-
10278
- case 'dismiss':
10279
- path = 'M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm5 11l-3-3 3-3-2-2-3 3-3-3-2 2 3 3-3 3 2 2 3-3 3 3z';
10280
- break;
10281
-
10282
- case 'download':
10283
- path = 'M14.01 4v6h2V2H4v8h2.01V4h8zm-2 2v6h3l-5 6-5-6h3V6h4z';
10284
- break;
10285
-
10286
- case 'edit':
10287
- path = 'M13.89 3.39l2.71 2.72c.46.46.42 1.24.03 1.64l-8.01 8.02-5.56 1.16 1.16-5.58s7.6-7.63 7.99-8.03c.39-.39 1.22-.39 1.68.07zm-2.73 2.79l-5.59 5.61 1.11 1.11 5.54-5.65zm-2.97 8.23l5.58-5.6-1.07-1.08-5.59 5.6z';
10288
- break;
10289
-
10290
- case 'editor-aligncenter':
10291
- path = 'M14 5V3H6v2h8zm3 4V7H3v2h14zm-3 4v-2H6v2h8zm3 4v-2H3v2h14z';
10292
- break;
10293
-
10294
- case 'editor-alignleft':
10295
- path = 'M12 5V3H3v2h9zm5 4V7H3v2h14zm-5 4v-2H3v2h9zm5 4v-2H3v2h14z';
10296
- break;
10297
-
10298
- case 'editor-alignright':
10299
- path = 'M17 5V3H8v2h9zm0 4V7H3v2h14zm0 4v-2H8v2h9zm0 4v-2H3v2h14z';
10300
- break;
10301
-
10302
- case 'editor-bold':
10303
- path = 'M6 4v13h4.54c1.37 0 2.46-.33 3.26-1 .8-.66 1.2-1.58 1.2-2.77 0-.84-.17-1.51-.51-2.01s-.9-.85-1.67-1.03v-.09c.57-.1 1.02-.4 1.36-.9s.51-1.13.51-1.91c0-1.14-.39-1.98-1.17-2.5C12.75 4.26 11.5 4 9.78 4H6zm2.57 5.15V6.26h1.36c.73 0 1.27.11 1.61.32.34.22.51.58.51 1.07 0 .54-.16.92-.47 1.15s-.82.35-1.51.35h-1.5zm0 2.19h1.6c1.44 0 2.16.53 2.16 1.61 0 .6-.17 1.05-.51 1.34s-.86.43-1.57.43H8.57v-3.38z';
10304
- break;
10305
-
10306
- case 'editor-break':
10307
- path = 'M16 4h2v9H7v3l-5-4 5-4v3h9V4z';
10308
- break;
10309
-
10310
- case 'editor-code':
10311
- path = 'M9 6l-4 4 4 4-1 2-6-6 6-6zm2 8l4-4-4-4 1-2 6 6-6 6z';
10312
- break;
10313
-
10314
- case 'editor-contract':
10315
- path = 'M15.75 6.75L18 3v14l-2.25-3.75L17 12h-4v4l1.25-1.25L18 17H2l3.75-2.25L7 16v-4H3l1.25 1.25L2 17V3l2.25 3.75L3 8h4V4L5.75 5.25 2 3h16l-3.75 2.25L13 4v4h4z';
10316
- break;
10317
-
10318
- case 'editor-customchar':
10319
- path = 'M10 5.4c1.27 0 2.24.36 2.91 1.08.66.71 1 1.76 1 3.13 0 1.28-.23 2.37-.69 3.27-.47.89-1.27 1.52-2.22 2.12v2h6v-2h-3.69c.92-.64 1.62-1.34 2.12-2.34.49-1.01.74-2.13.74-3.35 0-1.78-.55-3.19-1.65-4.22S11.92 3.54 10 3.54s-3.43.53-4.52 1.57c-1.1 1.04-1.65 2.44-1.65 4.2 0 1.21.24 2.31.73 3.33.48 1.01 1.19 1.71 2.1 2.36H3v2h6v-2c-.98-.64-1.8-1.28-2.24-2.17-.45-.89-.67-1.96-.67-3.22 0-1.37.33-2.41 1-3.13C7.75 5.76 8.72 5.4 10 5.4z';
10320
- break;
10321
-
10322
- case 'editor-expand':
10323
- path = 'M7 8h6v4H7zm-5 5v4h4l-1.2-1.2L7 12l-3.8 2.2M14 17h4v-4l-1.2 1.2L13 12l2.2 3.8M14 3l1.3 1.3L13 8l3.8-2.2L18 7V3M6 3H2v4l1.2-1.2L7 8 4.7 4.3';
10324
- break;
10325
-
10326
- case 'editor-help':
10327
- path = 'M17 10c0-3.87-3.14-7-7-7-3.87 0-7 3.13-7 7s3.13 7 7 7c3.86 0 7-3.13 7-7zm-6.3 1.48H9.14v-.43c0-.38.08-.7.24-.98s.46-.57.88-.89c.41-.29.68-.53.81-.71.14-.18.2-.39.2-.62 0-.25-.09-.44-.28-.58-.19-.13-.45-.19-.79-.19-.58 0-1.25.19-2 .57l-.64-1.28c.87-.49 1.8-.74 2.77-.74.81 0 1.45.2 1.92.58.48.39.71.91.71 1.55 0 .43-.09.8-.29 1.11-.19.32-.57.67-1.11 1.06-.38.28-.61.49-.71.63-.1.15-.15.34-.15.57v.35zm-1.47 2.74c-.18-.17-.27-.42-.27-.73 0-.33.08-.58.26-.75s.43-.25.77-.25c.32 0 .57.09.75.26s.27.42.27.74c0 .3-.09.55-.27.72-.18.18-.43.27-.75.27-.33 0-.58-.09-.76-.26z';
10328
- break;
10329
-
10330
- case 'editor-indent':
10331
- path = 'M3 5V3h9v2H3zm10-1V3h4v1h-4zm0 3h2V5l4 3.5-4 3.5v-2h-2V7zM3 8V6h9v2H3zm2 3V9h7v2H5zm-2 3v-2h9v2H3zm10 0v-1h4v1h-4zm-4 3v-2h3v2H9z';
10332
- break;
10333
-
10334
- case 'editor-insertmore':
10335
- path = 'M17 7V3H3v4h14zM6 11V9H3v2h3zm6 0V9H8v2h4zm5 0V9h-3v2h3zm0 6v-4H3v4h14z';
10336
- break;
10337
-
10338
- case 'editor-italic':
10339
- path = 'M14.78 6h-2.13l-2.8 9h2.12l-.62 2H4.6l.62-2h2.14l2.8-9H8.03l.62-2h6.75z';
10340
- break;
10341
-
10342
- case 'editor-justify':
10343
- path = 'M2 3h16v2H2V3zm0 4h16v2H2V7zm0 4h16v2H2v-2zm0 4h16v2H2v-2z';
10344
- break;
10345
-
10346
- case 'editor-kitchensink':
10347
- path = 'M19 2v6H1V2h18zm-1 5V3H2v4h16zM5 4v2H3V4h2zm3 0v2H6V4h2zm3 0v2H9V4h2zm3 0v2h-2V4h2zm3 0v2h-2V4h2zm2 5v9H1V9h18zm-1 8v-7H2v7h16zM5 11v2H3v-2h2zm3 0v2H6v-2h2zm3 0v2H9v-2h2zm6 0v2h-5v-2h5zm-6 3v2H3v-2h8zm3 0v2h-2v-2h2zm3 0v2h-2v-2h2z';
10348
- break;
10349
-
10350
- case 'editor-ltr':
10351
- path = 'M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM14 14l5-4-5-4v8z';
10352
- break;
10353
-
10354
- case 'editor-ol-rtl':
10355
- path = 'M15.025 8.75a1.048 1.048 0 0 1 .45-.1.507.507 0 0 1 .35.11.455.455 0 0 1 .13.36.803.803 0 0 1-.06.3 1.448 1.448 0 0 1-.19.33c-.09.11-.29.32-.58.62l-.99 1v.58h2.76v-.7h-1.72v-.04l.51-.48a7.276 7.276 0 0 0 .7-.71 1.75 1.75 0 0 0 .3-.49 1.254 1.254 0 0 0 .1-.51.968.968 0 0 0-.16-.56 1.007 1.007 0 0 0-.44-.37 1.512 1.512 0 0 0-.65-.14 1.98 1.98 0 0 0-.51.06 1.9 1.9 0 0 0-.42.15 3.67 3.67 0 0 0-.48.35l.45.54a2.505 2.505 0 0 1 .45-.3zM16.695 15.29a1.29 1.29 0 0 0-.74-.3v-.02a1.203 1.203 0 0 0 .65-.37.973.973 0 0 0 .23-.65.81.81 0 0 0-.37-.71 1.72 1.72 0 0 0-1-.26 2.185 2.185 0 0 0-1.33.4l.4.6a1.79 1.79 0 0 1 .46-.23 1.18 1.18 0 0 1 .41-.07c.38 0 .58.15.58.46a.447.447 0 0 1-.22.43 1.543 1.543 0 0 1-.7.12h-.31v.66h.31a1.764 1.764 0 0 1 .75.12.433.433 0 0 1 .23.41.55.55 0 0 1-.2.47 1.084 1.084 0 0 1-.63.15 2.24 2.24 0 0 1-.57-.08 2.671 2.671 0 0 1-.52-.2v.74a2.923 2.923 0 0 0 1.18.22 1.948 1.948 0 0 0 1.22-.33 1.077 1.077 0 0 0 .43-.92.836.836 0 0 0-.26-.64zM15.005 4.17c.06-.05.16-.14.3-.28l-.02.42V7h.84V3h-.69l-1.29 1.03.4.51zM4.02 5h9v1h-9zM4.02 10h9v1h-9zM4.02 15h9v1h-9z';
10356
- break;
10357
-
10358
- case 'editor-ol':
10359
- path = 'M6 7V3h-.69L4.02 4.03l.4.51.46-.37c.06-.05.16-.14.3-.28l-.02.42V7H6zm2-2h9v1H8V5zm-1.23 6.95v-.7H5.05v-.04l.51-.48c.33-.31.57-.54.7-.71.14-.17.24-.33.3-.49.07-.16.1-.33.1-.51 0-.21-.05-.4-.16-.56-.1-.16-.25-.28-.44-.37s-.41-.14-.65-.14c-.19 0-.36.02-.51.06-.15.03-.29.09-.42.15-.12.07-.29.19-.48.35l.45.54c.16-.13.31-.23.45-.3.15-.07.3-.1.45-.1.14 0 .26.03.35.11s.13.2.13.36c0 .1-.02.2-.06.3s-.1.21-.19.33c-.09.11-.29.32-.58.62l-.99 1v.58h2.76zM8 10h9v1H8v-1zm-1.29 3.95c0-.3-.12-.54-.37-.71-.24-.17-.58-.26-1-.26-.52 0-.96.13-1.33.4l.4.6c.17-.11.32-.19.46-.23.14-.05.27-.07.41-.07.38 0 .58.15.58.46 0 .2-.07.35-.22.43s-.38.12-.7.12h-.31v.66h.31c.34 0 .59.04.75.12.15.08.23.22.23.41 0 .22-.07.37-.2.47-.14.1-.35.15-.63.15-.19 0-.38-.03-.57-.08s-.36-.12-.52-.2v.74c.34.15.74.22 1.18.22.53 0 .94-.11 1.22-.33.29-.22.43-.52.43-.92 0-.27-.09-.48-.26-.64s-.42-.26-.74-.3v-.02c.27-.06.49-.19.65-.37.15-.18.23-.39.23-.65zM8 15h9v1H8v-1z';
10360
- break;
10361
-
10362
- case 'editor-outdent':
10363
- path = 'M7 4V3H3v1h4zm10 1V3H8v2h9zM7 7H5V5L1 8.5 5 12v-2h2V7zm10 1V6H8v2h9zm-2 3V9H8v2h7zm2 3v-2H8v2h9zM7 14v-1H3v1h4zm4 3v-2H8v2h3z';
10364
- break;
10365
-
10366
- case 'editor-paragraph':
10367
- path = 'M15 2H7.54c-.83 0-1.59.2-2.28.6-.7.41-1.25.96-1.65 1.65C3.2 4.94 3 5.7 3 6.52s.2 1.58.61 2.27c.4.69.95 1.24 1.65 1.64.69.41 1.45.61 2.28.61h.43V17c0 .27.1.51.29.71.2.19.44.29.71.29.28 0 .51-.1.71-.29.2-.2.3-.44.3-.71V5c0-.27.09-.51.29-.71.2-.19.44-.29.71-.29s.51.1.71.29c.19.2.29.44.29.71v12c0 .27.1.51.3.71.2.19.43.29.71.29.27 0 .51-.1.71-.29.19-.2.29-.44.29-.71V4H15c.27 0 .5-.1.7-.3.2-.19.3-.43.3-.7s-.1-.51-.3-.71C15.5 2.1 15.27 2 15 2z';
10368
- break;
10369
-
10370
- case 'editor-paste-text':
10371
- path = 'M12.38 2L15 5v1H5V5l2.64-3h4.74zM10 5c.55 0 1-.44 1-1 0-.55-.45-1-1-1s-1 .45-1 1c0 .56.45 1 1 1zm5.45-1H17c.55 0 1 .45 1 1v12c0 .56-.45 1-1 1H3c-.55 0-1-.44-1-1V5c0-.55.45-1 1-1h1.55L4 4.63V7h12V4.63zM14 11V9H6v2h3v5h2v-5h3z';
10372
- break;
10373
-
10374
- case 'editor-paste-word':
10375
- path = 'M12.38 2L15 5v1H5V5l2.64-3h4.74zM10 5c.55 0 1-.45 1-1s-.45-1-1-1-1 .45-1 1 .45 1 1 1zm8 12V5c0-.55-.45-1-1-1h-1.54l.54.63V7H4V4.62L4.55 4H3c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h14c.55 0 1-.45 1-1zm-3-8l-2 7h-2l-1-5-1 5H6.92L5 9h2l1 5 1-5h2l1 5 1-5h2z';
10376
- break;
10377
-
10378
- case 'editor-quote':
10379
- path = 'M9.49 13.22c0-.74-.2-1.38-.61-1.9-.62-.78-1.83-.88-2.53-.72-.29-1.65 1.11-3.75 2.92-4.65L7.88 4c-2.73 1.3-5.42 4.28-4.96 8.05C3.21 14.43 4.59 16 6.54 16c.85 0 1.56-.25 2.12-.75s.83-1.18.83-2.03zm8.05 0c0-.74-.2-1.38-.61-1.9-.63-.78-1.83-.88-2.53-.72-.29-1.65 1.11-3.75 2.92-4.65L15.93 4c-2.73 1.3-5.41 4.28-4.95 8.05.29 2.38 1.66 3.95 3.61 3.95.85 0 1.56-.25 2.12-.75s.83-1.18.83-2.03z';
10380
- break;
10381
-
10382
- case 'editor-removeformatting':
10383
- path = 'M14.29 4.59l1.1 1.11c.41.4.61.94.61 1.47v2.12c0 .53-.2 1.07-.61 1.47l-6.63 6.63c-.4.41-.94.61-1.47.61s-1.07-.2-1.47-.61l-1.11-1.1-1.1-1.11c-.41-.4-.61-.94-.61-1.47v-2.12c0-.54.2-1.07.61-1.48l6.63-6.62c.4-.41.94-.61 1.47-.61s1.06.2 1.47.61zm-6.21 9.7l6.42-6.42c.39-.39.39-1.03 0-1.43L12.36 4.3c-.19-.19-.45-.29-.72-.29s-.52.1-.71.29l-6.42 6.42c-.39.4-.39 1.04 0 1.43l2.14 2.14c.38.38 1.04.38 1.43 0z';
10384
- break;
10385
-
10386
- case 'editor-rtl':
10387
- path = 'M5.52 2h7.43c.55 0 1 .45 1 1s-.45 1-1 1h-1v13c0 .55-.45 1-1 1s-1-.45-1-1V5c0-.55-.45-1-1-1s-1 .45-1 1v12c0 .55-.45 1-1 1s-1-.45-1-1v-5.96h-.43C3.02 11.04 1 9.02 1 6.52S3.02 2 5.52 2zM19 6l-5 4 5 4V6z';
10388
- break;
10389
-
10390
- case 'editor-spellcheck':
10391
- path = 'M15.84 2.76c.25 0 .49.04.71.11.23.07.44.16.64.25l.35-.81c-.52-.26-1.08-.39-1.69-.39-.58 0-1.09.13-1.52.37-.43.25-.76.61-.99 1.08C13.11 3.83 13 4.38 13 5c0 .99.23 1.75.7 2.28s1.15.79 2.02.79c.6 0 1.13-.09 1.6-.26v-.84c-.26.08-.51.14-.74.19-.24.05-.49.08-.74.08-.59 0-1.04-.19-1.34-.57-.32-.37-.47-.93-.47-1.66 0-.7.16-1.25.48-1.65.33-.4.77-.6 1.33-.6zM6.5 8h1.04L5.3 2H4.24L2 8h1.03l.58-1.66H5.9zM8 2v6h2.17c.67 0 1.19-.15 1.57-.46.38-.3.56-.72.56-1.26 0-.4-.1-.72-.3-.95-.19-.24-.5-.39-.93-.47v-.04c.35-.06.6-.21.78-.44.18-.24.28-.53.28-.88 0-.52-.19-.9-.56-1.14-.36-.24-.96-.36-1.79-.36H8zm.98 2.48V2.82h.85c.44 0 .77.06.97.19.21.12.31.33.31.61 0 .31-.1.53-.29.66-.18.13-.48.2-.89.2h-.95zM5.64 5.5H3.9l.54-1.56c.14-.4.25-.76.32-1.1l.15.52c.07.23.13.4.17.51zm3.34-.23h.99c.44 0 .76.08.98.23.21.15.32.38.32.69 0 .34-.11.59-.32.75s-.52.24-.93.24H8.98V5.27zM4 13l5 5 9-8-1-1-8 6-4-3z';
10392
- break;
10393
-
10394
- case 'editor-strikethrough':
10395
- path = 'M15.82 12.25c.26 0 .5-.02.74-.07.23-.05.48-.12.73-.2v.84c-.46.17-.99.26-1.58.26-.88 0-1.54-.26-2.01-.79-.39-.44-.62-1.04-.68-1.79h-.94c.12.21.18.48.18.79 0 .54-.18.95-.55 1.26-.38.3-.9.45-1.56.45H8v-2.5H6.59l.93 2.5H6.49l-.59-1.67H3.62L3.04 13H2l.93-2.5H2v-1h1.31l.93-2.49H5.3l.92 2.49H8V7h1.77c1 0 1.41.17 1.77.41.37.24.55.62.55 1.13 0 .35-.09.64-.27.87l-.08.09h1.29c.05-.4.15-.77.31-1.1.23-.46.55-.82.98-1.06.43-.25.93-.37 1.51-.37.61 0 1.17.12 1.69.38l-.35.81c-.2-.1-.42-.18-.64-.25s-.46-.11-.71-.11c-.55 0-.99.2-1.31.59-.23.29-.38.66-.44 1.11H17v1h-2.95c.06.5.2.9.44 1.19.3.37.75.56 1.33.56zM4.44 8.96l-.18.54H5.3l-.22-.61c-.04-.11-.09-.28-.17-.51-.07-.24-.12-.41-.14-.51-.08.33-.18.69-.33 1.09zm4.53-1.09V9.5h1.19c.28-.02.49-.09.64-.18.19-.13.28-.35.28-.66 0-.28-.1-.48-.3-.61-.2-.12-.53-.18-.97-.18h-.84zm-3.33 2.64v-.01H3.91v.01h1.73zm5.28.01l-.03-.02H8.97v1.68h1.04c.4 0 .71-.08.92-.23.21-.16.31-.4.31-.74 0-.31-.11-.54-.32-.69z';
10396
- break;
10397
-
10398
- case 'editor-table':
10399
- path = 'M18 17V3H2v14h16zM16 7H4V5h12v2zm-7 4H4V9h5v2zm7 0h-5V9h5v2zm-7 4H4v-2h5v2zm7 0h-5v-2h5v2z';
10400
- break;
10401
-
10402
- case 'editor-textcolor':
10403
- path = 'M13.23 15h1.9L11 4H9L5 15h1.88l1.07-3h4.18zm-1.53-4.54H8.51L10 5.6z';
10404
- break;
10405
-
10406
- case 'editor-ul':
10407
- path = 'M5.5 7C4.67 7 4 6.33 4 5.5 4 4.68 4.67 4 5.5 4 6.32 4 7 4.68 7 5.5 7 6.33 6.32 7 5.5 7zM8 5h9v1H8V5zm-2.5 7c-.83 0-1.5-.67-1.5-1.5C4 9.68 4.67 9 5.5 9c.82 0 1.5.68 1.5 1.5 0 .83-.68 1.5-1.5 1.5zM8 10h9v1H8v-1zm-2.5 7c-.83 0-1.5-.67-1.5-1.5 0-.82.67-1.5 1.5-1.5.82 0 1.5.68 1.5 1.5 0 .83-.68 1.5-1.5 1.5zM8 15h9v1H8v-1z';
10408
- break;
10409
-
10410
- case 'editor-underline':
10411
- path = 'M14 5h-2v5.71c0 1.99-1.12 2.98-2.45 2.98-1.32 0-2.55-1-2.55-2.96V5H5v5.87c0 1.91 1 4.54 4.48 4.54 3.49 0 4.52-2.58 4.52-4.5V5zm0 13v-2H5v2h9z';
10412
- break;
10413
-
10414
- case 'editor-unlink':
10415
- path = 'M17.74 2.26c1.68 1.69 1.68 4.41 0 6.1l-1.53 1.52c-.32.33-.69.58-1.08.77L13 10l1.69-1.64.76-.77.76-.76c.84-.84.84-2.2 0-3.04-.84-.85-2.2-.85-3.04 0l-.77.76-.76.76L10 7l-.65-2.14c.19-.38.44-.75.77-1.07l1.52-1.53c1.69-1.68 4.42-1.68 6.1 0zM2 4l8 6-6-8zm4-2l4 8-2-8H6zM2 6l8 4-8-2V6zm7.36 7.69L10 13l.74 2.35-1.38 1.39c-1.69 1.68-4.41 1.68-6.1 0-1.68-1.68-1.68-4.42 0-6.1l1.39-1.38L7 10l-.69.64-1.52 1.53c-.85.84-.85 2.2 0 3.04.84.85 2.2.85 3.04 0zM18 16l-8-6 6 8zm-4 2l-4-8 2 8h2zm4-4l-8-4 8 2v2z';
10416
- break;
10417
-
10418
- case 'editor-video':
10419
- path = 'M16 2h-3v1H7V2H4v15h3v-1h6v1h3V2zM6 3v1H5V3h1zm9 0v1h-1V3h1zm-2 1v5H7V4h6zM6 5v1H5V5h1zm9 0v1h-1V5h1zM6 7v1H5V7h1zm9 0v1h-1V7h1zM6 9v1H5V9h1zm9 0v1h-1V9h1zm-2 1v5H7v-5h6zm-7 1v1H5v-1h1zm9 0v1h-1v-1h1zm-9 2v1H5v-1h1zm9 0v1h-1v-1h1zm-9 2v1H5v-1h1zm9 0v1h-1v-1h1z';
10420
- break;
10421
-
10422
- case 'ellipsis':
10423
- path = 'M5 10c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2zm12-2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-7 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z';
10424
- break;
10425
-
10426
- case 'email-alt':
10427
- path = 'M19 14.5v-9c0-.83-.67-1.5-1.5-1.5H3.49c-.83 0-1.5.67-1.5 1.5v9c0 .83.67 1.5 1.5 1.5H17.5c.83 0 1.5-.67 1.5-1.5zm-1.31-9.11c.33.33.15.67-.03.84L13.6 9.95l3.9 4.06c.12.14.2.36.06.51-.13.16-.43.15-.56.05l-4.37-3.73-2.14 1.95-2.13-1.95-4.37 3.73c-.13.1-.43.11-.56-.05-.14-.15-.06-.37.06-.51l3.9-4.06-4.06-3.72c-.18-.17-.36-.51-.03-.84s.67-.17.95.07l6.24 5.04 6.25-5.04c.28-.24.62-.4.95-.07z';
10428
- break;
10429
-
10430
- case 'email-alt2':
10431
- path = 'M18.01 11.18V2.51c0-1.19-.9-1.81-2-1.37L4 5.91c-1.1.44-2 1.77-2 2.97v8.66c0 1.2.9 1.81 2 1.37l12.01-4.77c1.1-.44 2-1.76 2-2.96zm-1.43-7.46l-6.04 9.33-6.65-4.6c-.1-.07-.36-.32-.17-.64.21-.36.65-.21.65-.21l6.3 2.32s4.83-6.34 5.11-6.7c.13-.17.43-.34.73-.13.29.2.16.49.07.63z';
10432
- break;
10433
-
10434
- case 'email':
10435
- path = 'M3.87 4h13.25C18.37 4 19 4.59 19 5.79v8.42c0 1.19-.63 1.79-1.88 1.79H3.87c-1.25 0-1.88-.6-1.88-1.79V5.79c0-1.2.63-1.79 1.88-1.79zm6.62 8.6l6.74-5.53c.24-.2.43-.66.13-1.07-.29-.41-.82-.42-1.17-.17l-5.7 3.86L4.8 5.83c-.35-.25-.88-.24-1.17.17-.3.41-.11.87.13 1.07z';
10436
- break;
10437
-
10438
- case 'embed-audio':
10439
- path = 'M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-7 3H7v4c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2c.4 0 .7.1 1 .3V5h4v2zm4 3.5L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3z';
10440
- break;
10441
-
10442
- case 'embed-generic':
10443
- path = 'M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-3 6.5L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3z';
10444
- break;
10445
-
10446
- case 'embed-photo':
10447
- path = 'M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-7 8H3V6h7v6zm4-1.5L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3zm-6-4V8.5L7.2 10 6 9.2 4 11h5zM4.6 8.6c.6 0 1-.4 1-1s-.4-1-1-1-1 .4-1 1 .4 1 1 1z';
10448
- break;
10449
-
10450
- case 'embed-post':
10451
- path = 'M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM8.6 9l-.4.3c-.4.4-.5 1.1-.2 1.6l-.8.8-1.1-1.1-1.3 1.3c-.2.2-1.6 1.3-1.8 1.1-.2-.2.9-1.6 1.1-1.8l1.3-1.3-1.1-1.1.8-.8c.5.3 1.2.3 1.6-.2l.3-.3c.5-.5.5-1.2.2-1.7L8 5l3 2.9-.8.8c-.5-.2-1.2-.2-1.6.3zm5.4 1.5L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3z';
10452
- break;
10453
-
10454
- case 'embed-video':
10455
- path = 'M17 4H3c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-7 6.5L8 9.1V11H3V6h5v1.8l2-1.3v4zm4 0L12.5 12l1.5 1.5V15l-3-3 3-3v1.5zm1 4.5v-1.5l1.5-1.5-1.5-1.5V9l3 3-3 3z';
10456
- break;
10457
-
10458
- case 'excerpt-view':
10459
- path = 'M19 18V2c0-.55-.45-1-1-1H2c-.55 0-1 .45-1 1v16c0 .55.45 1 1 1h16c.55 0 1-.45 1-1zM4 3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v6H6V3h11zM4 11c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v6H6v-6h11z';
10460
- break;
10461
-
10462
- case 'exit':
10463
- path = 'M13 3v2h2v10h-2v2h4V3h-4zm0 8V9H5.4l4.3-4.3-1.4-1.4L1.6 10l6.7 6.7 1.4-1.4L5.4 11H13z';
10464
- break;
10465
-
10466
- case 'external':
10467
- path = 'M9 3h8v8l-2-1V6.92l-5.6 5.59-1.41-1.41L14.08 5H10zm3 12v-3l2-2v7H3V6h8L9 8H5v7h7z';
10468
- break;
10469
-
10470
- case 'facebook-alt':
10471
- path = 'M8.46 18h2.93v-7.3h2.45l.37-2.84h-2.82V6.04c0-.82.23-1.38 1.41-1.38h1.51V2.11c-.26-.03-1.15-.11-2.19-.11-2.18 0-3.66 1.33-3.66 3.76v2.1H6v2.84h2.46V18z';
10472
- break;
10473
-
10474
- case 'facebook':
10475
- path = 'M2.89 2h14.23c.49 0 .88.39.88.88v14.24c0 .48-.39.88-.88.88h-4.08v-6.2h2.08l.31-2.41h-2.39V7.85c0-.7.2-1.18 1.2-1.18h1.28V4.51c-.22-.03-.98-.09-1.86-.09-1.85 0-3.11 1.12-3.11 3.19v1.78H8.46v2.41h2.09V18H2.89c-.49 0-.89-.4-.89-.88V2.88c0-.49.4-.88.89-.88z';
10476
- break;
10477
-
10478
- case 'feedback':
10479
- path = 'M2 2h16c.55 0 1 .45 1 1v14c0 .55-.45 1-1 1H2c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm15 14V7H3v9h14zM4 8v1h3V8H4zm4 0v3h8V8H8zm-4 4v1h3v-1H4zm4 0v3h8v-3H8z';
10480
- break;
10481
-
10482
- case 'filter':
10483
- path = 'M3 4.5v-2s3.34-1 7-1 7 1 7 1v2l-5 7.03v6.97s-1.22-.09-2.25-.59S8 16.5 8 16.5v-4.97z';
10484
- break;
10485
-
10486
- case 'flag':
10487
- path = 'M5 18V3H3v15h2zm1-6V4c3-1 7 1 11 0v8c-3 1.27-8-1-11 0z';
10488
- break;
10489
-
10490
- case 'format-aside':
10491
- path = 'M1 1h18v12l-6 6H1V1zm3 3v1h12V4H4zm0 4v1h12V8H4zm6 5v-1H4v1h6zm2 4l5-5h-5v5z';
10492
- break;
10493
-
10494
- case 'format-audio':
10495
- path = 'M6.99 3.08l11.02-2c.55-.08.99.45.99 1V14.5c0 1.94-1.57 3.5-3.5 3.5S12 16.44 12 14.5c0-1.93 1.57-3.5 3.5-3.5.54 0 1.04.14 1.5.35V5.08l-9 2V16c-.24 1.7-1.74 3-3.5 3C2.57 19 1 17.44 1 15.5 1 13.57 2.57 12 4.5 12c.54 0 1.04.14 1.5.35V4.08c0-.55.44-.91.99-1z';
10496
- break;
10497
-
10498
- case 'format-chat':
10499
- path = 'M11 6h-.82C9.07 6 8 7.2 8 8.16V10l-3 3v-3H3c-1.1 0-2-.9-2-2V3c0-1.1.9-2 2-2h6c1.1 0 2 .9 2 2v3zm0 1h6c1.1 0 2 .9 2 2v5c0 1.1-.9 2-2 2h-2v3l-3-3h-1c-1.1 0-2-.9-2-2V9c0-1.1.9-2 2-2z';
10500
- break;
10501
-
10502
- case 'format-gallery':
10503
- path = 'M16 4h1.96c.57 0 1.04.47 1.04 1.04v12.92c0 .57-.47 1.04-1.04 1.04H5.04C4.47 19 4 18.53 4 17.96V16H2.04C1.47 16 1 15.53 1 14.96V2.04C1 1.47 1.47 1 2.04 1h12.92c.57 0 1.04.47 1.04 1.04V4zM3 14h11V3H3v11zm5-8.5C8 4.67 7.33 4 6.5 4S5 4.67 5 5.5 5.67 7 6.5 7 8 6.33 8 5.5zm2 4.5s1-5 3-5v8H4V7c2 0 2 3 2 3s.33-2 2-2 2 2 2 2zm7 7V6h-1v8.96c0 .57-.47 1.04-1.04 1.04H6v1h11z';
10504
- break;
10505
-
10506
- case 'format-image':
10507
- path = 'M2.25 1h15.5c.69 0 1.25.56 1.25 1.25v15.5c0 .69-.56 1.25-1.25 1.25H2.25C1.56 19 1 18.44 1 17.75V2.25C1 1.56 1.56 1 2.25 1zM17 17V3H3v14h14zM10 6c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2zm3 5s0-6 3-6v10c0 .55-.45 1-1 1H5c-.55 0-1-.45-1-1V8c2 0 3 4 3 4s1-3 3-3 3 2 3 2z';
10508
- break;
10509
-
10510
- case 'format-quote':
10511
- path = 'M8.54 12.74c0-.87-.24-1.61-.72-2.22-.73-.92-2.14-1.03-2.96-.85-.34-1.93 1.3-4.39 3.42-5.45L6.65 1.94C3.45 3.46.31 6.96.85 11.37 1.19 14.16 2.8 16 5.08 16c1 0 1.83-.29 2.48-.88.66-.59.98-1.38.98-2.38zm9.43 0c0-.87-.24-1.61-.72-2.22-.73-.92-2.14-1.03-2.96-.85-.34-1.93 1.3-4.39 3.42-5.45l-1.63-2.28c-3.2 1.52-6.34 5.02-5.8 9.43.34 2.79 1.95 4.63 4.23 4.63 1 0 1.83-.29 2.48-.88.66-.59.98-1.38.98-2.38z';
10512
- break;
10513
-
10514
- case 'format-status':
10515
- path = 'M10 1c7 0 9 2.91 9 6.5S17 14 10 14s-9-2.91-9-6.5S3 1 10 1zM5.5 9C6.33 9 7 8.33 7 7.5S6.33 6 5.5 6 4 6.67 4 7.5 4.67 9 5.5 9zM10 9c.83 0 1.5-.67 1.5-1.5S10.83 6 10 6s-1.5.67-1.5 1.5S9.17 9 10 9zm4.5 0c.83 0 1.5-.67 1.5-1.5S15.33 6 14.5 6 13 6.67 13 7.5 13.67 9 14.5 9zM6 14.5c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5zm-3 2c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1z';
10516
- break;
10517
-
10518
- case 'format-video':
10519
- path = 'M2 1h16c.55 0 1 .45 1 1v16l-18-.02V2c0-.55.45-1 1-1zm4 1L4 5h1l2-3H6zm4 0H9L7 5h1zm3 0h-1l-2 3h1zm3 0h-1l-2 3h1zm1 14V6H3v10h14zM8 7l6 4-6 4V7z';
10520
- break;
10521
-
10522
- case 'forms':
10523
- path = 'M2 2h7v7H2V2zm9 0v7h7V2h-7zM5.5 4.5L7 3H4zM12 8V3h5v5h-5zM4.5 5.5L3 4v3zM8 4L6.5 5.5 8 7V4zM5.5 6.5L4 8h3zM9 18v-7H2v7h7zm9 0h-7v-7h7v7zM8 12v5H3v-5h5zm6.5 1.5L16 12h-3zM12 16l1.5-1.5L12 13v3zm3.5-1.5L17 16v-3zm-1 1L13 17h3z';
10524
- break;
10525
-
10526
- case 'googleplus':
10527
- path = 'M6.73 10h5.4c.05.29.09.57.09.95 0 3.27-2.19 5.6-5.49 5.6-3.17 0-5.73-2.57-5.73-5.73 0-3.17 2.56-5.73 5.73-5.73 1.54 0 2.84.57 3.83 1.5l-1.55 1.5c-.43-.41-1.17-.89-2.28-.89-1.96 0-3.55 1.62-3.55 3.62 0 1.99 1.59 3.61 3.55 3.61 2.26 0 3.11-1.62 3.24-2.47H6.73V10zM19 10v1.64h-1.64v1.63h-1.63v-1.63h-1.64V10h1.64V8.36h1.63V10H19z';
10528
- break;
10529
-
10530
- case 'grid-view':
10531
- path = 'M2 1h16c.55 0 1 .45 1 1v16c0 .55-.45 1-1 1H2c-.55 0-1-.45-1-1V2c0-.55.45-1 1-1zm7.01 7.99v-6H3v6h6.01zm8 0v-6h-6v6h6zm-8 8.01v-6H3v6h6.01zm8 0v-6h-6v6h6z';
10532
- break;
10533
-
10534
- case 'groups':
10535
- path = 'M8.03 4.46c-.29 1.28.55 3.46 1.97 3.46 1.41 0 2.25-2.18 1.96-3.46-.22-.98-1.08-1.63-1.96-1.63-.89 0-1.74.65-1.97 1.63zm-4.13.9c-.25 1.08.47 2.93 1.67 2.93s1.92-1.85 1.67-2.93c-.19-.83-.92-1.39-1.67-1.39s-1.48.56-1.67 1.39zm8.86 0c-.25 1.08.47 2.93 1.66 2.93 1.2 0 1.92-1.85 1.67-2.93-.19-.83-.92-1.39-1.67-1.39-.74 0-1.47.56-1.66 1.39zm-.59 11.43l1.25-4.3C14.2 10 12.71 8.47 10 8.47c-2.72 0-4.21 1.53-3.44 4.02l1.26 4.3C8.05 17.51 9 18 10 18c.98 0 1.94-.49 2.17-1.21zm-6.1-7.63c-.49.67-.96 1.83-.42 3.59l1.12 3.79c-.34.2-.77.31-1.2.31-.85 0-1.65-.41-1.85-1.03l-1.07-3.65c-.65-2.11.61-3.4 2.92-3.4.27 0 .54.02.79.06-.1.1-.2.22-.29.33zm8.35-.39c2.31 0 3.58 1.29 2.92 3.4l-1.07 3.65c-.2.62-1 1.03-1.85 1.03-.43 0-.86-.11-1.2-.31l1.11-3.77c.55-1.78.08-2.94-.42-3.61-.08-.11-.18-.23-.28-.33.25-.04.51-.06.79-.06z';
10536
- break;
10537
-
10538
- case 'hammer':
10539
- path = 'M17.7 6.32l1.41 1.42-3.47 3.41-1.42-1.42.84-.82c-.32-.76-.81-1.57-1.51-2.31l-4.61 6.59-5.26 4.7c-.39.39-1.02.39-1.42 0l-1.2-1.21c-.39-.39-.39-1.02 0-1.41l10.97-9.92c-1.37-.86-3.21-1.46-5.67-1.48 2.7-.82 4.95-.93 6.58-.3 1.7.66 2.82 2.2 3.91 3.58z';
10540
- break;
10541
-
10542
- case 'heading':
10543
- path = 'M12.5 4v5.2h-5V4H5v13h2.5v-5.2h5V17H15V4';
10544
- break;
10545
-
10546
- case 'heart':
10547
- path = 'M10 17.12c3.33-1.4 5.74-3.79 7.04-6.21 1.28-2.41 1.46-4.81.32-6.25-1.03-1.29-2.37-1.78-3.73-1.74s-2.68.63-3.63 1.46c-.95-.83-2.27-1.42-3.63-1.46s-2.7.45-3.73 1.74c-1.14 1.44-.96 3.84.34 6.25 1.28 2.42 3.69 4.81 7.02 6.21z';
10548
- break;
10549
-
10550
- case 'hidden':
10551
- path = 'M17.2 3.3l.16.17c.39.39.39 1.02 0 1.41L4.55 17.7c-.39.39-1.03.39-1.41 0l-.17-.17c-.39-.39-.39-1.02 0-1.41l1.59-1.6c-1.57-1-2.76-2.3-3.56-3.93.81-1.65 2.03-2.98 3.64-3.99S8.04 5.09 10 5.09c1.2 0 2.33.21 3.4.6l2.38-2.39c.39-.39 1.03-.39 1.42 0zm-7.09 4.01c-.23.25-.34.54-.34.88 0 .31.12.58.31.81l1.8-1.79c-.13-.12-.28-.21-.45-.26-.11-.01-.28-.03-.49-.04-.33.03-.6.16-.83.4zM2.4 10.59c.69 1.23 1.71 2.25 3.05 3.05l1.28-1.28c-.51-.69-.77-1.47-.77-2.36 0-1.06.36-1.98 1.09-2.76-1.04.27-1.96.7-2.76 1.26-.8.58-1.43 1.27-1.89 2.09zm13.22-2.13l.96-.96c1.02.86 1.83 1.89 2.42 3.09-.81 1.65-2.03 2.98-3.64 3.99s-3.4 1.51-5.36 1.51c-.63 0-1.24-.07-1.83-.18l1.07-1.07c.25.02.5.05.76.05 1.63 0 3.13-.4 4.5-1.21s2.4-1.84 3.1-3.09c-.46-.82-1.09-1.51-1.89-2.09-.03-.01-.06-.03-.09-.04zm-5.58 5.58l4-4c-.01 1.1-.41 2.04-1.18 2.81-.78.78-1.72 1.18-2.82 1.19z';
10552
- break;
10553
-
10554
- case 'html':
10555
- path = 'M4 16v-2H2v2H1v-5h1v2h2v-2h1v5H4zM7 16v-4H5.6v-1h3.7v1H8v4H7zM10 16v-5h1l1.4 3.4h.1L14 11h1v5h-1v-3.1h-.1l-1.1 2.5h-.6l-1.1-2.5H11V16h-1zM19 16h-3v-5h1v4h2v1zM9.4 4.2L7.1 6.5l2.3 2.3-.6 1.2-3.5-3.5L8.8 3l.6 1.2zm1.2 4.6l2.3-2.3-2.3-2.3.6-1.2 3.5 3.5-3.5 3.5-.6-1.2z';
10556
- break;
10557
-
10558
- case 'id-alt':
10559
- path = 'M18 18H2V2h16v16zM8.05 7.53c.13-.07.24-.15.33-.24.09-.1.17-.21.24-.34.07-.14.13-.26.17-.37s.07-.22.1-.34L8.95 6c0-.04.01-.07.01-.09.05-.32.03-.61-.04-.9-.08-.28-.23-.52-.46-.72C8.23 4.1 7.95 4 7.6 4c-.2 0-.39.04-.56.11-.17.08-.31.18-.41.3-.11.13-.2.27-.27.44-.07.16-.11.33-.12.51s0 .36.01.55l.02.09c.01.06.03.15.06.25s.06.21.1.33.1.25.17.37c.08.12.16.23.25.33s.2.19.34.25c.13.06.28.09.43.09s.3-.03.43-.09zM16 5V4h-5v1h5zm0 2V6h-5v1h5zM7.62 8.83l-1.38-.88c-.41 0-.79.11-1.14.32-.35.22-.62.5-.81.85-.19.34-.29.7-.29 1.07v1.25l.2.05c.13.04.31.09.55.14.24.06.51.12.8.17.29.06.62.1 1 .14.37.04.73.06 1.07.06s.69-.02 1.07-.06.7-.09.98-.14c.27-.05.54-.1.82-.17.27-.06.45-.11.54-.13.09-.03.16-.05.21-.06v-1.25c0-.36-.1-.72-.31-1.07s-.49-.64-.84-.86-.72-.33-1.11-.33zM16 9V8h-3v1h3zm0 2v-1h-3v1h3zm0 3v-1H4v1h12zm0 2v-1H4v1h12z';
10560
- break;
10561
-
10562
- case 'id':
10563
- path = 'M18 16H2V4h16v12zM7.05 8.53c.13-.07.24-.15.33-.24.09-.1.17-.21.24-.34.07-.14.13-.26.17-.37s.07-.22.1-.34L7.95 7c0-.04.01-.07.01-.09.05-.32.03-.61-.04-.9-.08-.28-.23-.52-.46-.72C7.23 5.1 6.95 5 6.6 5c-.2 0-.39.04-.56.11-.17.08-.31.18-.41.3-.11.13-.2.27-.27.44-.07.16-.11.33-.12.51s0 .36.01.55l.02.09c.01.06.03.15.06.25s.06.21.1.33.1.25.17.37c.08.12.16.23.25.33s.2.19.34.25c.13.06.28.09.43.09s.3-.03.43-.09zM17 9V5h-5v4h5zm-10.38.83l-1.38-.88c-.41 0-.79.11-1.14.32-.35.22-.62.5-.81.85-.19.34-.29.7-.29 1.07v1.25l.2.05c.13.04.31.09.55.14.24.06.51.12.8.17.29.06.62.1 1 .14.37.04.73.06 1.07.06s.69-.02 1.07-.06.7-.09.98-.14c.27-.05.54-.1.82-.17.27-.06.45-.11.54-.13.09-.03.16-.05.21-.06v-1.25c0-.36-.1-.72-.31-1.07s-.49-.64-.84-.86-.72-.33-1.11-.33zM17 11v-1h-5v1h5zm0 2v-1h-5v1h5zm0 2v-1H3v1h14z';
10564
- break;
10565
-
10566
- case 'image-crop':
10567
- path = 'M19 12v3h-4v4h-3v-4H4V7H0V4h4V0h3v4h7l3-3 1 1-3 3v7h4zm-8-5H7v4zm-3 5h4V8z';
10568
- break;
10569
-
10570
- case 'image-filter':
10571
- path = 'M14 5.87c0-2.2-1.79-4-4-4s-4 1.8-4 4c0 2.21 1.79 4 4 4s4-1.79 4-4zM3.24 10.66c-1.92 1.1-2.57 3.55-1.47 5.46 1.11 1.92 3.55 2.57 5.47 1.47 1.91-1.11 2.57-3.55 1.46-5.47-1.1-1.91-3.55-2.56-5.46-1.46zm9.52 6.93c1.92 1.1 4.36.45 5.47-1.46 1.1-1.92.45-4.36-1.47-5.47-1.91-1.1-4.36-.45-5.46 1.46-1.11 1.92-.45 4.36 1.46 5.47z';
10572
- break;
10573
-
10574
- case 'image-flip-horizontal':
10575
- path = 'M19 3v14h-8v3H9v-3H1V3h8V0h2v3h8zm-8.5 14V3h-1v14h1zM7 6.5L3 10l4 3.5v-7zM17 10l-4-3.5v7z';
10576
- break;
10577
-
10578
- case 'image-flip-vertical':
10579
- path = 'M20 9v2h-3v8H3v-8H0V9h3V1h14v8h3zM6.5 7h7L10 3zM17 9.5H3v1h14v-1zM13.5 13h-7l3.5 4z';
10580
- break;
10581
-
10582
- case 'image-rotate-left':
10583
- path = 'M7 5H5.05c0-1.74.85-2.9 2.95-2.9V0C4.85 0 2.96 2.11 2.96 5H1.18L3.8 8.39zm13-4v14h-5v5H1V10h9V1h10zm-2 2h-6v7h3v3h3V3zm-5 9H3v6h10v-6z';
10584
- break;
10585
-
10586
- case 'image-rotate-right':
10587
- path = 'M15.95 5H14l3.2 3.39L19.82 5h-1.78c0-2.89-1.89-5-5.04-5v2.1c2.1 0 2.95 1.16 2.95 2.9zM1 1h10v9h9v10H6v-5H1V1zm2 2v10h3v-3h3V3H3zm5 9v6h10v-6H8z';
10588
- break;
10589
-
10590
- case 'image-rotate':
10591
- path = 'M10.25 1.02c5.1 0 8.75 4.04 8.75 9s-3.65 9-8.75 9c-3.2 0-6.02-1.59-7.68-3.99l2.59-1.52c1.1 1.5 2.86 2.51 4.84 2.51 3.3 0 6-2.79 6-6s-2.7-6-6-6c-1.97 0-3.72 1-4.82 2.49L7 8.02l-6 2v-7L2.89 4.6c1.69-2.17 4.36-3.58 7.36-3.58z';
10592
- break;
10593
-
10594
- case 'images-alt':
10595
- path = 'M4 15v-3H2V2h12v3h2v3h2v10H6v-3H4zm7-12c-1.1 0-2 .9-2 2h4c0-1.1-.89-2-2-2zm-7 8V6H3v5h1zm7-3h4c0-1.1-.89-2-2-2-1.1 0-2 .9-2 2zm-5 6V9H5v5h1zm9-1c1.1 0 2-.89 2-2 0-1.1-.9-2-2-2s-2 .9-2 2c0 1.11.9 2 2 2zm2 4v-2c-5 0-5-3-10-3v5h10z';
10596
- break;
10597
-
10598
- case 'images-alt2':
10599
- path = 'M5 3h14v11h-2v2h-2v2H1V7h2V5h2V3zm13 10V4H6v9h12zm-3-4c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm1 6v-1H5V6H4v9h12zM7 6l10 6H7V6zm7 11v-1H3V8H2v9h12z';
10600
- break;
10601
-
10602
- case 'index-card':
10603
- path = 'M1 3.17V18h18V4H8v-.83c0-.32-.12-.6-.35-.83S7.14 2 6.82 2H2.18c-.33 0-.6.11-.83.34-.24.23-.35.51-.35.83zM10 6v2H3V6h7zm7 0v10h-5V6h5zm-7 4v2H3v-2h7zm0 4v2H3v-2h7z';
10604
- break;
10605
-
10606
- case 'info-outline':
10607
- path = 'M9 15h2V9H9v6zm1-10c-.5 0-1 .5-1 1s.5 1 1 1 1-.5 1-1-.5-1-1-1zm0-4c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7z';
10608
- break;
10609
-
10610
- case 'info':
10611
- path = 'M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1 4c0-.55-.45-1-1-1s-1 .45-1 1 .45 1 1 1 1-.45 1-1zm0 9V9H9v6h2z';
10612
- break;
10613
-
10614
- case 'insert-after':
10615
- path = 'M9 12h2v-2h2V8h-2V6H9v2H7v2h2v2zm1 4c3.9 0 7-3.1 7-7s-3.1-7-7-7-7 3.1-7 7 3.1 7 7 7zm0-12c2.8 0 5 2.2 5 5s-2.2 5-5 5-5-2.2-5-5 2.2-5 5-5zM3 19h14v-2H3v2z';
10616
- break;
10617
-
10618
- case 'insert-before':
10619
- path = 'M11 8H9v2H7v2h2v2h2v-2h2v-2h-2V8zm-1-4c-3.9 0-7 3.1-7 7s3.1 7 7 7 7-3.1 7-7-3.1-7-7-7zm0 12c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5-2.2 5-5 5zM3 1v2h14V1H3z';
10620
- break;
10621
-
10622
- case 'insert':
10623
- path = 'M10 1c-5 0-9 4-9 9s4 9 9 9 9-4 9-9-4-9-9-9zm0 16c-3.9 0-7-3.1-7-7s3.1-7 7-7 7 3.1 7 7-3.1 7-7 7zm1-11H9v3H6v2h3v3h2v-3h3V9h-3V6z';
10624
- break;
10625
-
10626
- case 'instagram':
10627
- path = 'M12.67 10A2.67 2.67 0 1 0 10 12.67 2.68 2.68 0 0 0 12.67 10zm1.43 0A4.1 4.1 0 1 1 10 5.9a4.09 4.09 0 0 1 4.1 4.1zm1.13-4.27a1 1 0 1 1-1-1 1 1 0 0 1 1 1zM10 3.44c-1.17 0-3.67-.1-4.72.32a2.67 2.67 0 0 0-1.52 1.52c-.42 1-.32 3.55-.32 4.72s-.1 3.67.32 4.72a2.74 2.74 0 0 0 1.52 1.52c1 .42 3.55.32 4.72.32s3.67.1 4.72-.32a2.83 2.83 0 0 0 1.52-1.52c.42-1.05.32-3.55.32-4.72s.1-3.67-.32-4.72a2.74 2.74 0 0 0-1.52-1.52c-1.05-.42-3.55-.32-4.72-.32zM18 10c0 1.1 0 2.2-.05 3.3a4.84 4.84 0 0 1-1.29 3.36A4.8 4.8 0 0 1 13.3 18H6.7a4.84 4.84 0 0 1-3.36-1.29 4.84 4.84 0 0 1-1.29-3.41C2 12.2 2 11.1 2 10V6.7a4.84 4.84 0 0 1 1.34-3.36A4.8 4.8 0 0 1 6.7 2.05C7.8 2 8.9 2 10 2h3.3a4.84 4.84 0 0 1 3.36 1.29A4.8 4.8 0 0 1 18 6.7V10z';
10628
- break;
10629
-
10630
- case 'laptop':
10631
- path = 'M3 3h14c.6 0 1 .4 1 1v10c0 .6-.4 1-1 1H3c-.6 0-1-.4-1-1V4c0-.6.4-1 1-1zm13 2H4v8h12V5zm-3 1H5v4zm6 11v-1H1v1c0 .6.5 1 1.1 1h15.8c.6 0 1.1-.4 1.1-1z';
10632
- break;
10633
-
10634
- case 'layout':
10635
- path = 'M2 2h5v11H2V2zm6 0h5v5H8V2zm6 0h4v16h-4V2zM8 8h5v5H8V8zm-6 6h11v4H2v-4z';
10636
- break;
10637
-
10638
- case 'leftright':
10639
- path = 'M3 10.03L9 6v8zM11 6l6 4.03L11 14V6z';
10640
- break;
10641
-
10642
- case 'lightbulb':
10643
- path = 'M10 1c3.11 0 5.63 2.52 5.63 5.62 0 1.84-2.03 4.58-2.03 4.58-.33.44-.6 1.25-.6 1.8v1c0 .55-.45 1-1 1H8c-.55 0-1-.45-1-1v-1c0-.55-.27-1.36-.6-1.8 0 0-2.02-2.74-2.02-4.58C4.38 3.52 6.89 1 10 1zM7 16.87V16h6v.87c0 .62-.13 1.13-.75 1.13H12c0 .62-.4 1-1.02 1h-2c-.61 0-.98-.38-.98-1h-.25c-.62 0-.75-.51-.75-1.13z';
10644
- break;
10645
-
10646
- case 'list-view':
10647
- path = 'M2 19h16c.55 0 1-.45 1-1V2c0-.55-.45-1-1-1H2c-.55 0-1 .45-1 1v16c0 .55.45 1 1 1zM4 3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v2H6V3h11zM4 7c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v2H6V7h11zM4 11c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v2H6v-2h11zM4 15c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm13 0v2H6v-2h11z';
10648
- break;
10649
-
10650
- case 'location-alt':
10651
- path = 'M13 13.14l1.17-5.94c.79-.43 1.33-1.25 1.33-2.2 0-1.38-1.12-2.5-2.5-2.5S10.5 3.62 10.5 5c0 .95.54 1.77 1.33 2.2zm0-9.64c.83 0 1.5.67 1.5 1.5s-.67 1.5-1.5 1.5-1.5-.67-1.5-1.5.67-1.5 1.5-1.5zm1.72 4.8L18 6.97v9L13.12 18 7 15.97l-5 2v-9l5-2 4.27 1.41 1.73 7.3z';
10652
- break;
10653
-
10654
- case 'location':
10655
- path = 'M10 2C6.69 2 4 4.69 4 8c0 2.02 1.17 3.71 2.53 4.89.43.37 1.18.96 1.85 1.83.74.97 1.41 2.01 1.62 2.71.21-.7.88-1.74 1.62-2.71.67-.87 1.42-1.46 1.85-1.83C14.83 11.71 16 10.02 16 8c0-3.31-2.69-6-6-6zm0 2.56c1.9 0 3.44 1.54 3.44 3.44S11.9 11.44 10 11.44 6.56 9.9 6.56 8 8.1 4.56 10 4.56z';
10656
- break;
10657
-
10658
- case 'lock':
10659
- path = 'M14 9h1c.55 0 1 .45 1 1v7c0 .55-.45 1-1 1H5c-.55 0-1-.45-1-1v-7c0-.55.45-1 1-1h1V6c0-2.21 1.79-4 4-4s4 1.79 4 4v3zm-2 0V6c0-1.1-.9-2-2-2s-2 .9-2 2v3h4zm-1 7l-.36-2.15c.51-.24.86-.75.86-1.35 0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5c0 .6.35 1.11.86 1.35L9 16h2z';
10660
- break;
10661
-
10662
- case 'marker':
10663
- path = 'M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm0 13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5z';
10664
- break;
10665
-
10666
- case 'media-archive':
10667
- path = 'M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3zM8 3.5v2l1.8-1zM11 5L9.2 6 11 7V5zM8 6.5v2l1.8-1zM11 8L9.2 9l1.8 1V8zM8 9.5v2l1.8-1zm3 1.5l-1.8 1 1.8 1v-2zm-1.5 6c.83 0 1.62-.72 1.5-1.63-.05-.38-.49-1.61-.49-1.61l-1.99-1.1s-.45 1.95-.52 2.71c-.07.77.67 1.63 1.5 1.63zm0-2.39c.42 0 .76.34.76.76 0 .43-.34.77-.76.77s-.76-.34-.76-.77c0-.42.34-.76.76-.76z';
10668
- break;
10669
-
10670
- case 'media-audio':
10671
- path = 'M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3zm1 7.26V8.09c0-.11-.04-.21-.12-.29-.07-.08-.16-.11-.27-.1 0 0-3.97.71-4.25.78C8.07 8.54 8 8.8 8 9v3.37c-.2-.09-.42-.07-.6-.07-.38 0-.7.13-.96.39-.26.27-.4.58-.4.96 0 .37.14.69.4.95.26.27.58.4.96.4.34 0 .7-.04.96-.26.26-.23.64-.65.64-1.12V10.3l3-.6V12c-.67-.2-1.17.04-1.44.31-.26.26-.39.58-.39.95 0 .38.13.69.39.96.27.26.71.39 1.08.39.38 0 .7-.13.96-.39.26-.27.4-.58.4-.96z';
10672
- break;
10673
-
10674
- case 'media-code':
10675
- path = 'M12 2l4 4v12H4V2h8zM9 13l-2-2 2-2-1-1-3 3 3 3zm3 1l3-3-3-3-1 1 2 2-2 2z';
10676
- break;
10677
-
10678
- case 'media-default':
10679
- path = 'M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3z';
10680
- break;
10681
-
10682
- case 'media-document':
10683
- path = 'M12 2l4 4v12H4V2h8zM5 3v1h6V3H5zm7 3h3l-3-3v3zM5 5v1h6V5H5zm10 3V7H5v1h10zM5 9v1h4V9H5zm10 3V9h-5v3h5zM5 11v1h4v-1H5zm10 3v-1H5v1h10zm-3 2v-1H5v1h7z';
10684
- break;
10685
-
10686
- case 'media-interactive':
10687
- path = 'M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3zm2 8V8H6v6h3l-1 2h1l1-2 1 2h1l-1-2h3zm-6-3c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm5-2v2h-3V9h3zm0 3v1H7v-1h6z';
10688
- break;
10689
-
10690
- case 'media-spreadsheet':
10691
- path = 'M12 2l4 4v12H4V2h8zm-1 4V3H5v3h6zM8 8V7H5v1h3zm3 0V7H9v1h2zm4 0V7h-3v1h3zm-7 2V9H5v1h3zm3 0V9H9v1h2zm4 0V9h-3v1h3zm-7 2v-1H5v1h3zm3 0v-1H9v1h2zm4 0v-1h-3v1h3zm-7 2v-1H5v1h3zm3 0v-1H9v1h2zm4 0v-1h-3v1h3zm-7 2v-1H5v1h3zm3 0v-1H9v1h2z';
10692
- break;
10693
-
10694
- case 'media-text':
10695
- path = 'M12 2l4 4v12H4V2h8zM5 3v1h6V3H5zm7 3h3l-3-3v3zM5 5v1h6V5H5zm10 3V7H5v1h10zm0 2V9H5v1h10zm0 2v-1H5v1h10zm-4 2v-1H5v1h6z';
10696
- break;
10697
-
10698
- case 'media-video':
10699
- path = 'M12 2l4 4v12H4V2h8zm0 4h3l-3-3v3zm-1 8v-3c0-.27-.1-.51-.29-.71-.2-.19-.44-.29-.71-.29H7c-.27 0-.51.1-.71.29-.19.2-.29.44-.29.71v3c0 .27.1.51.29.71.2.19.44.29.71.29h3c.27 0 .51-.1.71-.29.19-.2.29-.44.29-.71zm3 1v-5l-2 2v1z';
10700
- break;
10701
-
10702
- case 'megaphone':
10703
- path = 'M18.15 5.94c.46 1.62.38 3.22-.02 4.48-.42 1.28-1.26 2.18-2.3 2.48-.16.06-.26.06-.4.06-.06.02-.12.02-.18.02-.06.02-.14.02-.22.02h-6.8l2.22 5.5c.02.14-.06.26-.14.34-.08.1-.24.16-.34.16H6.95c-.1 0-.26-.06-.34-.16-.08-.08-.16-.2-.14-.34l-1-5.5H4.25l-.02-.02c-.5.06-1.08-.18-1.54-.62s-.88-1.08-1.06-1.88c-.24-.8-.2-1.56-.02-2.2.18-.62.58-1.08 1.06-1.3l.02-.02 9-5.4c.1-.06.18-.1.24-.16.06-.04.14-.08.24-.12.16-.08.28-.12.5-.18 1.04-.3 2.24.1 3.22.98s1.84 2.24 2.26 3.86zm-2.58 5.98h-.02c.4-.1.74-.34 1.04-.7.58-.7.86-1.76.86-3.04 0-.64-.1-1.3-.28-1.98-.34-1.36-1.02-2.5-1.78-3.24s-1.68-1.1-2.46-.88c-.82.22-1.4.96-1.7 2-.32 1.04-.28 2.36.06 3.72.38 1.36 1 2.5 1.8 3.24.78.74 1.62 1.1 2.48.88zm-2.54-7.08c.22-.04.42-.02.62.04.38.16.76.48 1.02 1s.42 1.2.42 1.78c0 .3-.04.56-.12.8-.18.48-.44.84-.86.94-.34.1-.8-.06-1.14-.4s-.64-.86-.78-1.5c-.18-.62-.12-1.24.02-1.72s.48-.84.82-.94z';
10704
- break;
10705
-
10706
- case 'menu-alt':
10707
- path = 'M3 4h14v2H3V4zm0 5h14v2H3V9zm0 5h14v2H3v-2z';
10708
- break;
10709
-
10710
- case 'menu':
10711
- path = 'M17 7V5H3v2h14zm0 4V9H3v2h14zm0 4v-2H3v2h14z';
10712
- break;
10713
-
10714
- case 'microphone':
10715
- path = 'M12 9V3c0-1.1-.89-2-2-2-1.12 0-2 .94-2 2v6c0 1.1.9 2 2 2 1.13 0 2-.94 2-2zm4 0c0 2.97-2.16 5.43-5 5.91V17h2c.56 0 1 .45 1 1s-.44 1-1 1H7c-.55 0-1-.45-1-1s.45-1 1-1h2v-2.09C6.17 14.43 4 11.97 4 9c0-.55.45-1 1-1 .56 0 1 .45 1 1 0 2.21 1.8 4 4 4 2.21 0 4-1.79 4-4 0-.55.45-1 1-1 .56 0 1 .45 1 1z';
10716
- break;
10717
-
10718
- case 'migrate':
10719
- path = 'M4 6h6V4H2v12.01h8V14H4V6zm2 2h6V5l6 5-6 5v-3H6V8z';
10720
- break;
10721
-
10722
- case 'minus':
10723
- path = 'M4 9h12v2H4V9z';
10724
- break;
10725
-
10726
- case 'money':
10727
- path = 'M0 3h20v12h-.75c0-1.79-1.46-3.25-3.25-3.25-1.31 0-2.42.79-2.94 1.91-.25-.1-.52-.16-.81-.16-.98 0-1.8.63-2.11 1.5H0V3zm8.37 3.11c-.06.15-.1.31-.11.47s-.01.33.01.5l.02.08c.01.06.02.14.05.23.02.1.06.2.1.31.03.11.09.22.15.33.07.12.15.22.23.31s.18.17.31.23c.12.06.25.09.4.09.14 0 .27-.03.39-.09s.22-.14.3-.22c.09-.09.16-.2.22-.32.07-.12.12-.23.16-.33s.07-.2.09-.31c.03-.11.04-.18.05-.22s.01-.07.01-.09c.05-.29.03-.56-.04-.82s-.21-.48-.41-.66c-.21-.18-.47-.27-.79-.27-.19 0-.36.03-.52.1-.15.07-.28.16-.38.28-.09.11-.17.25-.24.4zm4.48 6.04v-1.14c0-.33-.1-.66-.29-.98s-.45-.59-.77-.79c-.32-.21-.66-.31-1.02-.31l-1.24.84-1.28-.82c-.37 0-.72.1-1.04.3-.31.2-.56.46-.74.77-.18.32-.27.65-.27.99v1.14l.18.05c.12.04.29.08.51.14.23.05.47.1.74.15.26.05.57.09.91.13.34.03.67.05.99.05.3 0 .63-.02.98-.05.34-.04.64-.08.89-.13.25-.04.5-.1.76-.16l.5-.12c.08-.02.14-.04.19-.06zm3.15.1c1.52 0 2.75 1.23 2.75 2.75s-1.23 2.75-2.75 2.75c-.73 0-1.38-.3-1.87-.77.23-.35.37-.78.37-1.23 0-.77-.39-1.46-.99-1.86.43-.96 1.37-1.64 2.49-1.64zm-5.5 3.5c0-.96.79-1.75 1.75-1.75s1.75.79 1.75 1.75-.79 1.75-1.75 1.75-1.75-.79-1.75-1.75z';
10728
- break;
10729
-
10730
- case 'move':
10731
- path = 'M19 10l-4 4v-3h-4v4h3l-4 4-4-4h3v-4H5v3l-4-4 4-4v3h4V5H6l4-4 4 4h-3v4h4V6z';
10732
- break;
10733
-
10734
- case 'nametag':
10735
- path = 'M12 5V2c0-.55-.45-1-1-1H9c-.55 0-1 .45-1 1v3c0 .55.45 1 1 1h2c.55 0 1-.45 1-1zm-2-3c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm8 13V7c0-1.1-.9-2-2-2h-3v.33C13 6.25 12.25 7 11.33 7H8.67C7.75 7 7 6.25 7 5.33V5H4c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-1-6v6H3V9h14zm-8 2c0-.55-.22-1-.5-1s-.5.45-.5 1 .22 1 .5 1 .5-.45.5-1zm3 0c0-.55-.22-1-.5-1s-.5.45-.5 1 .22 1 .5 1 .5-.45.5-1zm-5.96 1.21c.92.48 2.34.79 3.96.79s3.04-.31 3.96-.79c-.21 1-1.89 1.79-3.96 1.79s-3.75-.79-3.96-1.79z';
10736
- break;
10737
-
10738
- case 'networking':
10739
- path = 'M18 13h1c.55 0 1 .45 1 1.01v2.98c0 .56-.45 1.01-1 1.01h-4c-.55 0-1-.45-1-1.01v-2.98c0-.56.45-1.01 1-1.01h1v-2h-5v2h1c.55 0 1 .45 1 1.01v2.98c0 .56-.45 1.01-1 1.01H8c-.55 0-1-.45-1-1.01v-2.98c0-.56.45-1.01 1-1.01h1v-2H4v2h1c.55 0 1 .45 1 1.01v2.98C6 17.55 5.55 18 5 18H1c-.55 0-1-.45-1-1.01v-2.98C0 13.45.45 13 1 13h1v-2c0-1.1.9-2 2-2h5V7H8c-.55 0-1-.45-1-1.01V3.01C7 2.45 7.45 2 8 2h4c.55 0 1 .45 1 1.01v2.98C13 6.55 12.55 7 12 7h-1v2h5c1.1 0 2 .9 2 2v2z';
10740
- break;
10741
-
10742
- case 'no-alt':
10743
- path = 'M14.95 6.46L11.41 10l3.54 3.54-1.41 1.41L10 11.42l-3.53 3.53-1.42-1.42L8.58 10 5.05 6.47l1.42-1.42L10 8.58l3.54-3.53z';
10744
- break;
10745
-
10746
- case 'no':
10747
- path = 'M12.12 10l3.53 3.53-2.12 2.12L10 12.12l-3.54 3.54-2.12-2.12L7.88 10 4.34 6.46l2.12-2.12L10 7.88l3.54-3.53 2.12 2.12z';
10748
- break;
10749
-
10750
- case 'palmtree':
10751
- path = 'M8.58 2.39c.32 0 .59.05.81.14 1.25.55 1.69 2.24 1.7 3.97.59-.82 2.15-2.29 3.41-2.29s2.94.73 3.53 3.55c-1.13-.65-2.42-.94-3.65-.94-1.26 0-2.45.32-3.29.89.4-.11.86-.16 1.33-.16 1.39 0 2.9.45 3.4 1.31.68 1.16.47 3.38-.76 4.14-.14-2.1-1.69-4.12-3.47-4.12-.44 0-.88.12-1.33.38C8 10.62 7 14.56 7 19H2c0-5.53 4.21-9.65 7.68-10.79-.56-.09-1.17-.15-1.82-.15C6.1 8.06 4.05 8.5 2 10c.76-2.96 2.78-4.1 4.69-4.1 1.25 0 2.45.5 3.2 1.29-.66-2.24-2.49-2.86-4.08-2.86-.8 0-1.55.16-2.05.35.91-1.29 3.31-2.29 4.82-2.29zM13 11.5c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5.67 1.5 1.5 1.5 1.5-.67 1.5-1.5z';
10752
- break;
10753
-
10754
- case 'paperclip':
10755
- path = 'M17.05 2.7c1.93 1.94 1.93 5.13 0 7.07L10 16.84c-1.88 1.89-4.91 1.93-6.86.15-.06-.05-.13-.09-.19-.15-1.93-1.94-1.93-5.12 0-7.07l4.94-4.95c.91-.92 2.28-1.1 3.39-.58.3.15.59.33.83.58 1.17 1.17 1.17 3.07 0 4.24l-4.93 4.95c-.39.39-1.02.39-1.41 0s-.39-1.02 0-1.41l4.93-4.95c.39-.39.39-1.02 0-1.41-.38-.39-1.02-.39-1.4 0l-4.94 4.95c-.91.92-1.1 2.29-.57 3.4.14.3.32.59.57.84s.54.43.84.57c1.11.53 2.47.35 3.39-.57l7.05-7.07c1.16-1.17 1.16-3.08 0-4.25-.56-.55-1.28-.83-2-.86-.08.01-.16.01-.24 0-.22-.03-.43-.11-.6-.27-.39-.4-.38-1.05.02-1.45.16-.16.36-.24.56-.28.14-.02.27-.01.4.02 1.19.06 2.36.52 3.27 1.43z';
10756
- break;
10757
-
10758
- case 'performance':
10759
- path = 'M3.76 17.01h12.48C17.34 15.63 18 13.9 18 12c0-4.41-3.58-8-8-8s-8 3.59-8 8c0 1.9.66 3.63 1.76 5.01zM9 6c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1zM4 8c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1zm4.52 3.4c.84-.83 6.51-3.5 6.51-3.5s-2.66 5.68-3.49 6.51c-.84.84-2.18.84-3.02 0-.83-.83-.83-2.18 0-3.01zM3 13c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1zm6 0c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1zm6 0c0-.55.45-1 1-1s1 .45 1 1c0 .56-.45 1-1 1s-1-.44-1-1z';
10760
- break;
10761
-
10762
- case 'phone':
10763
- path = 'M12.06 6l-.21-.2c-.52-.54-.43-.79.08-1.3l2.72-2.75c.81-.82.96-1.21 1.73-.48l.21.2zm.53.45l4.4-4.4c.7.94 2.34 3.47 1.53 5.34-.73 1.67-1.09 1.75-2 3-1.85 2.11-4.18 4.37-6 6.07-1.26.91-1.31 1.33-3 2-1.8.71-4.4-.89-5.38-1.56l4.4-4.4 1.18 1.62c.34.46 1.2-.06 1.8-.66 1.04-1.05 3.18-3.18 4-4.07.59-.59 1.12-1.45.66-1.8zM1.57 16.5l-.21-.21c-.68-.74-.29-.9.52-1.7l2.74-2.72c.51-.49.75-.6 1.27-.11l.2.21z';
10764
- break;
10765
-
10766
- case 'playlist-audio':
10767
- path = 'M17 3V1H2v2h15zm0 4V5H2v2h15zm-7 4V9H2v2h8zm7.45-1.96l-6 1.12c-.16.02-.19.03-.29.13-.11.09-.16.22-.16.37v4.59c-.29-.13-.66-.14-.93-.14-.54 0-1 .19-1.38.57s-.56.84-.56 1.38c0 .53.18.99.56 1.37s.84.57 1.38.57c.49 0 .92-.16 1.29-.48s.59-.71.65-1.19v-4.95L17 11.27v3.48c-.29-.13-.56-.19-.83-.19-.54 0-1.11.19-1.49.57-.38.37-.57.83-.57 1.37s.19.99.57 1.37.84.57 1.38.57c.53 0 .99-.19 1.37-.57s.57-.83.57-1.37V9.6c0-.16-.05-.3-.16-.41-.11-.12-.24-.17-.39-.15zM8 15v-2H2v2h6zm-2 4v-2H2v2h4z';
10768
- break;
10769
-
10770
- case 'playlist-video':
10771
- path = 'M17 3V1H2v2h15zm0 4V5H2v2h15zM6 11V9H2v2h4zm2-2h9c.55 0 1 .45 1 1v8c0 .55-.45 1-1 1H8c-.55 0-1-.45-1-1v-8c0-.55.45-1 1-1zm3 7l3.33-2L11 12v4zm-5-1v-2H2v2h4zm0 4v-2H2v2h4z';
10772
- break;
10773
-
10774
- case 'plus-alt':
10775
- path = 'M15.8 4.2c3.2 3.21 3.2 8.39 0 11.6-3.21 3.2-8.39 3.2-11.6 0C1 12.59 1 7.41 4.2 4.2 7.41 1 12.59 1 15.8 4.2zm-4.3 11.3v-4h4v-3h-4v-4h-3v4h-4v3h4v4h3z';
10776
- break;
10777
-
10778
- case 'plus-light':
10779
- path = 'M17 9v2h-6v6H9v-6H3V9h6V3h2v6h6z';
10780
- break;
10781
-
10782
- case 'plus':
10783
- path = 'M17 7v3h-5v5H9v-5H4V7h5V2h3v5h5z';
10784
- break;
10785
-
10786
- case 'portfolio':
10787
- path = 'M4 5H.78c-.37 0-.74.32-.69.84l1.56 9.99S3.5 8.47 3.86 6.7c.11-.53.61-.7.98-.7H10s-.7-2.08-.77-2.31C9.11 3.25 8.89 3 8.45 3H5.14c-.36 0-.7.23-.8.64C4.25 4.04 4 5 4 5zm4.88 0h-4s.42-1 .87-1h2.13c.48 0 1 1 1 1zM2.67 16.25c-.31.47-.76.75-1.26.75h15.73c.54 0 .92-.31 1.03-.83.44-2.19 1.68-8.44 1.68-8.44.07-.5-.3-.73-.62-.73H16V5.53c0-.16-.26-.53-.66-.53h-3.76c-.52 0-.87.58-.87.58L10 7H5.59c-.32 0-.63.19-.69.5 0 0-1.59 6.7-1.72 7.33-.07.37-.22.99-.51 1.42zM15.38 7H11s.58-1 1.13-1h2.29c.71 0 .96 1 .96 1z';
10788
- break;
10789
-
10790
- case 'post-status':
10791
- path = 'M14 6c0 1.86-1.28 3.41-3 3.86V16c0 1-2 2-2 2V9.86c-1.72-.45-3-2-3-3.86 0-2.21 1.79-4 4-4s4 1.79 4 4zM8 5c0 .55.45 1 1 1s1-.45 1-1-.45-1-1-1-1 .45-1 1z';
10792
- break;
10793
-
10794
- case 'pressthis':
10795
- path = 'M14.76 1C16.55 1 18 2.46 18 4.25c0 1.78-1.45 3.24-3.24 3.24-.23 0-.47-.03-.7-.08L13 8.47V19H2V4h9.54c.13-2 1.52-3 3.22-3zm0 5.49C16 6.49 17 5.48 17 4.25 17 3.01 16 2 14.76 2s-2.24 1.01-2.24 2.25c0 .37.1.72.27 1.03L9.57 8.5c-.28.28-1.77 2.22-1.5 2.49.02.03.06.04.1.04.49 0 2.14-1.28 2.39-1.53l3.24-3.24c.29.14.61.23.96.23z';
10796
- break;
10797
-
10798
- case 'products':
10799
- path = 'M17 8h1v11H2V8h1V6c0-2.76 2.24-5 5-5 .71 0 1.39.15 2 .42.61-.27 1.29-.42 2-.42 2.76 0 5 2.24 5 5v2zM5 6v2h2V6c0-1.13.39-2.16 1.02-3H8C6.35 3 5 4.35 5 6zm10 2V6c0-1.65-1.35-3-3-3h-.02c.63.84 1.02 1.87 1.02 3v2h2zm-5-4.22C9.39 4.33 9 5.12 9 6v2h2V6c0-.88-.39-1.67-1-2.22z';
10800
- break;
10801
-
10802
- case 'randomize':
10803
- path = 'M18 6.01L14 9V7h-4l-5 8H2v-2h2l5-8h5V3zM2 5h3l1.15 2.17-1.12 1.8L4 7H2V5zm16 9.01L14 17v-2H9l-1.15-2.17 1.12-1.8L10 13h4v-2z';
10804
- break;
10805
-
10806
- case 'redo':
10807
- path = 'M8 5h5V2l6 4-6 4V7H8c-2.2 0-4 1.8-4 4s1.8 4 4 4h5v2H8c-3.3 0-6-2.7-6-6s2.7-6 6-6z';
10808
- break;
10809
-
10810
- case 'rest-api':
10811
- path = 'M3 4h2v12H3z';
10812
- break;
10813
-
10814
- case 'rss':
10815
- path = 'M14.92 18H18C18 9.32 10.82 2.25 2 2.25v3.02c7.12 0 12.92 5.71 12.92 12.73zm-5.44 0h3.08C12.56 12.27 7.82 7.6 2 7.6v3.02c2 0 3.87.77 5.29 2.16C8.7 14.17 9.48 16.03 9.48 18zm-5.35-.02c1.17 0 2.13-.93 2.13-2.09 0-1.15-.96-2.09-2.13-2.09-1.18 0-2.13.94-2.13 2.09 0 1.16.95 2.09 2.13 2.09z';
10816
- break;
10817
-
10818
- case 'saved':
10819
- path = 'M15.3 5.3l-6.8 6.8-2.8-2.8-1.4 1.4 4.2 4.2 8.2-8.2';
10820
- break;
10821
-
10822
- case 'schedule':
10823
- path = 'M2 2h16v4H2V2zm0 10V8h4v4H2zm6-2V8h4v2H8zm6 3V8h4v5h-4zm-6 5v-6h4v6H8zm-6 0v-4h4v4H2zm12 0v-3h4v3h-4z';
10824
- break;
10825
-
10826
- case 'screenoptions':
10827
- path = 'M9 9V3H3v6h6zm8 0V3h-6v6h6zm-8 8v-6H3v6h6zm8 0v-6h-6v6h6z';
10828
- break;
10829
-
10830
- case 'search':
10831
- path = 'M12.14 4.18c1.87 1.87 2.11 4.75.72 6.89.12.1.22.21.36.31.2.16.47.36.81.59.34.24.56.39.66.47.42.31.73.57.94.78.32.32.6.65.84 1 .25.35.44.69.59 1.04.14.35.21.68.18 1-.02.32-.14.59-.36.81s-.49.34-.81.36c-.31.02-.65-.04-.99-.19-.35-.14-.7-.34-1.04-.59-.35-.24-.68-.52-1-.84-.21-.21-.47-.52-.77-.93-.1-.13-.25-.35-.47-.66-.22-.32-.4-.57-.56-.78-.16-.2-.29-.35-.44-.5-2.07 1.09-4.69.76-6.44-.98-2.14-2.15-2.14-5.64 0-7.78 2.15-2.15 5.63-2.15 7.78 0zm-1.41 6.36c1.36-1.37 1.36-3.58 0-4.95-1.37-1.37-3.59-1.37-4.95 0-1.37 1.37-1.37 3.58 0 4.95 1.36 1.37 3.58 1.37 4.95 0z';
10832
- break;
10833
-
10834
- case 'share-alt':
10835
- path = 'M16.22 5.8c.47.69.29 1.62-.4 2.08-.69.47-1.62.29-2.08-.4-.16-.24-.35-.46-.55-.67-.21-.2-.43-.39-.67-.55s-.5-.3-.77-.41c-.27-.12-.55-.21-.84-.26-.59-.13-1.23-.13-1.82-.01-.29.06-.57.15-.84.27-.27.11-.53.25-.77.41s-.46.35-.66.55c-.21.21-.4.43-.56.67s-.3.5-.41.76c-.01.02-.01.03-.01.04-.1.24-.17.48-.23.72H1V6h2.66c.04-.07.07-.13.12-.2.27-.4.57-.77.91-1.11s.72-.65 1.11-.91c.4-.27.83-.51 1.28-.7s.93-.34 1.41-.43c.99-.21 2.03-.21 3.02 0 .48.09.96.24 1.41.43s.88.43 1.28.7c.39.26.77.57 1.11.91s.64.71.91 1.11zM12.5 10c0-1.38-1.12-2.5-2.5-2.5S7.5 8.62 7.5 10s1.12 2.5 2.5 2.5 2.5-1.12 2.5-2.5zm-8.72 4.2c-.47-.69-.29-1.62.4-2.09.69-.46 1.62-.28 2.08.41.16.24.35.46.55.67.21.2.43.39.67.55s.5.3.77.41c.27.12.55.2.84.26.59.13 1.23.12 1.82 0 .29-.06.57-.14.84-.26.27-.11.53-.25.77-.41s.46-.35.66-.55c.21-.21.4-.44.56-.67.16-.25.3-.5.41-.76.01-.02.01-.03.01-.04.1-.24.17-.48.23-.72H19v3h-2.66c-.04.06-.07.13-.12.2-.27.4-.57.77-.91 1.11s-.72.65-1.11.91c-.4.27-.83.51-1.28.7s-.93.33-1.41.43c-.99.21-2.03.21-3.02 0-.48-.1-.96-.24-1.41-.43s-.88-.43-1.28-.7c-.39-.26-.77-.57-1.11-.91s-.64-.71-.91-1.11z';
10836
- break;
10837
-
10838
- case 'share-alt2':
10839
- path = 'M18 8l-5 4V9.01c-2.58.06-4.88.45-7 2.99.29-3.57 2.66-5.66 7-5.94V3zM4 14h11v-2l2-1.6V16H2V5h9.43c-1.83.32-3.31 1-4.41 2H4v7z';
10840
- break;
10841
-
10842
- case 'share':
10843
- path = 'M14.5 12c1.66 0 3 1.34 3 3s-1.34 3-3 3-3-1.34-3-3c0-.24.03-.46.09-.69l-4.38-2.3c-.55.61-1.33.99-2.21.99-1.66 0-3-1.34-3-3s1.34-3 3-3c.88 0 1.66.39 2.21.99l4.38-2.3c-.06-.23-.09-.45-.09-.69 0-1.66 1.34-3 3-3s3 1.34 3 3-1.34 3-3 3c-.88 0-1.66-.39-2.21-.99l-4.38 2.3c.06.23.09.45.09.69s-.03.46-.09.69l4.38 2.3c.55-.61 1.33-.99 2.21-.99z';
10844
- break;
10845
-
10846
- case 'shield-alt':
10847
- path = 'M10 2s3 2 7 2c0 11-7 14-7 14S3 15 3 4c4 0 7-2 7-2z';
10848
- break;
10849
-
10850
- case 'shield':
10851
- path = 'M10 2s3 2 7 2c0 11-7 14-7 14S3 15 3 4c4 0 7-2 7-2zm0 8h5s1-1 1-5c0 0-5-1-6-2v7H5c1 4 5 7 5 7v-7z';
10852
- break;
10853
-
10854
- case 'shortcode':
10855
- path = 'M6 14H4V6h2V4H2v12h4M7.1 17h2.1l3.7-14h-2.1M14 4v2h2v8h-2v2h4V4';
10856
- break;
10857
-
10858
- case 'slides':
10859
- path = 'M5 14V6h10v8H5zm-3-1V7h2v6H2zm4-6v6h8V7H6zm10 0h2v6h-2V7zm-3 2V8H7v1h6zm0 3v-2H7v2h6z';
10860
- break;
10861
-
10862
- case 'smartphone':
10863
- path = 'M6 2h8c.55 0 1 .45 1 1v14c0 .55-.45 1-1 1H6c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm7 12V4H7v10h6zM8 5h4l-4 5V5z';
10864
- break;
10865
-
10866
- case 'smiley':
10867
- path = 'M7 5.2c1.1 0 2 .89 2 2 0 .37-.11.71-.28 1C8.72 8.2 8 8 7 8s-1.72.2-1.72.2c-.17-.29-.28-.63-.28-1 0-1.11.9-2 2-2zm6 0c1.11 0 2 .89 2 2 0 .37-.11.71-.28 1 0 0-.72-.2-1.72-.2s-1.72.2-1.72.2c-.17-.29-.28-.63-.28-1 0-1.11.89-2 2-2zm-3 13.7c3.72 0 7.03-2.36 8.23-5.88l-1.32-.46C15.9 15.52 13.12 17.5 10 17.5s-5.9-1.98-6.91-4.94l-1.32.46c1.2 3.52 4.51 5.88 8.23 5.88z';
10868
- break;
10869
-
10870
- case 'sort':
10871
- path = 'M11 7H1l5 7zm-2 7h10l-5-7z';
10872
- break;
10873
-
10874
- case 'sos':
10875
- path = 'M18 10c0-4.42-3.58-8-8-8s-8 3.58-8 8 3.58 8 8 8 8-3.58 8-8zM7.23 3.57L8.72 7.3c-.62.29-1.13.8-1.42 1.42L3.57 7.23c.71-1.64 2.02-2.95 3.66-3.66zm9.2 3.66L12.7 8.72c-.29-.62-.8-1.13-1.42-1.42l1.49-3.73c1.64.71 2.95 2.02 3.66 3.66zM10 12c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2zm-6.43.77l3.73-1.49c.29.62.8 1.13 1.42 1.42l-1.49 3.73c-1.64-.71-2.95-2.02-3.66-3.66zm9.2 3.66l-1.49-3.73c.62-.29 1.13-.8 1.42-1.42l3.73 1.49c-.71 1.64-2.02 2.95-3.66 3.66z';
10876
- break;
10877
-
10878
- case 'star-empty':
10879
- path = 'M10 1L7 7l-6 .75 4.13 4.62L4 19l6-3 6 3-1.12-6.63L19 7.75 13 7zm0 2.24l2.34 4.69 4.65.58-3.18 3.56.87 5.15L10 14.88l-4.68 2.34.87-5.15-3.18-3.56 4.65-.58z';
10880
- break;
10881
-
10882
- case 'star-filled':
10883
- path = 'M10 1l3 6 6 .75-4.12 4.62L16 19l-6-3-6 3 1.13-6.63L1 7.75 7 7z';
10884
- break;
10885
-
10886
- case 'star-half':
10887
- path = 'M10 1L7 7l-6 .75 4.13 4.62L4 19l6-3 6 3-1.12-6.63L19 7.75 13 7zm0 2.24l2.34 4.69 4.65.58-3.18 3.56.87 5.15L10 14.88V3.24z';
10888
- break;
10889
-
10890
- case 'sticky':
10891
- path = 'M5 3.61V1.04l8.99-.01-.01 2.58c-1.22.26-2.16 1.35-2.16 2.67v.5c.01 1.31.93 2.4 2.17 2.66l-.01 2.58h-3.41l-.01 2.57c0 .6-.47 4.41-1.06 4.41-.6 0-1.08-3.81-1.08-4.41v-2.56L5 12.02l.01-2.58c1.23-.25 2.15-1.35 2.15-2.66v-.5c0-1.31-.92-2.41-2.16-2.67z';
10892
- break;
10893
-
10894
- case 'store':
10895
- path = 'M1 10c.41.29.96.43 1.5.43.55 0 1.09-.14 1.5-.43.62-.46 1-1.17 1-2 0 .83.37 1.54 1 2 .41.29.96.43 1.5.43.55 0 1.09-.14 1.5-.43.62-.46 1-1.17 1-2 0 .83.37 1.54 1 2 .41.29.96.43 1.51.43.54 0 1.08-.14 1.49-.43.62-.46 1-1.17 1-2 0 .83.37 1.54 1 2 .41.29.96.43 1.5.43.55 0 1.09-.14 1.5-.43.63-.46 1-1.17 1-2V7l-3-7H4L0 7v1c0 .83.37 1.54 1 2zm2 8.99h5v-5h4v5h5v-7c-.37-.05-.72-.22-1-.43-.63-.45-1-.73-1-1.56 0 .83-.38 1.11-1 1.56-.41.3-.95.43-1.49.44-.55 0-1.1-.14-1.51-.44-.63-.45-1-.73-1-1.56 0 .83-.38 1.11-1 1.56-.41.3-.95.43-1.5.44-.54 0-1.09-.14-1.5-.44-.63-.45-1-.73-1-1.57 0 .84-.38 1.12-1 1.57-.29.21-.63.38-1 .44v6.99z';
10896
- break;
10897
-
10898
- case 'table-col-after':
10899
- path = 'M14.08 12.864V9.216h3.648V7.424H14.08V3.776h-1.728v3.648H8.64v1.792h3.712v3.648zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm0 5.12H1.28v3.84H6.4V6.4zm0 5.12H1.28v3.84H6.4v-3.84zM19.2 1.28H7.68v14.08H19.2V1.28z';
10900
- break;
10901
-
10902
- case 'table-col-before':
10903
- path = 'M6.4 3.776v3.648H2.752v1.792H6.4v3.648h1.728V9.216h3.712V7.424H8.128V3.776zM0 17.92V0h20.48v17.92H0zM12.8 1.28H1.28v14.08H12.8V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.12h-5.12v3.84h5.12V6.4zm0 5.12h-5.12v3.84h5.12v-3.84z';
10904
- break;
10905
-
10906
- case 'table-col-delete':
10907
- path = 'M6.4 9.98L7.68 8.7v-.256L6.4 7.164V9.98zm6.4-1.532l1.28-1.28V9.92L12.8 8.64v-.192zm7.68 9.472V0H0v17.92h20.48zm-1.28-2.56h-5.12v-1.024l-.256.256-1.024-1.024v1.792H7.68v-1.792l-1.024 1.024-.256-.256v1.024H1.28V1.28H6.4v2.368l.704-.704.576.576V1.216h5.12V3.52l.96-.96.32.32V1.216h5.12V15.36zm-5.76-2.112l-3.136-3.136-3.264 3.264-1.536-1.536 3.264-3.264L5.632 5.44l1.536-1.536 3.136 3.136 3.2-3.2 1.536 1.536-3.2 3.2 3.136 3.136-1.536 1.536z';
10908
- break;
10909
-
10910
- case 'table-row-after':
10911
- path = 'M13.824 10.176h-2.88v-2.88H9.536v2.88h-2.88v1.344h2.88v2.88h1.408v-2.88h2.88zM0 17.92V0h20.48v17.92H0zM6.4 1.28H1.28v3.84H6.4V1.28zm6.4 0H7.68v3.84h5.12V1.28zm6.4 0h-5.12v3.84h5.12V1.28zm0 5.056H1.28v9.024H19.2V6.336z';
10912
- break;
10913
-
10914
- case 'table-row-before':
10915
- path = 'M6.656 6.464h2.88v2.88h1.408v-2.88h2.88V5.12h-2.88V2.24H9.536v2.88h-2.88zM0 17.92V0h20.48v17.92H0zm7.68-2.56h5.12v-3.84H7.68v3.84zm-6.4 0H6.4v-3.84H1.28v3.84zM19.2 1.28H1.28v9.024H19.2V1.28zm0 10.24h-5.12v3.84h5.12v-3.84z';
10916
- break;
10917
-
10918
- case 'table-row-delete':
10919
- path = 'M17.728 11.456L14.592 8.32l3.2-3.2-1.536-1.536-3.2 3.2L9.92 3.648 8.384 5.12l3.2 3.2-3.264 3.264 1.536 1.536 3.264-3.264 3.136 3.136 1.472-1.536zM0 17.92V0h20.48v17.92H0zm19.2-6.4h-.448l-1.28-1.28H19.2V6.4h-1.792l1.28-1.28h.512V1.28H1.28v3.84h6.208l1.28 1.28H1.28v3.84h7.424l-1.28 1.28H1.28v3.84H19.2v-3.84z';
10920
- break;
10921
-
10922
- case 'tablet':
10923
- path = 'M4 2h12c.55 0 1 .45 1 1v14c0 .55-.45 1-1 1H4c-.55 0-1-.45-1-1V3c0-.55.45-1 1-1zm11 14V4H5v12h10zM6 5h6l-6 5V5z';
10924
- break;
10925
-
10926
- case 'tag':
10927
- path = 'M11 2h7v7L8 19l-7-7zm3 6c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z';
10928
- break;
10929
-
10930
- case 'tagcloud':
10931
- path = 'M11 3v4H1V3h10zm8 0v4h-7V3h7zM7 8v3H1V8h6zm12 0v3H8V8h11zM9 12v2H1v-2h8zm10 0v2h-9v-2h9zM6 15v1H1v-1h5zm5 0v1H7v-1h4zm3 0v1h-2v-1h2zm5 0v1h-4v-1h4z';
10932
- break;
10933
-
10934
- case 'testimonial':
10935
- path = 'M4 3h12c.55 0 1.02.2 1.41.59S18 4.45 18 5v7c0 .55-.2 1.02-.59 1.41S16.55 14 16 14h-1l-5 5v-5H4c-.55 0-1.02-.2-1.41-.59S2 12.55 2 12V5c0-.55.2-1.02.59-1.41S3.45 3 4 3zm11 2H4v1h11V5zm1 3H4v1h12V8zm-3 3H4v1h9v-1z';
10936
- break;
10937
-
10938
- case 'text':
10939
- path = 'M18 3v2H2V3h16zm-6 4v2H2V7h10zm6 0v2h-4V7h4zM8 11v2H2v-2h6zm10 0v2h-8v-2h8zm-4 4v2H2v-2h12z';
10940
- break;
10941
-
10942
- case 'thumbs-down':
10943
- path = 'M7.28 18c-.15.02-.26-.02-.41-.07-.56-.19-.83-.79-.66-1.35.17-.55 1-3.04 1-3.58 0-.53-.75-1-1.35-1h-3c-.6 0-1-.4-1-1s2-7 2-7c.17-.39.55-1 1-1H14v9h-2.14c-.41.41-3.3 4.71-3.58 5.27-.21.41-.6.68-1 .73zM18 12h-2V3h2v9z';
10944
- break;
10945
-
10946
- case 'thumbs-up':
10947
- path = 'M12.72 2c.15-.02.26.02.41.07.56.19.83.79.66 1.35-.17.55-1 3.04-1 3.58 0 .53.75 1 1.35 1h3c.6 0 1 .4 1 1s-2 7-2 7c-.17.39-.55 1-1 1H6V8h2.14c.41-.41 3.3-4.71 3.58-5.27.21-.41.6-.68 1-.73zM2 8h2v9H2V8z';
10948
- break;
10949
-
10950
- case 'tickets-alt':
10951
- path = 'M20 6.38L18.99 9.2v-.01c-.52-.19-1.03-.16-1.53.08s-.85.62-1.04 1.14-.16 1.03.07 1.53c.24.5.62.84 1.15 1.03v.01l-1.01 2.82-15.06-5.38.99-2.79c.52.19 1.03.16 1.53-.08.5-.23.84-.61 1.03-1.13s.16-1.03-.08-1.53c-.23-.49-.61-.83-1.13-1.02L4.93 1zm-4.97 5.69l1.37-3.76c.12-.31.1-.65-.04-.95s-.39-.53-.7-.65L8.14 3.98c-.64-.23-1.37.12-1.6.74L5.17 8.48c-.24.65.1 1.37.74 1.6l7.52 2.74c.14.05.28.08.43.08.52 0 1-.33 1.17-.83zM7.97 4.45l7.51 2.73c.19.07.34.21.43.39.08.18.09.38.02.57l-1.37 3.76c-.13.38-.58.59-.96.45L6.09 9.61c-.39-.14-.59-.57-.45-.96l1.37-3.76c.1-.29.39-.49.7-.49.09 0 .17.02.26.05zm6.82 12.14c.35.27.75.41 1.2.41H16v3H0v-2.96c.55 0 1.03-.2 1.41-.59.39-.38.59-.86.59-1.41s-.2-1.02-.59-1.41-.86-.59-1.41-.59V10h1.05l-.28.8 2.87 1.02c-.51.16-.89.62-.89 1.18v4c0 .69.56 1.25 1.25 1.25h8c.69 0 1.25-.56 1.25-1.25v-1.75l.83.3c.12.43.36.78.71 1.04zM3.25 17v-4c0-.41.34-.75.75-.75h.83l7.92 2.83V17c0 .41-.34.75-.75.75H4c-.41 0-.75-.34-.75-.75z';
10952
- break;
10953
-
10954
- case 'tickets':
10955
- path = 'M20 5.38L18.99 8.2v-.01c-1.04-.37-2.19.18-2.57 1.22-.37 1.04.17 2.19 1.22 2.56v.01l-1.01 2.82L1.57 9.42l.99-2.79c1.04.38 2.19-.17 2.56-1.21s-.17-2.18-1.21-2.55L4.93 0zm-5.45 3.37c.74-2.08-.34-4.37-2.42-5.12-2.08-.74-4.37.35-5.11 2.42-.74 2.08.34 4.38 2.42 5.12 2.07.74 4.37-.35 5.11-2.42zm-2.56-4.74c.89.32 1.57.94 1.97 1.71-.01-.01-.02-.01-.04-.02-.33-.12-.67.09-.78.4-.1.28-.03.57.05.91.04.27.09.62-.06 1.04-.1.29-.33.58-.65 1l-.74 1.01.08-4.08.4.11c.19.04.26-.24.08-.29 0 0-.57-.15-.92-.28-.34-.12-.88-.36-.88-.36-.18-.08-.3.19-.12.27 0 0 .16.08.34.16l.01 1.63L9.2 9.18l.08-4.11c.2.06.4.11.4.11.19.04.26-.23.07-.29 0 0-.56-.15-.91-.28-.07-.02-.14-.05-.22-.08.93-.7 2.19-.94 3.37-.52zM7.4 6.19c.17-.49.44-.92.78-1.27l.04 5c-.94-.95-1.3-2.39-.82-3.73zm4.04 4.75l2.1-2.63c.37-.41.57-.77.69-1.12.05-.12.08-.24.11-.35.09.57.04 1.18-.17 1.77-.45 1.25-1.51 2.1-2.73 2.33zm-.7-3.22l.02 3.22c0 .02 0 .04.01.06-.4 0-.8-.07-1.2-.21-.33-.12-.63-.28-.9-.48zm1.24 6.08l2.1.75c.24.84 1 1.45 1.91 1.45H16v3H0v-2.96c1.1 0 2-.89 2-2 0-1.1-.9-2-2-2V9h1.05l-.28.8 4.28 1.52C4.4 12.03 4 12.97 4 14c0 2.21 1.79 4 4 4s4-1.79 4-4c0-.07-.02-.13-.02-.2zm-6.53-2.33l1.48.53c-.14.04-.15.27.03.28 0 0 .18.02.37.03l.56 1.54-.78 2.36-1.31-3.9c.21-.01.41-.03.41-.03.19-.02.17-.31-.02-.3 0 0-.59.05-.96.05-.07 0-.15 0-.23-.01.13-.2.28-.38.45-.55zM4.4 14c0-.52.12-1.02.32-1.46l1.71 4.7C5.23 16.65 4.4 15.42 4.4 14zm4.19-1.41l1.72.62c.07.17.12.37.12.61 0 .31-.12.66-.28 1.16l-.35 1.2zM11.6 14c0 1.33-.72 2.49-1.79 3.11l1.1-3.18c.06-.17.1-.31.14-.46l.52.19c.02.11.03.22.03.34zm-4.62 3.45l1.08-3.14 1.11 3.03c.01.02.01.04.02.05-.37.13-.77.21-1.19.21-.35 0-.69-.06-1.02-.15z';
10956
- break;
10957
-
10958
- case 'tide':
10959
- path = 'M17 7.2V3H3v7.1c2.6-.5 4.5-1.5 6.4-2.6.2-.2.4-.3.6-.5v3c-1.9 1.1-4 2.2-7 2.8V17h14V9.9c-2.6.5-4.4 1.5-6.2 2.6-.3.1-.5.3-.8.4V10c2-1.1 4-2.2 7-2.8z';
10960
- break;
10961
-
10962
- case 'translation':
10963
- path = 'M11 7H9.49c-.63 0-1.25.3-1.59.7L7 5H4.13l-2.39 7h1.69l.74-2H7v4H2c-1.1 0-2-.9-2-2V5c0-1.1.9-2 2-2h7c1.1 0 2 .9 2 2v2zM6.51 9H4.49l1-2.93zM10 8h7c1.1 0 2 .9 2 2v7c0 1.1-.9 2-2 2h-7c-1.1 0-2-.9-2-2v-7c0-1.1.9-2 2-2zm7.25 5v-1.08h-3.17V9.75h-1.16v2.17H9.75V13h1.28c.11.85.56 1.85 1.28 2.62-.87.36-1.89.62-2.31.62-.01.02.22.97.2 1.46.84 0 2.21-.5 3.28-1.15 1.09.65 2.48 1.15 3.34 1.15-.02-.49.2-1.44.2-1.46-.43 0-1.49-.27-2.38-.63.7-.77 1.14-1.77 1.25-2.61h1.36zm-3.81 1.93c-.5-.46-.85-1.13-1.01-1.93h2.09c-.17.8-.51 1.47-1 1.93l-.04.03s-.03-.02-.04-.03z';
10964
- break;
10965
-
10966
- case 'trash':
10967
- path = 'M12 4h3c.6 0 1 .4 1 1v1H3V5c0-.6.5-1 1-1h3c.2-1.1 1.3-2 2.5-2s2.3.9 2.5 2zM8 4h3c-.2-.6-.9-1-1.5-1S8.2 3.4 8 4zM4 7h11l-.9 10.1c0 .5-.5.9-1 .9H5.9c-.5 0-.9-.4-1-.9L4 7z';
10968
- break;
10969
-
10970
- case 'twitter':
10971
- path = 'M18.94 4.46c-.49.73-1.11 1.38-1.83 1.9.01.15.01.31.01.47 0 4.85-3.69 10.44-10.43 10.44-2.07 0-4-.61-5.63-1.65.29.03.58.05.88.05 1.72 0 3.3-.59 4.55-1.57-1.6-.03-2.95-1.09-3.42-2.55.22.04.45.07.69.07.33 0 .66-.05.96-.13-1.67-.34-2.94-1.82-2.94-3.6v-.04c.5.27 1.06.44 1.66.46-.98-.66-1.63-1.78-1.63-3.06 0-.67.18-1.3.5-1.84 1.81 2.22 4.51 3.68 7.56 3.83-.06-.27-.1-.55-.1-.84 0-2.02 1.65-3.66 3.67-3.66 1.06 0 2.01.44 2.68 1.16.83-.17 1.62-.47 2.33-.89-.28.85-.86 1.57-1.62 2.02.75-.08 1.45-.28 2.11-.57z';
10972
- break;
10973
-
10974
- case 'undo':
10975
- path = 'M12 5H7V2L1 6l6 4V7h5c2.2 0 4 1.8 4 4s-1.8 4-4 4H7v2h5c3.3 0 6-2.7 6-6s-2.7-6-6-6z';
10976
- break;
10977
-
10978
- case 'universal-access-alt':
10979
- path = 'M19 10c0-4.97-4.03-9-9-9s-9 4.03-9 9 4.03 9 9 9 9-4.03 9-9zm-9-7.4c.83 0 1.5.67 1.5 1.5s-.67 1.51-1.5 1.51c-.82 0-1.5-.68-1.5-1.51s.68-1.5 1.5-1.5zM3.4 7.36c0-.65 6.6-.76 6.6-.76s6.6.11 6.6.76-4.47 1.4-4.47 1.4 1.69 8.14 1.06 8.38c-.62.24-3.19-5.19-3.19-5.19s-2.56 5.43-3.18 5.19c-.63-.24 1.06-8.38 1.06-8.38S3.4 8.01 3.4 7.36z';
10980
- break;
10981
-
10982
- case 'universal-access':
10983
- path = 'M10 2.6c.83 0 1.5.67 1.5 1.5s-.67 1.51-1.5 1.51c-.82 0-1.5-.68-1.5-1.51s.68-1.5 1.5-1.5zM3.4 7.36c0-.65 6.6-.76 6.6-.76s6.6.11 6.6.76-4.47 1.4-4.47 1.4 1.69 8.14 1.06 8.38c-.62.24-3.19-5.19-3.19-5.19s-2.56 5.43-3.18 5.19c-.63-.24 1.06-8.38 1.06-8.38S3.4 8.01 3.4 7.36z';
10984
- break;
10985
-
10986
- case 'unlock':
10987
- path = 'M12 9V6c0-1.1-.9-2-2-2s-2 .9-2 2H6c0-2.21 1.79-4 4-4s4 1.79 4 4v3h1c.55 0 1 .45 1 1v7c0 .55-.45 1-1 1H5c-.55 0-1-.45-1-1v-7c0-.55.45-1 1-1h7zm-1 7l-.36-2.15c.51-.24.86-.75.86-1.35 0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5c0 .6.35 1.11.86 1.35L9 16h2z';
10988
- break;
10989
-
10990
- case 'update':
10991
- path = 'M10.2 3.28c3.53 0 6.43 2.61 6.92 6h2.08l-3.5 4-3.5-4h2.32c-.45-1.97-2.21-3.45-4.32-3.45-1.45 0-2.73.71-3.54 1.78L4.95 5.66C6.23 4.2 8.11 3.28 10.2 3.28zm-.4 13.44c-3.52 0-6.43-2.61-6.92-6H.8l3.5-4c1.17 1.33 2.33 2.67 3.5 4H5.48c.45 1.97 2.21 3.45 4.32 3.45 1.45 0 2.73-.71 3.54-1.78l1.71 1.95c-1.28 1.46-3.15 2.38-5.25 2.38z';
10992
- break;
10993
-
10994
- case 'upload':
10995
- path = 'M8 14V8H5l5-6 5 6h-3v6H8zm-2 2v-6H4v8h12.01v-8H14v6H6z';
10996
- break;
10997
-
10998
- case 'vault':
10999
- path = 'M18 17V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v14c0 .55.45 1 1 1h14c.55 0 1-.45 1-1zm-1 0H3V3h14v14zM4.75 4h10.5c.41 0 .75.34.75.75V6h-1v3h1v2h-1v3h1v1.25c0 .41-.34.75-.75.75H4.75c-.41 0-.75-.34-.75-.75V4.75c0-.41.34-.75.75-.75zM13 10c0-2.21-1.79-4-4-4s-4 1.79-4 4 1.79 4 4 4 4-1.79 4-4zM9 7l.77 1.15C10.49 8.46 11 9.17 11 10c0 1.1-.9 2-2 2s-2-.9-2-2c0-.83.51-1.54 1.23-1.85z';
11000
- break;
11001
-
11002
- case 'video-alt':
11003
- path = 'M8 5c0-.55-.45-1-1-1H2c-.55 0-1 .45-1 1 0 .57.49 1 1 1h5c.55 0 1-.45 1-1zm6 5l4-4v10l-4-4v-2zm-1 4V8c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v6c0 .55.45 1 1 1h8c.55 0 1-.45 1-1z';
11004
- break;
11005
-
11006
- case 'video-alt2':
11007
- path = 'M12 13V7c0-1.1-.9-2-2-2H3c-1.1 0-2 .9-2 2v6c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2zm1-2.5l6 4.5V5l-6 4.5v1z';
11008
- break;
11009
-
11010
- case 'video-alt3':
11011
- path = 'M19 15V5c0-1.1-.9-2-2-2H4c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2zM8 14V6l6 4z';
11012
- break;
11013
-
11014
- case 'visibility':
11015
- path = 'M19.7 9.4C17.7 6 14 3.9 10 3.9S2.3 6 .3 9.4L0 10l.3.6c2 3.4 5.7 5.5 9.7 5.5s7.7-2.1 9.7-5.5l.3-.6-.3-.6zM10 14.1c-3.1 0-6-1.6-7.7-4.1C3.6 8 5.7 6.6 8 6.1c-.9.6-1.5 1.7-1.5 2.9 0 1.9 1.6 3.5 3.5 3.5s3.5-1.6 3.5-3.5c0-1.2-.6-2.3-1.5-2.9 2.3.5 4.4 1.9 5.7 3.9-1.7 2.5-4.6 4.1-7.7 4.1z';
11016
- break;
11017
-
11018
- case 'warning':
11019
- path = 'M10 2c4.42 0 8 3.58 8 8s-3.58 8-8 8-8-3.58-8-8 3.58-8 8-8zm1.13 9.38l.35-6.46H8.52l.35 6.46h2.26zm-.09 3.36c.24-.23.37-.55.37-.96 0-.42-.12-.74-.36-.97s-.59-.35-1.06-.35-.82.12-1.07.35-.37.55-.37.97c0 .41.13.73.38.96.26.23.61.34 1.06.34s.8-.11 1.05-.34z';
11020
- break;
11021
-
11022
- case 'welcome-add-page':
11023
- path = 'M17 7V4h-2V2h-3v1H3v15h11V9h1V7h2zm-1-2v1h-2v2h-1V6h-2V5h2V3h1v2h2z';
11024
- break;
11025
-
11026
- case 'welcome-comments':
11027
- path = 'M5 2h10c1.1 0 2 .9 2 2v8c0 1.1-.9 2-2 2h-2l-5 5v-5H5c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2zm8.5 8.5L11 8l2.5-2.5-1-1L10 7 7.5 4.5l-1 1L9 8l-2.5 2.5 1 1L10 9l2.5 2.5z';
11028
- break;
11029
-
11030
- case 'welcome-learn-more':
11031
- path = 'M10 10L2.54 7.02 3 18H1l.48-11.41L0 6l10-4 10 4zm0-5c-.55 0-1 .22-1 .5s.45.5 1 .5 1-.22 1-.5-.45-.5-1-.5zm0 6l5.57-2.23c.71.94 1.2 2.07 1.36 3.3-.3-.04-.61-.07-.93-.07-2.55 0-4.78 1.37-6 3.41C8.78 13.37 6.55 12 4 12c-.32 0-.63.03-.93.07.16-1.23.65-2.36 1.36-3.3z';
11032
- break;
11033
-
11034
- case 'welcome-view-site':
11035
- path = 'M18 14V4c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h14c.55 0 1-.45 1-1zm-8-8c2.3 0 4.4 1.14 6 3-1.6 1.86-3.7 3-6 3s-4.4-1.14-6-3c1.6-1.86 3.7-3 6-3zm2 3c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2zm2 8h3v1H3v-1h3v-1h8v1z';
11036
- break;
11037
-
11038
- case 'welcome-widgets-menus':
11039
- path = 'M19 16V3c0-.55-.45-1-1-1H3c-.55 0-1 .45-1 1v13c0 .55.45 1 1 1h15c.55 0 1-.45 1-1zM4 4h13v4H4V4zm1 1v2h3V5H5zm4 0v2h3V5H9zm4 0v2h3V5h-3zm-8.5 5c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5zM6 10h4v1H6v-1zm6 0h5v5h-5v-5zm-7.5 2c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5zM6 12h4v1H6v-1zm7 0v2h3v-2h-3zm-8.5 2c.28 0 .5.22.5.5s-.22.5-.5.5-.5-.22-.5-.5.22-.5.5-.5zM6 14h4v1H6v-1z';
11040
- break;
11041
-
11042
- case 'welcome-write-blog':
11043
- path = 'M16.89 1.2l1.41 1.41c.39.39.39 1.02 0 1.41L14 8.33V18H3V3h10.67l1.8-1.8c.4-.39 1.03-.4 1.42 0zm-5.66 8.48l5.37-5.36-1.42-1.42-5.36 5.37-.71 2.12z';
11044
- break;
11045
-
11046
- case 'wordpress-alt':
11047
- path = 'M20 10c0-5.51-4.49-10-10-10C4.48 0 0 4.49 0 10c0 5.52 4.48 10 10 10 5.51 0 10-4.48 10-10zM7.78 15.37L4.37 6.22c.55-.02 1.17-.08 1.17-.08.5-.06.44-1.13-.06-1.11 0 0-1.45.11-2.37.11-.18 0-.37 0-.58-.01C4.12 2.69 6.87 1.11 10 1.11c2.33 0 4.45.87 6.05 2.34-.68-.11-1.65.39-1.65 1.58 0 .74.45 1.36.9 2.1.35.61.55 1.36.55 2.46 0 1.49-1.4 5-1.4 5l-3.03-8.37c.54-.02.82-.17.82-.17.5-.05.44-1.25-.06-1.22 0 0-1.44.12-2.38.12-.87 0-2.33-.12-2.33-.12-.5-.03-.56 1.2-.06 1.22l.92.08 1.26 3.41zM17.41 10c.24-.64.74-1.87.43-4.25.7 1.29 1.05 2.71 1.05 4.25 0 3.29-1.73 6.24-4.4 7.78.97-2.59 1.94-5.2 2.92-7.78zM6.1 18.09C3.12 16.65 1.11 13.53 1.11 10c0-1.3.23-2.48.72-3.59C3.25 10.3 4.67 14.2 6.1 18.09zm4.03-6.63l2.58 6.98c-.86.29-1.76.45-2.71.45-.79 0-1.57-.11-2.29-.33.81-2.38 1.62-4.74 2.42-7.1z';
11048
- break;
11049
-
11050
- case 'wordpress':
11051
- path = 'M20 10c0-5.52-4.48-10-10-10S0 4.48 0 10s4.48 10 10 10 10-4.48 10-10zM10 1.01c4.97 0 8.99 4.02 8.99 8.99s-4.02 8.99-8.99 8.99S1.01 14.97 1.01 10 5.03 1.01 10 1.01zM8.01 14.82L4.96 6.61c.49-.03 1.05-.08 1.05-.08.43-.05.38-1.01-.06-.99 0 0-1.29.1-2.13.1-.15 0-.33 0-.52-.01 1.44-2.17 3.9-3.6 6.7-3.6 2.09 0 3.99.79 5.41 2.09-.6-.08-1.45.35-1.45 1.42 0 .66.38 1.22.79 1.88.31.54.5 1.22.5 2.21 0 1.34-1.27 4.48-1.27 4.48l-2.71-7.5c.48-.03.75-.16.75-.16.43-.05.38-1.1-.05-1.08 0 0-1.3.11-2.14.11-.78 0-2.11-.11-2.11-.11-.43-.02-.48 1.06-.05 1.08l.84.08 1.12 3.04zm6.02 2.15L16.64 10s.67-1.69.39-3.81c.63 1.14.94 2.42.94 3.81 0 2.96-1.56 5.58-3.94 6.97zM2.68 6.77L6.5 17.25c-2.67-1.3-4.47-4.08-4.47-7.25 0-1.16.2-2.23.65-3.23zm7.45 4.53l2.29 6.25c-.75.27-1.57.42-2.42.42-.72 0-1.41-.11-2.06-.3z';
11052
- break;
11053
-
11054
- case 'yes-alt':
11055
- path = 'M10 2c-4.42 0-8 3.58-8 8s3.58 8 8 8 8-3.58 8-8-3.58-8-8-8zm-.615 12.66h-1.34l-3.24-4.54 1.34-1.25 2.57 2.4 5.14-5.93 1.34.94-5.81 8.38z';
11056
- break;
11057
-
11058
- case 'yes':
11059
- path = 'M14.83 4.89l1.34.94-5.81 8.38H9.02L5.78 9.67l1.34-1.25 2.57 2.4z';
11060
- break;
11061
- }
11062
-
11063
- if (!path) {
11064
- return null;
11065
- }
11066
-
11067
- var iconClass = ['dashicon', 'dashicons-' + icon, className].filter(Boolean).join(' ');
11068
- return Object(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_6__primitives__["c" /* SVG */], {
11069
- "aria-hidden": true,
11070
- role: "img",
11071
- focusable: "false",
11072
- className: iconClass,
11073
- xmlns: "http://www.w3.org/2000/svg",
11074
- width: size,
11075
- height: size,
11076
- viewBox: "0 0 20 20"
11077
- }, Object(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_6__primitives__["b" /* Path */], {
11078
- d: path
11079
- }));
11080
- }
11081
- }]);
11082
-
11083
- return Dashicon;
11084
- }(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["b" /* Component */]);
11085
-
11086
-
11087
- //# sourceMappingURL=index.js.map
11088
-
11089
- /***/ }),
11090
- /* 56 */
11091
- /***/ (function(module, exports, __webpack_require__) {
11092
-
11093
- "use strict";
11094
-
11095
-
11096
- // https://www.ecma-international.org/ecma-262/6.0/#sec-ispropertykey
11097
-
11098
- module.exports = function IsPropertyKey(argument) {
11099
- return typeof argument === 'string' || typeof argument === 'symbol';
11100
- };
11101
-
11102
-
11103
- /***/ }),
11104
- /* 57 */
11105
- /***/ (function(module, exports, __webpack_require__) {
11106
-
11107
- "use strict";
11108
- /**
11109
- * Copyright (c) 2013-present, Facebook, Inc.
11110
- *
11111
- * This source code is licensed under the MIT license found in the
11112
- * LICENSE file in the root directory of this source tree.
11113
- *
11114
- * @providesModule shallowCompare
11115
- */
11116
-
11117
-
11118
-
11119
- var shallowEqual = __webpack_require__(688);
11120
-
11121
- /**
11122
- * Does a shallow comparison for props and state.
11123
- * See ReactComponentWithPureRenderMixin
11124
- * See also https://facebook.github.io/react/docs/shallow-compare.html
11125
- */
11126
- function shallowCompare(instance, nextProps, nextState) {
11127
- return (
11128
- !shallowEqual(instance.props, nextProps) ||
11129
- !shallowEqual(instance.state, nextState)
11130
- );
11131
- }
11132
-
11133
- module.exports = shallowCompare;
11134
-
11135
-
11136
- /***/ }),
11137
- /* 58 */
11138
- /***/ (function(module, exports, __webpack_require__) {
11139
-
11140
- "use strict";
11141
-
11142
-
11143
- Object.defineProperty(exports, "__esModule", {
11144
- value: true
11145
- });
11146
- exports['default'] = isSameDay;
11147
-
11148
- var _moment = __webpack_require__(0);
11149
-
11150
- var _moment2 = _interopRequireDefault(_moment);
11151
-
11152
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
11153
-
11154
- function isSameDay(a, b) {
11155
- if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
11156
- // Compare least significant, most likely to change units first
11157
- // Moment's isSame clones moment inputs and is a tad slow
11158
- return a.date() === b.date() && a.month() === b.month() && a.year() === b.year();
11159
- }
11160
-
11161
- /***/ }),
11162
- /* 59 */
11163
- /***/ (function(module, exports, __webpack_require__) {
11164
-
11165
- "use strict";
11166
-
11167
-
11168
- Object.defineProperty(exports, "__esModule", {
11169
- value: true
11170
- });
11171
- exports['default'] = toMomentObject;
11172
-
11173
- var _moment = __webpack_require__(0);
11174
-
11175
- var _moment2 = _interopRequireDefault(_moment);
11176
-
11177
- var _constants = __webpack_require__(17);
11178
-
11179
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
11180
-
11181
- function toMomentObject(dateString, customFormat) {
11182
- var dateFormats = customFormat ? [customFormat, _constants.DISPLAY_FORMAT, _constants.ISO_FORMAT] : [_constants.DISPLAY_FORMAT, _constants.ISO_FORMAT];
11183
-
11184
- var date = (0, _moment2['default'])(dateString, dateFormats, true);
11185
- return date.isValid() ? date.hour(12) : null;
11186
- }
11187
-
11188
- /***/ }),
11189
- /* 60 */
11190
- /***/ (function(module, exports, __webpack_require__) {
11191
-
11192
- "use strict";
11193
-
11194
-
11195
- Object.defineProperty(exports, "__esModule", {
11196
- value: true
11197
- });
11198
-
11199
- var _propTypes = __webpack_require__(11);
11200
-
11201
- var _propTypes2 = _interopRequireDefault(_propTypes);
11202
-
11203
- var _constants = __webpack_require__(17);
11204
-
11205
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
11206
-
11207
- exports['default'] = _propTypes2['default'].oneOf([_constants.HORIZONTAL_ORIENTATION, _constants.VERTICAL_ORIENTATION, _constants.VERTICAL_SCROLLABLE]);
11208
-
11209
- /***/ }),
11210
- /* 61 */
11211
- /***/ (function(module, exports) {
11212
-
11213
- Object.defineProperty(exports, "__esModule", {
11214
- value: true
11215
- });
11216
- exports['default'] = isTouchDevice;
11217
- function isTouchDevice() {
11218
- return !!(typeof window !== 'undefined' && ('ontouchstart' in window || window.DocumentTouch && typeof document !== 'undefined' && document instanceof window.DocumentTouch)) || !!(typeof navigator !== 'undefined' && (navigator.maxTouchPoints || navigator.msMaxTouchPoints));
11219
- }
11220
- module.exports = exports['default'];
11221
-
11222
- /***/ }),
11223
- /* 62 */
11224
- /***/ (function(module, exports, __webpack_require__) {
11225
-
11226
- "use strict";
11227
-
11228
-
11229
- Object.defineProperty(exports, "__esModule", {
11230
- value: true
11231
- });
11232
-
11233
- var _propTypes = __webpack_require__(11);
11234
-
11235
- var _propTypes2 = _interopRequireDefault(_propTypes);
11236
-
11237
- var _constants = __webpack_require__(17);
11238
-
11239
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
11240
-
11241
- exports['default'] = _propTypes2['default'].oneOf([_constants.OPEN_DOWN, _constants.OPEN_UP]);
11242
-
11243
- /***/ }),
11244
- /* 63 */
11245
- /***/ (function(module, exports, __webpack_require__) {
11246
-
11247
- "use strict";
11248
- /*
11249
- object-assign
11250
- (c) Sindre Sorhus
11251
- @license MIT
11252
- */
11253
-
11254
-
11255
- /* eslint-disable no-unused-vars */
11256
- var getOwnPropertySymbols = Object.getOwnPropertySymbols;
11257
- var hasOwnProperty = Object.prototype.hasOwnProperty;
11258
- var propIsEnumerable = Object.prototype.propertyIsEnumerable;
11259
-
11260
- function toObject(val) {
11261
- if (val === null || val === undefined) {
11262
- throw new TypeError('Object.assign cannot be called with null or undefined');
11263
- }
11264
-
11265
- return Object(val);
11266
- }
11267
-
11268
- function shouldUseNative() {
11269
- try {
11270
- if (!Object.assign) {
11271
- return false;
11272
- }
11273
-
11274
- // Detect buggy property enumeration order in older V8 versions.
11275
-
11276
- // https://bugs.chromium.org/p/v8/issues/detail?id=4118
11277
- var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
11278
- test1[5] = 'de';
11279
- if (Object.getOwnPropertyNames(test1)[0] === '5') {
11280
- return false;
11281
- }
11282
-
11283
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
11284
- var test2 = {};
11285
- for (var i = 0; i < 10; i++) {
11286
- test2['_' + String.fromCharCode(i)] = i;
11287
- }
11288
- var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
11289
- return test2[n];
11290
- });
11291
- if (order2.join('') !== '0123456789') {
11292
- return false;
11293
- }
11294
-
11295
- // https://bugs.chromium.org/p/v8/issues/detail?id=3056
11296
- var test3 = {};
11297
- 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
11298
- test3[letter] = letter;
11299
- });
11300
- if (Object.keys(Object.assign({}, test3)).join('') !==
11301
- 'abcdefghijklmnopqrst') {
11302
- return false;
11303
- }
11304
-
11305
- return true;
11306
- } catch (err) {
11307
- // We don't expect any of the above to throw, but better to be safe.
11308
- return false;
11309
- }
11310
- }
11311
-
11312
- module.exports = shouldUseNative() ? Object.assign : function (target, source) {
11313
- var from;
11314
- var to = toObject(target);
11315
- var symbols;
11316
-
11317
- for (var s = 1; s < arguments.length; s++) {
11318
- from = Object(arguments[s]);
11319
-
11320
- for (var key in from) {
11321
- if (hasOwnProperty.call(from, key)) {
11322
- to[key] = from[key];
11323
- }
11324
- }
11325
-
11326
- if (getOwnPropertySymbols) {
11327
- symbols = getOwnPropertySymbols(from);
11328
- for (var i = 0; i < symbols.length; i++) {
11329
- if (propIsEnumerable.call(from, symbols[i])) {
11330
- to[symbols[i]] = from[symbols[i]];
11331
- }
11332
- }
11333
- }
11334
- }
11335
-
11336
- return to;
11337
- };
11338
-
11339
-
11340
- /***/ }),
11341
- /* 64 */
11342
- /***/ (function(module, exports, __webpack_require__) {
11343
-
11344
- /* WEBPACK VAR INJECTION */(function(process) {/**
11345
- * Memize options object.
11346
- *
11347
- * @typedef MemizeOptions
11348
- *
11349
- * @property {number} [maxSize] Maximum size of the cache.
11350
- */
11351
-
11352
- /**
11353
- * Internal cache entry.
11354
- *
11355
- * @typedef MemizeCacheNode
11356
- *
11357
- * @property {?MemizeCacheNode|undefined} [prev] Previous node.
11358
- * @property {?MemizeCacheNode|undefined} [next] Next node.
11359
- * @property {Array<*>} args Function arguments for cache
11360
- * entry.
11361
- * @property {*} val Function result.
11362
- */
11363
-
11364
- /**
11365
- * Properties of the enhanced function for controlling cache.
11366
- *
11367
- * @typedef MemizeMemoizedFunction
11368
- *
11369
- * @property {()=>void} clear Clear the cache.
11370
- */
11371
-
11372
- /**
11373
- * Accepts a function to be memoized, and returns a new memoized function, with
11374
- * optional options.
11375
- *
11376
- * @template {Function} F
11377
- *
11378
- * @param {F} fn Function to memoize.
11379
- * @param {MemizeOptions} [options] Options object.
11380
- *
11381
- * @return {F & MemizeMemoizedFunction} Memoized function.
11382
- */
11383
- function memize( fn, options ) {
11384
- var size = 0;
11385
-
11386
- /** @type {?MemizeCacheNode|undefined} */
11387
- var head;
11388
-
11389
- /** @type {?MemizeCacheNode|undefined} */
11390
- var tail;
11391
-
11392
- options = options || {};
11393
-
11394
- function memoized( /* ...args */ ) {
11395
- var node = head,
11396
- len = arguments.length,
11397
- args, i;
11398
-
11399
- searchCache: while ( node ) {
11400
- // Perform a shallow equality test to confirm that whether the node
11401
- // under test is a candidate for the arguments passed. Two arrays
11402
- // are shallowly equal if their length matches and each entry is
11403
- // strictly equal between the two sets. Avoid abstracting to a
11404
- // function which could incur an arguments leaking deoptimization.
11405
-
11406
- // Check whether node arguments match arguments length
11407
- if ( node.args.length !== arguments.length ) {
11408
- node = node.next;
11409
- continue;
11410
- }
11411
-
11412
- // Check whether node arguments match arguments values
11413
- for ( i = 0; i < len; i++ ) {
11414
- if ( node.args[ i ] !== arguments[ i ] ) {
11415
- node = node.next;
11416
- continue searchCache;
11417
- }
11418
- }
11419
-
11420
- // At this point we can assume we've found a match
11421
-
11422
- // Surface matched node to head if not already
11423
- if ( node !== head ) {
11424
- // As tail, shift to previous. Must only shift if not also
11425
- // head, since if both head and tail, there is no previous.
11426
- if ( node === tail ) {
11427
- tail = node.prev;
11428
- }
11429
-
11430
- // Adjust siblings to point to each other. If node was tail,
11431
- // this also handles new tail's empty `next` assignment.
11432
- /** @type {MemizeCacheNode} */ ( node.prev ).next = node.next;
11433
- if ( node.next ) {
11434
- node.next.prev = node.prev;
11435
- }
11436
-
11437
- node.next = head;
11438
- node.prev = null;
11439
- /** @type {MemizeCacheNode} */ ( head ).prev = node;
11440
- head = node;
11441
- }
11442
-
11443
- // Return immediately
11444
- return node.val;
11445
- }
11446
-
11447
- // No cached value found. Continue to insertion phase:
11448
-
11449
- // Create a copy of arguments (avoid leaking deoptimization)
11450
- args = new Array( len );
11451
- for ( i = 0; i < len; i++ ) {
11452
- args[ i ] = arguments[ i ];
11453
- }
11454
-
11455
- node = {
11456
- args: args,
11457
-
11458
- // Generate the result from original function
11459
- val: fn.apply( null, args ),
11460
- };
11461
-
11462
- // Don't need to check whether node is already head, since it would
11463
- // have been returned above already if it was
11464
-
11465
- // Shift existing head down list
11466
- if ( head ) {
11467
- head.prev = node;
11468
- node.next = head;
11469
- } else {
11470
- // If no head, follows that there's no tail (at initial or reset)
11471
- tail = node;
11472
- }
11473
-
11474
- // Trim tail if we're reached max size and are pending cache insertion
11475
- if ( size === /** @type {MemizeOptions} */ ( options ).maxSize ) {
11476
- tail = /** @type {MemizeCacheNode} */ ( tail ).prev;
11477
- /** @type {MemizeCacheNode} */ ( tail ).next = null;
11478
- } else {
11479
- size++;
11480
- }
11481
-
11482
- head = node;
11483
-
11484
- return node.val;
11485
- }
11486
-
11487
- memoized.clear = function() {
11488
- head = null;
11489
- tail = null;
11490
- size = 0;
11491
- };
11492
-
11493
- if ( process.env.NODE_ENV === 'test' ) {
11494
- // Cache is not exposed in the public API, but used in tests to ensure
11495
- // expected list progression
11496
- memoized.getCache = function() {
11497
- return [ head, tail, size ];
11498
- };
11499
- }
11500
-
11501
- // Ignore reason: There's not a clear solution to create an intersection of
11502
- // the function with additional properties, where the goal is to retain the
11503
- // function signature of the incoming argument and add control properties
11504
- // on the return value.
11505
-
11506
- // @ts-ignore
11507
- return memoized;
11508
- }
11509
-
11510
- module.exports = memize;
11511
-
11512
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))
11513
-
11514
- /***/ }),
11515
- /* 65 */
11516
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
11517
-
11518
- "use strict";
11519
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return addAction; });
11520
- /* unused harmony export addFilter */
11521
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return removeAction; });
11522
- /* unused harmony export removeFilter */
11523
- /* unused harmony export hasAction */
11524
- /* unused harmony export hasFilter */
11525
- /* unused harmony export removeAllActions */
11526
- /* unused harmony export removeAllFilters */
11527
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return doAction; });
11528
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return applyFilters; });
11529
- /* unused harmony export currentAction */
11530
- /* unused harmony export currentFilter */
11531
- /* unused harmony export doingAction */
11532
- /* unused harmony export doingFilter */
11533
- /* unused harmony export didAction */
11534
- /* unused harmony export didFilter */
11535
- /* unused harmony export actions */
11536
- /* unused harmony export filters */
11537
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__createHooks__ = __webpack_require__(540);
11538
- /* unused harmony reexport createHooks */
11539
- /**
11540
- * Internal dependencies
11541
- */
11542
-
11543
-
11544
- var _createHooks = Object(__WEBPACK_IMPORTED_MODULE_0__createHooks__["a" /* default */])(),
11545
- addAction = _createHooks.addAction,
11546
- addFilter = _createHooks.addFilter,
11547
- removeAction = _createHooks.removeAction,
11548
- removeFilter = _createHooks.removeFilter,
11549
- hasAction = _createHooks.hasAction,
11550
- hasFilter = _createHooks.hasFilter,
11551
- removeAllActions = _createHooks.removeAllActions,
11552
- removeAllFilters = _createHooks.removeAllFilters,
11553
- doAction = _createHooks.doAction,
11554
- applyFilters = _createHooks.applyFilters,
11555
- currentAction = _createHooks.currentAction,
11556
- currentFilter = _createHooks.currentFilter,
11557
- doingAction = _createHooks.doingAction,
11558
- doingFilter = _createHooks.doingFilter,
11559
- didAction = _createHooks.didAction,
11560
- didFilter = _createHooks.didFilter,
11561
- actions = _createHooks.actions,
11562
- filters = _createHooks.filters;
11563
-
11564
-
11565
- //# sourceMappingURL=index.js.map
11566
-
11567
- /***/ }),
11568
- /* 66 */
11569
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
11570
-
11571
- "use strict";
11572
- /* harmony export (immutable) */ __webpack_exports__["a"] = insert;
11573
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__create__ = __webpack_require__(53);
11574
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__normalise_formats__ = __webpack_require__(52);
11575
- /**
11576
- * Internal dependencies
11577
- */
11578
-
11579
-
11580
- /** @typedef {import('./create').RichTextValue} RichTextValue */
11581
-
11582
- /**
11583
- * Insert a Rich Text value, an HTML string, or a plain text string, into a
11584
- * Rich Text value at the given `startIndex`. Any content between `startIndex`
11585
- * and `endIndex` will be removed. Indices are retrieved from the selection if
11586
- * none are provided.
11587
- *
11588
- * @param {RichTextValue} value Value to modify.
11589
- * @param {RichTextValue|string} valueToInsert Value to insert.
11590
- * @param {number} [startIndex] Start index.
11591
- * @param {number} [endIndex] End index.
11592
- *
11593
- * @return {RichTextValue} A new value with the value inserted.
11594
- */
11595
-
11596
- function insert(value, valueToInsert) {
11597
- var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
11598
- var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
11599
- var formats = value.formats,
11600
- replacements = value.replacements,
11601
- text = value.text;
11602
-
11603
- if (typeof valueToInsert === 'string') {
11604
- valueToInsert = Object(__WEBPACK_IMPORTED_MODULE_0__create__["a" /* create */])({
11605
- text: valueToInsert
11606
- });
11607
- }
11608
-
11609
- var index = startIndex + valueToInsert.text.length;
11610
- return Object(__WEBPACK_IMPORTED_MODULE_1__normalise_formats__["a" /* normaliseFormats */])({
11611
- formats: formats.slice(0, startIndex).concat(valueToInsert.formats, formats.slice(endIndex)),
11612
- replacements: replacements.slice(0, startIndex).concat(valueToInsert.replacements, replacements.slice(endIndex)),
11613
- text: text.slice(0, startIndex) + valueToInsert.text + text.slice(endIndex),
11614
- start: index,
11615
- end: index
11616
- });
11617
- }
11618
- //# sourceMappingURL=insert.js.map
11619
-
11620
- /***/ }),
11621
- /* 67 */
11622
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
11623
-
11624
- "use strict";
11625
- /* harmony export (immutable) */ __webpack_exports__["d"] = colorToState;
11626
- /* harmony export (immutable) */ __webpack_exports__["e"] = isValidHex;
11627
- /* harmony export (immutable) */ __webpack_exports__["f"] = simpleCheckForValidColor;
11628
- /* harmony export (immutable) */ __webpack_exports__["a"] = calculateAlphaChange;
11629
- /* harmony export (immutable) */ __webpack_exports__["b"] = calculateHueChange;
11630
- /* harmony export (immutable) */ __webpack_exports__["c"] = calculateSaturationChange;
11631
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(2);
11632
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);
11633
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tinycolor2__ = __webpack_require__(627);
11634
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tinycolor2___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_tinycolor2__);
11635
- /**
11636
- * Parts of this source were derived and modified from react-color,
11637
- * released under the MIT license.
11638
- *
11639
- * https://github.com/casesandberg/react-color/
11640
- *
11641
- * Copyright (c) 2015 Case Sandberg
11642
- *
11643
- * Permission is hereby granted, free of charge, to any person obtaining a copy
11644
- * of this software and associated documentation files (the "Software"), to deal
11645
- * in the Software without restriction, including without limitation the rights
11646
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11647
- * copies of the Software, and to permit persons to whom the Software is
11648
- * furnished to do so, subject to the following conditions:
11649
- *
11650
- * The above copyright notice and this permission notice shall be included in
11651
- * all copies or substantial portions of the Software.
11652
- *
11653
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11654
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11655
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
11656
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
11657
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
11658
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
11659
- * THE SOFTWARE.
11660
- */
11661
-
11662
- /**
11663
- * External dependencies
11664
- */
11665
-
11666
-
11667
- /**
11668
- * Given a hex color, get all other color properties (rgb, alpha, etc).
11669
- *
11670
- * @param {Object|string} data A hex color string or an object with a hex property
11671
- * @param {string} oldHue A reference to the hue of the previous color, otherwise dragging the saturation to zero will reset the current hue to zero as well. See https://github.com/casesandberg/react-color/issues/29#issuecomment-132686909.
11672
- * @return {Object} An object of different color representations.
11673
- */
11674
-
11675
- function colorToState() {
11676
- var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
11677
- var oldHue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
11678
- var color = data.hex ? __WEBPACK_IMPORTED_MODULE_1_tinycolor2___default()(data.hex) : __WEBPACK_IMPORTED_MODULE_1_tinycolor2___default()(data);
11679
- var hsl = color.toHsl();
11680
- hsl.h = Math.round(hsl.h);
11681
- hsl.s = Math.round(hsl.s * 100);
11682
- hsl.l = Math.round(hsl.l * 100);
11683
- var hsv = color.toHsv();
11684
- hsv.h = Math.round(hsv.h);
11685
- hsv.s = Math.round(hsv.s * 100);
11686
- hsv.v = Math.round(hsv.v * 100);
11687
- var rgb = color.toRgb();
11688
- var hex = color.toHex();
11689
-
11690
- if (hsl.s === 0) {
11691
- hsl.h = oldHue || 0;
11692
- hsv.h = oldHue || 0;
11693
- }
11694
-
11695
- var transparent = hex === '000000' && rgb.a === 0;
11696
- return {
11697
- color: color,
11698
- hex: transparent ? 'transparent' : "#".concat(hex),
11699
- hsl: hsl,
11700
- hsv: hsv,
11701
- oldHue: data.h || oldHue || hsl.h,
11702
- rgb: rgb,
11703
- source: data.source
11704
- };
11705
- }
11706
- /**
11707
- * Get the top/left offsets of a point in a container, also returns the container width/height.
11708
- *
11709
- * @param {Event} e Mouse or touch event with a location coordinate.
11710
- * @param {HTMLElement} container The container div, returned point is relative to this container.
11711
- * @return {Object} An object of the offset positions & container size.
11712
- */
11713
-
11714
- function getPointOffset(e, container) {
11715
- e.preventDefault();
11716
-
11717
- var _container$getBoundin = container.getBoundingClientRect(),
11718
- containerLeft = _container$getBoundin.left,
11719
- containerTop = _container$getBoundin.top,
11720
- width = _container$getBoundin.width,
11721
- height = _container$getBoundin.height;
11722
-
11723
- var x = typeof e.pageX === 'number' ? e.pageX : e.touches[0].pageX;
11724
- var y = typeof e.pageY === 'number' ? e.pageY : e.touches[0].pageY;
11725
- var left = x - (containerLeft + window.pageXOffset);
11726
- var top = y - (containerTop + window.pageYOffset);
11727
-
11728
- if (left < 0) {
11729
- left = 0;
11730
- } else if (left > width) {
11731
- left = width;
11732
- } else if (top < 0) {
11733
- top = 0;
11734
- } else if (top > height) {
11735
- top = height;
11736
- }
11737
-
11738
- return {
11739
- top: top,
11740
- left: left,
11741
- width: width,
11742
- height: height
11743
- };
11744
- }
11745
- /**
11746
- * Check if a string is a valid hex color code.
11747
- *
11748
- * @param {string} hex A possible hex color.
11749
- * @return {boolean} True if the color is a valid hex color.
11750
- */
11751
-
11752
-
11753
- function isValidHex(hex) {
11754
- // disable hex4 and hex8
11755
- var lh = String(hex).charAt(0) === '#' ? 1 : 0;
11756
- return hex.length !== 4 + lh && hex.length < 7 + lh && __WEBPACK_IMPORTED_MODULE_1_tinycolor2___default()(hex).isValid();
11757
- }
11758
- /**
11759
- * Check an object for any valid color properties.
11760
- *
11761
- * @param {Object} data A possible object representing a color.
11762
- * @return {Object|boolean} If a valid representation of color, returns the data object. Otherwise returns false.
11763
- */
11764
-
11765
- function simpleCheckForValidColor(data) {
11766
- var keysToCheck = ['r', 'g', 'b', 'a', 'h', 's', 'l', 'v'];
11767
- var checked = 0;
11768
- var passed = 0;
11769
- Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["each"])(keysToCheck, function (letter) {
11770
- if (data[letter]) {
11771
- checked += 1;
11772
-
11773
- if (!isNaN(data[letter])) {
11774
- passed += 1;
11775
- }
11776
- }
11777
- });
11778
- return checked === passed ? data : false;
11779
- }
11780
- /**
11781
- * Calculate the current alpha based on a mouse or touch event
11782
- *
11783
- * @param {Event} e A mouse or touch event on the alpha bar.
11784
- * @param {Object} props The current component props
11785
- * @param {HTMLElement} container The container div for the alpha bar graph.
11786
- * @return {Object|null} If the alpha value has changed, returns a new color object.
11787
- */
11788
-
11789
- function calculateAlphaChange(e, props, container) {
11790
- var _getPointOffset = getPointOffset(e, container),
11791
- left = _getPointOffset.left,
11792
- width = _getPointOffset.width;
11793
-
11794
- var a = left < 0 ? 0 : Math.round(left * 100 / width) / 100;
11795
-
11796
- if (props.hsl.a !== a) {
11797
- return {
11798
- h: props.hsl.h,
11799
- s: props.hsl.s,
11800
- l: props.hsl.l,
11801
- a: a,
11802
- source: 'rgb'
11803
- };
11804
- }
11805
-
11806
- return null;
11807
- }
11808
- /**
11809
- * Calculate the current hue based on a mouse or touch event
11810
- *
11811
- * @param {Event} e A mouse or touch event on the hue bar.
11812
- * @param {Object} props The current component props
11813
- * @param {HTMLElement} container The container div for the hue bar graph.
11814
- * @return {Object|null} If the hue value has changed, returns a new color object.
11815
- */
11816
-
11817
- function calculateHueChange(e, props, container) {
11818
- var _getPointOffset2 = getPointOffset(e, container),
11819
- left = _getPointOffset2.left,
11820
- width = _getPointOffset2.width;
11821
-
11822
- var percent = left * 100 / width;
11823
- var h = left >= width ? 359 : 360 * percent / 100;
11824
-
11825
- if (props.hsl.h !== h) {
11826
- return {
11827
- h: h,
11828
- s: props.hsl.s,
11829
- l: props.hsl.l,
11830
- a: props.hsl.a,
11831
- source: 'rgb'
11832
- };
11833
- }
11834
-
11835
- return null;
11836
- }
11837
- /**
11838
- * Calculate the current saturation & brightness based on a mouse or touch event
11839
- *
11840
- * @param {Event} e A mouse or touch event on the saturation graph.
11841
- * @param {Object} props The current component props
11842
- * @param {HTMLElement} container The container div for the 2D saturation graph.
11843
- * @return {Object} Returns a new color object.
11844
- */
11845
-
11846
- function calculateSaturationChange(e, props, container) {
11847
- var _getPointOffset3 = getPointOffset(e, container),
11848
- top = _getPointOffset3.top,
11849
- left = _getPointOffset3.left,
11850
- width = _getPointOffset3.width,
11851
- height = _getPointOffset3.height;
11852
-
11853
- var saturation = left < 0 ? 0 : left * 100 / width;
11854
- var bright = top >= height ? 0 : -(top * 100 / height) + 100; // `v` values less than 1 are considered in the [0,1] range, causing unexpected behavior at the bottom
11855
- // of the chart. To fix this, we assume any value less than 1 should be 0 brightness.
11856
-
11857
- if (bright < 1) {
11858
- bright = 0;
11859
- }
11860
-
11861
- return {
11862
- h: props.hsl.h,
11863
- s: saturation,
11864
- v: bright,
11865
- a: props.hsl.a,
11866
- source: 'rgb'
11867
- };
11868
- }
11869
- //# sourceMappingURL=utils.js.map
11870
-
11871
- /***/ }),
11872
- /* 68 */
11873
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
11874
-
11875
- "use strict";
11876
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
11877
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
11878
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
11879
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
11880
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
11881
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(10);
11882
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__wordpress_element__ = __webpack_require__(1);
11883
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_mousetrap__ = __webpack_require__(99);
11884
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_mousetrap___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_mousetrap__);
11885
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_mousetrap_plugins_global_bind_mousetrap_global_bind__ = __webpack_require__(100);
11886
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_mousetrap_plugins_global_bind_mousetrap_global_bind___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_mousetrap_plugins_global_bind_mousetrap_global_bind__);
11887
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_lodash__ = __webpack_require__(2);
11888
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_lodash__);
11889
-
11890
-
11891
-
11892
-
11893
-
11894
-
11895
-
11896
-
11897
- /**
11898
- * External dependencies
11899
- */
11900
-
11901
-
11902
-
11903
- /**
11904
- * WordPress dependencies
11905
- */
11906
-
11907
-
11908
-
11909
- var KeyboardShortcuts =
11910
- /*#__PURE__*/
11911
- function (_Component) {
11912
- Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__["a" /* default */])(KeyboardShortcuts, _Component);
11913
-
11914
- function KeyboardShortcuts() {
11915
- var _this;
11916
-
11917
- Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, KeyboardShortcuts);
11918
-
11919
- _this = Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(KeyboardShortcuts).apply(this, arguments));
11920
- _this.bindKeyTarget = _this.bindKeyTarget.bind(Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
11921
- return _this;
11922
- }
11923
-
11924
- Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__["a" /* default */])(KeyboardShortcuts, [{
11925
- key: "componentDidMount",
11926
- value: function componentDidMount() {
11927
- var _this2 = this;
11928
-
11929
- var _this$keyTarget = this.keyTarget,
11930
- keyTarget = _this$keyTarget === void 0 ? document : _this$keyTarget;
11931
- this.mousetrap = new __WEBPACK_IMPORTED_MODULE_7_mousetrap___default.a(keyTarget);
11932
- Object(__WEBPACK_IMPORTED_MODULE_9_lodash__["forEach"])(this.props.shortcuts, function (callback, key) {
11933
- var _this2$props = _this2.props,
11934
- bindGlobal = _this2$props.bindGlobal,
11935
- eventName = _this2$props.eventName;
11936
- var bindFn = bindGlobal ? 'bindGlobal' : 'bind';
11937
-
11938
- _this2.mousetrap[bindFn](key, callback, eventName);
11939
- });
11940
- }
11941
- }, {
11942
- key: "componentWillUnmount",
11943
- value: function componentWillUnmount() {
11944
- this.mousetrap.reset();
11945
- }
11946
- /**
11947
- * When rendering with children, binds the wrapper node on which events
11948
- * will be bound.
11949
- *
11950
- * @param {Element} node Key event target.
11951
- */
11952
-
11953
- }, {
11954
- key: "bindKeyTarget",
11955
- value: function bindKeyTarget(node) {
11956
- this.keyTarget = node;
11957
- }
11958
- }, {
11959
- key: "render",
11960
- value: function render() {
11961
- // Render as non-visual if there are no children pressed. Keyboard
11962
- // events will be bound to the document instead.
11963
- var children = this.props.children;
11964
-
11965
- if (!__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["a" /* Children */].count(children)) {
11966
- return null;
11967
- }
11968
-
11969
- return Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])("div", {
11970
- ref: this.bindKeyTarget
11971
- }, children);
11972
- }
11973
- }]);
11974
-
11975
- return KeyboardShortcuts;
11976
- }(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["b" /* Component */]);
11977
-
11978
- /* harmony default export */ __webpack_exports__["a"] = (KeyboardShortcuts);
11979
- //# sourceMappingURL=index.js.map
11980
-
11981
- /***/ }),
11982
- /* 69 */
11983
- /***/ (function(module, exports, __webpack_require__) {
11984
-
11985
- "use strict";
11986
-
11987
-
11988
- var GetIntrinsic = __webpack_require__(19);
11989
-
11990
- var callBind = __webpack_require__(122);
11991
-
11992
- var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
11993
-
11994
- module.exports = function callBoundIntrinsic(name, allowMissing) {
11995
- var intrinsic = GetIntrinsic(name, !!allowMissing);
11996
- if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.')) {
11997
- return callBind(intrinsic);
11998
- }
11999
- return intrinsic;
12000
- };
12001
-
12002
-
12003
- /***/ }),
12004
- /* 70 */
12005
- /***/ (function(module, exports, __webpack_require__) {
12006
-
12007
- "use strict";
12008
- /* WEBPACK VAR INJECTION */(function(process) {
12009
-
12010
- if (process.env.NODE_ENV === 'production') {
12011
- module.exports = __webpack_require__(684);
12012
- } else {
12013
- module.exports = __webpack_require__(685);
12014
- }
12015
-
12016
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))
12017
-
12018
- /***/ }),
12019
- /* 71 */
12020
- /***/ (function(module, exports, __webpack_require__) {
12021
-
12022
- "use strict";
12023
-
12024
-
12025
- Object.defineProperty(exports, "__esModule", {
12026
- value: true
12027
- });
12028
-
12029
- var _propTypes = __webpack_require__(11);
12030
-
12031
- var _propTypes2 = _interopRequireDefault(_propTypes);
12032
-
12033
- var _constants = __webpack_require__(17);
12034
-
12035
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
12036
-
12037
- exports['default'] = _propTypes2['default'].oneOf([_constants.ICON_BEFORE_POSITION, _constants.ICON_AFTER_POSITION]);
12038
-
12039
- /***/ }),
12040
- /* 72 */
12041
- /***/ (function(module, exports, __webpack_require__) {
12042
-
12043
- "use strict";
12044
-
12045
-
12046
- Object.defineProperty(exports, "__esModule", {
12047
- value: true
12048
- });
12049
-
12050
- var _propTypes = __webpack_require__(11);
12051
-
12052
- var _propTypes2 = _interopRequireDefault(_propTypes);
12053
-
12054
- var _constants = __webpack_require__(17);
12055
-
12056
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
12057
-
12058
- exports['default'] = _propTypes2['default'].oneOf([_constants.INFO_POSITION_TOP, _constants.INFO_POSITION_BOTTOM, _constants.INFO_POSITION_BEFORE, _constants.INFO_POSITION_AFTER]);
12059
-
12060
- /***/ }),
12061
- /* 73 */
12062
- /***/ (function(module, exports, __webpack_require__) {
12063
-
12064
- "use strict";
12065
-
12066
-
12067
- Object.defineProperty(exports, "__esModule", {
12068
- value: true
12069
- });
12070
- exports['default'] = isInclusivelyAfterDay;
12071
-
12072
- var _moment = __webpack_require__(0);
12073
-
12074
- var _moment2 = _interopRequireDefault(_moment);
12075
-
12076
- var _isBeforeDay = __webpack_require__(74);
12077
-
12078
- var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
12079
-
12080
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
12081
-
12082
- function isInclusivelyAfterDay(a, b) {
12083
- if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
12084
- return !(0, _isBeforeDay2['default'])(a, b);
12085
- }
12086
-
12087
- /***/ }),
12088
- /* 74 */
12089
- /***/ (function(module, exports, __webpack_require__) {
12090
-
12091
- "use strict";
12092
-
12093
-
12094
- Object.defineProperty(exports, "__esModule", {
12095
- value: true
12096
- });
12097
- exports['default'] = isBeforeDay;
12098
-
12099
- var _moment = __webpack_require__(0);
12100
-
12101
- var _moment2 = _interopRequireDefault(_moment);
12102
-
12103
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
12104
-
12105
- function isBeforeDay(a, b) {
12106
- if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
12107
-
12108
- var aYear = a.year();
12109
- var aMonth = a.month();
12110
-
12111
- var bYear = b.year();
12112
- var bMonth = b.month();
12113
-
12114
- var isSameYear = aYear === bYear;
12115
- var isSameMonth = aMonth === bMonth;
12116
-
12117
- if (isSameYear && isSameMonth) return a.date() < b.date();
12118
- if (isSameYear) return aMonth < bMonth;
12119
- return aYear < bYear;
12120
- }
12121
-
12122
- /***/ }),
12123
- /* 75 */
12124
- /***/ (function(module, exports, __webpack_require__) {
12125
-
12126
- "use strict";
12127
-
12128
-
12129
- Object.defineProperty(exports, "__esModule", {
12130
- value: true
12131
- });
12132
-
12133
- var _react = __webpack_require__(9);
12134
-
12135
- var _react2 = _interopRequireDefault(_react);
12136
-
12137
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
12138
-
12139
- var CloseButton = function () {
12140
- function CloseButton(props) {
12141
- return _react2['default'].createElement(
12142
- 'svg',
12143
- props,
12144
- _react2['default'].createElement('path', {
12145
- fillRule: 'evenodd',
12146
- d: 'M11.53.47a.75.75 0 0 0-1.061 0l-4.47 4.47L1.529.47A.75.75 0 1 0 .468 1.531l4.47 4.47-4.47 4.47a.75.75 0 1 0 1.061 1.061l4.47-4.47 4.47 4.47a.75.75 0 1 0 1.061-1.061l-4.47-4.47 4.47-4.47a.75.75 0 0 0 0-1.061z'
12147
- })
12148
- );
12149
- }
12150
-
12151
- return CloseButton;
12152
- }();
12153
-
12154
- CloseButton.defaultProps = {
12155
- viewBox: '0 0 12 12'
12156
- };
12157
- exports['default'] = CloseButton;
12158
-
12159
- /***/ }),
12160
- /* 76 */
12161
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
12162
-
12163
- "use strict";
12164
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__menu__ = __webpack_require__(790);
12165
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__menu__["a"]; });
12166
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__tabbable__ = __webpack_require__(791);
12167
- /* unused harmony reexport TabbableContainer */
12168
- /**
12169
- * Internal Dependencies
12170
- */
12171
-
12172
-
12173
- //# sourceMappingURL=index.js.map
12174
-
12175
- /***/ }),
12176
- /* 77 */
12177
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
12178
-
12179
- "use strict";
12180
- /* unused harmony export escapeAmpersand */
12181
- /* unused harmony export escapeQuotationMark */
12182
- /* unused harmony export escapeLessThan */
12183
- /* harmony export (immutable) */ __webpack_exports__["a"] = escapeAttribute;
12184
- /* harmony export (immutable) */ __webpack_exports__["c"] = escapeHTML;
12185
- /* harmony export (immutable) */ __webpack_exports__["b"] = escapeEditableHTML;
12186
- /* harmony export (immutable) */ __webpack_exports__["d"] = isValidAttributeName;
12187
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__escape_greater__ = __webpack_require__(466);
12188
- /**
12189
- * Internal dependencies
12190
- */
12191
-
12192
- /**
12193
- * Regular expression matching invalid attribute names.
12194
- *
12195
- * "Attribute names must consist of one or more characters other than controls,
12196
- * U+0020 SPACE, U+0022 ("), U+0027 ('), U+003E (>), U+002F (/), U+003D (=),
12197
- * and noncharacters."
12198
- *
12199
- * @see https://html.spec.whatwg.org/multipage/syntax.html#attributes-2
12200
- *
12201
- * @type {RegExp}
12202
- */
12203
-
12204
- var REGEXP_INVALID_ATTRIBUTE_NAME = /[\u007F-\u009F "'>/="\uFDD0-\uFDEF]/;
12205
- /**
12206
- * Returns a string with ampersands escaped. Note that this is an imperfect
12207
- * implementation, where only ampersands which do not appear as a pattern of
12208
- * named, decimal, or hexadecimal character references are escaped. Invalid
12209
- * named references (i.e. ambiguous ampersand) are are still permitted.
12210
- *
12211
- * @see https://w3c.github.io/html/syntax.html#character-references
12212
- * @see https://w3c.github.io/html/syntax.html#ambiguous-ampersand
12213
- * @see https://w3c.github.io/html/syntax.html#named-character-references
12214
- *
12215
- * @param {string} value Original string.
12216
- *
12217
- * @return {string} Escaped string.
12218
- */
12219
-
12220
- function escapeAmpersand(value) {
12221
- return value.replace(/&(?!([a-z0-9]+|#[0-9]+|#x[a-f0-9]+);)/gi, '&amp;');
12222
- }
12223
- /**
12224
- * Returns a string with quotation marks replaced.
12225
- *
12226
- * @param {string} value Original string.
12227
- *
12228
- * @return {string} Escaped string.
12229
- */
12230
-
12231
- function escapeQuotationMark(value) {
12232
- return value.replace(/"/g, '&quot;');
12233
- }
12234
- /**
12235
- * Returns a string with less-than sign replaced.
12236
- *
12237
- * @param {string} value Original string.
12238
- *
12239
- * @return {string} Escaped string.
12240
- */
12241
-
12242
- function escapeLessThan(value) {
12243
- return value.replace(/</g, '&lt;');
12244
- }
12245
- /**
12246
- * Returns an escaped attribute value.
12247
- *
12248
- * @see https://w3c.github.io/html/syntax.html#elements-attributes
12249
- *
12250
- * "[...] the text cannot contain an ambiguous ampersand [...] must not contain
12251
- * any literal U+0022 QUOTATION MARK characters (")"
12252
- *
12253
- * Note we also escape the greater than symbol, as this is used by wptexturize to
12254
- * split HTML strings. This is a WordPress specific fix
12255
- *
12256
- * Note that if a resolution for Trac#45387 comes to fruition, it is no longer
12257
- * necessary for `__unstableEscapeGreaterThan` to be used.
12258
- *
12259
- * See: https://core.trac.wordpress.org/ticket/45387
12260
- *
12261
- * @param {string} value Attribute value.
12262
- *
12263
- * @return {string} Escaped attribute value.
12264
- */
12265
-
12266
- function escapeAttribute(value) {
12267
- return Object(__WEBPACK_IMPORTED_MODULE_0__escape_greater__["a" /* default */])(escapeQuotationMark(escapeAmpersand(value)));
12268
- }
12269
- /**
12270
- * Returns an escaped HTML element value.
12271
- *
12272
- * @see https://w3c.github.io/html/syntax.html#writing-html-documents-elements
12273
- *
12274
- * "the text must not contain the character U+003C LESS-THAN SIGN (<) or an
12275
- * ambiguous ampersand."
12276
- *
12277
- * @param {string} value Element value.
12278
- *
12279
- * @return {string} Escaped HTML element value.
12280
- */
12281
-
12282
- function escapeHTML(value) {
12283
- return escapeLessThan(escapeAmpersand(value));
12284
- }
12285
- /**
12286
- * Returns an escaped Editable HTML element value. This is different from
12287
- * `escapeHTML`, because for editable HTML, ALL ampersands must be escaped in
12288
- * order to render the content correctly on the page.
12289
- *
12290
- * @param {string} value Element value.
12291
- *
12292
- * @return {string} Escaped HTML element value.
12293
- */
12294
-
12295
- function escapeEditableHTML(value) {
12296
- return escapeLessThan(value.replace(/&/g, '&amp;'));
12297
- }
12298
- /**
12299
- * Returns true if the given attribute name is valid, or false otherwise.
12300
- *
12301
- * @param {string} name Attribute name to test.
12302
- *
12303
- * @return {boolean} Whether attribute is valid.
12304
- */
12305
-
12306
- function isValidAttributeName(name) {
12307
- return !REGEXP_INVALID_ATTRIBUTE_NAME.test(name);
12308
- }
12309
- //# sourceMappingURL=index.js.map
12310
-
12311
- /***/ }),
12312
- /* 78 */
12313
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
12314
-
12315
- "use strict";
12316
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__svg__ = __webpack_require__(467);
12317
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__svg__["a"]; });
12318
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_0__svg__["b"]; });
12319
- /* harmony namespace reexport (by used) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_0__svg__["c"]; });
12320
-
12321
- //# sourceMappingURL=index.js.map
12322
-
12323
- /***/ }),
12324
- /* 79 */
12325
- /***/ (function(module, exports, __webpack_require__) {
12326
-
12327
- var __WEBPACK_AMD_DEFINE_RESULT__;/* global window, exports, define */
12328
-
12329
- !function() {
12330
- 'use strict'
12331
-
12332
- var re = {
12333
- not_string: /[^s]/,
12334
- not_bool: /[^t]/,
12335
- not_type: /[^T]/,
12336
- not_primitive: /[^v]/,
12337
- number: /[diefg]/,
12338
- numeric_arg: /[bcdiefguxX]/,
12339
- json: /[j]/,
12340
- not_json: /[^j]/,
12341
- text: /^[^\x25]+/,
12342
- modulo: /^\x25{2}/,
12343
- placeholder: /^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,
12344
- key: /^([a-z_][a-z_\d]*)/i,
12345
- key_access: /^\.([a-z_][a-z_\d]*)/i,
12346
- index_access: /^\[(\d+)\]/,
12347
- sign: /^[+-]/
12348
- }
12349
-
12350
- function sprintf(key) {
12351
- // `arguments` is not an array, but should be fine for this call
12352
- return sprintf_format(sprintf_parse(key), arguments)
12353
- }
12354
-
12355
- function vsprintf(fmt, argv) {
12356
- return sprintf.apply(null, [fmt].concat(argv || []))
12357
- }
12358
-
12359
- function sprintf_format(parse_tree, argv) {
12360
- var cursor = 1, tree_length = parse_tree.length, arg, output = '', i, k, ph, pad, pad_character, pad_length, is_positive, sign
12361
- for (i = 0; i < tree_length; i++) {
12362
- if (typeof parse_tree[i] === 'string') {
12363
- output += parse_tree[i]
12364
- }
12365
- else if (typeof parse_tree[i] === 'object') {
12366
- ph = parse_tree[i] // convenience purposes only
12367
- if (ph.keys) { // keyword argument
12368
- arg = argv[cursor]
12369
- for (k = 0; k < ph.keys.length; k++) {
12370
- if (arg == undefined) {
12371
- throw new Error(sprintf('[sprintf] Cannot access property "%s" of undefined value "%s"', ph.keys[k], ph.keys[k-1]))
12372
- }
12373
- arg = arg[ph.keys[k]]
12374
- }
12375
- }
12376
- else if (ph.param_no) { // positional argument (explicit)
12377
- arg = argv[ph.param_no]
12378
- }
12379
- else { // positional argument (implicit)
12380
- arg = argv[cursor++]
12381
- }
12382
-
12383
- if (re.not_type.test(ph.type) && re.not_primitive.test(ph.type) && arg instanceof Function) {
12384
- arg = arg()
12385
- }
12386
-
12387
- if (re.numeric_arg.test(ph.type) && (typeof arg !== 'number' && isNaN(arg))) {
12388
- throw new TypeError(sprintf('[sprintf] expecting number but found %T', arg))
12389
- }
12390
-
12391
- if (re.number.test(ph.type)) {
12392
- is_positive = arg >= 0
12393
- }
12394
-
12395
- switch (ph.type) {
12396
- case 'b':
12397
- arg = parseInt(arg, 10).toString(2)
12398
- break
12399
- case 'c':
12400
- arg = String.fromCharCode(parseInt(arg, 10))
12401
- break
12402
- case 'd':
12403
- case 'i':
12404
- arg = parseInt(arg, 10)
12405
- break
12406
- case 'j':
12407
- arg = JSON.stringify(arg, null, ph.width ? parseInt(ph.width) : 0)
12408
- break
12409
- case 'e':
12410
- arg = ph.precision ? parseFloat(arg).toExponential(ph.precision) : parseFloat(arg).toExponential()
12411
- break
12412
- case 'f':
12413
- arg = ph.precision ? parseFloat(arg).toFixed(ph.precision) : parseFloat(arg)
12414
- break
12415
- case 'g':
12416
- arg = ph.precision ? String(Number(arg.toPrecision(ph.precision))) : parseFloat(arg)
12417
- break
12418
- case 'o':
12419
- arg = (parseInt(arg, 10) >>> 0).toString(8)
12420
- break
12421
- case 's':
12422
- arg = String(arg)
12423
- arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
12424
- break
12425
- case 't':
12426
- arg = String(!!arg)
12427
- arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
12428
- break
12429
- case 'T':
12430
- arg = Object.prototype.toString.call(arg).slice(8, -1).toLowerCase()
12431
- arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
12432
- break
12433
- case 'u':
12434
- arg = parseInt(arg, 10) >>> 0
12435
- break
12436
- case 'v':
12437
- arg = arg.valueOf()
12438
- arg = (ph.precision ? arg.substring(0, ph.precision) : arg)
12439
- break
12440
- case 'x':
12441
- arg = (parseInt(arg, 10) >>> 0).toString(16)
12442
- break
12443
- case 'X':
12444
- arg = (parseInt(arg, 10) >>> 0).toString(16).toUpperCase()
12445
- break
12446
- }
12447
- if (re.json.test(ph.type)) {
12448
- output += arg
12449
- }
12450
- else {
12451
- if (re.number.test(ph.type) && (!is_positive || ph.sign)) {
12452
- sign = is_positive ? '+' : '-'
12453
- arg = arg.toString().replace(re.sign, '')
12454
- }
12455
- else {
12456
- sign = ''
12457
- }
12458
- pad_character = ph.pad_char ? ph.pad_char === '0' ? '0' : ph.pad_char.charAt(1) : ' '
12459
- pad_length = ph.width - (sign + arg).length
12460
- pad = ph.width ? (pad_length > 0 ? pad_character.repeat(pad_length) : '') : ''
12461
- output += ph.align ? sign + arg + pad : (pad_character === '0' ? sign + pad + arg : pad + sign + arg)
12462
- }
12463
- }
12464
- }
12465
- return output
12466
- }
12467
-
12468
- var sprintf_cache = Object.create(null)
12469
-
12470
- function sprintf_parse(fmt) {
12471
- if (sprintf_cache[fmt]) {
12472
- return sprintf_cache[fmt]
12473
- }
12474
-
12475
- var _fmt = fmt, match, parse_tree = [], arg_names = 0
12476
- while (_fmt) {
12477
- if ((match = re.text.exec(_fmt)) !== null) {
12478
- parse_tree.push(match[0])
12479
- }
12480
- else if ((match = re.modulo.exec(_fmt)) !== null) {
12481
- parse_tree.push('%')
12482
- }
12483
- else if ((match = re.placeholder.exec(_fmt)) !== null) {
12484
- if (match[2]) {
12485
- arg_names |= 1
12486
- var field_list = [], replacement_field = match[2], field_match = []
12487
- if ((field_match = re.key.exec(replacement_field)) !== null) {
12488
- field_list.push(field_match[1])
12489
- while ((replacement_field = replacement_field.substring(field_match[0].length)) !== '') {
12490
- if ((field_match = re.key_access.exec(replacement_field)) !== null) {
12491
- field_list.push(field_match[1])
12492
- }
12493
- else if ((field_match = re.index_access.exec(replacement_field)) !== null) {
12494
- field_list.push(field_match[1])
12495
- }
12496
- else {
12497
- throw new SyntaxError('[sprintf] failed to parse named argument key')
12498
- }
12499
- }
12500
- }
12501
- else {
12502
- throw new SyntaxError('[sprintf] failed to parse named argument key')
12503
- }
12504
- match[2] = field_list
12505
- }
12506
- else {
12507
- arg_names |= 2
12508
- }
12509
- if (arg_names === 3) {
12510
- throw new Error('[sprintf] mixing positional and named placeholders is not (yet) supported')
12511
- }
12512
-
12513
- parse_tree.push(
12514
- {
12515
- placeholder: match[0],
12516
- param_no: match[1],
12517
- keys: match[2],
12518
- sign: match[3],
12519
- pad_char: match[4],
12520
- align: match[5],
12521
- width: match[6],
12522
- precision: match[7],
12523
- type: match[8]
12524
- }
12525
- )
12526
- }
12527
- else {
12528
- throw new SyntaxError('[sprintf] unexpected placeholder')
12529
- }
12530
- _fmt = _fmt.substring(match[0].length)
12531
- }
12532
- return sprintf_cache[fmt] = parse_tree
12533
- }
12534
-
12535
- /**
12536
- * export to either browser or node.js
12537
- */
12538
- /* eslint-disable quote-props */
12539
- if (true) {
12540
- exports['sprintf'] = sprintf
12541
- exports['vsprintf'] = vsprintf
12542
- }
12543
- if (typeof window !== 'undefined') {
12544
- window['sprintf'] = sprintf
12545
- window['vsprintf'] = vsprintf
12546
-
12547
- if (true) {
12548
- !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
12549
- return {
12550
- 'sprintf': sprintf,
12551
- 'vsprintf': vsprintf
12552
- }
12553
- }).call(exports, __webpack_require__, exports, module),
12554
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__))
12555
- }
12556
- }
12557
- /* eslint-enable quote-props */
12558
- }(); // eslint-disable-line
12559
-
12560
-
12561
- /***/ }),
12562
- /* 80 */
12563
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
12564
-
12565
- "use strict";
12566
- /* harmony export (immutable) */ __webpack_exports__["a"] = Tannin;
12567
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tannin_plural_forms__ = __webpack_require__(475);
12568
-
12569
-
12570
- /**
12571
- * Tannin constructor options.
12572
- *
12573
- * @typedef {Object} TanninOptions
12574
- *
12575
- * @property {string} [contextDelimiter] Joiner in string lookup with context.
12576
- * @property {Function} [onMissingKey] Callback to invoke when key missing.
12577
- */
12578
-
12579
- /**
12580
- * Domain metadata.
12581
- *
12582
- * @typedef {Object} TanninDomainMetadata
12583
- *
12584
- * @property {string} [domain] Domain name.
12585
- * @property {string} [lang] Language code.
12586
- * @property {(string|Function)} [plural_forms] Plural forms expression or
12587
- * function evaluator.
12588
- */
12589
-
12590
- /**
12591
- * Domain translation pair respectively representing the singular and plural
12592
- * translation.
12593
- *
12594
- * @typedef {[string,string]} TanninTranslation
12595
- */
12596
-
12597
- /**
12598
- * Locale data domain. The key is used as reference for lookup, the value an
12599
- * array of two string entries respectively representing the singular and plural
12600
- * translation.
12601
- *
12602
- * @typedef {{[key:string]:TanninDomainMetadata|TanninTranslation,'':TanninDomainMetadata|TanninTranslation}} TanninLocaleDomain
12603
- */
12604
-
12605
- /**
12606
- * Jed-formatted locale data.
12607
- *
12608
- * @see http://messageformat.github.io/Jed/
12609
- *
12610
- * @typedef {{[domain:string]:TanninLocaleDomain}} TanninLocaleData
12611
- */
12612
-
12613
- /**
12614
- * Default Tannin constructor options.
12615
- *
12616
- * @type {TanninOptions}
12617
- */
12618
- var DEFAULT_OPTIONS = {
12619
- contextDelimiter: '\u0004',
12620
- onMissingKey: null,
12621
- };
12622
-
12623
- /**
12624
- * Given a specific locale data's config `plural_forms` value, returns the
12625
- * expression.
12626
- *
12627
- * @example
12628
- *
12629
- * ```
12630
- * getPluralExpression( 'nplurals=2; plural=(n != 1);' ) === '(n != 1)'
12631
- * ```
12632
- *
12633
- * @param {string} pf Locale data plural forms.
12634
- *
12635
- * @return {string} Plural forms expression.
12636
- */
12637
- function getPluralExpression( pf ) {
12638
- var parts, i, part;
12639
-
12640
- parts = pf.split( ';' );
12641
-
12642
- for ( i = 0; i < parts.length; i++ ) {
12643
- part = parts[ i ].trim();
12644
- if ( part.indexOf( 'plural=' ) === 0 ) {
12645
- return part.substr( 7 );
12646
- }
12647
- }
12648
- }
12649
-
12650
- /**
12651
- * Tannin constructor.
12652
- *
12653
- * @class
12654
- *
12655
- * @param {TanninLocaleData} data Jed-formatted locale data.
12656
- * @param {TanninOptions} [options] Tannin options.
12657
- */
12658
- function Tannin( data, options ) {
12659
- var key;
12660
-
12661
- /**
12662
- * Jed-formatted locale data.
12663
- *
12664
- * @name Tannin#data
12665
- * @type {TanninLocaleData}
12666
- */
12667
- this.data = data;
12668
-
12669
- /**
12670
- * Plural forms function cache, keyed by plural forms string.
12671
- *
12672
- * @name Tannin#pluralForms
12673
- * @type {Object<string,Function>}
12674
- */
12675
- this.pluralForms = {};
12676
-
12677
- /**
12678
- * Effective options for instance, including defaults.
12679
- *
12680
- * @name Tannin#options
12681
- * @type {TanninOptions}
12682
- */
12683
- this.options = {};
12684
-
12685
- for ( key in DEFAULT_OPTIONS ) {
12686
- this.options[ key ] = options !== undefined && key in options
12687
- ? options[ key ]
12688
- : DEFAULT_OPTIONS[ key ];
12689
- }
12690
- }
12691
-
12692
- /**
12693
- * Returns the plural form index for the given domain and value.
12694
- *
12695
- * @param {string} domain Domain on which to calculate plural form.
12696
- * @param {number} n Value for which plural form is to be calculated.
12697
- *
12698
- * @return {number} Plural form index.
12699
- */
12700
- Tannin.prototype.getPluralForm = function( domain, n ) {
12701
- var getPluralForm = this.pluralForms[ domain ],
12702
- config, plural, pf;
12703
-
12704
- if ( ! getPluralForm ) {
12705
- config = this.data[ domain ][ '' ];
12706
-
12707
- pf = (
12708
- config[ 'Plural-Forms' ] ||
12709
- config[ 'plural-forms' ] ||
12710
- // Ignore reason: As known, there's no way to document the empty
12711
- // string property on a key to guarantee this as metadata.
12712
- // @ts-ignore
12713
- config.plural_forms
12714
- );
12715
-
12716
- if ( typeof pf !== 'function' ) {
12717
- plural = getPluralExpression(
12718
- config[ 'Plural-Forms' ] ||
12719
- config[ 'plural-forms' ] ||
12720
- // Ignore reason: As known, there's no way to document the empty
12721
- // string property on a key to guarantee this as metadata.
12722
- // @ts-ignore
12723
- config.plural_forms
12724
- );
12725
-
12726
- pf = Object(__WEBPACK_IMPORTED_MODULE_0__tannin_plural_forms__["a" /* default */])( plural );
12727
- }
12728
-
12729
- getPluralForm = this.pluralForms[ domain ] = pf;
12730
- }
12731
-
12732
- return getPluralForm( n );
12733
- };
12734
-
12735
- /**
12736
- * Translate a string.
12737
- *
12738
- * @param {string} domain Translation domain.
12739
- * @param {string|void} context Context distinguishing terms of the same name.
12740
- * @param {string} singular Primary key for translation lookup.
12741
- * @param {string=} plural Fallback value used for non-zero plural
12742
- * form index.
12743
- * @param {number=} n Value to use in calculating plural form.
12744
- *
12745
- * @return {string} Translated string.
12746
- */
12747
- Tannin.prototype.dcnpgettext = function( domain, context, singular, plural, n ) {
12748
- var index, key, entry;
12749
-
12750
- if ( n === undefined ) {
12751
- // Default to singular.
12752
- index = 0;
12753
- } else {
12754
- // Find index by evaluating plural form for value.
12755
- index = this.getPluralForm( domain, n );
12756
- }
12757
-
12758
- key = singular;
12759
-
12760
- // If provided, context is prepended to key with delimiter.
12761
- if ( context ) {
12762
- key = context + this.options.contextDelimiter + singular;
12763
- }
12764
-
12765
- entry = this.data[ domain ][ key ];
12766
-
12767
- // Verify not only that entry exists, but that the intended index is within
12768
- // range and non-empty.
12769
- if ( entry && entry[ index ] ) {
12770
- return entry[ index ];
12771
- }
12772
-
12773
- if ( this.options.onMissingKey ) {
12774
- this.options.onMissingKey( singular, domain );
12775
- }
12776
-
12777
- // If entry not found, fall back to singular vs. plural with zero index
12778
- // representing the singular value.
12779
- return index === 0 ? singular : plural;
12780
- };
12781
-
12782
-
12783
- /***/ }),
12784
- /* 81 */
12785
- /***/ (function(module, exports) {
12786
-
12787
- var g;
12788
-
12789
- // This works in non-strict mode
12790
- g = (function() {
12791
- return this;
12792
- })();
12793
-
12794
- try {
12795
- // This works if eval is allowed (see CSP)
12796
- g = g || Function("return this")() || (1,eval)("this");
12797
- } catch(e) {
12798
- // This works if the window reference is available
12799
- if(typeof window === "object")
12800
- g = window;
12801
- }
12802
-
12803
- // g can still be undefined, but nothing to do about it...
12804
- // We return undefined, instead of nothing here, so it's
12805
- // easier to handle this case. if(!global) { ...}
12806
-
12807
- module.exports = g;
12808
-
12809
-
12810
- /***/ }),
12811
- /* 82 */
12812
- /***/ (function(module, exports, __webpack_require__) {
12813
-
12814
- "use strict";
12815
-
12816
-
12817
- Object.defineProperty(exports, "__esModule", {
12818
- value: true
12819
- });
12820
-
12821
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
12822
-
12823
- var _keys = __webpack_require__(162);
12824
-
12825
- var _keys2 = _interopRequireDefault(_keys);
12826
-
12827
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12828
-
12829
- var is = {
12830
- obj: function obj(value) {
12831
- return (typeof value === 'undefined' ? 'undefined' : _typeof(value)) === 'object' && !!value;
12832
- },
12833
- all: function all(value) {
12834
- return is.obj(value) && value.type === _keys2.default.all;
12835
- },
12836
- error: function error(value) {
12837
- return is.obj(value) && value.type === _keys2.default.error;
12838
- },
12839
- array: Array.isArray,
12840
- func: function func(value) {
12841
- return typeof value === 'function';
12842
- },
12843
- promise: function promise(value) {
12844
- return value && is.func(value.then);
12845
- },
12846
- iterator: function iterator(value) {
12847
- return value && is.func(value.next) && is.func(value.throw);
12848
- },
12849
- fork: function fork(value) {
12850
- return is.obj(value) && value.type === _keys2.default.fork;
12851
- },
12852
- join: function join(value) {
12853
- return is.obj(value) && value.type === _keys2.default.join;
12854
- },
12855
- race: function race(value) {
12856
- return is.obj(value) && value.type === _keys2.default.race;
12857
- },
12858
- call: function call(value) {
12859
- return is.obj(value) && value.type === _keys2.default.call;
12860
- },
12861
- cps: function cps(value) {
12862
- return is.obj(value) && value.type === _keys2.default.cps;
12863
- },
12864
- subscribe: function subscribe(value) {
12865
- return is.obj(value) && value.type === _keys2.default.subscribe;
12866
- },
12867
- channel: function channel(value) {
12868
- return is.obj(value) && is.func(value.subscribe);
12869
- }
12870
- };
12871
-
12872
- exports.default = is;
12873
-
12874
- /***/ }),
12875
- /* 83 */
12876
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
12877
-
12878
- "use strict";
12879
- /* harmony export (immutable) */ __webpack_exports__["a"] = useRegistry;
12880
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(15);
12881
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__context__ = __webpack_require__(171);
12882
- /**
12883
- * WordPress dependencies
12884
- */
12885
-
12886
- /**
12887
- * Internal dependencies
12888
- */
12889
-
12890
-
12891
- /**
12892
- * A custom react hook exposing the registry context for use.
12893
- *
12894
- * This exposes the `registry` value provided via the
12895
- * <a href="#RegistryProvider">Registry Provider</a> to a component implementing
12896
- * this hook.
12897
- *
12898
- * It acts similarly to the `useContext` react hook.
12899
- *
12900
- * Note: Generally speaking, `useRegistry` is a low level hook that in most cases
12901
- * won't be needed for implementation. Most interactions with the wp.data api
12902
- * can be performed via the `useSelect` hook, or the `withSelect` and
12903
- * `withDispatch` higher order components.
12904
- *
12905
- * @example
12906
- * ```js
12907
- * const {
12908
- * RegistryProvider,
12909
- * createRegistry,
12910
- * useRegistry,
12911
- * } = wp.data
12912
- *
12913
- * const registry = createRegistry( {} );
12914
- *
12915
- * const SomeChildUsingRegistry = ( props ) => {
12916
- * const registry = useRegistry( registry );
12917
- * // ...logic implementing the registry in other react hooks.
12918
- * };
12919
- *
12920
- *
12921
- * const ParentProvidingRegistry = ( props ) => {
12922
- * return <RegistryProvider value={ registry }>
12923
- * <SomeChildUsingRegistry { ...props } />
12924
- * </RegistryProvider>
12925
- * };
12926
- * ```
12927
- *
12928
- * @return {Function} A custom react hook exposing the registry context value.
12929
- */
12930
-
12931
- function useRegistry() {
12932
- return Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["g" /* useContext */])(__WEBPACK_IMPORTED_MODULE_1__context__["a" /* Context */]);
12933
- }
12934
- //# sourceMappingURL=use-registry.js.map
12935
-
12936
- /***/ }),
12937
- /* 84 */
12938
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
12939
-
12940
- "use strict";
12941
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__ = __webpack_require__(8);
12942
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
12943
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
12944
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
12945
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
12946
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
12947
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
12948
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(10);
12949
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__wordpress_element__ = __webpack_require__(1);
12950
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_classnames__ = __webpack_require__(14);
12951
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_9_classnames__);
12952
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__wordpress_is_shallow_equal__ = __webpack_require__(194);
12953
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__wordpress_is_shallow_equal___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_10__wordpress_is_shallow_equal__);
12954
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__wordpress_dom__ = __webpack_require__(54);
12955
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__wordpress_keycodes__ = __webpack_require__(32);
12956
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__utils__ = __webpack_require__(608);
12957
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__higher_order_with_focus_return__ = __webpack_require__(116);
12958
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__higher_order_with_constrained_tabbing__ = __webpack_require__(117);
12959
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__detect_outside__ = __webpack_require__(609);
12960
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__icon_button__ = __webpack_require__(37);
12961
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__scroll_lock__ = __webpack_require__(197);
12962
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__isolated_event_container__ = __webpack_require__(119);
12963
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__slot_fill__ = __webpack_require__(198);
12964
-
12965
-
12966
-
12967
-
12968
-
12969
-
12970
-
12971
-
12972
-
12973
-
12974
- /**
12975
- * External dependencies
12976
- */
12977
-
12978
-
12979
- /**
12980
- * WordPress dependencies
12981
- */
12982
-
12983
-
12984
-
12985
-
12986
- /**
12987
- * Internal dependencies
12988
- */
12989
-
12990
-
12991
-
12992
-
12993
-
12994
-
12995
-
12996
-
12997
-
12998
- var FocusManaged = Object(__WEBPACK_IMPORTED_MODULE_15__higher_order_with_constrained_tabbing__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_14__higher_order_with_focus_return__["a" /* default */])(function (_ref) {
12999
- var children = _ref.children;
13000
- return children;
13001
- }));
13002
- /**
13003
- * Name of slot in which popover should fill.
13004
- *
13005
- * @type {String}
13006
- */
13007
-
13008
- var SLOT_NAME = 'Popover';
13009
-
13010
- var Popover =
13011
- /*#__PURE__*/
13012
- function (_Component) {
13013
- Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_inherits__["a" /* default */])(Popover, _Component);
13014
-
13015
- function Popover() {
13016
- var _this;
13017
-
13018
- Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, Popover);
13019
-
13020
- _this = Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(Popover).apply(this, arguments));
13021
- _this.getAnchorRect = _this.getAnchorRect.bind(Object(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
13022
- _this.computePopoverPosition = _this.computePopoverPosition.bind(Object(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
13023
- _this.maybeClose = _this.maybeClose.bind(Object(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
13024
- _this.throttledRefresh = _this.throttledRefresh.bind(Object(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
13025
- _this.refresh = _this.refresh.bind(Object(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
13026
- _this.refreshOnAnchorMove = _this.refreshOnAnchorMove.bind(Object(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
13027
- _this.contentNode = Object(__WEBPACK_IMPORTED_MODULE_8__wordpress_element__["j" /* createRef */])();
13028
- _this.anchorNode = Object(__WEBPACK_IMPORTED_MODULE_8__wordpress_element__["j" /* createRef */])();
13029
- _this.state = {
13030
- popoverLeft: null,
13031
- popoverTop: null,
13032
- yAxis: 'top',
13033
- xAxis: 'center',
13034
- contentHeight: null,
13035
- contentWidth: null,
13036
- isMobile: false,
13037
- popoverSize: null
13038
- }; // Property used keep track of the previous anchor rect
13039
- // used to compute the popover position and size.
13040
-
13041
- _this.anchorRect = {};
13042
- return _this;
13043
- }
13044
-
13045
- Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_createClass__["a" /* default */])(Popover, [{
13046
- key: "componentDidMount",
13047
- value: function componentDidMount() {
13048
- var _this2 = this;
13049
-
13050
- this.toggleAutoRefresh(true);
13051
- this.refresh();
13052
- /*
13053
- * Without the setTimeout, the dom node is not being focused. Related:
13054
- * https://stackoverflow.com/questions/35522220/react-ref-with-focus-doesnt-work-without-settimeout-my-example
13055
- *
13056
- * TODO: Treat the cause, not the symptom.
13057
- */
13058
-
13059
- this.focusTimeout = setTimeout(function () {
13060
- _this2.focus();
13061
- }, 0);
13062
- }
13063
- }, {
13064
- key: "componentDidUpdate",
13065
- value: function componentDidUpdate(prevProps) {
13066
- if (prevProps.position !== this.props.position) {
13067
- this.computePopoverPosition(this.state.popoverSize, this.anchorRect);
13068
- }
13069
- }
13070
- }, {
13071
- key: "componentWillUnmount",
13072
- value: function componentWillUnmount() {
13073
- clearTimeout(this.focusTimeout);
13074
- this.toggleAutoRefresh(false);
13075
- }
13076
- }, {
13077
- key: "toggleAutoRefresh",
13078
- value: function toggleAutoRefresh(isActive) {
13079
- window.cancelAnimationFrame(this.rafHandle); // Refresh the popover every time the window is resized or scrolled
13080
-
13081
- var handler = isActive ? 'addEventListener' : 'removeEventListener';
13082
- window[handler]('resize', this.throttledRefresh);
13083
- window[handler]('scroll', this.throttledRefresh, true);
13084
- /*
13085
- * There are sometimes we need to reposition or resize the popover that are not
13086
- * handled by the resize/scroll window events (i.e. CSS changes in the layout
13087
- * that changes the position of the anchor).
13088
- *
13089
- * For these situations, we refresh the popover every 0.5s
13090
- */
13091
-
13092
- if (isActive) {
13093
- this.autoRefresh = setInterval(this.refreshOnAnchorMove, 500);
13094
- } else {
13095
- clearInterval(this.autoRefresh);
13096
- }
13097
- }
13098
- }, {
13099
- key: "throttledRefresh",
13100
- value: function throttledRefresh(event) {
13101
- window.cancelAnimationFrame(this.rafHandle);
13102
-
13103
- if (event && event.type === 'scroll' && this.contentNode.current.contains(event.target)) {
13104
- return;
13105
- }
13106
-
13107
- this.rafHandle = window.requestAnimationFrame(this.refresh);
13108
- }
13109
- /**
13110
- * Calling refreshOnAnchorMove
13111
- * will only refresh the popover position if the anchor moves.
13112
- */
13113
-
13114
- }, {
13115
- key: "refreshOnAnchorMove",
13116
- value: function refreshOnAnchorMove() {
13117
- var _this$props$getAnchor = this.props.getAnchorRect,
13118
- getAnchorRect = _this$props$getAnchor === void 0 ? this.getAnchorRect : _this$props$getAnchor;
13119
- var anchorRect = getAnchorRect(this.anchorNode.current);
13120
- var didAnchorRectChange = !__WEBPACK_IMPORTED_MODULE_10__wordpress_is_shallow_equal___default()(anchorRect, this.anchorRect);
13121
-
13122
- if (didAnchorRectChange) {
13123
- this.anchorRect = anchorRect;
13124
- this.computePopoverPosition(this.state.popoverSize, anchorRect);
13125
- }
13126
- }
13127
- /**
13128
- * Calling `refresh()` will force the Popover to recalculate its size and
13129
- * position. This is useful when a DOM change causes the anchor node to change
13130
- * position.
13131
- */
13132
-
13133
- }, {
13134
- key: "refresh",
13135
- value: function refresh() {
13136
- var _this$props$getAnchor2 = this.props.getAnchorRect,
13137
- getAnchorRect = _this$props$getAnchor2 === void 0 ? this.getAnchorRect : _this$props$getAnchor2;
13138
- var anchorRect = getAnchorRect(this.anchorNode.current);
13139
- var contentRect = this.contentNode.current.getBoundingClientRect();
13140
- var popoverSize = {
13141
- width: contentRect.width,
13142
- height: contentRect.height
13143
- };
13144
- var didPopoverSizeChange = !this.state.popoverSize || popoverSize.width !== this.state.popoverSize.width || popoverSize.height !== this.state.popoverSize.height;
13145
-
13146
- if (didPopoverSizeChange) {
13147
- this.setState({
13148
- popoverSize: popoverSize
13149
- });
13150
- }
13151
-
13152
- this.anchorRect = anchorRect;
13153
- this.computePopoverPosition(popoverSize, anchorRect);
13154
- }
13155
- }, {
13156
- key: "focus",
13157
- value: function focus() {
13158
- var focusOnMount = this.props.focusOnMount;
13159
-
13160
- if (!focusOnMount || !this.contentNode.current) {
13161
- return;
13162
- }
13163
-
13164
- if (focusOnMount === 'firstElement') {
13165
- // Find first tabbable node within content and shift focus, falling
13166
- // back to the popover panel itself.
13167
- var firstTabbable = __WEBPACK_IMPORTED_MODULE_11__wordpress_dom__["a" /* focus */].tabbable.find(this.contentNode.current)[0];
13168
-
13169
- if (firstTabbable) {
13170
- firstTabbable.focus();
13171
- } else {
13172
- this.contentNode.current.focus();
13173
- }
13174
-
13175
- return;
13176
- }
13177
-
13178
- if (focusOnMount === 'container') {
13179
- // Focus the popover panel itself so items in the popover are easily
13180
- // accessed via keyboard navigation.
13181
- this.contentNode.current.focus();
13182
- }
13183
- }
13184
- }, {
13185
- key: "getAnchorRect",
13186
- value: function getAnchorRect(anchor) {
13187
- if (!anchor || !anchor.parentNode) {
13188
- return;
13189
- }
13190
-
13191
- var rect = anchor.parentNode.getBoundingClientRect(); // subtract padding
13192
-
13193
- var _window$getComputedSt = window.getComputedStyle(anchor.parentNode),
13194
- paddingTop = _window$getComputedSt.paddingTop,
13195
- paddingBottom = _window$getComputedSt.paddingBottom;
13196
-
13197
- var topPad = parseInt(paddingTop, 10);
13198
- var bottomPad = parseInt(paddingBottom, 10);
13199
- return {
13200
- x: rect.left,
13201
- y: rect.top + topPad,
13202
- width: rect.width,
13203
- height: rect.height - topPad - bottomPad,
13204
- left: rect.left,
13205
- right: rect.right,
13206
- top: rect.top + topPad,
13207
- bottom: rect.bottom - bottomPad
13208
- };
13209
- }
13210
- }, {
13211
- key: "computePopoverPosition",
13212
- value: function computePopoverPosition(popoverSize, anchorRect) {
13213
- var _this$props = this.props,
13214
- _this$props$position = _this$props.position,
13215
- position = _this$props$position === void 0 ? 'top' : _this$props$position,
13216
- expandOnMobile = _this$props.expandOnMobile;
13217
-
13218
- var newPopoverPosition = Object(__WEBPACK_IMPORTED_MODULE_13__utils__["a" /* computePopoverPosition */])(anchorRect, popoverSize, position, expandOnMobile);
13219
-
13220
- if (this.state.yAxis !== newPopoverPosition.yAxis || this.state.xAxis !== newPopoverPosition.xAxis || this.state.popoverLeft !== newPopoverPosition.popoverLeft || this.state.popoverTop !== newPopoverPosition.popoverTop || this.state.contentHeight !== newPopoverPosition.contentHeight || this.state.contentWidth !== newPopoverPosition.contentWidth || this.state.isMobile !== newPopoverPosition.isMobile) {
13221
- this.setState(newPopoverPosition);
13222
- }
13223
- }
13224
- }, {
13225
- key: "maybeClose",
13226
- value: function maybeClose(event) {
13227
- var _this$props2 = this.props,
13228
- onKeyDown = _this$props2.onKeyDown,
13229
- onClose = _this$props2.onClose; // Close on escape
13230
-
13231
- if (event.keyCode === __WEBPACK_IMPORTED_MODULE_12__wordpress_keycodes__["e" /* ESCAPE */] && onClose) {
13232
- event.stopPropagation();
13233
- onClose();
13234
- } // Preserve original content prop behavior
13235
-
13236
-
13237
- if (onKeyDown) {
13238
- onKeyDown(event);
13239
- }
13240
- }
13241
- }, {
13242
- key: "render",
13243
- value: function render() {
13244
- var _this3 = this;
13245
-
13246
- var _this$props3 = this.props,
13247
- headerTitle = _this$props3.headerTitle,
13248
- onClose = _this$props3.onClose,
13249
- children = _this$props3.children,
13250
- className = _this$props3.className,
13251
- _this$props3$onClickO = _this$props3.onClickOutside,
13252
- onClickOutside = _this$props3$onClickO === void 0 ? onClose : _this$props3$onClickO,
13253
- noArrow = _this$props3.noArrow,
13254
- position = _this$props3.position,
13255
- range = _this$props3.range,
13256
- focusOnMount = _this$props3.focusOnMount,
13257
- getAnchorRect = _this$props3.getAnchorRect,
13258
- expandOnMobile = _this$props3.expandOnMobile,
13259
- contentProps = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(_this$props3, ["headerTitle", "onClose", "children", "className", "onClickOutside", "noArrow", "position", "range", "focusOnMount", "getAnchorRect", "expandOnMobile"]);
13260
-
13261
- var _this$state = this.state,
13262
- popoverLeft = _this$state.popoverLeft,
13263
- popoverTop = _this$state.popoverTop,
13264
- yAxis = _this$state.yAxis,
13265
- xAxis = _this$state.xAxis,
13266
- contentHeight = _this$state.contentHeight,
13267
- contentWidth = _this$state.contentWidth,
13268
- popoverSize = _this$state.popoverSize,
13269
- isMobile = _this$state.isMobile;
13270
- var classes = __WEBPACK_IMPORTED_MODULE_9_classnames___default()('components-popover', className, 'is-' + yAxis, 'is-' + xAxis, {
13271
- 'is-mobile': isMobile,
13272
- 'is-without-arrow': noArrow || xAxis === 'center' && yAxis === 'middle'
13273
- }); // Disable reason: We care to capture the _bubbled_ events from inputs
13274
- // within popover as inferring close intent.
13275
-
13276
- /* eslint-disable jsx-a11y/no-static-element-interactions */
13277
-
13278
- var content = Object(__WEBPACK_IMPORTED_MODULE_8__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_16__detect_outside__["a" /* default */], {
13279
- onClickOutside: onClickOutside
13280
- }, Object(__WEBPACK_IMPORTED_MODULE_8__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_19__isolated_event_container__["a" /* default */], Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])({
13281
- className: classes,
13282
- style: {
13283
- top: !isMobile && popoverTop ? popoverTop + 'px' : undefined,
13284
- left: !isMobile && popoverLeft ? popoverLeft + 'px' : undefined,
13285
- visibility: popoverSize ? undefined : 'hidden'
13286
- }
13287
- }, contentProps, {
13288
- onKeyDown: this.maybeClose
13289
- }), isMobile && Object(__WEBPACK_IMPORTED_MODULE_8__wordpress_element__["h" /* createElement */])("div", {
13290
- className: "components-popover__header"
13291
- }, Object(__WEBPACK_IMPORTED_MODULE_8__wordpress_element__["h" /* createElement */])("span", {
13292
- className: "components-popover__header-title"
13293
- }, headerTitle), Object(__WEBPACK_IMPORTED_MODULE_8__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_17__icon_button__["a" /* default */], {
13294
- className: "components-popover__close",
13295
- icon: "no-alt",
13296
- onClick: onClose
13297
- })), Object(__WEBPACK_IMPORTED_MODULE_8__wordpress_element__["h" /* createElement */])("div", {
13298
- ref: this.contentNode,
13299
- className: "components-popover__content",
13300
- style: {
13301
- maxHeight: !isMobile && contentHeight ? contentHeight + 'px' : undefined,
13302
- maxWidth: !isMobile && contentWidth ? contentWidth + 'px' : undefined
13303
- },
13304
- tabIndex: "-1"
13305
- }, children)));
13306
- /* eslint-enable jsx-a11y/no-static-element-interactions */
13307
- // Apply focus to element as long as focusOnMount is truthy; false is
13308
- // the only "disabled" value.
13309
-
13310
- if (focusOnMount) {
13311
- content = Object(__WEBPACK_IMPORTED_MODULE_8__wordpress_element__["h" /* createElement */])(FocusManaged, null, content);
13312
- }
13313
-
13314
- return Object(__WEBPACK_IMPORTED_MODULE_8__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_20__slot_fill__["a" /* Consumer */], null, function (_ref2) {
13315
- var getSlot = _ref2.getSlot;
13316
-
13317
- // In case there is no slot context in which to render,
13318
- // default to an in-place rendering.
13319
- if (getSlot && getSlot(SLOT_NAME)) {
13320
- content = Object(__WEBPACK_IMPORTED_MODULE_8__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_20__slot_fill__["b" /* Fill */], {
13321
- name: SLOT_NAME
13322
- }, content);
13323
- }
13324
-
13325
- return Object(__WEBPACK_IMPORTED_MODULE_8__wordpress_element__["h" /* createElement */])("span", {
13326
- ref: _this3.anchorNode
13327
- }, content, isMobile && expandOnMobile && Object(__WEBPACK_IMPORTED_MODULE_8__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_18__scroll_lock__["a" /* default */], null));
13328
- });
13329
- }
13330
- }]);
13331
-
13332
- return Popover;
13333
- }(__WEBPACK_IMPORTED_MODULE_8__wordpress_element__["b" /* Component */]);
13334
-
13335
- Popover.defaultProps = {
13336
- focusOnMount: 'firstElement',
13337
- noArrow: false
13338
- };
13339
- var PopoverContainer = Popover;
13340
-
13341
- PopoverContainer.Slot = function () {
13342
- return Object(__WEBPACK_IMPORTED_MODULE_8__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_20__slot_fill__["c" /* Slot */], {
13343
- bubblesVirtually: true,
13344
- name: SLOT_NAME
13345
- });
13346
- };
13347
-
13348
- /* harmony default export */ __webpack_exports__["a"] = (PopoverContainer);
13349
- //# sourceMappingURL=index.js.map
13350
-
13351
- /***/ }),
13352
- /* 85 */
13353
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
13354
-
13355
- "use strict";
13356
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
13357
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
13358
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
13359
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
13360
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
13361
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(10);
13362
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__wordpress_element__ = __webpack_require__(1);
13363
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__wordpress_deprecated__ = __webpack_require__(104);
13364
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__popover__ = __webpack_require__(84);
13365
-
13366
-
13367
-
13368
-
13369
-
13370
-
13371
-
13372
-
13373
- /**
13374
- * WordPress dependencies
13375
- */
13376
-
13377
-
13378
- /**
13379
- * Internal dependencies
13380
- */
13381
-
13382
-
13383
-
13384
- var Dropdown =
13385
- /*#__PURE__*/
13386
- function (_Component) {
13387
- Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__["a" /* default */])(Dropdown, _Component);
13388
-
13389
- function Dropdown() {
13390
- var _this;
13391
-
13392
- Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, Dropdown);
13393
-
13394
- _this = Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(Dropdown).apply(this, arguments));
13395
- _this.toggle = _this.toggle.bind(Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
13396
- _this.close = _this.close.bind(Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
13397
- _this.closeIfClickOutside = _this.closeIfClickOutside.bind(Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
13398
- _this.refresh = _this.refresh.bind(Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
13399
- _this.containerRef = Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["j" /* createRef */])();
13400
- _this.state = {
13401
- isOpen: false
13402
- };
13403
- return _this;
13404
- }
13405
-
13406
- Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__["a" /* default */])(Dropdown, [{
13407
- key: "componentWillUnmount",
13408
- value: function componentWillUnmount() {
13409
- var isOpen = this.state.isOpen;
13410
- var onToggle = this.props.onToggle;
13411
-
13412
- if (isOpen && onToggle) {
13413
- onToggle(false);
13414
- }
13415
- }
13416
- }, {
13417
- key: "componentDidUpdate",
13418
- value: function componentDidUpdate(prevProps, prevState) {
13419
- var isOpen = this.state.isOpen;
13420
- var onToggle = this.props.onToggle;
13421
-
13422
- if (prevState.isOpen !== isOpen && onToggle) {
13423
- onToggle(isOpen);
13424
- }
13425
- }
13426
- /**
13427
- * When contents change height due to user interaction,
13428
- * `refresh` can be called to re-render Popover with correct
13429
- * attributes which allow scroll, if need be.
13430
- * @deprecated
13431
- */
13432
-
13433
- }, {
13434
- key: "refresh",
13435
- value: function refresh() {
13436
- Object(__WEBPACK_IMPORTED_MODULE_7__wordpress_deprecated__["a" /* default */])('Dropdown.refresh()', {
13437
- plugin: 'Gutenberg',
13438
- version: '4.5',
13439
- hint: 'Popover is now automatically re-rendered without needing to execute "refresh"'
13440
- });
13441
- }
13442
- }, {
13443
- key: "toggle",
13444
- value: function toggle() {
13445
- this.setState(function (state) {
13446
- return {
13447
- isOpen: !state.isOpen
13448
- };
13449
- });
13450
- }
13451
- /**
13452
- * Closes the dropdown if a click occurs outside the dropdown wrapper. This
13453
- * is intentionally distinct from `onClose` in that a click outside the
13454
- * popover may occur in the toggling of the dropdown via its toggle button.
13455
- * The correct behavior is to keep the dropdown closed.
13456
- *
13457
- * @param {MouseEvent} event Click event triggering `onClickOutside`.
13458
- */
13459
-
13460
- }, {
13461
- key: "closeIfClickOutside",
13462
- value: function closeIfClickOutside(event) {
13463
- if (!this.containerRef.current.contains(event.target)) {
13464
- this.close();
13465
- }
13466
- }
13467
- }, {
13468
- key: "close",
13469
- value: function close() {
13470
- this.setState({
13471
- isOpen: false
13472
- });
13473
- }
13474
- }, {
13475
- key: "render",
13476
- value: function render() {
13477
- var isOpen = this.state.isOpen;
13478
- var _this$props = this.props,
13479
- renderContent = _this$props.renderContent,
13480
- renderToggle = _this$props.renderToggle,
13481
- _this$props$position = _this$props.position,
13482
- position = _this$props$position === void 0 ? 'bottom' : _this$props$position,
13483
- className = _this$props.className,
13484
- contentClassName = _this$props.contentClassName,
13485
- expandOnMobile = _this$props.expandOnMobile,
13486
- headerTitle = _this$props.headerTitle;
13487
- var args = {
13488
- isOpen: isOpen,
13489
- onToggle: this.toggle,
13490
- onClose: this.close
13491
- };
13492
- return Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])("div", {
13493
- className: className,
13494
- ref: this.containerRef
13495
- }, renderToggle(args), isOpen && Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_8__popover__["a" /* default */], {
13496
- className: contentClassName,
13497
- position: position,
13498
- onClose: this.close,
13499
- onClickOutside: this.closeIfClickOutside,
13500
- expandOnMobile: expandOnMobile,
13501
- headerTitle: headerTitle
13502
- }, renderContent(args)));
13503
- }
13504
- }]);
13505
-
13506
- return Dropdown;
13507
- }(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["b" /* Component */]);
13508
-
13509
- /* harmony default export */ __webpack_exports__["a"] = (Dropdown);
13510
- //# sourceMappingURL=index.js.map
13511
-
13512
- /***/ }),
13513
- /* 86 */
13514
- /***/ (function(module, exports, __webpack_require__) {
13515
-
13516
- "use strict";
13517
-
13518
-
13519
- var fnToStr = Function.prototype.toString;
13520
- var reflectApply = typeof Reflect === 'object' && Reflect !== null && Reflect.apply;
13521
- var badArrayLike;
13522
- var isCallableMarker;
13523
- if (typeof reflectApply === 'function' && typeof Object.defineProperty === 'function') {
13524
- try {
13525
- badArrayLike = Object.defineProperty({}, 'length', {
13526
- get: function () {
13527
- throw isCallableMarker;
13528
- }
13529
- });
13530
- isCallableMarker = {};
13531
- // eslint-disable-next-line no-throw-literal
13532
- reflectApply(function () { throw 42; }, null, badArrayLike);
13533
- } catch (_) {
13534
- if (_ !== isCallableMarker) {
13535
- reflectApply = null;
13536
- }
13537
- }
13538
- } else {
13539
- reflectApply = null;
13540
- }
13541
-
13542
- var constructorRegex = /^\s*class\b/;
13543
- var isES6ClassFn = function isES6ClassFunction(value) {
13544
- try {
13545
- var fnStr = fnToStr.call(value);
13546
- return constructorRegex.test(fnStr);
13547
- } catch (e) {
13548
- return false; // not a function
13549
- }
13550
- };
13551
-
13552
- var tryFunctionObject = function tryFunctionToStr(value) {
13553
- try {
13554
- if (isES6ClassFn(value)) { return false; }
13555
- fnToStr.call(value);
13556
- return true;
13557
- } catch (e) {
13558
- return false;
13559
- }
13560
- };
13561
- var toStr = Object.prototype.toString;
13562
- var fnClass = '[object Function]';
13563
- var genClass = '[object GeneratorFunction]';
13564
- var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';
13565
-
13566
- module.exports = reflectApply
13567
- ? function isCallable(value) {
13568
- if (!value) { return false; }
13569
- if (typeof value !== 'function' && typeof value !== 'object') { return false; }
13570
- if (typeof value === 'function' && !value.prototype) { return true; }
13571
- try {
13572
- reflectApply(value, null, badArrayLike);
13573
- } catch (e) {
13574
- if (e !== isCallableMarker) { return false; }
13575
- }
13576
- return !isES6ClassFn(value);
13577
- }
13578
- : function isCallable(value) {
13579
- if (!value) { return false; }
13580
- if (typeof value !== 'function' && typeof value !== 'object') { return false; }
13581
- if (typeof value === 'function' && !value.prototype) { return true; }
13582
- if (hasToStringTag) { return tryFunctionObject(value); }
13583
- if (isES6ClassFn(value)) { return false; }
13584
- var strClass = toStr.call(value);
13585
- return strClass === fnClass || strClass === genClass;
13586
- };
13587
-
13588
-
13589
- /***/ }),
13590
- /* 87 */
13591
- /***/ (function(module, exports, __webpack_require__) {
13592
-
13593
- "use strict";
13594
-
13595
-
13596
- Object.defineProperty(exports, "__esModule", {
13597
- value: true
13598
- });
13599
-
13600
- var _propTypes = __webpack_require__(11);
13601
-
13602
- var _propTypes2 = _interopRequireDefault(_propTypes);
13603
-
13604
- var _airbnbPropTypes = __webpack_require__(22);
13605
-
13606
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
13607
-
13608
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13609
-
13610
- function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
13611
-
13612
- exports['default'] = (0, _airbnbPropTypes.and)([_propTypes2['default'].instanceOf(Set), function () {
13613
- function modifiers(props, propName) {
13614
- for (var _len = arguments.length, rest = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
13615
- rest[_key - 2] = arguments[_key];
13616
- }
13617
-
13618
- var propValue = props[propName];
13619
-
13620
- var firstError = void 0;
13621
- [].concat(_toConsumableArray(propValue)).some(function (v, i) {
13622
- var _PropTypes$string;
13623
-
13624
- var fakePropName = String(propName) + ': index ' + String(i);
13625
- firstError = (_PropTypes$string = _propTypes2['default'].string).isRequired.apply(_PropTypes$string, [_defineProperty({}, fakePropName, v), fakePropName].concat(rest));
13626
- return firstError != null;
13627
- });
13628
- return firstError == null ? null : firstError;
13629
- }
13630
-
13631
- return modifiers;
13632
- }()], 'Modifiers (Set of Strings)');
13633
-
13634
- /***/ }),
13635
- /* 88 */
13636
- /***/ (function(module, exports, __webpack_require__) {
13637
-
13638
- "use strict";
13639
-
13640
-
13641
- Object.defineProperty(exports, "__esModule", {
13642
- value: true
13643
- });
13644
- exports['default'] = toISODateString;
13645
-
13646
- var _moment = __webpack_require__(0);
13647
-
13648
- var _moment2 = _interopRequireDefault(_moment);
13649
-
13650
- var _toMomentObject = __webpack_require__(59);
13651
-
13652
- var _toMomentObject2 = _interopRequireDefault(_toMomentObject);
13653
-
13654
- var _constants = __webpack_require__(17);
13655
-
13656
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
13657
-
13658
- function toISODateString(date, currentFormat) {
13659
- var dateObj = _moment2['default'].isMoment(date) ? date : (0, _toMomentObject2['default'])(date, currentFormat);
13660
- if (!dateObj) return null;
13661
-
13662
- return dateObj.format(_constants.ISO_FORMAT);
13663
- }
13664
-
13665
- /***/ }),
13666
- /* 89 */
13667
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
13668
-
13669
- "use strict";
13670
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
13671
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "addEventListener", function() { return addEventListener; });
13672
- var CAN_USE_DOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
13673
-
13674
- // Adapted from Modernizr
13675
- // https://github.com/Modernizr/Modernizr/blob/acb3f0d9/feature-detects/dom/passiveeventlisteners.js#L26-L37
13676
- function testPassiveEventListeners() {
13677
- if (!CAN_USE_DOM) {
13678
- return false;
13679
- }
13680
-
13681
- if (!window.addEventListener || !window.removeEventListener || !Object.defineProperty) {
13682
- return false;
13683
- }
13684
-
13685
- var supportsPassiveOption = false;
13686
- try {
13687
- var opts = Object.defineProperty({}, 'passive', {
13688
- // eslint-disable-next-line getter-return
13689
- get: function () {
13690
- function get() {
13691
- supportsPassiveOption = true;
13692
- }
13693
-
13694
- return get;
13695
- }()
13696
- });
13697
- var noop = function noop() {};
13698
- window.addEventListener('testPassiveEventSupport', noop, opts);
13699
- window.removeEventListener('testPassiveEventSupport', noop, opts);
13700
- } catch (e) {
13701
- // do nothing
13702
- }
13703
-
13704
- return supportsPassiveOption;
13705
- }
13706
-
13707
- var memoized = void 0;
13708
-
13709
- function canUsePassiveEventListeners() {
13710
- if (memoized === undefined) {
13711
- memoized = testPassiveEventListeners();
13712
- }
13713
- return memoized;
13714
- }
13715
-
13716
- function normalizeEventOptions(eventOptions) {
13717
- if (!eventOptions) {
13718
- return undefined;
13719
- }
13720
-
13721
- if (!canUsePassiveEventListeners()) {
13722
- // If the browser does not support the passive option, then it is expecting
13723
- // a boolean for the options argument to specify whether it should use
13724
- // capture or not. In more modern browsers, this is passed via the `capture`
13725
- // option, so let's just hoist that value up.
13726
- return !!eventOptions.capture;
13727
- }
13728
-
13729
- return eventOptions;
13730
- }
13731
-
13732
- /* eslint-disable no-bitwise */
13733
-
13734
- /**
13735
- * Generate a unique key for any set of event options
13736
- */
13737
- function eventOptionsKey(normalizedEventOptions) {
13738
- if (!normalizedEventOptions) {
13739
- return 0;
13740
- }
13741
-
13742
- // If the browser does not support passive event listeners, the normalized
13743
- // event options will be a boolean.
13744
- if (normalizedEventOptions === true) {
13745
- return 100;
13746
- }
13747
-
13748
- // At this point, the browser supports passive event listeners, so we expect
13749
- // the event options to be an object with possible properties of capture,
13750
- // passive, and once.
13751
- //
13752
- // We want to consistently return the same value, regardless of the order of
13753
- // these properties, so let's use binary maths to assign each property to a
13754
- // bit, and then add those together (with an offset to account for the
13755
- // booleans at the beginning of this function).
13756
- var capture = normalizedEventOptions.capture << 0;
13757
- var passive = normalizedEventOptions.passive << 1;
13758
- var once = normalizedEventOptions.once << 2;
13759
- return capture + passive + once;
13760
- }
13761
-
13762
- function ensureCanMutateNextEventHandlers(eventHandlers) {
13763
- if (eventHandlers.handlers === eventHandlers.nextHandlers) {
13764
- // eslint-disable-next-line no-param-reassign
13765
- eventHandlers.nextHandlers = eventHandlers.handlers.slice();
13766
- }
13767
- }
13768
-
13769
- function TargetEventHandlers(target) {
13770
- this.target = target;
13771
- this.events = {};
13772
- }
13773
-
13774
- TargetEventHandlers.prototype.getEventHandlers = function () {
13775
- function getEventHandlers(eventName, options) {
13776
- var key = String(eventName) + ' ' + String(eventOptionsKey(options));
13777
-
13778
- if (!this.events[key]) {
13779
- this.events[key] = {
13780
- handlers: [],
13781
- handleEvent: undefined
13782
- };
13783
- this.events[key].nextHandlers = this.events[key].handlers;
13784
- }
13785
-
13786
- return this.events[key];
13787
- }
13788
-
13789
- return getEventHandlers;
13790
- }();
13791
-
13792
- TargetEventHandlers.prototype.handleEvent = function () {
13793
- function handleEvent(eventName, options, event) {
13794
- var eventHandlers = this.getEventHandlers(eventName, options);
13795
- eventHandlers.handlers = eventHandlers.nextHandlers;
13796
- eventHandlers.handlers.forEach(function (handler) {
13797
- if (handler) {
13798
- // We need to check for presence here because a handler function may
13799
- // cause later handlers to get removed. This can happen if you for
13800
- // instance have a waypoint that unmounts another waypoint as part of an
13801
- // onEnter/onLeave handler.
13802
- handler(event);
13803
- }
13804
- });
13805
- }
13806
-
13807
- return handleEvent;
13808
- }();
13809
-
13810
- TargetEventHandlers.prototype.add = function () {
13811
- function add(eventName, listener, options) {
13812
- var _this = this;
13813
-
13814
- // options has already been normalized at this point.
13815
- var eventHandlers = this.getEventHandlers(eventName, options);
13816
-
13817
- ensureCanMutateNextEventHandlers(eventHandlers);
13818
-
13819
- if (eventHandlers.nextHandlers.length === 0) {
13820
- eventHandlers.handleEvent = this.handleEvent.bind(this, eventName, options);
13821
-
13822
- this.target.addEventListener(eventName, eventHandlers.handleEvent, options);
13823
- }
13824
-
13825
- eventHandlers.nextHandlers.push(listener);
13826
-
13827
- var isSubscribed = true;
13828
- var unsubscribe = function () {
13829
- function unsubscribe() {
13830
- if (!isSubscribed) {
13831
- return;
13832
- }
13833
-
13834
- isSubscribed = false;
13835
-
13836
- ensureCanMutateNextEventHandlers(eventHandlers);
13837
- var index = eventHandlers.nextHandlers.indexOf(listener);
13838
- eventHandlers.nextHandlers.splice(index, 1);
13839
-
13840
- if (eventHandlers.nextHandlers.length === 0) {
13841
- // All event handlers have been removed, so we want to remove the event
13842
- // listener from the target node.
13843
-
13844
- if (_this.target) {
13845
- // There can be a race condition where the target may no longer exist
13846
- // when this function is called, e.g. when a React component is
13847
- // unmounting. Guarding against this prevents the following error:
13848
- //
13849
- // Cannot read property 'removeEventListener' of undefined
13850
- _this.target.removeEventListener(eventName, eventHandlers.handleEvent, options);
13851
- }
13852
-
13853
- eventHandlers.handleEvent = undefined;
13854
- }
13855
- }
13856
-
13857
- return unsubscribe;
13858
- }();
13859
- return unsubscribe;
13860
- }
13861
-
13862
- return add;
13863
- }();
13864
-
13865
- var EVENT_HANDLERS_KEY = '__consolidated_events_handlers__';
13866
-
13867
- // eslint-disable-next-line import/prefer-default-export
13868
- function addEventListener(target, eventName, listener, options) {
13869
- if (!target[EVENT_HANDLERS_KEY]) {
13870
- // eslint-disable-next-line no-param-reassign
13871
- target[EVENT_HANDLERS_KEY] = new TargetEventHandlers(target);
13872
- }
13873
- var normalizedEventOptions = normalizeEventOptions(options);
13874
- return target[EVENT_HANDLERS_KEY].add(eventName, listener, normalizedEventOptions);
13875
- }
13876
-
13877
-
13878
-
13879
-
13880
- /***/ }),
13881
- /* 90 */
13882
- /***/ (function(module, exports, __webpack_require__) {
13883
-
13884
- "use strict";
13885
-
13886
-
13887
- Object.defineProperty(exports, "__esModule", {
13888
- value: true
13889
- });
13890
- exports['default'] = toISOMonthString;
13891
-
13892
- var _moment = __webpack_require__(0);
13893
-
13894
- var _moment2 = _interopRequireDefault(_moment);
13895
-
13896
- var _toMomentObject = __webpack_require__(59);
13897
-
13898
- var _toMomentObject2 = _interopRequireDefault(_toMomentObject);
13899
-
13900
- var _constants = __webpack_require__(17);
13901
-
13902
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
13903
-
13904
- function toISOMonthString(date, currentFormat) {
13905
- var dateObj = _moment2['default'].isMoment(date) ? date : (0, _toMomentObject2['default'])(date, currentFormat);
13906
- if (!dateObj) return null;
13907
-
13908
- return dateObj.format(_constants.ISO_MONTH_FORMAT);
13909
- }
13910
-
13911
- /***/ }),
13912
- /* 91 */
13913
- /***/ (function(module, exports, __webpack_require__) {
13914
-
13915
- "use strict";
13916
-
13917
-
13918
- Object.defineProperty(exports, "__esModule", {
13919
- value: true
13920
- });
13921
-
13922
- var _propTypes = __webpack_require__(11);
13923
-
13924
- var _propTypes2 = _interopRequireDefault(_propTypes);
13925
-
13926
- var _constants = __webpack_require__(17);
13927
-
13928
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
13929
-
13930
- exports['default'] = _propTypes2['default'].oneOfType([_propTypes2['default'].bool, _propTypes2['default'].oneOf([_constants.START_DATE, _constants.END_DATE])]);
13931
-
13932
- /***/ }),
13933
- /* 92 */
13934
- /***/ (function(module, exports, __webpack_require__) {
13935
-
13936
- "use strict";
13937
-
13938
-
13939
- Object.defineProperty(exports, "__esModule", {
13940
- value: true
13941
- });
13942
- exports['default'] = isAfterDay;
13943
-
13944
- var _moment = __webpack_require__(0);
13945
-
13946
- var _moment2 = _interopRequireDefault(_moment);
13947
-
13948
- var _isBeforeDay = __webpack_require__(74);
13949
-
13950
- var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
13951
-
13952
- var _isSameDay = __webpack_require__(58);
13953
-
13954
- var _isSameDay2 = _interopRequireDefault(_isSameDay);
13955
-
13956
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
13957
-
13958
- function isAfterDay(a, b) {
13959
- if (!_moment2['default'].isMoment(a) || !_moment2['default'].isMoment(b)) return false;
13960
- return !(0, _isBeforeDay2['default'])(a, b) && !(0, _isSameDay2['default'])(a, b);
13961
- }
13962
-
13963
- /***/ }),
13964
- /* 93 */
13965
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
13966
-
13967
- "use strict";
13968
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_url__ = __webpack_require__(829);
13969
- /* unused harmony reexport isURL */
13970
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_email__ = __webpack_require__(440);
13971
- /* unused harmony reexport isEmail */
13972
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__get_protocol__ = __webpack_require__(830);
13973
- /* unused harmony reexport getProtocol */
13974
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__is_valid_protocol__ = __webpack_require__(831);
13975
- /* unused harmony reexport isValidProtocol */
13976
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__get_authority__ = __webpack_require__(832);
13977
- /* unused harmony reexport getAuthority */
13978
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__is_valid_authority__ = __webpack_require__(833);
13979
- /* unused harmony reexport isValidAuthority */
13980
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__get_path__ = __webpack_require__(834);
13981
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_6__get_path__["a"]; });
13982
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__is_valid_path__ = __webpack_require__(835);
13983
- /* unused harmony reexport isValidPath */
13984
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__get_query_string__ = __webpack_require__(836);
13985
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_8__get_query_string__["a"]; });
13986
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__is_valid_query_string__ = __webpack_require__(837);
13987
- /* unused harmony reexport isValidQueryString */
13988
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__get_path_and_query_string__ = __webpack_require__(838);
13989
- /* unused harmony reexport getPathAndQueryString */
13990
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__get_fragment__ = __webpack_require__(839);
13991
- /* unused harmony reexport getFragment */
13992
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__is_valid_fragment__ = __webpack_require__(840);
13993
- /* unused harmony reexport isValidFragment */
13994
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__add_query_args__ = __webpack_require__(841);
13995
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_13__add_query_args__["a"]; });
13996
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__get_query_arg__ = __webpack_require__(442);
13997
- /* unused harmony reexport getQueryArg */
13998
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__has_query_arg__ = __webpack_require__(844);
13999
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_15__has_query_arg__["a"]; });
14000
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__remove_query_args__ = __webpack_require__(845);
14001
- /* unused harmony reexport removeQueryArgs */
14002
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__prepend_http__ = __webpack_require__(846);
14003
- /* unused harmony reexport prependHTTP */
14004
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__safe_decode_uri__ = __webpack_require__(847);
14005
- /* unused harmony reexport safeDecodeURI */
14006
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__safe_decode_uri_component__ = __webpack_require__(848);
14007
- /* unused harmony reexport safeDecodeURIComponent */
14008
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__filter_url_for_display__ = __webpack_require__(849);
14009
- /* unused harmony reexport filterURLForDisplay */
14010
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__clean_for_slug__ = __webpack_require__(850);
14011
- /* unused harmony reexport cleanForSlug */
14012
-
14013
-
14014
-
14015
-
14016
-
14017
-
14018
-
14019
-
14020
-
14021
-
14022
-
14023
-
14024
-
14025
-
14026
-
14027
-
14028
-
14029
-
14030
-
14031
-
14032
-
14033
-
14034
- //# sourceMappingURL=index.js.map
14035
-
14036
- /***/ }),
14037
- /* 94 */
14038
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
14039
-
14040
- "use strict";
14041
- /* harmony export (immutable) */ __webpack_exports__["f"] = concatChildren;
14042
- /* unused harmony export switchChildrenNodeName */
14043
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__ = __webpack_require__(23);
14044
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
14045
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(9);
14046
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
14047
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash__ = __webpack_require__(2);
14048
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash__);
14049
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "Children")) __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["Children"]; });
14050
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "cloneElement")) __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["cloneElement"]; });
14051
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "Component")) __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["Component"]; });
14052
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "createContext")) __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["createContext"]; });
14053
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "createElement")) __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["createElement"]; });
14054
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "createRef")) __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["createRef"]; });
14055
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "forwardRef")) __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["forwardRef"]; });
14056
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "Fragment")) __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["Fragment"]; });
14057
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "isValidElement")) __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["isValidElement"]; });
14058
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "StrictMode")) __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["StrictMode"]; });
14059
-
14060
-
14061
-
14062
- /**
14063
- * External dependencies
14064
- */
14065
-
14066
-
14067
-
14068
- /**
14069
- * Creates a copy of an element with extended props.
14070
- *
14071
- * @param {WPElement} element Element
14072
- * @param {?Object} props Props to apply to cloned element
14073
- *
14074
- * @return {WPElement} Cloned element.
14075
- */
14076
-
14077
-
14078
- /**
14079
- * A base class to create WordPress Components (Refs, state and lifecycle hooks)
14080
- */
14081
-
14082
-
14083
- /**
14084
- * Creates a context object containing two components: a provider and consumer.
14085
- *
14086
- * @param {Object} defaultValue A default data stored in the context.
14087
- *
14088
- * @return {Object} Context object.
14089
- */
14090
-
14091
-
14092
- /**
14093
- * Returns a new element of given type. Type can be either a string tag name or
14094
- * another function which itself returns an element.
14095
- *
14096
- * @param {?(string|Function)} type Tag name or element creator
14097
- * @param {Object} props Element properties, either attribute
14098
- * set to apply to DOM node or values to
14099
- * pass through to element creator
14100
- * @param {...WPElement} children Descendant elements
14101
- *
14102
- * @return {WPElement} Element.
14103
- */
14104
-
14105
-
14106
- /**
14107
- * Returns an object tracking a reference to a rendered element via its
14108
- * `current` property as either a DOMElement or Element, dependent upon the
14109
- * type of element rendered with the ref attribute.
14110
- *
14111
- * @return {Object} Ref object.
14112
- */
14113
-
14114
-
14115
- /**
14116
- * Component enhancer used to enable passing a ref to its wrapped component.
14117
- * Pass a function argument which receives `props` and `ref` as its arguments,
14118
- * returning an element using the forwarded ref. The return value is a new
14119
- * component which forwards its ref.
14120
- *
14121
- * @param {Function} forwarder Function passed `props` and `ref`, expected to
14122
- * return an element.
14123
- *
14124
- * @return {WPComponent} Enhanced component.
14125
- */
14126
-
14127
-
14128
- /**
14129
- * A component which renders its children without any wrapping element.
14130
- */
14131
-
14132
-
14133
- /**
14134
- * Checks if an object is a valid WPElement
14135
- *
14136
- * @param {Object} objectToCheck The object to be checked.
14137
- *
14138
- * @return {boolean} true if objectToTest is a valid WPElement and false otherwise.
14139
- */
14140
-
14141
-
14142
-
14143
- /**
14144
- * Concatenate two or more React children objects.
14145
- *
14146
- * @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate.
14147
- *
14148
- * @return {Array} The concatenated value.
14149
- */
14150
-
14151
- function concatChildren() {
14152
- for (var _len = arguments.length, childrenArguments = new Array(_len), _key = 0; _key < _len; _key++) {
14153
- childrenArguments[_key] = arguments[_key];
14154
- }
14155
-
14156
- return childrenArguments.reduce(function (memo, children, i) {
14157
- __WEBPACK_IMPORTED_MODULE_2_react__["Children"].forEach(children, function (child, j) {
14158
- if (child && 'string' !== typeof child) {
14159
- child = Object(__WEBPACK_IMPORTED_MODULE_2_react__["cloneElement"])(child, {
14160
- key: [i, j].join()
14161
- });
14162
- }
14163
-
14164
- memo.push(child);
14165
- });
14166
- return memo;
14167
- }, []);
14168
- }
14169
- /**
14170
- * Switches the nodeName of all the elements in the children object.
14171
- *
14172
- * @param {?Object} children Children object.
14173
- * @param {string} nodeName Node name.
14174
- *
14175
- * @return {?Object} The updated children object.
14176
- */
14177
-
14178
- function switchChildrenNodeName(children, nodeName) {
14179
- return children && __WEBPACK_IMPORTED_MODULE_2_react__["Children"].map(children, function (elt, index) {
14180
- if (Object(__WEBPACK_IMPORTED_MODULE_3_lodash__["isString"])(elt)) {
14181
- return Object(__WEBPACK_IMPORTED_MODULE_2_react__["createElement"])(nodeName, {
14182
- key: index
14183
- }, elt);
14184
- }
14185
-
14186
- var _elt$props = elt.props,
14187
- childrenProp = _elt$props.children,
14188
- props = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(_elt$props, ["children"]);
14189
-
14190
- return Object(__WEBPACK_IMPORTED_MODULE_2_react__["createElement"])(nodeName, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__["a" /* default */])({
14191
- key: index
14192
- }, props), childrenProp);
14193
- });
14194
- }
14195
- //# sourceMappingURL=react.js.map
14196
-
14197
- /***/ }),
14198
- /* 95 */
14199
- /***/ (function(module, exports, __webpack_require__) {
14200
-
14201
- "use strict";
14202
- /* WEBPACK VAR INJECTION */(function(process) {/**
14203
- * Copyright (c) 2013-present, Facebook, Inc.
14204
- *
14205
- * This source code is licensed under the MIT license found in the
14206
- * LICENSE file in the root directory of this source tree.
14207
- */
14208
-
14209
-
14210
-
14211
- var printWarning = function() {};
14212
-
14213
- if (process.env.NODE_ENV !== 'production') {
14214
- var ReactPropTypesSecret = __webpack_require__(96);
14215
- var loggedTypeFailures = {};
14216
- var has = Function.call.bind(Object.prototype.hasOwnProperty);
14217
-
14218
- printWarning = function(text) {
14219
- var message = 'Warning: ' + text;
14220
- if (typeof console !== 'undefined') {
14221
- console.error(message);
14222
- }
14223
- try {
14224
- // --- Welcome to debugging React ---
14225
- // This error was thrown as a convenience so that you can use this stack
14226
- // to find the callsite that caused this warning to fire.
14227
- throw new Error(message);
14228
- } catch (x) {}
14229
- };
14230
- }
14231
-
14232
- /**
14233
- * Assert that the values match with the type specs.
14234
- * Error messages are memorized and will only be shown once.
14235
- *
14236
- * @param {object} typeSpecs Map of name to a ReactPropType
14237
- * @param {object} values Runtime values that need to be type-checked
14238
- * @param {string} location e.g. "prop", "context", "child context"
14239
- * @param {string} componentName Name of the component for error messages.
14240
- * @param {?Function} getStack Returns the component stack.
14241
- * @private
14242
- */
14243
- function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
14244
- if (process.env.NODE_ENV !== 'production') {
14245
- for (var typeSpecName in typeSpecs) {
14246
- if (has(typeSpecs, typeSpecName)) {
14247
- var error;
14248
- // Prop type validation may throw. In case they do, we don't want to
14249
- // fail the render phase where it didn't fail before. So we log it.
14250
- // After these have been cleaned up, we'll let them throw.
14251
- try {
14252
- // This is intentionally an invariant that gets caught. It's the same
14253
- // behavior as without this statement except with a better message.
14254
- if (typeof typeSpecs[typeSpecName] !== 'function') {
14255
- var err = Error(
14256
- (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
14257
- 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'
14258
- );
14259
- err.name = 'Invariant Violation';
14260
- throw err;
14261
- }
14262
- error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
14263
- } catch (ex) {
14264
- error = ex;
14265
- }
14266
- if (error && !(error instanceof Error)) {
14267
- printWarning(
14268
- (componentName || 'React class') + ': type specification of ' +
14269
- location + ' `' + typeSpecName + '` is invalid; the type checker ' +
14270
- 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
14271
- 'You may have forgotten to pass an argument to the type checker ' +
14272
- 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
14273
- 'shape all require an argument).'
14274
- );
14275
- }
14276
- if (error instanceof Error && !(error.message in loggedTypeFailures)) {
14277
- // Only monitor this failure once because there tends to be a lot of the
14278
- // same error.
14279
- loggedTypeFailures[error.message] = true;
14280
-
14281
- var stack = getStack ? getStack() : '';
14282
-
14283
- printWarning(
14284
- 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
14285
- );
14286
- }
14287
- }
14288
- }
14289
- }
14290
- }
14291
-
14292
- /**
14293
- * Resets warning cache when testing.
14294
- *
14295
- * @private
14296
- */
14297
- checkPropTypes.resetWarningCache = function() {
14298
- if (process.env.NODE_ENV !== 'production') {
14299
- loggedTypeFailures = {};
14300
- }
14301
- }
14302
-
14303
- module.exports = checkPropTypes;
14304
-
14305
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))
14306
-
14307
- /***/ }),
14308
- /* 96 */
14309
- /***/ (function(module, exports, __webpack_require__) {
14310
-
14311
- "use strict";
14312
- /**
14313
- * Copyright (c) 2013-present, Facebook, Inc.
14314
- *
14315
- * This source code is licensed under the MIT license found in the
14316
- * LICENSE file in the root directory of this source tree.
14317
- */
14318
-
14319
-
14320
-
14321
- var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
14322
-
14323
- module.exports = ReactPropTypesSecret;
14324
-
14325
-
14326
- /***/ }),
14327
- /* 97 */
14328
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
14329
-
14330
- "use strict";
14331
- /* unused harmony export concatChildren */
14332
- /* unused harmony export switchChildrenNodeName */
14333
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(13);
14334
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
14335
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(9);
14336
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
14337
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash__ = __webpack_require__(2);
14338
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash__);
14339
- /* unused harmony reexport Children */
14340
- /* unused harmony reexport cloneElement */
14341
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "Component")) __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["Component"]; });
14342
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "createContext")) __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["createContext"]; });
14343
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "createElement")) __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["createElement"]; });
14344
- /* unused harmony reexport createRef */
14345
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "forwardRef")) __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["forwardRef"]; });
14346
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "Fragment")) __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["Fragment"]; });
14347
- /* unused harmony reexport isValidElement */
14348
- /* unused harmony reexport memo */
14349
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "StrictMode")) __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["StrictMode"]; });
14350
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useCallback")) __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useCallback"]; });
14351
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useContext")) __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useContext"]; });
14352
- /* unused harmony reexport useDebugValue */
14353
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useEffect")) __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useEffect"]; });
14354
- /* unused harmony reexport useImperativeHandle */
14355
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useLayoutEffect")) __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useLayoutEffect"]; });
14356
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useMemo")) __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useMemo"]; });
14357
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useReducer")) __webpack_require__.d(__webpack_exports__, "l", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useReducer"]; });
14358
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useRef")) __webpack_require__.d(__webpack_exports__, "m", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useRef"]; });
14359
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useState")) __webpack_require__.d(__webpack_exports__, "n", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useState"]; });
14360
- /* unused harmony reexport lazy */
14361
- /* unused harmony reexport Suspense */
14362
-
14363
-
14364
-
14365
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
14366
-
14367
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
14368
-
14369
- /**
14370
- * External dependencies
14371
- */
14372
-
14373
-
14374
- /**
14375
- * Object containing a React element.
14376
- *
14377
- * @typedef {import('react').ReactElement} WPElement
14378
- */
14379
-
14380
- /**
14381
- * Object containing a React component.
14382
- *
14383
- * @typedef {import('react').ComponentType} WPComponent
14384
- */
14385
-
14386
- /**
14387
- * Object containing a React synthetic event.
14388
- *
14389
- * @typedef {import('react').SyntheticEvent} WPSyntheticEvent
14390
- */
14391
-
14392
- /**
14393
- * Object that provides utilities for dealing with React children.
14394
- */
14395
-
14396
-
14397
- /**
14398
- * Creates a copy of an element with extended props.
14399
- *
14400
- * @param {WPElement} element Element
14401
- * @param {?Object} props Props to apply to cloned element
14402
- *
14403
- * @return {WPElement} Cloned element.
14404
- */
14405
-
14406
-
14407
- /**
14408
- * A base class to create WordPress Components (Refs, state and lifecycle hooks)
14409
- */
14410
-
14411
-
14412
- /**
14413
- * Creates a context object containing two components: a provider and consumer.
14414
- *
14415
- * @param {Object} defaultValue A default data stored in the context.
14416
- *
14417
- * @return {Object} Context object.
14418
- */
14419
-
14420
-
14421
- /**
14422
- * Returns a new element of given type. Type can be either a string tag name or
14423
- * another function which itself returns an element.
14424
- *
14425
- * @param {?(string|Function)} type Tag name or element creator
14426
- * @param {Object} props Element properties, either attribute
14427
- * set to apply to DOM node or values to
14428
- * pass through to element creator
14429
- * @param {...WPElement} children Descendant elements
14430
- *
14431
- * @return {WPElement} Element.
14432
- */
14433
-
14434
-
14435
- /**
14436
- * Returns an object tracking a reference to a rendered element via its
14437
- * `current` property as either a DOMElement or Element, dependent upon the
14438
- * type of element rendered with the ref attribute.
14439
- *
14440
- * @return {Object} Ref object.
14441
- */
14442
-
14443
-
14444
- /**
14445
- * Component enhancer used to enable passing a ref to its wrapped component.
14446
- * Pass a function argument which receives `props` and `ref` as its arguments,
14447
- * returning an element using the forwarded ref. The return value is a new
14448
- * component which forwards its ref.
14449
- *
14450
- * @param {Function} forwarder Function passed `props` and `ref`, expected to
14451
- * return an element.
14452
- *
14453
- * @return {WPComponent} Enhanced component.
14454
- */
14455
-
14456
-
14457
- /**
14458
- * A component which renders its children without any wrapping element.
14459
- */
14460
-
14461
-
14462
- /**
14463
- * Checks if an object is a valid WPElement.
14464
- *
14465
- * @param {Object} objectToCheck The object to be checked.
14466
- *
14467
- * @return {boolean} true if objectToTest is a valid WPElement and false otherwise.
14468
- */
14469
-
14470
-
14471
- /**
14472
- * @see https://reactjs.org/docs/react-api.html#reactmemo
14473
- */
14474
-
14475
-
14476
- /**
14477
- * Component that activates additional checks and warnings for its descendants.
14478
- */
14479
-
14480
-
14481
- /**
14482
- * @see https://reactjs.org/docs/hooks-reference.html#usecallback
14483
- */
14484
-
14485
-
14486
- /**
14487
- * @see https://reactjs.org/docs/hooks-reference.html#usecontext
14488
- */
14489
-
14490
-
14491
- /**
14492
- * @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue
14493
- */
14494
-
14495
-
14496
- /**
14497
- * @see https://reactjs.org/docs/hooks-reference.html#useeffect
14498
- */
14499
-
14500
-
14501
- /**
14502
- * @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle
14503
- */
14504
-
14505
-
14506
- /**
14507
- * @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect
14508
- */
14509
-
14510
-
14511
- /**
14512
- * @see https://reactjs.org/docs/hooks-reference.html#usememo
14513
- */
14514
-
14515
-
14516
- /**
14517
- * @see https://reactjs.org/docs/hooks-reference.html#usereducer
14518
- */
14519
-
14520
-
14521
- /**
14522
- * @see https://reactjs.org/docs/hooks-reference.html#useref
14523
- */
14524
-
14525
-
14526
- /**
14527
- * @see https://reactjs.org/docs/hooks-reference.html#usestate
14528
- */
14529
-
14530
-
14531
- /**
14532
- * @see https://reactjs.org/docs/react-api.html#reactlazy
14533
- */
14534
-
14535
-
14536
- /**
14537
- * @see https://reactjs.org/docs/react-api.html#reactsuspense
14538
- */
14539
-
14540
-
14541
- /**
14542
- * Concatenate two or more React children objects.
14543
- *
14544
- * @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate.
14545
- *
14546
- * @return {Array} The concatenated value.
14547
- */
14548
-
14549
- function concatChildren() {
14550
- for (var _len = arguments.length, childrenArguments = new Array(_len), _key = 0; _key < _len; _key++) {
14551
- childrenArguments[_key] = arguments[_key];
14552
- }
14553
-
14554
- return childrenArguments.reduce(function (accumulator, children, i) {
14555
- __WEBPACK_IMPORTED_MODULE_2_react__["Children"].forEach(children, function (child, j) {
14556
- if (child && 'string' !== typeof child) {
14557
- child = Object(__WEBPACK_IMPORTED_MODULE_2_react__["cloneElement"])(child, {
14558
- key: [i, j].join()
14559
- });
14560
- }
14561
-
14562
- accumulator.push(child);
14563
- });
14564
- return accumulator;
14565
- }, []);
14566
- }
14567
- /**
14568
- * Switches the nodeName of all the elements in the children object.
14569
- *
14570
- * @param {?Object} children Children object.
14571
- * @param {string} nodeName Node name.
14572
- *
14573
- * @return {?Object} The updated children object.
14574
- */
14575
-
14576
- function switchChildrenNodeName(children, nodeName) {
14577
- return children && __WEBPACK_IMPORTED_MODULE_2_react__["Children"].map(children, function (elt, index) {
14578
- if (Object(__WEBPACK_IMPORTED_MODULE_3_lodash__["isString"])(elt)) {
14579
- return Object(__WEBPACK_IMPORTED_MODULE_2_react__["createElement"])(nodeName, {
14580
- key: index
14581
- }, elt);
14582
- }
14583
-
14584
- var _elt$props = elt.props,
14585
- childrenProp = _elt$props.children,
14586
- props = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(_elt$props, ["children"]);
14587
-
14588
- return Object(__WEBPACK_IMPORTED_MODULE_2_react__["createElement"])(nodeName, _objectSpread({
14589
- key: index
14590
- }, props), childrenProp);
14591
- });
14592
- }
14593
- //# sourceMappingURL=react.js.map
14594
-
14595
- /***/ }),
14596
- /* 98 */
14597
- /***/ (function(module, exports, __webpack_require__) {
14598
-
14599
- /*!
14600
- * clipboard.js v2.0.6
14601
- * https://clipboardjs.com/
14602
- *
14603
- * Licensed MIT © Zeno Rocha
14604
- */
14605
- (function webpackUniversalModuleDefinition(root, factory) {
14606
- if(true)
14607
- module.exports = factory();
14608
- else if(typeof define === 'function' && define.amd)
14609
- define([], factory);
14610
- else if(typeof exports === 'object')
14611
- exports["ClipboardJS"] = factory();
14612
- else
14613
- root["ClipboardJS"] = factory();
14614
- })(this, function() {
14615
- return /******/ (function(modules) { // webpackBootstrap
14616
- /******/ // The module cache
14617
- /******/ var installedModules = {};
14618
- /******/
14619
- /******/ // The require function
14620
- /******/ function __webpack_require__(moduleId) {
14621
- /******/
14622
- /******/ // Check if module is in cache
14623
- /******/ if(installedModules[moduleId]) {
14624
- /******/ return installedModules[moduleId].exports;
14625
- /******/ }
14626
- /******/ // Create a new module (and put it into the cache)
14627
- /******/ var module = installedModules[moduleId] = {
14628
- /******/ i: moduleId,
14629
- /******/ l: false,
14630
- /******/ exports: {}
14631
- /******/ };
14632
- /******/
14633
- /******/ // Execute the module function
14634
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
14635
- /******/
14636
- /******/ // Flag the module as loaded
14637
- /******/ module.l = true;
14638
- /******/
14639
- /******/ // Return the exports of the module
14640
- /******/ return module.exports;
14641
- /******/ }
14642
- /******/
14643
- /******/
14644
- /******/ // expose the modules object (__webpack_modules__)
14645
- /******/ __webpack_require__.m = modules;
14646
- /******/
14647
- /******/ // expose the module cache
14648
- /******/ __webpack_require__.c = installedModules;
14649
- /******/
14650
- /******/ // define getter function for harmony exports
14651
- /******/ __webpack_require__.d = function(exports, name, getter) {
14652
- /******/ if(!__webpack_require__.o(exports, name)) {
14653
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
14654
- /******/ }
14655
- /******/ };
14656
- /******/
14657
- /******/ // define __esModule on exports
14658
- /******/ __webpack_require__.r = function(exports) {
14659
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
14660
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
14661
- /******/ }
14662
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
14663
- /******/ };
14664
- /******/
14665
- /******/ // create a fake namespace object
14666
- /******/ // mode & 1: value is a module id, require it
14667
- /******/ // mode & 2: merge all properties of value into the ns
14668
- /******/ // mode & 4: return value when already ns object
14669
- /******/ // mode & 8|1: behave like require
14670
- /******/ __webpack_require__.t = function(value, mode) {
14671
- /******/ if(mode & 1) value = __webpack_require__(value);
14672
- /******/ if(mode & 8) return value;
14673
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
14674
- /******/ var ns = Object.create(null);
14675
- /******/ __webpack_require__.r(ns);
14676
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
14677
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
14678
- /******/ return ns;
14679
- /******/ };
14680
- /******/
14681
- /******/ // getDefaultExport function for compatibility with non-harmony modules
14682
- /******/ __webpack_require__.n = function(module) {
14683
- /******/ var getter = module && module.__esModule ?
14684
- /******/ function getDefault() { return module['default']; } :
14685
- /******/ function getModuleExports() { return module; };
14686
- /******/ __webpack_require__.d(getter, 'a', getter);
14687
- /******/ return getter;
14688
- /******/ };
14689
- /******/
14690
- /******/ // Object.prototype.hasOwnProperty.call
14691
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
14692
- /******/
14693
- /******/ // __webpack_public_path__
14694
- /******/ __webpack_require__.p = "";
14695
- /******/
14696
- /******/
14697
- /******/ // Load entry module and return exports
14698
- /******/ return __webpack_require__(__webpack_require__.s = 6);
14699
- /******/ })
14700
- /************************************************************************/
14701
- /******/ ([
14702
- /* 0 */
14703
- /***/ (function(module, exports) {
14704
-
14705
- function select(element) {
14706
- var selectedText;
14707
-
14708
- if (element.nodeName === 'SELECT') {
14709
- element.focus();
14710
-
14711
- selectedText = element.value;
14712
- }
14713
- else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
14714
- var isReadOnly = element.hasAttribute('readonly');
14715
-
14716
- if (!isReadOnly) {
14717
- element.setAttribute('readonly', '');
14718
- }
14719
-
14720
- element.select();
14721
- element.setSelectionRange(0, element.value.length);
14722
-
14723
- if (!isReadOnly) {
14724
- element.removeAttribute('readonly');
14725
- }
14726
-
14727
- selectedText = element.value;
14728
- }
14729
- else {
14730
- if (element.hasAttribute('contenteditable')) {
14731
- element.focus();
14732
- }
14733
-
14734
- var selection = window.getSelection();
14735
- var range = document.createRange();
14736
-
14737
- range.selectNodeContents(element);
14738
- selection.removeAllRanges();
14739
- selection.addRange(range);
14740
-
14741
- selectedText = selection.toString();
14742
- }
14743
-
14744
- return selectedText;
14745
- }
14746
-
14747
- module.exports = select;
14748
-
14749
-
14750
- /***/ }),
14751
- /* 1 */
14752
- /***/ (function(module, exports) {
14753
-
14754
- function E () {
14755
- // Keep this empty so it's easier to inherit from
14756
- // (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
14757
- }
14758
-
14759
- E.prototype = {
14760
- on: function (name, callback, ctx) {
14761
- var e = this.e || (this.e = {});
14762
-
14763
- (e[name] || (e[name] = [])).push({
14764
- fn: callback,
14765
- ctx: ctx
14766
- });
14767
-
14768
- return this;
14769
- },
14770
-
14771
- once: function (name, callback, ctx) {
14772
- var self = this;
14773
- function listener () {
14774
- self.off(name, listener);
14775
- callback.apply(ctx, arguments);
14776
- };
14777
-
14778
- listener._ = callback
14779
- return this.on(name, listener, ctx);
14780
- },
14781
-
14782
- emit: function (name) {
14783
- var data = [].slice.call(arguments, 1);
14784
- var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
14785
- var i = 0;
14786
- var len = evtArr.length;
14787
-
14788
- for (i; i < len; i++) {
14789
- evtArr[i].fn.apply(evtArr[i].ctx, data);
14790
- }
14791
-
14792
- return this;
14793
- },
14794
-
14795
- off: function (name, callback) {
14796
- var e = this.e || (this.e = {});
14797
- var evts = e[name];
14798
- var liveEvents = [];
14799
-
14800
- if (evts && callback) {
14801
- for (var i = 0, len = evts.length; i < len; i++) {
14802
- if (evts[i].fn !== callback && evts[i].fn._ !== callback)
14803
- liveEvents.push(evts[i]);
14804
- }
14805
- }
14806
-
14807
- // Remove event from queue to prevent memory leak
14808
- // Suggested by https://github.com/lazd
14809
- // Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
14810
-
14811
- (liveEvents.length)
14812
- ? e[name] = liveEvents
14813
- : delete e[name];
14814
-
14815
- return this;
14816
- }
14817
- };
14818
-
14819
- module.exports = E;
14820
- module.exports.TinyEmitter = E;
14821
-
14822
-
14823
- /***/ }),
14824
- /* 2 */
14825
- /***/ (function(module, exports, __webpack_require__) {
14826
-
14827
- var is = __webpack_require__(3);
14828
- var delegate = __webpack_require__(4);
14829
-
14830
- /**
14831
- * Validates all params and calls the right
14832
- * listener function based on its target type.
14833
- *
14834
- * @param {String|HTMLElement|HTMLCollection|NodeList} target
14835
- * @param {String} type
14836
- * @param {Function} callback
14837
- * @return {Object}
14838
- */
14839
- function listen(target, type, callback) {
14840
- if (!target && !type && !callback) {
14841
- throw new Error('Missing required arguments');
14842
- }
14843
-
14844
- if (!is.string(type)) {
14845
- throw new TypeError('Second argument must be a String');
14846
- }
14847
-
14848
- if (!is.fn(callback)) {
14849
- throw new TypeError('Third argument must be a Function');
14850
- }
14851
-
14852
- if (is.node(target)) {
14853
- return listenNode(target, type, callback);
14854
- }
14855
- else if (is.nodeList(target)) {
14856
- return listenNodeList(target, type, callback);
14857
- }
14858
- else if (is.string(target)) {
14859
- return listenSelector(target, type, callback);
14860
- }
14861
- else {
14862
- throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');
14863
- }
14864
- }
14865
-
14866
- /**
14867
- * Adds an event listener to a HTML element
14868
- * and returns a remove listener function.
14869
- *
14870
- * @param {HTMLElement} node
14871
- * @param {String} type
14872
- * @param {Function} callback
14873
- * @return {Object}
14874
- */
14875
- function listenNode(node, type, callback) {
14876
- node.addEventListener(type, callback);
14877
-
14878
- return {
14879
- destroy: function() {
14880
- node.removeEventListener(type, callback);
14881
- }
14882
- }
14883
- }
14884
-
14885
- /**
14886
- * Add an event listener to a list of HTML elements
14887
- * and returns a remove listener function.
14888
- *
14889
- * @param {NodeList|HTMLCollection} nodeList
14890
- * @param {String} type
14891
- * @param {Function} callback
14892
- * @return {Object}
14893
- */
14894
- function listenNodeList(nodeList, type, callback) {
14895
- Array.prototype.forEach.call(nodeList, function(node) {
14896
- node.addEventListener(type, callback);
14897
- });
14898
-
14899
- return {
14900
- destroy: function() {
14901
- Array.prototype.forEach.call(nodeList, function(node) {
14902
- node.removeEventListener(type, callback);
14903
- });
14904
- }
14905
- }
14906
- }
14907
-
14908
- /**
14909
- * Add an event listener to a selector
14910
- * and returns a remove listener function.
14911
- *
14912
- * @param {String} selector
14913
- * @param {String} type
14914
- * @param {Function} callback
14915
- * @return {Object}
14916
- */
14917
- function listenSelector(selector, type, callback) {
14918
- return delegate(document.body, selector, type, callback);
14919
- }
14920
-
14921
- module.exports = listen;
14922
-
14923
-
14924
- /***/ }),
14925
- /* 3 */
14926
- /***/ (function(module, exports) {
14927
-
14928
- /**
14929
- * Check if argument is a HTML element.
14930
- *
14931
- * @param {Object} value
14932
- * @return {Boolean}
14933
- */
14934
- exports.node = function(value) {
14935
- return value !== undefined
14936
- && value instanceof HTMLElement
14937
- && value.nodeType === 1;
14938
- };
14939
-
14940
- /**
14941
- * Check if argument is a list of HTML elements.
14942
- *
14943
- * @param {Object} value
14944
- * @return {Boolean}
14945
- */
14946
- exports.nodeList = function(value) {
14947
- var type = Object.prototype.toString.call(value);
14948
-
14949
- return value !== undefined
14950
- && (type === '[object NodeList]' || type === '[object HTMLCollection]')
14951
- && ('length' in value)
14952
- && (value.length === 0 || exports.node(value[0]));
14953
- };
14954
-
14955
- /**
14956
- * Check if argument is a string.
14957
- *
14958
- * @param {Object} value
14959
- * @return {Boolean}
14960
- */
14961
- exports.string = function(value) {
14962
- return typeof value === 'string'
14963
- || value instanceof String;
14964
- };
14965
-
14966
- /**
14967
- * Check if argument is a function.
14968
- *
14969
- * @param {Object} value
14970
- * @return {Boolean}
14971
- */
14972
- exports.fn = function(value) {
14973
- var type = Object.prototype.toString.call(value);
14974
-
14975
- return type === '[object Function]';
14976
- };
14977
-
14978
-
14979
- /***/ }),
14980
- /* 4 */
14981
- /***/ (function(module, exports, __webpack_require__) {
14982
-
14983
- var closest = __webpack_require__(5);
14984
-
14985
- /**
14986
- * Delegates event to a selector.
14987
- *
14988
- * @param {Element} element
14989
- * @param {String} selector
14990
- * @param {String} type
14991
- * @param {Function} callback
14992
- * @param {Boolean} useCapture
14993
- * @return {Object}
14994
- */
14995
- function _delegate(element, selector, type, callback, useCapture) {
14996
- var listenerFn = listener.apply(this, arguments);
14997
-
14998
- element.addEventListener(type, listenerFn, useCapture);
14999
-
15000
- return {
15001
- destroy: function() {
15002
- element.removeEventListener(type, listenerFn, useCapture);
15003
- }
15004
- }
15005
- }
15006
-
15007
- /**
15008
- * Delegates event to a selector.
15009
- *
15010
- * @param {Element|String|Array} [elements]
15011
- * @param {String} selector
15012
- * @param {String} type
15013
- * @param {Function} callback
15014
- * @param {Boolean} useCapture
15015
- * @return {Object}
15016
- */
15017
- function delegate(elements, selector, type, callback, useCapture) {
15018
- // Handle the regular Element usage
15019
- if (typeof elements.addEventListener === 'function') {
15020
- return _delegate.apply(null, arguments);
15021
- }
15022
-
15023
- // Handle Element-less usage, it defaults to global delegation
15024
- if (typeof type === 'function') {
15025
- // Use `document` as the first parameter, then apply arguments
15026
- // This is a short way to .unshift `arguments` without running into deoptimizations
15027
- return _delegate.bind(null, document).apply(null, arguments);
15028
- }
15029
-
15030
- // Handle Selector-based usage
15031
- if (typeof elements === 'string') {
15032
- elements = document.querySelectorAll(elements);
15033
- }
15034
-
15035
- // Handle Array-like based usage
15036
- return Array.prototype.map.call(elements, function (element) {
15037
- return _delegate(element, selector, type, callback, useCapture);
15038
- });
15039
- }
15040
-
15041
- /**
15042
- * Finds closest match and invokes callback.
15043
- *
15044
- * @param {Element} element
15045
- * @param {String} selector
15046
- * @param {String} type
15047
- * @param {Function} callback
15048
- * @return {Function}
15049
- */
15050
- function listener(element, selector, type, callback) {
15051
- return function(e) {
15052
- e.delegateTarget = closest(e.target, selector);
15053
-
15054
- if (e.delegateTarget) {
15055
- callback.call(element, e);
15056
- }
15057
- }
15058
- }
15059
-
15060
- module.exports = delegate;
15061
-
15062
-
15063
- /***/ }),
15064
- /* 5 */
15065
- /***/ (function(module, exports) {
15066
-
15067
- var DOCUMENT_NODE_TYPE = 9;
15068
-
15069
- /**
15070
- * A polyfill for Element.matches()
15071
- */
15072
- if (typeof Element !== 'undefined' && !Element.prototype.matches) {
15073
- var proto = Element.prototype;
15074
-
15075
- proto.matches = proto.matchesSelector ||
15076
- proto.mozMatchesSelector ||
15077
- proto.msMatchesSelector ||
15078
- proto.oMatchesSelector ||
15079
- proto.webkitMatchesSelector;
15080
- }
15081
-
15082
- /**
15083
- * Finds the closest parent that matches a selector.
15084
- *
15085
- * @param {Element} element
15086
- * @param {String} selector
15087
- * @return {Function}
15088
- */
15089
- function closest (element, selector) {
15090
- while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
15091
- if (typeof element.matches === 'function' &&
15092
- element.matches(selector)) {
15093
- return element;
15094
- }
15095
- element = element.parentNode;
15096
- }
15097
- }
15098
-
15099
- module.exports = closest;
15100
-
15101
-
15102
- /***/ }),
15103
- /* 6 */
15104
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
15105
-
15106
- "use strict";
15107
- __webpack_require__.r(__webpack_exports__);
15108
-
15109
- // EXTERNAL MODULE: ./node_modules/select/src/select.js
15110
- var src_select = __webpack_require__(0);
15111
- var select_default = /*#__PURE__*/__webpack_require__.n(src_select);
15112
-
15113
- // CONCATENATED MODULE: ./src/clipboard-action.js
15114
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
15115
-
15116
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
15117
-
15118
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15119
-
15120
-
15121
-
15122
- /**
15123
- * Inner class which performs selection from either `text` or `target`
15124
- * properties and then executes copy or cut operations.
15125
- */
15126
-
15127
- var clipboard_action_ClipboardAction = function () {
15128
- /**
15129
- * @param {Object} options
15130
- */
15131
- function ClipboardAction(options) {
15132
- _classCallCheck(this, ClipboardAction);
15133
-
15134
- this.resolveOptions(options);
15135
- this.initSelection();
15136
- }
15137
-
15138
- /**
15139
- * Defines base properties passed from constructor.
15140
- * @param {Object} options
15141
- */
15142
-
15143
-
15144
- _createClass(ClipboardAction, [{
15145
- key: 'resolveOptions',
15146
- value: function resolveOptions() {
15147
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
15148
-
15149
- this.action = options.action;
15150
- this.container = options.container;
15151
- this.emitter = options.emitter;
15152
- this.target = options.target;
15153
- this.text = options.text;
15154
- this.trigger = options.trigger;
15155
-
15156
- this.selectedText = '';
15157
- }
15158
-
15159
- /**
15160
- * Decides which selection strategy is going to be applied based
15161
- * on the existence of `text` and `target` properties.
15162
- */
15163
-
15164
- }, {
15165
- key: 'initSelection',
15166
- value: function initSelection() {
15167
- if (this.text) {
15168
- this.selectFake();
15169
- } else if (this.target) {
15170
- this.selectTarget();
15171
- }
15172
- }
15173
-
15174
- /**
15175
- * Creates a fake textarea element, sets its value from `text` property,
15176
- * and makes a selection on it.
15177
- */
15178
-
15179
- }, {
15180
- key: 'selectFake',
15181
- value: function selectFake() {
15182
- var _this = this;
15183
-
15184
- var isRTL = document.documentElement.getAttribute('dir') == 'rtl';
15185
-
15186
- this.removeFake();
15187
-
15188
- this.fakeHandlerCallback = function () {
15189
- return _this.removeFake();
15190
- };
15191
- this.fakeHandler = this.container.addEventListener('click', this.fakeHandlerCallback) || true;
15192
-
15193
- this.fakeElem = document.createElement('textarea');
15194
- // Prevent zooming on iOS
15195
- this.fakeElem.style.fontSize = '12pt';
15196
- // Reset box model
15197
- this.fakeElem.style.border = '0';
15198
- this.fakeElem.style.padding = '0';
15199
- this.fakeElem.style.margin = '0';
15200
- // Move element out of screen horizontally
15201
- this.fakeElem.style.position = 'absolute';
15202
- this.fakeElem.style[isRTL ? 'right' : 'left'] = '-9999px';
15203
- // Move element to the same position vertically
15204
- var yPosition = window.pageYOffset || document.documentElement.scrollTop;
15205
- this.fakeElem.style.top = yPosition + 'px';
15206
-
15207
- this.fakeElem.setAttribute('readonly', '');
15208
- this.fakeElem.value = this.text;
15209
-
15210
- this.container.appendChild(this.fakeElem);
15211
-
15212
- this.selectedText = select_default()(this.fakeElem);
15213
- this.copyText();
15214
- }
15215
-
15216
- /**
15217
- * Only removes the fake element after another click event, that way
15218
- * a user can hit `Ctrl+C` to copy because selection still exists.
15219
- */
15220
-
15221
- }, {
15222
- key: 'removeFake',
15223
- value: function removeFake() {
15224
- if (this.fakeHandler) {
15225
- this.container.removeEventListener('click', this.fakeHandlerCallback);
15226
- this.fakeHandler = null;
15227
- this.fakeHandlerCallback = null;
15228
- }
15229
-
15230
- if (this.fakeElem) {
15231
- this.container.removeChild(this.fakeElem);
15232
- this.fakeElem = null;
15233
- }
15234
- }
15235
-
15236
- /**
15237
- * Selects the content from element passed on `target` property.
15238
- */
15239
-
15240
- }, {
15241
- key: 'selectTarget',
15242
- value: function selectTarget() {
15243
- this.selectedText = select_default()(this.target);
15244
- this.copyText();
15245
- }
15246
-
15247
- /**
15248
- * Executes the copy operation based on the current selection.
15249
- */
15250
-
15251
- }, {
15252
- key: 'copyText',
15253
- value: function copyText() {
15254
- var succeeded = void 0;
15255
-
15256
- try {
15257
- succeeded = document.execCommand(this.action);
15258
- } catch (err) {
15259
- succeeded = false;
15260
- }
15261
-
15262
- this.handleResult(succeeded);
15263
- }
15264
-
15265
- /**
15266
- * Fires an event based on the copy operation result.
15267
- * @param {Boolean} succeeded
15268
- */
15269
-
15270
- }, {
15271
- key: 'handleResult',
15272
- value: function handleResult(succeeded) {
15273
- this.emitter.emit(succeeded ? 'success' : 'error', {
15274
- action: this.action,
15275
- text: this.selectedText,
15276
- trigger: this.trigger,
15277
- clearSelection: this.clearSelection.bind(this)
15278
- });
15279
- }
15280
-
15281
- /**
15282
- * Moves focus away from `target` and back to the trigger, removes current selection.
15283
- */
15284
-
15285
- }, {
15286
- key: 'clearSelection',
15287
- value: function clearSelection() {
15288
- if (this.trigger) {
15289
- this.trigger.focus();
15290
- }
15291
- document.activeElement.blur();
15292
- window.getSelection().removeAllRanges();
15293
- }
15294
-
15295
- /**
15296
- * Sets the `action` to be performed which can be either 'copy' or 'cut'.
15297
- * @param {String} action
15298
- */
15299
-
15300
- }, {
15301
- key: 'destroy',
15302
-
15303
-
15304
- /**
15305
- * Destroy lifecycle.
15306
- */
15307
- value: function destroy() {
15308
- this.removeFake();
15309
- }
15310
- }, {
15311
- key: 'action',
15312
- set: function set() {
15313
- var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'copy';
15314
-
15315
- this._action = action;
15316
-
15317
- if (this._action !== 'copy' && this._action !== 'cut') {
15318
- throw new Error('Invalid "action" value, use either "copy" or "cut"');
15319
- }
15320
- }
15321
-
15322
- /**
15323
- * Gets the `action` property.
15324
- * @return {String}
15325
- */
15326
- ,
15327
- get: function get() {
15328
- return this._action;
15329
- }
15330
-
15331
- /**
15332
- * Sets the `target` property using an element
15333
- * that will be have its content copied.
15334
- * @param {Element} target
15335
- */
15336
-
15337
- }, {
15338
- key: 'target',
15339
- set: function set(target) {
15340
- if (target !== undefined) {
15341
- if (target && (typeof target === 'undefined' ? 'undefined' : _typeof(target)) === 'object' && target.nodeType === 1) {
15342
- if (this.action === 'copy' && target.hasAttribute('disabled')) {
15343
- throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
15344
- }
15345
-
15346
- if (this.action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {
15347
- throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
15348
- }
15349
-
15350
- this._target = target;
15351
- } else {
15352
- throw new Error('Invalid "target" value, use a valid Element');
15353
- }
15354
- }
15355
- }
15356
-
15357
- /**
15358
- * Gets the `target` property.
15359
- * @return {String|HTMLElement}
15360
- */
15361
- ,
15362
- get: function get() {
15363
- return this._target;
15364
- }
15365
- }]);
15366
-
15367
- return ClipboardAction;
15368
- }();
15369
-
15370
- /* harmony default export */ var clipboard_action = (clipboard_action_ClipboardAction);
15371
- // EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js
15372
- var tiny_emitter = __webpack_require__(1);
15373
- var tiny_emitter_default = /*#__PURE__*/__webpack_require__.n(tiny_emitter);
15374
-
15375
- // EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js
15376
- var listen = __webpack_require__(2);
15377
- var listen_default = /*#__PURE__*/__webpack_require__.n(listen);
15378
-
15379
- // CONCATENATED MODULE: ./src/clipboard.js
15380
- var clipboard_typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
15381
-
15382
- var clipboard_createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
15383
-
15384
- function clipboard_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15385
-
15386
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
15387
-
15388
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
15389
-
15390
-
15391
-
15392
-
15393
-
15394
- /**
15395
- * Base class which takes one or more elements, adds event listeners to them,
15396
- * and instantiates a new `ClipboardAction` on each click.
15397
- */
15398
-
15399
- var clipboard_Clipboard = function (_Emitter) {
15400
- _inherits(Clipboard, _Emitter);
15401
-
15402
- /**
15403
- * @param {String|HTMLElement|HTMLCollection|NodeList} trigger
15404
- * @param {Object} options
15405
- */
15406
- function Clipboard(trigger, options) {
15407
- clipboard_classCallCheck(this, Clipboard);
15408
-
15409
- var _this = _possibleConstructorReturn(this, (Clipboard.__proto__ || Object.getPrototypeOf(Clipboard)).call(this));
15410
-
15411
- _this.resolveOptions(options);
15412
- _this.listenClick(trigger);
15413
- return _this;
15414
- }
15415
-
15416
- /**
15417
- * Defines if attributes would be resolved using internal setter functions
15418
- * or custom functions that were passed in the constructor.
15419
- * @param {Object} options
15420
- */
15421
-
15422
-
15423
- clipboard_createClass(Clipboard, [{
15424
- key: 'resolveOptions',
15425
- value: function resolveOptions() {
15426
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
15427
-
15428
- this.action = typeof options.action === 'function' ? options.action : this.defaultAction;
15429
- this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;
15430
- this.text = typeof options.text === 'function' ? options.text : this.defaultText;
15431
- this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body;
15432
- }
15433
-
15434
- /**
15435
- * Adds a click event listener to the passed trigger.
15436
- * @param {String|HTMLElement|HTMLCollection|NodeList} trigger
15437
- */
15438
-
15439
- }, {
15440
- key: 'listenClick',
15441
- value: function listenClick(trigger) {
15442
- var _this2 = this;
15443
-
15444
- this.listener = listen_default()(trigger, 'click', function (e) {
15445
- return _this2.onClick(e);
15446
- });
15447
- }
15448
-
15449
- /**
15450
- * Defines a new `ClipboardAction` on each click event.
15451
- * @param {Event} e
15452
- */
15453
-
15454
- }, {
15455
- key: 'onClick',
15456
- value: function onClick(e) {
15457
- var trigger = e.delegateTarget || e.currentTarget;
15458
-
15459
- if (this.clipboardAction) {
15460
- this.clipboardAction = null;
15461
- }
15462
-
15463
- this.clipboardAction = new clipboard_action({
15464
- action: this.action(trigger),
15465
- target: this.target(trigger),
15466
- text: this.text(trigger),
15467
- container: this.container,
15468
- trigger: trigger,
15469
- emitter: this
15470
- });
15471
- }
15472
-
15473
- /**
15474
- * Default `action` lookup function.
15475
- * @param {Element} trigger
15476
- */
15477
-
15478
- }, {
15479
- key: 'defaultAction',
15480
- value: function defaultAction(trigger) {
15481
- return getAttributeValue('action', trigger);
15482
- }
15483
-
15484
- /**
15485
- * Default `target` lookup function.
15486
- * @param {Element} trigger
15487
- */
15488
-
15489
- }, {
15490
- key: 'defaultTarget',
15491
- value: function defaultTarget(trigger) {
15492
- var selector = getAttributeValue('target', trigger);
15493
-
15494
- if (selector) {
15495
- return document.querySelector(selector);
15496
- }
15497
- }
15498
-
15499
- /**
15500
- * Returns the support of the given action, or all actions if no action is
15501
- * given.
15502
- * @param {String} [action]
15503
- */
15504
-
15505
- }, {
15506
- key: 'defaultText',
15507
-
15508
-
15509
- /**
15510
- * Default `text` lookup function.
15511
- * @param {Element} trigger
15512
- */
15513
- value: function defaultText(trigger) {
15514
- return getAttributeValue('text', trigger);
15515
- }
15516
-
15517
- /**
15518
- * Destroy lifecycle.
15519
- */
15520
-
15521
- }, {
15522
- key: 'destroy',
15523
- value: function destroy() {
15524
- this.listener.destroy();
15525
-
15526
- if (this.clipboardAction) {
15527
- this.clipboardAction.destroy();
15528
- this.clipboardAction = null;
15529
- }
15530
- }
15531
- }], [{
15532
- key: 'isSupported',
15533
- value: function isSupported() {
15534
- var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];
15535
-
15536
- var actions = typeof action === 'string' ? [action] : action;
15537
- var support = !!document.queryCommandSupported;
15538
-
15539
- actions.forEach(function (action) {
15540
- support = support && !!document.queryCommandSupported(action);
15541
- });
15542
-
15543
- return support;
15544
- }
15545
- }]);
15546
-
15547
- return Clipboard;
15548
- }(tiny_emitter_default.a);
15549
-
15550
- /**
15551
- * Helper function to retrieve attribute value.
15552
- * @param {String} suffix
15553
- * @param {Element} element
15554
- */
15555
-
15556
-
15557
- function getAttributeValue(suffix, element) {
15558
- var attribute = 'data-clipboard-' + suffix;
15559
-
15560
- if (!element.hasAttribute(attribute)) {
15561
- return;
15562
- }
15563
-
15564
- return element.getAttribute(attribute);
15565
- }
15566
-
15567
- /* harmony default export */ var clipboard = __webpack_exports__["default"] = (clipboard_Clipboard);
15568
-
15569
- /***/ })
15570
- /******/ ])["default"];
15571
- });
15572
-
15573
- /***/ }),
15574
- /* 99 */
15575
- /***/ (function(module, exports, __webpack_require__) {
15576
-
15577
- var __WEBPACK_AMD_DEFINE_RESULT__;/*global define:false */
15578
- /**
15579
- * Copyright 2012-2017 Craig Campbell
15580
- *
15581
- * Licensed under the Apache License, Version 2.0 (the "License");
15582
- * you may not use this file except in compliance with the License.
15583
- * You may obtain a copy of the License at
15584
- *
15585
- * http://www.apache.org/licenses/LICENSE-2.0
15586
- *
15587
- * Unless required by applicable law or agreed to in writing, software
15588
- * distributed under the License is distributed on an "AS IS" BASIS,
15589
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15590
- * See the License for the specific language governing permissions and
15591
- * limitations under the License.
15592
- *
15593
- * Mousetrap is a simple keyboard shortcut library for Javascript with
15594
- * no external dependencies
15595
- *
15596
- * @version 1.6.5
15597
- * @url craig.is/killing/mice
15598
- */
15599
- (function(window, document, undefined) {
15600
-
15601
- // Check if mousetrap is used inside browser, if not, return
15602
- if (!window) {
15603
- return;
15604
- }
15605
-
15606
- /**
15607
- * mapping of special keycodes to their corresponding keys
15608
- *
15609
- * everything in this dictionary cannot use keypress events
15610
- * so it has to be here to map to the correct keycodes for
15611
- * keyup/keydown events
15612
- *
15613
- * @type {Object}
15614
- */
15615
- var _MAP = {
15616
- 8: 'backspace',
15617
- 9: 'tab',
15618
- 13: 'enter',
15619
- 16: 'shift',
15620
- 17: 'ctrl',
15621
- 18: 'alt',
15622
- 20: 'capslock',
15623
- 27: 'esc',
15624
- 32: 'space',
15625
- 33: 'pageup',
15626
- 34: 'pagedown',
15627
- 35: 'end',
15628
- 36: 'home',
15629
- 37: 'left',
15630
- 38: 'up',
15631
- 39: 'right',
15632
- 40: 'down',
15633
- 45: 'ins',
15634
- 46: 'del',
15635
- 91: 'meta',
15636
- 93: 'meta',
15637
- 224: 'meta'
15638
- };
15639
-
15640
- /**
15641
- * mapping for special characters so they can support
15642
- *
15643
- * this dictionary is only used incase you want to bind a
15644
- * keyup or keydown event to one of these keys
15645
- *
15646
- * @type {Object}
15647
- */
15648
- var _KEYCODE_MAP = {
15649
- 106: '*',
15650
- 107: '+',
15651
- 109: '-',
15652
- 110: '.',
15653
- 111 : '/',
15654
- 186: ';',
15655
- 187: '=',
15656
- 188: ',',
15657
- 189: '-',
15658
- 190: '.',
15659
- 191: '/',
15660
- 192: '`',
15661
- 219: '[',
15662
- 220: '\\',
15663
- 221: ']',
15664
- 222: '\''
15665
- };
15666
-
15667
- /**
15668
- * this is a mapping of keys that require shift on a US keypad
15669
- * back to the non shift equivelents
15670
- *
15671
- * this is so you can use keyup events with these keys
15672
- *
15673
- * note that this will only work reliably on US keyboards
15674
- *
15675
- * @type {Object}
15676
- */
15677
- var _SHIFT_MAP = {
15678
- '~': '`',
15679
- '!': '1',
15680
- '@': '2',
15681
- '#': '3',
15682
- '$': '4',
15683
- '%': '5',
15684
- '^': '6',
15685
- '&': '7',
15686
- '*': '8',
15687
- '(': '9',
15688
- ')': '0',
15689
- '_': '-',
15690
- '+': '=',
15691
- ':': ';',
15692
- '\"': '\'',
15693
- '<': ',',
15694
- '>': '.',
15695
- '?': '/',
15696
- '|': '\\'
15697
- };
15698
-
15699
- /**
15700
- * this is a list of special strings you can use to map
15701
- * to modifier keys when you specify your keyboard shortcuts
15702
- *
15703
- * @type {Object}
15704
- */
15705
- var _SPECIAL_ALIASES = {
15706
- 'option': 'alt',
15707
- 'command': 'meta',
15708
- 'return': 'enter',
15709
- 'escape': 'esc',
15710
- 'plus': '+',
15711
- 'mod': /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? 'meta' : 'ctrl'
15712
- };
15713
-
15714
- /**
15715
- * variable to store the flipped version of _MAP from above
15716
- * needed to check if we should use keypress or not when no action
15717
- * is specified
15718
- *
15719
- * @type {Object|undefined}
15720
- */
15721
- var _REVERSE_MAP;
15722
-
15723
- /**
15724
- * loop through the f keys, f1 to f19 and add them to the map
15725
- * programatically
15726
- */
15727
- for (var i = 1; i < 20; ++i) {
15728
- _MAP[111 + i] = 'f' + i;
15729
- }
15730
-
15731
- /**
15732
- * loop through to map numbers on the numeric keypad
15733
- */
15734
- for (i = 0; i <= 9; ++i) {
15735
-
15736
- // This needs to use a string cause otherwise since 0 is falsey
15737
- // mousetrap will never fire for numpad 0 pressed as part of a keydown
15738
- // event.
15739
- //
15740
- // @see https://github.com/ccampbell/mousetrap/pull/258
15741
- _MAP[i + 96] = i.toString();
15742
- }
15743
-
15744
- /**
15745
- * cross browser add event method
15746
- *
15747
- * @param {Element|HTMLDocument} object
15748
- * @param {string} type
15749
- * @param {Function} callback
15750
- * @returns void
15751
- */
15752
- function _addEvent(object, type, callback) {
15753
- if (object.addEventListener) {
15754
- object.addEventListener(type, callback, false);
15755
- return;
15756
- }
15757
-
15758
- object.attachEvent('on' + type, callback);
15759
- }
15760
-
15761
- /**
15762
- * takes the event and returns the key character
15763
- *
15764
- * @param {Event} e
15765
- * @return {string}
15766
- */
15767
- function _characterFromEvent(e) {
15768
-
15769
- // for keypress events we should return the character as is
15770
- if (e.type == 'keypress') {
15771
- var character = String.fromCharCode(e.which);
15772
-
15773
- // if the shift key is not pressed then it is safe to assume
15774
- // that we want the character to be lowercase. this means if
15775
- // you accidentally have caps lock on then your key bindings
15776
- // will continue to work
15777
- //
15778
- // the only side effect that might not be desired is if you
15779
- // bind something like 'A' cause you want to trigger an
15780
- // event when capital A is pressed caps lock will no longer
15781
- // trigger the event. shift+a will though.
15782
- if (!e.shiftKey) {
15783
- character = character.toLowerCase();
15784
- }
15785
-
15786
- return character;
15787
- }
15788
-
15789
- // for non keypress events the special maps are needed
15790
- if (_MAP[e.which]) {
15791
- return _MAP[e.which];
15792
- }
15793
-
15794
- if (_KEYCODE_MAP[e.which]) {
15795
- return _KEYCODE_MAP[e.which];
15796
- }
15797
-
15798
- // if it is not in the special map
15799
-
15800
- // with keydown and keyup events the character seems to always
15801
- // come in as an uppercase character whether you are pressing shift
15802
- // or not. we should make sure it is always lowercase for comparisons
15803
- return String.fromCharCode(e.which).toLowerCase();
15804
- }
15805
-
15806
- /**
15807
- * checks if two arrays are equal
15808
- *
15809
- * @param {Array} modifiers1
15810
- * @param {Array} modifiers2
15811
- * @returns {boolean}
15812
- */
15813
- function _modifiersMatch(modifiers1, modifiers2) {
15814
- return modifiers1.sort().join(',') === modifiers2.sort().join(',');
15815
- }
15816
-
15817
- /**
15818
- * takes a key event and figures out what the modifiers are
15819
- *
15820
- * @param {Event} e
15821
- * @returns {Array}
15822
- */
15823
- function _eventModifiers(e) {
15824
- var modifiers = [];
15825
-
15826
- if (e.shiftKey) {
15827
- modifiers.push('shift');
15828
- }
15829
-
15830
- if (e.altKey) {
15831
- modifiers.push('alt');
15832
- }
15833
-
15834
- if (e.ctrlKey) {
15835
- modifiers.push('ctrl');
15836
- }
15837
-
15838
- if (e.metaKey) {
15839
- modifiers.push('meta');
15840
- }
15841
-
15842
- return modifiers;
15843
- }
15844
-
15845
- /**
15846
- * prevents default for this event
15847
- *
15848
- * @param {Event} e
15849
- * @returns void
15850
- */
15851
- function _preventDefault(e) {
15852
- if (e.preventDefault) {
15853
- e.preventDefault();
15854
- return;
15855
- }
15856
-
15857
- e.returnValue = false;
15858
- }
15859
-
15860
- /**
15861
- * stops propogation for this event
15862
- *
15863
- * @param {Event} e
15864
- * @returns void
15865
- */
15866
- function _stopPropagation(e) {
15867
- if (e.stopPropagation) {
15868
- e.stopPropagation();
15869
- return;
15870
- }
15871
-
15872
- e.cancelBubble = true;
15873
- }
15874
-
15875
- /**
15876
- * determines if the keycode specified is a modifier key or not
15877
- *
15878
- * @param {string} key
15879
- * @returns {boolean}
15880
- */
15881
- function _isModifier(key) {
15882
- return key == 'shift' || key == 'ctrl' || key == 'alt' || key == 'meta';
15883
- }
15884
-
15885
- /**
15886
- * reverses the map lookup so that we can look for specific keys
15887
- * to see what can and can't use keypress
15888
- *
15889
- * @return {Object}
15890
- */
15891
- function _getReverseMap() {
15892
- if (!_REVERSE_MAP) {
15893
- _REVERSE_MAP = {};
15894
- for (var key in _MAP) {
15895
-
15896
- // pull out the numeric keypad from here cause keypress should
15897
- // be able to detect the keys from the character
15898
- if (key > 95 && key < 112) {
15899
- continue;
15900
- }
15901
-
15902
- if (_MAP.hasOwnProperty(key)) {
15903
- _REVERSE_MAP[_MAP[key]] = key;
15904
- }
15905
- }
15906
- }
15907
- return _REVERSE_MAP;
15908
- }
15909
-
15910
- /**
15911
- * picks the best action based on the key combination
15912
- *
15913
- * @param {string} key - character for key
15914
- * @param {Array} modifiers
15915
- * @param {string=} action passed in
15916
- */
15917
- function _pickBestAction(key, modifiers, action) {
15918
-
15919
- // if no action was picked in we should try to pick the one
15920
- // that we think would work best for this key
15921
- if (!action) {
15922
- action = _getReverseMap()[key] ? 'keydown' : 'keypress';
15923
- }
15924
-
15925
- // modifier keys don't work as expected with keypress,
15926
- // switch to keydown
15927
- if (action == 'keypress' && modifiers.length) {
15928
- action = 'keydown';
15929
- }
15930
-
15931
- return action;
15932
- }
15933
-
15934
- /**
15935
- * Converts from a string key combination to an array
15936
- *
15937
- * @param {string} combination like "command+shift+l"
15938
- * @return {Array}
15939
- */
15940
- function _keysFromString(combination) {
15941
- if (combination === '+') {
15942
- return ['+'];
15943
- }
15944
-
15945
- combination = combination.replace(/\+{2}/g, '+plus');
15946
- return combination.split('+');
15947
- }
15948
-
15949
- /**
15950
- * Gets info for a specific key combination
15951
- *
15952
- * @param {string} combination key combination ("command+s" or "a" or "*")
15953
- * @param {string=} action
15954
- * @returns {Object}
15955
- */
15956
- function _getKeyInfo(combination, action) {
15957
- var keys;
15958
- var key;
15959
- var i;
15960
- var modifiers = [];
15961
-
15962
- // take the keys from this pattern and figure out what the actual
15963
- // pattern is all about
15964
- keys = _keysFromString(combination);
15965
-
15966
- for (i = 0; i < keys.length; ++i) {
15967
- key = keys[i];
15968
-
15969
- // normalize key names
15970
- if (_SPECIAL_ALIASES[key]) {
15971
- key = _SPECIAL_ALIASES[key];
15972
- }
15973
-
15974
- // if this is not a keypress event then we should
15975
- // be smart about using shift keys
15976
- // this will only work for US keyboards however
15977
- if (action && action != 'keypress' && _SHIFT_MAP[key]) {
15978
- key = _SHIFT_MAP[key];
15979
- modifiers.push('shift');
15980
- }
15981
-
15982
- // if this key is a modifier then add it to the list of modifiers
15983
- if (_isModifier(key)) {
15984
- modifiers.push(key);
15985
- }
15986
- }
15987
-
15988
- // depending on what the key combination is
15989
- // we will try to pick the best event for it
15990
- action = _pickBestAction(key, modifiers, action);
15991
-
15992
- return {
15993
- key: key,
15994
- modifiers: modifiers,
15995
- action: action
15996
- };
15997
- }
15998
-
15999
- function _belongsTo(element, ancestor) {
16000
- if (element === null || element === document) {
16001
- return false;
16002
- }
16003
-
16004
- if (element === ancestor) {
16005
- return true;
16006
- }
16007
-
16008
- return _belongsTo(element.parentNode, ancestor);
16009
- }
16010
-
16011
- function Mousetrap(targetElement) {
16012
- var self = this;
16013
-
16014
- targetElement = targetElement || document;
16015
-
16016
- if (!(self instanceof Mousetrap)) {
16017
- return new Mousetrap(targetElement);
16018
- }
16019
-
16020
- /**
16021
- * element to attach key events to
16022
- *
16023
- * @type {Element}
16024
- */
16025
- self.target = targetElement;
16026
-
16027
- /**
16028
- * a list of all the callbacks setup via Mousetrap.bind()
16029
- *
16030
- * @type {Object}
16031
- */
16032
- self._callbacks = {};
16033
-
16034
- /**
16035
- * direct map of string combinations to callbacks used for trigger()
16036
- *
16037
- * @type {Object}
16038
- */
16039
- self._directMap = {};
16040
-
16041
- /**
16042
- * keeps track of what level each sequence is at since multiple
16043
- * sequences can start out with the same sequence
16044
- *
16045
- * @type {Object}
16046
- */
16047
- var _sequenceLevels = {};
16048
-
16049
- /**
16050
- * variable to store the setTimeout call
16051
- *
16052
- * @type {null|number}
16053
- */
16054
- var _resetTimer;
16055
-
16056
- /**
16057
- * temporary state where we will ignore the next keyup
16058
- *
16059
- * @type {boolean|string}
16060
- */
16061
- var _ignoreNextKeyup = false;
16062
-
16063
- /**
16064
- * temporary state where we will ignore the next keypress
16065
- *
16066
- * @type {boolean}
16067
- */
16068
- var _ignoreNextKeypress = false;
16069
-
16070
- /**
16071
- * are we currently inside of a sequence?
16072
- * type of action ("keyup" or "keydown" or "keypress") or false
16073
- *
16074
- * @type {boolean|string}
16075
- */
16076
- var _nextExpectedAction = false;
16077
-
16078
- /**
16079
- * resets all sequence counters except for the ones passed in
16080
- *
16081
- * @param {Object} doNotReset
16082
- * @returns void
16083
- */
16084
- function _resetSequences(doNotReset) {
16085
- doNotReset = doNotReset || {};
16086
-
16087
- var activeSequences = false,
16088
- key;
16089
-
16090
- for (key in _sequenceLevels) {
16091
- if (doNotReset[key]) {
16092
- activeSequences = true;
16093
- continue;
16094
- }
16095
- _sequenceLevels[key] = 0;
16096
- }
16097
-
16098
- if (!activeSequences) {
16099
- _nextExpectedAction = false;
16100
- }
16101
- }
16102
-
16103
- /**
16104
- * finds all callbacks that match based on the keycode, modifiers,
16105
- * and action
16106
- *
16107
- * @param {string} character
16108
- * @param {Array} modifiers
16109
- * @param {Event|Object} e
16110
- * @param {string=} sequenceName - name of the sequence we are looking for
16111
- * @param {string=} combination
16112
- * @param {number=} level
16113
- * @returns {Array}
16114
- */
16115
- function _getMatches(character, modifiers, e, sequenceName, combination, level) {
16116
- var i;
16117
- var callback;
16118
- var matches = [];
16119
- var action = e.type;
16120
-
16121
- // if there are no events related to this keycode
16122
- if (!self._callbacks[character]) {
16123
- return [];
16124
- }
16125
-
16126
- // if a modifier key is coming up on its own we should allow it
16127
- if (action == 'keyup' && _isModifier(character)) {
16128
- modifiers = [character];
16129
- }
16130
-
16131
- // loop through all callbacks for the key that was pressed
16132
- // and see if any of them match
16133
- for (i = 0; i < self._callbacks[character].length; ++i) {
16134
- callback = self._callbacks[character][i];
16135
-
16136
- // if a sequence name is not specified, but this is a sequence at
16137
- // the wrong level then move onto the next match
16138
- if (!sequenceName && callback.seq && _sequenceLevels[callback.seq] != callback.level) {
16139
- continue;
16140
- }
16141
-
16142
- // if the action we are looking for doesn't match the action we got
16143
- // then we should keep going
16144
- if (action != callback.action) {
16145
- continue;
16146
- }
16147
-
16148
- // if this is a keypress event and the meta key and control key
16149
- // are not pressed that means that we need to only look at the
16150
- // character, otherwise check the modifiers as well
16151
- //
16152
- // chrome will not fire a keypress if meta or control is down
16153
- // safari will fire a keypress if meta or meta+shift is down
16154
- // firefox will fire a keypress if meta or control is down
16155
- if ((action == 'keypress' && !e.metaKey && !e.ctrlKey) || _modifiersMatch(modifiers, callback.modifiers)) {
16156
-
16157
- // when you bind a combination or sequence a second time it
16158
- // should overwrite the first one. if a sequenceName or
16159
- // combination is specified in this call it does just that
16160
- //
16161
- // @todo make deleting its own method?
16162
- var deleteCombo = !sequenceName && callback.combo == combination;
16163
- var deleteSequence = sequenceName && callback.seq == sequenceName && callback.level == level;
16164
- if (deleteCombo || deleteSequence) {
16165
- self._callbacks[character].splice(i, 1);
16166
- }
16167
-
16168
- matches.push(callback);
16169
- }
16170
- }
16171
-
16172
- return matches;
16173
- }
16174
-
16175
- /**
16176
- * actually calls the callback function
16177
- *
16178
- * if your callback function returns false this will use the jquery
16179
- * convention - prevent default and stop propogation on the event
16180
- *
16181
- * @param {Function} callback
16182
- * @param {Event} e
16183
- * @returns void
16184
- */
16185
- function _fireCallback(callback, e, combo, sequence) {
16186
-
16187
- // if this event should not happen stop here
16188
- if (self.stopCallback(e, e.target || e.srcElement, combo, sequence)) {
16189
- return;
16190
- }
16191
-
16192
- if (callback(e, combo) === false) {
16193
- _preventDefault(e);
16194
- _stopPropagation(e);
16195
- }
16196
- }
16197
-
16198
- /**
16199
- * handles a character key event
16200
- *
16201
- * @param {string} character
16202
- * @param {Array} modifiers
16203
- * @param {Event} e
16204
- * @returns void
16205
- */
16206
- self._handleKey = function(character, modifiers, e) {
16207
- var callbacks = _getMatches(character, modifiers, e);
16208
- var i;
16209
- var doNotReset = {};
16210
- var maxLevel = 0;
16211
- var processedSequenceCallback = false;
16212
-
16213
- // Calculate the maxLevel for sequences so we can only execute the longest callback sequence
16214
- for (i = 0; i < callbacks.length; ++i) {
16215
- if (callbacks[i].seq) {
16216
- maxLevel = Math.max(maxLevel, callbacks[i].level);
16217
- }
16218
- }
16219
-
16220
- // loop through matching callbacks for this key event
16221
- for (i = 0; i < callbacks.length; ++i) {
16222
-
16223
- // fire for all sequence callbacks
16224
- // this is because if for example you have multiple sequences
16225
- // bound such as "g i" and "g t" they both need to fire the
16226
- // callback for matching g cause otherwise you can only ever
16227
- // match the first one
16228
- if (callbacks[i].seq) {
16229
-
16230
- // only fire callbacks for the maxLevel to prevent
16231
- // subsequences from also firing
16232
- //
16233
- // for example 'a option b' should not cause 'option b' to fire
16234
- // even though 'option b' is part of the other sequence
16235
- //
16236
- // any sequences that do not match here will be discarded
16237
- // below by the _resetSequences call
16238
- if (callbacks[i].level != maxLevel) {
16239
- continue;
16240
- }
16241
-
16242
- processedSequenceCallback = true;
16243
-
16244
- // keep a list of which sequences were matches for later
16245
- doNotReset[callbacks[i].seq] = 1;
16246
- _fireCallback(callbacks[i].callback, e, callbacks[i].combo, callbacks[i].seq);
16247
- continue;
16248
- }
16249
-
16250
- // if there were no sequence matches but we are still here
16251
- // that means this is a regular match so we should fire that
16252
- if (!processedSequenceCallback) {
16253
- _fireCallback(callbacks[i].callback, e, callbacks[i].combo);
16254
- }
16255
- }
16256
-
16257
- // if the key you pressed matches the type of sequence without
16258
- // being a modifier (ie "keyup" or "keypress") then we should
16259
- // reset all sequences that were not matched by this event
16260
- //
16261
- // this is so, for example, if you have the sequence "h a t" and you
16262
- // type "h e a r t" it does not match. in this case the "e" will
16263
- // cause the sequence to reset
16264
- //
16265
- // modifier keys are ignored because you can have a sequence
16266
- // that contains modifiers such as "enter ctrl+space" and in most
16267
- // cases the modifier key will be pressed before the next key
16268
- //
16269
- // also if you have a sequence such as "ctrl+b a" then pressing the
16270
- // "b" key will trigger a "keypress" and a "keydown"
16271
- //
16272
- // the "keydown" is expected when there is a modifier, but the
16273
- // "keypress" ends up matching the _nextExpectedAction since it occurs
16274
- // after and that causes the sequence to reset
16275
- //
16276
- // we ignore keypresses in a sequence that directly follow a keydown
16277
- // for the same character
16278
- var ignoreThisKeypress = e.type == 'keypress' && _ignoreNextKeypress;
16279
- if (e.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) {
16280
- _resetSequences(doNotReset);
16281
- }
16282
-
16283
- _ignoreNextKeypress = processedSequenceCallback && e.type == 'keydown';
16284
- };
16285
-
16286
- /**
16287
- * handles a keydown event
16288
- *
16289
- * @param {Event} e
16290
- * @returns void
16291
- */
16292
- function _handleKeyEvent(e) {
16293
-
16294
- // normalize e.which for key events
16295
- // @see http://stackoverflow.com/questions/4285627/javascript-keycode-vs-charcode-utter-confusion
16296
- if (typeof e.which !== 'number') {
16297
- e.which = e.keyCode;
16298
- }
16299
-
16300
- var character = _characterFromEvent(e);
16301
-
16302
- // no character found then stop
16303
- if (!character) {
16304
- return;
16305
- }
16306
-
16307
- // need to use === for the character check because the character can be 0
16308
- if (e.type == 'keyup' && _ignoreNextKeyup === character) {
16309
- _ignoreNextKeyup = false;
16310
- return;
16311
- }
16312
-
16313
- self.handleKey(character, _eventModifiers(e), e);
16314
- }
16315
-
16316
- /**
16317
- * called to set a 1 second timeout on the specified sequence
16318
- *
16319
- * this is so after each key press in the sequence you have 1 second
16320
- * to press the next key before you have to start over
16321
- *
16322
- * @returns void
16323
- */
16324
- function _resetSequenceTimer() {
16325
- clearTimeout(_resetTimer);
16326
- _resetTimer = setTimeout(_resetSequences, 1000);
16327
- }
16328
-
16329
- /**
16330
- * binds a key sequence to an event
16331
- *
16332
- * @param {string} combo - combo specified in bind call
16333
- * @param {Array} keys
16334
- * @param {Function} callback
16335
- * @param {string=} action
16336
- * @returns void
16337
- */
16338
- function _bindSequence(combo, keys, callback, action) {
16339
-
16340
- // start off by adding a sequence level record for this combination
16341
- // and setting the level to 0
16342
- _sequenceLevels[combo] = 0;
16343
-
16344
- /**
16345
- * callback to increase the sequence level for this sequence and reset
16346
- * all other sequences that were active
16347
- *
16348
- * @param {string} nextAction
16349
- * @returns {Function}
16350
- */
16351
- function _increaseSequence(nextAction) {
16352
- return function() {
16353
- _nextExpectedAction = nextAction;
16354
- ++_sequenceLevels[combo];
16355
- _resetSequenceTimer();
16356
- };
16357
- }
16358
-
16359
- /**
16360
- * wraps the specified callback inside of another function in order
16361
- * to reset all sequence counters as soon as this sequence is done
16362
- *
16363
- * @param {Event} e
16364
- * @returns void
16365
- */
16366
- function _callbackAndReset(e) {
16367
- _fireCallback(callback, e, combo);
16368
-
16369
- // we should ignore the next key up if the action is key down
16370
- // or keypress. this is so if you finish a sequence and
16371
- // release the key the final key will not trigger a keyup
16372
- if (action !== 'keyup') {
16373
- _ignoreNextKeyup = _characterFromEvent(e);
16374
- }
16375
-
16376
- // weird race condition if a sequence ends with the key
16377
- // another sequence begins with
16378
- setTimeout(_resetSequences, 10);
16379
- }
16380
-
16381
- // loop through keys one at a time and bind the appropriate callback
16382
- // function. for any key leading up to the final one it should
16383
- // increase the sequence. after the final, it should reset all sequences
16384
- //
16385
- // if an action is specified in the original bind call then that will
16386
- // be used throughout. otherwise we will pass the action that the
16387
- // next key in the sequence should match. this allows a sequence
16388
- // to mix and match keypress and keydown events depending on which
16389
- // ones are better suited to the key provided
16390
- for (var i = 0; i < keys.length; ++i) {
16391
- var isFinal = i + 1 === keys.length;
16392
- var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys[i + 1]).action);
16393
- _bindSingle(keys[i], wrappedCallback, action, combo, i);
16394
- }
16395
- }
16396
-
16397
- /**
16398
- * binds a single keyboard combination
16399
- *
16400
- * @param {string} combination
16401
- * @param {Function} callback
16402
- * @param {string=} action
16403
- * @param {string=} sequenceName - name of sequence if part of sequence
16404
- * @param {number=} level - what part of the sequence the command is
16405
- * @returns void
16406
- */
16407
- function _bindSingle(combination, callback, action, sequenceName, level) {
16408
-
16409
- // store a direct mapped reference for use with Mousetrap.trigger
16410
- self._directMap[combination + ':' + action] = callback;
16411
-
16412
- // make sure multiple spaces in a row become a single space
16413
- combination = combination.replace(/\s+/g, ' ');
16414
-
16415
- var sequence = combination.split(' ');
16416
- var info;
16417
-
16418
- // if this pattern is a sequence of keys then run through this method
16419
- // to reprocess each pattern one key at a time
16420
- if (sequence.length > 1) {
16421
- _bindSequence(combination, sequence, callback, action);
16422
- return;
16423
- }
16424
-
16425
- info = _getKeyInfo(combination, action);
16426
-
16427
- // make sure to initialize array if this is the first time
16428
- // a callback is added for this key
16429
- self._callbacks[info.key] = self._callbacks[info.key] || [];
16430
-
16431
- // remove an existing match if there is one
16432
- _getMatches(info.key, info.modifiers, {type: info.action}, sequenceName, combination, level);
16433
-
16434
- // add this call back to the array
16435
- // if it is a sequence put it at the beginning
16436
- // if not put it at the end
16437
- //
16438
- // this is important because the way these are processed expects
16439
- // the sequence ones to come first
16440
- self._callbacks[info.key][sequenceName ? 'unshift' : 'push']({
16441
- callback: callback,
16442
- modifiers: info.modifiers,
16443
- action: info.action,
16444
- seq: sequenceName,
16445
- level: level,
16446
- combo: combination
16447
- });
16448
- }
16449
-
16450
- /**
16451
- * binds multiple combinations to the same callback
16452
- *
16453
- * @param {Array} combinations
16454
- * @param {Function} callback
16455
- * @param {string|undefined} action
16456
- * @returns void
16457
- */
16458
- self._bindMultiple = function(combinations, callback, action) {
16459
- for (var i = 0; i < combinations.length; ++i) {
16460
- _bindSingle(combinations[i], callback, action);
16461
- }
16462
- };
16463
-
16464
- // start!
16465
- _addEvent(targetElement, 'keypress', _handleKeyEvent);
16466
- _addEvent(targetElement, 'keydown', _handleKeyEvent);
16467
- _addEvent(targetElement, 'keyup', _handleKeyEvent);
16468
- }
16469
-
16470
- /**
16471
- * binds an event to mousetrap
16472
- *
16473
- * can be a single key, a combination of keys separated with +,
16474
- * an array of keys, or a sequence of keys separated by spaces
16475
- *
16476
- * be sure to list the modifier keys first to make sure that the
16477
- * correct key ends up getting bound (the last key in the pattern)
16478
- *
16479
- * @param {string|Array} keys
16480
- * @param {Function} callback
16481
- * @param {string=} action - 'keypress', 'keydown', or 'keyup'
16482
- * @returns void
16483
- */
16484
- Mousetrap.prototype.bind = function(keys, callback, action) {
16485
- var self = this;
16486
- keys = keys instanceof Array ? keys : [keys];
16487
- self._bindMultiple.call(self, keys, callback, action);
16488
- return self;
16489
- };
16490
-
16491
- /**
16492
- * unbinds an event to mousetrap
16493
- *
16494
- * the unbinding sets the callback function of the specified key combo
16495
- * to an empty function and deletes the corresponding key in the
16496
- * _directMap dict.
16497
- *
16498
- * TODO: actually remove this from the _callbacks dictionary instead
16499
- * of binding an empty function
16500
- *
16501
- * the keycombo+action has to be exactly the same as
16502
- * it was defined in the bind method
16503
- *
16504
- * @param {string|Array} keys
16505
- * @param {string} action
16506
- * @returns void
16507
- */
16508
- Mousetrap.prototype.unbind = function(keys, action) {
16509
- var self = this;
16510
- return self.bind.call(self, keys, function() {}, action);
16511
- };
16512
-
16513
- /**
16514
- * triggers an event that has already been bound
16515
- *
16516
- * @param {string} keys
16517
- * @param {string=} action
16518
- * @returns void
16519
- */
16520
- Mousetrap.prototype.trigger = function(keys, action) {
16521
- var self = this;
16522
- if (self._directMap[keys + ':' + action]) {
16523
- self._directMap[keys + ':' + action]({}, keys);
16524
- }
16525
- return self;
16526
- };
16527
-
16528
- /**
16529
- * resets the library back to its initial state. this is useful
16530
- * if you want to clear out the current keyboard shortcuts and bind
16531
- * new ones - for example if you switch to another page
16532
- *
16533
- * @returns void
16534
- */
16535
- Mousetrap.prototype.reset = function() {
16536
- var self = this;
16537
- self._callbacks = {};
16538
- self._directMap = {};
16539
- return self;
16540
- };
16541
-
16542
- /**
16543
- * should we stop this event before firing off callbacks
16544
- *
16545
- * @param {Event} e
16546
- * @param {Element} element
16547
- * @return {boolean}
16548
- */
16549
- Mousetrap.prototype.stopCallback = function(e, element) {
16550
- var self = this;
16551
-
16552
- // if the element has the class "mousetrap" then no need to stop
16553
- if ((' ' + element.className + ' ').indexOf(' mousetrap ') > -1) {
16554
- return false;
16555
- }
16556
-
16557
- if (_belongsTo(element, self.target)) {
16558
- return false;
16559
- }
16560
-
16561
- // Events originating from a shadow DOM are re-targetted and `e.target` is the shadow host,
16562
- // not the initial event target in the shadow tree. Note that not all events cross the
16563
- // shadow boundary.
16564
- // For shadow trees with `mode: 'open'`, the initial event target is the first element in
16565
- // the event’s composed path. For shadow trees with `mode: 'closed'`, the initial event
16566
- // target cannot be obtained.
16567
- if ('composedPath' in e && typeof e.composedPath === 'function') {
16568
- // For open shadow trees, update `element` so that the following check works.
16569
- var initialEventTarget = e.composedPath()[0];
16570
- if (initialEventTarget !== e.target) {
16571
- element = initialEventTarget;
16572
- }
16573
- }
16574
-
16575
- // stop for input, select, and textarea
16576
- return element.tagName == 'INPUT' || element.tagName == 'SELECT' || element.tagName == 'TEXTAREA' || element.isContentEditable;
16577
- };
16578
-
16579
- /**
16580
- * exposes _handleKey publicly so it can be overwritten by extensions
16581
- */
16582
- Mousetrap.prototype.handleKey = function() {
16583
- var self = this;
16584
- return self._handleKey.apply(self, arguments);
16585
- };
16586
-
16587
- /**
16588
- * allow custom key mappings
16589
- */
16590
- Mousetrap.addKeycodes = function(object) {
16591
- for (var key in object) {
16592
- if (object.hasOwnProperty(key)) {
16593
- _MAP[key] = object[key];
16594
- }
16595
- }
16596
- _REVERSE_MAP = null;
16597
- };
16598
-
16599
- /**
16600
- * Init the global mousetrap functions
16601
- *
16602
- * This method is needed to allow the global mousetrap functions to work
16603
- * now that mousetrap is a constructor function.
16604
- */
16605
- Mousetrap.init = function() {
16606
- var documentMousetrap = Mousetrap(document);
16607
- for (var method in documentMousetrap) {
16608
- if (method.charAt(0) !== '_') {
16609
- Mousetrap[method] = (function(method) {
16610
- return function() {
16611
- return documentMousetrap[method].apply(documentMousetrap, arguments);
16612
- };
16613
- } (method));
16614
- }
16615
- }
16616
- };
16617
-
16618
- Mousetrap.init();
16619
-
16620
- // expose mousetrap to the global object
16621
- window.Mousetrap = Mousetrap;
16622
-
16623
- // expose as a common js module
16624
- if (typeof module !== 'undefined' && module.exports) {
16625
- module.exports = Mousetrap;
16626
- }
16627
-
16628
- // expose mousetrap as an AMD module
16629
- if (true) {
16630
- !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() {
16631
- return Mousetrap;
16632
- }).call(exports, __webpack_require__, exports, module),
16633
- __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
16634
- }
16635
- }) (typeof window !== 'undefined' ? window : null, typeof window !== 'undefined' ? document : null);
16636
-
16637
-
16638
- /***/ }),
16639
- /* 100 */
16640
- /***/ (function(module, exports) {
16641
-
16642
- /**
16643
- * adds a bindGlobal method to Mousetrap that allows you to
16644
- * bind specific keyboard shortcuts that will still work
16645
- * inside a text input field
16646
- *
16647
- * usage:
16648
- * Mousetrap.bindGlobal('ctrl+s', _saveChanges);
16649
- */
16650
- /* global Mousetrap:true */
16651
- (function(Mousetrap) {
16652
- if (! Mousetrap) {
16653
- return;
16654
- }
16655
- var _globalCallbacks = {};
16656
- var _originalStopCallback = Mousetrap.prototype.stopCallback;
16657
-
16658
- Mousetrap.prototype.stopCallback = function(e, element, combo, sequence) {
16659
- var self = this;
16660
-
16661
- if (self.paused) {
16662
- return true;
16663
- }
16664
-
16665
- if (_globalCallbacks[combo] || _globalCallbacks[sequence]) {
16666
- return false;
16667
- }
16668
-
16669
- return _originalStopCallback.call(self, e, element, combo);
16670
- };
16671
-
16672
- Mousetrap.prototype.bindGlobal = function(keys, callback, action) {
16673
- var self = this;
16674
- self.bind(keys, callback, action);
16675
-
16676
- if (keys instanceof Array) {
16677
- for (var i = 0; i < keys.length; i++) {
16678
- _globalCallbacks[keys[i]] = true;
16679
- }
16680
- return;
16681
- }
16682
-
16683
- _globalCallbacks[keys] = true;
16684
- };
16685
-
16686
- Mousetrap.init();
16687
- }) (typeof Mousetrap !== "undefined" ? Mousetrap : undefined);
16688
-
16689
-
16690
- /***/ }),
16691
- /* 101 */
16692
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
16693
-
16694
- "use strict";
16695
- /* harmony export (immutable) */ __webpack_exports__["a"] = useMediaQuery;
16696
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_slicedToArray__ = __webpack_require__(27);
16697
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__wordpress_element__ = __webpack_require__(24);
16698
-
16699
-
16700
- /**
16701
- * WordPress dependencies
16702
- */
16703
-
16704
- /**
16705
- * Runs a media query and returns its value when it changes.
16706
- *
16707
- * @param {string} [query] Media Query.
16708
- * @return {boolean} return value of the media query.
16709
- */
16710
-
16711
- function useMediaQuery(query) {
16712
- var _useState = Object(__WEBPACK_IMPORTED_MODULE_1__wordpress_element__["l" /* useState */])(query && window.matchMedia(query).matches),
16713
- _useState2 = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_slicedToArray__["a" /* default */])(_useState, 2),
16714
- match = _useState2[0],
16715
- setMatch = _useState2[1];
16716
-
16717
- Object(__WEBPACK_IMPORTED_MODULE_1__wordpress_element__["g" /* useEffect */])(function () {
16718
- if (!query) {
16719
- return;
16720
- }
16721
-
16722
- var updateMatch = function updateMatch() {
16723
- return setMatch(window.matchMedia(query).matches);
16724
- };
16725
-
16726
- updateMatch();
16727
- var list = window.matchMedia(query);
16728
- list.addListener(updateMatch);
16729
- return function () {
16730
- list.removeListener(updateMatch);
16731
- };
16732
- }, [query]);
16733
- return query && match;
16734
- }
16735
- //# sourceMappingURL=index.js.map
16736
-
16737
- /***/ }),
16738
- /* 102 */
16739
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
16740
-
16741
- "use strict";
16742
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createQueue; });
16743
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__request_idle_callback__ = __webpack_require__(507);
16744
- /**
16745
- * Internal dependencies
16746
- */
16747
-
16748
- /**
16749
- * Enqueued callback to invoke once idle time permits.
16750
- *
16751
- * @typedef {()=>void} WPPriorityQueueCallback
16752
- */
16753
-
16754
- /**
16755
- * An object used to associate callbacks in a particular context grouping.
16756
- *
16757
- * @typedef {{}} WPPriorityQueueContext
16758
- */
16759
-
16760
- /**
16761
- * Function to add callback to priority queue.
16762
- *
16763
- * @typedef {(element:WPPriorityQueueContext,item:WPPriorityQueueCallback)=>void} WPPriorityQueueAdd
16764
- */
16765
-
16766
- /**
16767
- * Function to flush callbacks from priority queue.
16768
- *
16769
- * @typedef {(element:WPPriorityQueueContext)=>boolean} WPPriorityQueueFlush
16770
- */
16771
-
16772
- /**
16773
- * Reset the queue.
16774
- *
16775
- * @typedef {()=>void} WPPriorityQueueReset
16776
- */
16777
-
16778
- /**
16779
- * Priority queue instance.
16780
- *
16781
- * @typedef {Object} WPPriorityQueue
16782
- *
16783
- * @property {WPPriorityQueueAdd} add Add callback to queue for context.
16784
- * @property {WPPriorityQueueFlush} flush Flush queue for context.
16785
- * @property {WPPriorityQueueReset} reset Reset queue.
16786
- */
16787
-
16788
- /**
16789
- * Creates a context-aware queue that only executes
16790
- * the last task of a given context.
16791
- *
16792
- * @example
16793
- *```js
16794
- * import { createQueue } from '@wordpress/priority-queue';
16795
- *
16796
- * const queue = createQueue();
16797
- *
16798
- * // Context objects.
16799
- * const ctx1 = {};
16800
- * const ctx2 = {};
16801
- *
16802
- * // For a given context in the queue, only the last callback is executed.
16803
- * queue.add( ctx1, () => console.log( 'This will be printed first' ) );
16804
- * queue.add( ctx2, () => console.log( 'This won\'t be printed' ) );
16805
- * queue.add( ctx2, () => console.log( 'This will be printed second' ) );
16806
- *```
16807
- *
16808
- * @return {WPPriorityQueue} Queue object with `add`, `flush` and `reset` methods.
16809
- */
16810
-
16811
- var createQueue = function createQueue() {
16812
- /** @type {WPPriorityQueueContext[]} */
16813
- var waitingList = [];
16814
- /** @type {WeakMap<WPPriorityQueueContext,WPPriorityQueueCallback>} */
16815
-
16816
- var elementsMap = new WeakMap();
16817
- var isRunning = false;
16818
- /**
16819
- * Callback to process as much queue as time permits.
16820
- *
16821
- * @param {IdleDeadline|number} deadline Idle callback deadline object, or
16822
- * animation frame timestamp.
16823
- */
16824
-
16825
- var runWaitingList = function runWaitingList(deadline) {
16826
- var hasTimeRemaining = typeof deadline === 'number' ? function () {
16827
- return false;
16828
- } : function () {
16829
- return deadline.timeRemaining() > 0;
16830
- };
16831
-
16832
- do {
16833
- if (waitingList.length === 0) {
16834
- isRunning = false;
16835
- return;
16836
- }
16837
-
16838
- var nextElement =
16839
- /** @type {WPPriorityQueueContext} */
16840
- waitingList.shift();
16841
- var callback =
16842
- /** @type {WPPriorityQueueCallback} */
16843
- elementsMap.get(nextElement);
16844
- callback();
16845
- elementsMap.delete(nextElement);
16846
- } while (hasTimeRemaining());
16847
-
16848
- Object(__WEBPACK_IMPORTED_MODULE_0__request_idle_callback__["a" /* default */])(runWaitingList);
16849
- };
16850
- /**
16851
- * Add a callback to the queue for a given context.
16852
- *
16853
- * @type {WPPriorityQueueAdd}
16854
- *
16855
- * @param {WPPriorityQueueContext} element Context object.
16856
- * @param {WPPriorityQueueCallback} item Callback function.
16857
- */
16858
-
16859
-
16860
- var add = function add(element, item) {
16861
- if (!elementsMap.has(element)) {
16862
- waitingList.push(element);
16863
- }
16864
-
16865
- elementsMap.set(element, item);
16866
-
16867
- if (!isRunning) {
16868
- isRunning = true;
16869
- Object(__WEBPACK_IMPORTED_MODULE_0__request_idle_callback__["a" /* default */])(runWaitingList);
16870
- }
16871
- };
16872
- /**
16873
- * Flushes queue for a given context, returning true if the flush was
16874
- * performed, or false if there is no queue for the given context.
16875
- *
16876
- * @type {WPPriorityQueueFlush}
16877
- *
16878
- * @param {WPPriorityQueueContext} element Context object.
16879
- *
16880
- * @return {boolean} Whether flush was performed.
16881
- */
16882
-
16883
-
16884
- var flush = function flush(element) {
16885
- if (!elementsMap.has(element)) {
16886
- return false;
16887
- }
16888
-
16889
- var index = waitingList.indexOf(element);
16890
- waitingList.splice(index, 1);
16891
- var callback =
16892
- /** @type {WPPriorityQueueCallback} */
16893
- elementsMap.get(element);
16894
- elementsMap.delete(element);
16895
- callback();
16896
- return true;
16897
- };
16898
- /**
16899
- * Reset the queue without running the pending callbacks.
16900
- *
16901
- * @type {WPPriorityQueueReset}
16902
- */
16903
-
16904
-
16905
- var reset = function reset() {
16906
- waitingList = [];
16907
- elementsMap = new WeakMap();
16908
- isRunning = false;
16909
- };
16910
-
16911
- return {
16912
- add: add,
16913
- flush: flush,
16914
- reset: reset
16915
- };
16916
- };
16917
- //# sourceMappingURL=index.js.map
16918
-
16919
- /***/ }),
16920
- /* 103 */
16921
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
16922
-
16923
- "use strict";
16924
- /* unused harmony export useCallback */
16925
- /* unused harmony export useCallbackOne */
16926
- /* unused harmony export useMemo */
16927
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return useMemoOne; });
16928
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react__ = __webpack_require__(9);
16929
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_react__);
16930
-
16931
-
16932
- function areInputsEqual(newInputs, lastInputs) {
16933
- if (newInputs.length !== lastInputs.length) {
16934
- return false;
16935
- }
16936
-
16937
- for (var i = 0; i < newInputs.length; i++) {
16938
- if (newInputs[i] !== lastInputs[i]) {
16939
- return false;
16940
- }
16941
- }
16942
-
16943
- return true;
16944
- }
16945
-
16946
- function useMemoOne(getResult, inputs) {
16947
- var initial = Object(__WEBPACK_IMPORTED_MODULE_0_react__["useState"])(function () {
16948
- return {
16949
- inputs: inputs,
16950
- result: getResult()
16951
- };
16952
- })[0];
16953
- var committed = Object(__WEBPACK_IMPORTED_MODULE_0_react__["useRef"])(initial);
16954
- var isInputMatch = Boolean(inputs && committed.current.inputs && areInputsEqual(inputs, committed.current.inputs));
16955
- var cache = isInputMatch ? committed.current : {
16956
- inputs: inputs,
16957
- result: getResult()
16958
- };
16959
- Object(__WEBPACK_IMPORTED_MODULE_0_react__["useEffect"])(function () {
16960
- committed.current = cache;
16961
- }, [cache]);
16962
- return cache.result;
16963
- }
16964
- function useCallbackOne(callback, inputs) {
16965
- return useMemoOne(function () {
16966
- return callback;
16967
- }, inputs);
16968
- }
16969
- var useMemo = useMemoOne;
16970
- var useCallback = useCallbackOne;
16971
-
16972
-
16973
-
16974
-
16975
- /***/ }),
16976
- /* 104 */
16977
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
16978
-
16979
- "use strict";
16980
- /* unused harmony export logged */
16981
- /* harmony export (immutable) */ __webpack_exports__["a"] = deprecated;
16982
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_hooks__ = __webpack_require__(65);
16983
- /**
16984
- * WordPress dependencies
16985
- */
16986
-
16987
- /**
16988
- * Object map tracking messages which have been logged, for use in ensuring a
16989
- * message is only logged once.
16990
- *
16991
- * @type {Object}
16992
- */
16993
-
16994
- var logged = Object.create(null);
16995
- /**
16996
- * Logs a message to notify developers about a deprecated feature.
16997
- *
16998
- * @param {string} feature Name of the deprecated feature.
16999
- * @param {?Object} options Personalisation options
17000
- * @param {?string} options.version Version in which the feature will be removed.
17001
- * @param {?string} options.alternative Feature to use instead
17002
- * @param {?string} options.plugin Plugin name if it's a plugin feature
17003
- * @param {?string} options.link Link to documentation
17004
- * @param {?string} options.hint Additional message to help transition away from the deprecated feature.
17005
- *
17006
- * @example
17007
- * ```js
17008
- * import deprecated from '@wordpress/deprecated';
17009
- *
17010
- * deprecated( 'Eating meat', {
17011
- * version: 'the future',
17012
- * alternative: 'vegetables',
17013
- * plugin: 'the earth',
17014
- * hint: 'You may find it beneficial to transition gradually.',
17015
- * } );
17016
- *
17017
- * // Logs: 'Eating meat is deprecated and will be removed from the earth in the future. Please use vegetables instead. Note: You may find it beneficial to transition gradually.'
17018
- * ```
17019
- */
17020
-
17021
- function deprecated(feature) {
17022
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
17023
- var version = options.version,
17024
- alternative = options.alternative,
17025
- plugin = options.plugin,
17026
- link = options.link,
17027
- hint = options.hint;
17028
- var pluginMessage = plugin ? " from ".concat(plugin) : '';
17029
- var versionMessage = version ? " and will be removed".concat(pluginMessage, " in version ").concat(version) : '';
17030
- var useInsteadMessage = alternative ? " Please use ".concat(alternative, " instead.") : '';
17031
- var linkMessage = link ? " See: ".concat(link) : '';
17032
- var hintMessage = hint ? " Note: ".concat(hint) : '';
17033
- var message = "".concat(feature, " is deprecated").concat(versionMessage, ".").concat(useInsteadMessage).concat(linkMessage).concat(hintMessage); // Skip if already logged.
17034
-
17035
- if (message in logged) {
17036
- return;
17037
- }
17038
- /**
17039
- * Fires whenever a deprecated feature is encountered
17040
- *
17041
- * @param {string} feature Name of the deprecated feature.
17042
- * @param {?Object} options Personalisation options
17043
- * @param {?string} options.version Version in which the feature will be removed.
17044
- * @param {?string} options.alternative Feature to use instead
17045
- * @param {?string} options.plugin Plugin name if it's a plugin feature
17046
- * @param {?string} options.link Link to documentation
17047
- * @param {?string} options.hint Additional message to help transition away from the deprecated feature.
17048
- * @param {?string} message Message sent to console.warn
17049
- */
17050
-
17051
-
17052
- Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_hooks__["c" /* doAction */])('deprecated', feature, options, message); // eslint-disable-next-line no-console
17053
-
17054
- console.warn(message);
17055
- logged[message] = true;
17056
- }
17057
- //# sourceMappingURL=index.js.map
17058
-
17059
- /***/ }),
17060
- /* 105 */
17061
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
17062
-
17063
- "use strict";
17064
- /**
17065
- * Validate a hookName string.
17066
- *
17067
- * @param {string} hookName The hook name to validate. Should be a non empty string containing
17068
- * only numbers, letters, dashes, periods and underscores. Also,
17069
- * the hook name cannot begin with `__`.
17070
- *
17071
- * @return {boolean} Whether the hook name is valid.
17072
- */
17073
- function validateHookName(hookName) {
17074
- if ('string' !== typeof hookName || '' === hookName) {
17075
- // eslint-disable-next-line no-console
17076
- console.error('The hook name must be a non-empty string.');
17077
- return false;
17078
- }
17079
-
17080
- if (/^__/.test(hookName)) {
17081
- // eslint-disable-next-line no-console
17082
- console.error('The hook name cannot begin with `__`.');
17083
- return false;
17084
- }
17085
-
17086
- if (!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(hookName)) {
17087
- // eslint-disable-next-line no-console
17088
- console.error('The hook name can only contain numbers, letters, dashes, periods and underscores.');
17089
- return false;
17090
- }
17091
-
17092
- return true;
17093
- }
17094
-
17095
- /* harmony default export */ __webpack_exports__["a"] = (validateHookName);
17096
- //# sourceMappingURL=validateHookName.js.map
17097
-
17098
- /***/ }),
17099
- /* 106 */
17100
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
17101
-
17102
- "use strict";
17103
- /* unused harmony export concatChildren */
17104
- /* unused harmony export switchChildrenNodeName */
17105
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(13);
17106
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
17107
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react__ = __webpack_require__(9);
17108
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_react___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_react__);
17109
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash__ = __webpack_require__(2);
17110
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_lodash__);
17111
- /* unused harmony reexport Children */
17112
- /* unused harmony reexport cloneElement */
17113
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "Component")) __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["Component"]; });
17114
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "createContext")) __webpack_require__.d(__webpack_exports__, "d", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["createContext"]; });
17115
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "createElement")) __webpack_require__.d(__webpack_exports__, "e", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["createElement"]; });
17116
- /* unused harmony reexport createRef */
17117
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "forwardRef")) __webpack_require__.d(__webpack_exports__, "f", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["forwardRef"]; });
17118
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "Fragment")) __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["Fragment"]; });
17119
- /* unused harmony reexport isValidElement */
17120
- /* unused harmony reexport memo */
17121
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "StrictMode")) __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["StrictMode"]; });
17122
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useCallback")) __webpack_require__.d(__webpack_exports__, "g", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useCallback"]; });
17123
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useContext")) __webpack_require__.d(__webpack_exports__, "h", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useContext"]; });
17124
- /* unused harmony reexport useDebugValue */
17125
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useEffect")) __webpack_require__.d(__webpack_exports__, "i", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useEffect"]; });
17126
- /* unused harmony reexport useImperativeHandle */
17127
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useLayoutEffect")) __webpack_require__.d(__webpack_exports__, "j", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useLayoutEffect"]; });
17128
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useMemo")) __webpack_require__.d(__webpack_exports__, "k", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useMemo"]; });
17129
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useReducer")) __webpack_require__.d(__webpack_exports__, "l", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useReducer"]; });
17130
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useRef")) __webpack_require__.d(__webpack_exports__, "m", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useRef"]; });
17131
- /* harmony reexport (binding) */ if(__webpack_require__.o(__WEBPACK_IMPORTED_MODULE_2_react__, "useState")) __webpack_require__.d(__webpack_exports__, "n", function() { return __WEBPACK_IMPORTED_MODULE_2_react__["useState"]; });
17132
- /* unused harmony reexport lazy */
17133
- /* unused harmony reexport Suspense */
17134
-
17135
-
17136
-
17137
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
17138
-
17139
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
17140
-
17141
- /**
17142
- * External dependencies
17143
- */
17144
-
17145
-
17146
- /**
17147
- * Object containing a React element.
17148
- *
17149
- * @typedef {import('react').ReactElement} WPElement
17150
- */
17151
-
17152
- /**
17153
- * Object containing a React component.
17154
- *
17155
- * @typedef {import('react').ComponentType} WPComponent
17156
- */
17157
-
17158
- /**
17159
- * Object containing a React synthetic event.
17160
- *
17161
- * @typedef {import('react').SyntheticEvent} WPSyntheticEvent
17162
- */
17163
-
17164
- /**
17165
- * Object that provides utilities for dealing with React children.
17166
- */
17167
-
17168
-
17169
- /**
17170
- * Creates a copy of an element with extended props.
17171
- *
17172
- * @param {WPElement} element Element
17173
- * @param {?Object} props Props to apply to cloned element
17174
- *
17175
- * @return {WPElement} Cloned element.
17176
- */
17177
-
17178
-
17179
- /**
17180
- * A base class to create WordPress Components (Refs, state and lifecycle hooks)
17181
- */
17182
-
17183
-
17184
- /**
17185
- * Creates a context object containing two components: a provider and consumer.
17186
- *
17187
- * @param {Object} defaultValue A default data stored in the context.
17188
- *
17189
- * @return {Object} Context object.
17190
- */
17191
-
17192
-
17193
- /**
17194
- * Returns a new element of given type. Type can be either a string tag name or
17195
- * another function which itself returns an element.
17196
- *
17197
- * @param {?(string|Function)} type Tag name or element creator
17198
- * @param {Object} props Element properties, either attribute
17199
- * set to apply to DOM node or values to
17200
- * pass through to element creator
17201
- * @param {...WPElement} children Descendant elements
17202
- *
17203
- * @return {WPElement} Element.
17204
- */
17205
-
17206
-
17207
- /**
17208
- * Returns an object tracking a reference to a rendered element via its
17209
- * `current` property as either a DOMElement or Element, dependent upon the
17210
- * type of element rendered with the ref attribute.
17211
- *
17212
- * @return {Object} Ref object.
17213
- */
17214
-
17215
-
17216
- /**
17217
- * Component enhancer used to enable passing a ref to its wrapped component.
17218
- * Pass a function argument which receives `props` and `ref` as its arguments,
17219
- * returning an element using the forwarded ref. The return value is a new
17220
- * component which forwards its ref.
17221
- *
17222
- * @param {Function} forwarder Function passed `props` and `ref`, expected to
17223
- * return an element.
17224
- *
17225
- * @return {WPComponent} Enhanced component.
17226
- */
17227
-
17228
-
17229
- /**
17230
- * A component which renders its children without any wrapping element.
17231
- */
17232
-
17233
-
17234
- /**
17235
- * Checks if an object is a valid WPElement.
17236
- *
17237
- * @param {Object} objectToCheck The object to be checked.
17238
- *
17239
- * @return {boolean} true if objectToTest is a valid WPElement and false otherwise.
17240
- */
17241
-
17242
-
17243
- /**
17244
- * @see https://reactjs.org/docs/react-api.html#reactmemo
17245
- */
17246
-
17247
-
17248
- /**
17249
- * Component that activates additional checks and warnings for its descendants.
17250
- */
17251
-
17252
-
17253
- /**
17254
- * @see https://reactjs.org/docs/hooks-reference.html#usecallback
17255
- */
17256
-
17257
-
17258
- /**
17259
- * @see https://reactjs.org/docs/hooks-reference.html#usecontext
17260
- */
17261
-
17262
-
17263
- /**
17264
- * @see https://reactjs.org/docs/hooks-reference.html#usedebugvalue
17265
- */
17266
-
17267
-
17268
- /**
17269
- * @see https://reactjs.org/docs/hooks-reference.html#useeffect
17270
- */
17271
-
17272
-
17273
- /**
17274
- * @see https://reactjs.org/docs/hooks-reference.html#useimperativehandle
17275
- */
17276
-
17277
-
17278
- /**
17279
- * @see https://reactjs.org/docs/hooks-reference.html#uselayouteffect
17280
- */
17281
-
17282
-
17283
- /**
17284
- * @see https://reactjs.org/docs/hooks-reference.html#usememo
17285
- */
17286
-
17287
-
17288
- /**
17289
- * @see https://reactjs.org/docs/hooks-reference.html#usereducer
17290
- */
17291
-
17292
-
17293
- /**
17294
- * @see https://reactjs.org/docs/hooks-reference.html#useref
17295
- */
17296
-
17297
-
17298
- /**
17299
- * @see https://reactjs.org/docs/hooks-reference.html#usestate
17300
- */
17301
-
17302
-
17303
- /**
17304
- * @see https://reactjs.org/docs/react-api.html#reactlazy
17305
- */
17306
-
17307
-
17308
- /**
17309
- * @see https://reactjs.org/docs/react-api.html#reactsuspense
17310
- */
17311
-
17312
-
17313
- /**
17314
- * Concatenate two or more React children objects.
17315
- *
17316
- * @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate.
17317
- *
17318
- * @return {Array} The concatenated value.
17319
- */
17320
-
17321
- function concatChildren() {
17322
- for (var _len = arguments.length, childrenArguments = new Array(_len), _key = 0; _key < _len; _key++) {
17323
- childrenArguments[_key] = arguments[_key];
17324
- }
17325
-
17326
- return childrenArguments.reduce(function (accumulator, children, i) {
17327
- __WEBPACK_IMPORTED_MODULE_2_react__["Children"].forEach(children, function (child, j) {
17328
- if (child && 'string' !== typeof child) {
17329
- child = Object(__WEBPACK_IMPORTED_MODULE_2_react__["cloneElement"])(child, {
17330
- key: [i, j].join()
17331
- });
17332
- }
17333
-
17334
- accumulator.push(child);
17335
- });
17336
- return accumulator;
17337
- }, []);
17338
- }
17339
- /**
17340
- * Switches the nodeName of all the elements in the children object.
17341
- *
17342
- * @param {?Object} children Children object.
17343
- * @param {string} nodeName Node name.
17344
- *
17345
- * @return {?Object} The updated children object.
17346
- */
17347
-
17348
- function switchChildrenNodeName(children, nodeName) {
17349
- return children && __WEBPACK_IMPORTED_MODULE_2_react__["Children"].map(children, function (elt, index) {
17350
- if (Object(__WEBPACK_IMPORTED_MODULE_3_lodash__["isString"])(elt)) {
17351
- return Object(__WEBPACK_IMPORTED_MODULE_2_react__["createElement"])(nodeName, {
17352
- key: index
17353
- }, elt);
17354
- }
17355
-
17356
- var _elt$props = elt.props,
17357
- childrenProp = _elt$props.children,
17358
- props = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(_elt$props, ["children"]);
17359
-
17360
- return Object(__WEBPACK_IMPORTED_MODULE_2_react__["createElement"])(nodeName, _objectSpread({
17361
- key: index
17362
- }, props), childrenProp);
17363
- });
17364
- }
17365
- //# sourceMappingURL=react.js.map
17366
-
17367
- /***/ }),
17368
- /* 107 */
17369
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
17370
-
17371
- "use strict";
17372
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils_create_higher_order_component__ = __webpack_require__(47);
17373
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__utils_create_higher_order_component__["a"]; });
17374
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__higher_order_compose__ = __webpack_require__(557);
17375
- /* unused harmony reexport compose */
17376
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__higher_order_if_condition__ = __webpack_require__(558);
17377
- /* unused harmony reexport ifCondition */
17378
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__higher_order_pure__ = __webpack_require__(559);
17379
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_3__higher_order_pure__["a"]; });
17380
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__higher_order_with_global_events__ = __webpack_require__(562);
17381
- /* unused harmony reexport withGlobalEvents */
17382
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__higher_order_with_instance_id__ = __webpack_require__(564);
17383
- /* unused harmony reexport withInstanceId */
17384
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__higher_order_with_safe_timeout__ = __webpack_require__(565);
17385
- /* unused harmony reexport withSafeTimeout */
17386
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__higher_order_with_state__ = __webpack_require__(566);
17387
- /* unused harmony reexport withState */
17388
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__hooks_use_copy_on_click__ = __webpack_require__(567);
17389
- /* unused harmony reexport useCopyOnClick */
17390
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__hooks_use_dragging__ = __webpack_require__(568);
17391
- /* unused harmony reexport __experimentalUseDragging */
17392
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__hooks_use_instance_id__ = __webpack_require__(168);
17393
- /* unused harmony reexport useInstanceId */
17394
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__hooks_use_keyboard_shortcut__ = __webpack_require__(569);
17395
- /* unused harmony reexport useKeyboardShortcut */
17396
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__hooks_use_media_query__ = __webpack_require__(108);
17397
- /* unused harmony reexport useMediaQuery */
17398
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__hooks_use_previous__ = __webpack_require__(169);
17399
- /* unused harmony reexport usePrevious */
17400
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__hooks_use_reduced_motion__ = __webpack_require__(570);
17401
- /* unused harmony reexport useReducedMotion */
17402
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__hooks_use_viewport_match__ = __webpack_require__(571);
17403
- /* unused harmony reexport useViewportMatch */
17404
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__hooks_use_resize_observer__ = __webpack_require__(572);
17405
- /* unused harmony reexport useResizeObserver */
17406
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__hooks_use_async_list__ = __webpack_require__(573);
17407
- /* unused harmony reexport useAsyncList */
17408
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__hooks_use_warn_on_change__ = __webpack_require__(574);
17409
- /* unused harmony reexport useWarnOnChange */
17410
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__hooks_use_debounce__ = __webpack_require__(575);
17411
- /* unused harmony reexport useDebounce */
17412
- // Utils
17413
- // Compose helper (aliased flowRight from Lodash)
17414
-
17415
- // Higher-order components
17416
-
17417
-
17418
-
17419
-
17420
-
17421
-
17422
- // Hooks
17423
-
17424
-
17425
-
17426
-
17427
-
17428
-
17429
-
17430
-
17431
-
17432
-
17433
-
17434
-
17435
-
17436
- //# sourceMappingURL=index.js.map
17437
-
17438
- /***/ }),
17439
- /* 108 */
17440
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
17441
-
17442
- "use strict";
17443
- /* harmony export (immutable) */ __webpack_exports__["a"] = useMediaQuery;
17444
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_slicedToArray__ = __webpack_require__(27);
17445
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__wordpress_element__ = __webpack_require__(15);
17446
-
17447
-
17448
- /**
17449
- * WordPress dependencies
17450
- */
17451
-
17452
- /**
17453
- * Runs a media query and returns its value when it changes.
17454
- *
17455
- * @param {string} [query] Media Query.
17456
- * @return {boolean} return value of the media query.
17457
- */
17458
-
17459
- function useMediaQuery(query) {
17460
- var _useState = Object(__WEBPACK_IMPORTED_MODULE_1__wordpress_element__["m" /* useState */])(query && window.matchMedia(query).matches),
17461
- _useState2 = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_slicedToArray__["a" /* default */])(_useState, 2),
17462
- match = _useState2[0],
17463
- setMatch = _useState2[1];
17464
-
17465
- Object(__WEBPACK_IMPORTED_MODULE_1__wordpress_element__["h" /* useEffect */])(function () {
17466
- if (!query) {
17467
- return;
17468
- }
17469
-
17470
- var updateMatch = function updateMatch() {
17471
- return setMatch(window.matchMedia(query).matches);
17472
- };
17473
-
17474
- updateMatch();
17475
- var list = window.matchMedia(query);
17476
- list.addListener(updateMatch);
17477
- return function () {
17478
- list.removeListener(updateMatch);
17479
- };
17480
- }, [query]);
17481
- return query && match;
17482
- }
17483
- //# sourceMappingURL=index.js.map
17484
-
17485
- /***/ }),
17486
- /* 109 */
17487
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
17488
-
17489
- "use strict";
17490
- /* harmony export (immutable) */ __webpack_exports__["a"] = isFormatEqual;
17491
- /** @typedef {import('./create').RichTextFormat} RichTextFormat */
17492
-
17493
- /**
17494
- * Optimised equality check for format objects.
17495
- *
17496
- * @param {?RichTextFormat} format1 Format to compare.
17497
- * @param {?RichTextFormat} format2 Format to compare.
17498
- *
17499
- * @return {boolean} True if formats are equal, false if not.
17500
- */
17501
- function isFormatEqual(format1, format2) {
17502
- // Both not defined.
17503
- if (format1 === format2) {
17504
- return true;
17505
- } // Either not defined.
17506
-
17507
-
17508
- if (!format1 || !format2) {
17509
- return false;
17510
- }
17511
-
17512
- if (format1.type !== format2.type) {
17513
- return false;
17514
- }
17515
-
17516
- var attributes1 = format1.attributes;
17517
- var attributes2 = format2.attributes; // Both not defined.
17518
-
17519
- if (attributes1 === attributes2) {
17520
- return true;
17521
- } // Either not defined.
17522
-
17523
-
17524
- if (!attributes1 || !attributes2) {
17525
- return false;
17526
- }
17527
-
17528
- var keys1 = Object.keys(attributes1);
17529
- var keys2 = Object.keys(attributes2);
17530
-
17531
- if (keys1.length !== keys2.length) {
17532
- return false;
17533
- }
17534
-
17535
- var length = keys1.length; // Optimise for speed.
17536
-
17537
- for (var i = 0; i < length; i++) {
17538
- var name = keys1[i];
17539
-
17540
- if (attributes1[name] !== attributes2[name]) {
17541
- return false;
17542
- }
17543
- }
17544
-
17545
- return true;
17546
- }
17547
- //# sourceMappingURL=is-format-equal.js.map
17548
-
17549
- /***/ }),
17550
- /* 110 */
17551
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
17552
-
17553
- "use strict";
17554
- /* harmony export (immutable) */ __webpack_exports__["a"] = createElement;
17555
- /**
17556
- * Parse the given HTML into a body element.
17557
- *
17558
- * Note: The current implementation will return a shared reference, reset on
17559
- * each call to `createElement`. Therefore, you should not hold a reference to
17560
- * the value to operate upon asynchronously, as it may have unexpected results.
17561
- *
17562
- * @param {HTMLDocument} document The HTML document to use to parse.
17563
- * @param {string} html The HTML to parse.
17564
- *
17565
- * @return {HTMLBodyElement} Body element with parsed HTML.
17566
- */
17567
- function createElement(_ref, html) {
17568
- var implementation = _ref.implementation;
17569
-
17570
- // Because `createHTMLDocument` is an expensive operation, and with this
17571
- // function being internal to `rich-text` (full control in avoiding a risk
17572
- // of asynchronous operations on the shared reference), a single document
17573
- // is reused and reset for each call to the function.
17574
- if (!createElement.body) {
17575
- createElement.body = implementation.createHTMLDocument('').body;
17576
- }
17577
-
17578
- createElement.body.innerHTML = html;
17579
- return createElement.body;
17580
- }
17581
- //# sourceMappingURL=create-element.js.map
17582
-
17583
- /***/ }),
17584
- /* 111 */
17585
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
17586
-
17587
- "use strict";
17588
- /* harmony export (immutable) */ __webpack_exports__["a"] = getActiveFormat;
17589
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash__ = __webpack_require__(2);
17590
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_lodash__);
17591
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__get_active_formats__ = __webpack_require__(112);
17592
- /**
17593
- * External dependencies
17594
- */
17595
-
17596
- /**
17597
- * Internal dependencies
17598
- */
17599
-
17600
-
17601
- /** @typedef {import('./create').RichTextValue} RichTextValue */
17602
-
17603
- /** @typedef {import('./create').RichTextFormat} RichTextFormat */
17604
-
17605
- /**
17606
- * Gets the format object by type at the start of the selection. This can be
17607
- * used to get e.g. the URL of a link format at the current selection, but also
17608
- * to check if a format is active at the selection. Returns undefined if there
17609
- * is no format at the selection.
17610
- *
17611
- * @param {RichTextValue} value Value to inspect.
17612
- * @param {string} formatType Format type to look for.
17613
- *
17614
- * @return {RichTextFormat|undefined} Active format object of the specified
17615
- * type, or undefined.
17616
- */
17617
-
17618
- function getActiveFormat(value, formatType) {
17619
- return Object(__WEBPACK_IMPORTED_MODULE_0_lodash__["find"])(Object(__WEBPACK_IMPORTED_MODULE_1__get_active_formats__["a" /* getActiveFormats */])(value), {
17620
- type: formatType
17621
- });
17622
- }
17623
- //# sourceMappingURL=get-active-format.js.map
17624
-
17625
- /***/ }),
17626
- /* 112 */
17627
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
17628
-
17629
- "use strict";
17630
- /* harmony export (immutable) */ __webpack_exports__["a"] = getActiveFormats;
17631
- /** @typedef {import('./create').RichTextValue} RichTextValue */
17632
-
17633
- /** @typedef {import('./create').RichTextFormatList} RichTextFormatList */
17634
-
17635
- /**
17636
- * Gets the all format objects at the start of the selection.
17637
- *
17638
- * @param {RichTextValue} value Value to inspect.
17639
- * @param {Array} EMPTY_ACTIVE_FORMATS Array to return if there are no
17640
- * active formats.
17641
- *
17642
- * @return {RichTextFormatList} Active format objects.
17643
- */
17644
- function getActiveFormats(_ref) {
17645
- var formats = _ref.formats,
17646
- start = _ref.start,
17647
- end = _ref.end,
17648
- activeFormats = _ref.activeFormats;
17649
- var EMPTY_ACTIVE_FORMATS = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
17650
-
17651
- if (start === undefined) {
17652
- return EMPTY_ACTIVE_FORMATS;
17653
- }
17654
-
17655
- if (start === end) {
17656
- // For a collapsed caret, it is possible to override the active formats.
17657
- if (activeFormats) {
17658
- return activeFormats;
17659
- }
17660
-
17661
- var formatsBefore = formats[start - 1] || EMPTY_ACTIVE_FORMATS;
17662
- var formatsAfter = formats[start] || EMPTY_ACTIVE_FORMATS; // By default, select the lowest amount of formats possible (which means
17663
- // the caret is positioned outside the format boundary). The user can
17664
- // then use arrow keys to define `activeFormats`.
17665
-
17666
- if (formatsBefore.length < formatsAfter.length) {
17667
- return formatsBefore;
17668
- }
17669
-
17670
- return formatsAfter;
17671
- }
17672
-
17673
- return formats[start] || EMPTY_ACTIVE_FORMATS;
17674
- }
17675
- //# sourceMappingURL=get-active-formats.js.map
17676
-
17677
- /***/ }),
17678
- /* 113 */
17679
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
17680
-
17681
- "use strict";
17682
- /* harmony export (immutable) */ __webpack_exports__["a"] = isCollapsed;
17683
- /** @typedef {import('./create').RichTextValue} RichTextValue */
17684
-
17685
- /**
17686
- * Check if the selection of a Rich Text value is collapsed or not. Collapsed
17687
- * means that no characters are selected, but there is a caret present. If there
17688
- * is no selection, `undefined` will be returned. This is similar to
17689
- * `window.getSelection().isCollapsed()`.
17690
- *
17691
- * @param {RichTextValue} value The rich text value to check.
17692
- *
17693
- * @return {boolean|undefined} True if the selection is collapsed, false if not,
17694
- * undefined if there is no selection.
17695
- */
17696
- function isCollapsed(_ref) {
17697
- var start = _ref.start,
17698
- end = _ref.end;
17699
-
17700
- if (start === undefined || end === undefined) {
17701
- return;
17702
- }
17703
-
17704
- return start === end;
17705
- }
17706
- //# sourceMappingURL=is-collapsed.js.map
17707
-
17708
- /***/ }),
17709
- /* 114 */
17710
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
17711
-
17712
- "use strict";
17713
- /* harmony export (immutable) */ __webpack_exports__["a"] = removeFormat;
17714
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(13);
17715
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(2);
17716
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);
17717
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__normalise_formats__ = __webpack_require__(52);
17718
-
17719
-
17720
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
17721
-
17722
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
17723
-
17724
- /**
17725
- * External dependencies
17726
- */
17727
-
17728
- /**
17729
- * Internal dependencies
17730
- */
17731
-
17732
-
17733
- /** @typedef {import('./create').RichTextValue} RichTextValue */
17734
-
17735
- /**
17736
- * Remove any format object from a Rich Text value by type from the given
17737
- * `startIndex` to the given `endIndex`. Indices are retrieved from the
17738
- * selection if none are provided.
17739
- *
17740
- * @param {RichTextValue} value Value to modify.
17741
- * @param {string} formatType Format type to remove.
17742
- * @param {number} [startIndex] Start index.
17743
- * @param {number} [endIndex] End index.
17744
- *
17745
- * @return {RichTextValue} A new value with the format applied.
17746
- */
17747
-
17748
- function removeFormat(value, formatType) {
17749
- var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
17750
- var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
17751
- var formats = value.formats,
17752
- activeFormats = value.activeFormats;
17753
- var newFormats = formats.slice(); // If the selection is collapsed, expand start and end to the edges of the
17754
- // format.
17755
-
17756
- if (startIndex === endIndex) {
17757
- var format = Object(__WEBPACK_IMPORTED_MODULE_1_lodash__["find"])(newFormats[startIndex], {
17758
- type: formatType
17759
- });
17760
-
17761
- if (format) {
17762
- while (Object(__WEBPACK_IMPORTED_MODULE_1_lodash__["find"])(newFormats[startIndex], format)) {
17763
- filterFormats(newFormats, startIndex, formatType);
17764
- startIndex--;
17765
- }
17766
-
17767
- endIndex++;
17768
-
17769
- while (Object(__WEBPACK_IMPORTED_MODULE_1_lodash__["find"])(newFormats[endIndex], format)) {
17770
- filterFormats(newFormats, endIndex, formatType);
17771
- endIndex++;
17772
- }
17773
- }
17774
- } else {
17775
- for (var i = startIndex; i < endIndex; i++) {
17776
- if (newFormats[i]) {
17777
- filterFormats(newFormats, i, formatType);
17778
- }
17779
- }
17780
- }
17781
-
17782
- return Object(__WEBPACK_IMPORTED_MODULE_2__normalise_formats__["a" /* normaliseFormats */])(_objectSpread(_objectSpread({}, value), {}, {
17783
- formats: newFormats,
17784
- activeFormats: Object(__WEBPACK_IMPORTED_MODULE_1_lodash__["reject"])(activeFormats, {
17785
- type: formatType
17786
- })
17787
- }));
17788
- }
17789
-
17790
- function filterFormats(formats, index, formatType) {
17791
- var newFormats = formats[index].filter(function (_ref) {
17792
- var type = _ref.type;
17793
- return type !== formatType;
17794
- });
17795
-
17796
- if (newFormats.length) {
17797
- formats[index] = newFormats;
17798
- } else {
17799
- delete formats[index];
17800
- }
17801
- }
17802
- //# sourceMappingURL=remove-format.js.map
17803
-
17804
- /***/ }),
17805
- /* 115 */
17806
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
17807
-
17808
- "use strict";
17809
- /* harmony export (immutable) */ __webpack_exports__["a"] = remove;
17810
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__insert__ = __webpack_require__(66);
17811
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__create__ = __webpack_require__(53);
17812
- /**
17813
- * Internal dependencies
17814
- */
17815
-
17816
-
17817
- /** @typedef {import('./create').RichTextValue} RichTextValue */
17818
-
17819
- /**
17820
- * Remove content from a Rich Text value between the given `startIndex` and
17821
- * `endIndex`. Indices are retrieved from the selection if none are provided.
17822
- *
17823
- * @param {RichTextValue} value Value to modify.
17824
- * @param {number} [startIndex] Start index.
17825
- * @param {number} [endIndex] End index.
17826
- *
17827
- * @return {RichTextValue} A new value with the content removed.
17828
- */
17829
-
17830
- function remove(value, startIndex, endIndex) {
17831
- return Object(__WEBPACK_IMPORTED_MODULE_0__insert__["a" /* insert */])(value, Object(__WEBPACK_IMPORTED_MODULE_1__create__["a" /* create */])(), startIndex, endIndex);
17832
- }
17833
- //# sourceMappingURL=remove.js.map
17834
-
17835
- /***/ }),
17836
- /* 116 */
17837
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
17838
-
17839
- "use strict";
17840
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
17841
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
17842
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
17843
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
17844
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
17845
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__wordpress_element__ = __webpack_require__(1);
17846
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__wordpress_compose__ = __webpack_require__(18);
17847
-
17848
-
17849
-
17850
-
17851
-
17852
-
17853
-
17854
- /**
17855
- * WordPress dependencies
17856
- */
17857
-
17858
-
17859
- /**
17860
- * Higher Order Component used to be used to wrap disposable elements like
17861
- * sidebars, modals, dropdowns. When mounting the wrapped component, we track a
17862
- * reference to the current active element so we know where to restore focus
17863
- * when the component is unmounted.
17864
- *
17865
- * @param {WPElement} WrappedComponent The disposable component.
17866
- *
17867
- * @return {Component} Component with the focus restauration behaviour.
17868
- */
17869
-
17870
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_compose__["b" /* createHigherOrderComponent */])(function (WrappedComponent) {
17871
- return (
17872
- /*#__PURE__*/
17873
- function (_Component) {
17874
- Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__["a" /* default */])(_class, _Component);
17875
-
17876
- function _class() {
17877
- var _this;
17878
-
17879
- Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, _class);
17880
-
17881
- _this = Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(_class).apply(this, arguments));
17882
-
17883
- _this.setIsFocusedTrue = function () {
17884
- return _this.isFocused = true;
17885
- };
17886
-
17887
- _this.setIsFocusedFalse = function () {
17888
- return _this.isFocused = false;
17889
- };
17890
-
17891
- _this.activeElementOnMount = document.activeElement;
17892
- return _this;
17893
- }
17894
-
17895
- Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__["a" /* default */])(_class, [{
17896
- key: "componentWillUnmount",
17897
- value: function componentWillUnmount() {
17898
- var activeElementOnMount = this.activeElementOnMount,
17899
- isFocused = this.isFocused;
17900
-
17901
- if (!activeElementOnMount) {
17902
- return;
17903
- }
17904
-
17905
- var _document = document,
17906
- body = _document.body,
17907
- activeElement = _document.activeElement;
17908
-
17909
- if (isFocused || null === activeElement || body === activeElement) {
17910
- activeElementOnMount.focus();
17911
- }
17912
- }
17913
- }, {
17914
- key: "render",
17915
- value: function render() {
17916
- return Object(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["h" /* createElement */])("div", {
17917
- onFocus: this.setIsFocusedTrue,
17918
- onBlur: this.setIsFocusedFalse
17919
- }, Object(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["h" /* createElement */])(WrappedComponent, this.props));
17920
- }
17921
- }]);
17922
-
17923
- return _class;
17924
- }(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["b" /* Component */])
17925
- );
17926
- }, 'withFocusReturn'));
17927
- //# sourceMappingURL=index.js.map
17928
-
17929
- /***/ }),
17930
- /* 117 */
17931
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
17932
-
17933
- "use strict";
17934
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
17935
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
17936
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
17937
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
17938
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
17939
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(10);
17940
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__wordpress_element__ = __webpack_require__(1);
17941
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__wordpress_compose__ = __webpack_require__(18);
17942
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__wordpress_keycodes__ = __webpack_require__(32);
17943
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__wordpress_dom__ = __webpack_require__(54);
17944
-
17945
-
17946
-
17947
-
17948
-
17949
-
17950
-
17951
-
17952
- /**
17953
- * WordPress dependencies
17954
- */
17955
-
17956
-
17957
-
17958
-
17959
- var withConstrainedTabbing = Object(__WEBPACK_IMPORTED_MODULE_7__wordpress_compose__["b" /* createHigherOrderComponent */])(function (WrappedComponent) {
17960
- return (
17961
- /*#__PURE__*/
17962
- function (_Component) {
17963
- Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__["a" /* default */])(_class, _Component);
17964
-
17965
- function _class() {
17966
- var _this;
17967
-
17968
- Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, _class);
17969
-
17970
- _this = Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(_class).apply(this, arguments));
17971
- _this.focusContainRef = Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["j" /* createRef */])();
17972
- _this.handleTabBehaviour = _this.handleTabBehaviour.bind(Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
17973
- return _this;
17974
- }
17975
-
17976
- Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__["a" /* default */])(_class, [{
17977
- key: "handleTabBehaviour",
17978
- value: function handleTabBehaviour(event) {
17979
- if (event.keyCode !== __WEBPACK_IMPORTED_MODULE_8__wordpress_keycodes__["i" /* TAB */]) {
17980
- return;
17981
- }
17982
-
17983
- var tabbables = __WEBPACK_IMPORTED_MODULE_9__wordpress_dom__["a" /* focus */].tabbable.find(this.focusContainRef.current);
17984
-
17985
- if (!tabbables.length) {
17986
- return;
17987
- }
17988
-
17989
- var firstTabbable = tabbables[0];
17990
- var lastTabbable = tabbables[tabbables.length - 1];
17991
-
17992
- if (event.shiftKey && event.target === firstTabbable) {
17993
- event.preventDefault();
17994
- lastTabbable.focus();
17995
- } else if (!event.shiftKey && event.target === lastTabbable) {
17996
- event.preventDefault();
17997
- firstTabbable.focus();
17998
- /*
17999
- * When pressing Tab and none of the tabbables has focus, the keydown
18000
- * event happens on the wrapper div: move focus on the first tabbable.
18001
- */
18002
- } else if (!tabbables.includes(event.target)) {
18003
- event.preventDefault();
18004
- firstTabbable.focus();
18005
- }
18006
- }
18007
- }, {
18008
- key: "render",
18009
- value: function render() {
18010
- // Disable reason: this component is non-interactive, but must capture
18011
- // events from the wrapped component to determine when the Tab key is used.
18012
-
18013
- /* eslint-disable jsx-a11y/no-static-element-interactions */
18014
- return Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])("div", {
18015
- onKeyDown: this.handleTabBehaviour,
18016
- ref: this.focusContainRef,
18017
- tabIndex: "-1"
18018
- }, Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])(WrappedComponent, this.props));
18019
- /* eslint-enable jsx-a11y/no-static-element-interactions */
18020
- }
18021
- }]);
18022
-
18023
- return _class;
18024
- }(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["b" /* Component */])
18025
- );
18026
- }, 'withConstrainedTabbing');
18027
- /* harmony default export */ __webpack_exports__["a"] = (withConstrainedTabbing);
18028
- //# sourceMappingURL=index.js.map
18029
-
18030
- /***/ }),
18031
- /* 118 */
18032
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
18033
-
18034
- "use strict";
18035
- /* WEBPACK VAR INJECTION */(function(process) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
18036
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
18037
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
18038
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
18039
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
18040
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__wordpress_element__ = __webpack_require__(1);
18041
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash__ = __webpack_require__(2);
18042
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_6_lodash__);
18043
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__popover__ = __webpack_require__(84);
18044
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__shortcut__ = __webpack_require__(196);
18045
-
18046
-
18047
-
18048
-
18049
-
18050
-
18051
-
18052
- /**
18053
- * External dependencies
18054
- */
18055
-
18056
- /**
18057
- * WordPress dependencies
18058
- */
18059
-
18060
-
18061
- /**
18062
- * Internal dependencies
18063
- */
18064
-
18065
-
18066
-
18067
- /**
18068
- * Time over children to wait before showing tooltip
18069
- *
18070
- * @type {Number}
18071
- */
18072
-
18073
- var TOOLTIP_DELAY = 700;
18074
-
18075
- var Tooltip =
18076
- /*#__PURE__*/
18077
- function (_Component) {
18078
- Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__["a" /* default */])(Tooltip, _Component);
18079
-
18080
- function Tooltip() {
18081
- var _this;
18082
-
18083
- Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, Tooltip);
18084
-
18085
- _this = Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(Tooltip).apply(this, arguments));
18086
- _this.delayedSetIsOver = Object(__WEBPACK_IMPORTED_MODULE_6_lodash__["debounce"])(function (isOver) {
18087
- return _this.setState({
18088
- isOver: isOver
18089
- });
18090
- }, TOOLTIP_DELAY);
18091
- _this.state = {
18092
- isOver: false
18093
- };
18094
- return _this;
18095
- }
18096
-
18097
- Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__["a" /* default */])(Tooltip, [{
18098
- key: "componentWillUnmount",
18099
- value: function componentWillUnmount() {
18100
- this.delayedSetIsOver.cancel();
18101
- }
18102
- }, {
18103
- key: "emitToChild",
18104
- value: function emitToChild(eventName, event) {
18105
- var children = this.props.children;
18106
-
18107
- if (__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["a" /* Children */].count(children) !== 1) {
18108
- return;
18109
- }
18110
-
18111
- var child = __WEBPACK_IMPORTED_MODULE_5__wordpress_element__["a" /* Children */].only(children);
18112
-
18113
- if (typeof child.props[eventName] === 'function') {
18114
- child.props[eventName](event);
18115
- }
18116
- }
18117
- }, {
18118
- key: "createToggleIsOver",
18119
- value: function createToggleIsOver(eventName, isDelayed) {
18120
- var _this2 = this;
18121
-
18122
- return function (event) {
18123
- // Preserve original child callback behavior
18124
- _this2.emitToChild(eventName, event); // Mouse events behave unreliably in React for disabled elements,
18125
- // firing on mouseenter but not mouseleave. Further, the default
18126
- // behavior for disabled elements in some browsers is to ignore
18127
- // mouse events. Don't bother trying to to handle them.
18128
- //
18129
- // See: https://github.com/facebook/react/issues/4251
18130
-
18131
-
18132
- if (event.currentTarget.disabled) {
18133
- return;
18134
- } // Needed in case unsetting is over while delayed set pending, i.e.
18135
- // quickly blur/mouseleave before delayedSetIsOver is called
18136
-
18137
-
18138
- _this2.delayedSetIsOver.cancel();
18139
-
18140
- var isOver = Object(__WEBPACK_IMPORTED_MODULE_6_lodash__["includes"])(['focus', 'mouseenter'], event.type);
18141
-
18142
- if (isOver === _this2.state.isOver) {
18143
- return;
18144
- }
18145
-
18146
- if (isDelayed) {
18147
- _this2.delayedSetIsOver(isOver);
18148
- } else {
18149
- _this2.setState({
18150
- isOver: isOver
18151
- });
18152
- }
18153
- };
18154
- }
18155
- }, {
18156
- key: "render",
18157
- value: function render() {
18158
- var _this$props = this.props,
18159
- children = _this$props.children,
18160
- position = _this$props.position,
18161
- text = _this$props.text,
18162
- shortcut = _this$props.shortcut;
18163
-
18164
- if (__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["a" /* Children */].count(children) !== 1) {
18165
- if ('development' === process.env.NODE_ENV) {
18166
- // eslint-disable-next-line no-console
18167
- console.error('Tooltip should be called with only a single child element.');
18168
- }
18169
-
18170
- return children;
18171
- }
18172
-
18173
- var child = __WEBPACK_IMPORTED_MODULE_5__wordpress_element__["a" /* Children */].only(children);
18174
- var isOver = this.state.isOver;
18175
- return Object(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["e" /* cloneElement */])(child, {
18176
- onMouseEnter: this.createToggleIsOver('onMouseEnter', true),
18177
- onMouseLeave: this.createToggleIsOver('onMouseLeave'),
18178
- onClick: this.createToggleIsOver('onClick'),
18179
- onFocus: this.createToggleIsOver('onFocus'),
18180
- onBlur: this.createToggleIsOver('onBlur'),
18181
- children: Object(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["f" /* concatChildren */])(child.props.children, isOver && Object(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_7__popover__["a" /* default */], {
18182
- focusOnMount: false,
18183
- position: position,
18184
- className: "components-tooltip",
18185
- "aria-hidden": "true"
18186
- }, text, Object(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_8__shortcut__["a" /* default */], {
18187
- className: "components-tooltip__shortcut",
18188
- shortcut: shortcut
18189
- })))
18190
- });
18191
- }
18192
- }]);
18193
-
18194
- return Tooltip;
18195
- }(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["b" /* Component */]);
18196
-
18197
- /* harmony default export */ __webpack_exports__["a"] = (Tooltip);
18198
- //# sourceMappingURL=index.js.map
18199
- /* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(20)))
18200
-
18201
- /***/ }),
18202
- /* 119 */
18203
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
18204
-
18205
- "use strict";
18206
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__ = __webpack_require__(8);
18207
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
18208
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
18209
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
18210
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
18211
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
18212
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
18213
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(10);
18214
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__wordpress_element__ = __webpack_require__(1);
18215
-
18216
-
18217
-
18218
-
18219
-
18220
-
18221
-
18222
-
18223
-
18224
-
18225
- /**
18226
- * External dependencies
18227
- */
18228
-
18229
-
18230
- var IsolatedEventContainer =
18231
- /*#__PURE__*/
18232
- function (_Component) {
18233
- Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_inherits__["a" /* default */])(IsolatedEventContainer, _Component);
18234
-
18235
- function IsolatedEventContainer(props) {
18236
- var _this;
18237
-
18238
- Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, IsolatedEventContainer);
18239
-
18240
- _this = Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(IsolatedEventContainer).call(this, props));
18241
- _this.stopEventPropagationOutsideContainer = _this.stopEventPropagationOutsideContainer.bind(Object(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_7__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
18242
- return _this;
18243
- }
18244
-
18245
- Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_createClass__["a" /* default */])(IsolatedEventContainer, [{
18246
- key: "stopEventPropagationOutsideContainer",
18247
- value: function stopEventPropagationOutsideContainer(event) {
18248
- event.stopPropagation();
18249
- }
18250
- }, {
18251
- key: "render",
18252
- value: function render() {
18253
- var _this$props = this.props,
18254
- children = _this$props.children,
18255
- props = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(_this$props, ["children"]); // Disable reason: this stops certain events from propagating outside of the component.
18256
- // - onMouseDown is disabled as this can cause interactions with other DOM elements
18257
-
18258
- /* eslint-disable jsx-a11y/no-static-element-interactions */
18259
-
18260
-
18261
- return Object(__WEBPACK_IMPORTED_MODULE_8__wordpress_element__["h" /* createElement */])("div", Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])({}, props, {
18262
- onMouseDown: this.stopEventPropagationOutsideContainer
18263
- }), children);
18264
- }
18265
- }]);
18266
-
18267
- return IsolatedEventContainer;
18268
- }(__WEBPACK_IMPORTED_MODULE_8__wordpress_element__["b" /* Component */]);
18269
-
18270
- /* harmony default export */ __webpack_exports__["a"] = (IsolatedEventContainer);
18271
- //# sourceMappingURL=index.js.map
18272
-
18273
- /***/ }),
18274
- /* 120 */
18275
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
18276
-
18277
- "use strict";
18278
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Consumer; });
18279
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_toConsumableArray__ = __webpack_require__(21);
18280
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
18281
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
18282
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
18283
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
18284
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
18285
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(10);
18286
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__wordpress_element__ = __webpack_require__(1);
18287
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash__ = __webpack_require__(2);
18288
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_lodash__);
18289
-
18290
-
18291
-
18292
-
18293
-
18294
-
18295
-
18296
-
18297
-
18298
- /**
18299
- * External dependencies
18300
- */
18301
-
18302
- /**
18303
- * WordPress dependencies
18304
- */
18305
-
18306
-
18307
-
18308
- var _createContext = Object(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["g" /* createContext */])({
18309
- registerSlot: function registerSlot() {},
18310
- unregisterSlot: function unregisterSlot() {},
18311
- registerFill: function registerFill() {},
18312
- unregisterFill: function unregisterFill() {},
18313
- getSlot: function getSlot() {},
18314
- getFills: function getFills() {}
18315
- }),
18316
- Provider = _createContext.Provider,
18317
- Consumer = _createContext.Consumer;
18318
-
18319
- var SlotFillProvider =
18320
- /*#__PURE__*/
18321
- function (_Component) {
18322
- Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_inherits__["a" /* default */])(SlotFillProvider, _Component);
18323
-
18324
- function SlotFillProvider() {
18325
- var _this;
18326
-
18327
- Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, SlotFillProvider);
18328
-
18329
- _this = Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(SlotFillProvider).apply(this, arguments));
18330
- _this.registerSlot = _this.registerSlot.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
18331
- _this.registerFill = _this.registerFill.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
18332
- _this.unregisterSlot = _this.unregisterSlot.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
18333
- _this.unregisterFill = _this.unregisterFill.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
18334
- _this.getSlot = _this.getSlot.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
18335
- _this.getFills = _this.getFills.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
18336
- _this.slots = {};
18337
- _this.fills = {};
18338
- _this.state = {
18339
- registerSlot: _this.registerSlot,
18340
- unregisterSlot: _this.unregisterSlot,
18341
- registerFill: _this.registerFill,
18342
- unregisterFill: _this.unregisterFill,
18343
- getSlot: _this.getSlot,
18344
- getFills: _this.getFills
18345
- };
18346
- return _this;
18347
- }
18348
-
18349
- Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_createClass__["a" /* default */])(SlotFillProvider, [{
18350
- key: "registerSlot",
18351
- value: function registerSlot(name, slot) {
18352
- this.slots[name] = slot;
18353
- this.forceUpdateFills(name); // Sometimes the fills are registered after the initial render of slot
18354
- // But before the registerSlot call, we need to rerender the slot
18355
-
18356
- this.forceUpdateSlot(name);
18357
- }
18358
- }, {
18359
- key: "registerFill",
18360
- value: function registerFill(name, instance) {
18361
- this.fills[name] = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(this.fills[name] || []).concat([instance]);
18362
- this.forceUpdateSlot(name);
18363
- }
18364
- }, {
18365
- key: "unregisterSlot",
18366
- value: function unregisterSlot(name) {
18367
- delete this.slots[name];
18368
- this.forceUpdateFills(name);
18369
- }
18370
- }, {
18371
- key: "unregisterFill",
18372
- value: function unregisterFill(name, instance) {
18373
- this.fills[name] = Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["without"])(this.fills[name], instance);
18374
- this.resetFillOccurrence(name);
18375
- this.forceUpdateSlot(name);
18376
- }
18377
- }, {
18378
- key: "getSlot",
18379
- value: function getSlot(name) {
18380
- return this.slots[name];
18381
- }
18382
- }, {
18383
- key: "getFills",
18384
- value: function getFills(name) {
18385
- return Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["sortBy"])(this.fills[name], 'occurrence');
18386
- }
18387
- }, {
18388
- key: "resetFillOccurrence",
18389
- value: function resetFillOccurrence(name) {
18390
- Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["forEach"])(this.fills[name], function (instance) {
18391
- instance.resetOccurrence();
18392
- });
18393
- }
18394
- }, {
18395
- key: "forceUpdateFills",
18396
- value: function forceUpdateFills(name) {
18397
- Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["forEach"])(this.fills[name], function (instance) {
18398
- instance.forceUpdate();
18399
- });
18400
- }
18401
- }, {
18402
- key: "forceUpdateSlot",
18403
- value: function forceUpdateSlot(name) {
18404
- var slot = this.getSlot(name);
18405
-
18406
- if (slot) {
18407
- slot.forceUpdate();
18408
- }
18409
- }
18410
- }, {
18411
- key: "render",
18412
- value: function render() {
18413
- return Object(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["h" /* createElement */])(Provider, {
18414
- value: this.state
18415
- }, this.props.children);
18416
- }
18417
- }]);
18418
-
18419
- return SlotFillProvider;
18420
- }(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["b" /* Component */]);
18421
-
18422
- /* unused harmony default export */ var _unused_webpack_default_export = (SlotFillProvider);
18423
-
18424
- //# sourceMappingURL=context.js.map
18425
-
18426
- /***/ }),
18427
- /* 121 */
18428
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
18429
-
18430
- "use strict";
18431
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__ = __webpack_require__(8);
18432
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
18433
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
18434
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
18435
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
18436
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
18437
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(10);
18438
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__wordpress_element__ = __webpack_require__(1);
18439
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash__ = __webpack_require__(2);
18440
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_lodash__);
18441
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__wordpress_a11y__ = __webpack_require__(199);
18442
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__wordpress_compose__ = __webpack_require__(18);
18443
-
18444
-
18445
-
18446
-
18447
-
18448
-
18449
-
18450
-
18451
-
18452
- /**
18453
- * External dependencies
18454
- */
18455
-
18456
- /**
18457
- * WordPress dependencies
18458
- */
18459
-
18460
-
18461
-
18462
-
18463
- /**
18464
- * A Higher Order Component used to be provide a unique instance ID by
18465
- * component.
18466
- *
18467
- * @param {WPElement} WrappedComponent The wrapped component.
18468
- *
18469
- * @return {Component} Component with an instanceId prop.
18470
- */
18471
-
18472
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_10__wordpress_compose__["b" /* createHigherOrderComponent */])(function (WrappedComponent) {
18473
- return (
18474
- /*#__PURE__*/
18475
- function (_Component) {
18476
- Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_inherits__["a" /* default */])(_class, _Component);
18477
-
18478
- function _class() {
18479
- var _this;
18480
-
18481
- Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, _class);
18482
-
18483
- _this = Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(_class).apply(this, arguments));
18484
- _this.debouncedSpeak = Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["debounce"])(_this.speak.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this))), 500);
18485
- return _this;
18486
- }
18487
-
18488
- Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_createClass__["a" /* default */])(_class, [{
18489
- key: "speak",
18490
- value: function speak(message) {
18491
- var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'polite';
18492
-
18493
- Object(__WEBPACK_IMPORTED_MODULE_9__wordpress_a11y__["a" /* speak */])(message, type);
18494
- }
18495
- }, {
18496
- key: "componentWillUnmount",
18497
- value: function componentWillUnmount() {
18498
- this.debouncedSpeak.cancel();
18499
- }
18500
- }, {
18501
- key: "render",
18502
- value: function render() {
18503
- return Object(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["h" /* createElement */])(WrappedComponent, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])({}, this.props, {
18504
- speak: this.speak,
18505
- debouncedSpeak: this.debouncedSpeak
18506
- }));
18507
- }
18508
- }]);
18509
-
18510
- return _class;
18511
- }(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["b" /* Component */])
18512
- );
18513
- }, 'withSpokenMessages'));
18514
- //# sourceMappingURL=index.js.map
18515
-
18516
- /***/ }),
18517
- /* 122 */
18518
- /***/ (function(module, exports, __webpack_require__) {
18519
-
18520
- "use strict";
18521
-
18522
-
18523
- var bind = __webpack_require__(33);
18524
-
18525
- var GetIntrinsic = __webpack_require__(19);
18526
-
18527
- var $apply = GetIntrinsic('%Function.prototype.apply%');
18528
- var $call = GetIntrinsic('%Function.prototype.call%');
18529
- var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
18530
-
18531
- var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
18532
-
18533
- if ($defineProperty) {
18534
- try {
18535
- $defineProperty({}, 'a', { value: 1 });
18536
- } catch (e) {
18537
- // IE 8 has a broken defineProperty
18538
- $defineProperty = null;
18539
- }
18540
- }
18541
-
18542
- module.exports = function callBind() {
18543
- return $reflectApply(bind, $call, arguments);
18544
- };
18545
-
18546
- var applyBind = function applyBind() {
18547
- return $reflectApply(bind, $apply, arguments);
18548
- };
18549
-
18550
- if ($defineProperty) {
18551
- $defineProperty(module.exports, 'apply', { value: applyBind });
18552
- } else {
18553
- module.exports.apply = applyBind;
18554
- }
18555
-
18556
-
18557
- /***/ }),
18558
- /* 123 */
18559
- /***/ (function(module, exports, __webpack_require__) {
18560
-
18561
- "use strict";
18562
-
18563
-
18564
- var GetIntrinsic = __webpack_require__(19);
18565
-
18566
- var $TypeError = GetIntrinsic('%TypeError%');
18567
-
18568
- var inspect = __webpack_require__(641);
18569
-
18570
- var IsPropertyKey = __webpack_require__(56);
18571
- var Type = __webpack_require__(35);
18572
-
18573
- /**
18574
- * 7.3.1 Get (O, P) - https://ecma-international.org/ecma-262/6.0/#sec-get-o-p
18575
- * 1. Assert: Type(O) is Object.
18576
- * 2. Assert: IsPropertyKey(P) is true.
18577
- * 3. Return O.[[Get]](P, O).
18578
- */
18579
-
18580
- module.exports = function Get(O, P) {
18581
- // 7.3.1.1
18582
- if (Type(O) !== 'Object') {
18583
- throw new $TypeError('Assertion failed: Type(O) is not Object');
18584
- }
18585
- // 7.3.1.2
18586
- if (!IsPropertyKey(P)) {
18587
- throw new $TypeError('Assertion failed: IsPropertyKey(P) is not true, got ' + inspect(P));
18588
- }
18589
- // 7.3.1.3
18590
- return O[P];
18591
- };
18592
-
18593
-
18594
- /***/ }),
18595
- /* 124 */
18596
- /***/ (function(module, exports, __webpack_require__) {
18597
-
18598
- "use strict";
18599
-
18600
-
18601
- var GetIntrinsic = __webpack_require__(19);
18602
-
18603
- var $Array = GetIntrinsic('%Array%');
18604
-
18605
- // eslint-disable-next-line global-require
18606
- var toStr = !$Array.isArray && __webpack_require__(69)('Object.prototype.toString');
18607
-
18608
- // https://www.ecma-international.org/ecma-262/6.0/#sec-isarray
18609
-
18610
- module.exports = $Array.isArray || function IsArray(argument) {
18611
- return toStr(argument) === '[object Array]';
18612
- };
18613
-
18614
-
18615
- /***/ }),
18616
- /* 125 */
18617
- /***/ (function(module, exports, __webpack_require__) {
18618
-
18619
- "use strict";
18620
-
18621
-
18622
- var GetIntrinsic = __webpack_require__(19);
18623
-
18624
- var $TypeError = GetIntrinsic('%TypeError%');
18625
- var $SyntaxError = GetIntrinsic('%SyntaxError%');
18626
-
18627
- var has = __webpack_require__(38);
18628
-
18629
- var predicates = {
18630
- // https://ecma-international.org/ecma-262/6.0/#sec-property-descriptor-specification-type
18631
- 'Property Descriptor': function isPropertyDescriptor(Type, Desc) {
18632
- if (Type(Desc) !== 'Object') {
18633
- return false;
18634
- }
18635
- var allowed = {
18636
- '[[Configurable]]': true,
18637
- '[[Enumerable]]': true,
18638
- '[[Get]]': true,
18639
- '[[Set]]': true,
18640
- '[[Value]]': true,
18641
- '[[Writable]]': true
18642
- };
18643
-
18644
- for (var key in Desc) { // eslint-disable-line
18645
- if (has(Desc, key) && !allowed[key]) {
18646
- return false;
18647
- }
18648
- }
18649
-
18650
- var isData = has(Desc, '[[Value]]');
18651
- var IsAccessor = has(Desc, '[[Get]]') || has(Desc, '[[Set]]');
18652
- if (isData && IsAccessor) {
18653
- throw new $TypeError('Property Descriptors may not be both accessor and data descriptors');
18654
- }
18655
- return true;
18656
- }
18657
- };
18658
-
18659
- module.exports = function assertRecord(Type, recordType, argumentName, value) {
18660
- var predicate = predicates[recordType];
18661
- if (typeof predicate !== 'function') {
18662
- throw new $SyntaxError('unknown record type: ' + recordType);
18663
- }
18664
- if (!predicate(Type, value)) {
18665
- throw new $TypeError(argumentName + ' must be a ' + recordType);
18666
- }
18667
- };
18668
-
18669
-
18670
- /***/ }),
18671
- /* 126 */
18672
- /***/ (function(module, exports, __webpack_require__) {
18673
-
18674
- "use strict";
18675
-
18676
-
18677
- module.exports = Number.isNaN || function isNaN(a) {
18678
- return a !== a;
18679
- };
18680
-
18681
-
18682
- /***/ }),
18683
- /* 127 */
18684
- /***/ (function(module, exports, __webpack_require__) {
18685
-
18686
- "use strict";
18687
-
18688
-
18689
- Object.defineProperty(exports, "__esModule", {
18690
- value: true
18691
- });
18692
- exports.PureCalendarDay = undefined;
18693
-
18694
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
18695
-
18696
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
18697
-
18698
- var _object = __webpack_require__(25);
18699
-
18700
- var _object2 = _interopRequireDefault(_object);
18701
-
18702
- var _react = __webpack_require__(9);
18703
-
18704
- var _react2 = _interopRequireDefault(_react);
18705
-
18706
- var _propTypes = __webpack_require__(11);
18707
-
18708
- var _propTypes2 = _interopRequireDefault(_propTypes);
18709
-
18710
- var _reactAddonsShallowCompare = __webpack_require__(57);
18711
-
18712
- var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
18713
-
18714
- var _reactMomentProptypes = __webpack_require__(40);
18715
-
18716
- var _reactMomentProptypes2 = _interopRequireDefault(_reactMomentProptypes);
18717
-
18718
- var _airbnbPropTypes = __webpack_require__(22);
18719
-
18720
- var _reactWithStyles = __webpack_require__(34);
18721
-
18722
- var _moment = __webpack_require__(0);
18723
-
18724
- var _moment2 = _interopRequireDefault(_moment);
18725
-
18726
- var _defaultPhrases = __webpack_require__(29);
18727
-
18728
- var _getPhrasePropTypes = __webpack_require__(31);
18729
-
18730
- var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
18731
-
18732
- var _getCalendarDaySettings = __webpack_require__(390);
18733
-
18734
- var _getCalendarDaySettings2 = _interopRequireDefault(_getCalendarDaySettings);
18735
-
18736
- var _ModifiersShape = __webpack_require__(87);
18737
-
18738
- var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
18739
-
18740
- var _constants = __webpack_require__(17);
18741
-
18742
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
18743
-
18744
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
18745
-
18746
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
18747
-
18748
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
18749
-
18750
- var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
18751
- day: _reactMomentProptypes2['default'].momentObj,
18752
- daySize: _airbnbPropTypes.nonNegativeInteger,
18753
- isOutsideDay: _propTypes2['default'].bool,
18754
- modifiers: _ModifiersShape2['default'],
18755
- isFocused: _propTypes2['default'].bool,
18756
- tabIndex: _propTypes2['default'].oneOf([0, -1]),
18757
- onDayClick: _propTypes2['default'].func,
18758
- onDayMouseEnter: _propTypes2['default'].func,
18759
- onDayMouseLeave: _propTypes2['default'].func,
18760
- renderDayContents: _propTypes2['default'].func,
18761
- ariaLabelFormat: _propTypes2['default'].string,
18762
-
18763
- // internationalization
18764
- phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.CalendarDayPhrases))
18765
- }));
18766
-
18767
- var defaultProps = {
18768
- day: (0, _moment2['default'])(),
18769
- daySize: _constants.DAY_SIZE,
18770
- isOutsideDay: false,
18771
- modifiers: new Set(),
18772
- isFocused: false,
18773
- tabIndex: -1,
18774
- onDayClick: function () {
18775
- function onDayClick() {}
18776
-
18777
- return onDayClick;
18778
- }(),
18779
- onDayMouseEnter: function () {
18780
- function onDayMouseEnter() {}
18781
-
18782
- return onDayMouseEnter;
18783
- }(),
18784
- onDayMouseLeave: function () {
18785
- function onDayMouseLeave() {}
18786
-
18787
- return onDayMouseLeave;
18788
- }(),
18789
-
18790
- renderDayContents: null,
18791
- ariaLabelFormat: 'dddd, LL',
18792
-
18793
- // internationalization
18794
- phrases: _defaultPhrases.CalendarDayPhrases
18795
- };
18796
-
18797
- var CalendarDay = function (_React$Component) {
18798
- _inherits(CalendarDay, _React$Component);
18799
-
18800
- function CalendarDay() {
18801
- var _ref;
18802
-
18803
- _classCallCheck(this, CalendarDay);
18804
-
18805
- for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
18806
- args[_key] = arguments[_key];
18807
- }
18808
-
18809
- var _this = _possibleConstructorReturn(this, (_ref = CalendarDay.__proto__ || Object.getPrototypeOf(CalendarDay)).call.apply(_ref, [this].concat(args)));
18810
-
18811
- _this.setButtonRef = _this.setButtonRef.bind(_this);
18812
- return _this;
18813
- }
18814
-
18815
- _createClass(CalendarDay, [{
18816
- key: 'shouldComponentUpdate',
18817
- value: function () {
18818
- function shouldComponentUpdate(nextProps, nextState) {
18819
- return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
18820
- }
18821
-
18822
- return shouldComponentUpdate;
18823
- }()
18824
- }, {
18825
- key: 'componentDidUpdate',
18826
- value: function () {
18827
- function componentDidUpdate(prevProps) {
18828
- var _props = this.props,
18829
- isFocused = _props.isFocused,
18830
- tabIndex = _props.tabIndex;
18831
-
18832
- if (tabIndex === 0) {
18833
- if (isFocused || tabIndex !== prevProps.tabIndex) {
18834
- this.buttonRef.focus();
18835
- }
18836
- }
18837
- }
18838
-
18839
- return componentDidUpdate;
18840
- }()
18841
- }, {
18842
- key: 'onDayClick',
18843
- value: function () {
18844
- function onDayClick(day, e) {
18845
- var onDayClick = this.props.onDayClick;
18846
-
18847
- onDayClick(day, e);
18848
- }
18849
-
18850
- return onDayClick;
18851
- }()
18852
- }, {
18853
- key: 'onDayMouseEnter',
18854
- value: function () {
18855
- function onDayMouseEnter(day, e) {
18856
- var onDayMouseEnter = this.props.onDayMouseEnter;
18857
-
18858
- onDayMouseEnter(day, e);
18859
- }
18860
-
18861
- return onDayMouseEnter;
18862
- }()
18863
- }, {
18864
- key: 'onDayMouseLeave',
18865
- value: function () {
18866
- function onDayMouseLeave(day, e) {
18867
- var onDayMouseLeave = this.props.onDayMouseLeave;
18868
-
18869
- onDayMouseLeave(day, e);
18870
- }
18871
-
18872
- return onDayMouseLeave;
18873
- }()
18874
- }, {
18875
- key: 'onKeyDown',
18876
- value: function () {
18877
- function onKeyDown(day, e) {
18878
- var onDayClick = this.props.onDayClick;
18879
- var key = e.key;
18880
-
18881
- if (key === 'Enter' || key === ' ') {
18882
- onDayClick(day, e);
18883
- }
18884
- }
18885
-
18886
- return onKeyDown;
18887
- }()
18888
- }, {
18889
- key: 'setButtonRef',
18890
- value: function () {
18891
- function setButtonRef(ref) {
18892
- this.buttonRef = ref;
18893
- }
18894
-
18895
- return setButtonRef;
18896
- }()
18897
- }, {
18898
- key: 'render',
18899
- value: function () {
18900
- function render() {
18901
- var _this2 = this;
18902
-
18903
- var _props2 = this.props,
18904
- day = _props2.day,
18905
- ariaLabelFormat = _props2.ariaLabelFormat,
18906
- daySize = _props2.daySize,
18907
- isOutsideDay = _props2.isOutsideDay,
18908
- modifiers = _props2.modifiers,
18909
- renderDayContents = _props2.renderDayContents,
18910
- tabIndex = _props2.tabIndex,
18911
- styles = _props2.styles,
18912
- phrases = _props2.phrases;
18913
-
18914
-
18915
- if (!day) return _react2['default'].createElement('td', null);
18916
-
18917
- var _getCalendarDaySettin = (0, _getCalendarDaySettings2['default'])(day, ariaLabelFormat, daySize, modifiers, phrases),
18918
- daySizeStyles = _getCalendarDaySettin.daySizeStyles,
18919
- useDefaultCursor = _getCalendarDaySettin.useDefaultCursor,
18920
- selected = _getCalendarDaySettin.selected,
18921
- hoveredSpan = _getCalendarDaySettin.hoveredSpan,
18922
- isOutsideRange = _getCalendarDaySettin.isOutsideRange,
18923
- ariaLabel = _getCalendarDaySettin.ariaLabel;
18924
-
18925
- return _react2['default'].createElement(
18926
- 'td',
18927
- _extends({}, (0, _reactWithStyles.css)(styles.CalendarDay, useDefaultCursor && styles.CalendarDay__defaultCursor, styles.CalendarDay__default, isOutsideDay && styles.CalendarDay__outside, modifiers.has('today') && styles.CalendarDay__today, modifiers.has('first-day-of-week') && styles.CalendarDay__firstDayOfWeek, modifiers.has('last-day-of-week') && styles.CalendarDay__lastDayOfWeek, modifiers.has('hovered-offset') && styles.CalendarDay__hovered_offset, modifiers.has('highlighted-calendar') && styles.CalendarDay__highlighted_calendar, modifiers.has('blocked-minimum-nights') && styles.CalendarDay__blocked_minimum_nights, modifiers.has('blocked-calendar') && styles.CalendarDay__blocked_calendar, hoveredSpan && styles.CalendarDay__hovered_span, modifiers.has('selected-span') && styles.CalendarDay__selected_span, modifiers.has('last-in-range') && styles.CalendarDay__last_in_range, modifiers.has('selected-start') && styles.CalendarDay__selected_start, modifiers.has('selected-end') && styles.CalendarDay__selected_end, selected && styles.CalendarDay__selected, isOutsideRange && styles.CalendarDay__blocked_out_of_range, daySizeStyles), {
18928
- role: 'button' // eslint-disable-line jsx-a11y/no-noninteractive-element-to-interactive-role
18929
- , ref: this.setButtonRef,
18930
- 'aria-label': ariaLabel,
18931
- onMouseEnter: function () {
18932
- function onMouseEnter(e) {
18933
- _this2.onDayMouseEnter(day, e);
18934
- }
18935
-
18936
- return onMouseEnter;
18937
- }(),
18938
- onMouseLeave: function () {
18939
- function onMouseLeave(e) {
18940
- _this2.onDayMouseLeave(day, e);
18941
- }
18942
-
18943
- return onMouseLeave;
18944
- }(),
18945
- onMouseUp: function () {
18946
- function onMouseUp(e) {
18947
- e.currentTarget.blur();
18948
- }
18949
-
18950
- return onMouseUp;
18951
- }(),
18952
- onClick: function () {
18953
- function onClick(e) {
18954
- _this2.onDayClick(day, e);
18955
- }
18956
-
18957
- return onClick;
18958
- }(),
18959
- onKeyDown: function () {
18960
- function onKeyDown(e) {
18961
- _this2.onKeyDown(day, e);
18962
- }
18963
-
18964
- return onKeyDown;
18965
- }(),
18966
- tabIndex: tabIndex
18967
- }),
18968
- renderDayContents ? renderDayContents(day, modifiers) : day.format('D')
18969
- );
18970
- }
18971
-
18972
- return render;
18973
- }()
18974
- }]);
18975
-
18976
- return CalendarDay;
18977
- }(_react2['default'].Component);
18978
-
18979
- CalendarDay.propTypes = propTypes;
18980
- CalendarDay.defaultProps = defaultProps;
18981
-
18982
- exports.PureCalendarDay = CalendarDay;
18983
- exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
18984
- var _ref2$reactDates = _ref2.reactDates,
18985
- color = _ref2$reactDates.color,
18986
- font = _ref2$reactDates.font;
18987
- return {
18988
- CalendarDay: {
18989
- boxSizing: 'border-box',
18990
- cursor: 'pointer',
18991
- fontSize: font.size,
18992
- textAlign: 'center',
18993
-
18994
- ':active': {
18995
- outline: 0
18996
- }
18997
- },
18998
-
18999
- CalendarDay__defaultCursor: {
19000
- cursor: 'default'
19001
- },
19002
-
19003
- CalendarDay__default: {
19004
- border: '1px solid ' + String(color.core.borderLight),
19005
- color: color.text,
19006
- background: color.background,
19007
-
19008
- ':hover': {
19009
- background: color.core.borderLight,
19010
- border: '1px double ' + String(color.core.borderLight),
19011
- color: 'inherit'
19012
- }
19013
- },
19014
-
19015
- CalendarDay__hovered_offset: {
19016
- background: color.core.borderBright,
19017
- border: '1px double ' + String(color.core.borderLight),
19018
- color: 'inherit'
19019
- },
19020
-
19021
- CalendarDay__outside: {
19022
- border: 0,
19023
- background: color.outside.backgroundColor,
19024
- color: color.outside.color,
19025
-
19026
- ':hover': {
19027
- border: 0
19028
- }
19029
- },
19030
-
19031
- CalendarDay__blocked_minimum_nights: {
19032
- background: color.minimumNights.backgroundColor,
19033
- border: '1px solid ' + String(color.minimumNights.borderColor),
19034
- color: color.minimumNights.color,
19035
-
19036
- ':hover': {
19037
- background: color.minimumNights.backgroundColor_hover,
19038
- color: color.minimumNights.color_active
19039
- },
19040
-
19041
- ':active': {
19042
- background: color.minimumNights.backgroundColor_active,
19043
- color: color.minimumNights.color_active
19044
- }
19045
- },
19046
-
19047
- CalendarDay__highlighted_calendar: {
19048
- background: color.highlighted.backgroundColor,
19049
- color: color.highlighted.color,
19050
-
19051
- ':hover': {
19052
- background: color.highlighted.backgroundColor_hover,
19053
- color: color.highlighted.color_active
19054
- },
19055
-
19056
- ':active': {
19057
- background: color.highlighted.backgroundColor_active,
19058
- color: color.highlighted.color_active
19059
- }
19060
- },
19061
-
19062
- CalendarDay__selected_span: {
19063
- background: color.selectedSpan.backgroundColor,
19064
- border: '1px solid ' + String(color.selectedSpan.borderColor),
19065
- color: color.selectedSpan.color,
19066
-
19067
- ':hover': {
19068
- background: color.selectedSpan.backgroundColor_hover,
19069
- border: '1px solid ' + String(color.selectedSpan.borderColor),
19070
- color: color.selectedSpan.color_active
19071
- },
19072
-
19073
- ':active': {
19074
- background: color.selectedSpan.backgroundColor_active,
19075
- border: '1px solid ' + String(color.selectedSpan.borderColor),
19076
- color: color.selectedSpan.color_active
19077
- }
19078
- },
19079
-
19080
- CalendarDay__last_in_range: {
19081
- borderRight: color.core.primary
19082
- },
19083
-
19084
- CalendarDay__selected: {
19085
- background: color.selected.backgroundColor,
19086
- border: '1px solid ' + String(color.selected.borderColor),
19087
- color: color.selected.color,
19088
-
19089
- ':hover': {
19090
- background: color.selected.backgroundColor_hover,
19091
- border: '1px solid ' + String(color.selected.borderColor),
19092
- color: color.selected.color_active
19093
- },
19094
-
19095
- ':active': {
19096
- background: color.selected.backgroundColor_active,
19097
- border: '1px solid ' + String(color.selected.borderColor),
19098
- color: color.selected.color_active
19099
- }
19100
- },
19101
-
19102
- CalendarDay__hovered_span: {
19103
- background: color.hoveredSpan.backgroundColor,
19104
- border: '1px solid ' + String(color.hoveredSpan.borderColor),
19105
- color: color.hoveredSpan.color,
19106
-
19107
- ':hover': {
19108
- background: color.hoveredSpan.backgroundColor_hover,
19109
- border: '1px solid ' + String(color.hoveredSpan.borderColor),
19110
- color: color.hoveredSpan.color_active
19111
- },
19112
-
19113
- ':active': {
19114
- background: color.hoveredSpan.backgroundColor_active,
19115
- border: '1px solid ' + String(color.hoveredSpan.borderColor),
19116
- color: color.hoveredSpan.color_active
19117
- }
19118
- },
19119
-
19120
- CalendarDay__blocked_calendar: {
19121
- background: color.blocked_calendar.backgroundColor,
19122
- border: '1px solid ' + String(color.blocked_calendar.borderColor),
19123
- color: color.blocked_calendar.color,
19124
-
19125
- ':hover': {
19126
- background: color.blocked_calendar.backgroundColor_hover,
19127
- border: '1px solid ' + String(color.blocked_calendar.borderColor),
19128
- color: color.blocked_calendar.color_active
19129
- },
19130
-
19131
- ':active': {
19132
- background: color.blocked_calendar.backgroundColor_active,
19133
- border: '1px solid ' + String(color.blocked_calendar.borderColor),
19134
- color: color.blocked_calendar.color_active
19135
- }
19136
- },
19137
-
19138
- CalendarDay__blocked_out_of_range: {
19139
- background: color.blocked_out_of_range.backgroundColor,
19140
- border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
19141
- color: color.blocked_out_of_range.color,
19142
-
19143
- ':hover': {
19144
- background: color.blocked_out_of_range.backgroundColor_hover,
19145
- border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
19146
- color: color.blocked_out_of_range.color_active
19147
- },
19148
-
19149
- ':active': {
19150
- background: color.blocked_out_of_range.backgroundColor_active,
19151
- border: '1px solid ' + String(color.blocked_out_of_range.borderColor),
19152
- color: color.blocked_out_of_range.color_active
19153
- }
19154
- },
19155
-
19156
- CalendarDay__selected_start: {},
19157
- CalendarDay__selected_end: {},
19158
- CalendarDay__today: {},
19159
- CalendarDay__firstDayOfWeek: {},
19160
- CalendarDay__lastDayOfWeek: {}
19161
- };
19162
- })(CalendarDay);
19163
-
19164
- /***/ }),
19165
- /* 128 */
19166
- /***/ (function(module, exports, __webpack_require__) {
19167
-
19168
- "use strict";
19169
-
19170
-
19171
- var bind = __webpack_require__(33);
19172
-
19173
- var GetIntrinsic = __webpack_require__(359);
19174
-
19175
- var $apply = GetIntrinsic('%Function.prototype.apply%');
19176
- var $call = GetIntrinsic('%Function.prototype.call%');
19177
- var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
19178
-
19179
- var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
19180
-
19181
- if ($defineProperty) {
19182
- try {
19183
- $defineProperty({}, 'a', { value: 1 });
19184
- } catch (e) {
19185
- // IE 8 has a broken defineProperty
19186
- $defineProperty = null;
19187
- }
19188
- }
19189
-
19190
- module.exports = function callBind() {
19191
- return $reflectApply(bind, $call, arguments);
19192
- };
19193
-
19194
- var applyBind = function applyBind() {
19195
- return $reflectApply(bind, $apply, arguments);
19196
- };
19197
-
19198
- if ($defineProperty) {
19199
- $defineProperty(module.exports, 'apply', { value: applyBind });
19200
- } else {
19201
- module.exports.apply = applyBind;
19202
- }
19203
-
19204
-
19205
- /***/ }),
19206
- /* 129 */
19207
- /***/ (function(module, exports, __webpack_require__) {
19208
-
19209
- "use strict";
19210
-
19211
-
19212
- Object.defineProperty(exports, "__esModule", {
19213
- value: true
19214
- });
19215
- exports["default"] = betweenValidator;
19216
-
19217
- var _object = _interopRequireDefault(__webpack_require__(694));
19218
-
19219
- var _shape = _interopRequireDefault(__webpack_require__(131));
19220
-
19221
- var _valuesOf = _interopRequireDefault(__webpack_require__(366));
19222
-
19223
- var _wrapValidator = _interopRequireDefault(__webpack_require__(16));
19224
-
19225
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19226
-
19227
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
19228
-
19229
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
19230
-
19231
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
19232
-
19233
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19234
-
19235
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
19236
-
19237
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
19238
-
19239
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
19240
-
19241
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
19242
-
19243
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
19244
-
19245
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19246
-
19247
- function number(props, propName, componentName) {
19248
- var value = props[propName];
19249
-
19250
- if (typeof value === 'number' && !isNaN(value)) {
19251
- return null;
19252
- }
19253
-
19254
- return new TypeError("".concat(componentName, ": ").concat(propName, " must be a non-NaN number."));
19255
- }
19256
-
19257
- function numberOrPropsFunc(props, propName) {
19258
- var value = props[propName];
19259
-
19260
- if (typeof value === 'function') {
19261
- return null;
19262
- }
19263
-
19264
- if (typeof value === 'number' && !isNaN(value)) {
19265
- return null;
19266
- }
19267
-
19268
- return new TypeError("".concat(propName, ": a function, or a non-NaN number is required"));
19269
- }
19270
-
19271
- function lowerCompare(value, _ref) {
19272
- var gt = _ref.gt,
19273
- gte = _ref.gte;
19274
-
19275
- if (typeof gt === 'number') {
19276
- return value > gt;
19277
- }
19278
-
19279
- if (typeof gte === 'number') {
19280
- return value >= gte;
19281
- }
19282
-
19283
- return true;
19284
- }
19285
-
19286
- function upperCompare(value, _ref2) {
19287
- var lt = _ref2.lt,
19288
- lte = _ref2.lte;
19289
-
19290
- if (typeof lt === 'number') {
19291
- return value < lt;
19292
- }
19293
-
19294
- if (typeof lte === 'number') {
19295
- return value <= lte;
19296
- }
19297
-
19298
- return true;
19299
- }
19300
-
19301
- function greaterThanError(_ref3) {
19302
- var gt = _ref3.gt,
19303
- gte = _ref3.gte;
19304
-
19305
- if (typeof gt === 'number') {
19306
- return "greater than ".concat(gt);
19307
- }
19308
-
19309
- if (typeof gte === 'number') {
19310
- return "greater than or equal to ".concat(gte);
19311
- }
19312
-
19313
- return '';
19314
- }
19315
-
19316
- function lessThanError(_ref4) {
19317
- var lt = _ref4.lt,
19318
- lte = _ref4.lte;
19319
-
19320
- if (typeof lt === 'number') {
19321
- return "less than ".concat(lt);
19322
- }
19323
-
19324
- if (typeof lte === 'number') {
19325
- return "less than or equal to ".concat(lte);
19326
- }
19327
-
19328
- return '';
19329
- }
19330
-
19331
- function errorMessage(componentName, propName, opts) {
19332
- var errors = [greaterThanError(opts), lessThanError(opts)].filter(Boolean).join(' and ');
19333
- return "".concat(componentName, ": ").concat(propName, " must be ").concat(errors);
19334
- }
19335
-
19336
- function propsThunkify(opts) {
19337
- return (0, _object["default"])(opts).reduce(function (acc, _ref5) {
19338
- var _ref6 = _slicedToArray(_ref5, 2),
19339
- key = _ref6[0],
19340
- value = _ref6[1];
19341
-
19342
- var numberThunk = typeof value === 'number' ? function () {
19343
- return value;
19344
- } : value;
19345
- return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, numberThunk));
19346
- }, {});
19347
- }
19348
-
19349
- function invokeWithProps(optsThunks, props) {
19350
- return (0, _object["default"])(optsThunks).reduce(function (acc, _ref7) {
19351
- var _ref8 = _slicedToArray(_ref7, 2),
19352
- key = _ref8[0],
19353
- thunk = _ref8[1];
19354
-
19355
- var value = thunk(props);
19356
- return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, key, value));
19357
- }, {});
19358
- }
19359
-
19360
- var argValidators = [(0, _shape["default"])({
19361
- lt: numberOrPropsFunc,
19362
- gt: numberOrPropsFunc
19363
- }).isRequired, (0, _shape["default"])({
19364
- lte: numberOrPropsFunc,
19365
- gt: numberOrPropsFunc
19366
- }).isRequired, (0, _shape["default"])({
19367
- lt: numberOrPropsFunc,
19368
- gte: numberOrPropsFunc
19369
- }).isRequired, (0, _shape["default"])({
19370
- lte: numberOrPropsFunc,
19371
- gte: numberOrPropsFunc
19372
- }).isRequired, (0, _shape["default"])({
19373
- lt: numberOrPropsFunc
19374
- }).isRequired, (0, _shape["default"])({
19375
- lte: numberOrPropsFunc
19376
- }).isRequired, (0, _shape["default"])({
19377
- gt: numberOrPropsFunc
19378
- }).isRequired, (0, _shape["default"])({
19379
- gte: numberOrPropsFunc
19380
- }).isRequired];
19381
-
19382
- function argValidator(props, propName) {
19383
- return argValidators.every(function (validator) {
19384
- return !!validator(props, propName);
19385
- });
19386
- }
19387
-
19388
- var thunkValueValidator = (0, _valuesOf["default"])(number).isRequired;
19389
-
19390
- function betweenValidator(options) {
19391
- var argError = argValidator({
19392
- options: options
19393
- }, 'options');
19394
-
19395
- if (argError) {
19396
- throw new TypeError('between: only one of the pairs of `lt`/`lte`, and `gt`/`gte`, may be supplied, and at least one pair must be provided.');
19397
- }
19398
-
19399
- var optsThunks = propsThunkify(options);
19400
-
19401
- var validator = function between(props, propName, componentName) {
19402
- var propValue = props[propName];
19403
-
19404
- if (propValue == null) {
19405
- return null;
19406
- }
19407
-
19408
- if (typeof propValue !== 'number') {
19409
- return new RangeError("".concat(componentName, ": ").concat(propName, " must be a number, got \"").concat(_typeof(propValue), "\""));
19410
- }
19411
-
19412
- var opts = invokeWithProps(optsThunks, props);
19413
-
19414
- for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
19415
- rest[_key - 3] = arguments[_key];
19416
- }
19417
-
19418
- var thunkValuesError = thunkValueValidator.apply(void 0, [_defineProperty({}, propName, opts), propName, componentName].concat(rest));
19419
-
19420
- if (thunkValuesError) {
19421
- return thunkValuesError;
19422
- }
19423
-
19424
- if (!lowerCompare(propValue, opts) || !upperCompare(propValue, opts)) {
19425
- return new RangeError(errorMessage(componentName, propName, opts));
19426
- }
19427
-
19428
- return null;
19429
- };
19430
-
19431
- validator.isRequired = function betweenRequired(props, propName, componentName) {
19432
- var propValue = props[propName];
19433
-
19434
- if (typeof propValue !== 'number') {
19435
- return new RangeError("".concat(componentName, ": ").concat(propName, " must be a number, got \"").concat(_typeof(propValue), "\""));
19436
- }
19437
-
19438
- var opts = invokeWithProps(optsThunks, props);
19439
-
19440
- for (var _len2 = arguments.length, rest = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
19441
- rest[_key2 - 3] = arguments[_key2];
19442
- }
19443
-
19444
- var thunkValuesError = thunkValueValidator.apply(void 0, [_defineProperty({}, propName, opts), propName, componentName].concat(rest));
19445
-
19446
- if (thunkValuesError) {
19447
- return thunkValuesError;
19448
- }
19449
-
19450
- if (!lowerCompare(propValue, opts) || !upperCompare(propValue, opts)) {
19451
- return new RangeError(errorMessage(componentName, propName, opts));
19452
- }
19453
-
19454
- return null;
19455
- };
19456
-
19457
- return (0, _wrapValidator["default"])(validator, 'between', options);
19458
- }
19459
- //# sourceMappingURL=between.js.map
19460
-
19461
- /***/ }),
19462
- /* 130 */
19463
- /***/ (function(module, exports, __webpack_require__) {
19464
-
19465
- "use strict";
19466
-
19467
-
19468
- /* globals
19469
- Atomics,
19470
- SharedArrayBuffer,
19471
- */
19472
-
19473
- var undefined;
19474
-
19475
- var $TypeError = TypeError;
19476
-
19477
- var $gOPD = Object.getOwnPropertyDescriptor;
19478
- if ($gOPD) {
19479
- try {
19480
- $gOPD({}, '');
19481
- } catch (e) {
19482
- $gOPD = null; // this is IE 8, which has a broken gOPD
19483
- }
19484
- }
19485
-
19486
- var throwTypeError = function () { throw new $TypeError(); };
19487
- var ThrowTypeError = $gOPD
19488
- ? (function () {
19489
- try {
19490
- // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
19491
- arguments.callee; // IE 8 does not throw here
19492
- return throwTypeError;
19493
- } catch (calleeThrows) {
19494
- try {
19495
- // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
19496
- return $gOPD(arguments, 'callee').get;
19497
- } catch (gOPDthrows) {
19498
- return throwTypeError;
19499
- }
19500
- }
19501
- }())
19502
- : throwTypeError;
19503
-
19504
- var hasSymbols = __webpack_require__(43)();
19505
-
19506
- var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
19507
-
19508
- var generator; // = function * () {};
19509
- var generatorFunction = generator ? getProto(generator) : undefined;
19510
- var asyncFn; // async function() {};
19511
- var asyncFunction = asyncFn ? asyncFn.constructor : undefined;
19512
- var asyncGen; // async function * () {};
19513
- var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined;
19514
- var asyncGenIterator = asyncGen ? asyncGen() : undefined;
19515
-
19516
- var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
19517
-
19518
- var INTRINSICS = {
19519
- '%Array%': Array,
19520
- '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
19521
- '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype,
19522
- '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
19523
- '%ArrayPrototype%': Array.prototype,
19524
- '%ArrayProto_entries%': Array.prototype.entries,
19525
- '%ArrayProto_forEach%': Array.prototype.forEach,
19526
- '%ArrayProto_keys%': Array.prototype.keys,
19527
- '%ArrayProto_values%': Array.prototype.values,
19528
- '%AsyncFromSyncIteratorPrototype%': undefined,
19529
- '%AsyncFunction%': asyncFunction,
19530
- '%AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined,
19531
- '%AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined,
19532
- '%AsyncGeneratorFunction%': asyncGenFunction,
19533
- '%AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined,
19534
- '%AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined,
19535
- '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
19536
- '%Boolean%': Boolean,
19537
- '%BooleanPrototype%': Boolean.prototype,
19538
- '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
19539
- '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype,
19540
- '%Date%': Date,
19541
- '%DatePrototype%': Date.prototype,
19542
- '%decodeURI%': decodeURI,
19543
- '%decodeURIComponent%': decodeURIComponent,
19544
- '%encodeURI%': encodeURI,
19545
- '%encodeURIComponent%': encodeURIComponent,
19546
- '%Error%': Error,
19547
- '%ErrorPrototype%': Error.prototype,
19548
- '%eval%': eval, // eslint-disable-line no-eval
19549
- '%EvalError%': EvalError,
19550
- '%EvalErrorPrototype%': EvalError.prototype,
19551
- '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
19552
- '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype,
19553
- '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
19554
- '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype,
19555
- '%Function%': Function,
19556
- '%FunctionPrototype%': Function.prototype,
19557
- '%Generator%': generator ? getProto(generator()) : undefined,
19558
- '%GeneratorFunction%': generatorFunction,
19559
- '%GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined,
19560
- '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
19561
- '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype,
19562
- '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
19563
- '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype,
19564
- '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
19565
- '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype,
19566
- '%isFinite%': isFinite,
19567
- '%isNaN%': isNaN,
19568
- '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
19569
- '%JSON%': typeof JSON === 'object' ? JSON : undefined,
19570
- '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined,
19571
- '%Map%': typeof Map === 'undefined' ? undefined : Map,
19572
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
19573
- '%MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype,
19574
- '%Math%': Math,
19575
- '%Number%': Number,
19576
- '%NumberPrototype%': Number.prototype,
19577
- '%Object%': Object,
19578
- '%ObjectPrototype%': Object.prototype,
19579
- '%ObjProto_toString%': Object.prototype.toString,
19580
- '%ObjProto_valueOf%': Object.prototype.valueOf,
19581
- '%parseFloat%': parseFloat,
19582
- '%parseInt%': parseInt,
19583
- '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
19584
- '%PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype,
19585
- '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then,
19586
- '%Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all,
19587
- '%Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject,
19588
- '%Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve,
19589
- '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
19590
- '%RangeError%': RangeError,
19591
- '%RangeErrorPrototype%': RangeError.prototype,
19592
- '%ReferenceError%': ReferenceError,
19593
- '%ReferenceErrorPrototype%': ReferenceError.prototype,
19594
- '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
19595
- '%RegExp%': RegExp,
19596
- '%RegExpPrototype%': RegExp.prototype,
19597
- '%Set%': typeof Set === 'undefined' ? undefined : Set,
19598
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
19599
- '%SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype,
19600
- '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
19601
- '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype,
19602
- '%String%': String,
19603
- '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
19604
- '%StringPrototype%': String.prototype,
19605
- '%Symbol%': hasSymbols ? Symbol : undefined,
19606
- '%SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined,
19607
- '%SyntaxError%': SyntaxError,
19608
- '%SyntaxErrorPrototype%': SyntaxError.prototype,
19609
- '%ThrowTypeError%': ThrowTypeError,
19610
- '%TypedArray%': TypedArray,
19611
- '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined,
19612
- '%TypeError%': $TypeError,
19613
- '%TypeErrorPrototype%': $TypeError.prototype,
19614
- '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
19615
- '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype,
19616
- '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
19617
- '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype,
19618
- '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
19619
- '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype,
19620
- '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
19621
- '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype,
19622
- '%URIError%': URIError,
19623
- '%URIErrorPrototype%': URIError.prototype,
19624
- '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
19625
- '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype,
19626
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
19627
- '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype
19628
- };
19629
-
19630
- var bind = __webpack_require__(33);
19631
- var $replace = bind.call(Function.call, String.prototype.replace);
19632
-
19633
- /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
19634
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
19635
- var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
19636
- var stringToPath = function stringToPath(string) {
19637
- var result = [];
19638
- $replace(string, rePropName, function (match, number, quote, subString) {
19639
- result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match);
19640
- });
19641
- return result;
19642
- };
19643
- /* end adaptation */
19644
-
19645
- var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
19646
- if (!(name in INTRINSICS)) {
19647
- throw new SyntaxError('intrinsic ' + name + ' does not exist!');
19648
- }
19649
-
19650
- // istanbul ignore if // hopefully this is impossible to test :-)
19651
- if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) {
19652
- throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
19653
- }
19654
-
19655
- return INTRINSICS[name];
19656
- };
19657
-
19658
- module.exports = function GetIntrinsic(name, allowMissing) {
19659
- if (typeof name !== 'string' || name.length === 0) {
19660
- throw new TypeError('intrinsic name must be a non-empty string');
19661
- }
19662
- if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
19663
- throw new TypeError('"allowMissing" argument must be a boolean');
19664
- }
19665
-
19666
- var parts = stringToPath(name);
19667
-
19668
- var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing);
19669
- for (var i = 1; i < parts.length; i += 1) {
19670
- if (value != null) {
19671
- if ($gOPD && (i + 1) >= parts.length) {
19672
- var desc = $gOPD(value, parts[i]);
19673
- if (!allowMissing && !(parts[i] in value)) {
19674
- throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
19675
- }
19676
- // By convention, when a data property is converted to an accessor
19677
- // property to emulate a data property that does not suffer from
19678
- // the override mistake, that accessor's getter is marked with
19679
- // an `originalValue` property. Here, when we detect this, we
19680
- // uphold the illusion by pretending to see that original data
19681
- // property, i.e., returning the value rather than the getter
19682
- // itself.
19683
- value = desc && 'get' in desc && !('originalValue' in desc.get) ? desc.get : value[parts[i]];
19684
- } else {
19685
- value = value[parts[i]];
19686
- }
19687
- }
19688
- }
19689
- return value;
19690
- };
19691
-
19692
-
19693
- /***/ }),
19694
- /* 131 */
19695
- /***/ (function(module, exports, __webpack_require__) {
19696
-
19697
- "use strict";
19698
-
19699
-
19700
- Object.defineProperty(exports, "__esModule", {
19701
- value: true
19702
- });
19703
- exports["default"] = shapeValidator;
19704
-
19705
- var _isPlainObject = _interopRequireDefault(__webpack_require__(132));
19706
-
19707
- var _wrapValidator = _interopRequireDefault(__webpack_require__(16));
19708
-
19709
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19710
-
19711
- function shapeValidator(shapeTypes) {
19712
- if (!(0, _isPlainObject["default"])(shapeTypes)) {
19713
- throw new TypeError('shape must be a normal object');
19714
- }
19715
-
19716
- function shape(props, propName, componentName, location) {
19717
- var propValue = props[propName];
19718
-
19719
- if (propValue == null) {
19720
- return null;
19721
- } // code adapted from PropTypes.shape: https://github.com/facebook/react/blob/14156e56b9cf18ac86963185c5af4abddf3ff811/src/isomorphic/classic/types/ReactPropTypes.js#L381
19722
- // eslint-disable-next-line guard-for-in, no-restricted-syntax
19723
-
19724
-
19725
- for (var _len = arguments.length, rest = new Array(_len > 4 ? _len - 4 : 0), _key = 4; _key < _len; _key++) {
19726
- rest[_key - 4] = arguments[_key];
19727
- }
19728
-
19729
- for (var key in shapeTypes) {
19730
- var checker = shapeTypes[key];
19731
-
19732
- if (checker) {
19733
- var error = checker.apply(void 0, [propValue, key, componentName, location].concat(rest));
19734
-
19735
- if (error) {
19736
- return error;
19737
- }
19738
- }
19739
- }
19740
-
19741
- return null;
19742
- }
19743
-
19744
- shape.isRequired = function shapeRequired(props, propName, componentName) {
19745
- var propValue = props[propName];
19746
-
19747
- if (propValue == null) {
19748
- return new TypeError("".concat(componentName, ": ").concat(propName, " is required."));
19749
- }
19750
-
19751
- for (var _len2 = arguments.length, rest = new Array(_len2 > 3 ? _len2 - 3 : 0), _key2 = 3; _key2 < _len2; _key2++) {
19752
- rest[_key2 - 3] = arguments[_key2];
19753
- }
19754
-
19755
- return shape.apply(void 0, [props, propName, componentName].concat(rest));
19756
- };
19757
-
19758
- return (0, _wrapValidator["default"])(shape, 'shape', shapeTypes);
19759
- }
19760
- //# sourceMappingURL=shape.js.map
19761
-
19762
- /***/ }),
19763
- /* 132 */
19764
- /***/ (function(module, exports, __webpack_require__) {
19765
-
19766
- "use strict";
19767
-
19768
-
19769
- Object.defineProperty(exports, "__esModule", {
19770
- value: true
19771
- });
19772
- exports["default"] = void 0;
19773
-
19774
- var _isPlainObject = _interopRequireDefault(__webpack_require__(362));
19775
-
19776
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19777
-
19778
- var _default = _isPlainObject["default"];
19779
- exports["default"] = _default;
19780
- //# sourceMappingURL=isPlainObject.js.map
19781
-
19782
- /***/ }),
19783
- /* 133 */
19784
- /***/ (function(module, exports, __webpack_require__) {
19785
-
19786
- "use strict";
19787
-
19788
-
19789
- Object.defineProperty(exports, "__esModule", {
19790
- value: true
19791
- });
19792
- exports["default"] = renderableChildren;
19793
-
19794
- var _react = _interopRequireDefault(__webpack_require__(9));
19795
-
19796
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19797
-
19798
- function renderableChildren(childrenProp) {
19799
- return _react["default"].Children.toArray(childrenProp).filter(function (child) {
19800
- return child === 0 || child;
19801
- });
19802
- }
19803
- //# sourceMappingURL=renderableChildren.js.map
19804
-
19805
- /***/ }),
19806
- /* 134 */
19807
- /***/ (function(module, exports, __webpack_require__) {
19808
-
19809
- "use strict";
19810
-
19811
-
19812
- Object.defineProperty(exports, "__esModule", {
19813
- value: true
19814
- });
19815
- exports["default"] = getComponentName;
19816
-
19817
- var _functionPrototype = _interopRequireDefault(__webpack_require__(720));
19818
-
19819
- var _reactIs = __webpack_require__(70);
19820
-
19821
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19822
-
19823
- function getComponentName(Component) {
19824
- if (typeof Component === 'string') {
19825
- return Component;
19826
- }
19827
-
19828
- if (typeof Component === 'function') {
19829
- return Component.displayName || (0, _functionPrototype["default"])(Component);
19830
- }
19831
-
19832
- if ((0, _reactIs.isForwardRef)({
19833
- type: Component,
19834
- $$typeof: _reactIs.Element
19835
- })) {
19836
- return Component.displayName;
19837
- }
19838
-
19839
- if ((0, _reactIs.isMemo)(Component)) {
19840
- return getComponentName(Component.type);
19841
- }
19842
-
19843
- return null;
19844
- }
19845
- //# sourceMappingURL=getComponentName.js.map
19846
-
19847
- /***/ }),
19848
- /* 135 */
19849
- /***/ (function(module, exports, __webpack_require__) {
19850
-
19851
- "use strict";
19852
-
19853
-
19854
- Object.defineProperty(exports, "__esModule", {
19855
- value: true
19856
- });
19857
- exports["default"] = void 0;
19858
-
19859
- var _isInteger = _interopRequireDefault(__webpack_require__(380));
19860
-
19861
- var _wrapValidator = _interopRequireDefault(__webpack_require__(16));
19862
-
19863
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19864
-
19865
- function requiredInteger(props, propName, componentName) {
19866
- var propValue = props[propName];
19867
-
19868
- if (propValue == null || !(0, _isInteger["default"])(propValue)) {
19869
- return new RangeError("".concat(propName, " in ").concat(componentName, " must be an integer"));
19870
- }
19871
-
19872
- return null;
19873
- }
19874
-
19875
- var validator = function integer(props, propName) {
19876
- var propValue = props[propName];
19877
-
19878
- if (propValue == null) {
19879
- return null;
19880
- }
19881
-
19882
- for (var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
19883
- rest[_key - 2] = arguments[_key];
19884
- }
19885
-
19886
- return requiredInteger.apply(void 0, [props, propName].concat(rest));
19887
- };
19888
-
19889
- validator.isRequired = requiredInteger;
19890
-
19891
- var _default = function _default() {
19892
- return (0, _wrapValidator["default"])(validator, 'integer');
19893
- };
19894
-
19895
- exports["default"] = _default;
19896
- //# sourceMappingURL=integer.js.map
19897
-
19898
- /***/ }),
19899
- /* 136 */
19900
- /***/ (function(module, exports, __webpack_require__) {
19901
-
19902
- "use strict";
19903
-
19904
-
19905
- Object.defineProperty(exports, "__esModule", {
19906
- value: true
19907
- });
19908
- exports["default"] = withShape;
19909
-
19910
- var _and = _interopRequireDefault(__webpack_require__(49));
19911
-
19912
- var _shape = _interopRequireDefault(__webpack_require__(131));
19913
-
19914
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19915
-
19916
- function withShape(type, shapeTypes) {
19917
- if (typeof type !== 'function') {
19918
- throw new TypeError('type must be a valid PropType');
19919
- }
19920
-
19921
- var shapeValidator = (0, _shape["default"])(shapeTypes);
19922
- return (0, _and["default"])([type, shapeValidator], 'withShape');
19923
- }
19924
- //# sourceMappingURL=withShape.js.map
19925
-
19926
- /***/ }),
19927
- /* 137 */
19928
- /***/ (function(module, exports, __webpack_require__) {
19929
-
19930
- // eslint-disable-next-line import/no-unresolved
19931
- module.exports = __webpack_require__(759);
19932
-
19933
-
19934
- /***/ }),
19935
- /* 138 */
19936
- /***/ (function(module, exports, __webpack_require__) {
19937
-
19938
- "use strict";
19939
-
19940
-
19941
- var define = __webpack_require__(28);
19942
-
19943
- var implementation = __webpack_require__(398);
19944
- var getPolyfill = __webpack_require__(399);
19945
- var shim = __webpack_require__(764);
19946
-
19947
- var polyfill = getPolyfill();
19948
-
19949
- define(polyfill, {
19950
- getPolyfill: getPolyfill,
19951
- implementation: implementation,
19952
- shim: shim
19953
- });
19954
-
19955
- module.exports = polyfill;
19956
-
19957
-
19958
- /***/ }),
19959
- /* 139 */
19960
- /***/ (function(module, exports, __webpack_require__) {
19961
-
19962
- "use strict";
19963
-
19964
-
19965
- /* globals
19966
- Atomics,
19967
- SharedArrayBuffer,
19968
- */
19969
-
19970
- var undefined;
19971
-
19972
- var $TypeError = TypeError;
19973
-
19974
- var $gOPD = Object.getOwnPropertyDescriptor;
19975
- if ($gOPD) {
19976
- try {
19977
- $gOPD({}, '');
19978
- } catch (e) {
19979
- $gOPD = null; // this is IE 8, which has a broken gOPD
19980
- }
19981
- }
19982
-
19983
- var throwTypeError = function () { throw new $TypeError(); };
19984
- var ThrowTypeError = $gOPD
19985
- ? (function () {
19986
- try {
19987
- // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
19988
- arguments.callee; // IE 8 does not throw here
19989
- return throwTypeError;
19990
- } catch (calleeThrows) {
19991
- try {
19992
- // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
19993
- return $gOPD(arguments, 'callee').get;
19994
- } catch (gOPDthrows) {
19995
- return throwTypeError;
19996
- }
19997
- }
19998
- }())
19999
- : throwTypeError;
20000
-
20001
- var hasSymbols = __webpack_require__(43)();
20002
-
20003
- var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
20004
-
20005
- var generator; // = function * () {};
20006
- var generatorFunction = generator ? getProto(generator) : undefined;
20007
- var asyncFn; // async function() {};
20008
- var asyncFunction = asyncFn ? asyncFn.constructor : undefined;
20009
- var asyncGen; // async function * () {};
20010
- var asyncGenFunction = asyncGen ? getProto(asyncGen) : undefined;
20011
- var asyncGenIterator = asyncGen ? asyncGen() : undefined;
20012
-
20013
- var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
20014
-
20015
- var INTRINSICS = {
20016
- '%Array%': Array,
20017
- '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
20018
- '%ArrayBufferPrototype%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer.prototype,
20019
- '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
20020
- '%ArrayPrototype%': Array.prototype,
20021
- '%ArrayProto_entries%': Array.prototype.entries,
20022
- '%ArrayProto_forEach%': Array.prototype.forEach,
20023
- '%ArrayProto_keys%': Array.prototype.keys,
20024
- '%ArrayProto_values%': Array.prototype.values,
20025
- '%AsyncFromSyncIteratorPrototype%': undefined,
20026
- '%AsyncFunction%': asyncFunction,
20027
- '%AsyncFunctionPrototype%': asyncFunction ? asyncFunction.prototype : undefined,
20028
- '%AsyncGenerator%': asyncGen ? getProto(asyncGenIterator) : undefined,
20029
- '%AsyncGeneratorFunction%': asyncGenFunction,
20030
- '%AsyncGeneratorPrototype%': asyncGenFunction ? asyncGenFunction.prototype : undefined,
20031
- '%AsyncIteratorPrototype%': asyncGenIterator && hasSymbols && Symbol.asyncIterator ? asyncGenIterator[Symbol.asyncIterator]() : undefined,
20032
- '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
20033
- '%Boolean%': Boolean,
20034
- '%BooleanPrototype%': Boolean.prototype,
20035
- '%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
20036
- '%DataViewPrototype%': typeof DataView === 'undefined' ? undefined : DataView.prototype,
20037
- '%Date%': Date,
20038
- '%DatePrototype%': Date.prototype,
20039
- '%decodeURI%': decodeURI,
20040
- '%decodeURIComponent%': decodeURIComponent,
20041
- '%encodeURI%': encodeURI,
20042
- '%encodeURIComponent%': encodeURIComponent,
20043
- '%Error%': Error,
20044
- '%ErrorPrototype%': Error.prototype,
20045
- '%eval%': eval, // eslint-disable-line no-eval
20046
- '%EvalError%': EvalError,
20047
- '%EvalErrorPrototype%': EvalError.prototype,
20048
- '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
20049
- '%Float32ArrayPrototype%': typeof Float32Array === 'undefined' ? undefined : Float32Array.prototype,
20050
- '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
20051
- '%Float64ArrayPrototype%': typeof Float64Array === 'undefined' ? undefined : Float64Array.prototype,
20052
- '%Function%': Function,
20053
- '%FunctionPrototype%': Function.prototype,
20054
- '%Generator%': generator ? getProto(generator()) : undefined,
20055
- '%GeneratorFunction%': generatorFunction,
20056
- '%GeneratorPrototype%': generatorFunction ? generatorFunction.prototype : undefined,
20057
- '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
20058
- '%Int8ArrayPrototype%': typeof Int8Array === 'undefined' ? undefined : Int8Array.prototype,
20059
- '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
20060
- '%Int16ArrayPrototype%': typeof Int16Array === 'undefined' ? undefined : Int8Array.prototype,
20061
- '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
20062
- '%Int32ArrayPrototype%': typeof Int32Array === 'undefined' ? undefined : Int32Array.prototype,
20063
- '%isFinite%': isFinite,
20064
- '%isNaN%': isNaN,
20065
- '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
20066
- '%JSON%': typeof JSON === 'object' ? JSON : undefined,
20067
- '%JSONParse%': typeof JSON === 'object' ? JSON.parse : undefined,
20068
- '%Map%': typeof Map === 'undefined' ? undefined : Map,
20069
- '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
20070
- '%MapPrototype%': typeof Map === 'undefined' ? undefined : Map.prototype,
20071
- '%Math%': Math,
20072
- '%Number%': Number,
20073
- '%NumberPrototype%': Number.prototype,
20074
- '%Object%': Object,
20075
- '%ObjectPrototype%': Object.prototype,
20076
- '%ObjProto_toString%': Object.prototype.toString,
20077
- '%ObjProto_valueOf%': Object.prototype.valueOf,
20078
- '%parseFloat%': parseFloat,
20079
- '%parseInt%': parseInt,
20080
- '%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
20081
- '%PromisePrototype%': typeof Promise === 'undefined' ? undefined : Promise.prototype,
20082
- '%PromiseProto_then%': typeof Promise === 'undefined' ? undefined : Promise.prototype.then,
20083
- '%Promise_all%': typeof Promise === 'undefined' ? undefined : Promise.all,
20084
- '%Promise_reject%': typeof Promise === 'undefined' ? undefined : Promise.reject,
20085
- '%Promise_resolve%': typeof Promise === 'undefined' ? undefined : Promise.resolve,
20086
- '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
20087
- '%RangeError%': RangeError,
20088
- '%RangeErrorPrototype%': RangeError.prototype,
20089
- '%ReferenceError%': ReferenceError,
20090
- '%ReferenceErrorPrototype%': ReferenceError.prototype,
20091
- '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
20092
- '%RegExp%': RegExp,
20093
- '%RegExpPrototype%': RegExp.prototype,
20094
- '%Set%': typeof Set === 'undefined' ? undefined : Set,
20095
- '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
20096
- '%SetPrototype%': typeof Set === 'undefined' ? undefined : Set.prototype,
20097
- '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
20098
- '%SharedArrayBufferPrototype%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer.prototype,
20099
- '%String%': String,
20100
- '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
20101
- '%StringPrototype%': String.prototype,
20102
- '%Symbol%': hasSymbols ? Symbol : undefined,
20103
- '%SymbolPrototype%': hasSymbols ? Symbol.prototype : undefined,
20104
- '%SyntaxError%': SyntaxError,
20105
- '%SyntaxErrorPrototype%': SyntaxError.prototype,
20106
- '%ThrowTypeError%': ThrowTypeError,
20107
- '%TypedArray%': TypedArray,
20108
- '%TypedArrayPrototype%': TypedArray ? TypedArray.prototype : undefined,
20109
- '%TypeError%': $TypeError,
20110
- '%TypeErrorPrototype%': $TypeError.prototype,
20111
- '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
20112
- '%Uint8ArrayPrototype%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array.prototype,
20113
- '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
20114
- '%Uint8ClampedArrayPrototype%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray.prototype,
20115
- '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
20116
- '%Uint16ArrayPrototype%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array.prototype,
20117
- '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
20118
- '%Uint32ArrayPrototype%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array.prototype,
20119
- '%URIError%': URIError,
20120
- '%URIErrorPrototype%': URIError.prototype,
20121
- '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
20122
- '%WeakMapPrototype%': typeof WeakMap === 'undefined' ? undefined : WeakMap.prototype,
20123
- '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet,
20124
- '%WeakSetPrototype%': typeof WeakSet === 'undefined' ? undefined : WeakSet.prototype
20125
- };
20126
-
20127
- var bind = __webpack_require__(33);
20128
- var $replace = bind.call(Function.call, String.prototype.replace);
20129
-
20130
- /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
20131
- var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
20132
- var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
20133
- var stringToPath = function stringToPath(string) {
20134
- var result = [];
20135
- $replace(string, rePropName, function (match, number, quote, subString) {
20136
- result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : (number || match);
20137
- });
20138
- return result;
20139
- };
20140
- /* end adaptation */
20141
-
20142
- var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
20143
- if (!(name in INTRINSICS)) {
20144
- throw new SyntaxError('intrinsic ' + name + ' does not exist!');
20145
- }
20146
-
20147
- // istanbul ignore if // hopefully this is impossible to test :-)
20148
- if (typeof INTRINSICS[name] === 'undefined' && !allowMissing) {
20149
- throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
20150
- }
20151
-
20152
- return INTRINSICS[name];
20153
- };
20154
-
20155
- module.exports = function GetIntrinsic(name, allowMissing) {
20156
- if (typeof name !== 'string' || name.length === 0) {
20157
- throw new TypeError('intrinsic name must be a non-empty string');
20158
- }
20159
- if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
20160
- throw new TypeError('"allowMissing" argument must be a boolean');
20161
- }
20162
-
20163
- var parts = stringToPath(name);
20164
-
20165
- var value = getBaseIntrinsic('%' + (parts.length > 0 ? parts[0] : '') + '%', allowMissing);
20166
- for (var i = 1; i < parts.length; i += 1) {
20167
- if (value != null) {
20168
- if ($gOPD && (i + 1) >= parts.length) {
20169
- var desc = $gOPD(value, parts[i]);
20170
- if (!allowMissing && !(parts[i] in value)) {
20171
- throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
20172
- }
20173
- // By convention, when a data property is converted to an accessor
20174
- // property to emulate a data property that does not suffer from
20175
- // the override mistake, that accessor's getter is marked with
20176
- // an `originalValue` property. Here, when we detect this, we
20177
- // uphold the illusion by pretending to see that original data
20178
- // property, i.e., returning the value rather than the getter
20179
- // itself.
20180
- value = desc && 'get' in desc && !('originalValue' in desc.get) ? desc.get : value[parts[i]];
20181
- } else {
20182
- value = value[parts[i]];
20183
- }
20184
- }
20185
- }
20186
- return value;
20187
- };
20188
-
20189
-
20190
- /***/ }),
20191
- /* 140 */
20192
- /***/ (function(module, exports, __webpack_require__) {
20193
-
20194
- "use strict";
20195
-
20196
-
20197
- Object.defineProperty(exports, "__esModule", {
20198
- value: true
20199
- });
20200
- exports['default'] = getInputHeight;
20201
- /* eslint-disable camelcase */
20202
-
20203
- function getPadding(vertical, top, bottom) {
20204
- var isTopDefined = typeof top === 'number';
20205
- var isBottomDefined = typeof bottom === 'number';
20206
- var isVerticalDefined = typeof vertical === 'number';
20207
-
20208
- if (isTopDefined && isBottomDefined) {
20209
- return top + bottom;
20210
- }
20211
-
20212
- if (isTopDefined && isVerticalDefined) {
20213
- return top + vertical;
20214
- }
20215
-
20216
- if (isTopDefined) {
20217
- return top;
20218
- }
20219
-
20220
- if (isBottomDefined && isVerticalDefined) {
20221
- return bottom + vertical;
20222
- }
20223
-
20224
- if (isBottomDefined) {
20225
- return bottom;
20226
- }
20227
-
20228
- if (isVerticalDefined) {
20229
- return 2 * vertical;
20230
- }
20231
-
20232
- return 0;
20233
- }
20234
-
20235
- function getInputHeight(_ref, small) {
20236
- var _ref$font$input = _ref.font.input,
20237
- lineHeight = _ref$font$input.lineHeight,
20238
- lineHeight_small = _ref$font$input.lineHeight_small,
20239
- _ref$spacing = _ref.spacing,
20240
- inputPadding = _ref$spacing.inputPadding,
20241
- displayTextPaddingVertical = _ref$spacing.displayTextPaddingVertical,
20242
- displayTextPaddingTop = _ref$spacing.displayTextPaddingTop,
20243
- displayTextPaddingBottom = _ref$spacing.displayTextPaddingBottom,
20244
- displayTextPaddingVertical_small = _ref$spacing.displayTextPaddingVertical_small,
20245
- displayTextPaddingTop_small = _ref$spacing.displayTextPaddingTop_small,
20246
- displayTextPaddingBottom_small = _ref$spacing.displayTextPaddingBottom_small;
20247
-
20248
- var calcLineHeight = small ? lineHeight_small : lineHeight;
20249
-
20250
- var padding = small ? getPadding(displayTextPaddingVertical_small, displayTextPaddingTop_small, displayTextPaddingBottom_small) : getPadding(displayTextPaddingVertical, displayTextPaddingTop, displayTextPaddingBottom);
20251
-
20252
- return parseInt(calcLineHeight, 10) + 2 * inputPadding + padding;
20253
- }
20254
-
20255
- /***/ }),
20256
- /* 141 */
20257
- /***/ (function(module, exports) {
20258
-
20259
- /**
20260
- * Checks if `value` is the
20261
- * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
20262
- * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
20263
- *
20264
- * @static
20265
- * @memberOf _
20266
- * @since 0.1.0
20267
- * @category Lang
20268
- * @param {*} value The value to check.
20269
- * @returns {boolean} Returns `true` if `value` is an object, else `false`.
20270
- * @example
20271
- *
20272
- * _.isObject({});
20273
- * // => true
20274
- *
20275
- * _.isObject([1, 2, 3]);
20276
- * // => true
20277
- *
20278
- * _.isObject(_.noop);
20279
- * // => true
20280
- *
20281
- * _.isObject(null);
20282
- * // => false
20283
- */
20284
- function isObject(value) {
20285
- var type = typeof value;
20286
- return value != null && (type == 'object' || type == 'function');
20287
- }
20288
-
20289
- module.exports = isObject;
20290
-
20291
-
20292
- /***/ }),
20293
- /* 142 */
20294
- /***/ (function(module, exports, __webpack_require__) {
20295
-
20296
- "use strict";
20297
-
20298
-
20299
- Object.defineProperty(exports, "__esModule", {
20300
- value: true
20301
- });
20302
- exports['default'] = toLocalizedDateString;
20303
-
20304
- var _moment = __webpack_require__(0);
20305
-
20306
- var _moment2 = _interopRequireDefault(_moment);
20307
-
20308
- var _toMomentObject = __webpack_require__(59);
20309
-
20310
- var _toMomentObject2 = _interopRequireDefault(_toMomentObject);
20311
-
20312
- var _constants = __webpack_require__(17);
20313
-
20314
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
20315
-
20316
- function toLocalizedDateString(date, currentFormat) {
20317
- var dateObj = _moment2['default'].isMoment(date) ? date : (0, _toMomentObject2['default'])(date, currentFormat);
20318
- if (!dateObj) return null;
20319
-
20320
- return dateObj.format(_constants.DISPLAY_FORMAT);
20321
- }
20322
-
20323
- /***/ }),
20324
- /* 143 */
20325
- /***/ (function(module, exports, __webpack_require__) {
20326
-
20327
- "use strict";
20328
-
20329
-
20330
- Object.defineProperty(exports, "__esModule", {
20331
- value: true
20332
- });
20333
- exports['default'] = isDayVisible;
20334
-
20335
- var _isBeforeDay = __webpack_require__(74);
20336
-
20337
- var _isBeforeDay2 = _interopRequireDefault(_isBeforeDay);
20338
-
20339
- var _isAfterDay = __webpack_require__(92);
20340
-
20341
- var _isAfterDay2 = _interopRequireDefault(_isAfterDay);
20342
-
20343
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
20344
-
20345
- function isDayVisible(day, month, numberOfMonths, enableOutsideDays) {
20346
- var firstDayOfFirstMonth = month.clone().startOf('month');
20347
- if (enableOutsideDays) firstDayOfFirstMonth = firstDayOfFirstMonth.startOf('week');
20348
- if ((0, _isBeforeDay2['default'])(day, firstDayOfFirstMonth)) return false;
20349
-
20350
- var lastDayOfLastMonth = month.clone().add(numberOfMonths - 1, 'months').endOf('month');
20351
- if (enableOutsideDays) lastDayOfLastMonth = lastDayOfLastMonth.endOf('week');
20352
- return !(0, _isAfterDay2['default'])(day, lastDayOfLastMonth);
20353
- }
20354
-
20355
- /***/ }),
20356
- /* 144 */
20357
- /***/ (function(module, exports, __webpack_require__) {
20358
-
20359
- "use strict";
20360
-
20361
-
20362
- Object.defineProperty(exports, "__esModule", {
20363
- value: true
20364
- });
20365
- exports.PureDayPicker = exports.defaultProps = undefined;
20366
-
20367
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
20368
-
20369
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
20370
-
20371
- var _object = __webpack_require__(25);
20372
-
20373
- var _object2 = _interopRequireDefault(_object);
20374
-
20375
- var _react = __webpack_require__(9);
20376
-
20377
- var _react2 = _interopRequireDefault(_react);
20378
-
20379
- var _propTypes = __webpack_require__(11);
20380
-
20381
- var _propTypes2 = _interopRequireDefault(_propTypes);
20382
-
20383
- var _reactAddonsShallowCompare = __webpack_require__(57);
20384
-
20385
- var _reactAddonsShallowCompare2 = _interopRequireDefault(_reactAddonsShallowCompare);
20386
-
20387
- var _airbnbPropTypes = __webpack_require__(22);
20388
-
20389
- var _reactWithStyles = __webpack_require__(34);
20390
-
20391
- var _moment = __webpack_require__(0);
20392
-
20393
- var _moment2 = _interopRequireDefault(_moment);
20394
-
20395
- var _throttle = __webpack_require__(412);
20396
-
20397
- var _throttle2 = _interopRequireDefault(_throttle);
20398
-
20399
- var _isTouchDevice = __webpack_require__(61);
20400
-
20401
- var _isTouchDevice2 = _interopRequireDefault(_isTouchDevice);
20402
-
20403
- var _reactOutsideClickHandler = __webpack_require__(137);
20404
-
20405
- var _reactOutsideClickHandler2 = _interopRequireDefault(_reactOutsideClickHandler);
20406
-
20407
- var _defaultPhrases = __webpack_require__(29);
20408
-
20409
- var _getPhrasePropTypes = __webpack_require__(31);
20410
-
20411
- var _getPhrasePropTypes2 = _interopRequireDefault(_getPhrasePropTypes);
20412
-
20413
- var _CalendarMonthGrid = __webpack_require__(393);
20414
-
20415
- var _CalendarMonthGrid2 = _interopRequireDefault(_CalendarMonthGrid);
20416
-
20417
- var _DayPickerNavigation = __webpack_require__(777);
20418
-
20419
- var _DayPickerNavigation2 = _interopRequireDefault(_DayPickerNavigation);
20420
-
20421
- var _DayPickerKeyboardShortcuts = __webpack_require__(780);
20422
-
20423
- var _DayPickerKeyboardShortcuts2 = _interopRequireDefault(_DayPickerKeyboardShortcuts);
20424
-
20425
- var _getNumberOfCalendarMonthWeeks = __webpack_require__(782);
20426
-
20427
- var _getNumberOfCalendarMonthWeeks2 = _interopRequireDefault(_getNumberOfCalendarMonthWeeks);
20428
-
20429
- var _getCalendarMonthWidth = __webpack_require__(394);
20430
-
20431
- var _getCalendarMonthWidth2 = _interopRequireDefault(_getCalendarMonthWidth);
20432
-
20433
- var _calculateDimension = __webpack_require__(392);
20434
-
20435
- var _calculateDimension2 = _interopRequireDefault(_calculateDimension);
20436
-
20437
- var _getActiveElement = __webpack_require__(783);
20438
-
20439
- var _getActiveElement2 = _interopRequireDefault(_getActiveElement);
20440
-
20441
- var _isDayVisible = __webpack_require__(143);
20442
-
20443
- var _isDayVisible2 = _interopRequireDefault(_isDayVisible);
20444
-
20445
- var _ModifiersShape = __webpack_require__(87);
20446
-
20447
- var _ModifiersShape2 = _interopRequireDefault(_ModifiersShape);
20448
-
20449
- var _ScrollableOrientationShape = __webpack_require__(60);
20450
-
20451
- var _ScrollableOrientationShape2 = _interopRequireDefault(_ScrollableOrientationShape);
20452
-
20453
- var _DayOfWeekShape = __webpack_require__(50);
20454
-
20455
- var _DayOfWeekShape2 = _interopRequireDefault(_DayOfWeekShape);
20456
-
20457
- var _CalendarInfoPositionShape = __webpack_require__(72);
20458
-
20459
- var _CalendarInfoPositionShape2 = _interopRequireDefault(_CalendarInfoPositionShape);
20460
-
20461
- var _constants = __webpack_require__(17);
20462
-
20463
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
20464
-
20465
- function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
20466
-
20467
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
20468
-
20469
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
20470
-
20471
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
20472
-
20473
- var MONTH_PADDING = 23;
20474
- var PREV_TRANSITION = 'prev';
20475
- var NEXT_TRANSITION = 'next';
20476
- var MONTH_SELECTION_TRANSITION = 'month_selection';
20477
- var YEAR_SELECTION_TRANSITION = 'year_selection';
20478
-
20479
- var propTypes = (0, _airbnbPropTypes.forbidExtraProps)((0, _object2['default'])({}, _reactWithStyles.withStylesPropTypes, {
20480
-
20481
- // calendar presentation props
20482
- enableOutsideDays: _propTypes2['default'].bool,
20483
- numberOfMonths: _propTypes2['default'].number,
20484
- orientation: _ScrollableOrientationShape2['default'],
20485
- withPortal: _propTypes2['default'].bool,
20486
- onOutsideClick: _propTypes2['default'].func,
20487
- hidden: _propTypes2['default'].bool,
20488
- initialVisibleMonth: _propTypes2['default'].func,
20489
- firstDayOfWeek: _DayOfWeekShape2['default'],
20490
- renderCalendarInfo: _propTypes2['default'].func,
20491
- calendarInfoPosition: _CalendarInfoPositionShape2['default'],
20492
- hideKeyboardShortcutsPanel: _propTypes2['default'].bool,
20493
- daySize: _airbnbPropTypes.nonNegativeInteger,
20494
- isRTL: _propTypes2['default'].bool,
20495
- verticalHeight: _airbnbPropTypes.nonNegativeInteger,
20496
- noBorder: _propTypes2['default'].bool,
20497
- transitionDuration: _airbnbPropTypes.nonNegativeInteger,
20498
- verticalBorderSpacing: _airbnbPropTypes.nonNegativeInteger,
20499
- horizontalMonthPadding: _airbnbPropTypes.nonNegativeInteger,
20500
-
20501
- // navigation props
20502
- navPrev: _propTypes2['default'].node,
20503
- navNext: _propTypes2['default'].node,
20504
- noNavButtons: _propTypes2['default'].bool,
20505
- onPrevMonthClick: _propTypes2['default'].func,
20506
- onNextMonthClick: _propTypes2['default'].func,
20507
- onMonthChange: _propTypes2['default'].func,
20508
- onYearChange: _propTypes2['default'].func,
20509
- onMultiplyScrollableMonths: _propTypes2['default'].func, // VERTICAL_SCROLLABLE daypickers only
20510
-
20511
- // month props
20512
- renderMonthText: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
20513
- renderMonthElement: (0, _airbnbPropTypes.mutuallyExclusiveProps)(_propTypes2['default'].func, 'renderMonthText', 'renderMonthElement'),
20514
-
20515
- // day props
20516
- modifiers: _propTypes2['default'].objectOf(_propTypes2['default'].objectOf(_ModifiersShape2['default'])),
20517
- renderCalendarDay: _propTypes2['default'].func,
20518
- renderDayContents: _propTypes2['default'].func,
20519
- onDayClick: _propTypes2['default'].func,
20520
- onDayMouseEnter: _propTypes2['default'].func,
20521
- onDayMouseLeave: _propTypes2['default'].func,
20522
-
20523
- // accessibility props
20524
- isFocused: _propTypes2['default'].bool,
20525
- getFirstFocusableDay: _propTypes2['default'].func,
20526
- onBlur: _propTypes2['default'].func,
20527
- showKeyboardShortcuts: _propTypes2['default'].bool,
20528
-
20529
- // internationalization
20530
- monthFormat: _propTypes2['default'].string,
20531
- weekDayFormat: _propTypes2['default'].string,
20532
- phrases: _propTypes2['default'].shape((0, _getPhrasePropTypes2['default'])(_defaultPhrases.DayPickerPhrases)),
20533
- dayAriaLabelFormat: _propTypes2['default'].string
20534
- }));
20535
-
20536
- var defaultProps = exports.defaultProps = {
20537
- // calendar presentation props
20538
- enableOutsideDays: false,
20539
- numberOfMonths: 2,
20540
- orientation: _constants.HORIZONTAL_ORIENTATION,
20541
- withPortal: false,
20542
- onOutsideClick: function () {
20543
- function onOutsideClick() {}
20544
-
20545
- return onOutsideClick;
20546
- }(),
20547
-
20548
- hidden: false,
20549
- initialVisibleMonth: function () {
20550
- function initialVisibleMonth() {
20551
- return (0, _moment2['default'])();
20552
- }
20553
-
20554
- return initialVisibleMonth;
20555
- }(),
20556
- firstDayOfWeek: null,
20557
- renderCalendarInfo: null,
20558
- calendarInfoPosition: _constants.INFO_POSITION_BOTTOM,
20559
- hideKeyboardShortcutsPanel: false,
20560
- daySize: _constants.DAY_SIZE,
20561
- isRTL: false,
20562
- verticalHeight: null,
20563
- noBorder: false,
20564
- transitionDuration: undefined,
20565
- verticalBorderSpacing: undefined,
20566
- horizontalMonthPadding: 13,
20567
-
20568
- // navigation props
20569
- navPrev: null,
20570
- navNext: null,
20571
- noNavButtons: false,
20572
- onPrevMonthClick: function () {
20573
- function onPrevMonthClick() {}
20574
-
20575
- return onPrevMonthClick;
20576
- }(),
20577
- onNextMonthClick: function () {
20578
- function onNextMonthClick() {}
20579
-
20580
- return onNextMonthClick;
20581
- }(),
20582
- onMonthChange: function () {
20583
- function onMonthChange() {}
20584
-
20585
- return onMonthChange;
20586
- }(),
20587
- onYearChange: function () {
20588
- function onYearChange() {}
20589
-
20590
- return onYearChange;
20591
- }(),
20592
- onMultiplyScrollableMonths: function () {
20593
- function onMultiplyScrollableMonths() {}
20594
-
20595
- return onMultiplyScrollableMonths;
20596
- }(),
20597
-
20598
-
20599
- // month props
20600
- renderMonthText: null,
20601
- renderMonthElement: null,
20602
-
20603
- // day props
20604
- modifiers: {},
20605
- renderCalendarDay: undefined,
20606
- renderDayContents: null,
20607
- onDayClick: function () {
20608
- function onDayClick() {}
20609
-
20610
- return onDayClick;
20611
- }(),
20612
- onDayMouseEnter: function () {
20613
- function onDayMouseEnter() {}
20614
-
20615
- return onDayMouseEnter;
20616
- }(),
20617
- onDayMouseLeave: function () {
20618
- function onDayMouseLeave() {}
20619
-
20620
- return onDayMouseLeave;
20621
- }(),
20622
-
20623
-
20624
- // accessibility props
20625
- isFocused: false,
20626
- getFirstFocusableDay: null,
20627
- onBlur: function () {
20628
- function onBlur() {}
20629
-
20630
- return onBlur;
20631
- }(),
20632
-
20633
- showKeyboardShortcuts: false,
20634
-
20635
- // internationalization
20636
- monthFormat: 'MMMM YYYY',
20637
- weekDayFormat: 'dd',
20638
- phrases: _defaultPhrases.DayPickerPhrases,
20639
- dayAriaLabelFormat: undefined
20640
- };
20641
-
20642
- var DayPicker = function (_React$Component) {
20643
- _inherits(DayPicker, _React$Component);
20644
-
20645
- function DayPicker(props) {
20646
- _classCallCheck(this, DayPicker);
20647
-
20648
- var _this = _possibleConstructorReturn(this, (DayPicker.__proto__ || Object.getPrototypeOf(DayPicker)).call(this, props));
20649
-
20650
- var currentMonth = props.hidden ? (0, _moment2['default'])() : props.initialVisibleMonth();
20651
-
20652
- var focusedDate = currentMonth.clone().startOf('month');
20653
- if (props.getFirstFocusableDay) {
20654
- focusedDate = props.getFirstFocusableDay(currentMonth);
20655
- }
20656
-
20657
- var horizontalMonthPadding = props.horizontalMonthPadding;
20658
-
20659
-
20660
- var translationValue = props.isRTL && _this.isHorizontal() ? -(0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding) : 0;
20661
-
20662
- _this.hasSetInitialVisibleMonth = !props.hidden;
20663
- _this.state = {
20664
- currentMonth: currentMonth,
20665
- monthTransition: null,
20666
- translationValue: translationValue,
20667
- scrollableMonthMultiple: 1,
20668
- calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(props.daySize, horizontalMonthPadding),
20669
- focusedDate: !props.hidden || props.isFocused ? focusedDate : null,
20670
- nextFocusedDate: null,
20671
- showKeyboardShortcuts: props.showKeyboardShortcuts,
20672
- onKeyboardShortcutsPanelClose: function () {
20673
- function onKeyboardShortcutsPanelClose() {}
20674
-
20675
- return onKeyboardShortcutsPanelClose;
20676
- }(),
20677
-
20678
- isTouchDevice: (0, _isTouchDevice2['default'])(),
20679
- withMouseInteractions: true,
20680
- calendarInfoWidth: 0,
20681
- monthTitleHeight: null,
20682
- hasSetHeight: false
20683
- };
20684
-
20685
- _this.setCalendarMonthWeeks(currentMonth);
20686
-
20687
- _this.calendarMonthGridHeight = 0;
20688
- _this.setCalendarInfoWidthTimeout = null;
20689
-
20690
- _this.onKeyDown = _this.onKeyDown.bind(_this);
20691
- _this.throttledKeyDown = (0, _throttle2['default'])(_this.onFinalKeyDown, 200, { trailing: false });
20692
- _this.onPrevMonthClick = _this.onPrevMonthClick.bind(_this);
20693
- _this.onNextMonthClick = _this.onNextMonthClick.bind(_this);
20694
- _this.onMonthChange = _this.onMonthChange.bind(_this);
20695
- _this.onYearChange = _this.onYearChange.bind(_this);
20696
-
20697
- _this.multiplyScrollableMonths = _this.multiplyScrollableMonths.bind(_this);
20698
- _this.updateStateAfterMonthTransition = _this.updateStateAfterMonthTransition.bind(_this);
20699
-
20700
- _this.openKeyboardShortcutsPanel = _this.openKeyboardShortcutsPanel.bind(_this);
20701
- _this.closeKeyboardShortcutsPanel = _this.closeKeyboardShortcutsPanel.bind(_this);
20702
-
20703
- _this.setCalendarInfoRef = _this.setCalendarInfoRef.bind(_this);
20704
- _this.setContainerRef = _this.setContainerRef.bind(_this);
20705
- _this.setTransitionContainerRef = _this.setTransitionContainerRef.bind(_this);
20706
- _this.setMonthTitleHeight = _this.setMonthTitleHeight.bind(_this);
20707
- return _this;
20708
- }
20709
-
20710
- _createClass(DayPicker, [{
20711
- key: 'componentDidMount',
20712
- value: function () {
20713
- function componentDidMount() {
20714
- var currentMonth = this.state.currentMonth;
20715
-
20716
- if (this.calendarInfo) {
20717
- this.setState({
20718
- isTouchDevice: (0, _isTouchDevice2['default'])(),
20719
- calendarInfoWidth: (0, _calculateDimension2['default'])(this.calendarInfo, 'width', true, true)
20720
- });
20721
- } else {
20722
- this.setState({ isTouchDevice: (0, _isTouchDevice2['default'])() });
20723
- }
20724
-
20725
- this.setCalendarMonthWeeks(currentMonth);
20726
- }
20727
-
20728
- return componentDidMount;
20729
- }()
20730
- }, {
20731
- key: 'componentWillReceiveProps',
20732
- value: function () {
20733
- function componentWillReceiveProps(nextProps) {
20734
- var hidden = nextProps.hidden,
20735
- isFocused = nextProps.isFocused,
20736
- showKeyboardShortcuts = nextProps.showKeyboardShortcuts,
20737
- onBlur = nextProps.onBlur,
20738
- renderMonthText = nextProps.renderMonthText,
20739
- horizontalMonthPadding = nextProps.horizontalMonthPadding;
20740
- var currentMonth = this.state.currentMonth;
20741
-
20742
-
20743
- if (!hidden) {
20744
- if (!this.hasSetInitialVisibleMonth) {
20745
- this.hasSetInitialVisibleMonth = true;
20746
- this.setState({
20747
- currentMonth: nextProps.initialVisibleMonth()
20748
- });
20749
- }
20750
- }
20751
-
20752
- var _props = this.props,
20753
- daySize = _props.daySize,
20754
- prevIsFocused = _props.isFocused,
20755
- prevRenderMonthText = _props.renderMonthText;
20756
-
20757
-
20758
- if (nextProps.daySize !== daySize) {
20759
- this.setState({
20760
- calendarMonthWidth: (0, _getCalendarMonthWidth2['default'])(nextProps.daySize, horizontalMonthPadding)
20761
- });
20762
- }
20763
-
20764
- if (isFocused !== prevIsFocused) {
20765
- if (isFocused) {
20766
- var focusedDate = this.getFocusedDay(currentMonth);
20767
-
20768
- var onKeyboardShortcutsPanelClose = this.state.onKeyboardShortcutsPanelClose;
20769
-
20770
- if (nextProps.showKeyboardShortcuts) {
20771
- // the ? shortcut came from the input and we should return input there once it is close
20772
- onKeyboardShortcutsPanelClose = onBlur;
20773
- }
20774
-
20775
- this.setState({
20776
- showKeyboardShortcuts: showKeyboardShortcuts,
20777
- onKeyboardShortcutsPanelClose: onKeyboardShortcutsPanelClose,
20778
- focusedDate: focusedDate,
20779
- withMouseInteractions: false
20780
- });
20781
- } else {
20782
- this.setState({ focusedDate: null });
20783
- }
20784
- }
20785
-
20786
- if (renderMonthText !== prevRenderMonthText) {
20787
- this.setState({
20788
- monthTitleHeight: null
20789
- });
20790
- }
20791
- }
20792
-
20793
- return componentWillReceiveProps;
20794
- }()
20795
- }, {
20796
- key: 'shouldComponentUpdate',
20797
- value: function () {
20798
- function shouldComponentUpdate(nextProps, nextState) {
20799
- return (0, _reactAddonsShallowCompare2['default'])(this, nextProps, nextState);
20800
- }
20801
-
20802
- return shouldComponentUpdate;
20803
- }()
20804
- }, {
20805
- key: 'componentWillUpdate',
20806
- value: function () {
20807
- function componentWillUpdate() {
20808
- var _this2 = this;
20809
-
20810
- var transitionDuration = this.props.transitionDuration;
20811
-
20812
- // Calculating the dimensions trigger a DOM repaint which
20813
- // breaks the CSS transition.
20814
- // The setTimeout will wait until the transition ends.
20815
-
20816
- if (this.calendarInfo) {
20817
- this.setCalendarInfoWidthTimeout = setTimeout(function () {
20818
- var calendarInfoWidth = _this2.state.calendarInfoWidth;
20819
-
20820
- var calendarInfoPanelWidth = (0, _calculateDimension2['default'])(_this2.calendarInfo, 'width', true, true);
20821
- if (calendarInfoWidth !== calendarInfoPanelWidth) {
20822
- _this2.setState({
20823
- calendarInfoWidth: calendarInfoPanelWidth
20824
- });
20825
- }
20826
- }, transitionDuration);
20827
- }
20828
- }
20829
-
20830
- return componentWillUpdate;
20831
- }()
20832
- }, {
20833
- key: 'componentDidUpdate',
20834
- value: function () {
20835
- function componentDidUpdate(prevProps) {
20836
- var _props2 = this.props,
20837
- orientation = _props2.orientation,
20838
- daySize = _props2.daySize,
20839
- isFocused = _props2.isFocused,
20840
- numberOfMonths = _props2.numberOfMonths;
20841
- var _state = this.state,
20842
- focusedDate = _state.focusedDate,
20843
- monthTitleHeight = _state.monthTitleHeight;
20844
-
20845
-
20846
- if (this.isHorizontal() && (orientation !== prevProps.orientation || daySize !== prevProps.daySize)) {
20847
- var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1);
20848
- var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
20849
- var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1;
20850
- this.adjustDayPickerHeight(newMonthHeight);
20851
- }
20852
-
20853
- if (!prevProps.isFocused && isFocused && !focusedDate) {
20854
- this.container.focus();
20855
- }
20856
- }
20857
-
20858
- return componentDidUpdate;
20859
- }()
20860
- }, {
20861
- key: 'componentWillUnmount',
20862
- value: function () {
20863
- function componentWillUnmount() {
20864
- clearTimeout(this.setCalendarInfoWidthTimeout);
20865
- }
20866
-
20867
- return componentWillUnmount;
20868
- }()
20869
- }, {
20870
- key: 'onKeyDown',
20871
- value: function () {
20872
- function onKeyDown(e) {
20873
- e.stopPropagation();
20874
- if (!_constants.MODIFIER_KEY_NAMES.has(e.key)) {
20875
- this.throttledKeyDown(e);
20876
- }
20877
- }
20878
-
20879
- return onKeyDown;
20880
- }()
20881
- }, {
20882
- key: 'onFinalKeyDown',
20883
- value: function () {
20884
- function onFinalKeyDown(e) {
20885
- this.setState({ withMouseInteractions: false });
20886
-
20887
- var _props3 = this.props,
20888
- onBlur = _props3.onBlur,
20889
- isRTL = _props3.isRTL;
20890
- var _state2 = this.state,
20891
- focusedDate = _state2.focusedDate,
20892
- showKeyboardShortcuts = _state2.showKeyboardShortcuts;
20893
-
20894
- if (!focusedDate) return;
20895
-
20896
- var newFocusedDate = focusedDate.clone();
20897
-
20898
- var didTransitionMonth = false;
20899
-
20900
- // focus might be anywhere when the keyboard shortcuts panel is opened so we want to
20901
- // return it to wherever it was before when the panel was opened
20902
- var activeElement = (0, _getActiveElement2['default'])();
20903
- var onKeyboardShortcutsPanelClose = function () {
20904
- function onKeyboardShortcutsPanelClose() {
20905
- if (activeElement) activeElement.focus();
20906
- }
20907
-
20908
- return onKeyboardShortcutsPanelClose;
20909
- }();
20910
-
20911
- switch (e.key) {
20912
- case 'ArrowUp':
20913
- e.preventDefault();
20914
- newFocusedDate.subtract(1, 'week');
20915
- didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
20916
- break;
20917
- case 'ArrowLeft':
20918
- e.preventDefault();
20919
- if (isRTL) {
20920
- newFocusedDate.add(1, 'day');
20921
- } else {
20922
- newFocusedDate.subtract(1, 'day');
20923
- }
20924
- didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
20925
- break;
20926
- case 'Home':
20927
- e.preventDefault();
20928
- newFocusedDate.startOf('week');
20929
- didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
20930
- break;
20931
- case 'PageUp':
20932
- e.preventDefault();
20933
- newFocusedDate.subtract(1, 'month');
20934
- didTransitionMonth = this.maybeTransitionPrevMonth(newFocusedDate);
20935
- break;
20936
-
20937
- case 'ArrowDown':
20938
- e.preventDefault();
20939
- newFocusedDate.add(1, 'week');
20940
- didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
20941
- break;
20942
- case 'ArrowRight':
20943
- e.preventDefault();
20944
- if (isRTL) {
20945
- newFocusedDate.subtract(1, 'day');
20946
- } else {
20947
- newFocusedDate.add(1, 'day');
20948
- }
20949
- didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
20950
- break;
20951
- case 'End':
20952
- e.preventDefault();
20953
- newFocusedDate.endOf('week');
20954
- didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
20955
- break;
20956
- case 'PageDown':
20957
- e.preventDefault();
20958
- newFocusedDate.add(1, 'month');
20959
- didTransitionMonth = this.maybeTransitionNextMonth(newFocusedDate);
20960
- break;
20961
-
20962
- case '?':
20963
- this.openKeyboardShortcutsPanel(onKeyboardShortcutsPanelClose);
20964
- break;
20965
-
20966
- case 'Escape':
20967
- if (showKeyboardShortcuts) {
20968
- this.closeKeyboardShortcutsPanel();
20969
- } else {
20970
- onBlur();
20971
- }
20972
- break;
20973
-
20974
- default:
20975
- break;
20976
- }
20977
-
20978
- // If there was a month transition, do not update the focused date until the transition has
20979
- // completed. Otherwise, attempting to focus on a DOM node may interrupt the CSS animation. If
20980
- // didTransitionMonth is true, the focusedDate gets updated in #updateStateAfterMonthTransition
20981
- if (!didTransitionMonth) {
20982
- this.setState({
20983
- focusedDate: newFocusedDate
20984
- });
20985
- }
20986
- }
20987
-
20988
- return onFinalKeyDown;
20989
- }()
20990
- }, {
20991
- key: 'onPrevMonthClick',
20992
- value: function () {
20993
- function onPrevMonthClick(nextFocusedDate, e) {
20994
- var _props4 = this.props,
20995
- daySize = _props4.daySize,
20996
- isRTL = _props4.isRTL,
20997
- numberOfMonths = _props4.numberOfMonths;
20998
- var _state3 = this.state,
20999
- calendarMonthWidth = _state3.calendarMonthWidth,
21000
- monthTitleHeight = _state3.monthTitleHeight;
21001
-
21002
-
21003
- if (e) e.preventDefault();
21004
-
21005
- var translationValue = void 0;
21006
- if (this.isVertical()) {
21007
- var calendarMonthWeeksHeight = this.calendarMonthWeeks[0] * (daySize - 1);
21008
- translationValue = monthTitleHeight + calendarMonthWeeksHeight + 1;
21009
- } else if (this.isHorizontal()) {
21010
- translationValue = calendarMonthWidth;
21011
- if (isRTL) {
21012
- translationValue = -2 * calendarMonthWidth;
21013
- }
21014
-
21015
- var visibleCalendarWeeks = this.calendarMonthWeeks.slice(0, numberOfMonths);
21016
- var _calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
21017
- var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight + 1;
21018
- this.adjustDayPickerHeight(newMonthHeight);
21019
- }
21020
-
21021
- this.setState({
21022
- monthTransition: PREV_TRANSITION,
21023
- translationValue: translationValue,
21024
- focusedDate: null,
21025
- nextFocusedDate: nextFocusedDate
21026
- });
21027
- }
21028
-
21029
- return onPrevMonthClick;
21030
- }()
21031
- }, {
21032
- key: 'onMonthChange',
21033
- value: function () {
21034
- function onMonthChange(currentMonth) {
21035
- this.setCalendarMonthWeeks(currentMonth);
21036
- this.calculateAndSetDayPickerHeight();
21037
-
21038
- // Translation value is a hack to force an invisible transition that
21039
- // properly rerenders the CalendarMonthGrid
21040
- this.setState({
21041
- monthTransition: MONTH_SELECTION_TRANSITION,
21042
- translationValue: 0.00001,
21043
- focusedDate: null,
21044
- nextFocusedDate: currentMonth,
21045
- currentMonth: currentMonth
21046
- });
21047
- }
21048
-
21049
- return onMonthChange;
21050
- }()
21051
- }, {
21052
- key: 'onYearChange',
21053
- value: function () {
21054
- function onYearChange(currentMonth) {
21055
- this.setCalendarMonthWeeks(currentMonth);
21056
- this.calculateAndSetDayPickerHeight();
21057
-
21058
- // Translation value is a hack to force an invisible transition that
21059
- // properly rerenders the CalendarMonthGrid
21060
- this.setState({
21061
- monthTransition: YEAR_SELECTION_TRANSITION,
21062
- translationValue: 0.0001,
21063
- focusedDate: null,
21064
- nextFocusedDate: currentMonth,
21065
- currentMonth: currentMonth
21066
- });
21067
- }
21068
-
21069
- return onYearChange;
21070
- }()
21071
- }, {
21072
- key: 'onNextMonthClick',
21073
- value: function () {
21074
- function onNextMonthClick(nextFocusedDate, e) {
21075
- var _props5 = this.props,
21076
- isRTL = _props5.isRTL,
21077
- numberOfMonths = _props5.numberOfMonths,
21078
- daySize = _props5.daySize;
21079
- var _state4 = this.state,
21080
- calendarMonthWidth = _state4.calendarMonthWidth,
21081
- monthTitleHeight = _state4.monthTitleHeight;
21082
-
21083
-
21084
- if (e) e.preventDefault();
21085
-
21086
- var translationValue = void 0;
21087
-
21088
- if (this.isVertical()) {
21089
- var firstVisibleMonthWeeks = this.calendarMonthWeeks[1];
21090
- var calendarMonthWeeksHeight = firstVisibleMonthWeeks * (daySize - 1);
21091
- translationValue = -(monthTitleHeight + calendarMonthWeeksHeight + 1);
21092
- }
21093
-
21094
- if (this.isHorizontal()) {
21095
- translationValue = -calendarMonthWidth;
21096
- if (isRTL) {
21097
- translationValue = 0;
21098
- }
21099
-
21100
- var visibleCalendarWeeks = this.calendarMonthWeeks.slice(2, numberOfMonths + 2);
21101
- var _calendarMonthWeeksHeight2 = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
21102
- var newMonthHeight = monthTitleHeight + _calendarMonthWeeksHeight2 + 1;
21103
- this.adjustDayPickerHeight(newMonthHeight);
21104
- }
21105
-
21106
- this.setState({
21107
- monthTransition: NEXT_TRANSITION,
21108
- translationValue: translationValue,
21109
- focusedDate: null,
21110
- nextFocusedDate: nextFocusedDate
21111
- });
21112
- }
21113
-
21114
- return onNextMonthClick;
21115
- }()
21116
- }, {
21117
- key: 'getFirstDayOfWeek',
21118
- value: function () {
21119
- function getFirstDayOfWeek() {
21120
- var firstDayOfWeek = this.props.firstDayOfWeek;
21121
-
21122
- if (firstDayOfWeek == null) {
21123
- return _moment2['default'].localeData().firstDayOfWeek();
21124
- }
21125
-
21126
- return firstDayOfWeek;
21127
- }
21128
-
21129
- return getFirstDayOfWeek;
21130
- }()
21131
- }, {
21132
- key: 'getFirstVisibleIndex',
21133
- value: function () {
21134
- function getFirstVisibleIndex() {
21135
- var orientation = this.props.orientation;
21136
- var monthTransition = this.state.monthTransition;
21137
-
21138
-
21139
- if (orientation === _constants.VERTICAL_SCROLLABLE) return 0;
21140
-
21141
- var firstVisibleMonthIndex = 1;
21142
- if (monthTransition === PREV_TRANSITION) {
21143
- firstVisibleMonthIndex -= 1;
21144
- } else if (monthTransition === NEXT_TRANSITION) {
21145
- firstVisibleMonthIndex += 1;
21146
- }
21147
-
21148
- return firstVisibleMonthIndex;
21149
- }
21150
-
21151
- return getFirstVisibleIndex;
21152
- }()
21153
- }, {
21154
- key: 'getFocusedDay',
21155
- value: function () {
21156
- function getFocusedDay(newMonth) {
21157
- var _props6 = this.props,
21158
- getFirstFocusableDay = _props6.getFirstFocusableDay,
21159
- numberOfMonths = _props6.numberOfMonths;
21160
-
21161
-
21162
- var focusedDate = void 0;
21163
- if (getFirstFocusableDay) {
21164
- focusedDate = getFirstFocusableDay(newMonth);
21165
- }
21166
-
21167
- if (newMonth && (!focusedDate || !(0, _isDayVisible2['default'])(focusedDate, newMonth, numberOfMonths))) {
21168
- focusedDate = newMonth.clone().startOf('month');
21169
- }
21170
-
21171
- return focusedDate;
21172
- }
21173
-
21174
- return getFocusedDay;
21175
- }()
21176
- }, {
21177
- key: 'setMonthTitleHeight',
21178
- value: function () {
21179
- function setMonthTitleHeight(monthTitleHeight) {
21180
- var _this3 = this;
21181
-
21182
- this.setState({
21183
- monthTitleHeight: monthTitleHeight
21184
- }, function () {
21185
- _this3.calculateAndSetDayPickerHeight();
21186
- });
21187
- }
21188
-
21189
- return setMonthTitleHeight;
21190
- }()
21191
- }, {
21192
- key: 'setCalendarMonthWeeks',
21193
- value: function () {
21194
- function setCalendarMonthWeeks(currentMonth) {
21195
- var numberOfMonths = this.props.numberOfMonths;
21196
-
21197
-
21198
- this.calendarMonthWeeks = [];
21199
- var month = currentMonth.clone().subtract(1, 'months');
21200
- var firstDayOfWeek = this.getFirstDayOfWeek();
21201
- for (var i = 0; i < numberOfMonths + 2; i += 1) {
21202
- var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(month, firstDayOfWeek);
21203
- this.calendarMonthWeeks.push(numberOfWeeks);
21204
- month = month.add(1, 'months');
21205
- }
21206
- }
21207
-
21208
- return setCalendarMonthWeeks;
21209
- }()
21210
- }, {
21211
- key: 'setContainerRef',
21212
- value: function () {
21213
- function setContainerRef(ref) {
21214
- this.container = ref;
21215
- }
21216
-
21217
- return setContainerRef;
21218
- }()
21219
- }, {
21220
- key: 'setCalendarInfoRef',
21221
- value: function () {
21222
- function setCalendarInfoRef(ref) {
21223
- this.calendarInfo = ref;
21224
- }
21225
-
21226
- return setCalendarInfoRef;
21227
- }()
21228
- }, {
21229
- key: 'setTransitionContainerRef',
21230
- value: function () {
21231
- function setTransitionContainerRef(ref) {
21232
- this.transitionContainer = ref;
21233
- }
21234
-
21235
- return setTransitionContainerRef;
21236
- }()
21237
- }, {
21238
- key: 'maybeTransitionNextMonth',
21239
- value: function () {
21240
- function maybeTransitionNextMonth(newFocusedDate) {
21241
- var numberOfMonths = this.props.numberOfMonths;
21242
- var _state5 = this.state,
21243
- currentMonth = _state5.currentMonth,
21244
- focusedDate = _state5.focusedDate;
21245
-
21246
-
21247
- var newFocusedDateMonth = newFocusedDate.month();
21248
- var focusedDateMonth = focusedDate.month();
21249
- var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths);
21250
- if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) {
21251
- this.onNextMonthClick(newFocusedDate);
21252
- return true;
21253
- }
21254
-
21255
- return false;
21256
- }
21257
-
21258
- return maybeTransitionNextMonth;
21259
- }()
21260
- }, {
21261
- key: 'maybeTransitionPrevMonth',
21262
- value: function () {
21263
- function maybeTransitionPrevMonth(newFocusedDate) {
21264
- var numberOfMonths = this.props.numberOfMonths;
21265
- var _state6 = this.state,
21266
- currentMonth = _state6.currentMonth,
21267
- focusedDate = _state6.focusedDate;
21268
-
21269
-
21270
- var newFocusedDateMonth = newFocusedDate.month();
21271
- var focusedDateMonth = focusedDate.month();
21272
- var isNewFocusedDateVisible = (0, _isDayVisible2['default'])(newFocusedDate, currentMonth, numberOfMonths);
21273
- if (newFocusedDateMonth !== focusedDateMonth && !isNewFocusedDateVisible) {
21274
- this.onPrevMonthClick(newFocusedDate);
21275
- return true;
21276
- }
21277
-
21278
- return false;
21279
- }
21280
-
21281
- return maybeTransitionPrevMonth;
21282
- }()
21283
- }, {
21284
- key: 'multiplyScrollableMonths',
21285
- value: function () {
21286
- function multiplyScrollableMonths(e) {
21287
- var onMultiplyScrollableMonths = this.props.onMultiplyScrollableMonths;
21288
-
21289
- if (e) e.preventDefault();
21290
-
21291
- if (onMultiplyScrollableMonths) onMultiplyScrollableMonths(e);
21292
-
21293
- this.setState(function (_ref) {
21294
- var scrollableMonthMultiple = _ref.scrollableMonthMultiple;
21295
- return {
21296
- scrollableMonthMultiple: scrollableMonthMultiple + 1
21297
- };
21298
- });
21299
- }
21300
-
21301
- return multiplyScrollableMonths;
21302
- }()
21303
- }, {
21304
- key: 'isHorizontal',
21305
- value: function () {
21306
- function isHorizontal() {
21307
- var orientation = this.props.orientation;
21308
-
21309
- return orientation === _constants.HORIZONTAL_ORIENTATION;
21310
- }
21311
-
21312
- return isHorizontal;
21313
- }()
21314
- }, {
21315
- key: 'isVertical',
21316
- value: function () {
21317
- function isVertical() {
21318
- var orientation = this.props.orientation;
21319
-
21320
- return orientation === _constants.VERTICAL_ORIENTATION || orientation === _constants.VERTICAL_SCROLLABLE;
21321
- }
21322
-
21323
- return isVertical;
21324
- }()
21325
- }, {
21326
- key: 'updateStateAfterMonthTransition',
21327
- value: function () {
21328
- function updateStateAfterMonthTransition() {
21329
- var _this4 = this;
21330
-
21331
- var _props7 = this.props,
21332
- onPrevMonthClick = _props7.onPrevMonthClick,
21333
- onNextMonthClick = _props7.onNextMonthClick,
21334
- numberOfMonths = _props7.numberOfMonths,
21335
- onMonthChange = _props7.onMonthChange,
21336
- onYearChange = _props7.onYearChange,
21337
- isRTL = _props7.isRTL;
21338
- var _state7 = this.state,
21339
- currentMonth = _state7.currentMonth,
21340
- monthTransition = _state7.monthTransition,
21341
- focusedDate = _state7.focusedDate,
21342
- nextFocusedDate = _state7.nextFocusedDate,
21343
- withMouseInteractions = _state7.withMouseInteractions,
21344
- calendarMonthWidth = _state7.calendarMonthWidth;
21345
-
21346
-
21347
- if (!monthTransition) return;
21348
-
21349
- var newMonth = currentMonth.clone();
21350
- var firstDayOfWeek = this.getFirstDayOfWeek();
21351
- if (monthTransition === PREV_TRANSITION) {
21352
- newMonth.subtract(1, 'month');
21353
- if (onPrevMonthClick) onPrevMonthClick(newMonth);
21354
- var newInvisibleMonth = newMonth.clone().subtract(1, 'month');
21355
- var numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(newInvisibleMonth, firstDayOfWeek);
21356
- this.calendarMonthWeeks = [numberOfWeeks].concat(_toConsumableArray(this.calendarMonthWeeks.slice(0, -1)));
21357
- } else if (monthTransition === NEXT_TRANSITION) {
21358
- newMonth.add(1, 'month');
21359
- if (onNextMonthClick) onNextMonthClick(newMonth);
21360
- var _newInvisibleMonth = newMonth.clone().add(numberOfMonths, 'month');
21361
- var _numberOfWeeks = (0, _getNumberOfCalendarMonthWeeks2['default'])(_newInvisibleMonth, firstDayOfWeek);
21362
- this.calendarMonthWeeks = [].concat(_toConsumableArray(this.calendarMonthWeeks.slice(1)), [_numberOfWeeks]);
21363
- } else if (monthTransition === MONTH_SELECTION_TRANSITION) {
21364
- if (onMonthChange) onMonthChange(newMonth);
21365
- } else if (monthTransition === YEAR_SELECTION_TRANSITION) {
21366
- if (onYearChange) onYearChange(newMonth);
21367
- }
21368
-
21369
- var newFocusedDate = null;
21370
- if (nextFocusedDate) {
21371
- newFocusedDate = nextFocusedDate;
21372
- } else if (!focusedDate && !withMouseInteractions) {
21373
- newFocusedDate = this.getFocusedDay(newMonth);
21374
- }
21375
-
21376
- this.setState({
21377
- currentMonth: newMonth,
21378
- monthTransition: null,
21379
- translationValue: isRTL && this.isHorizontal() ? -calendarMonthWidth : 0,
21380
- nextFocusedDate: null,
21381
- focusedDate: newFocusedDate
21382
- }, function () {
21383
- // we don't want to focus on the relevant calendar day after a month transition
21384
- // if the user is navigating around using a mouse
21385
- if (withMouseInteractions) {
21386
- var activeElement = (0, _getActiveElement2['default'])();
21387
- if (activeElement && activeElement !== document.body && _this4.container.contains(activeElement)) {
21388
- activeElement.blur();
21389
- }
21390
- }
21391
- });
21392
- }
21393
-
21394
- return updateStateAfterMonthTransition;
21395
- }()
21396
- }, {
21397
- key: 'adjustDayPickerHeight',
21398
- value: function () {
21399
- function adjustDayPickerHeight(newMonthHeight) {
21400
- var _this5 = this;
21401
-
21402
- var monthHeight = newMonthHeight + MONTH_PADDING;
21403
- if (monthHeight !== this.calendarMonthGridHeight) {
21404
- this.transitionContainer.style.height = String(monthHeight) + 'px';
21405
- if (!this.calendarMonthGridHeight) {
21406
- setTimeout(function () {
21407
- _this5.setState({ hasSetHeight: true });
21408
- }, 0);
21409
- }
21410
- this.calendarMonthGridHeight = monthHeight;
21411
- }
21412
- }
21413
-
21414
- return adjustDayPickerHeight;
21415
- }()
21416
- }, {
21417
- key: 'calculateAndSetDayPickerHeight',
21418
- value: function () {
21419
- function calculateAndSetDayPickerHeight() {
21420
- var _props8 = this.props,
21421
- daySize = _props8.daySize,
21422
- numberOfMonths = _props8.numberOfMonths;
21423
- var monthTitleHeight = this.state.monthTitleHeight;
21424
-
21425
-
21426
- var visibleCalendarWeeks = this.calendarMonthWeeks.slice(1, numberOfMonths + 1);
21427
- var calendarMonthWeeksHeight = Math.max.apply(Math, [0].concat(_toConsumableArray(visibleCalendarWeeks))) * (daySize - 1);
21428
- var newMonthHeight = monthTitleHeight + calendarMonthWeeksHeight + 1;
21429
-
21430
- if (this.isHorizontal()) {
21431
- this.adjustDayPickerHeight(newMonthHeight);
21432
- }
21433
- }
21434
-
21435
- return calculateAndSetDayPickerHeight;
21436
- }()
21437
- }, {
21438
- key: 'openKeyboardShortcutsPanel',
21439
- value: function () {
21440
- function openKeyboardShortcutsPanel(onCloseCallBack) {
21441
- this.setState({
21442
- showKeyboardShortcuts: true,
21443
- onKeyboardShortcutsPanelClose: onCloseCallBack
21444
- });
21445
- }
21446
-
21447
- return openKeyboardShortcutsPanel;
21448
- }()
21449
- }, {
21450
- key: 'closeKeyboardShortcutsPanel',
21451
- value: function () {
21452
- function closeKeyboardShortcutsPanel() {
21453
- var onKeyboardShortcutsPanelClose = this.state.onKeyboardShortcutsPanelClose;
21454
-
21455
-
21456
- if (onKeyboardShortcutsPanelClose) {
21457
- onKeyboardShortcutsPanelClose();
21458
- }
21459
-
21460
- this.setState({
21461
- onKeyboardShortcutsPanelClose: null,
21462
- showKeyboardShortcuts: false
21463
- });
21464
- }
21465
-
21466
- return closeKeyboardShortcutsPanel;
21467
- }()
21468
- }, {
21469
- key: 'renderNavigation',
21470
- value: function () {
21471
- function renderNavigation() {
21472
- var _this6 = this;
21473
-
21474
- var _props9 = this.props,
21475
- navPrev = _props9.navPrev,
21476
- navNext = _props9.navNext,
21477
- noNavButtons = _props9.noNavButtons,
21478
- orientation = _props9.orientation,
21479
- phrases = _props9.phrases,
21480
- isRTL = _props9.isRTL;
21481
-
21482
-
21483
- if (noNavButtons) {
21484
- return null;
21485
- }
21486
-
21487
- var onNextMonthClick = void 0;
21488
- if (orientation === _constants.VERTICAL_SCROLLABLE) {
21489
- onNextMonthClick = this.multiplyScrollableMonths;
21490
- } else {
21491
- onNextMonthClick = function () {
21492
- function onNextMonthClick(e) {
21493
- _this6.onNextMonthClick(null, e);
21494
- }
21495
-
21496
- return onNextMonthClick;
21497
- }();
21498
- }
21499
-
21500
- return _react2['default'].createElement(_DayPickerNavigation2['default'], {
21501
- onPrevMonthClick: function () {
21502
- function onPrevMonthClick(e) {
21503
- _this6.onPrevMonthClick(null, e);
21504
- }
21505
-
21506
- return onPrevMonthClick;
21507
- }(),
21508
- onNextMonthClick: onNextMonthClick,
21509
- navPrev: navPrev,
21510
- navNext: navNext,
21511
- orientation: orientation,
21512
- phrases: phrases,
21513
- isRTL: isRTL
21514
- });
21515
- }
21516
-
21517
- return renderNavigation;
21518
- }()
21519
- }, {
21520
- key: 'renderWeekHeader',
21521
- value: function () {
21522
- function renderWeekHeader(index) {
21523
- var _props10 = this.props,
21524
- daySize = _props10.daySize,
21525
- horizontalMonthPadding = _props10.horizontalMonthPadding,
21526
- orientation = _props10.orientation,
21527
- weekDayFormat = _props10.weekDayFormat,
21528
- styles = _props10.styles;
21529
- var calendarMonthWidth = this.state.calendarMonthWidth;
21530
-
21531
- var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
21532
- var horizontalStyle = {
21533
- left: index * calendarMonthWidth
21534
- };
21535
- var verticalStyle = {
21536
- marginLeft: -calendarMonthWidth / 2
21537
- };
21538
-
21539
- var weekHeaderStyle = {}; // no styles applied to the vertical-scrollable orientation
21540
- if (this.isHorizontal()) {
21541
- weekHeaderStyle = horizontalStyle;
21542
- } else if (this.isVertical() && !verticalScrollable) {
21543
- weekHeaderStyle = verticalStyle;
21544
- }
21545
-
21546
- var firstDayOfWeek = this.getFirstDayOfWeek();
21547
-
21548
- var header = [];
21549
- for (var i = 0; i < 7; i += 1) {
21550
- header.push(_react2['default'].createElement(
21551
- 'li',
21552
- _extends({ key: i }, (0, _reactWithStyles.css)(styles.DayPicker_weekHeader_li, { width: daySize })),
21553
- _react2['default'].createElement(
21554
- 'small',
21555
- null,
21556
- (0, _moment2['default'])().day((i + firstDayOfWeek) % 7).format(weekDayFormat)
21557
- )
21558
- ));
21559
- }
21560
-
21561
- return _react2['default'].createElement(
21562
- 'div',
21563
- _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeader, this.isVertical() && styles.DayPicker_weekHeader__vertical, verticalScrollable && styles.DayPicker_weekHeader__verticalScrollable, weekHeaderStyle, { padding: '0 ' + String(horizontalMonthPadding) + 'px' }), {
21564
- key: 'week-' + String(index)
21565
- }),
21566
- _react2['default'].createElement(
21567
- 'ul',
21568
- (0, _reactWithStyles.css)(styles.DayPicker_weekHeader_ul),
21569
- header
21570
- )
21571
- );
21572
- }
21573
-
21574
- return renderWeekHeader;
21575
- }()
21576
- }, {
21577
- key: 'render',
21578
- value: function () {
21579
- function render() {
21580
- var _this7 = this;
21581
-
21582
- var _state8 = this.state,
21583
- calendarMonthWidth = _state8.calendarMonthWidth,
21584
- currentMonth = _state8.currentMonth,
21585
- monthTransition = _state8.monthTransition,
21586
- translationValue = _state8.translationValue,
21587
- scrollableMonthMultiple = _state8.scrollableMonthMultiple,
21588
- focusedDate = _state8.focusedDate,
21589
- showKeyboardShortcuts = _state8.showKeyboardShortcuts,
21590
- isTouch = _state8.isTouchDevice,
21591
- hasSetHeight = _state8.hasSetHeight,
21592
- calendarInfoWidth = _state8.calendarInfoWidth,
21593
- monthTitleHeight = _state8.monthTitleHeight;
21594
- var _props11 = this.props,
21595
- enableOutsideDays = _props11.enableOutsideDays,
21596
- numberOfMonths = _props11.numberOfMonths,
21597
- orientation = _props11.orientation,
21598
- modifiers = _props11.modifiers,
21599
- withPortal = _props11.withPortal,
21600
- onDayClick = _props11.onDayClick,
21601
- onDayMouseEnter = _props11.onDayMouseEnter,
21602
- onDayMouseLeave = _props11.onDayMouseLeave,
21603
- firstDayOfWeek = _props11.firstDayOfWeek,
21604
- renderMonthText = _props11.renderMonthText,
21605
- renderCalendarDay = _props11.renderCalendarDay,
21606
- renderDayContents = _props11.renderDayContents,
21607
- renderCalendarInfo = _props11.renderCalendarInfo,
21608
- renderMonthElement = _props11.renderMonthElement,
21609
- calendarInfoPosition = _props11.calendarInfoPosition,
21610
- hideKeyboardShortcutsPanel = _props11.hideKeyboardShortcutsPanel,
21611
- onOutsideClick = _props11.onOutsideClick,
21612
- monthFormat = _props11.monthFormat,
21613
- daySize = _props11.daySize,
21614
- isFocused = _props11.isFocused,
21615
- isRTL = _props11.isRTL,
21616
- styles = _props11.styles,
21617
- theme = _props11.theme,
21618
- phrases = _props11.phrases,
21619
- verticalHeight = _props11.verticalHeight,
21620
- dayAriaLabelFormat = _props11.dayAriaLabelFormat,
21621
- noBorder = _props11.noBorder,
21622
- transitionDuration = _props11.transitionDuration,
21623
- verticalBorderSpacing = _props11.verticalBorderSpacing,
21624
- horizontalMonthPadding = _props11.horizontalMonthPadding;
21625
- var dayPickerHorizontalPadding = theme.reactDates.spacing.dayPickerHorizontalPadding;
21626
-
21627
-
21628
- var isHorizontal = this.isHorizontal();
21629
-
21630
- var numOfWeekHeaders = this.isVertical() ? 1 : numberOfMonths;
21631
- var weekHeaders = [];
21632
- for (var i = 0; i < numOfWeekHeaders; i += 1) {
21633
- weekHeaders.push(this.renderWeekHeader(i));
21634
- }
21635
-
21636
- var verticalScrollable = orientation === _constants.VERTICAL_SCROLLABLE;
21637
- var height = void 0;
21638
- if (isHorizontal) {
21639
- height = this.calendarMonthGridHeight;
21640
- } else if (this.isVertical() && !verticalScrollable && !withPortal) {
21641
- // If the user doesn't set a desired height,
21642
- // we default back to this kind of made-up value that generally looks good
21643
- height = verticalHeight || 1.75 * calendarMonthWidth;
21644
- }
21645
-
21646
- var isCalendarMonthGridAnimating = monthTransition !== null;
21647
-
21648
- var shouldFocusDate = !isCalendarMonthGridAnimating && isFocused;
21649
-
21650
- var keyboardShortcutButtonLocation = _DayPickerKeyboardShortcuts.BOTTOM_RIGHT;
21651
- if (this.isVertical()) {
21652
- keyboardShortcutButtonLocation = withPortal ? _DayPickerKeyboardShortcuts.TOP_LEFT : _DayPickerKeyboardShortcuts.TOP_RIGHT;
21653
- }
21654
-
21655
- var shouldAnimateHeight = isHorizontal && hasSetHeight;
21656
-
21657
- var calendarInfoPositionTop = calendarInfoPosition === _constants.INFO_POSITION_TOP;
21658
- var calendarInfoPositionBottom = calendarInfoPosition === _constants.INFO_POSITION_BOTTOM;
21659
- var calendarInfoPositionBefore = calendarInfoPosition === _constants.INFO_POSITION_BEFORE;
21660
- var calendarInfoPositionAfter = calendarInfoPosition === _constants.INFO_POSITION_AFTER;
21661
- var calendarInfoIsInline = calendarInfoPositionBefore || calendarInfoPositionAfter;
21662
-
21663
- var calendarInfo = renderCalendarInfo && _react2['default'].createElement(
21664
- 'div',
21665
- _extends({
21666
- ref: this.setCalendarInfoRef
21667
- }, (0, _reactWithStyles.css)(calendarInfoIsInline && styles.DayPicker_calendarInfo__horizontal)),
21668
- renderCalendarInfo()
21669
- );
21670
-
21671
- var calendarInfoPanelWidth = renderCalendarInfo && calendarInfoIsInline ? calendarInfoWidth : 0;
21672
-
21673
- var firstVisibleMonthIndex = this.getFirstVisibleIndex();
21674
- var wrapperHorizontalWidth = calendarMonthWidth * numberOfMonths + 2 * dayPickerHorizontalPadding;
21675
- // Adding `1px` because of whitespace between 2 inline-block
21676
- var fullHorizontalWidth = wrapperHorizontalWidth + calendarInfoPanelWidth + 1;
21677
-
21678
- var transitionContainerStyle = {
21679
- width: isHorizontal && wrapperHorizontalWidth,
21680
- height: height
21681
- };
21682
-
21683
- var dayPickerWrapperStyle = {
21684
- width: isHorizontal && wrapperHorizontalWidth
21685
- };
21686
-
21687
- var dayPickerStyle = {
21688
- width: isHorizontal && fullHorizontalWidth,
21689
-
21690
- // These values are to center the datepicker (approximately) on the page
21691
- marginLeft: isHorizontal && withPortal ? -fullHorizontalWidth / 2 : null,
21692
- marginTop: isHorizontal && withPortal ? -calendarMonthWidth / 2 : null
21693
- };
21694
-
21695
- return _react2['default'].createElement(
21696
- 'div',
21697
- _extends({
21698
- role: 'application',
21699
- 'aria-label': phrases.calendarLabel
21700
- }, (0, _reactWithStyles.css)(styles.DayPicker, isHorizontal && styles.DayPicker__horizontal, verticalScrollable && styles.DayPicker__verticalScrollable, isHorizontal && withPortal && styles.DayPicker_portal__horizontal, this.isVertical() && withPortal && styles.DayPicker_portal__vertical, dayPickerStyle, !monthTitleHeight && styles.DayPicker__hidden, !noBorder && styles.DayPicker__withBorder)),
21701
- _react2['default'].createElement(
21702
- _reactOutsideClickHandler2['default'],
21703
- { onOutsideClick: onOutsideClick },
21704
- (calendarInfoPositionTop || calendarInfoPositionBefore) && calendarInfo,
21705
- _react2['default'].createElement(
21706
- 'div',
21707
- (0, _reactWithStyles.css)(dayPickerWrapperStyle, calendarInfoIsInline && isHorizontal && styles.DayPicker_wrapper__horizontal),
21708
- _react2['default'].createElement(
21709
- 'div',
21710
- _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_weekHeaders, isHorizontal && styles.DayPicker_weekHeaders__horizontal), {
21711
- 'aria-hidden': 'true',
21712
- role: 'presentation'
21713
- }),
21714
- weekHeaders
21715
- ),
21716
- _react2['default'].createElement(
21717
- 'div',
21718
- _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_focusRegion), {
21719
- ref: this.setContainerRef,
21720
- onClick: function () {
21721
- function onClick(e) {
21722
- e.stopPropagation();
21723
- }
21724
-
21725
- return onClick;
21726
- }(),
21727
- onKeyDown: this.onKeyDown,
21728
- onMouseUp: function () {
21729
- function onMouseUp() {
21730
- _this7.setState({ withMouseInteractions: true });
21731
- }
21732
-
21733
- return onMouseUp;
21734
- }(),
21735
- role: 'region',
21736
- tabIndex: -1
21737
- }),
21738
- !verticalScrollable && this.renderNavigation(),
21739
- _react2['default'].createElement(
21740
- 'div',
21741
- _extends({}, (0, _reactWithStyles.css)(styles.DayPicker_transitionContainer, shouldAnimateHeight && styles.DayPicker_transitionContainer__horizontal, this.isVertical() && styles.DayPicker_transitionContainer__vertical, verticalScrollable && styles.DayPicker_transitionContainer__verticalScrollable, transitionContainerStyle), {
21742
- ref: this.setTransitionContainerRef
21743
- }),
21744
- _react2['default'].createElement(_CalendarMonthGrid2['default'], {
21745
- setMonthTitleHeight: !monthTitleHeight ? this.setMonthTitleHeight : undefined,
21746
- translationValue: translationValue,
21747
- enableOutsideDays: enableOutsideDays,
21748
- firstVisibleMonthIndex: firstVisibleMonthIndex,
21749
- initialMonth: currentMonth,
21750
- isAnimating: isCalendarMonthGridAnimating,
21751
- modifiers: modifiers,
21752
- orientation: orientation,
21753
- numberOfMonths: numberOfMonths * scrollableMonthMultiple,
21754
- onDayClick: onDayClick,
21755
- onDayMouseEnter: onDayMouseEnter,
21756
- onDayMouseLeave: onDayMouseLeave,
21757
- onMonthChange: this.onMonthChange,
21758
- onYearChange: this.onYearChange,
21759
- renderMonthText: renderMonthText,
21760
- renderCalendarDay: renderCalendarDay,
21761
- renderDayContents: renderDayContents,
21762
- renderMonthElement: renderMonthElement,
21763
- onMonthTransitionEnd: this.updateStateAfterMonthTransition,
21764
- monthFormat: monthFormat,
21765
- daySize: daySize,
21766
- firstDayOfWeek: firstDayOfWeek,
21767
- isFocused: shouldFocusDate,
21768
- focusedDate: focusedDate,
21769
- phrases: phrases,
21770
- isRTL: isRTL,
21771
- dayAriaLabelFormat: dayAriaLabelFormat,
21772
- transitionDuration: transitionDuration,
21773
- verticalBorderSpacing: verticalBorderSpacing,
21774
- horizontalMonthPadding: horizontalMonthPadding
21775
- }),
21776
- verticalScrollable && this.renderNavigation()
21777
- ),
21778
- !isTouch && !hideKeyboardShortcutsPanel && _react2['default'].createElement(_DayPickerKeyboardShortcuts2['default'], {
21779
- block: this.isVertical() && !withPortal,
21780
- buttonLocation: keyboardShortcutButtonLocation,
21781
- showKeyboardShortcutsPanel: showKeyboardShortcuts,
21782
- openKeyboardShortcutsPanel: this.openKeyboardShortcutsPanel,
21783
- closeKeyboardShortcutsPanel: this.closeKeyboardShortcutsPanel,
21784
- phrases: phrases
21785
- })
21786
- )
21787
- ),
21788
- (calendarInfoPositionBottom || calendarInfoPositionAfter) && calendarInfo
21789
- )
21790
- );
21791
- }
21792
-
21793
- return render;
21794
- }()
21795
- }]);
21796
-
21797
- return DayPicker;
21798
- }(_react2['default'].Component);
21799
-
21800
- DayPicker.propTypes = propTypes;
21801
- DayPicker.defaultProps = defaultProps;
21802
-
21803
- exports.PureDayPicker = DayPicker;
21804
- exports['default'] = (0, _reactWithStyles.withStyles)(function (_ref2) {
21805
- var _ref2$reactDates = _ref2.reactDates,
21806
- color = _ref2$reactDates.color,
21807
- font = _ref2$reactDates.font,
21808
- noScrollBarOnVerticalScrollable = _ref2$reactDates.noScrollBarOnVerticalScrollable,
21809
- spacing = _ref2$reactDates.spacing,
21810
- zIndex = _ref2$reactDates.zIndex;
21811
- return {
21812
- DayPicker: {
21813
- background: color.background,
21814
- position: 'relative',
21815
- textAlign: 'left'
21816
- },
21817
-
21818
- DayPicker__horizontal: {
21819
- background: color.background
21820
- },
21821
-
21822
- DayPicker__verticalScrollable: {
21823
- height: '100%'
21824
- },
21825
-
21826
- DayPicker__hidden: {
21827
- visibility: 'hidden'
21828
- },
21829
-
21830
- DayPicker__withBorder: {
21831
- boxShadow: '0 2px 6px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.07)',
21832
- borderRadius: 3
21833
- },
21834
-
21835
- DayPicker_portal__horizontal: {
21836
- boxShadow: 'none',
21837
- position: 'absolute',
21838
- left: '50%',
21839
- top: '50%'
21840
- },
21841
-
21842
- DayPicker_portal__vertical: {
21843
- position: 'initial'
21844
- },
21845
-
21846
- DayPicker_focusRegion: {
21847
- outline: 'none'
21848
- },
21849
-
21850
- DayPicker_calendarInfo__horizontal: {
21851
- display: 'inline-block',
21852
- verticalAlign: 'top'
21853
- },
21854
-
21855
- DayPicker_wrapper__horizontal: {
21856
- display: 'inline-block',
21857
- verticalAlign: 'top'
21858
- },
21859
-
21860
- DayPicker_weekHeaders: {
21861
- position: 'relative'
21862
- },
21863
-
21864
- DayPicker_weekHeaders__horizontal: {
21865
- marginLeft: spacing.dayPickerHorizontalPadding
21866
- },
21867
-
21868
- DayPicker_weekHeader: {
21869
- color: color.placeholderText,
21870
- position: 'absolute',
21871
- top: 62,
21872
- zIndex: zIndex + 2,
21873
- textAlign: 'left'
21874
- },
21875
-
21876
- DayPicker_weekHeader__vertical: {
21877
- left: '50%'
21878
- },
21879
-
21880
- DayPicker_weekHeader__verticalScrollable: {
21881
- top: 0,
21882
- display: 'table-row',
21883
- borderBottom: '1px solid ' + String(color.core.border),
21884
- background: color.background,
21885
- marginLeft: 0,
21886
- left: 0,
21887
- width: '100%',
21888
- textAlign: 'center'
21889
- },
21890
-
21891
- DayPicker_weekHeader_ul: {
21892
- listStyle: 'none',
21893
- margin: '1px 0',
21894
- paddingLeft: 0,
21895
- paddingRight: 0,
21896
- fontSize: font.size
21897
- },
21898
-
21899
- DayPicker_weekHeader_li: {
21900
- display: 'inline-block',
21901
- textAlign: 'center'
21902
- },
21903
-
21904
- DayPicker_transitionContainer: {
21905
- position: 'relative',
21906
- overflow: 'hidden',
21907
- borderRadius: 3
21908
- },
21909
-
21910
- DayPicker_transitionContainer__horizontal: {
21911
- transition: 'height 0.2s ease-in-out'
21912
- },
21913
-
21914
- DayPicker_transitionContainer__vertical: {
21915
- width: '100%'
21916
- },
21917
-
21918
- DayPicker_transitionContainer__verticalScrollable: (0, _object2['default'])({
21919
- paddingTop: 20,
21920
- height: '100%',
21921
- position: 'absolute',
21922
- top: 0,
21923
- bottom: 0,
21924
- right: 0,
21925
- left: 0,
21926
- overflowY: 'scroll'
21927
- }, noScrollBarOnVerticalScrollable && {
21928
- '-webkitOverflowScrolling': 'touch',
21929
- '::-webkit-scrollbar': {
21930
- '-webkit-appearance': 'none',
21931
- display: 'none'
21932
- }
21933
- })
21934
- };
21935
- })(DayPicker);
21936
-
21937
- /***/ }),
21938
- /* 145 */
21939
- /***/ (function(module, exports, __webpack_require__) {
21940
-
21941
- "use strict";
21942
-
21943
-
21944
- var stringify = __webpack_require__(842);
21945
- var parse = __webpack_require__(843);
21946
- var formats = __webpack_require__(441);
21947
-
21948
- module.exports = {
21949
- formats: formats,
21950
- parse: parse,
21951
- stringify: stringify
21952
- };
21953
-
21954
-
21955
- /***/ }),
21956
- /* 146 */
21957
- /***/ (function(module, exports, __webpack_require__) {
21958
-
21959
- "use strict";
21960
-
21961
-
21962
- var has = Object.prototype.hasOwnProperty;
21963
- var isArray = Array.isArray;
21964
-
21965
- var hexTable = (function () {
21966
- var array = [];
21967
- for (var i = 0; i < 256; ++i) {
21968
- array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
21969
- }
21970
-
21971
- return array;
21972
- }());
21973
-
21974
- var compactQueue = function compactQueue(queue) {
21975
- while (queue.length > 1) {
21976
- var item = queue.pop();
21977
- var obj = item.obj[item.prop];
21978
-
21979
- if (isArray(obj)) {
21980
- var compacted = [];
21981
-
21982
- for (var j = 0; j < obj.length; ++j) {
21983
- if (typeof obj[j] !== 'undefined') {
21984
- compacted.push(obj[j]);
21985
- }
21986
- }
21987
-
21988
- item.obj[item.prop] = compacted;
21989
- }
21990
- }
21991
- };
21992
-
21993
- var arrayToObject = function arrayToObject(source, options) {
21994
- var obj = options && options.plainObjects ? Object.create(null) : {};
21995
- for (var i = 0; i < source.length; ++i) {
21996
- if (typeof source[i] !== 'undefined') {
21997
- obj[i] = source[i];
21998
- }
21999
- }
22000
-
22001
- return obj;
22002
- };
22003
-
22004
- var merge = function merge(target, source, options) {
22005
- /* eslint no-param-reassign: 0 */
22006
- if (!source) {
22007
- return target;
22008
- }
22009
-
22010
- if (typeof source !== 'object') {
22011
- if (isArray(target)) {
22012
- target.push(source);
22013
- } else if (target && typeof target === 'object') {
22014
- if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {
22015
- target[source] = true;
22016
- }
22017
- } else {
22018
- return [target, source];
22019
- }
22020
-
22021
- return target;
22022
- }
22023
-
22024
- if (!target || typeof target !== 'object') {
22025
- return [target].concat(source);
22026
- }
22027
-
22028
- var mergeTarget = target;
22029
- if (isArray(target) && !isArray(source)) {
22030
- mergeTarget = arrayToObject(target, options);
22031
- }
22032
-
22033
- if (isArray(target) && isArray(source)) {
22034
- source.forEach(function (item, i) {
22035
- if (has.call(target, i)) {
22036
- var targetItem = target[i];
22037
- if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
22038
- target[i] = merge(targetItem, item, options);
22039
- } else {
22040
- target.push(item);
22041
- }
22042
- } else {
22043
- target[i] = item;
22044
- }
22045
- });
22046
- return target;
22047
- }
22048
-
22049
- return Object.keys(source).reduce(function (acc, key) {
22050
- var value = source[key];
22051
-
22052
- if (has.call(acc, key)) {
22053
- acc[key] = merge(acc[key], value, options);
22054
- } else {
22055
- acc[key] = value;
22056
- }
22057
- return acc;
22058
- }, mergeTarget);
22059
- };
22060
-
22061
- var assign = function assignSingleSource(target, source) {
22062
- return Object.keys(source).reduce(function (acc, key) {
22063
- acc[key] = source[key];
22064
- return acc;
22065
- }, target);
22066
- };
22067
-
22068
- var decode = function (str, decoder, charset) {
22069
- var strWithoutPlus = str.replace(/\+/g, ' ');
22070
- if (charset === 'iso-8859-1') {
22071
- // unescape never throws, no try...catch needed:
22072
- return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
22073
- }
22074
- // utf-8
22075
- try {
22076
- return decodeURIComponent(strWithoutPlus);
22077
- } catch (e) {
22078
- return strWithoutPlus;
22079
- }
22080
- };
22081
-
22082
- var encode = function encode(str, defaultEncoder, charset) {
22083
- // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
22084
- // It has been adapted here for stricter adherence to RFC 3986
22085
- if (str.length === 0) {
22086
- return str;
22087
- }
22088
-
22089
- var string = str;
22090
- if (typeof str === 'symbol') {
22091
- string = Symbol.prototype.toString.call(str);
22092
- } else if (typeof str !== 'string') {
22093
- string = String(str);
22094
- }
22095
-
22096
- if (charset === 'iso-8859-1') {
22097
- return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
22098
- return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
22099
- });
22100
- }
22101
-
22102
- var out = '';
22103
- for (var i = 0; i < string.length; ++i) {
22104
- var c = string.charCodeAt(i);
22105
-
22106
- if (
22107
- c === 0x2D // -
22108
- || c === 0x2E // .
22109
- || c === 0x5F // _
22110
- || c === 0x7E // ~
22111
- || (c >= 0x30 && c <= 0x39) // 0-9
22112
- || (c >= 0x41 && c <= 0x5A) // a-z
22113
- || (c >= 0x61 && c <= 0x7A) // A-Z
22114
- ) {
22115
- out += string.charAt(i);
22116
- continue;
22117
- }
22118
-
22119
- if (c < 0x80) {
22120
- out = out + hexTable[c];
22121
- continue;
22122
- }
22123
-
22124
- if (c < 0x800) {
22125
- out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
22126
- continue;
22127
- }
22128
-
22129
- if (c < 0xD800 || c >= 0xE000) {
22130
- out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
22131
- continue;
22132
- }
22133
-
22134
- i += 1;
22135
- c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
22136
- out += hexTable[0xF0 | (c >> 18)]
22137
- + hexTable[0x80 | ((c >> 12) & 0x3F)]
22138
- + hexTable[0x80 | ((c >> 6) & 0x3F)]
22139
- + hexTable[0x80 | (c & 0x3F)];
22140
- }
22141
-
22142
- return out;
22143
- };
22144
-
22145
- var compact = function compact(value) {
22146
- var queue = [{ obj: { o: value }, prop: 'o' }];
22147
- var refs = [];
22148
-
22149
- for (var i = 0; i < queue.length; ++i) {
22150
- var item = queue[i];
22151
- var obj = item.obj[item.prop];
22152
-
22153
- var keys = Object.keys(obj);
22154
- for (var j = 0; j < keys.length; ++j) {
22155
- var key = keys[j];
22156
- var val = obj[key];
22157
- if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
22158
- queue.push({ obj: obj, prop: key });
22159
- refs.push(val);
22160
- }
22161
- }
22162
- }
22163
-
22164
- compactQueue(queue);
22165
-
22166
- return value;
22167
- };
22168
-
22169
- var isRegExp = function isRegExp(obj) {
22170
- return Object.prototype.toString.call(obj) === '[object RegExp]';
22171
- };
22172
-
22173
- var isBuffer = function isBuffer(obj) {
22174
- if (!obj || typeof obj !== 'object') {
22175
- return false;
22176
- }
22177
-
22178
- return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
22179
- };
22180
-
22181
- var combine = function combine(a, b) {
22182
- return [].concat(a, b);
22183
- };
22184
-
22185
- var maybeMap = function maybeMap(val, fn) {
22186
- if (isArray(val)) {
22187
- var mapped = [];
22188
- for (var i = 0; i < val.length; i += 1) {
22189
- mapped.push(fn(val[i]));
22190
- }
22191
- return mapped;
22192
- }
22193
- return fn(val);
22194
- };
22195
-
22196
- module.exports = {
22197
- arrayToObject: arrayToObject,
22198
- assign: assign,
22199
- combine: combine,
22200
- compact: compact,
22201
- decode: decode,
22202
- encode: encode,
22203
- isBuffer: isBuffer,
22204
- isRegExp: isRegExp,
22205
- maybeMap: maybeMap,
22206
- merge: merge
22207
- };
22208
-
22209
-
22210
- /***/ }),
22211
- /* 147 */
22212
- /***/ (function(module, exports, __webpack_require__) {
22213
-
22214
- "use strict";
22215
- /* WEBPACK VAR INJECTION */(function(process) {
22216
-
22217
- if (process.env.NODE_ENV === 'production') {
22218
- module.exports = __webpack_require__(458);
22219
- } else {
22220
- module.exports = __webpack_require__(459);
22221
- }
22222
-
22223
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))
22224
-
22225
- /***/ }),
22226
- /* 148 */
22227
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
22228
-
22229
- "use strict";
22230
- /* harmony export (immutable) */ __webpack_exports__["a"] = RawHTML;
22231
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__ = __webpack_require__(23);
22232
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
22233
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__react__ = __webpack_require__(94);
22234
-
22235
-
22236
-
22237
- /**
22238
- * External dependencies
22239
- */
22240
-
22241
- /**
22242
- * Component used as equivalent of Fragment with unescaped HTML, in cases where
22243
- * it is desirable to render dangerous HTML without needing a wrapper element.
22244
- * To preserve additional props, a `div` wrapper _will_ be created if any props
22245
- * aside from `children` are passed.
22246
- *
22247
- * @param {string} props.children HTML to render.
22248
- *
22249
- * @return {WPElement} Dangerously-rendering element.
22250
- */
22251
-
22252
- function RawHTML(_ref) {
22253
- var children = _ref.children,
22254
- props = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(_ref, ["children"]);
22255
-
22256
- // The DIV wrapper will be stripped by serializer, unless there are
22257
- // non-children props present.
22258
- return Object(__WEBPACK_IMPORTED_MODULE_2__react__["h" /* createElement */])('div', Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_objectSpread__["a" /* default */])({
22259
- dangerouslySetInnerHTML: {
22260
- __html: children
22261
- }
22262
- }, props));
22263
- }
22264
- //# sourceMappingURL=raw-html.js.map
22265
-
22266
- /***/ }),
22267
- /* 149 */
22268
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
22269
-
22270
- "use strict";
22271
- /* harmony export (immutable) */ __webpack_exports__["a"] = _arrayLikeToArray;
22272
- function _arrayLikeToArray(arr, len) {
22273
- if (len == null || len > arr.length) len = arr.length;
22274
-
22275
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
22276
- arr2[i] = arr[i];
22277
- }
22278
-
22279
- return arr2;
22280
- }
22281
-
22282
- /***/ }),
22283
- /* 150 */
22284
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
22285
-
22286
- "use strict";
22287
- /* harmony export (immutable) */ __webpack_exports__["a"] = _unsupportedIterableToArray;
22288
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_arrayLikeToArray__ = __webpack_require__(149);
22289
-
22290
- function _unsupportedIterableToArray(o, minLen) {
22291
- if (!o) return;
22292
- if (typeof o === "string") return Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_arrayLikeToArray__["a" /* default */])(o, minLen);
22293
- var n = Object.prototype.toString.call(o).slice(8, -1);
22294
- if (n === "Object" && o.constructor) n = o.constructor.name;
22295
- if (n === "Map" || n === "Set") return Array.from(o);
22296
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_arrayLikeToArray__["a" /* default */])(o, minLen);
22297
- }
22298
-
22299
- /***/ }),
22300
- /* 151 */
22301
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
22302
-
22303
- "use strict";
22304
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createI18n; });
22305
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(13);
22306
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tannin__ = __webpack_require__(80);
22307
-
22308
-
22309
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
22310
-
22311
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
22312
-
22313
- /**
22314
- * External dependencies
22315
- */
22316
-
22317
- /**
22318
- * @typedef {Record<string,any>} LocaleData
22319
- */
22320
-
22321
- /**
22322
- * Default locale data to use for Tannin domain when not otherwise provided.
22323
- * Assumes an English plural forms expression.
22324
- *
22325
- * @type {LocaleData}
22326
- */
22327
-
22328
- var DEFAULT_LOCALE_DATA = {
22329
- '': {
22330
- /** @param {number} n */
22331
- plural_forms: function plural_forms(n) {
22332
- return n === 1 ? 0 : 1;
22333
- }
22334
- }
22335
- };
22336
- /**
22337
- * An i18n instance
22338
- *
22339
- * @typedef {Object} I18n
22340
- * @property {Function} setLocaleData Merges locale data into the Tannin instance by domain. Accepts data in a
22341
- * Jed-formatted JSON object shape.
22342
- * @property {Function} __ Retrieve the translation of text.
22343
- * @property {Function} _x Retrieve translated string with gettext context.
22344
- * @property {Function} _n Translates and retrieves the singular or plural form based on the supplied
22345
- * number.
22346
- * @property {Function} _nx Translates and retrieves the singular or plural form based on the supplied
22347
- * number, with gettext context.
22348
- * @property {Function} isRTL Check if current locale is RTL.
22349
- */
22350
-
22351
- /**
22352
- * Create an i18n instance
22353
- *
22354
- * @param {LocaleData} [initialData] Locale data configuration.
22355
- * @param {string} [initialDomain] Domain for which configuration applies.
22356
- * @return {I18n} I18n instance
22357
- */
22358
-
22359
- var createI18n = function createI18n(initialData, initialDomain) {
22360
- /**
22361
- * The underlying instance of Tannin to which exported functions interface.
22362
- *
22363
- * @type {Tannin}
22364
- */
22365
- var tannin = new __WEBPACK_IMPORTED_MODULE_1_tannin__["a" /* default */]({});
22366
- /**
22367
- * Merges locale data into the Tannin instance by domain. Accepts data in a
22368
- * Jed-formatted JSON object shape.
22369
- *
22370
- * @see http://messageformat.github.io/Jed/
22371
- *
22372
- * @param {LocaleData} [data] Locale data configuration.
22373
- * @param {string} [domain] Domain for which configuration applies.
22374
- */
22375
-
22376
- var setLocaleData = function setLocaleData(data) {
22377
- var domain = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
22378
- tannin.data[domain] = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_LOCALE_DATA), tannin.data[domain]), data); // Populate default domain configuration (supported locale date which omits
22379
- // a plural forms expression).
22380
-
22381
- tannin.data[domain][''] = _objectSpread(_objectSpread({}, DEFAULT_LOCALE_DATA['']), tannin.data[domain]['']);
22382
- };
22383
- /**
22384
- * Wrapper for Tannin's `dcnpgettext`. Populates default locale data if not
22385
- * otherwise previously assigned.
22386
- *
22387
- * @param {string|undefined} domain Domain to retrieve the translated text.
22388
- * @param {string|undefined} context Context information for the translators.
22389
- * @param {string} single Text to translate if non-plural. Used as
22390
- * fallback return value on a caught error.
22391
- * @param {string} [plural] The text to be used if the number is
22392
- * plural.
22393
- * @param {number} [number] The number to compare against to use
22394
- * either the singular or plural form.
22395
- *
22396
- * @return {string} The translated string.
22397
- */
22398
-
22399
-
22400
- var dcnpgettext = function dcnpgettext() {
22401
- var domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
22402
- var context = arguments.length > 1 ? arguments[1] : undefined;
22403
- var single = arguments.length > 2 ? arguments[2] : undefined;
22404
- var plural = arguments.length > 3 ? arguments[3] : undefined;
22405
- var number = arguments.length > 4 ? arguments[4] : undefined;
22406
-
22407
- if (!tannin.data[domain]) {
22408
- setLocaleData(undefined, domain);
22409
- }
22410
-
22411
- return tannin.dcnpgettext(domain, context, single, plural, number);
22412
- };
22413
- /**
22414
- * Retrieve the translation of text.
22415
- *
22416
- * @see https://developer.wordpress.org/reference/functions/__/
22417
- *
22418
- * @param {string} text Text to translate.
22419
- * @param {string} [domain] Domain to retrieve the translated text.
22420
- *
22421
- * @return {string} Translated text.
22422
- */
22423
-
22424
-
22425
- var __ = function __(text, domain) {
22426
- return dcnpgettext(domain, undefined, text);
22427
- };
22428
- /**
22429
- * Retrieve translated string with gettext context.
22430
- *
22431
- * @see https://developer.wordpress.org/reference/functions/_x/
22432
- *
22433
- * @param {string} text Text to translate.
22434
- * @param {string} context Context information for the translators.
22435
- * @param {string} [domain] Domain to retrieve the translated text.
22436
- *
22437
- * @return {string} Translated context string without pipe.
22438
- */
22439
-
22440
-
22441
- var _x = function _x(text, context, domain) {
22442
- return dcnpgettext(domain, context, text);
22443
- };
22444
- /**
22445
- * Translates and retrieves the singular or plural form based on the supplied
22446
- * number.
22447
- *
22448
- * @see https://developer.wordpress.org/reference/functions/_n/
22449
- *
22450
- * @param {string} single The text to be used if the number is singular.
22451
- * @param {string} plural The text to be used if the number is plural.
22452
- * @param {number} number The number to compare against to use either the
22453
- * singular or plural form.
22454
- * @param {string} [domain] Domain to retrieve the translated text.
22455
- *
22456
- * @return {string} The translated singular or plural form.
22457
- */
22458
-
22459
-
22460
- var _n = function _n(single, plural, number, domain) {
22461
- return dcnpgettext(domain, undefined, single, plural, number);
22462
- };
22463
- /**
22464
- * Translates and retrieves the singular or plural form based on the supplied
22465
- * number, with gettext context.
22466
- *
22467
- * @see https://developer.wordpress.org/reference/functions/_nx/
22468
- *
22469
- * @param {string} single The text to be used if the number is singular.
22470
- * @param {string} plural The text to be used if the number is plural.
22471
- * @param {number} number The number to compare against to use either the
22472
- * singular or plural form.
22473
- * @param {string} context Context information for the translators.
22474
- * @param {string} [domain] Domain to retrieve the translated text.
22475
- *
22476
- * @return {string} The translated singular or plural form.
22477
- */
22478
-
22479
-
22480
- var _nx = function _nx(single, plural, number, context, domain) {
22481
- return dcnpgettext(domain, context, single, plural, number);
22482
- };
22483
- /**
22484
- * Check if current locale is RTL.
22485
- *
22486
- * **RTL (Right To Left)** is a locale property indicating that text is written from right to left.
22487
- * For example, the `he` locale (for Hebrew) specifies right-to-left. Arabic (ar) is another common
22488
- * language written RTL. The opposite of RTL, LTR (Left To Right) is used in other languages,
22489
- * including English (`en`, `en-US`, `en-GB`, etc.), Spanish (`es`), and French (`fr`).
22490
- *
22491
- * @return {boolean} Whether locale is RTL.
22492
- */
22493
-
22494
-
22495
- var isRTL = function isRTL() {
22496
- return 'rtl' === _x('ltr', 'text direction');
22497
- };
22498
-
22499
- if (initialData) {
22500
- setLocaleData(initialData, initialDomain);
22501
- }
22502
-
22503
- return {
22504
- setLocaleData: setLocaleData,
22505
- __: __,
22506
- _x: _x,
22507
- _n: _n,
22508
- _nx: _nx,
22509
- isRTL: isRTL
22510
- };
22511
- };
22512
- //# sourceMappingURL=create-i18n.js.map
22513
-
22514
- /***/ }),
22515
- /* 152 */
22516
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
22517
-
22518
- "use strict";
22519
- /* harmony export (immutable) */ __webpack_exports__["a"] = RawHTML;
22520
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(13);
22521
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
22522
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__react__ = __webpack_require__(97);
22523
-
22524
-
22525
-
22526
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
22527
-
22528
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
22529
-
22530
- /**
22531
- * Internal dependencies
22532
- */
22533
- // Disable reason: JSDoc linter doesn't seem to parse the union (`&`) correctly.
22534
-
22535
- /** @typedef {{children: string} & import('react').ComponentPropsWithoutRef<'div'>} RawHTMLProps */
22536
-
22537
- /**
22538
- * Component used as equivalent of Fragment with unescaped HTML, in cases where
22539
- * it is desirable to render dangerous HTML without needing a wrapper element.
22540
- * To preserve additional props, a `div` wrapper _will_ be created if any props
22541
- * aside from `children` are passed.
22542
- *
22543
- * @param {RawHTMLProps} props Children should be a string of HTML. Other props
22544
- * will be passed through to div wrapper.
22545
- *
22546
- * @return {JSX.Element} Dangerously-rendering component.
22547
- */
22548
-
22549
- function RawHTML(_ref) {
22550
- var children = _ref.children,
22551
- props = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(_ref, ["children"]);
22552
-
22553
- // The DIV wrapper will be stripped by serializer, unless there are
22554
- // non-children props present.
22555
- return Object(__WEBPACK_IMPORTED_MODULE_2__react__["e" /* createElement */])('div', _objectSpread({
22556
- dangerouslySetInnerHTML: {
22557
- __html: children
22558
- }
22559
- }, props));
22560
- }
22561
- //# sourceMappingURL=raw-html.js.map
22562
-
22563
- /***/ }),
22564
- /* 153 */
22565
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
22566
-
22567
- "use strict";
22568
- /* harmony export (immutable) */ __webpack_exports__["a"] = useInstanceId;
22569
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(24);
22570
- /**
22571
- * WordPress dependencies
22572
- */
22573
-
22574
- var instanceMap = new WeakMap();
22575
- /**
22576
- * Creates a new id for a given object.
22577
- *
22578
- * @param {Object} object Object reference to create an id for.
22579
- */
22580
-
22581
- function createId(object) {
22582
- var instances = instanceMap.get(object) || 0;
22583
- instanceMap.set(object, instances + 1);
22584
- return instances;
22585
- }
22586
- /**
22587
- * Provides a unique instance ID.
22588
- *
22589
- * @param {Object} object Object reference to create an id for.
22590
- * @param {string} prefix Prefix for the unique id.
22591
- */
22592
-
22593
-
22594
- function useInstanceId(object, prefix) {
22595
- return Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["i" /* useMemo */])(function () {
22596
- var id = createId(object);
22597
- return prefix ? "".concat(prefix, "-").concat(id) : id;
22598
- }, [object]);
22599
- }
22600
- //# sourceMappingURL=index.js.map
22601
-
22602
- /***/ }),
22603
- /* 154 */
22604
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
22605
-
22606
- "use strict";
22607
- /* harmony export (immutable) */ __webpack_exports__["a"] = usePrevious;
22608
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(24);
22609
- /**
22610
- * WordPress dependencies
22611
- */
22612
-
22613
- /**
22614
- * Use something's value from the previous render.
22615
- * Based on https://usehooks.com/usePrevious/.
22616
- *
22617
- * @template T
22618
- *
22619
- * @param {T} value The value to track.
22620
- *
22621
- * @return {T|undefined} The value from the previous render.
22622
- */
22623
-
22624
- function usePrevious(value) {
22625
- // Disable reason: without an explicit type detail, the type of ref will be
22626
- // inferred based on the initial useRef argument, which is undefined.
22627
- // https://github.com/WordPress/gutenberg/pull/22597#issuecomment-633588366
22628
-
22629
- /* eslint-disable jsdoc/no-undefined-types */
22630
- var ref = Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["k" /* useRef */])(
22631
- /** @type {T|undefined} */
22632
- undefined);
22633
- /* eslint-enable jsdoc/no-undefined-types */
22634
- // Store current value in ref.
22635
-
22636
- Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["g" /* useEffect */])(function () {
22637
- ref.current = value;
22638
- }, [value]); // Re-run when value changes.
22639
- // Return previous value (happens before update in useEffect above).
22640
-
22641
- return ref.current;
22642
- }
22643
- //# sourceMappingURL=index.js.map
22644
-
22645
- /***/ }),
22646
- /* 155 */
22647
- /***/ (function(module, exports, __webpack_require__) {
22648
-
22649
- var e=__webpack_require__(9),n={display:"block",opacity:0,position:"absolute",top:0,left:0,height:"100%",width:"100%",overflow:"hidden",pointerEvents:"none",zIndex:-1},t=function(t){var r=t.onResize,u=e.useRef();return function(n,t){var r=function(){return n.current&&n.current.contentDocument&&n.current.contentDocument.defaultView};function u(){t();var e=r();e&&e.addEventListener("resize",t)}e.useEffect((function(){return r()?u():n.current&&n.current.addEventListener&&n.current.addEventListener("load",u),function(){var e=r();e&&"function"==typeof e.removeEventListener&&e.removeEventListener("resize",t)}}),[])}(u,(function(){return r(u)})),e.createElement("iframe",{style:n,src:"about:blank",ref:u,"aria-hidden":!0,tabIndex:-1,frameBorder:0})},r=function(e){return{width:null!=e?e.offsetWidth:null,height:null!=e?e.offsetHeight:null}};module.exports=function(n){void 0===n&&(n=r);var u=e.useState(n(null)),o=u[0],i=u[1],c=e.useCallback((function(e){return i(n(e.current))}),[n]);return[e.useMemo((function(){return e.createElement(t,{onResize:c})}),[c]),o]};
22650
- //# sourceMappingURL=index.js.map
22651
-
22652
-
22653
- /***/ }),
22654
- /* 156 */
22655
- /***/ (function(module, exports) {
22656
-
22657
- function combineReducers( reducers ) {
22658
- var keys = Object.keys( reducers ),
22659
- getNextState;
22660
-
22661
- getNextState = ( function() {
22662
- var fn, i, key;
22663
-
22664
- fn = 'return {';
22665
- for ( i = 0; i < keys.length; i++ ) {
22666
- // Rely on Quoted escaping of JSON.stringify with guarantee that
22667
- // each member of Object.keys is a string.
22668
- //
22669
- // "If Type(value) is String, then return the result of calling the
22670
- // abstract operation Quote with argument value. [...] The abstract
22671
- // operation Quote(value) wraps a String value in double quotes and
22672
- // escapes characters within it."
22673
- //
22674
- // https://www.ecma-international.org/ecma-262/5.1/#sec-15.12.3
22675
- key = JSON.stringify( keys[ i ] );
22676
-
22677
- fn += key + ':r[' + key + '](s[' + key + '],a),';
22678
- }
22679
- fn += '}';
22680
-
22681
- return new Function( 'r,s,a', fn );
22682
- } )();
22683
-
22684
- return function combinedReducer( state, action ) {
22685
- var nextState, i, key;
22686
-
22687
- // Assumed changed if initial state.
22688
- if ( state === undefined ) {
22689
- return getNextState( reducers, {}, action );
22690
- }
22691
-
22692
- nextState = getNextState( reducers, state, action );
22693
-
22694
- // Determine whether state has changed.
22695
- i = keys.length;
22696
- while ( i-- ) {
22697
- key = keys[ i ];
22698
- if ( state[ key ] !== nextState[ key ] ) {
22699
- // Return immediately if a changed value is encountered.
22700
- return nextState;
22701
- }
22702
- }
22703
-
22704
- return state;
22705
- };
22706
- }
22707
-
22708
- module.exports = combineReducers;
22709
-
22710
-
22711
- /***/ }),
22712
- /* 157 */
22713
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
22714
-
22715
- "use strict";
22716
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__registry__ = __webpack_require__(158);
22717
- /**
22718
- * Internal dependencies
22719
- */
22720
-
22721
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_0__registry__["a" /* createRegistry */])());
22722
- //# sourceMappingURL=default-registry.js.map
22723
-
22724
- /***/ }),
22725
- /* 158 */
22726
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
22727
-
22728
- "use strict";
22729
- /* harmony export (immutable) */ __webpack_exports__["a"] = createRegistry;
22730
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_slicedToArray__ = __webpack_require__(27);
22731
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(13);
22732
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash__ = __webpack_require__(2);
22733
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash__);
22734
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_memize__ = __webpack_require__(64);
22735
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3_memize___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_3_memize__);
22736
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__namespace_store__ = __webpack_require__(512);
22737
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__store__ = __webpack_require__(537);
22738
-
22739
-
22740
-
22741
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
22742
-
22743
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
22744
-
22745
- /**
22746
- * External dependencies
22747
- */
22748
-
22749
-
22750
- /**
22751
- * Internal dependencies
22752
- */
22753
-
22754
-
22755
-
22756
- /**
22757
- * @typedef {Object} WPDataRegistry An isolated orchestrator of store registrations.
22758
- *
22759
- * @property {Function} registerGenericStore Given a namespace key and settings
22760
- * object, registers a new generic
22761
- * store.
22762
- * @property {Function} registerStore Given a namespace key and settings
22763
- * object, registers a new namespace
22764
- * store.
22765
- * @property {Function} subscribe Given a function callback, invokes
22766
- * the callback on any change to state
22767
- * within any registered store.
22768
- * @property {Function} select Given a namespace key, returns an
22769
- * object of the store's registered
22770
- * selectors.
22771
- * @property {Function} dispatch Given a namespace key, returns an
22772
- * object of the store's registered
22773
- * action dispatchers.
22774
- */
22775
-
22776
- /**
22777
- * @typedef {Object} WPDataPlugin An object of registry function overrides.
22778
- *
22779
- * @property {Function} registerStore registers store.
22780
- */
22781
-
22782
- /**
22783
- * Creates a new store registry, given an optional object of initial store
22784
- * configurations.
22785
- *
22786
- * @param {Object} storeConfigs Initial store configurations.
22787
- * @param {Object?} parent Parent registry.
22788
- *
22789
- * @return {WPDataRegistry} Data registry.
22790
- */
22791
-
22792
- function createRegistry() {
22793
- var storeConfigs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
22794
- var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
22795
- var stores = {};
22796
- var listeners = [];
22797
- /**
22798
- * Global listener called for each store's update.
22799
- */
22800
-
22801
- function globalListener() {
22802
- listeners.forEach(function (listener) {
22803
- return listener();
22804
- });
22805
- }
22806
- /**
22807
- * Subscribe to changes to any data.
22808
- *
22809
- * @param {Function} listener Listener function.
22810
- *
22811
- * @return {Function} Unsubscribe function.
22812
- */
22813
-
22814
-
22815
- var subscribe = function subscribe(listener) {
22816
- listeners.push(listener);
22817
- return function () {
22818
- listeners = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["without"])(listeners, listener);
22819
- };
22820
- };
22821
- /**
22822
- * Calls a selector given the current state and extra arguments.
22823
- *
22824
- * @param {string} reducerKey Part of the state shape to register the
22825
- * selectors for.
22826
- *
22827
- * @return {*} The selector's returned value.
22828
- */
22829
-
22830
-
22831
- function select(reducerKey) {
22832
- var store = stores[reducerKey];
22833
-
22834
- if (store) {
22835
- return store.getSelectors();
22836
- }
22837
-
22838
- return parent && parent.select(reducerKey);
22839
- }
22840
-
22841
- var getResolveSelectors = __WEBPACK_IMPORTED_MODULE_3_memize___default()(function (selectors) {
22842
- return Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["omit"])(selectors, ['getIsResolving', 'hasStartedResolution', 'hasFinishedResolution', 'isResolving', 'getCachedResolvers']), function (selector, selectorName) {
22843
- return function () {
22844
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
22845
- args[_key] = arguments[_key];
22846
- }
22847
-
22848
- return new Promise(function (resolve) {
22849
- var hasFinished = function hasFinished() {
22850
- return selectors.hasFinishedResolution(selectorName, args);
22851
- };
22852
-
22853
- var getResult = function getResult() {
22854
- return selector.apply(null, args);
22855
- }; // trigger the selector (to trigger the resolver)
22856
-
22857
-
22858
- var result = getResult();
22859
-
22860
- if (hasFinished()) {
22861
- return resolve(result);
22862
- }
22863
-
22864
- var unsubscribe = subscribe(function () {
22865
- if (hasFinished()) {
22866
- unsubscribe();
22867
- resolve(getResult());
22868
- }
22869
- });
22870
- });
22871
- };
22872
- });
22873
- }, {
22874
- maxSize: 1
22875
- });
22876
- /**
22877
- * Given the name of a registered store, returns an object containing the store's
22878
- * selectors pre-bound to state so that you only need to supply additional arguments,
22879
- * and modified so that they return promises that resolve to their eventual values,
22880
- * after any resolvers have ran.
22881
- *
22882
- * @param {string} reducerKey Part of the state shape to register the
22883
- * selectors for.
22884
- *
22885
- * @return {Object} Each key of the object matches the name of a selector.
22886
- */
22887
-
22888
- function __experimentalResolveSelect(reducerKey) {
22889
- return getResolveSelectors(select(reducerKey));
22890
- }
22891
- /**
22892
- * Returns the available actions for a part of the state.
22893
- *
22894
- * @param {string} reducerKey Part of the state shape to dispatch the
22895
- * action for.
22896
- *
22897
- * @return {*} The action's returned value.
22898
- */
22899
-
22900
-
22901
- function dispatch(reducerKey) {
22902
- var store = stores[reducerKey];
22903
-
22904
- if (store) {
22905
- return store.getActions();
22906
- }
22907
-
22908
- return parent && parent.dispatch(reducerKey);
22909
- } //
22910
- // Deprecated
22911
- // TODO: Remove this after `use()` is removed.
22912
- //
22913
-
22914
-
22915
- function withPlugins(attributes) {
22916
- return Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["mapValues"])(attributes, function (attribute, key) {
22917
- if (typeof attribute !== 'function') {
22918
- return attribute;
22919
- }
22920
-
22921
- return function () {
22922
- return registry[key].apply(null, arguments);
22923
- };
22924
- });
22925
- }
22926
- /**
22927
- * Registers a generic store.
22928
- *
22929
- * @param {string} key Store registry key.
22930
- * @param {Object} config Configuration (getSelectors, getActions, subscribe).
22931
- */
22932
-
22933
-
22934
- function registerGenericStore(key, config) {
22935
- if (typeof config.getSelectors !== 'function') {
22936
- throw new TypeError('config.getSelectors must be a function');
22937
- }
22938
-
22939
- if (typeof config.getActions !== 'function') {
22940
- throw new TypeError('config.getActions must be a function');
22941
- }
22942
-
22943
- if (typeof config.subscribe !== 'function') {
22944
- throw new TypeError('config.subscribe must be a function');
22945
- }
22946
-
22947
- stores[key] = config;
22948
- config.subscribe(globalListener);
22949
- }
22950
-
22951
- var registry = {
22952
- registerGenericStore: registerGenericStore,
22953
- stores: stores,
22954
- namespaces: stores,
22955
- // TODO: Deprecate/remove this.
22956
- subscribe: subscribe,
22957
- select: select,
22958
- __experimentalResolveSelect: __experimentalResolveSelect,
22959
- dispatch: dispatch,
22960
- use: use
22961
- };
22962
- /**
22963
- * Registers a standard `@wordpress/data` store.
22964
- *
22965
- * @param {string} reducerKey Reducer key.
22966
- * @param {Object} options Store description (reducer, actions, selectors, resolvers).
22967
- *
22968
- * @return {Object} Registered store object.
22969
- */
22970
-
22971
- registry.registerStore = function (reducerKey, options) {
22972
- if (!options.reducer) {
22973
- throw new TypeError('Must specify store reducer');
22974
- }
22975
-
22976
- var namespace = Object(__WEBPACK_IMPORTED_MODULE_4__namespace_store__["a" /* default */])(reducerKey, options, registry);
22977
- registerGenericStore(reducerKey, namespace);
22978
- return namespace.store;
22979
- }; //
22980
- // TODO:
22981
- // This function will be deprecated as soon as it is no longer internally referenced.
22982
- //
22983
-
22984
-
22985
- function use(plugin, options) {
22986
- registry = _objectSpread(_objectSpread({}, registry), plugin(registry, options));
22987
- return registry;
22988
- }
22989
-
22990
- registerGenericStore('core/data', Object(__WEBPACK_IMPORTED_MODULE_5__store__["a" /* default */])(registry));
22991
- Object.entries(storeConfigs).forEach(function (_ref) {
22992
- var _ref2 = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_slicedToArray__["a" /* default */])(_ref, 2),
22993
- name = _ref2[0],
22994
- config = _ref2[1];
22995
-
22996
- return registry.registerStore(name, config);
22997
- });
22998
-
22999
- if (parent) {
23000
- parent.subscribe(globalListener);
23001
- }
23002
-
23003
- return withPlugins(registry);
23004
- }
23005
- //# sourceMappingURL=registry.js.map
23006
-
23007
- /***/ }),
23008
- /* 159 */
23009
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
23010
-
23011
- "use strict";
23012
- /* harmony export (immutable) */ __webpack_exports__["a"] = _asyncToGenerator;
23013
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
23014
- try {
23015
- var info = gen[key](arg);
23016
- var value = info.value;
23017
- } catch (error) {
23018
- reject(error);
23019
- return;
23020
- }
23021
-
23022
- if (info.done) {
23023
- resolve(value);
23024
- } else {
23025
- Promise.resolve(value).then(_next, _throw);
23026
- }
23027
- }
23028
-
23029
- function _asyncToGenerator(fn) {
23030
- return function () {
23031
- var self = this,
23032
- args = arguments;
23033
- return new Promise(function (resolve, reject) {
23034
- var gen = fn.apply(self, args);
23035
-
23036
- function _next(value) {
23037
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
23038
- }
23039
-
23040
- function _throw(err) {
23041
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
23042
- }
23043
-
23044
- _next(undefined);
23045
- });
23046
- };
23047
- }
23048
-
23049
- /***/ }),
23050
- /* 160 */
23051
- /***/ (function(module, exports, __webpack_require__) {
23052
-
23053
- "use strict";
23054
-
23055
-
23056
- function _typeof(obj) {
23057
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
23058
- _typeof = function (obj) {
23059
- return typeof obj;
23060
- };
23061
- } else {
23062
- _typeof = function (obj) {
23063
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
23064
- };
23065
- }
23066
-
23067
- return _typeof(obj);
23068
- }
23069
-
23070
- function _classCallCheck(instance, Constructor) {
23071
- if (!(instance instanceof Constructor)) {
23072
- throw new TypeError("Cannot call a class as a function");
23073
- }
23074
- }
23075
-
23076
- function _defineProperties(target, props) {
23077
- for (var i = 0; i < props.length; i++) {
23078
- var descriptor = props[i];
23079
- descriptor.enumerable = descriptor.enumerable || false;
23080
- descriptor.configurable = true;
23081
- if ("value" in descriptor) descriptor.writable = true;
23082
- Object.defineProperty(target, descriptor.key, descriptor);
23083
- }
23084
- }
23085
-
23086
- function _createClass(Constructor, protoProps, staticProps) {
23087
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
23088
- if (staticProps) _defineProperties(Constructor, staticProps);
23089
- return Constructor;
23090
- }
23091
-
23092
- /**
23093
- * Given an instance of EquivalentKeyMap, returns its internal value pair tuple
23094
- * for a key, if one exists. The tuple members consist of the last reference
23095
- * value for the key (used in efficient subsequent lookups) and the value
23096
- * assigned for the key at the leaf node.
23097
- *
23098
- * @param {EquivalentKeyMap} instance EquivalentKeyMap instance.
23099
- * @param {*} key The key for which to return value pair.
23100
- *
23101
- * @return {?Array} Value pair, if exists.
23102
- */
23103
- function getValuePair(instance, key) {
23104
- var _map = instance._map,
23105
- _arrayTreeMap = instance._arrayTreeMap,
23106
- _objectTreeMap = instance._objectTreeMap; // Map keeps a reference to the last object-like key used to set the
23107
- // value, which can be used to shortcut immediately to the value.
23108
-
23109
- if (_map.has(key)) {
23110
- return _map.get(key);
23111
- } // Sort keys to ensure stable retrieval from tree.
23112
-
23113
-
23114
- var properties = Object.keys(key).sort(); // Tree by type to avoid conflicts on numeric object keys, empty value.
23115
-
23116
- var map = Array.isArray(key) ? _arrayTreeMap : _objectTreeMap;
23117
-
23118
- for (var i = 0; i < properties.length; i++) {
23119
- var property = properties[i];
23120
- map = map.get(property);
23121
-
23122
- if (map === undefined) {
23123
- return;
23124
- }
23125
-
23126
- var propertyValue = key[property];
23127
- map = map.get(propertyValue);
23128
-
23129
- if (map === undefined) {
23130
- return;
23131
- }
23132
- }
23133
-
23134
- var valuePair = map.get('_ekm_value');
23135
-
23136
- if (!valuePair) {
23137
- return;
23138
- } // If reached, it implies that an object-like key was set with another
23139
- // reference, so delete the reference and replace with the current.
23140
-
23141
-
23142
- _map.delete(valuePair[0]);
23143
-
23144
- valuePair[0] = key;
23145
- map.set('_ekm_value', valuePair);
23146
-
23147
- _map.set(key, valuePair);
23148
-
23149
- return valuePair;
23150
- }
23151
- /**
23152
- * Variant of a Map object which enables lookup by equivalent (deeply equal)
23153
- * object and array keys.
23154
- */
23155
-
23156
-
23157
- var EquivalentKeyMap =
23158
- /*#__PURE__*/
23159
- function () {
23160
- /**
23161
- * Constructs a new instance of EquivalentKeyMap.
23162
- *
23163
- * @param {Iterable.<*>} iterable Initial pair of key, value for map.
23164
- */
23165
- function EquivalentKeyMap(iterable) {
23166
- _classCallCheck(this, EquivalentKeyMap);
23167
-
23168
- this.clear();
23169
-
23170
- if (iterable instanceof EquivalentKeyMap) {
23171
- // Map#forEach is only means of iterating with support for IE11.
23172
- var iterablePairs = [];
23173
- iterable.forEach(function (value, key) {
23174
- iterablePairs.push([key, value]);
23175
- });
23176
- iterable = iterablePairs;
23177
- }
23178
-
23179
- if (iterable != null) {
23180
- for (var i = 0; i < iterable.length; i++) {
23181
- this.set(iterable[i][0], iterable[i][1]);
23182
- }
23183
- }
23184
- }
23185
- /**
23186
- * Accessor property returning the number of elements.
23187
- *
23188
- * @return {number} Number of elements.
23189
- */
23190
-
23191
-
23192
- _createClass(EquivalentKeyMap, [{
23193
- key: "set",
23194
-
23195
- /**
23196
- * Add or update an element with a specified key and value.
23197
- *
23198
- * @param {*} key The key of the element to add.
23199
- * @param {*} value The value of the element to add.
23200
- *
23201
- * @return {EquivalentKeyMap} Map instance.
23202
- */
23203
- value: function set(key, value) {
23204
- // Shortcut non-object-like to set on internal Map.
23205
- if (key === null || _typeof(key) !== 'object') {
23206
- this._map.set(key, value);
23207
-
23208
- return this;
23209
- } // Sort keys to ensure stable assignment into tree.
23210
-
23211
-
23212
- var properties = Object.keys(key).sort();
23213
- var valuePair = [key, value]; // Tree by type to avoid conflicts on numeric object keys, empty value.
23214
-
23215
- var map = Array.isArray(key) ? this._arrayTreeMap : this._objectTreeMap;
23216
-
23217
- for (var i = 0; i < properties.length; i++) {
23218
- var property = properties[i];
23219
-
23220
- if (!map.has(property)) {
23221
- map.set(property, new EquivalentKeyMap());
23222
- }
23223
-
23224
- map = map.get(property);
23225
- var propertyValue = key[property];
23226
-
23227
- if (!map.has(propertyValue)) {
23228
- map.set(propertyValue, new EquivalentKeyMap());
23229
- }
23230
-
23231
- map = map.get(propertyValue);
23232
- } // If an _ekm_value exists, there was already an equivalent key. Before
23233
- // overriding, ensure that the old key reference is removed from map to
23234
- // avoid memory leak of accumulating equivalent keys. This is, in a
23235
- // sense, a poor man's WeakMap, while still enabling iterability.
23236
-
23237
-
23238
- var previousValuePair = map.get('_ekm_value');
23239
-
23240
- if (previousValuePair) {
23241
- this._map.delete(previousValuePair[0]);
23242
- }
23243
-
23244
- map.set('_ekm_value', valuePair);
23245
-
23246
- this._map.set(key, valuePair);
23247
-
23248
- return this;
23249
- }
23250
- /**
23251
- * Returns a specified element.
23252
- *
23253
- * @param {*} key The key of the element to return.
23254
- *
23255
- * @return {?*} The element associated with the specified key or undefined
23256
- * if the key can't be found.
23257
- */
23258
-
23259
- }, {
23260
- key: "get",
23261
- value: function get(key) {
23262
- // Shortcut non-object-like to get from internal Map.
23263
- if (key === null || _typeof(key) !== 'object') {
23264
- return this._map.get(key);
23265
- }
23266
-
23267
- var valuePair = getValuePair(this, key);
23268
-
23269
- if (valuePair) {
23270
- return valuePair[1];
23271
- }
23272
- }
23273
- /**
23274
- * Returns a boolean indicating whether an element with the specified key
23275
- * exists or not.
23276
- *
23277
- * @param {*} key The key of the element to test for presence.
23278
- *
23279
- * @return {boolean} Whether an element with the specified key exists.
23280
- */
23281
-
23282
- }, {
23283
- key: "has",
23284
- value: function has(key) {
23285
- if (key === null || _typeof(key) !== 'object') {
23286
- return this._map.has(key);
23287
- } // Test on the _presence_ of the pair, not its value, as even undefined
23288
- // can be a valid member value for a key.
23289
-
23290
-
23291
- return getValuePair(this, key) !== undefined;
23292
- }
23293
- /**
23294
- * Removes the specified element.
23295
- *
23296
- * @param {*} key The key of the element to remove.
23297
- *
23298
- * @return {boolean} Returns true if an element existed and has been
23299
- * removed, or false if the element does not exist.
23300
- */
23301
-
23302
- }, {
23303
- key: "delete",
23304
- value: function _delete(key) {
23305
- if (!this.has(key)) {
23306
- return false;
23307
- } // This naive implementation will leave orphaned child trees. A better
23308
- // implementation should traverse and remove orphans.
23309
-
23310
-
23311
- this.set(key, undefined);
23312
- return true;
23313
- }
23314
- /**
23315
- * Executes a provided function once per each key/value pair, in insertion
23316
- * order.
23317
- *
23318
- * @param {Function} callback Function to execute for each element.
23319
- * @param {*} thisArg Value to use as `this` when executing
23320
- * `callback`.
23321
- */
23322
-
23323
- }, {
23324
- key: "forEach",
23325
- value: function forEach(callback) {
23326
- var _this = this;
23327
-
23328
- var thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this;
23329
-
23330
- this._map.forEach(function (value, key) {
23331
- // Unwrap value from object-like value pair.
23332
- if (key !== null && _typeof(key) === 'object') {
23333
- value = value[1];
23334
- }
23335
-
23336
- callback.call(thisArg, value, key, _this);
23337
- });
23338
- }
23339
- /**
23340
- * Removes all elements.
23341
- */
23342
-
23343
- }, {
23344
- key: "clear",
23345
- value: function clear() {
23346
- this._map = new Map();
23347
- this._arrayTreeMap = new Map();
23348
- this._objectTreeMap = new Map();
23349
- }
23350
- }, {
23351
- key: "size",
23352
- get: function get() {
23353
- return this._map.size;
23354
- }
23355
- }]);
23356
-
23357
- return EquivalentKeyMap;
23358
- }();
23359
-
23360
- module.exports = EquivalentKeyMap;
23361
-
23362
-
23363
- /***/ }),
23364
- /* 161 */
23365
- /***/ (function(module, exports, __webpack_require__) {
23366
-
23367
- "use strict";
23368
-
23369
-
23370
- Object.defineProperty(exports, "__esModule", {
23371
- value: true
23372
- });
23373
- exports.createChannel = exports.subscribe = exports.cps = exports.apply = exports.call = exports.invoke = exports.delay = exports.race = exports.join = exports.fork = exports.error = exports.all = undefined;
23374
-
23375
- var _keys = __webpack_require__(162);
23376
-
23377
- var _keys2 = _interopRequireDefault(_keys);
23378
-
23379
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23380
-
23381
- var all = exports.all = function all(value) {
23382
- return {
23383
- type: _keys2.default.all,
23384
- value: value
23385
- };
23386
- };
23387
-
23388
- var error = exports.error = function error(err) {
23389
- return {
23390
- type: _keys2.default.error,
23391
- error: err
23392
- };
23393
- };
23394
-
23395
- var fork = exports.fork = function fork(iterator) {
23396
- for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
23397
- args[_key - 1] = arguments[_key];
23398
- }
23399
-
23400
- return {
23401
- type: _keys2.default.fork,
23402
- iterator: iterator,
23403
- args: args
23404
- };
23405
- };
23406
-
23407
- var join = exports.join = function join(task) {
23408
- return {
23409
- type: _keys2.default.join,
23410
- task: task
23411
- };
23412
- };
23413
-
23414
- var race = exports.race = function race(competitors) {
23415
- return {
23416
- type: _keys2.default.race,
23417
- competitors: competitors
23418
- };
23419
- };
23420
-
23421
- var delay = exports.delay = function delay(timeout) {
23422
- return new Promise(function (resolve) {
23423
- setTimeout(function () {
23424
- return resolve(true);
23425
- }, timeout);
23426
- });
23427
- };
23428
-
23429
- var invoke = exports.invoke = function invoke(func) {
23430
- for (var _len2 = arguments.length, args = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
23431
- args[_key2 - 1] = arguments[_key2];
23432
- }
23433
-
23434
- return {
23435
- type: _keys2.default.call,
23436
- func: func,
23437
- context: null,
23438
- args: args
23439
- };
23440
- };
23441
-
23442
- var call = exports.call = function call(func, context) {
23443
- for (var _len3 = arguments.length, args = Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
23444
- args[_key3 - 2] = arguments[_key3];
23445
- }
23446
-
23447
- return {
23448
- type: _keys2.default.call,
23449
- func: func,
23450
- context: context,
23451
- args: args
23452
- };
23453
- };
23454
-
23455
- var apply = exports.apply = function apply(func, context, args) {
23456
- return {
23457
- type: _keys2.default.call,
23458
- func: func,
23459
- context: context,
23460
- args: args
23461
- };
23462
- };
23463
-
23464
- var cps = exports.cps = function cps(func) {
23465
- for (var _len4 = arguments.length, args = Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
23466
- args[_key4 - 1] = arguments[_key4];
23467
- }
23468
-
23469
- return {
23470
- type: _keys2.default.cps,
23471
- func: func,
23472
- args: args
23473
- };
23474
- };
23475
-
23476
- var subscribe = exports.subscribe = function subscribe(channel) {
23477
- return {
23478
- type: _keys2.default.subscribe,
23479
- channel: channel
23480
- };
23481
- };
23482
-
23483
- var createChannel = exports.createChannel = function createChannel(callback) {
23484
- var listeners = [];
23485
- var subscribe = function subscribe(l) {
23486
- listeners.push(l);
23487
- return function () {
23488
- return listeners.splice(listeners.indexOf(l), 1);
23489
- };
23490
- };
23491
- var next = function next(val) {
23492
- return listeners.forEach(function (l) {
23493
- return l(val);
23494
- });
23495
- };
23496
- callback(next);
23497
-
23498
- return {
23499
- subscribe: subscribe
23500
- };
23501
- };
23502
-
23503
- /***/ }),
23504
- /* 162 */
23505
- /***/ (function(module, exports, __webpack_require__) {
23506
-
23507
- "use strict";
23508
-
23509
-
23510
- Object.defineProperty(exports, "__esModule", {
23511
- value: true
23512
- });
23513
- var keys = {
23514
- all: Symbol('all'),
23515
- error: Symbol('error'),
23516
- fork: Symbol('fork'),
23517
- join: Symbol('join'),
23518
- race: Symbol('race'),
23519
- call: Symbol('call'),
23520
- cps: Symbol('cps'),
23521
- subscribe: Symbol('subscribe')
23522
- };
23523
-
23524
- exports.default = keys;
23525
-
23526
- /***/ }),
23527
- /* 163 */
23528
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
23529
-
23530
- "use strict";
23531
- /* unused harmony export controls */
23532
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return builtinControls; });
23533
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(13);
23534
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__ = __webpack_require__(21);
23535
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__factory__ = __webpack_require__(164);
23536
-
23537
-
23538
-
23539
- var _builtinControls;
23540
-
23541
- /**
23542
- * Internal dependencies
23543
- */
23544
-
23545
- var SELECT = '@@data/SELECT';
23546
- var RESOLVE_SELECT = '@@data/RESOLVE_SELECT';
23547
- var DISPATCH = '@@data/DISPATCH';
23548
- /**
23549
- * Dispatches a control action for triggering a synchronous registry select.
23550
- *
23551
- * Note: This control synchronously returns the current selector value, triggering the
23552
- * resolution, but not waiting for it.
23553
- *
23554
- * @param {string} storeKey The key for the store the selector belongs to.
23555
- * @param {string} selectorName The name of the selector.
23556
- * @param {Array} args Arguments for the selector.
23557
- *
23558
- * @example
23559
- * ```js
23560
- * import { controls } from '@wordpress/data';
23561
- *
23562
- * // Action generator using `select`.
23563
- * export function* myAction() {
23564
- * const isEditorSideBarOpened = yield controls.select( 'core/edit-post', 'isEditorSideBarOpened' );
23565
- * // Do stuff with the result from the `select`.
23566
- * }
23567
- * ```
23568
- *
23569
- * @return {Object} The control descriptor.
23570
- */
23571
-
23572
- function select(storeKey, selectorName) {
23573
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
23574
- args[_key - 2] = arguments[_key];
23575
- }
23576
-
23577
- return {
23578
- type: SELECT,
23579
- storeKey: storeKey,
23580
- selectorName: selectorName,
23581
- args: args
23582
- };
23583
- }
23584
- /**
23585
- * Dispatches a control action for triggering and resolving a registry select.
23586
- *
23587
- * Note: when this control action is handled, it automatically considers
23588
- * selectors that may have a resolver. In such case, it will return a `Promise` that resolves
23589
- * after the selector finishes resolving, with the final result value.
23590
- *
23591
- * @param {string} storeKey The key for the store the selector belongs to
23592
- * @param {string} selectorName The name of the selector
23593
- * @param {Array} args Arguments for the selector.
23594
- *
23595
- * @example
23596
- * ```js
23597
- * import { controls } from '@wordpress/data';
23598
- *
23599
- * // Action generator using resolveSelect
23600
- * export function* myAction() {
23601
- * const isSidebarOpened = yield controls.resolveSelect( 'core/edit-post', 'isEditorSideBarOpened' );
23602
- * // do stuff with the result from the select.
23603
- * }
23604
- * ```
23605
- *
23606
- * @return {Object} The control descriptor.
23607
- */
23608
-
23609
-
23610
- function resolveSelect(storeKey, selectorName) {
23611
- for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
23612
- args[_key2 - 2] = arguments[_key2];
23613
- }
23614
-
23615
- return {
23616
- type: RESOLVE_SELECT,
23617
- storeKey: storeKey,
23618
- selectorName: selectorName,
23619
- args: args
23620
- };
23621
- }
23622
- /**
23623
- * Dispatches a control action for triggering a registry dispatch.
23624
- *
23625
- * @param {string} storeKey The key for the store the action belongs to
23626
- * @param {string} actionName The name of the action to dispatch
23627
- * @param {Array} args Arguments for the dispatch action.
23628
- *
23629
- * @example
23630
- * ```js
23631
- * import { controls } from '@wordpress/data-controls';
23632
- *
23633
- * // Action generator using dispatch
23634
- * export function* myAction() {
23635
- * yield controls.dispatch( 'core/edit-post', 'togglePublishSidebar' );
23636
- * // do some other things.
23637
- * }
23638
- * ```
23639
- *
23640
- * @return {Object} The control descriptor.
23641
- */
23642
-
23643
-
23644
- function dispatch(storeKey, actionName) {
23645
- for (var _len3 = arguments.length, args = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
23646
- args[_key3 - 2] = arguments[_key3];
23647
- }
23648
-
23649
- return {
23650
- type: DISPATCH,
23651
- storeKey: storeKey,
23652
- actionName: actionName,
23653
- args: args
23654
- };
23655
- }
23656
-
23657
- var controls = {
23658
- select: select,
23659
- resolveSelect: resolveSelect,
23660
- dispatch: dispatch
23661
- };
23662
- var builtinControls = (_builtinControls = {}, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_builtinControls, SELECT, Object(__WEBPACK_IMPORTED_MODULE_2__factory__["a" /* createRegistryControl */])(function (registry) {
23663
- return function (_ref) {
23664
- var _registry$select;
23665
-
23666
- var storeKey = _ref.storeKey,
23667
- selectorName = _ref.selectorName,
23668
- args = _ref.args;
23669
- return (_registry$select = registry.select(storeKey))[selectorName].apply(_registry$select, Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(args));
23670
- };
23671
- })), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_builtinControls, RESOLVE_SELECT, Object(__WEBPACK_IMPORTED_MODULE_2__factory__["a" /* createRegistryControl */])(function (registry) {
23672
- return function (_ref2) {
23673
- var _registry$method;
23674
-
23675
- var storeKey = _ref2.storeKey,
23676
- selectorName = _ref2.selectorName,
23677
- args = _ref2.args;
23678
- var method = registry.select(storeKey)[selectorName].hasResolver ? '__experimentalResolveSelect' : 'select';
23679
- return (_registry$method = registry[method](storeKey))[selectorName].apply(_registry$method, Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(args));
23680
- };
23681
- })), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(_builtinControls, DISPATCH, Object(__WEBPACK_IMPORTED_MODULE_2__factory__["a" /* createRegistryControl */])(function (registry) {
23682
- return function (_ref3) {
23683
- var _registry$dispatch;
23684
-
23685
- var storeKey = _ref3.storeKey,
23686
- actionName = _ref3.actionName,
23687
- args = _ref3.args;
23688
- return (_registry$dispatch = registry.dispatch(storeKey))[actionName].apply(_registry$dispatch, Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(args));
23689
- };
23690
- })), _builtinControls);
23691
- //# sourceMappingURL=controls.js.map
23692
-
23693
- /***/ }),
23694
- /* 164 */
23695
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
23696
-
23697
- "use strict";
23698
- /* unused harmony export createRegistrySelector */
23699
- /* harmony export (immutable) */ __webpack_exports__["a"] = createRegistryControl;
23700
- /**
23701
- * Creates a selector function that takes additional curried argument with the
23702
- * registry `select` function. While a regular selector has signature
23703
- * ```js
23704
- * ( state, ...selectorArgs ) => ( result )
23705
- * ```
23706
- * that allows to select data from the store's `state`, a registry selector
23707
- * has signature:
23708
- * ```js
23709
- * ( select ) => ( state, ...selectorArgs ) => ( result )
23710
- * ```
23711
- * that supports also selecting from other registered stores.
23712
- *
23713
- * @example
23714
- * ```js
23715
- * const getCurrentPostId = createRegistrySelector( ( select ) => ( state ) => {
23716
- * return select( 'core/editor' ).getCurrentPostId();
23717
- * } );
23718
- *
23719
- * const getPostEdits = createRegistrySelector( ( select ) => ( state ) => {
23720
- * // calling another registry selector just like any other function
23721
- * const postType = getCurrentPostType( state );
23722
- * const postId = getCurrentPostId( state );
23723
- * return select( 'core' ).getEntityRecordEdits( 'postType', postType, postId );
23724
- * } );
23725
- * ```
23726
- *
23727
- * Note how the `getCurrentPostId` selector can be called just like any other function,
23728
- * (it works even inside a regular non-registry selector) and we don't need to pass the
23729
- * registry as argument. The registry binding happens automatically when registering the selector
23730
- * with a store.
23731
- *
23732
- * @param {Function} registrySelector Function receiving a registry `select`
23733
- * function and returning a state selector.
23734
- *
23735
- * @return {Function} Registry selector that can be registered with a store.
23736
- */
23737
- function createRegistrySelector(registrySelector) {
23738
- // create a selector function that is bound to the registry referenced by `selector.registry`
23739
- // and that has the same API as a regular selector. Binding it in such a way makes it
23740
- // possible to call the selector directly from another selector.
23741
- var selector = function selector() {
23742
- return registrySelector(selector.registry.select).apply(void 0, arguments);
23743
- };
23744
- /**
23745
- * Flag indicating that the selector is a registry selector that needs the correct registry
23746
- * reference to be assigned to `selecto.registry` to make it work correctly.
23747
- * be mapped as a registry selector.
23748
- *
23749
- * @type {boolean}
23750
- */
23751
-
23752
-
23753
- selector.isRegistrySelector = true;
23754
- return selector;
23755
- }
23756
- /**
23757
- * Creates a control function that takes additional curried argument with the `registry` object.
23758
- * While a regular control has signature
23759
- * ```js
23760
- * ( action ) => ( iteratorOrPromise )
23761
- * ```
23762
- * where the control works with the `action` that it's bound to, a registry control has signature:
23763
- * ```js
23764
- * ( registry ) => ( action ) => ( iteratorOrPromise )
23765
- * ```
23766
- * A registry control is typically used to select data or dispatch an action to a registered
23767
- * store.
23768
- *
23769
- * When registering a control created with `createRegistryControl` with a store, the store
23770
- * knows which calling convention to use when executing the control.
23771
- *
23772
- * @param {Function} registryControl Function receiving a registry object and returning a control.
23773
- *
23774
- * @return {Function} Registry control that can be registered with a store.
23775
- */
23776
-
23777
- function createRegistryControl(registryControl) {
23778
- registryControl.isRegistryControl = true;
23779
- return registryControl;
23780
- }
23781
- //# sourceMappingURL=factory.js.map
23782
-
23783
- /***/ }),
23784
- /* 165 */
23785
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
23786
-
23787
- "use strict";
23788
- /**
23789
- * Validate a namespace string.
23790
- *
23791
- * @param {string} namespace The namespace to validate - should take the form
23792
- * `vendor/plugin/function`.
23793
- *
23794
- * @return {boolean} Whether the namespace is valid.
23795
- */
23796
- function validateNamespace(namespace) {
23797
- if ('string' !== typeof namespace || '' === namespace) {
23798
- // eslint-disable-next-line no-console
23799
- console.error('The namespace must be a non-empty string.');
23800
- return false;
23801
- }
23802
-
23803
- if (!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(namespace)) {
23804
- // eslint-disable-next-line no-console
23805
- console.error('The namespace can only contain numbers, letters, dashes, periods, underscores and slashes.');
23806
- return false;
23807
- }
23808
-
23809
- return true;
23810
- }
23811
-
23812
- /* harmony default export */ __webpack_exports__["a"] = (validateNamespace);
23813
- //# sourceMappingURL=validateNamespace.js.map
23814
-
23815
- /***/ }),
23816
- /* 166 */
23817
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
23818
-
23819
- "use strict";
23820
- /* harmony export (immutable) */ __webpack_exports__["a"] = RawHTML;
23821
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(13);
23822
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
23823
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__react__ = __webpack_require__(106);
23824
-
23825
-
23826
-
23827
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
23828
-
23829
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
23830
-
23831
- /**
23832
- * Internal dependencies
23833
- */
23834
- // Disable reason: JSDoc linter doesn't seem to parse the union (`&`) correctly.
23835
-
23836
- /** @typedef {{children: string} & import('react').ComponentPropsWithoutRef<'div'>} RawHTMLProps */
23837
-
23838
- /**
23839
- * Component used as equivalent of Fragment with unescaped HTML, in cases where
23840
- * it is desirable to render dangerous HTML without needing a wrapper element.
23841
- * To preserve additional props, a `div` wrapper _will_ be created if any props
23842
- * aside from `children` are passed.
23843
- *
23844
- * @param {RawHTMLProps} props Children should be a string of HTML. Other props
23845
- * will be passed through to div wrapper.
23846
- *
23847
- * @return {JSX.Element} Dangerously-rendering component.
23848
- */
23849
-
23850
- function RawHTML(_ref) {
23851
- var children = _ref.children,
23852
- props = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(_ref, ["children"]);
23853
-
23854
- // The DIV wrapper will be stripped by serializer, unless there are
23855
- // non-children props present.
23856
- return Object(__WEBPACK_IMPORTED_MODULE_2__react__["e" /* createElement */])('div', _objectSpread({
23857
- dangerouslySetInnerHTML: {
23858
- __html: children
23859
- }
23860
- }, props));
23861
- }
23862
- //# sourceMappingURL=raw-html.js.map
23863
-
23864
- /***/ }),
23865
- /* 167 */
23866
- /***/ (function(module, exports, __webpack_require__) {
23867
-
23868
- "use strict";
23869
-
23870
-
23871
- /**
23872
- * Internal dependencies;
23873
- */
23874
- var isShallowEqualObjects = __webpack_require__( 560 );
23875
- var isShallowEqualArrays = __webpack_require__( 561 );
23876
-
23877
- var isArray = Array.isArray;
23878
-
23879
- /**
23880
- * @typedef {Record<string, any>} ComparableObject
23881
- */
23882
-
23883
- /**
23884
- * Returns true if the two arrays or objects are shallow equal, or false
23885
- * otherwise.
23886
- *
23887
- * @param {any[]|ComparableObject} a First object or array to compare.
23888
- * @param {any[]|ComparableObject} b Second object or array to compare.
23889
- *
23890
- * @return {boolean} Whether the two values are shallow equal.
23891
- */
23892
- function isShallowEqual( a, b ) {
23893
- if ( a && b ) {
23894
- if ( a.constructor === Object && b.constructor === Object ) {
23895
- return isShallowEqualObjects( a, b );
23896
- } else if ( isArray( a ) && isArray( b ) ) {
23897
- return isShallowEqualArrays( a, b );
23898
- }
23899
- }
23900
-
23901
- return a === b;
23902
- }
23903
-
23904
- module.exports = isShallowEqual;
23905
- module.exports.isShallowEqualObjects = isShallowEqualObjects;
23906
- module.exports.isShallowEqualArrays = isShallowEqualArrays;
23907
-
23908
-
23909
- /***/ }),
23910
- /* 168 */
23911
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
23912
-
23913
- "use strict";
23914
- /* harmony export (immutable) */ __webpack_exports__["a"] = useInstanceId;
23915
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(15);
23916
- /**
23917
- * WordPress dependencies
23918
- */
23919
-
23920
- var instanceMap = new WeakMap();
23921
- /**
23922
- * Creates a new id for a given object.
23923
- *
23924
- * @param {Object} object Object reference to create an id for.
23925
- */
23926
-
23927
- function createId(object) {
23928
- var instances = instanceMap.get(object) || 0;
23929
- instanceMap.set(object, instances + 1);
23930
- return instances;
23931
- }
23932
- /**
23933
- * Provides a unique instance ID.
23934
- *
23935
- * @param {Object} object Object reference to create an id for.
23936
- * @param {string} prefix Prefix for the unique id.
23937
- */
23938
-
23939
-
23940
- function useInstanceId(object, prefix) {
23941
- return Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["j" /* useMemo */])(function () {
23942
- var id = createId(object);
23943
- return prefix ? "".concat(prefix, "-").concat(id) : id;
23944
- }, [object]);
23945
- }
23946
- //# sourceMappingURL=index.js.map
23947
-
23948
- /***/ }),
23949
- /* 169 */
23950
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
23951
-
23952
- "use strict";
23953
- /* harmony export (immutable) */ __webpack_exports__["a"] = usePrevious;
23954
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(15);
23955
- /**
23956
- * WordPress dependencies
23957
- */
23958
-
23959
- /**
23960
- * Use something's value from the previous render.
23961
- * Based on https://usehooks.com/usePrevious/.
23962
- *
23963
- * @template T
23964
- *
23965
- * @param {T} value The value to track.
23966
- *
23967
- * @return {T|undefined} The value from the previous render.
23968
- */
23969
-
23970
- function usePrevious(value) {
23971
- // Disable reason: without an explicit type detail, the type of ref will be
23972
- // inferred based on the initial useRef argument, which is undefined.
23973
- // https://github.com/WordPress/gutenberg/pull/22597#issuecomment-633588366
23974
-
23975
- /* eslint-disable jsdoc/no-undefined-types */
23976
- var ref = Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["l" /* useRef */])(
23977
- /** @type {T|undefined} */
23978
- undefined);
23979
- /* eslint-enable jsdoc/no-undefined-types */
23980
- // Store current value in ref.
23981
-
23982
- Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["h" /* useEffect */])(function () {
23983
- ref.current = value;
23984
- }, [value]); // Re-run when value changes.
23985
- // Return previous value (happens before update in useEffect above).
23986
-
23987
- return ref.current;
23988
- }
23989
- //# sourceMappingURL=index.js.map
23990
-
23991
- /***/ }),
23992
- /* 170 */
23993
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
23994
-
23995
- "use strict";
23996
- /* harmony export (immutable) */ __webpack_exports__["a"] = useSelect;
23997
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_slicedToArray__ = __webpack_require__(27);
23998
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_use_memo_one__ = __webpack_require__(103);
23999
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__wordpress_priority_queue__ = __webpack_require__(102);
24000
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__wordpress_element__ = __webpack_require__(15);
24001
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__wordpress_is_shallow_equal__ = __webpack_require__(167);
24002
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__wordpress_is_shallow_equal___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_4__wordpress_is_shallow_equal__);
24003
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__registry_provider_use_registry__ = __webpack_require__(83);
24004
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__async_mode_provider_use_async_mode__ = __webpack_require__(172);
24005
-
24006
-
24007
- /**
24008
- * External dependencies
24009
- */
24010
-
24011
- /**
24012
- * WordPress dependencies
24013
- */
24014
-
24015
-
24016
-
24017
-
24018
- /**
24019
- * Internal dependencies
24020
- */
24021
-
24022
-
24023
-
24024
- /**
24025
- * Favor useLayoutEffect to ensure the store subscription callback always has
24026
- * the selector from the latest render. If a store update happens between render
24027
- * and the effect, this could cause missed/stale updates or inconsistent state.
24028
- *
24029
- * Fallback to useEffect for server rendered components because currently React
24030
- * throws a warning when using useLayoutEffect in that environment.
24031
- */
24032
-
24033
- var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? __WEBPACK_IMPORTED_MODULE_3__wordpress_element__["i" /* useLayoutEffect */] : __WEBPACK_IMPORTED_MODULE_3__wordpress_element__["h" /* useEffect */];
24034
- var renderQueue = Object(__WEBPACK_IMPORTED_MODULE_2__wordpress_priority_queue__["a" /* createQueue */])();
24035
- /**
24036
- * Custom react hook for retrieving props from registered selectors.
24037
- *
24038
- * In general, this custom React hook follows the
24039
- * [rules of hooks](https://reactjs.org/docs/hooks-rules.html).
24040
- *
24041
- * @param {Function} _mapSelect Function called on every state change. The
24042
- * returned value is exposed to the component
24043
- * implementing this hook. The function receives
24044
- * the `registry.select` method on the first
24045
- * argument and the `registry` on the second
24046
- * argument.
24047
- * @param {Array} deps If provided, this memoizes the mapSelect so the
24048
- * same `mapSelect` is invoked on every state
24049
- * change unless the dependencies change.
24050
- *
24051
- * @example
24052
- * ```js
24053
- * const { useSelect } = wp.data;
24054
- *
24055
- * function HammerPriceDisplay( { currency } ) {
24056
- * const price = useSelect( ( select ) => {
24057
- * return select( 'my-shop' ).getPrice( 'hammer', currency )
24058
- * }, [ currency ] );
24059
- * return new Intl.NumberFormat( 'en-US', {
24060
- * style: 'currency',
24061
- * currency,
24062
- * } ).format( price );
24063
- * }
24064
- *
24065
- * // Rendered in the application:
24066
- * // <HammerPriceDisplay currency="USD" />
24067
- * ```
24068
- *
24069
- * In the above example, when `HammerPriceDisplay` is rendered into an
24070
- * application, the price will be retrieved from the store state using the
24071
- * `mapSelect` callback on `useSelect`. If the currency prop changes then
24072
- * any price in the state for that currency is retrieved. If the currency prop
24073
- * doesn't change and other props are passed in that do change, the price will
24074
- * not change because the dependency is just the currency.
24075
- *
24076
- * @return {Function} A custom react hook.
24077
- */
24078
-
24079
- function useSelect(_mapSelect, deps) {
24080
- var mapSelect = Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_element__["f" /* useCallback */])(_mapSelect, deps);
24081
- var registry = Object(__WEBPACK_IMPORTED_MODULE_5__registry_provider_use_registry__["a" /* default */])();
24082
- var isAsync = Object(__WEBPACK_IMPORTED_MODULE_6__async_mode_provider_use_async_mode__["a" /* default */])(); // React can sometimes clear the `useMemo` cache.
24083
- // We use the cache-stable `useMemoOne` to avoid
24084
- // losing queues.
24085
-
24086
- var queueContext = Object(__WEBPACK_IMPORTED_MODULE_1_use_memo_one__["a" /* useMemoOne */])(function () {
24087
- return {
24088
- queue: true
24089
- };
24090
- }, [registry]);
24091
-
24092
- var _useReducer = Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_element__["k" /* useReducer */])(function (s) {
24093
- return s + 1;
24094
- }, 0),
24095
- _useReducer2 = Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_slicedToArray__["a" /* default */])(_useReducer, 2),
24096
- forceRender = _useReducer2[1];
24097
-
24098
- var latestMapSelect = Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_element__["l" /* useRef */])();
24099
- var latestIsAsync = Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_element__["l" /* useRef */])(isAsync);
24100
- var latestMapOutput = Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_element__["l" /* useRef */])();
24101
- var latestMapOutputError = Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_element__["l" /* useRef */])();
24102
- var isMountedAndNotUnsubscribing = Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_element__["l" /* useRef */])();
24103
- var mapOutput;
24104
-
24105
- try {
24106
- if (latestMapSelect.current !== mapSelect || latestMapOutputError.current) {
24107
- mapOutput = mapSelect(registry.select, registry);
24108
- } else {
24109
- mapOutput = latestMapOutput.current;
24110
- }
24111
- } catch (error) {
24112
- var errorMessage = "An error occurred while running 'mapSelect': ".concat(error.message);
24113
-
24114
- if (latestMapOutputError.current) {
24115
- errorMessage += "\nThe error may be correlated with this previous error:\n";
24116
- errorMessage += "".concat(latestMapOutputError.current.stack, "\n\n");
24117
- errorMessage += 'Original stack trace:';
24118
- throw new Error(errorMessage);
24119
- } else {
24120
- // eslint-disable-next-line no-console
24121
- console.error(errorMessage);
24122
- }
24123
- }
24124
-
24125
- useIsomorphicLayoutEffect(function () {
24126
- latestMapSelect.current = mapSelect;
24127
- latestMapOutput.current = mapOutput;
24128
- latestMapOutputError.current = undefined;
24129
- isMountedAndNotUnsubscribing.current = true; // This has to run after the other ref updates
24130
- // to avoid using stale values in the flushed
24131
- // callbacks or potentially overwriting a
24132
- // changed `latestMapOutput.current`.
24133
-
24134
- if (latestIsAsync.current !== isAsync) {
24135
- latestIsAsync.current = isAsync;
24136
- renderQueue.flush(queueContext);
24137
- }
24138
- });
24139
- useIsomorphicLayoutEffect(function () {
24140
- var onStoreChange = function onStoreChange() {
24141
- if (isMountedAndNotUnsubscribing.current) {
24142
- try {
24143
- var newMapOutput = latestMapSelect.current(registry.select, registry);
24144
-
24145
- if (__WEBPACK_IMPORTED_MODULE_4__wordpress_is_shallow_equal___default()(latestMapOutput.current, newMapOutput)) {
24146
- return;
24147
- }
24148
-
24149
- latestMapOutput.current = newMapOutput;
24150
- } catch (error) {
24151
- latestMapOutputError.current = error;
24152
- }
24153
-
24154
- forceRender();
24155
- }
24156
- }; // catch any possible state changes during mount before the subscription
24157
- // could be set.
24158
-
24159
-
24160
- if (latestIsAsync.current) {
24161
- renderQueue.add(queueContext, onStoreChange);
24162
- } else {
24163
- onStoreChange();
24164
- }
24165
-
24166
- var unsubscribe = registry.subscribe(function () {
24167
- if (latestIsAsync.current) {
24168
- renderQueue.add(queueContext, onStoreChange);
24169
- } else {
24170
- onStoreChange();
24171
- }
24172
- });
24173
- return function () {
24174
- isMountedAndNotUnsubscribing.current = false;
24175
- unsubscribe();
24176
- renderQueue.flush(queueContext);
24177
- };
24178
- }, [registry]);
24179
- return mapOutput;
24180
- }
24181
- //# sourceMappingURL=index.js.map
24182
-
24183
- /***/ }),
24184
- /* 171 */
24185
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
24186
-
24187
- "use strict";
24188
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Context; });
24189
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return RegistryConsumer; });
24190
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(15);
24191
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__default_registry__ = __webpack_require__(157);
24192
- /**
24193
- * WordPress dependencies
24194
- */
24195
-
24196
- /**
24197
- * Internal dependencies
24198
- */
24199
-
24200
-
24201
- var Context = Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["c" /* createContext */])(__WEBPACK_IMPORTED_MODULE_1__default_registry__["a" /* default */]);
24202
- var Consumer = Context.Consumer,
24203
- Provider = Context.Provider;
24204
- /**
24205
- * A custom react Context consumer exposing the provided `registry` to
24206
- * children components. Used along with the RegistryProvider.
24207
- *
24208
- * You can read more about the react context api here:
24209
- * https://reactjs.org/docs/context.html#contextprovider
24210
- *
24211
- * @example
24212
- * ```js
24213
- * const {
24214
- * RegistryProvider,
24215
- * RegistryConsumer,
24216
- * createRegistry
24217
- * } = wp.data;
24218
- *
24219
- * const registry = createRegistry( {} );
24220
- *
24221
- * const App = ( { props } ) => {
24222
- * return <RegistryProvider value={ registry }>
24223
- * <div>Hello There</div>
24224
- * <RegistryConsumer>
24225
- * { ( registry ) => (
24226
- * <ComponentUsingRegistry
24227
- * { ...props }
24228
- * registry={ registry }
24229
- * ) }
24230
- * </RegistryConsumer>
24231
- * </RegistryProvider>
24232
- * }
24233
- * ```
24234
- */
24235
-
24236
- var RegistryConsumer = Consumer;
24237
- /**
24238
- * A custom Context provider for exposing the provided `registry` to children
24239
- * components via a consumer.
24240
- *
24241
- * See <a name="#RegistryConsumer">RegistryConsumer</a> documentation for
24242
- * example.
24243
- */
24244
-
24245
- /* unused harmony default export */ var _unused_webpack_default_export = (Provider);
24246
- //# sourceMappingURL=context.js.map
24247
-
24248
- /***/ }),
24249
- /* 172 */
24250
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
24251
-
24252
- "use strict";
24253
- /* harmony export (immutable) */ __webpack_exports__["a"] = useAsyncMode;
24254
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(15);
24255
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__context__ = __webpack_require__(173);
24256
- /**
24257
- * WordPress dependencies
24258
- */
24259
-
24260
- /**
24261
- * Internal dependencies
24262
- */
24263
-
24264
-
24265
- function useAsyncMode() {
24266
- return Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["g" /* useContext */])(__WEBPACK_IMPORTED_MODULE_1__context__["a" /* Context */]);
24267
- }
24268
- //# sourceMappingURL=use-async-mode.js.map
24269
-
24270
- /***/ }),
24271
- /* 173 */
24272
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
24273
-
24274
- "use strict";
24275
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Context; });
24276
- /* unused harmony export AsyncModeConsumer */
24277
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(15);
24278
- /**
24279
- * WordPress dependencies
24280
- */
24281
-
24282
- var Context = Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["c" /* createContext */])(false);
24283
- var Consumer = Context.Consumer,
24284
- Provider = Context.Provider;
24285
- var AsyncModeConsumer = Consumer;
24286
- /**
24287
- * Context Provider Component used to switch the data module component rerendering
24288
- * between Sync and Async modes.
24289
- *
24290
- * @example
24291
- *
24292
- * ```js
24293
- * import { useSelect, AsyncModeProvider } from '@wordpress/data';
24294
- *
24295
- * function BlockCount() {
24296
- * const count = useSelect( ( select ) => {
24297
- * return select( 'core/block-editor' ).getBlockCount()
24298
- * }, [] );
24299
- *
24300
- * return count;
24301
- * }
24302
- *
24303
- * function App() {
24304
- * return (
24305
- * <AsyncModeProvider value={ true }>
24306
- * <BlockCount />
24307
- * </AsyncModeProvider>
24308
- * );
24309
- * }
24310
- * ```
24311
- *
24312
- * In this example, the BlockCount component is rerendered asynchronously.
24313
- * It means if a more critical task is being performed (like typing in an input),
24314
- * the rerendering is delayed until the browser becomes IDLE.
24315
- * It is possible to nest multiple levels of AsyncModeProvider to fine-tune the rendering behavior.
24316
- *
24317
- * @param {boolean} props.value Enable Async Mode.
24318
- * @return {WPComponent} The component to be rendered.
24319
- */
24320
-
24321
- /* unused harmony default export */ var _unused_webpack_default_export = (Provider);
24322
- //# sourceMappingURL=context.js.map
24323
-
24324
- /***/ }),
24325
- /* 174 */
24326
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
24327
-
24328
- "use strict";
24329
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__use_dispatch__ = __webpack_require__(577);
24330
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__use_dispatch__["a"]; });
24331
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__use_dispatch_with_map__ = __webpack_require__(578);
24332
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_1__use_dispatch_with_map__["a"]; });
24333
-
24334
-
24335
- //# sourceMappingURL=index.js.map
24336
-
24337
- /***/ }),
24338
- /* 175 */
24339
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
24340
-
24341
- "use strict";
24342
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__context__ = __webpack_require__(171);
24343
- /* unused harmony reexport RegistryProvider */
24344
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_0__context__["b"]; });
24345
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__use_registry__ = __webpack_require__(83);
24346
- /* unused harmony reexport useRegistry */
24347
-
24348
-
24349
- //# sourceMappingURL=index.js.map
24350
-
24351
- /***/ }),
24352
- /* 176 */
24353
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
24354
-
24355
- "use strict";
24356
- /* harmony export (immutable) */ __webpack_exports__["a"] = applyFormat;
24357
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_toConsumableArray__ = __webpack_require__(21);
24358
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(13);
24359
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash__ = __webpack_require__(2);
24360
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_lodash__);
24361
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__normalise_formats__ = __webpack_require__(52);
24362
-
24363
-
24364
-
24365
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
24366
-
24367
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
24368
-
24369
- /**
24370
- * External dependencies
24371
- */
24372
-
24373
- /**
24374
- * Internal dependencies
24375
- */
24376
-
24377
-
24378
- /** @typedef {import('./create').RichTextValue} RichTextValue */
24379
-
24380
- /** @typedef {import('./create').RichTextFormat} RichTextFormat */
24381
-
24382
- function replace(array, index, value) {
24383
- array = array.slice();
24384
- array[index] = value;
24385
- return array;
24386
- }
24387
- /**
24388
- * Apply a format object to a Rich Text value from the given `startIndex` to the
24389
- * given `endIndex`. Indices are retrieved from the selection if none are
24390
- * provided.
24391
- *
24392
- * @param {RichTextValue} value Value to modify.
24393
- * @param {RichTextFormat} format Format to apply.
24394
- * @param {number} [startIndex] Start index.
24395
- * @param {number} [endIndex] End index.
24396
- *
24397
- * @return {RichTextValue} A new value with the format applied.
24398
- */
24399
-
24400
-
24401
- function applyFormat(value, format) {
24402
- var startIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : value.start;
24403
- var endIndex = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : value.end;
24404
- var formats = value.formats,
24405
- activeFormats = value.activeFormats;
24406
- var newFormats = formats.slice(); // The selection is collapsed.
24407
-
24408
- if (startIndex === endIndex) {
24409
- var startFormat = Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["find"])(newFormats[startIndex], {
24410
- type: format.type
24411
- }); // If the caret is at a format of the same type, expand start and end to
24412
- // the edges of the format. This is useful to apply new attributes.
24413
-
24414
- if (startFormat) {
24415
- var index = newFormats[startIndex].indexOf(startFormat);
24416
-
24417
- while (newFormats[startIndex] && newFormats[startIndex][index] === startFormat) {
24418
- newFormats[startIndex] = replace(newFormats[startIndex], index, format);
24419
- startIndex--;
24420
- }
24421
-
24422
- endIndex++;
24423
-
24424
- while (newFormats[endIndex] && newFormats[endIndex][index] === startFormat) {
24425
- newFormats[endIndex] = replace(newFormats[endIndex], index, format);
24426
- endIndex++;
24427
- }
24428
- }
24429
- } else {
24430
- // Determine the highest position the new format can be inserted at.
24431
- var position = +Infinity;
24432
-
24433
- for (var _index = startIndex; _index < endIndex; _index++) {
24434
- if (newFormats[_index]) {
24435
- newFormats[_index] = newFormats[_index].filter(function (_ref) {
24436
- var type = _ref.type;
24437
- return type !== format.type;
24438
- });
24439
- var length = newFormats[_index].length;
24440
-
24441
- if (length < position) {
24442
- position = length;
24443
- }
24444
- } else {
24445
- newFormats[_index] = [];
24446
- position = 0;
24447
- }
24448
- }
24449
-
24450
- for (var _index2 = startIndex; _index2 < endIndex; _index2++) {
24451
- newFormats[_index2].splice(position, 0, format);
24452
- }
24453
- }
24454
-
24455
- return Object(__WEBPACK_IMPORTED_MODULE_3__normalise_formats__["a" /* normaliseFormats */])(_objectSpread(_objectSpread({}, value), {}, {
24456
- formats: newFormats,
24457
- // Always revise active formats. This serves as a placeholder for new
24458
- // inputs with the format so new input appears with the format applied,
24459
- // and ensures a format of the same type uses the latest values.
24460
- activeFormats: [].concat(Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_2_lodash__["reject"])(activeFormats, {
24461
- type: format.type
24462
- })), [format])
24463
- }));
24464
- }
24465
- //# sourceMappingURL=apply-format.js.map
24466
-
24467
- /***/ }),
24468
- /* 177 */
24469
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
24470
-
24471
- "use strict";
24472
- /* harmony export (immutable) */ __webpack_exports__["a"] = mergePair;
24473
- /* unused harmony export concat */
24474
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__normalise_formats__ = __webpack_require__(52);
24475
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__create__ = __webpack_require__(53);
24476
- /**
24477
- * Internal dependencies
24478
- */
24479
-
24480
-
24481
- /** @typedef {import('./create').RichTextValue} RichTextValue */
24482
-
24483
- /**
24484
- * Concats a pair of rich text values. Not that this mutates `a` and does NOT
24485
- * normalise formats!
24486
- *
24487
- * @param {Object} a Value to mutate.
24488
- * @param {Object} b Value to add read from.
24489
- *
24490
- * @return {Object} `a`, mutated.
24491
- */
24492
-
24493
- function mergePair(a, b) {
24494
- a.formats = a.formats.concat(b.formats);
24495
- a.replacements = a.replacements.concat(b.replacements);
24496
- a.text += b.text;
24497
- return a;
24498
- }
24499
- /**
24500
- * Combine all Rich Text values into one. This is similar to
24501
- * `String.prototype.concat`.
24502
- *
24503
- * @param {...RichTextValue} values Objects to combine.
24504
- *
24505
- * @return {RichTextValue} A new value combining all given records.
24506
- */
24507
-
24508
- function concat() {
24509
- for (var _len = arguments.length, values = new Array(_len), _key = 0; _key < _len; _key++) {
24510
- values[_key] = arguments[_key];
24511
- }
24512
-
24513
- return Object(__WEBPACK_IMPORTED_MODULE_0__normalise_formats__["a" /* normaliseFormats */])(values.reduce(mergePair, Object(__WEBPACK_IMPORTED_MODULE_1__create__["a" /* create */])()));
24514
- }
24515
- //# sourceMappingURL=concat.js.map
24516
-
24517
- /***/ }),
24518
- /* 178 */
24519
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
24520
-
24521
- "use strict";
24522
- /* harmony export (immutable) */ __webpack_exports__["a"] = getActiveObject;
24523
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__special_characters__ = __webpack_require__(30);
24524
- /**
24525
- * Internal dependencies
24526
- */
24527
-
24528
- /** @typedef {import('./create').RichTextValue} RichTextValue */
24529
-
24530
- /** @typedef {import('./create').RichTextFormat} RichTextFormat */
24531
-
24532
- /**
24533
- * Gets the active object, if there is any.
24534
- *
24535
- * @param {RichTextValue} value Value to inspect.
24536
- *
24537
- * @return {RichTextFormat|void} Active object, or undefined.
24538
- */
24539
-
24540
- function getActiveObject(_ref) {
24541
- var start = _ref.start,
24542
- end = _ref.end,
24543
- replacements = _ref.replacements,
24544
- text = _ref.text;
24545
-
24546
- if (start + 1 !== end || text[start] !== __WEBPACK_IMPORTED_MODULE_0__special_characters__["b" /* OBJECT_REPLACEMENT_CHARACTER */]) {
24547
- return;
24548
- }
24549
-
24550
- return replacements[start];
24551
- }
24552
- //# sourceMappingURL=get-active-object.js.map
24553
-
24554
- /***/ }),
24555
- /* 179 */
24556
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
24557
-
24558
- "use strict";
24559
- /* harmony export (immutable) */ __webpack_exports__["a"] = getTextContent;
24560
- /** @typedef {import('./create').RichTextValue} RichTextValue */
24561
-
24562
- /**
24563
- * Get the textual content of a Rich Text value. This is similar to
24564
- * `Element.textContent`.
24565
- *
24566
- * @param {RichTextValue} value Value to use.
24567
- *
24568
- * @return {string} The text content.
24569
- */
24570
- function getTextContent(_ref) {
24571
- var text = _ref.text;
24572
- return text;
24573
- }
24574
- //# sourceMappingURL=get-text-content.js.map
24575
-
24576
- /***/ }),
24577
- /* 180 */
24578
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
24579
-
24580
- "use strict";
24581
- /* unused harmony export isEmpty */
24582
- /* harmony export (immutable) */ __webpack_exports__["a"] = isEmptyLine;
24583
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__special_characters__ = __webpack_require__(30);
24584
- /**
24585
- * Internal dependencies
24586
- */
24587
-
24588
- /** @typedef {import('./create').RichTextValue} RichTextValue */
24589
-
24590
- /**
24591
- * Check if a Rich Text value is Empty, meaning it contains no text or any
24592
- * objects (such as images).
24593
- *
24594
- * @param {RichTextValue} value Value to use.
24595
- *
24596
- * @return {boolean} True if the value is empty, false if not.
24597
- */
24598
-
24599
- function isEmpty(_ref) {
24600
- var text = _ref.text;
24601
- return text.length === 0;
24602
- }
24603
- /**
24604
- * Check if the current collapsed selection is on an empty line in case of a
24605
- * multiline value.
24606
- *
24607
- * @param {RichTextValue} value Value te check.
24608
- *
24609
- * @return {boolean} True if the line is empty, false if not.
24610
- */
24611
-
24612
- function isEmptyLine(_ref2) {
24613
- var text = _ref2.text,
24614
- start = _ref2.start,
24615
- end = _ref2.end;
24616
-
24617
- if (start !== end) {
24618
- return false;
24619
- }
24620
-
24621
- if (text.length === 0) {
24622
- return true;
24623
- }
24624
-
24625
- if (start === 0 && text.slice(0, 1) === __WEBPACK_IMPORTED_MODULE_0__special_characters__["a" /* LINE_SEPARATOR */]) {
24626
- return true;
24627
- }
24628
-
24629
- if (start === text.length && text.slice(-1) === __WEBPACK_IMPORTED_MODULE_0__special_characters__["a" /* LINE_SEPARATOR */]) {
24630
- return true;
24631
- }
24632
-
24633
- return text.slice(start - 1, end + 1) === "".concat(__WEBPACK_IMPORTED_MODULE_0__special_characters__["a" /* LINE_SEPARATOR */]).concat(__WEBPACK_IMPORTED_MODULE_0__special_characters__["a" /* LINE_SEPARATOR */]);
24634
- }
24635
- //# sourceMappingURL=is-empty.js.map
24636
-
24637
- /***/ }),
24638
- /* 181 */
24639
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
24640
-
24641
- "use strict";
24642
- /* harmony export (immutable) */ __webpack_exports__["a"] = replace;
24643
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_typeof__ = __webpack_require__(39);
24644
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__normalise_formats__ = __webpack_require__(52);
24645
-
24646
-
24647
- /**
24648
- * Internal dependencies
24649
- */
24650
-
24651
- /** @typedef {import('./create').RichTextValue} RichTextValue */
24652
-
24653
- /**
24654
- * Search a Rich Text value and replace the match(es) with `replacement`. This
24655
- * is similar to `String.prototype.replace`.
24656
- *
24657
- * @param {RichTextValue} value The value to modify.
24658
- * @param {RegExp|string} pattern A RegExp object or literal. Can also be
24659
- * a string. It is treated as a verbatim
24660
- * string and is not interpreted as a
24661
- * regular expression. Only the first
24662
- * occurrence will be replaced.
24663
- * @param {Function|string} replacement The match or matches are replaced with
24664
- * the specified or the value returned by
24665
- * the specified function.
24666
- *
24667
- * @return {RichTextValue} A new value with replacements applied.
24668
- */
24669
-
24670
- function replace(_ref, pattern, replacement) {
24671
- var formats = _ref.formats,
24672
- replacements = _ref.replacements,
24673
- text = _ref.text,
24674
- start = _ref.start,
24675
- end = _ref.end;
24676
- text = text.replace(pattern, function (match) {
24677
- for (var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
24678
- rest[_key - 1] = arguments[_key];
24679
- }
24680
-
24681
- var offset = rest[rest.length - 2];
24682
- var newText = replacement;
24683
- var newFormats;
24684
- var newReplacements;
24685
-
24686
- if (typeof newText === 'function') {
24687
- newText = replacement.apply(void 0, [match].concat(rest));
24688
- }
24689
-
24690
- if (Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_typeof__["a" /* default */])(newText) === 'object') {
24691
- newFormats = newText.formats;
24692
- newReplacements = newText.replacements;
24693
- newText = newText.text;
24694
- } else {
24695
- newFormats = Array(newText.length);
24696
- newReplacements = Array(newText.length);
24697
-
24698
- if (formats[offset]) {
24699
- newFormats = newFormats.fill(formats[offset]);
24700
- }
24701
- }
24702
-
24703
- formats = formats.slice(0, offset).concat(newFormats, formats.slice(offset + match.length));
24704
- replacements = replacements.slice(0, offset).concat(newReplacements, replacements.slice(offset + match.length));
24705
-
24706
- if (start) {
24707
- start = end = offset + newText.length;
24708
- }
24709
-
24710
- return newText;
24711
- });
24712
- return Object(__WEBPACK_IMPORTED_MODULE_1__normalise_formats__["a" /* normaliseFormats */])({
24713
- formats: formats,
24714
- replacements: replacements,
24715
- text: text,
24716
- start: start,
24717
- end: end
24718
- });
24719
- }
24720
- //# sourceMappingURL=replace.js.map
24721
-
24722
- /***/ }),
24723
- /* 182 */
24724
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
24725
-
24726
- "use strict";
24727
- /* harmony export (immutable) */ __webpack_exports__["a"] = removeLineSeparator;
24728
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(13);
24729
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__special_characters__ = __webpack_require__(30);
24730
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_collapsed__ = __webpack_require__(113);
24731
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__remove__ = __webpack_require__(115);
24732
-
24733
-
24734
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
24735
-
24736
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
24737
-
24738
- /**
24739
- * Internal dependencies
24740
- */
24741
-
24742
-
24743
-
24744
- /** @typedef {import('./create').RichTextValue} RichTextValue */
24745
-
24746
- /**
24747
- * Removes a line separator character, if existing, from a Rich Text value at
24748
- * the current indices. If no line separator exists on the indices it will
24749
- * return undefined.
24750
- *
24751
- * @param {RichTextValue} value Value to modify.
24752
- * @param {boolean} backward Indicates if are removing from the start
24753
- * index or the end index.
24754
- *
24755
- * @return {RichTextValue|undefined} A new value with the line separator
24756
- * removed. Or undefined if no line separator
24757
- * is found on the position.
24758
- */
24759
-
24760
- function removeLineSeparator(value) {
24761
- var backward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
24762
- var replacements = value.replacements,
24763
- text = value.text,
24764
- start = value.start,
24765
- end = value.end;
24766
- var collapsed = Object(__WEBPACK_IMPORTED_MODULE_2__is_collapsed__["a" /* isCollapsed */])(value);
24767
- var index = start - 1;
24768
- var removeStart = collapsed ? start - 1 : start;
24769
- var removeEnd = end;
24770
-
24771
- if (!backward) {
24772
- index = end;
24773
- removeStart = start;
24774
- removeEnd = collapsed ? end + 1 : end;
24775
- }
24776
-
24777
- if (text[index] !== __WEBPACK_IMPORTED_MODULE_1__special_characters__["a" /* LINE_SEPARATOR */]) {
24778
- return;
24779
- }
24780
-
24781
- var newValue; // If the line separator that is about te be removed
24782
- // contains wrappers, remove the wrappers first.
24783
-
24784
- if (collapsed && replacements[index] && replacements[index].length) {
24785
- var newReplacements = replacements.slice();
24786
- newReplacements[index] = replacements[index].slice(0, -1);
24787
- newValue = _objectSpread(_objectSpread({}, value), {}, {
24788
- replacements: newReplacements
24789
- });
24790
- } else {
24791
- newValue = Object(__WEBPACK_IMPORTED_MODULE_3__remove__["a" /* remove */])(value, removeStart, removeEnd);
24792
- }
24793
-
24794
- return newValue;
24795
- }
24796
- //# sourceMappingURL=remove-line-separator.js.map
24797
-
24798
- /***/ }),
24799
- /* 183 */
24800
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
24801
-
24802
- "use strict";
24803
- /* unused harmony export toDom */
24804
- /* harmony export (immutable) */ __webpack_exports__["a"] = apply;
24805
- /* unused harmony export applyValue */
24806
- /* unused harmony export applySelection */
24807
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(13);
24808
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__ = __webpack_require__(21);
24809
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__to_tree__ = __webpack_require__(184);
24810
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__create_element__ = __webpack_require__(110);
24811
-
24812
-
24813
-
24814
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
24815
-
24816
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
24817
-
24818
- /**
24819
- * Internal dependencies
24820
- */
24821
-
24822
-
24823
- /** @typedef {import('./create').RichTextValue} RichTextValue */
24824
-
24825
- /**
24826
- * Creates a path as an array of indices from the given root node to the given
24827
- * node.
24828
- *
24829
- * @param {Node} node Node to find the path of.
24830
- * @param {HTMLElement} rootNode Root node to find the path from.
24831
- * @param {Array} path Initial path to build on.
24832
- *
24833
- * @return {Array} The path from the root node to the node.
24834
- */
24835
-
24836
- function createPathToNode(node, rootNode, path) {
24837
- var parentNode = node.parentNode;
24838
- var i = 0;
24839
-
24840
- while (node = node.previousSibling) {
24841
- i++;
24842
- }
24843
-
24844
- path = [i].concat(Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(path));
24845
-
24846
- if (parentNode !== rootNode) {
24847
- path = createPathToNode(parentNode, rootNode, path);
24848
- }
24849
-
24850
- return path;
24851
- }
24852
- /**
24853
- * Gets a node given a path (array of indices) from the given node.
24854
- *
24855
- * @param {HTMLElement} node Root node to find the wanted node in.
24856
- * @param {Array} path Path (indices) to the wanted node.
24857
- *
24858
- * @return {Object} Object with the found node and the remaining offset (if any).
24859
- */
24860
-
24861
-
24862
- function getNodeByPath(node, path) {
24863
- path = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(path);
24864
-
24865
- while (node && path.length > 1) {
24866
- node = node.childNodes[path.shift()];
24867
- }
24868
-
24869
- return {
24870
- node: node,
24871
- offset: path[0]
24872
- };
24873
- }
24874
-
24875
- function append(element, child) {
24876
- if (typeof child === 'string') {
24877
- child = element.ownerDocument.createTextNode(child);
24878
- }
24879
-
24880
- var _child = child,
24881
- type = _child.type,
24882
- attributes = _child.attributes;
24883
-
24884
- if (type) {
24885
- child = element.ownerDocument.createElement(type);
24886
-
24887
- for (var key in attributes) {
24888
- child.setAttribute(key, attributes[key]);
24889
- }
24890
- }
24891
-
24892
- return element.appendChild(child);
24893
- }
24894
-
24895
- function appendText(node, text) {
24896
- node.appendData(text);
24897
- }
24898
-
24899
- function getLastChild(_ref) {
24900
- var lastChild = _ref.lastChild;
24901
- return lastChild;
24902
- }
24903
-
24904
- function getParent(_ref2) {
24905
- var parentNode = _ref2.parentNode;
24906
- return parentNode;
24907
- }
24908
-
24909
- function isText(node) {
24910
- return node.nodeType === node.TEXT_NODE;
24911
- }
24912
-
24913
- function getText(_ref3) {
24914
- var nodeValue = _ref3.nodeValue;
24915
- return nodeValue;
24916
- }
24917
-
24918
- function remove(node) {
24919
- return node.parentNode.removeChild(node);
24920
- }
24921
-
24922
- function toDom(_ref4) {
24923
- var value = _ref4.value,
24924
- multilineTag = _ref4.multilineTag,
24925
- prepareEditableTree = _ref4.prepareEditableTree,
24926
- _ref4$isEditableTree = _ref4.isEditableTree,
24927
- isEditableTree = _ref4$isEditableTree === void 0 ? true : _ref4$isEditableTree,
24928
- placeholder = _ref4.placeholder,
24929
- _ref4$doc = _ref4.doc,
24930
- doc = _ref4$doc === void 0 ? document : _ref4$doc;
24931
- var startPath = [];
24932
- var endPath = [];
24933
-
24934
- if (prepareEditableTree) {
24935
- value = _objectSpread(_objectSpread({}, value), {}, {
24936
- formats: prepareEditableTree(value)
24937
- });
24938
- }
24939
- /**
24940
- * Returns a new instance of a DOM tree upon which RichText operations can be
24941
- * applied.
24942
- *
24943
- * Note: The current implementation will return a shared reference, reset on
24944
- * each call to `createEmpty`. Therefore, you should not hold a reference to
24945
- * the value to operate upon asynchronously, as it may have unexpected results.
24946
- *
24947
- * @return {Object} RichText tree.
24948
- */
24949
-
24950
-
24951
- var createEmpty = function createEmpty() {
24952
- return Object(__WEBPACK_IMPORTED_MODULE_3__create_element__["a" /* createElement */])(doc, '');
24953
- };
24954
-
24955
- var tree = Object(__WEBPACK_IMPORTED_MODULE_2__to_tree__["a" /* toTree */])({
24956
- value: value,
24957
- multilineTag: multilineTag,
24958
- createEmpty: createEmpty,
24959
- append: append,
24960
- getLastChild: getLastChild,
24961
- getParent: getParent,
24962
- isText: isText,
24963
- getText: getText,
24964
- remove: remove,
24965
- appendText: appendText,
24966
- onStartIndex: function onStartIndex(body, pointer) {
24967
- startPath = createPathToNode(pointer, body, [pointer.nodeValue.length]);
24968
- },
24969
- onEndIndex: function onEndIndex(body, pointer) {
24970
- endPath = createPathToNode(pointer, body, [pointer.nodeValue.length]);
24971
- },
24972
- isEditableTree: isEditableTree,
24973
- placeholder: placeholder
24974
- });
24975
- return {
24976
- body: tree,
24977
- selection: {
24978
- startPath: startPath,
24979
- endPath: endPath
24980
- }
24981
- };
24982
- }
24983
- /**
24984
- * Create an `Element` tree from a Rich Text value and applies the difference to
24985
- * the `Element` tree contained by `current`. If a `multilineTag` is provided,
24986
- * text separated by two new lines will be wrapped in an `Element` of that type.
24987
- *
24988
- * @param {Object} $1 Named arguments.
24989
- * @param {RichTextValue} $1.value Value to apply.
24990
- * @param {HTMLElement} $1.current The live root node to apply the element tree to.
24991
- * @param {string} [$1.multilineTag] Multiline tag.
24992
- * @param {Function} [$1.prepareEditableTree] Function to filter editorable formats.
24993
- * @param {boolean} [$1.__unstableDomOnly] Only apply elements, no selection.
24994
- * @param {string} [$1.placeholder] Placeholder text.
24995
- */
24996
-
24997
- function apply(_ref5) {
24998
- var value = _ref5.value,
24999
- current = _ref5.current,
25000
- multilineTag = _ref5.multilineTag,
25001
- prepareEditableTree = _ref5.prepareEditableTree,
25002
- __unstableDomOnly = _ref5.__unstableDomOnly,
25003
- placeholder = _ref5.placeholder;
25004
-
25005
- // Construct a new element tree in memory.
25006
- var _toDom = toDom({
25007
- value: value,
25008
- multilineTag: multilineTag,
25009
- prepareEditableTree: prepareEditableTree,
25010
- placeholder: placeholder,
25011
- doc: current.ownerDocument
25012
- }),
25013
- body = _toDom.body,
25014
- selection = _toDom.selection;
25015
-
25016
- applyValue(body, current);
25017
-
25018
- if (value.start !== undefined && !__unstableDomOnly) {
25019
- applySelection(selection, current);
25020
- }
25021
- }
25022
- function applyValue(future, current) {
25023
- var i = 0;
25024
- var futureChild;
25025
-
25026
- while (futureChild = future.firstChild) {
25027
- var currentChild = current.childNodes[i];
25028
-
25029
- if (!currentChild) {
25030
- current.appendChild(futureChild);
25031
- } else if (!currentChild.isEqualNode(futureChild)) {
25032
- if (currentChild.nodeName !== futureChild.nodeName || currentChild.nodeType === currentChild.TEXT_NODE && currentChild.data !== futureChild.data) {
25033
- current.replaceChild(futureChild, currentChild);
25034
- } else {
25035
- var currentAttributes = currentChild.attributes;
25036
- var futureAttributes = futureChild.attributes;
25037
-
25038
- if (currentAttributes) {
25039
- var ii = currentAttributes.length; // Reverse loop because `removeAttribute` on `currentChild`
25040
- // changes `currentAttributes`.
25041
-
25042
- while (ii--) {
25043
- var name = currentAttributes[ii].name;
25044
-
25045
- if (!futureChild.getAttribute(name)) {
25046
- currentChild.removeAttribute(name);
25047
- }
25048
- }
25049
- }
25050
-
25051
- if (futureAttributes) {
25052
- for (var _ii = 0; _ii < futureAttributes.length; _ii++) {
25053
- var _futureAttributes$_ii = futureAttributes[_ii],
25054
- _name = _futureAttributes$_ii.name,
25055
- value = _futureAttributes$_ii.value;
25056
-
25057
- if (currentChild.getAttribute(_name) !== value) {
25058
- currentChild.setAttribute(_name, value);
25059
- }
25060
- }
25061
- }
25062
-
25063
- applyValue(futureChild, currentChild);
25064
- future.removeChild(futureChild);
25065
- }
25066
- } else {
25067
- future.removeChild(futureChild);
25068
- }
25069
-
25070
- i++;
25071
- }
25072
-
25073
- while (current.childNodes[i]) {
25074
- current.removeChild(current.childNodes[i]);
25075
- }
25076
- }
25077
- /**
25078
- * Returns true if two ranges are equal, or false otherwise. Ranges are
25079
- * considered equal if their start and end occur in the same container and
25080
- * offset.
25081
- *
25082
- * @param {Range} a First range object to test.
25083
- * @param {Range} b First range object to test.
25084
- *
25085
- * @return {boolean} Whether the two ranges are equal.
25086
- */
25087
-
25088
- function isRangeEqual(a, b) {
25089
- return a.startContainer === b.startContainer && a.startOffset === b.startOffset && a.endContainer === b.endContainer && a.endOffset === b.endOffset;
25090
- }
25091
-
25092
- function applySelection(_ref6, current) {
25093
- var startPath = _ref6.startPath,
25094
- endPath = _ref6.endPath;
25095
-
25096
- var _getNodeByPath = getNodeByPath(current, startPath),
25097
- startContainer = _getNodeByPath.node,
25098
- startOffset = _getNodeByPath.offset;
25099
-
25100
- var _getNodeByPath2 = getNodeByPath(current, endPath),
25101
- endContainer = _getNodeByPath2.node,
25102
- endOffset = _getNodeByPath2.offset;
25103
-
25104
- var ownerDocument = current.ownerDocument;
25105
- var defaultView = ownerDocument.defaultView;
25106
- var selection = defaultView.getSelection();
25107
- var range = ownerDocument.createRange();
25108
- range.setStart(startContainer, startOffset);
25109
- range.setEnd(endContainer, endOffset);
25110
- var activeElement = ownerDocument.activeElement;
25111
-
25112
- if (selection.rangeCount > 0) {
25113
- // If the to be added range and the live range are the same, there's no
25114
- // need to remove the live range and add the equivalent range.
25115
- if (isRangeEqual(range, selection.getRangeAt(0))) {
25116
- return;
25117
- }
25118
-
25119
- selection.removeAllRanges();
25120
- }
25121
-
25122
- selection.addRange(range); // This function is not intended to cause a shift in focus. Since the above
25123
- // selection manipulations may shift focus, ensure that focus is restored to
25124
- // its previous state.
25125
-
25126
- if (activeElement !== ownerDocument.activeElement) {
25127
- // The `instanceof` checks protect against edge cases where the focused
25128
- // element is not of the interface HTMLElement (does not have a `focus`
25129
- // or `blur` property).
25130
- //
25131
- // See: https://github.com/Microsoft/TypeScript/issues/5901#issuecomment-431649653
25132
- if (activeElement instanceof defaultView.HTMLElement) {
25133
- activeElement.focus();
25134
- }
25135
- }
25136
- }
25137
- //# sourceMappingURL=to-dom.js.map
25138
-
25139
- /***/ }),
25140
- /* 184 */
25141
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
25142
-
25143
- "use strict";
25144
- /* harmony export (immutable) */ __webpack_exports__["a"] = toTree;
25145
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_toConsumableArray__ = __webpack_require__(21);
25146
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(13);
25147
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__get_active_formats__ = __webpack_require__(112);
25148
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__get_format_type__ = __webpack_require__(593);
25149
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__special_characters__ = __webpack_require__(30);
25150
-
25151
-
25152
-
25153
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
25154
-
25155
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
25156
-
25157
- /**
25158
- * Internal dependencies
25159
- */
25160
-
25161
-
25162
-
25163
- /**
25164
- * Converts a format object to information that can be used to create an element
25165
- * from (type, attributes and object).
25166
- *
25167
- * @param {Object} $1 Named parameters.
25168
- * @param {string} $1.type The format type.
25169
- * @param {Object} $1.attributes The format attributes.
25170
- * @param {Object} $1.unregisteredAttributes The unregistered format
25171
- * attributes.
25172
- * @param {boolean} $1.object Wether or not it is an object
25173
- * format.
25174
- * @param {boolean} $1.boundaryClass Wether or not to apply a boundary
25175
- * class.
25176
- * @return {Object} Information to be used for
25177
- * element creation.
25178
- */
25179
-
25180
- function fromFormat(_ref) {
25181
- var type = _ref.type,
25182
- attributes = _ref.attributes,
25183
- unregisteredAttributes = _ref.unregisteredAttributes,
25184
- object = _ref.object,
25185
- boundaryClass = _ref.boundaryClass;
25186
- var formatType = Object(__WEBPACK_IMPORTED_MODULE_3__get_format_type__["a" /* getFormatType */])(type);
25187
- var elementAttributes = {};
25188
-
25189
- if (boundaryClass) {
25190
- elementAttributes['data-rich-text-format-boundary'] = 'true';
25191
- }
25192
-
25193
- if (!formatType) {
25194
- if (attributes) {
25195
- elementAttributes = _objectSpread(_objectSpread({}, attributes), elementAttributes);
25196
- }
25197
-
25198
- return {
25199
- type: type,
25200
- attributes: elementAttributes,
25201
- object: object
25202
- };
25203
- }
25204
-
25205
- elementAttributes = _objectSpread(_objectSpread({}, unregisteredAttributes), elementAttributes);
25206
-
25207
- for (var name in attributes) {
25208
- var key = formatType.attributes ? formatType.attributes[name] : false;
25209
-
25210
- if (key) {
25211
- elementAttributes[key] = attributes[name];
25212
- } else {
25213
- elementAttributes[name] = attributes[name];
25214
- }
25215
- }
25216
-
25217
- if (formatType.className) {
25218
- if (elementAttributes.class) {
25219
- elementAttributes.class = "".concat(formatType.className, " ").concat(elementAttributes.class);
25220
- } else {
25221
- elementAttributes.class = formatType.className;
25222
- }
25223
- }
25224
-
25225
- return {
25226
- type: formatType.tagName,
25227
- object: formatType.object,
25228
- attributes: elementAttributes
25229
- };
25230
- }
25231
- /**
25232
- * Checks if both arrays of formats up until a certain index are equal.
25233
- *
25234
- * @param {Array} a Array of formats to compare.
25235
- * @param {Array} b Array of formats to compare.
25236
- * @param {number} index Index to check until.
25237
- */
25238
-
25239
-
25240
- function isEqualUntil(a, b, index) {
25241
- do {
25242
- if (a[index] !== b[index]) {
25243
- return false;
25244
- }
25245
- } while (index--);
25246
-
25247
- return true;
25248
- }
25249
-
25250
- function toTree(_ref2) {
25251
- var value = _ref2.value,
25252
- multilineTag = _ref2.multilineTag,
25253
- preserveWhiteSpace = _ref2.preserveWhiteSpace,
25254
- createEmpty = _ref2.createEmpty,
25255
- append = _ref2.append,
25256
- getLastChild = _ref2.getLastChild,
25257
- getParent = _ref2.getParent,
25258
- isText = _ref2.isText,
25259
- getText = _ref2.getText,
25260
- remove = _ref2.remove,
25261
- appendText = _ref2.appendText,
25262
- onStartIndex = _ref2.onStartIndex,
25263
- onEndIndex = _ref2.onEndIndex,
25264
- isEditableTree = _ref2.isEditableTree,
25265
- placeholder = _ref2.placeholder;
25266
- var formats = value.formats,
25267
- replacements = value.replacements,
25268
- text = value.text,
25269
- start = value.start,
25270
- end = value.end;
25271
- var formatsLength = formats.length + 1;
25272
- var tree = createEmpty();
25273
- var multilineFormat = {
25274
- type: multilineTag
25275
- };
25276
- var activeFormats = Object(__WEBPACK_IMPORTED_MODULE_2__get_active_formats__["a" /* getActiveFormats */])(value);
25277
- var deepestActiveFormat = activeFormats[activeFormats.length - 1];
25278
- var lastSeparatorFormats;
25279
- var lastCharacterFormats;
25280
- var lastCharacter; // If we're building a multiline tree, start off with a multiline element.
25281
-
25282
- if (multilineTag) {
25283
- append(append(tree, {
25284
- type: multilineTag
25285
- }), '');
25286
- lastCharacterFormats = lastSeparatorFormats = [multilineFormat];
25287
- } else {
25288
- append(tree, '');
25289
- }
25290
-
25291
- var _loop = function _loop(i) {
25292
- var character = text.charAt(i);
25293
- var shouldInsertPadding = isEditableTree && ( // Pad the line if the line is empty.
25294
- !lastCharacter || lastCharacter === __WEBPACK_IMPORTED_MODULE_4__special_characters__["a" /* LINE_SEPARATOR */] || // Pad the line if the previous character is a line break, otherwise
25295
- // the line break won't be visible.
25296
- lastCharacter === '\n');
25297
- var characterFormats = formats[i]; // Set multiline tags in queue for building the tree.
25298
-
25299
- if (multilineTag) {
25300
- if (character === __WEBPACK_IMPORTED_MODULE_4__special_characters__["a" /* LINE_SEPARATOR */]) {
25301
- characterFormats = lastSeparatorFormats = (replacements[i] || []).reduce(function (accumulator, format) {
25302
- accumulator.push(format, multilineFormat);
25303
- return accumulator;
25304
- }, [multilineFormat]);
25305
- } else {
25306
- characterFormats = [].concat(Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(lastSeparatorFormats), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_toConsumableArray__["a" /* default */])(characterFormats || []));
25307
- }
25308
- }
25309
-
25310
- var pointer = getLastChild(tree);
25311
-
25312
- if (shouldInsertPadding && character === __WEBPACK_IMPORTED_MODULE_4__special_characters__["a" /* LINE_SEPARATOR */]) {
25313
- var node = pointer;
25314
-
25315
- while (!isText(node)) {
25316
- node = getLastChild(node);
25317
- }
25318
-
25319
- append(getParent(node), __WEBPACK_IMPORTED_MODULE_4__special_characters__["c" /* ZWNBSP */]);
25320
- } // Set selection for the start of line.
25321
-
25322
-
25323
- if (lastCharacter === __WEBPACK_IMPORTED_MODULE_4__special_characters__["a" /* LINE_SEPARATOR */]) {
25324
- var _node = pointer;
25325
-
25326
- while (!isText(_node)) {
25327
- _node = getLastChild(_node);
25328
- }
25329
-
25330
- if (onStartIndex && start === i) {
25331
- onStartIndex(tree, _node);
25332
- }
25333
-
25334
- if (onEndIndex && end === i) {
25335
- onEndIndex(tree, _node);
25336
- }
25337
- }
25338
-
25339
- if (characterFormats) {
25340
- characterFormats.forEach(function (format, formatIndex) {
25341
- if (pointer && lastCharacterFormats && // Reuse the last element if all formats remain the same.
25342
- isEqualUntil(characterFormats, lastCharacterFormats, formatIndex) && ( // Do not reuse the last element if the character is a
25343
- // line separator.
25344
- character !== __WEBPACK_IMPORTED_MODULE_4__special_characters__["a" /* LINE_SEPARATOR */] || characterFormats.length - 1 !== formatIndex)) {
25345
- pointer = getLastChild(pointer);
25346
- return;
25347
- }
25348
-
25349
- var type = format.type,
25350
- attributes = format.attributes,
25351
- unregisteredAttributes = format.unregisteredAttributes;
25352
- var boundaryClass = isEditableTree && character !== __WEBPACK_IMPORTED_MODULE_4__special_characters__["a" /* LINE_SEPARATOR */] && format === deepestActiveFormat;
25353
- var parent = getParent(pointer);
25354
- var newNode = append(parent, fromFormat({
25355
- type: type,
25356
- attributes: attributes,
25357
- unregisteredAttributes: unregisteredAttributes,
25358
- boundaryClass: boundaryClass
25359
- }));
25360
-
25361
- if (isText(pointer) && getText(pointer).length === 0) {
25362
- remove(pointer);
25363
- }
25364
-
25365
- pointer = append(newNode, '');
25366
- });
25367
- } // No need for further processing if the character is a line separator.
25368
-
25369
-
25370
- if (character === __WEBPACK_IMPORTED_MODULE_4__special_characters__["a" /* LINE_SEPARATOR */]) {
25371
- lastCharacterFormats = characterFormats;
25372
- lastCharacter = character;
25373
- return "continue";
25374
- } // If there is selection at 0, handle it before characters are inserted.
25375
-
25376
-
25377
- if (i === 0) {
25378
- if (onStartIndex && start === 0) {
25379
- onStartIndex(tree, pointer);
25380
- }
25381
-
25382
- if (onEndIndex && end === 0) {
25383
- onEndIndex(tree, pointer);
25384
- }
25385
- }
25386
-
25387
- if (character === __WEBPACK_IMPORTED_MODULE_4__special_characters__["b" /* OBJECT_REPLACEMENT_CHARACTER */]) {
25388
- pointer = append(getParent(pointer), fromFormat(_objectSpread(_objectSpread({}, replacements[i]), {}, {
25389
- object: true
25390
- }))); // Ensure pointer is text node.
25391
-
25392
- pointer = append(getParent(pointer), '');
25393
- } else if (!preserveWhiteSpace && character === '\n') {
25394
- pointer = append(getParent(pointer), {
25395
- type: 'br',
25396
- attributes: isEditableTree ? {
25397
- 'data-rich-text-line-break': 'true'
25398
- } : undefined,
25399
- object: true
25400
- }); // Ensure pointer is text node.
25401
-
25402
- pointer = append(getParent(pointer), '');
25403
- } else if (!isText(pointer)) {
25404
- pointer = append(getParent(pointer), character);
25405
- } else {
25406
- appendText(pointer, character);
25407
- }
25408
-
25409
- if (onStartIndex && start === i + 1) {
25410
- onStartIndex(tree, pointer);
25411
- }
25412
-
25413
- if (onEndIndex && end === i + 1) {
25414
- onEndIndex(tree, pointer);
25415
- }
25416
-
25417
- if (shouldInsertPadding && i === text.length) {
25418
- append(getParent(pointer), __WEBPACK_IMPORTED_MODULE_4__special_characters__["c" /* ZWNBSP */]);
25419
-
25420
- if (placeholder && text.length === 0) {
25421
- append(getParent(pointer), {
25422
- type: 'span',
25423
- attributes: {
25424
- 'data-rich-text-placeholder': placeholder,
25425
- // Necessary to prevent the placeholder from catching
25426
- // selection. The placeholder is also not editable after
25427
- // all.
25428
- contenteditable: 'false'
25429
- }
25430
- });
25431
- }
25432
- }
25433
-
25434
- lastCharacterFormats = characterFormats;
25435
- lastCharacter = character;
25436
- };
25437
-
25438
- for (var i = 0; i < formatsLength; i++) {
25439
- var _ret = _loop(i);
25440
-
25441
- if (_ret === "continue") continue;
25442
- }
25443
-
25444
- return tree;
25445
- }
25446
- //# sourceMappingURL=to-tree.js.map
25447
-
25448
- /***/ }),
25449
- /* 185 */
25450
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
25451
-
25452
- "use strict";
25453
- /* harmony export (immutable) */ __webpack_exports__["a"] = toHTMLString;
25454
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_escape_html__ = __webpack_require__(77);
25455
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__to_tree__ = __webpack_require__(184);
25456
- /**
25457
- * WordPress dependencies
25458
- */
25459
-
25460
- /**
25461
- * Internal dependencies
25462
- */
25463
-
25464
-
25465
- /** @typedef {import('./create').RichTextValue} RichTextValue */
25466
-
25467
- /**
25468
- * Create an HTML string from a Rich Text value. If a `multilineTag` is
25469
- * provided, text separated by a line separator will be wrapped in it.
25470
- *
25471
- * @param {Object} $1 Named argements.
25472
- * @param {RichTextValue} $1.value Rich text value.
25473
- * @param {string} [$1.multilineTag] Multiline tag.
25474
- * @param {boolean} [$1.preserveWhiteSpace] Whether or not to use newline
25475
- * characters for line breaks.
25476
- *
25477
- * @return {string} HTML string.
25478
- */
25479
-
25480
- function toHTMLString(_ref) {
25481
- var value = _ref.value,
25482
- multilineTag = _ref.multilineTag,
25483
- preserveWhiteSpace = _ref.preserveWhiteSpace;
25484
- var tree = Object(__WEBPACK_IMPORTED_MODULE_1__to_tree__["a" /* toTree */])({
25485
- value: value,
25486
- multilineTag: multilineTag,
25487
- preserveWhiteSpace: preserveWhiteSpace,
25488
- createEmpty: createEmpty,
25489
- append: append,
25490
- getLastChild: getLastChild,
25491
- getParent: getParent,
25492
- isText: isText,
25493
- getText: getText,
25494
- remove: remove,
25495
- appendText: appendText
25496
- });
25497
- return createChildrenHTML(tree.children);
25498
- }
25499
-
25500
- function createEmpty() {
25501
- return {};
25502
- }
25503
-
25504
- function getLastChild(_ref2) {
25505
- var children = _ref2.children;
25506
- return children && children[children.length - 1];
25507
- }
25508
-
25509
- function append(parent, object) {
25510
- if (typeof object === 'string') {
25511
- object = {
25512
- text: object
25513
- };
25514
- }
25515
-
25516
- object.parent = parent;
25517
- parent.children = parent.children || [];
25518
- parent.children.push(object);
25519
- return object;
25520
- }
25521
-
25522
- function appendText(object, text) {
25523
- object.text += text;
25524
- }
25525
-
25526
- function getParent(_ref3) {
25527
- var parent = _ref3.parent;
25528
- return parent;
25529
- }
25530
-
25531
- function isText(_ref4) {
25532
- var text = _ref4.text;
25533
- return typeof text === 'string';
25534
- }
25535
-
25536
- function getText(_ref5) {
25537
- var text = _ref5.text;
25538
- return text;
25539
- }
25540
-
25541
- function remove(object) {
25542
- var index = object.parent.children.indexOf(object);
25543
-
25544
- if (index !== -1) {
25545
- object.parent.children.splice(index, 1);
25546
- }
25547
-
25548
- return object;
25549
- }
25550
-
25551
- function createElementHTML(_ref6) {
25552
- var type = _ref6.type,
25553
- attributes = _ref6.attributes,
25554
- object = _ref6.object,
25555
- children = _ref6.children;
25556
- var attributeString = '';
25557
-
25558
- for (var key in attributes) {
25559
- if (!Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_escape_html__["d" /* isValidAttributeName */])(key)) {
25560
- continue;
25561
- }
25562
-
25563
- attributeString += " ".concat(key, "=\"").concat(Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_escape_html__["a" /* escapeAttribute */])(attributes[key]), "\"");
25564
- }
25565
-
25566
- if (object) {
25567
- return "<".concat(type).concat(attributeString, ">");
25568
- }
25569
-
25570
- return "<".concat(type).concat(attributeString, ">").concat(createChildrenHTML(children), "</").concat(type, ">");
25571
- }
25572
-
25573
- function createChildrenHTML() {
25574
- var children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
25575
- return children.map(function (child) {
25576
- return child.text === undefined ? createElementHTML(child) : Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_escape_html__["b" /* escapeEditableHTML */])(child.text);
25577
- }).join('');
25578
- }
25579
- //# sourceMappingURL=to-html-string.js.map
25580
-
25581
- /***/ }),
25582
- /* 186 */
25583
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
25584
-
25585
- "use strict";
25586
- /* harmony export (immutable) */ __webpack_exports__["a"] = canIndentListItems;
25587
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__get_line_index__ = __webpack_require__(48);
25588
- /**
25589
- * Internal dependencies
25590
- */
25591
-
25592
- /** @typedef {import('./create').RichTextValue} RichTextValue */
25593
-
25594
- /**
25595
- * Checks if the selected list item can be indented.
25596
- *
25597
- * @param {RichTextValue} value Value to check.
25598
- *
25599
- * @return {boolean} Whether or not the selected list item can be indented.
25600
- */
25601
-
25602
- function canIndentListItems(value) {
25603
- var lineIndex = Object(__WEBPACK_IMPORTED_MODULE_0__get_line_index__["a" /* getLineIndex */])(value); // There is only one line, so the line cannot be indented.
25604
-
25605
- if (lineIndex === undefined) {
25606
- return false;
25607
- }
25608
-
25609
- var replacements = value.replacements;
25610
- var previousLineIndex = Object(__WEBPACK_IMPORTED_MODULE_0__get_line_index__["a" /* getLineIndex */])(value, lineIndex);
25611
- var formatsAtLineIndex = replacements[lineIndex] || [];
25612
- var formatsAtPreviousLineIndex = replacements[previousLineIndex] || []; // If the indentation of the current line is greater than previous line,
25613
- // then the line cannot be furter indented.
25614
-
25615
- return formatsAtLineIndex.length <= formatsAtPreviousLineIndex.length;
25616
- }
25617
- //# sourceMappingURL=can-indent-list-items.js.map
25618
-
25619
- /***/ }),
25620
- /* 187 */
25621
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
25622
-
25623
- "use strict";
25624
- /* harmony export (immutable) */ __webpack_exports__["a"] = canOutdentListItems;
25625
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__get_line_index__ = __webpack_require__(48);
25626
- /**
25627
- * Internal dependencies
25628
- */
25629
-
25630
- /** @typedef {import('./create').RichTextValue} RichTextValue */
25631
-
25632
- /**
25633
- * Checks if the selected list item can be outdented.
25634
- *
25635
- * @param {RichTextValue} value Value to check.
25636
- *
25637
- * @return {boolean} Whether or not the selected list item can be outdented.
25638
- */
25639
-
25640
- function canOutdentListItems(value) {
25641
- var replacements = value.replacements,
25642
- start = value.start;
25643
- var startingLineIndex = Object(__WEBPACK_IMPORTED_MODULE_0__get_line_index__["a" /* getLineIndex */])(value, start);
25644
- return replacements[startingLineIndex] !== undefined;
25645
- }
25646
- //# sourceMappingURL=can-outdent-list-items.js.map
25647
-
25648
- /***/ }),
25649
- /* 188 */
25650
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
25651
-
25652
- "use strict";
25653
- /* harmony export (immutable) */ __webpack_exports__["a"] = indentListItems;
25654
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(13);
25655
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__special_characters__ = __webpack_require__(30);
25656
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__get_line_index__ = __webpack_require__(48);
25657
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__can_indent_list_items__ = __webpack_require__(186);
25658
-
25659
-
25660
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
25661
-
25662
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
25663
-
25664
- /**
25665
- * Internal dependencies
25666
- */
25667
-
25668
-
25669
-
25670
- /** @typedef {import('./create').RichTextValue} RichTextValue */
25671
-
25672
- /** @typedef {import('./create').RichTextFormat} RichTextFormat */
25673
-
25674
- /**
25675
- * Gets the line index of the first previous list item with higher indentation.
25676
- *
25677
- * @param {RichTextValue} value Value to search.
25678
- * @param {number} lineIndex Line index of the list item to compare
25679
- * with.
25680
- *
25681
- * @return {number|void} The line index.
25682
- */
25683
-
25684
- function getTargetLevelLineIndex(_ref, lineIndex) {
25685
- var text = _ref.text,
25686
- replacements = _ref.replacements;
25687
- var startFormats = replacements[lineIndex] || [];
25688
- var index = lineIndex;
25689
-
25690
- while (index-- >= 0) {
25691
- if (text[index] !== __WEBPACK_IMPORTED_MODULE_1__special_characters__["a" /* LINE_SEPARATOR */]) {
25692
- continue;
25693
- }
25694
-
25695
- var formatsAtIndex = replacements[index] || []; // Return the first line index that is one level higher. If the level is
25696
- // lower or equal, there is no result.
25697
-
25698
- if (formatsAtIndex.length === startFormats.length + 1) {
25699
- return index;
25700
- } else if (formatsAtIndex.length <= startFormats.length) {
25701
- return;
25702
- }
25703
- }
25704
- }
25705
- /**
25706
- * Indents any selected list items if possible.
25707
- *
25708
- * @param {RichTextValue} value Value to change.
25709
- * @param {RichTextFormat} rootFormat Root format.
25710
- *
25711
- * @return {RichTextValue} The changed value.
25712
- */
25713
-
25714
-
25715
- function indentListItems(value, rootFormat) {
25716
- if (!Object(__WEBPACK_IMPORTED_MODULE_3__can_indent_list_items__["a" /* canIndentListItems */])(value)) {
25717
- return value;
25718
- }
25719
-
25720
- var lineIndex = Object(__WEBPACK_IMPORTED_MODULE_2__get_line_index__["a" /* getLineIndex */])(value);
25721
- var previousLineIndex = Object(__WEBPACK_IMPORTED_MODULE_2__get_line_index__["a" /* getLineIndex */])(value, lineIndex);
25722
- var text = value.text,
25723
- replacements = value.replacements,
25724
- end = value.end;
25725
- var newFormats = replacements.slice();
25726
- var targetLevelLineIndex = getTargetLevelLineIndex(value, lineIndex);
25727
-
25728
- for (var index = lineIndex; index < end; index++) {
25729
- if (text[index] !== __WEBPACK_IMPORTED_MODULE_1__special_characters__["a" /* LINE_SEPARATOR */]) {
25730
- continue;
25731
- } // Get the previous list, and if there's a child list, take over the
25732
- // formats. If not, duplicate the last level and create a new level.
25733
-
25734
-
25735
- if (targetLevelLineIndex) {
25736
- var targetFormats = replacements[targetLevelLineIndex] || [];
25737
- newFormats[index] = targetFormats.concat((newFormats[index] || []).slice(targetFormats.length - 1));
25738
- } else {
25739
- var _targetFormats = replacements[previousLineIndex] || [];
25740
-
25741
- var lastformat = _targetFormats[_targetFormats.length - 1] || rootFormat;
25742
- newFormats[index] = _targetFormats.concat([lastformat], (newFormats[index] || []).slice(_targetFormats.length));
25743
- }
25744
- }
25745
-
25746
- return _objectSpread(_objectSpread({}, value), {}, {
25747
- replacements: newFormats
25748
- });
25749
- }
25750
- //# sourceMappingURL=indent-list-items.js.map
25751
-
25752
- /***/ }),
25753
- /* 189 */
25754
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
25755
-
25756
- "use strict";
25757
- /* harmony export (immutable) */ __webpack_exports__["a"] = getParentLineIndex;
25758
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__special_characters__ = __webpack_require__(30);
25759
- /**
25760
- * Internal dependencies
25761
- */
25762
-
25763
- /** @typedef {import('./create').RichTextValue} RichTextValue */
25764
-
25765
- /**
25766
- * Gets the index of the first parent list. To get the parent list formats, we
25767
- * go through every list item until we find one with exactly one format type
25768
- * less.
25769
- *
25770
- * @param {RichTextValue} value Value to search.
25771
- * @param {number} lineIndex Line index of a child list item.
25772
- *
25773
- * @return {number|void} The parent list line index.
25774
- */
25775
-
25776
- function getParentLineIndex(_ref, lineIndex) {
25777
- var text = _ref.text,
25778
- replacements = _ref.replacements;
25779
- var startFormats = replacements[lineIndex] || [];
25780
- var index = lineIndex;
25781
-
25782
- while (index-- >= 0) {
25783
- if (text[index] !== __WEBPACK_IMPORTED_MODULE_0__special_characters__["a" /* LINE_SEPARATOR */]) {
25784
- continue;
25785
- }
25786
-
25787
- var formatsAtIndex = replacements[index] || [];
25788
-
25789
- if (formatsAtIndex.length === startFormats.length - 1) {
25790
- return index;
25791
- }
25792
- }
25793
- }
25794
- //# sourceMappingURL=get-parent-line-index.js.map
25795
-
25796
- /***/ }),
25797
- /* 190 */
25798
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
25799
-
25800
- "use strict";
25801
- /* harmony export (immutable) */ __webpack_exports__["a"] = FormatEdit;
25802
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(15);
25803
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__get_active_format__ = __webpack_require__(111);
25804
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__get_active_object__ = __webpack_require__(178);
25805
-
25806
-
25807
- /**
25808
- * Internal dependencies
25809
- */
25810
-
25811
-
25812
- /**
25813
- * Set of all interactive content tags.
25814
- *
25815
- * @see https://html.spec.whatwg.org/multipage/dom.html#interactive-content
25816
- */
25817
-
25818
- var interactiveContentTags = new Set(['a', 'audio', 'button', 'details', 'embed', 'iframe', 'input', 'label', 'select', 'textarea', 'video']);
25819
- function FormatEdit(_ref) {
25820
- var formatTypes = _ref.formatTypes,
25821
- onChange = _ref.onChange,
25822
- onFocus = _ref.onFocus,
25823
- value = _ref.value,
25824
- allowedFormats = _ref.allowedFormats,
25825
- withoutInteractiveFormatting = _ref.withoutInteractiveFormatting;
25826
- return formatTypes.map(function (_ref2) {
25827
- var name = _ref2.name,
25828
- Edit = _ref2.edit,
25829
- tagName = _ref2.tagName;
25830
-
25831
- if (!Edit) {
25832
- return null;
25833
- }
25834
-
25835
- if (allowedFormats && allowedFormats.indexOf(name) === -1) {
25836
- return null;
25837
- }
25838
-
25839
- if (withoutInteractiveFormatting && interactiveContentTags.has(tagName)) {
25840
- return null;
25841
- }
25842
-
25843
- var activeFormat = Object(__WEBPACK_IMPORTED_MODULE_1__get_active_format__["a" /* getActiveFormat */])(value, name);
25844
- var isActive = activeFormat !== undefined;
25845
- var activeObject = Object(__WEBPACK_IMPORTED_MODULE_2__get_active_object__["a" /* getActiveObject */])(value);
25846
- var isObjectActive = activeObject !== undefined && activeObject.type === name;
25847
- return Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["d" /* createElement */])(Edit, {
25848
- key: name,
25849
- isActive: isActive,
25850
- activeAttributes: isActive ? activeFormat.attributes || {} : {},
25851
- isObjectActive: isObjectActive,
25852
- activeObjectAttributes: isObjectActive ? activeObject.attributes || {} : {},
25853
- value: value,
25854
- onChange: onChange,
25855
- onFocus: onFocus
25856
- });
25857
- });
25858
- }
25859
- //# sourceMappingURL=format-edit.js.map
25860
-
25861
- /***/ }),
25862
- /* 191 */
25863
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
25864
-
25865
- "use strict";
25866
- Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
25867
- /* harmony export (immutable) */ __webpack_exports__["find"] = find;
25868
- /**
25869
- * References:
25870
- *
25871
- * Focusable:
25872
- * - https://www.w3.org/TR/html5/editing.html#focus-management
25873
- *
25874
- * Sequential focus navigation:
25875
- * - https://www.w3.org/TR/html5/editing.html#sequential-focus-navigation-and-the-tabindex-attribute
25876
- *
25877
- * Disabled elements:
25878
- * - https://www.w3.org/TR/html5/disabled-elements.html#disabled-elements
25879
- *
25880
- * getClientRects algorithm (requiring layout box):
25881
- * - https://www.w3.org/TR/cssom-view-1/#extension-to-the-element-interface
25882
- *
25883
- * AREA elements associated with an IMG:
25884
- * - https://w3c.github.io/html/editing.html#data-model
25885
- */
25886
- var SELECTOR = ['[tabindex]', 'a[href]', 'button:not([disabled])', 'input:not([type="hidden"]):not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'iframe', 'object', 'embed', 'area[href]', '[contenteditable]:not([contenteditable=false])'].join(',');
25887
- /**
25888
- * Returns true if the specified element is visible (i.e. neither display: none
25889
- * nor visibility: hidden).
25890
- *
25891
- * @param {Element} element DOM element to test.
25892
- *
25893
- * @return {boolean} Whether element is visible.
25894
- */
25895
-
25896
- function isVisible(element) {
25897
- return element.offsetWidth > 0 || element.offsetHeight > 0 || element.getClientRects().length > 0;
25898
- }
25899
- /**
25900
- * Returns true if the specified element should be skipped from focusable elements.
25901
- * For now it rather specific for `iframes` and if tabindex attribute is set to -1.
25902
- *
25903
- * @param {Element} element DOM element to test.
25904
- *
25905
- * @return {boolean} Whether element should be skipped from focusable elements.
25906
- */
25907
-
25908
-
25909
- function skipFocus(element) {
25910
- return element.nodeName.toLowerCase() === 'iframe' && element.getAttribute('tabindex') === '-1';
25911
- }
25912
- /**
25913
- * Returns true if the specified area element is a valid focusable element, or
25914
- * false otherwise. Area is only focusable if within a map where a named map
25915
- * referenced by an image somewhere in the document.
25916
- *
25917
- * @param {Element} element DOM area element to test.
25918
- *
25919
- * @return {boolean} Whether area element is valid for focus.
25920
- */
25921
-
25922
-
25923
- function isValidFocusableArea(element) {
25924
- var map = element.closest('map[name]');
25925
-
25926
- if (!map) {
25927
- return false;
25928
- }
25929
-
25930
- var img = element.ownerDocument.querySelector('img[usemap="#' + map.name + '"]');
25931
- return !!img && isVisible(img);
25932
- }
25933
- /**
25934
- * Returns all focusable elements within a given context.
25935
- *
25936
- * @param {Element} context Element in which to search.
25937
- *
25938
- * @return {Element[]} Focusable elements.
25939
- */
25940
-
25941
-
25942
- function find(context) {
25943
- var elements = context.querySelectorAll(SELECTOR);
25944
- return Array.from(elements).filter(function (element) {
25945
- if (!isVisible(element) || skipFocus(element)) {
25946
- return false;
25947
- }
25948
-
25949
- var nodeName = element.nodeName;
25950
-
25951
- if ('AREA' === nodeName) {
25952
- return isValidFocusableArea(element);
25953
- }
25954
-
25955
- return true;
25956
- });
25957
- }
25958
- //# sourceMappingURL=focusable.js.map
25959
-
25960
- /***/ }),
25961
- /* 192 */
25962
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
25963
-
25964
- "use strict";
25965
- /* unused harmony export getPhrasingContentSchema */
25966
- /* harmony export (immutable) */ __webpack_exports__["a"] = isPhrasingContent;
25967
- /* unused harmony export isTextContent */
25968
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(13);
25969
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(2);
25970
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);
25971
-
25972
-
25973
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
25974
-
25975
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
25976
-
25977
- /**
25978
- * External dependencies
25979
- */
25980
-
25981
- /**
25982
- * All phrasing content elements.
25983
- *
25984
- * @see https://www.w3.org/TR/2011/WD-html5-20110525/content-models.html#phrasing-content-0
25985
- */
25986
-
25987
- /**
25988
- * All text-level semantic elements.
25989
- *
25990
- * @see https://html.spec.whatwg.org/multipage/text-level-semantics.html
25991
- */
25992
-
25993
- var textContentSchema = {
25994
- strong: {},
25995
- em: {},
25996
- s: {},
25997
- del: {},
25998
- ins: {},
25999
- a: {
26000
- attributes: ['href', 'target', 'rel']
26001
- },
26002
- code: {},
26003
- abbr: {
26004
- attributes: ['title']
26005
- },
26006
- sub: {},
26007
- sup: {},
26008
- br: {},
26009
- small: {},
26010
- // To do: fix blockquote.
26011
- // cite: {},
26012
- q: {
26013
- attributes: ['cite']
26014
- },
26015
- dfn: {
26016
- attributes: ['title']
26017
- },
26018
- data: {
26019
- attributes: ['value']
26020
- },
26021
- time: {
26022
- attributes: ['datetime']
26023
- },
26024
- var: {},
26025
- samp: {},
26026
- kbd: {},
26027
- i: {},
26028
- b: {},
26029
- u: {},
26030
- mark: {},
26031
- ruby: {},
26032
- rt: {},
26033
- rp: {},
26034
- bdi: {
26035
- attributes: ['dir']
26036
- },
26037
- bdo: {
26038
- attributes: ['dir']
26039
- },
26040
- wbr: {},
26041
- '#text': {}
26042
- }; // Recursion is needed.
26043
- // Possible: strong > em > strong.
26044
- // Impossible: strong > strong.
26045
-
26046
- Object(__WEBPACK_IMPORTED_MODULE_1_lodash__["without"])(Object.keys(textContentSchema), '#text', 'br').forEach(function (tag) {
26047
- textContentSchema[tag].children = Object(__WEBPACK_IMPORTED_MODULE_1_lodash__["omit"])(textContentSchema, tag);
26048
- });
26049
- /**
26050
- * Embedded content elements.
26051
- *
26052
- * @see https://www.w3.org/TR/2011/WD-html5-20110525/content-models.html#embedded-content-0
26053
- */
26054
-
26055
- var embeddedContentSchema = {
26056
- audio: {
26057
- attributes: ['src', 'preload', 'autoplay', 'mediagroup', 'loop', 'muted']
26058
- },
26059
- canvas: {
26060
- attributes: ['width', 'height']
26061
- },
26062
- embed: {
26063
- attributes: ['src', 'type', 'width', 'height']
26064
- },
26065
- img: {
26066
- attributes: ['alt', 'src', 'srcset', 'usemap', 'ismap', 'width', 'height']
26067
- },
26068
- object: {
26069
- attributes: ['data', 'type', 'name', 'usemap', 'form', 'width', 'height']
26070
- },
26071
- video: {
26072
- attributes: ['src', 'poster', 'preload', 'autoplay', 'mediagroup', 'loop', 'muted', 'controls', 'width', 'height']
26073
- }
26074
- };
26075
- /**
26076
- * Phrasing content elements.
26077
- *
26078
- * @see https://www.w3.org/TR/2011/WD-html5-20110525/content-models.html#phrasing-content-0
26079
- */
26080
-
26081
- var phrasingContentSchema = _objectSpread(_objectSpread({}, textContentSchema), embeddedContentSchema);
26082
- /**
26083
- * Get schema of possible paths for phrasing content.
26084
- *
26085
- * @see https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content
26086
- *
26087
- * @param {string} context Set to "paste" to exclude invisible elements and
26088
- * sensitive data.
26089
- *
26090
- * @return {Object} Schema.
26091
- */
26092
-
26093
-
26094
- function getPhrasingContentSchema(context) {
26095
- if (context !== 'paste') {
26096
- return phrasingContentSchema;
26097
- }
26098
-
26099
- return Object(__WEBPACK_IMPORTED_MODULE_1_lodash__["omit"])(_objectSpread(_objectSpread({}, phrasingContentSchema), {}, {
26100
- // We shouldn't paste potentially sensitive information which is not
26101
- // visible to the user when pasted, so strip the attributes.
26102
- ins: {
26103
- children: phrasingContentSchema.ins.children
26104
- },
26105
- del: {
26106
- children: phrasingContentSchema.del.children
26107
- }
26108
- }), ['u', // Used to mark misspelling. Shouldn't be pasted.
26109
- 'abbr', // Invisible.
26110
- 'data', // Invisible.
26111
- 'time', // Invisible.
26112
- 'wbr', // Invisible.
26113
- 'bdi', // Invisible.
26114
- 'bdo' // Invisible.
26115
- ]);
26116
- }
26117
- /**
26118
- * Find out whether or not the given node is phrasing content.
26119
- *
26120
- * @see https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Phrasing_content
26121
- *
26122
- * @param {Element} node The node to test.
26123
- *
26124
- * @return {boolean} True if phrasing content, false if not.
26125
- */
26126
-
26127
- function isPhrasingContent(node) {
26128
- var tag = node.nodeName.toLowerCase();
26129
- return getPhrasingContentSchema().hasOwnProperty(tag) || tag === 'span';
26130
- }
26131
- function isTextContent(node) {
26132
- var tag = node.nodeName.toLowerCase();
26133
- return textContentSchema.hasOwnProperty(tag) || tag === 'span';
26134
- }
26135
- //# sourceMappingURL=phrasing-content.js.map
26136
-
26137
- /***/ }),
26138
- /* 193 */
26139
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
26140
-
26141
- "use strict";
26142
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__ = __webpack_require__(8);
26143
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
26144
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
26145
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
26146
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
26147
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
26148
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(10);
26149
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__wordpress_element__ = __webpack_require__(1);
26150
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash__ = __webpack_require__(2);
26151
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_lodash__);
26152
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__wordpress_compose__ = __webpack_require__(18);
26153
-
26154
-
26155
-
26156
-
26157
-
26158
-
26159
-
26160
-
26161
-
26162
- /**
26163
- * External dependencies
26164
- */
26165
-
26166
- /**
26167
- * WordPress dependencies
26168
- */
26169
-
26170
-
26171
-
26172
- /**
26173
- * Input types which are classified as button types, for use in considering
26174
- * whether element is a (focus-normalized) button.
26175
- *
26176
- * @type {string[]}
26177
- */
26178
-
26179
- var INPUT_BUTTON_TYPES = ['button', 'submit'];
26180
- /**
26181
- * Returns true if the given element is a button element subject to focus
26182
- * normalization, or false otherwise.
26183
- *
26184
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
26185
- *
26186
- * @param {Element} element Element to test.
26187
- *
26188
- * @return {boolean} Whether element is a button.
26189
- */
26190
-
26191
- function isFocusNormalizedButton(element) {
26192
- switch (element.nodeName) {
26193
- case 'A':
26194
- case 'BUTTON':
26195
- return true;
26196
-
26197
- case 'INPUT':
26198
- return Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["includes"])(INPUT_BUTTON_TYPES, element.type);
26199
- }
26200
-
26201
- return false;
26202
- }
26203
-
26204
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_9__wordpress_compose__["b" /* createHigherOrderComponent */])(function (WrappedComponent) {
26205
- return (
26206
- /*#__PURE__*/
26207
- function (_Component) {
26208
- Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_inherits__["a" /* default */])(_class, _Component);
26209
-
26210
- function _class() {
26211
- var _this;
26212
-
26213
- Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, _class);
26214
-
26215
- _this = Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(_class).apply(this, arguments));
26216
- _this.bindNode = _this.bindNode.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
26217
- _this.cancelBlurCheck = _this.cancelBlurCheck.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
26218
- _this.queueBlurCheck = _this.queueBlurCheck.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
26219
- _this.normalizeButtonFocus = _this.normalizeButtonFocus.bind(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_6__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
26220
- return _this;
26221
- }
26222
-
26223
- Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_createClass__["a" /* default */])(_class, [{
26224
- key: "componentWillUnmount",
26225
- value: function componentWillUnmount() {
26226
- this.cancelBlurCheck();
26227
- }
26228
- }, {
26229
- key: "bindNode",
26230
- value: function bindNode(node) {
26231
- if (node) {
26232
- this.node = node;
26233
- } else {
26234
- delete this.node;
26235
- this.cancelBlurCheck();
26236
- }
26237
- }
26238
- }, {
26239
- key: "queueBlurCheck",
26240
- value: function queueBlurCheck(event) {
26241
- var _this2 = this;
26242
-
26243
- // React does not allow using an event reference asynchronously
26244
- // due to recycling behavior, except when explicitly persisted.
26245
- event.persist(); // Skip blur check if clicking button. See `normalizeButtonFocus`.
26246
-
26247
- if (this.preventBlurCheck) {
26248
- return;
26249
- }
26250
-
26251
- this.blurCheckTimeout = setTimeout(function () {
26252
- if ('function' === typeof _this2.node.handleFocusOutside) {
26253
- _this2.node.handleFocusOutside(event);
26254
- }
26255
- }, 0);
26256
- }
26257
- }, {
26258
- key: "cancelBlurCheck",
26259
- value: function cancelBlurCheck() {
26260
- clearTimeout(this.blurCheckTimeout);
26261
- }
26262
- /**
26263
- * Handles a mousedown or mouseup event to respectively assign and
26264
- * unassign a flag for preventing blur check on button elements. Some
26265
- * browsers, namely Firefox and Safari, do not emit a focus event on
26266
- * button elements when clicked, while others do. The logic here
26267
- * intends to normalize this as treating click on buttons as focus.
26268
- *
26269
- * @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#Clicking_and_focus
26270
- *
26271
- * @param {MouseEvent} event Event for mousedown or mouseup.
26272
- */
26273
-
26274
- }, {
26275
- key: "normalizeButtonFocus",
26276
- value: function normalizeButtonFocus(event) {
26277
- var type = event.type,
26278
- target = event.target;
26279
- var isInteractionEnd = Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["includes"])(['mouseup', 'touchend'], type);
26280
-
26281
- if (isInteractionEnd) {
26282
- this.preventBlurCheck = false;
26283
- } else if (isFocusNormalizedButton(target)) {
26284
- this.preventBlurCheck = true;
26285
- }
26286
- }
26287
- }, {
26288
- key: "render",
26289
- value: function render() {
26290
- // Disable reason: See `normalizeButtonFocus` for browser-specific
26291
- // focus event normalization.
26292
-
26293
- /* eslint-disable jsx-a11y/no-static-element-interactions */
26294
- return Object(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["h" /* createElement */])("div", {
26295
- onFocus: this.cancelBlurCheck,
26296
- onMouseDown: this.normalizeButtonFocus,
26297
- onMouseUp: this.normalizeButtonFocus,
26298
- onTouchStart: this.normalizeButtonFocus,
26299
- onTouchEnd: this.normalizeButtonFocus,
26300
- onBlur: this.queueBlurCheck
26301
- }, Object(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["h" /* createElement */])(WrappedComponent, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])({
26302
- ref: this.bindNode
26303
- }, this.props)));
26304
- /* eslint-enable jsx-a11y/no-static-element-interactions */
26305
- }
26306
- }]);
26307
-
26308
- return _class;
26309
- }(__WEBPACK_IMPORTED_MODULE_7__wordpress_element__["b" /* Component */])
26310
- );
26311
- }, 'withFocusOutside'));
26312
- //# sourceMappingURL=index.js.map
26313
-
26314
- /***/ }),
26315
- /* 194 */
26316
- /***/ (function(module, exports, __webpack_require__) {
26317
-
26318
- "use strict";
26319
-
26320
-
26321
- /**
26322
- * Internal dependencies;
26323
- */
26324
- var isShallowEqualObjects = __webpack_require__( 606 );
26325
- var isShallowEqualArrays = __webpack_require__( 607 );
26326
-
26327
- var isArray = Array.isArray;
26328
-
26329
- /**
26330
- * @typedef {{[key: string]: any}} ComparableObject
26331
- */
26332
-
26333
- /**
26334
- * Returns true if the two arrays or objects are shallow equal, or false
26335
- * otherwise.
26336
- *
26337
- * @param {any[]|ComparableObject} a First object or array to compare.
26338
- * @param {any[]|ComparableObject} b Second object or array to compare.
26339
- *
26340
- * @return {boolean} Whether the two values are shallow equal.
26341
- */
26342
- function isShallowEqual( a, b ) {
26343
- if ( a && b ) {
26344
- if ( a.constructor === Object && b.constructor === Object ) {
26345
- return isShallowEqualObjects( a, b );
26346
- } else if ( isArray( a ) && isArray( b ) ) {
26347
- return isShallowEqualArrays( a, b );
26348
- }
26349
- }
26350
-
26351
- return a === b;
26352
- }
26353
-
26354
- module.exports = isShallowEqual;
26355
- module.exports.isShallowEqualObjects = isShallowEqualObjects;
26356
- module.exports.isShallowEqualArrays = isShallowEqualArrays;
26357
-
26358
-
26359
- /***/ }),
26360
- /* 195 */
26361
- /***/ (function(module, exports, __webpack_require__) {
26362
-
26363
- "use strict";
26364
-
26365
-
26366
- var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
26367
-
26368
- var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
26369
-
26370
- function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
26371
-
26372
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
26373
-
26374
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
26375
-
26376
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
26377
-
26378
- var hoistNonReactStatic = __webpack_require__(610);
26379
- var React = __webpack_require__(9);
26380
- var ReactDOM = __webpack_require__(45);
26381
-
26382
- module.exports = function enhanceWithClickOutside(WrappedComponent) {
26383
- var componentName = WrappedComponent.displayName || WrappedComponent.name;
26384
-
26385
- var EnhancedComponent = function (_React$Component) {
26386
- _inherits(EnhancedComponent, _React$Component);
26387
-
26388
- function EnhancedComponent(props) {
26389
- _classCallCheck(this, EnhancedComponent);
26390
-
26391
- var _this = _possibleConstructorReturn(this, (EnhancedComponent.__proto__ || Object.getPrototypeOf(EnhancedComponent)).call(this, props));
26392
-
26393
- _this.handleClickOutside = _this.handleClickOutside.bind(_this);
26394
- return _this;
26395
- }
26396
-
26397
- _createClass(EnhancedComponent, [{
26398
- key: 'componentDidMount',
26399
- value: function componentDidMount() {
26400
- document.addEventListener('click', this.handleClickOutside, true);
26401
- }
26402
- }, {
26403
- key: 'componentWillUnmount',
26404
- value: function componentWillUnmount() {
26405
- document.removeEventListener('click', this.handleClickOutside, true);
26406
- }
26407
- }, {
26408
- key: 'handleClickOutside',
26409
- value: function handleClickOutside(e) {
26410
- var domNode = this.__domNode;
26411
- if ((!domNode || !domNode.contains(e.target)) && this.__wrappedInstance && typeof this.__wrappedInstance.handleClickOutside === 'function') {
26412
- this.__wrappedInstance.handleClickOutside(e);
26413
- }
26414
- }
26415
- }, {
26416
- key: 'render',
26417
- value: function render() {
26418
- var _this2 = this;
26419
-
26420
- var _props = this.props,
26421
- wrappedRef = _props.wrappedRef,
26422
- rest = _objectWithoutProperties(_props, ['wrappedRef']);
26423
-
26424
- return React.createElement(WrappedComponent, _extends({}, rest, {
26425
- ref: function ref(c) {
26426
- _this2.__wrappedInstance = c;
26427
- _this2.__domNode = ReactDOM.findDOMNode(c);
26428
- wrappedRef && wrappedRef(c);
26429
- }
26430
- }));
26431
- }
26432
- }]);
26433
-
26434
- return EnhancedComponent;
26435
- }(React.Component);
26436
-
26437
- EnhancedComponent.displayName = 'clickOutside(' + componentName + ')';
26438
-
26439
- return hoistNonReactStatic(EnhancedComponent, WrappedComponent);
26440
- };
26441
-
26442
- /***/ }),
26443
- /* 196 */
26444
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
26445
-
26446
- "use strict";
26447
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_element__ = __webpack_require__(1);
26448
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash__ = __webpack_require__(2);
26449
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_lodash__);
26450
-
26451
-
26452
- /**
26453
- * External dependencies
26454
- */
26455
-
26456
-
26457
- function Shortcut(_ref) {
26458
- var shortcut = _ref.shortcut,
26459
- className = _ref.className;
26460
-
26461
- if (!shortcut) {
26462
- return null;
26463
- }
26464
-
26465
- var displayText;
26466
- var ariaLabel;
26467
-
26468
- if (Object(__WEBPACK_IMPORTED_MODULE_1_lodash__["isString"])(shortcut)) {
26469
- displayText = shortcut;
26470
- }
26471
-
26472
- if (Object(__WEBPACK_IMPORTED_MODULE_1_lodash__["isObject"])(shortcut)) {
26473
- displayText = shortcut.display;
26474
- ariaLabel = shortcut.ariaLabel;
26475
- }
26476
-
26477
- return Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_element__["h" /* createElement */])("span", {
26478
- className: className,
26479
- "aria-label": ariaLabel
26480
- }, displayText);
26481
- }
26482
-
26483
- /* harmony default export */ __webpack_exports__["a"] = (Shortcut);
26484
- //# sourceMappingURL=index.js.map
26485
-
26486
- /***/ }),
26487
- /* 197 */
26488
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
26489
-
26490
- "use strict";
26491
- /* unused harmony export createScrollLockComponent */
26492
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
26493
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
26494
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
26495
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
26496
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
26497
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__wordpress_element__ = __webpack_require__(1);
26498
-
26499
-
26500
-
26501
-
26502
-
26503
-
26504
- /**
26505
- * WordPress dependencies
26506
- */
26507
-
26508
- /**
26509
- * Creates a ScrollLock component bound to the specified document.
26510
- *
26511
- * This function creates a ScrollLock component for the specified document
26512
- * and is exposed so we can create an isolated component for unit testing.
26513
- *
26514
- * @param {Object} args Keyword args.
26515
- * @param {HTMLDocument} args.htmlDocument The document to lock the scroll for.
26516
- * @param {string} args.className The name of the class used to lock scrolling.
26517
- * @return {Component} The bound ScrollLock component.
26518
- */
26519
-
26520
- function createScrollLockComponent() {
26521
- var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
26522
- _ref$htmlDocument = _ref.htmlDocument,
26523
- htmlDocument = _ref$htmlDocument === void 0 ? document : _ref$htmlDocument,
26524
- _ref$className = _ref.className,
26525
- className = _ref$className === void 0 ? 'lockscroll' : _ref$className;
26526
-
26527
- var lockCounter = 0;
26528
- /*
26529
- * Setting `overflow: hidden` on html and body elements resets body scroll in iOS.
26530
- * Save scroll top so we can restore it after locking scroll.
26531
- *
26532
- * NOTE: It would be cleaner and possibly safer to find a localized solution such
26533
- * as preventing default on certain touchmove events.
26534
- */
26535
-
26536
- var previousScrollTop = 0;
26537
- /**
26538
- * Locks and unlocks scroll depending on the boolean argument.
26539
- *
26540
- * @param {boolean} locked Whether or not scroll should be locked.
26541
- */
26542
-
26543
- function setLocked(locked) {
26544
- var scrollingElement = htmlDocument.scrollingElement || htmlDocument.body;
26545
-
26546
- if (locked) {
26547
- previousScrollTop = scrollingElement.scrollTop;
26548
- }
26549
-
26550
- var methodName = locked ? 'add' : 'remove';
26551
- scrollingElement.classList[methodName](className); // Adding the class to the document element seems to be necessary in iOS.
26552
-
26553
- htmlDocument.documentElement.classList[methodName](className);
26554
-
26555
- if (!locked) {
26556
- scrollingElement.scrollTop = previousScrollTop;
26557
- }
26558
- }
26559
- /**
26560
- * Requests scroll lock.
26561
- *
26562
- * This function tracks requests for scroll lock. It locks scroll on the first
26563
- * request and counts each request so `releaseLock` can unlock scroll when
26564
- * all requests have been released.
26565
- */
26566
-
26567
-
26568
- function requestLock() {
26569
- if (lockCounter === 0) {
26570
- setLocked(true);
26571
- }
26572
-
26573
- ++lockCounter;
26574
- }
26575
- /**
26576
- * Releases a request for scroll lock.
26577
- *
26578
- * This function tracks released requests for scroll lock. When all requests
26579
- * have been released, it unlocks scroll.
26580
- */
26581
-
26582
-
26583
- function releaseLock() {
26584
- if (lockCounter === 1) {
26585
- setLocked(false);
26586
- }
26587
-
26588
- --lockCounter;
26589
- }
26590
-
26591
- return (
26592
- /*#__PURE__*/
26593
- function (_Component) {
26594
- Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__["a" /* default */])(ScrollLock, _Component);
26595
-
26596
- function ScrollLock() {
26597
- Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, ScrollLock);
26598
-
26599
- return Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(ScrollLock).apply(this, arguments));
26600
- }
26601
-
26602
- Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__["a" /* default */])(ScrollLock, [{
26603
- key: "componentDidMount",
26604
-
26605
- /**
26606
- * Requests scroll lock on mount.
26607
- */
26608
- value: function componentDidMount() {
26609
- requestLock();
26610
- }
26611
- /**
26612
- * Releases scroll lock before unmount.
26613
- */
26614
-
26615
- }, {
26616
- key: "componentWillUnmount",
26617
- value: function componentWillUnmount() {
26618
- releaseLock();
26619
- }
26620
- /**
26621
- * Render nothing as this component is merely a way to declare scroll lock.
26622
- *
26623
- * @return {null} Render nothing by returning `null`.
26624
- */
26625
-
26626
- }, {
26627
- key: "render",
26628
- value: function render() {
26629
- return null;
26630
- }
26631
- }]);
26632
-
26633
- return ScrollLock;
26634
- }(__WEBPACK_IMPORTED_MODULE_5__wordpress_element__["b" /* Component */])
26635
- );
26636
- }
26637
- /* harmony default export */ __webpack_exports__["a"] = (createScrollLockComponent());
26638
- //# sourceMappingURL=index.js.map
26639
-
26640
- /***/ }),
26641
- /* 198 */
26642
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
26643
-
26644
- "use strict";
26645
- /* unused harmony export createSlotFill */
26646
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__ = __webpack_require__(8);
26647
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__wordpress_element__ = __webpack_require__(1);
26648
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__slot__ = __webpack_require__(611);
26649
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__fill__ = __webpack_require__(612);
26650
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__context__ = __webpack_require__(120);
26651
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "c", function() { return __WEBPACK_IMPORTED_MODULE_2__slot__["a"]; });
26652
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return __WEBPACK_IMPORTED_MODULE_3__fill__["a"]; });
26653
- /* unused harmony reexport Provider */
26654
- /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return __WEBPACK_IMPORTED_MODULE_4__context__["a"]; });
26655
-
26656
-
26657
-
26658
- /**
26659
- * Internal dependencies
26660
- */
26661
-
26662
-
26663
-
26664
-
26665
-
26666
-
26667
- function createSlotFill(name) {
26668
- var FillComponent = function FillComponent(props) {
26669
- return Object(__WEBPACK_IMPORTED_MODULE_1__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_3__fill__["a" /* default */], Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])({
26670
- name: name
26671
- }, props));
26672
- };
26673
-
26674
- FillComponent.displayName = name + 'Fill';
26675
-
26676
- var SlotComponent = function SlotComponent(props) {
26677
- return Object(__WEBPACK_IMPORTED_MODULE_1__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_2__slot__["a" /* default */], Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])({
26678
- name: name
26679
- }, props));
26680
- };
26681
-
26682
- SlotComponent.displayName = name + 'Slot';
26683
- return {
26684
- Fill: FillComponent,
26685
- Slot: SlotComponent
26686
- };
26687
- }
26688
- //# sourceMappingURL=index.js.map
26689
-
26690
- /***/ }),
26691
- /* 199 */
26692
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
26693
-
26694
- "use strict";
26695
- /* unused harmony export setup */
26696
- /* harmony export (immutable) */ __webpack_exports__["a"] = speak;
26697
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__wordpress_dom_ready__ = __webpack_require__(613);
26698
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__add_intro_text__ = __webpack_require__(614);
26699
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__add_container__ = __webpack_require__(618);
26700
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__clear__ = __webpack_require__(619);
26701
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__filter_message__ = __webpack_require__(620);
26702
- /**
26703
- * WordPress dependencies
26704
- */
26705
-
26706
- /**
26707
- * Internal dependencies
26708
- */
26709
-
26710
-
26711
-
26712
-
26713
-
26714
- /**
26715
- * Create the live regions.
26716
- */
26717
-
26718
- function setup() {
26719
- var introText = document.getElementById('a11y-speak-intro-text');
26720
- var containerAssertive = document.getElementById('a11y-speak-assertive');
26721
- var containerPolite = document.getElementById('a11y-speak-polite');
26722
-
26723
- if (introText === null) {
26724
- Object(__WEBPACK_IMPORTED_MODULE_1__add_intro_text__["a" /* default */])();
26725
- }
26726
-
26727
- if (containerAssertive === null) {
26728
- Object(__WEBPACK_IMPORTED_MODULE_2__add_container__["a" /* default */])('assertive');
26729
- }
26730
-
26731
- if (containerPolite === null) {
26732
- Object(__WEBPACK_IMPORTED_MODULE_2__add_container__["a" /* default */])('polite');
26733
- }
26734
- }
26735
- /**
26736
- * Run setup on domReady.
26737
- */
26738
-
26739
- Object(__WEBPACK_IMPORTED_MODULE_0__wordpress_dom_ready__["a" /* default */])(setup);
26740
- /**
26741
- * Allows you to easily announce dynamic interface updates to screen readers using ARIA live regions.
26742
- * This module is inspired by the `speak` function in `wp-a11y.js`.
26743
- *
26744
- * @param {string} message The message to be announced by assistive technologies.
26745
- * @param {string} [ariaLive] The politeness level for aria-live; default: 'polite'.
26746
- *
26747
- * @example
26748
- * ```js
26749
- * import { speak } from '@wordpress/a11y';
26750
- *
26751
- * // For polite messages that shouldn't interrupt what screen readers are currently announcing.
26752
- * speak( 'The message you want to send to the ARIA live region' );
26753
- *
26754
- * // For assertive messages that should interrupt what screen readers are currently announcing.
26755
- * speak( 'The message you want to send to the ARIA live region', 'assertive' );
26756
- * ```
26757
- */
26758
-
26759
- function speak(message, ariaLive) {
26760
- /*
26761
- * Clear previous messages to allow repeated strings being read out and hide
26762
- * the explanatory text from assistive technologies.
26763
- */
26764
- Object(__WEBPACK_IMPORTED_MODULE_3__clear__["a" /* default */])();
26765
- message = Object(__WEBPACK_IMPORTED_MODULE_4__filter_message__["a" /* default */])(message);
26766
- var introText = document.getElementById('a11y-speak-intro-text');
26767
- var containerAssertive = document.getElementById('a11y-speak-assertive');
26768
- var containerPolite = document.getElementById('a11y-speak-polite');
26769
-
26770
- if (containerAssertive && ariaLive === 'assertive') {
26771
- containerAssertive.textContent = message;
26772
- } else if (containerPolite) {
26773
- containerPolite.textContent = message;
26774
- }
26775
- /*
26776
- * Make the explanatory text available to assistive technologies by removing
26777
- * the 'hidden' HTML attribute.
26778
- */
26779
-
26780
-
26781
- if (introText) {
26782
- introText.removeAttribute('hidden');
26783
- }
26784
- }
26785
- //# sourceMappingURL=index.js.map
26786
-
26787
- /***/ }),
26788
- /* 200 */
26789
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
26790
-
26791
- "use strict";
26792
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return createI18n; });
26793
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__ = __webpack_require__(13);
26794
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_tannin__ = __webpack_require__(80);
26795
-
26796
-
26797
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
26798
-
26799
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
26800
-
26801
- /**
26802
- * External dependencies
26803
- */
26804
-
26805
- /**
26806
- * @typedef {Record<string,any>} LocaleData
26807
- */
26808
-
26809
- /**
26810
- * Default locale data to use for Tannin domain when not otherwise provided.
26811
- * Assumes an English plural forms expression.
26812
- *
26813
- * @type {LocaleData}
26814
- */
26815
-
26816
- var DEFAULT_LOCALE_DATA = {
26817
- '': {
26818
- /** @param {number} n */
26819
- plural_forms: function plural_forms(n) {
26820
- return n === 1 ? 0 : 1;
26821
- }
26822
- }
26823
- };
26824
- /**
26825
- * An i18n instance
26826
- *
26827
- * @typedef {Object} I18n
26828
- * @property {Function} setLocaleData Merges locale data into the Tannin instance by domain. Accepts data in a
26829
- * Jed-formatted JSON object shape.
26830
- * @property {Function} __ Retrieve the translation of text.
26831
- * @property {Function} _x Retrieve translated string with gettext context.
26832
- * @property {Function} _n Translates and retrieves the singular or plural form based on the supplied
26833
- * number.
26834
- * @property {Function} _nx Translates and retrieves the singular or plural form based on the supplied
26835
- * number, with gettext context.
26836
- * @property {Function} isRTL Check if current locale is RTL.
26837
- */
26838
-
26839
- /**
26840
- * Create an i18n instance
26841
- *
26842
- * @param {LocaleData} [initialData] Locale data configuration.
26843
- * @param {string} [initialDomain] Domain for which configuration applies.
26844
- * @return {I18n} I18n instance
26845
- */
26846
-
26847
- var createI18n = function createI18n(initialData, initialDomain) {
26848
- /**
26849
- * The underlying instance of Tannin to which exported functions interface.
26850
- *
26851
- * @type {Tannin}
26852
- */
26853
- var tannin = new __WEBPACK_IMPORTED_MODULE_1_tannin__["a" /* default */]({});
26854
- /**
26855
- * Merges locale data into the Tannin instance by domain. Accepts data in a
26856
- * Jed-formatted JSON object shape.
26857
- *
26858
- * @see http://messageformat.github.io/Jed/
26859
- *
26860
- * @param {LocaleData} [data] Locale data configuration.
26861
- * @param {string} [domain] Domain for which configuration applies.
26862
- */
26863
-
26864
- var setLocaleData = function setLocaleData(data) {
26865
- var domain = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
26866
- tannin.data[domain] = _objectSpread(_objectSpread(_objectSpread({}, DEFAULT_LOCALE_DATA), tannin.data[domain]), data); // Populate default domain configuration (supported locale date which omits
26867
- // a plural forms expression).
26868
-
26869
- tannin.data[domain][''] = _objectSpread(_objectSpread({}, DEFAULT_LOCALE_DATA['']), tannin.data[domain]['']);
26870
- };
26871
- /**
26872
- * Wrapper for Tannin's `dcnpgettext`. Populates default locale data if not
26873
- * otherwise previously assigned.
26874
- *
26875
- * @param {string|undefined} domain Domain to retrieve the translated text.
26876
- * @param {string|undefined} context Context information for the translators.
26877
- * @param {string} single Text to translate if non-plural. Used as
26878
- * fallback return value on a caught error.
26879
- * @param {string} [plural] The text to be used if the number is
26880
- * plural.
26881
- * @param {number} [number] The number to compare against to use
26882
- * either the singular or plural form.
26883
- *
26884
- * @return {string} The translated string.
26885
- */
26886
-
26887
-
26888
- var dcnpgettext = function dcnpgettext() {
26889
- var domain = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
26890
- var context = arguments.length > 1 ? arguments[1] : undefined;
26891
- var single = arguments.length > 2 ? arguments[2] : undefined;
26892
- var plural = arguments.length > 3 ? arguments[3] : undefined;
26893
- var number = arguments.length > 4 ? arguments[4] : undefined;
26894
-
26895
- if (!tannin.data[domain]) {
26896
- setLocaleData(undefined, domain);
26897
- }
26898
-
26899
- return tannin.dcnpgettext(domain, context, single, plural, number);
26900
- };
26901
- /**
26902
- * Retrieve the translation of text.
26903
- *
26904
- * @see https://developer.wordpress.org/reference/functions/__/
26905
- *
26906
- * @param {string} text Text to translate.
26907
- * @param {string} [domain] Domain to retrieve the translated text.
26908
- *
26909
- * @return {string} Translated text.
26910
- */
26911
-
26912
-
26913
- var __ = function __(text, domain) {
26914
- return dcnpgettext(domain, undefined, text);
26915
- };
26916
- /**
26917
- * Retrieve translated string with gettext context.
26918
- *
26919
- * @see https://developer.wordpress.org/reference/functions/_x/
26920
- *
26921
- * @param {string} text Text to translate.
26922
- * @param {string} context Context information for the translators.
26923
- * @param {string} [domain] Domain to retrieve the translated text.
26924
- *
26925
- * @return {string} Translated context string without pipe.
26926
- */
26927
-
26928
-
26929
- var _x = function _x(text, context, domain) {
26930
- return dcnpgettext(domain, context, text);
26931
- };
26932
- /**
26933
- * Translates and retrieves the singular or plural form based on the supplied
26934
- * number.
26935
- *
26936
- * @see https://developer.wordpress.org/reference/functions/_n/
26937
- *
26938
- * @param {string} single The text to be used if the number is singular.
26939
- * @param {string} plural The text to be used if the number is plural.
26940
- * @param {number} number The number to compare against to use either the
26941
- * singular or plural form.
26942
- * @param {string} [domain] Domain to retrieve the translated text.
26943
- *
26944
- * @return {string} The translated singular or plural form.
26945
- */
26946
-
26947
-
26948
- var _n = function _n(single, plural, number, domain) {
26949
- return dcnpgettext(domain, undefined, single, plural, number);
26950
- };
26951
- /**
26952
- * Translates and retrieves the singular or plural form based on the supplied
26953
- * number, with gettext context.
26954
- *
26955
- * @see https://developer.wordpress.org/reference/functions/_nx/
26956
- *
26957
- * @param {string} single The text to be used if the number is singular.
26958
- * @param {string} plural The text to be used if the number is plural.
26959
- * @param {number} number The number to compare against to use either the
26960
- * singular or plural form.
26961
- * @param {string} context Context information for the translators.
26962
- * @param {string} [domain] Domain to retrieve the translated text.
26963
- *
26964
- * @return {string} The translated singular or plural form.
26965
- */
26966
-
26967
-
26968
- var _nx = function _nx(single, plural, number, context, domain) {
26969
- return dcnpgettext(domain, context, single, plural, number);
26970
- };
26971
- /**
26972
- * Check if current locale is RTL.
26973
- *
26974
- * **RTL (Right To Left)** is a locale property indicating that text is written from right to left.
26975
- * For example, the `he` locale (for Hebrew) specifies right-to-left. Arabic (ar) is another common
26976
- * language written RTL. The opposite of RTL, LTR (Left To Right) is used in other languages,
26977
- * including English (`en`, `en-US`, `en-GB`, etc.), Spanish (`es`), and French (`fr`).
26978
- *
26979
- * @return {boolean} Whether locale is RTL.
26980
- */
26981
-
26982
-
26983
- var isRTL = function isRTL() {
26984
- return 'rtl' === _x('ltr', 'text direction');
26985
- };
26986
-
26987
- if (initialData) {
26988
- setLocaleData(initialData, initialDomain);
26989
- }
26990
-
26991
- return {
26992
- setLocaleData: setLocaleData,
26993
- __: __,
26994
- _x: _x,
26995
- _n: _n,
26996
- _nx: _nx,
26997
- isRTL: isRTL
26998
- };
26999
- };
27000
- //# sourceMappingURL=create-i18n.js.map
27001
-
27002
- /***/ }),
27003
- /* 201 */
27004
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
27005
-
27006
- "use strict";
27007
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ColorPicker; });
27008
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__ = __webpack_require__(3);
27009
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__ = __webpack_require__(4);
27010
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__ = __webpack_require__(5);
27011
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__ = __webpack_require__(6);
27012
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__ = __webpack_require__(7);
27013
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__ = __webpack_require__(10);
27014
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__wordpress_element__ = __webpack_require__(1);
27015
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_classnames__ = __webpack_require__(14);
27016
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7_classnames___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_7_classnames__);
27017
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash__ = __webpack_require__(2);
27018
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8_lodash___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_8_lodash__);
27019
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__alpha__ = __webpack_require__(626);
27020
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__hue__ = __webpack_require__(628);
27021
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__inputs__ = __webpack_require__(629);
27022
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__saturation__ = __webpack_require__(630);
27023
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__utils__ = __webpack_require__(67);
27024
-
27025
-
27026
-
27027
-
27028
-
27029
-
27030
-
27031
-
27032
- /**
27033
- * Parts of this source were derived and modified from react-color,
27034
- * released under the MIT license.
27035
- *
27036
- * https://github.com/casesandberg/react-color/
27037
- *
27038
- * Copyright (c) 2015 Case Sandberg
27039
- *
27040
- * Permission is hereby granted, free of charge, to any person obtaining a copy
27041
- * of this software and associated documentation files (the "Software"), to deal
27042
- * in the Software without restriction, including without limitation the rights
27043
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
27044
- * copies of the Software, and to permit persons to whom the Software is
27045
- * furnished to do so, subject to the following conditions:
27046
- *
27047
- * The above copyright notice and this permission notice shall be included in
27048
- * all copies or substantial portions of the Software.
27049
- *
27050
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27051
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27052
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27053
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27054
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27055
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27056
- * THE SOFTWARE.
27057
- */
27058
-
27059
- /**
27060
- * External dependencies
27061
- */
27062
-
27063
-
27064
- /**
27065
- * WordPress dependencies
27066
- */
27067
-
27068
-
27069
- /**
27070
- * Internal dependencies
27071
- */
27072
-
27073
-
27074
-
27075
-
27076
-
27077
-
27078
-
27079
- var ColorPicker =
27080
- /*#__PURE__*/
27081
- function (_Component) {
27082
- Object(__WEBPACK_IMPORTED_MODULE_4__babel_runtime_helpers_esm_inherits__["a" /* default */])(ColorPicker, _Component);
27083
-
27084
- function ColorPicker(_ref) {
27085
- var _this;
27086
-
27087
- var _ref$color = _ref.color,
27088
- color = _ref$color === void 0 ? '0071a1' : _ref$color;
27089
-
27090
- Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_classCallCheck__["a" /* default */])(this, ColorPicker);
27091
-
27092
- _this = Object(__WEBPACK_IMPORTED_MODULE_2__babel_runtime_helpers_esm_possibleConstructorReturn__["a" /* default */])(this, Object(__WEBPACK_IMPORTED_MODULE_3__babel_runtime_helpers_esm_getPrototypeOf__["a" /* default */])(ColorPicker).apply(this, arguments));
27093
- _this.state = Object(__WEBPACK_IMPORTED_MODULE_13__utils__["d" /* colorToState */])(color);
27094
- _this.handleChange = _this.handleChange.bind(Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_5__babel_runtime_helpers_esm_assertThisInitialized__["a" /* default */])(_this)));
27095
- return _this;
27096
- }
27097
-
27098
- Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_createClass__["a" /* default */])(ColorPicker, [{
27099
- key: "handleChange",
27100
- value: function handleChange(data) {
27101
- var _this$props = this.props,
27102
- oldHue = _this$props.oldHue,
27103
- _this$props$onChangeC = _this$props.onChangeComplete,
27104
- onChangeComplete = _this$props$onChangeC === void 0 ? __WEBPACK_IMPORTED_MODULE_8_lodash__["noop"] : _this$props$onChangeC;
27105
- var isValidColor = Object(__WEBPACK_IMPORTED_MODULE_13__utils__["f" /* simpleCheckForValidColor */])(data);
27106
-
27107
- if (isValidColor) {
27108
- var colors = Object(__WEBPACK_IMPORTED_MODULE_13__utils__["d" /* colorToState */])(data, data.h || oldHue);
27109
- this.setState(colors, Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["debounce"])(Object(__WEBPACK_IMPORTED_MODULE_8_lodash__["partial"])(onChangeComplete, colors), 100));
27110
- }
27111
- }
27112
- }, {
27113
- key: "render",
27114
- value: function render() {
27115
- var _this$props2 = this.props,
27116
- className = _this$props2.className,
27117
- disableAlpha = _this$props2.disableAlpha;
27118
- var _this$state = this.state,
27119
- color = _this$state.color,
27120
- hex = _this$state.hex,
27121
- hsl = _this$state.hsl,
27122
- hsv = _this$state.hsv,
27123
- rgb = _this$state.rgb;
27124
- var classes = __WEBPACK_IMPORTED_MODULE_7_classnames___default()(className, {
27125
- 'components-color-picker': true,
27126
- 'is-alpha-disabled': disableAlpha,
27127
- 'is-alpha-enabled': !disableAlpha
27128
- });
27129
- return Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])("div", {
27130
- className: classes
27131
- }, Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])("div", {
27132
- className: "components-color-picker__saturation"
27133
- }, Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_12__saturation__["a" /* default */], {
27134
- hsl: hsl,
27135
- hsv: hsv,
27136
- onChange: this.handleChange
27137
- })), Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])("div", {
27138
- className: "components-color-picker__body"
27139
- }, Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])("div", {
27140
- className: "components-color-picker__controls"
27141
- }, Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])("div", {
27142
- className: "components-color-picker__swatch"
27143
- }, Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])("div", {
27144
- className: "components-color-picker__active",
27145
- style: {
27146
- backgroundColor: color && color.toRgbString()
27147
- }
27148
- })), Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])("div", {
27149
- className: "components-color-picker__toggles"
27150
- }, Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_10__hue__["a" /* default */], {
27151
- hsl: hsl,
27152
- onChange: this.handleChange
27153
- }), disableAlpha ? null : Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_9__alpha__["a" /* default */], {
27154
- rgb: rgb,
27155
- hsl: hsl,
27156
- onChange: this.handleChange
27157
- }))), Object(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_11__inputs__["a" /* default */], {
27158
- rgb: rgb,
27159
- hsl: hsl,
27160
- hex: hex,
27161
- onChange: this.handleChange,
27162
- disableAlpha: disableAlpha
27163
- })));
27164
- }
27165
- }]);
27166
-
27167
- return ColorPicker;
27168
- }(__WEBPACK_IMPORTED_MODULE_6__wordpress_element__["b" /* Component */]);
27169
-
27170
-
27171
- //# sourceMappingURL=index.js.map
27172
-
27173
- /***/ }),
27174
- /* 202 */
27175
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
27176
-
27177
- "use strict";
27178
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__ = __webpack_require__(8);
27179
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__ = __webpack_require__(12);
27180
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__wordpress_element__ = __webpack_require__(1);
27181
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__wordpress_compose__ = __webpack_require__(18);
27182
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__base_control__ = __webpack_require__(42);
27183
-
27184
-
27185
-
27186
-
27187
- /**
27188
- * WordPress dependencies
27189
- */
27190
-
27191
- /**
27192
- * Internal dependencies
27193
- */
27194
-
27195
-
27196
-
27197
- function TextControl(_ref) {
27198
- var label = _ref.label,
27199
- value = _ref.value,
27200
- help = _ref.help,
27201
- className = _ref.className,
27202
- instanceId = _ref.instanceId,
27203
- onChange = _ref.onChange,
27204
- _ref$type = _ref.type,
27205
- type = _ref$type === void 0 ? 'text' : _ref$type,
27206
- props = Object(__WEBPACK_IMPORTED_MODULE_1__babel_runtime_helpers_esm_objectWithoutProperties__["a" /* default */])(_ref, ["label", "value", "help", "className", "instanceId", "onChange", "type"]);
27207
-
27208
- var id = "inspector-text-control-".concat(instanceId);
27209
-
27210
- var onChangeValue = function onChangeValue(event) {
27211
- return onChange(event.target.value);
27212
- };
27213
-
27214
- return Object(__WEBPACK_IMPORTED_MODULE_2__wordpress_element__["h" /* createElement */])(__WEBPACK_IMPORTED_MODULE_4__base_control__["a" /* default */], {
27215
- label: label,
27216
- id: id,
27217
- help: help,
27218
- className: className
27219
- }, Object(__WEBPACK_IMPORTED_MODULE_2__wordpress_element__["h" /* createElement */])("input", Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_extends__["a" /* default */])({
27220
- className: "components-text-control__input",
27221
- type: type,
27222
- id: id,
27223
- value: value,
27224
- onChange: onChangeValue,
27225
- "aria-describedby": !!help ? id + '__help' : undefined
27226
- }, props)));
27227
- }
27228
-
27229
- /* harmony default export */ __webpack_exports__["a"] = (Object(__WEBPACK_IMPORTED_MODULE_3__wordpress_compose__["d" /* withInstanceId */])(TextControl));
27230
- //# sourceMappingURL=index.js.map
27231
-
27232
- /***/ }),
27233
- /* 203 */
27234
- /***/ (function(module, exports, __webpack_require__) {
27235
-
27236
- "use strict";
27237
-
27238
-
27239
- var slice = Array.prototype.slice;
27240
- var isArgs = __webpack_require__(204);
27241
-
27242
- var origKeys = Object.keys;
27243
- var keysShim = origKeys ? function keys(o) { return origKeys(o); } : __webpack_require__(638);
27244
-
27245
- var originalKeys = Object.keys;
27246
-
27247
- keysShim.shim = function shimObjectKeys() {
27248
- if (Object.keys) {
27249
- var keysWorksWithArguments = (function () {
27250
- // Safari 5.0 bug
27251
- var args = Object.keys(arguments);
27252
- return args && args.length === arguments.length;
27253
- }(1, 2));
27254
- if (!keysWorksWithArguments) {
27255
- Object.keys = function keys(object) { // eslint-disable-line func-name-matching
27256
- if (isArgs(object)) {
27257
- return originalKeys(slice.call(object));
27258
- }
27259
- return originalKeys(object);
27260
- };
27261
- }
27262
- } else {
27263
- Object.keys = keysShim;
27264
- }
27265
- return Object.keys || keysShim;
27266
- };
27267
-
27268
- module.exports = keysShim;
27269
-
27270
-
27271
- /***/ }),
27272
- /* 204 */
27273
- /***/ (function(module, exports, __webpack_require__) {
27274
-
27275
- "use strict";
27276
-
27277
-
27278
- var toStr = Object.prototype.toString;
27279
-
27280
- module.exports = function isArguments(value) {
27281
- var str = toStr.call(value);
27282
- var isArgs = str === '[object Arguments]';
27283
- if (!isArgs) {
27284
- isArgs = str !== '[object Array]' &&
27285
- value !== null &&
27286
- typeof value === 'object' &&
27287
- typeof value.length === 'number' &&
27288
- value.length >= 0 &&
27289
- toStr.call(value.callee) === '[object Function]';
27290
- }
27291
- return isArgs;
27292
- };
27293
-
27294
-
27295
- /***/ }),
27296
- /* 205 */
27297
- /***/ (function(module, exports, __webpack_require__) {
27298
-
27299
- "use strict";
27300
-
27301
-
27302
- /* eslint complexity: [2, 18], max-statements: [2, 33] */
27303
- module.exports = function hasSymbols() {
27304
- if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
27305
- if (typeof Symbol.iterator === 'symbol') { return true; }
27306
-
27307
- var obj = {};
27308
- var sym = Symbol('test');
27309
- var symObj = Object(sym);
27310
- if (typeof sym === 'string') { return false; }
27311
-
27312
- if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
27313
- if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
27314
-
27315
- // temp disabled per https://github.com/ljharb/object.assign/issues/17
27316
- // if (sym instanceof Symbol) { return false; }
27317
- // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
27318
- // if (!(symObj instanceof Symbol)) { return false; }
27319
-
27320
- // if (typeof Symbol.prototype.toString !== 'function') { return false; }
27321
- // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
27322
-
27323
- var symVal = 42;
27324
- obj[sym] = symVal;
27325
- for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax
27326
- if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
27327
-
27328
- if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
27329
-
27330
- var syms = Object.getOwnPropertySymbols(obj);
27331
- if (syms.length !== 1 || syms[0] !== sym) { return false; }
27332
-
27333
- if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
27334
-
27335
- if (typeof Object.getOwnPropertyDescriptor === 'function') {
27336
- var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
27337
- if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
27338
- }
27339
-
27340
- return true;
27341
- };
27342
-
27343
-
27344
- /***/ }),
27345
- /* 206 */
27346
- /***/ (function(module, exports, __webpack_require__) {
27347
-
27348
- "use strict";
27349
-
27350
-
27351
- var ArraySpeciesCreate = __webpack_require__(640);
27352
- var FlattenIntoArray = __webpack_require__(650);
27353
- var Get = __webpack_require__(123);
27354
- var ToInteger = __webpack_require__(218);
27355
- var ToLength = __webpack_require__(217);
27356
- var ToObject = __webpack_require__(668);
27357
-
27358
- module.exports = function flat() {
27359
- var O = ToObject(this);
27360
- var sourceLen = ToLength(Get(O, 'length'));
27361
-
27362
- var depthNum = 1;
27363
- if (arguments.length > 0 && typeof arguments[0] !== 'undefined') {
27364
- depthNum = ToInteger(arguments[0]);
27365
- }
27366
-
27367
- var A = ArraySpeciesCreate(O, 0);
27368
- FlattenIntoArray(A, O, sourceLen, 0, depthNum);
27369
- return A;
27370
- };
27371
-
27372
-
27373
- /***/ }),
27374
- /* 207 */
27375
- /***/ (function(module, exports, __webpack_require__) {
27376
-
27377
- "use strict";
27378
-
27379
-
27380
- var GetIntrinsic = __webpack_require__(19);
27381
-
27382
- var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
27383
-
27384
- if ($defineProperty) {
27385
- try {
27386
- $defineProperty({}, 'a', { value: 1 });
27387
- } catch (e) {
27388
- // IE 8 has a broken defineProperty
27389
- $defineProperty = null;
27390
- }
27391
- }
27392
-
27393
- var callBound = __webpack_require__(69);
27394
-
27395
- var $isEnumerable = callBound('Object.prototype.propertyIsEnumerable');
27396
-
27397
- // eslint-disable-next-line max-params
27398
- module.exports = function DefineOwnProperty(IsDataDescriptor, SameValue, FromPropertyDescriptor, O, P, desc) {
27399
- if (!$defineProperty) {
27400
- if (!IsDataDescriptor(desc)) {
27401
- // ES3 does not support getters/setters
27402
- return false;
27403
- }
27404
- if (!desc['[[Configurable]]'] || !desc['[[Writable]]']) {
27405
- return false;
27406
- }
27407
-
27408
- // fallback for ES3
27409
- if (P in O && $isEnumerable(O, P) !== !!desc['[[Enumerable]]']) {
27410
- // a non-enumerable existing property
27411
- return false;
27412
- }
27413
-
27414
- // property does not exist at all, or exists but is enumerable
27415
- var V = desc['[[Value]]'];
27416
- // eslint-disable-next-line no-param-reassign
27417
- O[P] = V; // will use [[Define]]
27418
- return SameValue(O[P], V);
27419
- }
27420
- $defineProperty(O, P, FromPropertyDescriptor(desc));
27421
- return true;
27422
- };
27423
-
27424
-
27425
- /***/ }),
27426
- /* 208 */
27427
- /***/ (function(module, exports, __webpack_require__) {
27428
-
27429
- "use strict";
27430
-
27431
-
27432
- var assertRecord = __webpack_require__(125);
27433
-
27434
- var Type = __webpack_require__(35);
27435
-
27436
- // https://www.ecma-international.org/ecma-262/6.0/#sec-frompropertydescriptor
27437
-
27438
- module.exports = function FromPropertyDescriptor(Desc) {
27439
- if (typeof Desc === 'undefined') {
27440
- return Desc;
27441
- }
27442
-
27443
- assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
27444
-
27445
- var obj = {};
27446
- if ('[[Value]]' in Desc) {
27447
- obj.value = Desc['[[Value]]'];
27448
- }
27449
- if ('[[Writable]]' in Desc) {
27450
- obj.writable = Desc['[[Writable]]'];
27451
- }
27452
- if ('[[Get]]' in Desc) {
27453
- obj.get = Desc['[[Get]]'];
27454
- }
27455
- if ('[[Set]]' in Desc) {
27456
- obj.set = Desc['[[Set]]'];
27457
- }
27458
- if ('[[Enumerable]]' in Desc) {
27459
- obj.enumerable = Desc['[[Enumerable]]'];
27460
- }
27461
- if ('[[Configurable]]' in Desc) {
27462
- obj.configurable = Desc['[[Configurable]]'];
27463
- }
27464
- return obj;
27465
- };
27466
-
27467
-
27468
- /***/ }),
27469
- /* 209 */
27470
- /***/ (function(module, exports, __webpack_require__) {
27471
-
27472
- "use strict";
27473
-
27474
-
27475
- var has = __webpack_require__(38);
27476
-
27477
- var assertRecord = __webpack_require__(125);
27478
-
27479
- var Type = __webpack_require__(35);
27480
-
27481
- // https://www.ecma-international.org/ecma-262/6.0/#sec-isdatadescriptor
27482
-
27483
- module.exports = function IsDataDescriptor(Desc) {
27484
- if (typeof Desc === 'undefined') {
27485
- return false;
27486
- }
27487
-
27488
- assertRecord(Type, 'Property Descriptor', 'Desc', Desc);
27489
-
27490
- if (!has(Desc, '[[Value]]') && !has(Desc, '[[Writable]]')) {
27491
- return false;
27492
- }
27493
-
27494
- return true;
27495
- };
27496
-
27497
-
27498
- /***/ }),
27499
- /* 210 */
27500
- /***/ (function(module, exports, __webpack_require__) {
27501
-
27502
- "use strict";
27503
-
27504
-
27505
- var $isNaN = __webpack_require__(126);
27506
-
27507
- // http://www.ecma-international.org/ecma-262/5.1/#sec-9.12
27508
-
27509
- module.exports = function SameValue(x, y) {
27510
- if (x === y) { // 0 === -0, but they are not identical.
27511
- if (x === 0) { return 1 / x === 1 / y; }
27512
- return true;
27513
- }
27514
- return $isNaN(x) && $isNaN(y);
27515
- };
27516
-
27517
-
27518
- /***/ }),
27519
- /* 211 */
27520
- /***/ (function(module, exports, __webpack_require__) {
27521
-
27522
- "use strict";
27523
-
27524
-
27525
- var has = __webpack_require__(38);
27526
-
27527
- var GetIntrinsic = __webpack_require__(19);
27528
-
27529
- var $TypeError = GetIntrinsic('%TypeError%');
27530
-
27531
- var Type = __webpack_require__(35);
27532
- var ToBoolean = __webpack_require__(212);
27533
- var IsCallable = __webpack_require__(648);
27534
-
27535
- // https://ecma-international.org/ecma-262/5.1/#sec-8.10.5
27536
-
27537
- module.exports = function ToPropertyDescriptor(Obj) {
27538
- if (Type(Obj) !== 'Object') {
27539
- throw new $TypeError('ToPropertyDescriptor requires an object');
27540
- }
27541
-
27542
- var desc = {};
27543
- if (has(Obj, 'enumerable')) {
27544
- desc['[[Enumerable]]'] = ToBoolean(Obj.enumerable);
27545
- }
27546
- if (has(Obj, 'configurable')) {
27547
- desc['[[Configurable]]'] = ToBoolean(Obj.configurable);
27548
- }
27549
- if (has(Obj, 'value')) {
27550
- desc['[[Value]]'] = Obj.value;
27551
- }
27552
- if (has(Obj, 'writable')) {
27553
- desc['[[Writable]]'] = ToBoolean(Obj.writable);
27554
- }
27555
- if (has(Obj, 'get')) {
27556
- var getter = Obj.get;
27557
- if (typeof getter !== 'undefined' && !IsCallable(getter)) {
27558
- throw new $TypeError('getter must be a function');
27559
- }
27560
- desc['[[Get]]'] = getter;
27561
- }
27562
- if (has(Obj, 'set')) {
27563
- var setter = Obj.set;
27564
- if (typeof setter !== 'undefined' && !IsCallable(setter)) {
27565
- throw new $TypeError('setter must be a function');
27566
- }
27567
- desc['[[Set]]'] = setter;
27568
- }
27569
-
27570
- if ((has(desc, '[[Get]]') || has(desc, '[[Set]]')) && (has(desc, '[[Value]]') || has(desc, '[[Writable]]'))) {
27571
- throw new $TypeError('Invalid property descriptor. Cannot both specify accessors and a value or writable attribute');
27572
- }
27573
- return desc;
27574
- };
27575
-
27576
-
27577
- /***/ }),
27578
- /* 212 */
27579
- /***/ (function(module, exports, __webpack_require__) {
27580
-
27581
- "use strict";
27582
-
27583
-
27584
- // http://www.ecma-international.org/ecma-262/5.1/#sec-9.2
27585
-
27586
- module.exports = function ToBoolean(value) { return !!value; };
27587
-
27588
-
27589
- /***/ }),
27590
- /* 213 */
27591
- /***/ (function(module, exports, __webpack_require__) {
27592
-
27593
- "use strict";
27594
-
27595
-
27596
- var $isNaN = Number.isNaN || function (a) { return a !== a; };
27597
-
27598
- module.exports = Number.isFinite || function (x) { return typeof x === 'number' && !$isNaN(x) && x !== Infinity && x !== -Infinity; };
27599
-
27600
-
27601
- /***/ }),
27602
- /* 214 */
27603
- /***/ (function(module, exports, __webpack_require__) {
27604
-
27605
- "use strict";
27606
-
27607
-
27608
- var GetIntrinsic = __webpack_require__(19);
27609
-
27610
- var $Math = GetIntrinsic('%Math%');
27611
- var $Number = GetIntrinsic('%Number%');
27612
-
27613
- module.exports = $Number.MAX_SAFE_INTEGER || $Math.pow(2, 53) - 1;
27614
-
27615
-
27616
- /***/ }),
27617
- /* 215 */
27618
- /***/ (function(module, exports, __webpack_require__) {
27619
-
27620
- "use strict";
27621
-
27622
-
27623
- var hasSymbols = __webpack_require__(43)();
27624
- var hasToStringTag = hasSymbols && typeof Symbol.toStringTag === 'symbol';
27625
- var hasOwnProperty;
27626
- var regexExec;
27627
- var isRegexMarker;
27628
- var badStringifier;
27629
-
27630
- if (hasToStringTag) {
27631
- hasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty);
27632
- regexExec = Function.call.bind(RegExp.prototype.exec);
27633
- isRegexMarker = {};
27634
-
27635
- var throwRegexMarker = function () {
27636
- throw isRegexMarker;
27637
- };
27638
- badStringifier = {
27639
- toString: throwRegexMarker,
27640
- valueOf: throwRegexMarker
27641
- };
27642
-
27643
- if (typeof Symbol.toPrimitive === 'symbol') {
27644
- badStringifier[Symbol.toPrimitive] = throwRegexMarker;
27645
- }
27646
- }
27647
-
27648
- var toStr = Object.prototype.toString;
27649
- var gOPD = Object.getOwnPropertyDescriptor;
27650
- var regexClass = '[object RegExp]';
27651
-
27652
- module.exports = hasToStringTag
27653
- // eslint-disable-next-line consistent-return
27654
- ? function isRegex(value) {
27655
- if (!value || typeof value !== 'object') {
27656
- return false;
27657
- }
27658
-
27659
- var descriptor = gOPD(value, 'lastIndex');
27660
- var hasLastIndexDataProperty = descriptor && hasOwnProperty(descriptor, 'value');
27661
- if (!hasLastIndexDataProperty) {
27662
- return false;
27663
- }
27664
-
27665
- try {
27666
- regexExec(value, badStringifier);
27667
- } catch (e) {
27668
- return e === isRegexMarker;
27669
- }
27670
- }
27671
- : function isRegex(value) {
27672
- // In older browsers, typeof regex incorrectly returns 'function'
27673
- if (!value || (typeof value !== 'object' && typeof value !== 'function')) {
27674
- return false;
27675
- }
27676
-
27677
- return toStr.call(value) === regexClass;
27678
- };
27679
-
27680
-
27681
- /***/ }),
27682
- /* 216 */
27683
- /***/ (function(module, exports, __webpack_require__) {
27684
-
27685
- "use strict";
27686
-
27687
-
27688
- module.exports = function isPrimitive(value) {
27689
- return value === null || (typeof value !== 'function' && typeof value !== 'object');
27690
- };
27691
-
27692
-
27693
- /***/ }),
27694
- /* 217 */
27695
- /***/ (function(module, exports, __webpack_require__) {
27696
-
27697
- "use strict";
27698
-
27699
-
27700
- var MAX_SAFE_INTEGER = __webpack_require__(214);
27701
-
27702
- var ToInteger = __webpack_require__(218);
27703
-
27704
- module.exports = function ToLength(argument) {
27705
- var len = ToInteger(argument);
27706
- if (len <= 0) { return 0; } // includes converting -0 to +0
27707
- if (len > MAX_SAFE_INTEGER) { return MAX_SAFE_INTEGER; }
27708
- return len;
27709
- };
27710
-
27711
-
27712
- /***/ }),
27713
- /* 218 */
27714
- /***/ (function(module, exports, __webpack_require__) {
27715
-
27716
- "use strict";
27717
-
27718
-
27719
- var ES5ToInteger = __webpack_require__(659);
27720
-
27721
- var ToNumber = __webpack_require__(662);
27722
-
27723
- // https://www.ecma-international.org/ecma-262/6.0/#sec-tointeger
27724
-
27725
- module.exports = function ToInteger(value) {
27726
- var number = ToNumber(value);
27727
- return ES5ToInteger(number);
27728
- };
27729
-
27730
-
27731
- /***/ }),
27732
- /* 219 */
27733
- /***/ (function(module, exports, __webpack_require__) {
27734
-
27735
- "use strict";
27736
-
27737
-
27738
- var hasSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol';
27739
-
27740
- var isPrimitive = __webpack_require__(665);
27741
- var isCallable = __webpack_require__(86);
27742
- var isDate = __webpack_require__(666);
27743
- var isSymbol = __webpack_require__(220);
27744
-
27745
- var ordinaryToPrimitive = function OrdinaryToPrimitive(O, hint) {
27746
- if (typeof O === 'undefined' || O === null) {
27747
- throw new TypeError('Cannot call method on ' + O);
27748
- }
27749
- if (typeof hint !== 'string' || (hint !== 'number' && hint !== 'string')) {
27750
- throw new TypeError('hint must be "string" or "number"');
27751
- }
27752
- var methodNames = hint === 'string' ? ['toString', 'valueOf'] : ['valueOf', 'toString'];
27753
- var method, result, i;
27754
- for (i = 0; i < methodNames.length; ++i) {
27755
- method = O[methodNames[i]];
27756
- if (isCallable(method)) {
27757
- result = method.call(O);
27758
- if (isPrimitive(result)) {
27759
- return result;
27760
- }
27761
- }
27762
- }
27763
- throw new TypeError('No default value');
27764
- };
27765
-
27766
- var GetMethod = function GetMethod(O, P) {
27767
- var func = O[P];
27768
- if (func !== null && typeof func !== 'undefined') {
27769
- if (!isCallable(func)) {
27770
- throw new TypeError(func + ' returned for property ' + P + ' of object ' + O + ' is not a function');
27771
- }
27772
- return func;
27773
- }
27774
- return void 0;
27775
- };
27776
-
27777
- // http://www.ecma-international.org/ecma-262/6.0/#sec-toprimitive
27778
- module.exports = function ToPrimitive(input) {
27779
- if (isPrimitive(input)) {
27780
- return input;
27781
- }
27782
- var hint = 'default';
27783
- if (arguments.length > 1) {
27784
- if (arguments[1] === String) {
27785
- hint = 'string';
27786
- } else if (arguments[1] === Number) {
27787
- hint = 'number';
27788
- }
27789
- }
27790
-
27791
- var exoticToPrim;
27792
- if (hasSymbols) {
27793
- if (Symbol.toPrimitive) {
27794
- exoticToPrim = GetMethod(input, Symbol.toPrimitive);
27795
- } else if (isSymbol(input)) {
27796
- exoticToPrim = Symbol.prototype.valueOf;
27797
- }
27798
- }
27799
- if (typeof exoticToPrim !== 'undefined') {
27800
- var result = exoticToPrim.call(input, hint);
27801
- if (isPrimitive(result)) {
27802
- return result;
27803
- }
27804
- throw new TypeError('unable to convert exotic object to primitive');
27805
- }
27806
- if (hint === 'default' && (isDate(input) || isSymbol(input))) {
27807
- hint = 'string';
27808
- }
27809
- return ordinaryToPrimitive(input, hint === 'default' ? 'number' : hint);
27810
- };
27811
-
27812
-
27813
- /***/ }),
27814
- /* 220 */
27815
- /***/ (function(module, exports, __webpack_require__) {
27816
-
27817
- "use strict";
27818
-
27819
-
27820
- var toStr = Object.prototype.toString;
27821
- var hasSymbols = __webpack_require__(43)();
27822
-
27823
- if (hasSymbols) {
27824
- var symToStr = Symbol.prototype.toString;
27825
- var symStringRegex = /^Symbol\(.*\)$/;
27826
- var isSymbolObject = function isRealSymbolObject(value) {
27827
- if (typeof value.valueOf() !== 'symbol') {
27828
- return false;
27829
- }
27830
- return symStringRegex.test(symToStr.call(value));
27831
- };
27832
-
27833
- module.exports = function isSymbol(value) {
27834
- if (typeof value === 'symbol') {
27835
- return true;
27836
- }
27837
- if (toStr.call(value) !== '[object Symbol]') {
27838
- return false;
27839
- }
27840
- try {
27841
- return isSymbolObject(value);
27842
- } catch (e) {
27843
- return false;
27844
- }
27845
- };
27846
- } else {
27847
-
27848
- module.exports = function isSymbol(value) {
27849
- // this environment does not support Symbols.
27850
- return false && value;
27851
- };
27852
- }
27853
-
27854
-
27855
- /***/ }),
27856
- /* 221 */
27857
- /***/ (function(module, exports, __webpack_require__) {
27858
-
27859
- "use strict";
27860
-
27861
-
27862
- var implementation = __webpack_require__(206);
27863
-
27864
- module.exports = function getPolyfill() {
27865
- return Array.prototype.flat || implementation;
27866
- };
27867
-
27868
-
27869
- /***/ }),
27870
- /* 222 */
27871
- /***/ (function(module, exports, __webpack_require__) {
27872
-
27873
- "use strict";
27874
- /* WEBPACK VAR INJECTION */(function(process) {
27875
-
27876
- Object.defineProperty(exports, "__esModule", {
27877
- value: true
27878
- });
27879
- var styleInterface = void 0;
27880
- var styleTheme = void 0;
27881
-
27882
- var START_MARK = 'react-with-styles.resolve.start';
27883
- var END_MARK = 'react-with-styles.resolve.end';
27884
- var MEASURE_MARK = '\uD83D\uDC69\u200D\uD83C\uDFA8 [resolve]';
27885
-
27886
- function registerTheme(theme) {
27887
- styleTheme = theme;
27888
- }
27889
-
27890
- function registerInterface(interfaceToRegister) {
27891
- styleInterface = interfaceToRegister;
27892
- }
27893
-
27894
- function create(makeFromTheme, createWithDirection) {
27895
- var styles = createWithDirection(makeFromTheme(styleTheme));
27896
- return function () {
27897
- return styles;
27898
- };
27899
- }
27900
-
27901
- function createLTR(makeFromTheme) {
27902
- return create(makeFromTheme, styleInterface.createLTR || styleInterface.create);
27903
- }
27904
-
27905
- function createRTL(makeFromTheme) {
27906
- return create(makeFromTheme, styleInterface.createRTL || styleInterface.create);
27907
- }
27908
-
27909
- function get() {
27910
- return styleTheme;
27911
- }
27912
-
27913
- function resolve() {
27914
- if (process.env.NODE_ENV !== 'production' && typeof performance !== 'undefined' && performance.mark !== undefined && typeof performance.clearMarks === 'function') {
27915
- performance.clearMarks(START_MARK);
27916
- performance.mark(START_MARK);
27917
- }
27918
-
27919
- for (var _len = arguments.length, styles = Array(_len), _key = 0; _key < _len; _key++) {
27920
- styles[_key] = arguments[_key];
27921
- }
27922
-
27923
- var result = styleInterface.resolve(styles);
27924
-
27925
- if (process.env.NODE_ENV !== 'production' && typeof performance !== 'undefined' && performance.mark !== undefined && typeof performance.clearMarks === 'function') {
27926
- performance.clearMarks(END_MARK);
27927
- performance.mark(END_MARK);
27928
-
27929
- performance.measure(MEASURE_MARK, START_MARK, END_MARK);
27930
- performance.clearMarks(MEASURE_MARK);
27931
- }
27932
-
27933
- return result;
27934
- }
27935
-
27936
- function resolveLTR() {
27937
- for (var _len2 = arguments.length, styles = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
27938
- styles[_key2] = arguments[_key2];
27939
- }
27940
-
27941
- if (styleInterface.resolveLTR) {
27942
- return styleInterface.resolveLTR(styles);
27943
- }
27944
-
27945
- return resolve(styles);
27946
- }
27947
-
27948
- function resolveRTL() {
27949
- for (var _len3 = arguments.length, styles = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
27950
- styles[_key3] = arguments[_key3];
27951
- }
27952
-
27953
- if (styleInterface.resolveRTL) {
27954
- return styleInterface.resolveRTL(styles);
27955
- }
27956
-
27957
- return resolve(styles);
27958
- }
27959
-
27960
- function flush() {
27961
- if (styleInterface.flush) {
27962
- styleInterface.flush();
27963
- }
27964
- }
27965
-
27966
- exports['default'] = {
27967
- registerTheme: registerTheme,
27968
- registerInterface: registerInterface,
27969
- create: createLTR,
27970
- createLTR: createLTR,
27971
- createRTL: createRTL,
27972
- get: get,
27973
- resolve: resolveLTR,
27974
- resolveLTR: resolveLTR,
27975
- resolveRTL: resolveRTL,
27976
- flush: flush
27977
- };
27978
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(20)))
27979
-
27980
- /***/ }),
27981
- /* 223 */
27982
- /***/ (function(module, exports, __webpack_require__) {
27983
-
27984
- "use strict";
27985
-
27986
-
27987
- Object.defineProperty(exports, "__esModule", {
27988
- value: true
27989
- });
27990
- var core = {
27991
- white: '#fff',
27992
- gray: '#484848',
27993
- grayLight: '#82888a',
27994
- grayLighter: '#cacccd',
27995
- grayLightest: '#f2f2f2',
27996
-
27997
- borderMedium: '#c4c4c4',
27998
- border: '#dbdbdb',
27999
- borderLight: '#e4e7e7',
28000
- borderLighter: '#eceeee',
28001
- borderBright: '#f4f5f5',
28002
-
28003
- primary: '#00a699',
28004
- primaryShade_1: '#33dacd',
28005
- primaryShade_2: '#66e2da',
28006
- primaryShade_3: '#80e8e0',
28007
- primaryShade_4: '#b2f1ec',
28008
- primary_dark: '#008489',
28009
-
28010
- secondary: '#007a87',
28011
-
28012
- yellow: '#ffe8bc',
28013
- yellow_dark: '#ffce71'
28014
- };
28015
-
28016
- exports['default'] = {
28017
- reactDates: {
28018
- zIndex: 0,
28019
- border: {
28020
- input: {
28021
- border: 0,
28022
- borderTop: 0,
28023
- borderRight: 0,
28024
- borderBottom: '2px solid transparent',
28025
- borderLeft: 0,
28026
- outlineFocused: 0,
28027
- borderFocused: 0,
28028
- borderTopFocused: 0,
28029
- borderLeftFocused: 0,
28030
- borderBottomFocused: '2px solid ' + String(core.primary_dark),
28031
- borderRightFocused: 0,
28032
- borderRadius: 0
28033
- },
28034
- pickerInput: {
28035
- borderWidth: 1,
28036
- borderStyle: 'solid',
28037
- borderRadius: 2
28038
- }
28039
- },
28040
-
28041
- color: {
28042
- core: core,
28043
-
28044
- disabled: core.grayLightest,
28045
-
28046
- background: core.white,
28047
- backgroundDark: '#f2f2f2',
28048
- backgroundFocused: core.white,
28049
- border: 'rgb(219, 219, 219)',
28050
- text: core.gray,
28051
- textDisabled: core.border,
28052
- textFocused: '#007a87',
28053
- placeholderText: '#757575',
28054
-
28055
- outside: {
28056
- backgroundColor: core.white,
28057
- backgroundColor_active: core.white,
28058
- backgroundColor_hover: core.white,
28059
- color: core.gray,
28060
- color_active: core.gray,
28061
- color_hover: core.gray
28062
- },
28063
-
28064
- highlighted: {
28065
- backgroundColor: core.yellow,
28066
- backgroundColor_active: core.yellow_dark,
28067
- backgroundColor_hover: core.yellow_dark,
28068
- color: core.gray,
28069
- color_active: core.gray,
28070
- color_hover: core.gray
28071
- },
28072
-
28073
- minimumNights: {
28074
- backgroundColor: core.white,
28075
- backgroundColor_active: core.white,
28076
- backgroundColor_hover: core.white,
28077
- borderColor: core.borderLighter,
28078
- color: core.grayLighter,
28079
- color_active: core.grayLighter,
28080
- color_hover: core.grayLighter
28081
- },
28082
-
28083
- hoveredSpan: {
28084
- backgroundColor: core.primaryShade_4,
28085
- backgroundColor_active: core.primaryShade_3,
28086
- backgroundColor_hover: core.primaryShade_4,
28087
- borderColor: core.primaryShade_3,
28088
- borderColor_active: core.primaryShade_3,
28089
- borderColor_hover: core.primaryShade_3,
28090
- color: core.secondary,
28091
- color_active: core.secondary,
28092
- color_hover: core.secondary
28093
- },
28094
-
28095
- selectedSpan: {
28096
- backgroundColor: core.primaryShade_2,
28097
- backgroundColor_active: core.primaryShade_1,
28098
- backgroundColor_hover: core.primaryShade_1,
28099
- borderColor: core.primaryShade_1,
28100
- borderColor_active: core.primary,
28101
- borderColor_hover: core.primary,
28102
- color: core.white,
28103
- color_active: core.white,
28104
- color_hover: core.white
28105
- },
28106
-
28107
- selected: {
28108
- backgroundColor: core.primary,
28109
- backgroundColor_active: core.primary,
28110
- backgroundColor_hover: core.primary,
28111
- borderColor: core.primary,
28112
- borderColor_active: core.primary,
28113
- borderColor_hover: core.primary,
28114
- color: core.white,
28115
- color_active: core.white,
28116
- color_hover: core.white
28117
- },
28118
-
28119
- blocked_calendar: {
28120
- backgroundColor: core.grayLighter,
28121
- backgroundColor_active: core.grayLighter,
28122
- backgroundColor_hover: core.grayLighter,
28123
- borderColor: core.grayLighter,
28124
- borderColor_active: core.grayLighter,
28125
- borderColor_hover: core.grayLighter,
28126
- color: core.grayLight,
28127
- color_active: core.grayLight,
28128
- color_hover: core.grayLight
28129
- },
28130
-
28131
- blocked_out_of_range: {
28132
- backgroundColor: core.white,
28133
- backgroundColor_active: core.white,
28134
- backgroundColor_hover: core.white,
28135
- borderColor: core.borderLight,
28136
- borderColor_active: core.borderLight,
28137
- borderColor_hover: core.borderLight,
28138
- color: core.grayLighter,
28139
- color_active: core.grayLighter,
28140
- color_hover: core.grayLighter
28141
- }
28142
- },
28143
-
28144
- spacing: {
28145
- dayPickerHorizontalPadding: 9,
28146
- captionPaddingTop: 22,
28147
- captionPaddingBottom: 37,
28148
- inputPadding: 0,
28149
- displayTextPaddingVertical: undefined,
28150
- displayTextPaddingTop: 11,
28151
- displayTextPaddingBottom: 9,
28152
- displayTextPaddingHorizontal: undefined,
28153
- displayTextPaddingLeft: 11,
28154
- displayTextPaddingRight: 11,
28155
- displayTextPaddingVertical_small: undefined,
28156
- displayTextPaddingTop_small: 7,
28157
- displayTextPaddingBottom_small: