willba-component-library 0.0.55 → 0.0.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.esm.js CHANGED
@@ -1,534 +1,155 @@
1
1
  import * as React__default from 'react';
2
2
  import React__default__default, { useState, createContext, useContext, useRef, useEffect, forwardRef } from 'react';
3
3
 
4
- function getDefaultExportFromCjs (x) {
5
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
6
- }
4
+ function ownKeys$1(object, enumerableOnly) {
5
+ var keys = Object.keys(object);
7
6
 
8
- var classnames = {exports: {}};
7
+ if (Object.getOwnPropertySymbols) {
8
+ var symbols = Object.getOwnPropertySymbols(object);
9
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
10
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
11
+ })), keys.push.apply(keys, symbols);
12
+ }
9
13
 
10
- /*!
11
- Copyright (c) 2018 Jed Watson.
12
- Licensed under the MIT License (MIT), see
13
- http://jedwatson.github.io/classnames
14
- */
14
+ return keys;
15
+ }
15
16
 
16
- (function (module) {
17
- /* global define */
17
+ function _objectSpread2$1(target) {
18
+ for (var i = 1; i < arguments.length; i++) {
19
+ var source = null != arguments[i] ? arguments[i] : {};
20
+ i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) {
21
+ _defineProperty$1(target, key, source[key]);
22
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) {
23
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
24
+ });
25
+ }
18
26
 
19
- (function () {
27
+ return target;
28
+ }
20
29
 
21
- var hasOwn = {}.hasOwnProperty;
30
+ function _typeof$2(obj) {
31
+ "@babel/helpers - typeof";
22
32
 
23
- function classNames() {
24
- var classes = [];
33
+ return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
34
+ return typeof obj;
35
+ } : function (obj) {
36
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
37
+ }, _typeof$2(obj);
38
+ }
25
39
 
26
- for (var i = 0; i < arguments.length; i++) {
27
- var arg = arguments[i];
28
- if (!arg) continue;
40
+ function _classCallCheck(instance, Constructor) {
41
+ if (!(instance instanceof Constructor)) {
42
+ throw new TypeError("Cannot call a class as a function");
43
+ }
44
+ }
29
45
 
30
- var argType = typeof arg;
46
+ function _defineProperties(target, props) {
47
+ for (var i = 0; i < props.length; i++) {
48
+ var descriptor = props[i];
49
+ descriptor.enumerable = descriptor.enumerable || false;
50
+ descriptor.configurable = true;
51
+ if ("value" in descriptor) descriptor.writable = true;
52
+ Object.defineProperty(target, descriptor.key, descriptor);
53
+ }
54
+ }
31
55
 
32
- if (argType === 'string' || argType === 'number') {
33
- classes.push(arg);
34
- } else if (Array.isArray(arg)) {
35
- if (arg.length) {
36
- var inner = classNames.apply(null, arg);
37
- if (inner) {
38
- classes.push(inner);
39
- }
40
- }
41
- } else if (argType === 'object') {
42
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
43
- classes.push(arg.toString());
44
- continue;
45
- }
56
+ function _createClass(Constructor, protoProps, staticProps) {
57
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
58
+ if (staticProps) _defineProperties(Constructor, staticProps);
59
+ Object.defineProperty(Constructor, "prototype", {
60
+ writable: false
61
+ });
62
+ return Constructor;
63
+ }
46
64
 
47
- for (var key in arg) {
48
- if (hasOwn.call(arg, key) && arg[key]) {
49
- classes.push(key);
50
- }
51
- }
52
- }
53
- }
65
+ function _defineProperty$1(obj, key, value) {
66
+ if (key in obj) {
67
+ Object.defineProperty(obj, key, {
68
+ value: value,
69
+ enumerable: true,
70
+ configurable: true,
71
+ writable: true
72
+ });
73
+ } else {
74
+ obj[key] = value;
75
+ }
54
76
 
55
- return classes.join(' ');
56
- }
77
+ return obj;
78
+ }
57
79
 
58
- if (module.exports) {
59
- classNames.default = classNames;
60
- module.exports = classNames;
61
- } else {
62
- window.classNames = classNames;
63
- }
64
- }());
65
- } (classnames));
80
+ function _slicedToArray(arr, i) {
81
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest();
82
+ }
66
83
 
67
- var classnamesExports = classnames.exports;
68
- var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
84
+ function _toConsumableArray$1(arr) {
85
+ return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread$1();
86
+ }
69
87
 
70
- function styleInject(css, ref) {
71
- if ( ref === void 0 ) ref = {};
72
- var insertAt = ref.insertAt;
88
+ function _arrayWithoutHoles$1(arr) {
89
+ if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);
90
+ }
73
91
 
74
- if (!css || typeof document === 'undefined') { return; }
92
+ function _arrayWithHoles(arr) {
93
+ if (Array.isArray(arr)) return arr;
94
+ }
75
95
 
76
- var head = document.head || document.getElementsByTagName('head')[0];
77
- var style = document.createElement('style');
78
- style.type = 'text/css';
96
+ function _iterableToArray$1(iter) {
97
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
98
+ }
79
99
 
80
- if (insertAt === 'top') {
81
- if (head.firstChild) {
82
- head.insertBefore(style, head.firstChild);
83
- } else {
84
- head.appendChild(style);
85
- }
86
- } else {
87
- head.appendChild(style);
88
- }
100
+ function _iterableToArrayLimit(arr, i) {
101
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
89
102
 
90
- if (style.styleSheet) {
91
- style.styleSheet.cssText = css;
92
- } else {
93
- style.appendChild(document.createTextNode(css));
94
- }
95
- }
103
+ if (_i == null) return;
104
+ var _arr = [];
105
+ var _n = true;
106
+ var _d = false;
96
107
 
97
- var css_248z$9 = ".storybook-button {\r\n font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\r\n font-weight: 700;\r\n border: 0;\r\n border-radius: 3em;\r\n cursor: pointer;\r\n display: inline-block;\r\n line-height: 1;\r\n}\r\n.storybook-button--primary {\r\n color: white;\r\n background-color: #1ea7fd;\r\n}\r\n.storybook-button--secondary {\r\n color: #333;\r\n background-color: transparent;\r\n box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;\r\n}\r\n.storybook-button--small {\r\n font-size: 12px;\r\n padding: 10px 16px;\r\n}\r\n.storybook-button--medium {\r\n font-size: 14px;\r\n padding: 11px 20px;\r\n}\r\n.storybook-button--large {\r\n font-size: 16px;\r\n padding: 12px 24px;\r\n}";
98
- styleInject(css_248z$9);
108
+ var _s, _e;
99
109
 
100
- /**
101
- * Primary UI component for user interaction
102
- */
103
- var Button$1 = function (_a) {
104
- var _b = _a.type, type = _b === void 0 ? "primary" : _b, textColor = _a.textColor, _c = _a.size, size = _c === void 0 ? "medium" : _c, onClick = _a.onClick, label = _a.label;
105
- var _d = useState(4), theState = _d[0]; _d[1];
106
- return (React__default__default.createElement("button", { type: "button", className: classNames("storybook-button", "storybook-button--".concat(size), "storybook-button--".concat(type)), style: textColor ? { color: textColor } : {}, onClick: onClick }, "".concat(label, " ").concat(theState)));
107
- };
110
+ try {
111
+ for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
112
+ _arr.push(_s.value);
108
113
 
109
- function warn() {
110
- if (console && console.warn) {
111
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
112
- args[_key] = arguments[_key];
114
+ if (i && _arr.length === i) break;
115
+ }
116
+ } catch (err) {
117
+ _d = true;
118
+ _e = err;
119
+ } finally {
120
+ try {
121
+ if (!_n && _i["return"] != null) _i["return"]();
122
+ } finally {
123
+ if (_d) throw _e;
113
124
  }
114
- if (typeof args[0] === 'string') args[0] = `react-i18next:: ${args[0]}`;
115
- console.warn(...args);
116
125
  }
126
+
127
+ return _arr;
117
128
  }
118
- const alreadyWarned = {};
119
- function warnOnce() {
120
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
121
- args[_key2] = arguments[_key2];
122
- }
123
- if (typeof args[0] === 'string' && alreadyWarned[args[0]]) return;
124
- if (typeof args[0] === 'string') alreadyWarned[args[0]] = new Date();
125
- warn(...args);
129
+
130
+ function _unsupportedIterableToArray$1(o, minLen) {
131
+ if (!o) return;
132
+ if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
133
+ var n = Object.prototype.toString.call(o).slice(8, -1);
134
+ if (n === "Object" && o.constructor) n = o.constructor.name;
135
+ if (n === "Map" || n === "Set") return Array.from(o);
136
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
126
137
  }
127
- const loadedClb = (i18n, cb) => () => {
128
- if (i18n.isInitialized) {
129
- cb();
130
- } else {
131
- const initialized = () => {
132
- setTimeout(() => {
133
- i18n.off('initialized', initialized);
134
- }, 0);
135
- cb();
136
- };
137
- i18n.on('initialized', initialized);
138
- }
139
- };
140
- function loadNamespaces(i18n, ns, cb) {
141
- i18n.loadNamespaces(ns, loadedClb(i18n, cb));
138
+
139
+ function _arrayLikeToArray$1(arr, len) {
140
+ if (len == null || len > arr.length) len = arr.length;
141
+
142
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
143
+
144
+ return arr2;
142
145
  }
143
- function loadLanguages(i18n, lng, ns, cb) {
144
- if (typeof ns === 'string') ns = [ns];
145
- ns.forEach(n => {
146
- if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);
147
- });
148
- i18n.loadLanguages(lng, loadedClb(i18n, cb));
146
+
147
+ function _nonIterableSpread$1() {
148
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
149
149
  }
150
- function oldI18nextHasLoadedNamespace(ns, i18n) {
151
- let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
152
- const lng = i18n.languages[0];
153
- const fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
154
- const lastLng = i18n.languages[i18n.languages.length - 1];
155
- if (lng.toLowerCase() === 'cimode') return true;
156
- const loadNotPending = (l, n) => {
157
- const loadState = i18n.services.backendConnector.state[`${l}|${n}`];
158
- return loadState === -1 || loadState === 2;
159
- };
160
- if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns)) return false;
161
- if (i18n.hasResourceBundle(lng, ns)) return true;
162
- if (!i18n.services.backendConnector.backend || i18n.options.resources && !i18n.options.partialBundledLanguages) return true;
163
- if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
164
- return false;
165
- }
166
- function hasLoadedNamespace(ns, i18n) {
167
- let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
168
- if (!i18n.languages || !i18n.languages.length) {
169
- warnOnce('i18n.languages were undefined or empty', i18n.languages);
170
- return true;
171
- }
172
- const isNewerI18next = i18n.options.ignoreJSONStructure !== undefined;
173
- if (!isNewerI18next) {
174
- return oldI18nextHasLoadedNamespace(ns, i18n, options);
175
- }
176
- return i18n.hasLoadedNamespace(ns, {
177
- lng: options.lng,
178
- precheck: (i18nInstance, loadNotPending) => {
179
- if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;
180
- }
181
- });
182
- }
183
-
184
- const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
185
- const htmlEntities = {
186
- '&amp;': '&',
187
- '&#38;': '&',
188
- '&lt;': '<',
189
- '&#60;': '<',
190
- '&gt;': '>',
191
- '&#62;': '>',
192
- '&apos;': "'",
193
- '&#39;': "'",
194
- '&quot;': '"',
195
- '&#34;': '"',
196
- '&nbsp;': ' ',
197
- '&#160;': ' ',
198
- '&copy;': '©',
199
- '&#169;': '©',
200
- '&reg;': '®',
201
- '&#174;': '®',
202
- '&hellip;': '…',
203
- '&#8230;': '…',
204
- '&#x2F;': '/',
205
- '&#47;': '/'
206
- };
207
- const unescapeHtmlEntity = m => htmlEntities[m];
208
- const unescape = text => text.replace(matchHtmlEntity, unescapeHtmlEntity);
209
-
210
- let defaultOptions$1 = {
211
- bindI18n: 'languageChanged',
212
- bindI18nStore: '',
213
- transEmptyNodeValue: '',
214
- transSupportBasicHtmlNodes: true,
215
- transWrapTextNodes: '',
216
- transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],
217
- useSuspense: true,
218
- unescape
219
- };
220
- function setDefaults() {
221
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
222
- defaultOptions$1 = {
223
- ...defaultOptions$1,
224
- ...options
225
- };
226
- }
227
- function getDefaults() {
228
- return defaultOptions$1;
229
- }
230
-
231
- let i18nInstance;
232
- function setI18n(instance) {
233
- i18nInstance = instance;
234
- }
235
- function getI18n() {
236
- return i18nInstance;
237
- }
238
-
239
- const initReactI18next = {
240
- type: '3rdParty',
241
- init(instance) {
242
- setDefaults(instance.options.react);
243
- setI18n(instance);
244
- }
245
- };
246
-
247
- const I18nContext = createContext();
248
- class ReportNamespaces {
249
- constructor() {
250
- this.usedNamespaces = {};
251
- }
252
- addUsedNamespaces(namespaces) {
253
- namespaces.forEach(ns => {
254
- if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;
255
- });
256
- }
257
- getUsedNamespaces() {
258
- return Object.keys(this.usedNamespaces);
259
- }
260
- }
261
-
262
- const usePrevious = (value, ignore) => {
263
- const ref = useRef();
264
- useEffect(() => {
265
- ref.current = ignore ? ref.current : value;
266
- }, [value, ignore]);
267
- return ref.current;
268
- };
269
- function useTranslation(ns) {
270
- let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
271
- const {
272
- i18n: i18nFromProps
273
- } = props;
274
- const {
275
- i18n: i18nFromContext,
276
- defaultNS: defaultNSFromContext
277
- } = useContext(I18nContext) || {};
278
- const i18n = i18nFromProps || i18nFromContext || getI18n();
279
- if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
280
- if (!i18n) {
281
- warnOnce('You will need to pass in an i18next instance by using initReactI18next');
282
- const notReadyT = (k, optsOrDefaultValue) => {
283
- if (typeof optsOrDefaultValue === 'string') return optsOrDefaultValue;
284
- if (optsOrDefaultValue && typeof optsOrDefaultValue === 'object' && typeof optsOrDefaultValue.defaultValue === 'string') return optsOrDefaultValue.defaultValue;
285
- return Array.isArray(k) ? k[k.length - 1] : k;
286
- };
287
- const retNotReady = [notReadyT, {}, false];
288
- retNotReady.t = notReadyT;
289
- retNotReady.i18n = {};
290
- retNotReady.ready = false;
291
- return retNotReady;
292
- }
293
- if (i18n.options.react && i18n.options.react.wait !== undefined) warnOnce('It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.');
294
- const i18nOptions = {
295
- ...getDefaults(),
296
- ...i18n.options.react,
297
- ...props
298
- };
299
- const {
300
- useSuspense,
301
- keyPrefix
302
- } = i18nOptions;
303
- let namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
304
- namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
305
- if (i18n.reportNamespaces.addUsedNamespaces) i18n.reportNamespaces.addUsedNamespaces(namespaces);
306
- const ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every(n => hasLoadedNamespace(n, i18n, i18nOptions));
307
- function getT() {
308
- return i18n.getFixedT(props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);
309
- }
310
- const [t, setT] = useState(getT);
311
- let joinedNS = namespaces.join();
312
- if (props.lng) joinedNS = `${props.lng}${joinedNS}`;
313
- const previousJoinedNS = usePrevious(joinedNS);
314
- const isMounted = useRef(true);
315
- useEffect(() => {
316
- const {
317
- bindI18n,
318
- bindI18nStore
319
- } = i18nOptions;
320
- isMounted.current = true;
321
- if (!ready && !useSuspense) {
322
- if (props.lng) {
323
- loadLanguages(i18n, props.lng, namespaces, () => {
324
- if (isMounted.current) setT(getT);
325
- });
326
- } else {
327
- loadNamespaces(i18n, namespaces, () => {
328
- if (isMounted.current) setT(getT);
329
- });
330
- }
331
- }
332
- if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {
333
- setT(getT);
334
- }
335
- function boundReset() {
336
- if (isMounted.current) setT(getT);
337
- }
338
- if (bindI18n && i18n) i18n.on(bindI18n, boundReset);
339
- if (bindI18nStore && i18n) i18n.store.on(bindI18nStore, boundReset);
340
- return () => {
341
- isMounted.current = false;
342
- if (bindI18n && i18n) bindI18n.split(' ').forEach(e => i18n.off(e, boundReset));
343
- if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(e => i18n.store.off(e, boundReset));
344
- };
345
- }, [i18n, joinedNS]);
346
- const isInitial = useRef(true);
347
- useEffect(() => {
348
- if (isMounted.current && !isInitial.current) {
349
- setT(getT);
350
- }
351
- isInitial.current = false;
352
- }, [i18n, keyPrefix]);
353
- const ret = [t, i18n, ready];
354
- ret.t = t;
355
- ret.i18n = i18n;
356
- ret.ready = ready;
357
- if (ready) return ret;
358
- if (!ready && !useSuspense) return ret;
359
- throw new Promise(resolve => {
360
- if (props.lng) {
361
- loadLanguages(i18n, props.lng, namespaces, () => resolve());
362
- } else {
363
- loadNamespaces(i18n, namespaces, () => resolve());
364
- }
365
- });
366
- }
367
-
368
- var css_248z$8 = ".will-filter-bar-divider {\n width: 1px;\n margin: 0 10px;\n height: 35px;\n background-color: #384265;\n}";
369
- styleInject(css_248z$8);
370
-
371
- function Divider() {
372
- return React__default__default.createElement("div", { className: "will-filter-bar-divider" });
373
- }
374
-
375
- var css_248z$7 = ".will-filter-bar-select-button {\n width: 100%;\n height: auto;\n background-color: transparent;\n border: none;\n padding: 10px 20px;\n border-radius: 20px;\n cursor: pointer;\n font-size: 15px;\n text-align: initial;\n}\n";
376
- styleInject(css_248z$7);
377
-
378
- function SelectButton(_a) {
379
- var label = _a.label, onClick = _a.onClick, style = _a.style;
380
- return (React__default__default.createElement("button", { className: "will-filter-bar-select-button", onClick: onClick, style: style }, label));
381
- }
382
-
383
- function ownKeys$1(object, enumerableOnly) {
384
- var keys = Object.keys(object);
385
-
386
- if (Object.getOwnPropertySymbols) {
387
- var symbols = Object.getOwnPropertySymbols(object);
388
- enumerableOnly && (symbols = symbols.filter(function (sym) {
389
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
390
- })), keys.push.apply(keys, symbols);
391
- }
392
-
393
- return keys;
394
- }
395
-
396
- function _objectSpread2$1(target) {
397
- for (var i = 1; i < arguments.length; i++) {
398
- var source = null != arguments[i] ? arguments[i] : {};
399
- i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) {
400
- _defineProperty$1(target, key, source[key]);
401
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) {
402
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
403
- });
404
- }
405
-
406
- return target;
407
- }
408
-
409
- function _typeof$2(obj) {
410
- "@babel/helpers - typeof";
411
-
412
- return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
413
- return typeof obj;
414
- } : function (obj) {
415
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
416
- }, _typeof$2(obj);
417
- }
418
-
419
- function _classCallCheck(instance, Constructor) {
420
- if (!(instance instanceof Constructor)) {
421
- throw new TypeError("Cannot call a class as a function");
422
- }
423
- }
424
-
425
- function _defineProperties(target, props) {
426
- for (var i = 0; i < props.length; i++) {
427
- var descriptor = props[i];
428
- descriptor.enumerable = descriptor.enumerable || false;
429
- descriptor.configurable = true;
430
- if ("value" in descriptor) descriptor.writable = true;
431
- Object.defineProperty(target, descriptor.key, descriptor);
432
- }
433
- }
434
-
435
- function _createClass(Constructor, protoProps, staticProps) {
436
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
437
- if (staticProps) _defineProperties(Constructor, staticProps);
438
- Object.defineProperty(Constructor, "prototype", {
439
- writable: false
440
- });
441
- return Constructor;
442
- }
443
-
444
- function _defineProperty$1(obj, key, value) {
445
- if (key in obj) {
446
- Object.defineProperty(obj, key, {
447
- value: value,
448
- enumerable: true,
449
- configurable: true,
450
- writable: true
451
- });
452
- } else {
453
- obj[key] = value;
454
- }
455
-
456
- return obj;
457
- }
458
-
459
- function _slicedToArray(arr, i) {
460
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest();
461
- }
462
-
463
- function _toConsumableArray$1(arr) {
464
- return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread$1();
465
- }
466
-
467
- function _arrayWithoutHoles$1(arr) {
468
- if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);
469
- }
470
-
471
- function _arrayWithHoles(arr) {
472
- if (Array.isArray(arr)) return arr;
473
- }
474
-
475
- function _iterableToArray$1(iter) {
476
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
477
- }
478
-
479
- function _iterableToArrayLimit(arr, i) {
480
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
481
-
482
- if (_i == null) return;
483
- var _arr = [];
484
- var _n = true;
485
- var _d = false;
486
-
487
- var _s, _e;
488
-
489
- try {
490
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
491
- _arr.push(_s.value);
492
-
493
- if (i && _arr.length === i) break;
494
- }
495
- } catch (err) {
496
- _d = true;
497
- _e = err;
498
- } finally {
499
- try {
500
- if (!_n && _i["return"] != null) _i["return"]();
501
- } finally {
502
- if (_d) throw _e;
503
- }
504
- }
505
-
506
- return _arr;
507
- }
508
-
509
- function _unsupportedIterableToArray$1(o, minLen) {
510
- if (!o) return;
511
- if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
512
- var n = Object.prototype.toString.call(o).slice(8, -1);
513
- if (n === "Object" && o.constructor) n = o.constructor.name;
514
- if (n === "Map" || n === "Set") return Array.from(o);
515
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
516
- }
517
-
518
- function _arrayLikeToArray$1(arr, len) {
519
- if (len == null || len > arr.length) len = arr.length;
520
-
521
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
522
-
523
- return arr2;
524
- }
525
-
526
- function _nonIterableSpread$1() {
527
- throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
528
- }
529
-
530
- function _nonIterableRest() {
531
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
150
+
151
+ function _nonIterableRest() {
152
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
532
153
  }
533
154
 
534
155
  var noop$1 = function noop() {};
@@ -2734,637 +2355,1023 @@ var LayersCounter = {
2734
2355
  }
2735
2356
  };
2736
2357
 
2737
- var LayersText = {
2358
+ var LayersText = {
2359
+ mixout: function mixout() {
2360
+ return {
2361
+ text: function text(content) {
2362
+ var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2363
+ var _params$transform = params.transform,
2364
+ transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,
2365
+ _params$title = params.title,
2366
+ title = _params$title === void 0 ? null : _params$title,
2367
+ _params$classes = params.classes,
2368
+ classes = _params$classes === void 0 ? [] : _params$classes,
2369
+ _params$attributes = params.attributes,
2370
+ attributes = _params$attributes === void 0 ? {} : _params$attributes,
2371
+ _params$styles = params.styles,
2372
+ styles = _params$styles === void 0 ? {} : _params$styles;
2373
+ return domVariants({
2374
+ type: 'text',
2375
+ content: content
2376
+ }, function () {
2377
+ callHooks('beforeDOMElementCreation', {
2378
+ content: content,
2379
+ params: params
2380
+ });
2381
+ return makeLayersTextAbstract({
2382
+ content: content,
2383
+ transform: _objectSpread2$1(_objectSpread2$1({}, meaninglessTransform), transform),
2384
+ title: title,
2385
+ extra: {
2386
+ attributes: attributes,
2387
+ styles: styles,
2388
+ classes: ["".concat(config.cssPrefix, "-layers-text")].concat(_toConsumableArray$1(classes))
2389
+ }
2390
+ });
2391
+ });
2392
+ }
2393
+ };
2394
+ },
2395
+ provides: function provides(providers$$1) {
2396
+ providers$$1.generateLayersText = function (node, nodeMeta) {
2397
+ var title = nodeMeta.title,
2398
+ transform = nodeMeta.transform,
2399
+ extra = nodeMeta.extra;
2400
+ var width = null;
2401
+ var height = null;
2402
+
2403
+ if (IS_IE) {
2404
+ var computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);
2405
+ var boundingClientRect = node.getBoundingClientRect();
2406
+ width = boundingClientRect.width / computedFontSize;
2407
+ height = boundingClientRect.height / computedFontSize;
2408
+ }
2409
+
2410
+ if (config.autoA11y && !title) {
2411
+ extra.attributes['aria-hidden'] = 'true';
2412
+ }
2413
+
2414
+ return Promise.resolve([node, makeLayersTextAbstract({
2415
+ content: node.innerHTML,
2416
+ width: width,
2417
+ height: height,
2418
+ transform: transform,
2419
+ title: title,
2420
+ extra: extra,
2421
+ watchable: true
2422
+ })]);
2423
+ };
2424
+ }
2425
+ };
2426
+
2427
+ var CLEAN_CONTENT_PATTERN = new RegExp("\"", 'ug');
2428
+ var SECONDARY_UNICODE_RANGE = [1105920, 1112319];
2429
+ function hexValueFromContent(content) {
2430
+ var cleaned = content.replace(CLEAN_CONTENT_PATTERN, '');
2431
+ var codePoint = codePointAt(cleaned, 0);
2432
+ var isPrependTen = codePoint >= SECONDARY_UNICODE_RANGE[0] && codePoint <= SECONDARY_UNICODE_RANGE[1];
2433
+ var isDoubled = cleaned.length === 2 ? cleaned[0] === cleaned[1] : false;
2434
+ return {
2435
+ value: isDoubled ? toHex(cleaned[0]) : toHex(cleaned),
2436
+ isSecondary: isPrependTen || isDoubled
2437
+ };
2438
+ }
2439
+
2440
+ function replaceForPosition(node, position) {
2441
+ var pendingAttribute = "".concat(DATA_FA_PSEUDO_ELEMENT_PENDING).concat(position.replace(':', '-'));
2442
+ return new Promise(function (resolve, reject) {
2443
+ if (node.getAttribute(pendingAttribute) !== null) {
2444
+ // This node is already being processed
2445
+ return resolve();
2446
+ }
2447
+
2448
+ var children = toArray(node.children);
2449
+ var alreadyProcessedPseudoElement = children.filter(function (c) {
2450
+ return c.getAttribute(DATA_FA_PSEUDO_ELEMENT) === position;
2451
+ })[0];
2452
+ var styles = WINDOW.getComputedStyle(node, position);
2453
+ var fontFamily = styles.getPropertyValue('font-family').match(FONT_FAMILY_PATTERN);
2454
+ var fontWeight = styles.getPropertyValue('font-weight');
2455
+ var content = styles.getPropertyValue('content');
2456
+
2457
+ if (alreadyProcessedPseudoElement && !fontFamily) {
2458
+ // If we've already processed it but the current computed style does not result in a font-family,
2459
+ // that probably means that a class name that was previously present to make the icon has been
2460
+ // removed. So we now should delete the icon.
2461
+ node.removeChild(alreadyProcessedPseudoElement);
2462
+ return resolve();
2463
+ } else if (fontFamily && content !== 'none' && content !== '') {
2464
+ var _content = styles.getPropertyValue('content');
2465
+
2466
+ var family = ~['Sharp'].indexOf(fontFamily[2]) ? FAMILY_SHARP : FAMILY_CLASSIC;
2467
+ var prefix = ~['Solid', 'Regular', 'Light', 'Thin', 'Duotone', 'Brands', 'Kit'].indexOf(fontFamily[2]) ? STYLE_TO_PREFIX[family][fontFamily[2].toLowerCase()] : FONT_WEIGHT_TO_PREFIX[family][fontWeight];
2468
+
2469
+ var _hexValueFromContent = hexValueFromContent(_content),
2470
+ hexValue = _hexValueFromContent.value,
2471
+ isSecondary = _hexValueFromContent.isSecondary;
2472
+
2473
+ var isV4 = fontFamily[0].startsWith('FontAwesome');
2474
+ var iconName = byUnicode(prefix, hexValue);
2475
+ var iconIdentifier = iconName;
2476
+
2477
+ if (isV4) {
2478
+ var iconName4 = byOldUnicode(hexValue);
2479
+
2480
+ if (iconName4.iconName && iconName4.prefix) {
2481
+ iconName = iconName4.iconName;
2482
+ prefix = iconName4.prefix;
2483
+ }
2484
+ } // Only convert the pseudo element in this ::before/::after position into an icon if we haven't
2485
+ // already done so with the same prefix and iconName
2486
+
2487
+
2488
+ if (iconName && !isSecondary && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {
2489
+ node.setAttribute(pendingAttribute, iconIdentifier);
2490
+
2491
+ if (alreadyProcessedPseudoElement) {
2492
+ // Delete the old one, since we're replacing it with a new one
2493
+ node.removeChild(alreadyProcessedPseudoElement);
2494
+ }
2495
+
2496
+ var meta = blankMeta();
2497
+ var extra = meta.extra;
2498
+ extra.attributes[DATA_FA_PSEUDO_ELEMENT] = position;
2499
+ findIcon(iconName, prefix).then(function (main) {
2500
+ var _abstract = makeInlineSvgAbstract(_objectSpread2$1(_objectSpread2$1({}, meta), {}, {
2501
+ icons: {
2502
+ main: main,
2503
+ mask: emptyCanonicalIcon()
2504
+ },
2505
+ prefix: prefix,
2506
+ iconName: iconIdentifier,
2507
+ extra: extra,
2508
+ watchable: true
2509
+ }));
2510
+
2511
+ var element = DOCUMENT.createElementNS('http://www.w3.org/2000/svg', 'svg');
2512
+
2513
+ if (position === '::before') {
2514
+ node.insertBefore(element, node.firstChild);
2515
+ } else {
2516
+ node.appendChild(element);
2517
+ }
2518
+
2519
+ element.outerHTML = _abstract.map(function (a) {
2520
+ return toHtml(a);
2521
+ }).join('\n');
2522
+ node.removeAttribute(pendingAttribute);
2523
+ resolve();
2524
+ }).catch(reject);
2525
+ } else {
2526
+ resolve();
2527
+ }
2528
+ } else {
2529
+ resolve();
2530
+ }
2531
+ });
2532
+ }
2533
+
2534
+ function replace(node) {
2535
+ return Promise.all([replaceForPosition(node, '::before'), replaceForPosition(node, '::after')]);
2536
+ }
2537
+
2538
+ function processable(node) {
2539
+ return node.parentNode !== document.head && !~TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS.indexOf(node.tagName.toUpperCase()) && !node.getAttribute(DATA_FA_PSEUDO_ELEMENT) && (!node.parentNode || node.parentNode.tagName !== 'svg');
2540
+ }
2541
+
2542
+ function searchPseudoElements(root) {
2543
+ if (!IS_DOM) return;
2544
+ return new Promise(function (resolve, reject) {
2545
+ var operations = toArray(root.querySelectorAll('*')).filter(processable).map(replace);
2546
+ var end = perf.begin('searchPseudoElements');
2547
+ disableObservation();
2548
+ Promise.all(operations).then(function () {
2549
+ end();
2550
+ enableObservation();
2551
+ resolve();
2552
+ }).catch(function () {
2553
+ end();
2554
+ enableObservation();
2555
+ reject();
2556
+ });
2557
+ });
2558
+ }
2559
+
2560
+ var PseudoElements = {
2561
+ hooks: function hooks() {
2562
+ return {
2563
+ mutationObserverCallbacks: function mutationObserverCallbacks(accumulator) {
2564
+ accumulator.pseudoElementsCallback = searchPseudoElements;
2565
+ return accumulator;
2566
+ }
2567
+ };
2568
+ },
2569
+ provides: function provides(providers$$1) {
2570
+ providers$$1.pseudoElements2svg = function (params) {
2571
+ var _params$node = params.node,
2572
+ node = _params$node === void 0 ? DOCUMENT : _params$node;
2573
+
2574
+ if (config.searchPseudoElements) {
2575
+ searchPseudoElements(node);
2576
+ }
2577
+ };
2578
+ }
2579
+ };
2580
+
2581
+ var _unwatched = false;
2582
+ var MutationObserver$1 = {
2738
2583
  mixout: function mixout() {
2739
2584
  return {
2740
- text: function text(content) {
2741
- var params = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2742
- var _params$transform = params.transform,
2743
- transform = _params$transform === void 0 ? meaninglessTransform : _params$transform,
2744
- _params$title = params.title,
2745
- title = _params$title === void 0 ? null : _params$title,
2746
- _params$classes = params.classes,
2747
- classes = _params$classes === void 0 ? [] : _params$classes,
2748
- _params$attributes = params.attributes,
2749
- attributes = _params$attributes === void 0 ? {} : _params$attributes,
2750
- _params$styles = params.styles,
2751
- styles = _params$styles === void 0 ? {} : _params$styles;
2752
- return domVariants({
2753
- type: 'text',
2754
- content: content
2755
- }, function () {
2756
- callHooks('beforeDOMElementCreation', {
2757
- content: content,
2758
- params: params
2759
- });
2760
- return makeLayersTextAbstract({
2761
- content: content,
2762
- transform: _objectSpread2$1(_objectSpread2$1({}, meaninglessTransform), transform),
2763
- title: title,
2764
- extra: {
2765
- attributes: attributes,
2766
- styles: styles,
2767
- classes: ["".concat(config.cssPrefix, "-layers-text")].concat(_toConsumableArray$1(classes))
2768
- }
2769
- });
2770
- });
2585
+ dom: {
2586
+ unwatch: function unwatch() {
2587
+ disableObservation();
2588
+ _unwatched = true;
2589
+ }
2771
2590
  }
2772
2591
  };
2773
2592
  },
2774
- provides: function provides(providers$$1) {
2775
- providers$$1.generateLayersText = function (node, nodeMeta) {
2776
- var title = nodeMeta.title,
2777
- transform = nodeMeta.transform,
2778
- extra = nodeMeta.extra;
2779
- var width = null;
2780
- var height = null;
2781
-
2782
- if (IS_IE) {
2783
- var computedFontSize = parseInt(getComputedStyle(node).fontSize, 10);
2784
- var boundingClientRect = node.getBoundingClientRect();
2785
- width = boundingClientRect.width / computedFontSize;
2786
- height = boundingClientRect.height / computedFontSize;
2787
- }
2593
+ hooks: function hooks() {
2594
+ return {
2595
+ bootstrap: function bootstrap() {
2596
+ observe(chainHooks('mutationObserverCallbacks', {}));
2597
+ },
2598
+ noAuto: function noAuto() {
2599
+ disconnect();
2600
+ },
2601
+ watch: function watch(params) {
2602
+ var observeMutationsRoot = params.observeMutationsRoot;
2788
2603
 
2789
- if (config.autoA11y && !title) {
2790
- extra.attributes['aria-hidden'] = 'true';
2604
+ if (_unwatched) {
2605
+ enableObservation();
2606
+ } else {
2607
+ observe(chainHooks('mutationObserverCallbacks', {
2608
+ observeMutationsRoot: observeMutationsRoot
2609
+ }));
2610
+ }
2791
2611
  }
2792
-
2793
- return Promise.resolve([node, makeLayersTextAbstract({
2794
- content: node.innerHTML,
2795
- width: width,
2796
- height: height,
2797
- transform: transform,
2798
- title: title,
2799
- extra: extra,
2800
- watchable: true
2801
- })]);
2802
2612
  };
2803
2613
  }
2804
2614
  };
2805
2615
 
2806
- var CLEAN_CONTENT_PATTERN = new RegExp("\"", 'ug');
2807
- var SECONDARY_UNICODE_RANGE = [1105920, 1112319];
2808
- function hexValueFromContent(content) {
2809
- var cleaned = content.replace(CLEAN_CONTENT_PATTERN, '');
2810
- var codePoint = codePointAt(cleaned, 0);
2811
- var isPrependTen = codePoint >= SECONDARY_UNICODE_RANGE[0] && codePoint <= SECONDARY_UNICODE_RANGE[1];
2812
- var isDoubled = cleaned.length === 2 ? cleaned[0] === cleaned[1] : false;
2813
- return {
2814
- value: isDoubled ? toHex(cleaned[0]) : toHex(cleaned),
2815
- isSecondary: isPrependTen || isDoubled
2616
+ var parseTransformString = function parseTransformString(transformString) {
2617
+ var transform = {
2618
+ size: 16,
2619
+ x: 0,
2620
+ y: 0,
2621
+ flipX: false,
2622
+ flipY: false,
2623
+ rotate: 0
2816
2624
  };
2817
- }
2625
+ return transformString.toLowerCase().split(' ').reduce(function (acc, n) {
2626
+ var parts = n.toLowerCase().split('-');
2627
+ var first = parts[0];
2628
+ var rest = parts.slice(1).join('-');
2818
2629
 
2819
- function replaceForPosition(node, position) {
2820
- var pendingAttribute = "".concat(DATA_FA_PSEUDO_ELEMENT_PENDING).concat(position.replace(':', '-'));
2821
- return new Promise(function (resolve, reject) {
2822
- if (node.getAttribute(pendingAttribute) !== null) {
2823
- // This node is already being processed
2824
- return resolve();
2630
+ if (first && rest === 'h') {
2631
+ acc.flipX = true;
2632
+ return acc;
2825
2633
  }
2826
2634
 
2827
- var children = toArray(node.children);
2828
- var alreadyProcessedPseudoElement = children.filter(function (c) {
2829
- return c.getAttribute(DATA_FA_PSEUDO_ELEMENT) === position;
2830
- })[0];
2831
- var styles = WINDOW.getComputedStyle(node, position);
2832
- var fontFamily = styles.getPropertyValue('font-family').match(FONT_FAMILY_PATTERN);
2833
- var fontWeight = styles.getPropertyValue('font-weight');
2834
- var content = styles.getPropertyValue('content');
2635
+ if (first && rest === 'v') {
2636
+ acc.flipY = true;
2637
+ return acc;
2638
+ }
2835
2639
 
2836
- if (alreadyProcessedPseudoElement && !fontFamily) {
2837
- // If we've already processed it but the current computed style does not result in a font-family,
2838
- // that probably means that a class name that was previously present to make the icon has been
2839
- // removed. So we now should delete the icon.
2840
- node.removeChild(alreadyProcessedPseudoElement);
2841
- return resolve();
2842
- } else if (fontFamily && content !== 'none' && content !== '') {
2843
- var _content = styles.getPropertyValue('content');
2640
+ rest = parseFloat(rest);
2844
2641
 
2845
- var family = ~['Sharp'].indexOf(fontFamily[2]) ? FAMILY_SHARP : FAMILY_CLASSIC;
2846
- var prefix = ~['Solid', 'Regular', 'Light', 'Thin', 'Duotone', 'Brands', 'Kit'].indexOf(fontFamily[2]) ? STYLE_TO_PREFIX[family][fontFamily[2].toLowerCase()] : FONT_WEIGHT_TO_PREFIX[family][fontWeight];
2642
+ if (isNaN(rest)) {
2643
+ return acc;
2644
+ }
2645
+
2646
+ switch (first) {
2647
+ case 'grow':
2648
+ acc.size = acc.size + rest;
2649
+ break;
2650
+
2651
+ case 'shrink':
2652
+ acc.size = acc.size - rest;
2653
+ break;
2654
+
2655
+ case 'left':
2656
+ acc.x = acc.x - rest;
2657
+ break;
2658
+
2659
+ case 'right':
2660
+ acc.x = acc.x + rest;
2661
+ break;
2662
+
2663
+ case 'up':
2664
+ acc.y = acc.y - rest;
2665
+ break;
2666
+
2667
+ case 'down':
2668
+ acc.y = acc.y + rest;
2669
+ break;
2670
+
2671
+ case 'rotate':
2672
+ acc.rotate = acc.rotate + rest;
2673
+ break;
2674
+ }
2675
+
2676
+ return acc;
2677
+ }, transform);
2678
+ };
2679
+ var PowerTransforms = {
2680
+ mixout: function mixout() {
2681
+ return {
2682
+ parse: {
2683
+ transform: function transform(transformString) {
2684
+ return parseTransformString(transformString);
2685
+ }
2686
+ }
2687
+ };
2688
+ },
2689
+ hooks: function hooks() {
2690
+ return {
2691
+ parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
2692
+ var transformString = node.getAttribute('data-fa-transform');
2693
+
2694
+ if (transformString) {
2695
+ accumulator.transform = parseTransformString(transformString);
2696
+ }
2697
+
2698
+ return accumulator;
2699
+ }
2700
+ };
2701
+ },
2702
+ provides: function provides(providers) {
2703
+ providers.generateAbstractTransformGrouping = function (_ref) {
2704
+ var main = _ref.main,
2705
+ transform = _ref.transform,
2706
+ containerWidth = _ref.containerWidth,
2707
+ iconWidth = _ref.iconWidth;
2708
+ var outer = {
2709
+ transform: "translate(".concat(containerWidth / 2, " 256)")
2710
+ };
2711
+ var innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
2712
+ var innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
2713
+ var innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
2714
+ var inner = {
2715
+ transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
2716
+ };
2717
+ var path = {
2718
+ transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
2719
+ };
2720
+ var operations = {
2721
+ outer: outer,
2722
+ inner: inner,
2723
+ path: path
2724
+ };
2725
+ return {
2726
+ tag: 'g',
2727
+ attributes: _objectSpread2$1({}, operations.outer),
2728
+ children: [{
2729
+ tag: 'g',
2730
+ attributes: _objectSpread2$1({}, operations.inner),
2731
+ children: [{
2732
+ tag: main.icon.tag,
2733
+ children: main.icon.children,
2734
+ attributes: _objectSpread2$1(_objectSpread2$1({}, main.icon.attributes), operations.path)
2735
+ }]
2736
+ }]
2737
+ };
2738
+ };
2739
+ }
2740
+ };
2847
2741
 
2848
- var _hexValueFromContent = hexValueFromContent(_content),
2849
- hexValue = _hexValueFromContent.value,
2850
- isSecondary = _hexValueFromContent.isSecondary;
2742
+ var ALL_SPACE = {
2743
+ x: 0,
2744
+ y: 0,
2745
+ width: '100%',
2746
+ height: '100%'
2747
+ };
2851
2748
 
2852
- var isV4 = fontFamily[0].startsWith('FontAwesome');
2853
- var iconName = byUnicode(prefix, hexValue);
2854
- var iconIdentifier = iconName;
2749
+ function fillBlack(_abstract) {
2750
+ var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
2855
2751
 
2856
- if (isV4) {
2857
- var iconName4 = byOldUnicode(hexValue);
2752
+ if (_abstract.attributes && (_abstract.attributes.fill || force)) {
2753
+ _abstract.attributes.fill = 'black';
2754
+ }
2858
2755
 
2859
- if (iconName4.iconName && iconName4.prefix) {
2860
- iconName = iconName4.iconName;
2861
- prefix = iconName4.prefix;
2862
- }
2863
- } // Only convert the pseudo element in this ::before/::after position into an icon if we haven't
2864
- // already done so with the same prefix and iconName
2756
+ return _abstract;
2757
+ }
2865
2758
 
2759
+ function deGroup(_abstract2) {
2760
+ if (_abstract2.tag === 'g') {
2761
+ return _abstract2.children;
2762
+ } else {
2763
+ return [_abstract2];
2764
+ }
2765
+ }
2866
2766
 
2867
- if (iconName && !isSecondary && (!alreadyProcessedPseudoElement || alreadyProcessedPseudoElement.getAttribute(DATA_PREFIX) !== prefix || alreadyProcessedPseudoElement.getAttribute(DATA_ICON) !== iconIdentifier)) {
2868
- node.setAttribute(pendingAttribute, iconIdentifier);
2767
+ var Masks = {
2768
+ hooks: function hooks() {
2769
+ return {
2770
+ parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
2771
+ var maskData = node.getAttribute('data-fa-mask');
2772
+ var mask = !maskData ? emptyCanonicalIcon() : getCanonicalIcon(maskData.split(' ').map(function (i) {
2773
+ return i.trim();
2774
+ }));
2869
2775
 
2870
- if (alreadyProcessedPseudoElement) {
2871
- // Delete the old one, since we're replacing it with a new one
2872
- node.removeChild(alreadyProcessedPseudoElement);
2776
+ if (!mask.prefix) {
2777
+ mask.prefix = getDefaultUsablePrefix();
2873
2778
  }
2874
2779
 
2875
- var meta = blankMeta();
2876
- var extra = meta.extra;
2877
- extra.attributes[DATA_FA_PSEUDO_ELEMENT] = position;
2878
- findIcon(iconName, prefix).then(function (main) {
2879
- var _abstract = makeInlineSvgAbstract(_objectSpread2$1(_objectSpread2$1({}, meta), {}, {
2880
- icons: {
2881
- main: main,
2882
- mask: emptyCanonicalIcon()
2883
- },
2884
- prefix: prefix,
2885
- iconName: iconIdentifier,
2886
- extra: extra,
2887
- watchable: true
2888
- }));
2889
-
2890
- var element = DOCUMENT.createElementNS('http://www.w3.org/2000/svg', 'svg');
2780
+ accumulator.mask = mask;
2781
+ accumulator.maskId = node.getAttribute('data-fa-mask-id');
2782
+ return accumulator;
2783
+ }
2784
+ };
2785
+ },
2786
+ provides: function provides(providers) {
2787
+ providers.generateAbstractMask = function (_ref) {
2788
+ var children = _ref.children,
2789
+ attributes = _ref.attributes,
2790
+ main = _ref.main,
2791
+ mask = _ref.mask,
2792
+ explicitMaskId = _ref.maskId,
2793
+ transform = _ref.transform;
2794
+ var mainWidth = main.width,
2795
+ mainPath = main.icon;
2796
+ var maskWidth = mask.width,
2797
+ maskPath = mask.icon;
2798
+ var trans = transformForSvg({
2799
+ transform: transform,
2800
+ containerWidth: maskWidth,
2801
+ iconWidth: mainWidth
2802
+ });
2803
+ var maskRect = {
2804
+ tag: 'rect',
2805
+ attributes: _objectSpread2$1(_objectSpread2$1({}, ALL_SPACE), {}, {
2806
+ fill: 'white'
2807
+ })
2808
+ };
2809
+ var maskInnerGroupChildrenMixin = mainPath.children ? {
2810
+ children: mainPath.children.map(fillBlack)
2811
+ } : {};
2812
+ var maskInnerGroup = {
2813
+ tag: 'g',
2814
+ attributes: _objectSpread2$1({}, trans.inner),
2815
+ children: [fillBlack(_objectSpread2$1({
2816
+ tag: mainPath.tag,
2817
+ attributes: _objectSpread2$1(_objectSpread2$1({}, mainPath.attributes), trans.path)
2818
+ }, maskInnerGroupChildrenMixin))]
2819
+ };
2820
+ var maskOuterGroup = {
2821
+ tag: 'g',
2822
+ attributes: _objectSpread2$1({}, trans.outer),
2823
+ children: [maskInnerGroup]
2824
+ };
2825
+ var maskId = "mask-".concat(explicitMaskId || nextUniqueId());
2826
+ var clipId = "clip-".concat(explicitMaskId || nextUniqueId());
2827
+ var maskTag = {
2828
+ tag: 'mask',
2829
+ attributes: _objectSpread2$1(_objectSpread2$1({}, ALL_SPACE), {}, {
2830
+ id: maskId,
2831
+ maskUnits: 'userSpaceOnUse',
2832
+ maskContentUnits: 'userSpaceOnUse'
2833
+ }),
2834
+ children: [maskRect, maskOuterGroup]
2835
+ };
2836
+ var defs = {
2837
+ tag: 'defs',
2838
+ children: [{
2839
+ tag: 'clipPath',
2840
+ attributes: {
2841
+ id: clipId
2842
+ },
2843
+ children: deGroup(maskPath)
2844
+ }, maskTag]
2845
+ };
2846
+ children.push(defs, {
2847
+ tag: 'rect',
2848
+ attributes: _objectSpread2$1({
2849
+ fill: 'currentColor',
2850
+ 'clip-path': "url(#".concat(clipId, ")"),
2851
+ mask: "url(#".concat(maskId, ")")
2852
+ }, ALL_SPACE)
2853
+ });
2854
+ return {
2855
+ children: children,
2856
+ attributes: attributes
2857
+ };
2858
+ };
2859
+ }
2860
+ };
2891
2861
 
2892
- if (position === '::before') {
2893
- node.insertBefore(element, node.firstChild);
2894
- } else {
2895
- node.appendChild(element);
2896
- }
2862
+ var MissingIconIndicator = {
2863
+ provides: function provides(providers) {
2864
+ var reduceMotion = false;
2897
2865
 
2898
- element.outerHTML = _abstract.map(function (a) {
2899
- return toHtml(a);
2900
- }).join('\n');
2901
- node.removeAttribute(pendingAttribute);
2902
- resolve();
2903
- }).catch(reject);
2904
- } else {
2905
- resolve();
2906
- }
2907
- } else {
2908
- resolve();
2866
+ if (WINDOW.matchMedia) {
2867
+ reduceMotion = WINDOW.matchMedia('(prefers-reduced-motion: reduce)').matches;
2909
2868
  }
2910
- });
2911
- }
2912
2869
 
2913
- function replace(node) {
2914
- return Promise.all([replaceForPosition(node, '::before'), replaceForPosition(node, '::after')]);
2915
- }
2870
+ providers.missingIconAbstract = function () {
2871
+ var gChildren = [];
2872
+ var FILL = {
2873
+ fill: 'currentColor'
2874
+ };
2875
+ var ANIMATION_BASE = {
2876
+ attributeType: 'XML',
2877
+ repeatCount: 'indefinite',
2878
+ dur: '2s'
2879
+ }; // Ring
2916
2880
 
2917
- function processable(node) {
2918
- return node.parentNode !== document.head && !~TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS.indexOf(node.tagName.toUpperCase()) && !node.getAttribute(DATA_FA_PSEUDO_ELEMENT) && (!node.parentNode || node.parentNode.tagName !== 'svg');
2919
- }
2881
+ gChildren.push({
2882
+ tag: 'path',
2883
+ attributes: _objectSpread2$1(_objectSpread2$1({}, FILL), {}, {
2884
+ d: 'M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z'
2885
+ })
2886
+ });
2920
2887
 
2921
- function searchPseudoElements(root) {
2922
- if (!IS_DOM) return;
2923
- return new Promise(function (resolve, reject) {
2924
- var operations = toArray(root.querySelectorAll('*')).filter(processable).map(replace);
2925
- var end = perf.begin('searchPseudoElements');
2926
- disableObservation();
2927
- Promise.all(operations).then(function () {
2928
- end();
2929
- enableObservation();
2930
- resolve();
2931
- }).catch(function () {
2932
- end();
2933
- enableObservation();
2934
- reject();
2935
- });
2936
- });
2937
- }
2888
+ var OPACITY_ANIMATE = _objectSpread2$1(_objectSpread2$1({}, ANIMATION_BASE), {}, {
2889
+ attributeName: 'opacity'
2890
+ });
2938
2891
 
2939
- var PseudoElements = {
2940
- hooks: function hooks() {
2941
- return {
2942
- mutationObserverCallbacks: function mutationObserverCallbacks(accumulator) {
2943
- accumulator.pseudoElementsCallback = searchPseudoElements;
2944
- return accumulator;
2892
+ var dot = {
2893
+ tag: 'circle',
2894
+ attributes: _objectSpread2$1(_objectSpread2$1({}, FILL), {}, {
2895
+ cx: '256',
2896
+ cy: '364',
2897
+ r: '28'
2898
+ }),
2899
+ children: []
2900
+ };
2901
+
2902
+ if (!reduceMotion) {
2903
+ dot.children.push({
2904
+ tag: 'animate',
2905
+ attributes: _objectSpread2$1(_objectSpread2$1({}, ANIMATION_BASE), {}, {
2906
+ attributeName: 'r',
2907
+ values: '28;14;28;28;14;28;'
2908
+ })
2909
+ }, {
2910
+ tag: 'animate',
2911
+ attributes: _objectSpread2$1(_objectSpread2$1({}, OPACITY_ANIMATE), {}, {
2912
+ values: '1;0;1;1;0;1;'
2913
+ })
2914
+ });
2945
2915
  }
2946
- };
2947
- },
2948
- provides: function provides(providers$$1) {
2949
- providers$$1.pseudoElements2svg = function (params) {
2950
- var _params$node = params.node,
2951
- node = _params$node === void 0 ? DOCUMENT : _params$node;
2952
2916
 
2953
- if (config.searchPseudoElements) {
2954
- searchPseudoElements(node);
2917
+ gChildren.push(dot);
2918
+ gChildren.push({
2919
+ tag: 'path',
2920
+ attributes: _objectSpread2$1(_objectSpread2$1({}, FILL), {}, {
2921
+ opacity: '1',
2922
+ d: 'M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z'
2923
+ }),
2924
+ children: reduceMotion ? [] : [{
2925
+ tag: 'animate',
2926
+ attributes: _objectSpread2$1(_objectSpread2$1({}, OPACITY_ANIMATE), {}, {
2927
+ values: '1;0;0;0;0;1;'
2928
+ })
2929
+ }]
2930
+ });
2931
+
2932
+ if (!reduceMotion) {
2933
+ // Exclamation
2934
+ gChildren.push({
2935
+ tag: 'path',
2936
+ attributes: _objectSpread2$1(_objectSpread2$1({}, FILL), {}, {
2937
+ opacity: '0',
2938
+ d: 'M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z'
2939
+ }),
2940
+ children: [{
2941
+ tag: 'animate',
2942
+ attributes: _objectSpread2$1(_objectSpread2$1({}, OPACITY_ANIMATE), {}, {
2943
+ values: '0;0;1;1;0;0;'
2944
+ })
2945
+ }]
2946
+ });
2955
2947
  }
2948
+
2949
+ return {
2950
+ tag: 'g',
2951
+ attributes: {
2952
+ 'class': 'missing'
2953
+ },
2954
+ children: gChildren
2955
+ };
2956
2956
  };
2957
2957
  }
2958
2958
  };
2959
2959
 
2960
- var _unwatched = false;
2961
- var MutationObserver$1 = {
2962
- mixout: function mixout() {
2963
- return {
2964
- dom: {
2965
- unwatch: function unwatch() {
2966
- disableObservation();
2967
- _unwatched = true;
2968
- }
2969
- }
2970
- };
2971
- },
2960
+ var SvgSymbols = {
2972
2961
  hooks: function hooks() {
2973
2962
  return {
2974
- bootstrap: function bootstrap() {
2975
- observe(chainHooks('mutationObserverCallbacks', {}));
2976
- },
2977
- noAuto: function noAuto() {
2978
- disconnect();
2979
- },
2980
- watch: function watch(params) {
2981
- var observeMutationsRoot = params.observeMutationsRoot;
2982
-
2983
- if (_unwatched) {
2984
- enableObservation();
2985
- } else {
2986
- observe(chainHooks('mutationObserverCallbacks', {
2987
- observeMutationsRoot: observeMutationsRoot
2988
- }));
2989
- }
2963
+ parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
2964
+ var symbolData = node.getAttribute('data-fa-symbol');
2965
+ var symbol = symbolData === null ? false : symbolData === '' ? true : symbolData;
2966
+ accumulator['symbol'] = symbol;
2967
+ return accumulator;
2990
2968
  }
2991
2969
  };
2992
2970
  }
2993
2971
  };
2994
2972
 
2995
- var parseTransformString = function parseTransformString(transformString) {
2996
- var transform = {
2997
- size: 16,
2998
- x: 0,
2999
- y: 0,
3000
- flipX: false,
3001
- flipY: false,
3002
- rotate: 0
3003
- };
3004
- return transformString.toLowerCase().split(' ').reduce(function (acc, n) {
3005
- var parts = n.toLowerCase().split('-');
3006
- var first = parts[0];
3007
- var rest = parts.slice(1).join('-');
2973
+ var plugins = [InjectCSS, ReplaceElements, Layers, LayersCounter, LayersText, PseudoElements, MutationObserver$1, PowerTransforms, Masks, MissingIconIndicator, SvgSymbols];
3008
2974
 
3009
- if (first && rest === 'h') {
3010
- acc.flipX = true;
3011
- return acc;
3012
- }
2975
+ registerPlugins(plugins, {
2976
+ mixoutsTo: api
2977
+ });
2978
+ api.noAuto;
2979
+ api.config;
2980
+ var library$1 = api.library;
2981
+ api.dom;
2982
+ var parse$1 = api.parse;
2983
+ api.findIconDefinition;
2984
+ api.toHtml;
2985
+ var icon = api.icon;
2986
+ api.layer;
2987
+ api.text;
2988
+ api.counter;
3013
2989
 
3014
- if (first && rest === 'v') {
3015
- acc.flipY = true;
3016
- return acc;
3017
- }
2990
+ var faMagnifyingGlass = {
2991
+ prefix: 'fas',
2992
+ iconName: 'magnifying-glass',
2993
+ icon: [512, 512, [128269, "search"], "f002", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"]
2994
+ };
2995
+ var faSearch = faMagnifyingGlass;
3018
2996
 
3019
- rest = parseFloat(rest);
2997
+ function getDefaultExportFromCjs (x) {
2998
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
2999
+ }
3020
3000
 
3021
- if (isNaN(rest)) {
3022
- return acc;
3023
- }
3001
+ var classnames = {exports: {}};
3024
3002
 
3025
- switch (first) {
3026
- case 'grow':
3027
- acc.size = acc.size + rest;
3028
- break;
3003
+ /*!
3004
+ Copyright (c) 2018 Jed Watson.
3005
+ Licensed under the MIT License (MIT), see
3006
+ http://jedwatson.github.io/classnames
3007
+ */
3029
3008
 
3030
- case 'shrink':
3031
- acc.size = acc.size - rest;
3032
- break;
3009
+ (function (module) {
3010
+ /* global define */
3033
3011
 
3034
- case 'left':
3035
- acc.x = acc.x - rest;
3036
- break;
3012
+ (function () {
3037
3013
 
3038
- case 'right':
3039
- acc.x = acc.x + rest;
3040
- break;
3014
+ var hasOwn = {}.hasOwnProperty;
3041
3015
 
3042
- case 'up':
3043
- acc.y = acc.y - rest;
3044
- break;
3016
+ function classNames() {
3017
+ var classes = [];
3045
3018
 
3046
- case 'down':
3047
- acc.y = acc.y + rest;
3048
- break;
3019
+ for (var i = 0; i < arguments.length; i++) {
3020
+ var arg = arguments[i];
3021
+ if (!arg) continue;
3049
3022
 
3050
- case 'rotate':
3051
- acc.rotate = acc.rotate + rest;
3052
- break;
3053
- }
3023
+ var argType = typeof arg;
3054
3024
 
3055
- return acc;
3056
- }, transform);
3057
- };
3058
- var PowerTransforms = {
3059
- mixout: function mixout() {
3060
- return {
3061
- parse: {
3062
- transform: function transform(transformString) {
3063
- return parseTransformString(transformString);
3064
- }
3065
- }
3066
- };
3067
- },
3068
- hooks: function hooks() {
3069
- return {
3070
- parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
3071
- var transformString = node.getAttribute('data-fa-transform');
3025
+ if (argType === 'string' || argType === 'number') {
3026
+ classes.push(arg);
3027
+ } else if (Array.isArray(arg)) {
3028
+ if (arg.length) {
3029
+ var inner = classNames.apply(null, arg);
3030
+ if (inner) {
3031
+ classes.push(inner);
3032
+ }
3033
+ }
3034
+ } else if (argType === 'object') {
3035
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
3036
+ classes.push(arg.toString());
3037
+ continue;
3038
+ }
3072
3039
 
3073
- if (transformString) {
3074
- accumulator.transform = parseTransformString(transformString);
3075
- }
3040
+ for (var key in arg) {
3041
+ if (hasOwn.call(arg, key) && arg[key]) {
3042
+ classes.push(key);
3043
+ }
3044
+ }
3045
+ }
3046
+ }
3076
3047
 
3077
- return accumulator;
3078
- }
3079
- };
3080
- },
3081
- provides: function provides(providers) {
3082
- providers.generateAbstractTransformGrouping = function (_ref) {
3083
- var main = _ref.main,
3084
- transform = _ref.transform,
3085
- containerWidth = _ref.containerWidth,
3086
- iconWidth = _ref.iconWidth;
3087
- var outer = {
3088
- transform: "translate(".concat(containerWidth / 2, " 256)")
3089
- };
3090
- var innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
3091
- var innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
3092
- var innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
3093
- var inner = {
3094
- transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
3095
- };
3096
- var path = {
3097
- transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
3098
- };
3099
- var operations = {
3100
- outer: outer,
3101
- inner: inner,
3102
- path: path
3103
- };
3104
- return {
3105
- tag: 'g',
3106
- attributes: _objectSpread2$1({}, operations.outer),
3107
- children: [{
3108
- tag: 'g',
3109
- attributes: _objectSpread2$1({}, operations.inner),
3110
- children: [{
3111
- tag: main.icon.tag,
3112
- children: main.icon.children,
3113
- attributes: _objectSpread2$1(_objectSpread2$1({}, main.icon.attributes), operations.path)
3114
- }]
3115
- }]
3116
- };
3117
- };
3118
- }
3119
- };
3048
+ return classes.join(' ');
3049
+ }
3050
+
3051
+ if (module.exports) {
3052
+ classNames.default = classNames;
3053
+ module.exports = classNames;
3054
+ } else {
3055
+ window.classNames = classNames;
3056
+ }
3057
+ }());
3058
+ } (classnames));
3059
+
3060
+ var classnamesExports = classnames.exports;
3061
+ var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
3062
+
3063
+ function styleInject(css, ref) {
3064
+ if ( ref === void 0 ) ref = {};
3065
+ var insertAt = ref.insertAt;
3120
3066
 
3121
- var ALL_SPACE = {
3122
- x: 0,
3123
- y: 0,
3124
- width: '100%',
3125
- height: '100%'
3126
- };
3067
+ if (!css || typeof document === 'undefined') { return; }
3127
3068
 
3128
- function fillBlack(_abstract) {
3129
- var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
3069
+ var head = document.head || document.getElementsByTagName('head')[0];
3070
+ var style = document.createElement('style');
3071
+ style.type = 'text/css';
3130
3072
 
3131
- if (_abstract.attributes && (_abstract.attributes.fill || force)) {
3132
- _abstract.attributes.fill = 'black';
3073
+ if (insertAt === 'top') {
3074
+ if (head.firstChild) {
3075
+ head.insertBefore(style, head.firstChild);
3076
+ } else {
3077
+ head.appendChild(style);
3078
+ }
3079
+ } else {
3080
+ head.appendChild(style);
3133
3081
  }
3134
3082
 
3135
- return _abstract;
3136
- }
3137
-
3138
- function deGroup(_abstract2) {
3139
- if (_abstract2.tag === 'g') {
3140
- return _abstract2.children;
3083
+ if (style.styleSheet) {
3084
+ style.styleSheet.cssText = css;
3141
3085
  } else {
3142
- return [_abstract2];
3086
+ style.appendChild(document.createTextNode(css));
3143
3087
  }
3144
3088
  }
3145
3089
 
3146
- var Masks = {
3147
- hooks: function hooks() {
3148
- return {
3149
- parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
3150
- var maskData = node.getAttribute('data-fa-mask');
3151
- var mask = !maskData ? emptyCanonicalIcon() : getCanonicalIcon(maskData.split(' ').map(function (i) {
3152
- return i.trim();
3153
- }));
3090
+ var css_248z$9 = ".storybook-button {\r\n font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\r\n font-weight: 700;\r\n border: 0;\r\n border-radius: 3em;\r\n cursor: pointer;\r\n display: inline-block;\r\n line-height: 1;\r\n}\r\n.storybook-button--primary {\r\n color: white;\r\n background-color: #1ea7fd;\r\n}\r\n.storybook-button--secondary {\r\n color: #333;\r\n background-color: transparent;\r\n box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;\r\n}\r\n.storybook-button--small {\r\n font-size: 12px;\r\n padding: 10px 16px;\r\n}\r\n.storybook-button--medium {\r\n font-size: 14px;\r\n padding: 11px 20px;\r\n}\r\n.storybook-button--large {\r\n font-size: 16px;\r\n padding: 12px 24px;\r\n}";
3091
+ styleInject(css_248z$9);
3154
3092
 
3155
- if (!mask.prefix) {
3156
- mask.prefix = getDefaultUsablePrefix();
3157
- }
3093
+ /**
3094
+ * Primary UI component for user interaction
3095
+ */
3096
+ var Button$1 = function (_a) {
3097
+ var _b = _a.type, type = _b === void 0 ? "primary" : _b, textColor = _a.textColor, _c = _a.size, size = _c === void 0 ? "medium" : _c, onClick = _a.onClick, label = _a.label;
3098
+ var _d = useState(4), theState = _d[0]; _d[1];
3099
+ return (React__default__default.createElement("button", { type: "button", className: classNames("storybook-button", "storybook-button--".concat(size), "storybook-button--".concat(type)), style: textColor ? { color: textColor } : {}, onClick: onClick }, "".concat(label, " ").concat(theState)));
3100
+ };
3158
3101
 
3159
- accumulator.mask = mask;
3160
- accumulator.maskId = node.getAttribute('data-fa-mask-id');
3161
- return accumulator;
3162
- }
3163
- };
3164
- },
3165
- provides: function provides(providers) {
3166
- providers.generateAbstractMask = function (_ref) {
3167
- var children = _ref.children,
3168
- attributes = _ref.attributes,
3169
- main = _ref.main,
3170
- mask = _ref.mask,
3171
- explicitMaskId = _ref.maskId,
3172
- transform = _ref.transform;
3173
- var mainWidth = main.width,
3174
- mainPath = main.icon;
3175
- var maskWidth = mask.width,
3176
- maskPath = mask.icon;
3177
- var trans = transformForSvg({
3178
- transform: transform,
3179
- containerWidth: maskWidth,
3180
- iconWidth: mainWidth
3181
- });
3182
- var maskRect = {
3183
- tag: 'rect',
3184
- attributes: _objectSpread2$1(_objectSpread2$1({}, ALL_SPACE), {}, {
3185
- fill: 'white'
3186
- })
3187
- };
3188
- var maskInnerGroupChildrenMixin = mainPath.children ? {
3189
- children: mainPath.children.map(fillBlack)
3190
- } : {};
3191
- var maskInnerGroup = {
3192
- tag: 'g',
3193
- attributes: _objectSpread2$1({}, trans.inner),
3194
- children: [fillBlack(_objectSpread2$1({
3195
- tag: mainPath.tag,
3196
- attributes: _objectSpread2$1(_objectSpread2$1({}, mainPath.attributes), trans.path)
3197
- }, maskInnerGroupChildrenMixin))]
3198
- };
3199
- var maskOuterGroup = {
3200
- tag: 'g',
3201
- attributes: _objectSpread2$1({}, trans.outer),
3202
- children: [maskInnerGroup]
3203
- };
3204
- var maskId = "mask-".concat(explicitMaskId || nextUniqueId());
3205
- var clipId = "clip-".concat(explicitMaskId || nextUniqueId());
3206
- var maskTag = {
3207
- tag: 'mask',
3208
- attributes: _objectSpread2$1(_objectSpread2$1({}, ALL_SPACE), {}, {
3209
- id: maskId,
3210
- maskUnits: 'userSpaceOnUse',
3211
- maskContentUnits: 'userSpaceOnUse'
3212
- }),
3213
- children: [maskRect, maskOuterGroup]
3214
- };
3215
- var defs = {
3216
- tag: 'defs',
3217
- children: [{
3218
- tag: 'clipPath',
3219
- attributes: {
3220
- id: clipId
3221
- },
3222
- children: deGroup(maskPath)
3223
- }, maskTag]
3224
- };
3225
- children.push(defs, {
3226
- tag: 'rect',
3227
- attributes: _objectSpread2$1({
3228
- fill: 'currentColor',
3229
- 'clip-path': "url(#".concat(clipId, ")"),
3230
- mask: "url(#".concat(maskId, ")")
3231
- }, ALL_SPACE)
3232
- });
3233
- return {
3234
- children: children,
3235
- attributes: attributes
3236
- };
3102
+ function warn() {
3103
+ if (console && console.warn) {
3104
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3105
+ args[_key] = arguments[_key];
3106
+ }
3107
+ if (typeof args[0] === 'string') args[0] = `react-i18next:: ${args[0]}`;
3108
+ console.warn(...args);
3109
+ }
3110
+ }
3111
+ const alreadyWarned = {};
3112
+ function warnOnce() {
3113
+ for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
3114
+ args[_key2] = arguments[_key2];
3115
+ }
3116
+ if (typeof args[0] === 'string' && alreadyWarned[args[0]]) return;
3117
+ if (typeof args[0] === 'string') alreadyWarned[args[0]] = new Date();
3118
+ warn(...args);
3119
+ }
3120
+ const loadedClb = (i18n, cb) => () => {
3121
+ if (i18n.isInitialized) {
3122
+ cb();
3123
+ } else {
3124
+ const initialized = () => {
3125
+ setTimeout(() => {
3126
+ i18n.off('initialized', initialized);
3127
+ }, 0);
3128
+ cb();
3237
3129
  };
3130
+ i18n.on('initialized', initialized);
3238
3131
  }
3239
3132
  };
3240
-
3241
- var MissingIconIndicator = {
3242
- provides: function provides(providers) {
3243
- var reduceMotion = false;
3244
-
3245
- if (WINDOW.matchMedia) {
3246
- reduceMotion = WINDOW.matchMedia('(prefers-reduced-motion: reduce)').matches;
3133
+ function loadNamespaces(i18n, ns, cb) {
3134
+ i18n.loadNamespaces(ns, loadedClb(i18n, cb));
3135
+ }
3136
+ function loadLanguages(i18n, lng, ns, cb) {
3137
+ if (typeof ns === 'string') ns = [ns];
3138
+ ns.forEach(n => {
3139
+ if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);
3140
+ });
3141
+ i18n.loadLanguages(lng, loadedClb(i18n, cb));
3142
+ }
3143
+ function oldI18nextHasLoadedNamespace(ns, i18n) {
3144
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3145
+ const lng = i18n.languages[0];
3146
+ const fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
3147
+ const lastLng = i18n.languages[i18n.languages.length - 1];
3148
+ if (lng.toLowerCase() === 'cimode') return true;
3149
+ const loadNotPending = (l, n) => {
3150
+ const loadState = i18n.services.backendConnector.state[`${l}|${n}`];
3151
+ return loadState === -1 || loadState === 2;
3152
+ };
3153
+ if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns)) return false;
3154
+ if (i18n.hasResourceBundle(lng, ns)) return true;
3155
+ if (!i18n.services.backendConnector.backend || i18n.options.resources && !i18n.options.partialBundledLanguages) return true;
3156
+ if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
3157
+ return false;
3158
+ }
3159
+ function hasLoadedNamespace(ns, i18n) {
3160
+ let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3161
+ if (!i18n.languages || !i18n.languages.length) {
3162
+ warnOnce('i18n.languages were undefined or empty', i18n.languages);
3163
+ return true;
3164
+ }
3165
+ const isNewerI18next = i18n.options.ignoreJSONStructure !== undefined;
3166
+ if (!isNewerI18next) {
3167
+ return oldI18nextHasLoadedNamespace(ns, i18n, options);
3168
+ }
3169
+ return i18n.hasLoadedNamespace(ns, {
3170
+ lng: options.lng,
3171
+ precheck: (i18nInstance, loadNotPending) => {
3172
+ if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18nInstance.services.backendConnector.backend && i18nInstance.isLanguageChangingTo && !loadNotPending(i18nInstance.isLanguageChangingTo, ns)) return false;
3247
3173
  }
3174
+ });
3175
+ }
3248
3176
 
3249
- providers.missingIconAbstract = function () {
3250
- var gChildren = [];
3251
- var FILL = {
3252
- fill: 'currentColor'
3253
- };
3254
- var ANIMATION_BASE = {
3255
- attributeType: 'XML',
3256
- repeatCount: 'indefinite',
3257
- dur: '2s'
3258
- }; // Ring
3259
-
3260
- gChildren.push({
3261
- tag: 'path',
3262
- attributes: _objectSpread2$1(_objectSpread2$1({}, FILL), {}, {
3263
- d: 'M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z'
3264
- })
3265
- });
3266
-
3267
- var OPACITY_ANIMATE = _objectSpread2$1(_objectSpread2$1({}, ANIMATION_BASE), {}, {
3268
- attributeName: 'opacity'
3269
- });
3177
+ const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
3178
+ const htmlEntities = {
3179
+ '&amp;': '&',
3180
+ '&#38;': '&',
3181
+ '&lt;': '<',
3182
+ '&#60;': '<',
3183
+ '&gt;': '>',
3184
+ '&#62;': '>',
3185
+ '&apos;': "'",
3186
+ '&#39;': "'",
3187
+ '&quot;': '"',
3188
+ '&#34;': '"',
3189
+ '&nbsp;': ' ',
3190
+ '&#160;': ' ',
3191
+ '&copy;': '©',
3192
+ '&#169;': '©',
3193
+ '&reg;': '®',
3194
+ '&#174;': '®',
3195
+ '&hellip;': '…',
3196
+ '&#8230;': '',
3197
+ '&#x2F;': '/',
3198
+ '&#47;': '/'
3199
+ };
3200
+ const unescapeHtmlEntity = m => htmlEntities[m];
3201
+ const unescape = text => text.replace(matchHtmlEntity, unescapeHtmlEntity);
3270
3202
 
3271
- var dot = {
3272
- tag: 'circle',
3273
- attributes: _objectSpread2$1(_objectSpread2$1({}, FILL), {}, {
3274
- cx: '256',
3275
- cy: '364',
3276
- r: '28'
3277
- }),
3278
- children: []
3279
- };
3203
+ let defaultOptions$1 = {
3204
+ bindI18n: 'languageChanged',
3205
+ bindI18nStore: '',
3206
+ transEmptyNodeValue: '',
3207
+ transSupportBasicHtmlNodes: true,
3208
+ transWrapTextNodes: '',
3209
+ transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],
3210
+ useSuspense: true,
3211
+ unescape
3212
+ };
3213
+ function setDefaults() {
3214
+ let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3215
+ defaultOptions$1 = {
3216
+ ...defaultOptions$1,
3217
+ ...options
3218
+ };
3219
+ }
3220
+ function getDefaults() {
3221
+ return defaultOptions$1;
3222
+ }
3280
3223
 
3281
- if (!reduceMotion) {
3282
- dot.children.push({
3283
- tag: 'animate',
3284
- attributes: _objectSpread2$1(_objectSpread2$1({}, ANIMATION_BASE), {}, {
3285
- attributeName: 'r',
3286
- values: '28;14;28;28;14;28;'
3287
- })
3288
- }, {
3289
- tag: 'animate',
3290
- attributes: _objectSpread2$1(_objectSpread2$1({}, OPACITY_ANIMATE), {}, {
3291
- values: '1;0;1;1;0;1;'
3292
- })
3293
- });
3294
- }
3224
+ let i18nInstance;
3225
+ function setI18n(instance) {
3226
+ i18nInstance = instance;
3227
+ }
3228
+ function getI18n() {
3229
+ return i18nInstance;
3230
+ }
3295
3231
 
3296
- gChildren.push(dot);
3297
- gChildren.push({
3298
- tag: 'path',
3299
- attributes: _objectSpread2$1(_objectSpread2$1({}, FILL), {}, {
3300
- opacity: '1',
3301
- d: 'M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z'
3302
- }),
3303
- children: reduceMotion ? [] : [{
3304
- tag: 'animate',
3305
- attributes: _objectSpread2$1(_objectSpread2$1({}, OPACITY_ANIMATE), {}, {
3306
- values: '1;0;0;0;0;1;'
3307
- })
3308
- }]
3309
- });
3232
+ const initReactI18next = {
3233
+ type: '3rdParty',
3234
+ init(instance) {
3235
+ setDefaults(instance.options.react);
3236
+ setI18n(instance);
3237
+ }
3238
+ };
3310
3239
 
3311
- if (!reduceMotion) {
3312
- // Exclamation
3313
- gChildren.push({
3314
- tag: 'path',
3315
- attributes: _objectSpread2$1(_objectSpread2$1({}, FILL), {}, {
3316
- opacity: '0',
3317
- d: 'M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z'
3318
- }),
3319
- children: [{
3320
- tag: 'animate',
3321
- attributes: _objectSpread2$1(_objectSpread2$1({}, OPACITY_ANIMATE), {}, {
3322
- values: '0;0;1;1;0;0;'
3323
- })
3324
- }]
3325
- });
3326
- }
3240
+ const I18nContext = createContext();
3241
+ class ReportNamespaces {
3242
+ constructor() {
3243
+ this.usedNamespaces = {};
3244
+ }
3245
+ addUsedNamespaces(namespaces) {
3246
+ namespaces.forEach(ns => {
3247
+ if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;
3248
+ });
3249
+ }
3250
+ getUsedNamespaces() {
3251
+ return Object.keys(this.usedNamespaces);
3252
+ }
3253
+ }
3327
3254
 
3328
- return {
3329
- tag: 'g',
3330
- attributes: {
3331
- 'class': 'missing'
3332
- },
3333
- children: gChildren
3334
- };
3255
+ const usePrevious = (value, ignore) => {
3256
+ const ref = useRef();
3257
+ useEffect(() => {
3258
+ ref.current = ignore ? ref.current : value;
3259
+ }, [value, ignore]);
3260
+ return ref.current;
3261
+ };
3262
+ function useTranslation(ns) {
3263
+ let props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3264
+ const {
3265
+ i18n: i18nFromProps
3266
+ } = props;
3267
+ const {
3268
+ i18n: i18nFromContext,
3269
+ defaultNS: defaultNSFromContext
3270
+ } = useContext(I18nContext) || {};
3271
+ const i18n = i18nFromProps || i18nFromContext || getI18n();
3272
+ if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
3273
+ if (!i18n) {
3274
+ warnOnce('You will need to pass in an i18next instance by using initReactI18next');
3275
+ const notReadyT = (k, optsOrDefaultValue) => {
3276
+ if (typeof optsOrDefaultValue === 'string') return optsOrDefaultValue;
3277
+ if (optsOrDefaultValue && typeof optsOrDefaultValue === 'object' && typeof optsOrDefaultValue.defaultValue === 'string') return optsOrDefaultValue.defaultValue;
3278
+ return Array.isArray(k) ? k[k.length - 1] : k;
3335
3279
  };
3280
+ const retNotReady = [notReadyT, {}, false];
3281
+ retNotReady.t = notReadyT;
3282
+ retNotReady.i18n = {};
3283
+ retNotReady.ready = false;
3284
+ return retNotReady;
3336
3285
  }
3337
- };
3338
-
3339
- var SvgSymbols = {
3340
- hooks: function hooks() {
3341
- return {
3342
- parseNodeAttributes: function parseNodeAttributes(accumulator, node) {
3343
- var symbolData = node.getAttribute('data-fa-symbol');
3344
- var symbol = symbolData === null ? false : symbolData === '' ? true : symbolData;
3345
- accumulator['symbol'] = symbol;
3346
- return accumulator;
3286
+ if (i18n.options.react && i18n.options.react.wait !== undefined) warnOnce('It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.');
3287
+ const i18nOptions = {
3288
+ ...getDefaults(),
3289
+ ...i18n.options.react,
3290
+ ...props
3291
+ };
3292
+ const {
3293
+ useSuspense,
3294
+ keyPrefix
3295
+ } = i18nOptions;
3296
+ let namespaces = ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
3297
+ namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
3298
+ if (i18n.reportNamespaces.addUsedNamespaces) i18n.reportNamespaces.addUsedNamespaces(namespaces);
3299
+ const ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every(n => hasLoadedNamespace(n, i18n, i18nOptions));
3300
+ function getT() {
3301
+ return i18n.getFixedT(props.lng || null, i18nOptions.nsMode === 'fallback' ? namespaces : namespaces[0], keyPrefix);
3302
+ }
3303
+ const [t, setT] = useState(getT);
3304
+ let joinedNS = namespaces.join();
3305
+ if (props.lng) joinedNS = `${props.lng}${joinedNS}`;
3306
+ const previousJoinedNS = usePrevious(joinedNS);
3307
+ const isMounted = useRef(true);
3308
+ useEffect(() => {
3309
+ const {
3310
+ bindI18n,
3311
+ bindI18nStore
3312
+ } = i18nOptions;
3313
+ isMounted.current = true;
3314
+ if (!ready && !useSuspense) {
3315
+ if (props.lng) {
3316
+ loadLanguages(i18n, props.lng, namespaces, () => {
3317
+ if (isMounted.current) setT(getT);
3318
+ });
3319
+ } else {
3320
+ loadNamespaces(i18n, namespaces, () => {
3321
+ if (isMounted.current) setT(getT);
3322
+ });
3347
3323
  }
3324
+ }
3325
+ if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {
3326
+ setT(getT);
3327
+ }
3328
+ function boundReset() {
3329
+ if (isMounted.current) setT(getT);
3330
+ }
3331
+ if (bindI18n && i18n) i18n.on(bindI18n, boundReset);
3332
+ if (bindI18nStore && i18n) i18n.store.on(bindI18nStore, boundReset);
3333
+ return () => {
3334
+ isMounted.current = false;
3335
+ if (bindI18n && i18n) bindI18n.split(' ').forEach(e => i18n.off(e, boundReset));
3336
+ if (bindI18nStore && i18n) bindI18nStore.split(' ').forEach(e => i18n.store.off(e, boundReset));
3348
3337
  };
3349
- }
3350
- };
3338
+ }, [i18n, joinedNS]);
3339
+ const isInitial = useRef(true);
3340
+ useEffect(() => {
3341
+ if (isMounted.current && !isInitial.current) {
3342
+ setT(getT);
3343
+ }
3344
+ isInitial.current = false;
3345
+ }, [i18n, keyPrefix]);
3346
+ const ret = [t, i18n, ready];
3347
+ ret.t = t;
3348
+ ret.i18n = i18n;
3349
+ ret.ready = ready;
3350
+ if (ready) return ret;
3351
+ if (!ready && !useSuspense) return ret;
3352
+ throw new Promise(resolve => {
3353
+ if (props.lng) {
3354
+ loadLanguages(i18n, props.lng, namespaces, () => resolve());
3355
+ } else {
3356
+ loadNamespaces(i18n, namespaces, () => resolve());
3357
+ }
3358
+ });
3359
+ }
3351
3360
 
3352
- var plugins = [InjectCSS, ReplaceElements, Layers, LayersCounter, LayersText, PseudoElements, MutationObserver$1, PowerTransforms, Masks, MissingIconIndicator, SvgSymbols];
3361
+ var css_248z$8 = ".will-filter-bar-divider {\n width: 1px;\n margin: 0 10px;\n height: 35px;\n background-color: #384265;\n}";
3362
+ styleInject(css_248z$8);
3353
3363
 
3354
- registerPlugins(plugins, {
3355
- mixoutsTo: api
3356
- });
3357
- api.noAuto;
3358
- api.config;
3359
- api.library;
3360
- api.dom;
3361
- var parse$1 = api.parse;
3362
- api.findIconDefinition;
3363
- api.toHtml;
3364
- var icon = api.icon;
3365
- api.layer;
3366
- api.text;
3367
- api.counter;
3364
+ function Divider() {
3365
+ return React__default__default.createElement("div", { className: "will-filter-bar-divider" });
3366
+ }
3367
+
3368
+ var css_248z$7 = ".will-filter-bar-select-button {\n width: 100%;\n height: auto;\n background-color: transparent;\n border: none;\n padding: 10px 20px;\n border-radius: 20px;\n cursor: pointer;\n font-size: 15px;\n text-align: initial;\n}\n";
3369
+ styleInject(css_248z$7);
3370
+
3371
+ function SelectButton(_a) {
3372
+ var label = _a.label, onClick = _a.onClick, style = _a.style;
3373
+ return (React__default__default.createElement("button", { className: "will-filter-bar-select-button", onClick: onClick, style: style }, label));
3374
+ }
3368
3375
 
3369
3376
  var propTypes = {exports: {}};
3370
3377
 
@@ -4972,13 +4979,6 @@ FontAwesomeIcon.defaultProps = {
4972
4979
  };
4973
4980
  var convertCurry = convert.bind(null, React__default__default.createElement);
4974
4981
 
4975
- var faMagnifyingGlass = {
4976
- prefix: 'fas',
4977
- iconName: 'magnifying-glass',
4978
- icon: [512, 512, [128269, "search"], "f002", "M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.2-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0S416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"]
4979
- };
4980
- var faSearch = faMagnifyingGlass;
4981
-
4982
4982
  var css_248z$6 = ".will-filter-bar-submit-button {\n width: auto;\n height: auto;\n background-color: var(--will-primary);\n color: var(--will-white);\n padding: 10px 20px;\n border-radius: 20px;\n cursor: pointer;\n border: none;\n white-space: nowrap;\n text-transform: uppercase;\n font-size: 12px;\n display: flex;\n align-items: center;\n}\n\n.will-filter-bar-submit-button span {\n margin-right: 10px;\n}";
4983
4983
  styleInject(css_248z$6);
4984
4984
 
@@ -13054,5 +13054,7 @@ var fontWigthBold = function (input) {
13054
13054
  return { fontWeight: input ? 'bold' : 'initial' };
13055
13055
  };
13056
13056
 
13057
+ library$1.add(faSearch);
13058
+
13057
13059
  export { Button$1 as Button, FilterBar };
13058
13060
  //# sourceMappingURL=index.esm.js.map