@company-ui/vue
Version:
1,512 lines • 105 kB
JavaScript
import { openBlock, createElementBlock, normalizeClass, renderSlot, defineComponent, resolveDirective, withDirectives, createElementVNode, mergeProps, createCommentVNode, toDisplayString, createBlock, Teleport, normalizeStyle, Fragment, renderList, createTextVNode, vShow } from "vue";
var isVue3 = true;
const __viteBrowserExternal = {};
const __CJS__import__0__ = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
default: __viteBrowserExternal
}, Symbol.toStringTag, { value: "Module" }));
var module = { exports: {} };
var __assign = function() {
__assign = Object.assign || function __assign2(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) {
return value instanceof P ? value : new P(function(resolve) {
resolve(value);
});
}
return new (P || (P = Promise))(function(resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator["throw"](value));
} catch (e) {
reject(e);
}
}
function step(result) {
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() {
if (t[0] & 1)
throw t[1];
return t[1];
}, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
return this;
}), g;
function verb(n) {
return function(v) {
return step([n, v]);
};
}
function step(op) {
if (f)
throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _)
try {
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;
if (y = 0, t)
op = [op[0] & 2, t.value];
switch (op[0]) {
case 0:
case 1:
t = op;
break;
case 4:
_.label++;
return { value: op[1], done: false };
case 5:
_.label++;
y = op[1];
op = [0];
continue;
case 7:
op = _.ops.pop();
_.trys.pop();
continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
_ = 0;
continue;
}
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
_.label = op[1];
break;
}
if (op[0] === 6 && _.label < t[1]) {
_.label = t[1];
t = op;
break;
}
if (t && _.label < t[2]) {
_.label = t[2];
_.ops.push(op);
break;
}
if (t[2])
_.ops.pop();
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
} catch (e) {
op = [6, e];
y = 0;
} finally {
f = t = 0;
}
if (op[0] & 5)
throw op[1];
return { value: op[0] ? op[1] : void 0, done: true };
}
}
typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
var isUndefined$1 = function isUndefined(value) {
return value === void 0;
};
var replaceAll = function replaceAll2(str, find, replace) {
return str.replace(new RegExp(find, "g"), replace);
};
var removeHtmlTags$1 = function removeHtmlTags(str) {
return str.replace(/(<([^>]+)>)/gi, "");
};
var stringToJson = function stringToJson2(str) {
try {
var result = JSON.parse(str);
if (Array.isArray(result)) {
return result;
} else {
return [];
}
} catch (e) {
return [];
}
};
var objectToQueryString = function objectToQueryString2(object, prefix) {
if (prefix === void 0) {
prefix = "";
}
return prefix + Object.keys(object).map(function(key) {
return "".concat(key, "=").concat(object[key]);
}).join("&");
};
var splitArray = function splitArray2(arr, size2) {
var result = [];
for (var i = 0; i < arr.length; i += size2) {
result.push(arr.slice(i, i + size2));
}
return result;
};
var qccAvatarUrls = [
"https://image.qcc.com/logo/{id}.jpg",
"https://image.qcc.com/auto/{id}.jpg"
];
var handleAvatar = function(img, options) {
return __awaiter(void 0, void 0, void 0, function() {
var id, _a, _b, _c;
return __generator(this, function(_d) {
switch (_d.label) {
case 0:
id = img.dataset.id || "";
if (!options.avatarUrl)
return [3, 2];
_a = img;
return [4, getImageData(id, [options.avatarUrl])];
case 1:
_a.src = _d.sent();
return [
2
/*return*/
];
case 2:
_b = options.api;
switch (_b) {
case "qcc_open":
return [3, 3];
}
return [3, 5];
case 3:
_c = img;
return [4, getImageData(id, qccAvatarUrls)];
case 4:
_c.src = _d.sent();
return [3, 5];
case 5:
return [
2
/*return*/
];
}
});
});
};
var getImageData = function(id, urls) {
return __awaiter(void 0, void 0, void 0, function() {
var _i, urls_1, url, truthUrl, response, blob, error_1;
return __generator(this, function(_a) {
switch (_a.label) {
case 0:
_i = 0, urls_1 = urls;
_a.label = 1;
case 1:
if (!(_i < urls_1.length))
return [3, 8];
url = urls_1[_i];
_a.label = 2;
case 2:
_a.trys.push([2, 6, , 7]);
truthUrl = replaceAll(url, "{id}", id);
return [4, fetch(truthUrl)];
case 3:
response = _a.sent();
if (!(response.status === 200))
return [3, 5];
return [4, response.blob()];
case 4:
blob = _a.sent();
return [2, URL.createObjectURL(blob)];
case 5:
return [3, 7];
case 6:
error_1 = _a.sent();
console.error(error_1);
return [3, 7];
case 7:
_i++;
return [3, 1];
case 8:
return [2, ""];
}
});
});
};
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
function getDefaultExportFromCjs(x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
}
var md5$1 = { exports: {} };
function commonjsRequire(path) {
throw new Error('Could not dynamically require "' + path + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var core = { exports: {} };
var hasRequiredCore;
function requireCore() {
if (hasRequiredCore)
return core.exports;
hasRequiredCore = 1;
(function(module2, exports) {
(function(root, factory) {
{
module2.exports = factory();
}
})(commonjsGlobal, function() {
var CryptoJS = CryptoJS || function(Math2, undefined$1) {
var crypto2;
if (typeof window !== "undefined" && window.crypto) {
crypto2 = window.crypto;
}
if (typeof self !== "undefined" && self.crypto) {
crypto2 = self.crypto;
}
if (typeof globalThis !== "undefined" && globalThis.crypto) {
crypto2 = globalThis.crypto;
}
if (!crypto2 && typeof window !== "undefined" && window.msCrypto) {
crypto2 = window.msCrypto;
}
if (!crypto2 && typeof commonjsGlobal !== "undefined" && commonjsGlobal.crypto) {
crypto2 = commonjsGlobal.crypto;
}
if (!crypto2 && typeof commonjsRequire === "function") {
try {
crypto2 = __viteBrowserExternal || __CJS__import__0__;
} catch (err) {
}
}
var cryptoSecureRandomInt = function() {
if (crypto2) {
if (typeof crypto2.getRandomValues === "function") {
try {
return crypto2.getRandomValues(new Uint32Array(1))[0];
} catch (err) {
}
}
if (typeof crypto2.randomBytes === "function") {
try {
return crypto2.randomBytes(4).readInt32LE();
} catch (err) {
}
}
}
throw new Error("Native crypto module could not be used to get secure random number.");
};
var create = Object.create || /* @__PURE__ */ function() {
function F() {
}
return function(obj) {
var subtype;
F.prototype = obj;
subtype = new F();
F.prototype = null;
return subtype;
};
}();
var C = {};
var C_lib = C.lib = {};
var Base = C_lib.Base = /* @__PURE__ */ function() {
return {
/**
* Creates a new object that inherits from this object.
*
* @param {Object} overrides Properties to copy into the new object.
*
* @return {Object} The new object.
*
* @static
*
* @example
*
* var MyType = CryptoJS.lib.Base.extend({
* field: 'value',
*
* method: function () {
* }
* });
*/
extend: function(overrides) {
var subtype = create(this);
if (overrides) {
subtype.mixIn(overrides);
}
if (!subtype.hasOwnProperty("init") || this.init === subtype.init) {
subtype.init = function() {
subtype.$super.init.apply(this, arguments);
};
}
subtype.init.prototype = subtype;
subtype.$super = this;
return subtype;
},
/**
* Extends this object and runs the init method.
* Arguments to create() will be passed to init().
*
* @return {Object} The new object.
*
* @static
*
* @example
*
* var instance = MyType.create();
*/
create: function() {
var instance = this.extend();
instance.init.apply(instance, arguments);
return instance;
},
/**
* Initializes a newly created object.
* Override this method to add some logic when your objects are created.
*
* @example
*
* var MyType = CryptoJS.lib.Base.extend({
* init: function () {
* // ...
* }
* });
*/
init: function() {
},
/**
* Copies properties into this object.
*
* @param {Object} properties The properties to mix in.
*
* @example
*
* MyType.mixIn({
* field: 'value'
* });
*/
mixIn: function(properties) {
for (var propertyName in properties) {
if (properties.hasOwnProperty(propertyName)) {
this[propertyName] = properties[propertyName];
}
}
if (properties.hasOwnProperty("toString")) {
this.toString = properties.toString;
}
},
/**
* Creates a copy of this object.
*
* @return {Object} The clone.
*
* @example
*
* var clone = instance.clone();
*/
clone: function() {
return this.init.prototype.extend(this);
}
};
}();
var WordArray = C_lib.WordArray = Base.extend({
/**
* Initializes a newly created word array.
*
* @param {Array} words (Optional) An array of 32-bit words.
* @param {number} sigBytes (Optional) The number of significant bytes in the words.
*
* @example
*
* var wordArray = CryptoJS.lib.WordArray.create();
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
*/
init: function(words, sigBytes) {
words = this.words = words || [];
if (sigBytes != undefined$1) {
this.sigBytes = sigBytes;
} else {
this.sigBytes = words.length * 4;
}
},
/**
* Converts this word array to a string.
*
* @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
*
* @return {string} The stringified word array.
*
* @example
*
* var string = wordArray + '';
* var string = wordArray.toString();
* var string = wordArray.toString(CryptoJS.enc.Utf8);
*/
toString: function(encoder) {
return (encoder || Hex).stringify(this);
},
/**
* Concatenates a word array to this word array.
*
* @param {WordArray} wordArray The word array to append.
*
* @return {WordArray} This word array.
*
* @example
*
* wordArray1.concat(wordArray2);
*/
concat: function(wordArray) {
var thisWords = this.words;
var thatWords = wordArray.words;
var thisSigBytes = this.sigBytes;
var thatSigBytes = wordArray.sigBytes;
this.clamp();
if (thisSigBytes % 4) {
for (var i = 0; i < thatSigBytes; i++) {
var thatByte = thatWords[i >>> 2] >>> 24 - i % 4 * 8 & 255;
thisWords[thisSigBytes + i >>> 2] |= thatByte << 24 - (thisSigBytes + i) % 4 * 8;
}
} else {
for (var j = 0; j < thatSigBytes; j += 4) {
thisWords[thisSigBytes + j >>> 2] = thatWords[j >>> 2];
}
}
this.sigBytes += thatSigBytes;
return this;
},
/**
* Removes insignificant bits.
*
* @example
*
* wordArray.clamp();
*/
clamp: function() {
var words = this.words;
var sigBytes = this.sigBytes;
words[sigBytes >>> 2] &= 4294967295 << 32 - sigBytes % 4 * 8;
words.length = Math2.ceil(sigBytes / 4);
},
/**
* Creates a copy of this word array.
*
* @return {WordArray} The clone.
*
* @example
*
* var clone = wordArray.clone();
*/
clone: function() {
var clone = Base.clone.call(this);
clone.words = this.words.slice(0);
return clone;
},
/**
* Creates a word array filled with random bytes.
*
* @param {number} nBytes The number of random bytes to generate.
*
* @return {WordArray} The random word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.lib.WordArray.random(16);
*/
random: function(nBytes) {
var words = [];
for (var i = 0; i < nBytes; i += 4) {
words.push(cryptoSecureRandomInt());
}
return new WordArray.init(words, nBytes);
}
});
var C_enc = C.enc = {};
var Hex = C_enc.Hex = {
/**
* Converts a word array to a hex string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The hex string.
*
* @static
*
* @example
*
* var hexString = CryptoJS.enc.Hex.stringify(wordArray);
*/
stringify: function(wordArray) {
var words = wordArray.words;
var sigBytes = wordArray.sigBytes;
var hexChars = [];
for (var i = 0; i < sigBytes; i++) {
var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
hexChars.push((bite >>> 4).toString(16));
hexChars.push((bite & 15).toString(16));
}
return hexChars.join("");
},
/**
* Converts a hex string to a word array.
*
* @param {string} hexStr The hex string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Hex.parse(hexString);
*/
parse: function(hexStr) {
var hexStrLength = hexStr.length;
var words = [];
for (var i = 0; i < hexStrLength; i += 2) {
words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << 24 - i % 8 * 4;
}
return new WordArray.init(words, hexStrLength / 2);
}
};
var Latin1 = C_enc.Latin1 = {
/**
* Converts a word array to a Latin1 string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The Latin1 string.
*
* @static
*
* @example
*
* var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
*/
stringify: function(wordArray) {
var words = wordArray.words;
var sigBytes = wordArray.sigBytes;
var latin1Chars = [];
for (var i = 0; i < sigBytes; i++) {
var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
latin1Chars.push(String.fromCharCode(bite));
}
return latin1Chars.join("");
},
/**
* Converts a Latin1 string to a word array.
*
* @param {string} latin1Str The Latin1 string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
*/
parse: function(latin1Str) {
var latin1StrLength = latin1Str.length;
var words = [];
for (var i = 0; i < latin1StrLength; i++) {
words[i >>> 2] |= (latin1Str.charCodeAt(i) & 255) << 24 - i % 4 * 8;
}
return new WordArray.init(words, latin1StrLength);
}
};
var Utf8 = C_enc.Utf8 = {
/**
* Converts a word array to a UTF-8 string.
*
* @param {WordArray} wordArray The word array.
*
* @return {string} The UTF-8 string.
*
* @static
*
* @example
*
* var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
*/
stringify: function(wordArray) {
try {
return decodeURIComponent(escape(Latin1.stringify(wordArray)));
} catch (e) {
throw new Error("Malformed UTF-8 data");
}
},
/**
* Converts a UTF-8 string to a word array.
*
* @param {string} utf8Str The UTF-8 string.
*
* @return {WordArray} The word array.
*
* @static
*
* @example
*
* var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
*/
parse: function(utf8Str) {
return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
}
};
var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
/**
* Resets this block algorithm's data buffer to its initial state.
*
* @example
*
* bufferedBlockAlgorithm.reset();
*/
reset: function() {
this._data = new WordArray.init();
this._nDataBytes = 0;
},
/**
* Adds new data to this block algorithm's buffer.
*
* @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
*
* @example
*
* bufferedBlockAlgorithm._append('data');
* bufferedBlockAlgorithm._append(wordArray);
*/
_append: function(data) {
if (typeof data == "string") {
data = Utf8.parse(data);
}
this._data.concat(data);
this._nDataBytes += data.sigBytes;
},
/**
* Processes available data blocks.
*
* This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
*
* @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
*
* @return {WordArray} The processed data.
*
* @example
*
* var processedData = bufferedBlockAlgorithm._process();
* var processedData = bufferedBlockAlgorithm._process(!!'flush');
*/
_process: function(doFlush) {
var processedWords;
var data = this._data;
var dataWords = data.words;
var dataSigBytes = data.sigBytes;
var blockSize = this.blockSize;
var blockSizeBytes = blockSize * 4;
var nBlocksReady = dataSigBytes / blockSizeBytes;
if (doFlush) {
nBlocksReady = Math2.ceil(nBlocksReady);
} else {
nBlocksReady = Math2.max((nBlocksReady | 0) - this._minBufferSize, 0);
}
var nWordsReady = nBlocksReady * blockSize;
var nBytesReady = Math2.min(nWordsReady * 4, dataSigBytes);
if (nWordsReady) {
for (var offset2 = 0; offset2 < nWordsReady; offset2 += blockSize) {
this._doProcessBlock(dataWords, offset2);
}
processedWords = dataWords.splice(0, nWordsReady);
data.sigBytes -= nBytesReady;
}
return new WordArray.init(processedWords, nBytesReady);
},
/**
* Creates a copy of this object.
*
* @return {Object} The clone.
*
* @example
*
* var clone = bufferedBlockAlgorithm.clone();
*/
clone: function() {
var clone = Base.clone.call(this);
clone._data = this._data.clone();
return clone;
},
_minBufferSize: 0
});
C_lib.Hasher = BufferedBlockAlgorithm.extend({
/**
* Configuration options.
*/
cfg: Base.extend(),
/**
* Initializes a newly created hasher.
*
* @param {Object} cfg (Optional) The configuration options to use for this hash computation.
*
* @example
*
* var hasher = CryptoJS.algo.SHA256.create();
*/
init: function(cfg) {
this.cfg = this.cfg.extend(cfg);
this.reset();
},
/**
* Resets this hasher to its initial state.
*
* @example
*
* hasher.reset();
*/
reset: function() {
BufferedBlockAlgorithm.reset.call(this);
this._doReset();
},
/**
* Updates this hasher with a message.
*
* @param {WordArray|string} messageUpdate The message to append.
*
* @return {Hasher} This hasher.
*
* @example
*
* hasher.update('message');
* hasher.update(wordArray);
*/
update: function(messageUpdate) {
this._append(messageUpdate);
this._process();
return this;
},
/**
* Finalizes the hash computation.
* Note that the finalize operation is effectively a destructive, read-once operation.
*
* @param {WordArray|string} messageUpdate (Optional) A final message update.
*
* @return {WordArray} The hash.
*
* @example
*
* var hash = hasher.finalize();
* var hash = hasher.finalize('message');
* var hash = hasher.finalize(wordArray);
*/
finalize: function(messageUpdate) {
if (messageUpdate) {
this._append(messageUpdate);
}
var hash = this._doFinalize();
return hash;
},
blockSize: 512 / 32,
/**
* Creates a shortcut function to a hasher's object interface.
*
* @param {Hasher} hasher The hasher to create a helper for.
*
* @return {Function} The shortcut function.
*
* @static
*
* @example
*
* var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
*/
_createHelper: function(hasher) {
return function(message, cfg) {
return new hasher.init(cfg).finalize(message);
};
},
/**
* Creates a shortcut function to the HMAC's object interface.
*
* @param {Hasher} hasher The hasher to use in this HMAC helper.
*
* @return {Function} The shortcut function.
*
* @static
*
* @example
*
* var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
*/
_createHmacHelper: function(hasher) {
return function(message, key) {
return new C_algo.HMAC.init(hasher, key).finalize(message);
};
}
});
var C_algo = C.algo = {};
return C;
}(Math);
return CryptoJS;
});
})(core);
return core.exports;
}
(function(module2, exports) {
(function(root, factory) {
{
module2.exports = factory(requireCore());
}
})(commonjsGlobal, function(CryptoJS) {
(function(Math2) {
var C = CryptoJS;
var C_lib = C.lib;
var WordArray = C_lib.WordArray;
var Hasher = C_lib.Hasher;
var C_algo = C.algo;
var T = [];
(function() {
for (var i = 0; i < 64; i++) {
T[i] = Math2.abs(Math2.sin(i + 1)) * 4294967296 | 0;
}
})();
var MD5 = C_algo.MD5 = Hasher.extend({
_doReset: function() {
this._hash = new WordArray.init([
1732584193,
4023233417,
2562383102,
271733878
]);
},
_doProcessBlock: function(M, offset2) {
for (var i = 0; i < 16; i++) {
var offset_i = offset2 + i;
var M_offset_i = M[offset_i];
M[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 16711935 | (M_offset_i << 24 | M_offset_i >>> 8) & 4278255360;
}
var H = this._hash.words;
var M_offset_0 = M[offset2 + 0];
var M_offset_1 = M[offset2 + 1];
var M_offset_2 = M[offset2 + 2];
var M_offset_3 = M[offset2 + 3];
var M_offset_4 = M[offset2 + 4];
var M_offset_5 = M[offset2 + 5];
var M_offset_6 = M[offset2 + 6];
var M_offset_7 = M[offset2 + 7];
var M_offset_8 = M[offset2 + 8];
var M_offset_9 = M[offset2 + 9];
var M_offset_10 = M[offset2 + 10];
var M_offset_11 = M[offset2 + 11];
var M_offset_12 = M[offset2 + 12];
var M_offset_13 = M[offset2 + 13];
var M_offset_14 = M[offset2 + 14];
var M_offset_15 = M[offset2 + 15];
var a = H[0];
var b = H[1];
var c = H[2];
var d = H[3];
a = FF(a, b, c, d, M_offset_0, 7, T[0]);
d = FF(d, a, b, c, M_offset_1, 12, T[1]);
c = FF(c, d, a, b, M_offset_2, 17, T[2]);
b = FF(b, c, d, a, M_offset_3, 22, T[3]);
a = FF(a, b, c, d, M_offset_4, 7, T[4]);
d = FF(d, a, b, c, M_offset_5, 12, T[5]);
c = FF(c, d, a, b, M_offset_6, 17, T[6]);
b = FF(b, c, d, a, M_offset_7, 22, T[7]);
a = FF(a, b, c, d, M_offset_8, 7, T[8]);
d = FF(d, a, b, c, M_offset_9, 12, T[9]);
c = FF(c, d, a, b, M_offset_10, 17, T[10]);
b = FF(b, c, d, a, M_offset_11, 22, T[11]);
a = FF(a, b, c, d, M_offset_12, 7, T[12]);
d = FF(d, a, b, c, M_offset_13, 12, T[13]);
c = FF(c, d, a, b, M_offset_14, 17, T[14]);
b = FF(b, c, d, a, M_offset_15, 22, T[15]);
a = GG(a, b, c, d, M_offset_1, 5, T[16]);
d = GG(d, a, b, c, M_offset_6, 9, T[17]);
c = GG(c, d, a, b, M_offset_11, 14, T[18]);
b = GG(b, c, d, a, M_offset_0, 20, T[19]);
a = GG(a, b, c, d, M_offset_5, 5, T[20]);
d = GG(d, a, b, c, M_offset_10, 9, T[21]);
c = GG(c, d, a, b, M_offset_15, 14, T[22]);
b = GG(b, c, d, a, M_offset_4, 20, T[23]);
a = GG(a, b, c, d, M_offset_9, 5, T[24]);
d = GG(d, a, b, c, M_offset_14, 9, T[25]);
c = GG(c, d, a, b, M_offset_3, 14, T[26]);
b = GG(b, c, d, a, M_offset_8, 20, T[27]);
a = GG(a, b, c, d, M_offset_13, 5, T[28]);
d = GG(d, a, b, c, M_offset_2, 9, T[29]);
c = GG(c, d, a, b, M_offset_7, 14, T[30]);
b = GG(b, c, d, a, M_offset_12, 20, T[31]);
a = HH(a, b, c, d, M_offset_5, 4, T[32]);
d = HH(d, a, b, c, M_offset_8, 11, T[33]);
c = HH(c, d, a, b, M_offset_11, 16, T[34]);
b = HH(b, c, d, a, M_offset_14, 23, T[35]);
a = HH(a, b, c, d, M_offset_1, 4, T[36]);
d = HH(d, a, b, c, M_offset_4, 11, T[37]);
c = HH(c, d, a, b, M_offset_7, 16, T[38]);
b = HH(b, c, d, a, M_offset_10, 23, T[39]);
a = HH(a, b, c, d, M_offset_13, 4, T[40]);
d = HH(d, a, b, c, M_offset_0, 11, T[41]);
c = HH(c, d, a, b, M_offset_3, 16, T[42]);
b = HH(b, c, d, a, M_offset_6, 23, T[43]);
a = HH(a, b, c, d, M_offset_9, 4, T[44]);
d = HH(d, a, b, c, M_offset_12, 11, T[45]);
c = HH(c, d, a, b, M_offset_15, 16, T[46]);
b = HH(b, c, d, a, M_offset_2, 23, T[47]);
a = II(a, b, c, d, M_offset_0, 6, T[48]);
d = II(d, a, b, c, M_offset_7, 10, T[49]);
c = II(c, d, a, b, M_offset_14, 15, T[50]);
b = II(b, c, d, a, M_offset_5, 21, T[51]);
a = II(a, b, c, d, M_offset_12, 6, T[52]);
d = II(d, a, b, c, M_offset_3, 10, T[53]);
c = II(c, d, a, b, M_offset_10, 15, T[54]);
b = II(b, c, d, a, M_offset_1, 21, T[55]);
a = II(a, b, c, d, M_offset_8, 6, T[56]);
d = II(d, a, b, c, M_offset_15, 10, T[57]);
c = II(c, d, a, b, M_offset_6, 15, T[58]);
b = II(b, c, d, a, M_offset_13, 21, T[59]);
a = II(a, b, c, d, M_offset_4, 6, T[60]);
d = II(d, a, b, c, M_offset_11, 10, T[61]);
c = II(c, d, a, b, M_offset_2, 15, T[62]);
b = II(b, c, d, a, M_offset_9, 21, T[63]);
H[0] = H[0] + a | 0;
H[1] = H[1] + b | 0;
H[2] = H[2] + c | 0;
H[3] = H[3] + d | 0;
},
_doFinalize: function() {
var data = this._data;
var dataWords = data.words;
var nBitsTotal = this._nDataBytes * 8;
var nBitsLeft = data.sigBytes * 8;
dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
var nBitsTotalH = Math2.floor(nBitsTotal / 4294967296);
var nBitsTotalL = nBitsTotal;
dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = (nBitsTotalH << 8 | nBitsTotalH >>> 24) & 16711935 | (nBitsTotalH << 24 | nBitsTotalH >>> 8) & 4278255360;
dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotalL << 8 | nBitsTotalL >>> 24) & 16711935 | (nBitsTotalL << 24 | nBitsTotalL >>> 8) & 4278255360;
data.sigBytes = (dataWords.length + 1) * 4;
this._process();
var hash = this._hash;
var H = hash.words;
for (var i = 0; i < 4; i++) {
var H_i = H[i];
H[i] = (H_i << 8 | H_i >>> 24) & 16711935 | (H_i << 24 | H_i >>> 8) & 4278255360;
}
return hash;
},
clone: function() {
var clone = Hasher.clone.call(this);
clone._hash = this._hash.clone();
return clone;
}
});
function FF(a, b, c, d, x, s, t) {
var n = a + (b & c | ~b & d) + x + t;
return (n << s | n >>> 32 - s) + b;
}
function GG(a, b, c, d, x, s, t) {
var n = a + (b & d | c & ~d) + x + t;
return (n << s | n >>> 32 - s) + b;
}
function HH(a, b, c, d, x, s, t) {
var n = a + (b ^ c ^ d) + x + t;
return (n << s | n >>> 32 - s) + b;
}
function II(a, b, c, d, x, s, t) {
var n = a + (c ^ (b | ~d)) + x + t;
return (n << s | n >>> 32 - s) + b;
}
C.MD5 = Hasher._createHelper(MD5);
C.HmacMD5 = Hasher._createHmacHelper(MD5);
})(Math);
return CryptoJS.MD5;
});
})(md5$1);
var md5Exports = md5$1.exports;
var md5 = /* @__PURE__ */ getDefaultExportFromCjs(md5Exports);
var passwordBooks = [
"9y16cxzg",
"sr2z1z63",
"hk2ssit3",
"acsevi4u",
"nu38i9ej",
"6m70kgre",
"hl8rvmhu",
"30uzkxp0",
"v9jggair",
"4ryav515",
"pgx6isvq",
"6b3zumy7",
"bxureygp",
"jff4xbhb",
"7j56lyfw",
"2tctuvza",
"8jfrswdr",
"r2as467y",
"jzye6ls1",
"bpi7fhat",
"ywp0p3qn",
"rzybga6p",
"84u199q5",
"kktjaqis",
"amn5oud8",
"a0zs4b52",
"x16y3u37",
"xku2lp9m",
"n8eawc7q",
"gw68xkfw",
"4wxtunev",
"ew2x6rzg",
"go9f3t54",
"7d0fkx5i",
"ai6ol58k",
"47jsslmm",
"70mxfzcz",
"b90wzl0c",
"ua78bvmr",
"7p60hdt4",
"ge5lw4u8",
"ref3rey2",
"wgay7vhx",
"b8l2u4mj",
"rk80y5ot",
"o37o4wq3",
"0moweoh0",
"r10m9bpy",
"wjilkjhj",
"il27pnod"
];
var passwordBooksSplitResult = splitArray(passwordBooks, 5);
var passwordVersion = "v2.0";
var BASE_HASH = 31;
var getPasswordVersion = function() {
return passwordVersion;
};
var generateRandomString = function(length) {
var characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
return Array.from({ length }, function() {
return characters.charAt(Math.floor(Math.random() * characters.length));
}).join("");
};
var getPasswordBook = function(key) {
var base = calculateHash(key) % passwordBooks.length;
var index2 = Math.floor(base / 5);
return passwordBooksSplitResult[index2][base % 5];
};
var crypto = function(data) {
return md5(data).toString();
};
var calculateHash = function(key) {
var result = BASE_HASH + (key === null ? 0 : calculateCharHash(key)) | 0;
return Math.abs(result);
};
var calculateCharHash = function(str) {
var result = 1;
for (var i = 0; i < str.length; i++) {
result = BASE_HASH * result + str.charCodeAt(i) | 0;
}
return result;
};
var handleQueryUrl = function(keyword) {
var params = {
f: generateRandomString(5),
g: generateRandomString(3),
r: "/company/getCompanyName",
searchKey: keyword,
t: Math.floor(Date.now() / 1e3),
v: getPasswordVersion()
};
var queryString = objectToQueryString(params);
var passwordBook = getPasswordBook(params.r.toUpperCase() + queryString);
var m = crypto("GET".concat(queryString).concat(passwordBook));
return "https://c.qcc.com/embed/api".concat(params.r, "?").concat(queryString, "&m=").concat(m);
};
var queryQccOpenAPI = function(keyword, abortController) {
return __awaiter(void 0, void 0, void 0, function() {
var url, res, json, result;
return __generator(this, function(_a) {
switch (_a.label) {
case 0:
if (keyword.length < 2 || keyword.length > 100) {
throw new Error(" keyword length must be between 2 and 100");
}
url = handleQueryUrl(keyword);
return [4, fetch(url, __assign({ method: "GET", mode: "cors", headers: {
Referer: "https://c.qcc.com/"
} }, !isUndefined$1(abortController) ? {
signal: abortController === null || abortController === void 0 ? void 0 : abortController.signal
} : null))];
case 1:
res = _a.sent();
return [4, res.json()];
case 2:
json = _a.sent();
result = [];
if (json.status !== "200") {
return [2, result];
}
return [2, json.result.map(function(item) {
var id = item.keyNo || removeHtmlTags$1(item.companyName);
return {
name: item.companyName,
id
};
})];
}
});
});
};
var queryClearBitAPI = function(keyword, abortController) {
return __awaiter(void 0, void 0, void 0, function() {
var url, res, json;
return __generator(this, function(_a) {
switch (_a.label) {
case 0:
if (keyword.length < 2 || keyword.length >= 100) {
throw new Error("keyword length must be between 2 and 100");
}
url = "https://autocomplete.clearbit.com/v1/companies/suggest?query=".concat(keyword);
return [4, fetch(url, {
method: "GET",
mode: "cors",
signal: abortController === null || abortController === void 0 ? void 0 : abortController.signal
})];
case 1:
res = _a.sent();
return [4, res.json()];
case 2:
json = _a.sent();
return [2, json.map(function(item) {
return {
name: item.name,
id: item.domain,
avatar: item.logo
};
})];
}
});
});
};
var handleQueryData = function(keyword, api, abortController) {
return __awaiter(void 0, void 0, void 0, function() {
var data, _a;
return __generator(this, function(_b) {
switch (_b.label) {
case 0:
_a = api;
switch (_a) {
case "qcc_open":
return [3, 1];
case "clearbit":
return [3, 3];
}
return [3, 5];
case 1:
return [4, queryQccOpenAPI(keyword, abortController)];
case 2:
data = _b.sent();
return [3, 6];
case 3:
return [4, queryClearBitAPI(keyword, abortController)];
case 4:
data = _b.sent();
return [3, 6];
case 5:
data = [];
return [3, 6];
case 6:
return [2, {
data
}];
}
});
});
};
var addHistory = function(company, options) {
if (!options.enabled || !options.key) {
return;
}
var storage = options.type === "localStorage" ? localStorage : sessionStorage;
var list = getHistory(options);
var index2 = list.findIndex(function(e) {
return e.id === company.id;
});
if (index2 > -1) {
list.splice(index2, 1);
}
list.splice(0, 0, company);
storage.setItem(options.key, JSON.stringify(list.length > 5 ? list.slice(0, 5) : list));
};
var getHistory = function(options) {
if (!options.enabled || !options.key) {
return [];
}
var storage = options.type === "localStorage" ? localStorage : sessionStorage;
var content = storage.getItem(options.key) || "";
return stringToJson(content);
};
var removeHistory = function(options) {
var storage = options.type === "localStorage" ? localStorage : sessionStorage;
storage.removeItem(options.key);
};
var initialOptions = {
target: "body",
api: "clearbit",
queryDelay: 500,
placeholder: "Input company name",
clearable: true,
backFill: false,
popupAppendToBody: true,
clearIcon: '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10s10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17L12 13.41L8.41 17L7 15.59L10.59 12L7 8.41L8.41 7L12 10.59L15.59 7L17 8.41L13.41 12L17 15.59z"/></svg>',
autoFocus: true,
history: {
enabled: true,
type: "localStorage",
key: "company-history",
showClear: true,
itemIcon: '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="m15.1 19.37l1 1.74c-.96.44-2.01.73-3.1.84v-2.02c.74-.09 1.44-.28 2.1-.56zM4.07 13H2.05c.11 1.1.4 2.14.84 3.1l1.74-1c-.28-.66-.47-1.36-.56-2.1zM15.1 4.63l1-1.74c-.96-.44-2-.73-3.1-.84v2.02c.74.09 1.44.28 2.1.56zM19.93 11h2.02c-.11-1.1-.4-2.14-.84-3.1l-1.74 1c.28.66.47 1.36.56 2.1zM8.9 19.37l-1 1.74c.96.44 2.01.73 3.1.84v-2.02c-.74-.09-1.44-.28-2.1-.56zM11 4.07V2.05c-1.1.11-2.14.4-3.1.84l1 1.74c.66-.28 1.36-.47 2.1-.56zm7.36 3.1l1.74-1.01c-.63-.87-1.4-1.64-2.27-2.27l-1.01 1.74c.59.45 1.1.96 1.54 1.54zM4.63 8.9l-1.74-1c-.44.96-.73 2-.84 3.1h2.02c.09-.74.28-1.44.56-2.1zm15.3 4.1c-.09.74-.28 1.44-.56 2.1l1.74 1c.44-.96.73-2.01.84-3.1h-2.02zm-3.1 5.36l1.01 1.74c.87-.63 1.64-1.4 2.27-2.27l-1.74-1.01c-.45.59-.96 1.1-1.54 1.54zM7.17 5.64l-1-1.75c-.88.64-1.64 1.4-2.27 2.28l1.74 1.01a7.7 7.7 0 0 1 1.53-1.54zM5.64 16.83l-1.74 1c.63.87 1.4 1.64 2.27 2.27l1.01-1.74a7.7 7.7 0 0 1-1.54-1.53zM13 7h-2v5.41l4.29 4.29l1.41-1.41l-3.7-3.7V7z"/></svg>',
clearIcon: '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M15 2h-3.5l-1-1h-5l-1 1H1v2h14zm1 7c-.7 0-1.37.1-2 .29V5H2v12c0 1.1.9 2 2 2h5.68A6.999 6.999 0 0 0 23 16c0-3.87-3.13-7-7-7zm-7 7c0 .34.03.67.08 1H4V7h8v3.26c-1.81 1.27-3 3.36-3 5.74zm7 5c-2.76 0-5-2.24-5-5s2.24-5 5-5s5 2.24 5 5s-2.24 5-5 5z"/><path fill="currentColor" d="M16.5 12H15v5l3.6 2.1l.8-1.2l-2.9-1.7z"/></svg>'
},
onInput: function() {
},
onChange: function() {
},
onFetch: function() {
},
onAbortFetch: function() {
},
onSelect: function() {
},
onClear: function() {
},
onFocus: function() {
},
onBlur: function() {
},
onSubmit: function() {
},
onDropdownVisibleChange: function() {
},
showSubmitButton: true,
submitButtonLabel: "Submit",
offsetTop: 5,
autoFlip: false
// direction: 'ltr'
};
var index = /* @__PURE__ */ Object.freeze({
__proto__: null,
addHistory,
getHistory,
getImageData,
handleAvatar,
handleQueryData,
initialOptions,
removeHistory
});
(module.exports == null ? {} : module.exports).default || module.exports;
var isUndefined2 = function(value) {
return value === void 0;
};
var isNil = function(value) {
return value == null || value === void 0;
};
function throttle(callback, wait, _a) {
if (wait === void 0) {
wait = 0;
}
var _b = _a === void 0 ? {} : _a, _c = _b.start, start = _c === void 0 ? true : _c, _d = _b.middle, middle = _d === void 0 ? true : _d, _e = _b.once, once = _e === void 0 ? false : _e;
var innerStart = start;
var last = 0;
var timer;
var cancelled = false;
function fn() {
var _this = this;
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
if (cancelled)
return;
var delta = Date.now() - last;
last = Date.now();
if (start && middle && delta >= wait) {
innerStart = true;
}
if (innerStart) {
innerStart = false;
callback.apply(this, args);
if (once)
fn.cancel();
} else if (middle && delta < wait || !middle) {
clearTimeout(timer);
timer = setTimeout(function() {
last = Date.now();
callback.apply(_this, args);
if (once)
fn.cancel();
}, !middle ? wait : wait - delta);
}
}
fn.cancel = function() {
clearTimeout(timer);
cancelled = true;
};
return fn;
}
function debounce(callback, wait, _a) {
if (wait === void 0) {
wait = 0;
}
var _b = {}, _c = _b.start, start = _c === void 0 ? false : _c, _d = _b.middle, middle = _d === void 0 ? false : _d, _e = _b.once, once = _e === void 0 ? false : _e;
return throttle(callback, wait, { start, middle, once });
}
var removeHtmlTags2 = function(str) {
return str.replace(/(<([^>]+)>)/gi, "");
};
const min = Math.min;
const max = Math.max;
const round = Math.round;
const floor = Math.floor;
const createCoords = (v) => ({
x: v,
y: v
});
const oppositeSideMap = {
left: "right",
right: "left",
bottom: "top",
top: "bottom"
};
const oppositeAlignmentMap = {
start: "end",
end: "start"
};
function evaluate(value, param) {
return typeof value === "function" ? value(param) : value;
}
function getSide(placement) {
return placement.split("-")[0];
}
function getAlignment(placement) {
return placement.split("-")[1];
}
function getOppositeAxis(axis) {
return axis === "x" ? "y" : "x";
}
function getAxisLength(axis) {
return axis === "y" ? "height" : "width";
}
function getSideAxis(placement) {
return ["top", "bottom"].includes(getSide(placement)) ? "y" : "x";
}
function getAlignmentAxis(placement) {
return getOppositeAxis(getSideAxis(placement));
}
function getAlignmentSides(placement, rects, rtl) {
if (rtl === void 0) {
rtl = false;
}
const alignment = getAlignment(placement);
const alignmentAxis = getAlignmentAxis(placement);
const length = getAxisLength(alignmentAxis);
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
if (rects.reference[length] > rects.floating[length]) {
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
}
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
}
function getExpandedPlacements(placement) {
const oppositePlacement = getOppositePlacement(placement);
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
}
function getOppositeAlignmentPlacement(placement) {
return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
}
function getSideList(side, isStart, rtl) {
const lr = ["left", "right"];
const rl = ["right", "left"];
const tb = ["top", "bottom"];
const bt = ["bottom", "top"];
switch (side) {
case "top":
case "bottom":
if (rtl)
return isStart ? rl : lr;
return isStart ? lr : rl;
case "left":
case "right":
return isStart ? tb : bt;
default:
return [];
}
}
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
const alignment = getAlignment(placement);
let list = getSideList(getSide(placement), direction === "start", rtl);
if (alignment) {
list = list.map((side) => side + "-" + alignment);
if (flipAlignment) {
list = list.concat(list.map(getOppositeAlignmentPlacement));
}
}
return list;
}
function getOppositePlacement(placement) {
return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
}
function expandPaddingObject(padding) {
return {
top: 0,
right: 0,
bottom: 0,
left: 0,
...padding
};
}
function getPaddingObject(padding) {
return typeof padding !== "number" ? expandPaddingObject(padding) : {
top: padding,
right: padding,
bottom: padding,
left: padding
};
}
function rectToClientRect(rect) {
const {
x,
y,
width,
height
} = rect;
return {
width,
height,
top: y,
left: x,
right: x + width,
bottom: y + height,
x,
y
};
}
function computeCoordsFromPlacement(_ref, placement, rtl) {
let {
reference,
floating
} = _ref;
const sideAxis = getSideAxis(placement);
const alignmentAxis = getAlignmentAxis(placement);
const alignLength = getAxisLength(alignmentAxis);
const side = getSide(placement);
const isVertical = sideAxis === "y";
const commonX = reference.x + reference.width / 2 - floating.width / 2;
const commonY = reference.y + reference.height / 2 - floating.height