@teselagen/ove 0.7.30-beta.1 → 0.7.30-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +1739 -2203
- package/index.es.js +1739 -2203
- package/index.umd.js +1809 -2273
- package/package.json +15 -12
- package/selectors/orfsSelector.d.ts +2 -2
- package/selectors/translationsSelector.d.ts +1 -1
- package/src/AutoAnnotate.js +3 -3
- package/src/GlobalDialogUtils.js +2 -2
- package/src/ToolBar/alignmentTool.js +2 -2
- package/src/helperComponents/MergeFeaturesDialog/index.js +2 -2
- package/src/redux/alignments.js +2 -2
- package/src/redux/sequenceData/index.js +2 -2
- package/src/redux/sequenceData/upsertDeleteActionGenerator.js +2 -2
- package/src/selectors/cutsitesSelector.js +2 -2
- package/src/selectors/translationsSelector.js +3 -3
- package/src/utils/cleanSequenceData_DEPRECATED/arrayToObjWithIds.js +2 -2
- package/src/withEditorProps/index.js +2 -2
package/index.cjs.js
CHANGED
|
@@ -1534,10 +1534,10 @@ function debounce$2(fn5, ms) {
|
|
|
1534
1534
|
if (ms === 0) {
|
|
1535
1535
|
return fn5;
|
|
1536
1536
|
}
|
|
1537
|
-
var
|
|
1537
|
+
var timeout2;
|
|
1538
1538
|
return function(arg) {
|
|
1539
|
-
clearTimeout(
|
|
1540
|
-
|
|
1539
|
+
clearTimeout(timeout2);
|
|
1540
|
+
timeout2 = setTimeout(function() {
|
|
1541
1541
|
fn5(arg);
|
|
1542
1542
|
}, ms);
|
|
1543
1543
|
};
|
|
@@ -4655,19 +4655,15 @@ function requireClassnames() {
|
|
|
4655
4655
|
__name(requireClassnames, "requireClassnames");
|
|
4656
4656
|
var classnamesExports = requireClassnames();
|
|
4657
4657
|
const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
id2 +=
|
|
4664
|
-
} else if (byte > 62) {
|
|
4665
|
-
id2 += "-";
|
|
4666
|
-
} else {
|
|
4667
|
-
id2 += "_";
|
|
4658
|
+
const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
4659
|
+
let nanoid = /* @__PURE__ */ __name((size = 21) => {
|
|
4660
|
+
let id2 = "";
|
|
4661
|
+
let bytes = crypto.getRandomValues(new Uint8Array(size |= 0));
|
|
4662
|
+
while (size--) {
|
|
4663
|
+
id2 += urlAlphabet[bytes[size] & 63];
|
|
4668
4664
|
}
|
|
4669
4665
|
return id2;
|
|
4670
|
-
}, "
|
|
4666
|
+
}, "nanoid");
|
|
4671
4667
|
var papaparse_min$1 = { exports: {} };
|
|
4672
4668
|
/* @license
|
|
4673
4669
|
Papa Parse
|
|
@@ -7069,7 +7065,7 @@ function baseClamp(number2, lower, upper) {
|
|
|
7069
7065
|
return number2;
|
|
7070
7066
|
}
|
|
7071
7067
|
__name(baseClamp, "baseClamp");
|
|
7072
|
-
function clamp$
|
|
7068
|
+
function clamp$4(number2, lower, upper) {
|
|
7073
7069
|
if (upper === void 0) {
|
|
7074
7070
|
upper = lower;
|
|
7075
7071
|
lower = void 0;
|
|
@@ -7084,7 +7080,7 @@ function clamp$3(number2, lower, upper) {
|
|
|
7084
7080
|
}
|
|
7085
7081
|
return baseClamp(toNumber(number2), lower, upper);
|
|
7086
7082
|
}
|
|
7087
|
-
__name(clamp$
|
|
7083
|
+
__name(clamp$4, "clamp$4");
|
|
7088
7084
|
function stackClear() {
|
|
7089
7085
|
this.__data__ = new ListCache();
|
|
7090
7086
|
this.size = 0;
|
|
@@ -8901,15 +8897,15 @@ function _objectWithoutPropertiesLoose$4(source, excluded) {
|
|
|
8901
8897
|
return target;
|
|
8902
8898
|
}
|
|
8903
8899
|
__name(_objectWithoutPropertiesLoose$4, "_objectWithoutPropertiesLoose$4");
|
|
8904
|
-
var lib$
|
|
8905
|
-
var hasRequiredLib$
|
|
8906
|
-
function requireLib$
|
|
8907
|
-
if (hasRequiredLib$
|
|
8908
|
-
hasRequiredLib$
|
|
8909
|
-
Object.defineProperty(lib$
|
|
8900
|
+
var lib$8 = {};
|
|
8901
|
+
var hasRequiredLib$8;
|
|
8902
|
+
function requireLib$8() {
|
|
8903
|
+
if (hasRequiredLib$8) return lib$8;
|
|
8904
|
+
hasRequiredLib$8 = 1;
|
|
8905
|
+
Object.defineProperty(lib$8, "__esModule", {
|
|
8910
8906
|
value: true
|
|
8911
8907
|
});
|
|
8912
|
-
lib$
|
|
8908
|
+
lib$8.createChangeEmitter = /* @__PURE__ */ __name(function createChangeEmitter() {
|
|
8913
8909
|
var currentListeners = [];
|
|
8914
8910
|
var nextListeners = currentListeners;
|
|
8915
8911
|
function ensureCanMutateNextListeners() {
|
|
@@ -8949,10 +8945,10 @@ function requireLib$9() {
|
|
|
8949
8945
|
emit
|
|
8950
8946
|
};
|
|
8951
8947
|
}, "createChangeEmitter");
|
|
8952
|
-
return lib$
|
|
8948
|
+
return lib$8;
|
|
8953
8949
|
}
|
|
8954
|
-
__name(requireLib$
|
|
8955
|
-
requireLib$
|
|
8950
|
+
__name(requireLib$8, "requireLib$8");
|
|
8951
|
+
requireLib$8();
|
|
8956
8952
|
function symbolObservablePonyfill(root2) {
|
|
8957
8953
|
var result;
|
|
8958
8954
|
var Symbol2 = root2.Symbol;
|
|
@@ -16689,11 +16685,14 @@ function isEntityClean(e) {
|
|
|
16689
16685
|
}
|
|
16690
16686
|
__name(isEntityClean, "isEntityClean");
|
|
16691
16687
|
const getIdOrCodeOrIndex = /* @__PURE__ */ __name((record, rowIndex) => {
|
|
16692
|
-
if (record.id || record.id === 0) {
|
|
16688
|
+
if ("id" in record && (record.id || record.id === 0)) {
|
|
16693
16689
|
return record.id;
|
|
16694
|
-
} else if (record.code) {
|
|
16690
|
+
} else if ("code" in record && record.code) {
|
|
16695
16691
|
return record.code;
|
|
16696
16692
|
} else {
|
|
16693
|
+
if (rowIndex === void 0 || rowIndex === null) {
|
|
16694
|
+
throw new Error("id, code, or rowIndex must be provided");
|
|
16695
|
+
}
|
|
16697
16696
|
return rowIndex;
|
|
16698
16697
|
}
|
|
16699
16698
|
}, "getIdOrCodeOrIndex");
|
|
@@ -16775,17 +16774,22 @@ const getFieldPathToField = /* @__PURE__ */ __name((schema2) => {
|
|
|
16775
16774
|
});
|
|
16776
16775
|
return fieldPathToField;
|
|
16777
16776
|
}, "getFieldPathToField");
|
|
16778
|
-
const formatPasteData = /* @__PURE__ */ __name(({
|
|
16777
|
+
const formatPasteData = /* @__PURE__ */ __name(({
|
|
16778
|
+
schema: schema2,
|
|
16779
|
+
newVal: newVal2,
|
|
16780
|
+
path: path2
|
|
16781
|
+
}) => {
|
|
16779
16782
|
const pathToField = getFieldPathToField(schema2);
|
|
16780
16783
|
const column = pathToField[path2];
|
|
16781
16784
|
if (column.type === "genericSelect") {
|
|
16782
|
-
|
|
16783
|
-
|
|
16785
|
+
const value = newVal2;
|
|
16786
|
+
if (value.__genSelCol === path2) {
|
|
16787
|
+
newVal2 = value.__strVal;
|
|
16784
16788
|
} else {
|
|
16785
16789
|
newVal2 = void 0;
|
|
16786
16790
|
}
|
|
16787
16791
|
} else {
|
|
16788
|
-
newVal2 =
|
|
16792
|
+
newVal2 = typeof newVal2 === "object" && newVal2 !== null && "__strVal" in newVal2 ? newVal2.__strVal : newVal2;
|
|
16789
16793
|
}
|
|
16790
16794
|
return newVal2;
|
|
16791
16795
|
}, "formatPasteData");
|
|
@@ -16810,14 +16814,15 @@ const endsWithNumber = /* @__PURE__ */ __name((str) => {
|
|
|
16810
16814
|
return /[0-9]+$/.test(str);
|
|
16811
16815
|
}, "endsWithNumber");
|
|
16812
16816
|
const getNumberStrAtEnd = /* @__PURE__ */ __name((str) => {
|
|
16817
|
+
var _a2;
|
|
16813
16818
|
if (endsWithNumber(str)) {
|
|
16814
|
-
return str.match(/[0-9]+$/)[0];
|
|
16819
|
+
return (_a2 = str.match(/[0-9]+$/)) == null ? void 0 : _a2[0];
|
|
16815
16820
|
}
|
|
16816
16821
|
return null;
|
|
16817
16822
|
}, "getNumberStrAtEnd");
|
|
16818
16823
|
const stripNumberAtEnd = /* @__PURE__ */ __name((str) => {
|
|
16819
16824
|
var _a2;
|
|
16820
|
-
return (_a2 = str == null ? void 0 : str.replace) == null ? void 0 : _a2.call(str, getNumberStrAtEnd(str), "");
|
|
16825
|
+
return (_a2 = str == null ? void 0 : str.replace) == null ? void 0 : _a2.call(str, getNumberStrAtEnd(str) || "", "");
|
|
16821
16826
|
}, "stripNumberAtEnd");
|
|
16822
16827
|
const getAllRows = /* @__PURE__ */ __name((tableRef) => {
|
|
16823
16828
|
var _a2, _b2;
|
|
@@ -16854,7 +16859,7 @@ const getNewEntToSelect = /* @__PURE__ */ __name(({
|
|
|
16854
16859
|
}, "getNewEntToSelect");
|
|
16855
16860
|
const getLastSelectedEntity = /* @__PURE__ */ __name((idMap) => {
|
|
16856
16861
|
let lastSelectedEnt;
|
|
16857
|
-
let latestTime;
|
|
16862
|
+
let latestTime = null;
|
|
16858
16863
|
Object.values(idMap).forEach(({ time, entity }) => {
|
|
16859
16864
|
if (!latestTime || time > latestTime) {
|
|
16860
16865
|
lastSelectedEnt = entity;
|
|
@@ -16894,9 +16899,9 @@ const getCellInfo = /* @__PURE__ */ __name(({
|
|
|
16894
16899
|
};
|
|
16895
16900
|
}, "getCellInfo");
|
|
16896
16901
|
const getCellCopyText = /* @__PURE__ */ __name((cellWrapper) => {
|
|
16897
|
-
const text2 = cellWrapper
|
|
16898
|
-
const jsonText = cellWrapper
|
|
16899
|
-
const textContent = text2 || cellWrapper.textContent || "";
|
|
16902
|
+
const text2 = cellWrapper == null ? void 0 : cellWrapper.getAttribute("data-copy-text");
|
|
16903
|
+
const jsonText = cellWrapper == null ? void 0 : cellWrapper.getAttribute("data-copy-json");
|
|
16904
|
+
const textContent = text2 || (cellWrapper == null ? void 0 : cellWrapper.textContent) || "";
|
|
16900
16905
|
return [textContent, jsonText];
|
|
16901
16906
|
}, "getCellCopyText");
|
|
16902
16907
|
const getRowCopyText = /* @__PURE__ */ __name((rowEl, { specificColumn } = {}) => {
|
|
@@ -17204,7 +17209,7 @@ function rowClick(e, rowInfo, entities, {
|
|
|
17204
17209
|
if (noSelect || isEntityDisabled(entity)) return;
|
|
17205
17210
|
const rowId = getIdOrCodeOrIndex(entity, rowInfo.index);
|
|
17206
17211
|
if (rowId === void 0) return;
|
|
17207
|
-
const
|
|
17212
|
+
const ctrl2 = e.metaKey || e.ctrlKey || withCheckboxes && !e.shiftKey;
|
|
17208
17213
|
const oldIdMap = reduxFormSelectedEntityIdMap || {};
|
|
17209
17214
|
const rowSelected = oldIdMap[rowId];
|
|
17210
17215
|
let newIdMap = {
|
|
@@ -17216,12 +17221,12 @@ function rowClick(e, rowInfo, entities, {
|
|
|
17216
17221
|
if (isSingleSelect) {
|
|
17217
17222
|
if (rowSelected) newIdMap = {};
|
|
17218
17223
|
} else if (rowSelected && e.shiftKey) return;
|
|
17219
|
-
else if (rowSelected &&
|
|
17224
|
+
else if (rowSelected && ctrl2) {
|
|
17220
17225
|
newIdMap = __spreadValues({}, oldIdMap);
|
|
17221
17226
|
delete newIdMap[rowId];
|
|
17222
17227
|
} else if (rowSelected) {
|
|
17223
17228
|
newIdMap = {};
|
|
17224
|
-
} else if (
|
|
17229
|
+
} else if (ctrl2) {
|
|
17225
17230
|
newIdMap = __spreadValues(__spreadValues({}, oldIdMap), newIdMap);
|
|
17226
17231
|
} else if (e.shiftKey && !isEmpty$1(oldIdMap)) {
|
|
17227
17232
|
newIdMap = {
|
|
@@ -19531,23 +19536,23 @@ function requireParse() {
|
|
|
19531
19536
|
return parse$4;
|
|
19532
19537
|
}
|
|
19533
19538
|
__name(requireParse, "requireParse");
|
|
19534
|
-
var lib$
|
|
19535
|
-
var hasRequiredLib$
|
|
19536
|
-
function requireLib$
|
|
19537
|
-
if (hasRequiredLib$
|
|
19538
|
-
hasRequiredLib$
|
|
19539
|
+
var lib$7;
|
|
19540
|
+
var hasRequiredLib$7;
|
|
19541
|
+
function requireLib$7() {
|
|
19542
|
+
if (hasRequiredLib$7) return lib$7;
|
|
19543
|
+
hasRequiredLib$7 = 1;
|
|
19539
19544
|
var stringify2 = /* @__PURE__ */ requireStringify();
|
|
19540
19545
|
var parse3 = /* @__PURE__ */ requireParse();
|
|
19541
19546
|
var formats2 = /* @__PURE__ */ requireFormats();
|
|
19542
|
-
lib$
|
|
19547
|
+
lib$7 = {
|
|
19543
19548
|
formats: formats2,
|
|
19544
19549
|
parse: parse3,
|
|
19545
19550
|
stringify: stringify2
|
|
19546
19551
|
};
|
|
19547
|
-
return lib$
|
|
19552
|
+
return lib$7;
|
|
19548
19553
|
}
|
|
19549
|
-
__name(requireLib$
|
|
19550
|
-
var libExports$3 = /* @__PURE__ */ requireLib$
|
|
19554
|
+
__name(requireLib$7, "requireLib$7");
|
|
19555
|
+
var libExports$3 = /* @__PURE__ */ requireLib$7();
|
|
19551
19556
|
const queryString = /* @__PURE__ */ getDefaultExportFromCjs(libExports$3);
|
|
19552
19557
|
function tableQueryParamsToHasuraClauses({
|
|
19553
19558
|
page,
|
|
@@ -20040,8 +20045,9 @@ function initializeHasuraWhereAndFilter(additionalFilter, where = {}, currentPar
|
|
|
20040
20045
|
if (newWhere) {
|
|
20041
20046
|
Object.assign(where, newWhere);
|
|
20042
20047
|
}
|
|
20043
|
-
} else if (typeof additionalFilter === "object")
|
|
20048
|
+
} else if (typeof additionalFilter === "object" && additionalFilter !== null) {
|
|
20044
20049
|
where._and.push(additionalFilter);
|
|
20050
|
+
}
|
|
20045
20051
|
}
|
|
20046
20052
|
__name(initializeHasuraWhereAndFilter, "initializeHasuraWhereAndFilter");
|
|
20047
20053
|
const defaultPageSizes = [5, 10, 15, 25, 50, 100, 200, 400];
|
|
@@ -20549,7 +20555,7 @@ const PagingTool = /* @__PURE__ */ __name(({
|
|
|
20549
20555
|
}
|
|
20550
20556
|
));
|
|
20551
20557
|
}, "PagingTool");
|
|
20552
|
-
var lib$
|
|
20558
|
+
var lib$6 = {};
|
|
20553
20559
|
var flattenNames = {};
|
|
20554
20560
|
var _freeGlobal;
|
|
20555
20561
|
var hasRequired_freeGlobal;
|
|
@@ -23921,14 +23927,14 @@ function requireLoop() {
|
|
|
23921
23927
|
return loop;
|
|
23922
23928
|
}
|
|
23923
23929
|
__name(requireLoop, "requireLoop");
|
|
23924
|
-
var hasRequiredLib$
|
|
23925
|
-
function requireLib$
|
|
23926
|
-
if (hasRequiredLib$
|
|
23927
|
-
hasRequiredLib$
|
|
23928
|
-
Object.defineProperty(lib$
|
|
23930
|
+
var hasRequiredLib$6;
|
|
23931
|
+
function requireLib$6() {
|
|
23932
|
+
if (hasRequiredLib$6) return lib$6;
|
|
23933
|
+
hasRequiredLib$6 = 1;
|
|
23934
|
+
Object.defineProperty(lib$6, "__esModule", {
|
|
23929
23935
|
value: true
|
|
23930
23936
|
});
|
|
23931
|
-
lib$
|
|
23937
|
+
lib$6.ReactCSS = lib$6.loop = lib$6.handleActive = lib$6.handleHover = lib$6.hover = void 0;
|
|
23932
23938
|
var _flattenNames = requireFlattenNames();
|
|
23933
23939
|
var _flattenNames2 = _interopRequireDefault(_flattenNames);
|
|
23934
23940
|
var _mergeClasses = requireMergeClasses();
|
|
@@ -23945,11 +23951,11 @@ function requireLib$7() {
|
|
|
23945
23951
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
23946
23952
|
}
|
|
23947
23953
|
__name(_interopRequireDefault, "_interopRequireDefault");
|
|
23948
|
-
lib$
|
|
23949
|
-
lib$
|
|
23950
|
-
lib$
|
|
23951
|
-
lib$
|
|
23952
|
-
var ReactCSS = lib$
|
|
23954
|
+
lib$6.hover = _hover3.default;
|
|
23955
|
+
lib$6.handleHover = _hover3.default;
|
|
23956
|
+
lib$6.handleActive = _active2.default;
|
|
23957
|
+
lib$6.loop = _loop3.default;
|
|
23958
|
+
var ReactCSS = lib$6.ReactCSS = /* @__PURE__ */ __name(function ReactCSS2(classes) {
|
|
23953
23959
|
for (var _len = arguments.length, activations = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
23954
23960
|
activations[_key - 1] = arguments[_key];
|
|
23955
23961
|
}
|
|
@@ -23957,11 +23963,11 @@ function requireLib$7() {
|
|
|
23957
23963
|
var merged = (0, _mergeClasses2.default)(classes, activeNames);
|
|
23958
23964
|
return (0, _autoprefix2.default)(merged);
|
|
23959
23965
|
}, "ReactCSS");
|
|
23960
|
-
lib$
|
|
23961
|
-
return lib$
|
|
23966
|
+
lib$6.default = ReactCSS;
|
|
23967
|
+
return lib$6;
|
|
23962
23968
|
}
|
|
23963
|
-
__name(requireLib$
|
|
23964
|
-
var libExports$2 = requireLib$
|
|
23969
|
+
__name(requireLib$6, "requireLib$6");
|
|
23970
|
+
var libExports$2 = requireLib$6();
|
|
23965
23971
|
const reactCSS = /* @__PURE__ */ getDefaultExportFromCjs(libExports$2);
|
|
23966
23972
|
var calculateChange$2 = /* @__PURE__ */ __name(function calculateChange(e, hsl, direction, initialA, container) {
|
|
23967
23973
|
var containerWidth = container.clientWidth;
|
|
@@ -30370,11 +30376,20 @@ function requireFuzzysearch() {
|
|
|
30370
30376
|
__name(requireFuzzysearch, "requireFuzzysearch");
|
|
30371
30377
|
var fuzzysearchExports = requireFuzzysearch();
|
|
30372
30378
|
const fuzzysearch = /* @__PURE__ */ getDefaultExportFromCjs(fuzzysearchExports);
|
|
30379
|
+
const isReactElement = /* @__PURE__ */ __name((el) => {
|
|
30380
|
+
if (el) {
|
|
30381
|
+
const newEl = el;
|
|
30382
|
+
if (newEl.props && newEl.props.children) {
|
|
30383
|
+
return true;
|
|
30384
|
+
}
|
|
30385
|
+
}
|
|
30386
|
+
return false;
|
|
30387
|
+
}, "isReactElement");
|
|
30373
30388
|
function getTextFromEl(el, options = {}) {
|
|
30374
30389
|
const { lowerCase: lowerCase2 } = options;
|
|
30375
30390
|
if (React.isValidElement(el)) {
|
|
30376
|
-
return el && el.props && el.props.children ? (el.props.children
|
|
30377
|
-
if (child
|
|
30391
|
+
return el && el.props && el.props.children ? (Array.isArray(el.props.children) ? el.props.children : [el.props.children]).reduce((acc, child) => {
|
|
30392
|
+
if (isReactElement(child)) {
|
|
30378
30393
|
acc += getTextFromEl(child);
|
|
30379
30394
|
} else if (typeof child === "string") {
|
|
30380
30395
|
if (lowerCase2) {
|
|
@@ -30392,1795 +30407,1578 @@ function getTextFromEl(el, options = {}) {
|
|
|
30392
30407
|
}
|
|
30393
30408
|
}
|
|
30394
30409
|
__name(getTextFromEl, "getTextFromEl");
|
|
30395
|
-
|
|
30396
|
-
|
|
30397
|
-
|
|
30398
|
-
|
|
30399
|
-
|
|
30400
|
-
|
|
30401
|
-
|
|
30402
|
-
|
|
30403
|
-
|
|
30404
|
-
|
|
30405
|
-
|
|
30406
|
-
|
|
30407
|
-
|
|
30408
|
-
|
|
30409
|
-
|
|
30410
|
-
|
|
30411
|
-
|
|
30412
|
-
|
|
30413
|
-
|
|
30414
|
-
|
|
30415
|
-
|
|
30416
|
-
|
|
30417
|
-
|
|
30418
|
-
|
|
30419
|
-
|
|
30420
|
-
|
|
30421
|
-
|
|
30422
|
-
|
|
30423
|
-
|
|
30424
|
-
|
|
30425
|
-
|
|
30426
|
-
|
|
30427
|
-
|
|
30428
|
-
|
|
30429
|
-
|
|
30430
|
-
|
|
30431
|
-
|
|
30432
|
-
|
|
30433
|
-
|
|
30434
|
-
|
|
30435
|
-
|
|
30436
|
-
|
|
30437
|
-
|
|
30438
|
-
|
|
30439
|
-
|
|
30440
|
-
|
|
30441
|
-
|
|
30442
|
-
|
|
30443
|
-
|
|
30444
|
-
|
|
30445
|
-
|
|
30446
|
-
|
|
30447
|
-
|
|
30448
|
-
|
|
30449
|
-
|
|
30450
|
-
|
|
30451
|
-
|
|
30452
|
-
|
|
30453
|
-
|
|
30454
|
-
|
|
30455
|
-
|
|
30456
|
-
|
|
30457
|
-
|
|
30458
|
-
|
|
30459
|
-
|
|
30460
|
-
|
|
30461
|
-
|
|
30462
|
-
|
|
30463
|
-
|
|
30464
|
-
|
|
30465
|
-
|
|
30466
|
-
|
|
30467
|
-
|
|
30468
|
-
|
|
30469
|
-
|
|
30470
|
-
|
|
30471
|
-
|
|
30472
|
-
|
|
30473
|
-
|
|
30474
|
-
|
|
30475
|
-
|
|
30476
|
-
|
|
30477
|
-
|
|
30478
|
-
|
|
30479
|
-
|
|
30480
|
-
|
|
30481
|
-
|
|
30482
|
-
|
|
30483
|
-
|
|
30484
|
-
|
|
30485
|
-
|
|
30486
|
-
|
|
30487
|
-
|
|
30488
|
-
|
|
30489
|
-
|
|
30490
|
-
|
|
30491
|
-
|
|
30492
|
-
|
|
30493
|
-
|
|
30494
|
-
|
|
30495
|
-
|
|
30496
|
-
|
|
30497
|
-
|
|
30498
|
-
|
|
30499
|
-
|
|
30500
|
-
|
|
30501
|
-
|
|
30502
|
-
|
|
30503
|
-
|
|
30504
|
-
|
|
30505
|
-
|
|
30506
|
-
|
|
30507
|
-
|
|
30508
|
-
|
|
30509
|
-
|
|
30510
|
-
|
|
30511
|
-
|
|
30512
|
-
|
|
30513
|
-
|
|
30514
|
-
|
|
30515
|
-
|
|
30516
|
-
|
|
30517
|
-
|
|
30518
|
-
|
|
30519
|
-
|
|
30520
|
-
|
|
30521
|
-
|
|
30522
|
-
|
|
30523
|
-
|
|
30524
|
-
|
|
30525
|
-
|
|
30526
|
-
|
|
30527
|
-
|
|
30528
|
-
|
|
30529
|
-
|
|
30530
|
-
|
|
30531
|
-
|
|
30532
|
-
|
|
30533
|
-
|
|
30534
|
-
|
|
30535
|
-
|
|
30536
|
-
|
|
30537
|
-
|
|
30538
|
-
|
|
30539
|
-
|
|
30540
|
-
|
|
30541
|
-
|
|
30542
|
-
|
|
30543
|
-
|
|
30544
|
-
|
|
30545
|
-
|
|
30546
|
-
|
|
30547
|
-
|
|
30548
|
-
|
|
30549
|
-
|
|
30550
|
-
};
|
|
30551
|
-
return colorName$1;
|
|
30552
|
-
}
|
|
30553
|
-
__name(requireColorName$1, "requireColorName$1");
|
|
30554
|
-
var simpleSwizzle = { exports: {} };
|
|
30555
|
-
var isArrayish;
|
|
30556
|
-
var hasRequiredIsArrayish;
|
|
30557
|
-
function requireIsArrayish() {
|
|
30558
|
-
if (hasRequiredIsArrayish) return isArrayish;
|
|
30559
|
-
hasRequiredIsArrayish = 1;
|
|
30560
|
-
isArrayish = /* @__PURE__ */ __name(function isArrayish2(obj) {
|
|
30561
|
-
if (!obj || typeof obj === "string") {
|
|
30562
|
-
return false;
|
|
30563
|
-
}
|
|
30564
|
-
return obj instanceof Array || Array.isArray(obj) || obj.length >= 0 && (obj.splice instanceof Function || Object.getOwnPropertyDescriptor(obj, obj.length - 1) && obj.constructor.name !== "String");
|
|
30565
|
-
}, "isArrayish");
|
|
30566
|
-
return isArrayish;
|
|
30410
|
+
const cssKeywords = {
|
|
30411
|
+
aliceblue: [240, 248, 255],
|
|
30412
|
+
antiquewhite: [250, 235, 215],
|
|
30413
|
+
aqua: [0, 255, 255],
|
|
30414
|
+
aquamarine: [127, 255, 212],
|
|
30415
|
+
azure: [240, 255, 255],
|
|
30416
|
+
beige: [245, 245, 220],
|
|
30417
|
+
bisque: [255, 228, 196],
|
|
30418
|
+
black: [0, 0, 0],
|
|
30419
|
+
blanchedalmond: [255, 235, 205],
|
|
30420
|
+
blue: [0, 0, 255],
|
|
30421
|
+
blueviolet: [138, 43, 226],
|
|
30422
|
+
brown: [165, 42, 42],
|
|
30423
|
+
burlywood: [222, 184, 135],
|
|
30424
|
+
cadetblue: [95, 158, 160],
|
|
30425
|
+
chartreuse: [127, 255, 0],
|
|
30426
|
+
chocolate: [210, 105, 30],
|
|
30427
|
+
coral: [255, 127, 80],
|
|
30428
|
+
cornflowerblue: [100, 149, 237],
|
|
30429
|
+
cornsilk: [255, 248, 220],
|
|
30430
|
+
crimson: [220, 20, 60],
|
|
30431
|
+
cyan: [0, 255, 255],
|
|
30432
|
+
darkblue: [0, 0, 139],
|
|
30433
|
+
darkcyan: [0, 139, 139],
|
|
30434
|
+
darkgoldenrod: [184, 134, 11],
|
|
30435
|
+
darkgray: [169, 169, 169],
|
|
30436
|
+
darkgreen: [0, 100, 0],
|
|
30437
|
+
darkgrey: [169, 169, 169],
|
|
30438
|
+
darkkhaki: [189, 183, 107],
|
|
30439
|
+
darkmagenta: [139, 0, 139],
|
|
30440
|
+
darkolivegreen: [85, 107, 47],
|
|
30441
|
+
darkorange: [255, 140, 0],
|
|
30442
|
+
darkorchid: [153, 50, 204],
|
|
30443
|
+
darkred: [139, 0, 0],
|
|
30444
|
+
darksalmon: [233, 150, 122],
|
|
30445
|
+
darkseagreen: [143, 188, 143],
|
|
30446
|
+
darkslateblue: [72, 61, 139],
|
|
30447
|
+
darkslategray: [47, 79, 79],
|
|
30448
|
+
darkslategrey: [47, 79, 79],
|
|
30449
|
+
darkturquoise: [0, 206, 209],
|
|
30450
|
+
darkviolet: [148, 0, 211],
|
|
30451
|
+
deeppink: [255, 20, 147],
|
|
30452
|
+
deepskyblue: [0, 191, 255],
|
|
30453
|
+
dimgray: [105, 105, 105],
|
|
30454
|
+
dimgrey: [105, 105, 105],
|
|
30455
|
+
dodgerblue: [30, 144, 255],
|
|
30456
|
+
firebrick: [178, 34, 34],
|
|
30457
|
+
floralwhite: [255, 250, 240],
|
|
30458
|
+
forestgreen: [34, 139, 34],
|
|
30459
|
+
fuchsia: [255, 0, 255],
|
|
30460
|
+
gainsboro: [220, 220, 220],
|
|
30461
|
+
ghostwhite: [248, 248, 255],
|
|
30462
|
+
gold: [255, 215, 0],
|
|
30463
|
+
goldenrod: [218, 165, 32],
|
|
30464
|
+
gray: [128, 128, 128],
|
|
30465
|
+
green: [0, 128, 0],
|
|
30466
|
+
greenyellow: [173, 255, 47],
|
|
30467
|
+
grey: [128, 128, 128],
|
|
30468
|
+
honeydew: [240, 255, 240],
|
|
30469
|
+
hotpink: [255, 105, 180],
|
|
30470
|
+
indianred: [205, 92, 92],
|
|
30471
|
+
indigo: [75, 0, 130],
|
|
30472
|
+
ivory: [255, 255, 240],
|
|
30473
|
+
khaki: [240, 230, 140],
|
|
30474
|
+
lavender: [230, 230, 250],
|
|
30475
|
+
lavenderblush: [255, 240, 245],
|
|
30476
|
+
lawngreen: [124, 252, 0],
|
|
30477
|
+
lemonchiffon: [255, 250, 205],
|
|
30478
|
+
lightblue: [173, 216, 230],
|
|
30479
|
+
lightcoral: [240, 128, 128],
|
|
30480
|
+
lightcyan: [224, 255, 255],
|
|
30481
|
+
lightgoldenrodyellow: [250, 250, 210],
|
|
30482
|
+
lightgray: [211, 211, 211],
|
|
30483
|
+
lightgreen: [144, 238, 144],
|
|
30484
|
+
lightgrey: [211, 211, 211],
|
|
30485
|
+
lightpink: [255, 182, 193],
|
|
30486
|
+
lightsalmon: [255, 160, 122],
|
|
30487
|
+
lightseagreen: [32, 178, 170],
|
|
30488
|
+
lightskyblue: [135, 206, 250],
|
|
30489
|
+
lightslategray: [119, 136, 153],
|
|
30490
|
+
lightslategrey: [119, 136, 153],
|
|
30491
|
+
lightsteelblue: [176, 196, 222],
|
|
30492
|
+
lightyellow: [255, 255, 224],
|
|
30493
|
+
lime: [0, 255, 0],
|
|
30494
|
+
limegreen: [50, 205, 50],
|
|
30495
|
+
linen: [250, 240, 230],
|
|
30496
|
+
magenta: [255, 0, 255],
|
|
30497
|
+
maroon: [128, 0, 0],
|
|
30498
|
+
mediumaquamarine: [102, 205, 170],
|
|
30499
|
+
mediumblue: [0, 0, 205],
|
|
30500
|
+
mediumorchid: [186, 85, 211],
|
|
30501
|
+
mediumpurple: [147, 112, 219],
|
|
30502
|
+
mediumseagreen: [60, 179, 113],
|
|
30503
|
+
mediumslateblue: [123, 104, 238],
|
|
30504
|
+
mediumspringgreen: [0, 250, 154],
|
|
30505
|
+
mediumturquoise: [72, 209, 204],
|
|
30506
|
+
mediumvioletred: [199, 21, 133],
|
|
30507
|
+
midnightblue: [25, 25, 112],
|
|
30508
|
+
mintcream: [245, 255, 250],
|
|
30509
|
+
mistyrose: [255, 228, 225],
|
|
30510
|
+
moccasin: [255, 228, 181],
|
|
30511
|
+
navajowhite: [255, 222, 173],
|
|
30512
|
+
navy: [0, 0, 128],
|
|
30513
|
+
oldlace: [253, 245, 230],
|
|
30514
|
+
olive: [128, 128, 0],
|
|
30515
|
+
olivedrab: [107, 142, 35],
|
|
30516
|
+
orange: [255, 165, 0],
|
|
30517
|
+
orangered: [255, 69, 0],
|
|
30518
|
+
orchid: [218, 112, 214],
|
|
30519
|
+
palegoldenrod: [238, 232, 170],
|
|
30520
|
+
palegreen: [152, 251, 152],
|
|
30521
|
+
paleturquoise: [175, 238, 238],
|
|
30522
|
+
palevioletred: [219, 112, 147],
|
|
30523
|
+
papayawhip: [255, 239, 213],
|
|
30524
|
+
peachpuff: [255, 218, 185],
|
|
30525
|
+
peru: [205, 133, 63],
|
|
30526
|
+
pink: [255, 192, 203],
|
|
30527
|
+
plum: [221, 160, 221],
|
|
30528
|
+
powderblue: [176, 224, 230],
|
|
30529
|
+
purple: [128, 0, 128],
|
|
30530
|
+
rebeccapurple: [102, 51, 153],
|
|
30531
|
+
red: [255, 0, 0],
|
|
30532
|
+
rosybrown: [188, 143, 143],
|
|
30533
|
+
royalblue: [65, 105, 225],
|
|
30534
|
+
saddlebrown: [139, 69, 19],
|
|
30535
|
+
salmon: [250, 128, 114],
|
|
30536
|
+
sandybrown: [244, 164, 96],
|
|
30537
|
+
seagreen: [46, 139, 87],
|
|
30538
|
+
seashell: [255, 245, 238],
|
|
30539
|
+
sienna: [160, 82, 45],
|
|
30540
|
+
silver: [192, 192, 192],
|
|
30541
|
+
skyblue: [135, 206, 235],
|
|
30542
|
+
slateblue: [106, 90, 205],
|
|
30543
|
+
slategray: [112, 128, 144],
|
|
30544
|
+
slategrey: [112, 128, 144],
|
|
30545
|
+
snow: [255, 250, 250],
|
|
30546
|
+
springgreen: [0, 255, 127],
|
|
30547
|
+
steelblue: [70, 130, 180],
|
|
30548
|
+
tan: [210, 180, 140],
|
|
30549
|
+
teal: [0, 128, 128],
|
|
30550
|
+
thistle: [216, 191, 216],
|
|
30551
|
+
tomato: [255, 99, 71],
|
|
30552
|
+
turquoise: [64, 224, 208],
|
|
30553
|
+
violet: [238, 130, 238],
|
|
30554
|
+
wheat: [245, 222, 179],
|
|
30555
|
+
white: [255, 255, 255],
|
|
30556
|
+
whitesmoke: [245, 245, 245],
|
|
30557
|
+
yellow: [255, 255, 0],
|
|
30558
|
+
yellowgreen: [154, 205, 50]
|
|
30559
|
+
};
|
|
30560
|
+
const reverseNames = /* @__PURE__ */ Object.create(null);
|
|
30561
|
+
for (const name2 in cssKeywords) {
|
|
30562
|
+
if (Object.hasOwn(cssKeywords, name2)) {
|
|
30563
|
+
reverseNames[cssKeywords[name2]] = name2;
|
|
30564
|
+
}
|
|
30567
30565
|
}
|
|
30568
|
-
|
|
30569
|
-
|
|
30570
|
-
|
|
30571
|
-
|
|
30572
|
-
|
|
30573
|
-
|
|
30574
|
-
|
|
30575
|
-
|
|
30576
|
-
|
|
30577
|
-
|
|
30578
|
-
|
|
30579
|
-
|
|
30580
|
-
|
|
30581
|
-
results = concat.call(results, slice.call(arg));
|
|
30582
|
-
} else {
|
|
30583
|
-
results.push(arg);
|
|
30584
|
-
}
|
|
30566
|
+
const cs = {
|
|
30567
|
+
to: {},
|
|
30568
|
+
get: {}
|
|
30569
|
+
};
|
|
30570
|
+
cs.get = function(string2) {
|
|
30571
|
+
const prefix2 = string2.slice(0, 3).toLowerCase();
|
|
30572
|
+
let value;
|
|
30573
|
+
let model;
|
|
30574
|
+
switch (prefix2) {
|
|
30575
|
+
case "hsl": {
|
|
30576
|
+
value = cs.get.hsl(string2);
|
|
30577
|
+
model = "hsl";
|
|
30578
|
+
break;
|
|
30585
30579
|
}
|
|
30586
|
-
|
|
30587
|
-
|
|
30588
|
-
|
|
30589
|
-
|
|
30590
|
-
return fn4(swizzle(arguments));
|
|
30591
|
-
};
|
|
30592
|
-
};
|
|
30593
|
-
return simpleSwizzle.exports;
|
|
30594
|
-
}
|
|
30595
|
-
__name(requireSimpleSwizzle, "requireSimpleSwizzle");
|
|
30596
|
-
var hasRequiredColorString;
|
|
30597
|
-
function requireColorString() {
|
|
30598
|
-
if (hasRequiredColorString) return colorString.exports;
|
|
30599
|
-
hasRequiredColorString = 1;
|
|
30600
|
-
var colorNames = requireColorName$1();
|
|
30601
|
-
var swizzle = requireSimpleSwizzle();
|
|
30602
|
-
var hasOwnProperty2 = Object.hasOwnProperty;
|
|
30603
|
-
var reverseNames = /* @__PURE__ */ Object.create(null);
|
|
30604
|
-
for (var name2 in colorNames) {
|
|
30605
|
-
if (hasOwnProperty2.call(colorNames, name2)) {
|
|
30606
|
-
reverseNames[colorNames[name2]] = name2;
|
|
30607
|
-
}
|
|
30608
|
-
}
|
|
30609
|
-
var cs = colorString.exports = {
|
|
30610
|
-
to: {},
|
|
30611
|
-
get: {}
|
|
30612
|
-
};
|
|
30613
|
-
cs.get = function(string2) {
|
|
30614
|
-
var prefix2 = string2.substring(0, 3).toLowerCase();
|
|
30615
|
-
var val2;
|
|
30616
|
-
var model;
|
|
30617
|
-
switch (prefix2) {
|
|
30618
|
-
case "hsl":
|
|
30619
|
-
val2 = cs.get.hsl(string2);
|
|
30620
|
-
model = "hsl";
|
|
30621
|
-
break;
|
|
30622
|
-
case "hwb":
|
|
30623
|
-
val2 = cs.get.hwb(string2);
|
|
30624
|
-
model = "hwb";
|
|
30625
|
-
break;
|
|
30626
|
-
default:
|
|
30627
|
-
val2 = cs.get.rgb(string2);
|
|
30628
|
-
model = "rgb";
|
|
30629
|
-
break;
|
|
30580
|
+
case "hwb": {
|
|
30581
|
+
value = cs.get.hwb(string2);
|
|
30582
|
+
model = "hwb";
|
|
30583
|
+
break;
|
|
30630
30584
|
}
|
|
30631
|
-
|
|
30632
|
-
|
|
30585
|
+
default: {
|
|
30586
|
+
value = cs.get.rgb(string2);
|
|
30587
|
+
model = "rgb";
|
|
30588
|
+
break;
|
|
30633
30589
|
}
|
|
30634
|
-
|
|
30635
|
-
|
|
30636
|
-
|
|
30637
|
-
|
|
30638
|
-
|
|
30590
|
+
}
|
|
30591
|
+
if (!value) {
|
|
30592
|
+
return null;
|
|
30593
|
+
}
|
|
30594
|
+
return { model, value };
|
|
30595
|
+
};
|
|
30596
|
+
cs.get.rgb = function(string2) {
|
|
30597
|
+
if (!string2) {
|
|
30598
|
+
return null;
|
|
30599
|
+
}
|
|
30600
|
+
const abbr = /^#([a-f\d]{3,4})$/i;
|
|
30601
|
+
const hex = /^#([a-f\d]{6})([a-f\d]{2})?$/i;
|
|
30602
|
+
const rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/;
|
|
30603
|
+
const per = /^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/;
|
|
30604
|
+
const keyword = /^(\w+)$/;
|
|
30605
|
+
let rgb = [0, 0, 0, 1];
|
|
30606
|
+
let match;
|
|
30607
|
+
let i;
|
|
30608
|
+
let hexAlpha;
|
|
30609
|
+
if (match = string2.match(hex)) {
|
|
30610
|
+
hexAlpha = match[2];
|
|
30611
|
+
match = match[1];
|
|
30612
|
+
for (i = 0; i < 3; i++) {
|
|
30613
|
+
const i2 = i * 2;
|
|
30614
|
+
rgb[i] = Number.parseInt(match.slice(i2, i2 + 2), 16);
|
|
30639
30615
|
}
|
|
30640
|
-
|
|
30641
|
-
|
|
30642
|
-
var rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
|
|
30643
|
-
var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
|
|
30644
|
-
var keyword = /^(\w+)$/;
|
|
30645
|
-
var rgb = [0, 0, 0, 1];
|
|
30646
|
-
var match;
|
|
30647
|
-
var i;
|
|
30648
|
-
var hexAlpha;
|
|
30649
|
-
if (match = string2.match(hex)) {
|
|
30650
|
-
hexAlpha = match[2];
|
|
30651
|
-
match = match[1];
|
|
30652
|
-
for (i = 0; i < 3; i++) {
|
|
30653
|
-
var i2 = i * 2;
|
|
30654
|
-
rgb[i] = parseInt(match.slice(i2, i2 + 2), 16);
|
|
30655
|
-
}
|
|
30656
|
-
if (hexAlpha) {
|
|
30657
|
-
rgb[3] = parseInt(hexAlpha, 16) / 255;
|
|
30658
|
-
}
|
|
30659
|
-
} else if (match = string2.match(abbr)) {
|
|
30660
|
-
match = match[1];
|
|
30661
|
-
hexAlpha = match[3];
|
|
30662
|
-
for (i = 0; i < 3; i++) {
|
|
30663
|
-
rgb[i] = parseInt(match[i] + match[i], 16);
|
|
30664
|
-
}
|
|
30665
|
-
if (hexAlpha) {
|
|
30666
|
-
rgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;
|
|
30667
|
-
}
|
|
30668
|
-
} else if (match = string2.match(rgba)) {
|
|
30669
|
-
for (i = 0; i < 3; i++) {
|
|
30670
|
-
rgb[i] = parseInt(match[i + 1], 0);
|
|
30671
|
-
}
|
|
30672
|
-
if (match[4]) {
|
|
30673
|
-
if (match[5]) {
|
|
30674
|
-
rgb[3] = parseFloat(match[4]) * 0.01;
|
|
30675
|
-
} else {
|
|
30676
|
-
rgb[3] = parseFloat(match[4]);
|
|
30677
|
-
}
|
|
30678
|
-
}
|
|
30679
|
-
} else if (match = string2.match(per)) {
|
|
30680
|
-
for (i = 0; i < 3; i++) {
|
|
30681
|
-
rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
|
|
30682
|
-
}
|
|
30683
|
-
if (match[4]) {
|
|
30684
|
-
if (match[5]) {
|
|
30685
|
-
rgb[3] = parseFloat(match[4]) * 0.01;
|
|
30686
|
-
} else {
|
|
30687
|
-
rgb[3] = parseFloat(match[4]);
|
|
30688
|
-
}
|
|
30689
|
-
}
|
|
30690
|
-
} else if (match = string2.match(keyword)) {
|
|
30691
|
-
if (match[1] === "transparent") {
|
|
30692
|
-
return [0, 0, 0, 0];
|
|
30693
|
-
}
|
|
30694
|
-
if (!hasOwnProperty2.call(colorNames, match[1])) {
|
|
30695
|
-
return null;
|
|
30696
|
-
}
|
|
30697
|
-
rgb = colorNames[match[1]];
|
|
30698
|
-
rgb[3] = 1;
|
|
30699
|
-
return rgb;
|
|
30700
|
-
} else {
|
|
30701
|
-
return null;
|
|
30616
|
+
if (hexAlpha) {
|
|
30617
|
+
rgb[3] = Number.parseInt(hexAlpha, 16) / 255;
|
|
30702
30618
|
}
|
|
30619
|
+
} else if (match = string2.match(abbr)) {
|
|
30620
|
+
match = match[1];
|
|
30621
|
+
hexAlpha = match[3];
|
|
30703
30622
|
for (i = 0; i < 3; i++) {
|
|
30704
|
-
rgb[i] =
|
|
30623
|
+
rgb[i] = Number.parseInt(match[i] + match[i], 16);
|
|
30705
30624
|
}
|
|
30706
|
-
|
|
30707
|
-
|
|
30708
|
-
};
|
|
30709
|
-
cs.get.hsl = function(string2) {
|
|
30710
|
-
if (!string2) {
|
|
30711
|
-
return null;
|
|
30625
|
+
if (hexAlpha) {
|
|
30626
|
+
rgb[3] = Number.parseInt(hexAlpha + hexAlpha, 16) / 255;
|
|
30712
30627
|
}
|
|
30713
|
-
|
|
30714
|
-
|
|
30715
|
-
|
|
30716
|
-
var alpha = parseFloat(match[4]);
|
|
30717
|
-
var h2 = (parseFloat(match[1]) % 360 + 360) % 360;
|
|
30718
|
-
var s2 = clamp2(parseFloat(match[2]), 0, 100);
|
|
30719
|
-
var l2 = clamp2(parseFloat(match[3]), 0, 100);
|
|
30720
|
-
var a2 = clamp2(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
30721
|
-
return [h2, s2, l2, a2];
|
|
30628
|
+
} else if (match = string2.match(rgba)) {
|
|
30629
|
+
for (i = 0; i < 3; i++) {
|
|
30630
|
+
rgb[i] = Number.parseInt(match[i + 1], 10);
|
|
30722
30631
|
}
|
|
30723
|
-
|
|
30724
|
-
|
|
30725
|
-
cs.get.hwb = function(string2) {
|
|
30726
|
-
if (!string2) {
|
|
30727
|
-
return null;
|
|
30632
|
+
if (match[4]) {
|
|
30633
|
+
rgb[3] = match[5] ? Number.parseFloat(match[4]) * 0.01 : Number.parseFloat(match[4]);
|
|
30728
30634
|
}
|
|
30729
|
-
|
|
30730
|
-
|
|
30731
|
-
|
|
30732
|
-
|
|
30733
|
-
|
|
30734
|
-
|
|
30735
|
-
var b3 = clamp2(parseFloat(match[3]), 0, 100);
|
|
30736
|
-
var a2 = clamp2(isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
30737
|
-
return [h2, w2, b3, a2];
|
|
30635
|
+
} else if (match = string2.match(per)) {
|
|
30636
|
+
for (i = 0; i < 3; i++) {
|
|
30637
|
+
rgb[i] = Math.round(Number.parseFloat(match[i + 1]) * 2.55);
|
|
30638
|
+
}
|
|
30639
|
+
if (match[4]) {
|
|
30640
|
+
rgb[3] = match[5] ? Number.parseFloat(match[4]) * 0.01 : Number.parseFloat(match[4]);
|
|
30738
30641
|
}
|
|
30642
|
+
} else if (match = string2.match(keyword)) {
|
|
30643
|
+
if (match[1] === "transparent") {
|
|
30644
|
+
return [0, 0, 0, 0];
|
|
30645
|
+
}
|
|
30646
|
+
if (!Object.hasOwn(cssKeywords, match[1])) {
|
|
30647
|
+
return null;
|
|
30648
|
+
}
|
|
30649
|
+
rgb = cssKeywords[match[1]];
|
|
30650
|
+
rgb[3] = 1;
|
|
30651
|
+
return rgb;
|
|
30652
|
+
} else {
|
|
30739
30653
|
return null;
|
|
30740
|
-
}
|
|
30741
|
-
|
|
30742
|
-
|
|
30743
|
-
|
|
30744
|
-
|
|
30745
|
-
|
|
30746
|
-
|
|
30747
|
-
|
|
30748
|
-
|
|
30749
|
-
|
|
30750
|
-
|
|
30751
|
-
|
|
30752
|
-
|
|
30753
|
-
|
|
30754
|
-
|
|
30755
|
-
|
|
30756
|
-
|
|
30757
|
-
|
|
30758
|
-
|
|
30759
|
-
|
|
30760
|
-
|
|
30761
|
-
|
|
30762
|
-
|
|
30763
|
-
|
|
30764
|
-
|
|
30765
|
-
|
|
30766
|
-
|
|
30767
|
-
}
|
|
30768
|
-
|
|
30769
|
-
|
|
30770
|
-
|
|
30771
|
-
|
|
30772
|
-
|
|
30773
|
-
|
|
30774
|
-
|
|
30775
|
-
|
|
30776
|
-
|
|
30777
|
-
|
|
30778
|
-
|
|
30779
|
-
|
|
30780
|
-
return
|
|
30781
|
-
}
|
|
30782
|
-
|
|
30783
|
-
|
|
30784
|
-
|
|
30785
|
-
|
|
30786
|
-
|
|
30787
|
-
|
|
30788
|
-
|
|
30789
|
-
|
|
30790
|
-
|
|
30791
|
-
|
|
30792
|
-
|
|
30793
|
-
|
|
30794
|
-
|
|
30795
|
-
|
|
30796
|
-
|
|
30797
|
-
"
|
|
30798
|
-
|
|
30799
|
-
|
|
30800
|
-
|
|
30801
|
-
|
|
30802
|
-
|
|
30803
|
-
|
|
30804
|
-
|
|
30805
|
-
|
|
30806
|
-
|
|
30807
|
-
|
|
30808
|
-
|
|
30809
|
-
|
|
30810
|
-
|
|
30811
|
-
|
|
30812
|
-
|
|
30813
|
-
|
|
30814
|
-
|
|
30815
|
-
|
|
30816
|
-
|
|
30817
|
-
|
|
30818
|
-
|
|
30819
|
-
|
|
30820
|
-
|
|
30821
|
-
|
|
30822
|
-
|
|
30823
|
-
|
|
30824
|
-
|
|
30825
|
-
|
|
30826
|
-
|
|
30827
|
-
|
|
30828
|
-
|
|
30829
|
-
|
|
30830
|
-
|
|
30831
|
-
|
|
30832
|
-
|
|
30833
|
-
|
|
30834
|
-
|
|
30835
|
-
|
|
30836
|
-
|
|
30837
|
-
|
|
30838
|
-
|
|
30839
|
-
|
|
30840
|
-
|
|
30841
|
-
|
|
30842
|
-
|
|
30843
|
-
|
|
30844
|
-
|
|
30845
|
-
|
|
30846
|
-
|
|
30847
|
-
|
|
30848
|
-
"
|
|
30849
|
-
|
|
30850
|
-
|
|
30851
|
-
"
|
|
30852
|
-
|
|
30853
|
-
|
|
30854
|
-
"
|
|
30855
|
-
|
|
30856
|
-
|
|
30857
|
-
|
|
30858
|
-
|
|
30859
|
-
|
|
30860
|
-
|
|
30861
|
-
|
|
30862
|
-
|
|
30863
|
-
|
|
30864
|
-
|
|
30865
|
-
|
|
30866
|
-
|
|
30867
|
-
|
|
30868
|
-
|
|
30869
|
-
|
|
30870
|
-
|
|
30871
|
-
|
|
30872
|
-
|
|
30873
|
-
"limegreen": [50, 205, 50],
|
|
30874
|
-
"linen": [250, 240, 230],
|
|
30875
|
-
"magenta": [255, 0, 255],
|
|
30876
|
-
"maroon": [128, 0, 0],
|
|
30877
|
-
"mediumaquamarine": [102, 205, 170],
|
|
30878
|
-
"mediumblue": [0, 0, 205],
|
|
30879
|
-
"mediumorchid": [186, 85, 211],
|
|
30880
|
-
"mediumpurple": [147, 112, 219],
|
|
30881
|
-
"mediumseagreen": [60, 179, 113],
|
|
30882
|
-
"mediumslateblue": [123, 104, 238],
|
|
30883
|
-
"mediumspringgreen": [0, 250, 154],
|
|
30884
|
-
"mediumturquoise": [72, 209, 204],
|
|
30885
|
-
"mediumvioletred": [199, 21, 133],
|
|
30886
|
-
"midnightblue": [25, 25, 112],
|
|
30887
|
-
"mintcream": [245, 255, 250],
|
|
30888
|
-
"mistyrose": [255, 228, 225],
|
|
30889
|
-
"moccasin": [255, 228, 181],
|
|
30890
|
-
"navajowhite": [255, 222, 173],
|
|
30891
|
-
"navy": [0, 0, 128],
|
|
30892
|
-
"oldlace": [253, 245, 230],
|
|
30893
|
-
"olive": [128, 128, 0],
|
|
30894
|
-
"olivedrab": [107, 142, 35],
|
|
30895
|
-
"orange": [255, 165, 0],
|
|
30896
|
-
"orangered": [255, 69, 0],
|
|
30897
|
-
"orchid": [218, 112, 214],
|
|
30898
|
-
"palegoldenrod": [238, 232, 170],
|
|
30899
|
-
"palegreen": [152, 251, 152],
|
|
30900
|
-
"paleturquoise": [175, 238, 238],
|
|
30901
|
-
"palevioletred": [219, 112, 147],
|
|
30902
|
-
"papayawhip": [255, 239, 213],
|
|
30903
|
-
"peachpuff": [255, 218, 185],
|
|
30904
|
-
"peru": [205, 133, 63],
|
|
30905
|
-
"pink": [255, 192, 203],
|
|
30906
|
-
"plum": [221, 160, 221],
|
|
30907
|
-
"powderblue": [176, 224, 230],
|
|
30908
|
-
"purple": [128, 0, 128],
|
|
30909
|
-
"rebeccapurple": [102, 51, 153],
|
|
30910
|
-
"red": [255, 0, 0],
|
|
30911
|
-
"rosybrown": [188, 143, 143],
|
|
30912
|
-
"royalblue": [65, 105, 225],
|
|
30913
|
-
"saddlebrown": [139, 69, 19],
|
|
30914
|
-
"salmon": [250, 128, 114],
|
|
30915
|
-
"sandybrown": [244, 164, 96],
|
|
30916
|
-
"seagreen": [46, 139, 87],
|
|
30917
|
-
"seashell": [255, 245, 238],
|
|
30918
|
-
"sienna": [160, 82, 45],
|
|
30919
|
-
"silver": [192, 192, 192],
|
|
30920
|
-
"skyblue": [135, 206, 235],
|
|
30921
|
-
"slateblue": [106, 90, 205],
|
|
30922
|
-
"slategray": [112, 128, 144],
|
|
30923
|
-
"slategrey": [112, 128, 144],
|
|
30924
|
-
"snow": [255, 250, 250],
|
|
30925
|
-
"springgreen": [0, 255, 127],
|
|
30926
|
-
"steelblue": [70, 130, 180],
|
|
30927
|
-
"tan": [210, 180, 140],
|
|
30928
|
-
"teal": [0, 128, 128],
|
|
30929
|
-
"thistle": [216, 191, 216],
|
|
30930
|
-
"tomato": [255, 99, 71],
|
|
30931
|
-
"turquoise": [64, 224, 208],
|
|
30932
|
-
"violet": [238, 130, 238],
|
|
30933
|
-
"wheat": [245, 222, 179],
|
|
30934
|
-
"white": [255, 255, 255],
|
|
30935
|
-
"whitesmoke": [245, 245, 245],
|
|
30936
|
-
"yellow": [255, 255, 0],
|
|
30937
|
-
"yellowgreen": [154, 205, 50]
|
|
30938
|
-
};
|
|
30939
|
-
return colorName;
|
|
30940
|
-
}
|
|
30941
|
-
__name(requireColorName, "requireColorName");
|
|
30942
|
-
var hasRequiredConversions;
|
|
30943
|
-
function requireConversions() {
|
|
30944
|
-
if (hasRequiredConversions) return conversions.exports;
|
|
30945
|
-
hasRequiredConversions = 1;
|
|
30946
|
-
var cssKeywords = requireColorName();
|
|
30947
|
-
var reverseKeywords = {};
|
|
30948
|
-
for (var key in cssKeywords) {
|
|
30949
|
-
if (cssKeywords.hasOwnProperty(key)) {
|
|
30950
|
-
reverseKeywords[cssKeywords[key]] = key;
|
|
30951
|
-
}
|
|
30952
|
-
}
|
|
30953
|
-
var convert2 = conversions.exports = {
|
|
30954
|
-
rgb: { channels: 3, labels: "rgb" },
|
|
30955
|
-
hsl: { channels: 3, labels: "hsl" },
|
|
30956
|
-
hsv: { channels: 3, labels: "hsv" },
|
|
30957
|
-
hwb: { channels: 3, labels: "hwb" },
|
|
30958
|
-
cmyk: { channels: 4, labels: "cmyk" },
|
|
30959
|
-
xyz: { channels: 3, labels: "xyz" },
|
|
30960
|
-
lab: { channels: 3, labels: "lab" },
|
|
30961
|
-
lch: { channels: 3, labels: "lch" },
|
|
30962
|
-
hex: { channels: 1, labels: ["hex"] },
|
|
30963
|
-
keyword: { channels: 1, labels: ["keyword"] },
|
|
30964
|
-
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
30965
|
-
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
30966
|
-
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
30967
|
-
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
30968
|
-
gray: { channels: 1, labels: ["gray"] }
|
|
30969
|
-
};
|
|
30970
|
-
for (var model in convert2) {
|
|
30971
|
-
if (convert2.hasOwnProperty(model)) {
|
|
30972
|
-
if (!("channels" in convert2[model])) {
|
|
30973
|
-
throw new Error("missing channels property: " + model);
|
|
30974
|
-
}
|
|
30975
|
-
if (!("labels" in convert2[model])) {
|
|
30976
|
-
throw new Error("missing channel labels property: " + model);
|
|
30977
|
-
}
|
|
30978
|
-
if (convert2[model].labels.length !== convert2[model].channels) {
|
|
30979
|
-
throw new Error("channel and label counts mismatch: " + model);
|
|
30980
|
-
}
|
|
30981
|
-
var channels = convert2[model].channels;
|
|
30982
|
-
var labels = convert2[model].labels;
|
|
30983
|
-
delete convert2[model].channels;
|
|
30984
|
-
delete convert2[model].labels;
|
|
30985
|
-
Object.defineProperty(convert2[model], "channels", { value: channels });
|
|
30986
|
-
Object.defineProperty(convert2[model], "labels", { value: labels });
|
|
30987
|
-
}
|
|
30988
|
-
}
|
|
30989
|
-
convert2.rgb.hsl = function(rgb) {
|
|
30990
|
-
var r2 = rgb[0] / 255;
|
|
30991
|
-
var g2 = rgb[1] / 255;
|
|
30992
|
-
var b3 = rgb[2] / 255;
|
|
30993
|
-
var min2 = Math.min(r2, g2, b3);
|
|
30994
|
-
var max2 = Math.max(r2, g2, b3);
|
|
30995
|
-
var delta = max2 - min2;
|
|
30996
|
-
var h2;
|
|
30997
|
-
var s2;
|
|
30998
|
-
var l2;
|
|
30999
|
-
if (max2 === min2) {
|
|
30654
|
+
}
|
|
30655
|
+
for (i = 0; i < 3; i++) {
|
|
30656
|
+
rgb[i] = clamp$3(rgb[i], 0, 255);
|
|
30657
|
+
}
|
|
30658
|
+
rgb[3] = clamp$3(rgb[3], 0, 1);
|
|
30659
|
+
return rgb;
|
|
30660
|
+
};
|
|
30661
|
+
cs.get.hsl = function(string2) {
|
|
30662
|
+
if (!string2) {
|
|
30663
|
+
return null;
|
|
30664
|
+
}
|
|
30665
|
+
const hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
|
|
30666
|
+
const match = string2.match(hsl);
|
|
30667
|
+
if (match) {
|
|
30668
|
+
const alpha = Number.parseFloat(match[4]);
|
|
30669
|
+
const h2 = (Number.parseFloat(match[1]) % 360 + 360) % 360;
|
|
30670
|
+
const s2 = clamp$3(Number.parseFloat(match[2]), 0, 100);
|
|
30671
|
+
const l2 = clamp$3(Number.parseFloat(match[3]), 0, 100);
|
|
30672
|
+
const a2 = clamp$3(Number.isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
30673
|
+
return [h2, s2, l2, a2];
|
|
30674
|
+
}
|
|
30675
|
+
return null;
|
|
30676
|
+
};
|
|
30677
|
+
cs.get.hwb = function(string2) {
|
|
30678
|
+
if (!string2) {
|
|
30679
|
+
return null;
|
|
30680
|
+
}
|
|
30681
|
+
const hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
|
|
30682
|
+
const match = string2.match(hwb);
|
|
30683
|
+
if (match) {
|
|
30684
|
+
const alpha = Number.parseFloat(match[4]);
|
|
30685
|
+
const h2 = (Number.parseFloat(match[1]) % 360 + 360) % 360;
|
|
30686
|
+
const w2 = clamp$3(Number.parseFloat(match[2]), 0, 100);
|
|
30687
|
+
const b3 = clamp$3(Number.parseFloat(match[3]), 0, 100);
|
|
30688
|
+
const a2 = clamp$3(Number.isNaN(alpha) ? 1 : alpha, 0, 1);
|
|
30689
|
+
return [h2, w2, b3, a2];
|
|
30690
|
+
}
|
|
30691
|
+
return null;
|
|
30692
|
+
};
|
|
30693
|
+
cs.to.hex = function(...rgba) {
|
|
30694
|
+
return "#" + hexDouble(rgba[0]) + hexDouble(rgba[1]) + hexDouble(rgba[2]) + (rgba[3] < 1 ? hexDouble(Math.round(rgba[3] * 255)) : "");
|
|
30695
|
+
};
|
|
30696
|
+
cs.to.rgb = function(...rgba) {
|
|
30697
|
+
return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ")" : "rgba(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ", " + rgba[3] + ")";
|
|
30698
|
+
};
|
|
30699
|
+
cs.to.rgb.percent = function(...rgba) {
|
|
30700
|
+
const r2 = Math.round(rgba[0] / 255 * 100);
|
|
30701
|
+
const g2 = Math.round(rgba[1] / 255 * 100);
|
|
30702
|
+
const b3 = Math.round(rgba[2] / 255 * 100);
|
|
30703
|
+
return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + r2 + "%, " + g2 + "%, " + b3 + "%)" : "rgba(" + r2 + "%, " + g2 + "%, " + b3 + "%, " + rgba[3] + ")";
|
|
30704
|
+
};
|
|
30705
|
+
cs.to.hsl = function(...hsla) {
|
|
30706
|
+
return hsla.length < 4 || hsla[3] === 1 ? "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)" : "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, " + hsla[3] + ")";
|
|
30707
|
+
};
|
|
30708
|
+
cs.to.hwb = function(...hwba) {
|
|
30709
|
+
let a2 = "";
|
|
30710
|
+
if (hwba.length >= 4 && hwba[3] !== 1) {
|
|
30711
|
+
a2 = ", " + hwba[3];
|
|
30712
|
+
}
|
|
30713
|
+
return "hwb(" + hwba[0] + ", " + hwba[1] + "%, " + hwba[2] + "%" + a2 + ")";
|
|
30714
|
+
};
|
|
30715
|
+
cs.to.keyword = function(...rgb) {
|
|
30716
|
+
return reverseNames[rgb.slice(0, 3)];
|
|
30717
|
+
};
|
|
30718
|
+
function clamp$3(number_, min2, max2) {
|
|
30719
|
+
return Math.min(Math.max(min2, number_), max2);
|
|
30720
|
+
}
|
|
30721
|
+
__name(clamp$3, "clamp$3");
|
|
30722
|
+
function hexDouble(number_) {
|
|
30723
|
+
const string_ = Math.round(number_).toString(16).toUpperCase();
|
|
30724
|
+
return string_.length < 2 ? "0" + string_ : string_;
|
|
30725
|
+
}
|
|
30726
|
+
__name(hexDouble, "hexDouble");
|
|
30727
|
+
const reverseKeywords = {};
|
|
30728
|
+
for (const key of Object.keys(cssKeywords)) {
|
|
30729
|
+
reverseKeywords[cssKeywords[key]] = key;
|
|
30730
|
+
}
|
|
30731
|
+
const convert$2 = {
|
|
30732
|
+
rgb: { channels: 3, labels: "rgb" },
|
|
30733
|
+
hsl: { channels: 3, labels: "hsl" },
|
|
30734
|
+
hsv: { channels: 3, labels: "hsv" },
|
|
30735
|
+
hwb: { channels: 3, labels: "hwb" },
|
|
30736
|
+
cmyk: { channels: 4, labels: "cmyk" },
|
|
30737
|
+
xyz: { channels: 3, labels: "xyz" },
|
|
30738
|
+
lab: { channels: 3, labels: "lab" },
|
|
30739
|
+
oklab: { channels: 3, labels: ["okl", "oka", "okb"] },
|
|
30740
|
+
lch: { channels: 3, labels: "lch" },
|
|
30741
|
+
oklch: { channels: 3, labels: ["okl", "okc", "okh"] },
|
|
30742
|
+
hex: { channels: 1, labels: ["hex"] },
|
|
30743
|
+
keyword: { channels: 1, labels: ["keyword"] },
|
|
30744
|
+
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
30745
|
+
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
30746
|
+
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
30747
|
+
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
30748
|
+
gray: { channels: 1, labels: ["gray"] }
|
|
30749
|
+
};
|
|
30750
|
+
const LAB_FT = __pow(6 / 29, 3);
|
|
30751
|
+
function srgbNonlinearTransform(c2) {
|
|
30752
|
+
const cc = c2 > 31308e-7 ? 1.055 * __pow(c2, 1 / 2.4) - 0.055 : c2 * 12.92;
|
|
30753
|
+
return Math.min(Math.max(0, cc), 1);
|
|
30754
|
+
}
|
|
30755
|
+
__name(srgbNonlinearTransform, "srgbNonlinearTransform");
|
|
30756
|
+
function srgbNonlinearTransformInv(c2) {
|
|
30757
|
+
return c2 > 0.04045 ? __pow((c2 + 0.055) / 1.055, 2.4) : c2 / 12.92;
|
|
30758
|
+
}
|
|
30759
|
+
__name(srgbNonlinearTransformInv, "srgbNonlinearTransformInv");
|
|
30760
|
+
for (const model of Object.keys(convert$2)) {
|
|
30761
|
+
if (!("channels" in convert$2[model])) {
|
|
30762
|
+
throw new Error("missing channels property: " + model);
|
|
30763
|
+
}
|
|
30764
|
+
if (!("labels" in convert$2[model])) {
|
|
30765
|
+
throw new Error("missing channel labels property: " + model);
|
|
30766
|
+
}
|
|
30767
|
+
if (convert$2[model].labels.length !== convert$2[model].channels) {
|
|
30768
|
+
throw new Error("channel and label counts mismatch: " + model);
|
|
30769
|
+
}
|
|
30770
|
+
const { channels, labels } = convert$2[model];
|
|
30771
|
+
delete convert$2[model].channels;
|
|
30772
|
+
delete convert$2[model].labels;
|
|
30773
|
+
Object.defineProperty(convert$2[model], "channels", { value: channels });
|
|
30774
|
+
Object.defineProperty(convert$2[model], "labels", { value: labels });
|
|
30775
|
+
}
|
|
30776
|
+
convert$2.rgb.hsl = function(rgb) {
|
|
30777
|
+
const r2 = rgb[0] / 255;
|
|
30778
|
+
const g2 = rgb[1] / 255;
|
|
30779
|
+
const b3 = rgb[2] / 255;
|
|
30780
|
+
const min2 = Math.min(r2, g2, b3);
|
|
30781
|
+
const max2 = Math.max(r2, g2, b3);
|
|
30782
|
+
const delta = max2 - min2;
|
|
30783
|
+
let h2;
|
|
30784
|
+
let s2;
|
|
30785
|
+
switch (max2) {
|
|
30786
|
+
case min2: {
|
|
31000
30787
|
h2 = 0;
|
|
31001
|
-
|
|
30788
|
+
break;
|
|
30789
|
+
}
|
|
30790
|
+
case r2: {
|
|
31002
30791
|
h2 = (g2 - b3) / delta;
|
|
31003
|
-
|
|
30792
|
+
break;
|
|
30793
|
+
}
|
|
30794
|
+
case g2: {
|
|
31004
30795
|
h2 = 2 + (b3 - r2) / delta;
|
|
31005
|
-
|
|
31006
|
-
h2 = 4 + (r2 - g2) / delta;
|
|
30796
|
+
break;
|
|
31007
30797
|
}
|
|
31008
|
-
|
|
31009
|
-
|
|
31010
|
-
|
|
30798
|
+
case b3: {
|
|
30799
|
+
h2 = 4 + (r2 - g2) / delta;
|
|
30800
|
+
break;
|
|
31011
30801
|
}
|
|
31012
|
-
|
|
31013
|
-
|
|
31014
|
-
|
|
31015
|
-
|
|
31016
|
-
|
|
31017
|
-
|
|
31018
|
-
|
|
31019
|
-
|
|
31020
|
-
|
|
31021
|
-
|
|
31022
|
-
|
|
31023
|
-
|
|
31024
|
-
|
|
31025
|
-
|
|
31026
|
-
|
|
31027
|
-
|
|
31028
|
-
|
|
31029
|
-
|
|
31030
|
-
|
|
31031
|
-
|
|
31032
|
-
|
|
31033
|
-
|
|
31034
|
-
|
|
31035
|
-
|
|
31036
|
-
|
|
31037
|
-
|
|
31038
|
-
|
|
31039
|
-
|
|
31040
|
-
|
|
31041
|
-
|
|
31042
|
-
|
|
31043
|
-
|
|
30802
|
+
}
|
|
30803
|
+
h2 = Math.min(h2 * 60, 360);
|
|
30804
|
+
if (h2 < 0) {
|
|
30805
|
+
h2 += 360;
|
|
30806
|
+
}
|
|
30807
|
+
const l2 = (min2 + max2) / 2;
|
|
30808
|
+
if (max2 === min2) {
|
|
30809
|
+
s2 = 0;
|
|
30810
|
+
} else if (l2 <= 0.5) {
|
|
30811
|
+
s2 = delta / (max2 + min2);
|
|
30812
|
+
} else {
|
|
30813
|
+
s2 = delta / (2 - max2 - min2);
|
|
30814
|
+
}
|
|
30815
|
+
return [h2, s2 * 100, l2 * 100];
|
|
30816
|
+
};
|
|
30817
|
+
convert$2.rgb.hsv = function(rgb) {
|
|
30818
|
+
let rdif;
|
|
30819
|
+
let gdif;
|
|
30820
|
+
let bdif;
|
|
30821
|
+
let h2;
|
|
30822
|
+
let s2;
|
|
30823
|
+
const r2 = rgb[0] / 255;
|
|
30824
|
+
const g2 = rgb[1] / 255;
|
|
30825
|
+
const b3 = rgb[2] / 255;
|
|
30826
|
+
const v2 = Math.max(r2, g2, b3);
|
|
30827
|
+
const diff = v2 - Math.min(r2, g2, b3);
|
|
30828
|
+
const diffc = /* @__PURE__ */ __name(function(c2) {
|
|
30829
|
+
return (v2 - c2) / 6 / diff + 1 / 2;
|
|
30830
|
+
}, "diffc");
|
|
30831
|
+
if (diff === 0) {
|
|
30832
|
+
h2 = 0;
|
|
30833
|
+
s2 = 0;
|
|
30834
|
+
} else {
|
|
30835
|
+
s2 = diff / v2;
|
|
30836
|
+
rdif = diffc(r2);
|
|
30837
|
+
gdif = diffc(g2);
|
|
30838
|
+
bdif = diffc(b3);
|
|
30839
|
+
switch (v2) {
|
|
30840
|
+
case r2: {
|
|
31044
30841
|
h2 = bdif - gdif;
|
|
31045
|
-
|
|
30842
|
+
break;
|
|
30843
|
+
}
|
|
30844
|
+
case g2: {
|
|
31046
30845
|
h2 = 1 / 3 + rdif - bdif;
|
|
31047
|
-
|
|
31048
|
-
h2 = 2 / 3 + gdif - rdif;
|
|
30846
|
+
break;
|
|
31049
30847
|
}
|
|
31050
|
-
|
|
31051
|
-
h2
|
|
31052
|
-
|
|
31053
|
-
h2 -= 1;
|
|
30848
|
+
case b3: {
|
|
30849
|
+
h2 = 2 / 3 + gdif - rdif;
|
|
30850
|
+
break;
|
|
31054
30851
|
}
|
|
31055
30852
|
}
|
|
31056
|
-
|
|
31057
|
-
h2
|
|
31058
|
-
|
|
31059
|
-
|
|
31060
|
-
|
|
31061
|
-
}
|
|
31062
|
-
|
|
31063
|
-
|
|
31064
|
-
|
|
31065
|
-
|
|
31066
|
-
|
|
31067
|
-
|
|
31068
|
-
|
|
31069
|
-
|
|
31070
|
-
|
|
31071
|
-
|
|
31072
|
-
|
|
31073
|
-
|
|
31074
|
-
|
|
31075
|
-
|
|
31076
|
-
|
|
31077
|
-
|
|
31078
|
-
|
|
31079
|
-
|
|
31080
|
-
|
|
31081
|
-
|
|
31082
|
-
|
|
31083
|
-
|
|
31084
|
-
|
|
31085
|
-
|
|
31086
|
-
|
|
31087
|
-
|
|
31088
|
-
|
|
31089
|
-
|
|
31090
|
-
|
|
31091
|
-
|
|
31092
|
-
|
|
31093
|
-
|
|
31094
|
-
|
|
31095
|
-
|
|
31096
|
-
|
|
31097
|
-
|
|
31098
|
-
|
|
31099
|
-
|
|
31100
|
-
|
|
31101
|
-
|
|
31102
|
-
|
|
31103
|
-
|
|
31104
|
-
|
|
31105
|
-
|
|
31106
|
-
return
|
|
31107
|
-
}
|
|
31108
|
-
|
|
31109
|
-
|
|
31110
|
-
|
|
31111
|
-
|
|
31112
|
-
|
|
31113
|
-
|
|
31114
|
-
|
|
31115
|
-
|
|
31116
|
-
|
|
31117
|
-
|
|
31118
|
-
|
|
31119
|
-
|
|
31120
|
-
|
|
31121
|
-
|
|
31122
|
-
|
|
31123
|
-
|
|
31124
|
-
|
|
31125
|
-
|
|
31126
|
-
|
|
31127
|
-
|
|
31128
|
-
|
|
31129
|
-
|
|
31130
|
-
|
|
31131
|
-
|
|
31132
|
-
|
|
31133
|
-
|
|
31134
|
-
|
|
31135
|
-
|
|
31136
|
-
|
|
31137
|
-
|
|
31138
|
-
|
|
31139
|
-
|
|
31140
|
-
|
|
31141
|
-
|
|
31142
|
-
|
|
31143
|
-
|
|
31144
|
-
|
|
31145
|
-
|
|
31146
|
-
|
|
31147
|
-
|
|
31148
|
-
|
|
31149
|
-
|
|
31150
|
-
|
|
31151
|
-
|
|
31152
|
-
|
|
31153
|
-
|
|
31154
|
-
|
|
31155
|
-
|
|
31156
|
-
|
|
30853
|
+
if (h2 < 0) {
|
|
30854
|
+
h2 += 1;
|
|
30855
|
+
} else if (h2 > 1) {
|
|
30856
|
+
h2 -= 1;
|
|
30857
|
+
}
|
|
30858
|
+
}
|
|
30859
|
+
return [
|
|
30860
|
+
h2 * 360,
|
|
30861
|
+
s2 * 100,
|
|
30862
|
+
v2 * 100
|
|
30863
|
+
];
|
|
30864
|
+
};
|
|
30865
|
+
convert$2.rgb.hwb = function(rgb) {
|
|
30866
|
+
const r2 = rgb[0];
|
|
30867
|
+
const g2 = rgb[1];
|
|
30868
|
+
let b3 = rgb[2];
|
|
30869
|
+
const h2 = convert$2.rgb.hsl(rgb)[0];
|
|
30870
|
+
const w2 = 1 / 255 * Math.min(r2, Math.min(g2, b3));
|
|
30871
|
+
b3 = 1 - 1 / 255 * Math.max(r2, Math.max(g2, b3));
|
|
30872
|
+
return [h2, w2 * 100, b3 * 100];
|
|
30873
|
+
};
|
|
30874
|
+
convert$2.rgb.oklab = function(rgb) {
|
|
30875
|
+
const r2 = srgbNonlinearTransformInv(rgb[0] / 255);
|
|
30876
|
+
const g2 = srgbNonlinearTransformInv(rgb[1] / 255);
|
|
30877
|
+
const b3 = srgbNonlinearTransformInv(rgb[2] / 255);
|
|
30878
|
+
const lp = Math.cbrt(0.4122214708 * r2 + 0.5363325363 * g2 + 0.0514459929 * b3);
|
|
30879
|
+
const mp = Math.cbrt(0.2119034982 * r2 + 0.6806995451 * g2 + 0.1073969566 * b3);
|
|
30880
|
+
const sp = Math.cbrt(0.0883024619 * r2 + 0.2817188376 * g2 + 0.6299787005 * b3);
|
|
30881
|
+
const l2 = 0.2104542553 * lp + 0.793617785 * mp - 0.0040720468 * sp;
|
|
30882
|
+
const aa = 1.9779984951 * lp - 2.428592205 * mp + 0.4505937099 * sp;
|
|
30883
|
+
const bb = 0.0259040371 * lp + 0.7827717662 * mp - 0.808675766 * sp;
|
|
30884
|
+
return [l2 * 100, aa * 100, bb * 100];
|
|
30885
|
+
};
|
|
30886
|
+
convert$2.rgb.cmyk = function(rgb) {
|
|
30887
|
+
const r2 = rgb[0] / 255;
|
|
30888
|
+
const g2 = rgb[1] / 255;
|
|
30889
|
+
const b3 = rgb[2] / 255;
|
|
30890
|
+
const k2 = Math.min(1 - r2, 1 - g2, 1 - b3);
|
|
30891
|
+
const c2 = (1 - r2 - k2) / (1 - k2) || 0;
|
|
30892
|
+
const m2 = (1 - g2 - k2) / (1 - k2) || 0;
|
|
30893
|
+
const y2 = (1 - b3 - k2) / (1 - k2) || 0;
|
|
30894
|
+
return [c2 * 100, m2 * 100, y2 * 100, k2 * 100];
|
|
30895
|
+
};
|
|
30896
|
+
function comparativeDistance(x, y2) {
|
|
30897
|
+
return __pow(x[0] - y2[0], 2) + __pow(x[1] - y2[1], 2) + __pow(x[2] - y2[2], 2);
|
|
30898
|
+
}
|
|
30899
|
+
__name(comparativeDistance, "comparativeDistance");
|
|
30900
|
+
convert$2.rgb.keyword = function(rgb) {
|
|
30901
|
+
const reversed = reverseKeywords[rgb];
|
|
30902
|
+
if (reversed) {
|
|
30903
|
+
return reversed;
|
|
30904
|
+
}
|
|
30905
|
+
let currentClosestDistance = Number.POSITIVE_INFINITY;
|
|
30906
|
+
let currentClosestKeyword;
|
|
30907
|
+
for (const keyword of Object.keys(cssKeywords)) {
|
|
30908
|
+
const value = cssKeywords[keyword];
|
|
30909
|
+
const distance2 = comparativeDistance(rgb, value);
|
|
30910
|
+
if (distance2 < currentClosestDistance) {
|
|
30911
|
+
currentClosestDistance = distance2;
|
|
30912
|
+
currentClosestKeyword = keyword;
|
|
30913
|
+
}
|
|
30914
|
+
}
|
|
30915
|
+
return currentClosestKeyword;
|
|
30916
|
+
};
|
|
30917
|
+
convert$2.keyword.rgb = function(keyword) {
|
|
30918
|
+
return cssKeywords[keyword];
|
|
30919
|
+
};
|
|
30920
|
+
convert$2.rgb.xyz = function(rgb) {
|
|
30921
|
+
const r2 = srgbNonlinearTransformInv(rgb[0] / 255);
|
|
30922
|
+
const g2 = srgbNonlinearTransformInv(rgb[1] / 255);
|
|
30923
|
+
const b3 = srgbNonlinearTransformInv(rgb[2] / 255);
|
|
30924
|
+
const x = r2 * 0.4124564 + g2 * 0.3575761 + b3 * 0.1804375;
|
|
30925
|
+
const y2 = r2 * 0.2126729 + g2 * 0.7151522 + b3 * 0.072175;
|
|
30926
|
+
const z2 = r2 * 0.0193339 + g2 * 0.119192 + b3 * 0.9503041;
|
|
30927
|
+
return [x * 100, y2 * 100, z2 * 100];
|
|
30928
|
+
};
|
|
30929
|
+
convert$2.rgb.lab = function(rgb) {
|
|
30930
|
+
const xyz = convert$2.rgb.xyz(rgb);
|
|
30931
|
+
let x = xyz[0];
|
|
30932
|
+
let y2 = xyz[1];
|
|
30933
|
+
let z2 = xyz[2];
|
|
30934
|
+
x /= 95.047;
|
|
30935
|
+
y2 /= 100;
|
|
30936
|
+
z2 /= 108.883;
|
|
30937
|
+
x = x > LAB_FT ? __pow(x, 1 / 3) : 7.787 * x + 16 / 116;
|
|
30938
|
+
y2 = y2 > LAB_FT ? __pow(y2, 1 / 3) : 7.787 * y2 + 16 / 116;
|
|
30939
|
+
z2 = z2 > LAB_FT ? __pow(z2, 1 / 3) : 7.787 * z2 + 16 / 116;
|
|
30940
|
+
const l2 = 116 * y2 - 16;
|
|
30941
|
+
const a2 = 500 * (x - y2);
|
|
30942
|
+
const b3 = 200 * (y2 - z2);
|
|
30943
|
+
return [l2, a2, b3];
|
|
30944
|
+
};
|
|
30945
|
+
convert$2.hsl.rgb = function(hsl) {
|
|
30946
|
+
const h2 = hsl[0] / 360;
|
|
30947
|
+
const s2 = hsl[1] / 100;
|
|
30948
|
+
const l2 = hsl[2] / 100;
|
|
30949
|
+
let t3;
|
|
30950
|
+
let value;
|
|
30951
|
+
if (s2 === 0) {
|
|
30952
|
+
value = l2 * 255;
|
|
30953
|
+
return [value, value, value];
|
|
30954
|
+
}
|
|
30955
|
+
const t2 = l2 < 0.5 ? l2 * (1 + s2) : l2 + s2 - l2 * s2;
|
|
30956
|
+
const t1 = 2 * l2 - t2;
|
|
30957
|
+
const rgb = [0, 0, 0];
|
|
30958
|
+
for (let i = 0; i < 3; i++) {
|
|
30959
|
+
t3 = h2 + 1 / 3 * -(i - 1);
|
|
30960
|
+
if (t3 < 0) {
|
|
30961
|
+
t3++;
|
|
30962
|
+
}
|
|
30963
|
+
if (t3 > 1) {
|
|
30964
|
+
t3--;
|
|
30965
|
+
}
|
|
30966
|
+
if (6 * t3 < 1) {
|
|
30967
|
+
value = t1 + (t2 - t1) * 6 * t3;
|
|
30968
|
+
} else if (2 * t3 < 1) {
|
|
30969
|
+
value = t2;
|
|
30970
|
+
} else if (3 * t3 < 2) {
|
|
30971
|
+
value = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
31157
30972
|
} else {
|
|
31158
|
-
|
|
31159
|
-
}
|
|
31160
|
-
t1 = 2 * l2 - t2;
|
|
31161
|
-
rgb = [0, 0, 0];
|
|
31162
|
-
for (var i = 0; i < 3; i++) {
|
|
31163
|
-
t3 = h2 + 1 / 3 * -(i - 1);
|
|
31164
|
-
if (t3 < 0) {
|
|
31165
|
-
t3++;
|
|
31166
|
-
}
|
|
31167
|
-
if (t3 > 1) {
|
|
31168
|
-
t3--;
|
|
31169
|
-
}
|
|
31170
|
-
if (6 * t3 < 1) {
|
|
31171
|
-
val2 = t1 + (t2 - t1) * 6 * t3;
|
|
31172
|
-
} else if (2 * t3 < 1) {
|
|
31173
|
-
val2 = t2;
|
|
31174
|
-
} else if (3 * t3 < 2) {
|
|
31175
|
-
val2 = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
31176
|
-
} else {
|
|
31177
|
-
val2 = t1;
|
|
31178
|
-
}
|
|
31179
|
-
rgb[i] = val2 * 255;
|
|
30973
|
+
value = t1;
|
|
31180
30974
|
}
|
|
31181
|
-
|
|
31182
|
-
}
|
|
31183
|
-
|
|
31184
|
-
|
|
31185
|
-
|
|
31186
|
-
|
|
31187
|
-
|
|
31188
|
-
|
|
31189
|
-
|
|
31190
|
-
|
|
31191
|
-
|
|
31192
|
-
|
|
31193
|
-
|
|
31194
|
-
|
|
31195
|
-
|
|
31196
|
-
|
|
31197
|
-
|
|
31198
|
-
|
|
31199
|
-
|
|
31200
|
-
|
|
31201
|
-
|
|
31202
|
-
|
|
31203
|
-
|
|
31204
|
-
|
|
31205
|
-
|
|
31206
|
-
|
|
31207
|
-
|
|
31208
|
-
|
|
31209
|
-
|
|
31210
|
-
|
|
31211
|
-
case 1:
|
|
31212
|
-
return [q2, v2, p2];
|
|
31213
|
-
case 2:
|
|
31214
|
-
return [p2, v2, t2];
|
|
31215
|
-
case 3:
|
|
31216
|
-
return [p2, q2, v2];
|
|
31217
|
-
case 4:
|
|
31218
|
-
return [t2, p2, v2];
|
|
31219
|
-
case 5:
|
|
31220
|
-
return [v2, p2, q2];
|
|
31221
|
-
}
|
|
31222
|
-
};
|
|
31223
|
-
convert2.hsv.hsl = function(hsv) {
|
|
31224
|
-
var h2 = hsv[0];
|
|
31225
|
-
var s2 = hsv[1] / 100;
|
|
31226
|
-
var v2 = hsv[2] / 100;
|
|
31227
|
-
var vmin = Math.max(v2, 0.01);
|
|
31228
|
-
var lmin;
|
|
31229
|
-
var sl;
|
|
31230
|
-
var l2;
|
|
31231
|
-
l2 = (2 - s2) * v2;
|
|
31232
|
-
lmin = (2 - s2) * vmin;
|
|
31233
|
-
sl = s2 * vmin;
|
|
31234
|
-
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
31235
|
-
sl = sl || 0;
|
|
31236
|
-
l2 /= 2;
|
|
31237
|
-
return [h2, sl * 100, l2 * 100];
|
|
31238
|
-
};
|
|
31239
|
-
convert2.hwb.rgb = function(hwb) {
|
|
31240
|
-
var h2 = hwb[0] / 360;
|
|
31241
|
-
var wh = hwb[1] / 100;
|
|
31242
|
-
var bl = hwb[2] / 100;
|
|
31243
|
-
var ratio = wh + bl;
|
|
31244
|
-
var i;
|
|
31245
|
-
var v2;
|
|
31246
|
-
var f2;
|
|
31247
|
-
var n2;
|
|
31248
|
-
if (ratio > 1) {
|
|
31249
|
-
wh /= ratio;
|
|
31250
|
-
bl /= ratio;
|
|
31251
|
-
}
|
|
31252
|
-
i = Math.floor(6 * h2);
|
|
31253
|
-
v2 = 1 - bl;
|
|
31254
|
-
f2 = 6 * h2 - i;
|
|
31255
|
-
if ((i & 1) !== 0) {
|
|
31256
|
-
f2 = 1 - f2;
|
|
31257
|
-
}
|
|
31258
|
-
n2 = wh + f2 * (v2 - wh);
|
|
31259
|
-
var r2;
|
|
31260
|
-
var g2;
|
|
31261
|
-
var b3;
|
|
31262
|
-
switch (i) {
|
|
31263
|
-
default:
|
|
31264
|
-
case 6:
|
|
31265
|
-
case 0:
|
|
31266
|
-
r2 = v2;
|
|
31267
|
-
g2 = n2;
|
|
31268
|
-
b3 = wh;
|
|
31269
|
-
break;
|
|
31270
|
-
case 1:
|
|
31271
|
-
r2 = n2;
|
|
31272
|
-
g2 = v2;
|
|
31273
|
-
b3 = wh;
|
|
31274
|
-
break;
|
|
31275
|
-
case 2:
|
|
31276
|
-
r2 = wh;
|
|
31277
|
-
g2 = v2;
|
|
31278
|
-
b3 = n2;
|
|
31279
|
-
break;
|
|
31280
|
-
case 3:
|
|
31281
|
-
r2 = wh;
|
|
31282
|
-
g2 = n2;
|
|
31283
|
-
b3 = v2;
|
|
31284
|
-
break;
|
|
31285
|
-
case 4:
|
|
31286
|
-
r2 = n2;
|
|
31287
|
-
g2 = wh;
|
|
31288
|
-
b3 = v2;
|
|
31289
|
-
break;
|
|
31290
|
-
case 5:
|
|
31291
|
-
r2 = v2;
|
|
31292
|
-
g2 = wh;
|
|
31293
|
-
b3 = n2;
|
|
31294
|
-
break;
|
|
30975
|
+
rgb[i] = value * 255;
|
|
30976
|
+
}
|
|
30977
|
+
return rgb;
|
|
30978
|
+
};
|
|
30979
|
+
convert$2.hsl.hsv = function(hsl) {
|
|
30980
|
+
const h2 = hsl[0];
|
|
30981
|
+
let s2 = hsl[1] / 100;
|
|
30982
|
+
let l2 = hsl[2] / 100;
|
|
30983
|
+
let smin = s2;
|
|
30984
|
+
const lmin = Math.max(l2, 0.01);
|
|
30985
|
+
l2 *= 2;
|
|
30986
|
+
s2 *= l2 <= 1 ? l2 : 2 - l2;
|
|
30987
|
+
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
30988
|
+
const v2 = (l2 + s2) / 2;
|
|
30989
|
+
const sv = l2 === 0 ? 2 * smin / (lmin + smin) : 2 * s2 / (l2 + s2);
|
|
30990
|
+
return [h2, sv * 100, v2 * 100];
|
|
30991
|
+
};
|
|
30992
|
+
convert$2.hsv.rgb = function(hsv) {
|
|
30993
|
+
const h2 = hsv[0] / 60;
|
|
30994
|
+
const s2 = hsv[1] / 100;
|
|
30995
|
+
let v2 = hsv[2] / 100;
|
|
30996
|
+
const hi = Math.floor(h2) % 6;
|
|
30997
|
+
const f2 = h2 - Math.floor(h2);
|
|
30998
|
+
const p2 = 255 * v2 * (1 - s2);
|
|
30999
|
+
const q2 = 255 * v2 * (1 - s2 * f2);
|
|
31000
|
+
const t2 = 255 * v2 * (1 - s2 * (1 - f2));
|
|
31001
|
+
v2 *= 255;
|
|
31002
|
+
switch (hi) {
|
|
31003
|
+
case 0: {
|
|
31004
|
+
return [v2, t2, p2];
|
|
31295
31005
|
}
|
|
31296
|
-
|
|
31297
|
-
|
|
31298
|
-
convert2.cmyk.rgb = function(cmyk) {
|
|
31299
|
-
var c2 = cmyk[0] / 100;
|
|
31300
|
-
var m2 = cmyk[1] / 100;
|
|
31301
|
-
var y2 = cmyk[2] / 100;
|
|
31302
|
-
var k2 = cmyk[3] / 100;
|
|
31303
|
-
var r2;
|
|
31304
|
-
var g2;
|
|
31305
|
-
var b3;
|
|
31306
|
-
r2 = 1 - Math.min(1, c2 * (1 - k2) + k2);
|
|
31307
|
-
g2 = 1 - Math.min(1, m2 * (1 - k2) + k2);
|
|
31308
|
-
b3 = 1 - Math.min(1, y2 * (1 - k2) + k2);
|
|
31309
|
-
return [r2 * 255, g2 * 255, b3 * 255];
|
|
31310
|
-
};
|
|
31311
|
-
convert2.xyz.rgb = function(xyz) {
|
|
31312
|
-
var x = xyz[0] / 100;
|
|
31313
|
-
var y2 = xyz[1] / 100;
|
|
31314
|
-
var z2 = xyz[2] / 100;
|
|
31315
|
-
var r2;
|
|
31316
|
-
var g2;
|
|
31317
|
-
var b3;
|
|
31318
|
-
r2 = x * 3.2406 + y2 * -1.5372 + z2 * -0.4986;
|
|
31319
|
-
g2 = x * -0.9689 + y2 * 1.8758 + z2 * 0.0415;
|
|
31320
|
-
b3 = x * 0.0557 + y2 * -0.204 + z2 * 1.057;
|
|
31321
|
-
r2 = r2 > 31308e-7 ? 1.055 * Math.pow(r2, 1 / 2.4) - 0.055 : r2 * 12.92;
|
|
31322
|
-
g2 = g2 > 31308e-7 ? 1.055 * Math.pow(g2, 1 / 2.4) - 0.055 : g2 * 12.92;
|
|
31323
|
-
b3 = b3 > 31308e-7 ? 1.055 * Math.pow(b3, 1 / 2.4) - 0.055 : b3 * 12.92;
|
|
31324
|
-
r2 = Math.min(Math.max(0, r2), 1);
|
|
31325
|
-
g2 = Math.min(Math.max(0, g2), 1);
|
|
31326
|
-
b3 = Math.min(Math.max(0, b3), 1);
|
|
31327
|
-
return [r2 * 255, g2 * 255, b3 * 255];
|
|
31328
|
-
};
|
|
31329
|
-
convert2.xyz.lab = function(xyz) {
|
|
31330
|
-
var x = xyz[0];
|
|
31331
|
-
var y2 = xyz[1];
|
|
31332
|
-
var z2 = xyz[2];
|
|
31333
|
-
var l2;
|
|
31334
|
-
var a2;
|
|
31335
|
-
var b3;
|
|
31336
|
-
x /= 95.047;
|
|
31337
|
-
y2 /= 100;
|
|
31338
|
-
z2 /= 108.883;
|
|
31339
|
-
x = x > 8856e-6 ? Math.pow(x, 1 / 3) : 7.787 * x + 16 / 116;
|
|
31340
|
-
y2 = y2 > 8856e-6 ? Math.pow(y2, 1 / 3) : 7.787 * y2 + 16 / 116;
|
|
31341
|
-
z2 = z2 > 8856e-6 ? Math.pow(z2, 1 / 3) : 7.787 * z2 + 16 / 116;
|
|
31342
|
-
l2 = 116 * y2 - 16;
|
|
31343
|
-
a2 = 500 * (x - y2);
|
|
31344
|
-
b3 = 200 * (y2 - z2);
|
|
31345
|
-
return [l2, a2, b3];
|
|
31346
|
-
};
|
|
31347
|
-
convert2.lab.xyz = function(lab) {
|
|
31348
|
-
var l2 = lab[0];
|
|
31349
|
-
var a2 = lab[1];
|
|
31350
|
-
var b3 = lab[2];
|
|
31351
|
-
var x;
|
|
31352
|
-
var y2;
|
|
31353
|
-
var z2;
|
|
31354
|
-
y2 = (l2 + 16) / 116;
|
|
31355
|
-
x = a2 / 500 + y2;
|
|
31356
|
-
z2 = y2 - b3 / 200;
|
|
31357
|
-
var y22 = Math.pow(y2, 3);
|
|
31358
|
-
var x2 = Math.pow(x, 3);
|
|
31359
|
-
var z22 = Math.pow(z2, 3);
|
|
31360
|
-
y2 = y22 > 8856e-6 ? y22 : (y2 - 16 / 116) / 7.787;
|
|
31361
|
-
x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
|
|
31362
|
-
z2 = z22 > 8856e-6 ? z22 : (z2 - 16 / 116) / 7.787;
|
|
31363
|
-
x *= 95.047;
|
|
31364
|
-
y2 *= 100;
|
|
31365
|
-
z2 *= 108.883;
|
|
31366
|
-
return [x, y2, z2];
|
|
31367
|
-
};
|
|
31368
|
-
convert2.lab.lch = function(lab) {
|
|
31369
|
-
var l2 = lab[0];
|
|
31370
|
-
var a2 = lab[1];
|
|
31371
|
-
var b3 = lab[2];
|
|
31372
|
-
var hr;
|
|
31373
|
-
var h2;
|
|
31374
|
-
var c2;
|
|
31375
|
-
hr = Math.atan2(b3, a2);
|
|
31376
|
-
h2 = hr * 360 / 2 / Math.PI;
|
|
31377
|
-
if (h2 < 0) {
|
|
31378
|
-
h2 += 360;
|
|
31379
|
-
}
|
|
31380
|
-
c2 = Math.sqrt(a2 * a2 + b3 * b3);
|
|
31381
|
-
return [l2, c2, h2];
|
|
31382
|
-
};
|
|
31383
|
-
convert2.lch.lab = function(lch) {
|
|
31384
|
-
var l2 = lch[0];
|
|
31385
|
-
var c2 = lch[1];
|
|
31386
|
-
var h2 = lch[2];
|
|
31387
|
-
var a2;
|
|
31388
|
-
var b3;
|
|
31389
|
-
var hr;
|
|
31390
|
-
hr = h2 / 360 * 2 * Math.PI;
|
|
31391
|
-
a2 = c2 * Math.cos(hr);
|
|
31392
|
-
b3 = c2 * Math.sin(hr);
|
|
31393
|
-
return [l2, a2, b3];
|
|
31394
|
-
};
|
|
31395
|
-
convert2.rgb.ansi16 = function(args) {
|
|
31396
|
-
var r2 = args[0];
|
|
31397
|
-
var g2 = args[1];
|
|
31398
|
-
var b3 = args[2];
|
|
31399
|
-
var value = 1 in arguments ? arguments[1] : convert2.rgb.hsv(args)[2];
|
|
31400
|
-
value = Math.round(value / 50);
|
|
31401
|
-
if (value === 0) {
|
|
31402
|
-
return 30;
|
|
31403
|
-
}
|
|
31404
|
-
var ansi = 30 + (Math.round(b3 / 255) << 2 | Math.round(g2 / 255) << 1 | Math.round(r2 / 255));
|
|
31405
|
-
if (value === 2) {
|
|
31406
|
-
ansi += 60;
|
|
31407
|
-
}
|
|
31408
|
-
return ansi;
|
|
31409
|
-
};
|
|
31410
|
-
convert2.hsv.ansi16 = function(args) {
|
|
31411
|
-
return convert2.rgb.ansi16(convert2.hsv.rgb(args), args[2]);
|
|
31412
|
-
};
|
|
31413
|
-
convert2.rgb.ansi256 = function(args) {
|
|
31414
|
-
var r2 = args[0];
|
|
31415
|
-
var g2 = args[1];
|
|
31416
|
-
var b3 = args[2];
|
|
31417
|
-
if (r2 === g2 && g2 === b3) {
|
|
31418
|
-
if (r2 < 8) {
|
|
31419
|
-
return 16;
|
|
31420
|
-
}
|
|
31421
|
-
if (r2 > 248) {
|
|
31422
|
-
return 231;
|
|
31423
|
-
}
|
|
31424
|
-
return Math.round((r2 - 8) / 247 * 24) + 232;
|
|
31425
|
-
}
|
|
31426
|
-
var ansi = 16 + 36 * Math.round(r2 / 255 * 5) + 6 * Math.round(g2 / 255 * 5) + Math.round(b3 / 255 * 5);
|
|
31427
|
-
return ansi;
|
|
31428
|
-
};
|
|
31429
|
-
convert2.ansi16.rgb = function(args) {
|
|
31430
|
-
var color2 = args % 10;
|
|
31431
|
-
if (color2 === 0 || color2 === 7) {
|
|
31432
|
-
if (args > 50) {
|
|
31433
|
-
color2 += 3.5;
|
|
31434
|
-
}
|
|
31435
|
-
color2 = color2 / 10.5 * 255;
|
|
31436
|
-
return [color2, color2, color2];
|
|
31437
|
-
}
|
|
31438
|
-
var mult = (~~(args > 50) + 1) * 0.5;
|
|
31439
|
-
var r2 = (color2 & 1) * mult * 255;
|
|
31440
|
-
var g2 = (color2 >> 1 & 1) * mult * 255;
|
|
31441
|
-
var b3 = (color2 >> 2 & 1) * mult * 255;
|
|
31442
|
-
return [r2, g2, b3];
|
|
31443
|
-
};
|
|
31444
|
-
convert2.ansi256.rgb = function(args) {
|
|
31445
|
-
if (args >= 232) {
|
|
31446
|
-
var c2 = (args - 232) * 10 + 8;
|
|
31447
|
-
return [c2, c2, c2];
|
|
31448
|
-
}
|
|
31449
|
-
args -= 16;
|
|
31450
|
-
var rem;
|
|
31451
|
-
var r2 = Math.floor(args / 36) / 5 * 255;
|
|
31452
|
-
var g2 = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
31453
|
-
var b3 = rem % 6 / 5 * 255;
|
|
31454
|
-
return [r2, g2, b3];
|
|
31455
|
-
};
|
|
31456
|
-
convert2.rgb.hex = function(args) {
|
|
31457
|
-
var integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
31458
|
-
var string2 = integer.toString(16).toUpperCase();
|
|
31459
|
-
return "000000".substring(string2.length) + string2;
|
|
31460
|
-
};
|
|
31461
|
-
convert2.hex.rgb = function(args) {
|
|
31462
|
-
var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
31463
|
-
if (!match) {
|
|
31464
|
-
return [0, 0, 0];
|
|
31465
|
-
}
|
|
31466
|
-
var colorString2 = match[0];
|
|
31467
|
-
if (match[0].length === 3) {
|
|
31468
|
-
colorString2 = colorString2.split("").map(function(char) {
|
|
31469
|
-
return char + char;
|
|
31470
|
-
}).join("");
|
|
31471
|
-
}
|
|
31472
|
-
var integer = parseInt(colorString2, 16);
|
|
31473
|
-
var r2 = integer >> 16 & 255;
|
|
31474
|
-
var g2 = integer >> 8 & 255;
|
|
31475
|
-
var b3 = integer & 255;
|
|
31476
|
-
return [r2, g2, b3];
|
|
31477
|
-
};
|
|
31478
|
-
convert2.rgb.hcg = function(rgb) {
|
|
31479
|
-
var r2 = rgb[0] / 255;
|
|
31480
|
-
var g2 = rgb[1] / 255;
|
|
31481
|
-
var b3 = rgb[2] / 255;
|
|
31482
|
-
var max2 = Math.max(Math.max(r2, g2), b3);
|
|
31483
|
-
var min2 = Math.min(Math.min(r2, g2), b3);
|
|
31484
|
-
var chroma = max2 - min2;
|
|
31485
|
-
var grayscale;
|
|
31486
|
-
var hue;
|
|
31487
|
-
if (chroma < 1) {
|
|
31488
|
-
grayscale = min2 / (1 - chroma);
|
|
31489
|
-
} else {
|
|
31490
|
-
grayscale = 0;
|
|
31491
|
-
}
|
|
31492
|
-
if (chroma <= 0) {
|
|
31493
|
-
hue = 0;
|
|
31494
|
-
} else if (max2 === r2) {
|
|
31495
|
-
hue = (g2 - b3) / chroma % 6;
|
|
31496
|
-
} else if (max2 === g2) {
|
|
31497
|
-
hue = 2 + (b3 - r2) / chroma;
|
|
31498
|
-
} else {
|
|
31499
|
-
hue = 4 + (r2 - g2) / chroma + 4;
|
|
31500
|
-
}
|
|
31501
|
-
hue /= 6;
|
|
31502
|
-
hue %= 1;
|
|
31503
|
-
return [hue * 360, chroma * 100, grayscale * 100];
|
|
31504
|
-
};
|
|
31505
|
-
convert2.hsl.hcg = function(hsl) {
|
|
31506
|
-
var s2 = hsl[1] / 100;
|
|
31507
|
-
var l2 = hsl[2] / 100;
|
|
31508
|
-
var c2 = 1;
|
|
31509
|
-
var f2 = 0;
|
|
31510
|
-
if (l2 < 0.5) {
|
|
31511
|
-
c2 = 2 * s2 * l2;
|
|
31512
|
-
} else {
|
|
31513
|
-
c2 = 2 * s2 * (1 - l2);
|
|
31514
|
-
}
|
|
31515
|
-
if (c2 < 1) {
|
|
31516
|
-
f2 = (l2 - 0.5 * c2) / (1 - c2);
|
|
31517
|
-
}
|
|
31518
|
-
return [hsl[0], c2 * 100, f2 * 100];
|
|
31519
|
-
};
|
|
31520
|
-
convert2.hsv.hcg = function(hsv) {
|
|
31521
|
-
var s2 = hsv[1] / 100;
|
|
31522
|
-
var v2 = hsv[2] / 100;
|
|
31523
|
-
var c2 = s2 * v2;
|
|
31524
|
-
var f2 = 0;
|
|
31525
|
-
if (c2 < 1) {
|
|
31526
|
-
f2 = (v2 - c2) / (1 - c2);
|
|
31527
|
-
}
|
|
31528
|
-
return [hsv[0], c2 * 100, f2 * 100];
|
|
31529
|
-
};
|
|
31530
|
-
convert2.hcg.rgb = function(hcg) {
|
|
31531
|
-
var h2 = hcg[0] / 360;
|
|
31532
|
-
var c2 = hcg[1] / 100;
|
|
31533
|
-
var g2 = hcg[2] / 100;
|
|
31534
|
-
if (c2 === 0) {
|
|
31535
|
-
return [g2 * 255, g2 * 255, g2 * 255];
|
|
31536
|
-
}
|
|
31537
|
-
var pure2 = [0, 0, 0];
|
|
31538
|
-
var hi = h2 % 1 * 6;
|
|
31539
|
-
var v2 = hi % 1;
|
|
31540
|
-
var w2 = 1 - v2;
|
|
31541
|
-
var mg = 0;
|
|
31542
|
-
switch (Math.floor(hi)) {
|
|
31543
|
-
case 0:
|
|
31544
|
-
pure2[0] = 1;
|
|
31545
|
-
pure2[1] = v2;
|
|
31546
|
-
pure2[2] = 0;
|
|
31547
|
-
break;
|
|
31548
|
-
case 1:
|
|
31549
|
-
pure2[0] = w2;
|
|
31550
|
-
pure2[1] = 1;
|
|
31551
|
-
pure2[2] = 0;
|
|
31552
|
-
break;
|
|
31553
|
-
case 2:
|
|
31554
|
-
pure2[0] = 0;
|
|
31555
|
-
pure2[1] = 1;
|
|
31556
|
-
pure2[2] = v2;
|
|
31557
|
-
break;
|
|
31558
|
-
case 3:
|
|
31559
|
-
pure2[0] = 0;
|
|
31560
|
-
pure2[1] = w2;
|
|
31561
|
-
pure2[2] = 1;
|
|
31562
|
-
break;
|
|
31563
|
-
case 4:
|
|
31564
|
-
pure2[0] = v2;
|
|
31565
|
-
pure2[1] = 0;
|
|
31566
|
-
pure2[2] = 1;
|
|
31567
|
-
break;
|
|
31568
|
-
default:
|
|
31569
|
-
pure2[0] = 1;
|
|
31570
|
-
pure2[1] = 0;
|
|
31571
|
-
pure2[2] = w2;
|
|
31006
|
+
case 1: {
|
|
31007
|
+
return [q2, v2, p2];
|
|
31572
31008
|
}
|
|
31573
|
-
|
|
31574
|
-
|
|
31575
|
-
|
|
31576
|
-
|
|
31577
|
-
|
|
31578
|
-
|
|
31579
|
-
|
|
31580
|
-
|
|
31581
|
-
|
|
31582
|
-
|
|
31583
|
-
|
|
31584
|
-
var f2 = 0;
|
|
31585
|
-
if (v2 > 0) {
|
|
31586
|
-
f2 = c2 / v2;
|
|
31587
|
-
}
|
|
31588
|
-
return [hcg[0], f2 * 100, v2 * 100];
|
|
31589
|
-
};
|
|
31590
|
-
convert2.hcg.hsl = function(hcg) {
|
|
31591
|
-
var c2 = hcg[1] / 100;
|
|
31592
|
-
var g2 = hcg[2] / 100;
|
|
31593
|
-
var l2 = g2 * (1 - c2) + 0.5 * c2;
|
|
31594
|
-
var s2 = 0;
|
|
31595
|
-
if (l2 > 0 && l2 < 0.5) {
|
|
31596
|
-
s2 = c2 / (2 * l2);
|
|
31597
|
-
} else if (l2 >= 0.5 && l2 < 1) {
|
|
31598
|
-
s2 = c2 / (2 * (1 - l2));
|
|
31599
|
-
}
|
|
31600
|
-
return [hcg[0], s2 * 100, l2 * 100];
|
|
31601
|
-
};
|
|
31602
|
-
convert2.hcg.hwb = function(hcg) {
|
|
31603
|
-
var c2 = hcg[1] / 100;
|
|
31604
|
-
var g2 = hcg[2] / 100;
|
|
31605
|
-
var v2 = c2 + g2 * (1 - c2);
|
|
31606
|
-
return [hcg[0], (v2 - c2) * 100, (1 - v2) * 100];
|
|
31607
|
-
};
|
|
31608
|
-
convert2.hwb.hcg = function(hwb) {
|
|
31609
|
-
var w2 = hwb[1] / 100;
|
|
31610
|
-
var b3 = hwb[2] / 100;
|
|
31611
|
-
var v2 = 1 - b3;
|
|
31612
|
-
var c2 = v2 - w2;
|
|
31613
|
-
var g2 = 0;
|
|
31614
|
-
if (c2 < 1) {
|
|
31615
|
-
g2 = (v2 - c2) / (1 - c2);
|
|
31616
|
-
}
|
|
31617
|
-
return [hwb[0], c2 * 100, g2 * 100];
|
|
31618
|
-
};
|
|
31619
|
-
convert2.apple.rgb = function(apple) {
|
|
31620
|
-
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
31621
|
-
};
|
|
31622
|
-
convert2.rgb.apple = function(rgb) {
|
|
31623
|
-
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
31624
|
-
};
|
|
31625
|
-
convert2.gray.rgb = function(args) {
|
|
31626
|
-
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
31627
|
-
};
|
|
31628
|
-
convert2.gray.hsl = convert2.gray.hsv = function(args) {
|
|
31629
|
-
return [0, 0, args[0]];
|
|
31630
|
-
};
|
|
31631
|
-
convert2.gray.hwb = function(gray) {
|
|
31632
|
-
return [0, 100, gray[0]];
|
|
31633
|
-
};
|
|
31634
|
-
convert2.gray.cmyk = function(gray) {
|
|
31635
|
-
return [0, 0, 0, gray[0]];
|
|
31636
|
-
};
|
|
31637
|
-
convert2.gray.lab = function(gray) {
|
|
31638
|
-
return [gray[0], 0, 0];
|
|
31639
|
-
};
|
|
31640
|
-
convert2.gray.hex = function(gray) {
|
|
31641
|
-
var val2 = Math.round(gray[0] / 100 * 255) & 255;
|
|
31642
|
-
var integer = (val2 << 16) + (val2 << 8) + val2;
|
|
31643
|
-
var string2 = integer.toString(16).toUpperCase();
|
|
31644
|
-
return "000000".substring(string2.length) + string2;
|
|
31645
|
-
};
|
|
31646
|
-
convert2.rgb.gray = function(rgb) {
|
|
31647
|
-
var val2 = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
31648
|
-
return [val2 / 255 * 100];
|
|
31649
|
-
};
|
|
31650
|
-
return conversions.exports;
|
|
31651
|
-
}
|
|
31652
|
-
__name(requireConversions, "requireConversions");
|
|
31653
|
-
var route;
|
|
31654
|
-
var hasRequiredRoute;
|
|
31655
|
-
function requireRoute() {
|
|
31656
|
-
if (hasRequiredRoute) return route;
|
|
31657
|
-
hasRequiredRoute = 1;
|
|
31658
|
-
var conversions2 = requireConversions();
|
|
31659
|
-
function buildGraph() {
|
|
31660
|
-
var graph = {};
|
|
31661
|
-
var models = Object.keys(conversions2);
|
|
31662
|
-
for (var len = models.length, i = 0; i < len; i++) {
|
|
31663
|
-
graph[models[i]] = {
|
|
31664
|
-
// http://jsperf.com/1-vs-infinity
|
|
31665
|
-
// micro-opt, but this is simple.
|
|
31666
|
-
distance: -1,
|
|
31667
|
-
parent: null
|
|
31668
|
-
};
|
|
31009
|
+
case 2: {
|
|
31010
|
+
return [p2, v2, t2];
|
|
31011
|
+
}
|
|
31012
|
+
case 3: {
|
|
31013
|
+
return [p2, q2, v2];
|
|
31014
|
+
}
|
|
31015
|
+
case 4: {
|
|
31016
|
+
return [t2, p2, v2];
|
|
31017
|
+
}
|
|
31018
|
+
case 5: {
|
|
31019
|
+
return [v2, p2, q2];
|
|
31669
31020
|
}
|
|
31670
|
-
return graph;
|
|
31671
31021
|
}
|
|
31672
|
-
|
|
31673
|
-
|
|
31674
|
-
|
|
31675
|
-
|
|
31676
|
-
|
|
31677
|
-
|
|
31678
|
-
|
|
31679
|
-
|
|
31680
|
-
|
|
31681
|
-
|
|
31682
|
-
|
|
31683
|
-
|
|
31684
|
-
|
|
31685
|
-
|
|
31686
|
-
|
|
31687
|
-
|
|
31688
|
-
|
|
31022
|
+
};
|
|
31023
|
+
convert$2.hsv.hsl = function(hsv) {
|
|
31024
|
+
const h2 = hsv[0];
|
|
31025
|
+
const s2 = hsv[1] / 100;
|
|
31026
|
+
const v2 = hsv[2] / 100;
|
|
31027
|
+
const vmin = Math.max(v2, 0.01);
|
|
31028
|
+
let sl;
|
|
31029
|
+
let l2;
|
|
31030
|
+
l2 = (2 - s2) * v2;
|
|
31031
|
+
const lmin = (2 - s2) * vmin;
|
|
31032
|
+
sl = s2 * vmin;
|
|
31033
|
+
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
31034
|
+
sl = sl || 0;
|
|
31035
|
+
l2 /= 2;
|
|
31036
|
+
return [h2, sl * 100, l2 * 100];
|
|
31037
|
+
};
|
|
31038
|
+
convert$2.hwb.rgb = function(hwb) {
|
|
31039
|
+
const h2 = hwb[0] / 360;
|
|
31040
|
+
let wh = hwb[1] / 100;
|
|
31041
|
+
let bl = hwb[2] / 100;
|
|
31042
|
+
const ratio = wh + bl;
|
|
31043
|
+
let f2;
|
|
31044
|
+
if (ratio > 1) {
|
|
31045
|
+
wh /= ratio;
|
|
31046
|
+
bl /= ratio;
|
|
31047
|
+
}
|
|
31048
|
+
const i = Math.floor(6 * h2);
|
|
31049
|
+
const v2 = 1 - bl;
|
|
31050
|
+
f2 = 6 * h2 - i;
|
|
31051
|
+
if ((i & 1) !== 0) {
|
|
31052
|
+
f2 = 1 - f2;
|
|
31053
|
+
}
|
|
31054
|
+
const n2 = wh + f2 * (v2 - wh);
|
|
31055
|
+
let r2;
|
|
31056
|
+
let g2;
|
|
31057
|
+
let b3;
|
|
31058
|
+
switch (i) {
|
|
31059
|
+
default:
|
|
31060
|
+
case 6:
|
|
31061
|
+
case 0: {
|
|
31062
|
+
r2 = v2;
|
|
31063
|
+
g2 = n2;
|
|
31064
|
+
b3 = wh;
|
|
31065
|
+
break;
|
|
31066
|
+
}
|
|
31067
|
+
case 1: {
|
|
31068
|
+
r2 = n2;
|
|
31069
|
+
g2 = v2;
|
|
31070
|
+
b3 = wh;
|
|
31071
|
+
break;
|
|
31072
|
+
}
|
|
31073
|
+
case 2: {
|
|
31074
|
+
r2 = wh;
|
|
31075
|
+
g2 = v2;
|
|
31076
|
+
b3 = n2;
|
|
31077
|
+
break;
|
|
31078
|
+
}
|
|
31079
|
+
case 3: {
|
|
31080
|
+
r2 = wh;
|
|
31081
|
+
g2 = n2;
|
|
31082
|
+
b3 = v2;
|
|
31083
|
+
break;
|
|
31084
|
+
}
|
|
31085
|
+
case 4: {
|
|
31086
|
+
r2 = n2;
|
|
31087
|
+
g2 = wh;
|
|
31088
|
+
b3 = v2;
|
|
31089
|
+
break;
|
|
31090
|
+
}
|
|
31091
|
+
case 5: {
|
|
31092
|
+
r2 = v2;
|
|
31093
|
+
g2 = wh;
|
|
31094
|
+
b3 = n2;
|
|
31095
|
+
break;
|
|
31096
|
+
}
|
|
31097
|
+
}
|
|
31098
|
+
return [r2 * 255, g2 * 255, b3 * 255];
|
|
31099
|
+
};
|
|
31100
|
+
convert$2.cmyk.rgb = function(cmyk) {
|
|
31101
|
+
const c2 = cmyk[0] / 100;
|
|
31102
|
+
const m2 = cmyk[1] / 100;
|
|
31103
|
+
const y2 = cmyk[2] / 100;
|
|
31104
|
+
const k2 = cmyk[3] / 100;
|
|
31105
|
+
const r2 = 1 - Math.min(1, c2 * (1 - k2) + k2);
|
|
31106
|
+
const g2 = 1 - Math.min(1, m2 * (1 - k2) + k2);
|
|
31107
|
+
const b3 = 1 - Math.min(1, y2 * (1 - k2) + k2);
|
|
31108
|
+
return [r2 * 255, g2 * 255, b3 * 255];
|
|
31109
|
+
};
|
|
31110
|
+
convert$2.xyz.rgb = function(xyz) {
|
|
31111
|
+
const x = xyz[0] / 100;
|
|
31112
|
+
const y2 = xyz[1] / 100;
|
|
31113
|
+
const z2 = xyz[2] / 100;
|
|
31114
|
+
let r2;
|
|
31115
|
+
let g2;
|
|
31116
|
+
let b3;
|
|
31117
|
+
r2 = x * 3.2404542 + y2 * -1.5371385 + z2 * -0.4985314;
|
|
31118
|
+
g2 = x * -0.969266 + y2 * 1.8760108 + z2 * 0.041556;
|
|
31119
|
+
b3 = x * 0.0556434 + y2 * -0.2040259 + z2 * 1.0572252;
|
|
31120
|
+
r2 = srgbNonlinearTransform(r2);
|
|
31121
|
+
g2 = srgbNonlinearTransform(g2);
|
|
31122
|
+
b3 = srgbNonlinearTransform(b3);
|
|
31123
|
+
return [r2 * 255, g2 * 255, b3 * 255];
|
|
31124
|
+
};
|
|
31125
|
+
convert$2.xyz.lab = function(xyz) {
|
|
31126
|
+
let x = xyz[0];
|
|
31127
|
+
let y2 = xyz[1];
|
|
31128
|
+
let z2 = xyz[2];
|
|
31129
|
+
x /= 95.047;
|
|
31130
|
+
y2 /= 100;
|
|
31131
|
+
z2 /= 108.883;
|
|
31132
|
+
x = x > LAB_FT ? __pow(x, 1 / 3) : 7.787 * x + 16 / 116;
|
|
31133
|
+
y2 = y2 > LAB_FT ? __pow(y2, 1 / 3) : 7.787 * y2 + 16 / 116;
|
|
31134
|
+
z2 = z2 > LAB_FT ? __pow(z2, 1 / 3) : 7.787 * z2 + 16 / 116;
|
|
31135
|
+
const l2 = 116 * y2 - 16;
|
|
31136
|
+
const a2 = 500 * (x - y2);
|
|
31137
|
+
const b3 = 200 * (y2 - z2);
|
|
31138
|
+
return [l2, a2, b3];
|
|
31139
|
+
};
|
|
31140
|
+
convert$2.xyz.oklab = function(xyz) {
|
|
31141
|
+
const x = xyz[0] / 100;
|
|
31142
|
+
const y2 = xyz[1] / 100;
|
|
31143
|
+
const z2 = xyz[2] / 100;
|
|
31144
|
+
const lp = Math.cbrt(0.8189330101 * x + 0.3618667424 * y2 - 0.1288597137 * z2);
|
|
31145
|
+
const mp = Math.cbrt(0.0329845436 * x + 0.9293118715 * y2 + 0.0361456387 * z2);
|
|
31146
|
+
const sp = Math.cbrt(0.0482003018 * x + 0.2643662691 * y2 + 0.633851707 * z2);
|
|
31147
|
+
const l2 = 0.2104542553 * lp + 0.793617785 * mp - 0.0040720468 * sp;
|
|
31148
|
+
const a2 = 1.9779984951 * lp - 2.428592205 * mp + 0.4505937099 * sp;
|
|
31149
|
+
const b3 = 0.0259040371 * lp + 0.7827717662 * mp - 0.808675766 * sp;
|
|
31150
|
+
return [l2 * 100, a2 * 100, b3 * 100];
|
|
31151
|
+
};
|
|
31152
|
+
convert$2.oklab.oklch = function(oklab) {
|
|
31153
|
+
return convert$2.lab.lch(oklab);
|
|
31154
|
+
};
|
|
31155
|
+
convert$2.oklab.xyz = function(oklab) {
|
|
31156
|
+
const ll = oklab[0] / 100;
|
|
31157
|
+
const a2 = oklab[1] / 100;
|
|
31158
|
+
const b3 = oklab[2] / 100;
|
|
31159
|
+
const l2 = __pow(0.999999998 * ll + 0.396337792 * a2 + 0.215803758 * b3, 3);
|
|
31160
|
+
const m2 = __pow(1.000000008 * ll - 0.105561342 * a2 - 0.063854175 * b3, 3);
|
|
31161
|
+
const s2 = __pow(1.000000055 * ll - 0.089484182 * a2 - 1.291485538 * b3, 3);
|
|
31162
|
+
const x = 1.227013851 * l2 - 0.55779998 * m2 + 0.281256149 * s2;
|
|
31163
|
+
const y2 = -0.040580178 * l2 + 1.11225687 * m2 - 0.071676679 * s2;
|
|
31164
|
+
const z2 = -0.076381285 * l2 - 0.421481978 * m2 + 1.58616322 * s2;
|
|
31165
|
+
return [x * 100, y2 * 100, z2 * 100];
|
|
31166
|
+
};
|
|
31167
|
+
convert$2.oklab.rgb = function(oklab) {
|
|
31168
|
+
const ll = oklab[0] / 100;
|
|
31169
|
+
const aa = oklab[1] / 100;
|
|
31170
|
+
const bb = oklab[2] / 100;
|
|
31171
|
+
const l2 = __pow(ll + 0.3963377774 * aa + 0.2158037573 * bb, 3);
|
|
31172
|
+
const m2 = __pow(ll - 0.1055613458 * aa - 0.0638541728 * bb, 3);
|
|
31173
|
+
const s2 = __pow(ll - 0.0894841775 * aa - 1.291485548 * bb, 3);
|
|
31174
|
+
const r2 = srgbNonlinearTransform(4.0767416621 * l2 - 3.3077115913 * m2 + 0.2309699292 * s2);
|
|
31175
|
+
const g2 = srgbNonlinearTransform(-1.2684380046 * l2 + 2.6097574011 * m2 - 0.3413193965 * s2);
|
|
31176
|
+
const b3 = srgbNonlinearTransform(-0.0041960863 * l2 - 0.7034186147 * m2 + 1.707614701 * s2);
|
|
31177
|
+
return [r2 * 255, g2 * 255, b3 * 255];
|
|
31178
|
+
};
|
|
31179
|
+
convert$2.oklch.oklab = function(oklch) {
|
|
31180
|
+
return convert$2.lch.lab(oklch);
|
|
31181
|
+
};
|
|
31182
|
+
convert$2.lab.xyz = function(lab) {
|
|
31183
|
+
const l2 = lab[0];
|
|
31184
|
+
const a2 = lab[1];
|
|
31185
|
+
const b3 = lab[2];
|
|
31186
|
+
let x;
|
|
31187
|
+
let y2;
|
|
31188
|
+
let z2;
|
|
31189
|
+
y2 = (l2 + 16) / 116;
|
|
31190
|
+
x = a2 / 500 + y2;
|
|
31191
|
+
z2 = y2 - b3 / 200;
|
|
31192
|
+
const y22 = __pow(y2, 3);
|
|
31193
|
+
const x2 = __pow(x, 3);
|
|
31194
|
+
const z22 = __pow(z2, 3);
|
|
31195
|
+
y2 = y22 > LAB_FT ? y22 : (y2 - 16 / 116) / 7.787;
|
|
31196
|
+
x = x2 > LAB_FT ? x2 : (x - 16 / 116) / 7.787;
|
|
31197
|
+
z2 = z22 > LAB_FT ? z22 : (z2 - 16 / 116) / 7.787;
|
|
31198
|
+
x *= 95.047;
|
|
31199
|
+
y2 *= 100;
|
|
31200
|
+
z2 *= 108.883;
|
|
31201
|
+
return [x, y2, z2];
|
|
31202
|
+
};
|
|
31203
|
+
convert$2.lab.lch = function(lab) {
|
|
31204
|
+
const l2 = lab[0];
|
|
31205
|
+
const a2 = lab[1];
|
|
31206
|
+
const b3 = lab[2];
|
|
31207
|
+
let h2;
|
|
31208
|
+
const hr = Math.atan2(b3, a2);
|
|
31209
|
+
h2 = hr * 360 / 2 / Math.PI;
|
|
31210
|
+
if (h2 < 0) {
|
|
31211
|
+
h2 += 360;
|
|
31212
|
+
}
|
|
31213
|
+
const c2 = Math.sqrt(a2 * a2 + b3 * b3);
|
|
31214
|
+
return [l2, c2, h2];
|
|
31215
|
+
};
|
|
31216
|
+
convert$2.lch.lab = function(lch) {
|
|
31217
|
+
const l2 = lch[0];
|
|
31218
|
+
const c2 = lch[1];
|
|
31219
|
+
const h2 = lch[2];
|
|
31220
|
+
const hr = h2 / 360 * 2 * Math.PI;
|
|
31221
|
+
const a2 = c2 * Math.cos(hr);
|
|
31222
|
+
const b3 = c2 * Math.sin(hr);
|
|
31223
|
+
return [l2, a2, b3];
|
|
31224
|
+
};
|
|
31225
|
+
convert$2.rgb.ansi16 = function(args, saturation = null) {
|
|
31226
|
+
const [r2, g2, b3] = args;
|
|
31227
|
+
let value = saturation === null ? convert$2.rgb.hsv(args)[2] : saturation;
|
|
31228
|
+
value = Math.round(value / 50);
|
|
31229
|
+
if (value === 0) {
|
|
31230
|
+
return 30;
|
|
31231
|
+
}
|
|
31232
|
+
let ansi = 30 + (Math.round(b3 / 255) << 2 | Math.round(g2 / 255) << 1 | Math.round(r2 / 255));
|
|
31233
|
+
if (value === 2) {
|
|
31234
|
+
ansi += 60;
|
|
31235
|
+
}
|
|
31236
|
+
return ansi;
|
|
31237
|
+
};
|
|
31238
|
+
convert$2.hsv.ansi16 = function(args) {
|
|
31239
|
+
return convert$2.rgb.ansi16(convert$2.hsv.rgb(args), args[2]);
|
|
31240
|
+
};
|
|
31241
|
+
convert$2.rgb.ansi256 = function(args) {
|
|
31242
|
+
const r2 = args[0];
|
|
31243
|
+
const g2 = args[1];
|
|
31244
|
+
const b3 = args[2];
|
|
31245
|
+
if (r2 >> 4 === g2 >> 4 && g2 >> 4 === b3 >> 4) {
|
|
31246
|
+
if (r2 < 8) {
|
|
31247
|
+
return 16;
|
|
31248
|
+
}
|
|
31249
|
+
if (r2 > 248) {
|
|
31250
|
+
return 231;
|
|
31251
|
+
}
|
|
31252
|
+
return Math.round((r2 - 8) / 247 * 24) + 232;
|
|
31253
|
+
}
|
|
31254
|
+
const ansi = 16 + 36 * Math.round(r2 / 255 * 5) + 6 * Math.round(g2 / 255 * 5) + Math.round(b3 / 255 * 5);
|
|
31255
|
+
return ansi;
|
|
31256
|
+
};
|
|
31257
|
+
convert$2.ansi16.rgb = function(args) {
|
|
31258
|
+
args = args[0];
|
|
31259
|
+
let color2 = args % 10;
|
|
31260
|
+
if (color2 === 0 || color2 === 7) {
|
|
31261
|
+
if (args > 50) {
|
|
31262
|
+
color2 += 3.5;
|
|
31263
|
+
}
|
|
31264
|
+
color2 = color2 / 10.5 * 255;
|
|
31265
|
+
return [color2, color2, color2];
|
|
31266
|
+
}
|
|
31267
|
+
const mult = (Math.trunc(args > 50) + 1) * 0.5;
|
|
31268
|
+
const r2 = (color2 & 1) * mult * 255;
|
|
31269
|
+
const g2 = (color2 >> 1 & 1) * mult * 255;
|
|
31270
|
+
const b3 = (color2 >> 2 & 1) * mult * 255;
|
|
31271
|
+
return [r2, g2, b3];
|
|
31272
|
+
};
|
|
31273
|
+
convert$2.ansi256.rgb = function(args) {
|
|
31274
|
+
args = args[0];
|
|
31275
|
+
if (args >= 232) {
|
|
31276
|
+
const c2 = (args - 232) * 10 + 8;
|
|
31277
|
+
return [c2, c2, c2];
|
|
31278
|
+
}
|
|
31279
|
+
args -= 16;
|
|
31280
|
+
let rem;
|
|
31281
|
+
const r2 = Math.floor(args / 36) / 5 * 255;
|
|
31282
|
+
const g2 = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
31283
|
+
const b3 = rem % 6 / 5 * 255;
|
|
31284
|
+
return [r2, g2, b3];
|
|
31285
|
+
};
|
|
31286
|
+
convert$2.rgb.hex = function(args) {
|
|
31287
|
+
const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
31288
|
+
const string2 = integer.toString(16).toUpperCase();
|
|
31289
|
+
return "000000".slice(string2.length) + string2;
|
|
31290
|
+
};
|
|
31291
|
+
convert$2.hex.rgb = function(args) {
|
|
31292
|
+
const match = args.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);
|
|
31293
|
+
if (!match) {
|
|
31294
|
+
return [0, 0, 0];
|
|
31295
|
+
}
|
|
31296
|
+
let colorString = match[0];
|
|
31297
|
+
if (match[0].length === 3) {
|
|
31298
|
+
colorString = [...colorString].map((char) => char + char).join("");
|
|
31299
|
+
}
|
|
31300
|
+
const integer = Number.parseInt(colorString, 16);
|
|
31301
|
+
const r2 = integer >> 16 & 255;
|
|
31302
|
+
const g2 = integer >> 8 & 255;
|
|
31303
|
+
const b3 = integer & 255;
|
|
31304
|
+
return [r2, g2, b3];
|
|
31305
|
+
};
|
|
31306
|
+
convert$2.rgb.hcg = function(rgb) {
|
|
31307
|
+
const r2 = rgb[0] / 255;
|
|
31308
|
+
const g2 = rgb[1] / 255;
|
|
31309
|
+
const b3 = rgb[2] / 255;
|
|
31310
|
+
const max2 = Math.max(Math.max(r2, g2), b3);
|
|
31311
|
+
const min2 = Math.min(Math.min(r2, g2), b3);
|
|
31312
|
+
const chroma = max2 - min2;
|
|
31313
|
+
let hue;
|
|
31314
|
+
const grayscale = chroma < 1 ? min2 / (1 - chroma) : 0;
|
|
31315
|
+
if (chroma <= 0) {
|
|
31316
|
+
hue = 0;
|
|
31317
|
+
} else if (max2 === r2) {
|
|
31318
|
+
hue = (g2 - b3) / chroma % 6;
|
|
31319
|
+
} else if (max2 === g2) {
|
|
31320
|
+
hue = 2 + (b3 - r2) / chroma;
|
|
31321
|
+
} else {
|
|
31322
|
+
hue = 4 + (r2 - g2) / chroma;
|
|
31323
|
+
}
|
|
31324
|
+
hue /= 6;
|
|
31325
|
+
hue %= 1;
|
|
31326
|
+
return [hue * 360, chroma * 100, grayscale * 100];
|
|
31327
|
+
};
|
|
31328
|
+
convert$2.hsl.hcg = function(hsl) {
|
|
31329
|
+
const s2 = hsl[1] / 100;
|
|
31330
|
+
const l2 = hsl[2] / 100;
|
|
31331
|
+
const c2 = l2 < 0.5 ? 2 * s2 * l2 : 2 * s2 * (1 - l2);
|
|
31332
|
+
let f2 = 0;
|
|
31333
|
+
if (c2 < 1) {
|
|
31334
|
+
f2 = (l2 - 0.5 * c2) / (1 - c2);
|
|
31335
|
+
}
|
|
31336
|
+
return [hsl[0], c2 * 100, f2 * 100];
|
|
31337
|
+
};
|
|
31338
|
+
convert$2.hsv.hcg = function(hsv) {
|
|
31339
|
+
const s2 = hsv[1] / 100;
|
|
31340
|
+
const v2 = hsv[2] / 100;
|
|
31341
|
+
const c2 = s2 * v2;
|
|
31342
|
+
let f2 = 0;
|
|
31343
|
+
if (c2 < 1) {
|
|
31344
|
+
f2 = (v2 - c2) / (1 - c2);
|
|
31345
|
+
}
|
|
31346
|
+
return [hsv[0], c2 * 100, f2 * 100];
|
|
31347
|
+
};
|
|
31348
|
+
convert$2.hcg.rgb = function(hcg) {
|
|
31349
|
+
const h2 = hcg[0] / 360;
|
|
31350
|
+
const c2 = hcg[1] / 100;
|
|
31351
|
+
const g2 = hcg[2] / 100;
|
|
31352
|
+
if (c2 === 0) {
|
|
31353
|
+
return [g2 * 255, g2 * 255, g2 * 255];
|
|
31354
|
+
}
|
|
31355
|
+
const pure2 = [0, 0, 0];
|
|
31356
|
+
const hi = h2 % 1 * 6;
|
|
31357
|
+
const v2 = hi % 1;
|
|
31358
|
+
const w2 = 1 - v2;
|
|
31359
|
+
let mg = 0;
|
|
31360
|
+
switch (Math.floor(hi)) {
|
|
31361
|
+
case 0: {
|
|
31362
|
+
pure2[0] = 1;
|
|
31363
|
+
pure2[1] = v2;
|
|
31364
|
+
pure2[2] = 0;
|
|
31365
|
+
break;
|
|
31366
|
+
}
|
|
31367
|
+
case 1: {
|
|
31368
|
+
pure2[0] = w2;
|
|
31369
|
+
pure2[1] = 1;
|
|
31370
|
+
pure2[2] = 0;
|
|
31371
|
+
break;
|
|
31372
|
+
}
|
|
31373
|
+
case 2: {
|
|
31374
|
+
pure2[0] = 0;
|
|
31375
|
+
pure2[1] = 1;
|
|
31376
|
+
pure2[2] = v2;
|
|
31377
|
+
break;
|
|
31378
|
+
}
|
|
31379
|
+
case 3: {
|
|
31380
|
+
pure2[0] = 0;
|
|
31381
|
+
pure2[1] = w2;
|
|
31382
|
+
pure2[2] = 1;
|
|
31383
|
+
break;
|
|
31384
|
+
}
|
|
31385
|
+
case 4: {
|
|
31386
|
+
pure2[0] = v2;
|
|
31387
|
+
pure2[1] = 0;
|
|
31388
|
+
pure2[2] = 1;
|
|
31389
|
+
break;
|
|
31390
|
+
}
|
|
31391
|
+
default: {
|
|
31392
|
+
pure2[0] = 1;
|
|
31393
|
+
pure2[1] = 0;
|
|
31394
|
+
pure2[2] = w2;
|
|
31689
31395
|
}
|
|
31690
|
-
return graph;
|
|
31691
31396
|
}
|
|
31692
|
-
|
|
31693
|
-
|
|
31694
|
-
|
|
31695
|
-
|
|
31397
|
+
mg = (1 - c2) * g2;
|
|
31398
|
+
return [
|
|
31399
|
+
(c2 * pure2[0] + mg) * 255,
|
|
31400
|
+
(c2 * pure2[1] + mg) * 255,
|
|
31401
|
+
(c2 * pure2[2] + mg) * 255
|
|
31402
|
+
];
|
|
31403
|
+
};
|
|
31404
|
+
convert$2.hcg.hsv = function(hcg) {
|
|
31405
|
+
const c2 = hcg[1] / 100;
|
|
31406
|
+
const g2 = hcg[2] / 100;
|
|
31407
|
+
const v2 = c2 + g2 * (1 - c2);
|
|
31408
|
+
let f2 = 0;
|
|
31409
|
+
if (v2 > 0) {
|
|
31410
|
+
f2 = c2 / v2;
|
|
31411
|
+
}
|
|
31412
|
+
return [hcg[0], f2 * 100, v2 * 100];
|
|
31413
|
+
};
|
|
31414
|
+
convert$2.hcg.hsl = function(hcg) {
|
|
31415
|
+
const c2 = hcg[1] / 100;
|
|
31416
|
+
const g2 = hcg[2] / 100;
|
|
31417
|
+
const l2 = g2 * (1 - c2) + 0.5 * c2;
|
|
31418
|
+
let s2 = 0;
|
|
31419
|
+
if (l2 > 0 && l2 < 0.5) {
|
|
31420
|
+
s2 = c2 / (2 * l2);
|
|
31421
|
+
} else if (l2 >= 0.5 && l2 < 1) {
|
|
31422
|
+
s2 = c2 / (2 * (1 - l2));
|
|
31423
|
+
}
|
|
31424
|
+
return [hcg[0], s2 * 100, l2 * 100];
|
|
31425
|
+
};
|
|
31426
|
+
convert$2.hcg.hwb = function(hcg) {
|
|
31427
|
+
const c2 = hcg[1] / 100;
|
|
31428
|
+
const g2 = hcg[2] / 100;
|
|
31429
|
+
const v2 = c2 + g2 * (1 - c2);
|
|
31430
|
+
return [hcg[0], (v2 - c2) * 100, (1 - v2) * 100];
|
|
31431
|
+
};
|
|
31432
|
+
convert$2.hwb.hcg = function(hwb) {
|
|
31433
|
+
const w2 = hwb[1] / 100;
|
|
31434
|
+
const b3 = hwb[2] / 100;
|
|
31435
|
+
const v2 = 1 - b3;
|
|
31436
|
+
const c2 = v2 - w2;
|
|
31437
|
+
let g2 = 0;
|
|
31438
|
+
if (c2 < 1) {
|
|
31439
|
+
g2 = (v2 - c2) / (1 - c2);
|
|
31440
|
+
}
|
|
31441
|
+
return [hwb[0], c2 * 100, g2 * 100];
|
|
31442
|
+
};
|
|
31443
|
+
convert$2.apple.rgb = function(apple) {
|
|
31444
|
+
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
31445
|
+
};
|
|
31446
|
+
convert$2.rgb.apple = function(rgb) {
|
|
31447
|
+
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
31448
|
+
};
|
|
31449
|
+
convert$2.gray.rgb = function(args) {
|
|
31450
|
+
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
31451
|
+
};
|
|
31452
|
+
convert$2.gray.hsl = function(args) {
|
|
31453
|
+
return [0, 0, args[0]];
|
|
31454
|
+
};
|
|
31455
|
+
convert$2.gray.hsv = convert$2.gray.hsl;
|
|
31456
|
+
convert$2.gray.hwb = function(gray) {
|
|
31457
|
+
return [0, 100, gray[0]];
|
|
31458
|
+
};
|
|
31459
|
+
convert$2.gray.cmyk = function(gray) {
|
|
31460
|
+
return [0, 0, 0, gray[0]];
|
|
31461
|
+
};
|
|
31462
|
+
convert$2.gray.lab = function(gray) {
|
|
31463
|
+
return [gray[0], 0, 0];
|
|
31464
|
+
};
|
|
31465
|
+
convert$2.gray.hex = function(gray) {
|
|
31466
|
+
const value = Math.round(gray[0] / 100 * 255) & 255;
|
|
31467
|
+
const integer = (value << 16) + (value << 8) + value;
|
|
31468
|
+
const string2 = integer.toString(16).toUpperCase();
|
|
31469
|
+
return "000000".slice(string2.length) + string2;
|
|
31470
|
+
};
|
|
31471
|
+
convert$2.rgb.gray = function(rgb) {
|
|
31472
|
+
const value = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
31473
|
+
return [value / 255 * 100];
|
|
31474
|
+
};
|
|
31475
|
+
function buildGraph() {
|
|
31476
|
+
const graph = {};
|
|
31477
|
+
const models2 = Object.keys(convert$2);
|
|
31478
|
+
for (let { length } = models2, i = 0; i < length; i++) {
|
|
31479
|
+
graph[models2[i]] = {
|
|
31480
|
+
// http://jsperf.com/1-vs-infinity
|
|
31481
|
+
// micro-opt, but this is simple.
|
|
31482
|
+
distance: -1,
|
|
31483
|
+
parent: null
|
|
31696
31484
|
};
|
|
31697
31485
|
}
|
|
31698
|
-
|
|
31699
|
-
|
|
31700
|
-
|
|
31701
|
-
|
|
31702
|
-
|
|
31703
|
-
|
|
31704
|
-
|
|
31705
|
-
|
|
31706
|
-
|
|
31707
|
-
|
|
31708
|
-
|
|
31709
|
-
|
|
31486
|
+
return graph;
|
|
31487
|
+
}
|
|
31488
|
+
__name(buildGraph, "buildGraph");
|
|
31489
|
+
function deriveBFS(fromModel) {
|
|
31490
|
+
const graph = buildGraph();
|
|
31491
|
+
const queue = [fromModel];
|
|
31492
|
+
graph[fromModel].distance = 0;
|
|
31493
|
+
while (queue.length > 0) {
|
|
31494
|
+
const current = queue.pop();
|
|
31495
|
+
const adjacents = Object.keys(convert$2[current]);
|
|
31496
|
+
for (let { length } = adjacents, i = 0; i < length; i++) {
|
|
31497
|
+
const adjacent = adjacents[i];
|
|
31498
|
+
const node2 = graph[adjacent];
|
|
31499
|
+
if (node2.distance === -1) {
|
|
31500
|
+
node2.distance = graph[current].distance + 1;
|
|
31501
|
+
node2.parent = current;
|
|
31502
|
+
queue.unshift(adjacent);
|
|
31503
|
+
}
|
|
31504
|
+
}
|
|
31505
|
+
}
|
|
31506
|
+
return graph;
|
|
31507
|
+
}
|
|
31508
|
+
__name(deriveBFS, "deriveBFS");
|
|
31509
|
+
function link$2(from, to) {
|
|
31510
|
+
return function(args) {
|
|
31511
|
+
return to(from(args));
|
|
31512
|
+
};
|
|
31513
|
+
}
|
|
31514
|
+
__name(link$2, "link$2");
|
|
31515
|
+
function wrapConversion(toModel, graph) {
|
|
31516
|
+
const path2 = [graph[toModel].parent, toModel];
|
|
31517
|
+
let fn4 = convert$2[graph[toModel].parent][toModel];
|
|
31518
|
+
let cur = graph[toModel].parent;
|
|
31519
|
+
while (graph[cur].parent) {
|
|
31520
|
+
path2.unshift(graph[cur].parent);
|
|
31521
|
+
fn4 = link$2(convert$2[graph[cur].parent][cur], fn4);
|
|
31522
|
+
cur = graph[cur].parent;
|
|
31523
|
+
}
|
|
31524
|
+
fn4.conversion = path2;
|
|
31525
|
+
return fn4;
|
|
31526
|
+
}
|
|
31527
|
+
__name(wrapConversion, "wrapConversion");
|
|
31528
|
+
function route(fromModel) {
|
|
31529
|
+
const graph = deriveBFS(fromModel);
|
|
31530
|
+
const conversion = {};
|
|
31531
|
+
const models2 = Object.keys(graph);
|
|
31532
|
+
for (let { length } = models2, i = 0; i < length; i++) {
|
|
31533
|
+
const toModel = models2[i];
|
|
31534
|
+
const node2 = graph[toModel];
|
|
31535
|
+
if (node2.parent === null) {
|
|
31536
|
+
continue;
|
|
31537
|
+
}
|
|
31538
|
+
conversion[toModel] = wrapConversion(toModel, graph);
|
|
31710
31539
|
}
|
|
31711
|
-
|
|
31712
|
-
|
|
31713
|
-
|
|
31714
|
-
|
|
31715
|
-
|
|
31716
|
-
|
|
31717
|
-
|
|
31718
|
-
|
|
31719
|
-
|
|
31720
|
-
|
|
31721
|
-
|
|
31722
|
-
|
|
31540
|
+
return conversion;
|
|
31541
|
+
}
|
|
31542
|
+
__name(route, "route");
|
|
31543
|
+
const convert$1 = {};
|
|
31544
|
+
const models = Object.keys(convert$2);
|
|
31545
|
+
function wrapRaw(fn4) {
|
|
31546
|
+
const wrappedFn = /* @__PURE__ */ __name(function(...args) {
|
|
31547
|
+
const arg0 = args[0];
|
|
31548
|
+
if (arg0 === void 0 || arg0 === null) {
|
|
31549
|
+
return arg0;
|
|
31550
|
+
}
|
|
31551
|
+
if (arg0.length > 1) {
|
|
31552
|
+
args = arg0;
|
|
31723
31553
|
}
|
|
31724
|
-
return
|
|
31725
|
-
}, "
|
|
31726
|
-
|
|
31554
|
+
return fn4(args);
|
|
31555
|
+
}, "wrappedFn");
|
|
31556
|
+
if ("conversion" in fn4) {
|
|
31557
|
+
wrappedFn.conversion = fn4.conversion;
|
|
31558
|
+
}
|
|
31559
|
+
return wrappedFn;
|
|
31727
31560
|
}
|
|
31728
|
-
__name(
|
|
31729
|
-
|
|
31730
|
-
|
|
31731
|
-
|
|
31732
|
-
|
|
31733
|
-
|
|
31734
|
-
|
|
31735
|
-
|
|
31736
|
-
|
|
31737
|
-
|
|
31738
|
-
|
|
31739
|
-
|
|
31740
|
-
|
|
31741
|
-
|
|
31742
|
-
}
|
|
31743
|
-
if (arguments.length > 1) {
|
|
31744
|
-
args = Array.prototype.slice.call(arguments);
|
|
31561
|
+
__name(wrapRaw, "wrapRaw");
|
|
31562
|
+
function wrapRounded(fn4) {
|
|
31563
|
+
const wrappedFn = /* @__PURE__ */ __name(function(...args) {
|
|
31564
|
+
const arg0 = args[0];
|
|
31565
|
+
if (arg0 === void 0 || arg0 === null) {
|
|
31566
|
+
return arg0;
|
|
31567
|
+
}
|
|
31568
|
+
if (arg0.length > 1) {
|
|
31569
|
+
args = arg0;
|
|
31570
|
+
}
|
|
31571
|
+
const result = fn4(args);
|
|
31572
|
+
if (typeof result === "object") {
|
|
31573
|
+
for (let { length } = result, i = 0; i < length; i++) {
|
|
31574
|
+
result[i] = Math.round(result[i]);
|
|
31745
31575
|
}
|
|
31746
|
-
return fn4(args);
|
|
31747
|
-
}, "wrappedFn");
|
|
31748
|
-
if ("conversion" in fn4) {
|
|
31749
|
-
wrappedFn.conversion = fn4.conversion;
|
|
31750
31576
|
}
|
|
31751
|
-
return
|
|
31577
|
+
return result;
|
|
31578
|
+
}, "wrappedFn");
|
|
31579
|
+
if ("conversion" in fn4) {
|
|
31580
|
+
wrappedFn.conversion = fn4.conversion;
|
|
31581
|
+
}
|
|
31582
|
+
return wrappedFn;
|
|
31583
|
+
}
|
|
31584
|
+
__name(wrapRounded, "wrapRounded");
|
|
31585
|
+
for (const fromModel of models) {
|
|
31586
|
+
convert$1[fromModel] = {};
|
|
31587
|
+
Object.defineProperty(convert$1[fromModel], "channels", { value: convert$2[fromModel].channels });
|
|
31588
|
+
Object.defineProperty(convert$1[fromModel], "labels", { value: convert$2[fromModel].labels });
|
|
31589
|
+
const routes = route(fromModel);
|
|
31590
|
+
const routeModels = Object.keys(routes);
|
|
31591
|
+
for (const toModel of routeModels) {
|
|
31592
|
+
const fn4 = routes[toModel];
|
|
31593
|
+
convert$1[fromModel][toModel] = wrapRounded(fn4);
|
|
31594
|
+
convert$1[fromModel][toModel].raw = wrapRaw(fn4);
|
|
31595
|
+
}
|
|
31596
|
+
}
|
|
31597
|
+
const skippedModels = [
|
|
31598
|
+
// To be honest, I don't really feel like keyword belongs in color convert, but eh.
|
|
31599
|
+
"keyword",
|
|
31600
|
+
// Gray conflicts with some method names, and has its own method defined.
|
|
31601
|
+
"gray",
|
|
31602
|
+
// Shouldn't really be in color-convert either...
|
|
31603
|
+
"hex"
|
|
31604
|
+
];
|
|
31605
|
+
const hashedModelKeys = {};
|
|
31606
|
+
for (const model of Object.keys(convert$1)) {
|
|
31607
|
+
hashedModelKeys[[...convert$1[model].labels].sort().join("")] = model;
|
|
31608
|
+
}
|
|
31609
|
+
const limiters = {};
|
|
31610
|
+
function Color(object3, model) {
|
|
31611
|
+
if (!(this instanceof Color)) {
|
|
31612
|
+
return new Color(object3, model);
|
|
31752
31613
|
}
|
|
31753
|
-
|
|
31754
|
-
|
|
31755
|
-
|
|
31756
|
-
|
|
31757
|
-
|
|
31758
|
-
|
|
31759
|
-
|
|
31760
|
-
|
|
31761
|
-
|
|
31762
|
-
|
|
31763
|
-
|
|
31764
|
-
|
|
31765
|
-
|
|
31766
|
-
|
|
31767
|
-
|
|
31768
|
-
|
|
31769
|
-
|
|
31770
|
-
|
|
31771
|
-
|
|
31772
|
-
|
|
31773
|
-
|
|
31774
|
-
|
|
31775
|
-
|
|
31776
|
-
|
|
31777
|
-
|
|
31778
|
-
|
|
31779
|
-
|
|
31780
|
-
|
|
31781
|
-
|
|
31782
|
-
|
|
31783
|
-
|
|
31784
|
-
|
|
31785
|
-
|
|
31786
|
-
|
|
31787
|
-
|
|
31788
|
-
|
|
31789
|
-
|
|
31790
|
-
|
|
31791
|
-
|
|
31792
|
-
|
|
31793
|
-
|
|
31794
|
-
|
|
31795
|
-
|
|
31796
|
-
|
|
31797
|
-
|
|
31798
|
-
var convert2 = requireColorConvert();
|
|
31799
|
-
var _slice = [].slice;
|
|
31800
|
-
var skippedModels = [
|
|
31801
|
-
// to be honest, I don't really feel like keyword belongs in color convert, but eh.
|
|
31802
|
-
"keyword",
|
|
31803
|
-
// gray conflicts with some method names, and has its own method defined.
|
|
31804
|
-
"gray",
|
|
31805
|
-
// shouldn't really be in color-convert either...
|
|
31806
|
-
"hex"
|
|
31807
|
-
];
|
|
31808
|
-
var hashedModelKeys = {};
|
|
31809
|
-
Object.keys(convert2).forEach(function(model) {
|
|
31810
|
-
hashedModelKeys[_slice.call(convert2[model].labels).sort().join("")] = model;
|
|
31811
|
-
});
|
|
31812
|
-
var limiters = {};
|
|
31813
|
-
function Color2(obj, model) {
|
|
31814
|
-
if (!(this instanceof Color2)) {
|
|
31815
|
-
return new Color2(obj, model);
|
|
31614
|
+
if (model && model in skippedModels) {
|
|
31615
|
+
model = null;
|
|
31616
|
+
}
|
|
31617
|
+
if (model && !(model in convert$1)) {
|
|
31618
|
+
throw new Error("Unknown model: " + model);
|
|
31619
|
+
}
|
|
31620
|
+
let i;
|
|
31621
|
+
let channels;
|
|
31622
|
+
if (object3 == null) {
|
|
31623
|
+
this.model = "rgb";
|
|
31624
|
+
this.color = [0, 0, 0];
|
|
31625
|
+
this.valpha = 1;
|
|
31626
|
+
} else if (object3 instanceof Color) {
|
|
31627
|
+
this.model = object3.model;
|
|
31628
|
+
this.color = [...object3.color];
|
|
31629
|
+
this.valpha = object3.valpha;
|
|
31630
|
+
} else if (typeof object3 === "string") {
|
|
31631
|
+
const result = cs.get(object3);
|
|
31632
|
+
if (result === null) {
|
|
31633
|
+
throw new Error("Unable to parse color from string: " + object3);
|
|
31634
|
+
}
|
|
31635
|
+
this.model = result.model;
|
|
31636
|
+
channels = convert$1[this.model].channels;
|
|
31637
|
+
this.color = result.value.slice(0, channels);
|
|
31638
|
+
this.valpha = typeof result.value[channels] === "number" ? result.value[channels] : 1;
|
|
31639
|
+
} else if (object3.length > 0) {
|
|
31640
|
+
this.model = model || "rgb";
|
|
31641
|
+
channels = convert$1[this.model].channels;
|
|
31642
|
+
const newArray = Array.prototype.slice.call(object3, 0, channels);
|
|
31643
|
+
this.color = zeroArray(newArray, channels);
|
|
31644
|
+
this.valpha = typeof object3[channels] === "number" ? object3[channels] : 1;
|
|
31645
|
+
} else if (typeof object3 === "number") {
|
|
31646
|
+
this.model = "rgb";
|
|
31647
|
+
this.color = [
|
|
31648
|
+
object3 >> 16 & 255,
|
|
31649
|
+
object3 >> 8 & 255,
|
|
31650
|
+
object3 & 255
|
|
31651
|
+
];
|
|
31652
|
+
this.valpha = 1;
|
|
31653
|
+
} else {
|
|
31654
|
+
this.valpha = 1;
|
|
31655
|
+
const keys3 = Object.keys(object3);
|
|
31656
|
+
if ("alpha" in object3) {
|
|
31657
|
+
keys3.splice(keys3.indexOf("alpha"), 1);
|
|
31658
|
+
this.valpha = typeof object3.alpha === "number" ? object3.alpha : 0;
|
|
31816
31659
|
}
|
|
31817
|
-
|
|
31818
|
-
|
|
31660
|
+
const hashedKeys = keys3.sort().join("");
|
|
31661
|
+
if (!(hashedKeys in hashedModelKeys)) {
|
|
31662
|
+
throw new Error("Unable to parse color from object: " + JSON.stringify(object3));
|
|
31819
31663
|
}
|
|
31820
|
-
|
|
31821
|
-
|
|
31664
|
+
this.model = hashedModelKeys[hashedKeys];
|
|
31665
|
+
const { labels } = convert$1[this.model];
|
|
31666
|
+
const color2 = [];
|
|
31667
|
+
for (i = 0; i < labels.length; i++) {
|
|
31668
|
+
color2.push(object3[labels[i]]);
|
|
31822
31669
|
}
|
|
31823
|
-
|
|
31824
|
-
|
|
31825
|
-
|
|
31826
|
-
|
|
31827
|
-
|
|
31828
|
-
|
|
31829
|
-
|
|
31830
|
-
|
|
31831
|
-
this.color = obj.color.slice();
|
|
31832
|
-
this.valpha = obj.valpha;
|
|
31833
|
-
} else if (typeof obj === "string") {
|
|
31834
|
-
var result = colorString2.get(obj);
|
|
31835
|
-
if (result === null) {
|
|
31836
|
-
throw new Error("Unable to parse color from string: " + obj);
|
|
31837
|
-
}
|
|
31838
|
-
this.model = result.model;
|
|
31839
|
-
channels = convert2[this.model].channels;
|
|
31840
|
-
this.color = result.value.slice(0, channels);
|
|
31841
|
-
this.valpha = typeof result.value[channels] === "number" ? result.value[channels] : 1;
|
|
31842
|
-
} else if (obj.length) {
|
|
31843
|
-
this.model = model || "rgb";
|
|
31844
|
-
channels = convert2[this.model].channels;
|
|
31845
|
-
var newArr = _slice.call(obj, 0, channels);
|
|
31846
|
-
this.color = zeroArray(newArr, channels);
|
|
31847
|
-
this.valpha = typeof obj[channels] === "number" ? obj[channels] : 1;
|
|
31848
|
-
} else if (typeof obj === "number") {
|
|
31849
|
-
obj &= 16777215;
|
|
31850
|
-
this.model = "rgb";
|
|
31851
|
-
this.color = [
|
|
31852
|
-
obj >> 16 & 255,
|
|
31853
|
-
obj >> 8 & 255,
|
|
31854
|
-
obj & 255
|
|
31855
|
-
];
|
|
31856
|
-
this.valpha = 1;
|
|
31857
|
-
} else {
|
|
31858
|
-
this.valpha = 1;
|
|
31859
|
-
var keys3 = Object.keys(obj);
|
|
31860
|
-
if ("alpha" in obj) {
|
|
31861
|
-
keys3.splice(keys3.indexOf("alpha"), 1);
|
|
31862
|
-
this.valpha = typeof obj.alpha === "number" ? obj.alpha : 0;
|
|
31863
|
-
}
|
|
31864
|
-
var hashedKeys = keys3.sort().join("");
|
|
31865
|
-
if (!(hashedKeys in hashedModelKeys)) {
|
|
31866
|
-
throw new Error("Unable to parse color from object: " + JSON.stringify(obj));
|
|
31867
|
-
}
|
|
31868
|
-
this.model = hashedModelKeys[hashedKeys];
|
|
31869
|
-
var labels = convert2[this.model].labels;
|
|
31870
|
-
var color2 = [];
|
|
31871
|
-
for (i = 0; i < labels.length; i++) {
|
|
31872
|
-
color2.push(obj[labels[i]]);
|
|
31873
|
-
}
|
|
31874
|
-
this.color = zeroArray(color2);
|
|
31875
|
-
}
|
|
31876
|
-
if (limiters[this.model]) {
|
|
31877
|
-
channels = convert2[this.model].channels;
|
|
31878
|
-
for (i = 0; i < channels; i++) {
|
|
31879
|
-
var limit = limiters[this.model][i];
|
|
31880
|
-
if (limit) {
|
|
31881
|
-
this.color[i] = limit(this.color[i]);
|
|
31882
|
-
}
|
|
31883
|
-
}
|
|
31884
|
-
}
|
|
31885
|
-
this.valpha = Math.max(0, Math.min(1, this.valpha));
|
|
31886
|
-
if (Object.freeze) {
|
|
31887
|
-
Object.freeze(this);
|
|
31888
|
-
}
|
|
31889
|
-
}
|
|
31890
|
-
__name(Color2, "Color");
|
|
31891
|
-
Color2.prototype = {
|
|
31892
|
-
toString: /* @__PURE__ */ __name(function() {
|
|
31893
|
-
return this.string();
|
|
31894
|
-
}, "toString"),
|
|
31895
|
-
toJSON: /* @__PURE__ */ __name(function() {
|
|
31896
|
-
return this[this.model]();
|
|
31897
|
-
}, "toJSON"),
|
|
31898
|
-
string: /* @__PURE__ */ __name(function(places) {
|
|
31899
|
-
var self2 = this.model in colorString2.to ? this : this.rgb();
|
|
31900
|
-
self2 = self2.round(typeof places === "number" ? places : 1);
|
|
31901
|
-
var args = self2.valpha === 1 ? self2.color : self2.color.concat(this.valpha);
|
|
31902
|
-
return colorString2.to[self2.model](args);
|
|
31903
|
-
}, "string"),
|
|
31904
|
-
percentString: /* @__PURE__ */ __name(function(places) {
|
|
31905
|
-
var self2 = this.rgb().round(typeof places === "number" ? places : 1);
|
|
31906
|
-
var args = self2.valpha === 1 ? self2.color : self2.color.concat(this.valpha);
|
|
31907
|
-
return colorString2.to.rgb.percent(args);
|
|
31908
|
-
}, "percentString"),
|
|
31909
|
-
array: /* @__PURE__ */ __name(function() {
|
|
31910
|
-
return this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha);
|
|
31911
|
-
}, "array"),
|
|
31912
|
-
object: /* @__PURE__ */ __name(function() {
|
|
31913
|
-
var result = {};
|
|
31914
|
-
var channels = convert2[this.model].channels;
|
|
31915
|
-
var labels = convert2[this.model].labels;
|
|
31916
|
-
for (var i = 0; i < channels; i++) {
|
|
31917
|
-
result[labels[i]] = this.color[i];
|
|
31918
|
-
}
|
|
31919
|
-
if (this.valpha !== 1) {
|
|
31920
|
-
result.alpha = this.valpha;
|
|
31670
|
+
this.color = zeroArray(color2);
|
|
31671
|
+
}
|
|
31672
|
+
if (limiters[this.model]) {
|
|
31673
|
+
channels = convert$1[this.model].channels;
|
|
31674
|
+
for (i = 0; i < channels; i++) {
|
|
31675
|
+
const limit = limiters[this.model][i];
|
|
31676
|
+
if (limit) {
|
|
31677
|
+
this.color[i] = limit(this.color[i]);
|
|
31921
31678
|
}
|
|
31922
|
-
return result;
|
|
31923
|
-
}, "object"),
|
|
31924
|
-
unitArray: /* @__PURE__ */ __name(function() {
|
|
31925
|
-
var rgb = this.rgb().color;
|
|
31926
|
-
rgb[0] /= 255;
|
|
31927
|
-
rgb[1] /= 255;
|
|
31928
|
-
rgb[2] /= 255;
|
|
31929
|
-
if (this.valpha !== 1) {
|
|
31930
|
-
rgb.push(this.valpha);
|
|
31931
|
-
}
|
|
31932
|
-
return rgb;
|
|
31933
|
-
}, "unitArray"),
|
|
31934
|
-
unitObject: /* @__PURE__ */ __name(function() {
|
|
31935
|
-
var rgb = this.rgb().object();
|
|
31936
|
-
rgb.r /= 255;
|
|
31937
|
-
rgb.g /= 255;
|
|
31938
|
-
rgb.b /= 255;
|
|
31939
|
-
if (this.valpha !== 1) {
|
|
31940
|
-
rgb.alpha = this.valpha;
|
|
31941
|
-
}
|
|
31942
|
-
return rgb;
|
|
31943
|
-
}, "unitObject"),
|
|
31944
|
-
round: /* @__PURE__ */ __name(function(places) {
|
|
31945
|
-
places = Math.max(places || 0, 0);
|
|
31946
|
-
return new Color2(this.color.map(roundToPlace(places)).concat(this.valpha), this.model);
|
|
31947
|
-
}, "round"),
|
|
31948
|
-
alpha: /* @__PURE__ */ __name(function(val2) {
|
|
31949
|
-
if (arguments.length) {
|
|
31950
|
-
return new Color2(this.color.concat(Math.max(0, Math.min(1, val2))), this.model);
|
|
31951
|
-
}
|
|
31952
|
-
return this.valpha;
|
|
31953
|
-
}, "alpha"),
|
|
31954
|
-
// rgb
|
|
31955
|
-
red: getset("rgb", 0, maxfn(255)),
|
|
31956
|
-
green: getset("rgb", 1, maxfn(255)),
|
|
31957
|
-
blue: getset("rgb", 2, maxfn(255)),
|
|
31958
|
-
hue: getset(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, function(val2) {
|
|
31959
|
-
return (val2 % 360 + 360) % 360;
|
|
31960
|
-
}),
|
|
31961
|
-
// eslint-disable-line brace-style
|
|
31962
|
-
saturationl: getset("hsl", 1, maxfn(100)),
|
|
31963
|
-
lightness: getset("hsl", 2, maxfn(100)),
|
|
31964
|
-
saturationv: getset("hsv", 1, maxfn(100)),
|
|
31965
|
-
value: getset("hsv", 2, maxfn(100)),
|
|
31966
|
-
chroma: getset("hcg", 1, maxfn(100)),
|
|
31967
|
-
gray: getset("hcg", 2, maxfn(100)),
|
|
31968
|
-
white: getset("hwb", 1, maxfn(100)),
|
|
31969
|
-
wblack: getset("hwb", 2, maxfn(100)),
|
|
31970
|
-
cyan: getset("cmyk", 0, maxfn(100)),
|
|
31971
|
-
magenta: getset("cmyk", 1, maxfn(100)),
|
|
31972
|
-
yellow: getset("cmyk", 2, maxfn(100)),
|
|
31973
|
-
black: getset("cmyk", 3, maxfn(100)),
|
|
31974
|
-
x: getset("xyz", 0, maxfn(100)),
|
|
31975
|
-
y: getset("xyz", 1, maxfn(100)),
|
|
31976
|
-
z: getset("xyz", 2, maxfn(100)),
|
|
31977
|
-
l: getset("lab", 0, maxfn(100)),
|
|
31978
|
-
a: getset("lab", 1),
|
|
31979
|
-
b: getset("lab", 2),
|
|
31980
|
-
keyword: /* @__PURE__ */ __name(function(val2) {
|
|
31981
|
-
if (arguments.length) {
|
|
31982
|
-
return new Color2(val2);
|
|
31983
|
-
}
|
|
31984
|
-
return convert2[this.model].keyword(this.color);
|
|
31985
|
-
}, "keyword"),
|
|
31986
|
-
hex: /* @__PURE__ */ __name(function(val2) {
|
|
31987
|
-
if (arguments.length) {
|
|
31988
|
-
return new Color2(val2);
|
|
31989
|
-
}
|
|
31990
|
-
return colorString2.to.hex(this.rgb().round().color);
|
|
31991
|
-
}, "hex"),
|
|
31992
|
-
rgbNumber: /* @__PURE__ */ __name(function() {
|
|
31993
|
-
var rgb = this.rgb().color;
|
|
31994
|
-
return (rgb[0] & 255) << 16 | (rgb[1] & 255) << 8 | rgb[2] & 255;
|
|
31995
|
-
}, "rgbNumber"),
|
|
31996
|
-
luminosity: /* @__PURE__ */ __name(function() {
|
|
31997
|
-
var rgb = this.rgb().color;
|
|
31998
|
-
var lum = [];
|
|
31999
|
-
for (var i = 0; i < rgb.length; i++) {
|
|
32000
|
-
var chan = rgb[i] / 255;
|
|
32001
|
-
lum[i] = chan <= 0.03928 ? chan / 12.92 : Math.pow((chan + 0.055) / 1.055, 2.4);
|
|
32002
|
-
}
|
|
32003
|
-
return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
|
|
32004
|
-
}, "luminosity"),
|
|
32005
|
-
contrast: /* @__PURE__ */ __name(function(color2) {
|
|
32006
|
-
var lum1 = this.luminosity();
|
|
32007
|
-
var lum2 = color2.luminosity();
|
|
32008
|
-
if (lum1 > lum2) {
|
|
32009
|
-
return (lum1 + 0.05) / (lum2 + 0.05);
|
|
32010
|
-
}
|
|
32011
|
-
return (lum2 + 0.05) / (lum1 + 0.05);
|
|
32012
|
-
}, "contrast"),
|
|
32013
|
-
level: /* @__PURE__ */ __name(function(color2) {
|
|
32014
|
-
var contrastRatio = this.contrast(color2);
|
|
32015
|
-
if (contrastRatio >= 7.1) {
|
|
32016
|
-
return "AAA";
|
|
32017
|
-
}
|
|
32018
|
-
return contrastRatio >= 4.5 ? "AA" : "";
|
|
32019
|
-
}, "level"),
|
|
32020
|
-
isDark: /* @__PURE__ */ __name(function() {
|
|
32021
|
-
var rgb = this.rgb().color;
|
|
32022
|
-
var yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1e3;
|
|
32023
|
-
return yiq < 128;
|
|
32024
|
-
}, "isDark"),
|
|
32025
|
-
isLight: /* @__PURE__ */ __name(function() {
|
|
32026
|
-
return !this.isDark();
|
|
32027
|
-
}, "isLight"),
|
|
32028
|
-
negate: /* @__PURE__ */ __name(function() {
|
|
32029
|
-
var rgb = this.rgb();
|
|
32030
|
-
for (var i = 0; i < 3; i++) {
|
|
32031
|
-
rgb.color[i] = 255 - rgb.color[i];
|
|
32032
|
-
}
|
|
32033
|
-
return rgb;
|
|
32034
|
-
}, "negate"),
|
|
32035
|
-
lighten: /* @__PURE__ */ __name(function(ratio) {
|
|
32036
|
-
var hsl = this.hsl();
|
|
32037
|
-
hsl.color[2] += hsl.color[2] * ratio;
|
|
32038
|
-
return hsl;
|
|
32039
|
-
}, "lighten"),
|
|
32040
|
-
darken: /* @__PURE__ */ __name(function(ratio) {
|
|
32041
|
-
var hsl = this.hsl();
|
|
32042
|
-
hsl.color[2] -= hsl.color[2] * ratio;
|
|
32043
|
-
return hsl;
|
|
32044
|
-
}, "darken"),
|
|
32045
|
-
saturate: /* @__PURE__ */ __name(function(ratio) {
|
|
32046
|
-
var hsl = this.hsl();
|
|
32047
|
-
hsl.color[1] += hsl.color[1] * ratio;
|
|
32048
|
-
return hsl;
|
|
32049
|
-
}, "saturate"),
|
|
32050
|
-
desaturate: /* @__PURE__ */ __name(function(ratio) {
|
|
32051
|
-
var hsl = this.hsl();
|
|
32052
|
-
hsl.color[1] -= hsl.color[1] * ratio;
|
|
32053
|
-
return hsl;
|
|
32054
|
-
}, "desaturate"),
|
|
32055
|
-
whiten: /* @__PURE__ */ __name(function(ratio) {
|
|
32056
|
-
var hwb = this.hwb();
|
|
32057
|
-
hwb.color[1] += hwb.color[1] * ratio;
|
|
32058
|
-
return hwb;
|
|
32059
|
-
}, "whiten"),
|
|
32060
|
-
blacken: /* @__PURE__ */ __name(function(ratio) {
|
|
32061
|
-
var hwb = this.hwb();
|
|
32062
|
-
hwb.color[2] += hwb.color[2] * ratio;
|
|
32063
|
-
return hwb;
|
|
32064
|
-
}, "blacken"),
|
|
32065
|
-
grayscale: /* @__PURE__ */ __name(function() {
|
|
32066
|
-
var rgb = this.rgb().color;
|
|
32067
|
-
var val2 = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
|
|
32068
|
-
return Color2.rgb(val2, val2, val2);
|
|
32069
|
-
}, "grayscale"),
|
|
32070
|
-
fade: /* @__PURE__ */ __name(function(ratio) {
|
|
32071
|
-
return this.alpha(this.valpha - this.valpha * ratio);
|
|
32072
|
-
}, "fade"),
|
|
32073
|
-
opaquer: /* @__PURE__ */ __name(function(ratio) {
|
|
32074
|
-
return this.alpha(this.valpha + this.valpha * ratio);
|
|
32075
|
-
}, "opaquer"),
|
|
32076
|
-
rotate: /* @__PURE__ */ __name(function(degrees) {
|
|
32077
|
-
var hsl = this.hsl();
|
|
32078
|
-
var hue = hsl.color[0];
|
|
32079
|
-
hue = (hue + degrees) % 360;
|
|
32080
|
-
hue = hue < 0 ? 360 + hue : hue;
|
|
32081
|
-
hsl.color[0] = hue;
|
|
32082
|
-
return hsl;
|
|
32083
|
-
}, "rotate"),
|
|
32084
|
-
mix: /* @__PURE__ */ __name(function(mixinColor, weight) {
|
|
32085
|
-
if (!mixinColor || !mixinColor.rgb) {
|
|
32086
|
-
throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
|
|
32087
|
-
}
|
|
32088
|
-
var color1 = mixinColor.rgb();
|
|
32089
|
-
var color2 = this.rgb();
|
|
32090
|
-
var p2 = weight === void 0 ? 0.5 : weight;
|
|
32091
|
-
var w2 = 2 * p2 - 1;
|
|
32092
|
-
var a2 = color1.alpha() - color2.alpha();
|
|
32093
|
-
var w1 = ((w2 * a2 === -1 ? w2 : (w2 + a2) / (1 + w2 * a2)) + 1) / 2;
|
|
32094
|
-
var w22 = 1 - w1;
|
|
32095
|
-
return Color2.rgb(
|
|
32096
|
-
w1 * color1.red() + w22 * color2.red(),
|
|
32097
|
-
w1 * color1.green() + w22 * color2.green(),
|
|
32098
|
-
w1 * color1.blue() + w22 * color2.blue(),
|
|
32099
|
-
color1.alpha() * p2 + color2.alpha() * (1 - p2)
|
|
32100
|
-
);
|
|
32101
|
-
}, "mix")
|
|
32102
|
-
};
|
|
32103
|
-
Object.keys(convert2).forEach(function(model) {
|
|
32104
|
-
if (skippedModels.indexOf(model) !== -1) {
|
|
32105
|
-
return;
|
|
32106
31679
|
}
|
|
32107
|
-
var channels = convert2[model].channels;
|
|
32108
|
-
Color2.prototype[model] = function() {
|
|
32109
|
-
if (this.model === model) {
|
|
32110
|
-
return new Color2(this);
|
|
32111
|
-
}
|
|
32112
|
-
if (arguments.length) {
|
|
32113
|
-
return new Color2(arguments, model);
|
|
32114
|
-
}
|
|
32115
|
-
var newAlpha = typeof arguments[channels] === "number" ? channels : this.valpha;
|
|
32116
|
-
return new Color2(assertArray(convert2[this.model][model].raw(this.color)).concat(newAlpha), model);
|
|
32117
|
-
};
|
|
32118
|
-
Color2[model] = function(color2) {
|
|
32119
|
-
if (typeof color2 === "number") {
|
|
32120
|
-
color2 = zeroArray(_slice.call(arguments), channels);
|
|
32121
|
-
}
|
|
32122
|
-
return new Color2(color2, model);
|
|
32123
|
-
};
|
|
32124
|
-
});
|
|
32125
|
-
function roundTo(num, places) {
|
|
32126
|
-
return Number(num.toFixed(places));
|
|
32127
31680
|
}
|
|
32128
|
-
|
|
32129
|
-
|
|
32130
|
-
|
|
32131
|
-
return roundTo(num, places);
|
|
32132
|
-
};
|
|
31681
|
+
this.valpha = Math.max(0, Math.min(1, this.valpha));
|
|
31682
|
+
if (Object.freeze) {
|
|
31683
|
+
Object.freeze(this);
|
|
32133
31684
|
}
|
|
32134
|
-
|
|
32135
|
-
|
|
32136
|
-
|
|
32137
|
-
|
|
32138
|
-
|
|
32139
|
-
|
|
32140
|
-
|
|
32141
|
-
return
|
|
32142
|
-
|
|
32143
|
-
|
|
32144
|
-
|
|
32145
|
-
|
|
32146
|
-
|
|
32147
|
-
|
|
32148
|
-
|
|
32149
|
-
|
|
32150
|
-
|
|
32151
|
-
|
|
32152
|
-
|
|
32153
|
-
|
|
32154
|
-
|
|
32155
|
-
|
|
32156
|
-
|
|
31685
|
+
}
|
|
31686
|
+
__name(Color, "Color");
|
|
31687
|
+
Color.prototype = {
|
|
31688
|
+
toString() {
|
|
31689
|
+
return this.string();
|
|
31690
|
+
},
|
|
31691
|
+
toJSON() {
|
|
31692
|
+
return this[this.model]();
|
|
31693
|
+
},
|
|
31694
|
+
string(places) {
|
|
31695
|
+
let self2 = this.model in cs.to ? this : this.rgb();
|
|
31696
|
+
self2 = self2.round(typeof places === "number" ? places : 1);
|
|
31697
|
+
const arguments_ = self2.valpha === 1 ? self2.color : [...self2.color, this.valpha];
|
|
31698
|
+
return cs.to[self2.model](...arguments_);
|
|
31699
|
+
},
|
|
31700
|
+
percentString(places) {
|
|
31701
|
+
const self2 = this.rgb().round(typeof places === "number" ? places : 1);
|
|
31702
|
+
const arguments_ = self2.valpha === 1 ? self2.color : [...self2.color, this.valpha];
|
|
31703
|
+
return cs.to.rgb.percent(...arguments_);
|
|
31704
|
+
},
|
|
31705
|
+
array() {
|
|
31706
|
+
return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
|
|
31707
|
+
},
|
|
31708
|
+
object() {
|
|
31709
|
+
const result = {};
|
|
31710
|
+
const { channels } = convert$1[this.model];
|
|
31711
|
+
const { labels } = convert$1[this.model];
|
|
31712
|
+
for (let i = 0; i < channels; i++) {
|
|
31713
|
+
result[labels[i]] = this.color[i];
|
|
31714
|
+
}
|
|
31715
|
+
if (this.valpha !== 1) {
|
|
31716
|
+
result.alpha = this.valpha;
|
|
31717
|
+
}
|
|
31718
|
+
return result;
|
|
31719
|
+
},
|
|
31720
|
+
unitArray() {
|
|
31721
|
+
const rgb = this.rgb().color;
|
|
31722
|
+
rgb[0] /= 255;
|
|
31723
|
+
rgb[1] /= 255;
|
|
31724
|
+
rgb[2] /= 255;
|
|
31725
|
+
if (this.valpha !== 1) {
|
|
31726
|
+
rgb.push(this.valpha);
|
|
31727
|
+
}
|
|
31728
|
+
return rgb;
|
|
31729
|
+
},
|
|
31730
|
+
unitObject() {
|
|
31731
|
+
const rgb = this.rgb().object();
|
|
31732
|
+
rgb.r /= 255;
|
|
31733
|
+
rgb.g /= 255;
|
|
31734
|
+
rgb.b /= 255;
|
|
31735
|
+
if (this.valpha !== 1) {
|
|
31736
|
+
rgb.alpha = this.valpha;
|
|
31737
|
+
}
|
|
31738
|
+
return rgb;
|
|
31739
|
+
},
|
|
31740
|
+
round(places) {
|
|
31741
|
+
places = Math.max(places || 0, 0);
|
|
31742
|
+
return new Color([...this.color.map(roundToPlace(places)), this.valpha], this.model);
|
|
31743
|
+
},
|
|
31744
|
+
alpha(value) {
|
|
31745
|
+
if (value !== void 0) {
|
|
31746
|
+
return new Color([...this.color, Math.max(0, Math.min(1, value))], this.model);
|
|
31747
|
+
}
|
|
31748
|
+
return this.valpha;
|
|
31749
|
+
},
|
|
31750
|
+
// Rgb
|
|
31751
|
+
red: getset("rgb", 0, maxfn(255)),
|
|
31752
|
+
green: getset("rgb", 1, maxfn(255)),
|
|
31753
|
+
blue: getset("rgb", 2, maxfn(255)),
|
|
31754
|
+
hue: getset(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, (value) => (value % 360 + 360) % 360),
|
|
31755
|
+
saturationl: getset("hsl", 1, maxfn(100)),
|
|
31756
|
+
lightness: getset("hsl", 2, maxfn(100)),
|
|
31757
|
+
saturationv: getset("hsv", 1, maxfn(100)),
|
|
31758
|
+
value: getset("hsv", 2, maxfn(100)),
|
|
31759
|
+
chroma: getset("hcg", 1, maxfn(100)),
|
|
31760
|
+
gray: getset("hcg", 2, maxfn(100)),
|
|
31761
|
+
white: getset("hwb", 1, maxfn(100)),
|
|
31762
|
+
wblack: getset("hwb", 2, maxfn(100)),
|
|
31763
|
+
cyan: getset("cmyk", 0, maxfn(100)),
|
|
31764
|
+
magenta: getset("cmyk", 1, maxfn(100)),
|
|
31765
|
+
yellow: getset("cmyk", 2, maxfn(100)),
|
|
31766
|
+
black: getset("cmyk", 3, maxfn(100)),
|
|
31767
|
+
x: getset("xyz", 0, maxfn(95.047)),
|
|
31768
|
+
y: getset("xyz", 1, maxfn(100)),
|
|
31769
|
+
z: getset("xyz", 2, maxfn(108.833)),
|
|
31770
|
+
l: getset("lab", 0, maxfn(100)),
|
|
31771
|
+
a: getset("lab", 1),
|
|
31772
|
+
b: getset("lab", 2),
|
|
31773
|
+
keyword(value) {
|
|
31774
|
+
if (value !== void 0) {
|
|
31775
|
+
return new Color(value);
|
|
31776
|
+
}
|
|
31777
|
+
return convert$1[this.model].keyword(this.color);
|
|
31778
|
+
},
|
|
31779
|
+
hex(value) {
|
|
31780
|
+
if (value !== void 0) {
|
|
31781
|
+
return new Color(value);
|
|
31782
|
+
}
|
|
31783
|
+
return cs.to.hex(...this.rgb().round().color);
|
|
31784
|
+
},
|
|
31785
|
+
hexa(value) {
|
|
31786
|
+
if (value !== void 0) {
|
|
31787
|
+
return new Color(value);
|
|
31788
|
+
}
|
|
31789
|
+
const rgbArray = this.rgb().round().color;
|
|
31790
|
+
let alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase();
|
|
31791
|
+
if (alphaHex.length === 1) {
|
|
31792
|
+
alphaHex = "0" + alphaHex;
|
|
31793
|
+
}
|
|
31794
|
+
return cs.to.hex(...rgbArray) + alphaHex;
|
|
31795
|
+
},
|
|
31796
|
+
rgbNumber() {
|
|
31797
|
+
const rgb = this.rgb().color;
|
|
31798
|
+
return (rgb[0] & 255) << 16 | (rgb[1] & 255) << 8 | rgb[2] & 255;
|
|
31799
|
+
},
|
|
31800
|
+
luminosity() {
|
|
31801
|
+
const rgb = this.rgb().color;
|
|
31802
|
+
const lum = [];
|
|
31803
|
+
for (const [i, element2] of rgb.entries()) {
|
|
31804
|
+
const chan = element2 / 255;
|
|
31805
|
+
lum[i] = chan <= 0.04045 ? chan / 12.92 : __pow((chan + 0.055) / 1.055, 2.4);
|
|
31806
|
+
}
|
|
31807
|
+
return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
|
|
31808
|
+
},
|
|
31809
|
+
contrast(color2) {
|
|
31810
|
+
const lum1 = this.luminosity();
|
|
31811
|
+
const lum2 = color2.luminosity();
|
|
31812
|
+
if (lum1 > lum2) {
|
|
31813
|
+
return (lum1 + 0.05) / (lum2 + 0.05);
|
|
31814
|
+
}
|
|
31815
|
+
return (lum2 + 0.05) / (lum1 + 0.05);
|
|
31816
|
+
},
|
|
31817
|
+
level(color2) {
|
|
31818
|
+
const contrastRatio = this.contrast(color2);
|
|
31819
|
+
if (contrastRatio >= 7) {
|
|
31820
|
+
return "AAA";
|
|
31821
|
+
}
|
|
31822
|
+
return contrastRatio >= 4.5 ? "AA" : "";
|
|
31823
|
+
},
|
|
31824
|
+
isDark() {
|
|
31825
|
+
const rgb = this.rgb().color;
|
|
31826
|
+
const yiq = (rgb[0] * 2126 + rgb[1] * 7152 + rgb[2] * 722) / 1e4;
|
|
31827
|
+
return yiq < 128;
|
|
31828
|
+
},
|
|
31829
|
+
isLight() {
|
|
31830
|
+
return !this.isDark();
|
|
31831
|
+
},
|
|
31832
|
+
negate() {
|
|
31833
|
+
const rgb = this.rgb();
|
|
31834
|
+
for (let i = 0; i < 3; i++) {
|
|
31835
|
+
rgb.color[i] = 255 - rgb.color[i];
|
|
31836
|
+
}
|
|
31837
|
+
return rgb;
|
|
31838
|
+
},
|
|
31839
|
+
lighten(ratio) {
|
|
31840
|
+
const hsl = this.hsl();
|
|
31841
|
+
hsl.color[2] += hsl.color[2] * ratio;
|
|
31842
|
+
return hsl;
|
|
31843
|
+
},
|
|
31844
|
+
darken(ratio) {
|
|
31845
|
+
const hsl = this.hsl();
|
|
31846
|
+
hsl.color[2] -= hsl.color[2] * ratio;
|
|
31847
|
+
return hsl;
|
|
31848
|
+
},
|
|
31849
|
+
saturate(ratio) {
|
|
31850
|
+
const hsl = this.hsl();
|
|
31851
|
+
hsl.color[1] += hsl.color[1] * ratio;
|
|
31852
|
+
return hsl;
|
|
31853
|
+
},
|
|
31854
|
+
desaturate(ratio) {
|
|
31855
|
+
const hsl = this.hsl();
|
|
31856
|
+
hsl.color[1] -= hsl.color[1] * ratio;
|
|
31857
|
+
return hsl;
|
|
31858
|
+
},
|
|
31859
|
+
whiten(ratio) {
|
|
31860
|
+
const hwb = this.hwb();
|
|
31861
|
+
hwb.color[1] += hwb.color[1] * ratio;
|
|
31862
|
+
return hwb;
|
|
31863
|
+
},
|
|
31864
|
+
blacken(ratio) {
|
|
31865
|
+
const hwb = this.hwb();
|
|
31866
|
+
hwb.color[2] += hwb.color[2] * ratio;
|
|
31867
|
+
return hwb;
|
|
31868
|
+
},
|
|
31869
|
+
grayscale() {
|
|
31870
|
+
const rgb = this.rgb().color;
|
|
31871
|
+
const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
|
|
31872
|
+
return Color.rgb(value, value, value);
|
|
31873
|
+
},
|
|
31874
|
+
fade(ratio) {
|
|
31875
|
+
return this.alpha(this.valpha - this.valpha * ratio);
|
|
31876
|
+
},
|
|
31877
|
+
opaquer(ratio) {
|
|
31878
|
+
return this.alpha(this.valpha + this.valpha * ratio);
|
|
31879
|
+
},
|
|
31880
|
+
rotate(degrees) {
|
|
31881
|
+
const hsl = this.hsl();
|
|
31882
|
+
let hue = hsl.color[0];
|
|
31883
|
+
hue = (hue + degrees) % 360;
|
|
31884
|
+
hue = hue < 0 ? 360 + hue : hue;
|
|
31885
|
+
hsl.color[0] = hue;
|
|
31886
|
+
return hsl;
|
|
31887
|
+
},
|
|
31888
|
+
mix(mixinColor, weight) {
|
|
31889
|
+
if (!mixinColor || !mixinColor.rgb) {
|
|
31890
|
+
throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
|
|
31891
|
+
}
|
|
31892
|
+
const color1 = mixinColor.rgb();
|
|
31893
|
+
const color2 = this.rgb();
|
|
31894
|
+
const p2 = weight === void 0 ? 0.5 : weight;
|
|
31895
|
+
const w2 = 2 * p2 - 1;
|
|
31896
|
+
const a2 = color1.alpha() - color2.alpha();
|
|
31897
|
+
const w1 = ((w2 * a2 === -1 ? w2 : (w2 + a2) / (1 + w2 * a2)) + 1) / 2;
|
|
31898
|
+
const w22 = 1 - w1;
|
|
31899
|
+
return Color.rgb(
|
|
31900
|
+
w1 * color1.red() + w22 * color2.red(),
|
|
31901
|
+
w1 * color1.green() + w22 * color2.green(),
|
|
31902
|
+
w1 * color1.blue() + w22 * color2.blue(),
|
|
31903
|
+
color1.alpha() * p2 + color2.alpha() * (1 - p2)
|
|
31904
|
+
);
|
|
32157
31905
|
}
|
|
32158
|
-
|
|
32159
|
-
|
|
32160
|
-
|
|
32161
|
-
|
|
32162
|
-
};
|
|
31906
|
+
};
|
|
31907
|
+
for (const model of Object.keys(convert$1)) {
|
|
31908
|
+
if (skippedModels.includes(model)) {
|
|
31909
|
+
continue;
|
|
32163
31910
|
}
|
|
32164
|
-
|
|
32165
|
-
function
|
|
32166
|
-
|
|
31911
|
+
const { channels } = convert$1[model];
|
|
31912
|
+
Color.prototype[model] = function(...arguments_) {
|
|
31913
|
+
if (this.model === model) {
|
|
31914
|
+
return new Color(this);
|
|
31915
|
+
}
|
|
31916
|
+
if (arguments_.length > 0) {
|
|
31917
|
+
return new Color(arguments_, model);
|
|
31918
|
+
}
|
|
31919
|
+
return new Color([...assertArray(convert$1[this.model][model].raw(this.color)), this.valpha], model);
|
|
31920
|
+
};
|
|
31921
|
+
Color[model] = function(...arguments_) {
|
|
31922
|
+
let color2 = arguments_[0];
|
|
31923
|
+
if (typeof color2 === "number") {
|
|
31924
|
+
color2 = zeroArray(arguments_, channels);
|
|
31925
|
+
}
|
|
31926
|
+
return new Color(color2, model);
|
|
31927
|
+
};
|
|
31928
|
+
}
|
|
31929
|
+
function roundTo(number2, places) {
|
|
31930
|
+
return Number(number2.toFixed(places));
|
|
31931
|
+
}
|
|
31932
|
+
__name(roundTo, "roundTo");
|
|
31933
|
+
function roundToPlace(places) {
|
|
31934
|
+
return function(number2) {
|
|
31935
|
+
return roundTo(number2, places);
|
|
31936
|
+
};
|
|
31937
|
+
}
|
|
31938
|
+
__name(roundToPlace, "roundToPlace");
|
|
31939
|
+
function getset(model, channel, modifier) {
|
|
31940
|
+
model = Array.isArray(model) ? model : [model];
|
|
31941
|
+
for (const m2 of model) {
|
|
31942
|
+
(limiters[m2] || (limiters[m2] = []))[channel] = modifier;
|
|
32167
31943
|
}
|
|
32168
|
-
|
|
32169
|
-
function
|
|
32170
|
-
|
|
32171
|
-
|
|
32172
|
-
|
|
31944
|
+
model = model[0];
|
|
31945
|
+
return function(value) {
|
|
31946
|
+
let result;
|
|
31947
|
+
if (value !== void 0) {
|
|
31948
|
+
if (modifier) {
|
|
31949
|
+
value = modifier(value);
|
|
32173
31950
|
}
|
|
31951
|
+
result = this[model]();
|
|
31952
|
+
result.color[channel] = value;
|
|
31953
|
+
return result;
|
|
31954
|
+
}
|
|
31955
|
+
result = this[model]().color[channel];
|
|
31956
|
+
if (modifier) {
|
|
31957
|
+
result = modifier(result);
|
|
31958
|
+
}
|
|
31959
|
+
return result;
|
|
31960
|
+
};
|
|
31961
|
+
}
|
|
31962
|
+
__name(getset, "getset");
|
|
31963
|
+
function maxfn(max2) {
|
|
31964
|
+
return function(v2) {
|
|
31965
|
+
return Math.max(0, Math.min(max2, v2));
|
|
31966
|
+
};
|
|
31967
|
+
}
|
|
31968
|
+
__name(maxfn, "maxfn");
|
|
31969
|
+
function assertArray(value) {
|
|
31970
|
+
return Array.isArray(value) ? value : [value];
|
|
31971
|
+
}
|
|
31972
|
+
__name(assertArray, "assertArray");
|
|
31973
|
+
function zeroArray(array2, length) {
|
|
31974
|
+
for (let i = 0; i < length; i++) {
|
|
31975
|
+
if (typeof array2[i] !== "number") {
|
|
31976
|
+
array2[i] = 0;
|
|
32174
31977
|
}
|
|
32175
|
-
return arr;
|
|
32176
31978
|
}
|
|
32177
|
-
|
|
32178
|
-
color$1 = Color2;
|
|
32179
|
-
return color$1;
|
|
31979
|
+
return array2;
|
|
32180
31980
|
}
|
|
32181
|
-
__name(
|
|
32182
|
-
var colorExports = requireColor();
|
|
32183
|
-
const Color = /* @__PURE__ */ getDefaultExportFromCjs(colorExports);
|
|
31981
|
+
__name(zeroArray, "zeroArray");
|
|
32184
31982
|
function determineBlackOrWhiteTextColor(c2) {
|
|
32185
31983
|
try {
|
|
32186
31984
|
return Color(c2).isLight() ? "#000000" : "#FFFFFF";
|
|
@@ -40041,10 +39839,10 @@ function tokenizeCodeFenced(effects, ok2, nok) {
|
|
|
40041
39839
|
effects.enter("chunkString", {
|
|
40042
39840
|
contentType: "string"
|
|
40043
39841
|
});
|
|
40044
|
-
return
|
|
39842
|
+
return meta2(code2);
|
|
40045
39843
|
}
|
|
40046
39844
|
__name(metaBefore, "metaBefore");
|
|
40047
|
-
function
|
|
39845
|
+
function meta2(code2) {
|
|
40048
39846
|
if (code2 === null || markdownLineEnding(code2)) {
|
|
40049
39847
|
effects.exit("chunkString");
|
|
40050
39848
|
effects.exit("codeFencedFenceMeta");
|
|
@@ -40054,9 +39852,9 @@ function tokenizeCodeFenced(effects, ok2, nok) {
|
|
|
40054
39852
|
return nok(code2);
|
|
40055
39853
|
}
|
|
40056
39854
|
effects.consume(code2);
|
|
40057
|
-
return
|
|
39855
|
+
return meta2;
|
|
40058
39856
|
}
|
|
40059
|
-
__name(
|
|
39857
|
+
__name(meta2, "meta");
|
|
40060
39858
|
function atNonLazyBreak(code2) {
|
|
40061
39859
|
return effects.attempt(closeStart, after, contentBefore)(code2);
|
|
40062
39860
|
}
|
|
@@ -55973,6 +55771,34 @@ if (typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === "object") {
|
|
|
55973
55771
|
$mobx
|
|
55974
55772
|
});
|
|
55975
55773
|
}
|
|
55774
|
+
const keyCount = {};
|
|
55775
|
+
const timeout = {};
|
|
55776
|
+
const isBeingCalledExcessively = /* @__PURE__ */ __name(({
|
|
55777
|
+
uniqName
|
|
55778
|
+
}) => {
|
|
55779
|
+
if (process.env["NODE_ENV"] !== "development") {
|
|
55780
|
+
return;
|
|
55781
|
+
}
|
|
55782
|
+
if (!uniqName) {
|
|
55783
|
+
throw new Error("uniqName is required");
|
|
55784
|
+
}
|
|
55785
|
+
keyCount[uniqName] = keyCount[uniqName] || 0;
|
|
55786
|
+
keyCount[uniqName]++;
|
|
55787
|
+
if (!timeout[uniqName]) {
|
|
55788
|
+
timeout[uniqName] = setTimeout(() => {
|
|
55789
|
+
keyCount[uniqName] = 0;
|
|
55790
|
+
timeout[uniqName] = null;
|
|
55791
|
+
}, 2e3);
|
|
55792
|
+
}
|
|
55793
|
+
if (keyCount[uniqName] > 20) {
|
|
55794
|
+
keyCount[uniqName] = 0;
|
|
55795
|
+
if (timeout[uniqName]) {
|
|
55796
|
+
clearTimeout(timeout[uniqName]);
|
|
55797
|
+
timeout[uniqName] = null;
|
|
55798
|
+
}
|
|
55799
|
+
throw new Error(`isBeingCalledExcessively: ${uniqName}`);
|
|
55800
|
+
}
|
|
55801
|
+
}, "isBeingCalledExcessively");
|
|
55976
55802
|
T();
|
|
55977
55803
|
const IS_LINUX = window.navigator.platform.toLowerCase().search("linux") > -1;
|
|
55978
55804
|
const itemSizeEstimators = {
|
|
@@ -56321,6 +56147,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
56321
56147
|
const entities = useDeepEqualMemo(_entities);
|
|
56322
56148
|
const entitiesAcrossPages = useDeepEqualMemo(_entitiesAcrossPages);
|
|
56323
56149
|
React.useEffect(() => {
|
|
56150
|
+
!noExcessiveCheck && isBeingCalledExcessively({ uniqName: `dt_entities_${formName}` });
|
|
56324
56151
|
change("allOrderedEntities", entitiesAcrossPages);
|
|
56325
56152
|
if (entities.length === 0 || isEmpty$1(reduxFormSelectedEntityIdMap)) return;
|
|
56326
56153
|
changeSelectedEntities({
|
|
@@ -56343,6 +56170,7 @@ const DataTable = /* @__PURE__ */ __name((_u) => {
|
|
|
56343
56170
|
} else {
|
|
56344
56171
|
newTableConfig = getTableConfigFromStorage(formName);
|
|
56345
56172
|
}
|
|
56173
|
+
!noExcessiveCheck && isBeingCalledExcessively({ uniqName: `dt_setTableConfig_${formName}` });
|
|
56346
56174
|
setTableConfig((prev) => {
|
|
56347
56175
|
if (!newTableConfig) {
|
|
56348
56176
|
newTableConfig = {
|
|
@@ -75028,7 +74856,9 @@ function comboToLabel(def, useSymbols = true) {
|
|
|
75028
74856
|
const combo = typeof def === "string" ? def : def.combo;
|
|
75029
74857
|
if (useSymbols) {
|
|
75030
74858
|
let parts2 = combo.replace("++", "+plus").split("+");
|
|
75031
|
-
parts2 = parts2.map(
|
|
74859
|
+
parts2 = parts2.map(
|
|
74860
|
+
(p2) => p2 in symbols ? symbols[p2] : startCase(p2) || p2
|
|
74861
|
+
);
|
|
75032
74862
|
return parts2.join("");
|
|
75033
74863
|
} else {
|
|
75034
74864
|
return combo.split("+").map((p2) => startCase(p2) || p2).join(" + ").replace("Meta", isMac ? "Cmd" : "Ctrl").replace("Mod", isMac ? "Cmd" : "Ctrl").replace("Alt", isMac ? "Option" : "Alt");
|
|
@@ -75038,7 +74868,7 @@ __name(comboToLabel, "comboToLabel");
|
|
|
75038
74868
|
const getHotkeyProps = /* @__PURE__ */ __name((def, id2) => {
|
|
75039
74869
|
let out;
|
|
75040
74870
|
if (typeof def === "string") {
|
|
75041
|
-
out = { combo: def };
|
|
74871
|
+
out = { combo: def, label: def };
|
|
75042
74872
|
} else if (def instanceof Array) {
|
|
75043
74873
|
out = __spreadValues({ combo: def[0], label: def[1] }, def[2] || {});
|
|
75044
74874
|
} else {
|
|
@@ -75073,15 +74903,18 @@ const withHotkeys = /* @__PURE__ */ __name((hotkeys, handlers2) => {
|
|
|
75073
74903
|
React.cloneElement(children, newProps)
|
|
75074
74904
|
) : (
|
|
75075
74905
|
//if not, then we'll return a div that can be used
|
|
75076
|
-
/* @__PURE__ */
|
|
74906
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", __spreadValues({ className: "hotkeyHandler" }, newProps))
|
|
75077
74907
|
);
|
|
75078
74908
|
};
|
|
75079
74909
|
}, "withHotkeys");
|
|
75080
74910
|
const isMac = navigator.userAgent.includes("Mac OS X");
|
|
74911
|
+
const cmd = "⌘";
|
|
74912
|
+
const meta = "⌘";
|
|
74913
|
+
const ctrl = "⌃";
|
|
75081
74914
|
const symbols = {
|
|
75082
|
-
cmd
|
|
75083
|
-
meta
|
|
75084
|
-
ctrl
|
|
74915
|
+
cmd,
|
|
74916
|
+
meta,
|
|
74917
|
+
ctrl,
|
|
75085
74918
|
alt: "⌥",
|
|
75086
74919
|
shift: "⇧",
|
|
75087
74920
|
esc: "␛",
|
|
@@ -75099,9 +74932,9 @@ const symbols = {
|
|
|
75099
74932
|
left: "←",
|
|
75100
74933
|
right: "→",
|
|
75101
74934
|
up: "↑",
|
|
75102
|
-
down: "↓"
|
|
74935
|
+
down: "↓",
|
|
74936
|
+
mod: isMac ? cmd : ctrl
|
|
75103
74937
|
};
|
|
75104
|
-
symbols.mod = symbols[isMac ? "meta" : "ctrl"];
|
|
75105
74938
|
let MenuBar$1 = (_C = class extends React.Component {
|
|
75106
74939
|
constructor(props) {
|
|
75107
74940
|
super(props);
|
|
@@ -75989,21 +75822,21 @@ function getCommandHotkeyHandlers(commands) {
|
|
|
75989
75822
|
}
|
|
75990
75823
|
__name(getCommandHotkeyHandlers, "getCommandHotkeyHandlers");
|
|
75991
75824
|
const withCommand = /* @__PURE__ */ __name((mappings) => (WrappedComponent) => (_a2) => {
|
|
75992
|
-
var _b2 = _a2, { cmd, cmdOptions = {} } = _b2, props = __objRest(_b2, ["cmd", "cmdOptions"]);
|
|
75825
|
+
var _b2 = _a2, { cmd: cmd2, cmdOptions = {} } = _b2, props = __objRest(_b2, ["cmd", "cmdOptions"]);
|
|
75993
75826
|
const mappedProps = {};
|
|
75994
75827
|
Object.keys(mappings).forEach((k2) => {
|
|
75995
|
-
mappedProps[k2] = mappings[k2] === "execute" ? (event) =>
|
|
75828
|
+
mappedProps[k2] = mappings[k2] === "execute" ? (event) => cmd2.execute({ event }) : typeof mappings[k2] === "function" ? mappings[k2](cmd2, props) : cmd2[mappings[k2]];
|
|
75996
75829
|
});
|
|
75997
75830
|
let out = /* @__PURE__ */ React.createElement(WrappedComponent, __spreadValues(__spreadValues({}, mappedProps), props));
|
|
75998
|
-
const tooltip =
|
|
75831
|
+
const tooltip = cmd2.tooltip || typeof cmd2.isDisabled === "string" && cmd2.isDisabled;
|
|
75999
75832
|
if (tooltip && !cmdOptions.ignoreTooltip) {
|
|
76000
75833
|
out = /* @__PURE__ */ React.createElement(core.Tooltip, { content: tooltip }, out);
|
|
76001
75834
|
}
|
|
76002
|
-
return
|
|
75835
|
+
return cmd2.isHidden && !cmdOptions.ignoreHidden ? null : out;
|
|
76003
75836
|
}, "withCommand");
|
|
76004
75837
|
const CmdCheckbox = withCommand({
|
|
76005
75838
|
onChange: "execute",
|
|
76006
|
-
label: /* @__PURE__ */ __name((
|
|
75839
|
+
label: /* @__PURE__ */ __name((cmd2, props) => props.name || props.prefix && /* @__PURE__ */ React.createElement(React.Fragment, null, props.prefix, cmd2.name) || cmd2.name, "label"),
|
|
76007
75840
|
disabled: "isDisabled",
|
|
76008
75841
|
checked: "isActive"
|
|
76009
75842
|
})(core.Checkbox);
|
|
@@ -76012,13 +75845,13 @@ const Div = /* @__PURE__ */ __name(({ onChange, children }) => {
|
|
|
76012
75845
|
}, "Div");
|
|
76013
75846
|
const CmdDiv = withCommand({
|
|
76014
75847
|
onChange: "execute",
|
|
76015
|
-
children: /* @__PURE__ */ __name((
|
|
75848
|
+
children: /* @__PURE__ */ __name((cmd2, props) => props.name || props.prefix && /* @__PURE__ */ React.createElement(React.Fragment, null, props.prefix, cmd2.name) || cmd2.name, "children"),
|
|
76016
75849
|
disabled: "isDisabled",
|
|
76017
75850
|
checked: "isActive"
|
|
76018
75851
|
})(Div);
|
|
76019
75852
|
const CmdButton = withCommand({
|
|
76020
75853
|
onClick: "execute",
|
|
76021
|
-
text: /* @__PURE__ */ __name((
|
|
75854
|
+
text: /* @__PURE__ */ __name((cmd2) => cmd2.isActive === false && cmd2.inactiveName || cmd2.name, "text"),
|
|
76022
75855
|
icon: "icon",
|
|
76023
75856
|
disabled: "isDisabled"
|
|
76024
75857
|
})(core.Button);
|
|
@@ -76311,9 +76144,9 @@ const createYourOwnEnzyme$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Obje
|
|
|
76311
76144
|
default: createYourOwnEnzyme
|
|
76312
76145
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
76313
76146
|
function createMetaAction(actionName, payloadHelper) {
|
|
76314
|
-
return createAction(actionName, payloadHelper, function(unused,
|
|
76315
|
-
return __spreadProps(__spreadValues({},
|
|
76316
|
-
editorName:
|
|
76147
|
+
return createAction(actionName, payloadHelper, function(unused, meta2) {
|
|
76148
|
+
return __spreadProps(__spreadValues({}, meta2), {
|
|
76149
|
+
editorName: meta2.editorName
|
|
76317
76150
|
});
|
|
76318
76151
|
});
|
|
76319
76152
|
}
|
|
@@ -78388,303 +78221,6 @@ const getFeatureToColorMap = /* @__PURE__ */ __name(({ includeHidden } = {}) =>
|
|
|
78388
78221
|
const getFeatureTypes = /* @__PURE__ */ __name(({ includeHidden } = {}) => filter(getMergedFeatureMap(), (f2) => includeHidden ? true : !f2.isHidden).map(
|
|
78389
78222
|
(f2) => f2.name
|
|
78390
78223
|
), "getFeatureTypes");
|
|
78391
|
-
var lib$6 = { exports: {} };
|
|
78392
|
-
var randomFromSeed;
|
|
78393
|
-
var hasRequiredRandomFromSeed;
|
|
78394
|
-
function requireRandomFromSeed() {
|
|
78395
|
-
if (hasRequiredRandomFromSeed) return randomFromSeed;
|
|
78396
|
-
hasRequiredRandomFromSeed = 1;
|
|
78397
|
-
var seed = 1;
|
|
78398
|
-
function getNextValue() {
|
|
78399
|
-
seed = (seed * 9301 + 49297) % 233280;
|
|
78400
|
-
return seed / 233280;
|
|
78401
|
-
}
|
|
78402
|
-
__name(getNextValue, "getNextValue");
|
|
78403
|
-
function setSeed(_seed_) {
|
|
78404
|
-
seed = _seed_;
|
|
78405
|
-
}
|
|
78406
|
-
__name(setSeed, "setSeed");
|
|
78407
|
-
randomFromSeed = {
|
|
78408
|
-
nextValue: getNextValue,
|
|
78409
|
-
seed: setSeed
|
|
78410
|
-
};
|
|
78411
|
-
return randomFromSeed;
|
|
78412
|
-
}
|
|
78413
|
-
__name(requireRandomFromSeed, "requireRandomFromSeed");
|
|
78414
|
-
var alphabet_1;
|
|
78415
|
-
var hasRequiredAlphabet;
|
|
78416
|
-
function requireAlphabet() {
|
|
78417
|
-
if (hasRequiredAlphabet) return alphabet_1;
|
|
78418
|
-
hasRequiredAlphabet = 1;
|
|
78419
|
-
var randomFromSeed2 = requireRandomFromSeed();
|
|
78420
|
-
var ORIGINAL = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";
|
|
78421
|
-
var alphabet;
|
|
78422
|
-
var previousSeed;
|
|
78423
|
-
var shuffled;
|
|
78424
|
-
function reset2() {
|
|
78425
|
-
shuffled = false;
|
|
78426
|
-
}
|
|
78427
|
-
__name(reset2, "reset");
|
|
78428
|
-
function setCharacters(_alphabet_) {
|
|
78429
|
-
if (!_alphabet_) {
|
|
78430
|
-
if (alphabet !== ORIGINAL) {
|
|
78431
|
-
alphabet = ORIGINAL;
|
|
78432
|
-
reset2();
|
|
78433
|
-
}
|
|
78434
|
-
return;
|
|
78435
|
-
}
|
|
78436
|
-
if (_alphabet_ === alphabet) {
|
|
78437
|
-
return;
|
|
78438
|
-
}
|
|
78439
|
-
if (_alphabet_.length !== ORIGINAL.length) {
|
|
78440
|
-
throw new Error("Custom alphabet for shortid must be " + ORIGINAL.length + " unique characters. You submitted " + _alphabet_.length + " characters: " + _alphabet_);
|
|
78441
|
-
}
|
|
78442
|
-
var unique2 = _alphabet_.split("").filter(function(item, ind, arr) {
|
|
78443
|
-
return ind !== arr.lastIndexOf(item);
|
|
78444
|
-
});
|
|
78445
|
-
if (unique2.length) {
|
|
78446
|
-
throw new Error("Custom alphabet for shortid must be " + ORIGINAL.length + " unique characters. These characters were not unique: " + unique2.join(", "));
|
|
78447
|
-
}
|
|
78448
|
-
alphabet = _alphabet_;
|
|
78449
|
-
reset2();
|
|
78450
|
-
}
|
|
78451
|
-
__name(setCharacters, "setCharacters");
|
|
78452
|
-
function characters(_alphabet_) {
|
|
78453
|
-
setCharacters(_alphabet_);
|
|
78454
|
-
return alphabet;
|
|
78455
|
-
}
|
|
78456
|
-
__name(characters, "characters");
|
|
78457
|
-
function setSeed(seed) {
|
|
78458
|
-
randomFromSeed2.seed(seed);
|
|
78459
|
-
if (previousSeed !== seed) {
|
|
78460
|
-
reset2();
|
|
78461
|
-
previousSeed = seed;
|
|
78462
|
-
}
|
|
78463
|
-
}
|
|
78464
|
-
__name(setSeed, "setSeed");
|
|
78465
|
-
function shuffle() {
|
|
78466
|
-
if (!alphabet) {
|
|
78467
|
-
setCharacters(ORIGINAL);
|
|
78468
|
-
}
|
|
78469
|
-
var sourceArray = alphabet.split("");
|
|
78470
|
-
var targetArray = [];
|
|
78471
|
-
var r2 = randomFromSeed2.nextValue();
|
|
78472
|
-
var characterIndex;
|
|
78473
|
-
while (sourceArray.length > 0) {
|
|
78474
|
-
r2 = randomFromSeed2.nextValue();
|
|
78475
|
-
characterIndex = Math.floor(r2 * sourceArray.length);
|
|
78476
|
-
targetArray.push(sourceArray.splice(characterIndex, 1)[0]);
|
|
78477
|
-
}
|
|
78478
|
-
return targetArray.join("");
|
|
78479
|
-
}
|
|
78480
|
-
__name(shuffle, "shuffle");
|
|
78481
|
-
function getShuffled() {
|
|
78482
|
-
if (shuffled) {
|
|
78483
|
-
return shuffled;
|
|
78484
|
-
}
|
|
78485
|
-
shuffled = shuffle();
|
|
78486
|
-
return shuffled;
|
|
78487
|
-
}
|
|
78488
|
-
__name(getShuffled, "getShuffled");
|
|
78489
|
-
function lookup(index2) {
|
|
78490
|
-
var alphabetShuffled = getShuffled();
|
|
78491
|
-
return alphabetShuffled[index2];
|
|
78492
|
-
}
|
|
78493
|
-
__name(lookup, "lookup");
|
|
78494
|
-
function get7() {
|
|
78495
|
-
return alphabet || ORIGINAL;
|
|
78496
|
-
}
|
|
78497
|
-
__name(get7, "get");
|
|
78498
|
-
alphabet_1 = {
|
|
78499
|
-
get: get7,
|
|
78500
|
-
characters,
|
|
78501
|
-
seed: setSeed,
|
|
78502
|
-
lookup,
|
|
78503
|
-
shuffled: getShuffled
|
|
78504
|
-
};
|
|
78505
|
-
return alphabet_1;
|
|
78506
|
-
}
|
|
78507
|
-
__name(requireAlphabet, "requireAlphabet");
|
|
78508
|
-
var randomByteBrowser;
|
|
78509
|
-
var hasRequiredRandomByteBrowser;
|
|
78510
|
-
function requireRandomByteBrowser() {
|
|
78511
|
-
if (hasRequiredRandomByteBrowser) return randomByteBrowser;
|
|
78512
|
-
hasRequiredRandomByteBrowser = 1;
|
|
78513
|
-
var crypto2 = typeof window === "object" && (window.crypto || window.msCrypto);
|
|
78514
|
-
var randomByte;
|
|
78515
|
-
if (!crypto2 || !crypto2.getRandomValues) {
|
|
78516
|
-
randomByte = /* @__PURE__ */ __name(function(size) {
|
|
78517
|
-
var bytes = [];
|
|
78518
|
-
for (var i = 0; i < size; i++) {
|
|
78519
|
-
bytes.push(Math.floor(Math.random() * 256));
|
|
78520
|
-
}
|
|
78521
|
-
return bytes;
|
|
78522
|
-
}, "randomByte");
|
|
78523
|
-
} else {
|
|
78524
|
-
randomByte = /* @__PURE__ */ __name(function(size) {
|
|
78525
|
-
return crypto2.getRandomValues(new Uint8Array(size));
|
|
78526
|
-
}, "randomByte");
|
|
78527
|
-
}
|
|
78528
|
-
randomByteBrowser = randomByte;
|
|
78529
|
-
return randomByteBrowser;
|
|
78530
|
-
}
|
|
78531
|
-
__name(requireRandomByteBrowser, "requireRandomByteBrowser");
|
|
78532
|
-
var format_browser;
|
|
78533
|
-
var hasRequiredFormat_browser;
|
|
78534
|
-
function requireFormat_browser() {
|
|
78535
|
-
if (hasRequiredFormat_browser) return format_browser;
|
|
78536
|
-
hasRequiredFormat_browser = 1;
|
|
78537
|
-
format_browser = /* @__PURE__ */ __name(function(random, alphabet, size) {
|
|
78538
|
-
var mask = (2 << Math.log(alphabet.length - 1) / Math.LN2) - 1;
|
|
78539
|
-
var step = -~(1.6 * mask * size / alphabet.length);
|
|
78540
|
-
var id2 = "";
|
|
78541
|
-
while (true) {
|
|
78542
|
-
var bytes = random(step);
|
|
78543
|
-
var i = step;
|
|
78544
|
-
while (i--) {
|
|
78545
|
-
id2 += alphabet[bytes[i] & mask] || "";
|
|
78546
|
-
if (id2.length === +size) return id2;
|
|
78547
|
-
}
|
|
78548
|
-
}
|
|
78549
|
-
}, "format_browser");
|
|
78550
|
-
return format_browser;
|
|
78551
|
-
}
|
|
78552
|
-
__name(requireFormat_browser, "requireFormat_browser");
|
|
78553
|
-
var generate_1;
|
|
78554
|
-
var hasRequiredGenerate;
|
|
78555
|
-
function requireGenerate() {
|
|
78556
|
-
if (hasRequiredGenerate) return generate_1;
|
|
78557
|
-
hasRequiredGenerate = 1;
|
|
78558
|
-
var alphabet = requireAlphabet();
|
|
78559
|
-
var random = requireRandomByteBrowser();
|
|
78560
|
-
var format2 = /* @__PURE__ */ requireFormat_browser();
|
|
78561
|
-
function generate(number2) {
|
|
78562
|
-
var loopCounter = 0;
|
|
78563
|
-
var done;
|
|
78564
|
-
var str = "";
|
|
78565
|
-
while (!done) {
|
|
78566
|
-
str = str + format2(random, alphabet.get(), 1);
|
|
78567
|
-
done = number2 < Math.pow(16, loopCounter + 1);
|
|
78568
|
-
loopCounter++;
|
|
78569
|
-
}
|
|
78570
|
-
return str;
|
|
78571
|
-
}
|
|
78572
|
-
__name(generate, "generate");
|
|
78573
|
-
generate_1 = generate;
|
|
78574
|
-
return generate_1;
|
|
78575
|
-
}
|
|
78576
|
-
__name(requireGenerate, "requireGenerate");
|
|
78577
|
-
var build_1;
|
|
78578
|
-
var hasRequiredBuild;
|
|
78579
|
-
function requireBuild() {
|
|
78580
|
-
if (hasRequiredBuild) return build_1;
|
|
78581
|
-
hasRequiredBuild = 1;
|
|
78582
|
-
var generate = requireGenerate();
|
|
78583
|
-
requireAlphabet();
|
|
78584
|
-
var REDUCE_TIME = 1567752802062;
|
|
78585
|
-
var version2 = 7;
|
|
78586
|
-
var counter2;
|
|
78587
|
-
var previousSeconds;
|
|
78588
|
-
function build(clusterWorkerId) {
|
|
78589
|
-
var str = "";
|
|
78590
|
-
var seconds = Math.floor((Date.now() - REDUCE_TIME) * 1e-3);
|
|
78591
|
-
if (seconds === previousSeconds) {
|
|
78592
|
-
counter2++;
|
|
78593
|
-
} else {
|
|
78594
|
-
counter2 = 0;
|
|
78595
|
-
previousSeconds = seconds;
|
|
78596
|
-
}
|
|
78597
|
-
str = str + generate(version2);
|
|
78598
|
-
str = str + generate(clusterWorkerId);
|
|
78599
|
-
if (counter2 > 0) {
|
|
78600
|
-
str = str + generate(counter2);
|
|
78601
|
-
}
|
|
78602
|
-
str = str + generate(seconds);
|
|
78603
|
-
return str;
|
|
78604
|
-
}
|
|
78605
|
-
__name(build, "build");
|
|
78606
|
-
build_1 = build;
|
|
78607
|
-
return build_1;
|
|
78608
|
-
}
|
|
78609
|
-
__name(requireBuild, "requireBuild");
|
|
78610
|
-
var isValid2;
|
|
78611
|
-
var hasRequiredIsValid;
|
|
78612
|
-
function requireIsValid() {
|
|
78613
|
-
if (hasRequiredIsValid) return isValid2;
|
|
78614
|
-
hasRequiredIsValid = 1;
|
|
78615
|
-
var alphabet = requireAlphabet();
|
|
78616
|
-
function isShortId(id2) {
|
|
78617
|
-
if (!id2 || typeof id2 !== "string" || id2.length < 6) {
|
|
78618
|
-
return false;
|
|
78619
|
-
}
|
|
78620
|
-
var nonAlphabetic = new RegExp("[^" + alphabet.get().replace(/[|\\{}()[\]^$+*?.-]/g, "\\$&") + "]");
|
|
78621
|
-
return !nonAlphabetic.test(id2);
|
|
78622
|
-
}
|
|
78623
|
-
__name(isShortId, "isShortId");
|
|
78624
|
-
isValid2 = isShortId;
|
|
78625
|
-
return isValid2;
|
|
78626
|
-
}
|
|
78627
|
-
__name(requireIsValid, "requireIsValid");
|
|
78628
|
-
var clusterWorkerIdBrowser;
|
|
78629
|
-
var hasRequiredClusterWorkerIdBrowser;
|
|
78630
|
-
function requireClusterWorkerIdBrowser() {
|
|
78631
|
-
if (hasRequiredClusterWorkerIdBrowser) return clusterWorkerIdBrowser;
|
|
78632
|
-
hasRequiredClusterWorkerIdBrowser = 1;
|
|
78633
|
-
clusterWorkerIdBrowser = 0;
|
|
78634
|
-
return clusterWorkerIdBrowser;
|
|
78635
|
-
}
|
|
78636
|
-
__name(requireClusterWorkerIdBrowser, "requireClusterWorkerIdBrowser");
|
|
78637
|
-
var hasRequiredLib$6;
|
|
78638
|
-
function requireLib$6() {
|
|
78639
|
-
if (hasRequiredLib$6) return lib$6.exports;
|
|
78640
|
-
hasRequiredLib$6 = 1;
|
|
78641
|
-
(function(module2) {
|
|
78642
|
-
var alphabet = requireAlphabet();
|
|
78643
|
-
var build = requireBuild();
|
|
78644
|
-
var isValid3 = requireIsValid();
|
|
78645
|
-
var clusterWorkerId = requireClusterWorkerIdBrowser() || 0;
|
|
78646
|
-
function seed(seedValue) {
|
|
78647
|
-
alphabet.seed(seedValue);
|
|
78648
|
-
return module2.exports;
|
|
78649
|
-
}
|
|
78650
|
-
__name(seed, "seed");
|
|
78651
|
-
function worker(workerId) {
|
|
78652
|
-
clusterWorkerId = workerId;
|
|
78653
|
-
return module2.exports;
|
|
78654
|
-
}
|
|
78655
|
-
__name(worker, "worker");
|
|
78656
|
-
function characters(newCharacters) {
|
|
78657
|
-
if (newCharacters !== void 0) {
|
|
78658
|
-
alphabet.characters(newCharacters);
|
|
78659
|
-
}
|
|
78660
|
-
return alphabet.shuffled();
|
|
78661
|
-
}
|
|
78662
|
-
__name(characters, "characters");
|
|
78663
|
-
function generate() {
|
|
78664
|
-
return build(clusterWorkerId);
|
|
78665
|
-
}
|
|
78666
|
-
__name(generate, "generate");
|
|
78667
|
-
module2.exports = generate;
|
|
78668
|
-
module2.exports.generate = generate;
|
|
78669
|
-
module2.exports.seed = seed;
|
|
78670
|
-
module2.exports.worker = worker;
|
|
78671
|
-
module2.exports.characters = characters;
|
|
78672
|
-
module2.exports.isValid = isValid3;
|
|
78673
|
-
})(lib$6);
|
|
78674
|
-
return lib$6.exports;
|
|
78675
|
-
}
|
|
78676
|
-
__name(requireLib$6, "requireLib$6");
|
|
78677
|
-
var shortid;
|
|
78678
|
-
var hasRequiredShortid;
|
|
78679
|
-
function requireShortid() {
|
|
78680
|
-
if (hasRequiredShortid) return shortid;
|
|
78681
|
-
hasRequiredShortid = 1;
|
|
78682
|
-
shortid = requireLib$6();
|
|
78683
|
-
return shortid;
|
|
78684
|
-
}
|
|
78685
|
-
__name(requireShortid, "requireShortid");
|
|
78686
|
-
var shortidExports = requireShortid();
|
|
78687
|
-
const uuid = /* @__PURE__ */ getDefaultExportFromCjs(shortidExports);
|
|
78688
78224
|
function cutSequenceByRestrictionEnzyme(pSequence, circular2, restrictionEnzyme) {
|
|
78689
78225
|
if (restrictionEnzyme.forwardRegex.length === 0 || restrictionEnzyme.reverseRegex.length === 0) {
|
|
78690
78226
|
const returnArray = [];
|
|
@@ -78892,7 +78428,7 @@ function cutSequence(forwardRegExpPattern, restrictionEnzyme, sequence2, circula
|
|
|
78892
78428
|
}
|
|
78893
78429
|
const overhangBps = getSequenceWithinRange(cutRange, originalSequence);
|
|
78894
78430
|
restrictionCutSite = {
|
|
78895
|
-
id:
|
|
78431
|
+
id: nanoid(),
|
|
78896
78432
|
start: start2,
|
|
78897
78433
|
end: end2,
|
|
78898
78434
|
topSnipPosition,
|
|
@@ -83527,10 +83063,10 @@ function tidyUpAnnotation(_annotation, {
|
|
|
83527
83063
|
annotation.name = "Untitled annotation";
|
|
83528
83064
|
}
|
|
83529
83065
|
if (provideNewIdsForAnnotations) {
|
|
83530
|
-
annotation.id =
|
|
83066
|
+
annotation.id = nanoid();
|
|
83531
83067
|
}
|
|
83532
83068
|
if (!annotation.id && annotation.id !== 0 && !doNotProvideIdsForAnnotations) {
|
|
83533
|
-
annotation.id =
|
|
83069
|
+
annotation.id = nanoid();
|
|
83534
83070
|
messages.push(
|
|
83535
83071
|
"Unable to detect valid ID for annotation, setting ID to " + annotation.id
|
|
83536
83072
|
);
|
|
@@ -83774,7 +83310,7 @@ function tidyUpSequenceData(pSeqData, options = {}) {
|
|
|
83774
83310
|
if (item.id || item.id === 0) {
|
|
83775
83311
|
itemId = item.id;
|
|
83776
83312
|
} else {
|
|
83777
|
-
itemId =
|
|
83313
|
+
itemId = nanoid();
|
|
83778
83314
|
if (!doNotProvideIdsForAnnotations) {
|
|
83779
83315
|
item.id = itemId;
|
|
83780
83316
|
}
|
|
@@ -83837,7 +83373,7 @@ function getVirtualDigest({
|
|
|
83837
83373
|
});
|
|
83838
83374
|
sortedCutsites.forEach((cutsite1, index2) => {
|
|
83839
83375
|
if (computePartialDigest && !computePartialDigestDisabled) {
|
|
83840
|
-
sortedCutsites.forEach((
|
|
83376
|
+
sortedCutsites.forEach((cs2, index22) => {
|
|
83841
83377
|
pairs.push([cutsite1, sortedCutsites[index22]]);
|
|
83842
83378
|
});
|
|
83843
83379
|
}
|
|
@@ -92206,7 +91742,7 @@ function getOrfsFromSequence(options) {
|
|
|
92206
91742
|
forward,
|
|
92207
91743
|
annotationTypePlural: "orfs",
|
|
92208
91744
|
isOrf: true,
|
|
92209
|
-
id:
|
|
91745
|
+
id: nanoid()
|
|
92210
91746
|
});
|
|
92211
91747
|
}
|
|
92212
91748
|
}
|
|
@@ -94336,11 +93872,11 @@ function requireValidator() {
|
|
|
94336
93872
|
if (attrStr[attrStr.length - 1] === "/") {
|
|
94337
93873
|
const attrStrStart = i - attrStr.length;
|
|
94338
93874
|
attrStr = attrStr.substring(0, attrStr.length - 1);
|
|
94339
|
-
const
|
|
94340
|
-
if (
|
|
93875
|
+
const isValid2 = validateAttributeString(attrStr, options);
|
|
93876
|
+
if (isValid2 === true) {
|
|
94341
93877
|
tagFound = true;
|
|
94342
93878
|
} else {
|
|
94343
|
-
return getErrorObject(
|
|
93879
|
+
return getErrorObject(isValid2.err.code, isValid2.err.msg, getLineNumberForPosition(xmlData, attrStrStart + isValid2.err.line));
|
|
94344
93880
|
}
|
|
94345
93881
|
} else if (closingTag) {
|
|
94346
93882
|
if (!result.tagClosed) {
|
|
@@ -94362,9 +93898,9 @@ function requireValidator() {
|
|
|
94362
93898
|
}
|
|
94363
93899
|
}
|
|
94364
93900
|
} else {
|
|
94365
|
-
const
|
|
94366
|
-
if (
|
|
94367
|
-
return getErrorObject(
|
|
93901
|
+
const isValid2 = validateAttributeString(attrStr, options);
|
|
93902
|
+
if (isValid2 !== true) {
|
|
93903
|
+
return getErrorObject(isValid2.err.code, isValid2.err.msg, getLineNumberForPosition(xmlData, i - attrStr.length + isValid2.err.line));
|
|
94368
93904
|
}
|
|
94369
93905
|
if (reachedRoot === true) {
|
|
94370
93906
|
return getErrorObject("InvalidXml", "Multiple possible root nodes found.", getLineNumberForPosition(xmlData, i));
|
|
@@ -103542,7 +103078,7 @@ const alignments = /* @__PURE__ */ __name((state2 = {}, { payload = {}, type: ty
|
|
|
103542
103078
|
if (type2 === "UPSERT_ALIGNMENT_RUN") {
|
|
103543
103079
|
const { id: id2 } = payload;
|
|
103544
103080
|
const payloadToUse = __spreadValues(__spreadValues({
|
|
103545
|
-
stateTrackingId: ((_a2 = state2[id2]) == null ? void 0 : _a2.stateTrackingId) ?
|
|
103081
|
+
stateTrackingId: ((_a2 = state2[id2]) == null ? void 0 : _a2.stateTrackingId) ? nanoid() : "initialLoadId",
|
|
103546
103082
|
alignmentType: (_b2 = state2[id2]) == null ? void 0 : _b2.alignmentType
|
|
103547
103083
|
}, payload), defaultVisibilityTypes.reduce((acc, type22) => {
|
|
103548
103084
|
if (type22.startsWith("pairwise_") && payload.pairwiseAlignments || !type22.startsWith("pairwise_") && !payload.pairwiseAlignments) {
|
|
@@ -103764,10 +103300,10 @@ const flipActiveTabFromLinearOrCircularIfNecessary = createMetaAction(
|
|
|
103764
103300
|
"flipActiveTabFromLinearOrCircularIfNecessary"
|
|
103765
103301
|
);
|
|
103766
103302
|
const expandTabToSplitScreen = createMetaAction("expandTabToSplitScreen");
|
|
103767
|
-
const propertiesViewOpen = /* @__PURE__ */ __name((unused,
|
|
103768
|
-
return setPanelAsActive("properties",
|
|
103303
|
+
const propertiesViewOpen = /* @__PURE__ */ __name((unused, meta2) => {
|
|
103304
|
+
return setPanelAsActive("properties", meta2);
|
|
103769
103305
|
}, "propertiesViewOpen");
|
|
103770
|
-
const createNewDigest = /* @__PURE__ */ __name((unused,
|
|
103306
|
+
const createNewDigest = /* @__PURE__ */ __name((unused, meta2) => {
|
|
103771
103307
|
return (dispatch) => {
|
|
103772
103308
|
dispatch(
|
|
103773
103309
|
addPanelIfItDoesntAlreadyExist(
|
|
@@ -103777,13 +103313,13 @@ const createNewDigest = /* @__PURE__ */ __name((unused, meta) => {
|
|
|
103777
103313
|
active: true,
|
|
103778
103314
|
canClose: true
|
|
103779
103315
|
},
|
|
103780
|
-
|
|
103316
|
+
meta2
|
|
103781
103317
|
)
|
|
103782
103318
|
);
|
|
103783
|
-
dispatch(setPanelAsActive("digestTool",
|
|
103319
|
+
dispatch(setPanelAsActive("digestTool", meta2));
|
|
103784
103320
|
};
|
|
103785
103321
|
}, "createNewDigest");
|
|
103786
|
-
const createNewPCR = /* @__PURE__ */ __name((unused,
|
|
103322
|
+
const createNewPCR = /* @__PURE__ */ __name((unused, meta2) => {
|
|
103787
103323
|
return (dispatch) => {
|
|
103788
103324
|
dispatch(
|
|
103789
103325
|
addPanelIfItDoesntAlreadyExist(
|
|
@@ -103793,13 +103329,13 @@ const createNewPCR = /* @__PURE__ */ __name((unused, meta) => {
|
|
|
103793
103329
|
active: true,
|
|
103794
103330
|
canClose: true
|
|
103795
103331
|
},
|
|
103796
|
-
|
|
103332
|
+
meta2
|
|
103797
103333
|
)
|
|
103798
103334
|
);
|
|
103799
|
-
dispatch(setPanelAsActive("pcrTool",
|
|
103335
|
+
dispatch(setPanelAsActive("pcrTool", meta2));
|
|
103800
103336
|
};
|
|
103801
103337
|
}, "createNewPCR");
|
|
103802
|
-
const createNewAlignment = /* @__PURE__ */ __name((payload,
|
|
103338
|
+
const createNewAlignment = /* @__PURE__ */ __name((payload, meta2) => {
|
|
103803
103339
|
return (dispatch) => {
|
|
103804
103340
|
dispatch(
|
|
103805
103341
|
addPanelIfItDoesntAlreadyExist(
|
|
@@ -103809,13 +103345,13 @@ const createNewAlignment = /* @__PURE__ */ __name((payload, meta) => {
|
|
|
103809
103345
|
active: true,
|
|
103810
103346
|
canClose: true
|
|
103811
103347
|
}, payload),
|
|
103812
|
-
|
|
103348
|
+
meta2
|
|
103813
103349
|
)
|
|
103814
103350
|
);
|
|
103815
|
-
dispatch(setPanelAsActive(payload.id,
|
|
103351
|
+
dispatch(setPanelAsActive(payload.id, meta2));
|
|
103816
103352
|
};
|
|
103817
103353
|
}, "createNewAlignment");
|
|
103818
|
-
const createNewMismatchesList = /* @__PURE__ */ __name((payload,
|
|
103354
|
+
const createNewMismatchesList = /* @__PURE__ */ __name((payload, meta2) => {
|
|
103819
103355
|
return (dispatch) => {
|
|
103820
103356
|
dispatch(
|
|
103821
103357
|
addPanelIfItDoesntAlreadyExist(
|
|
@@ -103825,16 +103361,16 @@ const createNewMismatchesList = /* @__PURE__ */ __name((payload, meta) => {
|
|
|
103825
103361
|
active: true,
|
|
103826
103362
|
canClose: true
|
|
103827
103363
|
}, payload),
|
|
103828
|
-
|
|
103364
|
+
meta2
|
|
103829
103365
|
)
|
|
103830
103366
|
);
|
|
103831
|
-
dispatch(setPanelAsActive(payload.id,
|
|
103367
|
+
dispatch(setPanelAsActive(payload.id, meta2));
|
|
103832
103368
|
};
|
|
103833
103369
|
}, "createNewMismatchesList");
|
|
103834
|
-
const collapseSplitScreen = /* @__PURE__ */ __name((activePanelId,
|
|
103370
|
+
const collapseSplitScreen = /* @__PURE__ */ __name((activePanelId, meta2) => {
|
|
103835
103371
|
return (dispatch) => {
|
|
103836
|
-
dispatch(_collapseSplitScreen(activePanelId,
|
|
103837
|
-
activePanelId && dispatch(setPanelAsActive(activePanelId,
|
|
103372
|
+
dispatch(_collapseSplitScreen(activePanelId, meta2));
|
|
103373
|
+
activePanelId && dispatch(setPanelAsActive(activePanelId, meta2));
|
|
103838
103374
|
};
|
|
103839
103375
|
}, "collapseSplitScreen");
|
|
103840
103376
|
const reducer$1 = createReducer(
|
|
@@ -104371,7 +103907,7 @@ const updateSelectedAnnotation = createMetaAction(
|
|
|
104371
103907
|
);
|
|
104372
103908
|
const annotationDeselect = createMetaAction("VE_ANNOTATION_DESELECT");
|
|
104373
103909
|
const annotationDeselectAll = createMetaAction("VE_ANNOTATION_DESELECT_ALL");
|
|
104374
|
-
function replacementLayerRightClicked({ event, annotation },
|
|
103910
|
+
function replacementLayerRightClicked({ event, annotation }, meta2) {
|
|
104375
103911
|
event.preventDefault();
|
|
104376
103912
|
event.stopPropagation();
|
|
104377
103913
|
return function(dispatch) {
|
|
@@ -104381,7 +103917,7 @@ function replacementLayerRightClicked({ event, annotation }, meta) {
|
|
|
104381
103917
|
onClick: /* @__PURE__ */ __name(function() {
|
|
104382
103918
|
dispatch({
|
|
104383
103919
|
type: "REPLACEMENT_LAYER_DELETE",
|
|
104384
|
-
meta,
|
|
103920
|
+
meta: meta2,
|
|
104385
103921
|
payload: __spreadValues({}, annotation)
|
|
104386
103922
|
});
|
|
104387
103923
|
}, "onClick")
|
|
@@ -105246,7 +104782,7 @@ const deepEqual = /* @__PURE__ */ getDefaultExportFromCjs(deepEqualExports);
|
|
|
105246
104782
|
function upsertDeleteActionGenerator(upsertAction, deleteAction) {
|
|
105247
104783
|
return {
|
|
105248
104784
|
[upsertAction]: (state2, payload) => {
|
|
105249
|
-
const idToUse = payload.id ||
|
|
104785
|
+
const idToUse = payload.id || nanoid();
|
|
105250
104786
|
return __spreadProps(__spreadValues({}, state2), {
|
|
105251
104787
|
[idToUse]: __spreadProps(__spreadValues(__spreadValues({}, state2[idToUse] || {}), payload), { id: idToUse })
|
|
105252
104788
|
});
|
|
@@ -105370,7 +104906,7 @@ function index$1(state2, action2) {
|
|
|
105370
104906
|
return state2;
|
|
105371
104907
|
} else {
|
|
105372
104908
|
return __spreadProps(__spreadValues({}, newState), {
|
|
105373
|
-
stateTrackingId: newState.stateTrackingId ?
|
|
104909
|
+
stateTrackingId: newState.stateTrackingId ? nanoid() : "initialLoadId"
|
|
105374
104910
|
});
|
|
105375
104911
|
}
|
|
105376
104912
|
}
|
|
@@ -105829,11 +105365,11 @@ const _FillWindow = class _FillWindow extends React.Component {
|
|
|
105829
105365
|
};
|
|
105830
105366
|
__name(_FillWindow, "FillWindow");
|
|
105831
105367
|
let FillWindow = _FillWindow;
|
|
105832
|
-
function addMetaToActionCreators(actions2,
|
|
105368
|
+
function addMetaToActionCreators(actions2, meta2) {
|
|
105833
105369
|
const metaActions = {};
|
|
105834
105370
|
Object.keys(actions2).forEach(function(actionName) {
|
|
105835
105371
|
metaActions[actionName] = function(firstArg, additionalMeta) {
|
|
105836
|
-
return actions2[actionName](firstArg, __spreadValues(__spreadValues({},
|
|
105372
|
+
return actions2[actionName](firstArg, __spreadValues(__spreadValues({}, meta2), additionalMeta || {}));
|
|
105837
105373
|
};
|
|
105838
105374
|
});
|
|
105839
105375
|
return metaActions;
|
|
@@ -106071,7 +105607,7 @@ function cutsitesSelector(sequence2, circular2, enzymeList, cutsiteLabelColors)
|
|
|
106071
105607
|
const cutsitesForEnzyme = cutsitesByName[enzymeName];
|
|
106072
105608
|
cutsitesForEnzyme.forEach(function(cutsite) {
|
|
106073
105609
|
const numberOfCuts = cutsitesByName[enzymeName].length;
|
|
106074
|
-
const uniqueId =
|
|
105610
|
+
const uniqueId = nanoid();
|
|
106075
105611
|
cutsite.id = uniqueId;
|
|
106076
105612
|
cutsite.numberOfCuts = numberOfCuts;
|
|
106077
105613
|
cutsite.annotationType = "cutsite";
|
|
@@ -106475,7 +106011,7 @@ const cdsFeaturesSelector = createSelector(featuresSelector, cdsFeaturesRawSelec
|
|
|
106475
106011
|
function translationsSelector(isCircular, translationSearchMatches, sequence2, orfs, showOrfTranslations, showOrfs, cdsFeatures, showCdsFeatureTranslations, showFeatures, translations2, frameTranslations2) {
|
|
106476
106012
|
const translationsToPass = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, translationSearchMatches.reduce((acc, match) => {
|
|
106477
106013
|
if (!match) return acc;
|
|
106478
|
-
const id2 = match.id ||
|
|
106014
|
+
const id2 = match.id || nanoid();
|
|
106479
106015
|
acc[id2] = __spreadProps(__spreadValues({}, match), {
|
|
106480
106016
|
id: id2,
|
|
106481
106017
|
translationType: "AA Search Match",
|
|
@@ -106516,7 +106052,7 @@ function translationsSelector(isCircular, translationSearchMatches, sequence2, o
|
|
|
106516
106052
|
(acc, isActive2, frameName) => {
|
|
106517
106053
|
const frameOffset = Number(frameName);
|
|
106518
106054
|
if (isActive2) {
|
|
106519
|
-
const id2 =
|
|
106055
|
+
const id2 = nanoid();
|
|
106520
106056
|
acc[id2] = {
|
|
106521
106057
|
id: id2,
|
|
106522
106058
|
start: isCircular || frameOffset > 0 ? normalizePositionByRangeLength(
|
|
@@ -107229,7 +106765,7 @@ function requireDomToImage() {
|
|
|
107229
106765
|
return new Promise(function(resolve) {
|
|
107230
106766
|
var request = new XMLHttpRequest();
|
|
107231
106767
|
request.onreadystatechange = done;
|
|
107232
|
-
request.ontimeout =
|
|
106768
|
+
request.ontimeout = timeout2;
|
|
107233
106769
|
request.responseType = "blob";
|
|
107234
106770
|
request.timeout = TIMEOUT;
|
|
107235
106771
|
request.open("GET", url, true);
|
|
@@ -107259,14 +106795,14 @@ function requireDomToImage() {
|
|
|
107259
106795
|
encoder.readAsDataURL(request.response);
|
|
107260
106796
|
}
|
|
107261
106797
|
__name(done, "done");
|
|
107262
|
-
function
|
|
106798
|
+
function timeout2() {
|
|
107263
106799
|
if (placeholder) {
|
|
107264
106800
|
resolve(placeholder);
|
|
107265
106801
|
} else {
|
|
107266
106802
|
fail("timeout of " + TIMEOUT + "ms occured while fetching resource: " + url);
|
|
107267
106803
|
}
|
|
107268
106804
|
}
|
|
107269
|
-
__name(
|
|
106805
|
+
__name(timeout2, "timeout");
|
|
107270
106806
|
function fail(message) {
|
|
107271
106807
|
console.error(message);
|
|
107272
106808
|
resolve("");
|
|
@@ -107528,7 +107064,7 @@ function showDialog({
|
|
|
107528
107064
|
dialogHolder.CustomModalComponent = ModalComponent;
|
|
107529
107065
|
dialogHolder.props = props;
|
|
107530
107066
|
dialogHolder.overrideName = overrideName;
|
|
107531
|
-
dialogHolder.setUniqKeyToForceRerender(
|
|
107067
|
+
dialogHolder.setUniqKeyToForceRerender(nanoid());
|
|
107532
107068
|
}
|
|
107533
107069
|
__name(showDialog, "showDialog");
|
|
107534
107070
|
function hideDialog() {
|
|
@@ -107918,7 +107454,7 @@ const importSequenceFromFile = /* @__PURE__ */ __name((props) => (_0, ..._1) =>
|
|
|
107918
107454
|
seqData = yield onImport(seqData, file, props);
|
|
107919
107455
|
}
|
|
107920
107456
|
if (seqData) {
|
|
107921
|
-
seqData.stateTrackingId =
|
|
107457
|
+
seqData.stateTrackingId = nanoid();
|
|
107922
107458
|
updateEditor(
|
|
107923
107459
|
{
|
|
107924
107460
|
getState: /* @__PURE__ */ __name(() => ({ VectorEditor: { [props.editorName]: props } }), "getState"),
|
|
@@ -108180,7 +107716,7 @@ function mapStateToProps(state2, ownProps) {
|
|
|
108180
107716
|
readOnly: readOnly2
|
|
108181
107717
|
} = ownProps;
|
|
108182
107718
|
const editorState = getEditorState(state2, editorName);
|
|
108183
|
-
const
|
|
107719
|
+
const meta2 = { editorName };
|
|
108184
107720
|
const { VectorEditor } = state2;
|
|
108185
107721
|
const { __allEditorsOptions } = VectorEditor;
|
|
108186
107722
|
const { uppercaseSequenceMapFont: uppercaseSequenceMapFont2 } = __allEditorsOptions;
|
|
@@ -108208,7 +107744,7 @@ function mapStateToProps(state2, ownProps) {
|
|
|
108208
107744
|
}
|
|
108209
107745
|
});
|
|
108210
107746
|
const toReturn = __spreadProps(__spreadValues({}, editorState), {
|
|
108211
|
-
meta,
|
|
107747
|
+
meta: meta2,
|
|
108212
107748
|
annotationToAdd
|
|
108213
107749
|
});
|
|
108214
107750
|
if (sequenceDataFromProps && allowSeqDataOverride) {
|
|
@@ -108242,7 +107778,7 @@ function mapStateToProps(state2, ownProps) {
|
|
|
108242
107778
|
const f2 = getFindTool(findTool2, matchesTotal);
|
|
108243
107779
|
return __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, editorState), {
|
|
108244
107780
|
readOnly: readOnly2 || editorState.readOnly,
|
|
108245
|
-
meta,
|
|
107781
|
+
meta: meta2,
|
|
108246
107782
|
annotationToAdd
|
|
108247
107783
|
}), newSelection && { selectionLayer: newSelection }), {
|
|
108248
107784
|
selectedCutsites,
|
|
@@ -108301,8 +107837,8 @@ function fakeActionOverrides() {
|
|
|
108301
107837
|
}
|
|
108302
107838
|
__name(fakeActionOverrides, "fakeActionOverrides");
|
|
108303
107839
|
function getCombinedActions(editorName, actions2, actionOverrides, dispatch) {
|
|
108304
|
-
const
|
|
108305
|
-
let metaActions = addMetaToActionCreators(actions2,
|
|
107840
|
+
const meta2 = { editorName };
|
|
107841
|
+
let metaActions = addMetaToActionCreators(actions2, meta2);
|
|
108306
107842
|
const overrides = {};
|
|
108307
107843
|
metaActions = __spreadValues(__spreadValues({
|
|
108308
107844
|
undo: /* @__PURE__ */ __name(() => {
|
|
@@ -120264,7 +119800,7 @@ const DrawLabel = withHover(
|
|
|
120264
119800
|
}, hovered && { textDecoration: "underline" }), annotation.annotationTypePlural !== "cutsites" && {
|
|
120265
119801
|
fontStyle: "normal"
|
|
120266
119802
|
}), {
|
|
120267
|
-
left: clamp$
|
|
119803
|
+
left: clamp$4(xStart, 0, Number.MAX_VALUE),
|
|
120268
119804
|
whiteSpace: "nowrap",
|
|
120269
119805
|
color: annotation.annotationTypePlural === "parts" ? "#ac68cc" : annotation.labelColor,
|
|
120270
119806
|
zIndex: 10
|
|
@@ -122368,7 +121904,7 @@ function showFileDialog({ multiple = false, onSelect }) {
|
|
|
122368
121904
|
input.click();
|
|
122369
121905
|
}
|
|
122370
121906
|
__name(showFileDialog, "showFileDialog");
|
|
122371
|
-
const version = "0.7.
|
|
121907
|
+
const version = "0.7.30-beta.1";
|
|
122372
121908
|
const packageJson = {
|
|
122373
121909
|
version
|
|
122374
121910
|
};
|
|
@@ -128301,8 +127837,8 @@ function assignDefault(value, fallback) {
|
|
|
128301
127837
|
__name(assignDefault, "assignDefault");
|
|
128302
127838
|
const BEFORE_LAST_KINEMATICS_DELAY = 32;
|
|
128303
127839
|
const _Engine = class _Engine {
|
|
128304
|
-
constructor(
|
|
128305
|
-
this.ctrl =
|
|
127840
|
+
constructor(ctrl2, args, key) {
|
|
127841
|
+
this.ctrl = ctrl2;
|
|
128306
127842
|
this.args = args;
|
|
128307
127843
|
this.key = key;
|
|
128308
127844
|
if (!this.state) {
|
|
@@ -129105,9 +128641,9 @@ function parse(newConfig, gestureKey, _config = {}) {
|
|
|
129105
128641
|
}
|
|
129106
128642
|
__name(parse, "parse");
|
|
129107
128643
|
const _EventStore = class _EventStore {
|
|
129108
|
-
constructor(
|
|
128644
|
+
constructor(ctrl2, gestureKey) {
|
|
129109
128645
|
_defineProperty(this, "_listeners", /* @__PURE__ */ new Set());
|
|
129110
|
-
this._ctrl =
|
|
128646
|
+
this._ctrl = ctrl2;
|
|
129111
128647
|
this._gestureKey = gestureKey;
|
|
129112
128648
|
}
|
|
129113
128649
|
add(element2, device, action2, handler, options) {
|
|
@@ -129139,11 +128675,11 @@ const _TimeoutStore = class _TimeoutStore {
|
|
|
129139
128675
|
this._timeouts.set(key, window.setTimeout(callback2, ms, ...args));
|
|
129140
128676
|
}
|
|
129141
128677
|
remove(key) {
|
|
129142
|
-
const
|
|
129143
|
-
if (
|
|
128678
|
+
const timeout2 = this._timeouts.get(key);
|
|
128679
|
+
if (timeout2) window.clearTimeout(timeout2);
|
|
129144
128680
|
}
|
|
129145
128681
|
clean() {
|
|
129146
|
-
this._timeouts.forEach((
|
|
128682
|
+
this._timeouts.forEach((timeout2) => void window.clearTimeout(timeout2));
|
|
129147
128683
|
this._timeouts.clear();
|
|
129148
128684
|
}
|
|
129149
128685
|
};
|
|
@@ -129241,19 +128777,19 @@ const _Controller = class _Controller {
|
|
|
129241
128777
|
};
|
|
129242
128778
|
__name(_Controller, "Controller");
|
|
129243
128779
|
let Controller = _Controller;
|
|
129244
|
-
function setupGesture(
|
|
129245
|
-
|
|
129246
|
-
|
|
129247
|
-
|
|
128780
|
+
function setupGesture(ctrl2, gestureKey) {
|
|
128781
|
+
ctrl2.gestures.add(gestureKey);
|
|
128782
|
+
ctrl2.gestureEventStores[gestureKey] = new EventStore(ctrl2, gestureKey);
|
|
128783
|
+
ctrl2.gestureTimeoutStores[gestureKey] = new TimeoutStore();
|
|
129248
128784
|
}
|
|
129249
128785
|
__name(setupGesture, "setupGesture");
|
|
129250
|
-
function resolveGestures(
|
|
129251
|
-
if (internalHandlers.drag) setupGesture(
|
|
129252
|
-
if (internalHandlers.wheel) setupGesture(
|
|
129253
|
-
if (internalHandlers.scroll) setupGesture(
|
|
129254
|
-
if (internalHandlers.move) setupGesture(
|
|
129255
|
-
if (internalHandlers.pinch) setupGesture(
|
|
129256
|
-
if (internalHandlers.hover) setupGesture(
|
|
128786
|
+
function resolveGestures(ctrl2, internalHandlers) {
|
|
128787
|
+
if (internalHandlers.drag) setupGesture(ctrl2, "drag");
|
|
128788
|
+
if (internalHandlers.wheel) setupGesture(ctrl2, "wheel");
|
|
128789
|
+
if (internalHandlers.scroll) setupGesture(ctrl2, "scroll");
|
|
128790
|
+
if (internalHandlers.move) setupGesture(ctrl2, "move");
|
|
128791
|
+
if (internalHandlers.pinch) setupGesture(ctrl2, "pinch");
|
|
128792
|
+
if (internalHandlers.hover) setupGesture(ctrl2, "hover");
|
|
129257
128793
|
}
|
|
129258
128794
|
__name(resolveGestures, "resolveGestures");
|
|
129259
128795
|
const bindToProps = /* @__PURE__ */ __name((props, eventOptions, withPassiveOption) => (device, action2, handler, options = {}, isNative2 = false) => {
|
|
@@ -129266,15 +128802,15 @@ const bindToProps = /* @__PURE__ */ __name((props, eventOptions, withPassiveOpti
|
|
|
129266
128802
|
props[handlerProp].push(handler);
|
|
129267
128803
|
}, "bindToProps");
|
|
129268
128804
|
function useRecognizers(handlers2, config = {}, gestureKey, nativeHandlers) {
|
|
129269
|
-
const
|
|
129270
|
-
|
|
129271
|
-
|
|
129272
|
-
React.useEffect(
|
|
128805
|
+
const ctrl2 = React.useMemo(() => new Controller(handlers2), []);
|
|
128806
|
+
ctrl2.applyHandlers(handlers2, nativeHandlers);
|
|
128807
|
+
ctrl2.applyConfig(config, gestureKey);
|
|
128808
|
+
React.useEffect(ctrl2.effect.bind(ctrl2));
|
|
129273
128809
|
React.useEffect(() => {
|
|
129274
|
-
return
|
|
128810
|
+
return ctrl2.clean.bind(ctrl2);
|
|
129275
128811
|
}, []);
|
|
129276
128812
|
if (config.target === void 0) {
|
|
129277
|
-
return
|
|
128813
|
+
return ctrl2.bind.bind(ctrl2);
|
|
129278
128814
|
}
|
|
129279
128815
|
return void 0;
|
|
129280
128816
|
}
|
|
@@ -129433,7 +128969,7 @@ const _UncontrolledSliderWithPlusMinusBtns = class _UncontrolledSliderWithPlusMi
|
|
|
129433
128969
|
return fn4({
|
|
129434
128970
|
value: valToPass,
|
|
129435
128971
|
changeValue: /* @__PURE__ */ __name((newVal2) => {
|
|
129436
|
-
const newnew = clamp$
|
|
128972
|
+
const newnew = clamp$4(newVal2, min2, max2);
|
|
129437
128973
|
this.setState({ value: newnew });
|
|
129438
128974
|
this.props.onChange && this.props.onChange(newnew);
|
|
129439
128975
|
this.props.onRelease && this.props.onRelease(newnew);
|
|
@@ -131963,7 +131499,7 @@ function Labels({
|
|
|
131963
131499
|
const radius = outerRadius;
|
|
131964
131500
|
const outerPointRadius = outerRadius - 20;
|
|
131965
131501
|
const fontWidth = labelSize2 * (textScalingFactor < 1 ? textScalingFactor : 1);
|
|
131966
|
-
const fontHeight = fontWidth * clamp$
|
|
131502
|
+
const fontHeight = fontWidth * clamp$4(fontHeightMultiplier, 1.5, 3.5);
|
|
131967
131503
|
const labelPoints = labels.map(function(label) {
|
|
131968
131504
|
const {
|
|
131969
131505
|
annotationCenterAngle: _annotationCenterAngle,
|
|
@@ -143156,7 +142692,7 @@ const _AlignmentTool = class _AlignmentTool extends React.Component {
|
|
|
143156
142692
|
seqsToAlign = addedSequencesToUse;
|
|
143157
142693
|
}
|
|
143158
142694
|
hideModal();
|
|
143159
|
-
const alignmentId =
|
|
142695
|
+
const alignmentId = nanoid();
|
|
143160
142696
|
createNewAlignment2({
|
|
143161
142697
|
id: alignmentId,
|
|
143162
142698
|
name: seqsToAlign[0].name + " Alignment"
|
|
@@ -143475,7 +143011,7 @@ const _MergeFeaturesDialog = class _MergeFeaturesDialog extends React.Component
|
|
|
143475
143011
|
}
|
|
143476
143012
|
upsertFeature2(
|
|
143477
143013
|
__spreadProps(__spreadValues({}, feat1), {
|
|
143478
|
-
id:
|
|
143014
|
+
id: nanoid(),
|
|
143479
143015
|
start: start2 - 1,
|
|
143480
143016
|
end: end2 - 1,
|
|
143481
143017
|
name: name2
|