@sunggang/ui-lib 0.1.51 → 0.1.53
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/index.esm.css +248 -0
- package/index.esm.js +855 -3144
- package/package.json +6 -1
- package/src/Type/index.d.ts +19 -0
- package/src/components/ui/checkbox.d.ts +4 -0
- package/src/components/ui/dropdown-menu.d.ts +27 -0
- package/src/components/ui/input.d.ts +5 -0
- package/src/components/ui/table.d.ts +10 -0
- package/src/index.d.ts +1 -0
- package/src/lib/DataTable/Pagination.d.ts +6 -0
- package/src/lib/DataTable/fake.d.ts +68 -0
- package/src/lib/DataTable/index.d.ts +4 -0
package/index.esm.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import React__default, { useMemo, useRef, useReducer, useEffect, useCallback, forwardRef, useImperativeHandle, Fragment, useState } from 'react';
|
|
4
|
+
import { Icon } from '@iconify/react';
|
|
4
5
|
import * as SwitchPrimitives from '@radix-ui/react-switch';
|
|
5
6
|
import { clsx } from 'clsx';
|
|
6
7
|
import { twMerge } from 'tailwind-merge';
|
|
@@ -9,10 +10,14 @@ import { Calendar as Calendar$1 } from 'lucide-react';
|
|
|
9
10
|
import { Slot } from '@radix-ui/react-slot';
|
|
10
11
|
import { cva } from 'class-variance-authority';
|
|
11
12
|
import { DayPicker } from 'react-day-picker';
|
|
13
|
+
import { zhTW } from 'date-fns/locale';
|
|
12
14
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
13
15
|
import { Calendar as Calendar$2, DateRange } from 'react-date-range';
|
|
14
16
|
import * as locales from 'react-date-range/dist/locale';
|
|
15
17
|
import format$1 from 'date-fns/format';
|
|
18
|
+
import '@tanstack/react-table';
|
|
19
|
+
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
20
|
+
import { ChevronRightIcon, CheckIcon, DotFilledIcon } from '@radix-ui/react-icons';
|
|
16
21
|
|
|
17
22
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
18
23
|
function getDefaultExportFromCjs(x) {
|
|
@@ -64549,14 +64554,14 @@ var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
|
64549
64554
|
* This source code is licensed under the MIT license found in the
|
|
64550
64555
|
* LICENSE file in the root directory of this source tree.
|
|
64551
64556
|
*/
|
|
64552
|
-
function _instanceof$
|
|
64557
|
+
function _instanceof$3(left, right) {
|
|
64553
64558
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
64554
64559
|
return !!right[Symbol.hasInstance](left);
|
|
64555
64560
|
} else {
|
|
64556
64561
|
return left instanceof right;
|
|
64557
64562
|
}
|
|
64558
64563
|
}
|
|
64559
|
-
function _type_of$
|
|
64564
|
+
function _type_of$1(obj) {
|
|
64560
64565
|
"@swc/helpers - typeof";
|
|
64561
64566
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
64562
64567
|
}
|
|
@@ -64600,7 +64605,7 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
64600
64605
|
// This is intentionally an invariant that gets caught. It's the same
|
|
64601
64606
|
// behavior as without this statement except with a better message.
|
|
64602
64607
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
64603
|
-
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; " + "it must be a function, usually from the `prop-types` package, but received `" + _type_of$
|
|
64608
|
+
var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; " + "it must be a function, usually from the `prop-types` package, but received `" + _type_of$1(typeSpecs[typeSpecName]) + "`." + "This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
64604
64609
|
err.name = "Invariant Violation";
|
|
64605
64610
|
throw err;
|
|
64606
64611
|
}
|
|
@@ -64608,10 +64613,10 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
64608
64613
|
} catch (ex) {
|
|
64609
64614
|
error = ex;
|
|
64610
64615
|
}
|
|
64611
|
-
if (error && !_instanceof$
|
|
64612
|
-
printWarning$1((componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker " + "function must return `null` or an `Error` but returned a " + (typeof error === "undefined" ? "undefined" : _type_of$
|
|
64616
|
+
if (error && !_instanceof$3(error, Error)) {
|
|
64617
|
+
printWarning$1((componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker " + "function must return `null` or an `Error` but returned a " + (typeof error === "undefined" ? "undefined" : _type_of$1(error)) + ". " + "You may have forgotten to pass an argument to the type checker " + "creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and " + "shape all require an argument).");
|
|
64613
64618
|
}
|
|
64614
|
-
if (_instanceof$
|
|
64619
|
+
if (_instanceof$3(error, Error) && !(error.message in loggedTypeFailures)) {
|
|
64615
64620
|
// Only monitor this failure once because there tends to be a lot of the
|
|
64616
64621
|
// same error.
|
|
64617
64622
|
loggedTypeFailures[error.message] = true;
|
|
@@ -64639,14 +64644,14 @@ var checkPropTypes_1 = checkPropTypes$1;
|
|
|
64639
64644
|
* This source code is licensed under the MIT license found in the
|
|
64640
64645
|
* LICENSE file in the root directory of this source tree.
|
|
64641
64646
|
*/
|
|
64642
|
-
function _instanceof$
|
|
64647
|
+
function _instanceof$2(left, right) {
|
|
64643
64648
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
64644
64649
|
return !!right[Symbol.hasInstance](left);
|
|
64645
64650
|
} else {
|
|
64646
64651
|
return left instanceof right;
|
|
64647
64652
|
}
|
|
64648
64653
|
}
|
|
64649
|
-
function _type_of
|
|
64654
|
+
function _type_of(obj) {
|
|
64650
64655
|
"@swc/helpers - typeof";
|
|
64651
64656
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
64652
64657
|
}
|
|
@@ -64864,7 +64869,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
64864
64869
|
}
|
|
64865
64870
|
for(var i = 0; i < propValue.length; i++){
|
|
64866
64871
|
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret$1);
|
|
64867
|
-
if (_instanceof$
|
|
64872
|
+
if (_instanceof$2(error, Error)) {
|
|
64868
64873
|
return error;
|
|
64869
64874
|
}
|
|
64870
64875
|
}
|
|
@@ -64896,7 +64901,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
64896
64901
|
}
|
|
64897
64902
|
function createInstanceTypeChecker(expectedClass) {
|
|
64898
64903
|
function validate(props, propName, componentName, location, propFullName) {
|
|
64899
|
-
if (!_instanceof$
|
|
64904
|
+
if (!_instanceof$2(props[propName], expectedClass)) {
|
|
64900
64905
|
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
64901
64906
|
var actualClassName = getClassName(props[propName]);
|
|
64902
64907
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
|
|
@@ -64947,7 +64952,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
64947
64952
|
for(var key in propValue){
|
|
64948
64953
|
if (has(propValue, key)) {
|
|
64949
64954
|
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret$1);
|
|
64950
|
-
if (_instanceof$
|
|
64955
|
+
if (_instanceof$2(error, Error)) {
|
|
64951
64956
|
return error;
|
|
64952
64957
|
}
|
|
64953
64958
|
}
|
|
@@ -65045,7 +65050,7 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
65045
65050
|
return createChainableTypeChecker(validate);
|
|
65046
65051
|
}
|
|
65047
65052
|
function isNode(propValue) {
|
|
65048
|
-
switch(typeof propValue === "undefined" ? "undefined" : _type_of
|
|
65053
|
+
switch(typeof propValue === "undefined" ? "undefined" : _type_of(propValue)){
|
|
65049
65054
|
case "number":
|
|
65050
65055
|
case "string":
|
|
65051
65056
|
case "undefined":
|
|
@@ -65102,18 +65107,18 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
65102
65107
|
return true;
|
|
65103
65108
|
}
|
|
65104
65109
|
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
65105
|
-
if (typeof Symbol === "function" && _instanceof$
|
|
65110
|
+
if (typeof Symbol === "function" && _instanceof$2(propValue, Symbol)) {
|
|
65106
65111
|
return true;
|
|
65107
65112
|
}
|
|
65108
65113
|
return false;
|
|
65109
65114
|
}
|
|
65110
65115
|
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
65111
65116
|
function getPropType(propValue) {
|
|
65112
|
-
var propType = typeof propValue === "undefined" ? "undefined" : _type_of
|
|
65117
|
+
var propType = typeof propValue === "undefined" ? "undefined" : _type_of(propValue);
|
|
65113
65118
|
if (Array.isArray(propValue)) {
|
|
65114
65119
|
return "array";
|
|
65115
65120
|
}
|
|
65116
|
-
if (_instanceof$
|
|
65121
|
+
if (_instanceof$2(propValue, RegExp)) {
|
|
65117
65122
|
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
65118
65123
|
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
65119
65124
|
// passes PropTypes.object.
|
|
@@ -65132,9 +65137,9 @@ var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
|
65132
65137
|
}
|
|
65133
65138
|
var propType = getPropType(propValue);
|
|
65134
65139
|
if (propType === "object") {
|
|
65135
|
-
if (_instanceof$
|
|
65140
|
+
if (_instanceof$2(propValue, Date)) {
|
|
65136
65141
|
return "date";
|
|
65137
|
-
} else if (_instanceof$
|
|
65142
|
+
} else if (_instanceof$2(propValue, RegExp)) {
|
|
65138
65143
|
return "regexp";
|
|
65139
65144
|
}
|
|
65140
65145
|
}
|
|
@@ -65256,7 +65261,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
65256
65261
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
65257
65262
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
65258
65263
|
PERFORMANCE OF THIS SOFTWARE.
|
|
65259
|
-
***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol */ function _instanceof$
|
|
65264
|
+
***************************************************************************** */ /* global Reflect, Promise, SuppressedError, Symbol */ function _instanceof$1(left, right) {
|
|
65260
65265
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
65261
65266
|
return !!right[Symbol.hasInstance](left);
|
|
65262
65267
|
} else {
|
|
@@ -65265,7 +65270,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
65265
65270
|
}
|
|
65266
65271
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
65267
65272
|
function adopt(value) {
|
|
65268
|
-
return _instanceof$
|
|
65273
|
+
return _instanceof$1(value, P) ? value : new P(function(resolve) {
|
|
65269
65274
|
resolve(value);
|
|
65270
65275
|
});
|
|
65271
65276
|
}
|
|
@@ -66066,7 +66071,7 @@ var _default = function(file, acceptedFiles) {
|
|
|
66066
66071
|
return true;
|
|
66067
66072
|
};
|
|
66068
66073
|
|
|
66069
|
-
function _instanceof
|
|
66074
|
+
function _instanceof(left, right) {
|
|
66070
66075
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
66071
66076
|
return !!right[Symbol.hasInstance](left);
|
|
66072
66077
|
} else {
|
|
@@ -66379,7 +66384,7 @@ function isIeOrEdge() {
|
|
|
66379
66384
|
* @param {any} v
|
|
66380
66385
|
* @returns {boolean} True if v is an abort exception.
|
|
66381
66386
|
*/ function isAbort(v) {
|
|
66382
|
-
return _instanceof
|
|
66387
|
+
return _instanceof(v, DOMException) && (v.name === "AbortError" || v.code === v.ABORT_ERR);
|
|
66383
66388
|
}
|
|
66384
66389
|
/**
|
|
66385
66390
|
* Check if v is a security error.
|
|
@@ -66388,7 +66393,7 @@ function isIeOrEdge() {
|
|
|
66388
66393
|
* @param {any} v
|
|
66389
66394
|
* @returns {boolean} True if v is a security error.
|
|
66390
66395
|
*/ function isSecurityError(v) {
|
|
66391
|
-
return _instanceof
|
|
66396
|
+
return _instanceof(v, DOMException) && (v.name === "SecurityError" || v.code === v.SECURITY_ERR);
|
|
66392
66397
|
}
|
|
66393
66398
|
/**
|
|
66394
66399
|
* Check if v is a MIME type string.
|
|
@@ -67446,32 +67451,18 @@ function v4(options, buf, offset) {
|
|
|
67446
67451
|
return stringify(rnds);
|
|
67447
67452
|
}
|
|
67448
67453
|
|
|
67449
|
-
function
|
|
67450
|
-
if (
|
|
67451
|
-
|
|
67452
|
-
|
|
67453
|
-
return self;
|
|
67454
|
-
}
|
|
67455
|
-
function _class_call_check(instance, Constructor) {
|
|
67456
|
-
if (!(instance instanceof Constructor)) {
|
|
67457
|
-
throw new TypeError("Cannot call a class as a function");
|
|
67458
|
-
}
|
|
67454
|
+
function _array_like_to_array$3(arr, len) {
|
|
67455
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
67456
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
67457
|
+
return arr2;
|
|
67459
67458
|
}
|
|
67460
|
-
function
|
|
67461
|
-
|
|
67462
|
-
var descriptor = props[i];
|
|
67463
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
67464
|
-
descriptor.configurable = true;
|
|
67465
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
67466
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
67467
|
-
}
|
|
67459
|
+
function _array_with_holes$3(arr) {
|
|
67460
|
+
if (Array.isArray(arr)) return arr;
|
|
67468
67461
|
}
|
|
67469
|
-
function
|
|
67470
|
-
if (
|
|
67471
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
67472
|
-
return Constructor;
|
|
67462
|
+
function _array_without_holes(arr) {
|
|
67463
|
+
if (Array.isArray(arr)) return _array_like_to_array$3(arr);
|
|
67473
67464
|
}
|
|
67474
|
-
function _define_property$
|
|
67465
|
+
function _define_property$7(obj, key, value) {
|
|
67475
67466
|
if (key in obj) {
|
|
67476
67467
|
Object.defineProperty(obj, key, {
|
|
67477
67468
|
value: value,
|
|
@@ -67484,33 +67475,40 @@ function _define_property$5(obj, key, value) {
|
|
|
67484
67475
|
}
|
|
67485
67476
|
return obj;
|
|
67486
67477
|
}
|
|
67487
|
-
function
|
|
67488
|
-
|
|
67489
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
67490
|
-
};
|
|
67491
|
-
return _get_prototype_of(o);
|
|
67478
|
+
function _iterable_to_array(iter) {
|
|
67479
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
67492
67480
|
}
|
|
67493
|
-
function
|
|
67494
|
-
|
|
67495
|
-
|
|
67496
|
-
|
|
67497
|
-
|
|
67498
|
-
|
|
67499
|
-
|
|
67500
|
-
|
|
67501
|
-
|
|
67481
|
+
function _iterable_to_array_limit$3(arr, i) {
|
|
67482
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
67483
|
+
if (_i == null) return;
|
|
67484
|
+
var _arr = [];
|
|
67485
|
+
var _n = true;
|
|
67486
|
+
var _d = false;
|
|
67487
|
+
var _s, _e;
|
|
67488
|
+
try {
|
|
67489
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
67490
|
+
_arr.push(_s.value);
|
|
67491
|
+
if (i && _arr.length === i) break;
|
|
67492
|
+
}
|
|
67493
|
+
} catch (err) {
|
|
67494
|
+
_d = true;
|
|
67495
|
+
_e = err;
|
|
67496
|
+
} finally{
|
|
67497
|
+
try {
|
|
67498
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
67499
|
+
} finally{
|
|
67500
|
+
if (_d) throw _e;
|
|
67502
67501
|
}
|
|
67503
|
-
});
|
|
67504
|
-
if (superClass) _set_prototype_of(subClass, superClass);
|
|
67505
|
-
}
|
|
67506
|
-
function _instanceof(left, right) {
|
|
67507
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
67508
|
-
return !!right[Symbol.hasInstance](left);
|
|
67509
|
-
} else {
|
|
67510
|
-
return left instanceof right;
|
|
67511
67502
|
}
|
|
67503
|
+
return _arr;
|
|
67512
67504
|
}
|
|
67513
|
-
function
|
|
67505
|
+
function _non_iterable_rest$3() {
|
|
67506
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
67507
|
+
}
|
|
67508
|
+
function _non_iterable_spread() {
|
|
67509
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
67510
|
+
}
|
|
67511
|
+
function _object_spread$7(target) {
|
|
67514
67512
|
for(var i = 1; i < arguments.length; i++){
|
|
67515
67513
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
67516
67514
|
var ownKeys = Object.keys(source);
|
|
@@ -67520,7 +67518,7 @@ function _object_spread$5(target) {
|
|
|
67520
67518
|
}));
|
|
67521
67519
|
}
|
|
67522
67520
|
ownKeys.forEach(function(key) {
|
|
67523
|
-
_define_property$
|
|
67521
|
+
_define_property$7(target, key, source[key]);
|
|
67524
67522
|
});
|
|
67525
67523
|
}
|
|
67526
67524
|
return target;
|
|
@@ -67549,2312 +67547,365 @@ function _object_spread_props$3(target, source) {
|
|
|
67549
67547
|
}
|
|
67550
67548
|
return target;
|
|
67551
67549
|
}
|
|
67552
|
-
function
|
|
67553
|
-
|
|
67554
|
-
return call;
|
|
67555
|
-
}
|
|
67556
|
-
return _assert_this_initialized(self);
|
|
67557
|
-
}
|
|
67558
|
-
function _set_prototype_of(o, p) {
|
|
67559
|
-
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
67560
|
-
o.__proto__ = p;
|
|
67561
|
-
return o;
|
|
67562
|
-
};
|
|
67563
|
-
return _set_prototype_of(o, p);
|
|
67550
|
+
function _sliced_to_array$3(arr, i) {
|
|
67551
|
+
return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$3();
|
|
67564
67552
|
}
|
|
67565
|
-
function
|
|
67566
|
-
|
|
67567
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
67553
|
+
function _to_consumable_array(arr) {
|
|
67554
|
+
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array$3(arr) || _non_iterable_spread();
|
|
67568
67555
|
}
|
|
67569
|
-
function
|
|
67570
|
-
if (
|
|
67571
|
-
if (
|
|
67572
|
-
|
|
67573
|
-
|
|
67574
|
-
|
|
67575
|
-
|
|
67576
|
-
} catch (e) {
|
|
67577
|
-
return false;
|
|
67578
|
-
}
|
|
67556
|
+
function _unsupported_iterable_to_array$3(o, minLen) {
|
|
67557
|
+
if (!o) return;
|
|
67558
|
+
if (typeof o === "string") return _array_like_to_array$3(o, minLen);
|
|
67559
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
67560
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
67561
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
67562
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
|
|
67579
67563
|
}
|
|
67580
|
-
function
|
|
67581
|
-
var
|
|
67582
|
-
|
|
67583
|
-
|
|
67584
|
-
|
|
67585
|
-
|
|
67586
|
-
|
|
67587
|
-
|
|
67588
|
-
|
|
67564
|
+
var DropImage = function(param) {
|
|
67565
|
+
var _param_preview = param.preview, preview = _param_preview === void 0 ? true : _param_preview, setFiles = param.setFiles, imageUrls = param.imageUrls, setImageUrls = param.setImageUrls;
|
|
67566
|
+
var _useState = _sliced_to_array$3(useState([]), 2), previewFiles = _useState[0], setPreviewFiles = _useState[1];
|
|
67567
|
+
var _useDropzone = useDropzone({
|
|
67568
|
+
accept: {
|
|
67569
|
+
"image/png": [
|
|
67570
|
+
".png"
|
|
67571
|
+
],
|
|
67572
|
+
"image/jpeg": [
|
|
67573
|
+
".jpg",
|
|
67574
|
+
".jpeg"
|
|
67575
|
+
]
|
|
67576
|
+
},
|
|
67577
|
+
maxFiles: 10,
|
|
67578
|
+
maxSize: 5000000,
|
|
67579
|
+
onDrop: function(dropFiles) {
|
|
67580
|
+
var newFiles = [];
|
|
67581
|
+
setFiles(dropFiles);
|
|
67582
|
+
dropFiles.forEach(function(dropFile) {
|
|
67583
|
+
Object.assign(dropFile, {
|
|
67584
|
+
preview: URL.createObjectURL(dropFile),
|
|
67585
|
+
uuid: v4()
|
|
67586
|
+
});
|
|
67587
|
+
newFiles.push(dropFile);
|
|
67588
|
+
setPreviewFiles(newFiles);
|
|
67589
|
+
});
|
|
67589
67590
|
}
|
|
67590
|
-
|
|
67591
|
+
}), getRootProps = _useDropzone.getRootProps, getInputProps = _useDropzone.getInputProps; _useDropzone.isDragActive; _useDropzone.isDragAccept; _useDropzone.isDragReject;
|
|
67592
|
+
var removePreviewFile = function(file) {
|
|
67593
|
+
var currentItem = previewFiles === null || previewFiles === void 0 ? void 0 : previewFiles.indexOf(file);
|
|
67594
|
+
previewFiles.splice(currentItem, 1);
|
|
67595
|
+
setPreviewFiles(_to_consumable_array(previewFiles));
|
|
67591
67596
|
};
|
|
67592
|
-
|
|
67593
|
-
var
|
|
67594
|
-
|
|
67595
|
-
|
|
67596
|
-
|
|
67597
|
-
|
|
67598
|
-
|
|
67599
|
-
|
|
67600
|
-
|
|
67601
|
-
|
|
67602
|
-
|
|
67603
|
-
|
|
67604
|
-
|
|
67605
|
-
|
|
67606
|
-
|
|
67607
|
-
|
|
67608
|
-
|
|
67609
|
-
|
|
67610
|
-
|
|
67611
|
-
|
|
67612
|
-
|
|
67613
|
-
|
|
67614
|
-
|
|
67615
|
-
|
|
67616
|
-
|
|
67617
|
-
|
|
67618
|
-
|
|
67619
|
-
|
|
67620
|
-
|
|
67621
|
-
|
|
67622
|
-
|
|
67623
|
-
|
|
67624
|
-
|
|
67625
|
-
|
|
67626
|
-
|
|
67627
|
-
|
|
67628
|
-
|
|
67629
|
-
|
|
67630
|
-
|
|
67631
|
-
|
|
67632
|
-
|
|
67633
|
-
|
|
67634
|
-
|
|
67635
|
-
|
|
67597
|
+
var removeImageUrls = function(item) {
|
|
67598
|
+
var currentItem = imageUrls === null || imageUrls === void 0 ? void 0 : imageUrls.indexOf(item);
|
|
67599
|
+
imageUrls.splice(currentItem, 1);
|
|
67600
|
+
setImageUrls(_to_consumable_array(imageUrls));
|
|
67601
|
+
};
|
|
67602
|
+
return /*#__PURE__*/ jsxs("section", {
|
|
67603
|
+
className: "w-full",
|
|
67604
|
+
children: [
|
|
67605
|
+
/*#__PURE__*/ jsxs("div", _object_spread_props$3(_object_spread$7({}, getRootProps({
|
|
67606
|
+
className: "dropzone"
|
|
67607
|
+
})), {
|
|
67608
|
+
children: [
|
|
67609
|
+
/*#__PURE__*/ jsx("input", _object_spread$7({}, getInputProps())),
|
|
67610
|
+
/*#__PURE__*/ jsx("div", {
|
|
67611
|
+
className: "flex justify-between",
|
|
67612
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
67613
|
+
className: "w-full bg-gray-light rounded-lg",
|
|
67614
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
67615
|
+
className: "border-2 border-dashed border-gray-400 rounded-lg bg-gray-100",
|
|
67616
|
+
children: [
|
|
67617
|
+
/*#__PURE__*/ jsx("div", {
|
|
67618
|
+
className: "flex justify-center py-8",
|
|
67619
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
67620
|
+
icon: "material-symbols:upload",
|
|
67621
|
+
width: "2.5rem",
|
|
67622
|
+
height: "2.5rem"
|
|
67623
|
+
})
|
|
67624
|
+
}),
|
|
67625
|
+
/*#__PURE__*/ jsxs("div", {
|
|
67626
|
+
className: "flex items-center flex-col justify-center",
|
|
67627
|
+
children: [
|
|
67628
|
+
/*#__PURE__*/ jsx("p", {
|
|
67629
|
+
className: "font-normal text-sm text-gray-400 pb-4",
|
|
67630
|
+
children: "圖片僅支援 png、jpg、jpeg"
|
|
67631
|
+
}),
|
|
67632
|
+
/*#__PURE__*/ jsx("h5", {
|
|
67633
|
+
className: "mb-2 text-xl font-bold tracking-tight text-gray-700 pb-4",
|
|
67634
|
+
children: "拖曳圖片至此"
|
|
67635
|
+
})
|
|
67636
|
+
]
|
|
67637
|
+
})
|
|
67638
|
+
]
|
|
67639
|
+
})
|
|
67640
|
+
})
|
|
67641
|
+
})
|
|
67642
|
+
]
|
|
67643
|
+
})),
|
|
67644
|
+
preview && /*#__PURE__*/ jsx("div", {
|
|
67645
|
+
className: "flex pt-2 gap-2",
|
|
67646
|
+
children: (previewFiles === null || previewFiles === void 0 ? void 0 : previewFiles.length) ? previewFiles.length > 0 ? previewFiles.map(function(item) {
|
|
67647
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
67648
|
+
className: "relative",
|
|
67649
|
+
children: [
|
|
67650
|
+
/*#__PURE__*/ jsx("button", {
|
|
67651
|
+
className: "absolute bottom-0 right-0 bg-white rounded-full p-1 shadow-md",
|
|
67652
|
+
onClick: function() {
|
|
67653
|
+
return removePreviewFile(item);
|
|
67654
|
+
},
|
|
67655
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
67656
|
+
icon: "mingcute:delete-2-line",
|
|
67657
|
+
width: "1.5rem",
|
|
67658
|
+
height: "1.5rem"
|
|
67659
|
+
})
|
|
67660
|
+
}),
|
|
67661
|
+
/*#__PURE__*/ jsx("img", {
|
|
67662
|
+
className: "w-24 h-24 object-cover",
|
|
67663
|
+
src: item === null || item === void 0 ? void 0 : item.preview,
|
|
67664
|
+
alt: ""
|
|
67665
|
+
})
|
|
67666
|
+
]
|
|
67667
|
+
}, item === null || item === void 0 ? void 0 : item.uuid);
|
|
67668
|
+
}) : null : imageUrls && imageUrls.length ? imageUrls.map(function(item) {
|
|
67669
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
67670
|
+
className: "relative",
|
|
67671
|
+
children: [
|
|
67672
|
+
/*#__PURE__*/ jsx("button", {
|
|
67673
|
+
className: "absolute bottom-0 right-0 bg-white rounded-full p-1 shadow-md",
|
|
67674
|
+
onClick: function() {
|
|
67675
|
+
return removeImageUrls(item);
|
|
67676
|
+
},
|
|
67677
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
67678
|
+
icon: "mingcute:delete-2-line",
|
|
67679
|
+
width: "1.5rem",
|
|
67680
|
+
height: "1.5rem"
|
|
67681
|
+
})
|
|
67682
|
+
}),
|
|
67683
|
+
/*#__PURE__*/ jsx("img", {
|
|
67684
|
+
className: "w-24 h-24 object-cover",
|
|
67685
|
+
src: item === null || item === void 0 ? void 0 : item.url,
|
|
67686
|
+
alt: ""
|
|
67687
|
+
})
|
|
67688
|
+
]
|
|
67689
|
+
}, item === null || item === void 0 ? void 0 : item.url);
|
|
67690
|
+
}) : null
|
|
67691
|
+
})
|
|
67692
|
+
]
|
|
67693
|
+
});
|
|
67636
67694
|
};
|
|
67637
|
-
|
|
67638
|
-
|
|
67639
|
-
|
|
67640
|
-
|
|
67641
|
-
|
|
67695
|
+
|
|
67696
|
+
var ModalContent = function(param) {
|
|
67697
|
+
var title = param.title, setModal = param.setModal, children = param.children, onClick = param.onClick, _param_notice = param.notice, notice = _param_notice === void 0 ? false : _param_notice;
|
|
67698
|
+
return /*#__PURE__*/ jsxs("form", {
|
|
67699
|
+
children: [
|
|
67700
|
+
title && /*#__PURE__*/ jsx("div", {
|
|
67701
|
+
className: "text-2xl text-gray-700 font-medium border-solid border-b border-gray-300 mb-4 p-4",
|
|
67702
|
+
children: title
|
|
67703
|
+
}),
|
|
67704
|
+
children && /*#__PURE__*/ jsx("div", {
|
|
67705
|
+
className: "py-4 px-8",
|
|
67706
|
+
children: children
|
|
67707
|
+
}),
|
|
67708
|
+
/*#__PURE__*/ jsx("div", {
|
|
67709
|
+
className: "flex items-center text-base p-4 px-8 justify-around",
|
|
67710
|
+
children: notice ? /*#__PURE__*/ jsx("button", {
|
|
67711
|
+
type: "button",
|
|
67712
|
+
className: "w-24 h-10 px-2 text-white bg-gray-600 rounded",
|
|
67713
|
+
onClick: setModal,
|
|
67714
|
+
children: "確定"
|
|
67715
|
+
}) : /*#__PURE__*/ jsxs(Fragment$1, {
|
|
67716
|
+
children: [
|
|
67717
|
+
/*#__PURE__*/ jsx("button", {
|
|
67718
|
+
type: "button",
|
|
67719
|
+
className: "w-24 h-10 px-2 text-white bg-gray-600 rounded",
|
|
67720
|
+
onClick: setModal,
|
|
67721
|
+
children: "取消"
|
|
67722
|
+
}),
|
|
67723
|
+
onClick && /*#__PURE__*/ jsx("button", {
|
|
67724
|
+
type: "button",
|
|
67725
|
+
className: "w-24 h-10 mx-3 text-white bg-gray-500 rounded",
|
|
67726
|
+
onClick: onClick,
|
|
67727
|
+
children: "送出"
|
|
67728
|
+
})
|
|
67729
|
+
]
|
|
67730
|
+
})
|
|
67731
|
+
})
|
|
67732
|
+
]
|
|
67733
|
+
});
|
|
67642
67734
|
};
|
|
67643
|
-
|
|
67644
|
-
|
|
67645
|
-
|
|
67646
|
-
|
|
67647
|
-
|
|
67648
|
-
|
|
67649
|
-
|
|
67650
|
-
|
|
67651
|
-
|
|
67652
|
-
|
|
67653
|
-
|
|
67654
|
-
|
|
67655
|
-
|
|
67656
|
-
|
|
67657
|
-
|
|
67658
|
-
|
|
67659
|
-
|
|
67660
|
-
|
|
67661
|
-
|
|
67662
|
-
|
|
67663
|
-
|
|
67664
|
-
|
|
67665
|
-
|
|
67666
|
-
|
|
67667
|
-
|
|
67668
|
-
|
|
67669
|
-
|
|
67670
|
-
|
|
67671
|
-
|
|
67672
|
-
|
|
67673
|
-
|
|
67674
|
-
|
|
67675
|
-
|
|
67676
|
-
|
|
67677
|
-
|
|
67678
|
-
|
|
67679
|
-
}
|
|
67680
|
-
} else if (key in child) {
|
|
67681
|
-
result[key] = child[key];
|
|
67682
|
-
} else if (key in parent) {
|
|
67683
|
-
result[key] = parent[key];
|
|
67684
|
-
}
|
|
67685
|
-
}
|
|
67686
|
-
return result;
|
|
67687
|
-
}
|
|
67688
|
-
function getIconsTree(data, names) {
|
|
67689
|
-
var icons = data.icons;
|
|
67690
|
-
var aliases = data.aliases || /* @__PURE__ */ Object.create(null);
|
|
67691
|
-
var resolved = /* @__PURE__ */ Object.create(null);
|
|
67692
|
-
function resolve(name) {
|
|
67693
|
-
if (icons[name]) {
|
|
67694
|
-
return resolved[name] = [];
|
|
67695
|
-
}
|
|
67696
|
-
if (!(name in resolved)) {
|
|
67697
|
-
resolved[name] = null;
|
|
67698
|
-
var parent = aliases[name] && aliases[name].parent;
|
|
67699
|
-
var value = parent && resolve(parent);
|
|
67700
|
-
if (value) {
|
|
67701
|
-
resolved[name] = [
|
|
67702
|
-
parent
|
|
67703
|
-
].concat(value);
|
|
67704
|
-
}
|
|
67735
|
+
|
|
67736
|
+
var ErrorContent = function(param) {
|
|
67737
|
+
var setModal = param.setModal, errmsg = param.errmsg;
|
|
67738
|
+
return /*#__PURE__*/ jsx(ModalContent, {
|
|
67739
|
+
setModal: setModal,
|
|
67740
|
+
onClick: setModal,
|
|
67741
|
+
notice: true,
|
|
67742
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
67743
|
+
className: "w-full max-w-xl",
|
|
67744
|
+
children: [
|
|
67745
|
+
/*#__PURE__*/ jsx("div", {
|
|
67746
|
+
className: "flex justify-center items-center mb-6",
|
|
67747
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
67748
|
+
icon: "fluent-mdl2:status-error-full",
|
|
67749
|
+
color: "red",
|
|
67750
|
+
height: 60
|
|
67751
|
+
})
|
|
67752
|
+
}),
|
|
67753
|
+
/*#__PURE__*/ jsx("div", {
|
|
67754
|
+
className: "text-center text-lg text-gray-500",
|
|
67755
|
+
children: errmsg
|
|
67756
|
+
})
|
|
67757
|
+
]
|
|
67758
|
+
})
|
|
67759
|
+
});
|
|
67760
|
+
};
|
|
67761
|
+
|
|
67762
|
+
var Modal = function(param) {
|
|
67763
|
+
var modal = param.modal, _param_unsetModal = param.unsetModal, unsetModal = _param_unsetModal === void 0 ? function() {} : _param_unsetModal;
|
|
67764
|
+
var handleKeyUp = function(e) {
|
|
67765
|
+
var _document_activeElement;
|
|
67766
|
+
if (e.key === "Escape" && ![
|
|
67767
|
+
"INPUT",
|
|
67768
|
+
"SELECT"
|
|
67769
|
+
].includes((_document_activeElement = document.activeElement) === null || _document_activeElement === void 0 ? void 0 : _document_activeElement.tagName)) {
|
|
67770
|
+
unsetModal();
|
|
67705
67771
|
}
|
|
67706
|
-
|
|
67707
|
-
|
|
67708
|
-
|
|
67709
|
-
|
|
67772
|
+
};
|
|
67773
|
+
useEffect(function() {
|
|
67774
|
+
document.addEventListener("keyup", handleKeyUp);
|
|
67775
|
+
return function() {
|
|
67776
|
+
return document.removeEventListener("keyup", handleKeyUp);
|
|
67777
|
+
};
|
|
67778
|
+
}, [
|
|
67779
|
+
unsetModal
|
|
67780
|
+
]);
|
|
67781
|
+
return /*#__PURE__*/ jsx("div", {
|
|
67782
|
+
className: "fixed top-0 left-0 h-screen z-[2000] transition-opacity duration-300 transition-opacity bg-[#000000b3] w-full",
|
|
67783
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
67784
|
+
className: "w-full h-full flex justify-center items-center p-6",
|
|
67785
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
67786
|
+
className: "bg-white rounded overflow-y-auto w-full m-auto max-w-[455px] rounded-xl",
|
|
67787
|
+
children: modal
|
|
67788
|
+
})
|
|
67789
|
+
})
|
|
67790
|
+
});
|
|
67791
|
+
};
|
|
67792
|
+
|
|
67793
|
+
function _array_like_to_array$2(arr, len) {
|
|
67794
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
67795
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
67796
|
+
return arr2;
|
|
67710
67797
|
}
|
|
67711
|
-
function
|
|
67712
|
-
|
|
67713
|
-
var aliases = data.aliases || /* @__PURE__ */ Object.create(null);
|
|
67714
|
-
var currentProps = {};
|
|
67715
|
-
function parse(name2) {
|
|
67716
|
-
currentProps = mergeIconData(icons[name2] || aliases[name2], currentProps);
|
|
67717
|
-
}
|
|
67718
|
-
parse(name);
|
|
67719
|
-
tree.forEach(parse);
|
|
67720
|
-
return mergeIconData(data, currentProps);
|
|
67798
|
+
function _array_with_holes$2(arr) {
|
|
67799
|
+
if (Array.isArray(arr)) return arr;
|
|
67721
67800
|
}
|
|
67722
|
-
function
|
|
67723
|
-
var
|
|
67724
|
-
if (
|
|
67725
|
-
|
|
67726
|
-
|
|
67727
|
-
|
|
67728
|
-
|
|
67729
|
-
|
|
67730
|
-
|
|
67731
|
-
|
|
67732
|
-
|
|
67733
|
-
var tree = getIconsTree(data);
|
|
67734
|
-
for(var name in tree){
|
|
67735
|
-
var item = tree[name];
|
|
67736
|
-
if (item) {
|
|
67737
|
-
callback(name, internalGetIconData(data, name, item));
|
|
67738
|
-
names.push(name);
|
|
67801
|
+
function _iterable_to_array_limit$2(arr, i) {
|
|
67802
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
67803
|
+
if (_i == null) return;
|
|
67804
|
+
var _arr = [];
|
|
67805
|
+
var _n = true;
|
|
67806
|
+
var _d = false;
|
|
67807
|
+
var _s, _e;
|
|
67808
|
+
try {
|
|
67809
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
67810
|
+
_arr.push(_s.value);
|
|
67811
|
+
if (i && _arr.length === i) break;
|
|
67739
67812
|
}
|
|
67740
|
-
}
|
|
67741
|
-
|
|
67742
|
-
|
|
67743
|
-
|
|
67744
|
-
|
|
67745
|
-
|
|
67746
|
-
|
|
67747
|
-
|
|
67748
|
-
function checkOptionalProps(item, defaults) {
|
|
67749
|
-
for(var prop in defaults){
|
|
67750
|
-
if (prop in item && _type_of(item[prop]) !== _type_of(defaults[prop])) {
|
|
67751
|
-
return false;
|
|
67813
|
+
} catch (err) {
|
|
67814
|
+
_d = true;
|
|
67815
|
+
_e = err;
|
|
67816
|
+
} finally{
|
|
67817
|
+
try {
|
|
67818
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
67819
|
+
} finally{
|
|
67820
|
+
if (_d) throw _e;
|
|
67752
67821
|
}
|
|
67753
67822
|
}
|
|
67754
|
-
return
|
|
67823
|
+
return _arr;
|
|
67755
67824
|
}
|
|
67756
|
-
function
|
|
67757
|
-
|
|
67758
|
-
return null;
|
|
67759
|
-
}
|
|
67760
|
-
var data = obj;
|
|
67761
|
-
if (typeof data.prefix !== "string" || !obj.icons || typeof obj.icons !== "object") {
|
|
67762
|
-
return null;
|
|
67763
|
-
}
|
|
67764
|
-
if (!checkOptionalProps(obj, optionalPropertyDefaults)) {
|
|
67765
|
-
return null;
|
|
67766
|
-
}
|
|
67767
|
-
var icons = data.icons;
|
|
67768
|
-
for(var name in icons){
|
|
67769
|
-
var icon = icons[name];
|
|
67770
|
-
if (!name.match(matchIconName) || typeof icon.body !== "string" || !checkOptionalProps(icon, defaultExtendedIconProps)) {
|
|
67771
|
-
return null;
|
|
67772
|
-
}
|
|
67773
|
-
}
|
|
67774
|
-
var aliases = data.aliases || /* @__PURE__ */ Object.create(null);
|
|
67775
|
-
for(var name1 in aliases){
|
|
67776
|
-
var icon1 = aliases[name1];
|
|
67777
|
-
var parent = icon1.parent;
|
|
67778
|
-
if (!name1.match(matchIconName) || typeof parent !== "string" || !icons[parent] && !aliases[parent] || !checkOptionalProps(icon1, defaultExtendedIconProps)) {
|
|
67779
|
-
return null;
|
|
67780
|
-
}
|
|
67781
|
-
}
|
|
67782
|
-
return data;
|
|
67825
|
+
function _non_iterable_rest$2() {
|
|
67826
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
67783
67827
|
}
|
|
67784
|
-
|
|
67785
|
-
|
|
67786
|
-
return {
|
|
67787
|
-
provider: provider,
|
|
67788
|
-
prefix: prefix,
|
|
67789
|
-
icons: /* @__PURE__ */ Object.create(null),
|
|
67790
|
-
missing: /* @__PURE__ */ new Set()
|
|
67791
|
-
};
|
|
67828
|
+
function _sliced_to_array$2(arr, i) {
|
|
67829
|
+
return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
|
|
67792
67830
|
}
|
|
67793
|
-
function
|
|
67794
|
-
|
|
67795
|
-
|
|
67831
|
+
function _unsupported_iterable_to_array$2(o, minLen) {
|
|
67832
|
+
if (!o) return;
|
|
67833
|
+
if (typeof o === "string") return _array_like_to_array$2(o, minLen);
|
|
67834
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
67835
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
67836
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
67837
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
|
|
67796
67838
|
}
|
|
67797
|
-
function
|
|
67798
|
-
|
|
67799
|
-
|
|
67800
|
-
|
|
67801
|
-
|
|
67802
|
-
|
|
67803
|
-
|
|
67804
|
-
|
|
67805
|
-
|
|
67839
|
+
var BaseTemplate = function(param) {
|
|
67840
|
+
var file = param.file, imageUrl = param.imageUrl;
|
|
67841
|
+
var _useState = _sliced_to_array$2(useState(null), 2), tempImage = _useState[0], setTempImage = _useState[1];
|
|
67842
|
+
useEffect(function() {
|
|
67843
|
+
var fileReader;
|
|
67844
|
+
var isCancel = false;
|
|
67845
|
+
if (file) {
|
|
67846
|
+
fileReader = new FileReader();
|
|
67847
|
+
fileReader.onload = function(e) {
|
|
67848
|
+
var result = e.target.result;
|
|
67849
|
+
if (result && !isCancel) {
|
|
67850
|
+
setTempImage(result.toString());
|
|
67851
|
+
}
|
|
67852
|
+
};
|
|
67853
|
+
fileReader.readAsDataURL(file);
|
|
67806
67854
|
}
|
|
67855
|
+
return function() {
|
|
67856
|
+
setTempImage(null);
|
|
67857
|
+
isCancel = true;
|
|
67858
|
+
if (fileReader && fileReader.readyState === 1) {
|
|
67859
|
+
fileReader.abort();
|
|
67860
|
+
}
|
|
67861
|
+
};
|
|
67862
|
+
}, [
|
|
67863
|
+
file
|
|
67864
|
+
]);
|
|
67865
|
+
return /*#__PURE__*/ jsx("div", {
|
|
67866
|
+
className: "max-w-sm mx-auto bg-white rounded-lg shadow-md overflow-hidden items-center",
|
|
67867
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
67868
|
+
className: "px-4 py-6 w-72 h-56",
|
|
67869
|
+
children: tempImage || imageUrl ? /*#__PURE__*/ jsx("img", {
|
|
67870
|
+
className: "w-full h-full object-contain border-dashed border-2 border-gray-400 p-6 rounded-lg",
|
|
67871
|
+
src: tempImage || imageUrl,
|
|
67872
|
+
alt: ""
|
|
67873
|
+
}) : /*#__PURE__*/ jsx("div", {
|
|
67874
|
+
id: "image-preview",
|
|
67875
|
+
className: "max-w-sm p-6 bg-gray-100 border-dashed border-2 border-gray-400 rounded-lg items-center mx-auto text-center cursor-pointer",
|
|
67876
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
67877
|
+
className: "cursor-pointer",
|
|
67878
|
+
children: [
|
|
67879
|
+
/*#__PURE__*/ jsx("div", {
|
|
67880
|
+
className: "flex justify-center",
|
|
67881
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
67882
|
+
icon: "material-symbols:upload",
|
|
67883
|
+
width: "2.5rem",
|
|
67884
|
+
height: "2.5rem"
|
|
67885
|
+
})
|
|
67886
|
+
}),
|
|
67887
|
+
/*#__PURE__*/ jsx("p", {
|
|
67888
|
+
className: "font-normal text-sm text-gray-400 py-4",
|
|
67889
|
+
children: "圖片僅支援 png、jpg、jpeg"
|
|
67890
|
+
}),
|
|
67891
|
+
/*#__PURE__*/ jsx("h5", {
|
|
67892
|
+
className: "mb-2 text-xl font-bold tracking-tight text-gray-700",
|
|
67893
|
+
children: "上傳圖片"
|
|
67894
|
+
})
|
|
67895
|
+
]
|
|
67896
|
+
})
|
|
67897
|
+
})
|
|
67898
|
+
})
|
|
67807
67899
|
});
|
|
67900
|
+
};
|
|
67901
|
+
|
|
67902
|
+
function _array_like_to_array$1(arr, len) {
|
|
67903
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
67904
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
67905
|
+
return arr2;
|
|
67808
67906
|
}
|
|
67809
|
-
function
|
|
67810
|
-
|
|
67811
|
-
if (typeof icon.body === "string") {
|
|
67812
|
-
storage.icons[name] = _object_spread$5({}, icon);
|
|
67813
|
-
return true;
|
|
67814
|
-
}
|
|
67815
|
-
} catch (err) {}
|
|
67816
|
-
return false;
|
|
67817
|
-
}
|
|
67818
|
-
var simpleNames = false;
|
|
67819
|
-
function allowSimpleNames(allow) {
|
|
67820
|
-
if (typeof allow === "boolean") {
|
|
67821
|
-
simpleNames = allow;
|
|
67822
|
-
}
|
|
67823
|
-
return simpleNames;
|
|
67824
|
-
}
|
|
67825
|
-
function getIconData(name) {
|
|
67826
|
-
var icon = typeof name === "string" ? stringToIcon(name, true, simpleNames) : name;
|
|
67827
|
-
if (icon) {
|
|
67828
|
-
var storage = getStorage(icon.provider, icon.prefix);
|
|
67829
|
-
var iconName = icon.name;
|
|
67830
|
-
return storage.icons[iconName] || (storage.missing.has(iconName) ? null : void 0);
|
|
67831
|
-
}
|
|
67832
|
-
}
|
|
67833
|
-
function addIcon(name, data) {
|
|
67834
|
-
var icon = stringToIcon(name, true, simpleNames);
|
|
67835
|
-
if (!icon) {
|
|
67836
|
-
return false;
|
|
67837
|
-
}
|
|
67838
|
-
var storage = getStorage(icon.provider, icon.prefix);
|
|
67839
|
-
return addIconToStorage(storage, icon.name, data);
|
|
67840
|
-
}
|
|
67841
|
-
function addCollection(data, provider) {
|
|
67842
|
-
if (typeof data !== "object") {
|
|
67843
|
-
return false;
|
|
67844
|
-
}
|
|
67845
|
-
if (typeof provider !== "string") {
|
|
67846
|
-
provider = data.provider || "";
|
|
67847
|
-
}
|
|
67848
|
-
if (simpleNames && !provider && !data.prefix) {
|
|
67849
|
-
var added = false;
|
|
67850
|
-
if (quicklyValidateIconSet(data)) {
|
|
67851
|
-
data.prefix = "";
|
|
67852
|
-
parseIconSet(data, function(name, icon) {
|
|
67853
|
-
if (icon && addIcon(name, icon)) {
|
|
67854
|
-
added = true;
|
|
67855
|
-
}
|
|
67856
|
-
});
|
|
67857
|
-
}
|
|
67858
|
-
return added;
|
|
67859
|
-
}
|
|
67860
|
-
var prefix = data.prefix;
|
|
67861
|
-
if (!validateIconName({
|
|
67862
|
-
provider: provider,
|
|
67863
|
-
prefix: prefix,
|
|
67864
|
-
name: "a"
|
|
67865
|
-
})) {
|
|
67866
|
-
return false;
|
|
67867
|
-
}
|
|
67868
|
-
var storage = getStorage(provider, prefix);
|
|
67869
|
-
return !!addIconSet(storage, data);
|
|
67870
|
-
}
|
|
67871
|
-
var defaultIconSizeCustomisations = Object.freeze({
|
|
67872
|
-
width: null,
|
|
67873
|
-
height: null
|
|
67874
|
-
});
|
|
67875
|
-
var defaultIconCustomisations = Object.freeze(_object_spread$5({}, defaultIconSizeCustomisations, defaultIconTransformations));
|
|
67876
|
-
var unitsSplit = /(-?[0-9.]*[0-9]+[0-9.]*)/g;
|
|
67877
|
-
var unitsTest = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
67878
|
-
function calculateSize(size, ratio, precision) {
|
|
67879
|
-
if (ratio === 1) {
|
|
67880
|
-
return size;
|
|
67881
|
-
}
|
|
67882
|
-
precision = precision || 100;
|
|
67883
|
-
if (typeof size === "number") {
|
|
67884
|
-
return Math.ceil(size * ratio * precision) / precision;
|
|
67885
|
-
}
|
|
67886
|
-
if (typeof size !== "string") {
|
|
67887
|
-
return size;
|
|
67888
|
-
}
|
|
67889
|
-
var oldParts = size.split(unitsSplit);
|
|
67890
|
-
if (oldParts === null || !oldParts.length) {
|
|
67891
|
-
return size;
|
|
67892
|
-
}
|
|
67893
|
-
var newParts = [];
|
|
67894
|
-
var code = oldParts.shift();
|
|
67895
|
-
var isNumber = unitsTest.test(code);
|
|
67896
|
-
while(true){
|
|
67897
|
-
if (isNumber) {
|
|
67898
|
-
var num = parseFloat(code);
|
|
67899
|
-
if (isNaN(num)) {
|
|
67900
|
-
newParts.push(code);
|
|
67901
|
-
} else {
|
|
67902
|
-
newParts.push(Math.ceil(num * ratio * precision) / precision);
|
|
67903
|
-
}
|
|
67904
|
-
} else {
|
|
67905
|
-
newParts.push(code);
|
|
67906
|
-
}
|
|
67907
|
-
code = oldParts.shift();
|
|
67908
|
-
if (code === void 0) {
|
|
67909
|
-
return newParts.join("");
|
|
67910
|
-
}
|
|
67911
|
-
isNumber = !isNumber;
|
|
67912
|
-
}
|
|
67913
|
-
}
|
|
67914
|
-
var isUnsetKeyword = function(value) {
|
|
67915
|
-
return value === "unset" || value === "undefined" || value === "none";
|
|
67916
|
-
};
|
|
67917
|
-
function iconToSVG(icon, customisations) {
|
|
67918
|
-
var fullIcon = _object_spread$5({}, defaultIconProps, icon);
|
|
67919
|
-
var fullCustomisations = _object_spread$5({}, defaultIconCustomisations, customisations);
|
|
67920
|
-
var box = {
|
|
67921
|
-
left: fullIcon.left,
|
|
67922
|
-
top: fullIcon.top,
|
|
67923
|
-
width: fullIcon.width,
|
|
67924
|
-
height: fullIcon.height
|
|
67925
|
-
};
|
|
67926
|
-
var body = fullIcon.body;
|
|
67927
|
-
[
|
|
67928
|
-
fullIcon,
|
|
67929
|
-
fullCustomisations
|
|
67930
|
-
].forEach(function(props) {
|
|
67931
|
-
var transformations = [];
|
|
67932
|
-
var hFlip = props.hFlip;
|
|
67933
|
-
var vFlip = props.vFlip;
|
|
67934
|
-
var rotation = props.rotate;
|
|
67935
|
-
if (hFlip) {
|
|
67936
|
-
if (vFlip) {
|
|
67937
|
-
rotation += 2;
|
|
67938
|
-
} else {
|
|
67939
|
-
transformations.push("translate(" + (box.width + box.left).toString() + " " + (0 - box.top).toString() + ")");
|
|
67940
|
-
transformations.push("scale(-1 1)");
|
|
67941
|
-
box.top = box.left = 0;
|
|
67942
|
-
}
|
|
67943
|
-
} else if (vFlip) {
|
|
67944
|
-
transformations.push("translate(" + (0 - box.left).toString() + " " + (box.height + box.top).toString() + ")");
|
|
67945
|
-
transformations.push("scale(1 -1)");
|
|
67946
|
-
box.top = box.left = 0;
|
|
67947
|
-
}
|
|
67948
|
-
var tempValue;
|
|
67949
|
-
if (rotation < 0) {
|
|
67950
|
-
rotation -= Math.floor(rotation / 4) * 4;
|
|
67951
|
-
}
|
|
67952
|
-
rotation = rotation % 4;
|
|
67953
|
-
switch(rotation){
|
|
67954
|
-
case 1:
|
|
67955
|
-
tempValue = box.height / 2 + box.top;
|
|
67956
|
-
transformations.unshift("rotate(90 " + tempValue.toString() + " " + tempValue.toString() + ")");
|
|
67957
|
-
break;
|
|
67958
|
-
case 2:
|
|
67959
|
-
transformations.unshift("rotate(180 " + (box.width / 2 + box.left).toString() + " " + (box.height / 2 + box.top).toString() + ")");
|
|
67960
|
-
break;
|
|
67961
|
-
case 3:
|
|
67962
|
-
tempValue = box.width / 2 + box.left;
|
|
67963
|
-
transformations.unshift("rotate(-90 " + tempValue.toString() + " " + tempValue.toString() + ")");
|
|
67964
|
-
break;
|
|
67965
|
-
}
|
|
67966
|
-
if (rotation % 2 === 1) {
|
|
67967
|
-
if (box.left !== box.top) {
|
|
67968
|
-
tempValue = box.left;
|
|
67969
|
-
box.left = box.top;
|
|
67970
|
-
box.top = tempValue;
|
|
67971
|
-
}
|
|
67972
|
-
if (box.width !== box.height) {
|
|
67973
|
-
tempValue = box.width;
|
|
67974
|
-
box.width = box.height;
|
|
67975
|
-
box.height = tempValue;
|
|
67976
|
-
}
|
|
67977
|
-
}
|
|
67978
|
-
if (transformations.length) {
|
|
67979
|
-
body = '<g transform="' + transformations.join(" ") + '">' + body + "</g>";
|
|
67980
|
-
}
|
|
67981
|
-
});
|
|
67982
|
-
var customisationsWidth = fullCustomisations.width;
|
|
67983
|
-
var customisationsHeight = fullCustomisations.height;
|
|
67984
|
-
var boxWidth = box.width;
|
|
67985
|
-
var boxHeight = box.height;
|
|
67986
|
-
var width;
|
|
67987
|
-
var height;
|
|
67988
|
-
if (customisationsWidth === null) {
|
|
67989
|
-
height = customisationsHeight === null ? "1em" : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
|
|
67990
|
-
width = calculateSize(height, boxWidth / boxHeight);
|
|
67991
|
-
} else {
|
|
67992
|
-
width = customisationsWidth === "auto" ? boxWidth : customisationsWidth;
|
|
67993
|
-
height = customisationsHeight === null ? calculateSize(width, boxHeight / boxWidth) : customisationsHeight === "auto" ? boxHeight : customisationsHeight;
|
|
67994
|
-
}
|
|
67995
|
-
var attributes = {};
|
|
67996
|
-
var setAttr = function(prop, value) {
|
|
67997
|
-
if (!isUnsetKeyword(value)) {
|
|
67998
|
-
attributes[prop] = value.toString();
|
|
67999
|
-
}
|
|
68000
|
-
};
|
|
68001
|
-
setAttr("width", width);
|
|
68002
|
-
setAttr("height", height);
|
|
68003
|
-
attributes.viewBox = box.left.toString() + " " + box.top.toString() + " " + boxWidth.toString() + " " + boxHeight.toString();
|
|
68004
|
-
return {
|
|
68005
|
-
attributes: attributes,
|
|
68006
|
-
body: body
|
|
68007
|
-
};
|
|
68008
|
-
}
|
|
68009
|
-
var regex = /\sid="(\S+)"/g;
|
|
68010
|
-
var randomPrefix = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
|
|
68011
|
-
var counter = 0;
|
|
68012
|
-
function replaceIDs(body) {
|
|
68013
|
-
var prefix = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : randomPrefix;
|
|
68014
|
-
var ids = [];
|
|
68015
|
-
var match;
|
|
68016
|
-
while(match = regex.exec(body)){
|
|
68017
|
-
ids.push(match[1]);
|
|
68018
|
-
}
|
|
68019
|
-
if (!ids.length) {
|
|
68020
|
-
return body;
|
|
68021
|
-
}
|
|
68022
|
-
var suffix = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
|
|
68023
|
-
ids.forEach(function(id) {
|
|
68024
|
-
var newID = typeof prefix === "function" ? prefix(id) : prefix + (counter++).toString();
|
|
68025
|
-
var escapedID = id.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
68026
|
-
body = body.replace(// Allowed characters before id: [#;"]
|
|
68027
|
-
// Allowed characters after id: [)"], .[a-z]
|
|
68028
|
-
new RegExp('([#;"])(' + escapedID + ')([")]|\\.[a-z])', "g"), "$1" + newID + suffix + "$3");
|
|
68029
|
-
});
|
|
68030
|
-
body = body.replace(new RegExp(suffix, "g"), "");
|
|
68031
|
-
return body;
|
|
68032
|
-
}
|
|
68033
|
-
var storage = /* @__PURE__ */ Object.create(null);
|
|
68034
|
-
function setAPIModule(provider, item) {
|
|
68035
|
-
storage[provider] = item;
|
|
68036
|
-
}
|
|
68037
|
-
function getAPIModule(provider) {
|
|
68038
|
-
return storage[provider] || storage[""];
|
|
68039
|
-
}
|
|
68040
|
-
function createAPIConfig(source) {
|
|
68041
|
-
var resources;
|
|
68042
|
-
if (typeof source.resources === "string") {
|
|
68043
|
-
resources = [
|
|
68044
|
-
source.resources
|
|
68045
|
-
];
|
|
68046
|
-
} else {
|
|
68047
|
-
resources = source.resources;
|
|
68048
|
-
if (!_instanceof(resources, Array) || !resources.length) {
|
|
68049
|
-
return null;
|
|
68050
|
-
}
|
|
68051
|
-
}
|
|
68052
|
-
var result = {
|
|
68053
|
-
// API hosts
|
|
68054
|
-
resources: resources,
|
|
68055
|
-
// Root path
|
|
68056
|
-
path: source.path || "/",
|
|
68057
|
-
// URL length limit
|
|
68058
|
-
maxURL: source.maxURL || 500,
|
|
68059
|
-
// Timeout before next host is used.
|
|
68060
|
-
rotate: source.rotate || 750,
|
|
68061
|
-
// Timeout before failing query.
|
|
68062
|
-
timeout: source.timeout || 5e3,
|
|
68063
|
-
// Randomise default API end point.
|
|
68064
|
-
random: source.random === true,
|
|
68065
|
-
// Start index
|
|
68066
|
-
index: source.index || 0,
|
|
68067
|
-
// Receive data after time out (used if time out kicks in first, then API module sends data anyway).
|
|
68068
|
-
dataAfterTimeout: source.dataAfterTimeout !== false
|
|
68069
|
-
};
|
|
68070
|
-
return result;
|
|
68071
|
-
}
|
|
68072
|
-
var configStorage = /* @__PURE__ */ Object.create(null);
|
|
68073
|
-
var fallBackAPISources = [
|
|
68074
|
-
"https://api.simplesvg.com",
|
|
68075
|
-
"https://api.unisvg.com"
|
|
68076
|
-
];
|
|
68077
|
-
var fallBackAPI = [];
|
|
68078
|
-
while(fallBackAPISources.length > 0){
|
|
68079
|
-
if (fallBackAPISources.length === 1) {
|
|
68080
|
-
fallBackAPI.push(fallBackAPISources.shift());
|
|
68081
|
-
} else {
|
|
68082
|
-
if (Math.random() > 0.5) {
|
|
68083
|
-
fallBackAPI.push(fallBackAPISources.shift());
|
|
68084
|
-
} else {
|
|
68085
|
-
fallBackAPI.push(fallBackAPISources.pop());
|
|
68086
|
-
}
|
|
68087
|
-
}
|
|
68088
|
-
}
|
|
68089
|
-
configStorage[""] = createAPIConfig({
|
|
68090
|
-
resources: [
|
|
68091
|
-
"https://api.iconify.design"
|
|
68092
|
-
].concat(fallBackAPI)
|
|
68093
|
-
});
|
|
68094
|
-
function addAPIProvider(provider, customConfig) {
|
|
68095
|
-
var config = createAPIConfig(customConfig);
|
|
68096
|
-
if (config === null) {
|
|
68097
|
-
return false;
|
|
68098
|
-
}
|
|
68099
|
-
configStorage[provider] = config;
|
|
68100
|
-
return true;
|
|
68101
|
-
}
|
|
68102
|
-
function getAPIConfig(provider) {
|
|
68103
|
-
return configStorage[provider];
|
|
68104
|
-
}
|
|
68105
|
-
var detectFetch = function() {
|
|
68106
|
-
var callback;
|
|
68107
|
-
try {
|
|
68108
|
-
callback = fetch;
|
|
68109
|
-
if (typeof callback === "function") {
|
|
68110
|
-
return callback;
|
|
68111
|
-
}
|
|
68112
|
-
} catch (err) {}
|
|
68113
|
-
};
|
|
68114
|
-
var fetchModule = detectFetch();
|
|
68115
|
-
function calculateMaxLength(provider, prefix) {
|
|
68116
|
-
var config = getAPIConfig(provider);
|
|
68117
|
-
if (!config) {
|
|
68118
|
-
return 0;
|
|
68119
|
-
}
|
|
68120
|
-
var result;
|
|
68121
|
-
if (!config.maxURL) {
|
|
68122
|
-
result = 0;
|
|
68123
|
-
} else {
|
|
68124
|
-
var maxHostLength = 0;
|
|
68125
|
-
config.resources.forEach(function(item) {
|
|
68126
|
-
var host = item;
|
|
68127
|
-
maxHostLength = Math.max(maxHostLength, host.length);
|
|
68128
|
-
});
|
|
68129
|
-
var url = prefix + ".json?icons=";
|
|
68130
|
-
result = config.maxURL - maxHostLength - config.path.length - url.length;
|
|
68131
|
-
}
|
|
68132
|
-
return result;
|
|
68133
|
-
}
|
|
68134
|
-
function shouldAbort(status) {
|
|
68135
|
-
return status === 404;
|
|
68136
|
-
}
|
|
68137
|
-
var prepare = function(provider, prefix, icons) {
|
|
68138
|
-
var results = [];
|
|
68139
|
-
var maxLength = calculateMaxLength(provider, prefix);
|
|
68140
|
-
var type = "icons";
|
|
68141
|
-
var item = {
|
|
68142
|
-
type: type,
|
|
68143
|
-
provider: provider,
|
|
68144
|
-
prefix: prefix,
|
|
68145
|
-
icons: []
|
|
68146
|
-
};
|
|
68147
|
-
var length = 0;
|
|
68148
|
-
icons.forEach(function(name, index) {
|
|
68149
|
-
length += name.length + 1;
|
|
68150
|
-
if (length >= maxLength && index > 0) {
|
|
68151
|
-
results.push(item);
|
|
68152
|
-
item = {
|
|
68153
|
-
type: type,
|
|
68154
|
-
provider: provider,
|
|
68155
|
-
prefix: prefix,
|
|
68156
|
-
icons: []
|
|
68157
|
-
};
|
|
68158
|
-
length = name.length;
|
|
68159
|
-
}
|
|
68160
|
-
item.icons.push(name);
|
|
68161
|
-
});
|
|
68162
|
-
results.push(item);
|
|
68163
|
-
return results;
|
|
68164
|
-
};
|
|
68165
|
-
function getPath(provider) {
|
|
68166
|
-
if (typeof provider === "string") {
|
|
68167
|
-
var config = getAPIConfig(provider);
|
|
68168
|
-
if (config) {
|
|
68169
|
-
return config.path;
|
|
68170
|
-
}
|
|
68171
|
-
}
|
|
68172
|
-
return "/";
|
|
68173
|
-
}
|
|
68174
|
-
var send = function(host, params, callback) {
|
|
68175
|
-
if (!fetchModule) {
|
|
68176
|
-
callback("abort", 424);
|
|
68177
|
-
return;
|
|
68178
|
-
}
|
|
68179
|
-
var path = getPath(params.provider);
|
|
68180
|
-
switch(params.type){
|
|
68181
|
-
case "icons":
|
|
68182
|
-
{
|
|
68183
|
-
var prefix = params.prefix;
|
|
68184
|
-
var icons = params.icons;
|
|
68185
|
-
var iconsList = icons.join(",");
|
|
68186
|
-
var urlParams = new URLSearchParams({
|
|
68187
|
-
icons: iconsList
|
|
68188
|
-
});
|
|
68189
|
-
path += prefix + ".json?" + urlParams.toString();
|
|
68190
|
-
break;
|
|
68191
|
-
}
|
|
68192
|
-
case "custom":
|
|
68193
|
-
{
|
|
68194
|
-
var uri = params.uri;
|
|
68195
|
-
path += uri.slice(0, 1) === "/" ? uri.slice(1) : uri;
|
|
68196
|
-
break;
|
|
68197
|
-
}
|
|
68198
|
-
default:
|
|
68199
|
-
callback("abort", 400);
|
|
68200
|
-
return;
|
|
68201
|
-
}
|
|
68202
|
-
var defaultError = 503;
|
|
68203
|
-
fetchModule(host + path).then(function(response) {
|
|
68204
|
-
var status = response.status;
|
|
68205
|
-
if (status !== 200) {
|
|
68206
|
-
setTimeout(function() {
|
|
68207
|
-
callback(shouldAbort(status) ? "abort" : "next", status);
|
|
68208
|
-
});
|
|
68209
|
-
return;
|
|
68210
|
-
}
|
|
68211
|
-
defaultError = 501;
|
|
68212
|
-
return response.json();
|
|
68213
|
-
}).then(function(data) {
|
|
68214
|
-
if (typeof data !== "object" || data === null) {
|
|
68215
|
-
setTimeout(function() {
|
|
68216
|
-
if (data === 404) {
|
|
68217
|
-
callback("abort", data);
|
|
68218
|
-
} else {
|
|
68219
|
-
callback("next", defaultError);
|
|
68220
|
-
}
|
|
68221
|
-
});
|
|
68222
|
-
return;
|
|
68223
|
-
}
|
|
68224
|
-
setTimeout(function() {
|
|
68225
|
-
callback("success", data);
|
|
68226
|
-
});
|
|
68227
|
-
}).catch(function() {
|
|
68228
|
-
callback("next", defaultError);
|
|
68229
|
-
});
|
|
68230
|
-
};
|
|
68231
|
-
var fetchAPIModule = {
|
|
68232
|
-
prepare: prepare,
|
|
68233
|
-
send: send
|
|
68234
|
-
};
|
|
68235
|
-
function sortIcons(icons) {
|
|
68236
|
-
var result = {
|
|
68237
|
-
loaded: [],
|
|
68238
|
-
missing: [],
|
|
68239
|
-
pending: []
|
|
68240
|
-
};
|
|
68241
|
-
var storage = /* @__PURE__ */ Object.create(null);
|
|
68242
|
-
icons.sort(function(a, b) {
|
|
68243
|
-
if (a.provider !== b.provider) {
|
|
68244
|
-
return a.provider.localeCompare(b.provider);
|
|
68245
|
-
}
|
|
68246
|
-
if (a.prefix !== b.prefix) {
|
|
68247
|
-
return a.prefix.localeCompare(b.prefix);
|
|
68248
|
-
}
|
|
68249
|
-
return a.name.localeCompare(b.name);
|
|
68250
|
-
});
|
|
68251
|
-
var lastIcon = {
|
|
68252
|
-
provider: "",
|
|
68253
|
-
prefix: "",
|
|
68254
|
-
name: ""
|
|
68255
|
-
};
|
|
68256
|
-
icons.forEach(function(icon) {
|
|
68257
|
-
if (lastIcon.name === icon.name && lastIcon.prefix === icon.prefix && lastIcon.provider === icon.provider) {
|
|
68258
|
-
return;
|
|
68259
|
-
}
|
|
68260
|
-
lastIcon = icon;
|
|
68261
|
-
var provider = icon.provider;
|
|
68262
|
-
var prefix = icon.prefix;
|
|
68263
|
-
var name = icon.name;
|
|
68264
|
-
var providerStorage = storage[provider] || (storage[provider] = /* @__PURE__ */ Object.create(null));
|
|
68265
|
-
var localStorage = providerStorage[prefix] || (providerStorage[prefix] = getStorage(provider, prefix));
|
|
68266
|
-
var list;
|
|
68267
|
-
if (name in localStorage.icons) {
|
|
68268
|
-
list = result.loaded;
|
|
68269
|
-
} else if (prefix === "" || localStorage.missing.has(name)) {
|
|
68270
|
-
list = result.missing;
|
|
68271
|
-
} else {
|
|
68272
|
-
list = result.pending;
|
|
68273
|
-
}
|
|
68274
|
-
var item = {
|
|
68275
|
-
provider: provider,
|
|
68276
|
-
prefix: prefix,
|
|
68277
|
-
name: name
|
|
68278
|
-
};
|
|
68279
|
-
list.push(item);
|
|
68280
|
-
});
|
|
68281
|
-
return result;
|
|
68282
|
-
}
|
|
68283
|
-
function removeCallback(storages, id) {
|
|
68284
|
-
storages.forEach(function(storage) {
|
|
68285
|
-
var items = storage.loaderCallbacks;
|
|
68286
|
-
if (items) {
|
|
68287
|
-
storage.loaderCallbacks = items.filter(function(row) {
|
|
68288
|
-
return row.id !== id;
|
|
68289
|
-
});
|
|
68290
|
-
}
|
|
68291
|
-
});
|
|
68292
|
-
}
|
|
68293
|
-
function updateCallbacks(storage) {
|
|
68294
|
-
if (!storage.pendingCallbacksFlag) {
|
|
68295
|
-
storage.pendingCallbacksFlag = true;
|
|
68296
|
-
setTimeout(function() {
|
|
68297
|
-
storage.pendingCallbacksFlag = false;
|
|
68298
|
-
var items = storage.loaderCallbacks ? storage.loaderCallbacks.slice(0) : [];
|
|
68299
|
-
if (!items.length) {
|
|
68300
|
-
return;
|
|
68301
|
-
}
|
|
68302
|
-
var hasPending = false;
|
|
68303
|
-
var provider = storage.provider;
|
|
68304
|
-
var prefix = storage.prefix;
|
|
68305
|
-
items.forEach(function(item) {
|
|
68306
|
-
var icons = item.icons;
|
|
68307
|
-
var oldLength = icons.pending.length;
|
|
68308
|
-
icons.pending = icons.pending.filter(function(icon) {
|
|
68309
|
-
if (icon.prefix !== prefix) {
|
|
68310
|
-
return true;
|
|
68311
|
-
}
|
|
68312
|
-
var name = icon.name;
|
|
68313
|
-
if (storage.icons[name]) {
|
|
68314
|
-
icons.loaded.push({
|
|
68315
|
-
provider: provider,
|
|
68316
|
-
prefix: prefix,
|
|
68317
|
-
name: name
|
|
68318
|
-
});
|
|
68319
|
-
} else if (storage.missing.has(name)) {
|
|
68320
|
-
icons.missing.push({
|
|
68321
|
-
provider: provider,
|
|
68322
|
-
prefix: prefix,
|
|
68323
|
-
name: name
|
|
68324
|
-
});
|
|
68325
|
-
} else {
|
|
68326
|
-
hasPending = true;
|
|
68327
|
-
return true;
|
|
68328
|
-
}
|
|
68329
|
-
return false;
|
|
68330
|
-
});
|
|
68331
|
-
if (icons.pending.length !== oldLength) {
|
|
68332
|
-
if (!hasPending) {
|
|
68333
|
-
removeCallback([
|
|
68334
|
-
storage
|
|
68335
|
-
], item.id);
|
|
68336
|
-
}
|
|
68337
|
-
item.callback(icons.loaded.slice(0), icons.missing.slice(0), icons.pending.slice(0), item.abort);
|
|
68338
|
-
}
|
|
68339
|
-
});
|
|
68340
|
-
});
|
|
68341
|
-
}
|
|
68342
|
-
}
|
|
68343
|
-
var idCounter = 0;
|
|
68344
|
-
function storeCallback(callback, icons, pendingSources) {
|
|
68345
|
-
var id = idCounter++;
|
|
68346
|
-
var abort = removeCallback.bind(null, pendingSources, id);
|
|
68347
|
-
if (!icons.pending.length) {
|
|
68348
|
-
return abort;
|
|
68349
|
-
}
|
|
68350
|
-
var item = {
|
|
68351
|
-
id: id,
|
|
68352
|
-
icons: icons,
|
|
68353
|
-
callback: callback,
|
|
68354
|
-
abort: abort
|
|
68355
|
-
};
|
|
68356
|
-
pendingSources.forEach(function(storage) {
|
|
68357
|
-
(storage.loaderCallbacks || (storage.loaderCallbacks = [])).push(item);
|
|
68358
|
-
});
|
|
68359
|
-
return abort;
|
|
68360
|
-
}
|
|
68361
|
-
function listToIcons(list) {
|
|
68362
|
-
var validate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, simpleNames = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false;
|
|
68363
|
-
var result = [];
|
|
68364
|
-
list.forEach(function(item) {
|
|
68365
|
-
var icon = typeof item === "string" ? stringToIcon(item, validate, simpleNames) : item;
|
|
68366
|
-
if (icon) {
|
|
68367
|
-
result.push(icon);
|
|
68368
|
-
}
|
|
68369
|
-
});
|
|
68370
|
-
return result;
|
|
68371
|
-
}
|
|
68372
|
-
// src/config.ts
|
|
68373
|
-
var defaultConfig = {
|
|
68374
|
-
resources: [],
|
|
68375
|
-
index: 0,
|
|
68376
|
-
timeout: 2e3,
|
|
68377
|
-
rotate: 750,
|
|
68378
|
-
random: false,
|
|
68379
|
-
dataAfterTimeout: false
|
|
68380
|
-
};
|
|
68381
|
-
// src/query.ts
|
|
68382
|
-
function sendQuery(config, payload, query, done) {
|
|
68383
|
-
var resourcesCount = config.resources.length;
|
|
68384
|
-
var startIndex = config.random ? Math.floor(Math.random() * resourcesCount) : config.index;
|
|
68385
|
-
var resources;
|
|
68386
|
-
if (config.random) {
|
|
68387
|
-
var list = config.resources.slice(0);
|
|
68388
|
-
resources = [];
|
|
68389
|
-
while(list.length > 1){
|
|
68390
|
-
var nextIndex = Math.floor(Math.random() * list.length);
|
|
68391
|
-
resources.push(list[nextIndex]);
|
|
68392
|
-
list = list.slice(0, nextIndex).concat(list.slice(nextIndex + 1));
|
|
68393
|
-
}
|
|
68394
|
-
resources = resources.concat(list);
|
|
68395
|
-
} else {
|
|
68396
|
-
resources = config.resources.slice(startIndex).concat(config.resources.slice(0, startIndex));
|
|
68397
|
-
}
|
|
68398
|
-
var startTime = Date.now();
|
|
68399
|
-
var status = "pending";
|
|
68400
|
-
var queriesSent = 0;
|
|
68401
|
-
var lastError;
|
|
68402
|
-
var timer = null;
|
|
68403
|
-
var queue = [];
|
|
68404
|
-
var doneCallbacks = [];
|
|
68405
|
-
if (typeof done === "function") {
|
|
68406
|
-
doneCallbacks.push(done);
|
|
68407
|
-
}
|
|
68408
|
-
function resetTimer() {
|
|
68409
|
-
if (timer) {
|
|
68410
|
-
clearTimeout(timer);
|
|
68411
|
-
timer = null;
|
|
68412
|
-
}
|
|
68413
|
-
}
|
|
68414
|
-
function abort() {
|
|
68415
|
-
if (status === "pending") {
|
|
68416
|
-
status = "aborted";
|
|
68417
|
-
}
|
|
68418
|
-
resetTimer();
|
|
68419
|
-
queue.forEach(function(item) {
|
|
68420
|
-
if (item.status === "pending") {
|
|
68421
|
-
item.status = "aborted";
|
|
68422
|
-
}
|
|
68423
|
-
});
|
|
68424
|
-
queue = [];
|
|
68425
|
-
}
|
|
68426
|
-
function subscribe(callback, overwrite) {
|
|
68427
|
-
if (overwrite) {
|
|
68428
|
-
doneCallbacks = [];
|
|
68429
|
-
}
|
|
68430
|
-
if (typeof callback === "function") {
|
|
68431
|
-
doneCallbacks.push(callback);
|
|
68432
|
-
}
|
|
68433
|
-
}
|
|
68434
|
-
function getQueryStatus() {
|
|
68435
|
-
return {
|
|
68436
|
-
startTime: startTime,
|
|
68437
|
-
payload: payload,
|
|
68438
|
-
status: status,
|
|
68439
|
-
queriesSent: queriesSent,
|
|
68440
|
-
queriesPending: queue.length,
|
|
68441
|
-
subscribe: subscribe,
|
|
68442
|
-
abort: abort
|
|
68443
|
-
};
|
|
68444
|
-
}
|
|
68445
|
-
function failQuery() {
|
|
68446
|
-
status = "failed";
|
|
68447
|
-
doneCallbacks.forEach(function(callback) {
|
|
68448
|
-
callback(void 0, lastError);
|
|
68449
|
-
});
|
|
68450
|
-
}
|
|
68451
|
-
function clearQueue() {
|
|
68452
|
-
queue.forEach(function(item) {
|
|
68453
|
-
if (item.status === "pending") {
|
|
68454
|
-
item.status = "aborted";
|
|
68455
|
-
}
|
|
68456
|
-
});
|
|
68457
|
-
queue = [];
|
|
68458
|
-
}
|
|
68459
|
-
function moduleResponse(item, response, data) {
|
|
68460
|
-
var isError = response !== "success";
|
|
68461
|
-
queue = queue.filter(function(queued) {
|
|
68462
|
-
return queued !== item;
|
|
68463
|
-
});
|
|
68464
|
-
switch(status){
|
|
68465
|
-
case "pending":
|
|
68466
|
-
break;
|
|
68467
|
-
case "failed":
|
|
68468
|
-
if (isError || !config.dataAfterTimeout) {
|
|
68469
|
-
return;
|
|
68470
|
-
}
|
|
68471
|
-
break;
|
|
68472
|
-
default:
|
|
68473
|
-
return;
|
|
68474
|
-
}
|
|
68475
|
-
if (response === "abort") {
|
|
68476
|
-
lastError = data;
|
|
68477
|
-
failQuery();
|
|
68478
|
-
return;
|
|
68479
|
-
}
|
|
68480
|
-
if (isError) {
|
|
68481
|
-
lastError = data;
|
|
68482
|
-
if (!queue.length) {
|
|
68483
|
-
if (!resources.length) {
|
|
68484
|
-
failQuery();
|
|
68485
|
-
} else {
|
|
68486
|
-
execNext();
|
|
68487
|
-
}
|
|
68488
|
-
}
|
|
68489
|
-
return;
|
|
68490
|
-
}
|
|
68491
|
-
resetTimer();
|
|
68492
|
-
clearQueue();
|
|
68493
|
-
if (!config.random) {
|
|
68494
|
-
var index = config.resources.indexOf(item.resource);
|
|
68495
|
-
if (index !== -1 && index !== config.index) {
|
|
68496
|
-
config.index = index;
|
|
68497
|
-
}
|
|
68498
|
-
}
|
|
68499
|
-
status = "completed";
|
|
68500
|
-
doneCallbacks.forEach(function(callback) {
|
|
68501
|
-
callback(data);
|
|
68502
|
-
});
|
|
68503
|
-
}
|
|
68504
|
-
function execNext() {
|
|
68505
|
-
if (status !== "pending") {
|
|
68506
|
-
return;
|
|
68507
|
-
}
|
|
68508
|
-
resetTimer();
|
|
68509
|
-
var resource = resources.shift();
|
|
68510
|
-
if (resource === void 0) {
|
|
68511
|
-
if (queue.length) {
|
|
68512
|
-
timer = setTimeout(function() {
|
|
68513
|
-
resetTimer();
|
|
68514
|
-
if (status === "pending") {
|
|
68515
|
-
clearQueue();
|
|
68516
|
-
failQuery();
|
|
68517
|
-
}
|
|
68518
|
-
}, config.timeout);
|
|
68519
|
-
return;
|
|
68520
|
-
}
|
|
68521
|
-
failQuery();
|
|
68522
|
-
return;
|
|
68523
|
-
}
|
|
68524
|
-
var item = {
|
|
68525
|
-
status: "pending",
|
|
68526
|
-
resource: resource,
|
|
68527
|
-
callback: function(status2, data) {
|
|
68528
|
-
moduleResponse(item, status2, data);
|
|
68529
|
-
}
|
|
68530
|
-
};
|
|
68531
|
-
queue.push(item);
|
|
68532
|
-
queriesSent++;
|
|
68533
|
-
timer = setTimeout(execNext, config.rotate);
|
|
68534
|
-
query(resource, payload, item.callback);
|
|
68535
|
-
}
|
|
68536
|
-
setTimeout(execNext);
|
|
68537
|
-
return getQueryStatus;
|
|
68538
|
-
}
|
|
68539
|
-
// src/index.ts
|
|
68540
|
-
function initRedundancy(cfg) {
|
|
68541
|
-
var config = _object_spread$5({}, defaultConfig, cfg);
|
|
68542
|
-
var queries = [];
|
|
68543
|
-
function cleanup() {
|
|
68544
|
-
queries = queries.filter(function(item) {
|
|
68545
|
-
return item().status === "pending";
|
|
68546
|
-
});
|
|
68547
|
-
}
|
|
68548
|
-
function query(payload, queryCallback, doneCallback) {
|
|
68549
|
-
var query2 = sendQuery(config, payload, queryCallback, function(data, error) {
|
|
68550
|
-
cleanup();
|
|
68551
|
-
if (doneCallback) {
|
|
68552
|
-
doneCallback(data, error);
|
|
68553
|
-
}
|
|
68554
|
-
});
|
|
68555
|
-
queries.push(query2);
|
|
68556
|
-
return query2;
|
|
68557
|
-
}
|
|
68558
|
-
function find(callback) {
|
|
68559
|
-
return queries.find(function(value) {
|
|
68560
|
-
return callback(value);
|
|
68561
|
-
}) || null;
|
|
68562
|
-
}
|
|
68563
|
-
var instance = {
|
|
68564
|
-
query: query,
|
|
68565
|
-
find: find,
|
|
68566
|
-
setIndex: function(index) {
|
|
68567
|
-
config.index = index;
|
|
68568
|
-
},
|
|
68569
|
-
getIndex: function() {
|
|
68570
|
-
return config.index;
|
|
68571
|
-
},
|
|
68572
|
-
cleanup: cleanup
|
|
68573
|
-
};
|
|
68574
|
-
return instance;
|
|
68575
|
-
}
|
|
68576
|
-
function emptyCallback$1() {}
|
|
68577
|
-
var redundancyCache = /* @__PURE__ */ Object.create(null);
|
|
68578
|
-
function getRedundancyCache(provider) {
|
|
68579
|
-
if (!redundancyCache[provider]) {
|
|
68580
|
-
var config = getAPIConfig(provider);
|
|
68581
|
-
if (!config) {
|
|
68582
|
-
return;
|
|
68583
|
-
}
|
|
68584
|
-
var redundancy = initRedundancy(config);
|
|
68585
|
-
var cachedReundancy = {
|
|
68586
|
-
config: config,
|
|
68587
|
-
redundancy: redundancy
|
|
68588
|
-
};
|
|
68589
|
-
redundancyCache[provider] = cachedReundancy;
|
|
68590
|
-
}
|
|
68591
|
-
return redundancyCache[provider];
|
|
68592
|
-
}
|
|
68593
|
-
function sendAPIQuery(target, query, callback) {
|
|
68594
|
-
var redundancy;
|
|
68595
|
-
var send;
|
|
68596
|
-
if (typeof target === "string") {
|
|
68597
|
-
var api = getAPIModule(target);
|
|
68598
|
-
if (!api) {
|
|
68599
|
-
callback(void 0, 424);
|
|
68600
|
-
return emptyCallback$1;
|
|
68601
|
-
}
|
|
68602
|
-
send = api.send;
|
|
68603
|
-
var cached = getRedundancyCache(target);
|
|
68604
|
-
if (cached) {
|
|
68605
|
-
redundancy = cached.redundancy;
|
|
68606
|
-
}
|
|
68607
|
-
} else {
|
|
68608
|
-
var config = createAPIConfig(target);
|
|
68609
|
-
if (config) {
|
|
68610
|
-
redundancy = initRedundancy(config);
|
|
68611
|
-
var moduleKey = target.resources ? target.resources[0] : "";
|
|
68612
|
-
var api1 = getAPIModule(moduleKey);
|
|
68613
|
-
if (api1) {
|
|
68614
|
-
send = api1.send;
|
|
68615
|
-
}
|
|
68616
|
-
}
|
|
68617
|
-
}
|
|
68618
|
-
if (!redundancy || !send) {
|
|
68619
|
-
callback(void 0, 424);
|
|
68620
|
-
return emptyCallback$1;
|
|
68621
|
-
}
|
|
68622
|
-
return redundancy.query(query, send, callback)().abort;
|
|
68623
|
-
}
|
|
68624
|
-
var browserCacheVersion = "iconify2";
|
|
68625
|
-
var browserCachePrefix = "iconify";
|
|
68626
|
-
var browserCacheCountKey = browserCachePrefix + "-count";
|
|
68627
|
-
var browserCacheVersionKey = browserCachePrefix + "-version";
|
|
68628
|
-
var browserStorageHour = 36e5;
|
|
68629
|
-
var browserStorageCacheExpiration = 168;
|
|
68630
|
-
function getStoredItem(func, key) {
|
|
68631
|
-
try {
|
|
68632
|
-
return func.getItem(key);
|
|
68633
|
-
} catch (err) {}
|
|
68634
|
-
}
|
|
68635
|
-
function setStoredItem(func, key, value) {
|
|
68636
|
-
try {
|
|
68637
|
-
func.setItem(key, value);
|
|
68638
|
-
return true;
|
|
68639
|
-
} catch (err) {}
|
|
68640
|
-
}
|
|
68641
|
-
function removeStoredItem(func, key) {
|
|
68642
|
-
try {
|
|
68643
|
-
func.removeItem(key);
|
|
68644
|
-
} catch (err) {}
|
|
68645
|
-
}
|
|
68646
|
-
function setBrowserStorageItemsCount(storage, value) {
|
|
68647
|
-
return setStoredItem(storage, browserCacheCountKey, value.toString());
|
|
68648
|
-
}
|
|
68649
|
-
function getBrowserStorageItemsCount(storage) {
|
|
68650
|
-
return parseInt(getStoredItem(storage, browserCacheCountKey)) || 0;
|
|
68651
|
-
}
|
|
68652
|
-
var browserStorageConfig = {
|
|
68653
|
-
local: true,
|
|
68654
|
-
session: true
|
|
68655
|
-
};
|
|
68656
|
-
var browserStorageEmptyItems = {
|
|
68657
|
-
local: /* @__PURE__ */ new Set(),
|
|
68658
|
-
session: /* @__PURE__ */ new Set()
|
|
68659
|
-
};
|
|
68660
|
-
var browserStorageStatus = false;
|
|
68661
|
-
function setBrowserStorageStatus(status) {
|
|
68662
|
-
browserStorageStatus = status;
|
|
68663
|
-
}
|
|
68664
|
-
var _window = typeof window === "undefined" ? {} : window;
|
|
68665
|
-
function getBrowserStorage(key) {
|
|
68666
|
-
var attr = key + "Storage";
|
|
68667
|
-
try {
|
|
68668
|
-
if (_window && _window[attr] && typeof _window[attr].length === "number") {
|
|
68669
|
-
return _window[attr];
|
|
68670
|
-
}
|
|
68671
|
-
} catch (err) {}
|
|
68672
|
-
browserStorageConfig[key] = false;
|
|
68673
|
-
}
|
|
68674
|
-
function iterateBrowserStorage(key, callback) {
|
|
68675
|
-
var func = getBrowserStorage(key);
|
|
68676
|
-
if (!func) {
|
|
68677
|
-
return;
|
|
68678
|
-
}
|
|
68679
|
-
var version = getStoredItem(func, browserCacheVersionKey);
|
|
68680
|
-
if (version !== browserCacheVersion) {
|
|
68681
|
-
if (version) {
|
|
68682
|
-
var total2 = getBrowserStorageItemsCount(func);
|
|
68683
|
-
for(var i = 0; i < total2; i++){
|
|
68684
|
-
removeStoredItem(func, browserCachePrefix + i.toString());
|
|
68685
|
-
}
|
|
68686
|
-
}
|
|
68687
|
-
setStoredItem(func, browserCacheVersionKey, browserCacheVersion);
|
|
68688
|
-
setBrowserStorageItemsCount(func, 0);
|
|
68689
|
-
return;
|
|
68690
|
-
}
|
|
68691
|
-
var minTime = Math.floor(Date.now() / browserStorageHour) - browserStorageCacheExpiration;
|
|
68692
|
-
var parseItem = function(index) {
|
|
68693
|
-
var name = browserCachePrefix + index.toString();
|
|
68694
|
-
var item = getStoredItem(func, name);
|
|
68695
|
-
if (typeof item !== "string") {
|
|
68696
|
-
return;
|
|
68697
|
-
}
|
|
68698
|
-
try {
|
|
68699
|
-
var data = JSON.parse(item);
|
|
68700
|
-
if (typeof data === "object" && typeof data.cached === "number" && data.cached > minTime && typeof data.provider === "string" && typeof data.data === "object" && typeof data.data.prefix === "string" && // Valid item: run callback
|
|
68701
|
-
callback(data, index)) {
|
|
68702
|
-
return true;
|
|
68703
|
-
}
|
|
68704
|
-
} catch (err) {}
|
|
68705
|
-
removeStoredItem(func, name);
|
|
68706
|
-
};
|
|
68707
|
-
var total = getBrowserStorageItemsCount(func);
|
|
68708
|
-
for(var i1 = total - 1; i1 >= 0; i1--){
|
|
68709
|
-
if (!parseItem(i1)) {
|
|
68710
|
-
if (i1 === total - 1) {
|
|
68711
|
-
total--;
|
|
68712
|
-
setBrowserStorageItemsCount(func, total);
|
|
68713
|
-
} else {
|
|
68714
|
-
browserStorageEmptyItems[key].add(i1);
|
|
68715
|
-
}
|
|
68716
|
-
}
|
|
68717
|
-
}
|
|
68718
|
-
}
|
|
68719
|
-
function initBrowserStorage() {
|
|
68720
|
-
if (browserStorageStatus) {
|
|
68721
|
-
return;
|
|
68722
|
-
}
|
|
68723
|
-
setBrowserStorageStatus(true);
|
|
68724
|
-
for(var key in browserStorageConfig){
|
|
68725
|
-
iterateBrowserStorage(key, function(item) {
|
|
68726
|
-
var iconSet = item.data;
|
|
68727
|
-
var provider = item.provider;
|
|
68728
|
-
var prefix = iconSet.prefix;
|
|
68729
|
-
var storage = getStorage(provider, prefix);
|
|
68730
|
-
if (!addIconSet(storage, iconSet).length) {
|
|
68731
|
-
return false;
|
|
68732
|
-
}
|
|
68733
|
-
var lastModified = iconSet.lastModified || -1;
|
|
68734
|
-
storage.lastModifiedCached = storage.lastModifiedCached ? Math.min(storage.lastModifiedCached, lastModified) : lastModified;
|
|
68735
|
-
return true;
|
|
68736
|
-
});
|
|
68737
|
-
}
|
|
68738
|
-
}
|
|
68739
|
-
function updateLastModified(storage, lastModified) {
|
|
68740
|
-
var lastValue = storage.lastModifiedCached;
|
|
68741
|
-
if (// Matches or newer
|
|
68742
|
-
lastValue && lastValue >= lastModified) {
|
|
68743
|
-
return lastValue === lastModified;
|
|
68744
|
-
}
|
|
68745
|
-
storage.lastModifiedCached = lastModified;
|
|
68746
|
-
if (lastValue) {
|
|
68747
|
-
for(var key in browserStorageConfig){
|
|
68748
|
-
iterateBrowserStorage(key, function(item) {
|
|
68749
|
-
var iconSet = item.data;
|
|
68750
|
-
return item.provider !== storage.provider || iconSet.prefix !== storage.prefix || iconSet.lastModified === lastModified;
|
|
68751
|
-
});
|
|
68752
|
-
}
|
|
68753
|
-
}
|
|
68754
|
-
return true;
|
|
68755
|
-
}
|
|
68756
|
-
function storeInBrowserStorage(storage, data) {
|
|
68757
|
-
if (!browserStorageStatus) {
|
|
68758
|
-
initBrowserStorage();
|
|
68759
|
-
}
|
|
68760
|
-
function store(key) {
|
|
68761
|
-
var func;
|
|
68762
|
-
if (!browserStorageConfig[key] || !(func = getBrowserStorage(key))) {
|
|
68763
|
-
return;
|
|
68764
|
-
}
|
|
68765
|
-
var set = browserStorageEmptyItems[key];
|
|
68766
|
-
var index;
|
|
68767
|
-
if (set.size) {
|
|
68768
|
-
set.delete(index = Array.from(set).shift());
|
|
68769
|
-
} else {
|
|
68770
|
-
index = getBrowserStorageItemsCount(func);
|
|
68771
|
-
if (!setBrowserStorageItemsCount(func, index + 1)) {
|
|
68772
|
-
return;
|
|
68773
|
-
}
|
|
68774
|
-
}
|
|
68775
|
-
var item = {
|
|
68776
|
-
cached: Math.floor(Date.now() / browserStorageHour),
|
|
68777
|
-
provider: storage.provider,
|
|
68778
|
-
data: data
|
|
68779
|
-
};
|
|
68780
|
-
return setStoredItem(func, browserCachePrefix + index.toString(), JSON.stringify(item));
|
|
68781
|
-
}
|
|
68782
|
-
if (data.lastModified && !updateLastModified(storage, data.lastModified)) {
|
|
68783
|
-
return;
|
|
68784
|
-
}
|
|
68785
|
-
if (!Object.keys(data.icons).length) {
|
|
68786
|
-
return;
|
|
68787
|
-
}
|
|
68788
|
-
if (data.not_found) {
|
|
68789
|
-
data = Object.assign({}, data);
|
|
68790
|
-
delete data.not_found;
|
|
68791
|
-
}
|
|
68792
|
-
if (!store("local")) {
|
|
68793
|
-
store("session");
|
|
68794
|
-
}
|
|
68795
|
-
}
|
|
68796
|
-
function emptyCallback() {}
|
|
68797
|
-
function loadedNewIcons(storage) {
|
|
68798
|
-
if (!storage.iconsLoaderFlag) {
|
|
68799
|
-
storage.iconsLoaderFlag = true;
|
|
68800
|
-
setTimeout(function() {
|
|
68801
|
-
storage.iconsLoaderFlag = false;
|
|
68802
|
-
updateCallbacks(storage);
|
|
68803
|
-
});
|
|
68804
|
-
}
|
|
68805
|
-
}
|
|
68806
|
-
function loadNewIcons(storage, icons) {
|
|
68807
|
-
if (!storage.iconsToLoad) {
|
|
68808
|
-
storage.iconsToLoad = icons;
|
|
68809
|
-
} else {
|
|
68810
|
-
storage.iconsToLoad = storage.iconsToLoad.concat(icons).sort();
|
|
68811
|
-
}
|
|
68812
|
-
if (!storage.iconsQueueFlag) {
|
|
68813
|
-
storage.iconsQueueFlag = true;
|
|
68814
|
-
setTimeout(function() {
|
|
68815
|
-
storage.iconsQueueFlag = false;
|
|
68816
|
-
var provider = storage.provider, prefix = storage.prefix;
|
|
68817
|
-
var icons2 = storage.iconsToLoad;
|
|
68818
|
-
delete storage.iconsToLoad;
|
|
68819
|
-
var api;
|
|
68820
|
-
if (!icons2 || !(api = getAPIModule(provider))) {
|
|
68821
|
-
return;
|
|
68822
|
-
}
|
|
68823
|
-
var params = api.prepare(provider, prefix, icons2);
|
|
68824
|
-
params.forEach(function(item) {
|
|
68825
|
-
sendAPIQuery(provider, item, function(data) {
|
|
68826
|
-
if (typeof data !== "object") {
|
|
68827
|
-
item.icons.forEach(function(name) {
|
|
68828
|
-
storage.missing.add(name);
|
|
68829
|
-
});
|
|
68830
|
-
} else {
|
|
68831
|
-
try {
|
|
68832
|
-
var parsed = addIconSet(storage, data);
|
|
68833
|
-
if (!parsed.length) {
|
|
68834
|
-
return;
|
|
68835
|
-
}
|
|
68836
|
-
var pending = storage.pendingIcons;
|
|
68837
|
-
if (pending) {
|
|
68838
|
-
parsed.forEach(function(name) {
|
|
68839
|
-
pending.delete(name);
|
|
68840
|
-
});
|
|
68841
|
-
}
|
|
68842
|
-
storeInBrowserStorage(storage, data);
|
|
68843
|
-
} catch (err) {
|
|
68844
|
-
console.error(err);
|
|
68845
|
-
}
|
|
68846
|
-
}
|
|
68847
|
-
loadedNewIcons(storage);
|
|
68848
|
-
});
|
|
68849
|
-
});
|
|
68850
|
-
});
|
|
68851
|
-
}
|
|
68852
|
-
}
|
|
68853
|
-
var loadIcons = function(icons, callback) {
|
|
68854
|
-
var cleanedIcons = listToIcons(icons, true, allowSimpleNames());
|
|
68855
|
-
var sortedIcons = sortIcons(cleanedIcons);
|
|
68856
|
-
if (!sortedIcons.pending.length) {
|
|
68857
|
-
var callCallback = true;
|
|
68858
|
-
if (callback) {
|
|
68859
|
-
setTimeout(function() {
|
|
68860
|
-
if (callCallback) {
|
|
68861
|
-
callback(sortedIcons.loaded, sortedIcons.missing, sortedIcons.pending, emptyCallback);
|
|
68862
|
-
}
|
|
68863
|
-
});
|
|
68864
|
-
}
|
|
68865
|
-
return function() {
|
|
68866
|
-
callCallback = false;
|
|
68867
|
-
};
|
|
68868
|
-
}
|
|
68869
|
-
var newIcons = /* @__PURE__ */ Object.create(null);
|
|
68870
|
-
var sources = [];
|
|
68871
|
-
var lastProvider, lastPrefix;
|
|
68872
|
-
sortedIcons.pending.forEach(function(icon) {
|
|
68873
|
-
var provider = icon.provider, prefix = icon.prefix;
|
|
68874
|
-
if (prefix === lastPrefix && provider === lastProvider) {
|
|
68875
|
-
return;
|
|
68876
|
-
}
|
|
68877
|
-
lastProvider = provider;
|
|
68878
|
-
lastPrefix = prefix;
|
|
68879
|
-
sources.push(getStorage(provider, prefix));
|
|
68880
|
-
var providerNewIcons = newIcons[provider] || (newIcons[provider] = /* @__PURE__ */ Object.create(null));
|
|
68881
|
-
if (!providerNewIcons[prefix]) {
|
|
68882
|
-
providerNewIcons[prefix] = [];
|
|
68883
|
-
}
|
|
68884
|
-
});
|
|
68885
|
-
sortedIcons.pending.forEach(function(icon) {
|
|
68886
|
-
var provider = icon.provider, prefix = icon.prefix, name = icon.name;
|
|
68887
|
-
var storage = getStorage(provider, prefix);
|
|
68888
|
-
var pendingQueue = storage.pendingIcons || (storage.pendingIcons = /* @__PURE__ */ new Set());
|
|
68889
|
-
if (!pendingQueue.has(name)) {
|
|
68890
|
-
pendingQueue.add(name);
|
|
68891
|
-
newIcons[provider][prefix].push(name);
|
|
68892
|
-
}
|
|
68893
|
-
});
|
|
68894
|
-
sources.forEach(function(storage) {
|
|
68895
|
-
var provider = storage.provider, prefix = storage.prefix;
|
|
68896
|
-
if (newIcons[provider][prefix].length) {
|
|
68897
|
-
loadNewIcons(storage, newIcons[provider][prefix]);
|
|
68898
|
-
}
|
|
68899
|
-
});
|
|
68900
|
-
return callback ? storeCallback(callback, sortedIcons, sources) : emptyCallback;
|
|
68901
|
-
};
|
|
68902
|
-
function mergeCustomisations(defaults, item) {
|
|
68903
|
-
var result = _object_spread$5({}, defaults);
|
|
68904
|
-
for(var key in item){
|
|
68905
|
-
var value = item[key];
|
|
68906
|
-
var valueType = typeof value === "undefined" ? "undefined" : _type_of(value);
|
|
68907
|
-
if (key in defaultIconSizeCustomisations) {
|
|
68908
|
-
if (value === null || value && (valueType === "string" || valueType === "number")) {
|
|
68909
|
-
result[key] = value;
|
|
68910
|
-
}
|
|
68911
|
-
} else if (valueType === _type_of(result[key])) {
|
|
68912
|
-
result[key] = key === "rotate" ? value % 4 : value;
|
|
68913
|
-
}
|
|
68914
|
-
}
|
|
68915
|
-
return result;
|
|
68916
|
-
}
|
|
68917
|
-
var separator = /[\s,]+/;
|
|
68918
|
-
function flipFromString(custom, flip) {
|
|
68919
|
-
flip.split(separator).forEach(function(str) {
|
|
68920
|
-
var value = str.trim();
|
|
68921
|
-
switch(value){
|
|
68922
|
-
case "horizontal":
|
|
68923
|
-
custom.hFlip = true;
|
|
68924
|
-
break;
|
|
68925
|
-
case "vertical":
|
|
68926
|
-
custom.vFlip = true;
|
|
68927
|
-
break;
|
|
68928
|
-
}
|
|
68929
|
-
});
|
|
68930
|
-
}
|
|
68931
|
-
function rotateFromString(value) {
|
|
68932
|
-
var defaultValue = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
68933
|
-
var units = value.replace(/^-?[0-9.]*/, "");
|
|
68934
|
-
function cleanup(value2) {
|
|
68935
|
-
while(value2 < 0){
|
|
68936
|
-
value2 += 4;
|
|
68937
|
-
}
|
|
68938
|
-
return value2 % 4;
|
|
68939
|
-
}
|
|
68940
|
-
if (units === "") {
|
|
68941
|
-
var num = parseInt(value);
|
|
68942
|
-
return isNaN(num) ? 0 : cleanup(num);
|
|
68943
|
-
} else if (units !== value) {
|
|
68944
|
-
var split = 0;
|
|
68945
|
-
switch(units){
|
|
68946
|
-
case "%":
|
|
68947
|
-
split = 25;
|
|
68948
|
-
break;
|
|
68949
|
-
case "deg":
|
|
68950
|
-
split = 90;
|
|
68951
|
-
}
|
|
68952
|
-
if (split) {
|
|
68953
|
-
var num1 = parseFloat(value.slice(0, value.length - units.length));
|
|
68954
|
-
if (isNaN(num1)) {
|
|
68955
|
-
return 0;
|
|
68956
|
-
}
|
|
68957
|
-
num1 = num1 / split;
|
|
68958
|
-
return num1 % 1 === 0 ? cleanup(num1) : 0;
|
|
68959
|
-
}
|
|
68960
|
-
}
|
|
68961
|
-
return defaultValue;
|
|
68962
|
-
}
|
|
68963
|
-
function iconToHTML(body, attributes) {
|
|
68964
|
-
var renderAttribsHTML = body.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
|
|
68965
|
-
for(var attr in attributes){
|
|
68966
|
-
renderAttribsHTML += " " + attr + '="' + attributes[attr] + '"';
|
|
68967
|
-
}
|
|
68968
|
-
return '<svg xmlns="http://www.w3.org/2000/svg"' + renderAttribsHTML + ">" + body + "</svg>";
|
|
68969
|
-
}
|
|
68970
|
-
function encodeSVGforURL(svg) {
|
|
68971
|
-
return svg.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
68972
|
-
}
|
|
68973
|
-
function svgToData(svg) {
|
|
68974
|
-
return "data:image/svg+xml," + encodeSVGforURL(svg);
|
|
68975
|
-
}
|
|
68976
|
-
function svgToURL(svg) {
|
|
68977
|
-
return 'url("' + svgToData(svg) + '")';
|
|
68978
|
-
}
|
|
68979
|
-
var policy;
|
|
68980
|
-
function createPolicy() {
|
|
68981
|
-
try {
|
|
68982
|
-
policy = window.trustedTypes.createPolicy("iconify", {
|
|
68983
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
68984
|
-
createHTML: function(s) {
|
|
68985
|
-
return s;
|
|
68986
|
-
}
|
|
68987
|
-
});
|
|
68988
|
-
} catch (err) {
|
|
68989
|
-
policy = null;
|
|
68990
|
-
}
|
|
68991
|
-
}
|
|
68992
|
-
function cleanUpInnerHTML(html) {
|
|
68993
|
-
if (policy === void 0) {
|
|
68994
|
-
createPolicy();
|
|
68995
|
-
}
|
|
68996
|
-
return policy ? policy.createHTML(html) : html;
|
|
68997
|
-
}
|
|
68998
|
-
var defaultExtendedIconCustomisations = _object_spread_props$3(_object_spread$5({}, defaultIconCustomisations), {
|
|
68999
|
-
inline: false
|
|
69000
|
-
});
|
|
69001
|
-
/**
|
|
69002
|
-
* Default SVG attributes
|
|
69003
|
-
*/ var svgDefaults = {
|
|
69004
|
-
"xmlns": "http://www.w3.org/2000/svg",
|
|
69005
|
-
"xmlnsXlink": "http://www.w3.org/1999/xlink",
|
|
69006
|
-
"aria-hidden": true,
|
|
69007
|
-
"role": "img"
|
|
69008
|
-
};
|
|
69009
|
-
/**
|
|
69010
|
-
* Style modes
|
|
69011
|
-
*/ var commonProps = {
|
|
69012
|
-
display: "inline-block"
|
|
69013
|
-
};
|
|
69014
|
-
var monotoneProps = {
|
|
69015
|
-
backgroundColor: "currentColor"
|
|
69016
|
-
};
|
|
69017
|
-
var coloredProps = {
|
|
69018
|
-
backgroundColor: "transparent"
|
|
69019
|
-
};
|
|
69020
|
-
// Dynamically add common props to variables above
|
|
69021
|
-
var propsToAdd = {
|
|
69022
|
-
Image: "var(--svg)",
|
|
69023
|
-
Repeat: "no-repeat",
|
|
69024
|
-
Size: "100% 100%"
|
|
69025
|
-
};
|
|
69026
|
-
var propsToAddTo = {
|
|
69027
|
-
WebkitMask: monotoneProps,
|
|
69028
|
-
mask: monotoneProps,
|
|
69029
|
-
background: coloredProps
|
|
69030
|
-
};
|
|
69031
|
-
for(var prefix in propsToAddTo){
|
|
69032
|
-
var list = propsToAddTo[prefix];
|
|
69033
|
-
for(var prop in propsToAdd){
|
|
69034
|
-
list[prefix + prop] = propsToAdd[prop];
|
|
69035
|
-
}
|
|
69036
|
-
}
|
|
69037
|
-
/**
|
|
69038
|
-
* Default values for customisations for inline icon
|
|
69039
|
-
*/ var inlineDefaults = _object_spread_props$3(_object_spread$5({}, defaultExtendedIconCustomisations), {
|
|
69040
|
-
inline: true
|
|
69041
|
-
});
|
|
69042
|
-
/**
|
|
69043
|
-
* Fix size: add 'px' to numbers
|
|
69044
|
-
*/ function fixSize(value) {
|
|
69045
|
-
return value + (value.match(/^[-0-9.]+$/) ? "px" : "");
|
|
69046
|
-
}
|
|
69047
|
-
/**
|
|
69048
|
-
* Render icon
|
|
69049
|
-
*/ var render = function(// Icon must be validated before calling this function
|
|
69050
|
-
icon, // Partial properties
|
|
69051
|
-
props, // True if icon should have vertical-align added
|
|
69052
|
-
inline, // Optional reference for SVG/SPAN, extracted by React.forwardRef()
|
|
69053
|
-
ref) {
|
|
69054
|
-
// Get default properties
|
|
69055
|
-
var defaultProps = inline ? inlineDefaults : defaultExtendedIconCustomisations;
|
|
69056
|
-
// Get all customisations
|
|
69057
|
-
var customisations = mergeCustomisations(defaultProps, props);
|
|
69058
|
-
// Check mode
|
|
69059
|
-
var mode = props.mode || "svg";
|
|
69060
|
-
// Create style
|
|
69061
|
-
var style = {};
|
|
69062
|
-
var customStyle = props.style || {};
|
|
69063
|
-
// Create SVG component properties
|
|
69064
|
-
var componentProps = _object_spread_props$3(_object_spread$5({}, mode === "svg" ? svgDefaults : {}), {
|
|
69065
|
-
ref: ref
|
|
69066
|
-
});
|
|
69067
|
-
// Get element properties
|
|
69068
|
-
for(var key in props){
|
|
69069
|
-
var value = props[key];
|
|
69070
|
-
if (value === void 0) {
|
|
69071
|
-
continue;
|
|
69072
|
-
}
|
|
69073
|
-
switch(key){
|
|
69074
|
-
// Properties to ignore
|
|
69075
|
-
case "icon":
|
|
69076
|
-
case "style":
|
|
69077
|
-
case "children":
|
|
69078
|
-
case "onLoad":
|
|
69079
|
-
case "mode":
|
|
69080
|
-
case "_ref":
|
|
69081
|
-
case "_inline":
|
|
69082
|
-
break;
|
|
69083
|
-
// Boolean attributes
|
|
69084
|
-
case "inline":
|
|
69085
|
-
case "hFlip":
|
|
69086
|
-
case "vFlip":
|
|
69087
|
-
customisations[key] = value === true || value === "true" || value === 1;
|
|
69088
|
-
break;
|
|
69089
|
-
// Flip as string: 'horizontal,vertical'
|
|
69090
|
-
case "flip":
|
|
69091
|
-
if (typeof value === "string") {
|
|
69092
|
-
flipFromString(customisations, value);
|
|
69093
|
-
}
|
|
69094
|
-
break;
|
|
69095
|
-
// Color: copy to style
|
|
69096
|
-
case "color":
|
|
69097
|
-
style.color = value;
|
|
69098
|
-
break;
|
|
69099
|
-
// Rotation as string
|
|
69100
|
-
case "rotate":
|
|
69101
|
-
if (typeof value === "string") {
|
|
69102
|
-
customisations[key] = rotateFromString(value);
|
|
69103
|
-
} else if (typeof value === "number") {
|
|
69104
|
-
customisations[key] = value;
|
|
69105
|
-
}
|
|
69106
|
-
break;
|
|
69107
|
-
// Remove aria-hidden
|
|
69108
|
-
case "ariaHidden":
|
|
69109
|
-
case "aria-hidden":
|
|
69110
|
-
if (value !== true && value !== "true") {
|
|
69111
|
-
delete componentProps["aria-hidden"];
|
|
69112
|
-
}
|
|
69113
|
-
break;
|
|
69114
|
-
// Copy missing property if it does not exist in customisations
|
|
69115
|
-
default:
|
|
69116
|
-
if (defaultProps[key] === void 0) {
|
|
69117
|
-
componentProps[key] = value;
|
|
69118
|
-
}
|
|
69119
|
-
}
|
|
69120
|
-
}
|
|
69121
|
-
// Generate icon
|
|
69122
|
-
var item = iconToSVG(icon, customisations);
|
|
69123
|
-
var renderAttribs = item.attributes;
|
|
69124
|
-
// Inline display
|
|
69125
|
-
if (customisations.inline) {
|
|
69126
|
-
style.verticalAlign = "-0.125em";
|
|
69127
|
-
}
|
|
69128
|
-
if (mode === "svg") {
|
|
69129
|
-
// Add style
|
|
69130
|
-
componentProps.style = _object_spread$5({}, style, customStyle);
|
|
69131
|
-
// Add icon stuff
|
|
69132
|
-
Object.assign(componentProps, renderAttribs);
|
|
69133
|
-
// Counter for ids based on "id" property to render icons consistently on server and client
|
|
69134
|
-
var localCounter = 0;
|
|
69135
|
-
var id = props.id;
|
|
69136
|
-
if (typeof id === "string") {
|
|
69137
|
-
// Convert '-' to '_' to avoid errors in animations
|
|
69138
|
-
id = id.replace(/-/g, "_");
|
|
69139
|
-
}
|
|
69140
|
-
// Add icon stuff
|
|
69141
|
-
componentProps.dangerouslySetInnerHTML = {
|
|
69142
|
-
__html: cleanUpInnerHTML(replaceIDs(item.body, id ? function() {
|
|
69143
|
-
return id + "ID" + localCounter++;
|
|
69144
|
-
} : "iconifyReact"))
|
|
69145
|
-
};
|
|
69146
|
-
return React__default.createElement("svg", componentProps);
|
|
69147
|
-
}
|
|
69148
|
-
// Render <span> with style
|
|
69149
|
-
var body = icon.body, width = icon.width, height = icon.height;
|
|
69150
|
-
var useMask = mode === "mask" || (mode === "bg" ? false : body.indexOf("currentColor") !== -1);
|
|
69151
|
-
// Generate SVG
|
|
69152
|
-
var html = iconToHTML(body, _object_spread_props$3(_object_spread$5({}, renderAttribs), {
|
|
69153
|
-
width: width + "",
|
|
69154
|
-
height: height + ""
|
|
69155
|
-
}));
|
|
69156
|
-
// Generate style
|
|
69157
|
-
componentProps.style = _object_spread$5(_object_spread_props$3(_object_spread$5({}, style), {
|
|
69158
|
-
"--svg": svgToURL(html),
|
|
69159
|
-
"width": fixSize(renderAttribs.width),
|
|
69160
|
-
"height": fixSize(renderAttribs.height)
|
|
69161
|
-
}), commonProps, useMask ? monotoneProps : coloredProps, customStyle);
|
|
69162
|
-
return React__default.createElement("span", componentProps);
|
|
69163
|
-
};
|
|
69164
|
-
/**
|
|
69165
|
-
* Initialise stuff
|
|
69166
|
-
*/ // Enable short names
|
|
69167
|
-
allowSimpleNames(true);
|
|
69168
|
-
// Set API module
|
|
69169
|
-
setAPIModule("", fetchAPIModule);
|
|
69170
|
-
/**
|
|
69171
|
-
* Browser stuff
|
|
69172
|
-
*/ if (typeof document !== "undefined" && typeof window !== "undefined") {
|
|
69173
|
-
// Set cache and load existing cache
|
|
69174
|
-
initBrowserStorage();
|
|
69175
|
-
var _window1 = window;
|
|
69176
|
-
// Load icons from global "IconifyPreload"
|
|
69177
|
-
if (_window1.IconifyPreload !== void 0) {
|
|
69178
|
-
var preload = _window1.IconifyPreload;
|
|
69179
|
-
var err = "Invalid IconifyPreload syntax.";
|
|
69180
|
-
if (typeof preload === "object" && preload !== null) {
|
|
69181
|
-
(_instanceof(preload, Array) ? preload : [
|
|
69182
|
-
preload
|
|
69183
|
-
]).forEach(function(item) {
|
|
69184
|
-
try {
|
|
69185
|
-
if (// Check if item is an object and not null/array
|
|
69186
|
-
typeof item !== "object" || item === null || _instanceof(item, Array) || // Check for 'icons' and 'prefix'
|
|
69187
|
-
typeof item.icons !== "object" || typeof item.prefix !== "string" || // Add icon set
|
|
69188
|
-
!addCollection(item)) {
|
|
69189
|
-
console.error(err);
|
|
69190
|
-
}
|
|
69191
|
-
} catch (e) {
|
|
69192
|
-
console.error(err);
|
|
69193
|
-
}
|
|
69194
|
-
});
|
|
69195
|
-
}
|
|
69196
|
-
}
|
|
69197
|
-
// Set API from global "IconifyProviders"
|
|
69198
|
-
if (_window1.IconifyProviders !== void 0) {
|
|
69199
|
-
var providers = _window1.IconifyProviders;
|
|
69200
|
-
if (typeof providers === "object" && providers !== null) {
|
|
69201
|
-
for(var key in providers){
|
|
69202
|
-
var err1 = "IconifyProviders[" + key + "] is invalid.";
|
|
69203
|
-
try {
|
|
69204
|
-
var value = providers[key];
|
|
69205
|
-
if (typeof value !== "object" || !value || value.resources === void 0) {
|
|
69206
|
-
continue;
|
|
69207
|
-
}
|
|
69208
|
-
if (!addAPIProvider(key, value)) {
|
|
69209
|
-
console.error(err1);
|
|
69210
|
-
}
|
|
69211
|
-
} catch (e) {
|
|
69212
|
-
console.error(err1);
|
|
69213
|
-
}
|
|
69214
|
-
}
|
|
69215
|
-
}
|
|
69216
|
-
}
|
|
69217
|
-
}
|
|
69218
|
-
var IconComponent = /*#__PURE__*/ function(_React_Component) {
|
|
69219
|
-
_inherits(IconComponent, _React_Component);
|
|
69220
|
-
var _super = _create_super(IconComponent);
|
|
69221
|
-
function IconComponent(props) {
|
|
69222
|
-
_class_call_check(this, IconComponent);
|
|
69223
|
-
var _this;
|
|
69224
|
-
_this = _super.call(this, props);
|
|
69225
|
-
_this.state = {
|
|
69226
|
-
// Render placeholder before component is mounted
|
|
69227
|
-
icon: null
|
|
69228
|
-
};
|
|
69229
|
-
return _this;
|
|
69230
|
-
}
|
|
69231
|
-
_create_class(IconComponent, [
|
|
69232
|
-
{
|
|
69233
|
-
/**
|
|
69234
|
-
* Abort loading icon
|
|
69235
|
-
*/ key: "_abortLoading",
|
|
69236
|
-
value: function _abortLoading() {
|
|
69237
|
-
if (this._loading) {
|
|
69238
|
-
this._loading.abort();
|
|
69239
|
-
this._loading = null;
|
|
69240
|
-
}
|
|
69241
|
-
}
|
|
69242
|
-
},
|
|
69243
|
-
{
|
|
69244
|
-
/**
|
|
69245
|
-
* Update state
|
|
69246
|
-
*/ key: "_setData",
|
|
69247
|
-
value: function _setData(icon) {
|
|
69248
|
-
if (this.state.icon !== icon) {
|
|
69249
|
-
this.setState({
|
|
69250
|
-
icon: icon
|
|
69251
|
-
});
|
|
69252
|
-
}
|
|
69253
|
-
}
|
|
69254
|
-
},
|
|
69255
|
-
{
|
|
69256
|
-
/**
|
|
69257
|
-
* Check if icon should be loaded
|
|
69258
|
-
*/ key: "_checkIcon",
|
|
69259
|
-
value: function _checkIcon(changed) {
|
|
69260
|
-
var state = this.state;
|
|
69261
|
-
var icon = this.props.icon;
|
|
69262
|
-
// Icon is an object
|
|
69263
|
-
if (typeof icon === "object" && icon !== null && typeof icon.body === "string") {
|
|
69264
|
-
// Stop loading
|
|
69265
|
-
this._icon = "";
|
|
69266
|
-
this._abortLoading();
|
|
69267
|
-
if (changed || state.icon === null) {
|
|
69268
|
-
// Set data if it was changed
|
|
69269
|
-
this._setData({
|
|
69270
|
-
data: icon
|
|
69271
|
-
});
|
|
69272
|
-
}
|
|
69273
|
-
return;
|
|
69274
|
-
}
|
|
69275
|
-
// Invalid icon?
|
|
69276
|
-
var iconName;
|
|
69277
|
-
if (typeof icon !== "string" || (iconName = stringToIcon(icon, false, true)) === null) {
|
|
69278
|
-
this._abortLoading();
|
|
69279
|
-
this._setData(null);
|
|
69280
|
-
return;
|
|
69281
|
-
}
|
|
69282
|
-
// Load icon
|
|
69283
|
-
var data = getIconData(iconName);
|
|
69284
|
-
if (!data) {
|
|
69285
|
-
// Icon data is not available
|
|
69286
|
-
if (!this._loading || this._loading.name !== icon) {
|
|
69287
|
-
// New icon to load
|
|
69288
|
-
this._abortLoading();
|
|
69289
|
-
this._icon = "";
|
|
69290
|
-
this._setData(null);
|
|
69291
|
-
if (data !== null) {
|
|
69292
|
-
// Icon was not loaded
|
|
69293
|
-
this._loading = {
|
|
69294
|
-
name: icon,
|
|
69295
|
-
abort: loadIcons([
|
|
69296
|
-
iconName
|
|
69297
|
-
], this._checkIcon.bind(this, false))
|
|
69298
|
-
};
|
|
69299
|
-
}
|
|
69300
|
-
}
|
|
69301
|
-
return;
|
|
69302
|
-
}
|
|
69303
|
-
// Icon data is available
|
|
69304
|
-
if (this._icon !== icon || state.icon === null) {
|
|
69305
|
-
// New icon or icon has been loaded
|
|
69306
|
-
this._abortLoading();
|
|
69307
|
-
this._icon = icon;
|
|
69308
|
-
// Add classes
|
|
69309
|
-
var classes = [
|
|
69310
|
-
"iconify"
|
|
69311
|
-
];
|
|
69312
|
-
if (iconName.prefix !== "") {
|
|
69313
|
-
classes.push("iconify--" + iconName.prefix);
|
|
69314
|
-
}
|
|
69315
|
-
if (iconName.provider !== "") {
|
|
69316
|
-
classes.push("iconify--" + iconName.provider);
|
|
69317
|
-
}
|
|
69318
|
-
// Set data
|
|
69319
|
-
this._setData({
|
|
69320
|
-
data: data,
|
|
69321
|
-
classes: classes
|
|
69322
|
-
});
|
|
69323
|
-
if (this.props.onLoad) {
|
|
69324
|
-
this.props.onLoad(icon);
|
|
69325
|
-
}
|
|
69326
|
-
}
|
|
69327
|
-
}
|
|
69328
|
-
},
|
|
69329
|
-
{
|
|
69330
|
-
/**
|
|
69331
|
-
* Component mounted
|
|
69332
|
-
*/ key: "componentDidMount",
|
|
69333
|
-
value: function componentDidMount() {
|
|
69334
|
-
this._checkIcon(false);
|
|
69335
|
-
}
|
|
69336
|
-
},
|
|
69337
|
-
{
|
|
69338
|
-
/**
|
|
69339
|
-
* Component updated
|
|
69340
|
-
*/ key: "componentDidUpdate",
|
|
69341
|
-
value: function componentDidUpdate(oldProps) {
|
|
69342
|
-
if (oldProps.icon !== this.props.icon) {
|
|
69343
|
-
this._checkIcon(true);
|
|
69344
|
-
}
|
|
69345
|
-
}
|
|
69346
|
-
},
|
|
69347
|
-
{
|
|
69348
|
-
/**
|
|
69349
|
-
* Abort loading
|
|
69350
|
-
*/ key: "componentWillUnmount",
|
|
69351
|
-
value: function componentWillUnmount() {
|
|
69352
|
-
this._abortLoading();
|
|
69353
|
-
}
|
|
69354
|
-
},
|
|
69355
|
-
{
|
|
69356
|
-
/**
|
|
69357
|
-
* Render
|
|
69358
|
-
*/ key: "render",
|
|
69359
|
-
value: function render1() {
|
|
69360
|
-
var props = this.props;
|
|
69361
|
-
var icon = this.state.icon;
|
|
69362
|
-
if (icon === null) {
|
|
69363
|
-
// Render placeholder
|
|
69364
|
-
return props.children ? props.children : React__default.createElement("span", {});
|
|
69365
|
-
}
|
|
69366
|
-
// Add classes
|
|
69367
|
-
var newProps = props;
|
|
69368
|
-
if (icon.classes) {
|
|
69369
|
-
newProps = _object_spread_props$3(_object_spread$5({}, props), {
|
|
69370
|
-
className: (typeof props.className === "string" ? props.className + " " : "") + icon.classes.join(" ")
|
|
69371
|
-
});
|
|
69372
|
-
}
|
|
69373
|
-
// Render icon
|
|
69374
|
-
return render(_object_spread$5({}, defaultIconProps, icon.data), newProps, props._inline, props._ref);
|
|
69375
|
-
}
|
|
69376
|
-
}
|
|
69377
|
-
]);
|
|
69378
|
-
return IconComponent;
|
|
69379
|
-
}(React__default.Component);
|
|
69380
|
-
/**
|
|
69381
|
-
* Block icon
|
|
69382
|
-
*
|
|
69383
|
-
* @param props - Component properties
|
|
69384
|
-
*/ var Icon = React__default.forwardRef(function Icon(props, ref) {
|
|
69385
|
-
var newProps = _object_spread_props$3(_object_spread$5({}, props), {
|
|
69386
|
-
_ref: ref,
|
|
69387
|
-
_inline: false
|
|
69388
|
-
});
|
|
69389
|
-
return React__default.createElement(IconComponent, newProps);
|
|
69390
|
-
});
|
|
69391
|
-
/**
|
|
69392
|
-
* Inline icon (has negative verticalAlign that makes it behave like icon font)
|
|
69393
|
-
*
|
|
69394
|
-
* @param props - Component properties
|
|
69395
|
-
*/ React__default.forwardRef(function InlineIcon(props, ref) {
|
|
69396
|
-
var newProps = _object_spread_props$3(_object_spread$5({}, props), {
|
|
69397
|
-
_ref: ref,
|
|
69398
|
-
_inline: true
|
|
69399
|
-
});
|
|
69400
|
-
return React__default.createElement(IconComponent, newProps);
|
|
69401
|
-
});
|
|
69402
|
-
|
|
69403
|
-
function _array_like_to_array$3(arr, len) {
|
|
69404
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
69405
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
69406
|
-
return arr2;
|
|
69407
|
-
}
|
|
69408
|
-
function _array_with_holes$3(arr) {
|
|
69409
|
-
if (Array.isArray(arr)) return arr;
|
|
69410
|
-
}
|
|
69411
|
-
function _array_without_holes(arr) {
|
|
69412
|
-
if (Array.isArray(arr)) return _array_like_to_array$3(arr);
|
|
69413
|
-
}
|
|
69414
|
-
function _define_property$4(obj, key, value) {
|
|
69415
|
-
if (key in obj) {
|
|
69416
|
-
Object.defineProperty(obj, key, {
|
|
69417
|
-
value: value,
|
|
69418
|
-
enumerable: true,
|
|
69419
|
-
configurable: true,
|
|
69420
|
-
writable: true
|
|
69421
|
-
});
|
|
69422
|
-
} else {
|
|
69423
|
-
obj[key] = value;
|
|
69424
|
-
}
|
|
69425
|
-
return obj;
|
|
69426
|
-
}
|
|
69427
|
-
function _iterable_to_array(iter) {
|
|
69428
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
69429
|
-
}
|
|
69430
|
-
function _iterable_to_array_limit$3(arr, i) {
|
|
69431
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
69432
|
-
if (_i == null) return;
|
|
69433
|
-
var _arr = [];
|
|
69434
|
-
var _n = true;
|
|
69435
|
-
var _d = false;
|
|
69436
|
-
var _s, _e;
|
|
69437
|
-
try {
|
|
69438
|
-
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
69439
|
-
_arr.push(_s.value);
|
|
69440
|
-
if (i && _arr.length === i) break;
|
|
69441
|
-
}
|
|
69442
|
-
} catch (err) {
|
|
69443
|
-
_d = true;
|
|
69444
|
-
_e = err;
|
|
69445
|
-
} finally{
|
|
69446
|
-
try {
|
|
69447
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
69448
|
-
} finally{
|
|
69449
|
-
if (_d) throw _e;
|
|
69450
|
-
}
|
|
69451
|
-
}
|
|
69452
|
-
return _arr;
|
|
69453
|
-
}
|
|
69454
|
-
function _non_iterable_rest$3() {
|
|
69455
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
69456
|
-
}
|
|
69457
|
-
function _non_iterable_spread() {
|
|
69458
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
69459
|
-
}
|
|
69460
|
-
function _object_spread$4(target) {
|
|
69461
|
-
for(var i = 1; i < arguments.length; i++){
|
|
69462
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
69463
|
-
var ownKeys = Object.keys(source);
|
|
69464
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
69465
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
69466
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
69467
|
-
}));
|
|
69468
|
-
}
|
|
69469
|
-
ownKeys.forEach(function(key) {
|
|
69470
|
-
_define_property$4(target, key, source[key]);
|
|
69471
|
-
});
|
|
69472
|
-
}
|
|
69473
|
-
return target;
|
|
69474
|
-
}
|
|
69475
|
-
function ownKeys$2(object, enumerableOnly) {
|
|
69476
|
-
var keys = Object.keys(object);
|
|
69477
|
-
if (Object.getOwnPropertySymbols) {
|
|
69478
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
69479
|
-
if (enumerableOnly) {
|
|
69480
|
-
symbols = symbols.filter(function(sym) {
|
|
69481
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
69482
|
-
});
|
|
69483
|
-
}
|
|
69484
|
-
keys.push.apply(keys, symbols);
|
|
69485
|
-
}
|
|
69486
|
-
return keys;
|
|
69487
|
-
}
|
|
69488
|
-
function _object_spread_props$2(target, source) {
|
|
69489
|
-
source = source != null ? source : {};
|
|
69490
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
69491
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
69492
|
-
} else {
|
|
69493
|
-
ownKeys$2(Object(source)).forEach(function(key) {
|
|
69494
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
69495
|
-
});
|
|
69496
|
-
}
|
|
69497
|
-
return target;
|
|
69498
|
-
}
|
|
69499
|
-
function _sliced_to_array$3(arr, i) {
|
|
69500
|
-
return _array_with_holes$3(arr) || _iterable_to_array_limit$3(arr, i) || _unsupported_iterable_to_array$3(arr, i) || _non_iterable_rest$3();
|
|
69501
|
-
}
|
|
69502
|
-
function _to_consumable_array(arr) {
|
|
69503
|
-
return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array$3(arr) || _non_iterable_spread();
|
|
69504
|
-
}
|
|
69505
|
-
function _unsupported_iterable_to_array$3(o, minLen) {
|
|
69506
|
-
if (!o) return;
|
|
69507
|
-
if (typeof o === "string") return _array_like_to_array$3(o, minLen);
|
|
69508
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
69509
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
69510
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
69511
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$3(o, minLen);
|
|
69512
|
-
}
|
|
69513
|
-
var DropImage = function(param) {
|
|
69514
|
-
var _param_preview = param.preview, preview = _param_preview === void 0 ? true : _param_preview, setFiles = param.setFiles, imageUrls = param.imageUrls, setImageUrls = param.setImageUrls;
|
|
69515
|
-
var _useState = _sliced_to_array$3(useState([]), 2), previewFiles = _useState[0], setPreviewFiles = _useState[1];
|
|
69516
|
-
var _useDropzone = useDropzone({
|
|
69517
|
-
accept: {
|
|
69518
|
-
"image/png": [
|
|
69519
|
-
".png"
|
|
69520
|
-
],
|
|
69521
|
-
"image/jpeg": [
|
|
69522
|
-
".jpg",
|
|
69523
|
-
".jpeg"
|
|
69524
|
-
]
|
|
69525
|
-
},
|
|
69526
|
-
maxFiles: 10,
|
|
69527
|
-
maxSize: 5000000,
|
|
69528
|
-
onDrop: function(dropFiles) {
|
|
69529
|
-
var newFiles = [];
|
|
69530
|
-
setFiles(dropFiles);
|
|
69531
|
-
dropFiles.forEach(function(dropFile) {
|
|
69532
|
-
Object.assign(dropFile, {
|
|
69533
|
-
preview: URL.createObjectURL(dropFile),
|
|
69534
|
-
uuid: v4()
|
|
69535
|
-
});
|
|
69536
|
-
newFiles.push(dropFile);
|
|
69537
|
-
setPreviewFiles(newFiles);
|
|
69538
|
-
});
|
|
69539
|
-
}
|
|
69540
|
-
}), getRootProps = _useDropzone.getRootProps, getInputProps = _useDropzone.getInputProps; _useDropzone.isDragActive; _useDropzone.isDragAccept; _useDropzone.isDragReject;
|
|
69541
|
-
var removePreviewFile = function(file) {
|
|
69542
|
-
var currentItem = previewFiles === null || previewFiles === void 0 ? void 0 : previewFiles.indexOf(file);
|
|
69543
|
-
previewFiles.splice(currentItem, 1);
|
|
69544
|
-
setPreviewFiles(_to_consumable_array(previewFiles));
|
|
69545
|
-
};
|
|
69546
|
-
var removeImageUrls = function(item) {
|
|
69547
|
-
var currentItem = imageUrls === null || imageUrls === void 0 ? void 0 : imageUrls.indexOf(item);
|
|
69548
|
-
imageUrls.splice(currentItem, 1);
|
|
69549
|
-
setImageUrls(_to_consumable_array(imageUrls));
|
|
69550
|
-
};
|
|
69551
|
-
return /*#__PURE__*/ jsxs("section", {
|
|
69552
|
-
className: "w-full",
|
|
69553
|
-
children: [
|
|
69554
|
-
/*#__PURE__*/ jsxs("div", _object_spread_props$2(_object_spread$4({}, getRootProps({
|
|
69555
|
-
className: "dropzone"
|
|
69556
|
-
})), {
|
|
69557
|
-
children: [
|
|
69558
|
-
/*#__PURE__*/ jsx("input", _object_spread$4({}, getInputProps())),
|
|
69559
|
-
/*#__PURE__*/ jsx("div", {
|
|
69560
|
-
className: "flex justify-between",
|
|
69561
|
-
children: /*#__PURE__*/ jsx("div", {
|
|
69562
|
-
className: "w-full bg-gray-light rounded-lg",
|
|
69563
|
-
children: /*#__PURE__*/ jsxs("div", {
|
|
69564
|
-
className: "border-2 border-dashed border-gray-400 rounded-lg bg-gray-100",
|
|
69565
|
-
children: [
|
|
69566
|
-
/*#__PURE__*/ jsx("div", {
|
|
69567
|
-
className: "flex justify-center py-8",
|
|
69568
|
-
children: /*#__PURE__*/ jsx(Icon, {
|
|
69569
|
-
icon: "material-symbols:upload",
|
|
69570
|
-
width: "2.5rem",
|
|
69571
|
-
height: "2.5rem"
|
|
69572
|
-
})
|
|
69573
|
-
}),
|
|
69574
|
-
/*#__PURE__*/ jsxs("div", {
|
|
69575
|
-
className: "flex items-center flex-col justify-center",
|
|
69576
|
-
children: [
|
|
69577
|
-
/*#__PURE__*/ jsx("p", {
|
|
69578
|
-
className: "font-normal text-sm text-gray-400 pb-4",
|
|
69579
|
-
children: "圖片僅支援 png、jpg、jpeg"
|
|
69580
|
-
}),
|
|
69581
|
-
/*#__PURE__*/ jsx("h5", {
|
|
69582
|
-
className: "mb-2 text-xl font-bold tracking-tight text-gray-700 pb-4",
|
|
69583
|
-
children: "拖曳圖片至此"
|
|
69584
|
-
})
|
|
69585
|
-
]
|
|
69586
|
-
})
|
|
69587
|
-
]
|
|
69588
|
-
})
|
|
69589
|
-
})
|
|
69590
|
-
})
|
|
69591
|
-
]
|
|
69592
|
-
})),
|
|
69593
|
-
preview && /*#__PURE__*/ jsx("div", {
|
|
69594
|
-
className: "flex pt-2 gap-2",
|
|
69595
|
-
children: (previewFiles === null || previewFiles === void 0 ? void 0 : previewFiles.length) ? previewFiles.length > 0 ? previewFiles.map(function(item) {
|
|
69596
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
69597
|
-
className: "relative",
|
|
69598
|
-
children: [
|
|
69599
|
-
/*#__PURE__*/ jsx("button", {
|
|
69600
|
-
className: "absolute bottom-0 right-0 bg-white rounded-full p-1 shadow-md",
|
|
69601
|
-
onClick: function() {
|
|
69602
|
-
return removePreviewFile(item);
|
|
69603
|
-
},
|
|
69604
|
-
children: /*#__PURE__*/ jsx(Icon, {
|
|
69605
|
-
icon: "mingcute:delete-2-line",
|
|
69606
|
-
width: "1.5rem",
|
|
69607
|
-
height: "1.5rem"
|
|
69608
|
-
})
|
|
69609
|
-
}),
|
|
69610
|
-
/*#__PURE__*/ jsx("img", {
|
|
69611
|
-
className: "w-24 h-24 object-cover",
|
|
69612
|
-
src: item === null || item === void 0 ? void 0 : item.preview,
|
|
69613
|
-
alt: ""
|
|
69614
|
-
})
|
|
69615
|
-
]
|
|
69616
|
-
}, item === null || item === void 0 ? void 0 : item.uuid);
|
|
69617
|
-
}) : null : imageUrls && imageUrls.length ? imageUrls.map(function(item) {
|
|
69618
|
-
return /*#__PURE__*/ jsxs("div", {
|
|
69619
|
-
className: "relative",
|
|
69620
|
-
children: [
|
|
69621
|
-
/*#__PURE__*/ jsx("button", {
|
|
69622
|
-
className: "absolute bottom-0 right-0 bg-white rounded-full p-1 shadow-md",
|
|
69623
|
-
onClick: function() {
|
|
69624
|
-
return removeImageUrls(item);
|
|
69625
|
-
},
|
|
69626
|
-
children: /*#__PURE__*/ jsx(Icon, {
|
|
69627
|
-
icon: "mingcute:delete-2-line",
|
|
69628
|
-
width: "1.5rem",
|
|
69629
|
-
height: "1.5rem"
|
|
69630
|
-
})
|
|
69631
|
-
}),
|
|
69632
|
-
/*#__PURE__*/ jsx("img", {
|
|
69633
|
-
className: "w-24 h-24 object-cover",
|
|
69634
|
-
src: item === null || item === void 0 ? void 0 : item.url,
|
|
69635
|
-
alt: ""
|
|
69636
|
-
})
|
|
69637
|
-
]
|
|
69638
|
-
}, item === null || item === void 0 ? void 0 : item.url);
|
|
69639
|
-
}) : null
|
|
69640
|
-
})
|
|
69641
|
-
]
|
|
69642
|
-
});
|
|
69643
|
-
};
|
|
69644
|
-
|
|
69645
|
-
var ModalContent = function(param) {
|
|
69646
|
-
var title = param.title, setModal = param.setModal, children = param.children, onClick = param.onClick, _param_notice = param.notice, notice = _param_notice === void 0 ? false : _param_notice;
|
|
69647
|
-
return /*#__PURE__*/ jsxs("form", {
|
|
69648
|
-
children: [
|
|
69649
|
-
title && /*#__PURE__*/ jsx("div", {
|
|
69650
|
-
className: "text-2xl text-gray-700 font-medium border-solid border-b border-gray-300 mb-4 p-4",
|
|
69651
|
-
children: title
|
|
69652
|
-
}),
|
|
69653
|
-
children && /*#__PURE__*/ jsx("div", {
|
|
69654
|
-
className: "py-4 px-8",
|
|
69655
|
-
children: children
|
|
69656
|
-
}),
|
|
69657
|
-
/*#__PURE__*/ jsx("div", {
|
|
69658
|
-
className: "flex items-center text-base p-4 px-8 justify-around",
|
|
69659
|
-
children: notice ? /*#__PURE__*/ jsx("button", {
|
|
69660
|
-
type: "button",
|
|
69661
|
-
className: "w-24 h-10 px-2 text-white bg-gray-600 rounded",
|
|
69662
|
-
onClick: setModal,
|
|
69663
|
-
children: "確定"
|
|
69664
|
-
}) : /*#__PURE__*/ jsxs(Fragment$1, {
|
|
69665
|
-
children: [
|
|
69666
|
-
/*#__PURE__*/ jsx("button", {
|
|
69667
|
-
type: "button",
|
|
69668
|
-
className: "w-24 h-10 px-2 text-white bg-gray-600 rounded",
|
|
69669
|
-
onClick: setModal,
|
|
69670
|
-
children: "取消"
|
|
69671
|
-
}),
|
|
69672
|
-
onClick && /*#__PURE__*/ jsx("button", {
|
|
69673
|
-
type: "button",
|
|
69674
|
-
className: "w-24 h-10 mx-3 text-white bg-gray-500 rounded",
|
|
69675
|
-
onClick: onClick,
|
|
69676
|
-
children: "送出"
|
|
69677
|
-
})
|
|
69678
|
-
]
|
|
69679
|
-
})
|
|
69680
|
-
})
|
|
69681
|
-
]
|
|
69682
|
-
});
|
|
69683
|
-
};
|
|
69684
|
-
|
|
69685
|
-
var ErrorContent = function(param) {
|
|
69686
|
-
var setModal = param.setModal, errmsg = param.errmsg;
|
|
69687
|
-
return /*#__PURE__*/ jsx(ModalContent, {
|
|
69688
|
-
setModal: setModal,
|
|
69689
|
-
onClick: setModal,
|
|
69690
|
-
notice: true,
|
|
69691
|
-
children: /*#__PURE__*/ jsxs("div", {
|
|
69692
|
-
className: "w-full max-w-xl",
|
|
69693
|
-
children: [
|
|
69694
|
-
/*#__PURE__*/ jsx("div", {
|
|
69695
|
-
className: "flex justify-center items-center mb-6",
|
|
69696
|
-
children: /*#__PURE__*/ jsx(Icon, {
|
|
69697
|
-
icon: "fluent-mdl2:status-error-full",
|
|
69698
|
-
color: "red",
|
|
69699
|
-
height: 60
|
|
69700
|
-
})
|
|
69701
|
-
}),
|
|
69702
|
-
/*#__PURE__*/ jsx("div", {
|
|
69703
|
-
className: "text-center text-lg text-gray-500",
|
|
69704
|
-
children: errmsg
|
|
69705
|
-
})
|
|
69706
|
-
]
|
|
69707
|
-
})
|
|
69708
|
-
});
|
|
69709
|
-
};
|
|
69710
|
-
|
|
69711
|
-
var Modal = function(param) {
|
|
69712
|
-
var modal = param.modal, _param_unsetModal = param.unsetModal, unsetModal = _param_unsetModal === void 0 ? function() {} : _param_unsetModal;
|
|
69713
|
-
var handleKeyUp = function(e) {
|
|
69714
|
-
var _document_activeElement;
|
|
69715
|
-
if (e.key === "Escape" && ![
|
|
69716
|
-
"INPUT",
|
|
69717
|
-
"SELECT"
|
|
69718
|
-
].includes((_document_activeElement = document.activeElement) === null || _document_activeElement === void 0 ? void 0 : _document_activeElement.tagName)) {
|
|
69719
|
-
unsetModal();
|
|
69720
|
-
}
|
|
69721
|
-
};
|
|
69722
|
-
useEffect(function() {
|
|
69723
|
-
document.addEventListener("keyup", handleKeyUp);
|
|
69724
|
-
return function() {
|
|
69725
|
-
return document.removeEventListener("keyup", handleKeyUp);
|
|
69726
|
-
};
|
|
69727
|
-
}, [
|
|
69728
|
-
unsetModal
|
|
69729
|
-
]);
|
|
69730
|
-
return /*#__PURE__*/ jsx("div", {
|
|
69731
|
-
className: "fixed top-0 left-0 h-screen z-[2000] transition-opacity duration-300 transition-opacity bg-[#000000b3] w-full",
|
|
69732
|
-
children: /*#__PURE__*/ jsx("div", {
|
|
69733
|
-
className: "w-full h-full flex justify-center items-center p-6",
|
|
69734
|
-
children: /*#__PURE__*/ jsx("div", {
|
|
69735
|
-
className: "bg-white rounded overflow-y-auto w-full m-auto max-w-[455px] rounded-xl",
|
|
69736
|
-
children: modal
|
|
69737
|
-
})
|
|
69738
|
-
})
|
|
69739
|
-
});
|
|
69740
|
-
};
|
|
69741
|
-
|
|
69742
|
-
function _array_like_to_array$2(arr, len) {
|
|
69743
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
69744
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
69745
|
-
return arr2;
|
|
69746
|
-
}
|
|
69747
|
-
function _array_with_holes$2(arr) {
|
|
69748
|
-
if (Array.isArray(arr)) return arr;
|
|
69749
|
-
}
|
|
69750
|
-
function _iterable_to_array_limit$2(arr, i) {
|
|
69751
|
-
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
69752
|
-
if (_i == null) return;
|
|
69753
|
-
var _arr = [];
|
|
69754
|
-
var _n = true;
|
|
69755
|
-
var _d = false;
|
|
69756
|
-
var _s, _e;
|
|
69757
|
-
try {
|
|
69758
|
-
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
69759
|
-
_arr.push(_s.value);
|
|
69760
|
-
if (i && _arr.length === i) break;
|
|
69761
|
-
}
|
|
69762
|
-
} catch (err) {
|
|
69763
|
-
_d = true;
|
|
69764
|
-
_e = err;
|
|
69765
|
-
} finally{
|
|
69766
|
-
try {
|
|
69767
|
-
if (!_n && _i["return"] != null) _i["return"]();
|
|
69768
|
-
} finally{
|
|
69769
|
-
if (_d) throw _e;
|
|
69770
|
-
}
|
|
69771
|
-
}
|
|
69772
|
-
return _arr;
|
|
69773
|
-
}
|
|
69774
|
-
function _non_iterable_rest$2() {
|
|
69775
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
69776
|
-
}
|
|
69777
|
-
function _sliced_to_array$2(arr, i) {
|
|
69778
|
-
return _array_with_holes$2(arr) || _iterable_to_array_limit$2(arr, i) || _unsupported_iterable_to_array$2(arr, i) || _non_iterable_rest$2();
|
|
69779
|
-
}
|
|
69780
|
-
function _unsupported_iterable_to_array$2(o, minLen) {
|
|
69781
|
-
if (!o) return;
|
|
69782
|
-
if (typeof o === "string") return _array_like_to_array$2(o, minLen);
|
|
69783
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
69784
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
69785
|
-
if (n === "Map" || n === "Set") return Array.from(n);
|
|
69786
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
|
|
69787
|
-
}
|
|
69788
|
-
var BaseTemplate = function(param) {
|
|
69789
|
-
var file = param.file, imageUrl = param.imageUrl;
|
|
69790
|
-
var _useState = _sliced_to_array$2(useState(null), 2), tempImage = _useState[0], setTempImage = _useState[1];
|
|
69791
|
-
useEffect(function() {
|
|
69792
|
-
var fileReader;
|
|
69793
|
-
var isCancel = false;
|
|
69794
|
-
if (file) {
|
|
69795
|
-
fileReader = new FileReader();
|
|
69796
|
-
fileReader.onload = function(e) {
|
|
69797
|
-
var result = e.target.result;
|
|
69798
|
-
if (result && !isCancel) {
|
|
69799
|
-
setTempImage(result.toString());
|
|
69800
|
-
}
|
|
69801
|
-
};
|
|
69802
|
-
fileReader.readAsDataURL(file);
|
|
69803
|
-
}
|
|
69804
|
-
return function() {
|
|
69805
|
-
setTempImage(null);
|
|
69806
|
-
isCancel = true;
|
|
69807
|
-
if (fileReader && fileReader.readyState === 1) {
|
|
69808
|
-
fileReader.abort();
|
|
69809
|
-
}
|
|
69810
|
-
};
|
|
69811
|
-
}, [
|
|
69812
|
-
file
|
|
69813
|
-
]);
|
|
69814
|
-
return /*#__PURE__*/ jsx("div", {
|
|
69815
|
-
className: "max-w-sm mx-auto bg-white rounded-lg shadow-md overflow-hidden items-center",
|
|
69816
|
-
children: /*#__PURE__*/ jsx("div", {
|
|
69817
|
-
className: "px-4 py-6 w-72 h-56",
|
|
69818
|
-
children: tempImage || imageUrl ? /*#__PURE__*/ jsx("img", {
|
|
69819
|
-
className: "w-full h-full object-contain border-dashed border-2 border-gray-400 p-6 rounded-lg",
|
|
69820
|
-
src: tempImage || imageUrl,
|
|
69821
|
-
alt: ""
|
|
69822
|
-
}) : /*#__PURE__*/ jsx("div", {
|
|
69823
|
-
id: "image-preview",
|
|
69824
|
-
className: "max-w-sm p-6 bg-gray-100 border-dashed border-2 border-gray-400 rounded-lg items-center mx-auto text-center cursor-pointer",
|
|
69825
|
-
children: /*#__PURE__*/ jsxs("div", {
|
|
69826
|
-
className: "cursor-pointer",
|
|
69827
|
-
children: [
|
|
69828
|
-
/*#__PURE__*/ jsx("div", {
|
|
69829
|
-
className: "flex justify-center",
|
|
69830
|
-
children: /*#__PURE__*/ jsx(Icon, {
|
|
69831
|
-
icon: "material-symbols:upload",
|
|
69832
|
-
width: "2.5rem",
|
|
69833
|
-
height: "2.5rem"
|
|
69834
|
-
})
|
|
69835
|
-
}),
|
|
69836
|
-
/*#__PURE__*/ jsx("p", {
|
|
69837
|
-
className: "font-normal text-sm text-gray-400 py-4",
|
|
69838
|
-
children: "圖片僅支援 png、jpg、jpeg"
|
|
69839
|
-
}),
|
|
69840
|
-
/*#__PURE__*/ jsx("h5", {
|
|
69841
|
-
className: "mb-2 text-xl font-bold tracking-tight text-gray-700",
|
|
69842
|
-
children: "上傳圖片"
|
|
69843
|
-
})
|
|
69844
|
-
]
|
|
69845
|
-
})
|
|
69846
|
-
})
|
|
69847
|
-
})
|
|
69848
|
-
});
|
|
69849
|
-
};
|
|
69850
|
-
|
|
69851
|
-
function _array_like_to_array$1(arr, len) {
|
|
69852
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
69853
|
-
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
69854
|
-
return arr2;
|
|
69855
|
-
}
|
|
69856
|
-
function _array_with_holes$1(arr) {
|
|
69857
|
-
if (Array.isArray(arr)) return arr;
|
|
67907
|
+
function _array_with_holes$1(arr) {
|
|
67908
|
+
if (Array.isArray(arr)) return arr;
|
|
69858
67909
|
}
|
|
69859
67910
|
function _iterable_to_array_limit$1(arr, i) {
|
|
69860
67911
|
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
@@ -69996,7 +68047,7 @@ function cn() {
|
|
|
69996
68047
|
return twMerge(clsx(inputs));
|
|
69997
68048
|
}
|
|
69998
68049
|
|
|
69999
|
-
function _define_property$
|
|
68050
|
+
function _define_property$6(obj, key, value) {
|
|
70000
68051
|
if (key in obj) {
|
|
70001
68052
|
Object.defineProperty(obj, key, {
|
|
70002
68053
|
value: value,
|
|
@@ -70009,7 +68060,7 @@ function _define_property$3(obj, key, value) {
|
|
|
70009
68060
|
}
|
|
70010
68061
|
return obj;
|
|
70011
68062
|
}
|
|
70012
|
-
function _object_spread$
|
|
68063
|
+
function _object_spread$6(target) {
|
|
70013
68064
|
for(var i = 1; i < arguments.length; i++){
|
|
70014
68065
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
70015
68066
|
var ownKeys = Object.keys(source);
|
|
@@ -70019,12 +68070,12 @@ function _object_spread$3(target) {
|
|
|
70019
68070
|
}));
|
|
70020
68071
|
}
|
|
70021
68072
|
ownKeys.forEach(function(key) {
|
|
70022
|
-
_define_property$
|
|
68073
|
+
_define_property$6(target, key, source[key]);
|
|
70023
68074
|
});
|
|
70024
68075
|
}
|
|
70025
68076
|
return target;
|
|
70026
68077
|
}
|
|
70027
|
-
function ownKeys$
|
|
68078
|
+
function ownKeys$2(object, enumerableOnly) {
|
|
70028
68079
|
var keys = Object.keys(object);
|
|
70029
68080
|
if (Object.getOwnPropertySymbols) {
|
|
70030
68081
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -70037,20 +68088,20 @@ function ownKeys$1(object, enumerableOnly) {
|
|
|
70037
68088
|
}
|
|
70038
68089
|
return keys;
|
|
70039
68090
|
}
|
|
70040
|
-
function _object_spread_props$
|
|
68091
|
+
function _object_spread_props$2(target, source) {
|
|
70041
68092
|
source = source != null ? source : {};
|
|
70042
68093
|
if (Object.getOwnPropertyDescriptors) {
|
|
70043
68094
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
70044
68095
|
} else {
|
|
70045
|
-
ownKeys$
|
|
68096
|
+
ownKeys$2(Object(source)).forEach(function(key) {
|
|
70046
68097
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
70047
68098
|
});
|
|
70048
68099
|
}
|
|
70049
68100
|
return target;
|
|
70050
68101
|
}
|
|
70051
|
-
function _object_without_properties$
|
|
68102
|
+
function _object_without_properties$6(source, excluded) {
|
|
70052
68103
|
if (source == null) return {};
|
|
70053
|
-
var target = _object_without_properties_loose$
|
|
68104
|
+
var target = _object_without_properties_loose$6(source, excluded);
|
|
70054
68105
|
var key, i;
|
|
70055
68106
|
if (Object.getOwnPropertySymbols) {
|
|
70056
68107
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -70063,7 +68114,7 @@ function _object_without_properties$3(source, excluded) {
|
|
|
70063
68114
|
}
|
|
70064
68115
|
return target;
|
|
70065
68116
|
}
|
|
70066
|
-
function _object_without_properties_loose$
|
|
68117
|
+
function _object_without_properties_loose$6(source, excluded) {
|
|
70067
68118
|
if (source == null) return {};
|
|
70068
68119
|
var target = {};
|
|
70069
68120
|
var sourceKeys = Object.keys(source);
|
|
@@ -70076,10 +68127,10 @@ function _object_without_properties_loose$3(source, excluded) {
|
|
|
70076
68127
|
return target;
|
|
70077
68128
|
}
|
|
70078
68129
|
var Switch = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
70079
|
-
var className = _param.className, props = _object_without_properties$
|
|
68130
|
+
var className = _param.className, props = _object_without_properties$6(_param, [
|
|
70080
68131
|
"className"
|
|
70081
68132
|
]);
|
|
70082
|
-
return /*#__PURE__*/ jsx(SwitchPrimitives.Root, _object_spread_props$
|
|
68133
|
+
return /*#__PURE__*/ jsx(SwitchPrimitives.Root, _object_spread_props$2(_object_spread$6({
|
|
70083
68134
|
className: cn("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input", className)
|
|
70084
68135
|
}, props), {
|
|
70085
68136
|
ref: ref,
|
|
@@ -70090,7 +68141,7 @@ var Switch = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
70090
68141
|
});
|
|
70091
68142
|
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
70092
68143
|
|
|
70093
|
-
function _define_property$
|
|
68144
|
+
function _define_property$5(obj, key, value) {
|
|
70094
68145
|
if (key in obj) {
|
|
70095
68146
|
Object.defineProperty(obj, key, {
|
|
70096
68147
|
value: value,
|
|
@@ -70103,7 +68154,7 @@ function _define_property$2(obj, key, value) {
|
|
|
70103
68154
|
}
|
|
70104
68155
|
return obj;
|
|
70105
68156
|
}
|
|
70106
|
-
function _object_spread$
|
|
68157
|
+
function _object_spread$5(target) {
|
|
70107
68158
|
for(var i = 1; i < arguments.length; i++){
|
|
70108
68159
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
70109
68160
|
var ownKeys = Object.keys(source);
|
|
@@ -70113,14 +68164,14 @@ function _object_spread$2(target) {
|
|
|
70113
68164
|
}));
|
|
70114
68165
|
}
|
|
70115
68166
|
ownKeys.forEach(function(key) {
|
|
70116
|
-
_define_property$
|
|
68167
|
+
_define_property$5(target, key, source[key]);
|
|
70117
68168
|
});
|
|
70118
68169
|
}
|
|
70119
68170
|
return target;
|
|
70120
68171
|
}
|
|
70121
|
-
function _object_without_properties$
|
|
68172
|
+
function _object_without_properties$5(source, excluded) {
|
|
70122
68173
|
if (source == null) return {};
|
|
70123
|
-
var target = _object_without_properties_loose$
|
|
68174
|
+
var target = _object_without_properties_loose$5(source, excluded);
|
|
70124
68175
|
var key, i;
|
|
70125
68176
|
if (Object.getOwnPropertySymbols) {
|
|
70126
68177
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -70133,7 +68184,7 @@ function _object_without_properties$2(source, excluded) {
|
|
|
70133
68184
|
}
|
|
70134
68185
|
return target;
|
|
70135
68186
|
}
|
|
70136
|
-
function _object_without_properties_loose$
|
|
68187
|
+
function _object_without_properties_loose$5(source, excluded) {
|
|
70137
68188
|
if (source == null) return {};
|
|
70138
68189
|
var target = {};
|
|
70139
68190
|
var sourceKeys = Object.keys(source);
|
|
@@ -70168,14 +68219,14 @@ var buttonVariants = cva("inline-flex items-center justify-center whitespace-now
|
|
|
70168
68219
|
}
|
|
70169
68220
|
});
|
|
70170
68221
|
var Button = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
70171
|
-
var className = _param.className, variant = _param.variant, size = _param.size, _param_asChild = _param.asChild, asChild = _param_asChild === void 0 ? false : _param_asChild, props = _object_without_properties$
|
|
68222
|
+
var className = _param.className, variant = _param.variant, size = _param.size, _param_asChild = _param.asChild, asChild = _param_asChild === void 0 ? false : _param_asChild, props = _object_without_properties$5(_param, [
|
|
70172
68223
|
"className",
|
|
70173
68224
|
"variant",
|
|
70174
68225
|
"size",
|
|
70175
68226
|
"asChild"
|
|
70176
68227
|
]);
|
|
70177
68228
|
var Comp = asChild ? Slot : "button";
|
|
70178
|
-
return /*#__PURE__*/ jsx(Comp, _object_spread$
|
|
68229
|
+
return /*#__PURE__*/ jsx(Comp, _object_spread$5({
|
|
70179
68230
|
className: cn(buttonVariants({
|
|
70180
68231
|
variant: variant,
|
|
70181
68232
|
size: size,
|
|
@@ -70185,757 +68236,7 @@ var Button = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
|
70185
68236
|
}, props));
|
|
70186
68237
|
});
|
|
70187
68238
|
|
|
70188
|
-
|
|
70189
|
-
exports: {}
|
|
70190
|
-
};
|
|
70191
|
-
|
|
70192
|
-
var interopRequireDefault = {
|
|
70193
|
-
exports: {}
|
|
70194
|
-
};
|
|
70195
|
-
|
|
70196
|
-
(function (module) {
|
|
70197
|
-
function _interopRequireDefault(obj) {
|
|
70198
|
-
return obj && obj.__esModule ? obj : {
|
|
70199
|
-
"default": obj
|
|
70200
|
-
};
|
|
70201
|
-
}
|
|
70202
|
-
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
70203
|
-
}(interopRequireDefault));
|
|
70204
|
-
|
|
70205
|
-
var formatDistance = {
|
|
70206
|
-
exports: {}
|
|
70207
|
-
};
|
|
70208
|
-
|
|
70209
|
-
(function (module, exports) {
|
|
70210
|
-
Object.defineProperty(exports, "__esModule", {
|
|
70211
|
-
value: true
|
|
70212
|
-
});
|
|
70213
|
-
exports.default = void 0;
|
|
70214
|
-
var formatDistanceLocale = {
|
|
70215
|
-
lessThanXSeconds: {
|
|
70216
|
-
one: "少於 1 秒",
|
|
70217
|
-
other: "少於 {{count}} 秒"
|
|
70218
|
-
},
|
|
70219
|
-
xSeconds: {
|
|
70220
|
-
one: "1 秒",
|
|
70221
|
-
other: "{{count}} 秒"
|
|
70222
|
-
},
|
|
70223
|
-
halfAMinute: "半分鐘",
|
|
70224
|
-
lessThanXMinutes: {
|
|
70225
|
-
one: "少於 1 分鐘",
|
|
70226
|
-
other: "少於 {{count}} 分鐘"
|
|
70227
|
-
},
|
|
70228
|
-
xMinutes: {
|
|
70229
|
-
one: "1 分鐘",
|
|
70230
|
-
other: "{{count}} 分鐘"
|
|
70231
|
-
},
|
|
70232
|
-
xHours: {
|
|
70233
|
-
one: "1 小時",
|
|
70234
|
-
other: "{{count}} 小時"
|
|
70235
|
-
},
|
|
70236
|
-
aboutXHours: {
|
|
70237
|
-
one: "大約 1 小時",
|
|
70238
|
-
other: "大約 {{count}} 小時"
|
|
70239
|
-
},
|
|
70240
|
-
xDays: {
|
|
70241
|
-
one: "1 天",
|
|
70242
|
-
other: "{{count}} 天"
|
|
70243
|
-
},
|
|
70244
|
-
aboutXWeeks: {
|
|
70245
|
-
one: "大約 1 個星期",
|
|
70246
|
-
other: "大約 {{count}} 個星期"
|
|
70247
|
-
},
|
|
70248
|
-
xWeeks: {
|
|
70249
|
-
one: "1 個星期",
|
|
70250
|
-
other: "{{count}} 個星期"
|
|
70251
|
-
},
|
|
70252
|
-
aboutXMonths: {
|
|
70253
|
-
one: "大約 1 個月",
|
|
70254
|
-
other: "大約 {{count}} 個月"
|
|
70255
|
-
},
|
|
70256
|
-
xMonths: {
|
|
70257
|
-
one: "1 個月",
|
|
70258
|
-
other: "{{count}} 個月"
|
|
70259
|
-
},
|
|
70260
|
-
aboutXYears: {
|
|
70261
|
-
one: "大約 1 年",
|
|
70262
|
-
other: "大約 {{count}} 年"
|
|
70263
|
-
},
|
|
70264
|
-
xYears: {
|
|
70265
|
-
one: "1 年",
|
|
70266
|
-
other: "{{count}} 年"
|
|
70267
|
-
},
|
|
70268
|
-
overXYears: {
|
|
70269
|
-
one: "超過 1 年",
|
|
70270
|
-
other: "超過 {{count}} 年"
|
|
70271
|
-
},
|
|
70272
|
-
almostXYears: {
|
|
70273
|
-
one: "將近 1 年",
|
|
70274
|
-
other: "將近 {{count}} 年"
|
|
70275
|
-
}
|
|
70276
|
-
};
|
|
70277
|
-
var formatDistance = function formatDistance(token, count, options) {
|
|
70278
|
-
var result;
|
|
70279
|
-
var tokenValue = formatDistanceLocale[token];
|
|
70280
|
-
if (typeof tokenValue === "string") {
|
|
70281
|
-
result = tokenValue;
|
|
70282
|
-
} else if (count === 1) {
|
|
70283
|
-
result = tokenValue.one;
|
|
70284
|
-
} else {
|
|
70285
|
-
result = tokenValue.other.replace("{{count}}", String(count));
|
|
70286
|
-
}
|
|
70287
|
-
if (options !== null && options !== void 0 && options.addSuffix) {
|
|
70288
|
-
if (options.comparison && options.comparison > 0) {
|
|
70289
|
-
return result + "內";
|
|
70290
|
-
} else {
|
|
70291
|
-
return result + "前";
|
|
70292
|
-
}
|
|
70293
|
-
}
|
|
70294
|
-
return result;
|
|
70295
|
-
};
|
|
70296
|
-
var _default = formatDistance;
|
|
70297
|
-
exports.default = _default;
|
|
70298
|
-
module.exports = exports.default;
|
|
70299
|
-
}(formatDistance, formatDistance.exports));
|
|
70300
|
-
|
|
70301
|
-
var formatLong = {
|
|
70302
|
-
exports: {}
|
|
70303
|
-
};
|
|
70304
|
-
|
|
70305
|
-
var buildFormatLongFn = {
|
|
70306
|
-
exports: {}
|
|
70307
|
-
};
|
|
70308
|
-
|
|
70309
|
-
(function (module, exports) {
|
|
70310
|
-
Object.defineProperty(exports, "__esModule", {
|
|
70311
|
-
value: true
|
|
70312
|
-
});
|
|
70313
|
-
exports.default = buildFormatLongFn;
|
|
70314
|
-
function buildFormatLongFn(args) {
|
|
70315
|
-
return function() {
|
|
70316
|
-
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
70317
|
-
// TODO: Remove String()
|
|
70318
|
-
var width = options.width ? String(options.width) : args.defaultWidth;
|
|
70319
|
-
var format = args.formats[width] || args.formats[args.defaultWidth];
|
|
70320
|
-
return format;
|
|
70321
|
-
};
|
|
70322
|
-
}
|
|
70323
|
-
module.exports = exports.default;
|
|
70324
|
-
}(buildFormatLongFn, buildFormatLongFn.exports));
|
|
70325
|
-
|
|
70326
|
-
(function (module, exports) {
|
|
70327
|
-
var _interopRequireDefault = interopRequireDefault.exports.default;
|
|
70328
|
-
Object.defineProperty(exports, "__esModule", {
|
|
70329
|
-
value: true
|
|
70330
|
-
});
|
|
70331
|
-
exports.default = void 0;
|
|
70332
|
-
var _index = _interopRequireDefault(buildFormatLongFn.exports);
|
|
70333
|
-
var dateFormats = {
|
|
70334
|
-
full: "y'年'M'月'd'日' EEEE",
|
|
70335
|
-
long: "y'年'M'月'd'日'",
|
|
70336
|
-
medium: "yyyy-MM-dd",
|
|
70337
|
-
short: "yy-MM-dd"
|
|
70338
|
-
};
|
|
70339
|
-
var timeFormats = {
|
|
70340
|
-
full: "zzzz a h:mm:ss",
|
|
70341
|
-
long: "z a h:mm:ss",
|
|
70342
|
-
medium: "a h:mm:ss",
|
|
70343
|
-
short: "a h:mm"
|
|
70344
|
-
};
|
|
70345
|
-
var dateTimeFormats = {
|
|
70346
|
-
full: "{{date}} {{time}}",
|
|
70347
|
-
long: "{{date}} {{time}}",
|
|
70348
|
-
medium: "{{date}} {{time}}",
|
|
70349
|
-
short: "{{date}} {{time}}"
|
|
70350
|
-
};
|
|
70351
|
-
var formatLong = {
|
|
70352
|
-
date: (0, _index.default)({
|
|
70353
|
-
formats: dateFormats,
|
|
70354
|
-
defaultWidth: "full"
|
|
70355
|
-
}),
|
|
70356
|
-
time: (0, _index.default)({
|
|
70357
|
-
formats: timeFormats,
|
|
70358
|
-
defaultWidth: "full"
|
|
70359
|
-
}),
|
|
70360
|
-
dateTime: (0, _index.default)({
|
|
70361
|
-
formats: dateTimeFormats,
|
|
70362
|
-
defaultWidth: "full"
|
|
70363
|
-
})
|
|
70364
|
-
};
|
|
70365
|
-
var _default = formatLong;
|
|
70366
|
-
exports.default = _default;
|
|
70367
|
-
module.exports = exports.default;
|
|
70368
|
-
}(formatLong, formatLong.exports));
|
|
70369
|
-
|
|
70370
|
-
var formatRelative = {
|
|
70371
|
-
exports: {}
|
|
70372
|
-
};
|
|
70373
|
-
|
|
70374
|
-
(function (module, exports) {
|
|
70375
|
-
Object.defineProperty(exports, "__esModule", {
|
|
70376
|
-
value: true
|
|
70377
|
-
});
|
|
70378
|
-
exports.default = void 0;
|
|
70379
|
-
var formatRelativeLocale = {
|
|
70380
|
-
lastWeek: "'上個'eeee p",
|
|
70381
|
-
yesterday: "'昨天' p",
|
|
70382
|
-
today: "'今天' p",
|
|
70383
|
-
tomorrow: "'明天' p",
|
|
70384
|
-
nextWeek: "'下個'eeee p",
|
|
70385
|
-
other: "P"
|
|
70386
|
-
};
|
|
70387
|
-
var formatRelative = function formatRelative(token, _date, _baseDate, _options) {
|
|
70388
|
-
return formatRelativeLocale[token];
|
|
70389
|
-
};
|
|
70390
|
-
var _default = formatRelative;
|
|
70391
|
-
exports.default = _default;
|
|
70392
|
-
module.exports = exports.default;
|
|
70393
|
-
}(formatRelative, formatRelative.exports));
|
|
70394
|
-
|
|
70395
|
-
var localize = {
|
|
70396
|
-
exports: {}
|
|
70397
|
-
};
|
|
70398
|
-
|
|
70399
|
-
var buildLocalizeFn = {
|
|
70400
|
-
exports: {}
|
|
70401
|
-
};
|
|
70402
|
-
|
|
70403
|
-
(function (module, exports) {
|
|
70404
|
-
Object.defineProperty(exports, "__esModule", {
|
|
70405
|
-
value: true
|
|
70406
|
-
});
|
|
70407
|
-
exports.default = buildLocalizeFn;
|
|
70408
|
-
function buildLocalizeFn(args) {
|
|
70409
|
-
return function(dirtyIndex, options) {
|
|
70410
|
-
var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
|
|
70411
|
-
var valuesArray;
|
|
70412
|
-
if (context === "formatting" && args.formattingValues) {
|
|
70413
|
-
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
|
|
70414
|
-
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
|
|
70415
|
-
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
|
|
70416
|
-
} else {
|
|
70417
|
-
var _defaultWidth = args.defaultWidth;
|
|
70418
|
-
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
|
|
70419
|
-
valuesArray = args.values[_width] || args.values[_defaultWidth];
|
|
70420
|
-
}
|
|
70421
|
-
var index = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
|
|
70422
|
-
// @ts-ignore: For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!
|
|
70423
|
-
return valuesArray[index];
|
|
70424
|
-
};
|
|
70425
|
-
}
|
|
70426
|
-
module.exports = exports.default;
|
|
70427
|
-
}(buildLocalizeFn, buildLocalizeFn.exports));
|
|
70428
|
-
|
|
70429
|
-
(function (module, exports) {
|
|
70430
|
-
var _interopRequireDefault = interopRequireDefault.exports.default;
|
|
70431
|
-
Object.defineProperty(exports, "__esModule", {
|
|
70432
|
-
value: true
|
|
70433
|
-
});
|
|
70434
|
-
exports.default = void 0;
|
|
70435
|
-
var _index = _interopRequireDefault(buildLocalizeFn.exports);
|
|
70436
|
-
var eraValues = {
|
|
70437
|
-
narrow: [
|
|
70438
|
-
"前",
|
|
70439
|
-
"公元"
|
|
70440
|
-
],
|
|
70441
|
-
abbreviated: [
|
|
70442
|
-
"前",
|
|
70443
|
-
"公元"
|
|
70444
|
-
],
|
|
70445
|
-
wide: [
|
|
70446
|
-
"公元前",
|
|
70447
|
-
"公元"
|
|
70448
|
-
]
|
|
70449
|
-
};
|
|
70450
|
-
var quarterValues = {
|
|
70451
|
-
narrow: [
|
|
70452
|
-
"1",
|
|
70453
|
-
"2",
|
|
70454
|
-
"3",
|
|
70455
|
-
"4"
|
|
70456
|
-
],
|
|
70457
|
-
abbreviated: [
|
|
70458
|
-
"第一刻",
|
|
70459
|
-
"第二刻",
|
|
70460
|
-
"第三刻",
|
|
70461
|
-
"第四刻"
|
|
70462
|
-
],
|
|
70463
|
-
wide: [
|
|
70464
|
-
"第一刻鐘",
|
|
70465
|
-
"第二刻鐘",
|
|
70466
|
-
"第三刻鐘",
|
|
70467
|
-
"第四刻鐘"
|
|
70468
|
-
]
|
|
70469
|
-
};
|
|
70470
|
-
var monthValues = {
|
|
70471
|
-
narrow: [
|
|
70472
|
-
"一",
|
|
70473
|
-
"二",
|
|
70474
|
-
"三",
|
|
70475
|
-
"四",
|
|
70476
|
-
"五",
|
|
70477
|
-
"六",
|
|
70478
|
-
"七",
|
|
70479
|
-
"八",
|
|
70480
|
-
"九",
|
|
70481
|
-
"十",
|
|
70482
|
-
"十一",
|
|
70483
|
-
"十二"
|
|
70484
|
-
],
|
|
70485
|
-
abbreviated: [
|
|
70486
|
-
"1月",
|
|
70487
|
-
"2月",
|
|
70488
|
-
"3月",
|
|
70489
|
-
"4月",
|
|
70490
|
-
"5月",
|
|
70491
|
-
"6月",
|
|
70492
|
-
"7月",
|
|
70493
|
-
"8月",
|
|
70494
|
-
"9月",
|
|
70495
|
-
"10月",
|
|
70496
|
-
"11月",
|
|
70497
|
-
"12月"
|
|
70498
|
-
],
|
|
70499
|
-
wide: [
|
|
70500
|
-
"一月",
|
|
70501
|
-
"二月",
|
|
70502
|
-
"三月",
|
|
70503
|
-
"四月",
|
|
70504
|
-
"五月",
|
|
70505
|
-
"六月",
|
|
70506
|
-
"七月",
|
|
70507
|
-
"八月",
|
|
70508
|
-
"九月",
|
|
70509
|
-
"十月",
|
|
70510
|
-
"十一月",
|
|
70511
|
-
"十二月"
|
|
70512
|
-
]
|
|
70513
|
-
};
|
|
70514
|
-
var dayValues = {
|
|
70515
|
-
narrow: [
|
|
70516
|
-
"日",
|
|
70517
|
-
"一",
|
|
70518
|
-
"二",
|
|
70519
|
-
"三",
|
|
70520
|
-
"四",
|
|
70521
|
-
"五",
|
|
70522
|
-
"六"
|
|
70523
|
-
],
|
|
70524
|
-
short: [
|
|
70525
|
-
"日",
|
|
70526
|
-
"一",
|
|
70527
|
-
"二",
|
|
70528
|
-
"三",
|
|
70529
|
-
"四",
|
|
70530
|
-
"五",
|
|
70531
|
-
"六"
|
|
70532
|
-
],
|
|
70533
|
-
abbreviated: [
|
|
70534
|
-
"週日",
|
|
70535
|
-
"週一",
|
|
70536
|
-
"週二",
|
|
70537
|
-
"週三",
|
|
70538
|
-
"週四",
|
|
70539
|
-
"週五",
|
|
70540
|
-
"週六"
|
|
70541
|
-
],
|
|
70542
|
-
wide: [
|
|
70543
|
-
"星期日",
|
|
70544
|
-
"星期一",
|
|
70545
|
-
"星期二",
|
|
70546
|
-
"星期三",
|
|
70547
|
-
"星期四",
|
|
70548
|
-
"星期五",
|
|
70549
|
-
"星期六"
|
|
70550
|
-
]
|
|
70551
|
-
};
|
|
70552
|
-
var dayPeriodValues = {
|
|
70553
|
-
narrow: {
|
|
70554
|
-
am: "上",
|
|
70555
|
-
pm: "下",
|
|
70556
|
-
midnight: "凌晨",
|
|
70557
|
-
noon: "午",
|
|
70558
|
-
morning: "早",
|
|
70559
|
-
afternoon: "下午",
|
|
70560
|
-
evening: "晚",
|
|
70561
|
-
night: "夜"
|
|
70562
|
-
},
|
|
70563
|
-
abbreviated: {
|
|
70564
|
-
am: "上午",
|
|
70565
|
-
pm: "下午",
|
|
70566
|
-
midnight: "凌晨",
|
|
70567
|
-
noon: "中午",
|
|
70568
|
-
morning: "早晨",
|
|
70569
|
-
afternoon: "中午",
|
|
70570
|
-
evening: "晚上",
|
|
70571
|
-
night: "夜間"
|
|
70572
|
-
},
|
|
70573
|
-
wide: {
|
|
70574
|
-
am: "上午",
|
|
70575
|
-
pm: "下午",
|
|
70576
|
-
midnight: "凌晨",
|
|
70577
|
-
noon: "中午",
|
|
70578
|
-
morning: "早晨",
|
|
70579
|
-
afternoon: "中午",
|
|
70580
|
-
evening: "晚上",
|
|
70581
|
-
night: "夜間"
|
|
70582
|
-
}
|
|
70583
|
-
};
|
|
70584
|
-
var formattingDayPeriodValues = {
|
|
70585
|
-
narrow: {
|
|
70586
|
-
am: "上",
|
|
70587
|
-
pm: "下",
|
|
70588
|
-
midnight: "凌晨",
|
|
70589
|
-
noon: "午",
|
|
70590
|
-
morning: "早",
|
|
70591
|
-
afternoon: "下午",
|
|
70592
|
-
evening: "晚",
|
|
70593
|
-
night: "夜"
|
|
70594
|
-
},
|
|
70595
|
-
abbreviated: {
|
|
70596
|
-
am: "上午",
|
|
70597
|
-
pm: "下午",
|
|
70598
|
-
midnight: "凌晨",
|
|
70599
|
-
noon: "中午",
|
|
70600
|
-
morning: "早晨",
|
|
70601
|
-
afternoon: "中午",
|
|
70602
|
-
evening: "晚上",
|
|
70603
|
-
night: "夜間"
|
|
70604
|
-
},
|
|
70605
|
-
wide: {
|
|
70606
|
-
am: "上午",
|
|
70607
|
-
pm: "下午",
|
|
70608
|
-
midnight: "凌晨",
|
|
70609
|
-
noon: "中午",
|
|
70610
|
-
morning: "早晨",
|
|
70611
|
-
afternoon: "中午",
|
|
70612
|
-
evening: "晚上",
|
|
70613
|
-
night: "夜間"
|
|
70614
|
-
}
|
|
70615
|
-
};
|
|
70616
|
-
var ordinalNumber = function ordinalNumber(dirtyNumber, options) {
|
|
70617
|
-
var number = Number(dirtyNumber);
|
|
70618
|
-
switch(options === null || options === void 0 ? void 0 : options.unit){
|
|
70619
|
-
case "date":
|
|
70620
|
-
return number + "日";
|
|
70621
|
-
case "hour":
|
|
70622
|
-
return number + "時";
|
|
70623
|
-
case "minute":
|
|
70624
|
-
return number + "分";
|
|
70625
|
-
case "second":
|
|
70626
|
-
return number + "秒";
|
|
70627
|
-
default:
|
|
70628
|
-
return "第 " + number;
|
|
70629
|
-
}
|
|
70630
|
-
};
|
|
70631
|
-
var localize = {
|
|
70632
|
-
ordinalNumber: ordinalNumber,
|
|
70633
|
-
era: (0, _index.default)({
|
|
70634
|
-
values: eraValues,
|
|
70635
|
-
defaultWidth: "wide"
|
|
70636
|
-
}),
|
|
70637
|
-
quarter: (0, _index.default)({
|
|
70638
|
-
values: quarterValues,
|
|
70639
|
-
defaultWidth: "wide",
|
|
70640
|
-
argumentCallback: function argumentCallback(quarter) {
|
|
70641
|
-
return quarter - 1;
|
|
70642
|
-
}
|
|
70643
|
-
}),
|
|
70644
|
-
month: (0, _index.default)({
|
|
70645
|
-
values: monthValues,
|
|
70646
|
-
defaultWidth: "wide"
|
|
70647
|
-
}),
|
|
70648
|
-
day: (0, _index.default)({
|
|
70649
|
-
values: dayValues,
|
|
70650
|
-
defaultWidth: "wide"
|
|
70651
|
-
}),
|
|
70652
|
-
dayPeriod: (0, _index.default)({
|
|
70653
|
-
values: dayPeriodValues,
|
|
70654
|
-
defaultWidth: "wide",
|
|
70655
|
-
formattingValues: formattingDayPeriodValues,
|
|
70656
|
-
defaultFormattingWidth: "wide"
|
|
70657
|
-
})
|
|
70658
|
-
};
|
|
70659
|
-
var _default = localize;
|
|
70660
|
-
exports.default = _default;
|
|
70661
|
-
module.exports = exports.default;
|
|
70662
|
-
}(localize, localize.exports));
|
|
70663
|
-
|
|
70664
|
-
var match = {
|
|
70665
|
-
exports: {}
|
|
70666
|
-
};
|
|
70667
|
-
|
|
70668
|
-
var buildMatchFn = {
|
|
70669
|
-
exports: {}
|
|
70670
|
-
};
|
|
70671
|
-
|
|
70672
|
-
(function (module, exports) {
|
|
70673
|
-
Object.defineProperty(exports, "__esModule", {
|
|
70674
|
-
value: true
|
|
70675
|
-
});
|
|
70676
|
-
exports.default = buildMatchFn;
|
|
70677
|
-
function buildMatchFn(args) {
|
|
70678
|
-
return function(string) {
|
|
70679
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
70680
|
-
var width = options.width;
|
|
70681
|
-
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
|
|
70682
|
-
var matchResult = string.match(matchPattern);
|
|
70683
|
-
if (!matchResult) {
|
|
70684
|
-
return null;
|
|
70685
|
-
}
|
|
70686
|
-
var matchedString = matchResult[0];
|
|
70687
|
-
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
|
|
70688
|
-
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function(pattern) {
|
|
70689
|
-
return pattern.test(matchedString);
|
|
70690
|
-
}) : findKey(parsePatterns, function(pattern) {
|
|
70691
|
-
return pattern.test(matchedString);
|
|
70692
|
-
});
|
|
70693
|
-
var value;
|
|
70694
|
-
value = args.valueCallback ? args.valueCallback(key) : key;
|
|
70695
|
-
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
70696
|
-
var rest = string.slice(matchedString.length);
|
|
70697
|
-
return {
|
|
70698
|
-
value: value,
|
|
70699
|
-
rest: rest
|
|
70700
|
-
};
|
|
70701
|
-
};
|
|
70702
|
-
}
|
|
70703
|
-
function findKey(object, predicate) {
|
|
70704
|
-
for(var key in object){
|
|
70705
|
-
if (object.hasOwnProperty(key) && predicate(object[key])) {
|
|
70706
|
-
return key;
|
|
70707
|
-
}
|
|
70708
|
-
}
|
|
70709
|
-
return undefined;
|
|
70710
|
-
}
|
|
70711
|
-
function findIndex(array, predicate) {
|
|
70712
|
-
for(var key = 0; key < array.length; key++){
|
|
70713
|
-
if (predicate(array[key])) {
|
|
70714
|
-
return key;
|
|
70715
|
-
}
|
|
70716
|
-
}
|
|
70717
|
-
return undefined;
|
|
70718
|
-
}
|
|
70719
|
-
module.exports = exports.default;
|
|
70720
|
-
}(buildMatchFn, buildMatchFn.exports));
|
|
70721
|
-
|
|
70722
|
-
var buildMatchPatternFn = {
|
|
70723
|
-
exports: {}
|
|
70724
|
-
};
|
|
70725
|
-
|
|
70726
|
-
(function (module, exports) {
|
|
70727
|
-
Object.defineProperty(exports, "__esModule", {
|
|
70728
|
-
value: true
|
|
70729
|
-
});
|
|
70730
|
-
exports.default = buildMatchPatternFn;
|
|
70731
|
-
function buildMatchPatternFn(args) {
|
|
70732
|
-
return function(string) {
|
|
70733
|
-
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
70734
|
-
var matchResult = string.match(args.matchPattern);
|
|
70735
|
-
if (!matchResult) return null;
|
|
70736
|
-
var matchedString = matchResult[0];
|
|
70737
|
-
var parseResult = string.match(args.parsePattern);
|
|
70738
|
-
if (!parseResult) return null;
|
|
70739
|
-
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
|
|
70740
|
-
value = options.valueCallback ? options.valueCallback(value) : value;
|
|
70741
|
-
var rest = string.slice(matchedString.length);
|
|
70742
|
-
return {
|
|
70743
|
-
value: value,
|
|
70744
|
-
rest: rest
|
|
70745
|
-
};
|
|
70746
|
-
};
|
|
70747
|
-
}
|
|
70748
|
-
module.exports = exports.default;
|
|
70749
|
-
}(buildMatchPatternFn, buildMatchPatternFn.exports));
|
|
70750
|
-
|
|
70751
|
-
(function (module, exports) {
|
|
70752
|
-
var _interopRequireDefault = interopRequireDefault.exports.default;
|
|
70753
|
-
Object.defineProperty(exports, "__esModule", {
|
|
70754
|
-
value: true
|
|
70755
|
-
});
|
|
70756
|
-
exports.default = void 0;
|
|
70757
|
-
var _index = _interopRequireDefault(buildMatchFn.exports);
|
|
70758
|
-
var _index2 = _interopRequireDefault(buildMatchPatternFn.exports);
|
|
70759
|
-
var matchOrdinalNumberPattern = /^(第\s*)?\d+(日|時|分|秒)?/i;
|
|
70760
|
-
var parseOrdinalNumberPattern = /\d+/i;
|
|
70761
|
-
var matchEraPatterns = {
|
|
70762
|
-
narrow: /^(前)/i,
|
|
70763
|
-
abbreviated: /^(前)/i,
|
|
70764
|
-
wide: /^(公元前|公元)/i
|
|
70765
|
-
};
|
|
70766
|
-
var parseEraPatterns = {
|
|
70767
|
-
any: [
|
|
70768
|
-
/^(前)/i,
|
|
70769
|
-
/^(公元)/i
|
|
70770
|
-
]
|
|
70771
|
-
};
|
|
70772
|
-
var matchQuarterPatterns = {
|
|
70773
|
-
narrow: /^[1234]/i,
|
|
70774
|
-
abbreviated: /^第[一二三四]刻/i,
|
|
70775
|
-
wide: /^第[一二三四]刻鐘/i
|
|
70776
|
-
};
|
|
70777
|
-
var parseQuarterPatterns = {
|
|
70778
|
-
any: [
|
|
70779
|
-
/(1|一)/i,
|
|
70780
|
-
/(2|二)/i,
|
|
70781
|
-
/(3|三)/i,
|
|
70782
|
-
/(4|四)/i
|
|
70783
|
-
]
|
|
70784
|
-
};
|
|
70785
|
-
var matchMonthPatterns = {
|
|
70786
|
-
narrow: /^(一|二|三|四|五|六|七|八|九|十[二一])/i,
|
|
70787
|
-
abbreviated: /^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,
|
|
70788
|
-
wide: /^(一|二|三|四|五|六|七|八|九|十[二一])月/i
|
|
70789
|
-
};
|
|
70790
|
-
var parseMonthPatterns = {
|
|
70791
|
-
narrow: [
|
|
70792
|
-
/^一/i,
|
|
70793
|
-
/^二/i,
|
|
70794
|
-
/^三/i,
|
|
70795
|
-
/^四/i,
|
|
70796
|
-
/^五/i,
|
|
70797
|
-
/^六/i,
|
|
70798
|
-
/^七/i,
|
|
70799
|
-
/^八/i,
|
|
70800
|
-
/^九/i,
|
|
70801
|
-
/^十(?!(一|二))/i,
|
|
70802
|
-
/^十一/i,
|
|
70803
|
-
/^十二/i
|
|
70804
|
-
],
|
|
70805
|
-
any: [
|
|
70806
|
-
/^一|1/i,
|
|
70807
|
-
/^二|2/i,
|
|
70808
|
-
/^三|3/i,
|
|
70809
|
-
/^四|4/i,
|
|
70810
|
-
/^五|5/i,
|
|
70811
|
-
/^六|6/i,
|
|
70812
|
-
/^七|7/i,
|
|
70813
|
-
/^八|8/i,
|
|
70814
|
-
/^九|9/i,
|
|
70815
|
-
/^十(?!(一|二))|10/i,
|
|
70816
|
-
/^十一|11/i,
|
|
70817
|
-
/^十二|12/i
|
|
70818
|
-
]
|
|
70819
|
-
};
|
|
70820
|
-
var matchDayPatterns = {
|
|
70821
|
-
narrow: /^[一二三四五六日]/i,
|
|
70822
|
-
short: /^[一二三四五六日]/i,
|
|
70823
|
-
abbreviated: /^週[一二三四五六日]/i,
|
|
70824
|
-
wide: /^星期[一二三四五六日]/i
|
|
70825
|
-
};
|
|
70826
|
-
var parseDayPatterns = {
|
|
70827
|
-
any: [
|
|
70828
|
-
/日/i,
|
|
70829
|
-
/一/i,
|
|
70830
|
-
/二/i,
|
|
70831
|
-
/三/i,
|
|
70832
|
-
/四/i,
|
|
70833
|
-
/五/i,
|
|
70834
|
-
/六/i
|
|
70835
|
-
]
|
|
70836
|
-
};
|
|
70837
|
-
var matchDayPeriodPatterns = {
|
|
70838
|
-
any: /^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨)/i
|
|
70839
|
-
};
|
|
70840
|
-
var parseDayPeriodPatterns = {
|
|
70841
|
-
any: {
|
|
70842
|
-
am: /^上午?/i,
|
|
70843
|
-
pm: /^下午?/i,
|
|
70844
|
-
midnight: /^午夜/i,
|
|
70845
|
-
noon: /^[中正]午/i,
|
|
70846
|
-
morning: /^早上/i,
|
|
70847
|
-
afternoon: /^下午/i,
|
|
70848
|
-
evening: /^晚上?/i,
|
|
70849
|
-
night: /^凌晨/i
|
|
70850
|
-
}
|
|
70851
|
-
};
|
|
70852
|
-
var match = {
|
|
70853
|
-
ordinalNumber: (0, _index2.default)({
|
|
70854
|
-
matchPattern: matchOrdinalNumberPattern,
|
|
70855
|
-
parsePattern: parseOrdinalNumberPattern,
|
|
70856
|
-
valueCallback: function valueCallback(value) {
|
|
70857
|
-
return parseInt(value, 10);
|
|
70858
|
-
}
|
|
70859
|
-
}),
|
|
70860
|
-
era: (0, _index.default)({
|
|
70861
|
-
matchPatterns: matchEraPatterns,
|
|
70862
|
-
defaultMatchWidth: "wide",
|
|
70863
|
-
parsePatterns: parseEraPatterns,
|
|
70864
|
-
defaultParseWidth: "any"
|
|
70865
|
-
}),
|
|
70866
|
-
quarter: (0, _index.default)({
|
|
70867
|
-
matchPatterns: matchQuarterPatterns,
|
|
70868
|
-
defaultMatchWidth: "wide",
|
|
70869
|
-
parsePatterns: parseQuarterPatterns,
|
|
70870
|
-
defaultParseWidth: "any",
|
|
70871
|
-
valueCallback: function valueCallback(index) {
|
|
70872
|
-
return index + 1;
|
|
70873
|
-
}
|
|
70874
|
-
}),
|
|
70875
|
-
month: (0, _index.default)({
|
|
70876
|
-
matchPatterns: matchMonthPatterns,
|
|
70877
|
-
defaultMatchWidth: "wide",
|
|
70878
|
-
parsePatterns: parseMonthPatterns,
|
|
70879
|
-
defaultParseWidth: "any"
|
|
70880
|
-
}),
|
|
70881
|
-
day: (0, _index.default)({
|
|
70882
|
-
matchPatterns: matchDayPatterns,
|
|
70883
|
-
defaultMatchWidth: "wide",
|
|
70884
|
-
parsePatterns: parseDayPatterns,
|
|
70885
|
-
defaultParseWidth: "any"
|
|
70886
|
-
}),
|
|
70887
|
-
dayPeriod: (0, _index.default)({
|
|
70888
|
-
matchPatterns: matchDayPeriodPatterns,
|
|
70889
|
-
defaultMatchWidth: "any",
|
|
70890
|
-
parsePatterns: parseDayPeriodPatterns,
|
|
70891
|
-
defaultParseWidth: "any"
|
|
70892
|
-
})
|
|
70893
|
-
};
|
|
70894
|
-
var _default = match;
|
|
70895
|
-
exports.default = _default;
|
|
70896
|
-
module.exports = exports.default;
|
|
70897
|
-
}(match, match.exports));
|
|
70898
|
-
|
|
70899
|
-
(function (module, exports) {
|
|
70900
|
-
var _interopRequireDefault = interopRequireDefault.exports.default;
|
|
70901
|
-
Object.defineProperty(exports, "__esModule", {
|
|
70902
|
-
value: true
|
|
70903
|
-
});
|
|
70904
|
-
exports.default = void 0;
|
|
70905
|
-
var _index = _interopRequireDefault(formatDistance.exports);
|
|
70906
|
-
var _index2 = _interopRequireDefault(formatLong.exports);
|
|
70907
|
-
var _index3 = _interopRequireDefault(formatRelative.exports);
|
|
70908
|
-
var _index4 = _interopRequireDefault(localize.exports);
|
|
70909
|
-
var _index5 = _interopRequireDefault(match.exports);
|
|
70910
|
-
/**
|
|
70911
|
-
* @type {Locale}
|
|
70912
|
-
* @category Locales
|
|
70913
|
-
* @summary Chinese Traditional locale.
|
|
70914
|
-
* @language Chinese Traditional
|
|
70915
|
-
* @iso-639-2 zho
|
|
70916
|
-
* @author tonypai [@tpai]{@link https://github.com/tpai}
|
|
70917
|
-
* @author Jack Hsu [@jackhsu978]{@link https://github.com/jackhsu978}
|
|
70918
|
-
* @author Terrence Lam [@skyuplam]{@link https://github.com/skyuplam}
|
|
70919
|
-
*/ var locale = {
|
|
70920
|
-
code: "zh-TW",
|
|
70921
|
-
formatDistance: _index.default,
|
|
70922
|
-
formatLong: _index2.default,
|
|
70923
|
-
formatRelative: _index3.default,
|
|
70924
|
-
localize: _index4.default,
|
|
70925
|
-
match: _index5.default,
|
|
70926
|
-
options: {
|
|
70927
|
-
weekStartsOn: 1 /* Monday */ ,
|
|
70928
|
-
firstWeekContainsDate: 4
|
|
70929
|
-
}
|
|
70930
|
-
};
|
|
70931
|
-
var _default = locale;
|
|
70932
|
-
exports.default = _default;
|
|
70933
|
-
module.exports = exports.default;
|
|
70934
|
-
}(zhTW$1, zhTW$1.exports));
|
|
70935
|
-
|
|
70936
|
-
var zhTW = /*@__PURE__*/getDefaultExportFromCjs(zhTW$1.exports);
|
|
70937
|
-
|
|
70938
|
-
function _define_property$1(obj, key, value) {
|
|
68239
|
+
function _define_property$4(obj, key, value) {
|
|
70939
68240
|
if (key in obj) {
|
|
70940
68241
|
Object.defineProperty(obj, key, {
|
|
70941
68242
|
value: value,
|
|
@@ -70966,7 +68267,7 @@ function _object_destructuring_empty(o) {
|
|
|
70966
68267
|
if (o === null || o === void 0) throw new TypeError("Cannot destructure " + o);
|
|
70967
68268
|
return o;
|
|
70968
68269
|
}
|
|
70969
|
-
function _object_spread$
|
|
68270
|
+
function _object_spread$4(target) {
|
|
70970
68271
|
for(var i = 1; i < arguments.length; i++){
|
|
70971
68272
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
70972
68273
|
var ownKeys = Object.keys(source);
|
|
@@ -70976,12 +68277,12 @@ function _object_spread$1(target) {
|
|
|
70976
68277
|
}));
|
|
70977
68278
|
}
|
|
70978
68279
|
ownKeys.forEach(function(key) {
|
|
70979
|
-
_define_property$
|
|
68280
|
+
_define_property$4(target, key, source[key]);
|
|
70980
68281
|
});
|
|
70981
68282
|
}
|
|
70982
68283
|
return target;
|
|
70983
68284
|
}
|
|
70984
|
-
function ownKeys(object, enumerableOnly) {
|
|
68285
|
+
function ownKeys$1(object, enumerableOnly) {
|
|
70985
68286
|
var keys = Object.keys(object);
|
|
70986
68287
|
if (Object.getOwnPropertySymbols) {
|
|
70987
68288
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
@@ -70994,20 +68295,20 @@ function ownKeys(object, enumerableOnly) {
|
|
|
70994
68295
|
}
|
|
70995
68296
|
return keys;
|
|
70996
68297
|
}
|
|
70997
|
-
function _object_spread_props(target, source) {
|
|
68298
|
+
function _object_spread_props$1(target, source) {
|
|
70998
68299
|
source = source != null ? source : {};
|
|
70999
68300
|
if (Object.getOwnPropertyDescriptors) {
|
|
71000
68301
|
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
71001
68302
|
} else {
|
|
71002
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
68303
|
+
ownKeys$1(Object(source)).forEach(function(key) {
|
|
71003
68304
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
71004
68305
|
});
|
|
71005
68306
|
}
|
|
71006
68307
|
return target;
|
|
71007
68308
|
}
|
|
71008
|
-
function _object_without_properties$
|
|
68309
|
+
function _object_without_properties$4(source, excluded) {
|
|
71009
68310
|
if (source == null) return {};
|
|
71010
|
-
var target = _object_without_properties_loose$
|
|
68311
|
+
var target = _object_without_properties_loose$4(source, excluded);
|
|
71011
68312
|
var key, i;
|
|
71012
68313
|
if (Object.getOwnPropertySymbols) {
|
|
71013
68314
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -71020,7 +68321,7 @@ function _object_without_properties$1(source, excluded) {
|
|
|
71020
68321
|
}
|
|
71021
68322
|
return target;
|
|
71022
68323
|
}
|
|
71023
|
-
function _object_without_properties_loose$
|
|
68324
|
+
function _object_without_properties_loose$4(source, excluded) {
|
|
71024
68325
|
if (source == null) return {};
|
|
71025
68326
|
var target = {};
|
|
71026
68327
|
var sourceKeys = Object.keys(source);
|
|
@@ -71033,15 +68334,15 @@ function _object_without_properties_loose$1(source, excluded) {
|
|
|
71033
68334
|
return target;
|
|
71034
68335
|
}
|
|
71035
68336
|
function Calendar(_param) {
|
|
71036
|
-
var className = _param.className, classNames = _param.classNames, _param_showOutsideDays = _param.showOutsideDays, showOutsideDays = _param_showOutsideDays === void 0 ? true : _param_showOutsideDays, props = _object_without_properties$
|
|
68337
|
+
var className = _param.className, classNames = _param.classNames, _param_showOutsideDays = _param.showOutsideDays, showOutsideDays = _param_showOutsideDays === void 0 ? true : _param_showOutsideDays, props = _object_without_properties$4(_param, [
|
|
71037
68338
|
"className",
|
|
71038
68339
|
"classNames",
|
|
71039
68340
|
"showOutsideDays"
|
|
71040
68341
|
]);
|
|
71041
|
-
return /*#__PURE__*/ jsx(DayPicker, _object_spread_props(_object_spread$
|
|
68342
|
+
return /*#__PURE__*/ jsx(DayPicker, _object_spread_props$1(_object_spread$4({
|
|
71042
68343
|
showOutsideDays: showOutsideDays,
|
|
71043
68344
|
className: cn("p-3", className),
|
|
71044
|
-
classNames: _object_spread$
|
|
68345
|
+
classNames: _object_spread$4({
|
|
71045
68346
|
months: "flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",
|
|
71046
68347
|
month: "space-y-4",
|
|
71047
68348
|
caption: "flex justify-center pt-1 relative items-center",
|
|
@@ -71093,7 +68394,7 @@ function Calendar(_param) {
|
|
|
71093
68394
|
}
|
|
71094
68395
|
Calendar.displayName = "Calendar";
|
|
71095
68396
|
|
|
71096
|
-
function _define_property(obj, key, value) {
|
|
68397
|
+
function _define_property$3(obj, key, value) {
|
|
71097
68398
|
if (key in obj) {
|
|
71098
68399
|
Object.defineProperty(obj, key, {
|
|
71099
68400
|
value: value,
|
|
@@ -71106,7 +68407,7 @@ function _define_property(obj, key, value) {
|
|
|
71106
68407
|
}
|
|
71107
68408
|
return obj;
|
|
71108
68409
|
}
|
|
71109
|
-
function _object_spread(target) {
|
|
68410
|
+
function _object_spread$3(target) {
|
|
71110
68411
|
for(var i = 1; i < arguments.length; i++){
|
|
71111
68412
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
71112
68413
|
var ownKeys = Object.keys(source);
|
|
@@ -71116,14 +68417,14 @@ function _object_spread(target) {
|
|
|
71116
68417
|
}));
|
|
71117
68418
|
}
|
|
71118
68419
|
ownKeys.forEach(function(key) {
|
|
71119
|
-
_define_property(target, key, source[key]);
|
|
68420
|
+
_define_property$3(target, key, source[key]);
|
|
71120
68421
|
});
|
|
71121
68422
|
}
|
|
71122
68423
|
return target;
|
|
71123
68424
|
}
|
|
71124
|
-
function _object_without_properties(source, excluded) {
|
|
68425
|
+
function _object_without_properties$3(source, excluded) {
|
|
71125
68426
|
if (source == null) return {};
|
|
71126
|
-
var target = _object_without_properties_loose(source, excluded);
|
|
68427
|
+
var target = _object_without_properties_loose$3(source, excluded);
|
|
71127
68428
|
var key, i;
|
|
71128
68429
|
if (Object.getOwnPropertySymbols) {
|
|
71129
68430
|
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
@@ -71136,7 +68437,7 @@ function _object_without_properties(source, excluded) {
|
|
|
71136
68437
|
}
|
|
71137
68438
|
return target;
|
|
71138
68439
|
}
|
|
71139
|
-
function _object_without_properties_loose(source, excluded) {
|
|
68440
|
+
function _object_without_properties_loose$3(source, excluded) {
|
|
71140
68441
|
if (source == null) return {};
|
|
71141
68442
|
var target = {};
|
|
71142
68443
|
var sourceKeys = Object.keys(source);
|
|
@@ -71151,13 +68452,13 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
71151
68452
|
var Popover = PopoverPrimitive.Root;
|
|
71152
68453
|
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
71153
68454
|
var PopoverContent = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
71154
|
-
var className = _param.className, _param_align = _param.align, align = _param_align === void 0 ? "center" : _param_align, _param_sideOffset = _param.sideOffset, sideOffset = _param_sideOffset === void 0 ? 4 : _param_sideOffset, props = _object_without_properties(_param, [
|
|
68455
|
+
var className = _param.className, _param_align = _param.align, align = _param_align === void 0 ? "center" : _param_align, _param_sideOffset = _param.sideOffset, sideOffset = _param_sideOffset === void 0 ? 4 : _param_sideOffset, props = _object_without_properties$3(_param, [
|
|
71155
68456
|
"className",
|
|
71156
68457
|
"align",
|
|
71157
68458
|
"sideOffset"
|
|
71158
68459
|
]);
|
|
71159
68460
|
return /*#__PURE__*/ jsx(PopoverPrimitive.Portal, {
|
|
71160
|
-
children: /*#__PURE__*/ jsx(PopoverPrimitive.Content, _object_spread({
|
|
68461
|
+
children: /*#__PURE__*/ jsx(PopoverPrimitive.Content, _object_spread$3({
|
|
71161
68462
|
ref: ref,
|
|
71162
68463
|
align: align,
|
|
71163
68464
|
sideOffset: sideOffset,
|
|
@@ -71378,4 +68679,414 @@ var ReactDateRange = function(param) {
|
|
|
71378
68679
|
});
|
|
71379
68680
|
};
|
|
71380
68681
|
|
|
68682
|
+
function _define_property$2(obj, key, value) {
|
|
68683
|
+
if (key in obj) {
|
|
68684
|
+
Object.defineProperty(obj, key, {
|
|
68685
|
+
value: value,
|
|
68686
|
+
enumerable: true,
|
|
68687
|
+
configurable: true,
|
|
68688
|
+
writable: true
|
|
68689
|
+
});
|
|
68690
|
+
} else {
|
|
68691
|
+
obj[key] = value;
|
|
68692
|
+
}
|
|
68693
|
+
return obj;
|
|
68694
|
+
}
|
|
68695
|
+
function _object_spread$2(target) {
|
|
68696
|
+
for(var i = 1; i < arguments.length; i++){
|
|
68697
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
68698
|
+
var ownKeys = Object.keys(source);
|
|
68699
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
68700
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
68701
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
68702
|
+
}));
|
|
68703
|
+
}
|
|
68704
|
+
ownKeys.forEach(function(key) {
|
|
68705
|
+
_define_property$2(target, key, source[key]);
|
|
68706
|
+
});
|
|
68707
|
+
}
|
|
68708
|
+
return target;
|
|
68709
|
+
}
|
|
68710
|
+
function ownKeys(object, enumerableOnly) {
|
|
68711
|
+
var keys = Object.keys(object);
|
|
68712
|
+
if (Object.getOwnPropertySymbols) {
|
|
68713
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
68714
|
+
if (enumerableOnly) {
|
|
68715
|
+
symbols = symbols.filter(function(sym) {
|
|
68716
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
68717
|
+
});
|
|
68718
|
+
}
|
|
68719
|
+
keys.push.apply(keys, symbols);
|
|
68720
|
+
}
|
|
68721
|
+
return keys;
|
|
68722
|
+
}
|
|
68723
|
+
function _object_spread_props(target, source) {
|
|
68724
|
+
source = source != null ? source : {};
|
|
68725
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
68726
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
68727
|
+
} else {
|
|
68728
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
68729
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
68730
|
+
});
|
|
68731
|
+
}
|
|
68732
|
+
return target;
|
|
68733
|
+
}
|
|
68734
|
+
function _object_without_properties$2(source, excluded) {
|
|
68735
|
+
if (source == null) return {};
|
|
68736
|
+
var target = _object_without_properties_loose$2(source, excluded);
|
|
68737
|
+
var key, i;
|
|
68738
|
+
if (Object.getOwnPropertySymbols) {
|
|
68739
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
68740
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
68741
|
+
key = sourceSymbolKeys[i];
|
|
68742
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
68743
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
68744
|
+
target[key] = source[key];
|
|
68745
|
+
}
|
|
68746
|
+
}
|
|
68747
|
+
return target;
|
|
68748
|
+
}
|
|
68749
|
+
function _object_without_properties_loose$2(source, excluded) {
|
|
68750
|
+
if (source == null) return {};
|
|
68751
|
+
var target = {};
|
|
68752
|
+
var sourceKeys = Object.keys(source);
|
|
68753
|
+
var key, i;
|
|
68754
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
68755
|
+
key = sourceKeys[i];
|
|
68756
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
68757
|
+
target[key] = source[key];
|
|
68758
|
+
}
|
|
68759
|
+
return target;
|
|
68760
|
+
}
|
|
68761
|
+
var DropdownMenuSubTrigger = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68762
|
+
var className = _param.className, inset = _param.inset, children = _param.children, props = _object_without_properties$2(_param, [
|
|
68763
|
+
"className",
|
|
68764
|
+
"inset",
|
|
68765
|
+
"children"
|
|
68766
|
+
]);
|
|
68767
|
+
return /*#__PURE__*/ jsxs(DropdownMenuPrimitive.SubTrigger, _object_spread_props(_object_spread$2({
|
|
68768
|
+
ref: ref,
|
|
68769
|
+
className: cn("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent", inset && "pl-8", className)
|
|
68770
|
+
}, props), {
|
|
68771
|
+
children: [
|
|
68772
|
+
children,
|
|
68773
|
+
/*#__PURE__*/ jsx(ChevronRightIcon, {
|
|
68774
|
+
className: "ml-auto h-4 w-4"
|
|
68775
|
+
})
|
|
68776
|
+
]
|
|
68777
|
+
}));
|
|
68778
|
+
});
|
|
68779
|
+
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
68780
|
+
var DropdownMenuSubContent = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68781
|
+
var className = _param.className, props = _object_without_properties$2(_param, [
|
|
68782
|
+
"className"
|
|
68783
|
+
]);
|
|
68784
|
+
return /*#__PURE__*/ jsx(DropdownMenuPrimitive.SubContent, _object_spread$2({
|
|
68785
|
+
ref: ref,
|
|
68786
|
+
className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className)
|
|
68787
|
+
}, props));
|
|
68788
|
+
});
|
|
68789
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
68790
|
+
var DropdownMenuContent = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68791
|
+
var className = _param.className, _param_sideOffset = _param.sideOffset, sideOffset = _param_sideOffset === void 0 ? 4 : _param_sideOffset, props = _object_without_properties$2(_param, [
|
|
68792
|
+
"className",
|
|
68793
|
+
"sideOffset"
|
|
68794
|
+
]);
|
|
68795
|
+
return /*#__PURE__*/ jsx(DropdownMenuPrimitive.Portal, {
|
|
68796
|
+
children: /*#__PURE__*/ jsx(DropdownMenuPrimitive.Content, _object_spread$2({
|
|
68797
|
+
ref: ref,
|
|
68798
|
+
sideOffset: sideOffset,
|
|
68799
|
+
className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className)
|
|
68800
|
+
}, props))
|
|
68801
|
+
});
|
|
68802
|
+
});
|
|
68803
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
68804
|
+
var DropdownMenuItem = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68805
|
+
var className = _param.className, inset = _param.inset, props = _object_without_properties$2(_param, [
|
|
68806
|
+
"className",
|
|
68807
|
+
"inset"
|
|
68808
|
+
]);
|
|
68809
|
+
return /*#__PURE__*/ jsx(DropdownMenuPrimitive.Item, _object_spread$2({
|
|
68810
|
+
ref: ref,
|
|
68811
|
+
className: cn("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", inset && "pl-8", className)
|
|
68812
|
+
}, props));
|
|
68813
|
+
});
|
|
68814
|
+
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
68815
|
+
var DropdownMenuCheckboxItem = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68816
|
+
var className = _param.className, children = _param.children, checked = _param.checked, props = _object_without_properties$2(_param, [
|
|
68817
|
+
"className",
|
|
68818
|
+
"children",
|
|
68819
|
+
"checked"
|
|
68820
|
+
]);
|
|
68821
|
+
return /*#__PURE__*/ jsxs(DropdownMenuPrimitive.CheckboxItem, _object_spread_props(_object_spread$2({
|
|
68822
|
+
ref: ref,
|
|
68823
|
+
className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className),
|
|
68824
|
+
checked: checked
|
|
68825
|
+
}, props), {
|
|
68826
|
+
children: [
|
|
68827
|
+
/*#__PURE__*/ jsx("span", {
|
|
68828
|
+
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
68829
|
+
children: /*#__PURE__*/ jsx(DropdownMenuPrimitive.ItemIndicator, {
|
|
68830
|
+
children: /*#__PURE__*/ jsx(CheckIcon, {
|
|
68831
|
+
className: "h-4 w-4"
|
|
68832
|
+
})
|
|
68833
|
+
})
|
|
68834
|
+
}),
|
|
68835
|
+
children
|
|
68836
|
+
]
|
|
68837
|
+
}));
|
|
68838
|
+
});
|
|
68839
|
+
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
68840
|
+
var DropdownMenuRadioItem = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68841
|
+
var className = _param.className, children = _param.children, props = _object_without_properties$2(_param, [
|
|
68842
|
+
"className",
|
|
68843
|
+
"children"
|
|
68844
|
+
]);
|
|
68845
|
+
return /*#__PURE__*/ jsxs(DropdownMenuPrimitive.RadioItem, _object_spread_props(_object_spread$2({
|
|
68846
|
+
ref: ref,
|
|
68847
|
+
className: cn("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", className)
|
|
68848
|
+
}, props), {
|
|
68849
|
+
children: [
|
|
68850
|
+
/*#__PURE__*/ jsx("span", {
|
|
68851
|
+
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
68852
|
+
children: /*#__PURE__*/ jsx(DropdownMenuPrimitive.ItemIndicator, {
|
|
68853
|
+
children: /*#__PURE__*/ jsx(DotFilledIcon, {
|
|
68854
|
+
className: "h-4 w-4 fill-current"
|
|
68855
|
+
})
|
|
68856
|
+
})
|
|
68857
|
+
}),
|
|
68858
|
+
children
|
|
68859
|
+
]
|
|
68860
|
+
}));
|
|
68861
|
+
});
|
|
68862
|
+
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
68863
|
+
var DropdownMenuLabel = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68864
|
+
var className = _param.className, inset = _param.inset, props = _object_without_properties$2(_param, [
|
|
68865
|
+
"className",
|
|
68866
|
+
"inset"
|
|
68867
|
+
]);
|
|
68868
|
+
return /*#__PURE__*/ jsx(DropdownMenuPrimitive.Label, _object_spread$2({
|
|
68869
|
+
ref: ref,
|
|
68870
|
+
className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className)
|
|
68871
|
+
}, props));
|
|
68872
|
+
});
|
|
68873
|
+
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
68874
|
+
var DropdownMenuSeparator = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68875
|
+
var className = _param.className, props = _object_without_properties$2(_param, [
|
|
68876
|
+
"className"
|
|
68877
|
+
]);
|
|
68878
|
+
return /*#__PURE__*/ jsx(DropdownMenuPrimitive.Separator, _object_spread$2({
|
|
68879
|
+
ref: ref,
|
|
68880
|
+
className: cn("-mx-1 my-1 h-px bg-muted", className)
|
|
68881
|
+
}, props));
|
|
68882
|
+
});
|
|
68883
|
+
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
68884
|
+
|
|
68885
|
+
function _define_property$1(obj, key, value) {
|
|
68886
|
+
if (key in obj) {
|
|
68887
|
+
Object.defineProperty(obj, key, {
|
|
68888
|
+
value: value,
|
|
68889
|
+
enumerable: true,
|
|
68890
|
+
configurable: true,
|
|
68891
|
+
writable: true
|
|
68892
|
+
});
|
|
68893
|
+
} else {
|
|
68894
|
+
obj[key] = value;
|
|
68895
|
+
}
|
|
68896
|
+
return obj;
|
|
68897
|
+
}
|
|
68898
|
+
function _object_spread$1(target) {
|
|
68899
|
+
for(var i = 1; i < arguments.length; i++){
|
|
68900
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
68901
|
+
var ownKeys = Object.keys(source);
|
|
68902
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
68903
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
68904
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
68905
|
+
}));
|
|
68906
|
+
}
|
|
68907
|
+
ownKeys.forEach(function(key) {
|
|
68908
|
+
_define_property$1(target, key, source[key]);
|
|
68909
|
+
});
|
|
68910
|
+
}
|
|
68911
|
+
return target;
|
|
68912
|
+
}
|
|
68913
|
+
function _object_without_properties$1(source, excluded) {
|
|
68914
|
+
if (source == null) return {};
|
|
68915
|
+
var target = _object_without_properties_loose$1(source, excluded);
|
|
68916
|
+
var key, i;
|
|
68917
|
+
if (Object.getOwnPropertySymbols) {
|
|
68918
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
68919
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
68920
|
+
key = sourceSymbolKeys[i];
|
|
68921
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
68922
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
68923
|
+
target[key] = source[key];
|
|
68924
|
+
}
|
|
68925
|
+
}
|
|
68926
|
+
return target;
|
|
68927
|
+
}
|
|
68928
|
+
function _object_without_properties_loose$1(source, excluded) {
|
|
68929
|
+
if (source == null) return {};
|
|
68930
|
+
var target = {};
|
|
68931
|
+
var sourceKeys = Object.keys(source);
|
|
68932
|
+
var key, i;
|
|
68933
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
68934
|
+
key = sourceKeys[i];
|
|
68935
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
68936
|
+
target[key] = source[key];
|
|
68937
|
+
}
|
|
68938
|
+
return target;
|
|
68939
|
+
}
|
|
68940
|
+
var Input = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
68941
|
+
var className = _param.className, type = _param.type, props = _object_without_properties$1(_param, [
|
|
68942
|
+
"className",
|
|
68943
|
+
"type"
|
|
68944
|
+
]);
|
|
68945
|
+
return /*#__PURE__*/ jsx("input", _object_spread$1({
|
|
68946
|
+
type: type,
|
|
68947
|
+
className: cn("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
68948
|
+
ref: ref
|
|
68949
|
+
}, props));
|
|
68950
|
+
});
|
|
68951
|
+
Input.displayName = "Input";
|
|
68952
|
+
|
|
68953
|
+
function _define_property(obj, key, value) {
|
|
68954
|
+
if (key in obj) {
|
|
68955
|
+
Object.defineProperty(obj, key, {
|
|
68956
|
+
value: value,
|
|
68957
|
+
enumerable: true,
|
|
68958
|
+
configurable: true,
|
|
68959
|
+
writable: true
|
|
68960
|
+
});
|
|
68961
|
+
} else {
|
|
68962
|
+
obj[key] = value;
|
|
68963
|
+
}
|
|
68964
|
+
return obj;
|
|
68965
|
+
}
|
|
68966
|
+
function _object_spread(target) {
|
|
68967
|
+
for(var i = 1; i < arguments.length; i++){
|
|
68968
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
68969
|
+
var ownKeys = Object.keys(source);
|
|
68970
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
68971
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
68972
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
68973
|
+
}));
|
|
68974
|
+
}
|
|
68975
|
+
ownKeys.forEach(function(key) {
|
|
68976
|
+
_define_property(target, key, source[key]);
|
|
68977
|
+
});
|
|
68978
|
+
}
|
|
68979
|
+
return target;
|
|
68980
|
+
}
|
|
68981
|
+
function _object_without_properties(source, excluded) {
|
|
68982
|
+
if (source == null) return {};
|
|
68983
|
+
var target = _object_without_properties_loose(source, excluded);
|
|
68984
|
+
var key, i;
|
|
68985
|
+
if (Object.getOwnPropertySymbols) {
|
|
68986
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
68987
|
+
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
68988
|
+
key = sourceSymbolKeys[i];
|
|
68989
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
68990
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
68991
|
+
target[key] = source[key];
|
|
68992
|
+
}
|
|
68993
|
+
}
|
|
68994
|
+
return target;
|
|
68995
|
+
}
|
|
68996
|
+
function _object_without_properties_loose(source, excluded) {
|
|
68997
|
+
if (source == null) return {};
|
|
68998
|
+
var target = {};
|
|
68999
|
+
var sourceKeys = Object.keys(source);
|
|
69000
|
+
var key, i;
|
|
69001
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
69002
|
+
key = sourceKeys[i];
|
|
69003
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
69004
|
+
target[key] = source[key];
|
|
69005
|
+
}
|
|
69006
|
+
return target;
|
|
69007
|
+
}
|
|
69008
|
+
var Table = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69009
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
69010
|
+
"className"
|
|
69011
|
+
]);
|
|
69012
|
+
return /*#__PURE__*/ jsx("div", {
|
|
69013
|
+
className: "relative w-full overflow-auto",
|
|
69014
|
+
children: /*#__PURE__*/ jsx("table", _object_spread({
|
|
69015
|
+
ref: ref,
|
|
69016
|
+
className: cn("w-full caption-bottom text-sm", className)
|
|
69017
|
+
}, props))
|
|
69018
|
+
});
|
|
69019
|
+
});
|
|
69020
|
+
Table.displayName = "Table";
|
|
69021
|
+
var TableHeader = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69022
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
69023
|
+
"className"
|
|
69024
|
+
]);
|
|
69025
|
+
return /*#__PURE__*/ jsx("thead", _object_spread({
|
|
69026
|
+
ref: ref,
|
|
69027
|
+
className: cn("[&_tr]:border-b", className)
|
|
69028
|
+
}, props));
|
|
69029
|
+
});
|
|
69030
|
+
TableHeader.displayName = "TableHeader";
|
|
69031
|
+
var TableBody = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69032
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
69033
|
+
"className"
|
|
69034
|
+
]);
|
|
69035
|
+
return /*#__PURE__*/ jsx("tbody", _object_spread({
|
|
69036
|
+
ref: ref,
|
|
69037
|
+
className: cn("[&_tr:last-child]:border-0", className)
|
|
69038
|
+
}, props));
|
|
69039
|
+
});
|
|
69040
|
+
TableBody.displayName = "TableBody";
|
|
69041
|
+
var TableFooter = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69042
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
69043
|
+
"className"
|
|
69044
|
+
]);
|
|
69045
|
+
return /*#__PURE__*/ jsx("tfoot", _object_spread({
|
|
69046
|
+
ref: ref,
|
|
69047
|
+
className: cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className)
|
|
69048
|
+
}, props));
|
|
69049
|
+
});
|
|
69050
|
+
TableFooter.displayName = "TableFooter";
|
|
69051
|
+
var TableRow = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69052
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
69053
|
+
"className"
|
|
69054
|
+
]);
|
|
69055
|
+
return /*#__PURE__*/ jsx("tr", _object_spread({
|
|
69056
|
+
ref: ref,
|
|
69057
|
+
className: cn("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", className)
|
|
69058
|
+
}, props));
|
|
69059
|
+
});
|
|
69060
|
+
TableRow.displayName = "TableRow";
|
|
69061
|
+
var TableHead = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69062
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
69063
|
+
"className"
|
|
69064
|
+
]);
|
|
69065
|
+
return /*#__PURE__*/ jsx("th", _object_spread({
|
|
69066
|
+
ref: ref,
|
|
69067
|
+
className: cn("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className)
|
|
69068
|
+
}, props));
|
|
69069
|
+
});
|
|
69070
|
+
TableHead.displayName = "TableHead";
|
|
69071
|
+
var TableCell = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69072
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
69073
|
+
"className"
|
|
69074
|
+
]);
|
|
69075
|
+
return /*#__PURE__*/ jsx("td", _object_spread({
|
|
69076
|
+
ref: ref,
|
|
69077
|
+
className: cn("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className)
|
|
69078
|
+
}, props));
|
|
69079
|
+
});
|
|
69080
|
+
TableCell.displayName = "TableCell";
|
|
69081
|
+
var TableCaption = /*#__PURE__*/ React.forwardRef(function(_param, ref) {
|
|
69082
|
+
var className = _param.className, props = _object_without_properties(_param, [
|
|
69083
|
+
"className"
|
|
69084
|
+
]);
|
|
69085
|
+
return /*#__PURE__*/ jsx("caption", _object_spread({
|
|
69086
|
+
ref: ref,
|
|
69087
|
+
className: cn("mt-4 text-sm text-muted-foreground", className)
|
|
69088
|
+
}, props));
|
|
69089
|
+
});
|
|
69090
|
+
TableCaption.displayName = "TableCaption";
|
|
69091
|
+
|
|
71381
69092
|
export { CkEditor, CustomUpload, DateRangePicker, DropImage, ReactDateRange, Spin, Switch, UiLibrary };
|