star-horse-lowcode 2.7.38 → 2.7.39

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/dist/index.es.js CHANGED
@@ -4138,7 +4138,7 @@ const useNamespace = (block, namespaceOverrides) => {
4138
4138
  };
4139
4139
 
4140
4140
  /**
4141
- * @vue/shared v3.5.15
4141
+ * @vue/shared v3.5.16
4142
4142
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4143
4143
  * @license MIT
4144
4144
  **/
@@ -4156,7 +4156,7 @@ const isDate = (val) => toTypeString(val) === "[object Date]";
4156
4156
  const isFunction$3 = (val) => typeof val === "function";
4157
4157
  const isString$3 = (val) => typeof val === "string";
4158
4158
  const isObject$2 = (val) => val !== null && typeof val === "object";
4159
- const isPromise$2 = (val) => {
4159
+ const isPromise$1 = (val) => {
4160
4160
  return (isObject$2(val) || isFunction$3(val)) && isFunction$3(val.then) && isFunction$3(val.catch);
4161
4161
  };
4162
4162
  const objectToString$1 = Object.prototype.toString;
@@ -25072,7 +25072,7 @@ const _sfc_main$36 = /* @__PURE__ */ defineComponent({
25072
25072
  if (!value)
25073
25073
  return;
25074
25074
  const passed = props.beforeFilter(value);
25075
- if (isPromise$2(passed)) {
25075
+ if (isPromise$1(passed)) {
25076
25076
  passed.then(calculateSuggestions).catch(() => {
25077
25077
  });
25078
25078
  } else if (passed !== false) {
@@ -25506,13 +25506,13 @@ const useCollapse = (props, emit) => {
25506
25506
  }
25507
25507
  const shouldChange = beforeCollapse(name);
25508
25508
  const isPromiseOrBool = [
25509
- isPromise$2(shouldChange),
25509
+ isPromise$1(shouldChange),
25510
25510
  isBoolean(shouldChange)
25511
25511
  ].includes(true);
25512
25512
  if (!isPromiseOrBool) {
25513
25513
  throwError(SCOPE$3, "beforeCollapse must return type `Promise<boolean>` or `boolean`");
25514
25514
  }
25515
- if (isPromise$2(shouldChange)) {
25515
+ if (isPromise$1(shouldChange)) {
25516
25516
  shouldChange.then((result) => {
25517
25517
  if (result !== false) {
25518
25518
  handleChange(name);
@@ -42999,13 +42999,13 @@ const _sfc_main$2c = /* @__PURE__ */ defineComponent({
42999
42999
  }
43000
43000
  const shouldChange = beforeChange();
43001
43001
  const isPromiseOrBool = [
43002
- isPromise$2(shouldChange),
43002
+ isPromise$1(shouldChange),
43003
43003
  isBoolean(shouldChange)
43004
43004
  ].includes(true);
43005
43005
  if (!isPromiseOrBool) {
43006
43006
  throwError(COMPONENT_NAME$4, "beforeChange must return type `Promise<boolean>` or `boolean`");
43007
43007
  }
43008
- if (isPromise$2(shouldChange)) {
43008
+ if (isPromise$1(shouldChange)) {
43009
43009
  shouldChange.then((result) => {
43010
43010
  if (result) {
43011
43011
  handleChange();
@@ -46847,7 +46847,7 @@ const useScrollbar = () => {
46847
46847
  };
46848
46848
  };
46849
46849
 
46850
- var v$5=false,o$5,f$4,s$3,u$1,d$6,N$8,l$3,p$7,m$6,w$6,D$7,x$6,E$5,M$a,F$8;function a$3(){if(!v$5){v$5=true;var e=navigator.userAgent,n=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),i=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(x$6=/\b(iPhone|iP[ao]d)/.exec(e),E$5=/\b(iP[ao]d)/.exec(e),w$6=/Android/i.exec(e),M$a=/FBAN\/\w+;/i.exec(e),F$8=/Mobile/i.exec(e),D$7=!!/Win64/.exec(e),n){o$5=n[1]?parseFloat(n[1]):n[5]?parseFloat(n[5]):NaN,o$5&&document&&document.documentMode&&(o$5=document.documentMode);var r=/(?:Trident\/(\d+.\d+))/.exec(e);N$8=r?parseFloat(r[1])+4:o$5,f$4=n[2]?parseFloat(n[2]):NaN,s$3=n[3]?parseFloat(n[3]):NaN,u$1=n[4]?parseFloat(n[4]):NaN,u$1?(n=/(?:Chrome\/(\d+\.\d+))/.exec(e),d$6=n&&n[1]?parseFloat(n[1]):NaN):d$6=NaN;}else o$5=f$4=s$3=d$6=u$1=NaN;if(i){if(i[1]){var t=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);l$3=t?parseFloat(t[1].replace("_",".")):true;}else l$3=false;p$7=!!i[2],m$6=!!i[3];}else l$3=p$7=m$6=false;}}var _$8={ie:function(){return a$3()||o$5},ieCompatibilityMode:function(){return a$3()||N$8>o$5},ie64:function(){return _$8.ie()&&D$7},firefox:function(){return a$3()||f$4},opera:function(){return a$3()||s$3},webkit:function(){return a$3()||u$1},safari:function(){return _$8.webkit()},chrome:function(){return a$3()||d$6},windows:function(){return a$3()||p$7},osx:function(){return a$3()||l$3},linux:function(){return a$3()||m$6},iphone:function(){return a$3()||x$6},mobile:function(){return a$3()||x$6||E$5||w$6||F$8},nativeApp:function(){return a$3()||M$a},android:function(){return a$3()||w$6},ipad:function(){return a$3()||E$5}},A$6=_$8;var c$2=!!(typeof window<"u"&&window.document&&window.document.createElement),U$9={canUseDOM:c$2},h$2=U$9;var X$5;h$2.canUseDOM&&(X$5=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==true);function S$8(e,n){if(!h$2.canUseDOM||n&&!("addEventListener"in document))return false;var i="on"+e,r=i in document;if(!r){var t=document.createElement("div");t.setAttribute(i,"return;"),r=typeof t[i]=="function";}return !r&&X$5&&e==="wheel"&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var b$3=S$8;var O$8=10,I$7=40,P$d=800;function T$8(e){var n=0,i=0,r=0,t=0;return "detail"in e&&(i=e.detail),"wheelDelta"in e&&(i=-e.wheelDelta/120),"wheelDeltaY"in e&&(i=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(n=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(n=i,i=0),r=n*O$8,t=i*O$8,"deltaY"in e&&(t=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||t)&&e.deltaMode&&(e.deltaMode==1?(r*=I$7,t*=I$7):(r*=P$d,t*=P$d)),r&&!n&&(n=r<1?-1:1),t&&!i&&(i=t<1?-1:1),{spinX:n,spinY:i,pixelX:r,pixelY:t}}T$8.getEventType=function(){return A$6.firefox()?"DOMMouseScroll":b$3("wheel")?"wheel":"mousewheel"};var Y$5=T$8;/**
46850
+ var v$4=false,o$5,f$4,s$3,u$1,d$6,N$8,l$3,p$7,m$6,w$6,D$7,x$6,E$5,M$9,F$8;function a$3(){if(!v$4){v$4=true;var e=navigator.userAgent,n=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),i=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(x$6=/\b(iPhone|iP[ao]d)/.exec(e),E$5=/\b(iP[ao]d)/.exec(e),w$6=/Android/i.exec(e),M$9=/FBAN\/\w+;/i.exec(e),F$8=/Mobile/i.exec(e),D$7=!!/Win64/.exec(e),n){o$5=n[1]?parseFloat(n[1]):n[5]?parseFloat(n[5]):NaN,o$5&&document&&document.documentMode&&(o$5=document.documentMode);var r=/(?:Trident\/(\d+.\d+))/.exec(e);N$8=r?parseFloat(r[1])+4:o$5,f$4=n[2]?parseFloat(n[2]):NaN,s$3=n[3]?parseFloat(n[3]):NaN,u$1=n[4]?parseFloat(n[4]):NaN,u$1?(n=/(?:Chrome\/(\d+\.\d+))/.exec(e),d$6=n&&n[1]?parseFloat(n[1]):NaN):d$6=NaN;}else o$5=f$4=s$3=d$6=u$1=NaN;if(i){if(i[1]){var t=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);l$3=t?parseFloat(t[1].replace("_",".")):true;}else l$3=false;p$7=!!i[2],m$6=!!i[3];}else l$3=p$7=m$6=false;}}var _$8={ie:function(){return a$3()||o$5},ieCompatibilityMode:function(){return a$3()||N$8>o$5},ie64:function(){return _$8.ie()&&D$7},firefox:function(){return a$3()||f$4},opera:function(){return a$3()||s$3},webkit:function(){return a$3()||u$1},safari:function(){return _$8.webkit()},chrome:function(){return a$3()||d$6},windows:function(){return a$3()||p$7},osx:function(){return a$3()||l$3},linux:function(){return a$3()||m$6},iphone:function(){return a$3()||x$6},mobile:function(){return a$3()||x$6||E$5||w$6||F$8},nativeApp:function(){return a$3()||M$9},android:function(){return a$3()||w$6},ipad:function(){return a$3()||E$5}},A$6=_$8;var c$2=!!(typeof window<"u"&&window.document&&window.document.createElement),U$9={canUseDOM:c$2},h$2=U$9;var X$5;h$2.canUseDOM&&(X$5=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==true);function S$8(e,n){if(!h$2.canUseDOM||n&&!("addEventListener"in document))return false;var i="on"+e,r=i in document;if(!r){var t=document.createElement("div");t.setAttribute(i,"return;"),r=typeof t[i]=="function";}return !r&&X$5&&e==="wheel"&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var b$3=S$8;var O$8=10,I$7=40,P$d=800;function T$8(e){var n=0,i=0,r=0,t=0;return "detail"in e&&(i=e.detail),"wheelDelta"in e&&(i=-e.wheelDelta/120),"wheelDeltaY"in e&&(i=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(n=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(n=i,i=0),r=n*O$8,t=i*O$8,"deltaY"in e&&(t=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||t)&&e.deltaMode&&(e.deltaMode==1?(r*=I$7,t*=I$7):(r*=P$d,t*=P$d)),r&&!n&&(n=r<1?-1:1),t&&!i&&(i=t<1?-1:1),{spinX:n,spinY:i,pixelX:r,pixelY:t}}T$8.getEventType=function(){return A$6.firefox()?"DOMMouseScroll":b$3("wheel")?"wheel":"mousewheel"};var Y$5=T$8;/**
46851
46851
  * Checks if an event is supported in the current execution environment.
46852
46852
  *
46853
46853
  * NOTE: This will not work correctly for non-generic events such as `change`,
@@ -54606,7 +54606,7 @@ const withInstall = (t, fn) => {
54606
54606
  t.install = fn;
54607
54607
  return t;
54608
54608
  };
54609
- var index$3 = withInstall(message$3, function(app, options = {}) {
54609
+ var index$2 = withInstall(message$3, function(app, options = {}) {
54610
54610
  message$3._context = app._context;
54611
54611
  app.config.globalProperties["$" + (options.name || "mmessage")] = message$3;
54612
54612
  if (options.defaultOptions) {
@@ -54628,7 +54628,7 @@ const operationConfirm = (msg) => {
54628
54628
  });
54629
54629
  };
54630
54630
  const message$2 = (msg, type = "info", duration = 2e3, title = "提示", position = "top-right") => {
54631
- index$3({
54631
+ index$2({
54632
54632
  message: msg,
54633
54633
  type: type ?? "info",
54634
54634
  duration,
@@ -54711,3272 +54711,6 @@ const useUserInfoStore = defineStore(
54711
54711
  }
54712
54712
  );
54713
54713
 
54714
- /******************************************************************************
54715
- Copyright (c) Microsoft Corporation.
54716
-
54717
- Permission to use, copy, modify, and/or distribute this software for any
54718
- purpose with or without fee is hereby granted.
54719
-
54720
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
54721
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
54722
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
54723
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
54724
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
54725
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
54726
- PERFORMANCE OF THIS SOFTWARE.
54727
- ***************************************************************************** */
54728
- /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
54729
-
54730
-
54731
- var __assign$1 = function() {
54732
- __assign$1 = Object.assign || function __assign(t) {
54733
- for (var s, i = 1, n = arguments.length; i < n; i++) {
54734
- s = arguments[i];
54735
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
54736
- }
54737
- return t;
54738
- };
54739
- return __assign$1.apply(this, arguments);
54740
- };
54741
-
54742
- function __awaiter(thisArg, _arguments, P, generator) {
54743
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
54744
- return new (P || (P = Promise))(function (resolve, reject) {
54745
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
54746
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
54747
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
54748
- step((generator = generator.apply(thisArg, _arguments || [])).next());
54749
- });
54750
- }
54751
-
54752
- function __generator(thisArg, body) {
54753
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
54754
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
54755
- function verb(n) { return function (v) { return step([n, v]); }; }
54756
- function step(op) {
54757
- if (f) throw new TypeError("Generator is already executing.");
54758
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
54759
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
54760
- if (y = 0, t) op = [op[0] & 2, t.value];
54761
- switch (op[0]) {
54762
- case 0: case 1: t = op; break;
54763
- case 4: _.label++; return { value: op[1], done: false };
54764
- case 5: _.label++; y = op[1]; op = [0]; continue;
54765
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
54766
- default:
54767
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
54768
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
54769
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
54770
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
54771
- if (t[2]) _.ops.pop();
54772
- _.trys.pop(); continue;
54773
- }
54774
- op = body.call(thisArg, _);
54775
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
54776
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
54777
- }
54778
- }
54779
-
54780
- function __spreadArray(to, from, pack) {
54781
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
54782
- if (ar || !(i in from)) {
54783
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
54784
- ar[i] = from[i];
54785
- }
54786
- }
54787
- return to.concat(ar || Array.prototype.slice.call(from));
54788
- }
54789
-
54790
- typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
54791
- var e = new Error(message);
54792
- return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
54793
- };
54794
-
54795
- /**
54796
- * FingerprintJS v4.6.2 - Copyright (c) FingerprintJS, Inc, 2025 (https://fingerprint.com)
54797
- *
54798
- * Licensed under Business Source License 1.1 https://mariadb.com/bsl11/
54799
- * Licensor: FingerprintJS, Inc.
54800
- * Licensed Work: FingerprintJS browser fingerprinting library
54801
- * Additional Use Grant: None
54802
- * Change Date: Four years from first release for the specific version.
54803
- * Change License: MIT, text at https://opensource.org/license/mit/ with the following copyright notice:
54804
- * Copyright 2015-present FingerprintJS, Inc.
54805
- */
54806
-
54807
-
54808
- var version$1 = "4.6.2";
54809
-
54810
- function wait(durationMs, resolveWith) {
54811
- return new Promise(function (resolve) { return setTimeout(resolve, durationMs, resolveWith); });
54812
- }
54813
- /**
54814
- * Allows asynchronous actions and microtasks to happen.
54815
- */
54816
- function releaseEventLoop() {
54817
- // Don't use setTimeout because Chrome throttles it in some cases causing very long agent execution:
54818
- // https://stackoverflow.com/a/6032591/1118709
54819
- // https://github.com/chromium/chromium/commit/0295dd09496330f3a9103ef7e543fa9b6050409b
54820
- // Reusing a MessageChannel object gives no noticeable benefits
54821
- return new Promise(function (resolve) {
54822
- var channel = new MessageChannel();
54823
- channel.port1.onmessage = function () { return resolve(); };
54824
- channel.port2.postMessage(null);
54825
- });
54826
- }
54827
- function requestIdleCallbackIfAvailable(fallbackTimeout, deadlineTimeout) {
54828
- if (deadlineTimeout === void 0) { deadlineTimeout = Infinity; }
54829
- var requestIdleCallback = window.requestIdleCallback;
54830
- if (requestIdleCallback) {
54831
- // The function `requestIdleCallback` loses the binding to `window` here.
54832
- // `globalThis` isn't always equal `window` (see https://github.com/fingerprintjs/fingerprintjs/issues/683).
54833
- // Therefore, an error can occur. `call(window,` prevents the error.
54834
- return new Promise(function (resolve) { return requestIdleCallback.call(window, function () { return resolve(); }, { timeout: deadlineTimeout }); });
54835
- }
54836
- else {
54837
- return wait(Math.min(fallbackTimeout, deadlineTimeout));
54838
- }
54839
- }
54840
- function isPromise$1(value) {
54841
- return !!value && typeof value.then === 'function';
54842
- }
54843
- /**
54844
- * Calls a maybe asynchronous function without creating microtasks when the function is synchronous.
54845
- * Catches errors in both cases.
54846
- *
54847
- * If just you run a code like this:
54848
- * ```
54849
- * console.time('Action duration')
54850
- * await action()
54851
- * console.timeEnd('Action duration')
54852
- * ```
54853
- * The synchronous function time can be measured incorrectly because another microtask may run before the `await`
54854
- * returns the control back to the code.
54855
- */
54856
- function awaitIfAsync(action, callback) {
54857
- try {
54858
- var returnedValue = action();
54859
- if (isPromise$1(returnedValue)) {
54860
- returnedValue.then(function (result) { return callback(true, result); }, function (error) { return callback(false, error); });
54861
- }
54862
- else {
54863
- callback(true, returnedValue);
54864
- }
54865
- }
54866
- catch (error) {
54867
- callback(false, error);
54868
- }
54869
- }
54870
- /**
54871
- * If you run many synchronous tasks without using this function, the JS main loop will be busy and asynchronous tasks
54872
- * (e.g. completing a network request, rendering the page) won't be able to happen.
54873
- * This function allows running many synchronous tasks such way that asynchronous tasks can run too in background.
54874
- */
54875
- function mapWithBreaks(items, callback, loopReleaseInterval) {
54876
- if (loopReleaseInterval === void 0) { loopReleaseInterval = 16; }
54877
- return __awaiter(this, void 0, void 0, function () {
54878
- var results, lastLoopReleaseTime, i, now;
54879
- return __generator(this, function (_a) {
54880
- switch (_a.label) {
54881
- case 0:
54882
- results = Array(items.length);
54883
- lastLoopReleaseTime = Date.now();
54884
- i = 0;
54885
- _a.label = 1;
54886
- case 1:
54887
- if (!(i < items.length)) return [3 /*break*/, 4];
54888
- results[i] = callback(items[i], i);
54889
- now = Date.now();
54890
- if (!(now >= lastLoopReleaseTime + loopReleaseInterval)) return [3 /*break*/, 3];
54891
- lastLoopReleaseTime = now;
54892
- return [4 /*yield*/, releaseEventLoop()];
54893
- case 2:
54894
- _a.sent();
54895
- _a.label = 3;
54896
- case 3:
54897
- ++i;
54898
- return [3 /*break*/, 1];
54899
- case 4: return [2 /*return*/, results];
54900
- }
54901
- });
54902
- });
54903
- }
54904
- /**
54905
- * Makes the given promise never emit an unhandled promise rejection console warning.
54906
- * The promise will still pass errors to the next promises.
54907
- * Returns the input promise for convenience.
54908
- *
54909
- * Otherwise, promise emits a console warning unless it has a `catch` listener.
54910
- */
54911
- function suppressUnhandledRejectionWarning(promise) {
54912
- promise.then(undefined, function () { return undefined; });
54913
- return promise;
54914
- }
54915
-
54916
- /*
54917
- * This file contains functions to work with pure data only (no browser features, DOM, side effects, etc).
54918
- */
54919
- /**
54920
- * Does the same as Array.prototype.includes but has better typing
54921
- */
54922
- function includes(haystack, needle) {
54923
- for (var i = 0, l = haystack.length; i < l; ++i) {
54924
- if (haystack[i] === needle) {
54925
- return true;
54926
- }
54927
- }
54928
- return false;
54929
- }
54930
- /**
54931
- * Like `!includes()` but with proper typing
54932
- */
54933
- function excludes(haystack, needle) {
54934
- return !includes(haystack, needle);
54935
- }
54936
- /**
54937
- * Be careful, NaN can return
54938
- */
54939
- function toInt(value) {
54940
- return parseInt(value);
54941
- }
54942
- /**
54943
- * Be careful, NaN can return
54944
- */
54945
- function toFloat(value) {
54946
- return parseFloat(value);
54947
- }
54948
- function replaceNaN(value, replacement) {
54949
- return typeof value === 'number' && isNaN(value) ? replacement : value;
54950
- }
54951
- function countTruthy(values) {
54952
- return values.reduce(function (sum, value) { return sum + (value ? 1 : 0); }, 0);
54953
- }
54954
- function round(value, base) {
54955
- if (base === void 0) { base = 1; }
54956
- if (Math.abs(base) >= 1) {
54957
- return Math.round(value / base) * base;
54958
- }
54959
- else {
54960
- // Sometimes when a number is multiplied by a small number, precision is lost,
54961
- // for example 1234 * 0.0001 === 0.12340000000000001, and it's more precise divide: 1234 / (1 / 0.0001) === 0.1234.
54962
- var counterBase = 1 / base;
54963
- return Math.round(value * counterBase) / counterBase;
54964
- }
54965
- }
54966
- /**
54967
- * Parses a CSS selector into tag name with HTML attributes.
54968
- * Only single element selector are supported (without operators like space, +, >, etc).
54969
- *
54970
- * Multiple values can be returned for each attribute. You decide how to handle them.
54971
- */
54972
- function parseSimpleCssSelector(selector) {
54973
- var _a, _b;
54974
- var errorMessage = "Unexpected syntax '".concat(selector, "'");
54975
- var tagMatch = /^\s*([a-z-]*)(.*)$/i.exec(selector);
54976
- var tag = tagMatch[1] || undefined;
54977
- var attributes = {};
54978
- var partsRegex = /([.:#][\w-]+|\[.+?\])/gi;
54979
- var addAttribute = function (name, value) {
54980
- attributes[name] = attributes[name] || [];
54981
- attributes[name].push(value);
54982
- };
54983
- for (;;) {
54984
- var match = partsRegex.exec(tagMatch[2]);
54985
- if (!match) {
54986
- break;
54987
- }
54988
- var part = match[0];
54989
- switch (part[0]) {
54990
- case '.':
54991
- addAttribute('class', part.slice(1));
54992
- break;
54993
- case '#':
54994
- addAttribute('id', part.slice(1));
54995
- break;
54996
- case '[': {
54997
- var attributeMatch = /^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(part);
54998
- if (attributeMatch) {
54999
- addAttribute(attributeMatch[1], (_b = (_a = attributeMatch[4]) !== null && _a !== void 0 ? _a : attributeMatch[5]) !== null && _b !== void 0 ? _b : '');
55000
- }
55001
- else {
55002
- throw new Error(errorMessage);
55003
- }
55004
- break;
55005
- }
55006
- default:
55007
- throw new Error(errorMessage);
55008
- }
55009
- }
55010
- return [tag, attributes];
55011
- }
55012
- /**
55013
- * Converts a string to UTF8 bytes
55014
- */
55015
- function getUTF8Bytes(input) {
55016
- // Benchmark: https://jsbench.me/b6klaaxgwq/1
55017
- // If you want to just count bytes, see solutions at https://jsbench.me/ehklab415e/1
55018
- var result = new Uint8Array(input.length);
55019
- for (var i = 0; i < input.length; i++) {
55020
- // `charCode` is faster than encoding, so we prefer that when it's possible
55021
- var charCode = input.charCodeAt(i);
55022
- // In case of non-ASCII symbols we use proper encoding
55023
- if (charCode > 127) {
55024
- return new TextEncoder().encode(input);
55025
- }
55026
- result[i] = charCode;
55027
- }
55028
- return result;
55029
- }
55030
-
55031
- /*
55032
- * Based on https://github.com/karanlyons/murmurHash3.js/blob/a33d0723127e2e5415056c455f8aed2451ace208/murmurHash3.js
55033
- */
55034
- /**
55035
- * Adds two 64-bit values (provided as tuples of 32-bit values)
55036
- * and updates (mutates) first value to write the result
55037
- */
55038
- function x64Add(m, n) {
55039
- var m0 = m[0] >>> 16, m1 = m[0] & 0xffff, m2 = m[1] >>> 16, m3 = m[1] & 0xffff;
55040
- var n0 = n[0] >>> 16, n1 = n[0] & 0xffff, n2 = n[1] >>> 16, n3 = n[1] & 0xffff;
55041
- var o0 = 0, o1 = 0, o2 = 0, o3 = 0;
55042
- o3 += m3 + n3;
55043
- o2 += o3 >>> 16;
55044
- o3 &= 0xffff;
55045
- o2 += m2 + n2;
55046
- o1 += o2 >>> 16;
55047
- o2 &= 0xffff;
55048
- o1 += m1 + n1;
55049
- o0 += o1 >>> 16;
55050
- o1 &= 0xffff;
55051
- o0 += m0 + n0;
55052
- o0 &= 0xffff;
55053
- m[0] = (o0 << 16) | o1;
55054
- m[1] = (o2 << 16) | o3;
55055
- }
55056
- /**
55057
- * Multiplies two 64-bit values (provided as tuples of 32-bit values)
55058
- * and updates (mutates) first value to write the result
55059
- */
55060
- function x64Multiply(m, n) {
55061
- var m0 = m[0] >>> 16, m1 = m[0] & 0xffff, m2 = m[1] >>> 16, m3 = m[1] & 0xffff;
55062
- var n0 = n[0] >>> 16, n1 = n[0] & 0xffff, n2 = n[1] >>> 16, n3 = n[1] & 0xffff;
55063
- var o0 = 0, o1 = 0, o2 = 0, o3 = 0;
55064
- o3 += m3 * n3;
55065
- o2 += o3 >>> 16;
55066
- o3 &= 0xffff;
55067
- o2 += m2 * n3;
55068
- o1 += o2 >>> 16;
55069
- o2 &= 0xffff;
55070
- o2 += m3 * n2;
55071
- o1 += o2 >>> 16;
55072
- o2 &= 0xffff;
55073
- o1 += m1 * n3;
55074
- o0 += o1 >>> 16;
55075
- o1 &= 0xffff;
55076
- o1 += m2 * n2;
55077
- o0 += o1 >>> 16;
55078
- o1 &= 0xffff;
55079
- o1 += m3 * n1;
55080
- o0 += o1 >>> 16;
55081
- o1 &= 0xffff;
55082
- o0 += m0 * n3 + m1 * n2 + m2 * n1 + m3 * n0;
55083
- o0 &= 0xffff;
55084
- m[0] = (o0 << 16) | o1;
55085
- m[1] = (o2 << 16) | o3;
55086
- }
55087
- /**
55088
- * Provides left rotation of the given int64 value (provided as tuple of two int32)
55089
- * by given number of bits. Result is written back to the value
55090
- */
55091
- function x64Rotl(m, bits) {
55092
- var m0 = m[0];
55093
- bits %= 64;
55094
- if (bits === 32) {
55095
- m[0] = m[1];
55096
- m[1] = m0;
55097
- }
55098
- else if (bits < 32) {
55099
- m[0] = (m0 << bits) | (m[1] >>> (32 - bits));
55100
- m[1] = (m[1] << bits) | (m0 >>> (32 - bits));
55101
- }
55102
- else {
55103
- bits -= 32;
55104
- m[0] = (m[1] << bits) | (m0 >>> (32 - bits));
55105
- m[1] = (m0 << bits) | (m[1] >>> (32 - bits));
55106
- }
55107
- }
55108
- /**
55109
- * Provides a left shift of the given int32 value (provided as tuple of [0, int32])
55110
- * by given number of bits. Result is written back to the value
55111
- */
55112
- function x64LeftShift(m, bits) {
55113
- bits %= 64;
55114
- if (bits === 0) {
55115
- return;
55116
- }
55117
- else if (bits < 32) {
55118
- m[0] = m[1] >>> (32 - bits);
55119
- m[1] = m[1] << bits;
55120
- }
55121
- else {
55122
- m[0] = m[1] << (bits - 32);
55123
- m[1] = 0;
55124
- }
55125
- }
55126
- /**
55127
- * Provides a XOR of the given int64 values(provided as tuple of two int32).
55128
- * Result is written back to the first value
55129
- */
55130
- function x64Xor(m, n) {
55131
- m[0] ^= n[0];
55132
- m[1] ^= n[1];
55133
- }
55134
- var F1$2 = [0xff51afd7, 0xed558ccd];
55135
- var F2$1 = [0xc4ceb9fe, 0x1a85ec53];
55136
- /**
55137
- * Calculates murmurHash3's final x64 mix of that block and writes result back to the input value.
55138
- * (`[0, h[0] >>> 1]` is a 33 bit unsigned right shift. This is the
55139
- * only place where we need to right shift 64bit ints.)
55140
- */
55141
- function x64Fmix(h) {
55142
- var shifted = [0, h[0] >>> 1];
55143
- x64Xor(h, shifted);
55144
- x64Multiply(h, F1$2);
55145
- shifted[1] = h[0] >>> 1;
55146
- x64Xor(h, shifted);
55147
- x64Multiply(h, F2$1);
55148
- shifted[1] = h[0] >>> 1;
55149
- x64Xor(h, shifted);
55150
- }
55151
- var C1$2 = [0x87c37b91, 0x114253d5];
55152
- var C2$1 = [0x4cf5ad43, 0x2745937f];
55153
- var M$1$1 = [0, 5];
55154
- var N1$2 = [0, 0x52dce729];
55155
- var N2$1 = [0, 0x38495ab5];
55156
- /**
55157
- * Given a string and an optional seed as an int, returns a 128 bit
55158
- * hash using the x64 flavor of MurmurHash3, as an unsigned hex.
55159
- * All internal functions mutates passed value to achieve minimal memory allocations and GC load
55160
- *
55161
- * Benchmark https://jsbench.me/p4lkpaoabi/1
55162
- */
55163
- function x64hash128(input, seed) {
55164
- var key = getUTF8Bytes(input);
55165
- seed = seed || 0;
55166
- var length = [0, key.length];
55167
- var remainder = length[1] % 16;
55168
- var bytes = length[1] - remainder;
55169
- var h1 = [0, seed];
55170
- var h2 = [0, seed];
55171
- var k1 = [0, 0];
55172
- var k2 = [0, 0];
55173
- var i;
55174
- for (i = 0; i < bytes; i = i + 16) {
55175
- k1[0] = key[i + 4] | (key[i + 5] << 8) | (key[i + 6] << 16) | (key[i + 7] << 24);
55176
- k1[1] = key[i] | (key[i + 1] << 8) | (key[i + 2] << 16) | (key[i + 3] << 24);
55177
- k2[0] = key[i + 12] | (key[i + 13] << 8) | (key[i + 14] << 16) | (key[i + 15] << 24);
55178
- k2[1] = key[i + 8] | (key[i + 9] << 8) | (key[i + 10] << 16) | (key[i + 11] << 24);
55179
- x64Multiply(k1, C1$2);
55180
- x64Rotl(k1, 31);
55181
- x64Multiply(k1, C2$1);
55182
- x64Xor(h1, k1);
55183
- x64Rotl(h1, 27);
55184
- x64Add(h1, h2);
55185
- x64Multiply(h1, M$1$1);
55186
- x64Add(h1, N1$2);
55187
- x64Multiply(k2, C2$1);
55188
- x64Rotl(k2, 33);
55189
- x64Multiply(k2, C1$2);
55190
- x64Xor(h2, k2);
55191
- x64Rotl(h2, 31);
55192
- x64Add(h2, h1);
55193
- x64Multiply(h2, M$1$1);
55194
- x64Add(h2, N2$1);
55195
- }
55196
- k1[0] = 0;
55197
- k1[1] = 0;
55198
- k2[0] = 0;
55199
- k2[1] = 0;
55200
- var val = [0, 0];
55201
- switch (remainder) {
55202
- case 15:
55203
- val[1] = key[i + 14];
55204
- x64LeftShift(val, 48);
55205
- x64Xor(k2, val);
55206
- // fallthrough
55207
- case 14:
55208
- val[1] = key[i + 13];
55209
- x64LeftShift(val, 40);
55210
- x64Xor(k2, val);
55211
- // fallthrough
55212
- case 13:
55213
- val[1] = key[i + 12];
55214
- x64LeftShift(val, 32);
55215
- x64Xor(k2, val);
55216
- // fallthrough
55217
- case 12:
55218
- val[1] = key[i + 11];
55219
- x64LeftShift(val, 24);
55220
- x64Xor(k2, val);
55221
- // fallthrough
55222
- case 11:
55223
- val[1] = key[i + 10];
55224
- x64LeftShift(val, 16);
55225
- x64Xor(k2, val);
55226
- // fallthrough
55227
- case 10:
55228
- val[1] = key[i + 9];
55229
- x64LeftShift(val, 8);
55230
- x64Xor(k2, val);
55231
- // fallthrough
55232
- case 9:
55233
- val[1] = key[i + 8];
55234
- x64Xor(k2, val);
55235
- x64Multiply(k2, C2$1);
55236
- x64Rotl(k2, 33);
55237
- x64Multiply(k2, C1$2);
55238
- x64Xor(h2, k2);
55239
- // fallthrough
55240
- case 8:
55241
- val[1] = key[i + 7];
55242
- x64LeftShift(val, 56);
55243
- x64Xor(k1, val);
55244
- // fallthrough
55245
- case 7:
55246
- val[1] = key[i + 6];
55247
- x64LeftShift(val, 48);
55248
- x64Xor(k1, val);
55249
- // fallthrough
55250
- case 6:
55251
- val[1] = key[i + 5];
55252
- x64LeftShift(val, 40);
55253
- x64Xor(k1, val);
55254
- // fallthrough
55255
- case 5:
55256
- val[1] = key[i + 4];
55257
- x64LeftShift(val, 32);
55258
- x64Xor(k1, val);
55259
- // fallthrough
55260
- case 4:
55261
- val[1] = key[i + 3];
55262
- x64LeftShift(val, 24);
55263
- x64Xor(k1, val);
55264
- // fallthrough
55265
- case 3:
55266
- val[1] = key[i + 2];
55267
- x64LeftShift(val, 16);
55268
- x64Xor(k1, val);
55269
- // fallthrough
55270
- case 2:
55271
- val[1] = key[i + 1];
55272
- x64LeftShift(val, 8);
55273
- x64Xor(k1, val);
55274
- // fallthrough
55275
- case 1:
55276
- val[1] = key[i];
55277
- x64Xor(k1, val);
55278
- x64Multiply(k1, C1$2);
55279
- x64Rotl(k1, 31);
55280
- x64Multiply(k1, C2$1);
55281
- x64Xor(h1, k1);
55282
- // fallthrough
55283
- }
55284
- x64Xor(h1, length);
55285
- x64Xor(h2, length);
55286
- x64Add(h1, h2);
55287
- x64Add(h2, h1);
55288
- x64Fmix(h1);
55289
- x64Fmix(h2);
55290
- x64Add(h1, h2);
55291
- x64Add(h2, h1);
55292
- return (('00000000' + (h1[0] >>> 0).toString(16)).slice(-8) +
55293
- ('00000000' + (h1[1] >>> 0).toString(16)).slice(-8) +
55294
- ('00000000' + (h2[0] >>> 0).toString(16)).slice(-8) +
55295
- ('00000000' + (h2[1] >>> 0).toString(16)).slice(-8));
55296
- }
55297
-
55298
- /**
55299
- * Converts an error object to a plain object that can be used with `JSON.stringify`.
55300
- * If you just run `JSON.stringify(error)`, you'll get `'{}'`.
55301
- */
55302
- function errorToObject(error) {
55303
- var _a;
55304
- return __assign$1({ name: error.name, message: error.message, stack: (_a = error.stack) === null || _a === void 0 ? void 0 : _a.split('\n') }, error);
55305
- }
55306
- function isFunctionNative(func) {
55307
- return /^function\s.*?\{\s*\[native code]\s*}$/.test(String(func));
55308
- }
55309
-
55310
- function isFinalResultLoaded(loadResult) {
55311
- return typeof loadResult !== 'function';
55312
- }
55313
- /**
55314
- * Loads the given entropy source. Returns a function that gets an entropy component from the source.
55315
- *
55316
- * The result is returned synchronously to prevent `loadSources` from
55317
- * waiting for one source to load before getting the components from the other sources.
55318
- */
55319
- function loadSource(source, sourceOptions) {
55320
- var sourceLoadPromise = suppressUnhandledRejectionWarning(new Promise(function (resolveLoad) {
55321
- var loadStartTime = Date.now();
55322
- // `awaitIfAsync` is used instead of just `await` in order to measure the duration of synchronous sources
55323
- // correctly (other microtasks won't affect the duration).
55324
- awaitIfAsync(source.bind(null, sourceOptions), function () {
55325
- var loadArgs = [];
55326
- for (var _i = 0; _i < arguments.length; _i++) {
55327
- loadArgs[_i] = arguments[_i];
55328
- }
55329
- var loadDuration = Date.now() - loadStartTime;
55330
- // Source loading failed
55331
- if (!loadArgs[0]) {
55332
- return resolveLoad(function () { return ({ error: loadArgs[1], duration: loadDuration }); });
55333
- }
55334
- var loadResult = loadArgs[1];
55335
- // Source loaded with the final result
55336
- if (isFinalResultLoaded(loadResult)) {
55337
- return resolveLoad(function () { return ({ value: loadResult, duration: loadDuration }); });
55338
- }
55339
- // Source loaded with "get" stage
55340
- resolveLoad(function () {
55341
- return new Promise(function (resolveGet) {
55342
- var getStartTime = Date.now();
55343
- awaitIfAsync(loadResult, function () {
55344
- var getArgs = [];
55345
- for (var _i = 0; _i < arguments.length; _i++) {
55346
- getArgs[_i] = arguments[_i];
55347
- }
55348
- var duration = loadDuration + Date.now() - getStartTime;
55349
- // Source getting failed
55350
- if (!getArgs[0]) {
55351
- return resolveGet({ error: getArgs[1], duration: duration });
55352
- }
55353
- // Source getting succeeded
55354
- resolveGet({ value: getArgs[1], duration: duration });
55355
- });
55356
- });
55357
- });
55358
- });
55359
- }));
55360
- return function getComponent() {
55361
- return sourceLoadPromise.then(function (finalizeSource) { return finalizeSource(); });
55362
- };
55363
- }
55364
- /**
55365
- * Loads the given entropy sources. Returns a function that collects the entropy components.
55366
- *
55367
- * The result is returned synchronously in order to allow start getting the components
55368
- * before the sources are loaded completely.
55369
- *
55370
- * Warning for package users:
55371
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
55372
- */
55373
- function loadSources(sources, sourceOptions, excludeSources, loopReleaseInterval) {
55374
- var includedSources = Object.keys(sources).filter(function (sourceKey) { return excludes(excludeSources, sourceKey); });
55375
- // Using `mapWithBreaks` allows asynchronous sources to complete between synchronous sources
55376
- // and measure the duration correctly
55377
- var sourceGettersPromise = suppressUnhandledRejectionWarning(mapWithBreaks(includedSources, function (sourceKey) { return loadSource(sources[sourceKey], sourceOptions); }, loopReleaseInterval));
55378
- return function getComponents() {
55379
- return __awaiter(this, void 0, void 0, function () {
55380
- var sourceGetters, componentPromises, componentArray, components, index;
55381
- return __generator(this, function (_a) {
55382
- switch (_a.label) {
55383
- case 0: return [4 /*yield*/, sourceGettersPromise];
55384
- case 1:
55385
- sourceGetters = _a.sent();
55386
- return [4 /*yield*/, mapWithBreaks(sourceGetters, function (sourceGetter) { return suppressUnhandledRejectionWarning(sourceGetter()); }, loopReleaseInterval)];
55387
- case 2:
55388
- componentPromises = _a.sent();
55389
- return [4 /*yield*/, Promise.all(componentPromises)
55390
- // Keeping the component keys order the same as the source keys order
55391
- ];
55392
- case 3:
55393
- componentArray = _a.sent();
55394
- components = {};
55395
- for (index = 0; index < includedSources.length; ++index) {
55396
- components[includedSources[index]] = componentArray[index];
55397
- }
55398
- return [2 /*return*/, components];
55399
- }
55400
- });
55401
- });
55402
- };
55403
- }
55404
-
55405
- /*
55406
- * Functions to help with features that vary through browsers
55407
- */
55408
- /**
55409
- * Checks whether the browser is based on Trident (the Internet Explorer engine) without using user-agent.
55410
- *
55411
- * Warning for package users:
55412
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
55413
- */
55414
- function isTrident() {
55415
- var w = window;
55416
- var n = navigator;
55417
- // The properties are checked to be in IE 10, IE 11 and not to be in other browsers in October 2020
55418
- return (countTruthy([
55419
- 'MSCSSMatrix' in w,
55420
- 'msSetImmediate' in w,
55421
- 'msIndexedDB' in w,
55422
- 'msMaxTouchPoints' in n,
55423
- 'msPointerEnabled' in n,
55424
- ]) >= 4);
55425
- }
55426
- /**
55427
- * Checks whether the browser is based on EdgeHTML (the pre-Chromium Edge engine) without using user-agent.
55428
- *
55429
- * Warning for package users:
55430
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
55431
- */
55432
- function isEdgeHTML() {
55433
- // Based on research in October 2020
55434
- var w = window;
55435
- var n = navigator;
55436
- return (countTruthy(['msWriteProfilerMark' in w, 'MSStream' in w, 'msLaunchUri' in n, 'msSaveBlob' in n]) >= 3 &&
55437
- !isTrident());
55438
- }
55439
- /**
55440
- * Checks whether the browser is based on Chromium without using user-agent.
55441
- *
55442
- * Warning for package users:
55443
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
55444
- */
55445
- function isChromium() {
55446
- // Based on research in October 2020. Tested to detect Chromium 42-86.
55447
- var w = window;
55448
- var n = navigator;
55449
- return (countTruthy([
55450
- 'webkitPersistentStorage' in n,
55451
- 'webkitTemporaryStorage' in n,
55452
- (n.vendor || '').indexOf('Google') === 0,
55453
- 'webkitResolveLocalFileSystemURL' in w,
55454
- 'BatteryManager' in w,
55455
- 'webkitMediaStream' in w,
55456
- 'webkitSpeechGrammar' in w,
55457
- ]) >= 5);
55458
- }
55459
- /**
55460
- * Checks whether the browser is based on mobile or desktop Safari without using user-agent.
55461
- * All iOS browsers use WebKit (the Safari engine).
55462
- *
55463
- * Warning for package users:
55464
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
55465
- */
55466
- function isWebKit() {
55467
- // Based on research in August 2024
55468
- var w = window;
55469
- var n = navigator;
55470
- return (countTruthy([
55471
- 'ApplePayError' in w,
55472
- 'CSSPrimitiveValue' in w,
55473
- 'Counter' in w,
55474
- n.vendor.indexOf('Apple') === 0,
55475
- 'RGBColor' in w,
55476
- 'WebKitMediaKeys' in w,
55477
- ]) >= 4);
55478
- }
55479
- /**
55480
- * Checks whether this WebKit browser is a desktop browser.
55481
- * It doesn't check that the browser is based on WebKit, there is a separate function for this.
55482
- *
55483
- * Warning for package users:
55484
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
55485
- */
55486
- function isDesktopWebKit() {
55487
- // Checked in Safari and DuckDuckGo
55488
- var w = window;
55489
- var HTMLElement = w.HTMLElement, Document = w.Document;
55490
- return (countTruthy([
55491
- 'safari' in w,
55492
- !('ongestureend' in w),
55493
- !('TouchEvent' in w),
55494
- !('orientation' in w),
55495
- HTMLElement && !('autocapitalize' in HTMLElement.prototype),
55496
- Document && 'pointerLockElement' in Document.prototype,
55497
- ]) >= 4);
55498
- }
55499
- /**
55500
- * Checks whether this WebKit browser is Safari.
55501
- * It doesn't check that the browser is based on WebKit, there is a separate function for this.
55502
- *
55503
- * Warning! The function works properly only for Safari version 15.4 and newer.
55504
- */
55505
- function isSafariWebKit() {
55506
- // Checked in Safari, Chrome, Firefox, Yandex, UC Browser, Opera, Edge and DuckDuckGo.
55507
- // iOS Safari and Chrome were checked on iOS 11-18. DuckDuckGo was checked on iOS 17-18 and macOS 14-15.
55508
- // Desktop Safari versions 12-18 were checked.
55509
- // The other browsers were checked on iOS 17 and 18; there was no chance to check them on the other OS versions.
55510
- var w = window;
55511
- return (
55512
- // Filters-out Chrome, Yandex, DuckDuckGo (macOS and iOS), Edge
55513
- isFunctionNative(w.print) &&
55514
- // Doesn't work in Safari < 15.4
55515
- String(w.browser) === '[object WebPageNamespace]');
55516
- }
55517
- /**
55518
- * Checks whether the browser is based on Gecko (Firefox engine) without using user-agent.
55519
- *
55520
- * Warning for package users:
55521
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
55522
- */
55523
- function isGecko() {
55524
- var _a, _b;
55525
- var w = window;
55526
- // Based on research in September 2020
55527
- return (countTruthy([
55528
- 'buildID' in navigator,
55529
- 'MozAppearance' in ((_b = (_a = document.documentElement) === null || _a === void 0 ? void 0 : _a.style) !== null && _b !== void 0 ? _b : {}),
55530
- 'onmozfullscreenchange' in w,
55531
- 'mozInnerScreenX' in w,
55532
- 'CSSMozDocumentRule' in w,
55533
- 'CanvasCaptureMediaStream' in w,
55534
- ]) >= 4);
55535
- }
55536
- /**
55537
- * Checks whether the browser is based on Chromium version ≥86 without using user-agent.
55538
- * It doesn't check that the browser is based on Chromium, there is a separate function for this.
55539
- */
55540
- function isChromium86OrNewer() {
55541
- // Checked in Chrome 85 vs Chrome 86 both on desktop and Android. Checked in macOS Chrome 128, Android Chrome 127.
55542
- var w = window;
55543
- return (countTruthy([
55544
- !('MediaSettingsRange' in w),
55545
- 'RTCEncodedAudioFrame' in w,
55546
- '' + w.Intl === '[object Intl]',
55547
- '' + w.Reflect === '[object Reflect]',
55548
- ]) >= 3);
55549
- }
55550
- /**
55551
- * Checks whether the browser is based on Chromium version ≥122 without using user-agent.
55552
- * It doesn't check that the browser is based on Chromium, there is a separate function for this.
55553
- */
55554
- function isChromium122OrNewer() {
55555
- // Checked in Chrome 121 vs Chrome 122 and 129 both on desktop and Android
55556
- var w = window;
55557
- var URLPattern = w.URLPattern;
55558
- return (countTruthy([
55559
- 'union' in Set.prototype,
55560
- 'Iterator' in w,
55561
- URLPattern && 'hasRegExpGroups' in URLPattern.prototype,
55562
- 'RGB8' in WebGLRenderingContext.prototype,
55563
- ]) >= 3);
55564
- }
55565
- /**
55566
- * Checks whether the browser is based on WebKit version ≥606 (Safari ≥12) without using user-agent.
55567
- * It doesn't check that the browser is based on WebKit, there is a separate function for this.
55568
- *
55569
- * @see https://en.wikipedia.org/wiki/Safari_version_history#Release_history Safari-WebKit versions map
55570
- */
55571
- function isWebKit606OrNewer() {
55572
- // Checked in Safari 9–18
55573
- var w = window;
55574
- return (countTruthy([
55575
- 'DOMRectList' in w,
55576
- 'RTCPeerConnectionIceEvent' in w,
55577
- 'SVGGeometryElement' in w,
55578
- 'ontransitioncancel' in w,
55579
- ]) >= 3);
55580
- }
55581
- /**
55582
- * Checks whether the browser is based on WebKit version ≥616 (Safari ≥17) without using user-agent.
55583
- * It doesn't check that the browser is based on WebKit, there is a separate function for this.
55584
- *
55585
- * @see https://developer.apple.com/documentation/safari-release-notes/safari-17-release-notes Safari 17 release notes
55586
- * @see https://tauri.app/v1/references/webview-versions/#webkit-versions-in-safari Safari-WebKit versions map
55587
- */
55588
- function isWebKit616OrNewer() {
55589
- var w = window;
55590
- var n = navigator;
55591
- var CSS = w.CSS, HTMLButtonElement = w.HTMLButtonElement;
55592
- return (countTruthy([
55593
- !('getStorageUpdates' in n),
55594
- HTMLButtonElement && 'popover' in HTMLButtonElement.prototype,
55595
- 'CSSCounterStyleRule' in w,
55596
- CSS.supports('font-size-adjust: ex-height 0.5'),
55597
- CSS.supports('text-transform: full-width'),
55598
- ]) >= 4);
55599
- }
55600
- /**
55601
- * Checks whether the device is an iPad.
55602
- * It doesn't check that the engine is WebKit and that the WebKit isn't desktop.
55603
- */
55604
- function isIPad() {
55605
- // Checked on:
55606
- // Safari on iPadOS (both mobile and desktop modes): 8, 11-18
55607
- // Chrome on iPadOS (both mobile and desktop modes): 11-18
55608
- // Safari on iOS (both mobile and desktop modes): 9-18
55609
- // Chrome on iOS (both mobile and desktop modes): 9-18
55610
- // Before iOS 13. Safari tampers the value in "request desktop site" mode since iOS 13.
55611
- if (navigator.platform === 'iPad') {
55612
- return true;
55613
- }
55614
- var s = screen;
55615
- var screenRatio = s.width / s.height;
55616
- return (countTruthy([
55617
- // Since iOS 13. Doesn't work in Chrome on iPadOS <15, but works in desktop mode.
55618
- 'MediaSource' in window,
55619
- // Since iOS 12. Doesn't work in Chrome on iPadOS.
55620
- !!Element.prototype.webkitRequestFullscreen,
55621
- // iPhone 4S that runs iOS 9 matches this, but it is not supported
55622
- // Doesn't work in incognito mode of Safari ≥17 with split screen because of tracking prevention
55623
- screenRatio > 0.65 && screenRatio < 1.53,
55624
- ]) >= 2);
55625
- }
55626
- /**
55627
- * Warning for package users:
55628
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
55629
- */
55630
- function getFullscreenElement() {
55631
- var d = document;
55632
- return d.fullscreenElement || d.msFullscreenElement || d.mozFullScreenElement || d.webkitFullscreenElement || null;
55633
- }
55634
- function exitFullscreen() {
55635
- var d = document;
55636
- // `call` is required because the function throws an error without a proper "this" context
55637
- return (d.exitFullscreen || d.msExitFullscreen || d.mozCancelFullScreen || d.webkitExitFullscreen).call(d);
55638
- }
55639
- /**
55640
- * Checks whether the device runs on Android without using user-agent.
55641
- *
55642
- * Warning for package users:
55643
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
55644
- */
55645
- function isAndroid() {
55646
- var isItChromium = isChromium();
55647
- var isItGecko = isGecko();
55648
- var w = window;
55649
- var n = navigator;
55650
- var c = 'connection';
55651
- // Chrome removes all words "Android" from `navigator` when desktop version is requested
55652
- // Firefox keeps "Android" in `navigator.appVersion` when desktop version is requested
55653
- if (isItChromium) {
55654
- return (countTruthy([
55655
- !('SharedWorker' in w),
55656
- // `typechange` is deprecated, but it's still present on Android (tested on Chrome Mobile 117)
55657
- // Removal proposal https://bugs.chromium.org/p/chromium/issues/detail?id=699892
55658
- // Note: this expression returns true on ChromeOS, so additional detectors are required to avoid false-positives
55659
- n[c] && 'ontypechange' in n[c],
55660
- !('sinkId' in new Audio()),
55661
- ]) >= 2);
55662
- }
55663
- else if (isItGecko) {
55664
- return countTruthy(['onorientationchange' in w, 'orientation' in w, /android/i.test(n.appVersion)]) >= 2;
55665
- }
55666
- else {
55667
- // Only 2 browser engines are presented on Android.
55668
- // Actually, there is also Android 4.1 browser, but it's not worth detecting it at the moment.
55669
- return false;
55670
- }
55671
- }
55672
- /**
55673
- * Checks whether the browser is Samsung Internet without using user-agent.
55674
- * It doesn't check that the browser is based on Chromium, please use `isChromium` before using this function.
55675
- *
55676
- * Warning for package users:
55677
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
55678
- */
55679
- function isSamsungInternet() {
55680
- // Checked in Samsung Internet 21, 25 and 27
55681
- var n = navigator;
55682
- var w = window;
55683
- var audioPrototype = Audio.prototype;
55684
- var visualViewport = w.visualViewport;
55685
- return (countTruthy([
55686
- 'srLatency' in audioPrototype,
55687
- 'srChannelCount' in audioPrototype,
55688
- 'devicePosture' in n,
55689
- visualViewport && 'segments' in visualViewport,
55690
- 'getTextInformation' in Image.prototype, // Not available in Samsung Internet 21
55691
- ]) >= 3);
55692
- }
55693
-
55694
- /**
55695
- * A deep description: https://fingerprint.com/blog/audio-fingerprinting/
55696
- * Inspired by and based on https://github.com/cozylife/audio-fingerprint
55697
- *
55698
- * A version of the entropy source with stabilization to make it suitable for static fingerprinting.
55699
- * Audio signal is noised in private mode of Safari 17, so audio fingerprinting is skipped in Safari 17.
55700
- */
55701
- function getAudioFingerprint() {
55702
- if (doesBrowserPerformAntifingerprinting$1()) {
55703
- return -4 /* SpecialFingerprint.KnownForAntifingerprinting */;
55704
- }
55705
- return getUnstableAudioFingerprint();
55706
- }
55707
- /**
55708
- * A version of the entropy source without stabilization.
55709
- *
55710
- * Warning for package users:
55711
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
55712
- */
55713
- function getUnstableAudioFingerprint() {
55714
- var w = window;
55715
- var AudioContext = w.OfflineAudioContext || w.webkitOfflineAudioContext;
55716
- if (!AudioContext) {
55717
- return -2 /* SpecialFingerprint.NotSupported */;
55718
- }
55719
- // In some browsers, audio context always stays suspended unless the context is started in response to a user action
55720
- // (e.g. a click or a tap). It prevents audio fingerprint from being taken at an arbitrary moment of time.
55721
- // Such browsers are old and unpopular, so the audio fingerprinting is just skipped in them.
55722
- // See a similar case explanation at https://stackoverflow.com/questions/46363048/onaudioprocess-not-called-on-ios11#46534088
55723
- if (doesBrowserSuspendAudioContext()) {
55724
- return -1 /* SpecialFingerprint.KnownForSuspending */;
55725
- }
55726
- var hashFromIndex = 4500;
55727
- var hashToIndex = 5000;
55728
- var context = new AudioContext(1, hashToIndex, 44100);
55729
- var oscillator = context.createOscillator();
55730
- oscillator.type = 'triangle';
55731
- oscillator.frequency.value = 10000;
55732
- var compressor = context.createDynamicsCompressor();
55733
- compressor.threshold.value = -50;
55734
- compressor.knee.value = 40;
55735
- compressor.ratio.value = 12;
55736
- compressor.attack.value = 0;
55737
- compressor.release.value = 0.25;
55738
- oscillator.connect(compressor);
55739
- compressor.connect(context.destination);
55740
- oscillator.start(0);
55741
- var _a = startRenderingAudio(context), renderPromise = _a[0], finishRendering = _a[1];
55742
- // Suppresses the console error message in case when the fingerprint fails before requested
55743
- var fingerprintPromise = suppressUnhandledRejectionWarning(renderPromise.then(function (buffer) { return getHash(buffer.getChannelData(0).subarray(hashFromIndex)); }, function (error) {
55744
- if (error.name === "timeout" /* InnerErrorName.Timeout */ || error.name === "suspended" /* InnerErrorName.Suspended */) {
55745
- return -3 /* SpecialFingerprint.Timeout */;
55746
- }
55747
- throw error;
55748
- }));
55749
- return function () {
55750
- finishRendering();
55751
- return fingerprintPromise;
55752
- };
55753
- }
55754
- /**
55755
- * Checks if the current browser is known for always suspending audio context
55756
- */
55757
- function doesBrowserSuspendAudioContext() {
55758
- // Mobile Safari 11 and older
55759
- return isWebKit() && !isDesktopWebKit() && !isWebKit606OrNewer();
55760
- }
55761
- /**
55762
- * Checks if the current browser is known for applying anti-fingerprinting measures in all or some critical modes
55763
- */
55764
- function doesBrowserPerformAntifingerprinting$1() {
55765
- return (
55766
- // Safari ≥17
55767
- (isWebKit() && isWebKit616OrNewer() && isSafariWebKit()) ||
55768
- // Samsung Internet ≥26
55769
- (isChromium() && isSamsungInternet() && isChromium122OrNewer()));
55770
- }
55771
- /**
55772
- * Starts rendering the audio context.
55773
- * When the returned function is called, the render process starts finishing.
55774
- */
55775
- function startRenderingAudio(context) {
55776
- var renderTryMaxCount = 3;
55777
- var renderRetryDelay = 500;
55778
- var runningMaxAwaitTime = 500;
55779
- var runningSufficientTime = 5000;
55780
- var finalize = function () { return undefined; };
55781
- var resultPromise = new Promise(function (resolve, reject) {
55782
- var isFinalized = false;
55783
- var renderTryCount = 0;
55784
- var startedRunningAt = 0;
55785
- context.oncomplete = function (event) { return resolve(event.renderedBuffer); };
55786
- var startRunningTimeout = function () {
55787
- setTimeout(function () { return reject(makeInnerError("timeout" /* InnerErrorName.Timeout */)); }, Math.min(runningMaxAwaitTime, startedRunningAt + runningSufficientTime - Date.now()));
55788
- };
55789
- var tryRender = function () {
55790
- try {
55791
- var renderingPromise = context.startRendering();
55792
- // `context.startRendering` has two APIs: Promise and callback, we check that it's really a promise just in case
55793
- if (isPromise$1(renderingPromise)) {
55794
- // Suppresses all unhandled rejections in case of scheduled redundant retries after successful rendering
55795
- suppressUnhandledRejectionWarning(renderingPromise);
55796
- }
55797
- switch (context.state) {
55798
- case 'running':
55799
- startedRunningAt = Date.now();
55800
- if (isFinalized) {
55801
- startRunningTimeout();
55802
- }
55803
- break;
55804
- // Sometimes the audio context doesn't start after calling `startRendering` (in addition to the cases where
55805
- // audio context doesn't start at all). A known case is starting an audio context when the browser tab is in
55806
- // background on iPhone. Retries usually help in this case.
55807
- case 'suspended':
55808
- // The audio context can reject starting until the tab is in foreground. Long fingerprint duration
55809
- // in background isn't a problem, therefore the retry attempts don't count in background. It can lead to
55810
- // a situation when a fingerprint takes very long time and finishes successfully. FYI, the audio context
55811
- // can be suspended when `document.hidden === false` and start running after a retry.
55812
- if (!document.hidden) {
55813
- renderTryCount++;
55814
- }
55815
- if (isFinalized && renderTryCount >= renderTryMaxCount) {
55816
- reject(makeInnerError("suspended" /* InnerErrorName.Suspended */));
55817
- }
55818
- else {
55819
- setTimeout(tryRender, renderRetryDelay);
55820
- }
55821
- break;
55822
- }
55823
- }
55824
- catch (error) {
55825
- reject(error);
55826
- }
55827
- };
55828
- tryRender();
55829
- finalize = function () {
55830
- if (!isFinalized) {
55831
- isFinalized = true;
55832
- if (startedRunningAt > 0) {
55833
- startRunningTimeout();
55834
- }
55835
- }
55836
- };
55837
- });
55838
- return [resultPromise, finalize];
55839
- }
55840
- function getHash(signal) {
55841
- var hash = 0;
55842
- for (var i = 0; i < signal.length; ++i) {
55843
- hash += Math.abs(signal[i]);
55844
- }
55845
- return hash;
55846
- }
55847
- function makeInnerError(name) {
55848
- var error = new Error(name);
55849
- error.name = name;
55850
- return error;
55851
- }
55852
-
55853
- /**
55854
- * Creates and keeps an invisible iframe while the given function runs.
55855
- * The given function is called when the iframe is loaded and has a body.
55856
- * The iframe allows to measure DOM sizes inside itself.
55857
- *
55858
- * Notice: passing an initial HTML code doesn't work in IE.
55859
- *
55860
- * Warning for package users:
55861
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
55862
- */
55863
- function withIframe(action, initialHtml, domPollInterval) {
55864
- var _a, _b, _c;
55865
- if (domPollInterval === void 0) { domPollInterval = 50; }
55866
- return __awaiter(this, void 0, void 0, function () {
55867
- var d, iframe;
55868
- return __generator(this, function (_d) {
55869
- switch (_d.label) {
55870
- case 0:
55871
- d = document;
55872
- _d.label = 1;
55873
- case 1:
55874
- if (!!d.body) return [3 /*break*/, 3];
55875
- return [4 /*yield*/, wait(domPollInterval)];
55876
- case 2:
55877
- _d.sent();
55878
- return [3 /*break*/, 1];
55879
- case 3:
55880
- iframe = d.createElement('iframe');
55881
- _d.label = 4;
55882
- case 4:
55883
- _d.trys.push([4, , 10, 11]);
55884
- return [4 /*yield*/, new Promise(function (_resolve, _reject) {
55885
- var isComplete = false;
55886
- var resolve = function () {
55887
- isComplete = true;
55888
- _resolve();
55889
- };
55890
- var reject = function (error) {
55891
- isComplete = true;
55892
- _reject(error);
55893
- };
55894
- iframe.onload = resolve;
55895
- iframe.onerror = reject;
55896
- var style = iframe.style;
55897
- style.setProperty('display', 'block', 'important'); // Required for browsers to calculate the layout
55898
- style.position = 'absolute';
55899
- style.top = '0';
55900
- style.left = '0';
55901
- style.visibility = 'hidden';
55902
- if (initialHtml && 'srcdoc' in iframe) {
55903
- iframe.srcdoc = initialHtml;
55904
- }
55905
- else {
55906
- iframe.src = 'about:blank';
55907
- }
55908
- d.body.appendChild(iframe);
55909
- // WebKit in WeChat doesn't fire the iframe's `onload` for some reason.
55910
- // This code checks for the loading state manually.
55911
- // See https://github.com/fingerprintjs/fingerprintjs/issues/645
55912
- var checkReadyState = function () {
55913
- var _a, _b;
55914
- // The ready state may never become 'complete' in Firefox despite the 'load' event being fired.
55915
- // So an infinite setTimeout loop can happen without this check.
55916
- // See https://github.com/fingerprintjs/fingerprintjs/pull/716#issuecomment-986898796
55917
- if (isComplete) {
55918
- return;
55919
- }
55920
- // Make sure iframe.contentWindow and iframe.contentWindow.document are both loaded
55921
- // The contentWindow.document can miss in JSDOM (https://github.com/jsdom/jsdom).
55922
- if (((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.readyState) === 'complete') {
55923
- resolve();
55924
- }
55925
- else {
55926
- setTimeout(checkReadyState, 10);
55927
- }
55928
- };
55929
- checkReadyState();
55930
- })];
55931
- case 5:
55932
- _d.sent();
55933
- _d.label = 6;
55934
- case 6:
55935
- if (!!((_b = (_a = iframe.contentWindow) === null || _a === void 0 ? void 0 : _a.document) === null || _b === void 0 ? void 0 : _b.body)) return [3 /*break*/, 8];
55936
- return [4 /*yield*/, wait(domPollInterval)];
55937
- case 7:
55938
- _d.sent();
55939
- return [3 /*break*/, 6];
55940
- case 8: return [4 /*yield*/, action(iframe, iframe.contentWindow)];
55941
- case 9: return [2 /*return*/, _d.sent()];
55942
- case 10:
55943
- (_c = iframe.parentNode) === null || _c === void 0 ? void 0 : _c.removeChild(iframe);
55944
- return [7 /*endfinally*/];
55945
- case 11: return [2 /*return*/];
55946
- }
55947
- });
55948
- });
55949
- }
55950
- /**
55951
- * Creates a DOM element that matches the given selector.
55952
- * Only single element selector are supported (without operators like space, +, >, etc).
55953
- */
55954
- function selectorToElement(selector) {
55955
- var _a = parseSimpleCssSelector(selector), tag = _a[0], attributes = _a[1];
55956
- var element = document.createElement(tag !== null && tag !== void 0 ? tag : 'div');
55957
- for (var _i = 0, _b = Object.keys(attributes); _i < _b.length; _i++) {
55958
- var name_1 = _b[_i];
55959
- var value = attributes[name_1].join(' ');
55960
- // Changing the `style` attribute can cause a CSP error, therefore we change the `style.cssText` property.
55961
- // https://github.com/fingerprintjs/fingerprintjs/issues/733
55962
- if (name_1 === 'style') {
55963
- addStyleString(element.style, value);
55964
- }
55965
- else {
55966
- element.setAttribute(name_1, value);
55967
- }
55968
- }
55969
- return element;
55970
- }
55971
- /**
55972
- * Adds CSS styles from a string in such a way that doesn't trigger a CSP warning (unsafe-inline or unsafe-eval)
55973
- */
55974
- function addStyleString(style, source) {
55975
- // We don't use `style.cssText` because browsers must block it when no `unsafe-eval` CSP is presented: https://csplite.com/csp145/#w3c_note
55976
- // Even though the browsers ignore this standard, we don't use `cssText` just in case.
55977
- for (var _i = 0, _a = source.split(';'); _i < _a.length; _i++) {
55978
- var property = _a[_i];
55979
- var match = /^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(property);
55980
- if (match) {
55981
- var name_2 = match[1], value = match[2], priority = match[4];
55982
- style.setProperty(name_2, value, priority || ''); // The last argument can't be undefined in IE11
55983
- }
55984
- }
55985
- }
55986
- /**
55987
- * Returns true if the code runs in an iframe, and any parent page's origin doesn't match the current origin
55988
- */
55989
- function isAnyParentCrossOrigin() {
55990
- var currentWindow = window;
55991
- for (;;) {
55992
- var parentWindow = currentWindow.parent;
55993
- if (!parentWindow || parentWindow === currentWindow) {
55994
- return false; // The top page is reached
55995
- }
55996
- try {
55997
- if (parentWindow.location.origin !== currentWindow.location.origin) {
55998
- return true;
55999
- }
56000
- }
56001
- catch (error) {
56002
- // The error is thrown when `origin` is accessed on `parentWindow.location` when the parent is cross-origin
56003
- if (error instanceof Error && error.name === 'SecurityError') {
56004
- return true;
56005
- }
56006
- throw error;
56007
- }
56008
- currentWindow = parentWindow;
56009
- }
56010
- }
56011
-
56012
- // We use m or w because these two characters take up the maximum width.
56013
- // And we use a LLi so that the same matching fonts can get separated.
56014
- var testString = 'mmMwWLliI0O&1';
56015
- // We test using 48px font size, we may use any size. I guess larger the better.
56016
- var textSize = '48px';
56017
- // A font will be compared against all the three default fonts.
56018
- // And if for any default fonts it doesn't match, then that font is available.
56019
- var baseFonts = ['monospace', 'sans-serif', 'serif'];
56020
- var fontList = [
56021
- // This is android-specific font from "Roboto" family
56022
- 'sans-serif-thin',
56023
- 'ARNO PRO',
56024
- 'Agency FB',
56025
- 'Arabic Typesetting',
56026
- 'Arial Unicode MS',
56027
- 'AvantGarde Bk BT',
56028
- 'BankGothic Md BT',
56029
- 'Batang',
56030
- 'Bitstream Vera Sans Mono',
56031
- 'Calibri',
56032
- 'Century',
56033
- 'Century Gothic',
56034
- 'Clarendon',
56035
- 'EUROSTILE',
56036
- 'Franklin Gothic',
56037
- 'Futura Bk BT',
56038
- 'Futura Md BT',
56039
- 'GOTHAM',
56040
- 'Gill Sans',
56041
- 'HELV',
56042
- 'Haettenschweiler',
56043
- 'Helvetica Neue',
56044
- 'Humanst521 BT',
56045
- 'Leelawadee',
56046
- 'Letter Gothic',
56047
- 'Levenim MT',
56048
- 'Lucida Bright',
56049
- 'Lucida Sans',
56050
- 'Menlo',
56051
- 'MS Mincho',
56052
- 'MS Outlook',
56053
- 'MS Reference Specialty',
56054
- 'MS UI Gothic',
56055
- 'MT Extra',
56056
- 'MYRIAD PRO',
56057
- 'Marlett',
56058
- 'Meiryo UI',
56059
- 'Microsoft Uighur',
56060
- 'Minion Pro',
56061
- 'Monotype Corsiva',
56062
- 'PMingLiU',
56063
- 'Pristina',
56064
- 'SCRIPTINA',
56065
- 'Segoe UI Light',
56066
- 'Serifa',
56067
- 'SimHei',
56068
- 'Small Fonts',
56069
- 'Staccato222 BT',
56070
- 'TRAJAN PRO',
56071
- 'Univers CE 55 Medium',
56072
- 'Vrinda',
56073
- 'ZWAdobeF',
56074
- ];
56075
- // kudos to http://www.lalit.org/lab/javascript-css-font-detect/
56076
- function getFonts() {
56077
- var _this = this;
56078
- // Running the script in an iframe makes it not affect the page look and not be affected by the page CSS. See:
56079
- // https://github.com/fingerprintjs/fingerprintjs/issues/592
56080
- // https://github.com/fingerprintjs/fingerprintjs/issues/628
56081
- return withIframe(function (_, _a) {
56082
- var document = _a.document;
56083
- return __awaiter(_this, void 0, void 0, function () {
56084
- var holder, spansContainer, defaultWidth, defaultHeight, createSpan, createSpanWithFonts, initializeBaseFontsSpans, initializeFontsSpans, isFontAvailable, baseFontsSpans, fontsSpans, index;
56085
- return __generator(this, function (_b) {
56086
- holder = document.body;
56087
- holder.style.fontSize = textSize;
56088
- spansContainer = document.createElement('div');
56089
- spansContainer.style.setProperty('visibility', 'hidden', 'important');
56090
- defaultWidth = {};
56091
- defaultHeight = {};
56092
- createSpan = function (fontFamily) {
56093
- var span = document.createElement('span');
56094
- var style = span.style;
56095
- style.position = 'absolute';
56096
- style.top = '0';
56097
- style.left = '0';
56098
- style.fontFamily = fontFamily;
56099
- span.textContent = testString;
56100
- spansContainer.appendChild(span);
56101
- return span;
56102
- };
56103
- createSpanWithFonts = function (fontToDetect, baseFont) {
56104
- return createSpan("'".concat(fontToDetect, "',").concat(baseFont));
56105
- };
56106
- initializeBaseFontsSpans = function () {
56107
- return baseFonts.map(createSpan);
56108
- };
56109
- initializeFontsSpans = function () {
56110
- // Stores {fontName : [spans for that font]}
56111
- var spans = {};
56112
- var _loop_1 = function (font) {
56113
- spans[font] = baseFonts.map(function (baseFont) { return createSpanWithFonts(font, baseFont); });
56114
- };
56115
- for (var _i = 0, fontList_1 = fontList; _i < fontList_1.length; _i++) {
56116
- var font = fontList_1[_i];
56117
- _loop_1(font);
56118
- }
56119
- return spans;
56120
- };
56121
- isFontAvailable = function (fontSpans) {
56122
- return baseFonts.some(function (baseFont, baseFontIndex) {
56123
- return fontSpans[baseFontIndex].offsetWidth !== defaultWidth[baseFont] ||
56124
- fontSpans[baseFontIndex].offsetHeight !== defaultHeight[baseFont];
56125
- });
56126
- };
56127
- baseFontsSpans = initializeBaseFontsSpans();
56128
- fontsSpans = initializeFontsSpans();
56129
- // add all the spans to the DOM
56130
- holder.appendChild(spansContainer);
56131
- // get the default width for the three base fonts
56132
- for (index = 0; index < baseFonts.length; index++) {
56133
- defaultWidth[baseFonts[index]] = baseFontsSpans[index].offsetWidth; // width for the default font
56134
- defaultHeight[baseFonts[index]] = baseFontsSpans[index].offsetHeight; // height for the default font
56135
- }
56136
- // check available fonts
56137
- return [2 /*return*/, fontList.filter(function (font) { return isFontAvailable(fontsSpans[font]); })];
56138
- });
56139
- });
56140
- });
56141
- }
56142
-
56143
- function getPlugins() {
56144
- var rawPlugins = navigator.plugins;
56145
- if (!rawPlugins) {
56146
- return undefined;
56147
- }
56148
- var plugins = [];
56149
- // Safari 10 doesn't support iterating navigator.plugins with for...of
56150
- for (var i = 0; i < rawPlugins.length; ++i) {
56151
- var plugin = rawPlugins[i];
56152
- if (!plugin) {
56153
- continue;
56154
- }
56155
- var mimeTypes = [];
56156
- for (var j = 0; j < plugin.length; ++j) {
56157
- var mimeType = plugin[j];
56158
- mimeTypes.push({
56159
- type: mimeType.type,
56160
- suffixes: mimeType.suffixes,
56161
- });
56162
- }
56163
- plugins.push({
56164
- name: plugin.name,
56165
- description: plugin.description,
56166
- mimeTypes: mimeTypes,
56167
- });
56168
- }
56169
- return plugins;
56170
- }
56171
-
56172
- /**
56173
- * @see https://www.browserleaks.com/canvas#how-does-it-work
56174
- *
56175
- * A version of the entropy source with stabilization to make it suitable for static fingerprinting.
56176
- * Canvas image is noised in private mode of Safari 17, so image rendering is skipped in Safari 17.
56177
- */
56178
- function getCanvasFingerprint() {
56179
- return getUnstableCanvasFingerprint(doesBrowserPerformAntifingerprinting());
56180
- }
56181
- /**
56182
- * A version of the entropy source without stabilization.
56183
- *
56184
- * Warning for package users:
56185
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
56186
- */
56187
- function getUnstableCanvasFingerprint(skipImages) {
56188
- var _a;
56189
- var winding = false;
56190
- var geometry;
56191
- var text;
56192
- var _b = makeCanvasContext(), canvas = _b[0], context = _b[1];
56193
- if (!isSupported(canvas, context)) {
56194
- geometry = text = "unsupported" /* ImageStatus.Unsupported */;
56195
- }
56196
- else {
56197
- winding = doesSupportWinding(context);
56198
- if (skipImages) {
56199
- geometry = text = "skipped" /* ImageStatus.Skipped */;
56200
- }
56201
- else {
56202
- _a = renderImages(canvas, context), geometry = _a[0], text = _a[1];
56203
- }
56204
- }
56205
- return { winding: winding, geometry: geometry, text: text };
56206
- }
56207
- function makeCanvasContext() {
56208
- var canvas = document.createElement('canvas');
56209
- canvas.width = 1;
56210
- canvas.height = 1;
56211
- return [canvas, canvas.getContext('2d')];
56212
- }
56213
- function isSupported(canvas, context) {
56214
- return !!(context && canvas.toDataURL);
56215
- }
56216
- function doesSupportWinding(context) {
56217
- // https://web.archive.org/web/20170825024655/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/
56218
- // https://github.com/Modernizr/Modernizr/blob/master/feature-detects/canvas/winding.js
56219
- context.rect(0, 0, 10, 10);
56220
- context.rect(2, 2, 6, 6);
56221
- return !context.isPointInPath(5, 5, 'evenodd');
56222
- }
56223
- function renderImages(canvas, context) {
56224
- renderTextImage(canvas, context);
56225
- var textImage1 = canvasToString(canvas);
56226
- var textImage2 = canvasToString(canvas); // It's slightly faster to double-encode the text image
56227
- // Some browsers add a noise to the canvas: https://github.com/fingerprintjs/fingerprintjs/issues/791
56228
- // The canvas is excluded from the fingerprint in this case
56229
- if (textImage1 !== textImage2) {
56230
- return ["unstable" /* ImageStatus.Unstable */, "unstable" /* ImageStatus.Unstable */];
56231
- }
56232
- // Text is unstable:
56233
- // https://github.com/fingerprintjs/fingerprintjs/issues/583
56234
- // https://github.com/fingerprintjs/fingerprintjs/issues/103
56235
- // Therefore it's extracted into a separate image.
56236
- renderGeometryImage(canvas, context);
56237
- var geometryImage = canvasToString(canvas);
56238
- return [geometryImage, textImage1];
56239
- }
56240
- function renderTextImage(canvas, context) {
56241
- // Resizing the canvas cleans it
56242
- canvas.width = 240;
56243
- canvas.height = 60;
56244
- context.textBaseline = 'alphabetic';
56245
- context.fillStyle = '#f60';
56246
- context.fillRect(100, 1, 62, 20);
56247
- context.fillStyle = '#069';
56248
- // It's important to use explicit built-in fonts in order to exclude the affect of font preferences
56249
- // (there is a separate entropy source for them).
56250
- context.font = '11pt "Times New Roman"';
56251
- // The choice of emojis has a gigantic impact on rendering performance (especially in FF).
56252
- // Some newer emojis cause it to slow down 50-200 times.
56253
- // There must be no text to the right of the emoji, see https://github.com/fingerprintjs/fingerprintjs/issues/574
56254
- // A bare emoji shouldn't be used because the canvas will change depending on the script encoding:
56255
- // https://github.com/fingerprintjs/fingerprintjs/issues/66
56256
- // Escape sequence shouldn't be used too because Terser will turn it into a bare unicode.
56257
- var printedText = "Cwm fjordbank gly ".concat(String.fromCharCode(55357, 56835) /* 😃 */);
56258
- context.fillText(printedText, 2, 15);
56259
- context.fillStyle = 'rgba(102, 204, 0, 0.2)';
56260
- context.font = '18pt Arial';
56261
- context.fillText(printedText, 4, 45);
56262
- }
56263
- function renderGeometryImage(canvas, context) {
56264
- // Resizing the canvas cleans it
56265
- canvas.width = 122;
56266
- canvas.height = 110;
56267
- // Canvas blending
56268
- // https://web.archive.org/web/20170826194121/http://blogs.adobe.com/webplatform/2013/01/28/blending-features-in-canvas/
56269
- // http://jsfiddle.net/NDYV8/16/
56270
- context.globalCompositeOperation = 'multiply';
56271
- for (var _i = 0, _a = [
56272
- ['#f2f', 40, 40],
56273
- ['#2ff', 80, 40],
56274
- ['#ff2', 60, 80],
56275
- ]; _i < _a.length; _i++) {
56276
- var _b = _a[_i], color = _b[0], x = _b[1], y = _b[2];
56277
- context.fillStyle = color;
56278
- context.beginPath();
56279
- context.arc(x, y, 40, 0, Math.PI * 2, true);
56280
- context.closePath();
56281
- context.fill();
56282
- }
56283
- // Canvas winding
56284
- // https://web.archive.org/web/20130913061632/http://blogs.adobe.com/webplatform/2013/01/30/winding-rules-in-canvas/
56285
- // http://jsfiddle.net/NDYV8/19/
56286
- context.fillStyle = '#f9c';
56287
- context.arc(60, 60, 60, 0, Math.PI * 2, true);
56288
- context.arc(60, 60, 20, 0, Math.PI * 2, true);
56289
- context.fill('evenodd');
56290
- }
56291
- function canvasToString(canvas) {
56292
- return canvas.toDataURL();
56293
- }
56294
- /**
56295
- * Checks if the current browser is known for applying anti-fingerprinting measures in all or some critical modes
56296
- */
56297
- function doesBrowserPerformAntifingerprinting() {
56298
- // Safari 17
56299
- return isWebKit() && isWebKit616OrNewer() && isSafariWebKit();
56300
- }
56301
-
56302
- /**
56303
- * This is a crude and primitive touch screen detection. It's not possible to currently reliably detect the availability
56304
- * of a touch screen with a JS, without actually subscribing to a touch event.
56305
- *
56306
- * @see http://www.stucox.com/blog/you-cant-detect-a-touchscreen/
56307
- * @see https://github.com/Modernizr/Modernizr/issues/548
56308
- */
56309
- function getTouchSupport() {
56310
- var n = navigator;
56311
- var maxTouchPoints = 0;
56312
- var touchEvent;
56313
- if (n.maxTouchPoints !== undefined) {
56314
- maxTouchPoints = toInt(n.maxTouchPoints);
56315
- }
56316
- else if (n.msMaxTouchPoints !== undefined) {
56317
- maxTouchPoints = n.msMaxTouchPoints;
56318
- }
56319
- try {
56320
- document.createEvent('TouchEvent');
56321
- touchEvent = true;
56322
- }
56323
- catch (_a) {
56324
- touchEvent = false;
56325
- }
56326
- var touchStart = 'ontouchstart' in window;
56327
- return {
56328
- maxTouchPoints: maxTouchPoints,
56329
- touchEvent: touchEvent,
56330
- touchStart: touchStart,
56331
- };
56332
- }
56333
-
56334
- function getOsCpu() {
56335
- return navigator.oscpu;
56336
- }
56337
-
56338
- function getLanguages() {
56339
- var n = navigator;
56340
- var result = [];
56341
- var language = n.language || n.userLanguage || n.browserLanguage || n.systemLanguage;
56342
- if (language !== undefined) {
56343
- result.push([language]);
56344
- }
56345
- if (Array.isArray(n.languages)) {
56346
- // Starting from Chromium 86, there is only a single value in `navigator.language` in Incognito mode:
56347
- // the value of `navigator.language`. Therefore the value is ignored in this browser.
56348
- if (!(isChromium() && isChromium86OrNewer())) {
56349
- result.push(n.languages);
56350
- }
56351
- }
56352
- else if (typeof n.languages === 'string') {
56353
- var languages = n.languages;
56354
- if (languages) {
56355
- result.push(languages.split(','));
56356
- }
56357
- }
56358
- return result;
56359
- }
56360
-
56361
- function getColorDepth() {
56362
- return window.screen.colorDepth;
56363
- }
56364
-
56365
- function getDeviceMemory() {
56366
- // `navigator.deviceMemory` is a string containing a number in some unidentified cases
56367
- return replaceNaN(toFloat(navigator.deviceMemory), undefined);
56368
- }
56369
-
56370
- /**
56371
- * A version of the entropy source with stabilization to make it suitable for static fingerprinting.
56372
- * The window resolution is always the document size in private mode of Safari 17,
56373
- * so the window resolution is not used in Safari 17.
56374
- */
56375
- function getScreenResolution() {
56376
- if (isWebKit() && isWebKit616OrNewer() && isSafariWebKit()) {
56377
- return undefined;
56378
- }
56379
- return getUnstableScreenResolution();
56380
- }
56381
- /**
56382
- * A version of the entropy source without stabilization.
56383
- *
56384
- * Warning for package users:
56385
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
56386
- */
56387
- function getUnstableScreenResolution() {
56388
- var s = screen;
56389
- // Some browsers return screen resolution as strings, e.g. "1200", instead of a number, e.g. 1200.
56390
- // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.
56391
- // Some browsers even return screen resolution as not numbers.
56392
- var parseDimension = function (value) { return replaceNaN(toInt(value), null); };
56393
- var dimensions = [parseDimension(s.width), parseDimension(s.height)];
56394
- dimensions.sort().reverse();
56395
- return dimensions;
56396
- }
56397
-
56398
- var screenFrameCheckInterval = 2500;
56399
- var roundingPrecision = 10;
56400
- // The type is readonly to protect from unwanted mutations
56401
- var screenFrameBackup;
56402
- var screenFrameSizeTimeoutId;
56403
- /**
56404
- * Starts watching the screen frame size. When a non-zero size appears, the size is saved and the watch is stopped.
56405
- * Later, when `getScreenFrame` runs, it will return the saved non-zero size if the current size is null.
56406
- *
56407
- * This trick is required to mitigate the fact that the screen frame turns null in some cases.
56408
- * See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568
56409
- */
56410
- function watchScreenFrame() {
56411
- if (screenFrameSizeTimeoutId !== undefined) {
56412
- return;
56413
- }
56414
- var checkScreenFrame = function () {
56415
- var frameSize = getCurrentScreenFrame();
56416
- if (isFrameSizeNull(frameSize)) {
56417
- screenFrameSizeTimeoutId = setTimeout(checkScreenFrame, screenFrameCheckInterval);
56418
- }
56419
- else {
56420
- screenFrameBackup = frameSize;
56421
- screenFrameSizeTimeoutId = undefined;
56422
- }
56423
- };
56424
- checkScreenFrame();
56425
- }
56426
- /**
56427
- * A version of the entropy source without stabilization.
56428
- *
56429
- * Warning for package users:
56430
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
56431
- */
56432
- function getUnstableScreenFrame() {
56433
- var _this = this;
56434
- watchScreenFrame();
56435
- return function () { return __awaiter(_this, void 0, void 0, function () {
56436
- var frameSize;
56437
- return __generator(this, function (_a) {
56438
- switch (_a.label) {
56439
- case 0:
56440
- frameSize = getCurrentScreenFrame();
56441
- if (!isFrameSizeNull(frameSize)) return [3 /*break*/, 2];
56442
- if (screenFrameBackup) {
56443
- return [2 /*return*/, __spreadArray([], screenFrameBackup, true)];
56444
- }
56445
- if (!getFullscreenElement()) return [3 /*break*/, 2];
56446
- // Some browsers set the screen frame to zero when programmatic fullscreen is on.
56447
- // There is a chance of getting a non-zero frame after exiting the fullscreen.
56448
- // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568
56449
- return [4 /*yield*/, exitFullscreen()];
56450
- case 1:
56451
- // Some browsers set the screen frame to zero when programmatic fullscreen is on.
56452
- // There is a chance of getting a non-zero frame after exiting the fullscreen.
56453
- // See more on this at https://github.com/fingerprintjs/fingerprintjs/issues/568
56454
- _a.sent();
56455
- frameSize = getCurrentScreenFrame();
56456
- _a.label = 2;
56457
- case 2:
56458
- if (!isFrameSizeNull(frameSize)) {
56459
- screenFrameBackup = frameSize;
56460
- }
56461
- return [2 /*return*/, frameSize];
56462
- }
56463
- });
56464
- }); };
56465
- }
56466
- /**
56467
- * A version of the entropy source with stabilization to make it suitable for static fingerprinting.
56468
- *
56469
- * Sometimes the available screen resolution changes a bit, e.g. 1900x1440 → 1900x1439. A possible reason: macOS Dock
56470
- * shrinks to fit more icons when there is too little space. The rounding is used to mitigate the difference.
56471
- *
56472
- * The frame width is always 0 in private mode of Safari 17, so the frame is not used in Safari 17.
56473
- */
56474
- function getScreenFrame() {
56475
- var _this = this;
56476
- if (isWebKit() && isWebKit616OrNewer() && isSafariWebKit()) {
56477
- return function () { return Promise.resolve(undefined); };
56478
- }
56479
- var screenFrameGetter = getUnstableScreenFrame();
56480
- return function () { return __awaiter(_this, void 0, void 0, function () {
56481
- var frameSize, processSize;
56482
- return __generator(this, function (_a) {
56483
- switch (_a.label) {
56484
- case 0: return [4 /*yield*/, screenFrameGetter()];
56485
- case 1:
56486
- frameSize = _a.sent();
56487
- processSize = function (sideSize) { return (sideSize === null ? null : round(sideSize, roundingPrecision)); };
56488
- // It might look like I don't know about `for` and `map`.
56489
- // In fact, such code is used to avoid TypeScript issues without using `as`.
56490
- return [2 /*return*/, [processSize(frameSize[0]), processSize(frameSize[1]), processSize(frameSize[2]), processSize(frameSize[3])]];
56491
- }
56492
- });
56493
- }); };
56494
- }
56495
- function getCurrentScreenFrame() {
56496
- var s = screen;
56497
- // Some browsers return screen resolution as strings, e.g. "1200", instead of a number, e.g. 1200.
56498
- // I suspect it's done by certain plugins that randomize browser properties to prevent fingerprinting.
56499
- //
56500
- // Some browsers (IE, Edge ≤18) don't provide `screen.availLeft` and `screen.availTop`. The property values are
56501
- // replaced with 0 in such cases to not lose the entropy from `screen.availWidth` and `screen.availHeight`.
56502
- return [
56503
- replaceNaN(toFloat(s.availTop), null),
56504
- replaceNaN(toFloat(s.width) - toFloat(s.availWidth) - replaceNaN(toFloat(s.availLeft), 0), null),
56505
- replaceNaN(toFloat(s.height) - toFloat(s.availHeight) - replaceNaN(toFloat(s.availTop), 0), null),
56506
- replaceNaN(toFloat(s.availLeft), null),
56507
- ];
56508
- }
56509
- function isFrameSizeNull(frameSize) {
56510
- for (var i = 0; i < 4; ++i) {
56511
- if (frameSize[i]) {
56512
- return false;
56513
- }
56514
- }
56515
- return true;
56516
- }
56517
-
56518
- function getHardwareConcurrency() {
56519
- // sometimes hardware concurrency is a string
56520
- return replaceNaN(toInt(navigator.hardwareConcurrency), undefined);
56521
- }
56522
-
56523
- function getTimezone() {
56524
- var _a;
56525
- var DateTimeFormat = (_a = window.Intl) === null || _a === void 0 ? void 0 : _a.DateTimeFormat;
56526
- if (DateTimeFormat) {
56527
- var timezone = new DateTimeFormat().resolvedOptions().timeZone;
56528
- if (timezone) {
56529
- return timezone;
56530
- }
56531
- }
56532
- // For browsers that don't support timezone names
56533
- // The minus is intentional because the JS offset is opposite to the real offset
56534
- var offset = -getTimezoneOffset();
56535
- return "UTC".concat(offset >= 0 ? '+' : '').concat(offset);
56536
- }
56537
- function getTimezoneOffset() {
56538
- var currentYear = new Date().getFullYear();
56539
- // The timezone offset may change over time due to daylight saving time (DST) shifts.
56540
- // The non-DST timezone offset is used as the result timezone offset.
56541
- // Since the DST season differs in the northern and the southern hemispheres,
56542
- // both January and July timezones offsets are considered.
56543
- return Math.max(
56544
- // `getTimezoneOffset` returns a number as a string in some unidentified cases
56545
- toFloat(new Date(currentYear, 0, 1).getTimezoneOffset()), toFloat(new Date(currentYear, 6, 1).getTimezoneOffset()));
56546
- }
56547
-
56548
- function getSessionStorage() {
56549
- try {
56550
- return !!window.sessionStorage;
56551
- }
56552
- catch (error) {
56553
- /* SecurityError when referencing it means it exists */
56554
- return true;
56555
- }
56556
- }
56557
-
56558
- // https://bugzilla.mozilla.org/show_bug.cgi?id=781447
56559
- function getLocalStorage() {
56560
- try {
56561
- return !!window.localStorage;
56562
- }
56563
- catch (e) {
56564
- /* SecurityError when referencing it means it exists */
56565
- return true;
56566
- }
56567
- }
56568
-
56569
- function getIndexedDB() {
56570
- // IE and Edge don't allow accessing indexedDB in private mode, therefore IE and Edge will have different
56571
- // visitor identifier in normal and private modes.
56572
- if (isTrident() || isEdgeHTML()) {
56573
- return undefined;
56574
- }
56575
- try {
56576
- return !!window.indexedDB;
56577
- }
56578
- catch (e) {
56579
- /* SecurityError when referencing it means it exists */
56580
- return true;
56581
- }
56582
- }
56583
-
56584
- function getOpenDatabase() {
56585
- return !!window.openDatabase;
56586
- }
56587
-
56588
- function getCpuClass() {
56589
- return navigator.cpuClass;
56590
- }
56591
-
56592
- function getPlatform() {
56593
- // Android Chrome 86 and 87 and Android Firefox 80 and 84 don't mock the platform value when desktop mode is requested
56594
- var platform = navigator.platform;
56595
- // iOS mocks the platform value when desktop version is requested: https://github.com/fingerprintjs/fingerprintjs/issues/514
56596
- // iPad uses desktop mode by default since iOS 13
56597
- // The value is 'MacIntel' on M1 Macs
56598
- // The value is 'iPhone' on iPod Touch
56599
- if (platform === 'MacIntel') {
56600
- if (isWebKit() && !isDesktopWebKit()) {
56601
- return isIPad() ? 'iPad' : 'iPhone';
56602
- }
56603
- }
56604
- return platform;
56605
- }
56606
-
56607
- function getVendor() {
56608
- return navigator.vendor || '';
56609
- }
56610
-
56611
- /**
56612
- * Checks for browser-specific (not engine specific) global variables to tell browsers with the same engine apart.
56613
- * Only somewhat popular browsers are considered.
56614
- */
56615
- function getVendorFlavors() {
56616
- var flavors = [];
56617
- for (var _i = 0, _a = [
56618
- // Blink and some browsers on iOS
56619
- 'chrome',
56620
- // Safari on macOS
56621
- 'safari',
56622
- // Chrome on iOS (checked in 85 on 13 and 87 on 14)
56623
- '__crWeb',
56624
- '__gCrWeb',
56625
- // Yandex Browser on iOS, macOS and Android (checked in 21.2 on iOS 14, macOS and Android)
56626
- 'yandex',
56627
- // Yandex Browser on iOS (checked in 21.2 on 14)
56628
- '__yb',
56629
- '__ybro',
56630
- // Firefox on iOS (checked in 32 on 14)
56631
- '__firefox__',
56632
- // Edge on iOS (checked in 46 on 14)
56633
- '__edgeTrackingPreventionStatistics',
56634
- 'webkit',
56635
- // Opera Touch on iOS (checked in 2.6 on 14)
56636
- 'oprt',
56637
- // Samsung Internet on Android (checked in 11.1)
56638
- 'samsungAr',
56639
- // UC Browser on Android (checked in 12.10 and 13.0)
56640
- 'ucweb',
56641
- 'UCShellJava',
56642
- // Puffin on Android (checked in 9.0)
56643
- 'puffinDevice',
56644
- // UC on iOS and Opera on Android have no specific global variables
56645
- // Edge for Android isn't checked
56646
- ]; _i < _a.length; _i++) {
56647
- var key = _a[_i];
56648
- var value = window[key];
56649
- if (value && typeof value === 'object') {
56650
- flavors.push(key);
56651
- }
56652
- }
56653
- return flavors.sort();
56654
- }
56655
-
56656
- /**
56657
- * navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking
56658
- * cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past with
56659
- * site-specific exceptions. Don't rely on it.
56660
- *
56661
- * @see https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js Taken from here
56662
- */
56663
- function areCookiesEnabled() {
56664
- var d = document;
56665
- // Taken from here: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cookies.js
56666
- // navigator.cookieEnabled cannot detect custom or nuanced cookie blocking configurations. For example, when blocking
56667
- // cookies via the Advanced Privacy Settings in IE9, it always returns true. And there have been issues in the past
56668
- // with site-specific exceptions. Don't rely on it.
56669
- // try..catch because some in situations `document.cookie` is exposed but throws a
56670
- // SecurityError if you try to access it; e.g. documents created from data URIs
56671
- // or in sandboxed iframes (depending on flags/context)
56672
- try {
56673
- // Create cookie
56674
- d.cookie = 'cookietest=1; SameSite=Strict;';
56675
- var result = d.cookie.indexOf('cookietest=') !== -1;
56676
- // Delete cookie
56677
- d.cookie = 'cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT';
56678
- return result;
56679
- }
56680
- catch (e) {
56681
- return false;
56682
- }
56683
- }
56684
-
56685
- /**
56686
- * Only single element selector are supported (no operators like space, +, >, etc).
56687
- * `embed` and `position: fixed;` will be considered as blocked anyway because it always has no offsetParent.
56688
- * Avoid `iframe` and anything with `[src=]` because they produce excess HTTP requests.
56689
- *
56690
- * The "inappropriate" selectors are obfuscated. See https://github.com/fingerprintjs/fingerprintjs/issues/734.
56691
- * A function is used instead of a plain object to help tree-shaking.
56692
- *
56693
- * The function code is generated automatically. See docs/content_blockers.md to learn how to make the list.
56694
- */
56695
- function getFilters() {
56696
- var fromB64 = atob; // Just for better minification
56697
- return {
56698
- abpIndo: [
56699
- '#Iklan-Melayang',
56700
- '#Kolom-Iklan-728',
56701
- '#SidebarIklan-wrapper',
56702
- '[title="ALIENBOLA" i]',
56703
- fromB64('I0JveC1CYW5uZXItYWRz'),
56704
- ],
56705
- abpvn: ['.quangcao', '#mobileCatfish', fromB64('LmNsb3NlLWFkcw=='), '[id^="bn_bottom_fixed_"]', '#pmadv'],
56706
- adBlockFinland: [
56707
- '.mainostila',
56708
- fromB64('LnNwb25zb3JpdA=='),
56709
- '.ylamainos',
56710
- fromB64('YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd'),
56711
- fromB64('YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd'),
56712
- ],
56713
- adBlockPersian: [
56714
- '#navbar_notice_50',
56715
- '.kadr',
56716
- 'TABLE[width="140px"]',
56717
- '#divAgahi',
56718
- fromB64('YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd'),
56719
- ],
56720
- adBlockWarningRemoval: [
56721
- '#adblock-honeypot',
56722
- '.adblocker-root',
56723
- '.wp_adblock_detect',
56724
- fromB64('LmhlYWRlci1ibG9ja2VkLWFk'),
56725
- fromB64('I2FkX2Jsb2NrZXI='),
56726
- ],
56727
- adGuardAnnoyances: [
56728
- '.hs-sosyal',
56729
- '#cookieconsentdiv',
56730
- 'div[class^="app_gdpr"]',
56731
- '.as-oil',
56732
- '[data-cypress="soft-push-notification-modal"]',
56733
- ],
56734
- adGuardBase: [
56735
- '.BetterJsPopOverlay',
56736
- fromB64('I2FkXzMwMFgyNTA='),
56737
- fromB64('I2Jhbm5lcmZsb2F0MjI='),
56738
- fromB64('I2NhbXBhaWduLWJhbm5lcg=='),
56739
- fromB64('I0FkLUNvbnRlbnQ='),
56740
- ],
56741
- adGuardChinese: [
56742
- fromB64('LlppX2FkX2FfSA=='),
56743
- fromB64('YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd'),
56744
- '#widget-quan',
56745
- fromB64('YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd'),
56746
- fromB64('YVtocmVmKj0iLjE5NTZobC5jb20vIl0='),
56747
- ],
56748
- adGuardFrench: [
56749
- '#pavePub',
56750
- fromB64('LmFkLWRlc2t0b3AtcmVjdGFuZ2xl'),
56751
- '.mobile_adhesion',
56752
- '.widgetadv',
56753
- fromB64('LmFkc19iYW4='),
56754
- ],
56755
- adGuardGerman: ['aside[data-portal-id="leaderboard"]'],
56756
- adGuardJapanese: [
56757
- '#kauli_yad_1',
56758
- fromB64('YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0='),
56759
- fromB64('Ll9wb3BJbl9pbmZpbml0ZV9hZA=='),
56760
- fromB64('LmFkZ29vZ2xl'),
56761
- fromB64('Ll9faXNib29zdFJldHVybkFk'),
56762
- ],
56763
- adGuardMobile: [
56764
- fromB64('YW1wLWF1dG8tYWRz'),
56765
- fromB64('LmFtcF9hZA=='),
56766
- 'amp-embed[type="24smi"]',
56767
- '#mgid_iframe1',
56768
- fromB64('I2FkX2ludmlld19hcmVh'),
56769
- ],
56770
- adGuardRussian: [
56771
- fromB64('YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0='),
56772
- fromB64('LnJlY2xhbWE='),
56773
- 'div[id^="smi2adblock"]',
56774
- fromB64('ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd'),
56775
- '#psyduckpockeball',
56776
- ],
56777
- adGuardSocial: [
56778
- fromB64('YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0='),
56779
- fromB64('YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0='),
56780
- '.etsy-tweet',
56781
- '#inlineShare',
56782
- '.popup-social',
56783
- ],
56784
- adGuardSpanishPortuguese: ['#barraPublicidade', '#Publicidade', '#publiEspecial', '#queTooltip', '.cnt-publi'],
56785
- adGuardTrackingProtection: [
56786
- '#qoo-counter',
56787
- fromB64('YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=='),
56788
- fromB64('YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0='),
56789
- fromB64('YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=='),
56790
- '#top100counter',
56791
- ],
56792
- adGuardTurkish: [
56793
- '#backkapat',
56794
- fromB64('I3Jla2xhbWk='),
56795
- fromB64('YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0='),
56796
- fromB64('YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd'),
56797
- fromB64('YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ=='),
56798
- ],
56799
- bulgarian: [fromB64('dGQjZnJlZW5ldF90YWJsZV9hZHM='), '#ea_intext_div', '.lapni-pop-over', '#xenium_hot_offers'],
56800
- easyList: [
56801
- '.yb-floorad',
56802
- fromB64('LndpZGdldF9wb19hZHNfd2lkZ2V0'),
56803
- fromB64('LnRyYWZmaWNqdW5reS1hZA=='),
56804
- '.textad_headline',
56805
- fromB64('LnNwb25zb3JlZC10ZXh0LWxpbmtz'),
56806
- ],
56807
- easyListChina: [
56808
- fromB64('LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=='),
56809
- fromB64('LmZyb250cGFnZUFkdk0='),
56810
- '#taotaole',
56811
- '#aafoot.top_box',
56812
- '.cfa_popup',
56813
- ],
56814
- easyListCookie: [
56815
- '.ezmob-footer',
56816
- '.cc-CookieWarning',
56817
- '[data-cookie-number]',
56818
- fromB64('LmF3LWNvb2tpZS1iYW5uZXI='),
56819
- '.sygnal24-gdpr-modal-wrap',
56820
- ],
56821
- easyListCzechSlovak: [
56822
- '#onlajny-stickers',
56823
- fromB64('I3Jla2xhbW5pLWJveA=='),
56824
- fromB64('LnJla2xhbWEtbWVnYWJvYXJk'),
56825
- '.sklik',
56826
- fromB64('W2lkXj0ic2tsaWtSZWtsYW1hIl0='),
56827
- ],
56828
- easyListDutch: [
56829
- fromB64('I2FkdmVydGVudGll'),
56830
- fromB64('I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=='),
56831
- '.adstekst',
56832
- fromB64('YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0='),
56833
- '#semilo-lrectangle',
56834
- ],
56835
- easyListGermany: [
56836
- '#SSpotIMPopSlider',
56837
- fromB64('LnNwb25zb3JsaW5rZ3J1ZW4='),
56838
- fromB64('I3dlcmJ1bmdza3k='),
56839
- fromB64('I3Jla2xhbWUtcmVjaHRzLW1pdHRl'),
56840
- fromB64('YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0='),
56841
- ],
56842
- easyListItaly: [
56843
- fromB64('LmJveF9hZHZfYW5udW5jaQ=='),
56844
- '.sb-box-pubbliredazionale',
56845
- fromB64('YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd'),
56846
- fromB64('YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd'),
56847
- fromB64('YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ=='),
56848
- ],
56849
- easyListLithuania: [
56850
- fromB64('LnJla2xhbW9zX3RhcnBhcw=='),
56851
- fromB64('LnJla2xhbW9zX251b3JvZG9z'),
56852
- fromB64('aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd'),
56853
- fromB64('aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd'),
56854
- fromB64('aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd'),
56855
- ],
56856
- estonian: [fromB64('QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==')],
56857
- fanboyAnnoyances: ['#ac-lre-player', '.navigate-to-top', '#subscribe_popup', '.newsletter_holder', '#back-top'],
56858
- fanboyAntiFacebook: ['.util-bar-module-firefly-visible'],
56859
- fanboyEnhancedTrackers: [
56860
- '.open.pushModal',
56861
- '#issuem-leaky-paywall-articles-zero-remaining-nag',
56862
- '#sovrn_container',
56863
- 'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',
56864
- '.BlockNag__Card',
56865
- ],
56866
- fanboySocial: ['#FollowUs', '#meteored_share', '#social_follow', '.article-sharer', '.community__social-desc'],
56867
- frellwitSwedish: [
56868
- fromB64('YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=='),
56869
- fromB64('YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=='),
56870
- 'article.category-samarbete',
56871
- fromB64('ZGl2LmhvbGlkQWRz'),
56872
- 'ul.adsmodern',
56873
- ],
56874
- greekAdBlock: [
56875
- fromB64('QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd'),
56876
- fromB64('QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=='),
56877
- fromB64('QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd'),
56878
- 'DIV.agores300',
56879
- 'TABLE.advright',
56880
- ],
56881
- hungarian: [
56882
- '#cemp_doboz',
56883
- '.optimonk-iframe-container',
56884
- fromB64('LmFkX19tYWlu'),
56885
- fromB64('W2NsYXNzKj0iR29vZ2xlQWRzIl0='),
56886
- '#hirdetesek_box',
56887
- ],
56888
- iDontCareAboutCookies: [
56889
- '.alert-info[data-block-track*="CookieNotice"]',
56890
- '.ModuleTemplateCookieIndicator',
56891
- '.o--cookies--container',
56892
- '#cookies-policy-sticky',
56893
- '#stickyCookieBar',
56894
- ],
56895
- icelandicAbp: [fromB64('QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==')],
56896
- latvian: [
56897
- fromB64('YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0O' +
56898
- 'iA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0='),
56899
- fromB64('YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6I' +
56900
- 'DMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ=='),
56901
- ],
56902
- listKr: [
56903
- fromB64('YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0='),
56904
- fromB64('I2xpdmVyZUFkV3JhcHBlcg=='),
56905
- fromB64('YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=='),
56906
- fromB64('aW5zLmZhc3R2aWV3LWFk'),
56907
- '.revenue_unit_item.dable',
56908
- ],
56909
- listeAr: [
56910
- fromB64('LmdlbWluaUxCMUFk'),
56911
- '.right-and-left-sponsers',
56912
- fromB64('YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=='),
56913
- fromB64('YVtocmVmKj0iYm9vcmFxLm9yZyJd'),
56914
- fromB64('YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd'),
56915
- ],
56916
- listeFr: [
56917
- fromB64('YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=='),
56918
- fromB64('I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=='),
56919
- fromB64('YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0='),
56920
- '.site-pub-interstitiel',
56921
- 'div[id^="crt-"][data-criteo-id]',
56922
- ],
56923
- officialPolish: [
56924
- '#ceneo-placeholder-ceneo-12',
56925
- fromB64('W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd'),
56926
- fromB64('YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=='),
56927
- fromB64('YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=='),
56928
- fromB64('ZGl2I3NrYXBpZWNfYWQ='),
56929
- ],
56930
- ro: [
56931
- fromB64('YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd'),
56932
- fromB64('YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd'),
56933
- fromB64('YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0='),
56934
- fromB64('YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd'),
56935
- 'a[href^="/url/"]',
56936
- ],
56937
- ruAd: [
56938
- fromB64('YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd'),
56939
- fromB64('YVtocmVmKj0iLy91dGltZy5ydS8iXQ=='),
56940
- fromB64('YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0='),
56941
- '#pgeldiz',
56942
- '.yandex-rtb-block',
56943
- ],
56944
- thaiAds: [
56945
- 'a[href*=macau-uta-popup]',
56946
- fromB64('I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=='),
56947
- fromB64('LmFkczMwMHM='),
56948
- '.bumq',
56949
- '.img-kosana',
56950
- ],
56951
- webAnnoyancesUltralist: [
56952
- '#mod-social-share-2',
56953
- '#social-tools',
56954
- fromB64('LmN0cGwtZnVsbGJhbm5lcg=='),
56955
- '.zergnet-recommend',
56956
- '.yt.btn-link.btn-md.btn',
56957
- ],
56958
- };
56959
- }
56960
- /**
56961
- * The order of the returned array means nothing (it's always sorted alphabetically).
56962
- *
56963
- * Notice that the source is slightly unstable.
56964
- * Safari provides a 2-taps way to disable all content blockers on a page temporarily.
56965
- * Also content blockers can be disabled permanently for a domain, but it requires 4 taps.
56966
- * So empty array shouldn't be treated as "no blockers", it should be treated as "no signal".
56967
- * If you are a website owner, don't make your visitors want to disable content blockers.
56968
- */
56969
- function getDomBlockers(_a) {
56970
- var _b = _a === void 0 ? {} : _a, debug = _b.debug;
56971
- return __awaiter(this, void 0, void 0, function () {
56972
- var filters, filterNames, allSelectors, blockedSelectors, activeBlockers;
56973
- var _c;
56974
- return __generator(this, function (_d) {
56975
- switch (_d.label) {
56976
- case 0:
56977
- if (!isApplicable()) {
56978
- return [2 /*return*/, undefined];
56979
- }
56980
- filters = getFilters();
56981
- filterNames = Object.keys(filters);
56982
- allSelectors = (_c = []).concat.apply(_c, filterNames.map(function (filterName) { return filters[filterName]; }));
56983
- return [4 /*yield*/, getBlockedSelectors(allSelectors)];
56984
- case 1:
56985
- blockedSelectors = _d.sent();
56986
- if (debug) {
56987
- printDebug(filters, blockedSelectors);
56988
- }
56989
- activeBlockers = filterNames.filter(function (filterName) {
56990
- var selectors = filters[filterName];
56991
- var blockedCount = countTruthy(selectors.map(function (selector) { return blockedSelectors[selector]; }));
56992
- return blockedCount > selectors.length * 0.6;
56993
- });
56994
- activeBlockers.sort();
56995
- return [2 /*return*/, activeBlockers];
56996
- }
56997
- });
56998
- });
56999
- }
57000
- function isApplicable() {
57001
- // Safari (desktop and mobile) and all Android browsers keep content blockers in both regular and private mode
57002
- return isWebKit() || isAndroid();
57003
- }
57004
- function getBlockedSelectors(selectors) {
57005
- var _a;
57006
- return __awaiter(this, void 0, void 0, function () {
57007
- var d, root, elements, blockedSelectors, i, element, holder, i;
57008
- return __generator(this, function (_b) {
57009
- switch (_b.label) {
57010
- case 0:
57011
- d = document;
57012
- root = d.createElement('div');
57013
- elements = new Array(selectors.length);
57014
- blockedSelectors = {} // Set() isn't used just in case somebody need older browser support
57015
- ;
57016
- forceShow(root);
57017
- // First create all elements that can be blocked. If the DOM steps below are done in a single cycle,
57018
- // browser will alternate tree modification and layout reading, that is very slow.
57019
- for (i = 0; i < selectors.length; ++i) {
57020
- element = selectorToElement(selectors[i]);
57021
- if (element.tagName === 'DIALOG') {
57022
- element.show();
57023
- }
57024
- holder = d.createElement('div') // Protects from unwanted effects of `+` and `~` selectors of filters
57025
- ;
57026
- forceShow(holder);
57027
- holder.appendChild(element);
57028
- root.appendChild(holder);
57029
- elements[i] = element;
57030
- }
57031
- _b.label = 1;
57032
- case 1:
57033
- if (!!d.body) return [3 /*break*/, 3];
57034
- return [4 /*yield*/, wait(50)];
57035
- case 2:
57036
- _b.sent();
57037
- return [3 /*break*/, 1];
57038
- case 3:
57039
- d.body.appendChild(root);
57040
- try {
57041
- // Then check which of the elements are blocked
57042
- for (i = 0; i < selectors.length; ++i) {
57043
- if (!elements[i].offsetParent) {
57044
- blockedSelectors[selectors[i]] = true;
57045
- }
57046
- }
57047
- }
57048
- finally {
57049
- // Then remove the elements
57050
- (_a = root.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(root);
57051
- }
57052
- return [2 /*return*/, blockedSelectors];
57053
- }
57054
- });
57055
- });
57056
- }
57057
- function forceShow(element) {
57058
- element.style.setProperty('visibility', 'hidden', 'important');
57059
- element.style.setProperty('display', 'block', 'important');
57060
- }
57061
- function printDebug(filters, blockedSelectors) {
57062
- var message = 'DOM blockers debug:\n```';
57063
- for (var _i = 0, _a = Object.keys(filters); _i < _a.length; _i++) {
57064
- var filterName = _a[_i];
57065
- message += "\n".concat(filterName, ":");
57066
- for (var _b = 0, _c = filters[filterName]; _b < _c.length; _b++) {
57067
- var selector = _c[_b];
57068
- message += "\n ".concat(blockedSelectors[selector] ? '🚫' : '➡️', " ").concat(selector);
57069
- }
57070
- }
57071
- // console.log is ok here because it's under a debug clause
57072
- // eslint-disable-next-line no-console
57073
- console.log("".concat(message, "\n```"));
57074
- }
57075
-
57076
- /**
57077
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/color-gamut
57078
- */
57079
- function getColorGamut() {
57080
- // rec2020 includes p3 and p3 includes srgb
57081
- for (var _i = 0, _a = ['rec2020', 'p3', 'srgb']; _i < _a.length; _i++) {
57082
- var gamut = _a[_i];
57083
- if (matchMedia("(color-gamut: ".concat(gamut, ")")).matches) {
57084
- return gamut;
57085
- }
57086
- }
57087
- return undefined;
57088
- }
57089
-
57090
- /**
57091
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/inverted-colors
57092
- */
57093
- function areColorsInverted() {
57094
- if (doesMatch$5('inverted')) {
57095
- return true;
57096
- }
57097
- if (doesMatch$5('none')) {
57098
- return false;
57099
- }
57100
- return undefined;
57101
- }
57102
- function doesMatch$5(value) {
57103
- return matchMedia("(inverted-colors: ".concat(value, ")")).matches;
57104
- }
57105
-
57106
- /**
57107
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/forced-colors
57108
- */
57109
- function areColorsForced() {
57110
- if (doesMatch$4('active')) {
57111
- return true;
57112
- }
57113
- if (doesMatch$4('none')) {
57114
- return false;
57115
- }
57116
- return undefined;
57117
- }
57118
- function doesMatch$4(value) {
57119
- return matchMedia("(forced-colors: ".concat(value, ")")).matches;
57120
- }
57121
-
57122
- var maxValueToCheck = 100;
57123
- /**
57124
- * If the display is monochrome (e.g. black&white), the value will be ≥0 and will mean the number of bits per pixel.
57125
- * If the display is not monochrome, the returned value will be 0.
57126
- * If the browser doesn't support this feature, the returned value will be undefined.
57127
- *
57128
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/monochrome
57129
- */
57130
- function getMonochromeDepth() {
57131
- if (!matchMedia('(min-monochrome: 0)').matches) {
57132
- // The media feature isn't supported by the browser
57133
- return undefined;
57134
- }
57135
- // A variation of binary search algorithm can be used here.
57136
- // But since expected values are very small (≤10), there is no sense in adding the complexity.
57137
- for (var i = 0; i <= maxValueToCheck; ++i) {
57138
- if (matchMedia("(max-monochrome: ".concat(i, ")")).matches) {
57139
- return i;
57140
- }
57141
- }
57142
- throw new Error('Too high value');
57143
- }
57144
-
57145
- /**
57146
- * @see https://www.w3.org/TR/mediaqueries-5/#prefers-contrast
57147
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-contrast
57148
- */
57149
- function getContrastPreference() {
57150
- if (doesMatch$3('no-preference')) {
57151
- return 0 /* ContrastPreference.None */;
57152
- }
57153
- // The sources contradict on the keywords. Probably 'high' and 'low' will never be implemented.
57154
- // Need to check it when all browsers implement the feature.
57155
- if (doesMatch$3('high') || doesMatch$3('more')) {
57156
- return 1 /* ContrastPreference.More */;
57157
- }
57158
- if (doesMatch$3('low') || doesMatch$3('less')) {
57159
- return -1 /* ContrastPreference.Less */;
57160
- }
57161
- if (doesMatch$3('forced')) {
57162
- return 10 /* ContrastPreference.ForcedColors */;
57163
- }
57164
- return undefined;
57165
- }
57166
- function doesMatch$3(value) {
57167
- return matchMedia("(prefers-contrast: ".concat(value, ")")).matches;
57168
- }
57169
-
57170
- /**
57171
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion
57172
- */
57173
- function isMotionReduced() {
57174
- if (doesMatch$2('reduce')) {
57175
- return true;
57176
- }
57177
- if (doesMatch$2('no-preference')) {
57178
- return false;
57179
- }
57180
- return undefined;
57181
- }
57182
- function doesMatch$2(value) {
57183
- return matchMedia("(prefers-reduced-motion: ".concat(value, ")")).matches;
57184
- }
57185
-
57186
- /**
57187
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-transparency
57188
- */
57189
- function isTransparencyReduced() {
57190
- if (doesMatch$1('reduce')) {
57191
- return true;
57192
- }
57193
- if (doesMatch$1('no-preference')) {
57194
- return false;
57195
- }
57196
- return undefined;
57197
- }
57198
- function doesMatch$1(value) {
57199
- return matchMedia("(prefers-reduced-transparency: ".concat(value, ")")).matches;
57200
- }
57201
-
57202
- /**
57203
- * @see https://www.w3.org/TR/mediaqueries-5/#dynamic-range
57204
- */
57205
- function isHDR() {
57206
- if (doesMatch('high')) {
57207
- return true;
57208
- }
57209
- if (doesMatch('standard')) {
57210
- return false;
57211
- }
57212
- return undefined;
57213
- }
57214
- function doesMatch(value) {
57215
- return matchMedia("(dynamic-range: ".concat(value, ")")).matches;
57216
- }
57217
-
57218
- var M$9 = Math; // To reduce the minified code size
57219
- var fallbackFn = function () { return 0; };
57220
- /**
57221
- * @see https://gitlab.torproject.org/legacy/trac/-/issues/13018
57222
- * @see https://bugzilla.mozilla.org/show_bug.cgi?id=531915
57223
- */
57224
- function getMathFingerprint() {
57225
- // Native operations
57226
- var acos = M$9.acos || fallbackFn;
57227
- var acosh = M$9.acosh || fallbackFn;
57228
- var asin = M$9.asin || fallbackFn;
57229
- var asinh = M$9.asinh || fallbackFn;
57230
- var atanh = M$9.atanh || fallbackFn;
57231
- var atan = M$9.atan || fallbackFn;
57232
- var sin = M$9.sin || fallbackFn;
57233
- var sinh = M$9.sinh || fallbackFn;
57234
- var cos = M$9.cos || fallbackFn;
57235
- var cosh = M$9.cosh || fallbackFn;
57236
- var tan = M$9.tan || fallbackFn;
57237
- var tanh = M$9.tanh || fallbackFn;
57238
- var exp = M$9.exp || fallbackFn;
57239
- var expm1 = M$9.expm1 || fallbackFn;
57240
- var log1p = M$9.log1p || fallbackFn;
57241
- // Operation polyfills
57242
- var powPI = function (value) { return M$9.pow(M$9.PI, value); };
57243
- var acoshPf = function (value) { return M$9.log(value + M$9.sqrt(value * value - 1)); };
57244
- var asinhPf = function (value) { return M$9.log(value + M$9.sqrt(value * value + 1)); };
57245
- var atanhPf = function (value) { return M$9.log((1 + value) / (1 - value)) / 2; };
57246
- var sinhPf = function (value) { return M$9.exp(value) - 1 / M$9.exp(value) / 2; };
57247
- var coshPf = function (value) { return (M$9.exp(value) + 1 / M$9.exp(value)) / 2; };
57248
- var expm1Pf = function (value) { return M$9.exp(value) - 1; };
57249
- var tanhPf = function (value) { return (M$9.exp(2 * value) - 1) / (M$9.exp(2 * value) + 1); };
57250
- var log1pPf = function (value) { return M$9.log(1 + value); };
57251
- // Note: constant values are empirical
57252
- return {
57253
- acos: acos(0.123124234234234242),
57254
- acosh: acosh(1e308),
57255
- acoshPf: acoshPf(1e154),
57256
- asin: asin(0.123124234234234242),
57257
- asinh: asinh(1),
57258
- asinhPf: asinhPf(1),
57259
- atanh: atanh(0.5),
57260
- atanhPf: atanhPf(0.5),
57261
- atan: atan(0.5),
57262
- sin: sin(-1e300),
57263
- sinh: sinh(1),
57264
- sinhPf: sinhPf(1),
57265
- cos: cos(10.000000000123),
57266
- cosh: cosh(1),
57267
- coshPf: coshPf(1),
57268
- tan: tan(-1e300),
57269
- tanh: tanh(1),
57270
- tanhPf: tanhPf(1),
57271
- exp: exp(1),
57272
- expm1: expm1(1),
57273
- expm1Pf: expm1Pf(1),
57274
- log1p: log1p(10),
57275
- log1pPf: log1pPf(10),
57276
- powPI: powPI(-100),
57277
- };
57278
- }
57279
-
57280
- /**
57281
- * We use m or w because these two characters take up the maximum width.
57282
- * Also there are a couple of ligatures.
57283
- */
57284
- var defaultText = 'mmMwWLliI0fiflO&1';
57285
- /**
57286
- * Settings of text blocks to measure. The keys are random but persistent words.
57287
- */
57288
- var presets = {
57289
- /**
57290
- * The default font. User can change it in desktop Chrome, desktop Firefox, IE 11,
57291
- * Android Chrome (but only when the size is ≥ than the default) and Android Firefox.
57292
- */
57293
- default: [],
57294
- /** OS font on macOS. User can change its size and weight. Applies after Safari restart. */
57295
- apple: [{ font: '-apple-system-body' }],
57296
- /** User can change it in desktop Chrome and desktop Firefox. */
57297
- serif: [{ fontFamily: 'serif' }],
57298
- /** User can change it in desktop Chrome and desktop Firefox. */
57299
- sans: [{ fontFamily: 'sans-serif' }],
57300
- /** User can change it in desktop Chrome and desktop Firefox. */
57301
- mono: [{ fontFamily: 'monospace' }],
57302
- /**
57303
- * Check the smallest allowed font size. User can change it in desktop Chrome, desktop Firefox and desktop Safari.
57304
- * The height can be 0 in Chrome on a retina display.
57305
- */
57306
- min: [{ fontSize: '1px' }],
57307
- /** Tells one OS from another in desktop Chrome. */
57308
- system: [{ fontFamily: 'system-ui' }],
57309
- };
57310
- /**
57311
- * The result is a dictionary of the width of the text samples.
57312
- * Heights aren't included because they give no extra entropy and are unstable.
57313
- *
57314
- * The result is very stable in IE 11, Edge 18 and Safari 14.
57315
- * The result changes when the OS pixel density changes in Chromium 87. The real pixel density is required to solve,
57316
- * but seems like it's impossible: https://stackoverflow.com/q/1713771/1118709.
57317
- * The "min" and the "mono" (only on Windows) value may change when the page is zoomed in Firefox 87.
57318
- */
57319
- function getFontPreferences() {
57320
- return withNaturalFonts(function (document, container) {
57321
- var elements = {};
57322
- var sizes = {};
57323
- // First create all elements to measure. If the DOM steps below are done in a single cycle,
57324
- // browser will alternate tree modification and layout reading, that is very slow.
57325
- for (var _i = 0, _a = Object.keys(presets); _i < _a.length; _i++) {
57326
- var key = _a[_i];
57327
- var _b = presets[key], _c = _b[0], style = _c === void 0 ? {} : _c, _d = _b[1], text = _d === void 0 ? defaultText : _d;
57328
- var element = document.createElement('span');
57329
- element.textContent = text;
57330
- element.style.whiteSpace = 'nowrap';
57331
- for (var _e = 0, _f = Object.keys(style); _e < _f.length; _e++) {
57332
- var name_1 = _f[_e];
57333
- var value = style[name_1];
57334
- if (value !== undefined) {
57335
- element.style[name_1] = value;
57336
- }
57337
- }
57338
- elements[key] = element;
57339
- container.append(document.createElement('br'), element);
57340
- }
57341
- // Then measure the created elements
57342
- for (var _g = 0, _h = Object.keys(presets); _g < _h.length; _g++) {
57343
- var key = _h[_g];
57344
- sizes[key] = elements[key].getBoundingClientRect().width;
57345
- }
57346
- return sizes;
57347
- });
57348
- }
57349
- /**
57350
- * Creates a DOM environment that provides the most natural font available, including Android OS font.
57351
- * Measurements of the elements are zoom-independent.
57352
- * Don't put a content to measure inside an absolutely positioned element.
57353
- */
57354
- function withNaturalFonts(action, containerWidthPx) {
57355
- if (containerWidthPx === void 0) { containerWidthPx = 4000; }
57356
- /*
57357
- * Requirements for Android Chrome to apply the system font size to a text inside an iframe:
57358
- * - The iframe mustn't have a `display: none;` style;
57359
- * - The text mustn't be positioned absolutely;
57360
- * - The text block must be wide enough.
57361
- * 2560px on some devices in portrait orientation for the biggest font size option (32px);
57362
- * - There must be much enough text to form a few lines (I don't know the exact numbers);
57363
- * - The text must have the `text-size-adjust: none` style. Otherwise the text will scale in "Desktop site" mode;
57364
- *
57365
- * Requirements for Android Firefox to apply the system font size to a text inside an iframe:
57366
- * - The iframe document must have a header: `<meta name="viewport" content="width=device-width, initial-scale=1" />`.
57367
- * The only way to set it is to use the `srcdoc` attribute of the iframe;
57368
- * - The iframe content must get loaded before adding extra content with JavaScript;
57369
- *
57370
- * https://example.com as the iframe target always inherits Android font settings so it can be used as a reference.
57371
- *
57372
- * Observations on how page zoom affects the measurements:
57373
- * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;
57374
- * - macOS Safari 11.1, 12.1, 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;
57375
- * - macOS Safari 14.0: offsetWidth = 5% fluctuation;
57376
- * - macOS Safari 14.0: getBoundingClientRect = 5% fluctuation;
57377
- * - iOS Safari 9, 10, 11.0, 12.0: haven't found a way to zoom a page (pinch doesn't change layout);
57378
- * - iOS Safari 13.1, 14.0: zoom reset + offsetWidth = 100% reliable;
57379
- * - iOS Safari 13.1, 14.0: zoom reset + getBoundingClientRect = 100% reliable;
57380
- * - iOS Safari 14.0: offsetWidth = 100% reliable;
57381
- * - iOS Safari 14.0: getBoundingClientRect = 100% reliable;
57382
- * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + offsetWidth = 1px fluctuation;
57383
- * - Chrome 42, 65, 80, 87: zoom 1/devicePixelRatio + getBoundingClientRect = 100% reliable;
57384
- * - Chrome 87: offsetWidth = 1px fluctuation;
57385
- * - Chrome 87: getBoundingClientRect = 0.7px fluctuation;
57386
- * - Firefox 48, 51: offsetWidth = 10% fluctuation;
57387
- * - Firefox 48, 51: getBoundingClientRect = 10% fluctuation;
57388
- * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: offsetWidth = width 100% reliable, height 10% fluctuation;
57389
- * - Firefox 52, 53, 57, 62, 66, 67, 68, 71, 75, 80, 84: getBoundingClientRect = width 100% reliable, height 10%
57390
- * fluctuation;
57391
- * - Android Chrome 86: haven't found a way to zoom a page (pinch doesn't change layout);
57392
- * - Android Firefox 84: font size in accessibility settings changes all the CSS sizes, but offsetWidth and
57393
- * getBoundingClientRect keep measuring with regular units, so the size reflects the font size setting and doesn't
57394
- * fluctuate;
57395
- * - IE 11, Edge 18: zoom 1/devicePixelRatio + offsetWidth = 100% reliable;
57396
- * - IE 11, Edge 18: zoom 1/devicePixelRatio + getBoundingClientRect = reflects the zoom level;
57397
- * - IE 11, Edge 18: offsetWidth = 100% reliable;
57398
- * - IE 11, Edge 18: getBoundingClientRect = 100% reliable;
57399
- */
57400
- return withIframe(function (_, iframeWindow) {
57401
- var iframeDocument = iframeWindow.document;
57402
- var iframeBody = iframeDocument.body;
57403
- var bodyStyle = iframeBody.style;
57404
- bodyStyle.width = "".concat(containerWidthPx, "px");
57405
- bodyStyle.webkitTextSizeAdjust = bodyStyle.textSizeAdjust = 'none';
57406
- // See the big comment above
57407
- if (isChromium()) {
57408
- iframeBody.style.zoom = "".concat(1 / iframeWindow.devicePixelRatio);
57409
- }
57410
- else if (isWebKit()) {
57411
- iframeBody.style.zoom = 'reset';
57412
- }
57413
- // See the big comment above
57414
- var linesOfText = iframeDocument.createElement('div');
57415
- linesOfText.textContent = __spreadArray([], Array((containerWidthPx / 20) << 0), true).map(function () { return 'word'; }).join(' ');
57416
- iframeBody.appendChild(linesOfText);
57417
- return action(iframeDocument, iframeBody);
57418
- }, '<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">');
57419
- }
57420
-
57421
- function isPdfViewerEnabled() {
57422
- return navigator.pdfViewerEnabled;
57423
- }
57424
-
57425
- /**
57426
- * Unlike most other architectures, on x86/x86-64 when floating-point instructions
57427
- * have no NaN arguments, but produce NaN output, the output NaN has sign bit set.
57428
- * We use it to distinguish x86/x86-64 from other architectures, by doing subtraction
57429
- * of two infinities (must produce NaN per IEEE 754 standard).
57430
- *
57431
- * See https://codebrowser.bddppq.com/pytorch/pytorch/third_party/XNNPACK/src/init.c.html#79
57432
- */
57433
- function getArchitecture() {
57434
- var f = new Float32Array(1);
57435
- var u8 = new Uint8Array(f.buffer);
57436
- f[0] = Infinity;
57437
- f[0] = f[0] - f[0];
57438
- return u8[3];
57439
- }
57440
-
57441
- /**
57442
- * The return type is a union instead of the enum, because it's too challenging to embed the const enum into another
57443
- * project. Turning it into a union is a simple and an elegant solution.
57444
- */
57445
- function getApplePayState() {
57446
- var ApplePaySession = window.ApplePaySession;
57447
- if (typeof (ApplePaySession === null || ApplePaySession === void 0 ? void 0 : ApplePaySession.canMakePayments) !== 'function') {
57448
- return -1 /* ApplePayState.NoAPI */;
57449
- }
57450
- if (willPrintConsoleError()) {
57451
- return -3 /* ApplePayState.NotAvailableInFrame */;
57452
- }
57453
- try {
57454
- return ApplePaySession.canMakePayments() ? 1 /* ApplePayState.Enabled */ : 0 /* ApplePayState.Disabled */;
57455
- }
57456
- catch (error) {
57457
- return getStateFromError(error);
57458
- }
57459
- }
57460
- /**
57461
- * Starting from Safari 15 calling `ApplePaySession.canMakePayments()` produces this error message when FingerprintJS
57462
- * runs in an iframe with a cross-origin parent page, and the iframe on that page has no allow="payment *" attribute:
57463
- * Feature policy 'Payment' check failed for element with origin 'https://example.com' and allow attribute ''.
57464
- * This function checks whether the error message is expected.
57465
- *
57466
- * We check for cross-origin parents, which is prone to false-positive results. Instead, we should check for allowed
57467
- * feature/permission, but we can't because none of these API works in Safari yet:
57468
- * navigator.permissions.query({ name: ‘payment' })
57469
- * navigator.permissions.query({ name: ‘payment-handler' })
57470
- * document.featurePolicy
57471
- */
57472
- var willPrintConsoleError = isAnyParentCrossOrigin;
57473
- function getStateFromError(error) {
57474
- // See full expected error messages in the test
57475
- if (error instanceof Error && error.name === 'InvalidAccessError' && /\bfrom\b.*\binsecure\b/i.test(error.message)) {
57476
- return -2 /* ApplePayState.NotAvailableInInsecureContext */;
57477
- }
57478
- throw error;
57479
- }
57480
-
57481
- /**
57482
- * Checks whether the Safari's Privacy Preserving Ad Measurement setting is on.
57483
- * The setting is on when the value is not undefined.
57484
- * A.k.a. private click measurement, privacy-preserving ad attribution.
57485
- *
57486
- * Unfortunately, it doesn't work in mobile Safari.
57487
- * Probably, it will start working in mobile Safari or stop working in desktop Safari later.
57488
- * We've found no way to detect the setting state in mobile Safari. Help wanted.
57489
- *
57490
- * @see https://webkit.org/blog/11529/introducing-private-click-measurement-pcm/
57491
- * @see https://developer.apple.com/videos/play/wwdc2021/10033
57492
- */
57493
- function getPrivateClickMeasurement() {
57494
- var _a;
57495
- var link = document.createElement('a');
57496
- var sourceId = (_a = link.attributionSourceId) !== null && _a !== void 0 ? _a : link.attributionsourceid;
57497
- return sourceId === undefined ? undefined : String(sourceId);
57498
- }
57499
-
57500
- /** WebGl context is not available */
57501
- var STATUS_NO_GL_CONTEXT = -1;
57502
- /** WebGL context `getParameter` method is not a function */
57503
- var STATUS_GET_PARAMETER_NOT_A_FUNCTION = -2;
57504
- var validContextParameters = new Set([
57505
- 10752, 2849, 2884, 2885, 2886, 2928, 2929, 2930, 2931, 2932, 2960, 2961, 2962, 2963, 2964, 2965, 2966, 2967, 2968,
57506
- 2978, 3024, 3042, 3088, 3089, 3106, 3107, 32773, 32777, 32777, 32823, 32824, 32936, 32937, 32938, 32939, 32968, 32969,
57507
- 32970, 32971, 3317, 33170, 3333, 3379, 3386, 33901, 33902, 34016, 34024, 34076, 3408, 3410, 3411, 3412, 3413, 3414,
57508
- 3415, 34467, 34816, 34817, 34818, 34819, 34877, 34921, 34930, 35660, 35661, 35724, 35738, 35739, 36003, 36004, 36005,
57509
- 36347, 36348, 36349, 37440, 37441, 37443, 7936, 7937, 7938,
57510
- // SAMPLE_ALPHA_TO_COVERAGE (32926) and SAMPLE_COVERAGE (32928) are excluded because they trigger a console warning
57511
- // in IE, Chrome ≤ 59 and Safari ≤ 13 and give no entropy.
57512
- ]);
57513
- var validExtensionParams = new Set([
57514
- 34047,
57515
- 35723,
57516
- 36063,
57517
- 34852,
57518
- 34853,
57519
- 34854,
57520
- 34229,
57521
- 36392,
57522
- 36795,
57523
- 38449, // MAX_VIEWS_OVR
57524
- ]);
57525
- var shaderTypes = ['FRAGMENT_SHADER', 'VERTEX_SHADER'];
57526
- var precisionTypes = ['LOW_FLOAT', 'MEDIUM_FLOAT', 'HIGH_FLOAT', 'LOW_INT', 'MEDIUM_INT', 'HIGH_INT'];
57527
- var rendererInfoExtensionName = 'WEBGL_debug_renderer_info';
57528
- var polygonModeExtensionName = 'WEBGL_polygon_mode';
57529
- /**
57530
- * Gets the basic and simple WebGL parameters
57531
- */
57532
- function getWebGlBasics(_a) {
57533
- var _b, _c, _d, _e, _f, _g;
57534
- var cache = _a.cache;
57535
- var gl = getWebGLContext(cache);
57536
- if (!gl) {
57537
- return STATUS_NO_GL_CONTEXT;
57538
- }
57539
- if (!isValidParameterGetter(gl)) {
57540
- return STATUS_GET_PARAMETER_NOT_A_FUNCTION;
57541
- }
57542
- var debugExtension = shouldAvoidDebugRendererInfo() ? null : gl.getExtension(rendererInfoExtensionName);
57543
- return {
57544
- version: ((_b = gl.getParameter(gl.VERSION)) === null || _b === void 0 ? void 0 : _b.toString()) || '',
57545
- vendor: ((_c = gl.getParameter(gl.VENDOR)) === null || _c === void 0 ? void 0 : _c.toString()) || '',
57546
- vendorUnmasked: debugExtension ? (_d = gl.getParameter(debugExtension.UNMASKED_VENDOR_WEBGL)) === null || _d === void 0 ? void 0 : _d.toString() : '',
57547
- renderer: ((_e = gl.getParameter(gl.RENDERER)) === null || _e === void 0 ? void 0 : _e.toString()) || '',
57548
- rendererUnmasked: debugExtension ? (_f = gl.getParameter(debugExtension.UNMASKED_RENDERER_WEBGL)) === null || _f === void 0 ? void 0 : _f.toString() : '',
57549
- shadingLanguageVersion: ((_g = gl.getParameter(gl.SHADING_LANGUAGE_VERSION)) === null || _g === void 0 ? void 0 : _g.toString()) || '',
57550
- };
57551
- }
57552
- /**
57553
- * Gets the advanced and massive WebGL parameters and extensions
57554
- */
57555
- function getWebGlExtensions(_a) {
57556
- var cache = _a.cache;
57557
- var gl = getWebGLContext(cache);
57558
- if (!gl) {
57559
- return STATUS_NO_GL_CONTEXT;
57560
- }
57561
- if (!isValidParameterGetter(gl)) {
57562
- return STATUS_GET_PARAMETER_NOT_A_FUNCTION;
57563
- }
57564
- var extensions = gl.getSupportedExtensions();
57565
- var contextAttributes = gl.getContextAttributes();
57566
- var unsupportedExtensions = [];
57567
- // Features
57568
- var attributes = [];
57569
- var parameters = [];
57570
- var extensionParameters = [];
57571
- var shaderPrecisions = [];
57572
- // Context attributes
57573
- if (contextAttributes) {
57574
- for (var _i = 0, _b = Object.keys(contextAttributes); _i < _b.length; _i++) {
57575
- var attributeName = _b[_i];
57576
- attributes.push("".concat(attributeName, "=").concat(contextAttributes[attributeName]));
57577
- }
57578
- }
57579
- // Context parameters
57580
- var constants = getConstantsFromPrototype(gl);
57581
- for (var _c = 0, constants_1 = constants; _c < constants_1.length; _c++) {
57582
- var constant = constants_1[_c];
57583
- var code = gl[constant];
57584
- parameters.push("".concat(constant, "=").concat(code).concat(validContextParameters.has(code) ? "=".concat(gl.getParameter(code)) : ''));
57585
- }
57586
- // Extension parameters
57587
- if (extensions) {
57588
- for (var _d = 0, extensions_1 = extensions; _d < extensions_1.length; _d++) {
57589
- var name_1 = extensions_1[_d];
57590
- if ((name_1 === rendererInfoExtensionName && shouldAvoidDebugRendererInfo()) ||
57591
- (name_1 === polygonModeExtensionName && shouldAvoidPolygonModeExtensions())) {
57592
- continue;
57593
- }
57594
- var extension = gl.getExtension(name_1);
57595
- if (!extension) {
57596
- unsupportedExtensions.push(name_1);
57597
- continue;
57598
- }
57599
- for (var _e = 0, _f = getConstantsFromPrototype(extension); _e < _f.length; _e++) {
57600
- var constant = _f[_e];
57601
- var code = extension[constant];
57602
- extensionParameters.push("".concat(constant, "=").concat(code).concat(validExtensionParams.has(code) ? "=".concat(gl.getParameter(code)) : ''));
57603
- }
57604
- }
57605
- }
57606
- // Shader precision
57607
- for (var _g = 0, shaderTypes_1 = shaderTypes; _g < shaderTypes_1.length; _g++) {
57608
- var shaderType = shaderTypes_1[_g];
57609
- for (var _h = 0, precisionTypes_1 = precisionTypes; _h < precisionTypes_1.length; _h++) {
57610
- var precisionType = precisionTypes_1[_h];
57611
- var shaderPrecision = getShaderPrecision(gl, shaderType, precisionType);
57612
- shaderPrecisions.push("".concat(shaderType, ".").concat(precisionType, "=").concat(shaderPrecision.join(',')));
57613
- }
57614
- }
57615
- // Postprocess
57616
- extensionParameters.sort();
57617
- parameters.sort();
57618
- return {
57619
- contextAttributes: attributes,
57620
- parameters: parameters,
57621
- shaderPrecisions: shaderPrecisions,
57622
- extensions: extensions,
57623
- extensionParameters: extensionParameters,
57624
- unsupportedExtensions: unsupportedExtensions,
57625
- };
57626
- }
57627
- /**
57628
- * This function usually takes the most time to execute in all the sources, therefore we cache its result.
57629
- *
57630
- * Warning for package users:
57631
- * This function is out of Semantic Versioning, i.e. can change unexpectedly. Usage is at your own risk.
57632
- */
57633
- function getWebGLContext(cache) {
57634
- if (cache.webgl) {
57635
- return cache.webgl.context;
57636
- }
57637
- var canvas = document.createElement('canvas');
57638
- var context;
57639
- canvas.addEventListener('webglCreateContextError', function () { return (context = undefined); });
57640
- for (var _i = 0, _a = ['webgl', 'experimental-webgl']; _i < _a.length; _i++) {
57641
- var type = _a[_i];
57642
- try {
57643
- context = canvas.getContext(type);
57644
- }
57645
- catch (_b) {
57646
- // Ok, continue
57647
- }
57648
- if (context) {
57649
- break;
57650
- }
57651
- }
57652
- cache.webgl = { context: context };
57653
- return context;
57654
- }
57655
- /**
57656
- * https://developer.mozilla.org/en-US/docs/Web/API/WebGLShaderPrecisionFormat
57657
- * https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getShaderPrecisionFormat
57658
- * https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.12
57659
- */
57660
- function getShaderPrecision(gl, shaderType, precisionType) {
57661
- var shaderPrecision = gl.getShaderPrecisionFormat(gl[shaderType], gl[precisionType]);
57662
- return shaderPrecision ? [shaderPrecision.rangeMin, shaderPrecision.rangeMax, shaderPrecision.precision] : [];
57663
- }
57664
- function getConstantsFromPrototype(obj) {
57665
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
57666
- var keys = Object.keys(obj.__proto__);
57667
- return keys.filter(isConstantLike);
57668
- }
57669
- function isConstantLike(key) {
57670
- return typeof key === 'string' && !key.match(/[^A-Z0-9_x]/);
57671
- }
57672
- /**
57673
- * Some browsers print a console warning when the WEBGL_debug_renderer_info extension is requested.
57674
- * JS Agent aims to avoid printing messages to console, so we avoid this extension in that browsers.
57675
- */
57676
- function shouldAvoidDebugRendererInfo() {
57677
- return isGecko();
57678
- }
57679
- /**
57680
- * Some browsers print a console warning when the WEBGL_polygon_mode extension is requested.
57681
- * JS Agent aims to avoid printing messages to console, so we avoid this extension in that browsers.
57682
- */
57683
- function shouldAvoidPolygonModeExtensions() {
57684
- return isChromium() || isWebKit();
57685
- }
57686
- /**
57687
- * Some unknown browsers have no `getParameter` method
57688
- */
57689
- function isValidParameterGetter(gl) {
57690
- return typeof gl.getParameter === 'function';
57691
- }
57692
-
57693
- function getAudioContextBaseLatency() {
57694
- // The signal emits warning in Chrome and Firefox, therefore it is enabled on Safari where it doesn't produce warning
57695
- // and on Android where it's less visible
57696
- var isAllowedPlatform = isAndroid() || isWebKit();
57697
- if (!isAllowedPlatform) {
57698
- return -2 /* SpecialFingerprint.Disabled */;
57699
- }
57700
- if (!window.AudioContext) {
57701
- return -1 /* SpecialFingerprint.NotSupported */;
57702
- }
57703
- var latency = new AudioContext().baseLatency;
57704
- if (latency === null || latency === undefined) {
57705
- return -1 /* SpecialFingerprint.NotSupported */;
57706
- }
57707
- if (!isFinite(latency)) {
57708
- return -3 /* SpecialFingerprint.NotFinite */;
57709
- }
57710
- return latency;
57711
- }
57712
-
57713
- /**
57714
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/resolvedOptions
57715
- *
57716
- * The return type is a union instead of a const enum due to the difficulty of embedding const enums in other projects.
57717
- * This makes integration simpler and more elegant.
57718
- */
57719
- function getDateTimeLocale() {
57720
- if (!window.Intl) {
57721
- return -1 /* Status.IntlAPINotSupported */;
57722
- }
57723
- var DateTimeFormat = window.Intl.DateTimeFormat;
57724
- if (!DateTimeFormat) {
57725
- return -2 /* Status.DateTimeFormatNotSupported */;
57726
- }
57727
- var locale = DateTimeFormat().resolvedOptions().locale;
57728
- if (!locale && locale !== '') {
57729
- return -3 /* Status.LocaleNotAvailable */;
57730
- }
57731
- return locale;
57732
- }
57733
-
57734
- /**
57735
- * The list of entropy sources used to make visitor identifiers.
57736
- *
57737
- * This value isn't restricted by Semantic Versioning, i.e. it may be changed without bumping minor or major version of
57738
- * this package.
57739
- *
57740
- * Note: Rollup and Webpack are smart enough to remove unused properties of this object during tree-shaking, so there is
57741
- * no need to export the sources individually.
57742
- */
57743
- var sources = {
57744
- // READ FIRST:
57745
- // See https://github.com/fingerprintjs/fingerprintjs/blob/master/contributing.md#how-to-add-an-entropy-source
57746
- // to learn how entropy source works and how to make your own.
57747
- // The sources run in this exact order.
57748
- // The asynchronous sources are at the start to run in parallel with other sources.
57749
- fonts: getFonts,
57750
- domBlockers: getDomBlockers,
57751
- fontPreferences: getFontPreferences,
57752
- audio: getAudioFingerprint,
57753
- screenFrame: getScreenFrame,
57754
- canvas: getCanvasFingerprint,
57755
- osCpu: getOsCpu,
57756
- languages: getLanguages,
57757
- colorDepth: getColorDepth,
57758
- deviceMemory: getDeviceMemory,
57759
- screenResolution: getScreenResolution,
57760
- hardwareConcurrency: getHardwareConcurrency,
57761
- timezone: getTimezone,
57762
- sessionStorage: getSessionStorage,
57763
- localStorage: getLocalStorage,
57764
- indexedDB: getIndexedDB,
57765
- openDatabase: getOpenDatabase,
57766
- cpuClass: getCpuClass,
57767
- platform: getPlatform,
57768
- plugins: getPlugins,
57769
- touchSupport: getTouchSupport,
57770
- vendor: getVendor,
57771
- vendorFlavors: getVendorFlavors,
57772
- cookiesEnabled: areCookiesEnabled,
57773
- colorGamut: getColorGamut,
57774
- invertedColors: areColorsInverted,
57775
- forcedColors: areColorsForced,
57776
- monochrome: getMonochromeDepth,
57777
- contrast: getContrastPreference,
57778
- reducedMotion: isMotionReduced,
57779
- reducedTransparency: isTransparencyReduced,
57780
- hdr: isHDR,
57781
- math: getMathFingerprint,
57782
- pdfViewerEnabled: isPdfViewerEnabled,
57783
- architecture: getArchitecture,
57784
- applePay: getApplePayState,
57785
- privateClickMeasurement: getPrivateClickMeasurement,
57786
- audioBaseLatency: getAudioContextBaseLatency,
57787
- dateTimeLocale: getDateTimeLocale,
57788
- // Some sources can affect other sources (e.g. WebGL can affect canvas), so it's important to run these sources
57789
- // after other sources.
57790
- webGlBasics: getWebGlBasics,
57791
- webGlExtensions: getWebGlExtensions,
57792
- };
57793
- /**
57794
- * Loads the built-in entropy sources.
57795
- * Returns a function that collects the entropy components to make the visitor identifier.
57796
- */
57797
- function loadBuiltinSources(options) {
57798
- return loadSources(sources, options, []);
57799
- }
57800
-
57801
- var commentTemplate = '$ if upgrade to Pro: https://fpjs.dev/pro';
57802
- function getConfidence(components) {
57803
- var openConfidenceScore = getOpenConfidenceScore(components);
57804
- var proConfidenceScore = deriveProConfidenceScore(openConfidenceScore);
57805
- return { score: openConfidenceScore, comment: commentTemplate.replace(/\$/g, "".concat(proConfidenceScore)) };
57806
- }
57807
- function getOpenConfidenceScore(components) {
57808
- // In order to calculate the true probability of the visitor identifier being correct, we need to know the number of
57809
- // website visitors (the higher the number, the less the probability because the fingerprint entropy is limited).
57810
- // JS agent doesn't know the number of visitors, so we can only do an approximate assessment.
57811
- if (isAndroid()) {
57812
- return 0.4;
57813
- }
57814
- // Safari (mobile and desktop)
57815
- if (isWebKit()) {
57816
- return isDesktopWebKit() && !(isWebKit616OrNewer() && isSafariWebKit()) ? 0.5 : 0.3;
57817
- }
57818
- var platform = 'value' in components.platform ? components.platform.value : '';
57819
- // Windows
57820
- if (/^Win/.test(platform)) {
57821
- // The score is greater than on macOS because of the higher variety of devices running Windows.
57822
- // Chrome provides more entropy than Firefox according too
57823
- // https://netmarketshare.com/browser-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22platform%22%3A%7B%22%24in%22%3A%5B%22Windows%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Trend%22%2C%22attributes%22%3A%22share%22%2C%22group%22%3A%22browser%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22browsersDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222019-11%22%2C%22dateEnd%22%3A%222020-10%22%2C%22segments%22%3A%22-1000%22%7D
57824
- // So we assign the same score to them.
57825
- return 0.6;
57826
- }
57827
- // macOS
57828
- if (/^Mac/.test(platform)) {
57829
- // Chrome provides more entropy than Safari and Safari provides more entropy than Firefox.
57830
- // Chrome is more popular than Safari and Safari is more popular than Firefox according to
57831
- // https://netmarketshare.com/browser-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22platform%22%3A%7B%22%24in%22%3A%5B%22Mac%20OS%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Trend%22%2C%22attributes%22%3A%22share%22%2C%22group%22%3A%22browser%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22browsersDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222019-11%22%2C%22dateEnd%22%3A%222020-10%22%2C%22segments%22%3A%22-1000%22%7D
57832
- // So we assign the same score to them.
57833
- return 0.5;
57834
- }
57835
- // Another platform, e.g. a desktop Linux. It's rare, so it should be pretty unique.
57836
- return 0.7;
57837
- }
57838
- function deriveProConfidenceScore(openConfidenceScore) {
57839
- return round(0.99 + 0.01 * openConfidenceScore, 0.0001);
57840
- }
57841
-
57842
- function componentsToCanonicalString(components) {
57843
- var result = '';
57844
- for (var _i = 0, _a = Object.keys(components).sort(); _i < _a.length; _i++) {
57845
- var componentKey = _a[_i];
57846
- var component = components[componentKey];
57847
- var value = 'error' in component ? 'error' : JSON.stringify(component.value);
57848
- result += "".concat(result ? '|' : '').concat(componentKey.replace(/([:|\\])/g, '\\$1'), ":").concat(value);
57849
- }
57850
- return result;
57851
- }
57852
- function componentsToDebugString(components) {
57853
- return JSON.stringify(components, function (_key, value) {
57854
- if (value instanceof Error) {
57855
- return errorToObject(value);
57856
- }
57857
- return value;
57858
- }, 2);
57859
- }
57860
- function hashComponents(components) {
57861
- return x64hash128(componentsToCanonicalString(components));
57862
- }
57863
- /**
57864
- * Makes a GetResult implementation that calculates the visitor id hash on demand.
57865
- * Designed for optimisation.
57866
- */
57867
- function makeLazyGetResult(components) {
57868
- var visitorIdCache;
57869
- // This function runs very fast, so there is no need to make it lazy
57870
- var confidence = getConfidence(components);
57871
- // A plain class isn't used because its getters and setters aren't enumerable.
57872
- return {
57873
- get visitorId() {
57874
- if (visitorIdCache === undefined) {
57875
- visitorIdCache = hashComponents(this.components);
57876
- }
57877
- return visitorIdCache;
57878
- },
57879
- set visitorId(visitorId) {
57880
- visitorIdCache = visitorId;
57881
- },
57882
- confidence: confidence,
57883
- components: components,
57884
- version: version$1,
57885
- };
57886
- }
57887
- /**
57888
- * A delay is required to ensure consistent entropy components.
57889
- * See https://github.com/fingerprintjs/fingerprintjs/issues/254
57890
- * and https://github.com/fingerprintjs/fingerprintjs/issues/307
57891
- * and https://github.com/fingerprintjs/fingerprintjs/commit/945633e7c5f67ae38eb0fea37349712f0e669b18
57892
- */
57893
- function prepareForSources(delayFallback) {
57894
- if (delayFallback === void 0) { delayFallback = 50; }
57895
- // A proper deadline is unknown. Let it be twice the fallback timeout so that both cases have the same average time.
57896
- return requestIdleCallbackIfAvailable(delayFallback, delayFallback * 2);
57897
- }
57898
- /**
57899
- * The function isn't exported from the index file to not allow to call it without `load()`.
57900
- * The hiding gives more freedom for future non-breaking updates.
57901
- *
57902
- * A factory function is used instead of a class to shorten the attribute names in the minified code.
57903
- * Native private class fields could've been used, but TypeScript doesn't allow them with `"target": "es5"`.
57904
- */
57905
- function makeAgent(getComponents, debug) {
57906
- var creationTime = Date.now();
57907
- return {
57908
- get: function (options) {
57909
- return __awaiter(this, void 0, void 0, function () {
57910
- var startTime, components, result;
57911
- return __generator(this, function (_a) {
57912
- switch (_a.label) {
57913
- case 0:
57914
- startTime = Date.now();
57915
- return [4 /*yield*/, getComponents()];
57916
- case 1:
57917
- components = _a.sent();
57918
- result = makeLazyGetResult(components);
57919
- if (debug || (options === null || options === void 0 ? void 0 : options.debug)) {
57920
- // console.log is ok here because it's under a debug clause
57921
- // eslint-disable-next-line no-console
57922
- console.log("Copy the text below to get the debug data:\n\n```\nversion: ".concat(result.version, "\nuserAgent: ").concat(navigator.userAgent, "\ntimeBetweenLoadAndGet: ").concat(startTime - creationTime, "\nvisitorId: ").concat(result.visitorId, "\ncomponents: ").concat(componentsToDebugString(components), "\n```"));
57923
- }
57924
- return [2 /*return*/, result];
57925
- }
57926
- });
57927
- });
57928
- },
57929
- };
57930
- }
57931
- /**
57932
- * Sends an unpersonalized AJAX request to collect installation statistics
57933
- */
57934
- function monitor() {
57935
- // The FingerprintJS CDN (https://github.com/fingerprintjs/cdn) replaces `window.__fpjs_d_m` with `true`
57936
- if (window.__fpjs_d_m || Math.random() >= 0.001) {
57937
- return;
57938
- }
57939
- try {
57940
- var request = new XMLHttpRequest();
57941
- request.open('get', "https://m1.openfpcdn.io/fingerprintjs/v".concat(version$1, "/npm-monitoring"), true);
57942
- request.send();
57943
- }
57944
- catch (error) {
57945
- // console.error is ok here because it's an unexpected error handler
57946
- // eslint-disable-next-line no-console
57947
- console.error(error);
57948
- }
57949
- }
57950
- /**
57951
- * Builds an instance of Agent and waits a delay required for a proper operation.
57952
- */
57953
- function load$1(options) {
57954
- var _a;
57955
- if (options === void 0) { options = {}; }
57956
- return __awaiter(this, void 0, void 0, function () {
57957
- var delayFallback, debug, getComponents;
57958
- return __generator(this, function (_b) {
57959
- switch (_b.label) {
57960
- case 0:
57961
- if ((_a = options.monitoring) !== null && _a !== void 0 ? _a : true) {
57962
- monitor();
57963
- }
57964
- delayFallback = options.delayFallback, debug = options.debug;
57965
- return [4 /*yield*/, prepareForSources(delayFallback)];
57966
- case 1:
57967
- _b.sent();
57968
- getComponents = loadBuiltinSources({ cache: {}, debug: debug });
57969
- return [2 /*return*/, makeAgent(getComponents, debug)];
57970
- }
57971
- });
57972
- });
57973
- }
57974
-
57975
- // The default export is a syntax sugar (`import * as FP from '...' → import FP from '...'`).
57976
- // It should contain all the public exported values.
57977
- var index$2 = { load: load$1, hashComponents: hashComponents, componentsToDebugString: componentsToDebugString };
57978
-
57979
- const fpPromise = index$2.load();
57980
54714
  function getLocalIp() {
57981
54715
  return new Promise((resolve) => {
57982
54716
  const pc = new RTCPeerConnection({ iceServers: [] });
@@ -58015,16 +54749,11 @@ function getHardwareInfo() {
58015
54749
  return hardwareInfo;
58016
54750
  }
58017
54751
  async function generateDeviceId(userIp) {
58018
- let browserFinger = "";
58019
54752
  let hardwareInfo = getHardwareInfo();
58020
54753
  if (!userIp) {
58021
54754
  userIp = window.location.hostname;
58022
54755
  }
58023
- await fpPromise.then((fp) => fp.get()).then((result) => {
58024
- browserFinger = result.visitorId;
58025
- console.log("Browser Fingerprint:", browserFinger);
58026
- });
58027
- const data = { browserFinger, hardwareInfo, userIp };
54756
+ const data = { hardwareInfo, userIp };
58028
54757
  let deviceId = btoa(JSON.stringify(data));
58029
54758
  sessionStorage.setItem("deviceId", deviceId);
58030
54759
  return deviceId;
@@ -68972,7 +65701,7 @@ function getWeek(date) {
68972
65701
  if (target.getDay() !== 4) {
68973
65702
  target.setMonth(0, 1 + (4 - target.getDay() + 7) % 7);
68974
65703
  }
68975
- return 1 + Math.ceil((firstThursday - target) / 6048e5);
65704
+ return 1 + Math.ceil((firstThursday - target.valueOf()) / 6048e5);
68976
65705
  }
68977
65706
  function parseDateByType(val, type, needSecond = false, split = "-") {
68978
65707
  if (!val || val == "undefined" || val == "-") {
@@ -68980,9 +65709,8 @@ function parseDateByType(val, type, needSecond = false, split = "-") {
68980
65709
  }
68981
65710
  try {
68982
65711
  if (Array.isArray(val) && type.includes("range")) {
68983
- if (v instanceof Date) return v;
68984
- if (typeof v === "string" && /^\d+$/.test(v)) return Number(v);
68985
- return v;
65712
+ const start = val[0];
65713
+ const end = val[1];
68986
65714
  const formatStart = parseDateByType(start, type.replace("range", ""), needSecond, split);
68987
65715
  const formatEnd = parseDateByType(end, type.replace("range", ""), needSecond, split);
68988
65716
  return `${formatStart} 至 ${formatEnd}`;
@@ -93437,7 +90165,7 @@ async function loadData(url, params, orderBy = []) {
93437
90165
  let data = null;
93438
90166
  let error2 = "";
93439
90167
  let cond = params;
93440
- if (params instanceof Array) {
90168
+ if (Array.isArray(params)) {
93441
90169
  cond = {
93442
90170
  fieldList: params,
93443
90171
  orderBy
@@ -93589,18 +90317,18 @@ async function deleteByIds(url, ids, msg = "确认需要删除选择的数据吗
93589
90317
  });
93590
90318
  return objData;
93591
90319
  }
93592
- async function dictData(dictType, exclusion = []) {
90320
+ async function dictData(dictType, exclusion = [], userUrl) {
93593
90321
  const query = [];
93594
90322
  query.push({
93595
90323
  propertyName: "dictType",
93596
90324
  value: dictType
93597
90325
  });
93598
90326
  const dicts = [];
93599
- await postRequest(dictUrl, { fieldList: query }).then((res) => {
90327
+ await postRequest(userUrl ?? dictUrl, { fieldList: query }).then((res) => {
93600
90328
  const redata = res.data;
93601
90329
  if (redata.code == 0) {
93602
90330
  redata.data?.forEach((item) => {
93603
- if (exclusion && exclusion.includes(item.dictCode)) {
90331
+ if (exclusion?.includes(item.dictCode)) {
93604
90332
  return;
93605
90333
  }
93606
90334
  dicts.push({ name: item.dictName, value: item.dictCode });
@@ -93661,15 +90389,15 @@ function createCondition(name, val, matchType = "eq") {
93661
90389
  return { propertyName: name, value: val, operation: matchType };
93662
90390
  }
93663
90391
  function isJson(v) {
93664
- if (v && typeof v === "string") {
93665
- const start = v.substring(0, 1);
93666
- const end = v.substring(v.length - 1, v.length);
93667
- return start == "{" && end == "}" || start == "[" && end == "]";
93668
- }
93669
- if (typeof v === "object" && Object.prototype.toString.call(v).toLowerCase() === "[object object]" && !v.length) {
93670
- return true;
90392
+ if (typeof v === "string") {
90393
+ try {
90394
+ JSON.parse(v);
90395
+ return true;
90396
+ } catch {
90397
+ return false;
90398
+ }
93671
90399
  }
93672
- return false;
90400
+ return typeof v === "object" && v !== null && Object.prototype.toString.call(v) === "[object Object]";
93673
90401
  }
93674
90402
  function formFieldMapping(fieldList) {
93675
90403
  let defaultDatas = {};
@@ -93834,7 +90562,7 @@ async function compDynamicData(preps) {
93834
90562
  }
93835
90563
  return reDataList;
93836
90564
  }
93837
- async function dynamicUrlOperation(preps, queryInfo) {
90565
+ async function dynamicUrlOperation(preps, queryInfo, proxyUrl) {
93838
90566
  const temp = preps;
93839
90567
  const reDataList = [];
93840
90568
  const requestParams = [];
@@ -93865,7 +90593,7 @@ async function dynamicUrlOperation(preps, queryInfo) {
93865
90593
  fieldList: requestParams
93866
90594
  }
93867
90595
  };
93868
- url = "/system-config/redirect/execute";
90596
+ url = proxyUrl ?? "/system-config/redirect/execute";
93869
90597
  const validResult = await loadData(url, params);
93870
90598
  if (validResult.error) {
93871
90599
  error$1(validResult.error);
@@ -93896,19 +90624,6 @@ async function createFilter(queryString) {
93896
90624
  return restaurant?.name?.toLowerCase().search(queryString?.toLowerCase()) || restaurant?.value?.toString()?.toLowerCase().search(queryString?.toLowerCase());
93897
90625
  };
93898
90626
  }
93899
- async function dbConfigList() {
93900
- const { data, error: error2 } = await loadGetData("/userdb-manage/dbsearch/dbinfoEntity/getDbInfoByUser");
93901
- if (error2) {
93902
- warning$2(error2);
93903
- return [];
93904
- }
93905
- return data?.map((item) => {
93906
- return {
93907
- name: item.name,
93908
- value: item.configId + ""
93909
- };
93910
- });
93911
- }
93912
90627
  function apiInstance(appName, urlPrefix, condition = []) {
93913
90628
  const prefix = `/${appName}/${urlPrefix}`;
93914
90629
  const apiUrls = {
@@ -94065,7 +90780,6 @@ function v4(options, buf, offset) {
94065
90780
  const _sfc_main$1Q = /* @__PURE__ */ defineComponent({
94066
90781
  __name: "App",
94067
90782
  setup(__props) {
94068
- ref({});
94069
90783
  return (_ctx, _cache) => {
94070
90784
  return null;
94071
90785
  };
@@ -108721,7 +105435,7 @@ const p$5 = {
108721
105435
  prefix: "fas",
108722
105436
  iconName: "code",
108723
105437
  icon: [640, 512, [], "f121", "M392.8 1.2c-17-4.9-34.7 5-39.6 22l-128 448c-4.9 17 5 34.7 22 39.6s34.7-5 39.6-22l128-448c4.9-17-5-34.7-22-39.6zm80.6 120.1c-12.5 12.5-12.5 32.8 0 45.3L562.7 256l-89.4 89.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l112-112c12.5-12.5 12.5-32.8 0-45.3l-112-112c-12.5-12.5-32.8-12.5-45.3 0zm-306.7 0c-12.5-12.5-32.8-12.5-45.3 0l-112 112c-12.5 12.5-12.5 32.8 0 45.3l112 112c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256l89.4-89.4c12.5-12.5 12.5-32.8 0-45.3z"]
108724
- }, v$4 = {
105438
+ }, v$3 = {
108725
105439
  prefix: "fas",
108726
105440
  iconName: "wrench",
108727
105441
  icon: [512, 512, [128295], "f0ad", "M352 320c88.4 0 160-71.6 160-160c0-15.3-2.2-30.1-6.2-44.2c-3.1-10.8-16.4-13.2-24.3-5.3l-76.8 76.8c-3 3-7.1 4.7-11.3 4.7L336 192c-8.8 0-16-7.2-16-16l0-57.4c0-4.2 1.7-8.3 4.7-11.3l76.8-76.8c7.9-7.9 5.4-21.2-5.3-24.3C382.1 2.2 367.3 0 352 0C263.6 0 192 71.6 192 160c0 19.1 3.4 37.5 9.5 54.5L19.9 396.1C7.2 408.8 0 426.1 0 444.1C0 481.6 30.4 512 67.9 512c18 0 35.3-7.2 48-19.9L297.5 310.5c17 6.2 35.4 9.5 54.5 9.5zM80 408a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]
@@ -114916,7 +111630,7 @@ Object.getOwnPropertyNames(s).filter((t) => !I$3.includes(t) && x$3[t] === void
114916
111630
  x$3[t] = s[t];
114917
111631
  });
114918
111632
  x$3.Jsep = s;
114919
- const v$3 = "ConditionalExpression";
111633
+ const v$2 = "ConditionalExpression";
114920
111634
  var R$4 = {
114921
111635
  name: "ternary",
114922
111636
  init(t) {
@@ -114928,7 +111642,7 @@ var R$4 = {
114928
111642
  this.index++;
114929
111643
  const o = this.gobbleExpression();
114930
111644
  if (o || this.throwError("Expected expression"), r.node = {
114931
- type: v$3,
111645
+ type: v$2,
114932
111646
  test: n,
114933
111647
  consequent: i,
114934
111648
  alternate: o
@@ -128976,12 +125690,12 @@ function p$3(e, r, n) {
128976
125690
  throw new Error("Path does not exist");
128977
125691
  }
128978
125692
  const V$1 = /^\d+$/;
128979
- function v$2(e, r, n) {
125693
+ function v$1(e, r, n) {
128980
125694
  if (r.length === 0)
128981
125695
  return n(e);
128982
125696
  if (!E$2(e))
128983
125697
  throw new Error("Path doesn't exist");
128984
- const t = r[0], o = v$2(e[t], r.slice(1), n);
125698
+ const t = r[0], o = v$1(e[t], r.slice(1), n);
128985
125699
  return J$1(e, t, o);
128986
125700
  }
128987
125701
  function P$6(e, r) {
@@ -129002,7 +125716,7 @@ function P$6(e, r) {
129002
125716
  }
129003
125717
  function m$2(e, r, n) {
129004
125718
  const t = r.slice(0, r.length - 1), o = r[r.length - 1];
129005
- return v$2(e, t, (i) => {
125719
+ return v$1(e, t, (i) => {
129006
125720
  if (!Array.isArray(i))
129007
125721
  throw new TypeError("Array expected at path " + JSON.stringify(t));
129008
125722
  const s = S$2(i);
@@ -136619,7 +133333,7 @@ function Ka(t, e, n) {
136619
133333
  }
136620
133334
  function wf(t, e, n, r, a) {
136621
133335
  var s = eg(t, e, n, a);
136622
- return v$2(s, Zi(t, n), (i) => {
133336
+ return v$1(s, Zi(t, n), (i) => {
136623
133337
  var l = a$1(t, n);
136624
133338
  return r(l, i);
136625
133339
  });
@@ -140310,8 +137024,8 @@ function Zw(t, e) {
140310
137024
  p$1(O, [{ type: "space" }, { type: "button", icon: Q$3, title: "Cancel repair", className: "jse-cancel", onClick: g() }]);
140311
137025
  }), L$2(() => B$4, () => {
140312
137026
  p$1(a, { icon: B$4, text: "Show me", title: "Scroll to the error location", onClick: y });
140313
- }), L$2(() => v$4, () => {
140314
- p$1(s, { icon: v$4, text: "Auto repair", title: "Automatically repair JSON", onClick: R });
137027
+ }), L$2(() => v$3, () => {
137028
+ p$1(s, { icon: v$3, text: "Auto repair", title: "Automatically repair JSON", onClick: R });
140315
137029
  }), L$2(() => (o$2(r), o$2(a), o$2(s)), () => {
140316
137030
  p$1(i, o$2(r) ? [o$2(a), o$2(s)] : [o$2(a)]);
140317
137031
  }), L$2(() => z$2(u()), () => {
@@ -144039,7 +140753,7 @@ function Ad(t, e) {
144039
140753
  var Qe = ne$1(() => "You pasted a JSON ".concat(Array.isArray(o$2(it).contents) ? "array" : "object", " as text"));
144040
140754
  To(Je, { type: "info", get message() {
144041
140755
  return o$2(Qe);
144042
- }, actions: [{ icon: v$4, text: "Paste as JSON instead", title: "Replace the value with the pasted JSON", onMouseDown: _n }, { text: "Leave as is", title: "Keep the JSON embedded in the value", onClick: Un }] });
140756
+ }, actions: [{ icon: v$3, text: "Paste as JSON instead", title: "Replace the value with the pasted JSON", onMouseDown: _n }, { text: "Leave as is", title: "Keep the JSON embedded in the value", onClick: Un }] });
144043
140757
  };
144044
140758
  K$2(rr, (Je) => {
144045
140759
  o$2(it) && Je(In);
@@ -145156,8 +141870,8 @@ function X2(t, e) {
145156
141870
  })(a());
145157
141871
  }), L$2(() => (o$2(he), z$2(h())), () => {
145158
141872
  o$2(he) !== h() && (p$1(he, h()), H("forceUpdateText", { escapeUnicodeCharacters: h() }), re && re.dispatch({ changes: { from: 0, to: re.state.doc.length, insert: o$2(n).escapeValue(o$2(G)) } }));
145159
- }), L$2(() => (o$2(_t), z$2(a()), v$4), () => {
145160
- p$1(r, o$2(_t) !== Qv || a() ? [dr] : [{ icon: v$4, text: "Auto repair", title: "Automatically repair JSON", onClick: xe }, dr]);
141873
+ }), L$2(() => (o$2(_t), z$2(a()), v$3), () => {
141874
+ p$1(r, o$2(_t) !== Qv || a() ? [dr] : [{ icon: v$3, text: "Auto repair", title: "Automatically repair JSON", onClick: xe }, dr]);
145161
141875
  }), hn$1(), pt$1(true);
145162
141876
  var xr, hr = Z2(), Nn = M$1(hr), qn = ($) => {
145163
141877
  var ke = ne$1(() => o$2(G).length === 0), He = ne$1(() => !o$2(ke)), St = ne$1(() => !o$2(ke)), Ve = ne$1(() => !o$2(ke)), Et = ne$1(() => !o$2(ke));
@@ -146381,7 +143095,7 @@ function OC(t, e) {
146381
143095
  var vn = ne$1(() => "You pasted a JSON ".concat(Array.isArray(o$2(he).contents) ? "array" : "object", " as text"));
146382
143096
  To(Qe, { type: "info", get message() {
146383
143097
  return o$2(vn);
146384
- }, actions: [{ icon: v$4, text: "Paste as JSON instead", title: "Paste the text as JSON instead of a single value", onMouseDown: qn }, { text: "Leave as is", title: "Keep the pasted content as a single value", onClick: $ }] });
143098
+ }, actions: [{ icon: v$3, text: "Paste as JSON instead", title: "Paste the text as JSON instead of a single value", onMouseDown: qn }, { text: "Leave as is", title: "Keep the pasted content as a single value", onClick: $ }] });
146385
143099
  };
146386
143100
  K$2(In, (Qe) => {
146387
143101
  o$2(he) && Qe(Fn);
@@ -148322,7 +145036,7 @@ const _sfc_main$1f = /* @__PURE__ */ defineComponent({
148322
145036
 
148323
145037
  /* unplugin-vue-components disabled */
148324
145038
 
148325
- const StarHorseJsonEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1f, [["__scopeId", "data-v-6f2b3c1e"]]);
145039
+ const StarHorseJsonEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1f, [["__scopeId", "data-v-dcf0d633"]]);
148326
145040
 
148327
145041
  const StarHorseJsonEditor$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
148328
145042
  __proto__: null,
@@ -159232,7 +155946,7 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
159232
155946
 
159233
155947
  /* unplugin-vue-components disabled */
159234
155948
 
159235
- const dialogInputItem = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-4f9e67c1"]]);
155949
+ const dialogInputItem = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-4ec42551"]]);
159236
155950
 
159237
155951
  const dialogInputItem$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
159238
155952
  __proto__: null,
@@ -159373,7 +156087,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
159373
156087
  default: withCtx(() => [
159374
156088
  createElementVNode("div", {
159375
156089
  class: "user_html",
159376
- innerHTML: formData.value.value[props.field.preps["name"]] || __props.field.preps["content"]
156090
+ innerHTML: formData.value[__props.field.preps["name"]] || __props.field.preps["content"]
159377
156091
  }, null, 8, _hoisted_1$e)
159378
156092
  ]),
159379
156093
  _: 1
@@ -159384,7 +156098,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
159384
156098
 
159385
156099
  /* unplugin-vue-components disabled */
159386
156100
 
159387
- const htmlItem = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-1e0c8396"]]);
156101
+ const htmlItem = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-8572e673"]]);
159388
156102
 
159389
156103
  const htmlItem$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
159390
156104
  __proto__: null,
@@ -175306,19 +172020,19 @@ function requireAttributeMap () {
175306
172020
 
175307
172021
  var Op = {};
175308
172022
 
175309
- var Iterator$1 = {};
172023
+ var Iterator = {};
175310
172024
 
175311
172025
  var hasRequiredIterator;
175312
172026
 
175313
172027
  function requireIterator () {
175314
- if (hasRequiredIterator) return Iterator$1;
172028
+ if (hasRequiredIterator) return Iterator;
175315
172029
  hasRequiredIterator = 1;
175316
- var __importDefault = (Iterator$1 && Iterator$1.__importDefault) || function (mod) {
172030
+ var __importDefault = (Iterator && Iterator.__importDefault) || function (mod) {
175317
172031
  return (mod && mod.__esModule) ? mod : { "default": mod };
175318
172032
  };
175319
- Object.defineProperty(Iterator$1, "__esModule", { value: true });
172033
+ Object.defineProperty(Iterator, "__esModule", { value: true });
175320
172034
  var Op_1 = __importDefault(requireOp());
175321
- var Iterator = /** @class */ (function () {
172035
+ var Iterator$1 = /** @class */ (function () {
175322
172036
  function Iterator(ops) {
175323
172037
  this.ops = ops;
175324
172038
  this.index = 0;
@@ -175413,9 +172127,9 @@ function requireIterator () {
175413
172127
  };
175414
172128
  return Iterator;
175415
172129
  }());
175416
- Iterator$1.default = Iterator;
172130
+ Iterator.default = Iterator$1;
175417
172131
 
175418
- return Iterator$1;
172132
+ return Iterator;
175419
172133
  }
175420
172134
 
175421
172135
  var hasRequiredOp;
@@ -176503,8 +173217,6 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
176503
173217
  const props = __props;
176504
173218
  const emits = __emit;
176505
173219
  const formData = useModel(__props, "formData");
176506
- let editorConfig = shallowRef({});
176507
- let toolbarConfig = shallowRef({});
176508
173220
  const editorRef = shallowRef();
176509
173221
  const itemAction = (prep) => {
176510
173222
  allAction(props, emits, formData, prep);
@@ -176532,10 +173244,6 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
176532
173244
  }
176533
173245
  };
176534
173246
  onMounted(() => {
176535
- toolbarConfig.value = {
176536
- //excludeKeys: ["insertLink", "insertImage", "editImage", "viewImageLink", "insertVideo", "emotion", "fullScreen"],
176537
- };
176538
- editorConfig.value = { placeholder: "请输入内容...", MENU_CONF: {} };
176539
173247
  });
176540
173248
  return (_ctx, _cache) => {
176541
173249
  const _component_starhorse_form_item = __unplugin_components_0;
@@ -177000,7 +173708,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
177000
173708
 
177001
173709
  /* unplugin-vue-components disabled */
177002
173710
 
177003
- const imageItem = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-9166bb3a"]]);
173711
+ const imageItem = /* @__PURE__ */ _export_sfc(_sfc_main$x, [["__scopeId", "data-v-3963321e"]]);
177004
173712
 
177005
173713
  const imageItem$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
177006
173714
  __proto__: null,
@@ -177471,7 +174179,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
177471
174179
 
177472
174180
  /* unplugin-vue-components disabled */
177473
174181
 
177474
- const jsonArrayItem = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-140dfdce"]]);
174182
+ const jsonArrayItem = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-55446a18"]]);
177475
174183
 
177476
174184
  const jsonArrayItem$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
177477
174185
  __proto__: null,
@@ -177688,7 +174396,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
177688
174396
 
177689
174397
  /* unplugin-vue-components disabled */
177690
174398
 
177691
- const jsonItem = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-725f7ba7"]]);
174399
+ const jsonItem = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-4f8aa321"]]);
177692
174400
 
177693
174401
  const jsonItem$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
177694
174402
  __proto__: null,
@@ -177771,7 +174479,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
177771
174479
 
177772
174480
  /* unplugin-vue-components disabled */
177773
174481
 
177774
- const markdownItem = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-32ca2eda"]]);
174482
+ const markdownItem = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-5c8099fd"]]);
177775
174483
 
177776
174484
  const markdownItem$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
177777
174485
  __proto__: null,
@@ -177949,7 +174657,6 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
177949
174657
  const handleBlur = () => {
177950
174658
  isFocus.value = false;
177951
174659
  };
177952
- useSlots();
177953
174660
  const itemAction = (prep) => {
177954
174661
  let min = formData.value[props.field.preps["minName"]];
177955
174662
  let max = formData.value[props.field.preps["maxName"]];
@@ -178058,7 +174765,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
178058
174765
 
178059
174766
  /* unplugin-vue-components disabled */
178060
174767
 
178061
- const numberRangeItem = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-25c34441"]]);
174768
+ const numberRangeItem = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-428b4996"]]);
178062
174769
 
178063
174770
  const numberRangeItem$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
178064
174771
  __proto__: null,
@@ -179391,7 +176098,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
179391
176098
 
179392
176099
  /* unplugin-vue-components disabled */
179393
176100
 
179394
- const signatureItem = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-131cf92d"]]);
176101
+ const signatureItem = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-3134489c"]]);
179395
176102
 
179396
176103
  const signatureItem$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
179397
176104
  __proto__: null,
@@ -179438,7 +176145,6 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
179438
176145
  const props = __props;
179439
176146
  const emits = __emit;
179440
176147
  const formData = useModel(__props, "formData");
179441
- ref(0);
179442
176148
  const itemAction = () => {
179443
176149
  allAction(props, emits, formData, "change");
179444
176150
  };
@@ -179756,7 +176462,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
179756
176462
 
179757
176463
  /* unplugin-vue-components disabled */
179758
176464
 
179759
- const textItem = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-b0d95a3e"]]);
176465
+ const textItem = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-0ba70baf"]]);
179760
176466
 
179761
176467
  const textItem$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
179762
176468
  __proto__: null,
@@ -179804,7 +176510,6 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
179804
176510
  const emits = __emit;
179805
176511
  const formData = useModel(__props, "formData");
179806
176512
  const editorDialogVisible = shallowRef(false);
179807
- shallowRef("");
179808
176513
  let actionName = shallowRef("normal");
179809
176514
  const itemAction = (prep) => {
179810
176515
  allAction(props, emits, formData, prep);
@@ -189344,7 +186049,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
189344
186049
 
189345
186050
  /* unplugin-vue-components disabled */
189346
186051
 
189347
- const viewMarkdownItem = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-0f067789"]]);
186052
+ const viewMarkdownItem = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-cf0c50e0"]]);
189348
186053
 
189349
186054
  const viewMarkdownItem$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
189350
186055
  __proto__: null,
@@ -190698,7 +187403,7 @@ const qrcodeItem = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty
190698
187403
  default: _sfc_main$5
190699
187404
  }, Symbol.toStringTag, { value: 'Module' }));
190700
187405
 
190701
- var t$1=Object.defineProperty,e$1=Object.defineProperties,n$2=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o$1=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(e,n,r)=>n in e?t$1(e,n,{enumerable:true,configurable:true,writable:true,value:r}):e[n]=r;var p={},d$1={},h={};Object.defineProperty(h,"__esModule",{value:true});h.default=function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.data=e,this.text=n.text||e,this.options=n;},Object.defineProperty(d$1,"__esModule",{value:true}),d$1.CODE39=void 0;var y$1,v$1=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),b=(y$1=h)&&y$1.__esModule?y$1:{default:y$1};var _$1=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=t.toUpperCase(),n.mod43&&(t+=(r=function(t){for(var e=0,n=0;n<t.length;n++)e+=w(t[n]);return e%=43}(t),g[r])),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,b.default),v$1(e,[{key:"encode",value:function(){for(var t=E("*"),e=0;e<this.data.length;e++)t+=E(this.data[e])+"0";return {data:t+=E("*"),text:this.text}}},{key:"valid",value:function(){return -1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),e}(),g=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],O$1=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function E(t){return e=w(t),O$1[e].toString(2);var e;}function w(t){return g.indexOf(t)}d$1.CODE39=_$1;var m,j={},x$1={},P$1={},S={};function C(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:true,configurable:true,writable:true}):t[e]=n,t}Object.defineProperty(S,"__esModule",{value:true});var A$1=S.SET_A=0,T$1=S.SET_B=1,M=S.SET_C=2;S.SHIFT=98;var R$1=S.START_A=103,L$1=S.START_B=104,k=S.START_C=105;S.MODULO=103,S.STOP=106,S.FNC1=207,S.SET_BY_CODE=(C(m={},R$1,A$1),C(m,L$1,T$1),C(m,k,M),m),S.SWAP={101:A$1,100:T$1,99:M},S.A_START_CHAR=String.fromCharCode(208),S.B_START_CHAR=String.fromCharCode(209),S.C_START_CHAR=String.fromCharCode(210),S.A_CHARS="[\0-_È-Ï]",S.B_CHARS="[ -È-Ï]",S.C_CHARS="(Ï*[0-9]{2}Ï*)",S.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011],Object.defineProperty(P$1,"__esModule",{value:true});var I$1=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),G$1=function(t){return t&&t.__esModule?t:{default:t}}(h),B$1=S;var N$1=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.substring(1),n));return r.bytes=t.split("").map((function(t){return t.charCodeAt(0)})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,G$1.default),I$1(e,[{key:"valid",value:function(){return /^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var t=this.bytes,n=t.shift()-105,r=B$1.SET_BY_CODE[n];if(void 0===r)throw new RangeError("The encoding does not start with a start character.");true===this.shouldEncodeAsEan128()&&t.unshift(B$1.FNC1);var o=e.next(t,1,r);return {text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:e.getBar(n)+o.result+e.getBar((o.checksum+n)%B$1.MODULO)+e.getBar(B$1.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var t=this.options.ean128||false;return "string"==typeof t&&(t="true"===t.toLowerCase()),t}}],[{key:"getBar",value:function(t){return B$1.BARS[t]?B$1.BARS[t].toString():""}},{key:"correctIndex",value:function(t,e){if(e===B$1.SET_A){var n=t.shift();return n<32?n+64:n-32}return e===B$1.SET_B?t.shift()-32:10*(t.shift()-48)+t.shift()-48}},{key:"next",value:function(t,n,r){if(!t.length)return {result:"",checksum:0};var o=void 0,i=void 0;if(t[0]>=200){i=t.shift()-105;var a=B$1.SWAP[i];void 0!==a?o=e.next(t,n+1,a):(r!==B$1.SET_A&&r!==B$1.SET_B||i!==B$1.SHIFT||(t[0]=r===B$1.SET_A?t[0]>95?t[0]-96:t[0]:t[0]<32?t[0]+96:t[0]),o=e.next(t,n+1,r));}else i=e.correctIndex(t,r),o=e.next(t,n+1,r);var u=i*n;return {result:e.getBar(i)+o.result,checksum:u+o.checksum}}}]),e}();P$1.default=N$1;var D$1={};Object.defineProperty(D$1,"__esModule",{value:true});var X=S,z$1=function(t){return t.match(new RegExp("^"+X.A_CHARS+"*"))[0].length},H$1=function(t){return t.match(new RegExp("^"+X.B_CHARS+"*"))[0].length},V=function(t){return t.match(new RegExp("^"+X.C_CHARS+"*"))[0]};function U$1(t,e){var n=e?X.A_CHARS:X.B_CHARS,r=t.match(new RegExp("^("+n+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(r)return r[1]+String.fromCharCode(204)+$(t.substring(r[1].length));var o=t.match(new RegExp("^"+n+"+"))[0];return o.length===t.length?t:o+String.fromCharCode(e?205:206)+U$1(t.substring(o.length),!e)}function $(t){var e=V(t),n=e.length;if(n===t.length)return t;t=t.substring(n);var r=z$1(t)>=H$1(t);return e+String.fromCharCode(r?206:205)+U$1(t,r)}D$1.default=function(t){var e=void 0;if(V(t).length>=2)e=X.C_START_CHAR+$(t);else {var n=z$1(t)>H$1(t);e=(n?X.A_START_CHAR:X.B_START_CHAR)+U$1(t,n);}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,(function(t,e){return String.fromCharCode(203)+e}))},Object.defineProperty(x$1,"__esModule",{value:true});var F$1=Q(P$1),W=Q(D$1);function Q(t){return t&&t.__esModule?t:{default:t}}function J(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}var Y=function(t){function e(t,n){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(t))var r=J(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0, W.default)(t),n));else r=J(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return J(r)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,F$1.default),e}();x$1.default=Y;var q={};Object.defineProperty(q,"__esModule",{value:true});var Z=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),K$1=function(t){return t&&t.__esModule?t:{default:t}}(P$1),tt=S;var et=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,tt.A_START_CHAR+t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,K$1.default),Z(e,[{key:"valid",value:function(){return new RegExp("^"+tt.A_CHARS+"+$").test(this.data)}}]),e}();q.default=et;var nt={};Object.defineProperty(nt,"__esModule",{value:true});var rt=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),ot=function(t){return t&&t.__esModule?t:{default:t}}(P$1),it=S;var at=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,it.B_START_CHAR+t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,ot.default),rt(e,[{key:"valid",value:function(){return new RegExp("^"+it.B_CHARS+"+$").test(this.data)}}]),e}();nt.default=at;var ut={};Object.defineProperty(ut,"__esModule",{value:true});var ft=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),lt=function(t){return t&&t.__esModule?t:{default:t}}(P$1),ct=S;var st=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,ct.C_START_CHAR+t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,lt.default),ft(e,[{key:"valid",value:function(){return new RegExp("^"+ct.C_CHARS+"+$").test(this.data)}}]),e}();ut.default=st,Object.defineProperty(j,"__esModule",{value:true}),j.CODE128C=j.CODE128B=j.CODE128A=j.CODE128=void 0;var pt=vt(x$1),dt=vt(q),ht=vt(nt),yt=vt(ut);function vt(t){return t&&t.__esModule?t:{default:t}}j.CODE128=pt.default,j.CODE128A=dt.default,j.CODE128B=ht.default,j.CODE128C=yt.default;var bt={},_t={},gt={};Object.defineProperty(gt,"__esModule",{value:true}),gt.SIDE_BIN="101",gt.MIDDLE_BIN="01010",gt.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},gt.EAN2_STRUCTURE=["LL","LG","GL","GG"],gt.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],gt.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"];var Ot={},Et={};Object.defineProperty(Et,"__esModule",{value:true});var wt=gt;Et.default=function(t,e,n){var r=t.split("").map((function(t,n){return wt.BINARIES[e[n]]})).map((function(e,n){return e?e[t[n]]:""}));if(n){var o=t.length-1;r=r.map((function(t,e){return e<o?t+n:t}));}return r.join("")},Object.defineProperty(Ot,"__esModule",{value:true});var mt=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),jt=gt,xt=St(Et),Pt=St(h);function St(t){return t&&t.__esModule?t:{default:t}}var Ct=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.fontSize=!n.flat&&n.fontSize>10*n.width?10*n.width:n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,Pt.default),mt(e,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(t,e){return this.text.substr(t,e)}},{key:"leftEncode",value:function(t,e){return (0, xt.default)(t,e)}},{key:"rightText",value:function(t,e){return this.text.substr(t,e)}},{key:"rightEncode",value:function(t,e){return (0, xt.default)(t,e)}},{key:"encodeGuarded",value:function(){var t={fontSize:this.fontSize},e={height:this.guardHeight};return [{data:jt.SIDE_BIN,options:e},{data:this.leftEncode(),text:this.leftText(),options:t},{data:jt.MIDDLE_BIN,options:e},{data:this.rightEncode(),text:this.rightText(),options:t},{data:jt.SIDE_BIN,options:e}]}},{key:"encodeFlat",value:function(){return {data:[jt.SIDE_BIN,this.leftEncode(),jt.MIDDLE_BIN,this.rightEncode(),jt.SIDE_BIN].join(""),text:this.text}}}]),e}();Ot.default=Ct,Object.defineProperty(_t,"__esModule",{value:true});var At=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Tt=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},Mt=gt,Rt=function(t){return t&&t.__esModule?t:{default:t}}(Ot);var Lt=function(t){return (10-t.substr(0,12).split("").map((function(t){return +t})).reduce((function(t,e,n){return n%2?t+3*e:t+e}),0)%10)%10},kt=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),-1!==t.search(/^[0-9]{12}$/)&&(t+=Lt(t));var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.lastChar=n.lastChar,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,Rt.default),At(e,[{key:"valid",value:function(){return -1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===Lt(this.data)}},{key:"leftText",value:function(){return Tt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var t=this.data.substr(1,6),n=Mt.EAN13_STRUCTURE[this.data[0]];return Tt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,t,n)}},{key:"rightText",value:function(){return Tt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var t=this.data.substr(7,6);return Tt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,t,"RRRRRR")}},{key:"encodeGuarded",value:function(){var t=Tt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(t.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(t.push({data:"00"}),t.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),t}}]),e}();_t.default=kt;var It={};Object.defineProperty(It,"__esModule",{value:true});var Gt=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Bt=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},Nt=function(t){return t&&t.__esModule?t:{default:t}}(Ot);var Dt=function(t){return (10-t.substr(0,7).split("").map((function(t){return +t})).reduce((function(t,e,n){return n%2?t+e:t+3*e}),0)%10)%10},Xt=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),-1!==t.search(/^[0-9]{7}$/)&&(t+=Dt(t)),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,Nt.default),Gt(e,[{key:"valid",value:function(){return -1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===Dt(this.data)}},{key:"leftText",value:function(){return Bt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var t=this.data.substr(0,4);return Bt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,t,"LLLL")}},{key:"rightText",value:function(){return Bt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var t=this.data.substr(4,4);return Bt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,t,"RRRR")}}]),e}();It.default=Xt;var zt={};Object.defineProperty(zt,"__esModule",{value:true});var Ht=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Vt=gt,Ut=Ft(Et),$t=Ft(h);function Ft(t){return t&&t.__esModule?t:{default:t}}var Wt=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,$t.default),Ht(e,[{key:"valid",value:function(){return -1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var t,e=Vt.EAN5_STRUCTURE[(t=this.data,t.split("").map((function(t){return +t})).reduce((function(t,e,n){return n%2?t+9*e:t+3*e}),0)%10)];return {data:"1011"+(0, Ut.default)(this.data,e,"01"),text:this.text}}}]),e}();zt.default=Wt;var Qt={};Object.defineProperty(Qt,"__esModule",{value:true});var Jt=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Yt=gt,qt=Kt(Et),Zt=Kt(h);function Kt(t){return t&&t.__esModule?t:{default:t}}var te=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,Zt.default),Jt(e,[{key:"valid",value:function(){return -1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var t=Yt.EAN2_STRUCTURE[parseInt(this.data)%4];return {data:"1011"+(0, qt.default)(this.data,t,"01"),text:this.text}}}]),e}();Qt.default=te;var ee={};Object.defineProperty(ee,"__esModule",{value:true});var ne=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();ee.checksum=ue;var re=ie(Et),oe=ie(h);function ie(t){return t&&t.__esModule?t:{default:t}}var ae=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),-1!==t.search(/^[0-9]{11}$/)&&(t+=ue(t));var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.displayValue=n.displayValue,n.fontSize>10*n.width?r.fontSize=10*n.width:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,oe.default),ne(e,[{key:"valid",value:function(){return -1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==ue(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var t="";return t+="101",t+=(0, re.default)(this.data.substr(0,6),"LLLLLL"),t+="01010",t+=(0, re.default)(this.data.substr(6,6),"RRRRRR"),{data:t+="101",text:this.text}}},{key:"guardedEncoding",value:function(){var t=[];return this.displayValue&&t.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),t.push({data:"101"+(0, re.default)(this.data[0],"L"),options:{height:this.guardHeight}}),t.push({data:(0, re.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),t.push({data:"01010",options:{height:this.guardHeight}}),t.push({data:(0, re.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),t.push({data:(0, re.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&t.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),t}}]),e}();function ue(t){var e,n=0;for(e=1;e<11;e+=2)n+=parseInt(t[e]);for(e=0;e<11;e+=2)n+=3*parseInt(t[e]);return (10-n%10)%10}ee.default=ae;var fe={};Object.defineProperty(fe,"__esModule",{value:true});var le=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),ce=de(Et),se=de(h),pe=ee;function de(t){return t&&t.__esModule?t:{default:t}}function he(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}var ye=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],ve=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],be=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=he(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if(r.isValid=false,-1!==t.search(/^[0-9]{6}$/))r.middleDigits=t,r.upcA=_e(t,"0"),r.text=n.text||""+r.upcA[0]+t+r.upcA[r.upcA.length-1],r.isValid=true;else {if(-1===t.search(/^[01][0-9]{7}$/))return he(r);if(r.middleDigits=t.substring(1,t.length-1),r.upcA=_e(r.middleDigits,t[0]),r.upcA[r.upcA.length-1]!==t[t.length-1])return he(r);r.isValid=true;}return r.displayValue=n.displayValue,n.fontSize>10*n.width?r.fontSize=10*n.width:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,se.default),le(e,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var t="";return t+="101",t+=this.encodeMiddleDigits(),{data:t+="010101",text:this.text}}},{key:"guardedEncoding",value:function(){var t=[];return this.displayValue&&t.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),t.push({data:"101",options:{height:this.guardHeight}}),t.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),t.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&t.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),t}},{key:"encodeMiddleDigits",value:function(){var t=this.upcA[0],e=this.upcA[this.upcA.length-1],n=ve[parseInt(e)][parseInt(t)];return (0, ce.default)(this.middleDigits,n)}}]),e}();function _e(t,e){for(var n=parseInt(t[t.length-1]),r=ye[n],o="",i=0,a=0;a<r.length;a++){var u=r[a];o+="X"===u?t[i++]:u;}return ""+(o=""+e+o)+(0, pe.checksum)(o)}fe.default=be,Object.defineProperty(bt,"__esModule",{value:true}),bt.UPCE=bt.UPC=bt.EAN2=bt.EAN5=bt.EAN8=bt.EAN13=void 0;var ge=xe(_t),Oe=xe(It),Ee=xe(zt),we=xe(Qt),me=xe(ee),je=xe(fe);function xe(t){return t&&t.__esModule?t:{default:t}}bt.EAN13=ge.default,bt.EAN8=Oe.default,bt.EAN5=Ee.default,bt.EAN2=we.default,bt.UPC=me.default,bt.UPCE=je.default;var Pe={},Se={},Ce={};Object.defineProperty(Ce,"__esModule",{value:true}),Ce.START_BIN="1010",Ce.END_BIN="11101",Ce.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"],Object.defineProperty(Se,"__esModule",{value:true});var Ae=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Te=Ce,Me=function(t){return t&&t.__esModule?t:{default:t}}(h);function Re(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Le(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}var ke=function(t){function e(){return Re(this,e),Le(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,Me.default),Ae(e,[{key:"valid",value:function(){return -1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var t=this,e=this.data.match(/.{2}/g).map((function(e){return t.encodePair(e)})).join("");return {data:Te.START_BIN+e+Te.END_BIN,text:this.text}}},{key:"encodePair",value:function(t){var e=Te.BINARIES[t[1]];return Te.BINARIES[t[0]].split("").map((function(t,n){return ("1"===t?"111":"1")+("1"===e[n]?"000":"0")})).join("")}}]),e}();Se.default=ke;var Ie={};Object.defineProperty(Ie,"__esModule",{value:true});var Ge=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Be=function(t){return t&&t.__esModule?t:{default:t}}(Se);var Ne=function(t){var e=t.substr(0,13).split("").map((function(t){return parseInt(t,10)})).reduce((function(t,e,n){return t+e*(3-n%2*2)}),0);return 10*Math.ceil(e/10)-e},De=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),-1!==t.search(/^[0-9]{13}$/)&&(t+=Ne(t)),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,Be.default),Ge(e,[{key:"valid",value:function(){return -1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===Ne(this.data)}}]),e}();Ie.default=De,Object.defineProperty(Pe,"__esModule",{value:true}),Pe.ITF14=Pe.ITF=void 0;var Xe=He(Se),ze=He(Ie);function He(t){return t&&t.__esModule?t:{default:t}}Pe.ITF=Xe.default,Pe.ITF14=ze.default;var Ve={},Ue={};Object.defineProperty(Ue,"__esModule",{value:true});var $e=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Fe=function(t){return t&&t.__esModule?t:{default:t}}(h);var We=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,Fe.default),$e(e,[{key:"encode",value:function(){for(var t="110",e=0;e<this.data.length;e++){var n=parseInt(this.data[e]).toString(2);n=Qe(n,4-n.length);for(var r=0;r<n.length;r++)t+="0"==n[r]?"100":"110";}return {data:t+="1001",text:this.text}}},{key:"valid",value:function(){return -1!==this.data.search(/^[0-9]+$/)}}]),e}();function Qe(t,e){for(var n=0;n<e;n++)t="0"+t;return t}Ue.default=We;var Je={},Ye={};Object.defineProperty(Ye,"__esModule",{value:true}),Ye.mod10=function(t){for(var e=0,n=0;n<t.length;n++){var r=parseInt(t[n]);(n+t.length)%2==0?e+=r:e+=2*r%10+Math.floor(2*r/10);}return (10-e%10)%10},Ye.mod11=function(t){for(var e=0,n=[2,3,4,5,6,7],r=0;r<t.length;r++){var o=parseInt(t[t.length-1-r]);e+=n[r%n.length]*o;}return (11-e%11)%11},Object.defineProperty(Je,"__esModule",{value:true});var qe=function(t){return t&&t.__esModule?t:{default:t}}(Ue),Ze=Ye;var Ke=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0, Ze.mod10)(t),n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,qe.default),e}();Je.default=Ke;var tn={};Object.defineProperty(tn,"__esModule",{value:true});var en=function(t){return t&&t.__esModule?t:{default:t}}(Ue),nn=Ye;var rn=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0, nn.mod11)(t),n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,en.default),e}();tn.default=rn;var on={};Object.defineProperty(on,"__esModule",{value:true});var an=function(t){return t&&t.__esModule?t:{default:t}}(Ue),un=Ye;var fn=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t+=(0, un.mod10)(t),t+=(0, un.mod10)(t),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,an.default),e}();on.default=fn;var ln={};Object.defineProperty(ln,"__esModule",{value:true});var cn=function(t){return t&&t.__esModule?t:{default:t}}(Ue),sn=Ye;var pn=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t+=(0, sn.mod11)(t),t+=(0, sn.mod10)(t),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,cn.default),e}();ln.default=pn,Object.defineProperty(Ve,"__esModule",{value:true}),Ve.MSI1110=Ve.MSI1010=Ve.MSI11=Ve.MSI10=Ve.MSI=void 0;var dn=_n(Ue),hn=_n(Je),yn=_n(tn),vn=_n(on),bn=_n(ln);function _n(t){return t&&t.__esModule?t:{default:t}}Ve.MSI=dn.default,Ve.MSI10=hn.default,Ve.MSI11=yn.default,Ve.MSI1010=vn.default,Ve.MSI1110=bn.default;var gn={};Object.defineProperty(gn,"__esModule",{value:true}),gn.pharmacode=void 0;var On=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),En=function(t){return t&&t.__esModule?t:{default:t}}(h);var wn=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.number=parseInt(t,10),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,En.default),On(e,[{key:"encode",value:function(){for(var t=this.number,e="";!isNaN(t)&&0!=t;)t%2==0?(e="11100"+e,t=(t-2)/2):(e="100"+e,t=(t-1)/2);return {data:e=e.slice(0,-2),text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e}();gn.pharmacode=wn;var mn={};Object.defineProperty(mn,"__esModule",{value:true}),mn.codabar=void 0;var jn=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),xn=function(t){return t&&t.__esModule?t:{default:t}}(h);var Pn=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),0===t.search(/^[0-9\-\$\:\.\+\/]+$/)&&(t="A"+t+"A");var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.toUpperCase(),n));return r.text=r.options.text||r.text.replace(/[A-D]/g,""),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,xn.default),jn(e,[{key:"valid",value:function(){return -1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var t=[],e=this.getEncodings(),n=0;n<this.data.length;n++)t.push(e[this.data.charAt(n)]),n!==this.data.length-1&&t.push("0");return {text:this.text,data:t.join("")}}},{key:"getEncodings",value:function(){return {0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),e}();mn.codabar=Pn;var Sn={};Object.defineProperty(Sn,"__esModule",{value:true}),Sn.GenericBarcode=void 0;var Cn=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),An=function(t){return t&&t.__esModule?t:{default:t}}(h);var Tn=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,An.default),Cn(e,[{key:"encode",value:function(){return {data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return true}}]),e}();Sn.GenericBarcode=Tn,Object.defineProperty(p,"__esModule",{value:true});var Mn=d$1,Rn=j,Ln=bt,kn=Pe,In=Ve,Gn=gn,Bn=mn,Nn=Sn;p.default={CODE39:Mn.CODE39,CODE128:Rn.CODE128,CODE128A:Rn.CODE128A,CODE128B:Rn.CODE128B,CODE128C:Rn.CODE128C,EAN13:Ln.EAN13,EAN8:Ln.EAN8,EAN5:Ln.EAN5,EAN2:Ln.EAN2,UPC:Ln.UPC,UPCE:Ln.UPCE,ITF14:kn.ITF14,ITF:kn.ITF,MSI:In.MSI,MSI10:In.MSI10,MSI11:In.MSI11,MSI1010:In.MSI1010,MSI1110:In.MSI1110,pharmacode:Gn.pharmacode,codabar:Bn.codabar,GenericBarcode:Nn.GenericBarcode};var Dn={};Object.defineProperty(Dn,"__esModule",{value:true});var Xn=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);}return t};Dn.default=function(t,e){return Xn({},t,e)};var zn={};Object.defineProperty(zn,"__esModule",{value:true}),zn.default=function(t){var e=[];return function t(n){if(Array.isArray(n))for(var r=0;r<n.length;r++)t(n[r]);else n.text=n.text||"",n.data=n.data||"",e.push(n);}(t),e};var Hn={};Object.defineProperty(Hn,"__esModule",{value:true}),Hn.default=function(t){return t.marginTop=t.marginTop||t.margin,t.marginBottom=t.marginBottom||t.margin,t.marginRight=t.marginRight||t.margin,t.marginLeft=t.marginLeft||t.margin,t};var Vn={},Un={},$n={};Object.defineProperty($n,"__esModule",{value:true}),$n.default=function(t){var e=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var n in e)e.hasOwnProperty(n)&&(n=e[n],"string"==typeof t[n]&&(t[n]=parseInt(t[n],10)));"string"==typeof t.displayValue&&(t.displayValue="false"!=t.displayValue);return t};var Fn={};Object.defineProperty(Fn,"__esModule",{value:true});Fn.default={width:2,height:100,format:"auto",displayValue:true,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}},Object.defineProperty(Un,"__esModule",{value:true});var Wn=Jn($n),Qn=Jn(Fn);function Jn(t){return t&&t.__esModule?t:{default:t}}Un.default=function(t){var e={};for(var n in Qn.default)Qn.default.hasOwnProperty(n)&&(t.hasAttribute("jsbarcode-"+n.toLowerCase())&&(e[n]=t.getAttribute("jsbarcode-"+n.toLowerCase())),t.hasAttribute("data-"+n.toLowerCase())&&(e[n]=t.getAttribute("data-"+n.toLowerCase())));return e.value=t.getAttribute("jsbarcode-value")||t.getAttribute("data-value"),e=(0, Wn.default)(e)};var Yn={},qn={},Zn={};Object.defineProperty(Zn,"__esModule",{value:true}),Zn.getTotalWidthOfEncodings=Zn.calculateEncodingAttributes=Zn.getBarcodePadding=Zn.getEncodingHeight=Zn.getMaximumHeightOfEncodings=void 0;var Kn=function(t){return t&&t.__esModule?t:{default:t}}(Dn);function tr(t,e){return e.height+(e.displayValue&&t.text.length>0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function er(t,e,n){if(n.displayValue&&e<t){if("center"==n.textAlign)return Math.floor((t-e)/2);if("left"==n.textAlign)return 0;if("right"==n.textAlign)return Math.floor(t-e)}return 0}function nr(t,e,n){var r;if(n)r=n;else {if("undefined"==typeof document)return 0;r=document.createElement("canvas").getContext("2d");}r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var o=r.measureText(t);return o?o.width:0}Zn.getMaximumHeightOfEncodings=function(t){for(var e=0,n=0;n<t.length;n++)t[n].height>e&&(e=t[n].height);return e},Zn.getEncodingHeight=tr,Zn.getBarcodePadding=er,Zn.calculateEncodingAttributes=function(t,e,n){for(var r=0;r<t.length;r++){var o,i=t[r],a=(0, Kn.default)(e,i.options);o=a.displayValue?nr(i.text,a,n):0;var u=i.data.length*a.width;i.width=Math.ceil(Math.max(o,u)),i.height=tr(i,a),i.barcodePadding=er(o,u,a);}},Zn.getTotalWidthOfEncodings=function(t){for(var e=0,n=0;n<t.length;n++)e+=t[n].width;return e},Object.defineProperty(qn,"__esModule",{value:true});var rr=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),or=function(t){return t&&t.__esModule?t:{default:t}}(Dn),ir=Zn;var ar=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.canvas=e,this.encodings=n,this.options=r;}return rr(t,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var t=0;t<this.encodings.length;t++){var e=(0, or.default)(this.options,this.encodings[t].options);this.drawCanvasBarcode(e,this.encodings[t]),this.drawCanvasText(e,this.encodings[t]),this.moveCanvasDrawing(this.encodings[t]);}this.restoreCanvas();}},{key:"prepareCanvas",value:function(){var t=this.canvas.getContext("2d");t.save(),(0, ir.calculateEncodingAttributes)(this.encodings,this.options,t);var e=(0, ir.getTotalWidthOfEncodings)(this.encodings),n=(0, ir.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=e+this.options.marginLeft+this.options.marginRight,this.canvas.height=n,t.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(t.fillStyle=this.options.background,t.fillRect(0,0,this.canvas.width,this.canvas.height)),t.translate(this.options.marginLeft,0);}},{key:"drawCanvasBarcode",value:function(t,e){var n,r=this.canvas.getContext("2d"),o=e.data;n="top"==t.textPosition?t.marginTop+t.fontSize+t.textMargin:t.marginTop,r.fillStyle=t.lineColor;for(var i=0;i<o.length;i++){var a=i*t.width+e.barcodePadding;"1"===o[i]?r.fillRect(a,n,t.width,t.height):o[i]&&r.fillRect(a,n,t.width,t.height*o[i]);}}},{key:"drawCanvasText",value:function(t,e){var n,r,o=this.canvas.getContext("2d"),i=t.fontOptions+" "+t.fontSize+"px "+t.font;t.displayValue&&(r="top"==t.textPosition?t.marginTop+t.fontSize-t.textMargin:t.height+t.textMargin+t.marginTop+t.fontSize,o.font=i,"left"==t.textAlign||e.barcodePadding>0?(n=0,o.textAlign="left"):"right"==t.textAlign?(n=e.width-1,o.textAlign="right"):(n=e.width/2,o.textAlign="center"),o.fillText(e.text,n,r));}},{key:"moveCanvasDrawing",value:function(t){this.canvas.getContext("2d").translate(t.width,0);}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore();}}]),t}();qn.default=ar;var ur={};Object.defineProperty(ur,"__esModule",{value:true});var fr=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),lr=function(t){return t&&t.__esModule?t:{default:t}}(Dn),cr=Zn;var sr="http://www.w3.org/2000/svg",pr=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.svg=e,this.encodings=n,this.options=r,this.document=r.xmlDocument||document;}return fr(t,[{key:"render",value:function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e<this.encodings.length;e++){var n=this.encodings[e],r=(0, lr.default)(this.options,n.options),o=this.createGroup(t,r.marginTop,this.svg);this.setGroupOptions(o,r),this.drawSvgBarcode(o,r,n),this.drawSVGText(o,r,n),t+=n.width;}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0, cr.calculateEncodingAttributes)(this.encodings,this.options);var t=(0, cr.getTotalWidthOfEncodings)(this.encodings),e=(0, cr.getMaximumHeightOfEncodings)(this.encodings),n=t+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(n,e),this.options.background&&this.drawRect(0,0,n,e,this.svg).setAttribute("style","fill:"+this.options.background+";");}},{key:"drawSvgBarcode",value:function(t,e,n){var r,o=n.data;r="top"==e.textPosition?e.fontSize+e.textMargin:0;for(var i=0,a=0,u=0;u<o.length;u++)a=u*e.width+n.barcodePadding,"1"===o[u]?i++:i>0&&(this.drawRect(a-e.width*i,r,e.width*i,e.height,t),i=0);i>0&&this.drawRect(a-e.width*(i-1),r,e.width*i,e.height,t);}},{key:"drawSVGText",value:function(t,e,n){var r,o,i=this.document.createElementNS(sr,"text");e.displayValue&&(i.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),o="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(r=0,i.setAttribute("text-anchor","start")):"right"==e.textAlign?(r=n.width-1,i.setAttribute("text-anchor","end")):(r=n.width/2,i.setAttribute("text-anchor","middle")),i.setAttribute("x",r),i.setAttribute("y",o),i.appendChild(this.document.createTextNode(n.text)),t.appendChild(i));}},{key:"setSvgAttributes",value:function(t,e){var n=this.svg;n.setAttribute("width",t+"px"),n.setAttribute("height",e+"px"),n.setAttribute("x","0px"),n.setAttribute("y","0px"),n.setAttribute("viewBox","0 0 "+t+" "+e),n.setAttribute("xmlns",sr),n.setAttribute("version","1.1"),n.setAttribute("style","transform: translate(0,0)");}},{key:"createGroup",value:function(t,e,n){var r=this.document.createElementNS(sr,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}},{key:"setGroupOptions",value:function(t,e){t.setAttribute("style","fill:"+e.lineColor+";");}},{key:"drawRect",value:function(t,e,n,r,o){var i=this.document.createElementNS(sr,"rect");return i.setAttribute("x",t),i.setAttribute("y",e),i.setAttribute("width",n),i.setAttribute("height",r),o.appendChild(i),i}}]),t}();ur.default=pr;var dr={};Object.defineProperty(dr,"__esModule",{value:true});var hr=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var yr=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.object=e,this.encodings=n,this.options=r;}return hr(t,[{key:"render",value:function(){this.object.encodings=this.encodings;}}]),t}();dr.default=yr,Object.defineProperty(Yn,"__esModule",{value:true});var vr=gr(qn),br=gr(ur),_r=gr(dr);function gr(t){return t&&t.__esModule?t:{default:t}}Yn.default={CanvasRenderer:vr.default,SVGRenderer:br.default,ObjectRenderer:_r.default};var Or={};function Er(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wr(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}function mr(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(Or,"__esModule",{value:true});var jr=function(t){function e(t,n){Er(this,e);var r=wr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.name="InvalidInputException",r.symbology=t,r.input=n,r.message='"'+r.input+'" is not a valid input for '+r.symbology,r}return mr(e,Error),e}(),xr=function(t){function e(){Er(this,e);var t=wr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="InvalidElementException",t.message="Not supported type to render on",t}return mr(e,Error),e}(),Pr=function(t){function e(){Er(this,e);var t=wr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="NoElementException",t.message="No element to render on.",t}return mr(e,Error),e}();Or.InvalidInputException=jr,Or.InvalidElementException=xr,Or.NoElementException=Pr,Object.defineProperty(Vn,"__esModule",{value:true});var Sr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cr=Mr(Un),Ar=Mr(Yn),Tr=Or;function Mr(t){return t&&t.__esModule?t:{default:t}}function Rr(t){if("string"==typeof t)return function(t){var e=document.querySelectorAll(t);if(0===e.length)return;for(var n=[],r=0;r<e.length;r++)n.push(Rr(e[r]));return n}(t);if(Array.isArray(t)){for(var e=[],n=0;n<t.length;n++)e.push(Rr(t[n]));return e}if("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLImageElement)return r=t,{element:o=document.createElement("canvas"),options:(0, Cr.default)(r),renderer:Ar.default.CanvasRenderer,afterRender:function(){r.setAttribute("src",o.toDataURL());}};if(t&&t.nodeName&&"svg"===t.nodeName.toLowerCase()||"undefined"!=typeof SVGElement&&t instanceof SVGElement)return {element:t,options:(0, Cr.default)(t),renderer:Ar.default.SVGRenderer};if("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)return {element:t,options:(0, Cr.default)(t),renderer:Ar.default.CanvasRenderer};if(t&&t.getContext)return {element:t,renderer:Ar.default.CanvasRenderer};if(t&&"object"===(void 0===t?"undefined":Sr(t))&&!t.nodeName)return {element:t,renderer:Ar.default.ObjectRenderer};throw new Tr.InvalidElementException;var r,o;}Vn.default=Rr;var Lr={};Object.defineProperty(Lr,"__esModule",{value:true});var kr=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var Ir=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.api=e;}return kr(t,[{key:"handleCatch",value:function(t){if("InvalidInputException"!==t.name)throw t;if(this.api._options.valid===this.api._defaults.valid)throw t.message;this.api._options.valid(false),this.api.render=function(){};}},{key:"wrapBarcodeCall",value:function(t){try{var e=t.apply(void 0,arguments);return this.api._options.valid(!0),e}catch(n){return this.handleCatch(n),this.api}}}]),t}();Lr.default=Ir;var Gr=$r(p),Br=$r(Dn),Nr=$r(zn),Dr=$r(Hn),Xr=$r(Vn),zr=$r($n),Hr=$r(Lr),Vr=Or,Ur=$r(Fn);function $r(t){return t&&t.__esModule?t:{default:t}}var Fr=function(){},Wr=function(t,e,n){var r=new Fr;if(void 0===t)throw Error("No element to render on was provided.");return r._renderProperties=(0, Xr.default)(t),r._encodings=[],r._options=Ur.default,r._errorHandler=new Hr.default(r),void 0!==e&&((n=n||{}).format||(n.format=qr()),r.options(n)[n.format](e,n).render()),r};for(var Qr in Wr.getModule=function(t){return Gr.default[t]},Gr.default)Gr.default.hasOwnProperty(Qr)&&Jr(Gr.default,Qr);function Jr(t,e){Fr.prototype[e]=Fr.prototype[e.toUpperCase()]=Fr.prototype[e.toLowerCase()]=function(n,r){var o=this;return o._errorHandler.wrapBarcodeCall((function(){r.text=void 0===r.text?void 0:""+r.text;var i=(0, Br.default)(o._options,r);i=(0, zr.default)(i);var a=t[e],u=Yr(n,a,i);return o._encodings.push(u),o}))};}function Yr(t,e,n){var r=new e(t=""+t,n);if(!r.valid())throw new Vr.InvalidInputException(r.constructor.name,t);var o=r.encode();o=(0, Nr.default)(o);for(var i=0;i<o.length;i++)o[i].options=(0, Br.default)(n,o[i].options);return o}function qr(){return Gr.default.CODE128?"CODE128":Object.keys(Gr.default)[0]}function Zr(t,e,n){e=(0, Nr.default)(e);for(var r=0;r<e.length;r++)e[r].options=(0, Br.default)(n,e[r].options),(0, Dr.default)(e[r].options);(0, Dr.default)(n),new(t.renderer)(t.element,e,n).render(),t.afterRender&&t.afterRender();}Fr.prototype.options=function(t){return this._options=(0, Br.default)(this._options,t),this},Fr.prototype.blank=function(t){var e=new Array(t+1).join("0");return this._encodings.push({data:e}),this},Fr.prototype.init=function(){var t;if(this._renderProperties)for(var e in Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]),this._renderProperties){t=this._renderProperties[e];var n=(0, Br.default)(this._options,t.options);"auto"==n.format&&(n.format=qr()),this._errorHandler.wrapBarcodeCall((function(){var e=Yr(n.value,Gr.default[n.format.toUpperCase()],n);Zr(t,e,n);}));}},Fr.prototype.render=function(){if(!this._renderProperties)throw new Vr.NoElementException;if(Array.isArray(this._renderProperties))for(var t=0;t<this._renderProperties.length;t++)Zr(this._renderProperties[t],this._encodings,this._options);else Zr(this._renderProperties,this._encodings,this._options);return this},Fr.prototype._defaults=Ur.default,"undefined"!=typeof window&&(window.JsBarcode=Wr),"undefined"!=typeof jQuery&&(jQuery.fn.JsBarcode=function(t,e){var n=[];return jQuery(this).each((function(){n.push(this);})),Wr(n,t,e)});var Kr=Wr;const to=defineComponent({name:"vue3Barcode",props:{value:{type:[String,Number],default:""},format:[String],width:[String,Number],height:[String,Number],displayValue:{type:[String,Boolean],default:true},text:[String,Number],fontOptions:[String],font:[String],textAlign:[String],textPosition:[String],textMargin:[String,Number],fontSize:[String,Number],background:[String],lineColor:[String],margin:[String,Number],marginTop:[String,Number],marginBottom:[String,Number],marginLeft:[String,Number],marginRight:[String,Number],flat:[Boolean],ean128:[String,Boolean],elementTag:{type:String,default:"svg",validator:function(t){return -1!==["canvas","svg","img"].indexOf(t)}}},setup(t,{slots:u}){const p=ref(true);return onMounted((()=>{watch(t,(u=>{const f=(l=((t,e)=>{for(var n in e||(e={}))o$1.call(e,n)&&a(t,n,e[n]);if(r)for(var n of r(e))i.call(e,n)&&a(t,n,e[n]);return t})({},u),e$1(l,n$2({valid:t=>{p.value=t;}})));var l;!function(t){for(var e in t)t.hasOwnProperty(e)&&void 0===t[e]&&delete t[e];}(f),Kr(document.querySelector(".vue3-barcode-element"),String(t.value),f);}),{deep:true,immediate:true});})),()=>h$3("div",[h$3(t.elementTag,{style:{display:p.value?void 0:"none"},class:["vue3-barcode-element"]}),h$3("div",{style:{display:p.value?"none":void 0}},u)])}});to.install=t=>{t.component(to.name,to);};
187406
+ var t$1=Object.defineProperty,e$1=Object.defineProperties,n$2=Object.getOwnPropertyDescriptors,r=Object.getOwnPropertySymbols,o$1=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(e,n,r)=>n in e?t$1(e,n,{enumerable:true,configurable:true,writable:true,value:r}):e[n]=r;var p={},d$1={},h={};Object.defineProperty(h,"__esModule",{value:true});h.default=function t(e,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.data=e,this.text=n.text||e,this.options=n;},Object.defineProperty(d$1,"__esModule",{value:true}),d$1.CODE39=void 0;var y$1,v=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),b=(y$1=h)&&y$1.__esModule?y$1:{default:y$1};var _$1=function(t){function e(t,n){var r;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=t.toUpperCase(),n.mod43&&(t+=(r=function(t){for(var e=0,n=0;n<t.length;n++)e+=w(t[n]);return e%=43}(t),g[r])),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,b.default),v(e,[{key:"encode",value:function(){for(var t=E("*"),e=0;e<this.data.length;e++)t+=E(this.data[e])+"0";return {data:t+=E("*"),text:this.text}}},{key:"valid",value:function(){return -1!==this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)}}]),e}(),g=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],O$1=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function E(t){return e=w(t),O$1[e].toString(2);var e;}function w(t){return g.indexOf(t)}d$1.CODE39=_$1;var m,j={},x$1={},P$1={},S={};function C(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:true,configurable:true,writable:true}):t[e]=n,t}Object.defineProperty(S,"__esModule",{value:true});var A$1=S.SET_A=0,T$1=S.SET_B=1,M=S.SET_C=2;S.SHIFT=98;var R$1=S.START_A=103,L$1=S.START_B=104,k=S.START_C=105;S.MODULO=103,S.STOP=106,S.FNC1=207,S.SET_BY_CODE=(C(m={},R$1,A$1),C(m,L$1,T$1),C(m,k,M),m),S.SWAP={101:A$1,100:T$1,99:M},S.A_START_CHAR=String.fromCharCode(208),S.B_START_CHAR=String.fromCharCode(209),S.C_START_CHAR=String.fromCharCode(210),S.A_CHARS="[\0-_È-Ï]",S.B_CHARS="[ -È-Ï]",S.C_CHARS="(Ï*[0-9]{2}Ï*)",S.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011],Object.defineProperty(P$1,"__esModule",{value:true});var I$1=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),G$1=function(t){return t&&t.__esModule?t:{default:t}}(h),B$1=S;var N$1=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.substring(1),n));return r.bytes=t.split("").map((function(t){return t.charCodeAt(0)})),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,G$1.default),I$1(e,[{key:"valid",value:function(){return /^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var t=this.bytes,n=t.shift()-105,r=B$1.SET_BY_CODE[n];if(void 0===r)throw new RangeError("The encoding does not start with a start character.");true===this.shouldEncodeAsEan128()&&t.unshift(B$1.FNC1);var o=e.next(t,1,r);return {text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:e.getBar(n)+o.result+e.getBar((o.checksum+n)%B$1.MODULO)+e.getBar(B$1.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var t=this.options.ean128||false;return "string"==typeof t&&(t="true"===t.toLowerCase()),t}}],[{key:"getBar",value:function(t){return B$1.BARS[t]?B$1.BARS[t].toString():""}},{key:"correctIndex",value:function(t,e){if(e===B$1.SET_A){var n=t.shift();return n<32?n+64:n-32}return e===B$1.SET_B?t.shift()-32:10*(t.shift()-48)+t.shift()-48}},{key:"next",value:function(t,n,r){if(!t.length)return {result:"",checksum:0};var o=void 0,i=void 0;if(t[0]>=200){i=t.shift()-105;var a=B$1.SWAP[i];void 0!==a?o=e.next(t,n+1,a):(r!==B$1.SET_A&&r!==B$1.SET_B||i!==B$1.SHIFT||(t[0]=r===B$1.SET_A?t[0]>95?t[0]-96:t[0]:t[0]<32?t[0]+96:t[0]),o=e.next(t,n+1,r));}else i=e.correctIndex(t,r),o=e.next(t,n+1,r);var u=i*n;return {result:e.getBar(i)+o.result,checksum:u+o.checksum}}}]),e}();P$1.default=N$1;var D$1={};Object.defineProperty(D$1,"__esModule",{value:true});var X=S,z$1=function(t){return t.match(new RegExp("^"+X.A_CHARS+"*"))[0].length},H$1=function(t){return t.match(new RegExp("^"+X.B_CHARS+"*"))[0].length},V=function(t){return t.match(new RegExp("^"+X.C_CHARS+"*"))[0]};function U$1(t,e){var n=e?X.A_CHARS:X.B_CHARS,r=t.match(new RegExp("^("+n+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(r)return r[1]+String.fromCharCode(204)+$(t.substring(r[1].length));var o=t.match(new RegExp("^"+n+"+"))[0];return o.length===t.length?t:o+String.fromCharCode(e?205:206)+U$1(t.substring(o.length),!e)}function $(t){var e=V(t),n=e.length;if(n===t.length)return t;t=t.substring(n);var r=z$1(t)>=H$1(t);return e+String.fromCharCode(r?206:205)+U$1(t,r)}D$1.default=function(t){var e=void 0;if(V(t).length>=2)e=X.C_START_CHAR+$(t);else {var n=z$1(t)>H$1(t);e=(n?X.A_START_CHAR:X.B_START_CHAR)+U$1(t,n);}return e.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,(function(t,e){return String.fromCharCode(203)+e}))},Object.defineProperty(x$1,"__esModule",{value:true});var F$1=Q(P$1),W=Q(D$1);function Q(t){return t&&t.__esModule?t:{default:t}}function J(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}var Y=function(t){function e(t,n){if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),/^[\x00-\x7F\xC8-\xD3]+$/.test(t))var r=J(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,(0, W.default)(t),n));else r=J(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return J(r)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,F$1.default),e}();x$1.default=Y;var q={};Object.defineProperty(q,"__esModule",{value:true});var Z=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),K$1=function(t){return t&&t.__esModule?t:{default:t}}(P$1),tt=S;var et=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,tt.A_START_CHAR+t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,K$1.default),Z(e,[{key:"valid",value:function(){return new RegExp("^"+tt.A_CHARS+"+$").test(this.data)}}]),e}();q.default=et;var nt={};Object.defineProperty(nt,"__esModule",{value:true});var rt=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),ot=function(t){return t&&t.__esModule?t:{default:t}}(P$1),it=S;var at=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,it.B_START_CHAR+t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,ot.default),rt(e,[{key:"valid",value:function(){return new RegExp("^"+it.B_CHARS+"+$").test(this.data)}}]),e}();nt.default=at;var ut={};Object.defineProperty(ut,"__esModule",{value:true});var ft=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),lt=function(t){return t&&t.__esModule?t:{default:t}}(P$1),ct=S;var st=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,ct.C_START_CHAR+t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,lt.default),ft(e,[{key:"valid",value:function(){return new RegExp("^"+ct.C_CHARS+"+$").test(this.data)}}]),e}();ut.default=st,Object.defineProperty(j,"__esModule",{value:true}),j.CODE128C=j.CODE128B=j.CODE128A=j.CODE128=void 0;var pt=vt(x$1),dt=vt(q),ht=vt(nt),yt=vt(ut);function vt(t){return t&&t.__esModule?t:{default:t}}j.CODE128=pt.default,j.CODE128A=dt.default,j.CODE128B=ht.default,j.CODE128C=yt.default;var bt={},_t={},gt={};Object.defineProperty(gt,"__esModule",{value:true}),gt.SIDE_BIN="101",gt.MIDDLE_BIN="01010",gt.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},gt.EAN2_STRUCTURE=["LL","LG","GL","GG"],gt.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],gt.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"];var Ot={},Et={};Object.defineProperty(Et,"__esModule",{value:true});var wt=gt;Et.default=function(t,e,n){var r=t.split("").map((function(t,n){return wt.BINARIES[e[n]]})).map((function(e,n){return e?e[t[n]]:""}));if(n){var o=t.length-1;r=r.map((function(t,e){return e<o?t+n:t}));}return r.join("")},Object.defineProperty(Ot,"__esModule",{value:true});var mt=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),jt=gt,xt=St(Et),Pt=St(h);function St(t){return t&&t.__esModule?t:{default:t}}var Ct=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.fontSize=!n.flat&&n.fontSize>10*n.width?10*n.width:n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,Pt.default),mt(e,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(t,e){return this.text.substr(t,e)}},{key:"leftEncode",value:function(t,e){return (0, xt.default)(t,e)}},{key:"rightText",value:function(t,e){return this.text.substr(t,e)}},{key:"rightEncode",value:function(t,e){return (0, xt.default)(t,e)}},{key:"encodeGuarded",value:function(){var t={fontSize:this.fontSize},e={height:this.guardHeight};return [{data:jt.SIDE_BIN,options:e},{data:this.leftEncode(),text:this.leftText(),options:t},{data:jt.MIDDLE_BIN,options:e},{data:this.rightEncode(),text:this.rightText(),options:t},{data:jt.SIDE_BIN,options:e}]}},{key:"encodeFlat",value:function(){return {data:[jt.SIDE_BIN,this.leftEncode(),jt.MIDDLE_BIN,this.rightEncode(),jt.SIDE_BIN].join(""),text:this.text}}}]),e}();Ot.default=Ct,Object.defineProperty(_t,"__esModule",{value:true});var At=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Tt=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},Mt=gt,Rt=function(t){return t&&t.__esModule?t:{default:t}}(Ot);var Lt=function(t){return (10-t.substr(0,12).split("").map((function(t){return +t})).reduce((function(t,e,n){return n%2?t+3*e:t+e}),0)%10)%10},kt=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),-1!==t.search(/^[0-9]{12}$/)&&(t+=Lt(t));var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.lastChar=n.lastChar,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,Rt.default),At(e,[{key:"valid",value:function(){return -1!==this.data.search(/^[0-9]{13}$/)&&+this.data[12]===Lt(this.data)}},{key:"leftText",value:function(){return Tt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var t=this.data.substr(1,6),n=Mt.EAN13_STRUCTURE[this.data[0]];return Tt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,t,n)}},{key:"rightText",value:function(){return Tt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var t=this.data.substr(7,6);return Tt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,t,"RRRRRR")}},{key:"encodeGuarded",value:function(){var t=Tt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(t.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(t.push({data:"00"}),t.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),t}}]),e}();_t.default=kt;var It={};Object.defineProperty(It,"__esModule",{value:true});var Gt=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Bt=function t(e,n,r){null===e&&(e=Function.prototype);var o=Object.getOwnPropertyDescriptor(e,n);if(void 0===o){var i=Object.getPrototypeOf(e);return null===i?void 0:t(i,n,r)}if("value"in o)return o.value;var a=o.get;return void 0!==a?a.call(r):void 0},Nt=function(t){return t&&t.__esModule?t:{default:t}}(Ot);var Dt=function(t){return (10-t.substr(0,7).split("").map((function(t){return +t})).reduce((function(t,e,n){return n%2?t+e:t+3*e}),0)%10)%10},Xt=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),-1!==t.search(/^[0-9]{7}$/)&&(t+=Dt(t)),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,Nt.default),Gt(e,[{key:"valid",value:function(){return -1!==this.data.search(/^[0-9]{8}$/)&&+this.data[7]===Dt(this.data)}},{key:"leftText",value:function(){return Bt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var t=this.data.substr(0,4);return Bt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"leftEncode",this).call(this,t,"LLLL")}},{key:"rightText",value:function(){return Bt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var t=this.data.substr(4,4);return Bt(e.prototype.__proto__||Object.getPrototypeOf(e.prototype),"rightEncode",this).call(this,t,"RRRR")}}]),e}();It.default=Xt;var zt={};Object.defineProperty(zt,"__esModule",{value:true});var Ht=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Vt=gt,Ut=Ft(Et),$t=Ft(h);function Ft(t){return t&&t.__esModule?t:{default:t}}var Wt=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,$t.default),Ht(e,[{key:"valid",value:function(){return -1!==this.data.search(/^[0-9]{5}$/)}},{key:"encode",value:function(){var t,e=Vt.EAN5_STRUCTURE[(t=this.data,t.split("").map((function(t){return +t})).reduce((function(t,e,n){return n%2?t+9*e:t+3*e}),0)%10)];return {data:"1011"+(0, Ut.default)(this.data,e,"01"),text:this.text}}}]),e}();zt.default=Wt;var Qt={};Object.defineProperty(Qt,"__esModule",{value:true});var Jt=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Yt=gt,qt=Kt(Et),Zt=Kt(h);function Kt(t){return t&&t.__esModule?t:{default:t}}var te=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,Zt.default),Jt(e,[{key:"valid",value:function(){return -1!==this.data.search(/^[0-9]{2}$/)}},{key:"encode",value:function(){var t=Yt.EAN2_STRUCTURE[parseInt(this.data)%4];return {data:"1011"+(0, qt.default)(this.data,t,"01"),text:this.text}}}]),e}();Qt.default=te;var ee={};Object.defineProperty(ee,"__esModule",{value:true});var ne=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();ee.checksum=ue;var re=ie(Et),oe=ie(h);function ie(t){return t&&t.__esModule?t:{default:t}}var ae=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),-1!==t.search(/^[0-9]{11}$/)&&(t+=ue(t));var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.displayValue=n.displayValue,n.fontSize>10*n.width?r.fontSize=10*n.width:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,oe.default),ne(e,[{key:"valid",value:function(){return -1!==this.data.search(/^[0-9]{12}$/)&&this.data[11]==ue(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var t="";return t+="101",t+=(0, re.default)(this.data.substr(0,6),"LLLLLL"),t+="01010",t+=(0, re.default)(this.data.substr(6,6),"RRRRRR"),{data:t+="101",text:this.text}}},{key:"guardedEncoding",value:function(){var t=[];return this.displayValue&&t.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),t.push({data:"101"+(0, re.default)(this.data[0],"L"),options:{height:this.guardHeight}}),t.push({data:(0, re.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),t.push({data:"01010",options:{height:this.guardHeight}}),t.push({data:(0, re.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),t.push({data:(0, re.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&t.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),t}}]),e}();function ue(t){var e,n=0;for(e=1;e<11;e+=2)n+=parseInt(t[e]);for(e=0;e<11;e+=2)n+=3*parseInt(t[e]);return (10-n%10)%10}ee.default=ae;var fe={};Object.defineProperty(fe,"__esModule",{value:true});var le=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),ce=de(Et),se=de(h),pe=ee;function de(t){return t&&t.__esModule?t:{default:t}}function he(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}var ye=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],ve=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],be=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=he(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));if(r.isValid=false,-1!==t.search(/^[0-9]{6}$/))r.middleDigits=t,r.upcA=_e(t,"0"),r.text=n.text||""+r.upcA[0]+t+r.upcA[r.upcA.length-1],r.isValid=true;else {if(-1===t.search(/^[01][0-9]{7}$/))return he(r);if(r.middleDigits=t.substring(1,t.length-1),r.upcA=_e(r.middleDigits,t[0]),r.upcA[r.upcA.length-1]!==t[t.length-1])return he(r);r.isValid=true;}return r.displayValue=n.displayValue,n.fontSize>10*n.width?r.fontSize=10*n.width:r.fontSize=n.fontSize,r.guardHeight=n.height+r.fontSize/2+n.textMargin,r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,se.default),le(e,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var t="";return t+="101",t+=this.encodeMiddleDigits(),{data:t+="010101",text:this.text}}},{key:"guardedEncoding",value:function(){var t=[];return this.displayValue&&t.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),t.push({data:"101",options:{height:this.guardHeight}}),t.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),t.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&t.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),t}},{key:"encodeMiddleDigits",value:function(){var t=this.upcA[0],e=this.upcA[this.upcA.length-1],n=ve[parseInt(e)][parseInt(t)];return (0, ce.default)(this.middleDigits,n)}}]),e}();function _e(t,e){for(var n=parseInt(t[t.length-1]),r=ye[n],o="",i=0,a=0;a<r.length;a++){var u=r[a];o+="X"===u?t[i++]:u;}return ""+(o=""+e+o)+(0, pe.checksum)(o)}fe.default=be,Object.defineProperty(bt,"__esModule",{value:true}),bt.UPCE=bt.UPC=bt.EAN2=bt.EAN5=bt.EAN8=bt.EAN13=void 0;var ge=xe(_t),Oe=xe(It),Ee=xe(zt),we=xe(Qt),me=xe(ee),je=xe(fe);function xe(t){return t&&t.__esModule?t:{default:t}}bt.EAN13=ge.default,bt.EAN8=Oe.default,bt.EAN5=Ee.default,bt.EAN2=we.default,bt.UPC=me.default,bt.UPCE=je.default;var Pe={},Se={},Ce={};Object.defineProperty(Ce,"__esModule",{value:true}),Ce.START_BIN="1010",Ce.END_BIN="11101",Ce.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"],Object.defineProperty(Se,"__esModule",{value:true});var Ae=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Te=Ce,Me=function(t){return t&&t.__esModule?t:{default:t}}(h);function Re(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Le(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}var ke=function(t){function e(){return Re(this,e),Le(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,Me.default),Ae(e,[{key:"valid",value:function(){return -1!==this.data.search(/^([0-9]{2})+$/)}},{key:"encode",value:function(){var t=this,e=this.data.match(/.{2}/g).map((function(e){return t.encodePair(e)})).join("");return {data:Te.START_BIN+e+Te.END_BIN,text:this.text}}},{key:"encodePair",value:function(t){var e=Te.BINARIES[t[1]];return Te.BINARIES[t[0]].split("").map((function(t,n){return ("1"===t?"111":"1")+("1"===e[n]?"000":"0")})).join("")}}]),e}();Se.default=ke;var Ie={};Object.defineProperty(Ie,"__esModule",{value:true});var Ge=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Be=function(t){return t&&t.__esModule?t:{default:t}}(Se);var Ne=function(t){var e=t.substr(0,13).split("").map((function(t){return parseInt(t,10)})).reduce((function(t,e,n){return t+e*(3-n%2*2)}),0);return 10*Math.ceil(e/10)-e},De=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),-1!==t.search(/^[0-9]{13}$/)&&(t+=Ne(t)),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,Be.default),Ge(e,[{key:"valid",value:function(){return -1!==this.data.search(/^[0-9]{14}$/)&&+this.data[13]===Ne(this.data)}}]),e}();Ie.default=De,Object.defineProperty(Pe,"__esModule",{value:true}),Pe.ITF14=Pe.ITF=void 0;var Xe=He(Se),ze=He(Ie);function He(t){return t&&t.__esModule?t:{default:t}}Pe.ITF=Xe.default,Pe.ITF14=ze.default;var Ve={},Ue={};Object.defineProperty(Ue,"__esModule",{value:true});var $e=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),Fe=function(t){return t&&t.__esModule?t:{default:t}}(h);var We=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,Fe.default),$e(e,[{key:"encode",value:function(){for(var t="110",e=0;e<this.data.length;e++){var n=parseInt(this.data[e]).toString(2);n=Qe(n,4-n.length);for(var r=0;r<n.length;r++)t+="0"==n[r]?"100":"110";}return {data:t+="1001",text:this.text}}},{key:"valid",value:function(){return -1!==this.data.search(/^[0-9]+$/)}}]),e}();function Qe(t,e){for(var n=0;n<e;n++)t="0"+t;return t}Ue.default=We;var Je={},Ye={};Object.defineProperty(Ye,"__esModule",{value:true}),Ye.mod10=function(t){for(var e=0,n=0;n<t.length;n++){var r=parseInt(t[n]);(n+t.length)%2==0?e+=r:e+=2*r%10+Math.floor(2*r/10);}return (10-e%10)%10},Ye.mod11=function(t){for(var e=0,n=[2,3,4,5,6,7],r=0;r<t.length;r++){var o=parseInt(t[t.length-1-r]);e+=n[r%n.length]*o;}return (11-e%11)%11},Object.defineProperty(Je,"__esModule",{value:true});var qe=function(t){return t&&t.__esModule?t:{default:t}}(Ue),Ze=Ye;var Ke=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0, Ze.mod10)(t),n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,qe.default),e}();Je.default=Ke;var tn={};Object.defineProperty(tn,"__esModule",{value:true});var en=function(t){return t&&t.__esModule?t:{default:t}}(Ue),nn=Ye;var rn=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t+(0, nn.mod11)(t),n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,en.default),e}();tn.default=rn;var on={};Object.defineProperty(on,"__esModule",{value:true});var an=function(t){return t&&t.__esModule?t:{default:t}}(Ue),un=Ye;var fn=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t+=(0, un.mod10)(t),t+=(0, un.mod10)(t),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,an.default),e}();on.default=fn;var ln={};Object.defineProperty(ln,"__esModule",{value:true});var cn=function(t){return t&&t.__esModule?t:{default:t}}(Ue),sn=Ye;var pn=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t+=(0, sn.mod11)(t),t+=(0, sn.mod10)(t),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,cn.default),e}();ln.default=pn,Object.defineProperty(Ve,"__esModule",{value:true}),Ve.MSI1110=Ve.MSI1010=Ve.MSI11=Ve.MSI10=Ve.MSI=void 0;var dn=_n(Ue),hn=_n(Je),yn=_n(tn),vn=_n(on),bn=_n(ln);function _n(t){return t&&t.__esModule?t:{default:t}}Ve.MSI=dn.default,Ve.MSI10=hn.default,Ve.MSI11=yn.default,Ve.MSI1010=vn.default,Ve.MSI1110=bn.default;var gn={};Object.defineProperty(gn,"__esModule",{value:true}),gn.pharmacode=void 0;var On=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),En=function(t){return t&&t.__esModule?t:{default:t}}(h);var wn=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n));return r.number=parseInt(t,10),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,En.default),On(e,[{key:"encode",value:function(){for(var t=this.number,e="";!isNaN(t)&&0!=t;)t%2==0?(e="11100"+e,t=(t-2)/2):(e="100"+e,t=(t-1)/2);return {data:e=e.slice(0,-2),text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),e}();gn.pharmacode=wn;var mn={};Object.defineProperty(mn,"__esModule",{value:true}),mn.codabar=void 0;var jn=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),xn=function(t){return t&&t.__esModule?t:{default:t}}(h);var Pn=function(t){function e(t,n){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),0===t.search(/^[0-9\-\$\:\.\+\/]+$/)&&(t="A"+t+"A");var r=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t.toUpperCase(),n));return r.text=r.options.text||r.text.replace(/[A-D]/g,""),r}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,xn.default),jn(e,[{key:"valid",value:function(){return -1!==this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)}},{key:"encode",value:function(){for(var t=[],e=this.getEncodings(),n=0;n<this.data.length;n++)t.push(e[this.data.charAt(n)]),n!==this.data.length-1&&t.push("0");return {text:this.text,data:t.join("")}}},{key:"getEncodings",value:function(){return {0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),e}();mn.codabar=Pn;var Sn={};Object.defineProperty(Sn,"__esModule",{value:true}),Sn.GenericBarcode=void 0;var Cn=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),An=function(t){return t&&t.__esModule?t:{default:t}}(h);var Tn=function(t){function e(t,n){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t,n))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}(e,An.default),Cn(e,[{key:"encode",value:function(){return {data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return true}}]),e}();Sn.GenericBarcode=Tn,Object.defineProperty(p,"__esModule",{value:true});var Mn=d$1,Rn=j,Ln=bt,kn=Pe,In=Ve,Gn=gn,Bn=mn,Nn=Sn;p.default={CODE39:Mn.CODE39,CODE128:Rn.CODE128,CODE128A:Rn.CODE128A,CODE128B:Rn.CODE128B,CODE128C:Rn.CODE128C,EAN13:Ln.EAN13,EAN8:Ln.EAN8,EAN5:Ln.EAN5,EAN2:Ln.EAN2,UPC:Ln.UPC,UPCE:Ln.UPCE,ITF14:kn.ITF14,ITF:kn.ITF,MSI:In.MSI,MSI10:In.MSI10,MSI11:In.MSI11,MSI1010:In.MSI1010,MSI1110:In.MSI1110,pharmacode:Gn.pharmacode,codabar:Bn.codabar,GenericBarcode:Nn.GenericBarcode};var Dn={};Object.defineProperty(Dn,"__esModule",{value:true});var Xn=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);}return t};Dn.default=function(t,e){return Xn({},t,e)};var zn={};Object.defineProperty(zn,"__esModule",{value:true}),zn.default=function(t){var e=[];return function t(n){if(Array.isArray(n))for(var r=0;r<n.length;r++)t(n[r]);else n.text=n.text||"",n.data=n.data||"",e.push(n);}(t),e};var Hn={};Object.defineProperty(Hn,"__esModule",{value:true}),Hn.default=function(t){return t.marginTop=t.marginTop||t.margin,t.marginBottom=t.marginBottom||t.margin,t.marginRight=t.marginRight||t.margin,t.marginLeft=t.marginLeft||t.margin,t};var Vn={},Un={},$n={};Object.defineProperty($n,"__esModule",{value:true}),$n.default=function(t){var e=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var n in e)e.hasOwnProperty(n)&&(n=e[n],"string"==typeof t[n]&&(t[n]=parseInt(t[n],10)));"string"==typeof t.displayValue&&(t.displayValue="false"!=t.displayValue);return t};var Fn={};Object.defineProperty(Fn,"__esModule",{value:true});Fn.default={width:2,height:100,format:"auto",displayValue:true,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}},Object.defineProperty(Un,"__esModule",{value:true});var Wn=Jn($n),Qn=Jn(Fn);function Jn(t){return t&&t.__esModule?t:{default:t}}Un.default=function(t){var e={};for(var n in Qn.default)Qn.default.hasOwnProperty(n)&&(t.hasAttribute("jsbarcode-"+n.toLowerCase())&&(e[n]=t.getAttribute("jsbarcode-"+n.toLowerCase())),t.hasAttribute("data-"+n.toLowerCase())&&(e[n]=t.getAttribute("data-"+n.toLowerCase())));return e.value=t.getAttribute("jsbarcode-value")||t.getAttribute("data-value"),e=(0, Wn.default)(e)};var Yn={},qn={},Zn={};Object.defineProperty(Zn,"__esModule",{value:true}),Zn.getTotalWidthOfEncodings=Zn.calculateEncodingAttributes=Zn.getBarcodePadding=Zn.getEncodingHeight=Zn.getMaximumHeightOfEncodings=void 0;var Kn=function(t){return t&&t.__esModule?t:{default:t}}(Dn);function tr(t,e){return e.height+(e.displayValue&&t.text.length>0?e.fontSize+e.textMargin:0)+e.marginTop+e.marginBottom}function er(t,e,n){if(n.displayValue&&e<t){if("center"==n.textAlign)return Math.floor((t-e)/2);if("left"==n.textAlign)return 0;if("right"==n.textAlign)return Math.floor(t-e)}return 0}function nr(t,e,n){var r;if(n)r=n;else {if("undefined"==typeof document)return 0;r=document.createElement("canvas").getContext("2d");}r.font=e.fontOptions+" "+e.fontSize+"px "+e.font;var o=r.measureText(t);return o?o.width:0}Zn.getMaximumHeightOfEncodings=function(t){for(var e=0,n=0;n<t.length;n++)t[n].height>e&&(e=t[n].height);return e},Zn.getEncodingHeight=tr,Zn.getBarcodePadding=er,Zn.calculateEncodingAttributes=function(t,e,n){for(var r=0;r<t.length;r++){var o,i=t[r],a=(0, Kn.default)(e,i.options);o=a.displayValue?nr(i.text,a,n):0;var u=i.data.length*a.width;i.width=Math.ceil(Math.max(o,u)),i.height=tr(i,a),i.barcodePadding=er(o,u,a);}},Zn.getTotalWidthOfEncodings=function(t){for(var e=0,n=0;n<t.length;n++)e+=t[n].width;return e},Object.defineProperty(qn,"__esModule",{value:true});var rr=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),or=function(t){return t&&t.__esModule?t:{default:t}}(Dn),ir=Zn;var ar=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.canvas=e,this.encodings=n,this.options=r;}return rr(t,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var t=0;t<this.encodings.length;t++){var e=(0, or.default)(this.options,this.encodings[t].options);this.drawCanvasBarcode(e,this.encodings[t]),this.drawCanvasText(e,this.encodings[t]),this.moveCanvasDrawing(this.encodings[t]);}this.restoreCanvas();}},{key:"prepareCanvas",value:function(){var t=this.canvas.getContext("2d");t.save(),(0, ir.calculateEncodingAttributes)(this.encodings,this.options,t);var e=(0, ir.getTotalWidthOfEncodings)(this.encodings),n=(0, ir.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=e+this.options.marginLeft+this.options.marginRight,this.canvas.height=n,t.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(t.fillStyle=this.options.background,t.fillRect(0,0,this.canvas.width,this.canvas.height)),t.translate(this.options.marginLeft,0);}},{key:"drawCanvasBarcode",value:function(t,e){var n,r=this.canvas.getContext("2d"),o=e.data;n="top"==t.textPosition?t.marginTop+t.fontSize+t.textMargin:t.marginTop,r.fillStyle=t.lineColor;for(var i=0;i<o.length;i++){var a=i*t.width+e.barcodePadding;"1"===o[i]?r.fillRect(a,n,t.width,t.height):o[i]&&r.fillRect(a,n,t.width,t.height*o[i]);}}},{key:"drawCanvasText",value:function(t,e){var n,r,o=this.canvas.getContext("2d"),i=t.fontOptions+" "+t.fontSize+"px "+t.font;t.displayValue&&(r="top"==t.textPosition?t.marginTop+t.fontSize-t.textMargin:t.height+t.textMargin+t.marginTop+t.fontSize,o.font=i,"left"==t.textAlign||e.barcodePadding>0?(n=0,o.textAlign="left"):"right"==t.textAlign?(n=e.width-1,o.textAlign="right"):(n=e.width/2,o.textAlign="center"),o.fillText(e.text,n,r));}},{key:"moveCanvasDrawing",value:function(t){this.canvas.getContext("2d").translate(t.width,0);}},{key:"restoreCanvas",value:function(){this.canvas.getContext("2d").restore();}}]),t}();qn.default=ar;var ur={};Object.defineProperty(ur,"__esModule",{value:true});var fr=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),lr=function(t){return t&&t.__esModule?t:{default:t}}(Dn),cr=Zn;var sr="http://www.w3.org/2000/svg",pr=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.svg=e,this.encodings=n,this.options=r,this.document=r.xmlDocument||document;}return fr(t,[{key:"render",value:function(){var t=this.options.marginLeft;this.prepareSVG();for(var e=0;e<this.encodings.length;e++){var n=this.encodings[e],r=(0, lr.default)(this.options,n.options),o=this.createGroup(t,r.marginTop,this.svg);this.setGroupOptions(o,r),this.drawSvgBarcode(o,r,n),this.drawSVGText(o,r,n),t+=n.width;}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0, cr.calculateEncodingAttributes)(this.encodings,this.options);var t=(0, cr.getTotalWidthOfEncodings)(this.encodings),e=(0, cr.getMaximumHeightOfEncodings)(this.encodings),n=t+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(n,e),this.options.background&&this.drawRect(0,0,n,e,this.svg).setAttribute("style","fill:"+this.options.background+";");}},{key:"drawSvgBarcode",value:function(t,e,n){var r,o=n.data;r="top"==e.textPosition?e.fontSize+e.textMargin:0;for(var i=0,a=0,u=0;u<o.length;u++)a=u*e.width+n.barcodePadding,"1"===o[u]?i++:i>0&&(this.drawRect(a-e.width*i,r,e.width*i,e.height,t),i=0);i>0&&this.drawRect(a-e.width*(i-1),r,e.width*i,e.height,t);}},{key:"drawSVGText",value:function(t,e,n){var r,o,i=this.document.createElementNS(sr,"text");e.displayValue&&(i.setAttribute("style","font:"+e.fontOptions+" "+e.fontSize+"px "+e.font),o="top"==e.textPosition?e.fontSize-e.textMargin:e.height+e.textMargin+e.fontSize,"left"==e.textAlign||n.barcodePadding>0?(r=0,i.setAttribute("text-anchor","start")):"right"==e.textAlign?(r=n.width-1,i.setAttribute("text-anchor","end")):(r=n.width/2,i.setAttribute("text-anchor","middle")),i.setAttribute("x",r),i.setAttribute("y",o),i.appendChild(this.document.createTextNode(n.text)),t.appendChild(i));}},{key:"setSvgAttributes",value:function(t,e){var n=this.svg;n.setAttribute("width",t+"px"),n.setAttribute("height",e+"px"),n.setAttribute("x","0px"),n.setAttribute("y","0px"),n.setAttribute("viewBox","0 0 "+t+" "+e),n.setAttribute("xmlns",sr),n.setAttribute("version","1.1"),n.setAttribute("style","transform: translate(0,0)");}},{key:"createGroup",value:function(t,e,n){var r=this.document.createElementNS(sr,"g");return r.setAttribute("transform","translate("+t+", "+e+")"),n.appendChild(r),r}},{key:"setGroupOptions",value:function(t,e){t.setAttribute("style","fill:"+e.lineColor+";");}},{key:"drawRect",value:function(t,e,n,r,o){var i=this.document.createElementNS(sr,"rect");return i.setAttribute("x",t),i.setAttribute("y",e),i.setAttribute("width",n),i.setAttribute("height",r),o.appendChild(i),i}}]),t}();ur.default=pr;var dr={};Object.defineProperty(dr,"__esModule",{value:true});var hr=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var yr=function(){function t(e,n,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.object=e,this.encodings=n,this.options=r;}return hr(t,[{key:"render",value:function(){this.object.encodings=this.encodings;}}]),t}();dr.default=yr,Object.defineProperty(Yn,"__esModule",{value:true});var vr=gr(qn),br=gr(ur),_r=gr(dr);function gr(t){return t&&t.__esModule?t:{default:t}}Yn.default={CanvasRenderer:vr.default,SVGRenderer:br.default,ObjectRenderer:_r.default};var Or={};function Er(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function wr(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return !e||"object"!=typeof e&&"function"!=typeof e?t:e}function mr(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:false,writable:true,configurable:true}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e);}Object.defineProperty(Or,"__esModule",{value:true});var jr=function(t){function e(t,n){Er(this,e);var r=wr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return r.name="InvalidInputException",r.symbology=t,r.input=n,r.message='"'+r.input+'" is not a valid input for '+r.symbology,r}return mr(e,Error),e}(),xr=function(t){function e(){Er(this,e);var t=wr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="InvalidElementException",t.message="Not supported type to render on",t}return mr(e,Error),e}(),Pr=function(t){function e(){Er(this,e);var t=wr(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.name="NoElementException",t.message="No element to render on.",t}return mr(e,Error),e}();Or.InvalidInputException=jr,Or.InvalidElementException=xr,Or.NoElementException=Pr,Object.defineProperty(Vn,"__esModule",{value:true});var Sr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cr=Mr(Un),Ar=Mr(Yn),Tr=Or;function Mr(t){return t&&t.__esModule?t:{default:t}}function Rr(t){if("string"==typeof t)return function(t){var e=document.querySelectorAll(t);if(0===e.length)return;for(var n=[],r=0;r<e.length;r++)n.push(Rr(e[r]));return n}(t);if(Array.isArray(t)){for(var e=[],n=0;n<t.length;n++)e.push(Rr(t[n]));return e}if("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLImageElement)return r=t,{element:o=document.createElement("canvas"),options:(0, Cr.default)(r),renderer:Ar.default.CanvasRenderer,afterRender:function(){r.setAttribute("src",o.toDataURL());}};if(t&&t.nodeName&&"svg"===t.nodeName.toLowerCase()||"undefined"!=typeof SVGElement&&t instanceof SVGElement)return {element:t,options:(0, Cr.default)(t),renderer:Ar.default.SVGRenderer};if("undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)return {element:t,options:(0, Cr.default)(t),renderer:Ar.default.CanvasRenderer};if(t&&t.getContext)return {element:t,renderer:Ar.default.CanvasRenderer};if(t&&"object"===(void 0===t?"undefined":Sr(t))&&!t.nodeName)return {element:t,renderer:Ar.default.ObjectRenderer};throw new Tr.InvalidElementException;var r,o;}Vn.default=Rr;var Lr={};Object.defineProperty(Lr,"__esModule",{value:true});var kr=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();var Ir=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.api=e;}return kr(t,[{key:"handleCatch",value:function(t){if("InvalidInputException"!==t.name)throw t;if(this.api._options.valid===this.api._defaults.valid)throw t.message;this.api._options.valid(false),this.api.render=function(){};}},{key:"wrapBarcodeCall",value:function(t){try{var e=t.apply(void 0,arguments);return this.api._options.valid(!0),e}catch(n){return this.handleCatch(n),this.api}}}]),t}();Lr.default=Ir;var Gr=$r(p),Br=$r(Dn),Nr=$r(zn),Dr=$r(Hn),Xr=$r(Vn),zr=$r($n),Hr=$r(Lr),Vr=Or,Ur=$r(Fn);function $r(t){return t&&t.__esModule?t:{default:t}}var Fr=function(){},Wr=function(t,e,n){var r=new Fr;if(void 0===t)throw Error("No element to render on was provided.");return r._renderProperties=(0, Xr.default)(t),r._encodings=[],r._options=Ur.default,r._errorHandler=new Hr.default(r),void 0!==e&&((n=n||{}).format||(n.format=qr()),r.options(n)[n.format](e,n).render()),r};for(var Qr in Wr.getModule=function(t){return Gr.default[t]},Gr.default)Gr.default.hasOwnProperty(Qr)&&Jr(Gr.default,Qr);function Jr(t,e){Fr.prototype[e]=Fr.prototype[e.toUpperCase()]=Fr.prototype[e.toLowerCase()]=function(n,r){var o=this;return o._errorHandler.wrapBarcodeCall((function(){r.text=void 0===r.text?void 0:""+r.text;var i=(0, Br.default)(o._options,r);i=(0, zr.default)(i);var a=t[e],u=Yr(n,a,i);return o._encodings.push(u),o}))};}function Yr(t,e,n){var r=new e(t=""+t,n);if(!r.valid())throw new Vr.InvalidInputException(r.constructor.name,t);var o=r.encode();o=(0, Nr.default)(o);for(var i=0;i<o.length;i++)o[i].options=(0, Br.default)(n,o[i].options);return o}function qr(){return Gr.default.CODE128?"CODE128":Object.keys(Gr.default)[0]}function Zr(t,e,n){e=(0, Nr.default)(e);for(var r=0;r<e.length;r++)e[r].options=(0, Br.default)(n,e[r].options),(0, Dr.default)(e[r].options);(0, Dr.default)(n),new(t.renderer)(t.element,e,n).render(),t.afterRender&&t.afterRender();}Fr.prototype.options=function(t){return this._options=(0, Br.default)(this._options,t),this},Fr.prototype.blank=function(t){var e=new Array(t+1).join("0");return this._encodings.push({data:e}),this},Fr.prototype.init=function(){var t;if(this._renderProperties)for(var e in Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]),this._renderProperties){t=this._renderProperties[e];var n=(0, Br.default)(this._options,t.options);"auto"==n.format&&(n.format=qr()),this._errorHandler.wrapBarcodeCall((function(){var e=Yr(n.value,Gr.default[n.format.toUpperCase()],n);Zr(t,e,n);}));}},Fr.prototype.render=function(){if(!this._renderProperties)throw new Vr.NoElementException;if(Array.isArray(this._renderProperties))for(var t=0;t<this._renderProperties.length;t++)Zr(this._renderProperties[t],this._encodings,this._options);else Zr(this._renderProperties,this._encodings,this._options);return this},Fr.prototype._defaults=Ur.default,"undefined"!=typeof window&&(window.JsBarcode=Wr),"undefined"!=typeof jQuery&&(jQuery.fn.JsBarcode=function(t,e){var n=[];return jQuery(this).each((function(){n.push(this);})),Wr(n,t,e)});var Kr=Wr;const to=defineComponent({name:"vue3Barcode",props:{value:{type:[String,Number],default:""},format:[String],width:[String,Number],height:[String,Number],displayValue:{type:[String,Boolean],default:true},text:[String,Number],fontOptions:[String],font:[String],textAlign:[String],textPosition:[String],textMargin:[String,Number],fontSize:[String,Number],background:[String],lineColor:[String],margin:[String,Number],marginTop:[String,Number],marginBottom:[String,Number],marginLeft:[String,Number],marginRight:[String,Number],flat:[Boolean],ean128:[String,Boolean],elementTag:{type:String,default:"svg",validator:function(t){return -1!==["canvas","svg","img"].indexOf(t)}}},setup(t,{slots:u}){const p=ref(true);return onMounted((()=>{watch(t,(u=>{const f=(l=((t,e)=>{for(var n in e||(e={}))o$1.call(e,n)&&a(t,n,e[n]);if(r)for(var n of r(e))i.call(e,n)&&a(t,n,e[n]);return t})({},u),e$1(l,n$2({valid:t=>{p.value=t;}})));var l;!function(t){for(var e in t)t.hasOwnProperty(e)&&void 0===t[e]&&delete t[e];}(f),Kr(document.querySelector(".vue3-barcode-element"),String(t.value),f);}),{deep:true,immediate:true});})),()=>h$3("div",[h$3(t.elementTag,{style:{display:p.value?void 0:"none"},class:["vue3-barcode-element"]}),h$3("div",{style:{display:p.value?"none":void 0}},u)])}});to.install=t=>{t.component(to.name,to);};
190702
187407
 
190703
187408
  const _sfc_main$4 = /* @__PURE__ */ defineComponent({
190704
187409
  __name: "barcode-item",
@@ -190925,7 +187630,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
190925
187630
 
190926
187631
  /* unplugin-vue-components disabled */
190927
187632
 
190928
- const StarHorseHmenu = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-4fbf8504"]]);
187633
+ const StarHorseHmenu = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-ad411b15"]]);
190929
187634
 
190930
187635
  const StarHorseHmenu$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
190931
187636
  __proto__: null,
@@ -194124,4 +190829,4 @@ const stringStylesDT93GIY_ = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defi
194124
190829
  fullWidthButton: e
194125
190830
  }, Symbol.toStringTag, { value: 'Module' }));
194126
190831
 
194127
- export { __unplugin_components_5 as ContentMenu, DEFAULT_INITIAL_Z_INDEX, _sfc_main$1O as ShDynamicForm, ShForm, _sfc_main$1M as ShTableListColumn, __unplugin_components_2 as StarHorseButtonList, StarHorseDataSelector, StarHorseDataView, __unplugin_components_0$4 as StarHorseDataViewItems, __unplugin_components_2$4 as StarHorseDataViewTable, __unplugin_components_0$6 as StarHorseDialog, StarHorseDraggable, StarHorseForm, _sfc_main$1h as StarHorseFormItem, __unplugin_components_0$3 as StarHorseFormList, _sfc_main$1q as StarHorseFormTable, StarHorseHmenu, __unplugin_components_1$4 as StarHorseIcon, StarHorseJsonEditor, _sfc_main$1e as StarHorsePopover, __unplugin_components_0$1 as StarHorseSearchComp, StarHorseStaticTable, StarHorseSvg, __unplugin_components_2$1 as StarHorseTableColumn, __unplugin_components_1$1 as StarHorseTableComp, _sfc_main$1H as StarHorseTableViewColumn, StarHorseTree, apiInstance, areaItem, _sfc_main$U as audioItem, _sfc_main$T as autocompleteItem, _sfc_main$4 as barcodeItem, batchFieldDefaultValues, batchModifyAction, blobData, boxContainer, buttonItem, camelCaseToUnderline, cardContainer, cascadeItem, _sfc_main$Q as checkboxItem, closeLoad, collapseContainer, _sfc_main$P as colorItem, commonParseCodeToName, compDynamicData, convertToCamelCase, copy$3 as copy, createComponent, createCondition, createDate, createDatetime, createFilter, createTree, cronItem, currentDate, currentMonthRange, dateParse, dateTypes, datetimeItem, dbConfigList, index as default, deleteByIds, _sfc_main$D as departItem, dialogInputItem, dialogPreps, dictData, _sfc_main$B as dividerItem, download$2 as download, downloadData, dynamicUrlOperation, dytableContainer, error$1 as error, formFieldMapping, generateDeviceId, getFingerId, getMenuId, getRequest, htmlItem, _sfc_main$z as htmleditorItem, httpRequest, iconItem, imageItem, inputItem, isDark, isJson, isPromise, jsonArrayItem, jsonItem, load, loadById, loadData, loadElementPlusIcon, loadGetData, loadSvgIcons, markdownItem, message$2 as message, monthRange, numberItem, numberRangeItem, operationConfirm, pageSelectItem, parseDateByType, _sfc_main$o as passwordItem, piniaInstance, postRequest, _sfc_main$5 as qrcodeItem, _sfc_main$n as radioItem, _sfc_main$m as rateItem, removeEmptyCondition, rowClassName, searchData, searchMatchList, selectItem, signatureItem, _sfc_main$j as sliderItem, success, _sfc_main$i as switchItem, tabContainer, tableContainer, _sfc_main$h as tagItem, textItem, textToPinYin, _sfc_main$f as textareaItem, timeItem, timePickerItem, toggle, _sfc_main$c as transferItem, trim, _sfc_main$b as tselectItem, _sfc_main$a as unknownItem, uploadItem, uploadRequest, useButtonPermissionStore, useConsumerViewStore, useContinusConfigStore, useCopyerOperationStore, useDesignFormStore, useDesignPageStore, useDynamicFormStore, useGlobalConfigStore, useSelfOperationStore, useUserInfoStore, useZIndex, userAction, userFunction, _sfc_main$8 as userItem, _sfc_main$7 as usercompItem, uuid, viewMarkdownItem, warning$2 as warning };
190832
+ export { __unplugin_components_5 as ContentMenu, DEFAULT_INITIAL_Z_INDEX, _sfc_main$1O as ShDynamicForm, ShForm, _sfc_main$1M as ShTableListColumn, __unplugin_components_2 as StarHorseButtonList, StarHorseDataSelector, StarHorseDataView, __unplugin_components_0$4 as StarHorseDataViewItems, __unplugin_components_2$4 as StarHorseDataViewTable, __unplugin_components_0$6 as StarHorseDialog, StarHorseDraggable, StarHorseForm, _sfc_main$1h as StarHorseFormItem, __unplugin_components_0$3 as StarHorseFormList, _sfc_main$1q as StarHorseFormTable, StarHorseHmenu, __unplugin_components_1$4 as StarHorseIcon, StarHorseJsonEditor, _sfc_main$1e as StarHorsePopover, __unplugin_components_0$1 as StarHorseSearchComp, StarHorseStaticTable, StarHorseSvg, __unplugin_components_2$1 as StarHorseTableColumn, __unplugin_components_1$1 as StarHorseTableComp, _sfc_main$1H as StarHorseTableViewColumn, StarHorseTree, apiInstance, areaItem, _sfc_main$U as audioItem, _sfc_main$T as autocompleteItem, _sfc_main$4 as barcodeItem, batchFieldDefaultValues, batchModifyAction, blobData, boxContainer, buttonItem, camelCaseToUnderline, cardContainer, cascadeItem, _sfc_main$Q as checkboxItem, closeLoad, collapseContainer, _sfc_main$P as colorItem, commonParseCodeToName, compDynamicData, convertToCamelCase, copy$3 as copy, createComponent, createCondition, createDate, createDatetime, createFilter, createTree, cronItem, currentDate, currentMonthRange, dateParse, dateTypes, datetimeItem, index as default, deleteByIds, _sfc_main$D as departItem, dialogInputItem, dialogPreps, dictData, _sfc_main$B as dividerItem, download$2 as download, downloadData, dynamicUrlOperation, dytableContainer, error$1 as error, formFieldMapping, generateDeviceId, getFingerId, getMenuId, getRequest, htmlItem, _sfc_main$z as htmleditorItem, httpRequest, iconItem, imageItem, inputItem, isDark, isJson, isPromise, jsonArrayItem, jsonItem, load, loadById, loadData, loadElementPlusIcon, loadGetData, loadSvgIcons, markdownItem, message$2 as message, monthRange, numberItem, numberRangeItem, operationConfirm, pageSelectItem, parseDateByType, _sfc_main$o as passwordItem, piniaInstance, postRequest, _sfc_main$5 as qrcodeItem, _sfc_main$n as radioItem, _sfc_main$m as rateItem, removeEmptyCondition, rowClassName, searchData, searchMatchList, selectItem, signatureItem, _sfc_main$j as sliderItem, success, _sfc_main$i as switchItem, tabContainer, tableContainer, _sfc_main$h as tagItem, textItem, textToPinYin, _sfc_main$f as textareaItem, timeItem, timePickerItem, toggle, _sfc_main$c as transferItem, trim, _sfc_main$b as tselectItem, _sfc_main$a as unknownItem, uploadItem, uploadRequest, useButtonPermissionStore, useConsumerViewStore, useContinusConfigStore, useCopyerOperationStore, useDesignFormStore, useDesignPageStore, useDynamicFormStore, useGlobalConfigStore, useSelfOperationStore, useUserInfoStore, useZIndex, userAction, userFunction, _sfc_main$8 as userItem, _sfc_main$7 as usercompItem, uuid, viewMarkdownItem, warning$2 as warning };